Commit 7f45c59b by 前端

Merge branch 'dev_2.7.2_0819' into 'master'

Dev 2.7.2 0819

See merge request !14
2 parents aa6e0381 68585a8f
...@@ -3,7 +3,10 @@ export default { ...@@ -3,7 +3,10 @@ export default {
/** 分页查询活动 */ /** 分页查询活动 */
getActivityList (currentPage) { getActivityList (currentPage) {
let data = { let data = {
method: 'scrm.api.shopmall.activity.page', // 秒杀活动
// method: 'scrm.api.shopmall.activity.page',
// 秒杀+众筹
method: 'scrm.api.shopmall.wechat.crowdfunding.activity.page',
pageSize: 10, pageSize: 10,
currentPage currentPage
} }
...@@ -20,4 +23,4 @@ export default { ...@@ -20,4 +23,4 @@ export default {
data data
}) })
}, },
}
\ No newline at end of file \ No newline at end of file
}
import { wxConfig, bigdatautilApi } from '@/api' import { wxConfig, bigdatautilApi } from '@/api'
export default { export default {
data () { data() {
return { return {
entry: 'normal' entry: 'normal'
} }
}, },
mounted () { mounted() {
if (this.$route.meta.isTab || this.$route.meta.isIndex) this.wxInit() if (this.$route.meta.isTab || this.$route.meta.isIndex) this.wxInit()
// wxConfig // wxConfig
// .createMiniprogramUrlLink({ // .createMiniprogramUrlLink({
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
// }) // })
}, },
methods: { methods: {
wxInit () { wxInit() {
let _this = this let _this = this
wxConfig.init(['shareAppMessage', 'sendChatMessage', 'getCurExternalContact', 'getContext']).then(() => { wxConfig.init(['shareAppMessage', 'sendChatMessage', 'getCurExternalContact', 'getContext']).then(() => {
wxConfig.getContext().then(({ entry }) => { wxConfig.getContext().then(({ entry }) => {
...@@ -28,7 +28,10 @@ export default { ...@@ -28,7 +28,10 @@ export default {
}) })
}) })
}, },
showShareModel (i = {}) { iosTimeFormat (time) {
return time.replace(/\-/g, '/')
},
showShareModel(i = {}) {
let { let {
tabIndex, tabIndex,
$route: { name } $route: { name }
...@@ -48,40 +51,44 @@ export default { ...@@ -48,40 +51,44 @@ export default {
this.sendMessage(i) this.sendMessage(i)
}) })
}, },
sendMessage (i) { sendMessage(i) {
const { shopmall_appid, request: { baseURL } } = window.$fetchConfig const {
shopmall_appid,
request: { baseURL }
} = window.$fetchConfig
let { merchantId, merchantName, userName, sapCode, uuid } = this.getLocalStorage('dj_scrm_userInfo') let { merchantId, merchantName, userName, sapCode, uuid } = this.getLocalStorage('dj_scrm_userInfo')
let { tabIndex, entry } = this let { tabIndex, entry } = this
let { name } = this.$route let { name } = this.$route
let { userId, id, couponName, activityName, packageName, goodsName, goodsImage, discountType, shareType } = i let { userId, id, couponName, activityName, packageName, goodsName, goodsImage, discountType, shareType, marketingType } = i
let query = `merchantId=${merchantId}&shareTime=${Date.now()}` let query = `merchantId=${merchantId}&shareTime=${Date.now()}`
if (sapCode) query = `${query}&storeCode=${sapCode}` if (sapCode) query = `${query}&storeCode=${sapCode}`
const entryType = entry != 'normal' const entryType = entry != 'normal'
this.showLoading() this.showLoading()
let params = { let params = {
'coupon': { coupon: {
path: 'packageMine/pages/boutique/gift/gift', path: 'packageMine/pages/boutique/gift/gift',
desc: '您的专属服务顾问为您发来了优惠券,请点击领取~', desc: '您的专属服务顾问为您发来了优惠券,请点击领取~',
imgUrl: 'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png' imgUrl: 'http://img01.glsx.com.cn/upload/biz/dracMini-yh-10004.png'
}, },
'activity': { activity: {
path: 'packageMall/pages/detail/detail', path: 'packageMall/pages/detail/detail',
desc: '您有一个秒杀活动可参加', desc: '您有一个秒杀活动可参加',
imgUrl: 'http://img01.glsx.com.cn/upload/biz/dracMini-ms-10004.png' imgUrl: 'http://img01.glsx.com.cn/upload/biz/dracMini-ms-10004.png'
}, },
'merchant': { merchant: {
path: 'pages/tab/index/index', path: 'pages/tab/index/index',
desc: '', desc: '',
imgUrl: 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg' imgUrl: 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/activity/miniprogram-cover.jpg'
} }
}[name], }[name],
title = { title = {
'coupon': couponName, coupon: couponName,
'activity': activityName, activity: activityName,
'merchant': merchantName merchant: merchantName
}[name], }[name],
h5Params = {} h5Params = {}
if (name === 'coupon') { /**卡券 */ if (name === 'coupon') {
/**卡券 */
if (tabIndex == 0) { if (tabIndex == 0) {
query = `id=${id}&userId=${userId}&employName=${this.toUnicode(i.employeeName)}&${query}` query = `id=${id}&userId=${userId}&employName=${this.toUnicode(i.employeeName)}&${query}`
} else { } else {
...@@ -91,14 +98,39 @@ export default { ...@@ -91,14 +98,39 @@ export default {
this.couponShare(i) this.couponShare(i)
} }
} }
if (name === 'activity') { /**活动 */ if (name === 'activity') {
if (tabIndex == 0) { /**活动 */
query = `isActivity=true&id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}` // if (tabIndex == 0) {
} else { // 1-普通秒杀;2-直播间秒杀;3-众筹
/**直播 */ switch (marketingType) {
case 1:
query = `isActivity=true&id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}`
break
case 2:
/** 直播 */
break
case 3:
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}`
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')}`,
title: i.forwardTitle || i.activityName,
link
}
break
default:
break
} }
// } else {
// /**直播 */
// }
} }
if (name === 'merchant') { /**店铺 */ if (name === 'merchant') {
/**店铺 */
switch (+tabIndex) { switch (+tabIndex) {
case 1: case 1:
let isjt = i.packageType == 2 let isjt = i.packageType == 2
...@@ -110,7 +142,7 @@ export default { ...@@ -110,7 +142,7 @@ export default {
params.desc = '您的专属客服顾问为您发来了会员套餐,点击查看哦' params.desc = '您的专属客服顾问为您发来了会员套餐,点击查看哦'
query = `id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}&packageType=${i.packageType}` query = `id=${id}&${query}&shareStaffName=${this.toUnicode(userName)}&shareStaffUuid=${uuid}&packageType=${i.packageType}`
title = packageName title = packageName
break; break
case 2: case 2:
params.path = 'packageMall/pages/detail/detail' params.path = 'packageMall/pages/detail/detail'
params.imgUrl = goodsImage params.imgUrl = goodsImage
...@@ -125,49 +157,55 @@ export default { ...@@ -125,49 +157,55 @@ export default {
if (agentId) link = `${link}&agentId=${agentId}` if (agentId) link = `${link}&agentId=${agentId}`
h5Params = { h5Params = {
imgUrl: i.posterImg || i.activityImg, imgUrl: i.posterImg || i.activityImg,
desc: `限时大型众筹,活动时间${new Date(i.startTime).format('yyyy/M/d')}-${new Date(i.endTime).format('yyyy/M/d')}`, desc: `限时大型众筹,活动时间${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, title: i.forwardTitle || i.activityName,
link link
} }
break break
default: default:
break; break
} }
} }
if (shareType == 'h5') { if (shareType == 'h5') {
console.log(h5Params) console.log(h5Params)
if (entryType) this.sendChatMessage(h5Params, 'news', () => { if (entryType)
bigdatautilApi.reportTrack(i.id) this.sendChatMessage(h5Params, 'news', () => {
})
else wxConfig
.shareAppMessage(h5Params)
.then(() => {
this.hideLoading()
bigdatautilApi.reportTrack(i.id) bigdatautilApi.reportTrack(i.id)
}) })
.catch(() => { else
this.hideLoading() wxConfig
}) .shareAppMessage(h5Params)
.then(() => {
this.hideLoading()
bigdatautilApi.reportTrack(i.id)
})
.catch(() => {
this.hideLoading()
})
} else { } else {
if (entryType) this.sendChatMessage({ if (entryType)
appid: shopmall_appid, this.sendChatMessage({
title, appid: shopmall_appid,
imgUrl: params.imgUrl, title,
page: `/${params.path}.html?${query}` imgUrl: params.imgUrl,
}) page: `/${params.path}.html?${query}`
else this.shareAppMessage({ })
path: params.path, else
query, this.shareAppMessage(
appId:i.packageType==2? 'wxfe82b8d65d07808f':shopmall_appid {
}, { path: params.path,
desc: params.desc, query,
title, appId: i.packageType == 2 ? 'wxfe82b8d65d07808f' : shopmall_appid
imgUrl: params.imgUrl },
}) {
desc: params.desc,
title,
imgUrl: params.imgUrl
}
)
} }
}, },
sendChatMessage (params, msgtype = 'miniprogram', callBack) { sendChatMessage(params, msgtype = 'miniprogram', callBack) {
wxConfig wxConfig
.sendChatMessage({ .sendChatMessage({
msgtype, msgtype,
...@@ -183,41 +221,40 @@ export default { ...@@ -183,41 +221,40 @@ export default {
this.hideLoading() this.hideLoading()
}) })
}, },
shareAppMessage (linkParams, messageParams) { shareAppMessage(linkParams, messageParams) {
wxConfig wxConfig.createMiniprogramUrlLink(linkParams).then(link => {
.createMiniprogramUrlLink(linkParams) wxConfig
.then(link => { .shareAppMessage({
wxConfig link,
.shareAppMessage({ ...messageParams
link, })
...messageParams .then(() => {
}) this.hideLoading()
.then(() => { })
this.hideLoading() .catch(() => {
}) this.hideLoading()
.catch(() => { })
this.hideLoading() })
})
})
}, },
toUnicode (chineseStr = '') { toUnicode(chineseStr = '') {
let unicodeStr = '' let unicodeStr = ''
for (let i = 0, iLength = chineseStr.length; i < iLength; i++) { for (let i = 0, iLength = chineseStr.length; i < iLength; i++) {
unicodeStr += '@' + chineseStr.charCodeAt(i).toString(16) unicodeStr += '@' + chineseStr.charCodeAt(i).toString(16)
} }
return unicodeStr return unicodeStr
}, },
couponShare (item) { couponShare(item) {
let { is_contact, id } = item let { is_contact, id } = item
let obj = { let obj = {
couponId: id, couponId: id,
shareType: 1 shareType: 1
} }
if (is_contact) obj.userList = [ if (is_contact)
{ obj.userList = [
userId: is_contact {
} userId: is_contact
] }
]
else obj.shareType = 0 else obj.shareType = 0
} }
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</div> </div>
<div class="info"> <div class="info">
<div class="title text-hide">{{i.activityName}}</div> <div class="title text-hide">{{i.activityName}}</div>
<div class="time">时间:{{i.startTime}} ~ {{i.endTime}}</div> <div class="time">时间:{{i.startTimeTxt}} ~ {{i.endTimeTxt}}</div>
<div class="price flex"> <div class="price flex">
<template v-if="i.priceType == 1"> <template v-if="i.priceType == 1">
<div class="old">原价:¥{{i.price1}} </div> <div class="old">原价:¥{{i.price1}} </div>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</div> </div>
<div class="info"> <div class="info">
<div class="title text-hide">{{i.name}}</div> <div class="title text-hide">{{i.name}}</div>
<div class="time">直播时间:{{i.startTime}}</div> <div class="time">直播时间:{{i.startTimeTxt}}</div>
<div class="zhubo flex"> <div class="zhubo flex">
主播:{{i.anchorName}} 主播:{{i.anchorName}}
<div <div
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
mixins: [shareMixin, pageMixin], mixins: [shareMixin, pageMixin],
data () { data () {
return { return {
tabList: ['秒杀活动'] tabList: ['门店活动']
} }
}, },
methods: { methods: {
...@@ -104,8 +104,8 @@ export default { ...@@ -104,8 +104,8 @@ export default {
console.log(tabIndex == 0 ? '活动列表' : '直播列表', res) console.log(tabIndex == 0 ? '活动列表' : '直播列表', res)
if (tabIndex == 0) { if (tabIndex == 0) {
res.list.map(e => { res.list.map(e => {
if (e.startTime) e.startTime = new Date(this.iosTimeFormat(e.startTime)).format('yyyy年M月d日') if (e.startTime) e.startTimeTxt = new Date(this.iosTimeFormat(e.startTime)).format('yyyy年M月d日')
if (e.endTime) e.endTime = new Date(this.iosTimeFormat(e.endTime)).format('yyyy年M月d日') if (e.endTime) e.endTimeTxt = new Date(this.iosTimeFormat(e.endTime)).format('yyyy年M月d日')
e.price1 = this.centsToyuan(e.price1 || 0) e.price1 = this.centsToyuan(e.price1 || 0)
e.price2 = this.centsToyuan(e.price2 || 0) e.price2 = this.centsToyuan(e.price2 || 0)
}) })
...@@ -237,4 +237,4 @@ export default { ...@@ -237,4 +237,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<div class="name">{{i.activityName}}</div> <div class="name">{{i.activityName}}</div>
<div class="time flex"> <div class="time flex">
<div class="sprite-icon icon-activity-time"></div> <div class="sprite-icon icon-activity-time"></div>
{{new Date(i.startTime).format('yyyy/M/d')}}-{{new Date(i.endTime).format('yyyy/M/d')}} {{new Date(iosTimeFormat(i.startTime)).format('yyyy/M/d')}}-{{new Date(iosTimeFormat(i.endTime)).format('yyyy/M/d')}}
</div> </div>
<div class="price"> <div class="price">
¥{{centsToyuan(i.activityPrice)}} ¥{{centsToyuan(i.activityPrice)}}
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import { shareMixin, pageMixin } from '@/mixins' import { shareMixin, pageMixin } from '@/mixins'
import { shopmallApi, equityApi } from '@/api' import { shopmallApi, equityApi } from '@/api'
const tabList = ['我的店铺', '会员套餐', '门店商品', '门店活动'] const tabList = ['我的店铺', '会员套餐', '门店商品', '门店套餐']
const SEARCHTAB = ['全部', '门店', '集团'] const SEARCHTAB = ['全部', '门店', '集团']
export default { export default {
name: 'merchant', name: 'merchant',
...@@ -203,6 +203,9 @@ export default { ...@@ -203,6 +203,9 @@ export default {
this.hideLoading() this.hideLoading()
}) })
}, },
iosTimeFormat (time) {
return time.replace(/\-/g, '/')
},
showVipDialog (i) { showVipDialog (i) {
this.showVip = true this.showVip = true
this.equity_id = i.id this.equity_id = i.id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!