Commit 4a92926022804550f943803a0253efca5c130d2f

Authored by 刘淇
1 parent 32694e4b

商户券明细

common/common.js
... ... @@ -171,6 +171,27 @@ var dateFormat = function (msd) { // 时间转换
171 171 }
172 172 return time;
173 173 }
  174 +
  175 +var cardTypeFormat = function(num){
  176 + if(num == '1'){
  177 + return '单次券'
  178 + }
  179 + if(num == 2){
  180 + return '时长券'
  181 + }
  182 + if(num == 3){
  183 + return '满减券'
  184 + }
  185 + if(num == 4){
  186 + return '金额券'
  187 + }
  188 + if(num == 5){
  189 + return '包天券'
  190 + }
  191 + if(num == 6){
  192 + return '折扣券'
  193 + }
  194 +}
174 195 export default {
175 196 // deviceInfo,
176 197 hs_wxPay_appId,
... ... @@ -183,6 +204,7 @@ export default {
183 204 requestSign,
184 205 moneyFormat,
185 206 dateFormat,
  207 + cardTypeFormat,
186 208 // 接口
187 209 userLogin,
188 210 indexInfo,
... ...
pages/businessCard/cardDetail.vue
... ... @@ -9,8 +9,8 @@
9 9 所有类型
10 10 </view>
11 11 <view class="uni-list-cell-db">
12   - <picker @change="bindPickerChange" :value="index" :range="array">
13   - <view class="uni-input">{{array[index]}}</view>
  12 + <picker @change="bindPickerChange($event,array)" :value="index" :range="array" :range-key="'text'">
  13 + <view class="uni-input">{{array[index].text}}</view>
14 14 </picker>
15 15 </view>
16 16 </view>
... ... @@ -22,8 +22,9 @@
22 22 所有状态
23 23 </view>
24 24 <view class="uni-list-cell-db">
25   - <picker @change="bindPickerChangeWay" :value="indexWay" :range="arrayWay">
26   - <view class="uni-input">{{arrayWay[indexWay]}}</view>
  25 + <picker @change="bindPickerChangeWay($event,arrayWay)" :value="indexWay" :range="arrayWay"
  26 + :range-key="'text'">
  27 + <view class="uni-input">{{arrayWay[indexWay].text}}</view>
27 28 </picker>
28 29 </view>
29 30 </view>
... ... @@ -57,159 +58,167 @@
57 58 </view>
58 59 </view>
59 60  
60   - <view v-for="(i, index) in dataList" :key="i.id">
61   - <uni-section :title="`${i.cardTypeName}(${i.cardType})`" type="line">
62   - <uni-list>
63   - <uni-list-item>
64   - <template v-slot:body>
65   - <view class="slot-box uni-con-width">
66   - <view class="uni-flex uni-space-between ">
67   - <view class="color-blue">
68   - JE000100011
  61 + <view v-if="dataList.length>0">
  62 + <view v-for="(i, index) in dataList" :key="i.id">
  63 + <!--<uni-section :title="i.cardRuleName+'('+i.cardType|cardTypeFormate+')'" type="line">-->
  64 + <uni-section :title="`${i.cardRuleName} (${$common.cardTypeFormat(i.cardType)})`" type="line">
  65 + <uni-list>
  66 + <uni-list-item>
  67 + <template v-slot:body>
  68 + <view class="slot-box uni-con-width">
  69 + <view class="uni-flex uni-space-between ">
  70 + <view class="color-blue">
  71 + {{i.cardNo}}
  72 + </view>
  73 + <view class="color-blue">
  74 + {{i.carNumber}}
  75 + </view>
69 76 </view>
70   - <view class="color-blue">
71   - {{i.carNumber}}
  77 + <view class="uni-flex uni-space-between" style="padding: 10px 0">
  78 + <view>
  79 + <text class="color-blue paddingRight">领取时间</text>
  80 + <uni-dateformat :date="i.issuedEffDate" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat>
  81 + </view>
  82 + <view class="color-green" v-if="i.isUesed=='1'">
  83 + 已使用
  84 + </view>
  85 + <view class="color-blue" v-else>
  86 + 未使用
  87 + </view>
72 88 </view>
73   - </view>
74   - <view class="uni-flex uni-space-between" style="padding: 10px 0">
75   - <view>
76   - <text class="color-blue paddingRight">领取时间</text>
77   - 2020-11-01 01:01:01
78   - </view>
79   - <view class="color-green">
80   - 已使用
  89 + <view class="uni-flex uni-space-between">
  90 + <view>
  91 + <text class="color-red paddingRight">使用时间</text>
  92 + <uni-dateformat v-if="i.isUesed=='1'" :date="i.usedDate" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat>
  93 + <uni-dateformat v-else :date="i.exp_data" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat>
  94 + </view>
  95 + <view class="color-green">
  96 + {{i.fullCutValue}}元/张
  97 + </view>
81 98 </view>
82 99 </view>
83   - <view class="uni-flex uni-space-between">
84   - <view>
85   - <text class="color-red paddingRight">使用时间</text>
86   - 2020-11-01 01:01:01
87   - </view>
88   - <view class="color-green">
89   - {{i.fullCutValue}}元/张
90   - </view>
91   - </view>
92   - </view>
93   - </template>
94   - </uni-list-item>
95   - </uni-list>
96   - </uni-section>
  100 + </template>
  101 + </uni-list-item>
  102 + </uni-list>
  103 + </uni-section>
  104 + </view>
97 105 </view>
98 106  
99 107  
100 108  
101 109  
102   - <uni-section title="8折(折扣券)" type="line">
103   - <uni-list>
104   - <uni-list-item>
105   - <template v-slot:body>
106   - <view class="slot-box uni-con-width">
107   - <view class="uni-flex uni-space-between ">
108   - <view class="color-blue">
109   - JE000100011
110   - </view>
111   - <view class="color-blue">
112   - 京A123456
113   - </view>
114   - </view>
115   - <view class="uni-flex uni-space-between" style="padding: 10px 0">
116   - <view>
117   - <text class="color-blue paddingRight">领取时间</text>
118   - 2020-11-01 01:01:01
119   - </view>
120   - <view class="color-green">
121   - 已使用
122   - </view>
123   - </view>
124   - <view class="uni-flex uni-space-between">
125   - <view>
126   - <text class="color-red paddingRight">使用时间</text>
127   - 2020-11-01 01:01:01
128   - </view>
129   - <view class="color-green">
130   - 5元/张
131   - </view>
132   - </view>
133   - </view>
134   - </template>
135   - </uni-list-item>
136   - </uni-list>
137   - </uni-section>
138 110  
  111 + <!--<uni-section title="8折(折扣券)" type="line">-->
  112 + <!--<uni-list>-->
  113 + <!--<uni-list-item>-->
  114 + <!--<template v-slot:body>-->
  115 + <!--<view class="slot-box uni-con-width">-->
  116 + <!--<view class="uni-flex uni-space-between ">-->
  117 + <!--<view class="color-blue">-->
  118 + <!--JE000100011-->
  119 + <!--</view>-->
  120 + <!--<view class="color-blue">-->
  121 + <!--京A123456-->
  122 + <!--</view>-->
  123 + <!--</view>-->
  124 + <!--<view class="uni-flex uni-space-between" style="padding: 10px 0">-->
  125 + <!--<view>-->
  126 + <!--<text class="color-blue paddingRight">领取时间</text>-->
  127 + <!--2020-11-01 01:01:01-->
  128 + <!--</view>-->
  129 + <!--<view class="color-green">-->
  130 + <!--已使用-->
  131 + <!--</view>-->
  132 + <!--</view>-->
  133 + <!--<view class="uni-flex uni-space-between">-->
  134 + <!--<view>-->
  135 + <!--<text class="color-red paddingRight">使用时间</text>-->
  136 + <!--2020-11-01 01:01:01-->
  137 + <!--</view>-->
  138 + <!--<view class="color-green">-->
  139 + <!--5元/张-->
  140 + <!--</view>-->
  141 + <!--</view>-->
  142 + <!--</view>-->
  143 + <!--</template>-->
  144 + <!--</uni-list-item>-->
  145 + <!--</uni-list>-->
  146 + <!--</uni-section>-->
139 147  
140   - <uni-section title="8折(折扣券)" type="line">
141   - <uni-list>
142   - <uni-list-item>
143   - <template v-slot:body>
144   - <view class="slot-box uni-con-width">
145   - <view class="uni-flex uni-space-between ">
146   - <view class="color-blue">
147   - JE000100011
148   - </view>
149   - <view class="color-blue">
150   - 京A123456
151   - </view>
152   - </view>
153   - <view class="uni-flex uni-space-between" style="padding: 10px 0">
154   - <view>
155   - <text class="color-blue paddingRight">领取时间</text>
156   - 2020-11-01 01:01:01
157   - </view>
158   - <view class="color-red">
159   - 已失效
160   - </view>
161   - </view>
162   - <view class="uni-flex uni-space-between">
163   - <view>
164   - <text class="color-red paddingRight">失效时间</text>
165   - 2020-11-01 01:01:01
166   - </view>
167   - <view class="color-green">
168   - 5元/张
169   - </view>
170   - </view>
171   - </view>
172   - </template>
173   - </uni-list-item>
174   - </uni-list>
175   - </uni-section>
176 148  
177   - <uni-section title="8折(折扣券)" type="line">
178   - <uni-list>
179   - <uni-list-item>
180   - <template v-slot:body>
181   - <view class="slot-box uni-con-width">
182   - <view class="uni-flex uni-space-between ">
183   - <view class="color-blue">
184   - JE000100011
185   - </view>
186   - <view class="color-blue">
187   - 京A123456
188   - </view>
189   - </view>
190   - <view class="uni-flex uni-space-between" style="padding: 10px 0">
191   - <view>
192   - <text class="color-blue paddingRight">领取时间</text>
193   - 2020-11-01 01:01:01
194   - </view>
195   - <view class="color-blue">
196   - 未使用
197   - </view>
198   - </view>
199   - <view class="uni-flex uni-space-between">
200   - <view>
201   - <text class="color-green paddingRight">有效截止</text>
202   - 2020-11-01 01:01:01
203   - </view>
204   - <view class="color-green">
205   - 5元/张
206   - </view>
207   - </view>
208   - </view>
209   - </template>
210   - </uni-list-item>
211   - </uni-list>
212   - </uni-section>
  149 + <!--<uni-section title="8折(折扣券)" type="line">-->
  150 + <!--<uni-list>-->
  151 + <!--<uni-list-item>-->
  152 + <!--<template v-slot:body>-->
  153 + <!--<view class="slot-box uni-con-width">-->
  154 + <!--<view class="uni-flex uni-space-between ">-->
  155 + <!--<view class="color-blue">-->
  156 + <!--JE000100011-->
  157 + <!--</view>-->
  158 + <!--<view class="color-blue">-->
  159 + <!--京A123456-->
  160 + <!--</view>-->
  161 + <!--</view>-->
  162 + <!--<view class="uni-flex uni-space-between" style="padding: 10px 0">-->
  163 + <!--<view>-->
  164 + <!--<text class="color-blue paddingRight">领取时间</text>-->
  165 + <!--2020-11-01 01:01:01-->
  166 + <!--</view>-->
  167 + <!--<view class="color-red">-->
  168 + <!--已失效-->
  169 + <!--</view>-->
  170 + <!--</view>-->
  171 + <!--<view class="uni-flex uni-space-between">-->
  172 + <!--<view>-->
  173 + <!--<text class="color-red paddingRight">失效时间</text>-->
  174 + <!--2020-11-01 01:01:01-->
  175 + <!--</view>-->
  176 + <!--<view class="color-green">-->
  177 + <!--5元/张-->
  178 + <!--</view>-->
  179 + <!--</view>-->
  180 + <!--</view>-->
  181 + <!--</template>-->
  182 + <!--</uni-list-item>-->
  183 + <!--</uni-list>-->
  184 + <!--</uni-section>-->
  185 +
  186 + <!--<uni-section title="8折(折扣券)" type="line">-->
  187 + <!--<uni-list>-->
  188 + <!--<uni-list-item>-->
  189 + <!--<template v-slot:body>-->
  190 + <!--<view class="slot-box uni-con-width">-->
  191 + <!--<view class="uni-flex uni-space-between ">-->
  192 + <!--<view class="color-blue">-->
  193 + <!--JE000100011-->
  194 + <!--</view>-->
  195 + <!--<view class="color-blue">-->
  196 + <!--京A123456-->
  197 + <!--</view>-->
  198 + <!--</view>-->
  199 + <!--<view class="uni-flex uni-space-between" style="padding: 10px 0">-->
  200 + <!--<view>-->
  201 + <!--<text class="color-blue paddingRight">领取时间</text>-->
  202 + <!--2020-11-01 01:01:01-->
  203 + <!--</view>-->
  204 + <!--<view class="color-blue">-->
  205 + <!--未使用-->
  206 + <!--</view>-->
  207 + <!--</view>-->
  208 + <!--<view class="uni-flex uni-space-between">-->
  209 + <!--<view>-->
  210 + <!--<text class="color-green paddingRight">有效截止</text>-->
  211 + <!--2020-11-01 01:01:01-->
  212 + <!--</view>-->
  213 + <!--<view class="color-green">-->
  214 + <!--5元/张-->
  215 + <!--</view>-->
  216 + <!--</view>-->
  217 + <!--</view>-->
  218 + <!--</template>-->
  219 + <!--</uni-list-item>-->
  220 + <!--</uni-list>-->
  221 + <!--</uni-section>-->
213 222 </view>
214 223 </template>
215 224  
... ... @@ -221,10 +230,21 @@ export default {
221 230 })
222 231 return {
223 232 title: 'picker',
224   - array: ['单次券', '时长券', '满减券', '金额券', '包天券'],
225   - arrayWay: ['已使用/绑定', '未使用'],
  233 + array: [
  234 + {text: '单次券', id: 1},
  235 + {text: '时长券', id: 2},
  236 + {text: '满减券', id: 3},
  237 + {text: '金额券', id: 4},
  238 + {text: '包天券', id: 5},
  239 + ],
  240 + arrayWay: [
  241 + {text: '已使用/绑定', id: 1},
  242 + {text: '未使用', id: 0},
  243 + ],
226 244 index: 0,
227 245 indexWay: 0,
  246 + cardType: '1', //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券
  247 + isUesed: '1', //1:已使用/绑定 0:未使用
228 248 beginTime: currentDate,
229 249 endTime: currentDate,
230 250 rows: [],
... ... @@ -259,16 +279,17 @@ export default {
259 279 }
260 280 },
261 281 methods: {
  282 +
262 283 couponIssuedParkPage: function () {
263 284 console.log(this.arrayWay)
264 285 let that = this
265 286 let paramsData = {
266 287 pageNum: this.pageNum,
267 288 pageSize: this.pageSize,
268   - beginTime: this.beginTime,
269   - endTime: this.endTime,
270   - cardType: '', //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券
271   - isUesed: '1', //所有状态:已失效,已使用、未使用
  289 + beginTime: this.beginTime+' 00:00:00',
  290 + endTime: this.endTime+' 23:59:59',
  291 + cardType: this.cardType.toString(), //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券
  292 + isUesed: this.isUesed.toString(), //1:已使用/绑定 0:未使用
272 293 }
273 294 // 首页信息获取 接口
274 295 that.$myRequest({
... ... @@ -280,19 +301,26 @@ export default {
280 301 console.log(this.dataList)
281 302 })
282 303 },
283   - bindPickerChange: function (e) {
  304 + bindPickerChange: function (e, storage) {
284 305 console.log('picker发送选择改变,携带值为', e.detail.value)
285 306 this.index = e.detail.value
  307 + this.cardType = storage[this.index].id
  308 + this.couponIssuedParkPage()
286 309 },
287   - bindPickerChangeWay: function (e) {
288   - console.log('picker发送选择改变,携带值为', e.detail.value)
  310 + bindPickerChangeWay: function (e, storage) {
  311 + console.log(storage)
289 312 this.indexWay = e.detail.value
  313 + this.isUesed = storage[this.indexWay].id
  314 + this.couponIssuedParkPage()
290 315 },
291 316 bindStartDateChange: function (e) {
  317 + console.log(e.detail.value)
292 318 this.beginTime = e.detail.value
  319 + this.couponIssuedParkPage()
293 320 },
294 321 bindEndDateChange: function (e) {
295 322 this.endTime = e.detail.value
  323 + this.couponIssuedParkPage()
296 324 },
297 325 getDate(type) {
298 326 const date = new Date();
... ...