...
|
...
|
@@ -13,7 +13,7 @@ |
|
|
<image src="../../static/heart.png" mode="" v-if="detail.is_fav==0" @click="product_favorite">
|
|
|
</image>
|
|
|
<image src="../../static/1.png" mode="" v-else @click="product_favorite"></image>
|
|
|
<image src="../../static/share.png" mode=""></image>
|
|
|
<image src="../../static/share.png" @click="shareModel=true" mode=""></image>
|
|
|
<image src="../../static/result.png" mode="" @click="show = true"></image>
|
|
|
</view>
|
|
|
</view>
|
...
|
...
|
@@ -125,12 +125,18 @@ |
|
|
</scroll-view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
</u-popup>
|
|
|
<view class="share" v-if="shareModel" @click="shareModel=false">
|
|
|
<image src="../../static/detailShare.png" mode=""></image>
|
|
|
<view class="">
|
|
|
点击这里进行分享
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
let jweixin = require('jweixin-module')
|
|
|
<script>
|
|
|
var jweixin = require('jweixin-module');
|
|
|
import {
|
|
|
product_detail,
|
|
|
product_favorite,
|
...
|
...
|
@@ -171,16 +177,78 @@ |
|
|
isshow: false,
|
|
|
isshowname: "请选择",
|
|
|
isid: "",
|
|
|
content: "",
|
|
|
content: "",
|
|
|
shareModel:false
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
|
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.id = options.id
|
|
|
this.product_detail()
|
|
|
this.report_list()
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
methods: {
|
|
|
share(){
|
|
|
let that = this;
|
|
|
jweixin.ready(function() {
|
|
|
//分享给朋友
|
|
|
jweixin.onMenuShareAppMessage({
|
|
|
title: that.detail.name, // 分享标题
|
|
|
link: window.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
|
imgUrl: that.detail.images_preview[0], // 分享图标
|
|
|
success: function() {
|
|
|
// 用户点击了分享后执行的回调函数
|
|
|
uni.showToast({
|
|
|
title: '分享成功',
|
|
|
duration: 2000
|
|
|
});
|
|
|
},
|
|
|
cancel: function(res) {
|
|
|
console.log('取消分享')
|
|
|
}
|
|
|
});
|
|
|
jweixin.updateAppMessageShareData({
|
|
|
title: that.detail.name, // 分享标题
|
|
|
link: window.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
|
imgUrl: that.detail.images_preview[0], // 分享图标
|
|
|
success: function() {
|
|
|
console.log('设置分享给朋友成功')
|
|
|
},
|
|
|
cancel: function(res) {
|
|
|
console.log('取消分享')
|
|
|
}
|
|
|
});
|
|
|
//分享到朋友圈
|
|
|
jweixin.onMenuShareTimeline({
|
|
|
title: that.detail.name, // 分享标题
|
|
|
link: window.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
|
imgUrl: that.detail.images_preview[0], // 分享图标
|
|
|
success: function() {
|
|
|
// 用户点击了分享后执行的回调函数
|
|
|
uni.showToast({
|
|
|
title: '分享成功',
|
|
|
duration: 2000
|
|
|
});
|
|
|
},
|
|
|
cancel: function(res) {
|
|
|
console.log('取消分享')
|
|
|
}
|
|
|
});
|
|
|
jweixin.updateTimelineShareData({
|
|
|
title: that.detail.name, // 分享标题
|
|
|
link: window.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
|
imgUrl: that.detail.images_preview[0], // 分享图标
|
|
|
success: function() {
|
|
|
console.log('设置分享到朋友圈成功')
|
|
|
},
|
|
|
cancel: function(res) {
|
|
|
console.log('取消分享')
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
showbox() {
|
|
|
this.isshow = !this.isshow
|
|
|
},
|
...
|
...
|
@@ -259,7 +327,8 @@ |
|
|
const res = await product_detail(this.id)
|
|
|
console.log('product_detail', res)
|
|
|
this.detail = res.detail
|
|
|
this.list1 = res.detail.images_preview
|
|
|
this.list1 = res.detail.images_preview
|
|
|
this.share()
|
|
|
// 保存数据
|
|
|
} catch (err) {
|
|
|
uni.showToast({
|
...
|
...
|
@@ -578,5 +647,28 @@ |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
.share {
|
|
|
position: fixed;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
background: rgba(0,0,0,.6);
|
|
|
image {
|
|
|
position: fixed;
|
|
|
right: 80rpx;
|
|
|
top: 4rpx;
|
|
|
width: 188rpx;
|
|
|
height: 262rpx;
|
|
|
}
|
|
|
view {
|
|
|
position: fixed;
|
|
|
right: 80rpx;
|
|
|
top: 300rpx;
|
|
|
color: rgba(255,255,255,1);
|
|
|
font-size: 36rpx;
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
}
|
|
|
</style> |
...
|
...
|
|