|
|
@ -465,6 +465,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
options: {}, |
|
|
|
timestamp: new Date().getTime(), |
|
|
|
timestamp: new Date().getTime(), |
|
|
|
goods_sku_no: "", |
|
|
|
goods_sku_no: "", |
|
|
|
isTodo: false, |
|
|
|
isTodo: false, |
|
|
@ -529,6 +530,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
onLoad(options) { |
|
|
|
const that = this; |
|
|
|
const that = this; |
|
|
|
|
|
|
|
that.options = options; |
|
|
|
let result = uni.getStorageSync("addressResult") |
|
|
|
let result = uni.getStorageSync("addressResult") |
|
|
|
this.addressResult = result ? result.address_component : this.addressResult |
|
|
|
this.addressResult = result ? result.address_component : this.addressResult |
|
|
|
this.isPre = options.isPre ? options.isPre : null |
|
|
|
this.isPre = options.isPre ? options.isPre : null |
|
|
@ -1100,10 +1102,18 @@ |
|
|
|
this.isTodo = true; |
|
|
|
this.isTodo = true; |
|
|
|
this.openDialog = false; |
|
|
|
this.openDialog = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
toHaibao(index) { |
|
|
|
//获取短连接 |
|
|
|
this.shareCancel(); |
|
|
|
async toQueryShortUrl() { |
|
|
|
if (index == 2) { |
|
|
|
// 获取推荐商品列表 |
|
|
|
let str = `型号:${this.goods.goods_name}\n前台价:¥${this.goods.goods_price_max}元\n推广价:¥${this.goods.goods_price_min}元\nSKU:${this.goods.goods_no}\n京东链接:https://item.jd.com/${this.goods.goods_no}.html` |
|
|
|
const that = this; |
|
|
|
|
|
|
|
// 构建页面参数 |
|
|
|
|
|
|
|
const params = that.$getShareUrlParams(this.options) |
|
|
|
|
|
|
|
const res = await GoodsApi.goodsShortUrl({ |
|
|
|
|
|
|
|
page_url: `pages/goods/detail?${params}`, |
|
|
|
|
|
|
|
page_title: that.goods.goods_name |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
if(res.data.url){ |
|
|
|
|
|
|
|
let str = `型号:${that.goods.goods_name}\n前台价:¥${that.goods.goods_price_max}元\n推广价:¥${that.goods.goods_price_min}元\nSKU:${that.goods.goods_no}\n小程序链接:${res.data.url}` |
|
|
|
uni.setClipboardData({ |
|
|
|
uni.setClipboardData({ |
|
|
|
data: str, // 这里是个坑接受字符串类型 value转化为字符串 |
|
|
|
data: str, // 这里是个坑接受字符串类型 value转化为字符串 |
|
|
|
success: function() { |
|
|
|
success: function() { |
|
|
@ -1115,6 +1125,20 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: '复制失败', |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
toHaibao(index) { |
|
|
|
|
|
|
|
this.shareCancel(); |
|
|
|
|
|
|
|
if (index == 2) { |
|
|
|
|
|
|
|
this.toQueryShortUrl(); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.openDialog = false |
|
|
|
this.openDialog = false |
|
|
|
this.showGoodsPosterPopup = true; |
|
|
|
this.showGoodsPosterPopup = true; |
|
|
@ -1127,9 +1151,7 @@ |
|
|
|
onShareAppMessage() { |
|
|
|
onShareAppMessage() { |
|
|
|
const app = this |
|
|
|
const app = this |
|
|
|
// 构建页面参数 |
|
|
|
// 构建页面参数 |
|
|
|
const params = app.$getShareUrlParams({ |
|
|
|
const params = app.$getShareUrlParams(this.options) |
|
|
|
goodsId: app.goodsId, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
title: app.goods.goods_name, |
|
|
|
title: app.goods.goods_name, |
|
|
|
imageUrl: app.goods.goods_image, |
|
|
|
imageUrl: app.goods.goods_image, |
|
|
@ -1144,10 +1166,11 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
onShareTimeline() { |
|
|
|
onShareTimeline() { |
|
|
|
const app = this |
|
|
|
const app = this |
|
|
|
|
|
|
|
const params = app.$getShareUrlParams(this.options) |
|
|
|
return { |
|
|
|
return { |
|
|
|
title: app.goods.goods_name, |
|
|
|
title: app.goods.goods_name, |
|
|
|
imageUrl: app.goods.goods_image, |
|
|
|
imageUrl: app.goods.goods_image, |
|
|
|
path: `/pages/goods/detail?goodsId=${app.goodsId}` |
|
|
|
path: `/pages/goods/detail?${params}` |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|