Commit aeca3644 by 李伟康

commit

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