buyPop.vue
6.6 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
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<template>
<!-- 购买弹窗 -->
<view class="">
<!-- 底部按钮弹出成 -->
<u-popup :show="show" mode="bottom" :closeable="true" round="18" @close="close" @open="open">
<view class="popBox" :class="isIos?'':'btom'">
<!-- 价格 -->
<view class="topBox flexA">
<image :src="formList.spec_image ? formList.spec_image : shopDetailes.image" mode=""></image>
<view class="price">
<text>¥</text>{{formList.goods_price ? formList.goods_price : shopDetailes.spec[0].goods_price}}
</view>
</view>
<!-- 选择收货 -->
<view class="adressBox flexJ" v-if="shopAddress==null" @click="checkAderess">
<view class="left flexA">
<image src="/static/adressIc.png" mode=""></image>
请选择收货地址
</view>
<image src="/static/carIc/rights.png" mode=""></image>
</view>
<!-- 收货位置 -->
<view class="adressInfo flexJ" v-else @click="checkAderess">
<view class="infoBox">
<view class="adresInfo flexA">
<image src="/static/carIc/postion.png" mode=""></image>
{{shopAddress.zone}}{{shopAddress.address}}
</view>
<view class="phone">
{{shopAddress.name}}<text>{{shopAddress.mobile.slice(0,3) + '****' + shopAddress.mobile.slice(-4) }}</text>
</view>
</view>
<image src="/static/carIc/rights.png" mode=""></image>
</view>
<!-- 商品规格 -->
<view v-for="(item,index) in speList" :key="item.group_id" style="margin-bottom: 44rpx;">
<view class="specificationsTile">
{{item.group_name}}
</view>
<view class="colorBox">
<view class="item" v-for="(it,idx) in item.spec_items" :key="it.item_id"
:class="idx == indexList[index].curIndex?'checked':''" @click="checkSpec(index,it,idx)">
{{it.spec_value}}
</view>
</view>
</view>
<!-- 分割线 -->
<view class="line"></view>
<!-- 数量加减 -->
<view class="numBox flexJ">
<view class="rightTitle flexA">
购买数量 <view v-if="formList.stock_num" class="surplus">剩余:{{formList.stock_num}}件</view>
</view>
<view class="and flexA">
<image src="/static/reduce.png" mode="" @click="numBtn(0)"></image>
<view class="num flexC">{{num}}</view>
<image src="/static/add.png" mode="" @click="numBtn(1)"></image>
</view>
</view>
<!-- 加入购物车按钮 -->
<view v-if="btnType==1" class="popBtn flexC" @click="addBuy" :class="checkAll?'checkA':''">
加入购物车
</view>
<!-- 立即购买按钮 -->
<view v-else class="popBtn1 flexC" @click="payBtn" :class="formList.stock_num==0?'notHave':''">
{{formList.stock_num==0?'缺货':'立即支付'}}
<view v-if="payMoney>0" class="payMoney flexA"><text>¥</text>{{payMoney}}</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
</script>
<style lang="scss">
.popBox {
padding: 30rpx 24rpx 0;
.topBox {
margin-left: 8rpx;
image {
border-radius: 12rpx;
margin-right: 24rpx;
width: 134rpx;
height: 138rpx;
}
.price {
font-size: 36rpx;
font-weight: 700;
color: #E9422C;
text {
font-size: 28rpx;
color: #E9422C;
}
}
}
.adressBox {
padding: 42rpx 24rpx;
box-sizing: border-box;
width: 702rpx;
height: 120rpx;
border-radius: 16rpx;
background: #f5f5f5ff;
margin: 24rpx 0;
.left {
color: #000000e6;
font-size: 28rpx;
font-weight: 700;
image {
margin-right: 8rpx;
width: 32rpx;
height: 32rpx;
}
}
image {
width: 16rpx;
height: 32rpx;
}
}
.adressInfo {
border-radius: 16rpx;
background: #f5f5f5ff;
padding: 20rpx 24rpx 22rpx;
box-sizing: border-box;
margin: 24rpx 0;
.infoBox {
.adresInfo {
margin-bottom: 9rpx;
color: #323233ff;
font-size: 28rpx;
font-weight: 700;
image {
margin-right: 8rpx;
width: 32rpx;
height: 32rpx;
}
}
.phone {
color: #646566ff;
font-size: 24rpx;
margin-left: 40rpx;
text {
margin-left: 16rpx;
}
}
}
image {
width: 16rpx;
height: 32rpx;
}
}
.specificationsTile {
color: #00000099;
font-size: 28rpx;
margin-bottom: 16rpx;
border: 1rpx solid transparent;
}
.colorBox {
display: flex;
flex-wrap: wrap;
.item {
margin-right: 16rpx;
padding: 8rpx 32rpx;
border-radius: 46rpx;
color: #000;
font-size: 24rpx;
background: #1918330f;
border: 1rpx solid transparent;
}
.checked {
color: #f43736ff;
font-size: 24rpx;
border-radius: 46rpx;
border: 1rpx solid #f43736ff;
background: #fff1efff;
}
}
.line {
margin: 44rpx auto 34rpx;
width: 702rpx;
height: 2rpx;
background: #F5F5F5;
}
.numBox {
margin-bottom: 54rpx;
.rightTitle {
color: #00000099;
font-size: 28rpx;
.surplus {
margin-left: 12rpx;
color: #ec3323ff;
font-size: 24rpx;
}
}
.and {
image {
width: 56rpx;
height: 56rpx;
}
.num {
width: 64rpx;
height: 56rpx;
color: #333333ff;
font-size: 28rpx;
background: #f2f3f5ff;
margin: 0 4rpx;
}
}
}
.textarea {
position: relative;
textarea {
padding: 24rpx 16rpx 16rpx 24rpx;
box-sizing: border-box;
width: 702rpx;
height: 148rpx;
border-radius: 16rpx;
background: #f5f5f5ff;
color: #000;
font-size: 28rpx;
}
.count {
position: absolute;
color: #00000066;
font-size: 24rpx;
right: 16rpx;
bottom: 16rpx;
}
}
.payBox {
margin-top: 48rpx;
.payMode {
color: #000000e6;
font-size: 28rpx;
image {
margin-right: 12rpx;
width: 32rpx;
height: 32rpx;
}
}
.yue {
color: #F33F2E;
font-size: 30rpx;
font-weight: 700;
text {
margin-top: 5rpx;
color: #F33F2E;
font-size: 24rpx;
}
}
}
.popBtn {
margin: 50rpx auto 0;
width: 686rpx;
height: 88rpx;
border-radius: 80rpx;
color: #ffffffff;
font-size: 32rpx;
font-weight: 700;
background: #00000029;
}
.checkA {
background: linear-gradient(-89.3deg, #ffc24aff 0%, #ffab07ff 100%);
}
.popBtn1 {
margin: 50rpx auto 0;
width: 686rpx;
height: 88rpx;
border-radius: 96rpx;
opacity: 1;
color: #ffffffff;
font-size: 32rpx;
font-weight: 700;
background: linear-gradient(-88deg, #ff5e2bff 0%, #ec3323ff 100%);
.payMoney {
color: #ffffffff;
font-size: 36rpx;
font-weight: 700;
text {
font-size: 24rpx;
margin: 8rpx 3rpx 0;
}
}
}
.notHave {
background: #ffd5d1ff;
}
}
</style>