Commit aeca3644 by 李伟康

commit

1 parent 13a74ab4
<template> <template>
<div class="search-box flex"> <div class="search-box flex">
<van-search <van-search
v-model="keyword" v-model="searchValue"
placeholder="输入客户姓名搜索" placeholder="输入客户姓名搜索"
@search="onSearch" @search="onEmit($event,'search')"
@clear="onEmit('','search')"
/> />
<van-dropdown-menu active-color="#3975C6"> <van-dropdown-menu active-color="#3975C6">
<van-dropdown-item <van-dropdown-item
v-model="value" v-model="value"
:options="option" :options="option"
@change="change" @change="onEmit($event,'change')"
/> />
<div class="arrow y-center"> <div class="arrow y-center">
<div class="sprite-icon icon-down"></div> <div class="sprite-icon icon-down"></div>
...@@ -40,22 +41,21 @@ export default { ...@@ -40,22 +41,21 @@ export default {
{ text: '精品礼券', value: 1 }, { text: '精品礼券', value: 1 },
{ text: '商品订单', value: 2 }, { text: '商品订单', value: 2 },
{ text: '会员服务', value: 3 } { text: '会员服务', value: 3 }
] ],
searchValue: ''
} }
}, },
watch: { watch: {
'updata' (n) { 'updata' (n) {
this.value = this.index this.value = this.index
},
'keyword'(n){
this.searchValue = n
} }
}, },
mounted () {
},
methods: { methods: {
change (e) { onEmit (e, name) {
this.$emit('change', e) this.$emit(name, e )
},
onSearch (e) {
this.$emit('search', e)
} }
} }
} }
......
...@@ -260,14 +260,13 @@ export default { ...@@ -260,14 +260,13 @@ export default {
} }
}) })
}, },
activated () {
},
mounted () { mounted () {
this.getTabNum() this.getTabNum()
window.$wx = wxConfig window.$wx = wxConfig
window.$wx.init(['scanQRCode']) window.$wx.init(['scanQRCode'])
}, },
methods: { methods: {
/**获取列表数量 */
getTabNum () { getTabNum () {
this.showLoading() this.showLoading()
this.getVerificationList(0, true) this.getVerificationList(0, true)
...@@ -326,69 +325,74 @@ export default { ...@@ -326,69 +325,74 @@ export default {
this.getGoodsVerficationList(tabIndex == 0 ? 2 : 1, true) this.getGoodsVerficationList(tabIndex == 0 ? 2 : 1, true)
} }
}, },
setData (res) {
let { list } = this
this.list = list.concat(res.list)
this.flag = true
this.total = res.total
},
requestEnd () {
this.updata = new Date().getTime()
this.hideLoading()
},
/**优惠券已核销 */ /**优惠券已核销 */
getVerificationList (type = 0, setData) { getVerificationList (type = 0, setData) {
let { list, userName, pageNum } = this let { userName, pageNum } = this
let discountTypes = [2, 3, 4] let discountTypes = [2, 3, 4]
if (type == 3) discountTypes = [7] if (type == 3) discountTypes = [7]
couponApi.getVerificationList({ pageNum, userName, discountTypes }).then(res => { couponApi.getVerificationList({
pageNum,
userName,
discountTypes
}).then(res => {
if (setData) { if (setData) {
this.list = list.concat(res.list)
this.flag = true
this.itemObj = this.tools.deepClone(itemObj) this.itemObj = this.tools.deepClone(itemObj)
this.total = res.total this.setData(res)
} }
this.tab[type == 0 ? 0 : 3][0] = `已核销(${res.total})` this.tab[type == 0 ? 0 : 3][0] = `已核销(${res.total})`
this.updata = new Date().getTime() this.requestEnd()
this.hideLoading()
}) })
}, },
/**优惠券待核销 已领取 */ /**优惠券待核销 已领取 */
getUserCouponList ({ userStatus, type }, setData) { getUserCouponList ({ userStatus, type }, setData) {
let { list, userName, pageNum } = this let { userName, pageNum } = this
let discountTypes = [2, 3, 4] let discountTypes = [2, 3, 4]
if (type == 3) discountTypes = [7] if (type == 3) discountTypes = [7]
couponApi.getUserCouponList({ pageNum, userName, userStatus, discountTypes }).then(res => { couponApi.getUserCouponList({
pageNum,
userName,
userStatus,
discountTypes
}).then(res => {
if (setData) { if (setData) {
this.list = list.concat(res.list)
this.itemObj = this.tools.deepClone(itemObj).splice(0, 2) this.itemObj = this.tools.deepClone(itemObj).splice(0, 2)
this.flag = true this.setData(res)
this.total = res.total
} }
if (type == 0) { if (type == 0) {
if (userStatus == 0) { if (userStatus == 0) this.tab[0][2] = `未领取(${res.total})`
this.tab[0][2] = `未领取(${res.total})` else this.tab[0][1] = `待核销(${res.total})`
} else {
this.tab[0][1] = `待核销(${res.total})`
}
} else {
this.tab[3][1] = `待核销(${res.total})`
} }
this.updata = new Date().getTime() else this.tab[3][1] = `待核销(${res.total})`
this.hideLoading() this.requestEnd()
}) })
}, },
/**精品礼券 */ /**精品礼券 */
getCustomerCouponList (usedFlag, setData) { getCustomerCouponList (usedFlag, setData) {
let { list, pageNum, userName } = this let { pageNum, userName } = this
boutiquecouponApi.getCustomerCouponList({ currentPage: pageNum, customerName: userName, usedFlag }).then(res => { boutiquecouponApi.getCustomerCouponList({
if (setData) { currentPage: pageNum,
this.list = list.concat(res.list) customerName: userName,
this.flag = true usedFlag
this.total = res.total }).then(res => {
} if (setData) this.setData(res)
if (usedFlag == 'Y') { if (usedFlag == 'Y') this.tab[1][0] = `已核销(${res.total})`
this.tab[1][0] = `已核销(${res.total})` else this.tab[1][1] = `待核销(${res.total})`
} else { this.requestEnd()
this.tab[1][1] = `待核销(${res.total})`
}
this.updata = new Date().getTime()
this.hideLoading()
}) })
}, },
/**商品订单 */ /**商品订单 */
getGoodsVerficationList (verificationStatus, setData) { getGoodsVerficationList (verificationStatus, setData) {
let { list, pageNum, userName } = this let { pageNum, userName } = this
shopmallApi shopmallApi
.getGoodsVerficationList({ .getGoodsVerficationList({
currentPage: pageNum, currentPage: pageNum,
...@@ -396,18 +400,10 @@ export default { ...@@ -396,18 +400,10 @@ export default {
verificationStatus verificationStatus
}) })
.then(res => { .then(res => {
if (setData) { if (setData) this.setData(res)
this.list = list.concat(res.list) if (verificationStatus == 2) this.tab[2][0] = `已核销(${res.total})`
this.flag = true else this.tab[2][1] = `待核销(${res.total})`
this.total = res.total this.requestEnd()
}
if (verificationStatus == 2) {
this.tab[2][0] = `已核销(${res.total})`
} else {
this.tab[2][1] = `待核销(${res.total})`
}
this.updata = new Date().getTime()
this.hideLoading()
}) })
}, },
onReachBottom () { onReachBottom () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!