Blame view

pages/moneyRecharge/moneyRecharge.vue 4.25 KB
4b045f7c   刘淇   江阴初始化项目
1
  <template>
3b7af3a2   chenbiao   add 我的钱包 接口联调
2
3
4
5
6
7
8
9
10
11
12
  	<view>
  
  		<view class="rechargeTop">
  			<view class="toDetail uni-list-cell-pd uni-right" @click="detailCell">明细 ></view>
  			<view class="rechargeNum uni-center">¥{{acctBalance | toFixed2 }}</view>
  		</view>
  
  		<uni-section title="充值金额" type="line" padding>
  			<uni-grid :column="3" :highlight="true" :showBorder="false" :square="false" @change="change">
  				<uni-grid-item v-for="(item, index) in ListData" :index="index" :key="index">
  					<view class="grid-item-box" style="background-color: #fff;">
b398dc4a   chenbiao   add 我的钱包 接口联调
13
14
15
  						<view class="text" :class="currentIndex==index?'itemActive':''">
  							{{item.rechargeCode | ortherToFixed}}
  						</view>
3b7af3a2   chenbiao   add 我的钱包 接口联调
16
17
18
  					</view>
  				</uni-grid-item>
  			</uni-grid>
afb4daec   chenbiao   add
19
  			<view  :class="isShowInput ? 'jy-fix-height34' : 'display-none'">
b398dc4a   chenbiao   add 我的钱包 接口联调
20
21
22
  				<input class="jy-fix-height34 uni-list-cell-hover" type="digit" v-model="rechargeNum"
  					placeholder=" 请输入金额" />
  			</view>
3b7af3a2   chenbiao   add 我的钱包 接口联调
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
  		</uni-section>
  
  		<view class="uni-list-cell-pd">
  			温馨提示:暂不支持退款,请谨慎选择充值金额!
  		</view>
  		<view class="border-bg"></view>
  
  		<view class="order-title">
  			支付方法
  		</view>
  		<view class="order-line"></view>
  
  		<view class="orderwaysview">
  			<image src="../../static/orderInfo/orderinfo-wechat.png" class="orderways"></image>
  			<view class="order-info" style="margin-left: 8px;">
  				微信支付
  			</view>
  			<image src="../../static/orderInfo/orderinfo-sel.png" class="orderwaysSel"></image>
  		</view>
  
  		<button @click="payClick" class="button-sp-area" type="primary" plain="true">确认充值</button>
  
  	</view>
4b045f7c   刘淇   江阴初始化项目
46
47
48
  </template>
  
  <script>
3b7af3a2   chenbiao   add 我的钱包 接口联调
49
50
51
52
  	export default {
  		data() {
  			return {
  				acctBalance: '0.00',
b398dc4a   chenbiao   add 我的钱包 接口联调
53
  				ListData: [],
3b7af3a2   chenbiao   add 我的钱包 接口联调
54
  				currentIndex: 0,
62cee34d   chenbiao   add
55
  				isShowInput: false,
b398dc4a   chenbiao   add 我的钱包 接口联调
56
  				rechargeNum: '',
3b7af3a2   chenbiao   add 我的钱包 接口联调
57
58
59
60
61
62
  			}
  		},
  		onLoad() {
  
  		},
  		mounted() {
b398dc4a   chenbiao   add 我的钱包 接口联调
63
64
65
  			this.recharge();
  			this.rechargeList();
  
93c5ecb3   chenbiao   add 添加filter.js 设...
66
  		},
3b7af3a2   chenbiao   add 我的钱包 接口联调
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  		methods: {
  			recharge() {
  				let that = this;
  				that.$myRequest({
  					url: that.$common.walletAccount,
  					method: 'POST',
  					data: that.$common.requestSign()
  				}).then(res => {
  
  					console.log(res)
  					let data = res.data;
  					that.acctBalance = data.acctBalance;
  
  				})
  			},
b398dc4a   chenbiao   add 我的钱包 接口联调
82
83
84
85
86
87
88
  			rechargeList() {
  				let that = this;
  				that.$myRequest({
  					url: that.$common.rechargeList,
  					method: 'POST',
  					data: that.$common.requestSign()
  				}).then(res => {
3b7af3a2   chenbiao   add 我的钱包 接口联调
89
  
b398dc4a   chenbiao   add 我的钱包 接口联调
90
91
92
  					console.log(res)
  					let data = res.data;
  					that.ListData = data;
3b7af3a2   chenbiao   add 我的钱包 接口联调
93
  
b398dc4a   chenbiao   add 我的钱包 接口联调
94
95
96
97
  				})
  			},
  			change(e) {
  				let that = this;
3b7af3a2   chenbiao   add 我的钱包 接口联调
98
99
  				let {
  					index
b398dc4a   chenbiao   add 我的钱包 接口联调
100
101
102
103
104
105
106
107
108
  				} = e.detail;
  				that.currentIndex = index;
  
  				if (that.ListData[index].rechargeCode == -1) {
  					console.log('1')
  					that.isShowInput = true;
  					that.rechargeNum = ''
  				}
  				that.isShowInput = false;
3b7af3a2   chenbiao   add 我的钱包 接口联调
109
110
  			},
  			detailCell() {
b398dc4a   chenbiao   add 我的钱包 接口联调
111
  
3b7af3a2   chenbiao   add 我的钱包 接口联调
112
113
114
  			}
  		}
  	}
4b045f7c   刘淇   江阴初始化项目
115
116
117
  </script>
  
  <style scoped lang="scss">
3b7af3a2   chenbiao   add 我的钱包 接口联调
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
  	.rechargeTop {
  		height: 100px;
  		background: #007AFF;
  		color: #fff;
  		position: relative;
  	}
  
  	.toDetail {
  		/*text-align: right;*/
  
  	}
  
  	.rechargeNum {
  		font-size: 30px;
  	}
  
  	.text {
  		width: 80%;
  		height: 60px;
  		line-height: 60px;
  		margin: 10px auto;
  		border: 1px solid #ccc;
  		text-align: center;
  	}
  
  	.itemActive {
  		background: #f0ad4e;
  	}
  
  	.order-title {
  		font-size: 18px;
  		margin-left: 16px;
  		margin-top: 15px;
  		font-weight: bold;
  		color: #404040;
  	}
  
  	.order-info {
  		font-size: 14px;
  		margin-left: 15px;
  		margin-top: 12px;
  		color: #404040;
  	}
  
  	.order-line {
  		background: #D9D9D9;
  		height: 1px;
  		margin-top: 12px;
  		margin-left: 15px;
  		padding: 0px;
  		overflow: hidden;
  		/* 透明度 */
  		opacity: 0.5;
  	}
  
  	.order-line-bold {
  		background: #FAFAFA;
  		height: 12px;
  		margin-top: 12px;
  		padding: 0px;
  		overflow: hidden;
  	}
  
  	.flex-row-justify-between {
  		display: flex;
  		flex-direction: row;
  		justify-content: space-between;
  	}
  
  	.flex-row-justify-end {
  		display: flex;
  		flex-direction: row;
  		/* 水平对齐*/
  		align-items: baseline;
  
  	}
  
  	.order-discount {
  		color: #C8C7CC;
  		margin-right: 20 upx;
  		/* margin-right: 12px ; */
  		/* margin-top:12px ; */
  
  	}
  
  	.orderwaysview {
  		display: flex;
  		flex-direction: row;
  	}
  
  	.orderways {
  		width: 18px;
  		height: 18px;
  		margin-left: 15px;
  		margin-top: 14px;
  	}
  
  	.orderwaysSel {
  		width: 16px;
  		height: 16px;
  		margin-left: auto;
  		margin-right: 14px;
  		margin-top: 14px;
  		/* justify-content:flex-end; */
  	}
  
  	.button-sp-area {
  		margin: 0 auto;
  		width: 60%;
  		margin-top: 40px;
  
  	}
4b045f7c   刘淇   江阴初始化项目
230
  </style>