conquestCell.js
3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// tabOperating/pages/index/components/conquestCell/conquestCell.js
import api from '../../../../api'
Component({
/**
* 组件的属性列表
*/
properties: {
date: {
type: String,
observer: function (n) {
console.log(n)
this.getbusinessList(n)
// if (n) this.getLetter()
}
}, // 查询日期
hidden: {
// 刷新列表
type: Boolean,
observer: function (n) {}
}
// date: String
},
/**
* 组件的初始数据
*/
data: {
orderObj: {
orderCount: 0,
upgradeCount: 0,
list: []
},
orderItem: [
{
label: '车架号',
prop: 'standNo',
required: true
},
{
label: '抵用礼券',
prop: 'couponName',
required: true
},
{
label: '领券时间',
prop: 'couponPickUpDate',
required: true
},
{
label: '拒升理由',
prop: 'refusalReason'
},
{
label: '购买商品',
prop: 'subOrders'
}
// {
// label: '支付方式',
// prop: 'payType'
// }
// {
// label: '',
// prop: ''
// }
],
payType: {
0: '战败',
1: '微信支付',
2: '门店收款',
3: 'POS机收款'
}
},
/**
* 组件的方法列表
*/
methods: {
refreshList() {
let { date } = this.data
this.getbusinessList(date)
},
getbusinessList(n) {
wx.$util.showLoading('加载中...')
let params = {
installUpgradeBeginTimeStr: n + ' 00:00:00',
installUpgradeEndTimeStr: n + ' 23:59:59'
}
api
.listForBusinessView(params)
.then(result => {
wx.hideLoading()
let { data, code } = result
// console.log(result)
if (code == '0') {
// 处理时间戳
data.list = data.list.map(item => {
// console.log(wx.$util.tsFormatTime)
item.couponPickUpDate = wx.$util.tsFormatTime(item.couponPickUpDate)
item.installUpgradeTime = wx.$util.tsFormatTime(item.installUpgradeTime, 'h:m')
return item
})
this.setData({
orderObj: data,
triggered: false
})
}
})
.catch(err => {
console.log(err)
})
// console.log()
},
showSellBox(e) {
let { orderObj } = this.data
let { index } = e.currentTarget.dataset
// console.log(index)
let active = orderObj.list[index].active
orderObj.list[index].active = active ? false : true
this.setData({
orderObj
})
}
},
/** 组件生命周期 */
lifetimes: {
// attached: function () {
// // 支付方式为微信
// console.log('attached')
// // console.log(this.data)
// // console.log(this)
// if (this.data.orderType == 1) {
// this.createWxQrcode()
// }
// }
// },
ready() {
// console.log('ready')
// console.log(this)
// console.log(this.data)
// let { date } = this.data
// console.log(this.data)
// console.log(date)
// wx.$util.showLoading('加载中...')
// setTimeout(() => {
// wx.$util.hideLoading()
// }, 2000)
}
}
})