diff --git a/common/common.js b/common/common.js index d1d5d9f..dd43f6e 100644 --- a/common/common.js +++ b/common/common.js @@ -171,6 +171,27 @@ var dateFormat = function (msd) { // 时间转换 } return time; } + +var cardTypeFormat = function(num){ + if(num == '1'){ + return '单次券' + } + if(num == 2){ + return '时长券' + } + if(num == 3){ + return '满减券' + } + if(num == 4){ + return '金额券' + } + if(num == 5){ + return '包天券' + } + if(num == 6){ + return '折扣券' + } +} export default { // deviceInfo, hs_wxPay_appId, @@ -183,6 +204,7 @@ export default { requestSign, moneyFormat, dateFormat, + cardTypeFormat, // 接口 userLogin, indexInfo, diff --git a/pages/businessCard/cardDetail.vue b/pages/businessCard/cardDetail.vue index 24abad3..ae18a00 100644 --- a/pages/businessCard/cardDetail.vue +++ b/pages/businessCard/cardDetail.vue @@ -9,8 +9,8 @@ 所有类型 - - {{array[index]}} + + {{array[index].text}} @@ -22,8 +22,9 @@ 所有状态 - - {{arrayWay[indexWay]}} + + {{arrayWay[indexWay].text}} @@ -57,159 +58,167 @@ - - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -221,10 +230,21 @@ export default { }) return { title: 'picker', - array: ['单次券', '时长券', '满减券', '金额券', '包天券'], - arrayWay: ['已使用/绑定', '未使用'], + array: [ + {text: '单次券', id: 1}, + {text: '时长券', id: 2}, + {text: '满减券', id: 3}, + {text: '金额券', id: 4}, + {text: '包天券', id: 5}, + ], + arrayWay: [ + {text: '已使用/绑定', id: 1}, + {text: '未使用', id: 0}, + ], index: 0, indexWay: 0, + cardType: '1', //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券 + isUesed: '1', //1:已使用/绑定 0:未使用 beginTime: currentDate, endTime: currentDate, rows: [], @@ -259,16 +279,17 @@ export default { } }, methods: { + couponIssuedParkPage: function () { console.log(this.arrayWay) let that = this let paramsData = { pageNum: this.pageNum, pageSize: this.pageSize, - beginTime: this.beginTime, - endTime: this.endTime, - cardType: '', //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券 - isUesed: '1', //所有状态:已失效,已使用、未使用 + beginTime: this.beginTime+' 00:00:00', + endTime: this.endTime+' 23:59:59', + cardType: this.cardType.toString(), //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券 + isUesed: this.isUesed.toString(), //1:已使用/绑定 0:未使用 } // 首页信息获取 接口 that.$myRequest({ @@ -280,19 +301,26 @@ export default { console.log(this.dataList) }) }, - bindPickerChange: function (e) { + bindPickerChange: function (e, storage) { console.log('picker发送选择改变,携带值为', e.detail.value) this.index = e.detail.value + this.cardType = storage[this.index].id + this.couponIssuedParkPage() }, - bindPickerChangeWay: function (e) { - console.log('picker发送选择改变,携带值为', e.detail.value) + bindPickerChangeWay: function (e, storage) { + console.log(storage) this.indexWay = e.detail.value + this.isUesed = storage[this.indexWay].id + this.couponIssuedParkPage() }, bindStartDateChange: function (e) { + console.log(e.detail.value) this.beginTime = e.detail.value + this.couponIssuedParkPage() }, bindEndDateChange: function (e) { this.endTime = e.detail.value + this.couponIssuedParkPage() }, getDate(type) { const date = new Date();