Commit bd5afcff by 李伟康

commit

1 parent 8338349e
......@@ -2,7 +2,9 @@ import { shopmallApi, activityApi, couponApi, liveApi, boutiquecouponApi, equity
const { environment } = window.$fetchConfig
export default {
data() {
return {}
return {
entry: ''
}
},
mounted() {
if (this.$route.meta.isTab) this.wxInit()
......@@ -13,11 +15,12 @@ export default {
wxConfig.init(['shareAppMessage', 'sendChatMessage', 'getCurExternalContact', 'getContext']).then(() => {
wxConfig.getContext().then(({ entry }) => {
_this.$parent.entry = entry
_this.entry = entry
})
})
},
showShareModel(i) {
let { tabIndex } = this
let { tabIndex, entry } = this
if (tabIndex == 0 && i.remainAmount < 1) return
if (tabIndex == 1 && i.residueAmount < 1) return
wxConfig
......@@ -27,15 +30,15 @@ export default {
i.is_contact = res
this.sendMessage(i)
})
.catch(err => {
.catch(() => {
this.sendMessage(i)
})
},
sendMessage(i) {
let { merchantId } = this.getLocalStorage('dj_scrm_userInfo')
let { tabIndex } = this
let { tabIndex, entry } = this
let { name } = this.$route
let { is_contact, userId, id, couponName, activityName, packageName, goodsName, goodsImage } = i
let { userId, id, couponName, activityName, packageName, goodsName, goodsImage } = i
let shopmall_appId = environment == 'beta' ? 'wx9f91c1ec493eb425' : 'wxe10067a63c1856ac'
let dj_appId = 'wx06d1198e751435d1'
this.showLoading()
......@@ -46,7 +49,7 @@ export default {
let desc = '您的专属服务顾问为您发来了优惠券,请点击领取~'
let imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png'
if (tabIndex == 0) {
if (is_contact)
if (entry != 'normal')
this.sendChatMessage({
appid: dj_appId,
title: couponName,
......@@ -60,7 +63,7 @@ export default {
}
} else {
this.couponShare(i, res => {
if (is_contact)
if (entry != 'normal')
this.sendChatMessage({
appid: shopmall_appId,
title: packageName,
......@@ -77,7 +80,7 @@ export default {
case 'activity': {
if (tabIndex == 0) {
let imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-ms-10004.png'
if (is_contact)
if (entry != 'normal')
this.sendChatMessage({
appid: shopmall_appId,
title: activityName,
......@@ -97,7 +100,7 @@ export default {
case 'merchant': {
if (tabIndex == 0) {
let imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-qy-10004.png'
if (is_contact)
if (entry != 'normal')
this.sendChatMessage({
appid: shopmall_appId,
title: packageName,
......@@ -110,7 +113,7 @@ export default {
})
}
} else {
if (is_contact)
if (entry != 'normal')
this.sendChatMessage({
appid: shopmall_appId,
title: goodsName,
......@@ -164,15 +167,15 @@ export default {
return unicodeStr
},
couponShare(item, callBack) {
let { userId, id } = item
let { is_contact, id } = item
let obj = {
couponId: id,
shareType: 1
}
if (userId)
if (is_contact)
obj.userList = [
{
userId
userId: is_contact
}
]
else obj.shareType = 0
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!