Commit 71504154 by 前端

Merge branch 'dev_v3.2.0' into 'master'

Dev v3.2.0

See merge request !17
2 parents 7f45c59b ab78f7f1
......@@ -11,7 +11,7 @@ module.exports = {
envVersion: 'trial',
title: '嘀加企微管家',
request: {
baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间
timeout: 180000,
// 携带凭证
......
import { wxConfig, bigdatautilApi } from '@/api'
export default {
data() {
data () {
return {
entry: 'normal'
}
},
mounted() {
mounted () {
if (this.$route.meta.isTab || this.$route.meta.isIndex) this.wxInit()
// wxConfig
// .createMiniprogramUrlLink({
......@@ -19,7 +19,7 @@ export default {
// })
},
methods: {
wxInit() {
wxInit () {
let _this = this
wxConfig.init(['shareAppMessage', 'sendChatMessage', 'getCurExternalContact', 'getContext']).then(() => {
wxConfig.getContext().then(({ entry }) => {
......@@ -31,7 +31,7 @@ export default {
iosTimeFormat (time) {
return time.replace(/\-/g, '/')
},
showShareModel(i = {}) {
showShareModel (i = {}) {
let {
tabIndex,
$route: { name }
......@@ -51,7 +51,7 @@ export default {
this.sendMessage(i)
})
},
sendMessage(i) {
sendMessage (i) {
const {
shopmall_appid,
request: { baseURL }
......@@ -65,22 +65,22 @@ export default {
const entryType = entry != 'normal'
this.showLoading()
let params = {
coupon: {
path: 'packageMine/pages/boutique/gift/gift',
desc: '您的专属服务顾问为您发来了优惠券,请点击领取~',
imgUrl: 'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png'
},
activity: {
path: 'packageMall/pages/detail/detail',
desc: '您有一个秒杀活动可参加',
imgUrl: 'http://img01.glsx.com.cn/upload/biz/dracMini-ms-10004.png'
},
merchant: {
path: 'pages/tab/index/index',
desc: '',
imgUrl: 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg'
}
}[name],
coupon: {
path: 'packageMine/pages/boutique/gift/gift',
desc: '您的专属服务顾问为您发来了优惠券,请点击领取~',
imgUrl: 'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png'
},
activity: {
path: 'packageMall/pages/detail/detail',
desc: '您有一个秒杀活动可参加',
imgUrl: 'http://img01.glsx.com.cn/upload/biz/dracMini-ms-10004.png'
},
merchant: {
path: 'pages/tab/index/index',
desc: '',
imgUrl: 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg'
}
}[name],
title = {
coupon: couponName,
activity: activityName,
......@@ -90,9 +90,10 @@ export default {
if (name === 'coupon') {
/**卡券 */
if (tabIndex == 0) {
if(!sapCode) params.path = 'packageShopmall/packageMine/pages/boutique/gift/gift'
query = `id=${id}&userId=${userId}&employName=${this.toUnicode(i.employeeName)}&${query}`
} else {
params.path = 'packageMall/pages/coupon/coupon'
params.path = !sapCode ? 'packageShopmall/packageMall/pages/coupon/coupon' : 'packageMall/pages/coupon/coupon'
query = `couponId=${id}&${query}&issueName=${this.toUnicode(userName)}&issueDate=${new Date().getTime()}&shareSource=1&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}`
title = `${couponName}(${window.$discountType[discountType]}券)`
this.couponShare(i)
......@@ -104,6 +105,7 @@ export default {
// 1-普通秒杀;2-直播间秒杀;3-众筹
switch (marketingType) {
case 1:
if(!sapCode) params.path = 'packageShopmall/packageMall/pages/detail/detail'
query = `isActivity=true&id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}`
break
case 2:
......@@ -113,11 +115,11 @@ export default {
shareType = 'h5'
let { corpId, agentId } = this.getLocalStorage('dj_scrm_corpId')
let link = `${baseURL}/scrm-wx-merchant-activity/#/`
link = `${link}?${query}&id=${i.id}&shareStaffUuid=${uuid}&shareStaffName=${this.toUnicode(userName)}&shareStaffType=2&corpId=${corpId}`
link = `${link}?${query}&id=${i.id}&shareStaffUuid=${uuid}&shareStaffName=${this.toUnicode(userName)}&shareStaffType=2&corpId=${corpId}&sharedTime=${Date.now()}`
if (agentId) link = `${link}&agentId=${agentId}`
h5Params = {
imgUrl: i.posterImg || i.activityImg,
desc: `限时大型众筹,活动时间${new Date(this.iosTimeFormat(i.startTime)).format('yyyy/M/d')}-${new Date(this.iosTimeFormat(i.endTime)).format('yyyy/M/d')}`,
desc: i.activitySharingWords || `限时大型众筹,活动时间${new Date(this.iosTimeFormat(i.startTime)).format('yyyy/M/d')}-${new Date(this.iosTimeFormat(i.endTime)).format('yyyy/M/d')}`,
title: i.forwardTitle || i.activityName,
link
}
......@@ -134,8 +136,8 @@ export default {
switch (+tabIndex) {
case 1:
let isjt = i.packageType == 2
const STORE_PATH = 'packageEquity/pages/package/package'
const JT_PATH = 'packageEquity/pages/open/open'
const STORE_PATH = sapCode ? 'packageEquity/pages/package/package' : 'packageShopmall/packageEquity/pages/package/package'
const JT_PATH = sapCode ? 'packageEquity/pages/open/open' : 'packageShopmall/packageEquity/pages/open/open'
// params.path = 'packageEquity/pages/package/package'
params.path = isjt ? JT_PATH : STORE_PATH
params.imgUrl = 'http://img01.glsx.com.cn/upload/biz/dracMini-qy-10004.png'
......@@ -144,20 +146,21 @@ export default {
title = packageName
break
case 2:
params.path = 'packageMall/pages/detail/detail'
params.path = sapCode ? 'packageMall/pages/detail/detail' : 'packageShopmall/packageMall/pages/detail/detail'
params.imgUrl = goodsImage
params.desc = ''
query = `id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}`
title = goodsName
break
case 3:
/**众筹 */
let { corpId, agentId } = this.getLocalStorage('dj_scrm_corpId')
let link = `${baseURL}/scrm-wx-merchant-activity/#/`
link = `${link}?${query}&id=${i.id}&shareStaffUuid=${uuid}&shareStaffName=${this.toUnicode(userName)}&shareStaffType=2&corpId=${corpId}`
link = `${link}?${query}&id=${i.id}&shareStaffUuid=${uuid}&shareStaffName=${this.toUnicode(userName)}&shareStaffType=2&corpId=${corpId}&sharedTime=${Date.now()}`
if (agentId) link = `${link}&agentId=${agentId}`
h5Params = {
imgUrl: i.posterImg || i.activityImg,
desc: `限时大型众筹,活动时间${new Date(this.iosTimeFormat(i.startTime)).format('yyyy/M/d')}-${new Date(this.iosTimeFormat(i.endTime)).format('yyyy/M/d')}`,
desc: i.activitySharingWords || `限时大型众筹,活动时间${new Date(this.iosTimeFormat(i.startTime)).format('yyyy/M/d')}-${new Date(this.iosTimeFormat(i.endTime)).format('yyyy/M/d')}`,
title: i.forwardTitle || i.activityName,
link
}
......@@ -205,7 +208,7 @@ export default {
)
}
},
sendChatMessage(params, msgtype = 'miniprogram', callBack) {
sendChatMessage (params, msgtype = 'miniprogram', callBack) {
wxConfig
.sendChatMessage({
msgtype,
......@@ -221,7 +224,7 @@ export default {
this.hideLoading()
})
},
shareAppMessage(linkParams, messageParams) {
shareAppMessage (linkParams, messageParams) {
wxConfig.createMiniprogramUrlLink(linkParams).then(link => {
wxConfig
.shareAppMessage({
......@@ -236,14 +239,14 @@ export default {
})
})
},
toUnicode(chineseStr = '') {
toUnicode (chineseStr = '') {
let unicodeStr = ''
for (let i = 0, iLength = chineseStr.length; i < iLength; i++) {
unicodeStr += '@' + chineseStr.charCodeAt(i).toString(16)
}
return unicodeStr
},
couponShare(item) {
couponShare (item) {
let { is_contact, id } = item
let obj = {
couponId: id,
......
......@@ -41,7 +41,7 @@
<div v-html="i.format(detail)"></div>
</template>
<template v-else>
{{detail[i.key] || ''}}
<span class="gift-name"><span v-if="i.key == 'directionalGiftName' && detail.merchantType==2" class="group-label">集团</span> {{detail[i.key] || ''}}</span>
<template v-if="i.tipsValue">
<div
class="item-tips"
......@@ -82,7 +82,7 @@
>领取条件</div>
</div>
<div class="value">
{{detail.directionalGiftName}}
<span class="gift-name"><span v-if="detail.merchantType==2" class="group-label">集团</span>{{detail.directionalGiftName}}</span>
<div class="item-tips">
<template v-if="detail.directionalGiftReceiveCondition">
{{detail.directionalGiftReceiveWay == 1?'手机号':'车架号后6位'}}:{{detail.directionalGiftReceiveCondition}}
......@@ -93,6 +93,12 @@
</div>
</template>
</template>
<div class="item flex">
<div class="label">发放门店</div>
<div class="value">
{{detail.userCouponMerchantName}}
</div>
</div>
<div
v-if="detail.packageId"
class="item flex"
......@@ -295,6 +301,22 @@ export default {
// border-radius: 4px;
margin-right: 4px;
}
.gift-name{
display: flex;
align-items: center;
.group-label{
width: 42px;
height: 20px;
line-height: 20px;
display: inline-block;
text-align: center;
background: rgba(255,101,61,0.15);
border-radius: 4px;
font-size: 12px;
margin-right: 4px;
color: #FF653D;
}
}
.item-tips {
color: #333333;
}
......
......@@ -33,8 +33,8 @@
<template v-if="tabIndex == 0">
<van-swipe-cell>
<div class="title flex">
{{i.name}}
<span v-if="activeTab==1" @click.stop="send(i)">发送</span>
<span>{{i.name}}<span class="group-label" v-if="i.merchantType==2">集团</span></span>
<span class="send" v-if="activeTab==1" @click.stop="send(i)">发送</span>
</div>
<div class="content">
<div class="icon">
......@@ -84,7 +84,7 @@
</div>
</div>
<div class="gift-box">
<div class="title">{{i.name}}</div>
<div class="title">{{i.name}}<span class="group-label" v-if="i.merchantType==2">集团</span></div>
<div class="text" v-if="i.receiveRule!=3">指定领取{{i.receiveWay == 1?'手机号':'车架号'}}:{{i.receiveDetail}}</div>
<div class="text">备注名称:{{i.remarkName}}</div>
</div>
......@@ -93,7 +93,7 @@
<template v-if="tabIndex == 2">
<van-swipe-cell>
<div class="title flex">
<span>{{i.name}}</span>
<span>{{i.name}}<span class="group-label" v-if="i.merchantType==2">集团</span></span>
<span v-if="i.approveStatus==5" class="approve-btn" @click.stop="toAppprove(i)">
发起审批
</span>
......@@ -303,14 +303,15 @@ export default {
this.showLoading('生成中...')
return {
appId: shopmall_appid,
query: scene
query: scene,
sapCode
}
},
send (e) {
let { query, appId } = this.getMiniParams(e)
let { query, appId, sapCode } = this.getMiniParams(e)
wxConfig
.createMiniprogramUrlLink({
path: 'packageEquity/pages/directional/directional',
path: sapCode ? 'packageEquity/pages/directional/directional' : 'packageShopmall/packageEquity/pages/directional/directional',
query,
appId
})
......@@ -342,11 +343,11 @@ export default {
this.$router.push({ name: 'gift.create', query: params })
}else{
const { envVersion } = window.$fetchConfig
let { query, appId } = this.getMiniParams(e)
let { query, appId, sapCode } = this.getMiniParams(e)
// 正式版为:release 体验版为:trial 开发版为:develop
giftApi.createQr({
appId,
path: 'packageEquity/pages/directional/directional',
path: sapCode ? 'packageEquity/pages/directional/directional' : 'packageShopmall/packageEquity/pages/directional/directional',
envVersion,
scene: query
}).then(img => {
......@@ -423,6 +424,18 @@ export default {
}
}
}
.group-label{
width: 42px;
height: 20px;
display: inline-flex;
align-items: center;
justify-content: center;
background: rgba(255,101,61,0.15);
border-radius: 4px;
font-size: 12px;
margin-left: 8px;
color: #FF653D;
}
.type-0 {
height: calc(100vh - 148px);
.item {
......@@ -454,7 +467,7 @@ export default {
color: #282829;
padding: 10px;
border-bottom: 1px solid rgba(195, 195, 195, 0.3);
span {
.send {
margin-left: auto;
flex-shrink: 0;
width: 44px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!