|
|
@@ -11,7 +11,7 @@
|
|
|
<text v-if="Number(data.discountPrice) > 0">【特价】</text>
|
|
|
{{ data.name }}
|
|
|
</view>
|
|
|
- <button class="tui-share-btn tui-share-position">
|
|
|
+ <button open-type="share" class="tui-share-btn tui-share-position">
|
|
|
<app-tag type="gray" tui-tag-class="tui-tag-share tui-size" shape="circleLeft" size="small" >
|
|
|
<view class="flex-center">
|
|
|
<i class="iconfont iconfenxiang"></i>
|
|
|
@@ -43,7 +43,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<sel-popup :show="popupShow" :info="data" :buyNum="buyNum" @change="changeNum" @close="hidePopup" @nextFn="nextFn" />
|
|
|
- <buy-foot @buy="showPopup" :stock="data.stock" />
|
|
|
+ <buy-foot @buy="showPopup" :stock="data.stock" @goShop="goShopIndex()" />
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -58,9 +58,10 @@ import { mapGetters } from "vuex";
|
|
|
import { getMallItemInfo } from "@/api/item";
|
|
|
import { getHdInfo } from "@/api/hd";
|
|
|
import productMins from "@/mixins/cgProduct";
|
|
|
+import { share } from "@/mixins";
|
|
|
export default {
|
|
|
name: "detail",
|
|
|
- mixins: [productMins],
|
|
|
+ mixins: [productMins,share],
|
|
|
components: {
|
|
|
AppSwiper,
|
|
|
AppTag,
|
|
|
@@ -109,6 +110,9 @@ export default {
|
|
|
this.addItemEvent(customData)
|
|
|
this.$util.pageTo({url:"/pages/billing/affirmGhs?account="+this.option.account,type:2})
|
|
|
},
|
|
|
+ goShopIndex(){
|
|
|
+ this.$util.pageTo({url:"/pages/item/item?account="+this.option.account,type:2})
|
|
|
+ },
|
|
|
init() {
|
|
|
let that = this
|
|
|
//扫码进来
|
|
|
@@ -123,7 +127,6 @@ export default {
|
|
|
value = arr[1];
|
|
|
sceneArray[name] = value;
|
|
|
}
|
|
|
- console.log(sceneArray)
|
|
|
let id = sceneArray.id ? sceneArray.id : 0
|
|
|
let account = sceneArray.a ? sceneArray.a : 0
|
|
|
this.option.account = account
|
|
|
@@ -131,7 +134,7 @@ export default {
|
|
|
uni.setStorageSync('account',account)
|
|
|
getHdInfo().then(res=>{
|
|
|
if(res.code == 1){
|
|
|
- that.getItemDetail(id)
|
|
|
+ that.getItemDetail(id,account)
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
@@ -139,11 +142,11 @@ export default {
|
|
|
}
|
|
|
}else{
|
|
|
let id = this.option.id ? this.option.id : 0
|
|
|
- //let account = this.option.account ? this.option.account : 0
|
|
|
- that.getItemDetail(id)
|
|
|
+ let account = this.option.account ? this.option.account : 0
|
|
|
+ that.getItemDetail(id,account)
|
|
|
}
|
|
|
},
|
|
|
- getItemDetail(id){
|
|
|
+ getItemDetail(id,account){
|
|
|
getMallItemInfo({id: id}).then(res => {
|
|
|
if (this.$util.isEmpty(res.data)){
|
|
|
return false
|
|
|
@@ -152,6 +155,19 @@ export default {
|
|
|
let newArr = [];
|
|
|
newArr.push({img: this.data.bigCover});
|
|
|
this.imgList = newArr;
|
|
|
+
|
|
|
+ let skPrice = this.data.skPrice ? parseFloat(this.data.skPrice) : 0
|
|
|
+ let title = this.data.name+' ¥'+skPrice
|
|
|
+ if(this.data.discountPrice && Number(this.data.discountPrice) > 0){
|
|
|
+ title = '【特价】'+title
|
|
|
+ }
|
|
|
+ let shareParams = {
|
|
|
+ title: title,
|
|
|
+ desc: skPrice,
|
|
|
+ imgUrl: this.data.cover,
|
|
|
+ pagePath: `pages/item/detail?id=${id}&account=${account}`
|
|
|
+ };
|
|
|
+ this.jweixinFn(shareParams)
|
|
|
})
|
|
|
},
|
|
|
changeNum(e) {
|