Commit b6035776 by 李伟康

commit

1 parent fc56682c
...@@ -21,7 +21,17 @@ ...@@ -21,7 +21,17 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { export default {
name: 'SearchBox', name: 'SearchBox',
props: ['keyword'], props: {
keyword: String,
index: {
type: Number,
default: 0
},
updata: {
type: Number,
default: new Date().getTime()
}
},
data () { data () {
return { return {
value: 0, value: 0,
...@@ -33,6 +43,11 @@ export default { ...@@ -33,6 +43,11 @@ export default {
] ]
} }
}, },
watch: {
'updata' (n) {
this.value = this.index
}
},
mounted () { mounted () {
}, },
methods: { methods: {
......
...@@ -46,7 +46,6 @@ export default { ...@@ -46,7 +46,6 @@ export default {
}, },
watch: { watch: {
'index' (n) { 'index' (n) {
console.log(n)
this.tabIndex = n this.tabIndex = n
}, },
'updata' (n) { 'updata' (n) {
......
...@@ -9,19 +9,22 @@ const pages = [ ...@@ -9,19 +9,22 @@ const pages = [
{ {
name: 'verificationList', name: 'verificationList',
meta: { meta: {
title: '核销列表' title: '核销列表',
keepAlive: true
} }
}, },
{ {
name: 'verificationDetail', name: 'verificationDetail',
meta: { meta: {
title: '核销详情' title: '核销详情',
keepAlive: true
} }
}, },
{ {
name: 'goodsVerification', name: 'goodsVerification',
meta: { meta: {
title: '核销订单' title: '核销订单',
keepAlive: true
} }
} }
] ]
......
...@@ -137,6 +137,7 @@ export default { ...@@ -137,6 +137,7 @@ export default {
submit () { submit () {
let { verficationCode } = this.getParams() let { verficationCode } = this.getParams()
this.showLoading() this.showLoading()
this.$route.params.isGoods = true
shopmallApi shopmallApi
.verficationGoods(verficationCode) .verficationGoods(verficationCode)
.then(res => { .then(res => {
......
...@@ -83,7 +83,7 @@ const couponObj = [ ...@@ -83,7 +83,7 @@ const couponObj = [
}, },
{ {
label: '类型', label: '类型',
format(item) { format (item) {
return window.$discountType[item.discountType] return window.$discountType[item.discountType]
} }
}, },
...@@ -93,7 +93,7 @@ const couponObj = [ ...@@ -93,7 +93,7 @@ const couponObj = [
}, },
{ {
label: '发放时间', label: '发放时间',
format(item) { format (item) {
return new Date(item.issueDate).format('yyyy年MM月dd日') return new Date(item.issueDate).format('yyyy年MM月dd日')
} }
} }
...@@ -109,7 +109,7 @@ const vipObj = [ ...@@ -109,7 +109,7 @@ const vipObj = [
}, },
{ {
label: '有效期', label: '有效期',
format(item) { format (item) {
let { effectiveType } = item let { effectiveType } = item
let str = '' let str = ''
if (effectiveType == 1) str = `${item.effectiveDays}天` if (effectiveType == 1) str = `${item.effectiveDays}天`
...@@ -122,7 +122,7 @@ const vipObj = [ ...@@ -122,7 +122,7 @@ const vipObj = [
export default { export default {
name: '', name: '',
mixins: [discountTypeMixin], mixins: [discountTypeMixin],
data() { data () {
return { return {
detail: {}, detail: {},
customerObj: [ customerObj: [
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
}, },
{ {
label: '领取时间', label: '领取时间',
format(item) { format (item) {
return new Date(item.receiveTime).format('yyyy年MM月dd日') return new Date(item.receiveTime).format('yyyy年MM月dd日')
} }
} }
...@@ -146,7 +146,7 @@ export default { ...@@ -146,7 +146,7 @@ export default {
flag: false flag: false
} }
}, },
mounted() { mounted () {
let { verficationCode } = this.getParams() let { verficationCode } = this.getParams()
this.showLoading() this.showLoading()
couponApi.scan({ verficationCode }).then(res => { couponApi.scan({ verficationCode }).then(res => {
...@@ -158,7 +158,9 @@ export default { ...@@ -158,7 +158,9 @@ export default {
}) })
}, },
methods: { methods: {
submit() { submit () {
let { detail: { discountType } } = this
this.$route.params.discountType = discountType
let { verficationCode } = this let { verficationCode } = this
this.showLoading() this.showLoading()
couponApi.verificationCode({ verficationCode }).then(res => { couponApi.verificationCode({ verficationCode }).then(res => {
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
@change="changeType" @change="changeType"
@search="search" @search="search"
:keyword="userName" :keyword="userName"
:index="type"
:updata="updata"
></search-box> ></search-box>
<tab <tab
:list="tab[type]" :list="tab[type]"
...@@ -228,11 +230,43 @@ export default { ...@@ -228,11 +230,43 @@ export default {
] ]
} }
}, },
mounted () { beforeRouteEnter (to, from, next) {
console.log('from', from)
let { params: { discountType, isGoods } } = from
next(vm => {
if (discountType) {
if (discountType == 7) {
vm.changeType(3)
vm.getUserCouponList({
userStatus: 1,
type: 3
})
} else {
vm.changeType(0)
vm.getUserCouponList({
userStatus: 0,
type: 0
})
vm.getUserCouponList({
userStatus: 1,
type: 0
})
}
}
if (isGoods) {
vm.changeType(2)
vm.getGoodsVerficationList(1)
}
})
},
activated () {
this.getTabNum() this.getTabNum()
window.$wx = wxConfig window.$wx = wxConfig
window.$wx.init(['scanQRCode']) window.$wx.init(['scanQRCode'])
}, },
mounted () {
},
methods: { methods: {
getTabNum () { getTabNum () {
this.showLoading() this.showLoading()
...@@ -401,6 +435,7 @@ export default { ...@@ -401,6 +435,7 @@ export default {
} }
}, },
scan () { scan () {
// let resultStr = 't=2&c=3483845737948516352'
window.$wx.scanQRCode(1).then(({ resultStr }) => { window.$wx.scanQRCode(1).then(({ resultStr }) => {
let name = 'verificationDetail' let name = 'verificationDetail'
let [t, c] = resultStr.split('&') let [t, c] = resultStr.split('&')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!