|
@@ -51,8 +51,7 @@
|
51
|
51
|
<div class="flex-item">
|
52
|
52
|
<div>
|
53
|
53
|
<span>卡券货值总额:</span>
|
54
|
|
- <span>¥1000</span>
|
55
|
|
- <span>万</span>
|
|
54
|
+ <span>¥{{cardTotalCount}}</span>
|
56
|
55
|
</div>
|
57
|
56
|
</div>
|
58
|
57
|
<a @click="toSalesHistory">销售记录</a>
|
|
@@ -141,6 +140,11 @@ export default {
|
141
|
140
|
name: '',
|
142
|
141
|
data () {
|
143
|
142
|
return {
|
|
143
|
+ cardTotalCount: 0,
|
|
144
|
+ postCouponData: {
|
|
145
|
+ page: 1,
|
|
146
|
+ pageSize: 10
|
|
147
|
+ },
|
144
|
148
|
postCardData: {
|
145
|
149
|
page: 1,
|
146
|
150
|
pageSize: 10
|
|
@@ -256,30 +260,40 @@ export default {
|
256
|
260
|
scroll
|
257
|
261
|
},
|
258
|
262
|
created () {
|
259
|
|
- this.getMyCardList({
|
260
|
|
- ...this.postCardData
|
261
|
|
- }).then((res) => {
|
262
|
|
- console.log(JSON.stringify(res))
|
263
|
|
- for (var n = 0; n < res.list.length; n++) {
|
264
|
|
- this.data[1].list.push({
|
265
|
|
- invalid: '',
|
266
|
|
- price: res.list[n].Price,
|
267
|
|
- title: res.list[n].CardName,
|
268
|
|
- desc: 'xxx',
|
269
|
|
- startDate: this.toolClass.dateFormat(res.list[n].StartDate),
|
270
|
|
- endDate: this.toolClass.dateFormat(res.list[n].EndDate),
|
271
|
|
- totalCount: res.list[n].TotalCount,
|
272
|
|
- SentCount: res.list[n].SentCount,
|
273
|
|
- usedCount: res.list[n].UsedCount,
|
274
|
|
- // title: res.list[n].CardName,
|
275
|
|
- // desc: '描述',
|
276
|
|
- // time: this.toolClass.dateFormat(res.list[n].EndDate),
|
277
|
|
- // useType: '未使用',
|
278
|
|
- // tag: '共享'
|
279
|
|
- })
|
280
|
|
- }
|
281
|
|
- console.log(JSON.stringify(this.data[1].list))
|
282
|
|
- })
|
|
263
|
+ if (this.userInfo.customer.MapUser !== '') {
|
|
264
|
+ this.getForbidInfo().then((res) => {
|
|
265
|
+ console.log(JSON.stringify(res))
|
|
266
|
+ })
|
|
267
|
+ this.getMyCouponList({
|
|
268
|
+ ...this.postCouponData
|
|
269
|
+ }).then((res) => {
|
|
270
|
+ console.log(JSON.stringify(res))
|
|
271
|
+ })
|
|
272
|
+ this.getMyCardList({
|
|
273
|
+ ...this.postCardData
|
|
274
|
+ }).then((res) => {
|
|
275
|
+ console.log(JSON.stringify(res))
|
|
276
|
+ res.list = res.list || []
|
|
277
|
+ for (var n = 0; n < res.list.length; n++) {
|
|
278
|
+ this.data[1].list.push({
|
|
279
|
+ invalid: this.returnInvalid(res.list[n]),
|
|
280
|
+ price: res.list[n].Price,
|
|
281
|
+ title: res.list[n].CardName,
|
|
282
|
+ desc: res.list[n].Share.CardUseRule,
|
|
283
|
+ startDate: this.toolClass.dateFormat(res.list[n].StartDate),
|
|
284
|
+ endDate: this.toolClass.dateFormat(res.list[n].EndDate),
|
|
285
|
+ totalCount: res.list[n].TotalCount,
|
|
286
|
+ SentCount: res.list[n].SentCount,
|
|
287
|
+ usedCount: res.list[n].UsedCount,
|
|
288
|
+ })
|
|
289
|
+ }
|
|
290
|
+ var count = 0
|
|
291
|
+ for (var n = 0; n < this.data[1].list.length; n++) {
|
|
292
|
+ count += this.data[1].list[n].price * this.data[1].list[n].totalCount - 0
|
|
293
|
+ }
|
|
294
|
+ this.cardTotalCount = count.toFixed(2)
|
|
295
|
+ })
|
|
296
|
+ }
|
283
|
297
|
this.getCaseList().then((res) => {
|
284
|
298
|
this.topCaseInfoData.CaseName = res.cases[0].CaseName
|
285
|
299
|
this.topCaseInfoData.CaseId = res.cases[0].CaseId
|
|
@@ -297,6 +311,8 @@ export default {
|
297
|
311
|
methods: {
|
298
|
312
|
...mapUserCenterActions([
|
299
|
313
|
'getMyCardList',
|
|
314
|
+ 'getMyCouponList',
|
|
315
|
+ 'getForbidInfo',
|
300
|
316
|
]),
|
301
|
317
|
...actions([
|
302
|
318
|
'getCaseList',
|
|
@@ -309,8 +325,11 @@ export default {
|
309
|
325
|
]),
|
310
|
326
|
...mapCustomerActions(['getCustomerList']),
|
311
|
327
|
...mapCardActions(['getCardList']),
|
|
328
|
+ returnInvalid (item) {
|
|
329
|
+ return false
|
|
330
|
+ },
|
312
|
331
|
toSalesHistory () {
|
313
|
|
- console.log(this.getUrl('salesRecord'))
|
|
332
|
+ //console.log(this.getUrl('salesRecord'))
|
314
|
333
|
window.location.href = this.getUrl('salesRecord')
|
315
|
334
|
},
|
316
|
335
|
getUrl (val) {
|