Commit ebe0c4e7 by liwk

commit

1 parent 50db7b42
...@@ -19,4 +19,13 @@ export default { ...@@ -19,4 +19,13 @@ export default {
data data
}) })
}, },
/** 分页查询用户券列表(待核销、已核销) */
getCustomerCouponList(data) {
data.method = 'scrm.api.boutiquecoupon.wework.customerCoupon.page'
data.pageSize = 10
return window.$HTTP({
url,
data
})
},
} }
\ No newline at end of file \ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 250px 212px;} .sprite-icon { background-image: url(../images/sprite.png);background-size: 250px 212px;}
.icon-coupon-0 { width: 32px; height: 32px; background-position: 0px -180px;}
.icon-coupon-1 { width: 32px; height: 32px; background-position: -42px -180px;}
.icon-coupon-lose { width: 70px; height: 70px; background-position: -180px 0px;}
.icon-coupon-success { width: 70px; height: 70px; background-position: -180px -80px;}
.icon-coupon { width: 80px; height: 80px; background-position: 0px 0px;} .icon-coupon { width: 80px; height: 80px; background-position: 0px 0px;}
.icon-discount { width: 80px; height: 80px; background-position: -90px 0px;} .icon-discount { width: 80px; height: 80px; background-position: -90px 0px;}
.icon-down { width: 12px; height: 12px; background-position: -170px -180px;} .icon-down { width: 12px; height: 12px; background-position: -170px -180px;}
.icon-exchange { width: 80px; height: 80px; background-position: 0px -90px;} .icon-exchange { width: 80px; height: 80px; background-position: 0px -90px;}
.icon-poster-close { width: 20px; height: 20px; background-position: -84px -180px;} .icon-poster-close { width: 20px; height: 20px; background-position: -84px -180px;}
.icon-scan { width: 16px; height: 16px; background-position: -144px -180px;}
.icon-share { width: 20px; height: 20px; background-position: -114px -180px;} .icon-share { width: 20px; height: 20px; background-position: -114px -180px;}
.icon-vip { width: 80px; height: 80px; background-position: -90px -90px;} .icon-vip { width: 80px; height: 80px; background-position: -90px -90px;}
\ No newline at end of file \ No newline at end of file
.icon-scan { width: 16px; height: 16px; background-position: -144px -180px;}
.icon-coupon-0 { width: 32px; height: 32px; background-position: 0px -180px;}
.icon-coupon-1 { width: 32px; height: 32px; background-position: -42px -180px;}
.icon-coupon-lose { width: 70px; height: 70px; background-position: -180px 0px;}
.icon-coupon-success { width: 70px; height: 70px; background-position: -180px -80px;}
\ No newline at end of file \ No newline at end of file
<template> <template>
<van-overlay <van-overlay
:show="show" :show="show"
z-index="2013" z-index="9999999"
> >
<div <div
class="wrapper" class="wrapper"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
@click.prevent="close" @click.prevent="close"
></div> ></div>
<van-image <van-image
:src="img || activityData.posterUrl" :src="activityData.posterUrl"
width="100%" width="100%"
height="100%" height="100%"
> >
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { shopmallApi } from '@/api'
export default { export default {
name: 'Poster', name: 'Poster',
props: ['value', 'apiName', 'currentItem', 'activityData'], props: ['value', 'apiName', 'currentItem', 'activityData'],
...@@ -55,9 +54,6 @@ export default { ...@@ -55,9 +54,6 @@ export default {
watch: { watch: {
'value' (n) { 'value' (n) {
this.show = n this.show = n
if (n) {
if (this.apiName == 'shopmallApi') this.getGoodsPoster(this.currentItem.id)
}
}, },
}, },
methods: { methods: {
...@@ -80,13 +76,6 @@ export default { ...@@ -80,13 +76,6 @@ export default {
this.showToast('发送成功') this.showToast('发送成功')
}) })
},
getGoodsPoster (id) {
this.img = ''
shopmallApi.getGoodsPoster({ id }).then(res => {
console.log(res)
this.img = res
})
} }
} }
} }
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { export default {
name: 'SearchBox', name: 'SearchBox',
props: ['keyword'],
data () { data () {
return { return {
keyword: '',
value: 0, value: 0,
option: [ option: [
{ text: '优惠券', value: 0 }, { text: '优惠券', value: 0 },
......
...@@ -78,6 +78,12 @@ export default { ...@@ -78,6 +78,12 @@ export default {
url: data url: data
} }
}) })
shopmallApi.getGoodsPoster({ id }).then(res => {
console.log(res)
this.activityData = {
posterUrl: res
}
})
} }
this.showShare = true this.showShare = true
} }
...@@ -141,6 +147,7 @@ export default { ...@@ -141,6 +147,7 @@ export default {
this.showPoster = true this.showPoster = true
break; break;
case 3: case 3:
let { id } = currentItem
this.showLoading() this.showLoading()
if (apiName == 'shopmallApi') { if (apiName == 'shopmallApi') {
let { activityData } = this let { activityData } = this
...@@ -150,11 +157,15 @@ export default { ...@@ -150,11 +157,15 @@ export default {
} else if (apiName == 'liveApi') { } else if (apiName == 'liveApi') {
this.setClipboardData(activityData.pagePath) this.setClipboardData(activityData.pagePath)
} else if (apiName == 'couponApi') { } else if (apiName == 'couponApi') {
this.couponShare(currentItem.id, 0, 3) this.couponShare(currentItem, 0, 3)
} else if (apiName == 'boutiquecouponApi') { } else if (apiName == 'boutiquecouponApi') {
this.getBoutiqueCoupon(currentItem.id, res => { this.getBoutiqueCoupon(id, res => {
this.setClipboardData(res) this.setClipboardData(res)
}) })
} else {
equityApi.getEquityShared({ id }).then(res => {
this.setClipboardData(res.url)
})
} }
break; break;
} }
...@@ -213,8 +224,4 @@ export default { ...@@ -213,8 +224,4 @@ export default {
.van-share-sheet__option.disabled { .van-share-sheet__option.disabled {
opacity: 0.5; opacity: 0.5;
} }
.share {
position: relative;
z-index: 2003;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<template v-if="i.effectiveType == 1"> <template v-if="i.effectiveType == 1">
有效期:{{i.effectiveDays}}天 有效期:{{i.effectiveDays}}天
</template> </template>
<template v-if="i.effectiveType == 2"> <template v-else-if="i.effectiveType == 2">
有效期:{{new Date(i.effectiveStartTime).format('yyyy-MM-dd')}} ~ {{new Date(i.effectiveEndTime).format('yyyy-MM-dd')}} 有效期:{{new Date(i.effectiveStartTime).format('yyyy-MM-dd')}} ~ {{new Date(i.effectiveEndTime).format('yyyy-MM-dd')}}
</template> </template>
<template v-else> <template v-else>
......
...@@ -14,8 +14,6 @@ import { ...@@ -14,8 +14,6 @@ import {
Tabbar, Tabbar,
TabbarItem, TabbarItem,
NavBar, NavBar,
Lazyload,
Toast,
Search, Search,
ActionSheet, ActionSheet,
CellGroup, CellGroup,
......
...@@ -84,25 +84,26 @@ const actions = { ...@@ -84,25 +84,26 @@ const actions = {
util.setLocalStorage('dj_scrm_accountList', data.loginList) util.setLocalStorage('dj_scrm_accountList', data.loginList)
let redirect_uri = encodeURI(`${redirectUrl}${route}`) let redirect_uri = encodeURI(`${redirectUrl}${route}`)
console.log(data) console.log(data)
//先注释 window.location.replace(`${url}common/accountList?redirect_uri=${redirect_uri}`) // 先注释
window.location.replace(`${url}common/accountList?redirect_uri=${redirect_uri}`)
//以下是 本地调试多账号 //以下是 本地调试多账号
let userInfo = data.loginList[1] // let userInfo = data.loginList[1]
let { merchantId, accountName } = userInfo // let { merchantId, accountName } = userInfo
let loginAccount = accountName // let loginAccount = accountName
ssoApi.selectAccount({ // ssoApi.selectAccount({
loginAccount, // loginAccount,
merchantId, // merchantId,
loginToken: data.loginToken, // loginToken: data.loginToken,
loginSource: 'WW', // loginSource: 'WW',
loginType: 3 // loginType: 3
}).then(res => { // }).then(res => {
util.removeLocalStorage('dj_scrm_loginToken') // util.removeLocalStorage('dj_scrm_loginToken')
util.removeLocalStorage('dj_scrm_accountList') // util.removeLocalStorage('dj_scrm_accountList')
util.setLocalStorage('dj_scrm_userInfo', res.data) // util.setLocalStorage('dj_scrm_userInfo', res.data)
util.setSessionId(res.data.sessionId) // util.setSessionId(res.data.sessionId)
dispatch('registerHttp', res.data.sessionId) // dispatch('registerHttp', res.data.sessionId)
window.location.replace(`${url}${route}`) // window.location.replace(`${url}${route}`)
}) // })
} else { } else {
let [userInfo] = data.loginList let [userInfo] = data.loginList
util.setLocalStorage('dj_scrm_userInfo', userInfo) util.setLocalStorage('dj_scrm_userInfo', userInfo)
......
...@@ -129,7 +129,7 @@ const setClipboardData = data => { ...@@ -129,7 +129,7 @@ const setClipboardData = data => {
if (document.execCommand('copy')) document.execCommand('copy') if (document.execCommand('copy')) document.execCommand('copy')
hideLoading() hideLoading()
transfer.blur() transfer.blur()
Toast('内容已复制') Toast('复制成功')
document.body.removeChild(transfer) document.body.removeChild(transfer)
} }
...@@ -156,6 +156,9 @@ const toTop = () => { ...@@ -156,6 +156,9 @@ const toTop = () => {
const getParams = () => { const getParams = () => {
return window.vm.$route.params return window.vm.$route.params
} }
const getQuery = () => {
return window.vm.$route.query
}
const watchPageBack = () => { const watchPageBack = () => {
return new Promise(resolve => { return new Promise(resolve => {
if (window.$back) { if (window.$back) {
...@@ -183,6 +186,7 @@ const utils = { ...@@ -183,6 +186,7 @@ const utils = {
touchstart, touchstart,
showToast, showToast,
getParams, getParams,
getQuery,
touchend, touchend,
throttle, throttle,
decimal, decimal,
......
...@@ -3,14 +3,13 @@ ...@@ -3,14 +3,13 @@
<search-box <search-box
@change="changeType" @change="changeType"
@search="search" @search="search"
:keyword="userName"
></search-box> ></search-box>
<template v-if="type == 0">
<tab <tab
:list="tab" :list="type == 0?tab:tab2"
@change="change" @change="change"
:updata="updata" :updata="updata"
/> />
</template>
<template v-if="flag"> <template v-if="flag">
<template v-if="list.length"> <template v-if="list.length">
<scroll-view <scroll-view
...@@ -24,8 +23,9 @@ ...@@ -24,8 +23,9 @@
class="item" class="item"
> >
<div class="title flex"> <div class="title flex">
{{item.userName}} {{item.userName || item.customerName}}
<div class="time"> <div class="time">
<template v-if="type == 0">
<template v-if="tabIndex == 0"> <template v-if="tabIndex == 0">
核销时间: {{new Date(item.verificationTime).format('yyyy/MM/dd')}} 核销时间: {{new Date(item.verificationTime).format('yyyy/MM/dd')}}
</template> </template>
...@@ -35,10 +35,19 @@ ...@@ -35,10 +35,19 @@
<template v-else> <template v-else>
发放时间:{{new Date(item.issueDate).format('yyyy/MM/dd')}} 发放时间:{{new Date(item.issueDate).format('yyyy/MM/dd')}}
</template> </template>
</template>
<template v-else>
<template v-if="tabIndex == 0">
核销时间: {{new Date(item.usedTime).format('yyyy/MM/dd')}}
</template>
<template v-else>
领券时间:{{new Date(item.createdDate).format('yyyy/MM/dd')}}
</template>
</template>
</div> </div>
</div> </div>
<div class="info"> <div class="info">
<template v-for="(i,ind) in itemObj"> <template v-for="(i,ind) in type == 0?itemObj:itemObj2">
<div <div
:key="ind" :key="ind"
class="li flex" class="li flex"
...@@ -55,10 +64,13 @@ ...@@ -55,10 +64,13 @@
<div :class="['sprite-icon','coupon-icon',`icon-coupon-${item.discountType== 4?1:0}`]"></div> <div :class="['sprite-icon','coupon-icon',`icon-coupon-${item.discountType== 4?1:0}`]"></div>
</template> </template>
<template v-else> <template v-else>
<div :class="['sprite-icon','coupon-icon',`icon-coupon-success`]"></div> <template v-if="tabIndex == 0">
<div :class="['sprite-icon','coupon-icon',item.upgradeFlag == 'Y'?'icon-coupon-success':'icon-coupon-lose']"></div>
</template>
</template> </template>
</div> </div>
</div> </div>
</template> </template>
</scroll-view> </scroll-view>
</template> </template>
...@@ -74,11 +86,17 @@ ...@@ -74,11 +86,17 @@
<div class="sprite-icon icon-scan"></div> <div class="sprite-icon icon-scan"></div>
扫码核销 扫码核销
</div> </div>
<div
class="tips text-center"
v-if="type == 0 && tabIndex == 2"
>
仅从聊天侧边栏发送优惠券,可查看未领取记录
</div>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { couponApi, wxConfig } from '@/api' import { couponApi, boutiquecouponApi, wxConfig } from '@/api'
const itemObj = [ const itemObj = [
{ {
label: '券名', label: '券名',
...@@ -87,9 +105,6 @@ const itemObj = [ ...@@ -87,9 +105,6 @@ const itemObj = [
{ {
label: '发放人', label: '发放人',
key: 'issueName', key: 'issueName',
// format () {
// return '<span class=\"text-hide w84\">好借好还好借好还好借好还</span><b class=\"line\"></b><span class=\"text-hide w66\">恒河猴</span>'
// }
}, },
{ {
label: '核销人', label: '核销人',
...@@ -101,6 +116,7 @@ export default { ...@@ -101,6 +116,7 @@ export default {
data () { data () {
return { return {
tab: ['', '', ''], tab: ['', '', ''],
tab2: ['', ''],
list: [], list: [],
updata: new Date().getTime(), updata: new Date().getTime(),
tabIndex: 0, tabIndex: 0,
...@@ -109,7 +125,21 @@ export default { ...@@ -109,7 +125,21 @@ export default {
itemObj, itemObj,
total: 0, total: 0,
flag: false, flag: false,
userName: '' userName: '',
itemObj2: [
{
label: '券名',
key: 'couponName'
},
{
label: '发放人',
key: 'employeeName',
},
{
label: '核销人',
key: 'sellerName',
}
]
} }
}, },
mounted () { mounted () {
...@@ -123,6 +153,8 @@ export default { ...@@ -123,6 +153,8 @@ export default {
this.getVerificationList() this.getVerificationList()
this.getUserCouponList(0, false) this.getUserCouponList(0, false)
this.getUserCouponList(1, false) this.getUserCouponList(1, false)
this.getCustomerCouponList('Y', false)
this.getCustomerCouponList('N', false)
}, },
search (e) { search (e) {
this.userName = e this.userName = e
...@@ -136,6 +168,8 @@ export default { ...@@ -136,6 +168,8 @@ export default {
changeType (e) { changeType (e) {
this.showLoading() this.showLoading()
this.type = e this.type = e
this.updata = new Date().getTime()
this.userName = ''
this.clearData() this.clearData()
}, },
clearData () { clearData () {
...@@ -152,7 +186,7 @@ export default { ...@@ -152,7 +186,7 @@ export default {
if (tabIndex == 0) this.getVerificationList() if (tabIndex == 0) this.getVerificationList()
else this.getUserCouponList(tabIndex == 1 ? 1 : 0) else this.getUserCouponList(tabIndex == 1 ? 1 : 0)
} else { } else {
this.getCustomerCouponList(tabIndex == 0 ? 'Y' : 'N')
} }
}, },
getVerificationList () { getVerificationList () {
...@@ -187,6 +221,25 @@ export default { ...@@ -187,6 +221,25 @@ export default {
}) })
}, },
/**精品礼券 */
getCustomerCouponList (usedFlag, setDate = true) {
let { list, pageNum, userName } = this
boutiquecouponApi.getCustomerCouponList({ currentPage: pageNum, customerName: userName, usedFlag }).then(res => {
console.log(res)
if (setDate) {
this.list = list.concat(res.list)
this.flag = true
}
if (usedFlag == 'Y') {
this.tab2[0] = `已核销(${res.total})`
} else {
this.tab2[1] = `待核销(${res.total})`
}
this.updata = new Date().getTime()
this.total = res.total
this.hideLoading()
})
},
onReachBottom () { onReachBottom () {
let { total, pageNum, list } = this let { total, pageNum, list } = this
this.$refs.scrollView.loading = false this.$refs.scrollView.loading = false
...@@ -294,4 +347,14 @@ export default { ...@@ -294,4 +347,14 @@ export default {
margin-right: 8px; margin-right: 8px;
} }
} }
.tips {
width: 100%;
height: 24px;
background: rgba(88, 80, 255, 0.7);
position: fixed;
bottom: 0;
left: 0;
color: #fff;
font-size: 12px;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!