|
@@ -266,35 +266,35 @@
|
|
|
<!-- #ifndef MP -->
|
|
|
<button class="item" hover-class="none" v-if="weixinStatus === true" @click="H5ShareBox = true">
|
|
|
<view class="iconfont icon-weixin3"></view>
|
|
|
- <view class="">{{$t(`发送给朋友`)}}</view>
|
|
|
+ <view class="">{{ $t(`发送给朋友`) }}</view>
|
|
|
</button>
|
|
|
<!-- #endif -->
|
|
|
<!-- #ifdef MP -->
|
|
|
<button class="item" open-type="share" hover-class="none" @click="goFriend">
|
|
|
<view class="iconfont icon-weixin3"></view>
|
|
|
- <view class="">{{$t(`发送给朋友`)}}</view>
|
|
|
+ <view class="">{{ $t(`发送给朋友`) }}</view>
|
|
|
</button>
|
|
|
<!-- #endif -->
|
|
|
<!-- #ifdef H5 -->
|
|
|
<div class="item copy-data" v-if="storeInfo.command_word != ''"
|
|
|
:data-clipboard-text="storeInfo.command_word">
|
|
|
<view class="iconfont icon-fuzhikouling"></view>
|
|
|
- <text>{{$t(`复制口令`)}}</text>
|
|
|
+ <text>{{ $t(`复制口令`) }}</text>
|
|
|
</div>
|
|
|
<!-- #endif -->
|
|
|
<!-- #ifdef APP-PLUS -->
|
|
|
<view class="item" @click="appShare('WXSceneSession')">
|
|
|
<view class="iconfont icon-weixin3"></view>
|
|
|
- <view class="">{{$t(`微信好友`)}}</view>
|
|
|
+ <view class="">{{ $t(`微信好友`) }}</view>
|
|
|
</view>
|
|
|
<view class="item" @click="appShare('WXSenceTimeline')">
|
|
|
<view class="iconfont icon-pengyouquan"></view>
|
|
|
- <view class="">{{$t(`微信朋友圈`)}}</view>
|
|
|
+ <view class="">{{ $t(`微信朋友圈`) }}</view>
|
|
|
</view>
|
|
|
<!-- #endif -->
|
|
|
<button class="item" hover-class="none" @click="goPoster">
|
|
|
<view class="iconfont icon-haibao"></view>
|
|
|
- <view class="">{{$t(`生成海报`)}}</view>
|
|
|
+ <view class="">{{ $t(`生成海报`) }}</view>
|
|
|
</button>
|
|
|
</view>
|
|
|
<!-- 分享按钮 -->
|
|
@@ -333,7 +333,7 @@
|
|
|
let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
|
|
import {
|
|
|
getGoodsDetail, getUserAddressByUserId, postBeforeCheck, getAvailableCheck
|
|
|
- ,postLinkedUrl
|
|
|
+ , postLinkedUrl
|
|
|
} from "@/api/home.js";
|
|
|
import {
|
|
|
getProductDetail,
|
|
@@ -452,6 +452,7 @@ export default {
|
|
|
posterImage: "", //海报路径
|
|
|
posterbackgd: "/static/images/posterbackgd.png",
|
|
|
sharePacket: {
|
|
|
+ isCanShare: false, //是否可以分享
|
|
|
isState: false, //默认不显示
|
|
|
}, //分销商详细
|
|
|
circular: false,
|
|
@@ -505,6 +506,8 @@ export default {
|
|
|
selectSku: {},
|
|
|
currentPage: false,
|
|
|
svip_price_open: 1,
|
|
|
+ promotionNo: '',
|
|
|
+ promotionShare: ''
|
|
|
};
|
|
|
},
|
|
|
computed: mapGetters(["isLogin", "uid", "userInfo", "selectAddr"]),
|
|
@@ -534,9 +537,10 @@ export default {
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
uni.hideShareMenu();
|
|
|
+ console.log(options.inviteCode);
|
|
|
// 判断是否登录
|
|
|
if (!this.isLogin) {
|
|
|
- if (options.inviteCode != "undefined") {
|
|
|
+ if (options.inviteCode) {
|
|
|
this.$Cache.set('INVITE_CODE', options.inviteCode);
|
|
|
}
|
|
|
uni.showToast({
|
|
@@ -551,17 +555,14 @@ export default {
|
|
|
})
|
|
|
}, 1500);
|
|
|
} else {
|
|
|
- let userInfo = this.$Cache.get("USER_INFO", true)
|
|
|
- console.log("用户自己的推荐码:" + userInfo.code);
|
|
|
console.log("受邀的推荐码:" + options.inviteCode);
|
|
|
//1580 进入时
|
|
|
if (options.zoneType == 8) {
|
|
|
- //判断是否为自己的要求码进入
|
|
|
- if (options.inviteCode !== userInfo.code) {
|
|
|
- if (options.inviteCode != "undefined") {
|
|
|
- this.$Cache.set('INVITE_CODE', options.inviteCode);
|
|
|
- }
|
|
|
+ if (options.inviteCode) {
|
|
|
+ this.promotionNo = options.inviteCode
|
|
|
}
|
|
|
+ console.log("界面跳转的邀请码:" + this.promotionNo);
|
|
|
+ this.listenerActionSheet()
|
|
|
}
|
|
|
let that = this;
|
|
|
var pages = getCurrentPages();
|
|
@@ -650,16 +651,14 @@ export default {
|
|
|
* 用户点击右上角分享
|
|
|
*/
|
|
|
// #ifdef MP
|
|
|
- onShareAppMessage: function () {
|
|
|
+ onShareAppMessage: function (res) {
|
|
|
let that = this;
|
|
|
// 校验是否可以分享(先购买产品)
|
|
|
- postLinkedUrl().then(res =>{
|
|
|
- return {
|
|
|
- title: that.storeInfo.goodsName || "",
|
|
|
- imageUrl: "http://wine.gzzzyd.com/test/static/img/bg.a82f9752.jpg" ||that.storeInfo.image,
|
|
|
- path: "/pages/goods_details/index?id=" + that.id + "&inviteCode=" + that.$Cache.get("USER_INFO", true).code,
|
|
|
- };
|
|
|
- })
|
|
|
+ return {
|
|
|
+ title: that.storeInfo.goodsName || "",
|
|
|
+ imageUrl: "http://wine.gzzzyd.com/test/static/img/bg.a82f9752.jpg" || that.storeInfo.image,
|
|
|
+ path: "/pages/goods_details/index?id=" + that.id + "&inviteCode=" + that.promotionShare,
|
|
|
+ };
|
|
|
},
|
|
|
|
|
|
// #endif
|
|
@@ -952,7 +951,6 @@ export default {
|
|
|
that.storeInfo = res.data
|
|
|
// 处理分享
|
|
|
if (that.storeInfo.zoneType == 8) {
|
|
|
- uni.showShareMenu();
|
|
|
that.sharePacket.isState = true
|
|
|
}
|
|
|
that.skuArr = storeInfo.goodsSpecList
|
|
@@ -1357,10 +1355,21 @@ export default {
|
|
|
toLogin();
|
|
|
} else {
|
|
|
// 校验是否可以分享(先购买产品)
|
|
|
- postLinkedUrl().then(res =>{
|
|
|
- // this.downloadFilePromotionCode();
|
|
|
- // this.posters = true;
|
|
|
- })
|
|
|
+ if (!this.sharePacket.isCanShare) {
|
|
|
+ postLinkedUrl().then(res => {
|
|
|
+ uni.showShareMenu();
|
|
|
+ this.sharePacket.isCanShare = true
|
|
|
+ //判断是否为自己的要求码进入
|
|
|
+ if (this.promotionNo !== res.data.promotionNo) {
|
|
|
+ if (this.promotionNo) {
|
|
|
+ this.$Cache.set('INVITE_CODE', res.data.promotionNo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.promotionShare = res.data.promotionNo
|
|
|
+ // this.downloadFilePromotionCode();
|
|
|
+ // this.posters = true;
|
|
|
+ })
|
|
|
+ }
|
|
|
// if (this.posterImage) {
|
|
|
// this.posters = true;
|
|
|
// return
|