...
|
...
|
@@ -126,6 +126,7 @@ |
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
<image class="home" @click="goHome" src="/static/home.png" mode=""></image>
|
|
|
<view class="share" v-if="shareModel" @click="shareModel=false">
|
|
|
<image src="../../static/detailShare.png" mode=""></image>
|
|
|
<view class="">
|
...
|
...
|
@@ -136,7 +137,7 @@ |
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
var jweixin = require('jweixin-module');
|
|
|
var jweixin = require('jweixin-module');
|
|
|
import {
|
|
|
product_detail,
|
|
|
product_favorite,
|
...
|
...
|
@@ -158,7 +159,8 @@ |
|
|
sort: {
|
|
|
name: ""
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
jssdk:{},
|
|
|
list1: [], //轮播图
|
|
|
range: [{
|
|
|
value: 0,
|
...
|
...
|
@@ -190,9 +192,27 @@ |
|
|
this.report_list()
|
|
|
},
|
|
|
methods: {
|
|
|
goHome(){
|
|
|
uni.reLaunch({
|
|
|
url:'/pages/index/index'
|
|
|
})
|
|
|
},
|
|
|
share(){
|
|
|
let that = this;
|
|
|
jweixin.config({
|
|
|
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
|
appId: that.jssdk.appId, // 必填,公众号的唯一标识
|
|
|
timestamp: that.jssdk.timestamp, // 必填,生成签名的时间戳
|
|
|
nonceStr: that.jssdk.nonceStr, // 必填,生成签名的随机串
|
|
|
signature: that.jssdk.signature, // 必填,签名
|
|
|
jsApiList: that.jssdk.jsApiList // 必填,需要使用的JS接口列表
|
|
|
})
|
|
|
jweixin.error(function(res) {
|
|
|
console.log(res, '错误')
|
|
|
});
|
|
|
console.log('分享了',that.jssdk.signature);
|
|
|
jweixin.ready(function() {
|
|
|
|
|
|
//分享给朋友
|
|
|
jweixin.onMenuShareAppMessage({
|
|
|
title: that.detail.name, // 分享标题
|
...
|
...
|
@@ -257,7 +277,7 @@ |
|
|
this.show = false
|
|
|
},
|
|
|
change(e) {
|
|
|
console.log("e:", e);
|
|
|
// console.log("e:", e);
|
|
|
},
|
|
|
//选中效果
|
|
|
choosritem(name, id) {
|
...
|
...
|
@@ -322,11 +342,12 @@ |
|
|
}
|
|
|
},
|
|
|
//详情
|
|
|
async product_detail() {
|
|
|
async product_detail() {
|
|
|
try {
|
|
|
const res = await product_detail(this.id)
|
|
|
const res = await product_detail(this.id,window.location.href)
|
|
|
console.log('product_detail', res)
|
|
|
this.detail = res.detail
|
|
|
this.detail = res.detail
|
|
|
this.jssdk = res.jssdk
|
|
|
this.list1 = res.detail.images_preview
|
|
|
this.share()
|
|
|
// 保存数据
|
...
|
...
|
@@ -343,7 +364,8 @@ |
|
|
uni.navigateTo({
|
|
|
url: "/pages/index/buy?id=" + this.id
|
|
|
})
|
|
|
},
|
|
|
},
|
|
|
|
|
|
},
|
|
|
}
|
|
|
</script>
|
...
|
...
|
@@ -670,5 +692,12 @@ |
|
|
font-size: 36rpx;
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
}
|
|
|
.home {
|
|
|
width: 96rpx;
|
|
|
height: 96rpx;
|
|
|
position: fixed;
|
|
|
right: 28rpx;
|
|
|
bottom: 186rpx;
|
|
|
}
|
|
|
</style> |
...
|
...
|
|