Commit b6035776 by 李伟康

commit

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