Commit 1b4b4938a06f42ff5d1d7fab5cb2aac6d0f26d87
1 parent
78c1e13726
Exists in
master
auto commit the code by alias command
Showing
16 changed files
with
3817 additions
and
3622 deletions
Show diff stats
src/components/BottomSheet/BottomSheet.vue
1 | 1 | <template> |
2 | 2 | <view class="BottomSheetContent"> |
3 | - <view class="sheet" :class="{sheetShow:isShowBottom,sheeHide:!isShowBottom}" @touchmove.stop.prevent="moveHandle" @click="closeSheet()"> | |
4 | - <scroll-view scroll-y="true" class="sheetView" :class="{sheetView_active:isShowBottom}" @click.stop="stopEvent()" > | |
3 | + <view class="sheet" :class="{sheetShow:isShowBottom,sheeHide:!isShowBottom}" | |
4 | + @touchmove.stop.prevent="moveHandle" @click="closeSheet()"> | |
5 | + <scroll-view scroll-y="true" class="sheetView" :class="{sheetView_active:isShowBottom}" | |
6 | + @click.stop="stopEvent()"> | |
5 | 7 | <view class="BottomSheetContent"> |
6 | - <view class="goodInfo"> | |
7 | - <view class="imageWrap"> | |
8 | - <image | |
9 | - :src="skuItem.pic" | |
10 | - mode="aspectFill" | |
11 | - style="width: 188rpx;height: 168rpx;" | |
12 | - | |
13 | - ></image> | |
14 | - | |
15 | - </view> | |
16 | - <view class="infoRight"> | |
17 | - <text class="goodName">{{goodInfo.p_name}}</text> | |
18 | - <text class="remarks">支持7天无理由退货 顺丰发货</text> | |
19 | - <view class="priceBox"> | |
20 | - <view class="price">¥{{skuItem.real_price || '暂无'}}</view> | |
21 | - <text>(限购{{maxCount}}副)</text> | |
22 | - <view class="counter"> | |
23 | - <view | |
24 | - class="btn" | |
25 | - disabled="this.addDisabled" | |
26 | - type="default" | |
27 | - @click="counter(false)" | |
28 | - >-</view> | |
29 | - <text>{{count}}</text> | |
30 | - <view | |
31 | - class="btn" | |
32 | - disabled="this.desDisabled" | |
33 | - type="default" | |
34 | - @click="counter(true)" | |
35 | - >+</view> | |
36 | - </view> | |
37 | - </view> | |
38 | - </view> | |
39 | - </view> | |
40 | - <view class="peopleChoose"> | |
41 | - <view class="title">选择使用人</view> | |
42 | - <view class="loveList"> | |
43 | - <view class="peopleName" v-for="(item,index) in loveList" :key='index' :class="{ active2: loveCurrent === index }" | |
44 | - @click="onClickLoveItem(index,item.name)"> | |
45 | - {{item.name}} | |
46 | - </view> | |
47 | - </view> | |
48 | - </view> | |
49 | - <view class="goods-data" v-if="isCart !== 3"> | |
50 | - <view class="opCollapse"> | |
51 | - <view class="body"> | |
52 | - <template v-if="opIsOpen"> | |
53 | - <view class="goods-form"> | |
54 | - <view class="p1"> | |
55 | - <image class="image2" src="../../static/img/myOpticsData/dataWrite.png" mode="aspectFit"></image> | |
56 | - 填写验光数据 | |
57 | - </view> | |
58 | - <text class="p2">没有验光数据?请到线下眼镜店验光哦~</text> | |
59 | - <view class="picker"> | |
60 | - <view class="picker-choice"> | |
61 | - <view class="choice-left"> | |
62 | - <text class="pd">验光单取名:</text> | |
63 | - </view> | |
64 | - <input type="text" @blur="handleInput" class="input" | |
65 | - placeholder="请输入名称" maxlength="20" :value="name" /> | |
66 | - </view> | |
67 | - </view> | |
68 | - <view class="picker" > | |
69 | - <view class="picker-choice"> | |
70 | - <view class="choice-left"> | |
71 | - <text class="p11">{{pickerInfoList[0].nameC}}</text> | |
72 | - <text class="p12">{{pickerInfoList[0].nameE}}</text> | |
73 | - </view> | |
74 | - <text class="p13">左 (OD)</text> | |
75 | - <!-- <text class="p14">{{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}}</text> --> | |
76 | - <picker @change="bindPickerChange01" :value="pickerInfoList[0].nameIndex1" :range="pickerInfoList[0].nameArray1"> | |
77 | - <view class="p14"> | |
78 | - {{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}} | |
79 | - <image src="../../static/detail-tabicon.png" ></image> | |
80 | - </view> | |
81 | - <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
82 | - </picker> | |
83 | - <text class="p13">右 (OS)</text> | |
84 | - <!-- <text class="p14">{{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}}</text> --> | |
85 | - <picker @change="bindPickerChange02" :value="pickerInfoList[0].nameIndex2" :range="pickerInfoList[0].nameArray2"> | |
86 | - <view class="p14"> | |
87 | - {{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}} | |
88 | - <image src="../../static/detail-tabicon.png" ></image> | |
89 | - </view> | |
90 | - <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
91 | - </picker> | |
92 | - </view> | |
93 | - </view> | |
94 | - <view class="picker" > | |
95 | - <view class="picker-choice"> | |
96 | - <view class="choice-left"> | |
97 | - <text class="p11">{{pickerInfoList[1].nameC}}</text> | |
98 | - <text class="p12">{{pickerInfoList[1].nameE}}</text> | |
99 | - </view> | |
100 | - <text class="p13">左 (OD)</text> | |
101 | - <!-- <text class="p14">{{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}}</text> --> | |
102 | - <picker @change="bindPickerChange11" :value="pickerInfoList[1].nameIndex1" :range="pickerInfoList[1].nameArray1"> | |
103 | - <view class="p14"> | |
104 | - {{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}} | |
105 | - <image src="../../static/detail-tabicon.png" ></image> | |
106 | - </view> | |
107 | - <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
108 | - </picker> | |
109 | - <text class="p13">右 (OS)</text> | |
110 | - <!-- <text class="p14">{{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}}</text> --> | |
111 | - <picker @change="bindPickerChange12" :value="pickerInfoList[1].nameIndex2" :range="pickerInfoList[1].nameArray2"> | |
112 | - <view class="p14"> | |
113 | - {{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}} | |
114 | - <image src="../../static/detail-tabicon.png" ></image> | |
115 | - </view> | |
116 | - <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
117 | - </picker> | |
118 | - </view> | |
119 | - </view> | |
120 | - <view class="picker" > | |
121 | - <view class="picker-choice"> | |
122 | - <view class="choice-left"> | |
123 | - <text class="p11">{{pickerInfoList[2].nameC}}</text> | |
124 | - <text class="p12">{{pickerInfoList[2].nameE}}</text> | |
125 | - </view> | |
126 | - <text class="p13">左 (OD)</text> | |
127 | - <picker @change="bindPickerChange21" :value="pickerInfoList[2].nameIndex1" :range="pickerInfoList[2].nameArray1"> | |
128 | - <view class="p14"> | |
129 | - {{pickerInfoList[2].nameArray1[pickerInfoList[2].nameIndex1]}} | |
130 | - <image src="../../static/detail-tabicon.png" ></image> | |
131 | - </view> | |
132 | - </picker> | |
133 | - <text class="p13">右 (OS)</text> | |
134 | - <!-- <text class="p14">{{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}}</text> --> | |
135 | - <picker @change="bindPickerChange22" :value="pickerInfoList[2].nameIndex2" :range="pickerInfoList[2].nameArray2"> | |
136 | - <view class="p14"> | |
137 | - {{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}} | |
138 | - <image src="../../static/detail-tabicon.png" ></image> | |
139 | - </view> | |
140 | - <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
141 | - </picker> | |
142 | - </view> | |
143 | - </view> | |
144 | - <view class="picker"> | |
145 | - <view class="picker-choice"> | |
146 | - <view class="choice-left"> | |
147 | - <text class="pd">瞳距:</text> | |
148 | - </view> | |
149 | - <input type="digit" @change="handleInputPd" class="input" | |
150 | - placeholder="请输入瞳距,单位cm" maxlength="20" :value="pd" /> | |
151 | - </view> | |
152 | - </view> | |
153 | - <view class="picker" > | |
154 | - <view class="picker-choice"> | |
155 | - <view class="choice-left"> | |
156 | - <text class="p11">{{pickerInfoList[3].nameC}}</text> | |
157 | - </view> | |
158 | - <text class="p13-date">年 (Y)</text> | |
159 | - <picker @change="bindPickerChange41" :value="pickerInfoList[3].nameIndex1" :range="pickerInfoList[3].nameArray1"> | |
160 | - <view class="p14" style="width: 30px;"> | |
161 | - {{pickerInfoList[3].nameArray1[pickerInfoList[3].nameIndex1]}} | |
162 | - <image src="../../static/detail-tabicon.png" ></image> | |
163 | - </view> | |
164 | - </picker> | |
165 | - <text class="p13-date">月 (M)</text> | |
166 | - <picker @change="bindPickerChange42" :value="pickerInfoList[3].nameIndex2" :range="pickerInfoList[3].nameArray2"> | |
167 | - <view class="p14" style="width: 30px;"> | |
168 | - {{pickerInfoList[3].nameArray2[pickerInfoList[3].nameIndex2]}} | |
169 | - <image src="../../static/detail-tabicon.png" ></image> | |
170 | - </view> | |
171 | - </picker> | |
172 | - <text class="p13-date">日 (D)</text> | |
173 | - <picker @change="bindPickerChange43" :value="pickerInfoList[3].nameIndex3" :range="pickerInfoList[3].nameArray3"> | |
174 | - <view class="p14" style="width: 30px;"> | |
175 | - {{pickerInfoList[3].nameArray3[pickerInfoList[3].nameIndex3]}} | |
176 | - <image src="../../static/detail-tabicon.png" ></image> | |
177 | - </view> | |
178 | - </picker> | |
179 | - </view> | |
180 | - </view> | |
181 | - <view class="ipts"> | |
182 | - <view class="inputItem"> | |
183 | - <text class="text">镜片宽度</text> | |
184 | - <input class="input" @input="glassInfoInput($event,0)" type="text" :value="glassInfo.glassWidth!=='0'?glassInfo.glassWidth:''" placeholder="请输入镜片宽度"/> | |
185 | - </view> | |
186 | - <view class="inputItem"> | |
187 | - <text class="text">鼻梁宽度</text> | |
188 | - <input class="input" @input="glassInfoInput($event,1)" type="text" :value="glassInfo.norseWidth!=='0'?glassInfo.norseWidth:''" placeholder="请输入鼻梁宽度"/> | |
189 | - </view> | |
190 | - <view class="inputItem"> | |
191 | - <text class="text">镜腿长度</text> | |
192 | - <input class="input" @input="glassInfoInput($event,2)" type="text" :value="glassInfo.legWidth!=='0'?glassInfo.legWidth:''" placeholder="请输入镜腿长度"/> | |
193 | - </view> | |
194 | - | |
195 | - </view> | |
196 | - <!-- <view class="confirm"> | |
8 | + <view class="goodInfo"> | |
9 | + <view class="imageWrap"> | |
10 | + <!-- <image :src="skuItem.sku_pic_http" mode="aspectFill" style="width: 188rpx;height: 168rpx;"> | |
11 | + </image> --> | |
12 | + | |
13 | + </view> | |
14 | + <view class="infoRight"> | |
15 | + <!-- <text class="goodName">{{goodInfo.shop_wood_name}}-{{skuItem.wsp_sku_name}}</text> --> | |
16 | + <text class="goodName">{{goodInfo.shop_wood_name}}</text> | |
17 | + <text class="remarks">支持7天无理由退货 顺丰发货</text> | |
18 | + <view class="priceBox"> | |
19 | + <!-- <view class="price">¥{{skuItem.wsp_wood_price || '暂无'}}</view> --> | |
20 | + <view class="price">¥{{0 || '暂无'}}</view> | |
21 | + <text>(限购{{maxCount}}副)</text> | |
22 | + <view class="counter"> | |
23 | + <view class="btn" disabled="this.addDisabled" type="default" | |
24 | + @click="counter(false)">-</view> | |
25 | + <text>{{count}}</text> | |
26 | + <view class="btn" disabled="this.desDisabled" type="default" @click="counter(true)"> | |
27 | + +</view> | |
28 | + </view> | |
29 | + </view> | |
30 | + </view> | |
31 | + </view> | |
32 | + <view class="peopleChoose"> | |
33 | + <view class="title">选择使用人</view> | |
34 | + <view class="loveList"> | |
35 | + <view class="peopleName" v-for="(item,index) in loveList" :key='index' | |
36 | + :class="{ active2: loveCurrent === index }" @click="onClickLoveItem(index,item.name)"> | |
37 | + {{item.name}} | |
38 | + </view> | |
39 | + </view> | |
40 | + </view> | |
41 | + <view class="goods-data" v-if="isCart !== 3"> | |
42 | + <view class="opCollapse"> | |
43 | + <view class="body"> | |
44 | + <template v-if="opIsOpen"> | |
45 | + <view class="goods-form"> | |
46 | + <view class="p1"> | |
47 | + <image class="image2" src="../../static/img/myOpticsData/dataWrite.png" | |
48 | + mode="aspectFit"></image> | |
49 | + 填写验光数据 | |
50 | + </view> | |
51 | + <text class="p2">没有验光数据?请到线下眼镜店验光哦~</text> | |
52 | + <view class="picker"> | |
53 | + <view class="picker-choice"> | |
54 | + <view class="choice-left"> | |
55 | + <text class="pd">验光单取名:</text> | |
56 | + </view> | |
57 | + <input type="text" @blur="handleInput" class="input" placeholder="请输入名称" | |
58 | + maxlength="20" :value="name" /> | |
59 | + </view> | |
60 | + </view> | |
61 | + <view class="picker"> | |
62 | + <view class="picker-choice"> | |
63 | + <view class="choice-left"> | |
64 | + <text class="p11">{{pickerInfoList[0].nameC}}</text> | |
65 | + <text class="p12">{{pickerInfoList[0].nameE}}</text> | |
66 | + </view> | |
67 | + <text class="p13">左 (OD)</text> | |
68 | + <!-- <text class="p14">{{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}}</text> --> | |
69 | + <picker @change="bindPickerChange01" | |
70 | + :value="pickerInfoList[0].nameIndex1" | |
71 | + :range="pickerInfoList[0].nameArray1"> | |
72 | + <view class="p14"> | |
73 | + {{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}} | |
74 | + <image src="../../static/detail-tabicon.png"></image> | |
75 | + </view> | |
76 | + <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
77 | + </picker> | |
78 | + <text class="p13">右 (OS)</text> | |
79 | + <!-- <text class="p14">{{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}}</text> --> | |
80 | + <picker @change="bindPickerChange02" | |
81 | + :value="pickerInfoList[0].nameIndex2" | |
82 | + :range="pickerInfoList[0].nameArray2"> | |
83 | + <view class="p14"> | |
84 | + {{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}} | |
85 | + <image src="../../static/detail-tabicon.png"></image> | |
86 | + </view> | |
87 | + <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
88 | + </picker> | |
89 | + </view> | |
90 | + </view> | |
91 | + <view class="picker"> | |
92 | + <view class="picker-choice"> | |
93 | + <view class="choice-left"> | |
94 | + <text class="p11">{{pickerInfoList[1].nameC}}</text> | |
95 | + <text class="p12">{{pickerInfoList[1].nameE}}</text> | |
96 | + </view> | |
97 | + <text class="p13">左 (OD)</text> | |
98 | + <!-- <text class="p14">{{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}}</text> --> | |
99 | + <picker @change="bindPickerChange11" | |
100 | + :value="pickerInfoList[1].nameIndex1" | |
101 | + :range="pickerInfoList[1].nameArray1"> | |
102 | + <view class="p14"> | |
103 | + {{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}} | |
104 | + <image src="../../static/detail-tabicon.png"></image> | |
105 | + </view> | |
106 | + <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
107 | + </picker> | |
108 | + <text class="p13">右 (OS)</text> | |
109 | + <!-- <text class="p14">{{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}}</text> --> | |
110 | + <picker @change="bindPickerChange12" | |
111 | + :value="pickerInfoList[1].nameIndex2" | |
112 | + :range="pickerInfoList[1].nameArray2"> | |
113 | + <view class="p14"> | |
114 | + {{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}} | |
115 | + <image src="../../static/detail-tabicon.png"></image> | |
116 | + </view> | |
117 | + <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
118 | + </picker> | |
119 | + </view> | |
120 | + </view> | |
121 | + <view class="picker"> | |
122 | + <view class="picker-choice"> | |
123 | + <view class="choice-left"> | |
124 | + <text class="p11">{{pickerInfoList[2].nameC}}</text> | |
125 | + <text class="p12">{{pickerInfoList[2].nameE}}</text> | |
126 | + </view> | |
127 | + <text class="p13">左 (OD)</text> | |
128 | + <picker @change="bindPickerChange21" | |
129 | + :value="pickerInfoList[2].nameIndex1" | |
130 | + :range="pickerInfoList[2].nameArray1"> | |
131 | + <view class="p14"> | |
132 | + {{pickerInfoList[2].nameArray1[pickerInfoList[2].nameIndex1]}} | |
133 | + <image src="../../static/detail-tabicon.png"></image> | |
134 | + </view> | |
135 | + </picker> | |
136 | + <text class="p13">右 (OS)</text> | |
137 | + <!-- <text class="p14">{{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}}</text> --> | |
138 | + <picker @change="bindPickerChange22" | |
139 | + :value="pickerInfoList[2].nameIndex2" | |
140 | + :range="pickerInfoList[2].nameArray2"> | |
141 | + <view class="p14"> | |
142 | + {{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}} | |
143 | + <image src="../../static/detail-tabicon.png"></image> | |
144 | + </view> | |
145 | + <!-- <image src="../../static/detail-tabicon.png" ></image> --> | |
146 | + </picker> | |
147 | + </view> | |
148 | + </view> | |
149 | + <view class="picker"> | |
150 | + <view class="picker-choice"> | |
151 | + <view class="choice-left"> | |
152 | + <text class="pd">瞳距:</text> | |
153 | + </view> | |
154 | + <input type="digit" @change="handleInputPd" class="input" | |
155 | + placeholder="请输入瞳距,单位cm" maxlength="20" :value="pd" /> | |
156 | + </view> | |
157 | + </view> | |
158 | + <view class="picker"> | |
159 | + <view class="picker-choice"> | |
160 | + <view class="choice-left"> | |
161 | + <text class="p11">{{pickerInfoList[3].nameC}}</text> | |
162 | + </view> | |
163 | + <text class="p13-date">年 (Y)</text> | |
164 | + <picker @change="bindPickerChange41" | |
165 | + :value="pickerInfoList[3].nameIndex1" | |
166 | + :range="pickerInfoList[3].nameArray1"> | |
167 | + <view class="p14" style="width: 30px;"> | |
168 | + {{pickerInfoList[3].nameArray1[pickerInfoList[3].nameIndex1]}} | |
169 | + <image src="../../static/detail-tabicon.png"></image> | |
170 | + </view> | |
171 | + </picker> | |
172 | + <text class="p13-date">月 (M)</text> | |
173 | + <picker @change="bindPickerChange42" | |
174 | + :value="pickerInfoList[3].nameIndex2" | |
175 | + :range="pickerInfoList[3].nameArray2"> | |
176 | + <view class="p14" style="width: 30px;"> | |
177 | + {{pickerInfoList[3].nameArray2[pickerInfoList[3].nameIndex2]}} | |
178 | + <image src="../../static/detail-tabicon.png"></image> | |
179 | + </view> | |
180 | + </picker> | |
181 | + <text class="p13-date">日 (D)</text> | |
182 | + <picker @change="bindPickerChange43" | |
183 | + :value="pickerInfoList[3].nameIndex3" | |
184 | + :range="pickerInfoList[3].nameArray3"> | |
185 | + <view class="p14" style="width: 30px;"> | |
186 | + {{pickerInfoList[3].nameArray3[pickerInfoList[3].nameIndex3]}} | |
187 | + <image src="../../static/detail-tabicon.png"></image> | |
188 | + </view> | |
189 | + </picker> | |
190 | + </view> | |
191 | + </view> | |
192 | + <view class="ipts"> | |
193 | + <view class="inputItem"> | |
194 | + <text class="text">镜片宽度</text> | |
195 | + <input class="input" @input="glassInfoInput($event,0)" type="text" | |
196 | + :value="glassInfo.glassWidth!=='0'?glassInfo.glassWidth:''" | |
197 | + placeholder="请输入镜片宽度" /> | |
198 | + </view> | |
199 | + <view class="inputItem"> | |
200 | + <text class="text">鼻梁宽度</text> | |
201 | + <input class="input" @input="glassInfoInput($event,1)" type="text" | |
202 | + :value="glassInfo.norseWidth!=='0'?glassInfo.norseWidth:''" | |
203 | + placeholder="请输入鼻梁宽度" /> | |
204 | + </view> | |
205 | + <view class="inputItem"> | |
206 | + <text class="text">镜腿长度</text> | |
207 | + <input class="input" @input="glassInfoInput($event,2)" type="text" | |
208 | + :value="glassInfo.legWidth!=='0'?glassInfo.legWidth:''" | |
209 | + placeholder="请输入镜腿长度" /> | |
210 | + </view> | |
211 | + | |
212 | + </view> | |
213 | + <!-- <view class="confirm"> | |
197 | 214 | <image class="image1" :src="confirm ? tabicon[0] : tabicon[1]" @tap="changeConfirm"></image> |
198 | 215 | <text>确认以上输入信息来源于我的验光数据!</text> |
199 | 216 | </view> --> |
200 | - </view> | |
201 | - </template> | |
202 | - <template v-else> | |
203 | - <view | |
204 | - v-for="item in pickerInfoList" | |
205 | - :key="item.key" | |
206 | - class="bodyBox" | |
207 | - > | |
208 | - <template v-if="item.nameC==='验光日期'"> | |
209 | - <text class="names">{{item.nameC}}</text> | |
210 | - <text style="margin-right: 5px;">{{item.nameArray1[item.nameIndex1]}}年</text> | |
211 | - <text style="margin-right: 5px;">{{item.nameArray2[item.nameIndex2]}}月</text> | |
212 | - <text>{{item.nameArray3[item.nameIndex2]}}日</text> | |
213 | - </template> | |
214 | - <template v-else> | |
215 | - <template v-if="item.nameC==='度数'"> | |
216 | - <text style="display: inline;">*</text> | |
217 | - </template> | |
218 | - | |
219 | - <text class="names">{{item.nameC}}</text> | |
220 | - <text style="margin-right: 10px;">左 {{item.nameArray1[item.nameIndex1]}}</text> | |
221 | - <text>右 {{item.nameArray2[item.nameIndex2]}}</text> | |
222 | - </template> | |
223 | - </view> | |
224 | - </template> | |
225 | - </view> | |
226 | - </view> | |
227 | - </view> | |
228 | - <view class="choose"> | |
229 | - <view | |
230 | - class="chooseItem_1_content" | |
231 | - v-for="(item,index) in attrList" | |
232 | - :key="index" | |
233 | - > | |
234 | - <UniCollapse @change="changeShow(index)"> | |
235 | - <UniCollapseItem | |
236 | - :open="show[index]" | |
237 | - :title="item.meta_name" | |
238 | - showAnimation=false | |
239 | - > | |
240 | - <view class="chooseItem_1_content"> | |
241 | - <view class="itemsWrap" v-if="isCart ==3"> | |
242 | - <view | |
243 | - class="item2" | |
244 | - v-for="(one,i) in item.attr" | |
245 | - :key="i" | |
246 | - :class="{ active2: current[index] === i}" | |
247 | - @click="cartOnClickItem(index, i,one.aid)" | |
248 | - >{{one.name}}</view> | |
249 | - </view> | |
250 | - <view class="itemsWrap" v-else> | |
251 | - <view | |
252 | - class="item2" | |
253 | - v-for="(one,i) in item.attr" | |
254 | - :key="i" | |
255 | - :class="{ active2: current[index] === i }" | |
256 | - @click="cartOnClickItem(index, i,one.aid)" | |
257 | - >{{one.name}}</view> | |
217 | + </view> | |
218 | + </template> | |
219 | + <template v-else> | |
220 | + <view v-for="item in pickerInfoList" :key="item.key" class="bodyBox"> | |
221 | + <template v-if="item.nameC==='验光日期'"> | |
222 | + <text class="names">{{item.nameC}}</text> | |
223 | + <text | |
224 | + style="margin-right: 5px;">{{item.nameArray1[item.nameIndex1]}}年</text> | |
225 | + <text | |
226 | + style="margin-right: 5px;">{{item.nameArray2[item.nameIndex2]}}月</text> | |
227 | + <text>{{item.nameArray3[item.nameIndex2]}}日</text> | |
228 | + </template> | |
229 | + <template v-else> | |
230 | + <template v-if="item.nameC==='度数'"> | |
231 | + <text style="display: inline;">*</text> | |
232 | + </template> | |
233 | + | |
234 | + <text class="names">{{item.nameC}}</text> | |
235 | + <text | |
236 | + style="margin-right: 10px;">左 {{item.nameArray1[item.nameIndex1]}}</text> | |
237 | + <text>右 {{item.nameArray2[item.nameIndex2]}}</text> | |
238 | + </template> | |
239 | + </view> | |
240 | + </template> | |
258 | 241 | </view> |
259 | - </view> | |
260 | - </UniCollapseItem> | |
261 | - </UniCollapse> | |
262 | - <view | |
263 | - class="chooseRes" | |
264 | - v-show="!show[index]" | |
265 | - >* {{attrList[index].attr[current[index]].name}}</view> | |
266 | - </view> | |
267 | - </view> | |
268 | - <view | |
269 | - class="button" | |
270 | - @click.native="addCart" | |
271 | - v-if="isCart == 1" | |
272 | - > | |
273 | - 加入购物车 | |
274 | - </view> | |
275 | - <view | |
276 | - class="button" | |
277 | - @click="toComfirmOrder" | |
278 | - v-if="isCart == 2" | |
279 | - > | |
280 | - 立即结算 | |
281 | - </view> | |
282 | - <view | |
283 | - class="button" | |
284 | - @click="comfirmChoose" | |
285 | - v-if="isCart == 3" | |
286 | - > | |
287 | - 确定 | |
288 | - </view> | |
242 | + </view> | |
243 | + </view> | |
244 | + <view class="choose"> | |
245 | + <view class="chooseItem_1_content" v-for="(item,index) in attrList" :key="index"> | |
246 | + <UniCollapse @change="changeShow(index)"> | |
247 | + <UniCollapseItem :open="show[index]" :title="item.meta_name" showAnimation=false> | |
248 | + <view class="chooseItem_1_content"> | |
249 | + <view class="itemsWrap" v-if="isCart ==3"> | |
250 | + <view class="item2" v-for="(one,i) in item.attr" :key="i" | |
251 | + :class="{ active2: current[index] === i}" | |
252 | + @click="cartOnClickItem(index, i,one.aid)">{{one.name}}</view> | |
253 | + </view> | |
254 | + <view class="itemsWrap" v-else> | |
255 | + <view class="item2" v-for="(one,i) in item.attr" :key="i" | |
256 | + :class="{ active2: current[index] === i }" | |
257 | + @click="cartOnClickItem(index, i,one.aid)">{{one.name}}</view> | |
258 | + </view> | |
259 | + </view> | |
260 | + </UniCollapseItem> | |
261 | + </UniCollapse> | |
262 | + <view class="chooseRes" v-show="!show[index]">* | |
263 | + {{attrList[index].attr[current[index]].name}}</view> | |
264 | + </view> | |
265 | + </view> | |
266 | + <view class="button" @click.native="addCart" v-if="isCart == 1"> | |
267 | + 加入购物车 | |
268 | + </view> | |
269 | + <view class="button" @click="toComfirmOrder" v-if="isCart == 2"> | |
270 | + 立即结算 | |
271 | + </view> | |
272 | + <view class="button" @click="comfirmChoose" v-if="isCart == 3"> | |
273 | + 确定 | |
274 | + </view> | |
289 | 275 | </view> |
290 | 276 | </scroll-view> |
291 | 277 | </view> |
292 | 278 | </view> |
293 | 279 | </template> |
294 | 280 | <script> |
295 | -import UniCollapse from '@/components/UniCollapse/UniCollapse.vue' | |
296 | -import UniCollapseItem from '@/components/UniCollapseItem/UniCollapseItem.vue' | |
297 | -import store from '@/store' | |
281 | + import UniCollapse from '@/components/UniCollapse/UniCollapse.vue' | |
282 | + import UniCollapseItem from '@/components/UniCollapseItem/UniCollapseItem.vue' | |
283 | + import store from '@/store' | |
298 | 284 | export default { |
299 | 285 | components: { |
300 | 286 | UniCollapse, |
301 | 287 | UniCollapseItem, |
302 | 288 | }, |
303 | 289 | props: { |
304 | - isShowBottom : Boolean, | |
305 | - pid: Number, | |
306 | - sk_id:String, | |
307 | - propMpId:String, | |
308 | - goodInfo:Object, | |
309 | - isCart:Number, | |
310 | - cart_id:Number, | |
311 | - index:Number | |
290 | + isShowBottom: Boolean, | |
291 | + shop_wood_id: String, | |
292 | + wsp_id: String, | |
293 | + propMpId: String, | |
294 | + goodInfo: Object, | |
295 | + isCart: Number, | |
296 | + cart_id: String, | |
297 | + index: Number | |
312 | 298 | }, |
313 | 299 | data() { |
314 | - return { | |
315 | - loveCurrent:Number, | |
316 | - count: 1, | |
317 | - // pid: 0, | |
318 | - maxCount: 20, | |
319 | - dataName: '', // 验光数据人员名称 | |
320 | - isDataName: false, // 是否是已存在的人员数据 | |
321 | - dataConfirm: false, // 已确认所输入验光数据 | |
322 | - opIsOpen: true, | |
323 | - addDisabled: false, | |
324 | - desDisabled: false, | |
325 | - current: [], | |
326 | - show: [true,true], | |
327 | - checkedData: {}, | |
328 | - // 度数相关数据 | |
329 | - pickerInfoList: [ | |
330 | - { nameC: '度数', nameE: '(SPH)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 0 }, | |
331 | - { nameC: '散光', nameE: '(CYL)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 1 }, | |
332 | - { nameC: '散光轴位', nameE: '(AXI)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 2 }, | |
333 | - { nameC: '验光日期', nameE: '', nameArray1: [''], nameIndex1: 0, nameArray2: ['', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], nameIndex2: 0, nameArray3: [''], nameIndex3: 0 }, | |
334 | - ], | |
335 | - // confirm: false, // 用户是否确认 | |
336 | - // tabicon: ['/static/detail-button.png', '/static/detail-button-unselected.png'], | |
337 | - name: '', | |
338 | - oldname: '', // 用于判读用户是否改变名字 | |
339 | - pickerInfoChioce: { | |
340 | - leftSph: '', | |
341 | - rightSph: '', | |
342 | - leftCyl: '', | |
343 | - rightCyl: '', | |
344 | - leftAxi: '', | |
345 | - rightAxi: '', | |
346 | - time: { | |
347 | - year: 0, | |
348 | - month: 0, | |
349 | - day: 0, | |
350 | - }, | |
351 | - }, | |
352 | - glassInfo:{ | |
353 | - glassWidth:Number,//镜片宽度 | |
354 | - norseWidth:Number,//鼻宽 | |
355 | - legWidth:Number//镜腿长度 | |
356 | - }, | |
357 | - pd: '', // 瞳距 | |
358 | - oldpd: '', // 用于判断用户是否改变瞳距 | |
359 | - kinds: 1, // kinds=1,提交为新增验光,2为修改 | |
360 | - mp_id: Number, | |
361 | - skuValueArray:[], | |
362 | - skId:String | |
363 | - } | |
300 | + return { | |
301 | + loveCurrent: Number, | |
302 | + count: 1, | |
303 | + // pid: 0, | |
304 | + maxCount: 20, | |
305 | + dataName: '', // 验光数据人员名称 | |
306 | + isDataName: false, // 是否是已存在的人员数据 | |
307 | + dataConfirm: false, // 已确认所输入验光数据 | |
308 | + opIsOpen: true, | |
309 | + addDisabled: false, | |
310 | + desDisabled: false, | |
311 | + current: [], | |
312 | + show: [true, true], | |
313 | + checkedData: {}, | |
314 | + // 度数相关数据 | |
315 | + pickerInfoList: [{ | |
316 | + nameC: '度数', | |
317 | + nameE: '(SPH)', | |
318 | + nameArray1: [''], | |
319 | + nameIndex1: 0, | |
320 | + nameArray2: [''], | |
321 | + nameIndex2: 0, | |
322 | + key: 0 | |
323 | + }, | |
324 | + { | |
325 | + nameC: '散光', | |
326 | + nameE: '(CYL)', | |
327 | + nameArray1: [''], | |
328 | + nameIndex1: 0, | |
329 | + nameArray2: [''], | |
330 | + nameIndex2: 0, | |
331 | + key: 1 | |
332 | + }, | |
333 | + { | |
334 | + nameC: '散光轴位', | |
335 | + nameE: '(AXI)', | |
336 | + nameArray1: [''], | |
337 | + nameIndex1: 0, | |
338 | + nameArray2: [''], | |
339 | + nameIndex2: 0, | |
340 | + key: 2 | |
341 | + }, | |
342 | + { | |
343 | + nameC: '验光日期', | |
344 | + nameE: '', | |
345 | + nameArray1: [''], | |
346 | + nameIndex1: 0, | |
347 | + nameArray2: ['', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], | |
348 | + nameIndex2: 0, | |
349 | + nameArray3: [''], | |
350 | + nameIndex3: 0 | |
351 | + }, | |
352 | + ], | |
353 | + // confirm: false, // 用户是否确认 | |
354 | + // tabicon: ['/static/detail-button.png', '/static/detail-button-unselected.png'], | |
355 | + name: '', | |
356 | + oldname: '', // 用于判读用户是否改变名字 | |
357 | + pickerInfoChioce: { | |
358 | + leftSph: '', | |
359 | + rightSph: '', | |
360 | + leftCyl: '', | |
361 | + rightCyl: '', | |
362 | + leftAxi: '', | |
363 | + rightAxi: '', | |
364 | + time: { | |
365 | + year: 0, | |
366 | + month: 0, | |
367 | + day: 0, | |
368 | + }, | |
369 | + }, | |
370 | + glassInfo: { | |
371 | + glassWidth: Number, //镜片宽度 | |
372 | + norseWidth: Number, //鼻宽 | |
373 | + legWidth: Number //镜腿长度 | |
374 | + }, | |
375 | + pd: '', // 瞳距 | |
376 | + oldpd: '', // 用于判断用户是否改变瞳距 | |
377 | + kinds: 1, // kinds=1,提交为新增验光,2为修改 | |
378 | + mp_id: Number, | |
379 | + skuValueArray: [], | |
380 | + skId: String | |
381 | + } | |
364 | 382 | }, |
365 | 383 | computed: { |
366 | 384 | //进购物车选择的人的index |
367 | - p_current(){ | |
368 | - const getLoveItemIndex = (item) => item.mp_id == this.propMpId | |
369 | - const p_current = this.$store.state.myLoveList.loveList.findIndex(getLoveItemIndex ) | |
370 | - if(this.isCart == 3){ | |
371 | - this.loveCurrent = p_current | |
372 | - } | |
373 | - return p_current | |
385 | + p_current() { | |
386 | + const getLoveItemIndex = (item) => item.mp_id == this.propMpId | |
387 | + const p_current = this.$store.state.myLoveList.loveList.findIndex(getLoveItemIndex) | |
388 | + if (this.isCart == 3) { | |
389 | + this.loveCurrent = p_current | |
390 | + } | |
391 | + return p_current | |
374 | 392 | }, |
375 | - arr_current(){ | |
376 | - if(this.isCart == 3){ | |
377 | - const skId = this.sk_id | |
378 | - const skuValue = this.skuItem.sku_value | |
393 | + arr_current() { | |
394 | + if (this.isCart == 3) { | |
395 | + const skId = this.wsp_id | |
396 | + const skuValue = this.skuItem.wsp_sku_name | |
379 | 397 | const skuValueArray = skuValue.split('_') |
380 | 398 | this.skuValueArray = skuValueArray |
381 | 399 | const attrList = this.$store.state.read.goodInfo.attrList |
382 | - for (let i = 0;i<attrList.length;i++) { | |
400 | + for (let i = 0; i < attrList.length; i++) { | |
383 | 401 | const getArrIndex = (item) => item.aid == skuValueArray[i] |
384 | - const arr_current = this.$store.state.read.goodInfo.attrList[i].attr.findIndex(getArrIndex ) | |
402 | + const arr_current = this.$store.state.read.goodInfo.attrList[i].attr.findIndex(getArrIndex) | |
385 | 403 | // console.log('arr_current',arr_current) |
386 | - this.current.push(arr_current) | |
404 | + this.current.push(arr_current) | |
387 | 405 | } |
388 | - }else{ | |
406 | + } else { | |
389 | 407 | return null |
390 | 408 | } |
391 | 409 | }, |
392 | 410 | loveList() { |
393 | 411 | return this.$store.state.myLoveList.loveList || [] |
394 | 412 | }, |
395 | - attrList() { | |
396 | - // console.log('attrList',this.$store.state.read.goodInfo.attrList) | |
397 | - let attrList = this.$store.state.read.goodInfo.attrList | |
398 | - if(attrList !== undefined){ | |
399 | - return attrList | |
400 | - }else{ | |
401 | - return [] | |
402 | - } | |
403 | - }, | |
404 | - skuList() { | |
405 | - // console.log('skuList',this.$store.state.read.goodInfo.skuList) | |
406 | - return this.$store.state.read.goodInfo.skuList | |
407 | - }, | |
408 | - skuItem(){ | |
409 | - // if(this.isCart == 3){ | |
410 | - const skuList = this.$store.state.read.goodInfo.skuList | |
411 | - const skuItem = skuList.filter(item => item.sk_id === this.skId)[0] | |
412 | - return skuItem | |
413 | - // }else{ | |
414 | - // const skuList = this.$store.state.read.goodInfo.skuList | |
415 | - // const skuItem = skuList[0] | |
416 | - // return skuItem | |
417 | - // } | |
418 | - }, | |
419 | - mpList() { | |
420 | - | |
421 | - return this.$store.state.myLoveList.loveList | |
422 | - }, | |
423 | - glassInfoRight(){ | |
424 | - const glassInfoArr = Object.values(this.glassInfo) | |
425 | - // console.log('glassInfoArr',glassInfoArr.find(item => item == '0')) | |
426 | - return glassInfoArr.find(item => item == '0') ==undefined | |
427 | - } | |
413 | + attrList() { | |
414 | + // console.log('attrList',this.$store.state.read.goodInfo.attrList) | |
415 | + let attrList = this.$store.state.read.goodInfo.attrList | |
416 | + if (attrList !== undefined) { | |
417 | + return attrList | |
418 | + } else { | |
419 | + return [] | |
420 | + } | |
421 | + }, | |
422 | + skuList() { | |
423 | + // console.log('skuList',this.$store.state.read.goodInfo.skuList) | |
424 | + return this.$store.state.read.goodInfo.sku | |
425 | + }, | |
426 | + skuItem() { | |
427 | + // if(this.isCart == 3){ | |
428 | + const skuList = this.$store.state.read.goodInfo.sku | |
429 | + // console.log('skuItemskuItemskuItemskuItemskuItem', this.$store.state.read.goodInfo); | |
430 | + const skuItem = skuList.filter(item => item.wsp_id === this.skId)[0] | |
431 | + return skuItem | |
432 | + // }else{ | |
433 | + // const skuList = this.$store.state.read.goodInfo.skuList | |
434 | + // const skuItem = skuList[0] | |
435 | + // return skuItem | |
436 | + // } | |
437 | + }, | |
438 | + mpList() { | |
439 | + | |
440 | + return this.$store.state.myLoveList.loveList | |
441 | + }, | |
442 | + glassInfoRight() { | |
443 | + const glassInfoArr = Object.values(this.glassInfo) | |
444 | + // console.log('glassInfoArr',glassInfoArr.find(item => item == '0')) | |
445 | + return glassInfoArr.find(item => item == '0') == undefined | |
446 | + } | |
428 | 447 | }, |
429 | 448 | created() { |
430 | - this.skuValueArray = this.skuList[0].sku_value.split("_") | |
431 | - // console.log(this.sk_id) | |
449 | + this.skuValueArray = this.skuList[0].wsp_sku_name.split("_") | |
450 | + // console.log(this.wsp_id) | |
432 | 451 | this.mp_id = this.propMpId |
433 | - const pid = this.pid | |
434 | - if(this.isCart!==3){ | |
435 | - this.skId = this.skuList[0].sk_id | |
436 | - const current = [] | |
437 | - const show = [] | |
438 | - for (let index = 0; index < this.attrList.length; index++) { | |
439 | - current.push(0) | |
440 | - show.push(true) | |
452 | + const pid = this.shop_wood_id | |
453 | + if (this.isCart !== 3) { | |
454 | + this.skId = this.skuList[0].wsp_id | |
455 | + const current = [] | |
456 | + const show = [] | |
457 | + for (let index = 0; index < this.attrList.length; index++) { | |
458 | + current.push(0) | |
459 | + show.push(true) | |
460 | + } | |
461 | + this.current = current | |
462 | + this.show = show | |
463 | + } else { | |
464 | + this.skId = this.wsp_id | |
465 | + } | |
466 | + //获取关心的人列表 | |
467 | + store.dispatch('myLoveList/getLoveList', { | |
468 | + uid: this.$store.state.user.userInfo.uid, | |
469 | + }); | |
470 | + // 初始化SPL、CYL、AXI的值 | |
471 | + for (let j = 0; j < 3; j++) { | |
472 | + for (let i = -12; i < 6; i++) { | |
473 | + this.pickerInfoList[j].nameArray1.push(i) | |
474 | + this.pickerInfoList[j].nameArray1.push(i + 0.5) | |
475 | + this.pickerInfoList[j].nameArray2.push(i) | |
476 | + this.pickerInfoList[j].nameArray2.push(i + 0.5) | |
477 | + if (i >= -6) { | |
478 | + this.pickerInfoList[j].nameArray1.push(i + 0.25) | |
479 | + this.pickerInfoList[j].nameArray1.push(i + 0.75) | |
480 | + this.pickerInfoList[j].nameArray2.push(i + 0.25) | |
481 | + this.pickerInfoList[j].nameArray2.push(i + 0.75) | |
482 | + } | |
483 | + if (i === 5) { | |
484 | + this.pickerInfoList[j].nameArray1.push(i + 1) | |
485 | + this.pickerInfoList[j].nameArray2.push(i + 1) | |
486 | + } | |
487 | + } | |
488 | + } | |
489 | + // 初始化日期值 | |
490 | + for (let i = 1; i < 32; i++) { | |
491 | + this.pickerInfoList[3].nameArray3.push(i) | |
492 | + } | |
493 | + // 初始化年份前后五年 | |
494 | + const myDate = new Date() | |
495 | + const nowYear = myDate.getFullYear() | |
496 | + for (let i = 0; i < 5; i++) { | |
497 | + this.pickerInfoList[3].nameArray1.push(nowYear - i) | |
441 | 498 | } |
442 | - this.current = current | |
443 | - this.show = show | |
444 | - }else{ | |
445 | - this.skId = this.sk_id | |
446 | - } | |
447 | - //获取关心的人列表 | |
448 | - store.dispatch('myLoveList/getLoveList', { | |
449 | - uid: this.$store.state.user.userInfo.uid, | |
450 | - }); | |
451 | - // 初始化SPL、CYL、AXI的值 | |
452 | - for (let j = 0; j < 3; j++) { | |
453 | - for (let i = -12; i < 6; i++) { | |
454 | - this.pickerInfoList[j].nameArray1.push(i) | |
455 | - this.pickerInfoList[j].nameArray1.push(i + 0.5) | |
456 | - this.pickerInfoList[j].nameArray2.push(i) | |
457 | - this.pickerInfoList[j].nameArray2.push(i + 0.5) | |
458 | - if (i >= -6) { | |
459 | - this.pickerInfoList[j].nameArray1.push(i + 0.25) | |
460 | - this.pickerInfoList[j].nameArray1.push(i + 0.75) | |
461 | - this.pickerInfoList[j].nameArray2.push(i + 0.25) | |
462 | - this.pickerInfoList[j].nameArray2.push(i + 0.75) | |
463 | - } | |
464 | - if (i === 5) { | |
465 | - this.pickerInfoList[j].nameArray1.push(i + 1) | |
466 | - this.pickerInfoList[j].nameArray2.push(i + 1) | |
467 | - } | |
468 | - } | |
469 | - } | |
470 | - // 初始化日期值 | |
471 | - for (let i = 1; i < 32; i++) { | |
472 | - this.pickerInfoList[3].nameArray3.push(i) | |
473 | - } | |
474 | - // 初始化年份前后五年 | |
475 | - const myDate = new Date() | |
476 | - const nowYear = myDate.getFullYear() | |
477 | - for (let i = 0; i < 5; i++) { | |
478 | - this.pickerInfoList[3].nameArray1.push(nowYear - i) | |
479 | - } | |
480 | 499 | }, |
481 | - name : "bottomSheet", | |
500 | + name: "bottomSheet", | |
482 | 501 | methods: { |
483 | 502 | //判断眼镜数据是否为0 |
484 | - checkGlassInfo(){ | |
503 | + checkGlassInfo() { | |
485 | 504 | // const glassInfoArr = Object.values(this.glassInfo) |
486 | 505 | // console.log(this.glassInfoRight) |
487 | - if(!this.glassInfoRight){ | |
506 | + if (!this.glassInfoRight) { | |
488 | 507 | uni.showToast({ |
489 | - title:'请完善镜框数据~', | |
490 | - icon:'none' | |
508 | + title: '请完善镜框数据~', | |
509 | + icon: 'none' | |
491 | 510 | }) |
492 | 511 | } |
493 | 512 | }, |
494 | - updateMylove(){ | |
513 | + updateMylove() { | |
495 | 514 | const loveItem = this.loveList[this.loveCurrent] |
496 | 515 | const glassWidth = this.glassInfo.glassWidth |
497 | 516 | const norseWidth = this.glassInfo.norseWidth |
498 | 517 | const legWidth = this.glassInfo.legWidth |
499 | - if(loveItem.glassWidth !== glassWidth){ | |
518 | + if (loveItem.glassWidth !== glassWidth) { | |
500 | 519 | store.dispatch('myLoveList/updateMylove', { |
501 | 520 | uid: this.$store.state.user.userInfo.uid, |
502 | 521 | openid: this.$store.state.user.userInfo.openid, |
503 | 522 | mp_id: this.mp_id, |
504 | 523 | keyname: 'glassWidth', |
505 | 524 | keyvalue: glassWidth |
506 | - }); | |
525 | + }); | |
507 | 526 | } |
508 | - if(loveItem.norseWidth !== norseWidth){ | |
527 | + if (loveItem.norseWidth !== norseWidth) { | |
509 | 528 | store.dispatch('myLoveList/updateMylove', { |
510 | 529 | uid: this.$store.state.user.userInfo.uid, |
511 | 530 | openid: this.$store.state.user.userInfo.openid, |
512 | 531 | mp_id: this.mp_id, |
513 | 532 | keyname: 'norseWidth', |
514 | 533 | keyvalue: norseWidth |
515 | - }); | |
534 | + }); | |
516 | 535 | } |
517 | - if(loveItem.legWidth !== legWidth){ | |
536 | + if (loveItem.legWidth !== legWidth) { | |
518 | 537 | store.dispatch('myLoveList/updateMylove', { |
519 | 538 | uid: this.$store.state.user.userInfo.uid, |
520 | 539 | openid: this.$store.state.user.userInfo.openid, |
521 | 540 | mp_id: this.mp_id, |
522 | 541 | keyname: 'legWidth', |
523 | 542 | keyvalue: legWidth |
524 | - }); | |
543 | + }); | |
525 | 544 | } |
526 | 545 | }, |
527 | - glassInfoInput(e,type){ | |
528 | - switch(type){ | |
546 | + glassInfoInput(e, type) { | |
547 | + console.log('glassInfoInput', e); | |
548 | + switch (type) { | |
529 | 549 | case 0: |
530 | 550 | this.glassInfo.glassWidth = e.detail.value |
531 | - break; | |
551 | + break; | |
532 | 552 | case 1: |
533 | 553 | this.glassInfo.norseWidth = e.detail.value |
534 | - break; | |
554 | + break; | |
535 | 555 | case 2: |
536 | 556 | this.glassInfo.legWidth = e.detail.value |
537 | - break; | |
557 | + break; | |
538 | 558 | default: |
539 | - break; | |
559 | + break; | |
540 | 560 | } |
541 | 561 | }, |
542 | 562 | //参数点击事件==》改变对应图片 |
543 | - cartOnClickItem(index, i,aid) { | |
563 | + cartOnClickItem(index, i, aid) { | |
544 | 564 | //根据aid拼接skuValue |
545 | 565 | this.skuValueArray[index] = aid |
546 | - const sku_value = this.skuValueArray.join('_') | |
547 | - //根据sku_value获取对应的sk_id | |
548 | - const itemSk_id = this.skuList.filter(item=>item.sku_value == sku_value)[0].sk_id | |
549 | - //修改sk_id | |
566 | + const wsp_sku_name = this.skuValueArray.join('_') | |
567 | + //根据wsp_sku_name获取对应的wsp_id | |
568 | + const itemSk_id = this.skuList.filter(item => item.wsp_sku_name == wsp_sku_name)[0].wsp_id | |
569 | + //修改wsp_id | |
550 | 570 | this.skId = itemSk_id |
551 | - if (this.current[index] !== i) { | |
552 | - this.current[index] = i | |
553 | - } | |
554 | - this.$forceUpdate() | |
571 | + if (this.current[index] !== i) { | |
572 | + this.current[index] = i | |
573 | + } | |
574 | + this.$forceUpdate() | |
555 | 575 | }, |
556 | - comfirmChoose(){ | |
576 | + comfirmChoose() { | |
557 | 577 | this.checkGlassInfo() |
558 | - if(this.glassInfoRight){ | |
578 | + if (this.glassInfoRight) { | |
559 | 579 | this.updateMylove() |
560 | - const price = this.skuList.filter(item=>item.sk_id == this.skId)[0].real_price | |
561 | - this.$emit("chooseCartModi",this.mp_id,this.skId,price,this.pid,this.count,this.cart_id,this.index)//添加购物车 | |
580 | + const price = this.skuList.filter(item => item.wsp_id == this.skId)[0].real_price | |
581 | + this.$emit("chooseCartModi", this.mp_id, this.skId, price, this.shop_wood_id, this.count, this.cart_id, | |
582 | + this.index) //添加购物车 | |
562 | 583 | this.$emit("closeBottom") |
563 | 584 | } |
564 | 585 | }, |
565 | - addCart(){ | |
586 | + addCart() { | |
566 | 587 | this.checkGlassInfo() |
567 | - if(this.glassInfoRight){ | |
588 | + if (this.glassInfoRight) { | |
568 | 589 | this.updateMylove() |
569 | 590 | const that = this |
570 | - const checkedSKUName = [that.goodInfo.attrList[0].meta_name,that.goodInfo.attrList[1].meta_name] | |
591 | + console.log('that.goodInfo.attrList------------>', that.goodInfo); | |
592 | + const checkedSKUName = '1111' | |
571 | 593 | const checkedSKU = [] |
572 | - let j; | |
573 | - for (let i = 0;i<that.current.length;i++) { | |
574 | - checkedSKU.push(that.goodInfo.attrList[i].attr[that.current[i]]) | |
575 | - // console.log('i', i, j, i !== this.current.length - 1) | |
576 | - if (i !== this.current.length - 1) { | |
577 | - // 后续需修改算法:目前暂定只有两个参数选择,后续若有多个参数需要修改实现自适应 | |
578 | - j = this.current[i] * this.attrList[1].attr.length | |
579 | - } else { | |
580 | - j += this.current[i] | |
581 | - } | |
582 | - } | |
583 | - const price = this.skuList.filter(item=>item.sk_id == this.skuList[j].sk_id)[0].real_price | |
584 | - let sk_id = this.skuList[j].sk_id | |
585 | - // console.log('选择的商品sk_id',sk_id,'选择的商品参数',checkedSKU) | |
594 | + // let j; | |
595 | + // for (let i = 0; i < that.current.length; i++) { | |
596 | + // // checkedSKU.push(that.goodInfo.attrList[i].attr[that.current[i]]) | |
597 | + // // // console.log('i', i, j, i !== this.current.length - 1) | |
598 | + // // if (i !== this.current.length - 1) { | |
599 | + // // // 后续需修改算法:目前暂定只有两个参数选择,后续若有多个参数需要修改实现自适应 | |
600 | + // // j = this.current[i] * this.attrList[1].attr.length | |
601 | + // // } else { | |
602 | + // // j += this.current[i] | |
603 | + // // } | |
604 | + // } | |
605 | + const price = 11 | |
606 | + // let wsp_id = this.sku[j].wsp_id | |
607 | + // console.log('选择的商品wsp_id',wsp_id,'选择的商品参数',checkedSKU) | |
586 | 608 | // console.log('mp_id',this.mp_id,'数量',this.count) |
587 | - this.$emit("addCart",this.mp_id,this.count,checkedSKU,sk_id,price)//添加购物车 | |
588 | - this.$emit("closeBottom")//关闭弹窗 | |
609 | + this.$emit("addCart", this.mp_id, this.count, checkedSKU, this.wsp_id, price) //添加购物车 | |
610 | + this.$emit("closeBottom") //关闭弹窗 | |
589 | 611 | } |
590 | 612 | }, |
591 | - onClickLoveItem(index,name){ | |
613 | + onClickLoveItem(index, name) { | |
592 | 614 | const loveList = this.loveList |
593 | 615 | this.glassInfo.glassWidth = loveList[index].glassWidth |
594 | 616 | this.glassInfo.norseWidth = loveList[index].norseWidth |
595 | 617 | this.glassInfo.legWidth = loveList[index].legWidth |
596 | 618 | for (let index = 0; index < loveList.length; index++) { |
597 | - if (name === loveList[index].name && name!==this.name) { | |
598 | - this.isDataName = true | |
599 | - this.kinds = 2 | |
600 | - this.name = loveList[index].name | |
601 | - this.pd = loveList[index].pd | |
602 | - this.mp_id = loveList[index].mp_id | |
603 | - this.oldname = loveList[index].name | |
604 | - this.oldpd = loveList[index].pd | |
605 | - this.pickerInfoList[0].nameArray1.unshift(loveList[index].leftSph) | |
606 | - this.pickerInfoList[0].nameArray2.unshift(loveList[index].rightSph) | |
607 | - this.pickerInfoList[1].nameArray1.unshift(loveList[index].leftCyl) | |
608 | - this.pickerInfoList[1].nameArray2.unshift(loveList[index].rightCyl) | |
609 | - this.pickerInfoList[2].nameArray1.unshift(loveList[index].leftAxi) | |
610 | - this.pickerInfoList[2].nameArray2.unshift(loveList[index].rightAxi) | |
611 | - this.pickerInfoList[3].nameArray1.unshift(loveList[index].in_time.toString().slice(0, 4)) | |
612 | - if (loveList[index].in_time.toString().slice(5, 6) === 0) { | |
613 | - this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(6, 7)) | |
614 | - } else { | |
615 | - this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(5, 7)) | |
616 | - } | |
617 | - if (loveList[index].in_time.toString().slice(8, 9) === 0) { | |
618 | - this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(9, 10)) | |
619 | - } else { | |
620 | - this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(8, 10)) | |
621 | - } | |
622 | - } | |
619 | + if (name === loveList[index].name && name !== this.name) { | |
620 | + this.isDataName = true | |
621 | + this.kinds = 2 | |
622 | + this.name = loveList[index].name | |
623 | + this.pd = loveList[index].pd | |
624 | + this.mp_id = loveList[index].mp_id | |
625 | + this.oldname = loveList[index].name | |
626 | + this.oldpd = loveList[index].pd | |
627 | + this.pickerInfoList[0].nameArray1.unshift(loveList[index].leftSph) | |
628 | + this.pickerInfoList[0].nameArray2.unshift(loveList[index].rightSph) | |
629 | + this.pickerInfoList[1].nameArray1.unshift(loveList[index].leftCyl) | |
630 | + this.pickerInfoList[1].nameArray2.unshift(loveList[index].rightCyl) | |
631 | + this.pickerInfoList[2].nameArray1.unshift(loveList[index].leftAxi) | |
632 | + this.pickerInfoList[2].nameArray2.unshift(loveList[index].rightAxi) | |
633 | + this.pickerInfoList[3].nameArray1.unshift(loveList[index].in_time.toString().slice(0, 4)) | |
634 | + if (loveList[index].in_time.toString().slice(5, 6) === 0) { | |
635 | + this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(6, 7)) | |
636 | + } else { | |
637 | + this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(5, 7)) | |
638 | + } | |
639 | + if (loveList[index].in_time.toString().slice(8, 9) === 0) { | |
640 | + this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(9, 10)) | |
641 | + } else { | |
642 | + this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(8, 10)) | |
643 | + } | |
644 | + } | |
623 | 645 | } |
624 | - this.name = name; | |
625 | - this.loveCurrent = index; | |
646 | + this.name = name; | |
647 | + this.loveCurrent = index; | |
626 | 648 | }, |
627 | - closeSheet(){ | |
649 | + closeSheet() { | |
628 | 650 | this.$emit('closeBottom'); |
629 | 651 | }, |
630 | - stopEvent(){ //@click.stop防止事件冒泡 | |
631 | - | |
652 | + stopEvent() { //@click.stop防止事件冒泡 | |
653 | + | |
632 | 654 | }, |
633 | - moveHandle(){ //不让页面滚动 | |
634 | - | |
655 | + moveHandle() { //不让页面滚动 | |
656 | + | |
635 | 657 | }, |
636 | 658 | // picker相关功能 |
637 | 659 | handleInput(e) { |
638 | - this.name = e.target.value | |
639 | - this.isDataName = false | |
640 | - const mpList = this.mpList | |
641 | - // console.log('mpList===>', mpList) | |
642 | - for (let index = 0; index < mpList.length; index++) { | |
643 | - if (e.detail.value === mpList[index].name) { | |
644 | - this.isDataName = true | |
645 | - uni.showModal({ | |
646 | - title: '提示', | |
647 | - content: `是否填充已有的"${e.detail.value}"的数据`, | |
648 | - success: (res) => { | |
649 | - if (res.confirm) { | |
650 | - this.kinds = 2 | |
651 | - // console.log('args===>', index) | |
652 | - // const mpList=Object.assign({},this.$store.state.mympList.mpList) | |
653 | - this.name = mpList[index].name | |
654 | - this.pd = mpList[index].pd | |
655 | - this.mp_id = mpList[index].mp_id | |
656 | - this.oldname = mpList[index].name | |
657 | - this.oldpd = mpList[index].pd | |
658 | - // 将kinds =2时的值传到该页面 | |
659 | - this.pickerInfoList[0].nameArray1.unshift(mpList[index].leftSph) | |
660 | - this.pickerInfoList[0].nameArray2.unshift(mpList[index].rightSph) | |
661 | - this.pickerInfoList[1].nameArray1.unshift(mpList[index].leftCyl) | |
662 | - this.pickerInfoList[1].nameArray2.unshift(mpList[index].rightCyl) | |
663 | - this.pickerInfoList[2].nameArray1.unshift(mpList[index].leftAxi) | |
664 | - this.pickerInfoList[2].nameArray2.unshift(mpList[index].rightAxi) | |
665 | - this.pickerInfoList[3].nameArray1.unshift(mpList[index].in_time.toString().slice(0, 4)) | |
666 | - if (mpList[index].in_time.toString().slice(5, 6) === 0) { | |
667 | - this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(6, 7)) | |
668 | - } else { | |
669 | - this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(5, 7)) | |
670 | - } | |
671 | - if (mpList[index].in_time.toString().slice(8, 9) === 0) { | |
672 | - this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(9, 10)) | |
673 | - } else { | |
674 | - this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(8, 10)) | |
675 | - } | |
676 | - // this.checkedData = mpList[index] | |
677 | - // console.log('checkedData', this.checkedData) | |
678 | - } else if (res.cancel) { | |
679 | - this.kinds = 2 | |
680 | - } | |
681 | - }, | |
682 | - }) | |
683 | - } | |
684 | - } | |
660 | + console.log('handleInputhandleInputhandleInput', e); | |
661 | + this.name = e.target.value | |
662 | + this.isDataName = false | |
663 | + const mpList = this.mpList | |
664 | + // console.log('mpList===>', mpList) | |
665 | + for (let index = 0; index < mpList.length; index++) { | |
666 | + if (e.detail.value === mpList[index].name) { | |
667 | + this.isDataName = true | |
668 | + uni.showModal({ | |
669 | + title: '提示', | |
670 | + content: `是否填充已有的"${e.detail.value}"的数据`, | |
671 | + success: (res) => { | |
672 | + if (res.confirm) { | |
673 | + this.kinds = 2 | |
674 | + // console.log('args===>', index) | |
675 | + // const mpList=Object.assign({},this.$store.state.mympList.mpList) | |
676 | + this.name = mpList[index].name | |
677 | + this.pd = mpList[index].pd | |
678 | + this.mp_id = mpList[index].mp_id | |
679 | + this.oldname = mpList[index].name | |
680 | + this.oldpd = mpList[index].pd | |
681 | + // 将kinds =2时的值传到该页面 | |
682 | + this.pickerInfoList[0].nameArray1.unshift(mpList[index].leftSph) | |
683 | + this.pickerInfoList[0].nameArray2.unshift(mpList[index].rightSph) | |
684 | + this.pickerInfoList[1].nameArray1.unshift(mpList[index].leftCyl) | |
685 | + this.pickerInfoList[1].nameArray2.unshift(mpList[index].rightCyl) | |
686 | + this.pickerInfoList[2].nameArray1.unshift(mpList[index].leftAxi) | |
687 | + this.pickerInfoList[2].nameArray2.unshift(mpList[index].rightAxi) | |
688 | + this.pickerInfoList[3].nameArray1.unshift(mpList[index].in_time.toString() | |
689 | + .slice(0, 4)) | |
690 | + if (mpList[index].in_time.toString().slice(5, 6) === 0) { | |
691 | + this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time | |
692 | + .toString().slice(6, 7)) | |
693 | + } else { | |
694 | + this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time | |
695 | + .toString().slice(5, 7)) | |
696 | + } | |
697 | + if (mpList[index].in_time.toString().slice(8, 9) === 0) { | |
698 | + this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time | |
699 | + .toString().slice(9, 10)) | |
700 | + } else { | |
701 | + this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time | |
702 | + .toString().slice(8, 10)) | |
703 | + } | |
704 | + // this.checkedData = mpList[index] | |
705 | + // console.log('checkedData', this.checkedData) | |
706 | + } else if (res.cancel) { | |
707 | + this.kinds = 2 | |
708 | + } | |
709 | + }, | |
710 | + }) | |
711 | + } | |
712 | + } | |
685 | 713 | }, |
686 | 714 | handleInputPd(e) { |
687 | - // 只能输入正浮点数或正数 | |
688 | - if (/^\d+(\.\d+)?$/.test(e.target.value)) { | |
689 | - this.pd = e.target.value | |
690 | - } else { | |
691 | - uni.showToast({ | |
692 | - title: '请输入有效数据;示例:89', | |
693 | - icon: 'none', | |
694 | - duration: 2000, | |
695 | - }) | |
696 | - this.pd = '' | |
697 | - } | |
715 | + // 只能输入正浮点数或正数 | |
716 | + console.log('handleInputPdhandleInputPd', e); | |
717 | + if (/^\d+(\.\d+)?$/.test(e.target.value)) { | |
718 | + this.pd = e.target.value | |
719 | + } else { | |
720 | + uni.showToast({ | |
721 | + title: '请输入有效数据;示例:89', | |
722 | + icon: 'none', | |
723 | + duration: 2000, | |
724 | + }) | |
725 | + this.pd = '' | |
726 | + } | |
698 | 727 | }, |
699 | 728 | // changeConfirm() { |
700 | 729 | // this.confirm = !this.confirm |
701 | 730 | // }, |
702 | 731 | bindPickerChange01: function(e) { |
703 | - this.pickerInfoList[0].nameIndex1 = e.target.value | |
704 | - this.pickerInfoChioce.leftSph = this.pickerInfoList[0].nameArray1[e.target.value] | |
732 | + this.pickerInfoList[0].nameIndex1 = e.target.value | |
733 | + this.pickerInfoChioce.leftSph = this.pickerInfoList[0].nameArray1[e.target.value] | |
705 | 734 | }, |
706 | 735 | bindPickerChange02: function(e) { |
707 | - this.pickerInfoList[0].nameIndex2 = e.target.value | |
708 | - this.pickerInfoChioce.rightSph = this.pickerInfoList[0].nameArray2[e.target.value] | |
736 | + this.pickerInfoList[0].nameIndex2 = e.target.value | |
737 | + this.pickerInfoChioce.rightSph = this.pickerInfoList[0].nameArray2[e.target.value] | |
709 | 738 | }, |
710 | - | |
739 | + | |
711 | 740 | bindPickerChange11: function(e) { |
712 | - this.pickerInfoList[1].nameIndex1 = e.target.value | |
713 | - this.pickerInfoChioce.leftCyl = this.pickerInfoList[1].nameArray1[e.target.value] | |
741 | + this.pickerInfoList[1].nameIndex1 = e.target.value | |
742 | + this.pickerInfoChioce.leftCyl = this.pickerInfoList[1].nameArray1[e.target.value] | |
714 | 743 | }, |
715 | 744 | bindPickerChange12: function(e) { |
716 | - this.pickerInfoList[1].nameIndex2 = e.target.value | |
717 | - this.pickerInfoChioce.rightCyl = this.pickerInfoList[1].nameArray2[e.target.value] | |
745 | + this.pickerInfoList[1].nameIndex2 = e.target.value | |
746 | + this.pickerInfoChioce.rightCyl = this.pickerInfoList[1].nameArray2[e.target.value] | |
718 | 747 | }, |
719 | - | |
748 | + | |
720 | 749 | bindPickerChange21: function(e) { |
721 | - this.pickerInfoList[2].nameIndex1 = e.target.value | |
722 | - this.pickerInfoChioce.leftAxi = this.pickerInfoList[2].nameArray1[e.target.value] | |
750 | + this.pickerInfoList[2].nameIndex1 = e.target.value | |
751 | + this.pickerInfoChioce.leftAxi = this.pickerInfoList[2].nameArray1[e.target.value] | |
723 | 752 | }, |
724 | 753 | bindPickerChange22: function(e) { |
725 | - this.pickerInfoList[2].nameIndex2 = e.target.value | |
726 | - this.pickerInfoChioce.rightAxi = this.pickerInfoList[2].nameArray2[e.target.value] | |
754 | + this.pickerInfoList[2].nameIndex2 = e.target.value | |
755 | + this.pickerInfoChioce.rightAxi = this.pickerInfoList[2].nameArray2[e.target.value] | |
727 | 756 | }, |
728 | - | |
757 | + | |
729 | 758 | bindPickerChange41: function(e) { |
730 | - this.pickerInfoList[3].nameIndex1 = e.target.value | |
731 | - this.pickerInfoChioce.time.year = this.pickerInfoList[3].nameArray1[e.target.value] | |
759 | + this.pickerInfoList[3].nameIndex1 = e.target.value | |
760 | + this.pickerInfoChioce.time.year = this.pickerInfoList[3].nameArray1[e.target.value] | |
732 | 761 | }, |
733 | 762 | bindPickerChange42: function(e) { |
734 | - this.pickerInfoList[3].nameIndex2 = e.target.value | |
735 | - this.pickerInfoChioce.time.month = this.pickerInfoList[3].nameArray2[e.target.value] | |
763 | + this.pickerInfoList[3].nameIndex2 = e.target.value | |
764 | + this.pickerInfoChioce.time.month = this.pickerInfoList[3].nameArray2[e.target.value] | |
736 | 765 | }, |
737 | 766 | bindPickerChange43: function(e) { |
738 | - this.pickerInfoList[3].nameIndex3 = e.target.value | |
739 | - this.pickerInfoChioce.time.day = this.pickerInfoList[3].nameArray3[e.target.value] | |
767 | + this.pickerInfoList[3].nameIndex3 = e.target.value | |
768 | + this.pickerInfoChioce.time.day = this.pickerInfoList[3].nameArray3[e.target.value] | |
740 | 769 | }, |
741 | 770 | changeShow(num) { |
742 | - this.show[num] = !this.show[num] | |
743 | - this.$forceUpdate() | |
771 | + this.show[num] = !this.show[num] | |
772 | + this.$forceUpdate() | |
744 | 773 | }, |
745 | 774 | counter(isadd) { |
746 | - if (isadd) { | |
747 | - this.count >= this.maxCount ? this.addDisabled = true : this.count++ | |
748 | - } else { | |
749 | - this.count <= 1 ? this.desDisabled = true : this.count-- | |
750 | - } | |
775 | + if (isadd) { | |
776 | + this.count >= this.maxCount ? this.addDisabled = true : this.count++ | |
777 | + } else { | |
778 | + this.count <= 1 ? this.desDisabled = true : this.count-- | |
779 | + } | |
751 | 780 | }, |
752 | 781 | toComfirmOrder() { |
753 | 782 | this.checkGlassInfo() |
754 | 783 | this.updateMylove() |
755 | - // 先处理验光部分的逻辑,如果ok在跳转 | |
756 | - let flag = 0 | |
757 | - if (this.name === '') { | |
758 | - uni.showToast({ | |
759 | - title: '请输入验光单取名', | |
760 | - icon: 'none', | |
761 | - duration: 2000, | |
762 | - }) | |
763 | - } else { | |
764 | - if (this.pd === '') { | |
765 | - uni.showToast({ | |
766 | - title: '请输入瞳距', | |
767 | - icon: 'none', | |
768 | - duration: 2000, | |
769 | - }) | |
770 | - } else { | |
771 | - if (this.kinds === 1) { | |
772 | - // 添加用户验光单 | |
773 | - if (this.pickerInfoChioce.rightSph === '' || this.pickerInfoChioce.leftSph === '' || | |
774 | - this.pickerInfoChioce.leftCyl === '' || this.pickerInfoChioce.rightCyl === '' || | |
775 | - this.pickerInfoChioce.leftAxi === '' || this.pickerInfoChioce.rightAxi === '' | |
776 | - ) { | |
777 | - uni.showToast({ | |
778 | - title: '请输入您的验光数据', | |
779 | - icon: 'none', | |
780 | - duration: 2000, | |
781 | - }) | |
782 | - } else { | |
783 | - // if (this.confirm) { | |
784 | - store.dispatch('myLoveList/addMylove', { | |
785 | - uid: this.$store.state.user.userInfo.uid, | |
786 | - openid: this.$store.state.user.userInfo.openid, | |
787 | - // mp_name: this.$store.state.user.userInfo.mp_name, | |
788 | - leftSph: this.pickerInfoChioce.leftSph, | |
789 | - rightSph: this.pickerInfoChioce.rightSph, | |
790 | - leftCyl: this.pickerInfoChioce.leftCyl, | |
791 | - rightCyl: this.pickerInfoChioce.rightCyl, | |
792 | - leftAxi: this.pickerInfoChioce.leftAxi, | |
793 | - rightAxi: this.pickerInfoChioce.rightAxi, | |
794 | - pd: this.pd, // 瞳距 | |
795 | - mp_name: this.name, | |
796 | - // time: this.pickerInfoChioce.time, | |
797 | - // img_url2: "http://localhost:8087/images/shop_1/1/", | |
798 | - }).then(({ mp_id: mpId }) => { | |
799 | - this.mp_id = mpId | |
800 | - }) | |
801 | - flag = 1 | |
802 | - } | |
803 | - } | |
804 | - if (this.kinds === 2) { | |
805 | - // if (this.confirm) { | |
806 | - const leftList = ['leftSph', 'leftCyl', 'leftAxi'] | |
807 | - const rightList = ['rightSph', 'rightCyl', 'rightAxi'] | |
808 | - // let flag=0; | |
809 | - if (this.name !== this.oldname) { | |
810 | - store.dispatch('myLoveList/updateMylove', { | |
811 | - uid: this.$store.state.user.userInfo.uid, | |
812 | - openid: this.$store.state.user.userInfo.openid, | |
813 | - mp_id: this.mp_id, | |
814 | - keyname: 'name', | |
815 | - keyvalue: this.name, | |
816 | - }) | |
817 | - flag = 1 | |
818 | - } | |
819 | - if (this.pd !== this.oldpd) { | |
820 | - store.dispatch('myLoveList/updateMylove', { | |
821 | - uid: this.$store.state.user.userInfo.uid, | |
822 | - openid: this.$store.state.user.userInfo.openid, | |
823 | - mp_id: this.mp_id, | |
824 | - keyname: 'pd', | |
825 | - keyvalue: this.pd, | |
826 | - }) | |
827 | - flag = 1 | |
828 | - } | |
829 | - // 先验证是否输入有无空 | |
830 | - let q = true | |
831 | - for (let k = 0; k < 3; k++) { | |
832 | - q = q && (this.pickerInfoList[k].nameArray1[this.pickerInfoList[k].nameIndex1] !== '' && | |
833 | - this.pickerInfoList[k].nameArray2[this.pickerInfoList[k].nameIndex2] !== '') | |
834 | - } | |
835 | - if (q) { | |
836 | - for (let j = 0; j < 3; j++) { | |
837 | - if (this.pickerInfoList[j].nameIndex1 !== 0) { | |
838 | - store.dispatch('myLoveList/updateMylove', { | |
839 | - uid: this.$store.state.user.userInfo.uid, | |
840 | - openid: this.$store.state.user.userInfo.openid, | |
841 | - mp_id: this.mp_id, | |
842 | - keyname: leftList[j], | |
843 | - keyvalue: this.pickerInfoList[j].nameArray1[this.pickerInfoList[j].nameIndex1], | |
844 | - }) | |
845 | - } | |
846 | - if (this.pickerInfoList[j].nameIndex2 !== 0) { | |
847 | - store.dispatch('myLoveList/updateMylove', { | |
848 | - uid: this.$store.state.user.userInfo.uid, | |
849 | - openid: this.$store.state.user.userInfo.openid, | |
850 | - mp_id: this.mp_id, | |
851 | - keyname: rightList[j], | |
852 | - keyvalue: this.pickerInfoList[j].nameArray2[this.pickerInfoList[j].nameIndex2], | |
853 | - }) | |
854 | - } | |
855 | - flag = 1 | |
856 | - } | |
857 | - } else { | |
858 | - flag = 0 | |
859 | - uni.showToast({ | |
860 | - title: '请输入您的验光数据', | |
861 | - icon: 'none', | |
862 | - duration: 2000, | |
863 | - }) | |
864 | - } | |
865 | - | |
866 | - // } else { | |
867 | - // uni.showToast({ | |
868 | - // title: '请确认您的验光数据', | |
869 | - // icon: 'none', | |
870 | - // duration: 3000, | |
871 | - // }) | |
872 | - // } | |
873 | - } | |
874 | - } | |
875 | - } | |
876 | - if (flag !== 0) { | |
877 | - // 如果数据验证无误,那么更新验光单的数据 | |
878 | - store.dispatch('myLoveList/getLoveList', { | |
879 | - uid: this.$store.state.user.userInfo.uid, | |
880 | - }) | |
881 | - let i = 0 | |
882 | - // 判断出是哪一个sku被选中 | |
883 | - for (let index = 0; index < this.current.length; index++) { | |
884 | - // console.log('index', index, i, index !== this.current.length - 1) | |
885 | - if (index !== this.current.length - 1) { | |
886 | - // 后续需修改算法:目前暂定只有两个参数选择,后续若有多个参数需要修改实现自适应 | |
887 | - i = this.current[index] * this.attrList[1].attr.length | |
888 | - } else { | |
889 | - i += this.current[index] | |
890 | - } | |
891 | - } | |
892 | - // 判断是否其输入的人员数据是否已存在 | |
893 | - store.dispatch('order/saveParams', { | |
894 | - sk_id_arr: this.skuList[i], | |
895 | - current: this.current, | |
896 | - mp_id: this.mp_id, | |
897 | - attrList: this.attrList, | |
898 | - }) | |
899 | - this.$store.state.cart.buyItem = this.skuItem | |
900 | - // 跳转到确认订单页面 | |
901 | - uni.navigateTo({ | |
902 | - url: `../confirmOrder/confirmOrder?pid=${this.pid}&count=${this.count}&name=${this.name}&isCart=false`, | |
903 | - }) | |
904 | - } | |
784 | + // 先处理验光部分的逻辑,如果ok在跳转 | |
785 | + let flag = 0 | |
786 | + if (this.name === '') { | |
787 | + uni.showToast({ | |
788 | + title: '请输入验光单取名', | |
789 | + icon: 'none', | |
790 | + duration: 2000, | |
791 | + }) | |
792 | + } else { | |
793 | + if (this.pd === '') { | |
794 | + uni.showToast({ | |
795 | + title: '请输入瞳距', | |
796 | + icon: 'none', | |
797 | + duration: 2000, | |
798 | + }) | |
799 | + } else { | |
800 | + if (this.kinds === 1) { | |
801 | + // 添加用户验光单 | |
802 | + if (this.pickerInfoChioce.rightSph === '' || this.pickerInfoChioce.leftSph === '' || | |
803 | + this.pickerInfoChioce.leftCyl === '' || this.pickerInfoChioce.rightCyl === '' || | |
804 | + this.pickerInfoChioce.leftAxi === '' || this.pickerInfoChioce.rightAxi === '' | |
805 | + ) { | |
806 | + uni.showToast({ | |
807 | + title: '请输入您的验光数据', | |
808 | + icon: 'none', | |
809 | + duration: 2000, | |
810 | + }) | |
811 | + } else { | |
812 | + // if (this.confirm) { | |
813 | + store.dispatch('myLoveList/addMylove', { | |
814 | + uid: this.$store.state.user.userInfo.uid, | |
815 | + openid: this.$store.state.user.userInfo.openid, | |
816 | + // mp_name: this.$store.state.user.userInfo.mp_name, | |
817 | + leftSph: this.pickerInfoChioce.leftSph, | |
818 | + rightSph: this.pickerInfoChioce.rightSph, | |
819 | + leftCyl: this.pickerInfoChioce.leftCyl, | |
820 | + rightCyl: this.pickerInfoChioce.rightCyl, | |
821 | + leftAxi: this.pickerInfoChioce.leftAxi, | |
822 | + rightAxi: this.pickerInfoChioce.rightAxi, | |
823 | + pd: this.pd, // 瞳距 | |
824 | + mp_name: this.name, | |
825 | + // time: this.pickerInfoChioce.time, | |
826 | + // img_url2: "http://localhost:8087/images/shop_1/1/", | |
827 | + }).then(({ | |
828 | + mp_id: mpId | |
829 | + }) => { | |
830 | + this.mp_id = mpId | |
831 | + }) | |
832 | + flag = 1 | |
833 | + } | |
834 | + } | |
835 | + if (this.kinds === 2) { | |
836 | + // if (this.confirm) { | |
837 | + const leftList = ['leftSph', 'leftCyl', 'leftAxi'] | |
838 | + const rightList = ['rightSph', 'rightCyl', 'rightAxi'] | |
839 | + // let flag=0; | |
840 | + if (this.name !== this.oldname) { | |
841 | + store.dispatch('myLoveList/updateMylove', { | |
842 | + uid: this.$store.state.user.userInfo.uid, | |
843 | + openid: this.$store.state.user.userInfo.openid, | |
844 | + mp_id: this.mp_id, | |
845 | + keyname: 'name', | |
846 | + keyvalue: this.name, | |
847 | + }) | |
848 | + flag = 1 | |
849 | + } | |
850 | + if (this.pd !== this.oldpd) { | |
851 | + store.dispatch('myLoveList/updateMylove', { | |
852 | + uid: this.$store.state.user.userInfo.uid, | |
853 | + openid: this.$store.state.user.userInfo.openid, | |
854 | + mp_id: this.mp_id, | |
855 | + keyname: 'pd', | |
856 | + keyvalue: this.pd, | |
857 | + }) | |
858 | + flag = 1 | |
859 | + } | |
860 | + // 先验证是否输入有无空 | |
861 | + let q = true | |
862 | + for (let k = 0; k < 3; k++) { | |
863 | + q = q && (this.pickerInfoList[k].nameArray1[this.pickerInfoList[k].nameIndex1] !== '' && | |
864 | + this.pickerInfoList[k].nameArray2[this.pickerInfoList[k].nameIndex2] !== '') | |
865 | + } | |
866 | + if (q) { | |
867 | + for (let j = 0; j < 3; j++) { | |
868 | + if (this.pickerInfoList[j].nameIndex1 !== 0) { | |
869 | + store.dispatch('myLoveList/updateMylove', { | |
870 | + uid: this.$store.state.user.userInfo.uid, | |
871 | + openid: this.$store.state.user.userInfo.openid, | |
872 | + mp_id: this.mp_id, | |
873 | + keyname: leftList[j], | |
874 | + keyvalue: this.pickerInfoList[j].nameArray1[this.pickerInfoList[j] | |
875 | + .nameIndex1], | |
876 | + }) | |
877 | + } | |
878 | + if (this.pickerInfoList[j].nameIndex2 !== 0) { | |
879 | + store.dispatch('myLoveList/updateMylove', { | |
880 | + uid: this.$store.state.user.userInfo.uid, | |
881 | + openid: this.$store.state.user.userInfo.openid, | |
882 | + mp_id: this.mp_id, | |
883 | + keyname: rightList[j], | |
884 | + keyvalue: this.pickerInfoList[j].nameArray2[this.pickerInfoList[j] | |
885 | + .nameIndex2], | |
886 | + }) | |
887 | + } | |
888 | + flag = 1 | |
889 | + } | |
890 | + } else { | |
891 | + flag = 0 | |
892 | + uni.showToast({ | |
893 | + title: '请输入您的验光数据', | |
894 | + icon: 'none', | |
895 | + duration: 2000, | |
896 | + }) | |
897 | + } | |
898 | + | |
899 | + // } else { | |
900 | + // uni.showToast({ | |
901 | + // title: '请确认您的验光数据', | |
902 | + // icon: 'none', | |
903 | + // duration: 3000, | |
904 | + // }) | |
905 | + // } | |
906 | + } | |
907 | + } | |
908 | + } | |
909 | + if (flag !== 0) { | |
910 | + // 如果数据验证无误,那么更新验光单的数据 | |
911 | + store.dispatch('myLoveList/getLoveList', { | |
912 | + uid: this.$store.state.user.userInfo.uid, | |
913 | + }) | |
914 | + let i = 0 | |
915 | + // 判断出是哪一个sku被选中 | |
916 | + for (let index = 0; index < this.current.length; index++) { | |
917 | + // console.log('index', index, i, index !== this.current.length - 1) | |
918 | + if (index !== this.current.length - 1) { | |
919 | + // 后续需修改算法:目前暂定只有两个参数选择,后续若有多个参数需要修改实现自适应 | |
920 | + i = this.current[index] * this.attrList[1].attr.length | |
921 | + } else { | |
922 | + i += this.current[index] | |
923 | + } | |
924 | + } | |
925 | + // 判断是否其输入的人员数据是否已存在 | |
926 | + store.dispatch('order/saveParams', { | |
927 | + wsp_id_arr: this.skuList[i], | |
928 | + current: this.current, | |
929 | + mp_id: this.mp_id, | |
930 | + attrList: this.attrList, | |
931 | + }) | |
932 | + this.$store.state.cart.buyItem = this.skuItem | |
933 | + // 跳转到确认订单页面 | |
934 | + uni.navigateTo({ | |
935 | + url: `../confirmOrder/confirmOrder?shop_wood_id=${this.shop_wood_id}&count=${this.count}&name=${this.name}&isCart=false`, | |
936 | + }) | |
937 | + } | |
905 | 938 | }, |
906 | 939 | } |
907 | 940 | } |
... | ... | @@ -909,91 +942,103 @@ import store from '@/store' |
909 | 942 | |
910 | 943 | <style lang="scss"> |
911 | 944 | .BottomSheetContent { |
912 | - min-height: 100vh; | |
913 | - background-color: #f2f2f2; | |
914 | - // padding-top: 20rpx; | |
915 | - .goodInfo { | |
916 | - width: 100%; | |
917 | - height: 272rpx; | |
918 | - border-radius: 16rpx; | |
919 | - background-color: #ffffff; | |
920 | - box-sizing: border-box; | |
921 | - padding: 36rpx; | |
922 | - display: flex; | |
923 | - flex-direction: row; | |
924 | - justify-content: flex-start; | |
925 | - position: sticky; | |
926 | - top: 0rpx; | |
927 | - left: 0rpx; | |
928 | - z-index: 99999; | |
929 | - .imageWrap { | |
930 | - height: 188rpx; | |
931 | - width: 188rpx; | |
932 | - margin-right: 28rpx; | |
933 | - image { | |
934 | - height: 188rpx; | |
935 | - width: 188rpx; | |
936 | - } | |
937 | - } | |
938 | - .infoRight { | |
939 | - display: flex; | |
940 | - flex-direction: column; | |
941 | - align-items: flex-start; | |
942 | - justify-content: space-between; | |
943 | - width: 100%; | |
944 | - .goodName { | |
945 | - font-size: 28rpx; | |
946 | - color: #333333; | |
947 | - } | |
948 | - .remarks { | |
949 | - font-size: 20rpx; | |
950 | - color: #999999; | |
951 | - } | |
952 | - .priceBox { | |
953 | - display: flex; | |
954 | - justify-content: space-between; | |
955 | - align-items: center; | |
956 | - width: 100%; | |
957 | - font-size: 14px; | |
958 | - color: #999999; | |
959 | - .price { | |
960 | - color: #ff6b4a; | |
961 | - font-size: 28rpx; | |
962 | - } | |
963 | - .counter { | |
964 | - display: flex; | |
965 | - flex-direction: row; | |
966 | - justify-content: space-between; | |
967 | - align-items: center; | |
968 | - font-size: 28rpx; | |
969 | - color: #333333; | |
970 | - width: 122rpx; | |
971 | - .btn { | |
972 | - display: flex; | |
973 | - justify-content: center; | |
974 | - line-height: 32rpx; | |
975 | - height: 32rpx; | |
976 | - width: 32rpx; | |
977 | - background-color: #f2f2f2; | |
978 | - color: #cfcfcf; | |
979 | - } | |
980 | - } | |
981 | - } | |
982 | - } | |
983 | - } | |
984 | - .peopleChoose{ | |
985 | - width: 100%; | |
986 | - min-height: 200rpx; | |
987 | - border-radius: 16rpx; | |
988 | - background-color: #ffffff; | |
989 | - box-sizing: border-box; | |
990 | - padding: 36rpx; | |
945 | + min-height: 100vh; | |
946 | + background-color: #f2f2f2; | |
947 | + | |
948 | + // padding-top: 20rpx; | |
949 | + .goodInfo { | |
950 | + width: 100%; | |
951 | + height: 272rpx; | |
952 | + border-radius: 16rpx; | |
953 | + background-color: #ffffff; | |
954 | + box-sizing: border-box; | |
955 | + padding: 36rpx; | |
956 | + display: flex; | |
957 | + flex-direction: row; | |
958 | + justify-content: flex-start; | |
959 | + position: sticky; | |
960 | + top: 0rpx; | |
961 | + left: 0rpx; | |
962 | + z-index: 99999; | |
963 | + | |
964 | + .imageWrap { | |
965 | + height: 188rpx; | |
966 | + width: 188rpx; | |
967 | + margin-right: 28rpx; | |
968 | + | |
969 | + image { | |
970 | + height: 188rpx; | |
971 | + width: 188rpx; | |
972 | + } | |
973 | + } | |
974 | + | |
975 | + .infoRight { | |
976 | + display: flex; | |
977 | + flex-direction: column; | |
978 | + align-items: flex-start; | |
979 | + justify-content: space-between; | |
980 | + width: 100%; | |
981 | + | |
982 | + .goodName { | |
983 | + font-size: 28rpx; | |
984 | + color: #333333; | |
985 | + } | |
986 | + | |
987 | + .remarks { | |
988 | + font-size: 20rpx; | |
989 | + color: #999999; | |
990 | + } | |
991 | + | |
992 | + .priceBox { | |
993 | + display: flex; | |
994 | + justify-content: space-between; | |
995 | + align-items: center; | |
996 | + width: 100%; | |
997 | + font-size: 14px; | |
998 | + color: #999999; | |
999 | + | |
1000 | + .price { | |
1001 | + color: #ff6b4a; | |
1002 | + font-size: 28rpx; | |
1003 | + } | |
1004 | + | |
1005 | + .counter { | |
1006 | + display: flex; | |
1007 | + flex-direction: row; | |
1008 | + justify-content: space-between; | |
1009 | + align-items: center; | |
1010 | + font-size: 28rpx; | |
1011 | + color: #333333; | |
1012 | + width: 122rpx; | |
1013 | + | |
1014 | + .btn { | |
1015 | + display: flex; | |
1016 | + justify-content: center; | |
1017 | + line-height: 32rpx; | |
1018 | + height: 32rpx; | |
1019 | + width: 32rpx; | |
1020 | + background-color: #f2f2f2; | |
1021 | + color: #cfcfcf; | |
1022 | + } | |
1023 | + } | |
1024 | + } | |
1025 | + } | |
1026 | + } | |
1027 | + | |
1028 | + .peopleChoose { | |
1029 | + width: 100%; | |
1030 | + min-height: 200rpx; | |
1031 | + border-radius: 16rpx; | |
1032 | + background-color: #ffffff; | |
1033 | + box-sizing: border-box; | |
1034 | + padding: 36rpx; | |
991 | 1035 | margin: 10px 0; |
992 | - display: flex; | |
993 | - flex-direction: column; | |
994 | - justify-content: flex-start; | |
1036 | + display: flex; | |
1037 | + flex-direction: column; | |
1038 | + justify-content: flex-start; | |
995 | 1039 | align-items: center; |
996 | - .title{ | |
1040 | + | |
1041 | + .title { | |
997 | 1042 | font-size: 16px; |
998 | 1043 | color: #333333; |
999 | 1044 | letter-spacing: -0.3px; |
... | ... | @@ -1001,7 +1046,8 @@ import store from '@/store' |
1001 | 1046 | line-height: 24px; |
1002 | 1047 | margin: 4px 0; |
1003 | 1048 | } |
1004 | - .loveList{ | |
1049 | + | |
1050 | + .loveList { | |
1005 | 1051 | display: flex; |
1006 | 1052 | flex-direction: row; |
1007 | 1053 | flex-wrap: wrap; |
... | ... | @@ -1009,314 +1055,356 @@ import store from '@/store' |
1009 | 1055 | align-items: center; |
1010 | 1056 | padding-top: 24rpx; |
1011 | 1057 | width: 100%; |
1058 | + | |
1012 | 1059 | .peopleName { |
1013 | - padding: 0 30rpx; | |
1014 | - height: 60rpx; | |
1015 | - margin: 0 20rpx 20rpx 0; | |
1016 | - transition: all 0.3s; | |
1017 | - background: #f2f2f2; | |
1018 | - border-radius: 2px; | |
1019 | - border-radius: 2px; | |
1020 | - line-height: 60rpx; | |
1021 | - text-align: center; | |
1022 | - color: #666666; | |
1023 | - font-size: 12px; | |
1060 | + padding: 0 30rpx; | |
1061 | + height: 60rpx; | |
1062 | + margin: 0 20rpx 20rpx 0; | |
1063 | + transition: all 0.3s; | |
1064 | + background: #f2f2f2; | |
1065 | + border-radius: 2px; | |
1066 | + border-radius: 2px; | |
1067 | + line-height: 60rpx; | |
1068 | + text-align: center; | |
1069 | + color: #666666; | |
1070 | + font-size: 12px; | |
1024 | 1071 | } |
1072 | + | |
1025 | 1073 | .active2 { |
1026 | - background: rgba(255, 107, 74, 0.15); | |
1027 | - color: #ff6b4a; | |
1074 | + background: rgba(255, 107, 74, 0.15); | |
1075 | + color: #ff6b4a; | |
1028 | 1076 | } |
1029 | 1077 | } |
1030 | - } | |
1031 | - .goods-data { | |
1032 | - width: 100%; | |
1033 | - box-sizing: border-box; | |
1034 | - padding: 37rpx 40rpx 0 40rpx; | |
1035 | - background: #ffffff; | |
1036 | - border-radius: 12rpx; | |
1037 | - .opCollapse { | |
1038 | - width: 100%; | |
1039 | - padding-bottom: 28rpx; | |
1040 | - margin-top: 7px; | |
1041 | - border-bottom: 1px solid #e9e9e9; | |
1042 | - .head { | |
1043 | - display: flex; | |
1044 | - justify-content: space-between; | |
1045 | - height: 24px; | |
1046 | - // font-family: PingFangSC-Medium; | |
1047 | - font-size: 16px; | |
1048 | - color: #333333; | |
1049 | - letter-spacing: -0.3px; | |
1050 | - text-align: justify; | |
1051 | - line-height: 24px; | |
1052 | - margin-bottom: 18rpx; | |
1053 | - .headRighted { | |
1054 | - width: 0; | |
1055 | - height: 0; | |
1056 | - border-left: 4px solid transparent; | |
1057 | - border-right: 4px solid transparent; | |
1058 | - border-bottom: 4px solid #cfcfcf; | |
1059 | - transform: scaleY(-1); | |
1060 | - margin-top: 10px; | |
1061 | - } | |
1062 | - .headMid { | |
1063 | - font-size: 10px; | |
1064 | - color: #999999; | |
1065 | - letter-spacing: -0.19px; | |
1066 | - margin-left: -120rpx; | |
1067 | - } | |
1068 | - .headRight { | |
1069 | - width: 0; | |
1070 | - height: 0; | |
1071 | - border-left: 4px solid transparent; | |
1072 | - border-right: 4px solid transparent; | |
1073 | - border-bottom: 4px solid #cfcfcf; | |
1074 | - margin-top: 10px; | |
1075 | - } | |
1076 | - } | |
1077 | - .body { | |
1078 | - font-size: 12px; | |
1079 | - color: #666666; | |
1080 | - letter-spacing: 0; | |
1081 | - .bodyBox { | |
1082 | - margin-top: 15px; | |
1083 | - .names { | |
1084 | - font-size: 12px; | |
1085 | - color: #151515; | |
1086 | - letter-spacing: 0; | |
1087 | - text-align: justify; | |
1088 | - line-height: 17px; | |
1089 | - margin-left: 5px; | |
1090 | - margin-right: 10px; | |
1091 | - } | |
1092 | - text { | |
1093 | - font-size: 12px; | |
1094 | - color: #666666; | |
1095 | - letter-spacing: 0; | |
1096 | - text-align: justify; | |
1097 | - } | |
1098 | - } | |
1099 | - } | |
1100 | - .goods-form { | |
1101 | - display: flex; | |
1102 | - flex-direction: column; | |
1103 | - align-items: center; | |
1104 | - justify-content: center; | |
1105 | - background-color: #fff; | |
1106 | - width: 100%; | |
1107 | - padding: 40rpx 0; | |
1108 | - .p1 { | |
1109 | - font-size: 16px; | |
1110 | - color: #333333; | |
1111 | - letter-spacing: -0.3px; | |
1112 | - text-align: justify; | |
1113 | - line-height: 24px; | |
1114 | - margin: 4px 0; | |
1115 | - | |
1116 | - } | |
1117 | - .p2 { | |
1118 | - font-size: 12px; | |
1119 | - color: #999999; | |
1120 | - letter-spacing: -0.23px; | |
1121 | - margin-bottom: 32rpx; | |
1122 | - } | |
1123 | - .image2{ | |
1124 | - width: 42rpx; | |
1125 | - height: 34rpx; | |
1126 | - margin-right: 12rpx; | |
1127 | - } | |
1128 | - .confirm { | |
1129 | - display: flex; | |
1130 | - align-items: center; | |
1131 | - font-size: 12px; | |
1132 | - color: #666666; | |
1133 | - letter-spacing: -0.23px; | |
1134 | - width: 684rpx; | |
1135 | - .image1{ | |
1136 | - margin-right:25rpx; | |
1137 | - width: 42rpx; | |
1138 | - height: 38rpx; | |
1139 | - } | |
1140 | - } | |
1141 | - .picker{ | |
1142 | - display: flex; | |
1143 | - flex-direction: column; | |
1144 | - justify-content: center; | |
1145 | - align-items: center; | |
1146 | - width: 100%; | |
1147 | - | |
1148 | - .picker-choice{ | |
1149 | - display: flex; | |
1150 | - width: 684rpx; | |
1151 | - align-items: center; | |
1152 | - margin-bottom: 40rpx; | |
1153 | - .input{ | |
1154 | - border-bottom: 1px solid #CFCFCF; | |
1155 | - height: 40rpx; | |
1156 | - } | |
1157 | - .choice-left{ | |
1158 | - width: 210rpx; | |
1159 | - .pd{ | |
1160 | - font-size: 14px; | |
1161 | - color: #333333; | |
1162 | - letter-spacing: -0.26px; | |
1163 | - text-align: justify; | |
1164 | - line-height: 24px; | |
1165 | - margin-right: 44rpx; | |
1166 | - } | |
1167 | - .p11 { | |
1168 | - font-size: 14px; | |
1169 | - color: #333333; | |
1170 | - letter-spacing: -0.26px; | |
1171 | - text-align: justify; | |
1172 | - line-height: 24px; | |
1173 | - // margin-right: 10px; | |
1174 | - } | |
1175 | - .p12 { | |
1176 | - font-size: 10px; | |
1177 | - color: #3F3F3F; | |
1178 | - letter-spacing: -0.19px; | |
1179 | - text-align: justify; | |
1180 | - line-height: 24px; | |
1181 | - } | |
1182 | - | |
1183 | - } | |
1184 | - .p13 { | |
1185 | - font-size: 10px; | |
1186 | - color: #999999; | |
1187 | - letter-spacing: -0.19px; | |
1188 | - margin-right: 10px; | |
1189 | - } | |
1190 | - .p13-date { | |
1191 | - font-size: 10px; | |
1192 | - color: #999999; | |
1193 | - letter-spacing: -0.19px; | |
1194 | - margin-right: 5px; | |
1195 | - } | |
1196 | - picker{ | |
1197 | - width: 144rpx; | |
1198 | - height: 40rpx; | |
1199 | - display: flex; | |
1200 | - position: relative; | |
1201 | - .p14 { | |
1202 | - font-size: 14px; | |
1203 | - color: #666666; | |
1204 | - letter-spacing: -0.26px; | |
1205 | - text-align: center; | |
1206 | - width: 124rpx; | |
1207 | - border-bottom: 1px solid #CFCFCF; | |
1208 | - height: 38rpx; | |
1209 | - } | |
1210 | - image{ | |
1211 | - width: 20rpx; | |
1212 | - height: 20rpx; | |
1213 | - position: absolute; | |
1214 | - right: 20rpx; | |
1215 | - top: 8rpx; | |
1216 | - } | |
1217 | - } | |
1218 | - | |
1219 | - } | |
1220 | - } | |
1221 | - | |
1222 | - .ipts{ | |
1078 | + } | |
1079 | + | |
1080 | + .goods-data { | |
1223 | 1081 | width: 100%; |
1224 | - display: flex; | |
1225 | - flex-direction: column; | |
1226 | - justify-content: center; | |
1227 | - align-items: flex-start; | |
1228 | - // padding: 20rpx 36rpx; | |
1229 | 1082 | box-sizing: border-box; |
1230 | - .inputItem{ | |
1083 | + padding: 37rpx 40rpx 0 40rpx; | |
1084 | + background: #ffffff; | |
1085 | + border-radius: 12rpx; | |
1086 | + | |
1087 | + .opCollapse { | |
1088 | + width: 100%; | |
1089 | + padding-bottom: 28rpx; | |
1090 | + margin-top: 7px; | |
1091 | + border-bottom: 1px solid #e9e9e9; | |
1092 | + | |
1093 | + .head { | |
1094 | + display: flex; | |
1095 | + justify-content: space-between; | |
1096 | + height: 24px; | |
1097 | + // font-family: PingFangSC-Medium; | |
1098 | + font-size: 16px; | |
1099 | + color: #333333; | |
1100 | + letter-spacing: -0.3px; | |
1101 | + text-align: justify; | |
1102 | + line-height: 24px; | |
1103 | + margin-bottom: 18rpx; | |
1104 | + | |
1105 | + .headRighted { | |
1106 | + width: 0; | |
1107 | + height: 0; | |
1108 | + border-left: 4px solid transparent; | |
1109 | + border-right: 4px solid transparent; | |
1110 | + border-bottom: 4px solid #cfcfcf; | |
1111 | + transform: scaleY(-1); | |
1112 | + margin-top: 10px; | |
1113 | + } | |
1114 | + | |
1115 | + .headMid { | |
1116 | + font-size: 10px; | |
1117 | + color: #999999; | |
1118 | + letter-spacing: -0.19px; | |
1119 | + margin-left: -120rpx; | |
1120 | + } | |
1121 | + | |
1122 | + .headRight { | |
1123 | + width: 0; | |
1124 | + height: 0; | |
1125 | + border-left: 4px solid transparent; | |
1126 | + border-right: 4px solid transparent; | |
1127 | + border-bottom: 4px solid #cfcfcf; | |
1128 | + margin-top: 10px; | |
1129 | + } | |
1130 | + } | |
1131 | + | |
1132 | + .body { | |
1133 | + font-size: 12px; | |
1134 | + color: #666666; | |
1135 | + letter-spacing: 0; | |
1136 | + | |
1137 | + .bodyBox { | |
1138 | + margin-top: 15px; | |
1139 | + | |
1140 | + .names { | |
1141 | + font-size: 12px; | |
1142 | + color: #151515; | |
1143 | + letter-spacing: 0; | |
1144 | + text-align: justify; | |
1145 | + line-height: 17px; | |
1146 | + margin-left: 5px; | |
1147 | + margin-right: 10px; | |
1148 | + } | |
1149 | + | |
1150 | + text { | |
1151 | + font-size: 12px; | |
1152 | + color: #666666; | |
1153 | + letter-spacing: 0; | |
1154 | + text-align: justify; | |
1155 | + } | |
1156 | + } | |
1157 | + } | |
1158 | + | |
1159 | + .goods-form { | |
1160 | + display: flex; | |
1161 | + flex-direction: column; | |
1162 | + align-items: center; | |
1163 | + justify-content: center; | |
1164 | + background-color: #fff; | |
1165 | + width: 100%; | |
1166 | + padding: 40rpx 0; | |
1167 | + | |
1168 | + .p1 { | |
1169 | + font-size: 16px; | |
1170 | + color: #333333; | |
1171 | + letter-spacing: -0.3px; | |
1172 | + text-align: justify; | |
1173 | + line-height: 24px; | |
1174 | + margin: 4px 0; | |
1175 | + | |
1176 | + } | |
1177 | + | |
1178 | + .p2 { | |
1179 | + font-size: 12px; | |
1180 | + color: #999999; | |
1181 | + letter-spacing: -0.23px; | |
1182 | + margin-bottom: 32rpx; | |
1183 | + } | |
1184 | + | |
1185 | + .image2 { | |
1186 | + width: 42rpx; | |
1187 | + height: 34rpx; | |
1188 | + margin-right: 12rpx; | |
1189 | + } | |
1190 | + | |
1191 | + .confirm { | |
1192 | + display: flex; | |
1193 | + align-items: center; | |
1194 | + font-size: 12px; | |
1195 | + color: #666666; | |
1196 | + letter-spacing: -0.23px; | |
1197 | + width: 684rpx; | |
1198 | + | |
1199 | + .image1 { | |
1200 | + margin-right: 25rpx; | |
1201 | + width: 42rpx; | |
1202 | + height: 38rpx; | |
1203 | + } | |
1204 | + } | |
1205 | + | |
1206 | + .picker { | |
1207 | + display: flex; | |
1208 | + flex-direction: column; | |
1209 | + justify-content: center; | |
1210 | + align-items: center; | |
1211 | + width: 100%; | |
1212 | + | |
1213 | + .picker-choice { | |
1214 | + display: flex; | |
1215 | + width: 684rpx; | |
1216 | + align-items: center; | |
1217 | + margin-bottom: 40rpx; | |
1218 | + | |
1219 | + .input { | |
1220 | + border-bottom: 1px solid #CFCFCF; | |
1221 | + height: 40rpx; | |
1222 | + } | |
1223 | + | |
1224 | + .choice-left { | |
1225 | + width: 210rpx; | |
1226 | + | |
1227 | + .pd { | |
1228 | + font-size: 14px; | |
1229 | + color: #333333; | |
1230 | + letter-spacing: -0.26px; | |
1231 | + text-align: justify; | |
1232 | + line-height: 24px; | |
1233 | + margin-right: 44rpx; | |
1234 | + } | |
1235 | + | |
1236 | + .p11 { | |
1237 | + font-size: 14px; | |
1238 | + color: #333333; | |
1239 | + letter-spacing: -0.26px; | |
1240 | + text-align: justify; | |
1241 | + line-height: 24px; | |
1242 | + // margin-right: 10px; | |
1243 | + } | |
1244 | + | |
1245 | + .p12 { | |
1246 | + font-size: 10px; | |
1247 | + color: #3F3F3F; | |
1248 | + letter-spacing: -0.19px; | |
1249 | + text-align: justify; | |
1250 | + line-height: 24px; | |
1251 | + } | |
1252 | + | |
1253 | + } | |
1254 | + | |
1255 | + .p13 { | |
1256 | + font-size: 10px; | |
1257 | + color: #999999; | |
1258 | + letter-spacing: -0.19px; | |
1259 | + margin-right: 10px; | |
1260 | + } | |
1261 | + | |
1262 | + .p13-date { | |
1263 | + font-size: 10px; | |
1264 | + color: #999999; | |
1265 | + letter-spacing: -0.19px; | |
1266 | + margin-right: 5px; | |
1267 | + } | |
1268 | + | |
1269 | + picker { | |
1270 | + width: 144rpx; | |
1271 | + height: 40rpx; | |
1272 | + display: flex; | |
1273 | + position: relative; | |
1274 | + | |
1275 | + .p14 { | |
1276 | + font-size: 14px; | |
1277 | + color: #666666; | |
1278 | + letter-spacing: -0.26px; | |
1279 | + text-align: center; | |
1280 | + width: 124rpx; | |
1281 | + border-bottom: 1px solid #CFCFCF; | |
1282 | + height: 38rpx; | |
1283 | + } | |
1284 | + | |
1285 | + image { | |
1286 | + width: 20rpx; | |
1287 | + height: 20rpx; | |
1288 | + position: absolute; | |
1289 | + right: 20rpx; | |
1290 | + top: 8rpx; | |
1291 | + } | |
1292 | + } | |
1293 | + | |
1294 | + } | |
1295 | + } | |
1296 | + | |
1297 | + .ipts { | |
1298 | + width: 100%; | |
1299 | + display: flex; | |
1300 | + flex-direction: column; | |
1301 | + justify-content: center; | |
1302 | + align-items: flex-start; | |
1303 | + // padding: 20rpx 36rpx; | |
1304 | + box-sizing: border-box; | |
1305 | + | |
1306 | + .inputItem { | |
1307 | + display: flex; | |
1308 | + flex-direction: row; | |
1309 | + justify-content: center; | |
1310 | + align-items: center; | |
1311 | + margin-bottom: 36rpx; | |
1312 | + | |
1313 | + .text { | |
1314 | + margin-right: 100rpx; | |
1315 | + } | |
1316 | + | |
1317 | + .input { | |
1318 | + border-bottom: 1px solid #CFCFCF; | |
1319 | + } | |
1320 | + } | |
1321 | + | |
1322 | + } | |
1323 | + } | |
1324 | + } | |
1325 | + } | |
1326 | + | |
1327 | + .choose { | |
1328 | + width: 100%; | |
1329 | + background: #ffffff; | |
1330 | + border-radius: 12rpx; | |
1331 | + margin-top: 20rpx; | |
1332 | + padding: 40rpx 40rpx 112rpx 40rpx; | |
1333 | + box-sizing: border-box; | |
1334 | + | |
1335 | + .chooseItem { | |
1336 | + width: 100%; | |
1337 | + padding-bottom: 32rpx; | |
1338 | + border-bottom: 1px solid #e9e9e9; | |
1339 | + margin-bottom: 28rpx; | |
1340 | + } | |
1341 | + | |
1342 | + .chooseRes { | |
1343 | + font-size: 12px; | |
1344 | + color: #666666; | |
1345 | + } | |
1346 | + | |
1347 | + .itemsWrap { | |
1231 | 1348 | display: flex; |
1232 | 1349 | flex-direction: row; |
1233 | - justify-content: center; | |
1350 | + flex-wrap: wrap; | |
1351 | + justify-content: flex-start; | |
1234 | 1352 | align-items: center; |
1235 | - margin-bottom: 36rpx; | |
1236 | - .text{ | |
1237 | - margin-right: 100rpx; | |
1353 | + padding-top: 24rpx; | |
1354 | + | |
1355 | + .item1 { | |
1356 | + width: 64rpx; | |
1357 | + height: 64rpx; | |
1358 | + border-radius: 32rpx; | |
1359 | + margin: 0 36rpx 24rpx 0; | |
1360 | + transition: all 0.3s; | |
1361 | + border: 1px solid #ffffff; | |
1238 | 1362 | } |
1239 | - .input{ | |
1240 | - border-bottom: 1px solid #CFCFCF; | |
1363 | + | |
1364 | + .item2 { | |
1365 | + // width: 100rpx; | |
1366 | + padding: 0 30rpx; | |
1367 | + height: 60rpx; | |
1368 | + margin: 0 20rpx 20rpx 0; | |
1369 | + transition: all 0.3s; | |
1370 | + background: #f2f2f2; | |
1371 | + border-radius: 2px; | |
1372 | + border-radius: 2px; | |
1373 | + line-height: 60rpx; | |
1374 | + text-align: center; | |
1375 | + color: #666666; | |
1376 | + font-size: 12px; | |
1377 | + } | |
1378 | + | |
1379 | + .active1 { | |
1380 | + opacity: 0.7; | |
1381 | + border: 1px solid #ff6b4a; | |
1382 | + } | |
1383 | + | |
1384 | + .active2 { | |
1385 | + background: rgba(255, 107, 74, 0.15); | |
1386 | + color: #ff6b4a; | |
1241 | 1387 | } |
1242 | 1388 | } |
1243 | - | |
1244 | 1389 | } |
1245 | - } | |
1246 | - } | |
1247 | - } | |
1248 | - .choose { | |
1249 | - width: 100%; | |
1250 | - background: #ffffff; | |
1251 | - border-radius: 12rpx; | |
1252 | - margin-top: 20rpx; | |
1253 | - padding: 40rpx 40rpx 112rpx 40rpx; | |
1254 | - box-sizing: border-box; | |
1255 | - .chooseItem { | |
1256 | - width: 100%; | |
1257 | - padding-bottom: 32rpx; | |
1258 | - border-bottom: 1px solid #e9e9e9; | |
1259 | - margin-bottom: 28rpx; | |
1260 | - } | |
1261 | - .chooseRes { | |
1262 | - font-size: 12px; | |
1263 | - color: #666666; | |
1264 | - } | |
1265 | - .itemsWrap { | |
1266 | - display: flex; | |
1267 | - flex-direction: row; | |
1268 | - flex-wrap: wrap; | |
1269 | - justify-content: flex-start; | |
1270 | - align-items: center; | |
1271 | - padding-top: 24rpx; | |
1272 | - .item1 { | |
1273 | - width: 64rpx; | |
1274 | - height: 64rpx; | |
1275 | - border-radius: 32rpx; | |
1276 | - margin: 0 36rpx 24rpx 0; | |
1277 | - transition: all 0.3s; | |
1278 | - border: 1px solid #ffffff; | |
1279 | - } | |
1280 | - .item2 { | |
1281 | - // width: 100rpx; | |
1282 | - padding: 0 30rpx; | |
1283 | - height: 60rpx; | |
1284 | - margin: 0 20rpx 20rpx 0; | |
1285 | - transition: all 0.3s; | |
1286 | - background: #f2f2f2; | |
1287 | - border-radius: 2px; | |
1288 | - border-radius: 2px; | |
1289 | - line-height: 60rpx; | |
1290 | - text-align: center; | |
1291 | - color: #666666; | |
1292 | - font-size: 12px; | |
1293 | - } | |
1294 | - .active1 { | |
1295 | - opacity: 0.7; | |
1296 | - border: 1px solid #ff6b4a; | |
1297 | - } | |
1298 | - .active2 { | |
1299 | - background: rgba(255, 107, 74, 0.15); | |
1300 | - color: #ff6b4a; | |
1301 | - } | |
1302 | - } | |
1303 | - } | |
1304 | - .button { | |
1305 | - width: 100%; | |
1306 | - height: 112rpx; | |
1307 | - background-color: #ff6b4a; | |
1308 | - font-size: 16px; | |
1309 | - color: #ffffff; | |
1310 | - line-height: 112rpx; | |
1311 | - text-align: center; | |
1312 | - position: sticky; | |
1313 | - bottom: 0rpx; | |
1314 | - left: 0rpx; | |
1315 | - z-index: 9999; | |
1316 | - } | |
1390 | + | |
1391 | + .button { | |
1392 | + width: 100%; | |
1393 | + height: 112rpx; | |
1394 | + background-color: #ff6b4a; | |
1395 | + font-size: 16px; | |
1396 | + color: #ffffff; | |
1397 | + line-height: 112rpx; | |
1398 | + text-align: center; | |
1399 | + position: sticky; | |
1400 | + bottom: 0rpx; | |
1401 | + left: 0rpx; | |
1402 | + z-index: 9999; | |
1403 | + } | |
1317 | 1404 | } |
1405 | + | |
1318 | 1406 | /* sheet弹窗 */ |
1319 | - .sheet{ | |
1407 | + .sheet { | |
1320 | 1408 | width: 100%; |
1321 | 1409 | height: 100%; |
1322 | 1410 | position: fixed; |
... | ... | @@ -1324,12 +1412,12 @@ import store from '@/store' |
1324 | 1412 | left: 0upx; |
1325 | 1413 | bottom: 0upx; |
1326 | 1414 | right: 0upx; |
1327 | - background:rgba(0,0,0,0.3); | |
1415 | + background: rgba(0, 0, 0, 0.3); | |
1328 | 1416 | z-index: 10000; |
1329 | 1417 | } |
1330 | - | |
1418 | + | |
1331 | 1419 | /* 显示时候的动画默认0.5s */ |
1332 | - .sheetView{ | |
1420 | + .sheetView { | |
1333 | 1421 | width: 100%; |
1334 | 1422 | height: 0upx; |
1335 | 1423 | position: absolute; |
... | ... | @@ -1338,18 +1426,19 @@ import store from '@/store' |
1338 | 1426 | z-index: 10001; |
1339 | 1427 | transition: all 0.5s; |
1340 | 1428 | } |
1341 | - .sheetShow{ | |
1342 | - top:0upx !important; | |
1429 | + | |
1430 | + .sheetShow { | |
1431 | + top: 0upx !important; | |
1343 | 1432 | } |
1433 | + | |
1344 | 1434 | /* 关闭时的动画,时间自己可以设置0.5s*/ |
1345 | - .sheeHide{ | |
1346 | - top:120% !important; | |
1347 | - transition: all 0.5s; | |
1435 | + .sheeHide { | |
1436 | + top: 120% !important; | |
1437 | + transition: all 0.5s; | |
1348 | 1438 | } |
1349 | - | |
1439 | + | |
1350 | 1440 | /* 项目需求根据设计稿要展示的高度,超出这个高度就自动滚动*/ |
1351 | - .sheetView_active{ | |
1441 | + .sheetView_active { | |
1352 | 1442 | height: 1042upx; |
1353 | 1443 | } |
1354 | - | |
1355 | 1444 | </style> | ... | ... |
src/pages/address/addAddress.vue
1 | 1 | <template> |
2 | - <form | |
3 | - class="wrap" | |
4 | - @submit="formSubmit" | |
5 | - @reset="formReset" | |
6 | - > | |
7 | - <view class="content"> | |
8 | - <view class="item,name"> | |
9 | - <text class="itemText">姓名</text> | |
10 | - <input | |
11 | - placeholder="收货人姓名(真实姓名)" | |
12 | - placeholder-style="color:#B8B8B8" | |
13 | - name="name" | |
14 | - :value="name" | |
15 | - /> | |
16 | - </view> | |
17 | - <view class="item,phone"> | |
18 | - <text class="itemText">电话</text> | |
19 | - <input | |
20 | - placeholder="手机号" | |
21 | - type="digit" | |
22 | - placeholder-style="color:#B8B8B8" | |
23 | - name="mobile" | |
24 | - v-model="mobile" | |
25 | - /> | |
26 | - </view> | |
27 | - <view class="item,phone"> | |
28 | - <text class="itemText">性别</text> | |
29 | - <picker | |
30 | - @change="bindPickerChange" | |
31 | - :value="index" | |
32 | - :range="sexArray" | |
33 | - name="sex" | |
34 | - > | |
35 | - <view class="uni-input">{{sexArray[sexIndex]}}</view> | |
36 | - </picker> | |
37 | - </view> | |
38 | - <view class="item,area"> | |
39 | - <text class="itemText">地区</text> | |
40 | - <view | |
41 | - class="btn" | |
42 | - v-if="pickerText===''" | |
43 | - @tap="openAddres" | |
44 | - >选择省/市/区</view> | |
45 | - <view | |
46 | - class="btn" | |
47 | - v-else | |
48 | - @tap="openAddres" | |
49 | - >{{pickerText}}</view> | |
50 | - <simple-address | |
51 | - ref="SimpleAddress" | |
52 | - :pickerValueDefault="cityPickerValueDefault" | |
53 | - @onConfirm="onConfirm" | |
54 | - themeColor="#007AFF" | |
55 | - name="address" | |
56 | - ></simple-address> | |
57 | - </view> | |
58 | - <view class="item,address"> | |
59 | - <text class="itemText">详细地址</text> | |
60 | - <input | |
61 | - placeholder="街道、小区门牌等详细地址" | |
62 | - name="addDetail" | |
63 | - :value="addDetial" | |
64 | - /> | |
65 | - </view> | |
66 | - <view class="item,check"> | |
67 | - <text class="itemText">设为默认地址</text> | |
68 | - <switch | |
69 | - :checked="isDefalutAddress" | |
70 | - color="#FF6B4A" | |
71 | - style="transform:scale(0.6)" | |
72 | - @change="changeDefalutAddress" | |
73 | - name="isDefault" | |
74 | - /> | |
75 | - </view> | |
76 | - <input /> | |
77 | - </view> | |
78 | - <button | |
79 | - form-type="submit" | |
80 | - class="button" v-if="addId">编辑</button> | |
81 | - <button | |
82 | - form-type="submit" | |
83 | - class="button" | |
84 | - v-else | |
85 | - >保存并使用</button> | |
86 | - </form> | |
2 | + <form class="wrap" @submit="formSubmit" @reset="formReset"> | |
3 | + <view class="content"> | |
4 | + <view class="item,name"> | |
5 | + <text class="itemText">姓名</text> | |
6 | + <input placeholder="收货人姓名(真实姓名)" placeholder-style="color:#B8B8B8" name="name" :value="name" /> | |
7 | + </view> | |
8 | + <view class="item,phone"> | |
9 | + <text class="itemText">电话</text> | |
10 | + <input placeholder="手机号" type="digit" placeholder-style="color:#B8B8B8" name="mobile" | |
11 | + v-model="mobile" /> | |
12 | + </view> | |
13 | + <view class="item,phone"> | |
14 | + <text class="itemText">性别</text> | |
15 | + <picker @change="bindPickerChange" :value="sexIndex" :range="sexArray" name="sex"> | |
16 | + <view class="uni-input">{{sexArray[sexIndex]}}</view> | |
17 | + </picker> | |
18 | + </view> | |
19 | + <view class="item,area"> | |
20 | + <text class="itemText">地区</text> | |
21 | + <view class="btn" v-if="pickerText===''" @tap="openAddres">选择省/市/区</view> | |
22 | + <view class="btn" v-else @tap="openAddres">{{pickerText}}</view> | |
23 | + <simple-address ref="SimpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" | |
24 | + themeColor="#007AFF" name="address"></simple-address> | |
25 | + </view> | |
26 | + <view class="item,address"> | |
27 | + <text class="itemText">详细地址</text> | |
28 | + <input placeholder="街道、小区门牌等详细地址" name="addDetail" :value="add_detail" /> | |
29 | + </view> | |
30 | + <view class="item,check"> | |
31 | + <text class="itemText">设为默认地址</text> | |
32 | + <switch :checked="isDefalutAddress" color="#FF6B4A" style="transform:scale(0.6)" | |
33 | + @change="changeDefalutAddress" name="is_default" /> | |
34 | + </view> | |
35 | + <input /> | |
36 | + </view> | |
37 | + <button form-type="submit" class="button" v-if="addId">编辑</button> | |
38 | + <button form-type="submit" class="button" v-else>保存并使用</button> | |
39 | + </form> | |
87 | 40 | </template> |
88 | 41 | |
89 | 42 | <script> |
90 | -import SimpleAddress from '@/components/SimpleAddress/SimpleAddress.vue' | |
91 | -import store from '@/store' | |
43 | + import SimpleAddress from '@/components/SimpleAddress/SimpleAddress.vue' | |
44 | + import store from '@/store' | |
92 | 45 | |
93 | -export default { | |
94 | - data () { | |
95 | - return { | |
96 | - cityPickerValueDefault: [0, 0, 1], | |
97 | - pickerText: '', | |
98 | - isDefalutAddress: true, | |
99 | - sexArray: ['男', '女'], | |
100 | - sexIndex: 0, | |
101 | - flag: 0, | |
102 | - addId: undefined, | |
103 | - name: '', | |
104 | - mobile: '', | |
105 | - addDetial: '', | |
106 | - isDefault: 0 | |
107 | - } | |
108 | - }, | |
109 | - onLoad (option) { | |
110 | - const { addId } = option | |
111 | - if (addId) { | |
112 | - this.addId = addId | |
113 | - store.dispatch('address/details', { | |
114 | - add_id: addId | |
115 | - }).then(() => { | |
116 | - uni.setNavigationBarTitle({ | |
117 | - title: '编辑地址' | |
118 | - }) | |
119 | - const { name, mobile, sex, add_detail: addDetial, default: isDefault,address } = this.$store.state.address.details | |
120 | - console.log('---', this.$store.state.address.details) | |
121 | - const index = this.$refs.SimpleAddress.queryIndex(this.$store.state.address.details.address.split('-'), 'label') | |
122 | - console.log(index) | |
123 | - this.cityPickerValueDefault = index.index | |
124 | - this.name = name | |
125 | - this.mobile = Number(mobile) | |
126 | - this.sexIndex = sex | |
127 | - this.addDetial = addDetial | |
128 | - this.isDefalutAddress = !!Number(isDefault) | |
129 | - this.pickerText = address | |
130 | - }) | |
131 | - } | |
132 | - }, | |
133 | - components: { | |
134 | - SimpleAddress | |
135 | - }, | |
136 | - methods: { | |
137 | - openAddres () { | |
138 | - this.cityPickerValueDefault = [0, 0, 1] | |
139 | - this.$refs.SimpleAddress.open() | |
140 | - }, | |
141 | - onConfirm (e) { | |
142 | - this.pickerText = e.label | |
143 | - console.log('lll', e, this.pickerText) | |
144 | - }, | |
145 | - changeDefalutAddress (e) { | |
146 | - this.isDefalutAddress = e.target.value | |
147 | - }, | |
148 | - bindPickerChange (e) { | |
149 | - console.log('picker发送选择改变,携带值为', e.target.value) | |
150 | - this.sexIndex = e.target.value | |
151 | - }, | |
152 | - formValidation (formdata) { | |
153 | - const { name, mobile, addDetail } = formdata | |
154 | - this.flag = false | |
155 | - if (name === '') { | |
156 | - uni.showModal({ | |
157 | - content: '请输入姓名', | |
158 | - showCancel: false | |
159 | - }) | |
160 | - return 0 | |
161 | - } | |
162 | - if (!(/^1[3456789]\d{9}$/.test(mobile))) { | |
163 | - uni.showModal({ | |
164 | - content: '请输入正确的手机号', | |
165 | - showCancel: false | |
166 | - }) | |
167 | - return 0 | |
168 | - } | |
169 | - if (this.pickerText === '') { | |
170 | - uni.showModal({ | |
171 | - content: '请选择收货地区', | |
172 | - showCancel: false | |
173 | - }) | |
174 | - return 0 | |
175 | - } | |
176 | - if (addDetail === '') { | |
177 | - uni.showModal({ | |
178 | - content: '请输入收货详细地址', | |
179 | - showCancel: false | |
180 | - }) | |
181 | - return 0 | |
182 | - } | |
183 | - this.flag = true | |
184 | - }, | |
185 | - formSubmit (e) { | |
186 | - const formdata = e.detail.value | |
187 | - this.formValidation(formdata) | |
46 | + export default { | |
47 | + data() { | |
48 | + return { | |
49 | + cityPickerValueDefault: [0, 0, 1], | |
50 | + pickerText: '', | |
51 | + isDefalutAddress: true, | |
52 | + sexArray: ['男', '女'], | |
53 | + sexIndex: 0, | |
54 | + flag: 0, | |
55 | + addId: undefined, | |
56 | + name: '', | |
57 | + mobile: '', | |
58 | + add_detail: '', | |
59 | + is_default: 0, | |
60 | + // sex:0 | |
61 | + } | |
62 | + }, | |
63 | + onLoad(option) { | |
64 | + const { | |
65 | + addId | |
66 | + } = option | |
67 | + if (addId) { | |
68 | + this.addId = addId | |
69 | + store.dispatch('address/details', { | |
70 | + add_id: addId, | |
71 | + uid:1 | |
72 | + }).then(() => { | |
73 | + uni.setNavigationBarTitle({ | |
74 | + title: '编辑地址' | |
75 | + }) | |
76 | + const { | |
77 | + name, | |
78 | + mobile, | |
79 | + sex, | |
80 | + add_id, | |
81 | + add_detail, | |
82 | + province, | |
83 | + city, | |
84 | + is_default, | |
85 | + address | |
86 | + } = this.$store.state.address.details | |
87 | + console.log('this.$store.state.address.details', this.$store.state.address.details) | |
88 | + let a = this.$store.state.address.details.province+"-"+this.$store.state.address.details.city+"-"+this.$store.state.address.details.address; | |
89 | + console.log('a', a); | |
90 | + const index = this.$refs.SimpleAddress.queryIndex( | |
91 | + a.split('-'), 'label') | |
92 | + console.log(index) | |
93 | + this.cityPickerValueDefault = index.index | |
94 | + this.name = name | |
95 | + this.mobile = Number(mobile) | |
96 | + this.sexIndex = sex | |
97 | + this.add_detail = add_detail | |
98 | + this.isDefalutAddress = !!Number(is_default) | |
99 | + this.pickerText = a | |
100 | + }) | |
101 | + } | |
102 | + }, | |
103 | + components: { | |
104 | + SimpleAddress | |
105 | + }, | |
106 | + methods: { | |
107 | + openAddres() { | |
108 | + this.cityPickerValueDefault = [0, 0, 1] | |
109 | + this.$refs.SimpleAddress.open() | |
110 | + }, | |
111 | + onConfirm(e) { | |
112 | + this.pickerText = e.label | |
113 | + console.log('lll', e, this.pickerText) | |
114 | + }, | |
115 | + changeDefalutAddress(e) { | |
116 | + this.isDefalutAddress = e.target.value | |
117 | + }, | |
118 | + bindPickerChange(e) { | |
119 | + console.log('picker发送选择改变,携带值为', e.target.value) | |
120 | + this.sexIndex = e.target.value | |
121 | + }, | |
122 | + formValidation(formdata) { | |
123 | + const { | |
124 | + name, | |
125 | + mobile, | |
126 | + addDetail | |
127 | + } = formdata | |
128 | + this.flag = false | |
129 | + if (name === '') { | |
130 | + uni.showModal({ | |
131 | + content: '请输入姓名', | |
132 | + showCancel: false | |
133 | + }) | |
134 | + return 0 | |
135 | + } | |
136 | + if (!(/^1[3456789]\d{9}$/.test(mobile))) { | |
137 | + uni.showModal({ | |
138 | + content: '请输入正确的手机号', | |
139 | + showCancel: false | |
140 | + }) | |
141 | + return 0 | |
142 | + } | |
143 | + if (this.pickerText === '') { | |
144 | + uni.showModal({ | |
145 | + content: '请选择收货地区', | |
146 | + showCancel: false | |
147 | + }) | |
148 | + return 0 | |
149 | + } | |
150 | + if (addDetail === '') { | |
151 | + uni.showModal({ | |
152 | + content: '请输入收货详细地址', | |
153 | + showCancel: false | |
154 | + }) | |
155 | + return 0 | |
156 | + } | |
157 | + this.flag = true | |
158 | + }, | |
159 | + formSubmit(e) { | |
160 | + const formdata = e.detail.value | |
161 | + this.formValidation(formdata) | |
188 | 162 | |
189 | - const { name, mobile, addDetail, isDefault } = formdata | |
190 | - if (this.flag === true) { | |
191 | - const params = { | |
192 | - sex: this.sexIndex, | |
193 | - name, | |
194 | - address: this.pickerText, | |
195 | - mobile, | |
196 | - default: isDefault ? 1 : 0, | |
197 | - add_detail: addDetail, | |
198 | - longitude: 1, | |
199 | - latitude: 1 | |
200 | - } | |
201 | - if (this.addId) { | |
202 | - params.add_id = this.addId | |
203 | - } | |
204 | - store.dispatch('address/edit', params).then(() => { | |
205 | - console.log('fanhui') | |
206 | - uni.navigateBack({ | |
207 | - delta: 1 | |
208 | - }) | |
209 | - }) | |
210 | - } | |
211 | - } | |
212 | - } | |
213 | -} | |
163 | + const { | |
164 | + name, | |
165 | + mobile, | |
166 | + addDetail, | |
167 | + is_default | |
168 | + } = formdata | |
169 | + if (this.flag === true) { | |
170 | + console.log('this.pickerText', this.pickerText); | |
171 | + const addressOffice = this.pickerText.split("-"); | |
172 | + const params = { | |
173 | + sex: this.sexIndex, | |
174 | + name, | |
175 | + province: addressOffice[0], | |
176 | + city:addressOffice[1], | |
177 | + address: addressOffice[2], | |
178 | + uid:1, | |
179 | + mobile:'13910779120', | |
180 | + default: is_default ? 1 : 0, | |
181 | + add_detail: addDetail, | |
182 | + longitude: 1, | |
183 | + latitude: 1 | |
184 | + } | |
185 | + if (this.addId) { | |
186 | + params.add_id = this.addId | |
187 | + } | |
188 | + store.dispatch('address/edit', params).then(() => { | |
189 | + console.log('fanhui') | |
190 | + uni.navigateBack({ | |
191 | + delta: 1 | |
192 | + }) | |
193 | + }) | |
194 | + } | |
195 | + } | |
196 | + } | |
197 | + } | |
214 | 198 | </script> |
215 | 199 | |
216 | 200 | <style lang="scss"> |
217 | -.wrap { | |
218 | - height: 100vh; | |
219 | - background-color: #f2f2f2; | |
220 | - font-family: PingFangSC-Regular; | |
221 | - letter-spacing: -0.23px; | |
222 | - padding-top: 19rpx; | |
223 | -} | |
224 | -.content { | |
225 | - background-color: #ffffff; | |
226 | - border-radius: 8px; | |
227 | - border-radius: 8px; | |
228 | - padding: 40rpx 56rpx; | |
229 | - margin-left: 40rpx; | |
230 | - width: 670rpx; | |
231 | - box-sizing: border-box; | |
232 | - .item { | |
233 | - display: flex; | |
234 | - justify-content: flex-start; | |
235 | - font-size: 14px; | |
236 | - align-items: center; | |
237 | - height: 112rpx; | |
238 | - border-bottom: 1rpx solid #e9e9e9; | |
239 | - .itemText { | |
240 | - width: 162rpx; | |
241 | - font-family: PingFangSC-Regular; | |
242 | - letter-spacing: -0.26px; | |
243 | - } | |
244 | - .btn { | |
245 | - color: #333333 !important; | |
246 | - } | |
247 | - } | |
248 | - .check { | |
249 | - justify-content: space-between; | |
250 | - } | |
251 | -} | |
252 | -.button { | |
253 | - position: fixed; | |
254 | - bottom: 0; | |
255 | - left: 0; | |
256 | - height: 112rpx; | |
257 | - width: 100%; | |
258 | - background: #ff6b4a; | |
259 | - display: flex; | |
260 | - justify-content: center; | |
261 | - align-items: center; | |
262 | - font-size: 16px; | |
263 | - color: #ffffff; | |
264 | - letter-spacing: -0.3px; | |
265 | -} | |
266 | -</style> | |
201 | + .wrap { | |
202 | + height: 100vh; | |
203 | + background-color: #f2f2f2; | |
204 | + font-family: PingFangSC-Regular; | |
205 | + letter-spacing: -0.23px; | |
206 | + padding-top: 19rpx; | |
207 | + } | |
208 | + | |
209 | + .content { | |
210 | + background-color: #ffffff; | |
211 | + border:1px #000 solid; | |
212 | + border-radius: 8px; | |
213 | + border-radius: 8px; | |
214 | + padding: 40rpx 56rpx; | |
215 | + margin-left: 40rpx; | |
216 | + width: 670rpx; | |
217 | + box-sizing: border-box; | |
218 | + | |
219 | + .item { | |
220 | + display: flex; | |
221 | + border:1px #000 solid; | |
222 | + justify-content: flex-start; | |
223 | + font-size: 14px; | |
224 | + align-items: center; | |
225 | + height: 112rpx; | |
226 | + border-bottom: 1rpx solid #e9e9e9; | |
227 | + | |
228 | + .itemText { | |
229 | + width: 162rpx; | |
230 | + font-family: PingFangSC-Regular; | |
231 | + letter-spacing: -0.26px; | |
232 | + } | |
233 | + | |
234 | + .btn { | |
235 | + color: #333333 !important; | |
236 | + } | |
237 | + } | |
238 | + | |
239 | + .check { | |
240 | + justify-content: space-between; | |
241 | + } | |
242 | + } | |
243 | + | |
244 | + .button { | |
245 | + position: fixed; | |
246 | + bottom: 0; | |
247 | + left: 0; | |
248 | + height: 112rpx; | |
249 | + width: 100%; | |
250 | + background: #ff6b4a; | |
251 | + display: flex; | |
252 | + justify-content: center; | |
253 | + align-items: center; | |
254 | + font-size: 16px; | |
255 | + color: #ffffff; | |
256 | + letter-spacing: -0.3px; | |
257 | + } | |
258 | +</style> | ... | ... |
src/pages/address/addressList.vue
... | ... | @@ -21,7 +21,8 @@ |
21 | 21 | </view> |
22 | 22 | <view class="order-user-body"> |
23 | 23 | <image src="../../static/myorder-paying-location.png"></image> |
24 | - <text class="address">{{item.address.replace(/[-]/g,' ')}}\n{{item.add_detail}}</text> | |
24 | + <!-- <text class="address">{{item.address.replace(/[-]/g,' ')}}\n{{item.add_detail}}</text> --> | |
25 | + <text class="address">{{item.province}}{{item.city}}{{item.address}}\n{{item.add_detail}}</text> | |
25 | 26 | </view> |
26 | 27 | <image |
27 | 28 | @click.stop="toEditAddress(item.add_id)" |
... | ... | @@ -62,10 +63,14 @@ export default { |
62 | 63 | if (edit) { |
63 | 64 | this.edit = true |
64 | 65 | } |
65 | - store.dispatch('address/list') | |
66 | + store.dispatch('address/list',{ | |
67 | + uid:1 | |
68 | + }) | |
66 | 69 | }, |
67 | 70 | onShow() { |
68 | - store.dispatch('address/list') | |
71 | + store.dispatch('address/list',{ | |
72 | + uid:1 | |
73 | + }) | |
69 | 74 | }, |
70 | 75 | methods: { |
71 | 76 | toAddAddress() { | ... | ... |
src/pages/cart/cart.vue
1 | -<template> | |
2 | - <view class="content"> | |
3 | - <block v-if="cartList.length==0"> | |
4 | - | |
5 | - </block> | |
6 | - <block v-else> | |
7 | - <view class="card"> | |
8 | - <view class="cardHeader"> | |
9 | - <view | |
10 | - v-bind:class="pIsoPen? 'partentChecked' : 'partentCheck'" | |
11 | - @click="pClick" | |
12 | - > | |
13 | - <span class="correct"></span> | |
14 | - </view> | |
15 | - <image | |
16 | - src="../../static/store.png" | |
17 | - mode="aspectFill" | |
18 | - ></image> | |
19 | - <text>非常戴镜</text> | |
20 | - </view> | |
21 | - <view | |
22 | - class="cardBody" | |
23 | - v-for="(item,index) in cartList" | |
24 | - :key="index" | |
25 | - @longpress="delCart(item.cart_id,index)" | |
26 | - > | |
27 | - <view | |
28 | - v-bind:class="cartList[index].isChecked? 'partentChecked':'partentCheck'" | |
29 | - @click="childClick(cartList[index],index)" | |
30 | - > | |
31 | - <span class="correct"></span> | |
32 | - </view> | |
33 | - <view class="imageWrap"> | |
34 | - <image | |
35 | - :src="item.img_index_url" | |
36 | - mode="aspectFit" | |
37 | - style="width: 188rpx;height: 168rpx;" | |
38 | - ></image> | |
39 | - </view> | |
40 | - <view class="goodInfo"> | |
41 | - <!-- <view class="imageWrap"> | |
42 | - <image :src="item.img_index_url" mode="aspectFit" style="width: 188rpx;height: 168rpx;"></image> | |
43 | - </view> --> | |
44 | - <view class="infoRight"> | |
45 | - <view | |
46 | - class="goodName" | |
47 | - @tap="toGoods(item.pid,item.sk_id)" | |
48 | - >{{item.p_name}}</view> | |
49 | - <view | |
50 | - class="describ" | |
51 | - @click="showBottom(3,item.pid,item.sk_id,item.mp_id,item.cart_id,index)" | |
52 | - > | |
53 | - <view class="desL"> | |
54 | - <view class="people"> | |
55 | - 使用人:{{item.peopleName}} | |
56 | - </view> | |
57 | - <view class="skuInfo"> | |
58 | - {{item.sku_name}} | |
59 | - </view> | |
60 | - </view> | |
61 | - <view class="desR"> | |
62 | - <image | |
63 | - src="../../static/right.png" | |
64 | - mode="aspectFit" | |
65 | - style="width: 18rpx;height: 18rpx;" | |
66 | - ></image> | |
67 | - </view> | |
68 | - </view> | |
69 | - <view class="priceBox"> | |
70 | - <view class="price">¥{{item.nowPrice*item.num}}</view> | |
71 | - <text class="maxCount">(限购{{maxCount}}副)</text> | |
72 | - <view class="counter"> | |
73 | - <view | |
74 | - class="btn" | |
75 | - disabled="this.addDisabled" | |
76 | - type="default" | |
77 | - @tap="counter(index,false,item)" | |
78 | - >-</view> | |
79 | - <text>{{item.num}}</text> | |
80 | - <view | |
81 | - class="btn" | |
82 | - disabled="this.desDisabled" | |
83 | - type="default" | |
84 | - @tap="counter(index,true,item)" | |
85 | - >+</view> | |
86 | - </view> | |
87 | - </view> | |
88 | - </view> | |
89 | - </view> | |
90 | - </view> | |
91 | - </view> | |
92 | - </block> | |
93 | - <view class="footer"> | |
94 | - <view class="footerLeft">实付金额:<text>¥{{totalPrice}}</text></view> | |
95 | - <view class="footerRight"> | |
96 | - <view | |
97 | - class="paybtn" | |
98 | - @click="toComfirmOrder" | |
99 | - >立即结算</view> | |
100 | - </view> | |
101 | - </view> | |
102 | - <BottomSheet | |
103 | - v-if="isShowBottom" | |
104 | - :isCart="isCart" | |
105 | - @addCart="addCart" | |
106 | - :sk_id="sk_id" | |
107 | - :propMpId="mp_id" | |
108 | - @chooseCartModi="chooseCartModi" | |
109 | - :cart_id="cart_id" | |
110 | - :index="cartIndex" | |
111 | - :pid="pid" | |
112 | - :goodInfo="goodInfo" | |
113 | - :isShowBottom="isShowBottom" | |
114 | - @closeBottom="closeBottom" | |
115 | - ></BottomSheet> | |
116 | - </view> | |
117 | -</template> | |
118 | - | |
119 | -<script> | |
120 | - | |
121 | -import store from '@/store' | |
122 | -import BottomSheet from '../../components/BottomSheet/BottomSheet.vue' | |
123 | -export default { | |
124 | - components: { | |
125 | - BottomSheet, | |
126 | - }, | |
127 | - data() { | |
128 | - return { | |
129 | - pid: Number, | |
130 | - isCart: Number, | |
131 | - sk_id: String, | |
132 | - mp_id: String, | |
133 | - isShowBottom: false, // 底部弹窗开关 | |
134 | - cart_id: Number, | |
135 | - maxCount: 20, | |
136 | - cartIndex: Number, | |
137 | - cartList: [], | |
138 | - } | |
139 | - }, | |
140 | - computed: { | |
141 | - pIsoPen () { | |
142 | - if (this.cartList.length > 0) { | |
143 | - return !this.cartList.find(item => !item.isChecked) | |
144 | - } | |
145 | - return false | |
146 | - }, | |
147 | - goodInfo () { | |
148 | - return this.$store.state.read.goodInfo | |
149 | - }, | |
150 | - totalPrice() { | |
151 | - let totalPrice = 0 | |
152 | - this.cartList.forEach((item) => { | |
153 | - if (item.isChecked) { | |
154 | - totalPrice += item.nowPrice * item.num | |
155 | - } | |
156 | - }) | |
157 | - return totalPrice | |
158 | - }, | |
159 | - }, | |
160 | - onShow: async function() { | |
161 | - await this.$store.dispatch('cart/getCartList', { | |
162 | - uid: this.$store.state.user.userInfo.uid, // 用户id | |
163 | - }) | |
164 | - | |
165 | - this.cartList = this.$store.state.cart.cartList | |
166 | - this.cartList.forEach((item) => { | |
167 | - item.isChecked = false | |
168 | - }) | |
169 | - }, | |
170 | - // onLoad: async function() { | |
171 | - // }, | |
172 | - methods: { | |
173 | - // 全选按钮 | |
174 | - pClick() { | |
175 | - const pStatus = !this.cartList.find(item => !item.isChecked) | |
176 | - const oldList = this.cartList | |
177 | - oldList.forEach((item, index) => { | |
178 | - item.isChecked = !pStatus | |
179 | - this.cartList.splice(index, 1, item) | |
180 | - }) | |
181 | - }, | |
182 | - // 单选按钮 | |
183 | - childClick(type, index) { | |
184 | - this.cartList[index].isChecked = !this.cartList[index].isChecked | |
185 | - // vue没有办法监听数组内部值的变化,所以需要通过这个方法去触发 | |
186 | - this.cartList.splice(index, 1, this.cartList[index]) | |
187 | - }, | |
188 | - // 修改购物车 | |
189 | - chooseCartModi(mp_id, sk_id, price, pid, num, cart_id, index) { | |
190 | - // console.log('modi',mp_id,sk_id,price,pid,num,cart_id) | |
191 | - store.dispatch('cart/modiCart', { | |
192 | - uid: this.$store.state.user.userInfo.uid, | |
193 | - openid: this.$store.state.user.userInfo.openid, | |
194 | - mp_id: mp_id, | |
195 | - sk_id: sk_id, | |
196 | - price: price, | |
197 | - pid: pid, | |
198 | - num: num, | |
199 | - cart_id: cart_id, | |
200 | - args: { | |
201 | - index: index, | |
202 | - }, | |
203 | - }) | |
204 | - this.$nextTick(function() { | |
205 | - store.dispatch('cart/getCartList', { | |
206 | - uid: this.$store.state.user.userInfo.uid, // 用户id | |
207 | - }).then(() => { | |
208 | - this.cartList = this.$store.state.cart.cartList | |
209 | - }) | |
210 | - }) | |
211 | - }, | |
212 | - // 底部弹窗开关 | |
213 | - showBottom(isCart, pid, skId, mp_id, cart_id, index) { | |
214 | - store.dispatch('read/fetch', { | |
215 | - pid, | |
216 | - sk_id: skId, | |
217 | - }).then(() => { | |
218 | - this.cartIndex = index | |
219 | - this.sk_id = skId | |
220 | - this.pid = pid | |
221 | - this.mp_id = mp_id | |
222 | - this.isCart = isCart | |
223 | - this.cart_id = cart_id | |
224 | - this.isShowBottom = true | |
225 | - }) | |
226 | - }, | |
227 | - closeBottom() { | |
228 | - this.isShowBottom = false | |
229 | - }, | |
230 | - toGoods(id, skId) { | |
231 | - uni.navigateTo({ | |
232 | - url: '../details/details?pid=' + id + '&sk_id=' + skId, | |
233 | - success: res => {}, | |
234 | - fail: () => {}, | |
235 | - complete: () => {}, | |
236 | - }) | |
237 | - }, | |
238 | - | |
239 | - toComfirmOrder() { | |
240 | - this.$store.state.cart.checkedCartLst = this.cartList.filter(item => item.isChecked) | |
241 | - if (this.$store.state.cart.checkedCartLst.length > 0) { | |
242 | - uni.navigateTo({ | |
243 | - url: '../confirmOrder/confirmOrder?isCart=true', | |
244 | - }) | |
245 | - } else { | |
246 | - uni.showToast({ | |
247 | - title: '您还没有选择宝贝哦~', | |
248 | - icon: 'none', | |
249 | - }) | |
250 | - } | |
251 | - }, | |
252 | - counter(index, isadd, item) { | |
253 | - // console.log('item=====>', item) | |
254 | - // console.log('num=====>', item.num) | |
255 | - const nums = parseInt(item.num) | |
256 | - if (isadd) { | |
257 | - if (nums >= this.maxCount) { | |
258 | - this.addDisabled = true | |
259 | - } else { | |
260 | - this.addDisabled = true | |
261 | - store.dispatch('cart/modiCart', { | |
262 | - uid: this.$store.state.user.userInfo.uid, | |
263 | - openid: this.$store.state.user.userInfo.openid, | |
264 | - mp_id: item.mp_id, | |
265 | - sk_id: item.sk_id, | |
266 | - price: item.nowPrice, | |
267 | - pid: item.pid, | |
268 | - num: nums + 1, | |
269 | - cart_id: item.cart_id, | |
270 | - args: { | |
271 | - index: index, | |
272 | - isadd: isadd, | |
273 | - }, | |
274 | - }) | |
275 | - this.addDisabled = false | |
276 | - } | |
277 | - } else { | |
278 | - if (nums <= 1) { | |
279 | - this.desDisabled = true | |
280 | - } else { | |
281 | - this.desDisabled = false | |
282 | - | |
283 | - store.dispatch('cart/modiCart', { | |
284 | - uid: this.$store.state.user.userInfo.uid, | |
285 | - openid: this.$store.state.user.userInfo.openid, | |
286 | - mp_id: item.mp_id, | |
287 | - sk_id: item.sk_id, | |
288 | - price: item.nowPrice, | |
289 | - pid: item.pid, | |
290 | - num: nums - 1, | |
291 | - cart_id: item.cart_id, | |
292 | - args: { | |
293 | - index: index, | |
294 | - isadd: isadd, | |
295 | - }, | |
296 | - }) | |
297 | - this.desDisabled = true | |
298 | - } | |
299 | - } | |
300 | - }, | |
301 | - delCart(cart_id, index) { | |
302 | - cart_id = parseInt(cart_id) | |
303 | - uni.showModal({ | |
304 | - title: '是否删除该商品', | |
305 | - success: function (res) { | |
306 | - if (res.confirm) { | |
307 | - store.dispatch('cart/delCart', { | |
308 | - uid: this.$store.state.user.userInfo.uid, | |
309 | - openid: this.$store.state.user.userInfo.openid, | |
310 | - cart_id: cart_id, // 要修改的购物车id | |
311 | - arg: index, // 由于action 传参是能接收两参数,因此将index放入对象 | |
312 | - }) | |
313 | - } | |
314 | - }.bind(this), | |
315 | - }) | |
316 | - // this.cartList.splice(index,1) | |
317 | - }, | |
318 | - }, | |
319 | -} | |
320 | -</script> | |
321 | - | |
322 | -<style lang="scss"> | |
323 | -.content { | |
324 | - min-height: 100vh; | |
325 | - background-color: #f2f2f2; | |
326 | - display: flex; | |
327 | - flex-direction: column; | |
328 | - align-items: center; | |
329 | - justify-content: space-between; | |
330 | - padding: 20rpx 40rpx; | |
331 | - box-sizing: border-box; | |
332 | - | |
333 | - .partentCheck { | |
334 | - width: 16px; | |
335 | - height: 16px; | |
336 | - border-radius: 22px; | |
337 | - border: 1px solid #cfcfcf; | |
338 | - background-color: #ffffff; | |
339 | - margin: 24rpx 12rpx 24rpx 24rpx; | |
340 | - } | |
341 | - .partentChecked { | |
342 | - width: 18px; | |
343 | - height: 18px; | |
344 | - border-radius: 22px; | |
345 | - background-color: #ff6b4a; | |
346 | - margin: 24rpx 12rpx 24rpx 24rpx; | |
347 | - .correct { | |
348 | - display: inline-block; | |
349 | - position: relative; | |
350 | - width: 10rpx; | |
351 | - height: 2rpx; | |
352 | - background: #ffffff; | |
353 | - line-height: 0; | |
354 | - font-size: 0; | |
355 | - position: relative; | |
356 | - top: -7px; | |
357 | - left: 4px; | |
358 | - -webkit-transform: rotate(45deg); | |
359 | - } | |
360 | - .correct:after { | |
361 | - content: "/"; | |
362 | - display: block; | |
363 | - width: 16rpx; | |
364 | - height: 2rpx; | |
365 | - background: #ffffff; | |
366 | - -webkit-transform: rotate(-90deg) translateY(50%) translateX(50%); | |
367 | - } | |
368 | - } | |
369 | - | |
370 | - .card { | |
371 | - background-color: #ffffff; | |
372 | - border-radius: 16rpx; | |
373 | - box-sizing: border-box; | |
374 | - padding: 36rpx 36rpx 36rpx 18rpx; | |
375 | - display: flex; | |
376 | - flex-direction: column; | |
377 | - align-items: center; | |
378 | - justify-content: space-between; | |
379 | - margin-bottom: 180rpx; | |
380 | - .cardHeader { | |
381 | - width: 100%; | |
382 | - height: 36rpx; | |
383 | - display: flex; | |
384 | - align-items: center; | |
385 | - justify-content: flex-start; | |
386 | - margin-bottom: 20rpx; | |
387 | - image { | |
388 | - height: 32rpx; | |
389 | - width: 32rpx; | |
390 | - padding-left: 6px; | |
391 | - padding-right: 10px; | |
392 | - } | |
393 | - text { | |
394 | - // font-family: PingFangSC-Regular; | |
395 | - font-size: 14px; | |
396 | - color: #333333; | |
397 | - letter-spacing: -0.26px; | |
398 | - } | |
399 | - } | |
400 | - .cardBody { | |
401 | - width: 100%; | |
402 | - min-height: 300rpx; | |
403 | - display: flex; | |
404 | - align-items: center; | |
405 | - justify-content: space-between; | |
406 | - .goodInfo { | |
407 | - width: 390rpx; | |
408 | - display: flex; | |
409 | - flex-direction: row; | |
410 | - justify-content: flex-start; | |
411 | - padding-left: 6px; | |
412 | - | |
413 | - .imageWrap { | |
414 | - height: 188rpx; | |
415 | - width: 188rpx; | |
416 | - margin-right: 28rpx; | |
417 | - | |
418 | - image { | |
419 | - border-radius: 4px; | |
420 | - height: 188rpx; | |
421 | - width: 188rpx; | |
422 | - } | |
423 | - } | |
424 | - .infoRight { | |
425 | - display: flex; | |
426 | - flex-direction: column; | |
427 | - align-items: flex-start; | |
428 | - justify-content: space-between; | |
429 | - min-height: 240rpx; | |
430 | - width: 100%; | |
431 | - .goodName { | |
432 | - display: -webkit-box; | |
433 | - -webkit-box-orient: vertical; | |
434 | - -webkit-line-clamp: 2; | |
435 | - text-align: justify; | |
436 | - overflow: hidden; | |
437 | - font-size: 28rpx; | |
438 | - color: #333333; | |
439 | - } | |
440 | - .describ { | |
441 | - width: 100%; | |
442 | - min-height: 80rpx; | |
443 | - background: #f9f9f9; | |
444 | - border-radius: 2px; | |
445 | - box-sizing: border-box; | |
446 | - padding: 10rpx; | |
447 | - font-size: 20rpx; | |
448 | - letter-spacing: -0.23px; | |
449 | - color: #999999; | |
450 | - display: flex; | |
451 | - justify-content: space-between; | |
452 | - align-items: center; | |
453 | - .desL { | |
454 | - view { | |
455 | - margin: 10rpx 0 10rpx 0; | |
456 | - } | |
457 | - } | |
458 | - } | |
459 | - .priceBox { | |
460 | - display: flex; | |
461 | - justify-content: space-between; | |
462 | - align-items: center; | |
463 | - // margin-top: 26px; | |
464 | - width: 100%; | |
465 | - font-size: 14px; | |
466 | - color: #999999; | |
467 | - .maxCount { | |
468 | - color: #999999; | |
469 | - font-size: 20rpx; | |
470 | - } | |
471 | - .price { | |
472 | - color: #ff6b4a; | |
473 | - font-size: 28rpx; | |
474 | - } | |
475 | - .counter { | |
476 | - display: flex; | |
477 | - flex-direction: row; | |
478 | - justify-content: space-between; | |
479 | - align-items: center; | |
480 | - font-size: 28rpx; | |
481 | - color: #333333; | |
482 | - width: 122rpx; | |
483 | - .btn { | |
484 | - display: flex; | |
485 | - justify-content: center; | |
486 | - line-height: 32rpx; | |
487 | - height: 32rpx; | |
488 | - width: 32rpx; | |
489 | - background-color: #f2f2f2; | |
490 | - color: #cfcfcf; | |
491 | - } | |
492 | - } | |
493 | - } | |
494 | - } | |
495 | - } | |
496 | - } | |
497 | - } | |
498 | - .footer { | |
499 | - position: fixed; | |
500 | - left: 0; | |
501 | - bottom: 0px; | |
502 | - height: 112rpx; | |
503 | - width: 100%; | |
504 | - background-color: #ffffff; | |
505 | - font-size: 16px; | |
506 | - display: flex; | |
507 | - justify-content: space-between; | |
508 | - align-items: center; | |
509 | - .footerLeft { | |
510 | - display: flex; | |
511 | - justify-content: center; | |
512 | - align-items: center; | |
513 | - width: 50%; | |
514 | - color: #333333; | |
515 | - text { | |
516 | - color: #ff6b4a; | |
517 | - } | |
518 | - } | |
519 | - .footerRight { | |
520 | - display: flex; | |
521 | - justify-content: flex-end; | |
522 | - align-items: center; | |
523 | - width: 50%; | |
524 | - margin-right: 26rpx; | |
525 | - .paybtn { | |
526 | - display: flex; | |
527 | - justify-content: center; | |
528 | - align-items: center; | |
529 | - background: #ff6b4a; | |
530 | - border-radius: 20px; | |
531 | - border-radius: 20px; | |
532 | - color: #ffffff; | |
533 | - width: 204rpx; | |
534 | - height: 80rpx; | |
535 | - } | |
536 | - } | |
537 | - } | |
538 | -} | |
539 | -/* 隐藏滚动条 */ | |
540 | -::-webkit-scrollbar { | |
541 | - width: 0; | |
542 | - height: 0; | |
543 | - color: transparent; | |
544 | -} | |
1 | +<template> | |
2 | + <view class="content"> | |
3 | + <block v-if="cartList.length==0"> | |
4 | + | |
5 | + </block> | |
6 | + <block v-else> | |
7 | + <view class="card"> | |
8 | + <view class="cardHeader"> | |
9 | + <view v-bind:class="pIsoPen? 'partentChecked' : 'partentCheck'" @click="pClick"> | |
10 | + <span class="correct"></span> | |
11 | + </view> | |
12 | + <image src="../../static/store.png" mode="aspectFill"></image> | |
13 | + <text>非常戴镜</text> | |
14 | + </view> | |
15 | + <view class="cardBody" v-for="(item,index) in cartList" :key="index" | |
16 | + @longpress="delCart(item.cart_id,index)"> | |
17 | + <view v-bind:class="cartList[index].isChecked? 'partentChecked':'partentCheck'" | |
18 | + @click="childClick(cartList[index],index)"> | |
19 | + <span class="correct"></span> | |
20 | + </view> | |
21 | + <view class="imageWrap"> | |
22 | + <image :src="item.img" mode="aspectFit" style="width: 188rpx;height: 168rpx;"></image> | |
23 | + </view> | |
24 | + <view class="goodInfo"> | |
25 | + <!-- <view class="imageWrap"> | |
26 | + <image :src="item.img_index_url" mode="aspectFit" style="width: 188rpx;height: 168rpx;"></image> | |
27 | + </view> --> | |
28 | + <view class="infoRight"> | |
29 | + <view class="goodName" @tap="toGoods(item.shop_wood_id, item.wsp_id)">{{item.wsp_sku_name}}</view> | |
30 | + <view class="describ" | |
31 | + @click="showBottom(3, item.shop_wood_id, item.wsp_id, item.mp_id, item.cart_id, index)"> | |
32 | + <view class="desL"> | |
33 | + <view class="people"> | |
34 | + 使用人:{{item.peopleName}} | |
35 | + </view> | |
36 | + <view class="skuInfo"> | |
37 | + {{item.wsp_sku_name}} | |
38 | + </view> | |
39 | + </view> | |
40 | + <view class="desR"> | |
41 | + <image src="../../static/right.png" mode="aspectFit" | |
42 | + style="width: 18rpx;height: 18rpx;"></image> | |
43 | + </view> | |
44 | + </view> | |
45 | + <view class="priceBox"> | |
46 | + <view class="price">¥{{item.price*item.num}}</view> | |
47 | + <text class="maxCount">(限购{{maxCount}}副)</text> | |
48 | + <view class="counter"> | |
49 | + <view class="btn" disabled="this.addDisabled" type="default" | |
50 | + @tap="counter(index,false,item)">-</view> | |
51 | + <text>{{item.num}}</text> | |
52 | + <view class="btn" disabled="this.desDisabled" type="default" | |
53 | + @tap="counter(index,true,item)">+</view> | |
54 | + </view> | |
55 | + </view> | |
56 | + </view> | |
57 | + </view> | |
58 | + </view> | |
59 | + </view> | |
60 | + </block> | |
61 | + <view class="footer"> | |
62 | + <view class="footerLeft">实付金额:<text>¥{{totalPrice}}</text></view> | |
63 | + <view class="footerRight"> | |
64 | + <view class="paybtn" @click="toComfirmOrder">立即结算</view> | |
65 | + </view> | |
66 | + </view> | |
67 | + <BottomSheet v-if="isShowBottom" :isCart="isCart" @addCart="addCart" :wsp_id="wsp_id" :propMpId="mp_id" | |
68 | + @chooseCartModi="chooseCartModi" :cart_id="cart_id" :index="cartIndex" :pid="pid" :goodInfo="goodInfo" | |
69 | + :isShowBottom="isShowBottom" @closeBottom="closeBottom"></BottomSheet> | |
70 | + </view> | |
71 | +</template> | |
72 | + | |
73 | +<script> | |
74 | + import store from '@/store' | |
75 | + import BottomSheet from '../../components/BottomSheet/BottomSheet.vue' | |
76 | + export default { | |
77 | + components: { | |
78 | + BottomSheet, | |
79 | + }, | |
80 | + data() { | |
81 | + return { | |
82 | + pid: Number, | |
83 | + isCart: Number, | |
84 | + wsp_id: String, | |
85 | + mp_id: String, | |
86 | + isShowBottom: false, // 底部弹窗开关 | |
87 | + cart_id: Number, | |
88 | + maxCount: 20, | |
89 | + cartIndex: Number, | |
90 | + cartList: [], | |
91 | + } | |
92 | + }, | |
93 | + computed: { | |
94 | + pIsoPen() { | |
95 | + if (this.cartList.length > 0) { | |
96 | + const temp = !this.cartList.find(item => !item.isChecked) | |
97 | + // console.log('temptemp', temp) | |
98 | + return temp | |
99 | + } | |
100 | + return false | |
101 | + }, | |
102 | + goodInfo() { | |
103 | + return this.$store.state.read.goodInfo | |
104 | + }, | |
105 | + totalPrice() { | |
106 | + let totalPrice = 0 | |
107 | + this.cartList.forEach((item) => { | |
108 | + if (item.isChecked) { | |
109 | + totalPrice += item.price * item.num | |
110 | + } | |
111 | + }) | |
112 | + return totalPrice | |
113 | + }, | |
114 | + }, | |
115 | + onShow: async function() { | |
116 | + await this.$store.dispatch('cart/getCartList', { | |
117 | + uid: this.$store.state.user.userInfo.uid, // 用户id | |
118 | + }) | |
119 | + | |
120 | + this.cartList = this.$store.state.cart.cartList | |
121 | + this.cartList.forEach((item) => { | |
122 | + item.isChecked = false | |
123 | + }) | |
124 | + }, | |
125 | + // onLoad: async function() { | |
126 | + // }, | |
127 | + methods: { | |
128 | + // 全选按钮 | |
129 | + pClick() { | |
130 | + const pStatus = !this.cartList.find(item => !item.isChecked) | |
131 | + const oldList = this.cartList | |
132 | + oldList.forEach((item, index) => { | |
133 | + item.isChecked = !pStatus | |
134 | + this.cartList.splice(index, 1, item) | |
135 | + }) | |
136 | + }, | |
137 | + // 单选按钮 | |
138 | + childClick(type, index) { | |
139 | + this.cartList[index].isChecked = !this.cartList[index].isChecked | |
140 | + // vue没有办法监听数组内部值的变化,所以需要通过这个方法去触发 | |
141 | + this.cartList.splice(index, 1, this.cartList[index]) | |
142 | + }, | |
143 | + // 修改购物车 | |
144 | + chooseCartModi(mp_id, wsp_id, price, pid, num, cart_id, index) { | |
145 | + // console.log('modi',mp_id,wsp_id,price,pid,num,cart_id) | |
146 | + store.dispatch('cart/modiCart', { | |
147 | + uid: this.$store.state.user.userInfo.uid, | |
148 | + openid: this.$store.state.user.userInfo.openid, | |
149 | + mp_id: mp_id, | |
150 | + wsp_id: wsp_id, | |
151 | + price: price, | |
152 | + pid: pid, | |
153 | + num: num, | |
154 | + cart_id: cart_id, | |
155 | + args: { | |
156 | + index: index, | |
157 | + }, | |
158 | + }) | |
159 | + this.$nextTick(function() { | |
160 | + store.dispatch('cart/getCartList', { | |
161 | + uid: this.$store.state.user.userInfo.uid, // 用户id | |
162 | + }).then(() => { | |
163 | + this.cartList = this.$store.state.cart.cartList | |
164 | + }) | |
165 | + }) | |
166 | + }, | |
167 | + // 底部弹窗开关 | |
168 | + showBottom(isCart, pid, skId, mp_id, cart_id, index) { | |
169 | + store.dispatch('read/fetch', { | |
170 | + // shop_wood_id:pid, | |
171 | + shop_wood_id:681, | |
172 | + wsp_id: skId, | |
173 | + }).then(() => { | |
174 | + this.cartIndex = index | |
175 | + this.wsp_id = skId | |
176 | + this.shop_wood_id = pid | |
177 | + this.mp_id = mp_id | |
178 | + this.isCart = isCart | |
179 | + this.cart_id = cart_id | |
180 | + this.isShowBottom = true | |
181 | + }) | |
182 | + }, | |
183 | + closeBottom() { | |
184 | + this.isShowBottom = false | |
185 | + }, | |
186 | + toGoods(id, skId) { | |
187 | + uni.navigateTo({ | |
188 | + url: '../details/details?pid=' + id + '&wsp_id=' + skId, | |
189 | + success: res => {}, | |
190 | + fail: () => {}, | |
191 | + complete: () => {}, | |
192 | + }) | |
193 | + }, | |
194 | + | |
195 | + toComfirmOrder() { | |
196 | + this.$store.state.cart.checkedCartLst = this.cartList.filter(item => item.isChecked) | |
197 | + if (this.$store.state.cart.checkedCartLst.length > 0) { | |
198 | + uni.navigateTo({ | |
199 | + url: '../confirmOrder/confirmOrder?isCart=true', | |
200 | + }) | |
201 | + } else { | |
202 | + uni.showToast({ | |
203 | + title: '您还没有选择宝贝哦~', | |
204 | + icon: 'none', | |
205 | + }) | |
206 | + } | |
207 | + }, | |
208 | + counter(index, isadd, item) { | |
209 | + // console.log('item=====>', item) | |
210 | + // console.log('num=====>', item.num) | |
211 | + const nums = parseInt(item.num) | |
212 | + if (isadd) { | |
213 | + if (nums >= this.maxCount) { | |
214 | + this.addDisabled = true | |
215 | + } else { | |
216 | + this.addDisabled = true | |
217 | + store.dispatch('cart/modiCart', { | |
218 | + uid: this.$store.state.user.userInfo.uid, | |
219 | + openid: this.$store.state.user.userInfo.openid, | |
220 | + mp_id: item.mp_id, | |
221 | + wsp_id: item.wsp_id, | |
222 | + price: item.price, | |
223 | + pid: item.shop_wood_id, | |
224 | + num: nums + 1, | |
225 | + cart_id: item.cart_id, | |
226 | + args: { | |
227 | + index: index, | |
228 | + isadd: isadd, | |
229 | + }, | |
230 | + }) | |
231 | + this.addDisabled = false | |
232 | + } | |
233 | + } else { | |
234 | + if (nums <= 1) { | |
235 | + this.desDisabled = true | |
236 | + } else { | |
237 | + this.desDisabled = false | |
238 | + | |
239 | + store.dispatch('cart/modiCart', { | |
240 | + uid: this.$store.state.user.userInfo.uid, | |
241 | + openid: this.$store.state.user.userInfo.openid, | |
242 | + mp_id: item.mp_id, | |
243 | + wsp_id: item.wsp_id, | |
244 | + price: item.price, | |
245 | + pid: item.shop_wood_id, | |
246 | + num: nums - 1, | |
247 | + cart_id: item.cart_id, | |
248 | + args: { | |
249 | + index: index, | |
250 | + isadd: isadd, | |
251 | + }, | |
252 | + }) | |
253 | + this.desDisabled = true | |
254 | + } | |
255 | + } | |
256 | + }, | |
257 | + delCart(cart_id, index) { | |
258 | + cart_id = parseInt(cart_id) | |
259 | + uni.showModal({ | |
260 | + title: '是否删除该商品', | |
261 | + success: function(res) { | |
262 | + if (res.confirm) { | |
263 | + store.dispatch('cart/delCart', { | |
264 | + uid: this.$store.state.user.userInfo.uid, | |
265 | + openid: this.$store.state.user.userInfo.openid, | |
266 | + cart_id: cart_id, // 要修改的购物车id | |
267 | + arg: index, // 由于action 传参是能接收两参数,因此将index放入对象 | |
268 | + }) | |
269 | + } | |
270 | + }.bind(this), | |
271 | + }) | |
272 | + // this.cartList.splice(index,1) | |
273 | + }, | |
274 | + }, | |
275 | + } | |
276 | +</script> | |
277 | + | |
278 | +<style lang="scss"> | |
279 | + .content { | |
280 | + min-height: 100vh; | |
281 | + background-color: #f2f2f2; | |
282 | + display: flex; | |
283 | + flex-direction: column; | |
284 | + align-items: center; | |
285 | + justify-content: space-between; | |
286 | + padding: 20rpx 40rpx; | |
287 | + box-sizing: border-box; | |
288 | + | |
289 | + .partentCheck { | |
290 | + width: 16px; | |
291 | + height: 16px; | |
292 | + border-radius: 22px; | |
293 | + border: 1px solid #cfcfcf; | |
294 | + background-color: #ffffff; | |
295 | + margin: 24rpx 12rpx 24rpx 24rpx; | |
296 | + } | |
297 | + | |
298 | + .partentChecked { | |
299 | + width: 18px; | |
300 | + height: 18px; | |
301 | + border-radius: 22px; | |
302 | + background-color: #ff6b4a; | |
303 | + margin: 24rpx 12rpx 24rpx 24rpx; | |
304 | + | |
305 | + .correct { | |
306 | + display: inline-block; | |
307 | + position: relative; | |
308 | + width: 10rpx; | |
309 | + height: 2rpx; | |
310 | + background: #ffffff; | |
311 | + line-height: 0; | |
312 | + font-size: 0; | |
313 | + position: relative; | |
314 | + top: -7px; | |
315 | + left: 4px; | |
316 | + -webkit-transform: rotate(45deg); | |
317 | + } | |
318 | + | |
319 | + .correct:after { | |
320 | + content: "/"; | |
321 | + display: block; | |
322 | + width: 16rpx; | |
323 | + height: 2rpx; | |
324 | + background: #ffffff; | |
325 | + -webkit-transform: rotate(-90deg) translateY(50%) translateX(50%); | |
326 | + } | |
327 | + } | |
328 | + | |
329 | + .card { | |
330 | + background-color: #ffffff; | |
331 | + border-radius: 16rpx; | |
332 | + // border:1px #000 solid; | |
333 | + box-sizing: border-box; | |
334 | + padding: 36rpx 36rpx 36rpx 18rpx; | |
335 | + display: flex; | |
336 | + flex-direction: column; | |
337 | + align-items: center; | |
338 | + justify-content: space-between; | |
339 | + margin-bottom: 180rpx; | |
340 | + | |
341 | + .cardHeader { | |
342 | + width: 100%; | |
343 | + height: 36rpx; | |
344 | + display: flex; | |
345 | + align-items: center; | |
346 | + justify-content: flex-start; | |
347 | + margin-bottom: 20rpx; | |
348 | + | |
349 | + image { | |
350 | + height: 32rpx; | |
351 | + width: 32rpx; | |
352 | + padding-left: 6px; | |
353 | + padding-right: 10px; | |
354 | + } | |
355 | + | |
356 | + text { | |
357 | + // font-family: PingFangSC-Regular; | |
358 | + font-size: 14px; | |
359 | + color: #333333; | |
360 | + letter-spacing: -0.26px; | |
361 | + } | |
362 | + } | |
363 | + | |
364 | + .cardBody { | |
365 | + width: 100%; | |
366 | + // border:1px #000 solid; | |
367 | + min-height: 300rpx; | |
368 | + display: flex; | |
369 | + align-items: center; | |
370 | + justify-content: space-between; | |
371 | + | |
372 | + .goodInfo { | |
373 | + width: 390rpx; | |
374 | + display: flex; | |
375 | + flex-direction: row; | |
376 | + justify-content: flex-start; | |
377 | + padding-left: 6px; | |
378 | + | |
379 | + .imageWrap { | |
380 | + height: 188rpx; | |
381 | + width: 188rpx; | |
382 | + margin-right: 28rpx; | |
383 | + | |
384 | + image { | |
385 | + border-radius: 4px; | |
386 | + height: 188rpx; | |
387 | + width: 188rpx; | |
388 | + } | |
389 | + } | |
390 | + | |
391 | + .infoRight { | |
392 | + display: flex; | |
393 | + flex-direction: column; | |
394 | + align-items: flex-start; | |
395 | + justify-content: space-between; | |
396 | + min-height: 240rpx; | |
397 | + width: 100%; | |
398 | + | |
399 | + .goodName { | |
400 | + display: -webkit-box; | |
401 | + -webkit-box-orient: vertical; | |
402 | + -webkit-line-clamp: 2; | |
403 | + text-align: justify; | |
404 | + overflow: hidden; | |
405 | + font-size: 28rpx; | |
406 | + color: #333333; | |
407 | + } | |
408 | + | |
409 | + .describ { | |
410 | + width: 100%; | |
411 | + min-height: 80rpx; | |
412 | + background: #f9f9f9; | |
413 | + border-radius: 2px; | |
414 | + box-sizing: border-box; | |
415 | + padding: 10rpx; | |
416 | + font-size: 20rpx; | |
417 | + letter-spacing: -0.23px; | |
418 | + color: #999999; | |
419 | + display: flex; | |
420 | + justify-content: space-between; | |
421 | + align-items: center; | |
422 | + | |
423 | + .desL { | |
424 | + view { | |
425 | + margin: 10rpx 0 10rpx 0; | |
426 | + } | |
427 | + } | |
428 | + } | |
429 | + | |
430 | + .priceBox { | |
431 | + display: flex; | |
432 | + justify-content: space-between; | |
433 | + align-items: center; | |
434 | + // margin-top: 26px; | |
435 | + width: 100%; | |
436 | + font-size: 14px; | |
437 | + color: #999999; | |
438 | + | |
439 | + .maxCount { | |
440 | + color: #999999; | |
441 | + font-size: 20rpx; | |
442 | + } | |
443 | + | |
444 | + .price { | |
445 | + color: #ff6b4a; | |
446 | + font-size: 28rpx; | |
447 | + } | |
448 | + | |
449 | + .counter { | |
450 | + display: flex; | |
451 | + flex-direction: row; | |
452 | + justify-content: space-between; | |
453 | + align-items: center; | |
454 | + font-size: 28rpx; | |
455 | + color: #333333; | |
456 | + width: 122rpx; | |
457 | + | |
458 | + .btn { | |
459 | + display: flex; | |
460 | + justify-content: center; | |
461 | + line-height: 32rpx; | |
462 | + height: 32rpx; | |
463 | + width: 32rpx; | |
464 | + background-color: #f2f2f2; | |
465 | + color: #cfcfcf; | |
466 | + } | |
467 | + } | |
468 | + } | |
469 | + } | |
470 | + } | |
471 | + } | |
472 | + } | |
473 | + | |
474 | + .footer { | |
475 | + position: fixed; | |
476 | + left: 0; | |
477 | + bottom: 90rpx; | |
478 | + height: 112rpx; | |
479 | + width: 100%; | |
480 | + // border:1px #000 solid; | |
481 | + background-color: #FFF; | |
482 | + font-size: 16px; | |
483 | + display: flex; | |
484 | + justify-content: space-between; | |
485 | + align-items: center; | |
486 | + | |
487 | + .footerLeft { | |
488 | + display: flex; | |
489 | + justify-content: center; | |
490 | + align-items: center; | |
491 | + width: 50%; | |
492 | + color: #333333; | |
493 | + | |
494 | + text { | |
495 | + color: #ff6b4a; | |
496 | + } | |
497 | + } | |
498 | + | |
499 | + .footerRight { | |
500 | + display: flex; | |
501 | + justify-content: flex-end; | |
502 | + align-items: center; | |
503 | + width: 50%; | |
504 | + margin-right: 26rpx; | |
505 | + | |
506 | + .paybtn { | |
507 | + display: flex; | |
508 | + justify-content: center; | |
509 | + align-items: center; | |
510 | + background: #ff6b4a; | |
511 | + border-radius: 20px; | |
512 | + border-radius: 20px; | |
513 | + color: #ffffff; | |
514 | + width: 204rpx; | |
515 | + height: 80rpx; | |
516 | + } | |
517 | + } | |
518 | + } | |
519 | + } | |
520 | + | |
521 | + /* 隐藏滚动条 */ | |
522 | + ::-webkit-scrollbar { | |
523 | + width: 0; | |
524 | + height: 0; | |
525 | + color: transparent; | |
526 | + } | |
545 | 527 | </style> | ... | ... |
src/pages/confirmOrder/confirmOrder.vue
1 | 1 | <template> |
2 | - <view class="wrap"> | |
3 | - <view></view> | |
4 | - <view | |
5 | - class="addAddress" | |
6 | - @tap="toaddAddress" | |
7 | - v-if="this.showAddress" | |
8 | - > | |
9 | - <view class="addIcon"> | |
10 | - <image | |
11 | - src="../../static/add.png" | |
12 | - mode="aspectFill" | |
13 | - ></image> | |
14 | - </view> | |
15 | - <view class="addressText">{{addAddress}}</view> | |
16 | - <image | |
17 | - src="../../static/right.png" | |
18 | - mode="aspectFill" | |
19 | - ></image> | |
20 | - </view> | |
21 | - <view | |
22 | - v-else | |
23 | - @tap="toaddAddress" | |
24 | - class="list order-user" | |
25 | - > | |
26 | - <view class="order-user-head"> | |
27 | - <view class="name"> | |
28 | - <view | |
29 | - v-if="addressInfo.default === '1'" | |
30 | - class="default" | |
31 | - ><text>默认</text></view>{{addressInfo.name}} | |
32 | - </view> | |
33 | - <text class="mobile">{{addressInfo.mobile}}</text> | |
34 | - </view> | |
35 | - <view class="order-user-body"> | |
36 | - <image src="../../static/myorder-paying-location.png"></image> | |
37 | - <text class="address">{{addressInfo.address}}\n{{addressInfo.add_detail}}</text> | |
38 | - </view> | |
39 | - <image | |
40 | - class="arrow" | |
41 | - src="../../static/right.png" | |
42 | - mode="aspectFill" | |
43 | - ></image> | |
44 | - </view> | |
45 | - <view class="content"> | |
46 | - <view class="orderInfo"> | |
47 | - <view class="title"> | |
48 | - <image | |
49 | - src="../../static/store.png" | |
50 | - mode="aspectFill" | |
51 | - style="width: 40rpx;height: 40rpx;" | |
52 | - ></image> | |
53 | - <text>非常戴镜</text> | |
54 | - </view> | |
55 | - | |
56 | - <view | |
57 | - class="infoBox" | |
58 | - v-if="isCart == 'true'" | |
59 | - v-for="(item, index) in checkedCartLst" | |
60 | - :key="index" | |
61 | - > | |
62 | - <view class="infoTop"> | |
63 | - <image | |
64 | - :src="item.img_index_url" | |
65 | - mode="aspectFill" | |
66 | - ></image> | |
67 | - <view class="infoRight"> | |
68 | - <text class="goodName">{{item.p_name}}</text> | |
69 | - <text class="remarks">支持7天无理由退货 顺丰发货</text> | |
70 | - <view class="priceBox"> | |
71 | - <view class="price">¥{{Number(item.nowPrice) * item.num}}<text class="originCost"> | |
72 | - ¥{{item.oldPrice*item.num}} | |
73 | - </text></view> | |
74 | - <view class="counter"> | |
75 | - <view | |
76 | - class="btn" | |
77 | - disabled="this.disabled" | |
78 | - type="default" | |
79 | - @click="counter(false,index)" | |
80 | - >-</view> | |
81 | - <text>{{checkedCartLst[index].num}}</text> | |
82 | - <view | |
83 | - class="btn" | |
84 | - type="default" | |
85 | - @click="counter(true,index)" | |
86 | - >+</view> | |
87 | - </view> | |
88 | - </view> | |
89 | - </view> | |
90 | - </view> | |
91 | - <view class="infoBottom"> | |
92 | - <view class="norm">规格 <text> | |
93 | - <!-- 长度超出变省略号未做 --> | |
94 | - <block>{{item.sku_name}}<block v-if="index !== current.length -1">/</block> | |
95 | - </block> | |
96 | - </text></view> | |
97 | - <view class="shippingMethod">使用人 <text> | |
98 | - {{item.peopleName}} | |
99 | - </text></view> | |
100 | - <view class="shippingMethod">配送方式 <text>快递</text></view> | |
101 | - <view class="message">买家留言 | |
102 | - <input | |
103 | - type="text" | |
104 | - :value="note" | |
105 | - placeholder="建议提前协商(50字以内)" | |
106 | - /> | |
107 | - </view> | |
108 | - </view> | |
109 | - </view> | |
2 | + <view class="wrap"> | |
3 | + <view></view> | |
4 | + <view class="addAddress" @tap="toaddAddress" v-if="this.showAddress"> | |
5 | + <view class="addIcon"> | |
6 | + <image src="../../static/add.png" mode="aspectFill"></image> | |
7 | + </view> | |
8 | + <view class="addressText">{{addAddress}}</view> | |
9 | + <image src="../../static/right.png" mode="aspectFill"></image> | |
10 | + </view> | |
11 | + <view v-else @tap="toaddAddress" class="list order-user"> | |
12 | + <view class="order-user-head"> | |
13 | + <view class="name"> | |
14 | + <view v-if="addressInfo.is_default ===1" class="default"><text>默认</text></view>{{addressInfo.name}} | |
15 | + </view> | |
16 | + <text class="mobile">{{addressInfo.mobile}}</text> | |
17 | + </view> | |
18 | + <view class="order-user-body"> | |
19 | + <image src="../../static/myorder-paying-location.png"></image> | |
20 | + <text class="address">{{addressInfo.address}}\n{{addressInfo.add_detail}}</text> | |
21 | + </view> | |
22 | + <image class="arrow" src="../../static/right.png" mode="aspectFill"></image> | |
23 | + </view> | |
24 | + <view class="content"> | |
25 | + <view class="orderInfo"> | |
26 | + <view class="title"> | |
27 | + <image src="../../static/store.png" mode="aspectFill" style="width: 40rpx;height: 40rpx;"></image> | |
28 | + <text>非常戴镜</text> | |
29 | + </view> | |
110 | 30 | |
111 | - <view | |
112 | - class="infoBox" | |
113 | - v-if="isCart !== 'true'" | |
114 | - > | |
115 | - <view class="infoTop"> | |
116 | - <image | |
117 | - :src="buyItem.pic" | |
118 | - mode="aspectFill" | |
119 | - ></image> | |
120 | - <view class="infoRight"> | |
121 | - <text class="goodName">{{goodInfo.p_name}}</text> | |
122 | - <text class="remarks">支持7天无理由退货 顺丰发货</text> | |
123 | - <view class="priceBox"> | |
124 | - <view class="price">¥{{buyItem.real_price * count}}<text class="originCost"> | |
125 | - ¥{{buyItem.out_price * count}} | |
126 | - </text></view> | |
127 | - <view class="counter"> | |
128 | - <view | |
129 | - class="btn" | |
130 | - disabled="this.disabled" | |
131 | - type="default" | |
132 | - @click="counter(false)" | |
133 | - >-</view> | |
134 | - <text>{{count}}</text> | |
135 | - <view | |
136 | - class="btn" | |
137 | - type="default" | |
138 | - @click="counter(true)" | |
139 | - >+</view> | |
140 | - </view> | |
141 | - </view> | |
142 | - </view> | |
143 | - </view> | |
144 | - <view class="infoBottom"> | |
145 | - <view class="norm">规格 <text> | |
146 | - <!-- 长度超出变省略号未做 --> | |
147 | - <block | |
148 | - v-for="(item, index) in current" | |
149 | - :key="index" | |
150 | - >{{attrList[index].attr[item].name}}<block v-if="index !== current.length -1">/</block> | |
151 | - </block> | |
152 | - </text></view> | |
153 | - <view class="shippingMethod">使用人 <text> | |
154 | - {{name}} | |
155 | - </text></view> | |
156 | - <view class="shippingMethod">配送方式 <text>快递</text></view> | |
157 | - <view class="message">买家留言 | |
158 | - <input | |
159 | - type="text" | |
160 | - :value="note" | |
161 | - placeholder="建议提前协商(50字以内)" | |
162 | - /> | |
163 | - </view> | |
164 | - </view> | |
165 | - </view> | |
166 | - </view> | |
167 | - <view class="payWay"> | |
168 | - <view class="item"> | |
169 | - <text>支付方式</text> | |
170 | - <view class="itemRight"> | |
171 | - <view class="rightText"> | |
172 | - <view class="choosePayWay"> | |
173 | - <image | |
174 | - src="../../static/chat_logo.png" | |
175 | - mode="aspectFill" | |
176 | - ></image> | |
177 | - <text>微信支付</text> | |
178 | - </view> | |
179 | - <!-- <view class="randomSubstraction">最高随机立减¥99</view> --> | |
180 | - </view> | |
181 | - <!-- <image | |
31 | + <view class="infoBox" v-if="isCart == 'true'" v-for="(item, index) in checkedCartLst" :key="index"> | |
32 | + <view class="infoTop"> | |
33 | + <image :src="item.img_index_url" mode="aspectFill"></image> | |
34 | + <view class="infoRight"> | |
35 | + <text class="goodName">{{item.wsp_sku_name}}</text> | |
36 | + <text class="remarks">支持7天无理由退货 顺丰发货</text> | |
37 | + <view class="priceBox"> | |
38 | + <view class="price">¥{{Number(item.price) * item.num}}<text class="originCost"> | |
39 | + ¥{{item.price*item.num}} | |
40 | + </text></view> | |
41 | + <view class="counter"> | |
42 | + <view class="btn" disabled="this.disabled" type="default" | |
43 | + @click="counter(false,index)">-</view> | |
44 | + <text>{{checkedCartLst[index].num}}</text> | |
45 | + <view class="btn" type="default" @click="counter(true,index)">+</view> | |
46 | + </view> | |
47 | + </view> | |
48 | + </view> | |
49 | + </view> | |
50 | + <view class="infoBottom"> | |
51 | + <view class="norm">规格 <text> | |
52 | + <!-- 长度超出变省略号未做 --> | |
53 | + <!-- <block>{{item.wsp_sku_name}} | |
54 | + <block v-if="index !== current.length -1">/</block> | |
55 | + </block> --> | |
56 | + </text></view> | |
57 | + <view class="shippingMethod">使用人 <text> | |
58 | + {{item.peopleName}} | |
59 | + </text></view> | |
60 | + <view class="shippingMethod">配送方式 <text>快递</text></view> | |
61 | + <view class="message">买家留言 | |
62 | + <input type="text" :value="note" placeholder="建议提前协商(50字以内)" /> | |
63 | + </view> | |
64 | + </view> | |
65 | + </view> | |
66 | + | |
67 | + <view class="infoBox" v-if="isCart !== 'true'"> | |
68 | + <view class="infoTop"> | |
69 | + <image :src="buyItem.pic" mode="aspectFill"></image> | |
70 | + <view class="infoRight"> | |
71 | + <text class="goodName">{{goodInfo.p_name}}</text> | |
72 | + <text class="remarks">支持7天无理由退货 顺丰发货</text> | |
73 | + <view class="priceBox"> | |
74 | + <view class="price">¥{{buyItem.real_price * count}}<text class="originCost"> | |
75 | + ¥{{buyItem.out_price * count}} | |
76 | + </text></view> | |
77 | + <view class="counter"> | |
78 | + <view class="btn" disabled="this.disabled" type="default" @click="counter(false)">- | |
79 | + </view> | |
80 | + <text>{{count}}</text> | |
81 | + <view class="btn" type="default" @click="counter(true)">+</view> | |
82 | + </view> | |
83 | + </view> | |
84 | + </view> | |
85 | + </view> | |
86 | + <view class="infoBottom"> | |
87 | + <view class="norm">规格 <text> | |
88 | + <!-- 长度超出变省略号未做 --> | |
89 | + <!-- <block v-for="(item, index) in current" :key="index">{{attrList[index].attr[item].name}} | |
90 | + <block v-if="index !== current.length -1">/</block> | |
91 | + </block> --> | |
92 | + </text></view> | |
93 | + <view class="shippingMethod">使用人 <text> | |
94 | + {{name}} | |
95 | + </text></view> | |
96 | + <view class="shippingMethod">配送方式 <text>快递</text></view> | |
97 | + <view class="message">买家留言 | |
98 | + <input type="text" :value="note" placeholder="建议提前协商(50字以内)" /> | |
99 | + </view> | |
100 | + </view> | |
101 | + </view> | |
102 | + </view> | |
103 | + <view class="payWay"> | |
104 | + <view class="item"> | |
105 | + <text>支付方式</text> | |
106 | + <view class="itemRight"> | |
107 | + <view class="rightText"> | |
108 | + <view class="choosePayWay"> | |
109 | + <image src="../../static/chat_logo.png" mode="aspectFill"></image> | |
110 | + <text>微信支付</text> | |
111 | + </view> | |
112 | + <view class="randomSubstraction">最高随机立减¥99</view> | |
113 | + </view> | |
114 | + <!-- <image | |
182 | 115 | src="../../static/right.png" |
183 | 116 | mode="aspectFill" |
184 | 117 | ></image> --> |
185 | - </view> | |
186 | - </view> | |
187 | - <!-- <view class="item"> | |
118 | + </view> | |
119 | + </view> | |
120 | + <!-- <view class="item"> | |
188 | 121 | <text>优惠券</text> |
189 | 122 | <view class="itemRight"> |
190 | 123 | <view class="rightText"> |
... | ... | @@ -199,21 +132,21 @@ |
199 | 132 | ></image> |
200 | 133 | </view> |
201 | 134 | </view> --> |
202 | - <view class="item"> | |
203 | - <text>运费</text> | |
204 | - <view class="itemRight"> | |
205 | - <view class="freight">免运费</view> | |
206 | - </view> | |
207 | - </view> | |
208 | - <view class="item"> | |
209 | - <text>合计</text> | |
210 | - <view class="itemRight"> | |
211 | - <view class="total">¥{{totalPrice}}</view> | |
212 | - <!-- <view class="total" v-else>¥{{Number(skuInfo.real_price) * count}}</view> --> | |
213 | - </view> | |
214 | - </view> | |
215 | - </view> | |
216 | - <!-- | |
135 | + <view class="item"> | |
136 | + <text>运费</text> | |
137 | + <view class="itemRight"> | |
138 | + <view class="freight">免运费</view> | |
139 | + </view> | |
140 | + </view> | |
141 | + <view class="item"> | |
142 | + <text>合计</text> | |
143 | + <view class="itemRight"> | |
144 | + <view class="total">¥{{totalPrice}}</view> | |
145 | + <!-- <view class="total" v-else>¥{{Number(skuInfo.real_price) * count}}</view> --> | |
146 | + </view> | |
147 | + </view> | |
148 | + </view> | |
149 | + <!-- | |
217 | 150 | <view class="checkBox"> |
218 | 151 | <checkbox-group> |
219 | 152 | <label> |
... | ... | @@ -221,614 +154,697 @@ |
221 | 154 | </label> |
222 | 155 | </checkbox-group> |
223 | 156 | </view> --> |
224 | - </view> | |
225 | - <view class="last_zhanwei"></view> | |
226 | - <view class="footer"> | |
227 | - <view class="footerLeft">实付金额: | |
228 | - <text>¥{{totalPrice}}</text> | |
229 | - <!-- <text v-else>¥{{Number(skuInfo.real_price) * count}}</text> --> | |
230 | - </view> | |
231 | - <view class="footerRight"> | |
232 | - <view | |
233 | - class="paybtn" | |
234 | - @tap="orderBuild" | |
235 | - >立即支付</view> | |
236 | - </view> | |
237 | - </view> | |
238 | - </view> | |
157 | + </view> | |
158 | + <view class="last_zhanwei"></view> | |
159 | + <view class="footer"> | |
160 | + <view class="footerLeft">实付金额: | |
161 | + <text>¥{{totalPrice}}</text> | |
162 | + <!-- <text v-else>¥{{Number(skuInfo.real_price) * count}}</text> --> | |
163 | + </view> | |
164 | + <view class="footerRight"> | |
165 | + <view class="paybtn" @tap="orderBuild">立即支付</view> | |
166 | + </view> | |
167 | + </view> | |
168 | + </view> | |
239 | 169 | </template> |
240 | 170 | |
241 | 171 | <script> |
242 | -import store from '@/store' | |
243 | -import MD5Util from '../../utils/md5' | |
244 | - | |
245 | -export default { | |
246 | - data() { | |
247 | - return { | |
248 | - name: String, | |
249 | - addAddress: '添加收货地址', | |
250 | - count: 1, | |
251 | - pid: 0, | |
252 | - disabled: false, | |
253 | - freight: 0.0, | |
254 | - showAddress: false, | |
255 | - note: '', | |
256 | - addressInfo: { | |
257 | - address: '', | |
258 | - }, | |
259 | - isCart: Boolean, | |
260 | - // isAnonymous: | |
261 | - checkedCartLst: [], | |
262 | - } | |
263 | - }, | |
264 | - onShow(addressId) { | |
265 | - // console.log('+-+-*-*-+-+',addressId) | |
266 | - if (addressId) { | |
267 | - store | |
268 | - .dispatch('address/details', { | |
269 | - add_id: addressId, | |
270 | - }) | |
271 | - .then(({ code, data }) => { | |
272 | - if (code === 1) { | |
273 | - // console.log('code', code, data) | |
274 | - this.showAddress = true | |
275 | - this.addressInfo = data | |
276 | - } | |
277 | - }) | |
278 | - } | |
279 | - }, | |
280 | - onLoad({ pid, addressId, isCart, count, name }) { | |
281 | - if (isCart == 'false') { | |
282 | - this.pid = pid | |
283 | - // store.dispatch('read/fetch', { | |
284 | - // pid, | |
285 | - // }) | |
286 | - } | |
287 | - this.count = count | |
288 | - this.name = name | |
289 | - this.isCart = isCart | |
290 | - | |
291 | - console.log('++++++++++++' + pid, addressId, isCart) | |
292 | - this.checkedCartLst = this.$store.state.cart.checkedCartLst | |
293 | - // console.log('++++++++++6666666666++',this.$store.state.cart.checkedCartLst) | |
294 | - // 若已经选择地址 | |
295 | - if (addressId) { | |
296 | - store | |
297 | - .dispatch('address/details', { | |
298 | - add_id: addressId, | |
299 | - }) | |
300 | - .then(({ code, data }) => { | |
301 | - if (code === 1) { | |
302 | - // console.log('code', code, data) | |
303 | - this.showAddress = true | |
304 | - this.addressInfo = data | |
305 | - } | |
306 | - }) | |
307 | - } else { | |
308 | - store.dispatch('address/default').then(({ code, data }) => { | |
309 | - if (code === 1) { | |
310 | - // console.log('code', code, data) | |
311 | - this.showAddress = true | |
312 | - this.addressInfo = data | |
313 | - } | |
314 | - }) | |
315 | - } | |
316 | - }, | |
317 | - computed: { | |
318 | - totalPrice() { | |
319 | - if (this.isCart == 'true') { | |
320 | - let total = 0 | |
321 | - this.$store.state.cart.checkedCartLst.map(item => { | |
322 | - total += item.nowPrice * item.num | |
323 | - }) | |
324 | - return total | |
325 | - } else { | |
326 | - return this.buyItem.real_price * this.count | |
327 | - } | |
328 | - }, | |
329 | - buyItem() { | |
330 | - return this.$store.state.cart.buyItem | |
331 | - }, | |
332 | - // checkedCartLst(){ | |
333 | - // console.log('checkedCartLst',this.$store.state.cart.checkedCartLst) | |
334 | - // return this.$store.state.cart.checkedCartLst | |
335 | - // }, | |
336 | - goodInfo() { | |
337 | - // console.log('state', this.$store.state.read.goodInfo) | |
338 | - return this.$store.state.read.goodInfo | |
339 | - }, | |
340 | - skuInfo() { | |
341 | - return this.$store.state.order.param.sk_id_arr | |
342 | - }, | |
343 | - attrList() { | |
344 | - return this.$store.state.order.param.attrList | |
345 | - }, | |
346 | - current() { | |
347 | - return this.$store.state.order.param.current | |
348 | - }, | |
349 | - }, | |
350 | - methods: { | |
351 | - counter(isadd, index) { | |
352 | - if (isadd) { | |
353 | - if (this.isCart == 'true') { | |
354 | - this.checkedCartLst[index].num++ | |
355 | - } else { | |
356 | - this.count++ | |
357 | - } | |
358 | - } else { | |
359 | - if (this.isCart == 'true') { | |
360 | - this.checkedCartLst[index].num <= 1 ? (this.disabled = true) : this.checkedCartLst[index].num-- | |
361 | - } else { | |
362 | - this.count <= 1 ? (this.disabled = true) : this.count-- | |
363 | - } | |
364 | - } | |
365 | - }, | |
366 | - // 跳转添加地址页面 | |
367 | - toaddAddress() { | |
368 | - uni.navigateTo({ | |
369 | - url: `../address/addressList?edit=${1}`, | |
370 | - success: res => {}, | |
371 | - fail: error => { | |
372 | - console.log('跳转到地址列表页面失败====>', error) | |
373 | - }, | |
374 | - complete: () => {}, | |
375 | - }) | |
376 | - }, | |
377 | - // 下单 | |
378 | - orderBuild() { | |
379 | - uni.showLoading({ | |
380 | - title: '支付中', | |
381 | - }) | |
382 | - if (this.isCart === 'true') { | |
383 | - const checkedGoods = [] | |
384 | - const sk_id_arr = [] | |
385 | - this.checkedCartLst.map(item => { | |
386 | - checkedGoods.push(item.cart_id) | |
387 | - sk_id_arr.push(item.sk_id) | |
388 | - }) | |
389 | - store.dispatch('order/build', { | |
390 | - uid: this.$store.state.user.userInfo.uid, | |
391 | - address: JSON.stringify(this.addressInfo), | |
392 | - checkedGoods: checkedGoods, | |
393 | - sk_id_arr: sk_id_arr, | |
394 | - totalPrice: this.totalPrice, | |
395 | - }).then((res) => { | |
396 | - this.pay(res) | |
397 | - }) | |
398 | - } | |
399 | - if (this.isCart === 'false') { | |
400 | - const { sk_id_arr: skId, mp_id: mpId } = this.$store.state.order.param | |
401 | - store.dispatch('order/buyNow', { | |
402 | - pid: skId.pid, | |
403 | - sk_id: skId.sk_id, | |
404 | - number: this.count, | |
405 | - mp_id: mpId, | |
406 | - address: JSON.stringify(this.addressInfo), | |
407 | - totalPrice: this.totalPrice, | |
408 | - liuyan: this.note, | |
409 | - dir: 1, | |
410 | - }).then((res) => { | |
411 | - this.pay(res) | |
412 | - }) | |
413 | - } | |
414 | - }, | |
415 | - // 支付 | |
416 | - pay(res) { | |
417 | - console.log('pay', res) | |
418 | - const { data, exKeyName: keyName } = res | |
419 | - const uid = uni.getStorageSync('uid') | |
420 | - const timeStamp = new Date().getTime().toString() | |
421 | - const nonceStr = 'asfafasfasfasfasf' | |
422 | - // 支付参数 | |
423 | - const fieldSet = { | |
424 | - openid: this.$store.state.user.userInfo.openid, | |
425 | - uid: this.$store.state.user.userInfo.uid, | |
426 | - shopid: 0, | |
427 | - payCate: 2020, | |
428 | - payMoney: this.totalPrice, | |
429 | - payWoodId: `fcdj-${uid}-${keyName}`, | |
430 | - payWoodDesc: '在【非常戴镜】的微信付款凭证', | |
431 | - nonceStr, | |
432 | - signType: 'MD5', | |
433 | - app_uid: 2020, | |
434 | - timeStamp, | |
435 | - keyname: keyName, | |
436 | - billInfo: JSON.stringify(data), | |
437 | - } | |
438 | - // 请求后台支付接口 | |
439 | - store.dispatch('order/pay', fieldSet).then(({ data, data2, pay_id: payId }) => { | |
440 | - if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { | |
441 | - const stringA = `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` | |
442 | - const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' | |
443 | - | |
444 | - // 微信支付接口 | |
445 | - uni.requestPayment({ | |
446 | - appId: data.appid, | |
447 | - timeStamp, | |
448 | - nonceStr, | |
449 | - total_fee: this.totalPrice, | |
450 | - package: `prepay_id=${data.prepay_id}`, | |
451 | - signType: 'MD5', | |
452 | - paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), | |
453 | - success: (res) => { | |
454 | - // 支付成功 | |
455 | - uni.showModal({ | |
456 | - content: '支付成功', | |
457 | - showCancel: false, | |
458 | - }) | |
459 | - // 跳转订单详情页->状态 待收货 | |
460 | - uni.reLaunch({ | |
461 | - url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`, | |
462 | - }) | |
463 | - }, | |
464 | - fail: (res) => { | |
465 | - // 支付失败 | |
466 | - uni.showModal({ | |
467 | - content: '支付失败', | |
468 | - showCancel: false, | |
469 | - }) | |
470 | - // 跳转订单详情页->状态 待付款 | |
471 | - uni.reLaunch({ | |
472 | - url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, | |
473 | - }) | |
474 | - }, | |
475 | - complete: () => { | |
476 | - uni.hideLoading() | |
477 | - }, | |
478 | - }) | |
479 | - } else { | |
480 | - uni.showModal({ | |
481 | - content: '支付失败', | |
482 | - showCancel: false, | |
483 | - }) | |
484 | - console.log('支付失败') | |
485 | - uni.hideLoading() | |
486 | - } | |
487 | - }) | |
488 | - }, | |
489 | - }, | |
490 | -} | |
172 | + import store from '@/store' | |
173 | + import MD5Util from '../../utils/md5' | |
174 | + | |
175 | + export default { | |
176 | + data() { | |
177 | + return { | |
178 | + name: String, | |
179 | + addAddress: '添加收货地址', | |
180 | + count: 1, | |
181 | + pid: 0, | |
182 | + disabled: false, | |
183 | + freight: 0.0, | |
184 | + showAddress: false, | |
185 | + note: '', | |
186 | + addressInfo: { | |
187 | + address: '', | |
188 | + }, | |
189 | + isCart: Boolean, | |
190 | + // isAnonymous: | |
191 | + checkedCartLst: [], | |
192 | + } | |
193 | + }, | |
194 | + onShow(addressId) { | |
195 | + console.log('>>>>>>>>>>>>>>>>>addressId>>>>>>>>>>>>>>>', addressId) | |
196 | + if (addressId) { | |
197 | + store | |
198 | + .dispatch('address/details', { | |
199 | + add_id: addressId, | |
200 | + }) | |
201 | + .then(({ | |
202 | + code, | |
203 | + data | |
204 | + }) => { | |
205 | + if (code === 1) { | |
206 | + // console.log('code', code, data) | |
207 | + this.showAddress = true | |
208 | + this.addressInfo = data | |
209 | + } | |
210 | + }) | |
211 | + } | |
212 | + }, | |
213 | + onLoad({ | |
214 | + pid, | |
215 | + addressId, | |
216 | + isCart, | |
217 | + count, | |
218 | + name | |
219 | + }) { | |
220 | + console.log('>>>>>>confrm order ------>pid', pid); | |
221 | + console.log('>>>>>>confrm order ------>addressId', addressId); | |
222 | + console.log('>>>>>>confrm order ------>name', name); | |
223 | + if (isCart == 'false') { | |
224 | + this.pid = pid | |
225 | + // store.dispatch('read/fetch', { | |
226 | + // pid, | |
227 | + // }) | |
228 | + } | |
229 | + this.count = count | |
230 | + this.name = name | |
231 | + this.isCart = isCart | |
232 | + | |
233 | + console.log('++++++++++++' + pid, addressId, isCart) | |
234 | + this.checkedCartLst = this.$store.state.cart.checkedCartLst | |
235 | + console.log('++++++++++6666666666++', this.$store.state.cart.checkedCartLst) | |
236 | + // 若已经选择地址 | |
237 | + if (addressId) { | |
238 | + store | |
239 | + .dispatch('address/details', { | |
240 | + add_id: addressId, | |
241 | + }) | |
242 | + .then(({ | |
243 | + code, | |
244 | + data | |
245 | + }) => { | |
246 | + if (code === 1) { | |
247 | + // console.log('code', code, data) | |
248 | + this.showAddress = true | |
249 | + this.addressInfo = data | |
250 | + } | |
251 | + }) | |
252 | + } else { | |
253 | + store.dispatch('address/default', { | |
254 | + uid: 1, | |
255 | + add_id: "" | |
256 | + }).then(({ | |
257 | + code, | |
258 | + data | |
259 | + }) => { | |
260 | + if (code === 1) { | |
261 | + console.log('address/defaultaddress/defaultaddress/defaultcode', code, data) | |
262 | + this.showAddress = true | |
263 | + this.addressInfo = data | |
264 | + } | |
265 | + }) | |
266 | + } | |
267 | + }, | |
268 | + computed: { | |
269 | + totalPrice() { | |
270 | + if (this.isCart == 'true') { | |
271 | + let total = 0 | |
272 | + this.$store.state.cart.checkedCartLst.map(item => { | |
273 | + total += item.price * item.num | |
274 | + }) | |
275 | + return total | |
276 | + } else { | |
277 | + return this.buyItem.real_price * this.count | |
278 | + } | |
279 | + }, | |
280 | + buyItem() { | |
281 | + return this.$store.state.cart.buyItem | |
282 | + }, | |
283 | + // checkedCartLst(){ | |
284 | + // console.log('checkedCartLst',this.$store.state.cart.checkedCartLst) | |
285 | + // return this.$store.state.cart.checkedCartLst | |
286 | + // }, | |
287 | + goodInfo() { | |
288 | + // console.log('state', this.$store.state.read.goodInfo) | |
289 | + return this.$store.state.read.goodInfo | |
290 | + }, | |
291 | + skuInfo() { | |
292 | + return this.$store.state.order.param.sk_id_arr | |
293 | + }, | |
294 | + attrList() { | |
295 | + return this.$store.state.order.param.attrList | |
296 | + }, | |
297 | + current() { | |
298 | + return this.$store.state.order.param.current | |
299 | + }, | |
300 | + }, | |
301 | + methods: { | |
302 | + counter(isadd, index) { | |
303 | + if (isadd) { | |
304 | + if (this.isCart == 'true') { | |
305 | + this.checkedCartLst[index].num++ | |
306 | + } else { | |
307 | + this.count++ | |
308 | + } | |
309 | + } else { | |
310 | + if (this.isCart == 'true') { | |
311 | + this.checkedCartLst[index].num <= 1 ? (this.disabled = true) : this.checkedCartLst[index].num-- | |
312 | + } else { | |
313 | + this.count <= 1 ? (this.disabled = true) : this.count-- | |
314 | + } | |
315 | + } | |
316 | + }, | |
317 | + // 跳转添加地址页面 | |
318 | + toaddAddress() { | |
319 | + uni.navigateTo({ | |
320 | + url: `../address/addressList?edit=${1}`, | |
321 | + success: res => {}, | |
322 | + fail: error => { | |
323 | + console.log('跳转到地址列表页面失败====>', error) | |
324 | + }, | |
325 | + complete: () => {}, | |
326 | + }) | |
327 | + }, | |
328 | + // 下单 | |
329 | + orderBuild() { | |
330 | + uni.showLoading({ | |
331 | + title: '支付中', | |
332 | + }) | |
333 | + if (this.isCart === 'true') { | |
334 | + const checkedGoods = [] | |
335 | + const sk_id_arr = [] | |
336 | + this.checkedCartLst.map(item => { | |
337 | + checkedGoods.push(item.cart_id) | |
338 | + sk_id_arr.push(item.sk_id) | |
339 | + }) | |
340 | + store.dispatch('order/build', { | |
341 | + uid: this.$store.state.user.userInfo.uid, | |
342 | + address: JSON.stringify(this.addressInfo), | |
343 | + checkedGoods: checkedGoods, | |
344 | + sk_id_arr: sk_id_arr, | |
345 | + totalPrice: this.totalPrice, | |
346 | + }).then((res) => { | |
347 | + this.pay(res) | |
348 | + }) | |
349 | + } | |
350 | + if (this.isCart === 'false') { | |
351 | + const { | |
352 | + sk_id_arr: skId, | |
353 | + mp_id: mpId | |
354 | + } = this.$store.state.order.param | |
355 | + store.dispatch('order/buyNow', { | |
356 | + pid: skId.pid, | |
357 | + sk_id: skId.sk_id, | |
358 | + number: this.count, | |
359 | + mp_id: mpId, | |
360 | + address: JSON.stringify(this.addressInfo), | |
361 | + totalPrice: this.totalPrice, | |
362 | + liuyan: this.note, | |
363 | + dir: 1, | |
364 | + }).then((res) => { | |
365 | + this.pay(res) | |
366 | + }) | |
367 | + } | |
368 | + }, | |
369 | + // 支付 | |
370 | + pay(res) { | |
371 | + console.log('pay', res) | |
372 | + const { | |
373 | + data, | |
374 | + exKeyName: keyName | |
375 | + } = res | |
376 | + const uid = uni.getStorageSync('uid') | |
377 | + const timeStamp = new Date().getTime().toString() | |
378 | + const nonceStr = 'asfafasfasfasfasf' | |
379 | + // 支付参数 | |
380 | + const fieldSet = { | |
381 | + openid: this.$store.state.user.userInfo.openid, | |
382 | + uid: this.$store.state.user.userInfo.uid, | |
383 | + shopid: 0, | |
384 | + payCate: 2020, | |
385 | + payMoney: this.totalPrice, | |
386 | + payWoodId: `fcdj-${uid}-${keyName}`, | |
387 | + payWoodDesc: '在【非常戴镜】的微信付款凭证', | |
388 | + nonceStr, | |
389 | + signType: 'MD5', | |
390 | + app_uid: 2020, | |
391 | + timeStamp, | |
392 | + keyname: keyName, | |
393 | + billInfo: JSON.stringify(data), | |
394 | + } | |
395 | + // 请求后台支付接口 | |
396 | + store.dispatch('order/pay', fieldSet).then(({ | |
397 | + data, | |
398 | + data2, | |
399 | + pay_id: payId | |
400 | + }) => { | |
401 | + if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { | |
402 | + const stringA = | |
403 | + `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` | |
404 | + const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' | |
405 | + | |
406 | + // 微信支付接口 | |
407 | + uni.requestPayment({ | |
408 | + appId: data.appid, | |
409 | + timeStamp, | |
410 | + nonceStr, | |
411 | + total_fee: this.totalPrice, | |
412 | + package: `prepay_id=${data.prepay_id}`, | |
413 | + signType: 'MD5', | |
414 | + paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), | |
415 | + success: (res) => { | |
416 | + // 支付成功 | |
417 | + uni.showModal({ | |
418 | + content: '支付成功', | |
419 | + showCancel: false, | |
420 | + }) | |
421 | + // 跳转订单详情页->状态 待收货 | |
422 | + uni.reLaunch({ | |
423 | + url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`, | |
424 | + }) | |
425 | + }, | |
426 | + fail: (res) => { | |
427 | + // 支付失败 | |
428 | + uni.showModal({ | |
429 | + content: '支付失败', | |
430 | + showCancel: false, | |
431 | + }) | |
432 | + // 跳转订单详情页->状态 待付款 | |
433 | + uni.reLaunch({ | |
434 | + url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, | |
435 | + }) | |
436 | + }, | |
437 | + complete: () => { | |
438 | + uni.hideLoading() | |
439 | + }, | |
440 | + }) | |
441 | + } else { | |
442 | + uni.showModal({ | |
443 | + content: '支付失败', | |
444 | + showCancel: false, | |
445 | + }) | |
446 | + console.log('支付失败') | |
447 | + uni.hideLoading() | |
448 | + } | |
449 | + }) | |
450 | + }, | |
451 | + }, | |
452 | + } | |
491 | 453 | </script> |
492 | 454 | |
493 | 455 | <style lang="scss"> |
494 | -.wrap { | |
495 | - height: 100vh; | |
496 | - background-color: #f2f2f2; | |
497 | - font-family: PingFangSC-Regular; | |
498 | - letter-spacing: -0.23px; | |
499 | - position: absolute; | |
500 | -} | |
501 | -.addAddress { | |
502 | - background-color: #ffffff; | |
503 | - box-sizing: border-box; | |
504 | - height: 124rpx; | |
505 | - width: 100%; | |
506 | - display: flex; | |
507 | - align-items: center; | |
508 | - padding: 0 40rpx; | |
509 | - .addIcon { | |
510 | - background-color: #f2f2f2; | |
511 | - height: 56rpx; | |
512 | - width: 60rpx; | |
513 | - border-radius: 4rpx; | |
514 | - display: flex; | |
515 | - justify-content: center; | |
516 | - align-items: center; | |
517 | - margin-right: 40rpx; | |
518 | - } | |
519 | - image { | |
520 | - height: 28rpx; | |
521 | - width: 30rpx; | |
522 | - } | |
523 | - .addressText { | |
524 | - font-size: 28rpx; | |
525 | - color: #333333; | |
526 | - margin-right: 364rpx; | |
527 | - } | |
528 | -} | |
529 | -.content { | |
530 | - background-color: #f2f2f2; | |
531 | - width: 100%; | |
532 | - display: flex; | |
533 | - flex-direction: column; | |
534 | - justify-content: center; | |
535 | - align-items: center; | |
536 | - padding: 40rpx; | |
537 | - box-sizing: border-box; | |
538 | - .orderInfo { | |
539 | - width: 670rpx; | |
540 | - min-height: 488rpx; | |
541 | - background-color: #ffffff; | |
542 | - border-radius: 20rpx; | |
543 | - box-sizing: border-box; | |
544 | - padding: 0 40rpx 40rpx 40rpx; | |
545 | - .title { | |
546 | - display: flex; | |
547 | - align-items: center; | |
548 | - font-size: 28rpx; | |
549 | - color: #333333; | |
550 | - height: 60rpx; | |
551 | - line-height: 40rpx; | |
552 | - padding: 10rpx 10rpx 10rpx 0rpx; | |
553 | - image { | |
554 | - margin-right: 20rpx; | |
555 | - } | |
556 | - } | |
557 | - .infoBox { | |
558 | - margin-top: 42rpx; | |
559 | - .infoTop { | |
560 | - display: flex; | |
561 | - flex-direction: row; | |
562 | - image { | |
563 | - height: 188rpx; | |
564 | - width: 188rpx; | |
565 | - margin-right: 24rpx; | |
566 | - } | |
567 | - .infoRight { | |
568 | - width: 374rpx; | |
569 | - display: flex; | |
570 | - flex-direction: column; | |
571 | - align-items: flex-start; | |
572 | - justify-content: space-between; | |
573 | - .goodName { | |
574 | - font-size: 28rpx; | |
575 | - color: #333333; | |
576 | - } | |
577 | - .remarks { | |
578 | - font-size: 20rpx; | |
579 | - color: #999999; | |
580 | - } | |
581 | - .priceBox { | |
582 | - display: flex; | |
583 | - justify-content: space-between; | |
584 | - align-items: center; | |
585 | - width: 100%; | |
586 | - .price { | |
587 | - color: #ff6b4a; | |
588 | - font-size: 28rpx; | |
589 | - text{ | |
590 | - margin-left: 10rpx; | |
591 | - } | |
592 | - } | |
593 | - .originCost { | |
594 | - text-decoration: line-through; | |
595 | - color: #999999; | |
596 | - font-size: 20rpx; | |
597 | - } | |
598 | - .counter { | |
599 | - display: flex; | |
600 | - flex-direction: row; | |
601 | - justify-content: space-between; | |
602 | - font-size: 28rpx; | |
603 | - color: #333333; | |
604 | - width: 122rpx; | |
605 | - .btn { | |
606 | - display: flex; | |
607 | - justify-content: center; | |
608 | - line-height: 32rpx; | |
609 | - height: 32rpx; | |
610 | - width: 32rpx; | |
611 | - background-color: #f2f2f2; | |
612 | - color: #cfcfcf; | |
613 | - } | |
614 | - } | |
615 | - } | |
616 | - } | |
617 | - } | |
618 | - .infoBottom { | |
619 | - display: flex; | |
620 | - flex-direction: column; | |
621 | - justify-content: flex-start; | |
622 | - font-size: 24rpx; | |
623 | - color: #333333; | |
624 | - text { | |
625 | - color: #999999; | |
626 | - margin-left: 20rpx; | |
627 | - } | |
628 | - | |
629 | - .norm { | |
630 | - margin-top: 28rpx; | |
631 | - } | |
632 | - .shippingMethod { | |
633 | - margin-top: 12rpx; | |
634 | - } | |
635 | - .message { | |
636 | - display: flex; | |
637 | - flex-direction: row; | |
638 | - align-items: center; | |
639 | - margin-top: 18rpx; | |
640 | - input { | |
641 | - margin-left: 20rpx; | |
642 | - width: 75%; | |
643 | - } | |
644 | - } | |
645 | - } | |
646 | - } | |
647 | - } | |
648 | - .payWay { | |
649 | - height: 464rpx; | |
650 | - width: 670rpx; | |
651 | - background-color: #ffffff; | |
652 | - color: #333333; | |
653 | - font-size: 24rpx; | |
654 | - border-radius: 20rpx; | |
655 | - box-sizing: border-box; | |
656 | - padding: 0 52rpx 0rpx 40rpx; | |
657 | - margin-top: 20rpx; | |
658 | - display: flex; | |
659 | - flex-direction: column; | |
660 | - justify-content: center; | |
661 | - align-items: flex-start; | |
662 | - .item { | |
663 | - display: flex; | |
664 | - flex-direction: row; | |
665 | - justify-content: space-between; | |
666 | - align-items: center; | |
667 | - width: 100%; | |
668 | - height: 115rpx; | |
669 | - .itemRight { | |
670 | - display: flex; | |
671 | - flex-direction: row; | |
672 | - justify-content: space-between; | |
673 | - align-items: center; | |
674 | - image { | |
675 | - height: 24rpx; | |
676 | - width: 12rpx; | |
677 | - } | |
678 | - .rightText { | |
679 | - margin-right: 20rpx; | |
680 | - text-align: right; | |
681 | - .choosePayWay { | |
682 | - display: flex; | |
683 | - align-items: center; | |
684 | - text { | |
685 | - color: #333333; | |
686 | - } | |
687 | - image { | |
688 | - height: 36rpx; | |
689 | - width: 40rpx; | |
690 | - margin-right: 8px; | |
691 | - } | |
692 | - } | |
693 | - .randomSubstraction { | |
694 | - color: #ff6b4a; | |
695 | - } | |
696 | - .preferentialWay { | |
697 | - color: #999999; | |
698 | - } | |
699 | - } | |
700 | - .freight, | |
701 | - .total { | |
702 | - margin-right: 32rpx; | |
703 | - } | |
704 | - text { | |
705 | - color: #ff6b4a; | |
706 | - } | |
707 | - } | |
708 | - } | |
709 | - } | |
710 | - // .checkBox { | |
711 | - // height: 58rpx; | |
712 | - // line-height: 58rpx; | |
713 | - // width: 100%; | |
714 | - // margin-top: 36rpx; | |
715 | - // margin-left: 40rpx; | |
716 | - // font-size: 12px; | |
717 | - // color: #999999; | |
718 | - // } | |
719 | -} | |
720 | -.footer { | |
721 | - height: 112rpx; | |
722 | - width: 100%; | |
723 | - background-color: #fff; | |
724 | - font-size: 16px; | |
725 | - display: flex; | |
726 | - justify-content: space-between; | |
727 | - align-items: center; | |
728 | - position: fixed; | |
729 | - bottom: 0; | |
730 | - z-index: 9999; | |
731 | - .footerLeft { | |
732 | - display: flex; | |
733 | - justify-content: center; | |
734 | - align-items: center; | |
735 | - width: 50%; | |
736 | - color: #333333; | |
737 | - text { | |
738 | - color: #ff6b4a; | |
739 | - } | |
740 | - } | |
741 | - .footerRight { | |
742 | - display: flex; | |
743 | - justify-content: flex-end; | |
744 | - align-items: center; | |
745 | - width: 50%; | |
746 | - margin-right: 26rpx; | |
747 | - .paybtn { | |
748 | - display: flex; | |
749 | - justify-content: center; | |
750 | - align-items: center; | |
751 | - background: #ff6b4a; | |
752 | - border-radius: 20px; | |
753 | - border-radius: 20px; | |
754 | - color: #ffffff; | |
755 | - width: 204rpx; | |
756 | - height: 80rpx; | |
757 | - } | |
758 | - } | |
759 | -} | |
760 | -// 地址信息样式 | |
761 | -.order-user { | |
762 | - width: 670rpx; | |
763 | - height: 228rpx; | |
764 | - background: #ffffff; | |
765 | - border-radius: 14rpx; | |
766 | - margin: 0 auto; | |
767 | - margin-top: 20rpx; | |
768 | - position: relative; | |
769 | - .order-user-head { | |
770 | - display: flex; | |
771 | - height: 108rpx; | |
772 | - width: 100%; | |
773 | - align-items: center; | |
774 | - padding-left: 126rpx; | |
775 | - box-sizing: border-box; | |
776 | - .name { | |
777 | - display: flex; | |
778 | - justify-content: space-between; | |
779 | - font-size: 14px; | |
780 | - color: #333333; | |
781 | - letter-spacing: -0.26px; | |
782 | - margin-right: 20rpx; | |
783 | - .default { | |
784 | - height: 40rpx; | |
785 | - width: 80rpx; | |
786 | - background-color: #4a90e2; | |
787 | - border-radius: 13px; | |
788 | - border-radius: 13px; | |
789 | - text-align: center; | |
790 | - margin-right: 20rpx; | |
791 | - text { | |
792 | - display: flex; | |
793 | - justify-content: center; | |
794 | - align-items: center; | |
795 | - font-size: 12px; | |
796 | - color: #ffffff; | |
797 | - letter-spacing: -0.23px; | |
798 | - } | |
799 | - } | |
800 | - } | |
801 | - .mobile { | |
802 | - font-size: 14px; | |
803 | - color: #999999; | |
804 | - letter-spacing: -0.26px; | |
805 | - } | |
806 | - } | |
807 | - .order-user-body { | |
808 | - display: flex; | |
809 | - width: 100%; | |
810 | - image { | |
811 | - width: 24px; | |
812 | - height: 28px; | |
813 | - margin: 12rpx 32rpx 0 40rpx; | |
814 | - } | |
815 | - .address { | |
816 | - font-weight: bold; | |
817 | - font-size: 14px; | |
818 | - color: #333333; | |
819 | - letter-spacing: -0.26px; | |
820 | - } | |
821 | - } | |
822 | - .arrow { | |
823 | - width: 12px; | |
824 | - height: 12px; | |
825 | - position: absolute; | |
826 | - right: 40rpx; | |
827 | - bottom: 104rpx; | |
828 | - } | |
829 | -} | |
830 | -.last_zhanwei { | |
831 | - background: #f2f2f2; | |
832 | - height: 60px; | |
833 | -} | |
834 | -</style> | |
456 | + .wrap { | |
457 | + height: 100vh; | |
458 | + background-color: #f2f2f2; | |
459 | + font-family: PingFangSC-Regular; | |
460 | + letter-spacing: -0.23px; | |
461 | + position: absolute; | |
462 | + } | |
463 | + | |
464 | + .addAddress { | |
465 | + background-color: #ffffff; | |
466 | + box-sizing: border-box; | |
467 | + height: 124rpx; | |
468 | + width: 100%; | |
469 | + display: flex; | |
470 | + align-items: center; | |
471 | + padding: 0 40rpx; | |
472 | + | |
473 | + .addIcon { | |
474 | + background-color: #f2f2f2; | |
475 | + height: 56rpx; | |
476 | + width: 60rpx; | |
477 | + border-radius: 4rpx; | |
478 | + display: flex; | |
479 | + justify-content: center; | |
480 | + align-items: center; | |
481 | + margin-right: 40rpx; | |
482 | + } | |
483 | + | |
484 | + image { | |
485 | + height: 28rpx; | |
486 | + width: 30rpx; | |
487 | + } | |
488 | + | |
489 | + .addressText { | |
490 | + font-size: 28rpx; | |
491 | + color: #333333; | |
492 | + margin-right: 364rpx; | |
493 | + } | |
494 | + } | |
495 | + | |
496 | + .content { | |
497 | + background-color: #f2f2f2; | |
498 | + width: 100%; | |
499 | + display: flex; | |
500 | + flex-direction: column; | |
501 | + justify-content: center; | |
502 | + align-items: center; | |
503 | + padding: 40rpx; | |
504 | + box-sizing: border-box; | |
505 | + | |
506 | + .orderInfo { | |
507 | + width: 670rpx; | |
508 | + min-height: 488rpx; | |
509 | + background-color: #ffffff; | |
510 | + border-radius: 20rpx; | |
511 | + box-sizing: border-box; | |
512 | + padding: 0 40rpx 40rpx 40rpx; | |
513 | + | |
514 | + .title { | |
515 | + display: flex; | |
516 | + align-items: center; | |
517 | + font-size: 28rpx; | |
518 | + color: #333333; | |
519 | + height: 60rpx; | |
520 | + line-height: 40rpx; | |
521 | + padding: 10rpx 10rpx 10rpx 0rpx; | |
522 | + | |
523 | + image { | |
524 | + margin-right: 20rpx; | |
525 | + } | |
526 | + } | |
527 | + | |
528 | + .infoBox { | |
529 | + margin-top: 42rpx; | |
530 | + | |
531 | + .infoTop { | |
532 | + display: flex; | |
533 | + flex-direction: row; | |
534 | + | |
535 | + image { | |
536 | + height: 188rpx; | |
537 | + width: 188rpx; | |
538 | + margin-right: 24rpx; | |
539 | + } | |
540 | + | |
541 | + .infoRight { | |
542 | + width: 374rpx; | |
543 | + display: flex; | |
544 | + flex-direction: column; | |
545 | + align-items: flex-start; | |
546 | + justify-content: space-between; | |
547 | + | |
548 | + .goodName { | |
549 | + font-size: 28rpx; | |
550 | + color: #333333; | |
551 | + } | |
552 | + | |
553 | + .remarks { | |
554 | + font-size: 20rpx; | |
555 | + color: #999999; | |
556 | + } | |
557 | + | |
558 | + .priceBox { | |
559 | + display: flex; | |
560 | + justify-content: space-between; | |
561 | + align-items: center; | |
562 | + width: 100%; | |
563 | + | |
564 | + .price { | |
565 | + color: #ff6b4a; | |
566 | + font-size: 28rpx; | |
567 | + | |
568 | + text { | |
569 | + margin-left: 10rpx; | |
570 | + } | |
571 | + } | |
572 | + | |
573 | + .originCost { | |
574 | + text-decoration: line-through; | |
575 | + color: #999999; | |
576 | + font-size: 20rpx; | |
577 | + } | |
578 | + | |
579 | + .counter { | |
580 | + display: flex; | |
581 | + flex-direction: row; | |
582 | + justify-content: space-between; | |
583 | + font-size: 28rpx; | |
584 | + color: #333333; | |
585 | + width: 122rpx; | |
586 | + | |
587 | + .btn { | |
588 | + display: flex; | |
589 | + justify-content: center; | |
590 | + line-height: 32rpx; | |
591 | + height: 32rpx; | |
592 | + width: 32rpx; | |
593 | + background-color: #f2f2f2; | |
594 | + color: #cfcfcf; | |
595 | + } | |
596 | + } | |
597 | + } | |
598 | + } | |
599 | + } | |
600 | + | |
601 | + .infoBottom { | |
602 | + display: flex; | |
603 | + flex-direction: column; | |
604 | + justify-content: flex-start; | |
605 | + font-size: 24rpx; | |
606 | + color: #333333; | |
607 | + | |
608 | + text { | |
609 | + color: #999999; | |
610 | + margin-left: 20rpx; | |
611 | + } | |
612 | + | |
613 | + .norm { | |
614 | + margin-top: 28rpx; | |
615 | + } | |
616 | + | |
617 | + .shippingMethod { | |
618 | + margin-top: 12rpx; | |
619 | + } | |
620 | + | |
621 | + .message { | |
622 | + display: flex; | |
623 | + flex-direction: row; | |
624 | + align-items: center; | |
625 | + margin-top: 18rpx; | |
626 | + | |
627 | + input { | |
628 | + margin-left: 20rpx; | |
629 | + width: 75%; | |
630 | + } | |
631 | + } | |
632 | + } | |
633 | + } | |
634 | + } | |
635 | + | |
636 | + .payWay { | |
637 | + height: 464rpx; | |
638 | + width: 670rpx; | |
639 | + background-color: #ffffff; | |
640 | + color: #333333; | |
641 | + font-size: 24rpx; | |
642 | + border-radius: 20rpx; | |
643 | + box-sizing: border-box; | |
644 | + padding: 0 52rpx 0rpx 40rpx; | |
645 | + margin-top: 20rpx; | |
646 | + display: flex; | |
647 | + flex-direction: column; | |
648 | + justify-content: center; | |
649 | + align-items: flex-start; | |
650 | + | |
651 | + .item { | |
652 | + display: flex; | |
653 | + flex-direction: row; | |
654 | + justify-content: space-between; | |
655 | + align-items: center; | |
656 | + width: 100%; | |
657 | + height: 115rpx; | |
658 | + | |
659 | + .itemRight { | |
660 | + display: flex; | |
661 | + flex-direction: row; | |
662 | + justify-content: space-between; | |
663 | + align-items: center; | |
664 | + | |
665 | + image { | |
666 | + height: 24rpx; | |
667 | + width: 12rpx; | |
668 | + } | |
669 | + | |
670 | + .rightText { | |
671 | + margin-right: 20rpx; | |
672 | + text-align: right; | |
673 | + | |
674 | + .choosePayWay { | |
675 | + display: flex; | |
676 | + align-items: center; | |
677 | + | |
678 | + text { | |
679 | + color: #333333; | |
680 | + } | |
681 | + | |
682 | + image { | |
683 | + height: 36rpx; | |
684 | + width: 40rpx; | |
685 | + margin-right: 8px; | |
686 | + } | |
687 | + } | |
688 | + | |
689 | + .randomSubstraction { | |
690 | + color: #ff6b4a; | |
691 | + } | |
692 | + | |
693 | + .preferentialWay { | |
694 | + color: #999999; | |
695 | + } | |
696 | + } | |
697 | + | |
698 | + .freight, | |
699 | + .total { | |
700 | + margin-right: 32rpx; | |
701 | + } | |
702 | + | |
703 | + text { | |
704 | + color: #ff6b4a; | |
705 | + } | |
706 | + } | |
707 | + } | |
708 | + } | |
709 | + | |
710 | + // .checkBox { | |
711 | + // height: 58rpx; | |
712 | + // line-height: 58rpx; | |
713 | + // width: 100%; | |
714 | + // margin-top: 36rpx; | |
715 | + // margin-left: 40rpx; | |
716 | + // font-size: 12px; | |
717 | + // color: #999999; | |
718 | + // } | |
719 | + } | |
720 | + | |
721 | + .footer { | |
722 | + height: 112rpx; | |
723 | + width: 100%; | |
724 | + background-color: #fff; | |
725 | + font-size: 16px; | |
726 | + display: flex; | |
727 | + justify-content: space-between; | |
728 | + align-items: center; | |
729 | + position: fixed; | |
730 | + bottom: 0; | |
731 | + z-index: 9999; | |
732 | + | |
733 | + .footerLeft { | |
734 | + display: flex; | |
735 | + justify-content: center; | |
736 | + align-items: center; | |
737 | + width: 50%; | |
738 | + color: #333333; | |
739 | + | |
740 | + text { | |
741 | + color: #ff6b4a; | |
742 | + } | |
743 | + } | |
744 | + | |
745 | + .footerRight { | |
746 | + display: flex; | |
747 | + justify-content: flex-end; | |
748 | + align-items: center; | |
749 | + width: 50%; | |
750 | + margin-right: 26rpx; | |
751 | + | |
752 | + .paybtn { | |
753 | + display: flex; | |
754 | + justify-content: center; | |
755 | + align-items: center; | |
756 | + background: #ff6b4a; | |
757 | + border-radius: 20px; | |
758 | + border-radius: 20px; | |
759 | + color: #ffffff; | |
760 | + width: 204rpx; | |
761 | + height: 80rpx; | |
762 | + } | |
763 | + } | |
764 | + } | |
765 | + | |
766 | + // 地址信息样式 | |
767 | + .order-user { | |
768 | + width: 670rpx; | |
769 | + height: 228rpx; | |
770 | + background: #ffffff; | |
771 | + border-radius: 14rpx; | |
772 | + margin: 0 auto; | |
773 | + margin-top: 20rpx; | |
774 | + position: relative; | |
775 | + | |
776 | + .order-user-head { | |
777 | + display: flex; | |
778 | + height: 108rpx; | |
779 | + width: 100%; | |
780 | + align-items: center; | |
781 | + padding-left: 126rpx; | |
782 | + box-sizing: border-box; | |
783 | + | |
784 | + .name { | |
785 | + display: flex; | |
786 | + justify-content: space-between; | |
787 | + font-size: 14px; | |
788 | + color: #333333; | |
789 | + letter-spacing: -0.26px; | |
790 | + margin-right: 20rpx; | |
791 | + | |
792 | + .default { | |
793 | + height: 40rpx; | |
794 | + width: 80rpx; | |
795 | + background-color: #4a90e2; | |
796 | + border-radius: 13px; | |
797 | + border-radius: 13px; | |
798 | + text-align: center; | |
799 | + margin-right: 20rpx; | |
800 | + | |
801 | + text { | |
802 | + display: flex; | |
803 | + justify-content: center; | |
804 | + align-items: center; | |
805 | + font-size: 12px; | |
806 | + color: #ffffff; | |
807 | + letter-spacing: -0.23px; | |
808 | + } | |
809 | + } | |
810 | + } | |
811 | + | |
812 | + .mobile { | |
813 | + font-size: 14px; | |
814 | + color: #999999; | |
815 | + letter-spacing: -0.26px; | |
816 | + } | |
817 | + } | |
818 | + | |
819 | + .order-user-body { | |
820 | + display: flex; | |
821 | + width: 100%; | |
822 | + | |
823 | + image { | |
824 | + width: 24px; | |
825 | + height: 28px; | |
826 | + margin: 12rpx 32rpx 0 40rpx; | |
827 | + } | |
828 | + | |
829 | + .address { | |
830 | + font-weight: bold; | |
831 | + font-size: 14px; | |
832 | + color: #333333; | |
833 | + letter-spacing: -0.26px; | |
834 | + } | |
835 | + } | |
836 | + | |
837 | + .arrow { | |
838 | + width: 12px; | |
839 | + height: 12px; | |
840 | + position: absolute; | |
841 | + right: 40rpx; | |
842 | + bottom: 104rpx; | |
843 | + } | |
844 | + } | |
845 | + | |
846 | + .last_zhanwei { | |
847 | + background: #f2f2f2; | |
848 | + height: 60px; | |
849 | + } | |
850 | +</style> | ... | ... |
src/pages/details/components/Introduce.vue
1 | 1 | <template> |
2 | 2 | <view class="introduce"> |
3 | 3 | <!-- 迭代时建议配合接口修改 为数组 --> |
4 | - <view v-if="tag.prod_tag_age && tag.prod_tag_age.length !== 0"> | |
4 | + | |
5 | + <view v-if="Tag.Age && Tag.Age.length !== 0"> | |
5 | 6 | <view> |
6 | 7 | 年龄:<view |
7 | - v-for="(item,index) in tag.prod_tag_age" | |
8 | + v-for="(item,index) in Tag.Age" | |
8 | 9 | :key="index" |
9 | 10 | > |
10 | - {{item.label}}<text v-if="index !== tag.prod_tag_age.length - 1">/</text> | |
11 | + {{item}}<text v-if="index !== Tag.Age.length - 1">/</text> | |
11 | 12 | </view> |
12 | 13 | </view> |
13 | 14 | </view> |
14 | - <view v-if="tag.prod_tag_color && tag.prod_tag_color.length !== 0"> | |
15 | + <view v-if="Tag.Colour && Tag.Colour.length !== 0"> | |
15 | 16 | <view> |
16 | 17 | 颜色:<view |
17 | - v-for="(item,index) in tag.prod_tag_color" | |
18 | + v-for="(item,index) in Tag.Colour" | |
18 | 19 | :key="index" |
19 | 20 | > |
20 | - {{item.label}}<text v-if="index !== tag.prod_tag_color.length - 1">/</text> | |
21 | + {{item}}<text v-if="index !== Tag.Colour.length - 1">/</text> | |
21 | 22 | </view> |
22 | 23 | </view> |
23 | 24 | </view> |
24 | - <view v-if="tag.prod_tag_face && tag.prod_tag_face.length !== 0"> | |
25 | + <view v-if="Tag.Shape && Tag.Shape.length !== 0"> | |
25 | 26 | <view> |
26 | 27 | 脸型:<view |
27 | - v-for="(item,index) in tag.prod_tag_face" | |
28 | + v-for="(item,index) in Tag.Shape" | |
28 | 29 | :key="index" |
29 | 30 | > |
30 | - {{item.label}}<text v-if="index !== tag.prod_tag_face.length - 1">/</text> | |
31 | + {{item}}<text v-if="index !== Tag.Shape.length - 1">/</text> | |
31 | 32 | </view> |
32 | 33 | </view> |
33 | 34 | </view> |
34 | - <view v-if="tag.prod_tag_freesend && tag.prod_tag_freesend.length !== 0"> | |
35 | + <view v-if="Tag.Rim && Tag.Rim.length !== 0"> | |
35 | 36 | <view> |
36 | 37 | 赠品:<view |
37 | - v-for="(item,index) in tag.prod_tag_freesend" | |
38 | + v-for="(item,index) in Tag.Rim" | |
38 | 39 | :key="index" |
39 | 40 | > |
40 | - {{item.label}}<text v-if="index !== tag.prod_tag_freesend.length - 1">/</text> | |
41 | + {{item}}<text v-if="index !== Tag.Rim.length - 1">/</text> | |
41 | 42 | </view> |
42 | 43 | </view> |
43 | 44 | </view> |
44 | - <view v-if="tag.prod_tag_insurance && tag.prod_tag_insurance.length !== 0"> | |
45 | + <!-- <view v-if="Tag.prod_Tag_insurance && Tag.prod_Tag_insurance.length !== 0"> | |
45 | 46 | <view> |
46 | 47 | 保险:<view |
47 | - v-for="(item,index) in tag.prod_tag_insurance" | |
48 | + v-for="(item,index) in Tag.prod_Tag_insurance" | |
48 | 49 | :key="index" |
49 | 50 | > |
50 | - {{item.label}}<text v-if="index !== tag.prod_tag_insurance.length - 1">/</text> | |
51 | + {{item.label}}<text v-if="index !== Tag.prod_Tag_insurance.length - 1">/</text> | |
51 | 52 | </view> |
52 | 53 | </view> |
53 | - </view> | |
54 | - <view v-if="tag.prod_tag_metal && tag.prod_tag_metal.length !== 0"> | |
54 | + </view> --> | |
55 | + <view v-if="Tag.Material && Tag.Material.length !== 0"> | |
55 | 56 | <view> |
56 | 57 | 材质:<view |
57 | - v-for="(item,index) in tag.prod_tag_metal" | |
58 | + v-for="(item,index) in Tag.Material" | |
58 | 59 | :key="index" |
59 | 60 | > |
60 | - {{item.label}}<text v-if="index !== tag.prod_tag_metal.length - 1">/</text> | |
61 | + {{item}}<text v-if="index !== Tag.Material.length - 1">/</text> | |
61 | 62 | </view> |
62 | 63 | </view> |
63 | 64 | </view> |
64 | - <view v-if="tag.prod_tag_personal && tag.prod_tag_personal.length !== 0"> | |
65 | + <!-- <view v-if="Tag.Style && Tag.Style.length !== 0"> | |
65 | 66 | <view> |
66 | 67 | 个性:<view |
67 | - v-for="(item,index) in tag.prod_tag_personal" | |
68 | + v-for="(item,index) in Tag.Style" | |
68 | 69 | :key="index" |
69 | 70 | > |
70 | - {{item.label}}<text v-if="index !== tag.prod_tag_personal.length - 1">/</text> | |
71 | + {{item}}<text v-if="index !== Tag.Style.length - 1">/</text> | |
71 | 72 | </view> |
72 | 73 | </view> |
73 | - </view> | |
74 | - <view v-if="tag.prod_tag_sense && tag.prod_tag_sense.length !== 0"> | |
74 | + </view> --> | |
75 | + <view v-if="Tag.Eyeglasses && Tag.Eyeglasses.length !== 0"> | |
75 | 76 | <view> |
76 | 77 | 场景:<view |
77 | - v-for="(item,index) in tag.prod_tag_sense" | |
78 | + v-for="(item,index) in Tag.Eyeglasses" | |
78 | 79 | :key="index" |
79 | 80 | > |
80 | - {{item.label}}<text v-if="index !== tag.prod_tag_sense.length - 1">/</text> | |
81 | + {{item}}<text v-if="index !== Tag.Eyeglasses.length - 1">/</text> | |
81 | 82 | </view> |
82 | 83 | </view> |
83 | 84 | </view> |
84 | - <view v-if="tag.prod_tag_sex && tag.prod_tag_sex.length !== 0"> | |
85 | + <view v-if="Tag.Gender && Tag.Gender.length !== 0"> | |
85 | 86 | <view> |
86 | 87 | 性别:<view |
87 | - v-for="(item,index) in tag.prod_tag_sex" | |
88 | + v-for="(item,index) in Tag.Gender" | |
88 | 89 | :key="index" |
89 | 90 | > |
90 | - {{item.label}}<text v-if="index !== tag.prod_tag_sex.length - 1">/</text> | |
91 | + {{item}}<text v-if="index !== Tag.Gender.length - 1">/</text> | |
91 | 92 | </view> |
92 | 93 | </view> |
93 | 94 | </view> |
94 | - <view v-if="tag.prod_tag_style && tag.prod_tag_style.length !== 0"> | |
95 | + <!-- <view v-if="Tag.prod_Tag_style && Tag.prod_Tag_style.length !== 0"> | |
95 | 96 | <view> |
96 | 97 | 风格:<view |
97 | - v-for="(item,index) in tag.prod_tag_style" | |
98 | + v-for="(item,index) in Tag.prod_Tag_style" | |
98 | 99 | :key="index" |
99 | 100 | > |
100 | - {{item.label}}<text v-if="index !== tag.prod_tag_style.length - 1">/</text> | |
101 | + {{item.label}}<text v-if="index !== Tag.prod_Tag_style.length - 1">/</text> | |
101 | 102 | </view> |
102 | 103 | </view> |
103 | - </view> | |
104 | - <view v-if="tag.prod_tag_weight && tag.prod_tag_weight.length !== 0"> | |
104 | + </view> --> | |
105 | + | |
106 | + <view v-if="Tag.Colour && Tag.Colour.length !== 0"> | |
105 | 107 | <view> |
106 | 108 | 重量:<view |
107 | - v-for="(item,index) in tag.prod_tag_weight" | |
109 | + v-for="(item,index) in Tag.Colour" | |
108 | 110 | :key="index" |
109 | 111 | > |
110 | - {{item.label}}<text v-if="index !== tag.prod_tag_weight.length - 1">/</text> | |
112 | + {{item}}<text v-if="index !== Tag.Colour.length - 1">/</text> | |
111 | 113 | </view> |
112 | 114 | </view> |
113 | 115 | </view> |
... | ... | @@ -117,7 +119,7 @@ |
117 | 119 | <script> |
118 | 120 | export default { |
119 | 121 | props: { |
120 | - tag: Object, | |
122 | + Tag: Object, | |
121 | 123 | }, |
122 | 124 | created() { |
123 | 125 | }, | ... | ... |
src/pages/details/details.vue
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 | class="screen_item" |
67 | 67 | v-if="item_current === 0" |
68 | 68 | > |
69 | - <Introduce :tag="tag" /> | |
69 | + <Introduce :Tag="Tag" /> | |
70 | 70 | </view> |
71 | 71 | <!-- 规格参数 --> |
72 | 72 | <view |
... | ... | @@ -172,7 +172,8 @@ |
172 | 172 | <BottomSheet |
173 | 173 | :isCart="isCart" |
174 | 174 | @addCart="addCart" |
175 | - :pid="pid" | |
175 | + :shop_wood_id="shop_wood_id" | |
176 | + :wsp_id="skId" | |
176 | 177 | :goodInfo="goodInfo" |
177 | 178 | :isShowBottom="isShowBottom" |
178 | 179 | @closeBottom="closeBottom" |
... | ... | @@ -256,8 +257,8 @@ export default { |
256 | 257 | return this.$store.state.details.goodsInfo |
257 | 258 | }, |
258 | 259 | // 商品介绍商品标签 |
259 | - tag() { | |
260 | - return this.$store.state.details.tag | |
260 | + Tag() { | |
261 | + return this.$store.state.details.Tag | |
261 | 262 | }, |
262 | 263 | // 规格参数 |
263 | 264 | specification() { |
... | ... | @@ -269,7 +270,7 @@ export default { |
269 | 270 | }, |
270 | 271 | // 商品详情 |
271 | 272 | more() { |
272 | - return this.$store.state.details.more | |
273 | + return this.$store.state.details.shop_wood_desc_rich_text | |
273 | 274 | }, |
274 | 275 | // 购物车数目 |
275 | 276 | cartNumber() { |
... | ... | @@ -376,7 +377,7 @@ export default { |
376 | 377 | } |
377 | 378 | return { |
378 | 379 | title: 'Hi,' + myName + '送你300元来试戴最新潮流眼镜!', // 默认是小程序的名称(可以写slogan等) |
379 | - path: '/pages/details/details?sid=0&pid=' + this.pid, | |
380 | + path: '/pages/details/details?sid=0&pid=' + this.shop_wood_id, | |
380 | 381 | imageUrl: this.skuList[0].pic, // 不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 |
381 | 382 | success: function (res) { |
382 | 383 | if (res.errMsg === 'shareAppMessage:ok') { |
... | ... | @@ -428,7 +429,7 @@ export default { |
428 | 429 | addCartList.sk_id = skId |
429 | 430 | addCartList.num = num |
430 | 431 | // addCartList.checkedSKU = checkedSKU |
431 | - addCartList.pid = this.pid | |
432 | + addCartList.shop_wood_id = this.shop_wood_id | |
432 | 433 | addCartList.price = price |
433 | 434 | console.log('添加购物车的参数', addCartList) |
434 | 435 | store.dispatch('cart/addCart', addCartList).then((res) => { | ... | ... |
src/pages/myOrder/components/OrderCard.vue
1 | 1 | <template> |
2 | - <view> | |
3 | - <view | |
4 | - class="card" | |
5 | - v-if="current == status" | |
6 | - | |
7 | - > | |
8 | - <view class="cardHeader"> | |
9 | - <text | |
10 | - class="orderId" | |
11 | - v-if="status == '0'||status == '1'" | |
12 | - >订单号:{{order.pay_id}}</text> | |
13 | - <text | |
14 | - class="orderId" | |
15 | - v-if="status == '2'||status == '3'" | |
16 | - >下单时间:{{order.pay_time}}</text> | |
17 | - <text | |
18 | - class="orderType" | |
19 | - v-if="status=='0'" | |
20 | - >待付款</text> | |
21 | - <text | |
22 | - class="orderType" | |
23 | - v-if="status=='1'" | |
24 | - >待收货</text> | |
25 | - <text | |
26 | - class="orderType" | |
27 | - v-if="status == '2'||status == '3'" | |
28 | - >已完成</text> | |
29 | - <!-- <text class="orderType" v-if="status == '3'">已评价</text> --> | |
30 | - </view> | |
31 | - <view | |
32 | - class="orderCardInfo" | |
33 | - @click="toOrderInfo(status,order.pay_id)" | |
34 | - v-for="(orderInfo, index) in orderInfoList" | |
35 | - :key="index" | |
36 | - > | |
37 | - <image | |
38 | - :src="orderInfo.imgUrl" | |
39 | - mode="aspectFill" | |
40 | - ></image> | |
41 | - <view class="infoText"> | |
42 | - <view class="orderName">{{orderInfo.p_name}}</view> | |
43 | - <view class="orderDescrib">{{orderInfo.p_name}}</view> | |
44 | - <view class="infoText-bottom"> | |
45 | - <view class="markPrice">{{orderInfo.nowPrice}}</view> | |
46 | - <view class="buy-num">X {{orderInfo.num}}</view> | |
47 | - </view> | |
48 | - </view> | |
49 | - </view> | |
50 | - <view class="payPrice">实付:<text class="priceNum">{{order.total_fee}}</text> </view> | |
51 | - <!-- 0待付款 1 已付款 待收货 2 已收货待评价 3 已评价 --> | |
52 | - <view | |
53 | - class="btns" | |
54 | - v-if="status == '0'" | |
55 | - > | |
56 | - <view class="btn-type1" @click="cancleOrder">取消订单</view> | |
57 | - <view class="btn-type2" @click="paylog">去支付</view> | |
58 | - </view> | |
59 | - <view | |
60 | - class="btns" | |
61 | - v-if="status == '1'" | |
62 | - > | |
63 | - <view class="btn-type2">确认收货</view> | |
64 | - </view> | |
65 | - <view | |
66 | - class="btns" | |
67 | - v-if="status == '2'" | |
68 | - > | |
69 | - <view class="btn-type2" @click="toDetail(order.order_info[0].pid)">再次购买</view> | |
70 | - </view> | |
71 | - <!-- <view class="btns" v-if="status == '3'"> | |
72 | - <view class="btn-type2">再次购买</view> | |
73 | - </view> --> | |
74 | - </view> | |
75 | - <view class="card" v-if="current == '10'" > | |
2 | + <view> | |
3 | + <view class="card" v-if="current == '200000' "> | |
76 | 4 | <view class="cardHeader"> |
77 | - <text class="orderId" v-if="status == '0'||status == '1'">订单号:{{order.pay_id}}</text> | |
78 | - <text class="orderId" v-if="status == '2'||status == '3'">下单时间:{{order.pay_time}}</text> | |
79 | - <text class="orderType" v-if="status=='0'">待付款</text> | |
80 | - <text class="orderType" v-if="status=='1'">待收货</text> | |
81 | - <text class="orderType" v-if="status == '2'||status == '3'">已完成</text> | |
82 | - <!-- <text class="orderType" v-if="status == '3'">已评价</text> --> | |
5 | + <text class="orderId" v-if="order_status == '0'||order_status == '100000'">订单号:{{order.order_no}}</text> | |
6 | + <text class="orderId" | |
7 | + v-if="order_status == '200000'||order_status == '300000'">下单时间:{{order.order_time}}</text> | |
8 | + <text class="orderType" v-if="order_status=='100000'">待付款</text> | |
9 | + <text class="orderType" v-if="order_status=='200000'">待收货</text> | |
10 | + <text class="orderType" v-if="order_status == '200000'||order_status == '300000'">已完成</text> | |
11 | + <text class="orderType" v-if="order_status == '300000'">已评价</text> | |
83 | 12 | </view> |
84 | - <view class="orderCardInfo" @click="toOrderInfo(status,order.pay_id)" v-for="(orderInfo) in orderInfoList" :key="orderInfo"> | |
85 | - <image :src="orderInfo.imgUrl" mode="aspectFill"></image> | |
13 | + <view class="orderCardInfo" @click="toOrderInfo(order_status, order.order_id)" | |
14 | + v-for="(orderInfo, index) in orderInfoList" :key="index"> | |
15 | + <!-- --> | |
16 | + <image :src="orderInfo.img" mode="aspectFill"></image> | |
86 | 17 | <view class="infoText"> |
87 | - <view class="orderName">{{orderInfo.p_name}}</view> | |
88 | - <view class="orderDescrib">{{orderInfo.p_name}}</view> | |
18 | + <view class="orderName">{{orderInfo.wsp_sku_name}}--1</view> | |
19 | + <view class="orderDescrib">{{orderInfo.wsp_sku_name}}</view> | |
89 | 20 | <view class="infoText-bottom"> |
90 | - <view class="markPrice">{{orderInfo.nowPrice}}</view> | |
21 | + <view class="markPrice">{{orderInfo.price}}</view> | |
91 | 22 | <view class="buy-num">X {{orderInfo.num}}</view> |
92 | 23 | </view> |
93 | 24 | </view> |
94 | 25 | </view> |
95 | - <view class="payPrice">实付:<text class="priceNum">{{order.total_fee}}</text> </view> | |
96 | - <view class="btns" v-if="status == '0'"> | |
97 | - <view class="btn-type1" @click="cancleOrder">取消订单</view> | |
26 | + <view class="payPrice">总额:<text class="priceNum">{{orderObj.all_money}}</text>,优惠:<text class="priceNum">{{orderObj.reduce_all_price}}</text>,实付:<text class="priceNum">{{orderObj.final_money}}</text> </view> | |
27 | + <!-- 0待付款 1 已付款 待收货 2 已收货待评价 3 已评价 --> | |
28 | + <view class="btns" v-if="order_status == '0'"> | |
29 | + <view class="btn-type1" @click="cancleOrder">取消订单</view> | |
98 | 30 | <view class="btn-type2" @click="paylog">去支付</view> |
99 | 31 | </view> |
100 | - <view class="btns" v-if="status == '1'"> | |
32 | + <view class="btns" v-if="order_status == '1'"> | |
101 | 33 | <view class="btn-type2">确认收货</view> |
102 | 34 | </view> |
103 | - <view class="btns" v-if="status == '2'||status == '3'"> | |
35 | + <view class="btns" v-if="order_status == '2'"> | |
36 | + <view class="btn-type2" @click="toDetail(orderObj.order_detail.sku_arr[0].shop_wood_id)">再次购买</view> | |
37 | + </view> | |
38 | + | |
39 | + </view> | |
40 | + <view class="card" v-if="current == '100000'"> | |
41 | + <view class="cardHeader"> | |
42 | + <text class="orderId">订单号:{{order.order_no}}</text> | |
43 | + <text class="orderId" | |
44 | + v-if="order_status == '200000'||order_status == '300000'">下单时间:{{order.order_time}}</text> | |
45 | + <text class="orderType" v-if="order_status=='100000'">待付款</text> | |
46 | + <text class="orderType" v-if="order_status=='200000'">待收货</text> | |
47 | + <text class="orderType" v-if="order_status == '200000'||order_status == '300000'">已完成</text> | |
48 | + <!-- <text class="orderType" v-if="order_status == '3'">已评价</text> --> | |
49 | + </view> | |
50 | + <view class="orderCardInfo" @click="toOrderInfo(order_status, order.order_id)" | |
51 | + v-for="(orderInfo) in orderInfoList"> | |
52 | + <image :src="orderInfo.img" mode="aspectFill"></image> | |
53 | + <view class="infoText"> | |
54 | + <view class="orderName">{{orderInfo.wsp_sku_name}}</view> | |
55 | + <view class="orderDescrib">{{orderInfo.wsp_sku_name}}</view> | |
56 | + <view class="infoText-bottom"> | |
57 | + <view class="markPrice">{{orderInfo.price}}</view> | |
58 | + <view class="buy-num">X {{orderInfo.num}}</view> | |
59 | + </view> | |
60 | + </view> | |
61 | + </view> | |
62 | + <view class="payPrice">总额:<text class="priceNum">{{orderObj.all_money}}</text>,优惠:<text class="priceNum">{{orderObj.reduce_all_price}}</text>,实付:<text class="priceNum">{{orderObj.final_money}}</text> </view> | |
63 | + <!-- <view class="payPrice">实付:<text class="priceNum">{{orderObj.final_money}}</text> </view> --> | |
64 | + <view class="btns" v-if="order_status == '100000'"> | |
65 | + <view class="btn-type1" @click="cancleOrder">取消订单</view> | |
66 | + <view class="btn-type2" @click="paylog">去支付</view> | |
67 | + </view> | |
68 | + <view class="btns" v-if="order_status == '200000'"> | |
69 | + <view class="btn-type1">确认收货</view> | |
70 | + </view> | |
71 | + <view class="btns" v-if="order_status == '200000'||order_status == '300000'"> | |
72 | + <!-- <view class="btn-type1" v-if="order_status == '200000'" @click="toDetail(order.order_info[0].pid)">确认收货</view> --> | |
104 | 73 | <view class="btn-type2" @click="toDetail(order.order_info[0].pid)">再次购买</view> |
105 | 74 | </view> |
106 | - </view> | |
107 | - </view> | |
75 | + </view> | |
76 | + </view> | |
108 | 77 | </template> |
109 | 78 | |
110 | 79 | <script> |
... | ... | @@ -113,117 +82,134 @@ |
113 | 82 | export default { |
114 | 83 | data() { |
115 | 84 | return { |
116 | - | |
85 | + orderObj:JSON.parse(this.order.order_data_obj) | |
117 | 86 | }; |
118 | 87 | }, |
119 | 88 | props: { |
120 | 89 | /** |
121 | 90 | * 订单数据 |
122 | 91 | */ |
123 | - order: {}, | |
92 | + order: {}, | |
124 | 93 | /** |
125 | 94 | * 当前选择 |
126 | 95 | */ |
127 | - current:Number | |
128 | - | |
96 | + current: String | |
97 | + | |
129 | 98 | }, |
130 | 99 | created() { |
131 | - console.log('order',this.order); | |
100 | + console.error('order',this.order); | |
101 | + // let a = ; | |
102 | + // this.order = JSON.parse(this.order.order_data_obj); | |
132 | 103 | // console.log(this.order.status ); |
133 | 104 | // console.log(this.current); |
134 | 105 | }, |
135 | - computed:{ | |
136 | - status(){ | |
137 | - return this.order.status | |
138 | - }, | |
139 | - orderInfoList(){ | |
140 | - return this.order.order_info | |
106 | + computed: { | |
107 | + order_status() { | |
108 | + return this.order.order_status | |
109 | + }, | |
110 | + // orderObj(){ | |
111 | + | |
112 | + // return a; | |
113 | + // }, | |
114 | + orderInfoList() { | |
115 | + let a = JSON.parse(this.order.order_data_obj); | |
116 | + console.log('orderInfoList=====>', a) | |
117 | + // return JSON.parse(this.order.order_info) | |
118 | + return a.order_detail.sku_arr; | |
141 | 119 | } |
142 | 120 | }, |
143 | - methods:{ | |
121 | + methods: { | |
144 | 122 | async paylog() { |
145 | 123 | const openid = uni.getStorageSync('openid') |
146 | 124 | const uid = this.order.uid; |
147 | 125 | //先拿订单详情 |
148 | 126 | await store.dispatch('orderRead/getOrderInfo', { |
149 | - pay_id: this.order.pay_id, | |
150 | - uid: uid, | |
151 | - openid: openid | |
152 | - }).then((res)=>{ | |
127 | + pay_id: this.order.order_id, | |
128 | + uid: uid, | |
129 | + openid: openid | |
130 | + }).then((res) => { | |
153 | 131 | // console.log(res) |
154 | - const { data, exKeyName: keyName } = res.order_info | |
155 | - const timeStamp = new Date().getTime().toString() | |
156 | - const total_fee = res.total_fee | |
157 | - const payId = res.pay_id | |
158 | - const nonceStr = 'asfafasfasfasfasf' | |
159 | - // 支付参数 | |
160 | - const fieldSet = { | |
161 | - openid: openid, | |
162 | - uid: uid, | |
163 | - shopid: 0, | |
164 | - payCate: 2020, | |
165 | - payMoney: total_fee, | |
166 | - payWoodId: `fcdj-${uid}-${keyName}`, | |
167 | - payWoodDesc: '在【非常戴镜】的微信付款凭证', | |
168 | - nonceStr, | |
169 | - signType: 'MD5', | |
170 | - app_uid: 2020, | |
171 | - timeStamp, | |
172 | - keyname: keyName, | |
173 | - billInfo: JSON.stringify(data), | |
174 | - } | |
175 | - // 请求后台支付接口 | |
176 | - store.dispatch('order/pay', fieldSet).then(({ data, data2, pay_id: payId }) => { | |
177 | - if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { | |
178 | - const stringA = `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` | |
179 | - const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' | |
180 | - | |
181 | - // 微信支付接口 | |
182 | - uni.requestPayment({ | |
183 | - appId: data.appid, | |
184 | - timeStamp, | |
185 | - nonceStr, | |
186 | - total_fee: total_fee, | |
187 | - package: `prepay_id=${data.prepay_id}`, | |
188 | - signType: 'MD5', | |
189 | - paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), | |
190 | - success: (res) => { | |
191 | - // 支付成功 | |
192 | - uni.showModal({ | |
193 | - content: '支付成功', | |
194 | - showCancel: false, | |
195 | - }) | |
196 | - // //修改订单状态 待付款==>待收货 | |
197 | - // store.dispatch("statusConfirm/confirm", { | |
198 | - // uid: this.uid, | |
199 | - // openid: this.openid, | |
200 | - // oldway: "0", | |
201 | - // way: "1", | |
202 | - // pay_id: payId, | |
203 | - // judgeContent: "", | |
204 | - // orderInfo: this.orderInfo.order_info | |
205 | - // }) | |
206 | - }, | |
207 | - fail: (res) => { | |
208 | - // 支付失败 | |
209 | - uni.showModal({ | |
210 | - content: '支付失败', | |
211 | - showCancel: false, | |
212 | - }) | |
213 | - }, | |
214 | - complete: () => { | |
215 | - uni.hideLoading() | |
216 | - }, | |
217 | - }) | |
218 | - } else { | |
219 | - uni.showModal({ | |
220 | - content: '支付失败', | |
221 | - showCancel: false, | |
222 | - }) | |
223 | - console.log('支付失败') | |
224 | - uni.hideLoading() | |
225 | - } | |
226 | - }) | |
132 | + const { | |
133 | + data, | |
134 | + exKeyName: keyName | |
135 | + } = res.order_info | |
136 | + const timeStamp = new Date().getTime().toString() | |
137 | + const total_fee = res.total_fee | |
138 | + const payId = res.pay_id | |
139 | + const nonceStr = 'asfafasfasfasfasf' | |
140 | + // 支付参数 | |
141 | + const fieldSet = { | |
142 | + openid: openid, | |
143 | + uid: uid, | |
144 | + shopid: 0, | |
145 | + payCate: 2020, | |
146 | + payMoney: total_fee, | |
147 | + payWoodId: `fcdj-${uid}-${keyName}`, | |
148 | + payWoodDesc: '在【非常戴镜】的微信付款凭证', | |
149 | + nonceStr, | |
150 | + signType: 'MD5', | |
151 | + app_uid: 2020, | |
152 | + timeStamp, | |
153 | + keyname: keyName, | |
154 | + billInfo: JSON.stringify(data), | |
155 | + } | |
156 | + // 请求后台支付接口 | |
157 | + store.dispatch('order/pay', fieldSet).then(({ | |
158 | + data, | |
159 | + data2, | |
160 | + pay_id: payId | |
161 | + }) => { | |
162 | + if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { | |
163 | + const stringA = | |
164 | + `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` | |
165 | + const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' | |
166 | + | |
167 | + // 微信支付接口 | |
168 | + uni.requestPayment({ | |
169 | + appId: data.appid, | |
170 | + timeStamp, | |
171 | + nonceStr, | |
172 | + total_fee: total_fee, | |
173 | + package: `prepay_id=${data.prepay_id}`, | |
174 | + signType: 'MD5', | |
175 | + paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), | |
176 | + success: (res) => { | |
177 | + // 支付成功 | |
178 | + uni.showModal({ | |
179 | + content: '支付成功', | |
180 | + showCancel: false, | |
181 | + }) | |
182 | + // //修改订单状态 待付款==>待收货 | |
183 | + // store.dispatch("statusConfirm/confirm", { | |
184 | + // uid: this.uid, | |
185 | + // openid: this.openid, | |
186 | + // oldway: "0", | |
187 | + // way: "1", | |
188 | + // pay_id: payId, | |
189 | + // judgeContent: "", | |
190 | + // orderInfo: this.orderInfo.order_info | |
191 | + // }) | |
192 | + }, | |
193 | + fail: (res) => { | |
194 | + // 支付失败 | |
195 | + uni.showModal({ | |
196 | + content: '支付失败', | |
197 | + showCancel: false, | |
198 | + }) | |
199 | + }, | |
200 | + complete: () => { | |
201 | + uni.hideLoading() | |
202 | + }, | |
203 | + }) | |
204 | + } else { | |
205 | + uni.showModal({ | |
206 | + content: '支付失败', | |
207 | + showCancel: false, | |
208 | + }) | |
209 | + console.log('支付失败') | |
210 | + uni.hideLoading() | |
211 | + } | |
212 | + }) | |
227 | 213 | //修改订单状态 待付款==>待收货 |
228 | 214 | // store.dispatch("statusConfirm/confirm", { |
229 | 215 | // uid: this.uid, |
... | ... | @@ -236,55 +222,57 @@ |
236 | 222 | // }) |
237 | 223 | }) |
238 | 224 | }, |
239 | - | |
240 | - async cancleOrder(e) { | |
241 | - const openid = uni.getStorageSync('openid') | |
242 | - const uid = this.order.uid; | |
243 | - //先从订单详情中拿到keyname | |
244 | - await store.dispatch('orderRead/getOrderInfo', { | |
245 | - pay_id: this.order.pay_id, | |
246 | - uid: uid, | |
247 | - openid: openid | |
248 | - }).then((res)=>{ | |
249 | - const keyname = res.order_info.keyname | |
250 | - uni.showModal({ | |
251 | - title: "提示", | |
252 | - content: "现在取消,订单不可恢复哦,确认取消吗?", | |
253 | - success: function(res) { | |
254 | - if (res.confirm) { | |
255 | - store.dispatch("cancelOrder/cancel", { | |
256 | - keyname: keyname, | |
257 | - uid: uid, | |
258 | - openid: openid | |
259 | - }).then((res)=>{ | |
260 | - console.log(res) | |
261 | - if(res.code == 1){ | |
262 | - store.dispatch("myOrder/getList", { | |
263 | - way: "" | |
225 | + | |
226 | + async cancleOrder(e) { | |
227 | + const openid = uni.getStorageSync('openid') | |
228 | + const uid = this.order.uid; | |
229 | + //先从订单详情中拿到keyname | |
230 | + await store.dispatch('orderRead/getOrderInfo', { | |
231 | + pay_id: this.order.pay_id, | |
232 | + uid: uid, | |
233 | + openid: openid | |
234 | + }).then((res) => { | |
235 | + const keyname = res.order_info.keyname | |
236 | + uni.showModal({ | |
237 | + title: "提示", | |
238 | + content: "现在取消,订单不可恢复哦,确认取消吗?", | |
239 | + success: function(res) { | |
240 | + if (res.confirm) { | |
241 | + store.dispatch("cancelOrder/cancel", { | |
242 | + keyname: keyname, | |
243 | + uid: uid, | |
244 | + openid: openid | |
245 | + }).then((res) => { | |
246 | + console.log(res) | |
247 | + if (res.code == 1) { | |
248 | + store.dispatch("myOrder/getList", { | |
249 | + way: "" | |
250 | + }); | |
251 | + } else { | |
252 | + uni.showToast({ | |
253 | + title: '取消失败,服务器错误!', | |
254 | + icon: 'none' | |
255 | + }) | |
256 | + } | |
264 | 257 | }); |
265 | - }else{ | |
266 | - uni.showToast({ | |
267 | - title:'取消失败,服务器错误!', | |
268 | - icon:'none' | |
269 | - }) | |
258 | + } else if (res.cancel) { | |
259 | + console.log("用户点击取消"); | |
270 | 260 | } |
271 | - }); | |
272 | - } else if (res.cancel) { | |
273 | - console.log("用户点击取消"); | |
274 | - } | |
275 | - } | |
276 | - }); | |
277 | - }); | |
278 | - | |
261 | + } | |
262 | + }); | |
263 | + }); | |
264 | + | |
279 | 265 | }, |
280 | - toDetail(pid){ | |
281 | - console.log('pid',pid) | |
266 | + toDetail(pid) { | |
267 | + console.log('pid', pid) | |
282 | 268 | uni.navigateTo({ |
283 | - url: '../details/details?pid='+pid, | |
284 | - fail: (res) => {console.log(res)}, | |
269 | + url: '../details/details?pid=' + pid, | |
270 | + fail: (res) => { | |
271 | + console.log(res) | |
272 | + }, | |
285 | 273 | }); |
286 | 274 | }, |
287 | - toRefundment(){ | |
275 | + toRefundment() { | |
288 | 276 | uni.navigateTo({ |
289 | 277 | url: '../refundment/refundment', |
290 | 278 | success: res => {}, |
... | ... | @@ -292,162 +280,184 @@ |
292 | 280 | complete: () => {} |
293 | 281 | }); |
294 | 282 | }, |
295 | - toOrderInfo(status,payId){ | |
296 | - console.log(status,payId) | |
297 | - switch(status){ | |
283 | + toOrderInfo(status, payId) { | |
284 | + console.log(status, payId) | |
285 | + switch (status) { | |
298 | 286 | // 0待付款 1待收货 2已收货 3 已评价 |
299 | - case '0': | |
300 | - uni.navigateTo({ | |
301 | - url:`../myOrderPaying/myOrderPaying?status=`+status+`&payId=`+payId, | |
302 | - fail(errMsg) { | |
303 | - console.log(errMsg) | |
304 | - } | |
305 | - }) | |
306 | - break; | |
307 | - case '1': | |
287 | + case '100000': | |
308 | 288 | uni.navigateTo({ |
309 | - url:`../myOrderPaying/myOrderPaying?status=`+status+`&payId=`+payId, | |
289 | + url: `../myOrderPaying/myOrderPaying?status=` + status + `&payId=` + payId, | |
310 | 290 | fail(errMsg) { |
311 | 291 | console.log(errMsg) |
312 | 292 | } |
313 | 293 | }) |
314 | - | |
315 | - break; | |
316 | - case '2' || '3': | |
294 | + break; | |
295 | + case '200000': | |
317 | 296 | uni.navigateTo({ |
318 | - url:`../myOrderPaying/myOrderPaying?status=`+status+`&payId=`+payId, | |
297 | + url: `../myOrderPaying/myOrderPaying?status=` + status + `&payId=` + payId, | |
319 | 298 | fail(errMsg) { |
320 | 299 | console.log(errMsg) |
321 | 300 | } |
322 | 301 | }) |
323 | - break; | |
302 | + | |
303 | + break; | |
304 | + // case '200000' || '300000': | |
305 | + // uni.navigateTo({ | |
306 | + // url: `../myOrderPaying/myOrderPaying?status=` + status + `&payId=` + payId, | |
307 | + // fail(errMsg) { | |
308 | + // console.log(errMsg) | |
309 | + // } | |
310 | + // }) | |
311 | + // break; | |
324 | 312 | default: |
325 | - break; | |
326 | - | |
313 | + break; | |
314 | + | |
327 | 315 | } |
328 | 316 | } |
329 | 317 | } |
330 | 318 | } |
331 | - | |
332 | 319 | </script> |
333 | 320 | |
334 | 321 | <style lang="scss"> |
335 | -.card { | |
336 | - width: 670rpx; | |
337 | - // height: 478rpx; | |
338 | - background: #ffffff; | |
339 | - box-shadow: 0 0 10px 0 rgba(177, 128, 128, 0.06); | |
340 | - border-radius: 8px; | |
341 | - border-radius: 8px; | |
342 | - margin-top: 20rpx; | |
343 | - padding: 40rpx; | |
344 | - box-sizing: border-box; | |
345 | - .cardHeader { | |
346 | - width: 100%; | |
347 | - height: 40rpx; | |
348 | - display: flex; | |
349 | - justify-content: space-between; | |
350 | - align-items: center; | |
351 | - .orderId { | |
352 | - font-size: 12px; | |
353 | - color: #999999; | |
354 | - } | |
355 | - .orderType { | |
356 | - font-size: 14px; | |
357 | - color: #ff6b4a; | |
358 | - } | |
359 | - } | |
360 | - .orderCardInfo { | |
361 | - width: 100%; | |
362 | - height: 188rpx; | |
363 | - display: flex; | |
364 | - flex-direction: row; | |
365 | - justify-content: space-between; | |
366 | - align-items: center; | |
367 | - margin-top: 40rpx; | |
368 | - image { | |
369 | - height: 188rpx; | |
370 | - width: 188rpx; | |
371 | - margin-right: 24rpx; | |
372 | - } | |
373 | - .infoText { | |
374 | - display: flex; | |
375 | - flex-direction: column; | |
376 | - justify-content: space-between; | |
377 | - align-items: flex-start; | |
378 | - height: 188rpx; | |
379 | - width: 368rpx; | |
380 | - } | |
381 | - .orderName { | |
382 | - font-size: 14px; | |
383 | - color: #333333; | |
384 | - display: -webkit-box; | |
385 | - overflow: hidden; | |
386 | - -webkit-box-orient: vertical; | |
387 | - -webkit-line-clamp: 2; | |
388 | - } | |
389 | - .orderDescrib { | |
390 | - font-size: 12px; | |
391 | - color: #999999; | |
392 | - display: -webkit-box; | |
393 | - overflow: hidden; | |
394 | - -webkit-box-orient: vertical; | |
395 | - -webkit-line-clamp: 2; | |
396 | - } | |
397 | - .infoText-bottom { | |
398 | - display: flex; | |
399 | - flex-direction: row; | |
400 | - justify-content: flex-start; | |
401 | - align-items: center; | |
402 | - width: 100%; | |
403 | - .markPrice { | |
404 | - font-size: 14px; | |
405 | - color: #ff6b4a; | |
406 | - margin-right: 20rpx; | |
407 | - } | |
408 | - .buy-num { | |
409 | - font-size: 12px; | |
410 | - color: #999999; | |
411 | - } | |
412 | - } | |
413 | - } | |
414 | - .payPrice { | |
415 | - text-align: right; | |
416 | - margin: 20rpx 0; | |
417 | - font-size: 14px; | |
418 | - color: #333333; | |
419 | - .priceNum { | |
420 | - font-size: 14px; | |
421 | - color: #ff6b4a; | |
422 | - } | |
423 | - } | |
424 | - .btns { | |
425 | - display: flex; | |
426 | - justify-content: flex-end; | |
427 | - align-items: center; | |
428 | - .btn-type1 { | |
429 | - height: 48rpx; | |
430 | - width: 156rpx; | |
431 | - border: 1px solid #ff6b4a; | |
432 | - border-radius: 12px; | |
433 | - border-radius: 12px; | |
434 | - text-align: center; | |
435 | - line-height: 48rpx; | |
436 | - font-size: 12px; | |
437 | - color: #ff6b4a; | |
438 | - } | |
439 | - .btn-type2 { | |
440 | - height: 48rpx; | |
441 | - width: 140rpx; | |
442 | - background: #ff6b4a; | |
443 | - border-radius: 12px; | |
444 | - border-radius: 12px; | |
445 | - text-align: center; | |
446 | - line-height: 48rpx; | |
447 | - font-size: 12px; | |
448 | - color: #ffffff; | |
449 | - margin-left: 20rpx; | |
450 | - } | |
451 | - } | |
452 | -} | |
453 | -</style> | |
322 | + .card { | |
323 | + width: 670rpx; | |
324 | + // height: 478rpx; | |
325 | + background: #ffffff; | |
326 | + box-shadow: 0 0 10px 0 rgba(177, 128, 128, 0.06); | |
327 | + border-radius: 8px; | |
328 | + border-radius: 8px; | |
329 | + margin-top: 20rpx; | |
330 | + padding: 40rpx; | |
331 | + box-sizing: border-box; | |
332 | + | |
333 | + .cardHeader { | |
334 | + width: 100%; | |
335 | + height: 40rpx; | |
336 | + display: flex; | |
337 | + justify-content: space-between; | |
338 | + align-items: center; | |
339 | + | |
340 | + .orderId { | |
341 | + font-size: 12px; | |
342 | + color: #999999; | |
343 | + } | |
344 | + | |
345 | + .orderType { | |
346 | + font-size: 14px; | |
347 | + color: #ff6b4a; | |
348 | + } | |
349 | + } | |
350 | + | |
351 | + .orderCardInfo { | |
352 | + width: 100%; | |
353 | + height: 188rpx; | |
354 | + display: flex; | |
355 | + flex-direction: row; | |
356 | + border: 1px #000 solid; | |
357 | + justify-content: space-between; | |
358 | + align-items: center; | |
359 | + margin-top: 40rpx; | |
360 | + | |
361 | + image { | |
362 | + height: 188rpx; | |
363 | + width: 188rpx; | |
364 | + margin-right: 24rpx; | |
365 | + } | |
366 | + | |
367 | + .infoText { | |
368 | + display: flex; | |
369 | + flex-direction: column; | |
370 | + justify-content: space-between; | |
371 | + align-items: flex-start; | |
372 | + height: 188rpx; | |
373 | + width: 368rpx; | |
374 | + } | |
375 | + | |
376 | + .orderName { | |
377 | + font-size: 14px; | |
378 | + color: #333333; | |
379 | + display: -webkit-box; | |
380 | + overflow: hidden; | |
381 | + -webkit-box-orient: vertical; | |
382 | + -webkit-line-clamp: 2; | |
383 | + } | |
384 | + | |
385 | + .orderDescrib { | |
386 | + font-size: 12px; | |
387 | + color: #999999; | |
388 | + display: -webkit-box; | |
389 | + overflow: hidden; | |
390 | + -webkit-box-orient: vertical; | |
391 | + -webkit-line-clamp: 2; | |
392 | + } | |
393 | + | |
394 | + .infoText-bottom { | |
395 | + display: flex; | |
396 | + flex-direction: row; | |
397 | + justify-content: flex-start; | |
398 | + align-items: center; | |
399 | + width: 100%; | |
400 | + | |
401 | + .markPrice { | |
402 | + font-size: 14px; | |
403 | + color: #ff6b4a; | |
404 | + margin-right: 20rpx; | |
405 | + } | |
406 | + | |
407 | + .buy-num { | |
408 | + font-size: 12px; | |
409 | + color: #999999; | |
410 | + } | |
411 | + } | |
412 | + } | |
413 | + | |
414 | + .payPrice { | |
415 | + text-align: right; | |
416 | + margin: 20rpx 0; | |
417 | + font-size: 14px; | |
418 | + color: #333333; | |
419 | + | |
420 | + .priceNum { | |
421 | + font-size: 14px; | |
422 | + color: #ff6b4a; | |
423 | + } | |
424 | + } | |
425 | + | |
426 | + .btns { | |
427 | + display: flex; | |
428 | + justify-content: flex-end; | |
429 | + // justify-content: justify-content-between; | |
430 | + align-items: center; | |
431 | + margin: 10rpx; | |
432 | + | |
433 | + // margin-left: auto; | |
434 | + // border: 1px solid #000; | |
435 | + .btn-type1 { | |
436 | + height: 48rpx; | |
437 | + width: 156rpx; | |
438 | + border: 1px solid #ff6b4a; | |
439 | + // border: 1px solid #000; | |
440 | + border-radius: 12px; | |
441 | + border-radius: 12px; | |
442 | + text-align: center; | |
443 | + line-height: 48rpx; | |
444 | + font-size: 12px; | |
445 | + color: #ff6b4a; | |
446 | + } | |
447 | + | |
448 | + .btn-type2 { | |
449 | + height: 48rpx; | |
450 | + width: 140rpx; | |
451 | + background: #ff6b4a; | |
452 | + // border: 1px solid #000; | |
453 | + border-radius: 12px; | |
454 | + border-radius: 12px; | |
455 | + text-align: center; | |
456 | + line-height: 48rpx; | |
457 | + font-size: 12px; | |
458 | + color: #ffffff; | |
459 | + margin-left: 20rpx; | |
460 | + } | |
461 | + } | |
462 | + } | |
463 | +</style> | ... | ... |
src/pages/myOrder/myOrder.vue
1 | 1 | <template> |
2 | - <view class="content"> | |
3 | - <view class="header"> | |
4 | - <!-- 搜索--> | |
5 | - <!-- <view class="searchBar"> | |
6 | - <icon class="searchIcon" type="search" size="14"></icon> | |
7 | - <input class="searchIpt" placeholder="搜索订单关键字..." confirm-type="search"/> | |
8 | - </view> --> | |
9 | - <view class="screenBar"> | |
10 | - <view | |
11 | - v-for="item in screenItems" | |
12 | - :key="item.current" | |
13 | - @click="onClickItem(item.current)" | |
14 | - > | |
15 | - <view | |
16 | - class="screenItem" | |
17 | - v-bind:class="{ active: current === item.current }" | |
18 | - >{{ item.text }}</view> | |
19 | - </view> | |
20 | - </view> | |
21 | - </view> | |
22 | - <view class="orderList"> | |
23 | - <view | |
24 | - v-for="(order) in orderList" | |
25 | - :key="order.pay_id" | |
26 | - > | |
27 | - <OrderCard | |
28 | - :order="order" | |
29 | - :current="current" | |
30 | - v-if="order.order_info !== null" | |
31 | - ></OrderCard> | |
32 | - </view> | |
33 | - </view> | |
34 | - <view class="footer">没有更多订单了,去商城看看吧~</view> | |
35 | - </view> | |
2 | + <view class="content"> | |
3 | + <view class="header"> | |
4 | + <!-- 搜索--> | |
5 | + <view class="searchBar"> | |
6 | + <icon class="searchIcon" type="search" size="14"></icon> | |
7 | + <input class="searchIpt" placeholder="搜索订单关键字..." confirm-type="search" /> | |
8 | + </view> | |
9 | + <view class="screenBar"> | |
10 | + <view v-for="item in screenItems" :key="item.current" @click="onClickItem(item.current)"> | |
11 | + <view class="screenItem" v-bind:class="{ active: current === item.current }">{{ item.text }}</view> | |
12 | + </view> | |
13 | + </view> | |
14 | + </view> | |
15 | + <view class="orderList"> | |
16 | + <view v-for="(order) in orderList" :key="order.order_id"> | |
17 | + <OrderCard :order="order" :current="current" v-if="order.order_info !== null"></OrderCard> | |
18 | + </view> | |
19 | + </view> | |
20 | + <view class="footer">没有更多订单了,去商城看看吧~</view> | |
21 | + </view> | |
36 | 22 | </template> |
37 | 23 | <script> |
38 | -import OrderCard from "./components/OrderCard.vue"; | |
39 | -import store from "@/store"; | |
24 | + import OrderCard from "./components/OrderCard.vue"; | |
25 | + import store from "@/store"; | |
40 | 26 | |
41 | -export default { | |
42 | - components: { | |
43 | - OrderCard: OrderCard | |
44 | - }, | |
45 | - data() { | |
46 | - return { | |
47 | - // 顶部筛选项 | |
48 | - screenItems: [ | |
49 | - { current: "10", text: "全部" }, | |
50 | - { current: "0", text: "待付款" }, | |
51 | - { current: "1", text: "待收货" }, | |
52 | - { current: "2", text: "已完成" } | |
53 | - // {current:"3",text:'已评价'}, | |
54 | - // {current:"4",text:'退款'}, | |
55 | - ], | |
56 | - // 当前所在item 默认10-->全部 | |
57 | - current: "10" | |
58 | - }; | |
59 | - }, | |
27 | + export default { | |
28 | + components: { | |
29 | + OrderCard: OrderCard | |
30 | + }, | |
31 | + data() { | |
32 | + return { | |
33 | + // 顶部筛选项 | |
34 | + screenItems: [{ | |
35 | + current: "0", | |
36 | + text: "全部" | |
37 | + }, | |
38 | + { | |
39 | + current: "100000", | |
40 | + text: "待付款" | |
41 | + }, | |
42 | + { | |
43 | + current: "200000", | |
44 | + text: "待收货" | |
45 | + }, | |
46 | + { | |
47 | + current: "300000", | |
48 | + text: "已完成" | |
49 | + }, { | |
50 | + current: "400000", | |
51 | + text: '已评价' | |
52 | + }, | |
53 | + { | |
54 | + current: "500000", | |
55 | + text: '退款' | |
56 | + }, | |
57 | + ], | |
58 | + // 当前所在item 默认10-->全部 | |
59 | + current: "100000" | |
60 | + }; | |
61 | + }, | |
60 | 62 | |
61 | -onShow() { | |
62 | - store.dispatch("myOrder/getList", { | |
63 | - way: "" | |
64 | - }); | |
65 | -}, | |
66 | - onLoad: function(option) { | |
67 | - // 获取订单列表 | |
68 | - // store.dispatch("myOrder/getList", { | |
69 | - // way: "" | |
70 | - // }); | |
71 | - // 从user过来传的status,给current,以显示对应item | |
72 | - this.current = option.status; | |
73 | - }, | |
74 | - computed: { | |
75 | - orderList() { | |
76 | - console.log('orderList', this.$store.state.myOrder.orderList); | |
77 | - return this.$store.state.myOrder.orderList; | |
78 | - } | |
79 | - }, | |
80 | - methods: { | |
81 | - // tab点击事件 | |
82 | - onClickItem(e) { | |
83 | - if (this.current !== e) { | |
84 | - this.current = e; | |
85 | - } | |
86 | - } | |
87 | - } | |
88 | -}; | |
63 | + onShow() { | |
64 | + store.dispatch("myOrder/getList", { | |
65 | + way: "" | |
66 | + }); | |
67 | + }, | |
68 | + onLoad: function(option) { | |
69 | + // 获取订单列表 | |
70 | + // store.dispatch("myOrder/getList", { | |
71 | + // way: "" | |
72 | + // }); | |
73 | + // 从user过来传的status,给current,以显示对应item | |
74 | + this.current = option.status; | |
75 | + }, | |
76 | + computed: { | |
77 | + orderList() { | |
78 | + console.log('orderList', this.$store.state.myOrder.orderList); | |
79 | + return this.$store.state.myOrder.orderList; | |
80 | + } | |
81 | + }, | |
82 | + methods: { | |
83 | + // tab点击事件 | |
84 | + onClickItem(e) { | |
85 | + if (this.current !== e) { | |
86 | + this.current = e; | |
87 | + } | |
88 | + } | |
89 | + } | |
90 | + }; | |
89 | 91 | </script> |
90 | 92 | |
91 | 93 | <style lang="scss"> |
92 | -.content { | |
93 | - display: flex; | |
94 | - flex-direction: column; | |
95 | - align-items: center; | |
96 | - background-color: #f7f6f6; | |
97 | - min-height: 100vh; | |
98 | - .header { | |
99 | - background-color: #ffffff; | |
100 | - width: 100%; | |
101 | - // height: 232rpx; | |
102 | - padding: 20rpx 40rpx 16rpx 40rpx; | |
103 | - box-sizing: border-box; | |
104 | - position: fixed; | |
105 | - top: 0; | |
106 | - left: 0; | |
107 | - // .searchBar { | |
108 | - // width: 670rpx; | |
109 | - // display: flex; | |
110 | - // justify-content: center; | |
111 | - // align-items: center; | |
112 | - // box-sizing: border-box; | |
113 | - // padding: 0rpx 16rpx; | |
114 | - // border: 1px solid #ff6b4a; | |
115 | - // border-radius: 8rpx; | |
116 | - // background-color: #ffffff; | |
117 | - // } | |
94 | + .content { | |
95 | + display: flex; | |
96 | + flex-direction: column; | |
97 | + align-items: center; | |
98 | + background-color: #f7f6f6; | |
99 | + min-height: 100vh; | |
118 | 100 | |
119 | - .screenBar { | |
120 | - width: 670rpx; | |
121 | - // height: 110rpx; | |
122 | - height: 70rpx; | |
123 | - display: flex; | |
124 | - flex-direction: row; | |
125 | - justify-content: space-between; | |
126 | - align-items: center; | |
127 | - color: #333333; | |
128 | - font-size: 32rpx; | |
129 | - } | |
130 | - .screenItem { | |
131 | - height: 50rpx; | |
132 | - font-size: 32rpx; | |
133 | - color: #333333; | |
134 | - display: flex; | |
135 | - justify-content: center; | |
136 | - align-items: center; | |
137 | - transition: all 0.2s; | |
138 | - } | |
139 | - .active { | |
140 | - // font-size: 34rpx; | |
141 | - color: #ec5d3b; | |
142 | - } | |
143 | - .searchIpt { | |
144 | - height: 68rpx; | |
145 | - width: 670rpx; | |
146 | - padding: 16rpx; | |
147 | - font-size: 28rpx; | |
148 | - box-sizing: border-box; | |
149 | - } | |
150 | - } | |
151 | - .orderList { | |
152 | - // margin-top: 232rpx; | |
153 | - margin-top: 132rpx; | |
154 | - } | |
155 | - .footer { | |
156 | - font-size: 14px; | |
157 | - color: #b8b8b8; | |
158 | - margin: 40rpx 0; | |
159 | - } | |
160 | -} | |
161 | -</style> | |
101 | + .header { | |
102 | + background-color: #ffffff; | |
103 | + width: 100%; | |
104 | + // height: 232rpx; | |
105 | + padding: 20rpx 40rpx 16rpx 40rpx; | |
106 | + box-sizing: border-box; | |
107 | + position: fixed; | |
108 | + top: 0; | |
109 | + left: 0; | |
110 | + // .searchBar { | |
111 | + // width: 670rpx; | |
112 | + // display: flex; | |
113 | + // justify-content: center; | |
114 | + // align-items: center; | |
115 | + // box-sizing: border-box; | |
116 | + // padding: 0rpx 16rpx; | |
117 | + // border: 1px solid #ff6b4a; | |
118 | + // border-radius: 8rpx; | |
119 | + // background-color: #ffffff; | |
120 | + // } | |
121 | + | |
122 | + .screenBar { | |
123 | + width: 670rpx; | |
124 | + // height: 110rpx; | |
125 | + height: 70rpx; | |
126 | + display: flex; | |
127 | + flex-direction: row; | |
128 | + justify-content: space-between; | |
129 | + align-items: center; | |
130 | + color: #333333; | |
131 | + font-size: 32rpx; | |
132 | + } | |
133 | + | |
134 | + .screenItem { | |
135 | + height: 50rpx; | |
136 | + font-size: 32rpx; | |
137 | + color: #333333; | |
138 | + display: flex; | |
139 | + justify-content: center; | |
140 | + align-items: center; | |
141 | + transition: all 0.2s; | |
142 | + } | |
143 | + | |
144 | + .active { | |
145 | + // font-size: 34rpx; | |
146 | + color: #ec5d3b; | |
147 | + } | |
148 | + | |
149 | + .searchIpt { | |
150 | + height: 68rpx; | |
151 | + width: 670rpx; | |
152 | + padding: 16rpx; | |
153 | + font-size: 28rpx; | |
154 | + box-sizing: border-box; | |
155 | + } | |
156 | + } | |
157 | + | |
158 | + .orderList { | |
159 | + // margin-top: 232rpx; | |
160 | + margin-top: 132rpx; | |
161 | + } | |
162 | + | |
163 | + .footer { | |
164 | + font-size: 14px; | |
165 | + color: #b8b8b8; | |
166 | + margin: 40rpx 0; | |
167 | + } | |
168 | + } | |
169 | +</style> | ... | ... |
src/pages/user/user.vue
... | ... | @@ -77,7 +77,7 @@ |
77 | 77 | ></image> |
78 | 78 | </view> |
79 | 79 | <view class="myOrder"> |
80 | - <view class="orderHeader" @click="toMyOrder('10')" > | |
80 | + <view class="orderHeader" @click="toMyOrder('100000')" > | |
81 | 81 | <text>我的订单</text> |
82 | 82 | <view class="btn"> |
83 | 83 | 全部 |
... | ... | @@ -90,7 +90,7 @@ |
90 | 90 | <view class="orderBody"> |
91 | 91 | <view |
92 | 92 | class="item waitPay" |
93 | - @click="toMyOrder('0')" | |
93 | + @click="toMyOrder('100000')" | |
94 | 94 | > |
95 | 95 | <image |
96 | 96 | src="../../static/img/user/waitDeliver.png" |
... | ... | @@ -100,7 +100,7 @@ |
100 | 100 | </view> |
101 | 101 | <view |
102 | 102 | class="item waitDeliver" |
103 | - @click="toMyOrder('1')" | |
103 | + @click="toMyOrder('200000')" | |
104 | 104 | > |
105 | 105 | <image |
106 | 106 | src="../../static/img/user/waitPay.png" |
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 | </view> |
111 | 111 | <view |
112 | 112 | class="item waitReceive" |
113 | - @click="toMyOrder('2')" | |
113 | + @click="toMyOrder('300000')" | |
114 | 114 | > |
115 | 115 | <image |
116 | 116 | src="../../static/img/user/waitReceive.png" | ... | ... |
src/store/modules/address.js
... | ... | @@ -36,11 +36,12 @@ const actions = { |
36 | 36 | }, |
37 | 37 | })) |
38 | 38 | }, |
39 | - list({ commit }) { | |
39 | + list({ commit },param) { | |
40 | 40 | request({ |
41 | 41 | url: addressList, |
42 | + data: param, | |
42 | 43 | success: (res) => { |
43 | - commit('LIST', res.data.data) | |
44 | + commit('LIST', res.data.data.list) | |
44 | 45 | }, |
45 | 46 | fail: () => { |
46 | 47 | uni.showModal({ | ... | ... |
src/store/modules/cart.js
src/store/modules/details.js
1 | -import urlAlias from '../url' | |
2 | -import request from '../request' | |
3 | - | |
4 | -const { | |
5 | - read, | |
6 | - cartList, | |
7 | - makePost, | |
8 | -} = urlAlias | |
9 | - | |
10 | -const state = { | |
11 | - // 为配合参数选择框 | |
12 | - goodInfo: {}, | |
13 | - // 轮播图 | |
14 | - carousel: [ | |
15 | - '/static/img/detail/d9.png', | |
16 | - ], | |
17 | - // 商品基本信息 | |
18 | - goodsInfo: { | |
19 | - name: '暂无名称', | |
20 | - price: '暂无价格', | |
21 | - discountPrice: undefined, | |
22 | - tradeNumber: undefined, | |
23 | - }, | |
24 | - // 商品介绍 | |
25 | - tag: { | |
26 | - prod_tag_style: [{ | |
27 | - label: '青春学子风', | |
28 | - value: '54', | |
29 | - }], | |
30 | - }, | |
31 | - // 规格参数 | |
32 | - specification: [ | |
33 | - { key: 'frame_width', img: '/static/img/detail/d2.png', standard: '框架宽', slength: '139mm' }, | |
34 | - { key: 'glass_width', img: '/static/img/detail/d3.png', standard: '镜片宽', slength: '51mm' }, | |
35 | - { key: 'glass_height', img: '/static/img/detail/d4.png', standard: '镜片高', slength: '45mm' }, | |
36 | - { key: 'nose_width', img: '/static/img/detail/d5.png', standard: '鼻架宽', slength: '19mm' }, | |
37 | - { key: 'leg_long', img: '/static/img/detail/d6.png', standard: '框架耳长', slength: '138mm' }, | |
38 | - { key: 'weight', img: '/static/img/detail/d7.png', standard: '框架重', slength: '19克(grams)' }, | |
39 | - ], | |
40 | - // 评价 | |
41 | - evaluate: { | |
42 | - rate: '100%', | |
43 | - star: 5, | |
44 | - tag: [{ name: '价格实惠' }], | |
45 | - }, | |
46 | - // 商品详情 | |
47 | - more: '', | |
48 | - // 购物车数目 | |
49 | - cartNumber: 0, | |
50 | - // skuList | |
51 | - skuList: [], | |
52 | - postUrl: 'https://api.glass.xiuyetang.com/adv_pic/428_0_7.png', | |
53 | -} | |
54 | - | |
55 | -const mutations = { | |
56 | - INIT: (state, { goodInfo, carousel, goodsInfo, tag, specification, evaluate, more, skuList }) => { | |
57 | - state.goodInfo = goodInfo | |
58 | - state.carousel = carousel | |
59 | - state.goodsInfo = goodsInfo | |
60 | - state.tag = tag | |
61 | - state.specification = specification | |
62 | - state.evaluate = evaluate | |
63 | - state.more = more | |
64 | - state.skuList = skuList | |
65 | - // state.current = 1 | |
66 | - }, | |
67 | - CART: (state, number) => { | |
68 | - state.cartNumber = number | |
69 | - }, | |
70 | - POST: (state, url) => { | |
71 | - state.postUrl = url | |
72 | - }, | |
73 | -} | |
74 | - | |
75 | -const actions = { | |
76 | - // 获取详情 | |
77 | - details({ commit, rootState }, param) { | |
78 | - // console.log('paramparamparamparamparam', param); | |
79 | - return new Promise((resolve, reject) => request({ | |
80 | - url: read, | |
81 | - data: param, | |
82 | - success: ({ data: { data } }) => { | |
83 | - // console.log('details.details.details.details.details.data.tag', data) | |
84 | - console.log('this.statethis.statethis.statethis.state', this.state) | |
85 | - // return; | |
86 | - // 规格参数设置 | |
87 | - const specification=[]; | |
88 | - // specification[0].slength=1; | |
89 | - const parameter = { | |
90 | - frame_weight: data.frame_weight, | |
91 | - frame_width: data.frame_width, | |
92 | - glass_height: data.glass_height, | |
93 | - nose_width: data.nose_bridge, | |
94 | - lens_width:data.lens_width, | |
95 | - leg_long: data.leg_temple, | |
96 | - weight: data.weight, | |
97 | - } | |
98 | - for (let index = 0; index < specification.length; index++) { | |
99 | - if (specification[index].key !== 'weight') { | |
100 | - specification[index].slength = `${parameter[specification[index].key]}mm` | |
101 | - } else { | |
102 | - specification[index].slength = `${parameter[specification[index].key]}克(grams)` | |
103 | - } | |
104 | - } | |
105 | - | |
106 | - commit('INIT', { | |
107 | - goodInfo: data, | |
108 | - skuList: data.sku, | |
109 | - carousel: data.sku[0].sku_pic_arr_http, | |
110 | - goodsInfo: { | |
111 | - name: data.shop_wood_name, | |
112 | - price: data.sales_price, | |
113 | - discountPrice: data.sales_price - Number(0), | |
114 | - tradeNumber: data.sales_num, | |
115 | - }, | |
116 | - tag: data.tag_defined, | |
117 | - specification:[ | |
118 | - { key: 'frame_width', img: '/static/img/detail/d2.png', standard: '框架宽', slength: '139mm' }, | |
119 | - { key: 'glass_width', img: '/static/img/detail/d3.png', standard: '镜片宽', slength: '51mm' }, | |
120 | - { key: 'glass_height', img: '/static/img/detail/d4.png', standard: '镜片高', slength: '45mm' }, | |
121 | - { key: 'nose_width', img: '/static/img/detail/d5.png', standard: '鼻架宽', slength: '19mm' }, | |
122 | - { key: 'leg_long', img: '/static/img/detail/d6.png', standard: '框架耳长', slength: '138mm' }, | |
123 | - { key: 'weight', img: '/static/img/detail/d7.png', standard: '框架重', slength: '19克(grams)' }, | |
124 | - ], | |
125 | - evaluate: { | |
126 | - rate: 5, | |
127 | - tag: data.judge.list, | |
128 | - // star: parseInt(5 * Number(data.judgeInfo.good.slice(0, -1)) / 100), | |
129 | - star: 5, | |
130 | - }, | |
131 | - // eslint-disable-next-line | |
132 | - // more: data.prodIntro1.replace(/\<img/gi, '<img style="max-width:100%;height:auto"'), | |
133 | - more: data.shop_wood_desc_rich_text, | |
134 | - // current:1 | |
135 | - }) | |
136 | - resolve(data) | |
137 | - }, | |
138 | - fail: (res) => { | |
139 | - console.log('fail status ===>', res) | |
140 | - }, | |
141 | - })) | |
142 | - }, | |
143 | - // 获取购物车列表 | |
144 | - getCartNumber({ commit }, param) { | |
145 | - return new Promise((resolve) => request({ | |
146 | - url: cartList, | |
147 | - data: param, | |
148 | - success: ({ data: { data } }) => { | |
149 | - let number = 0 | |
150 | - for (let index = 0; index < data.length; index++) { | |
151 | - number += Number(data[index].num) | |
152 | - } | |
153 | - commit('CART', number) | |
154 | - }, | |
155 | - })) | |
156 | - }, | |
157 | - // 生成分享海报 | |
158 | - post({ commit }, param) { | |
159 | - return new Promise((resolve) => request({ | |
160 | - url: makePost, | |
161 | - data: param, | |
162 | - success: ({ data }) => { | |
163 | - commit('POST', data.data) | |
164 | - resolve() | |
165 | - }, | |
166 | - })) | |
167 | - }, | |
168 | -} | |
169 | - | |
170 | -export default { | |
171 | - namespaced: true, | |
172 | - state, | |
173 | - mutations, | |
174 | - actions, | |
1 | +import urlAlias from '../url' | |
2 | +import request from '../request' | |
3 | + | |
4 | +const { | |
5 | + read, | |
6 | + cartList, | |
7 | + makePost, | |
8 | +} = urlAlias | |
9 | + | |
10 | +const state = { | |
11 | + // 为配合参数选择框 | |
12 | + goodInfo: {}, | |
13 | + // 轮播图 | |
14 | + carousel: [ | |
15 | + '/static/img/detail/d9.png', | |
16 | + ], | |
17 | + // 商品基本信息 | |
18 | + goodsInfo: { | |
19 | + name: '暂无名称', | |
20 | + price: '暂无价格', | |
21 | + discountPrice: undefined, | |
22 | + tradeNumber: undefined, | |
23 | + }, | |
24 | + // 商品介绍 | |
25 | + // tag: { | |
26 | + // prod_tag_style: [{ | |
27 | + // label: '青春学子风', | |
28 | + // value: '54', | |
29 | + // }], | |
30 | + // }, | |
31 | + // 规格参数 | |
32 | + specification: [{ | |
33 | + key: 'frame_width', | |
34 | + img: '/static/img/detail/d2.png', | |
35 | + standard: '框架宽', | |
36 | + slength: '139mm' | |
37 | + }, | |
38 | + { | |
39 | + key: 'glass_width', | |
40 | + img: '/static/img/detail/d3.png', | |
41 | + standard: '镜片宽', | |
42 | + slength: '51mm' | |
43 | + }, | |
44 | + { | |
45 | + key: 'glass_height', | |
46 | + img: '/static/img/detail/d4.png', | |
47 | + standard: '镜片高', | |
48 | + slength: '45mm' | |
49 | + }, | |
50 | + { | |
51 | + key: 'nose_width', | |
52 | + img: '/static/img/detail/d5.png', | |
53 | + standard: '鼻架宽', | |
54 | + slength: '19mm' | |
55 | + }, | |
56 | + { | |
57 | + key: 'leg_long', | |
58 | + img: '/static/img/detail/d6.png', | |
59 | + standard: '框架耳长', | |
60 | + slength: '138mm' | |
61 | + }, | |
62 | + { | |
63 | + key: 'weight', | |
64 | + img: '/static/img/detail/d7.png', | |
65 | + standard: '框架重', | |
66 | + slength: '19克(grams)' | |
67 | + }, | |
68 | + ], | |
69 | + Tag: { | |
70 | + Age: [], | |
71 | + Colour: [], | |
72 | + Eyeglasses: [], | |
73 | + Gender: [], | |
74 | + Hinge: [], | |
75 | + Material: [], | |
76 | + Rim: [], | |
77 | + Shape: [], | |
78 | + Style: [], | |
79 | + }, | |
80 | + // 评价 | |
81 | + evaluate: { | |
82 | + rate: '100%', | |
83 | + star: 5, | |
84 | + tag: [{ | |
85 | + name: '价格实惠' | |
86 | + }], | |
87 | + }, | |
88 | + // 商品详情 | |
89 | + more: '', | |
90 | + // 购物车数目 | |
91 | + cartNumber: 0, | |
92 | + // skuList | |
93 | + skuList: [], | |
94 | + postUrl: 'https://api.glass.xiuyetang.com/adv_pic/428_0_7.png', | |
95 | +} | |
96 | + | |
97 | +const mutations = { | |
98 | + INIT: (state, { | |
99 | + goodInfo, | |
100 | + carousel, | |
101 | + goodsInfo, | |
102 | + Tag, | |
103 | + specification, | |
104 | + evaluate, | |
105 | + more, | |
106 | + skuList | |
107 | + }) => { | |
108 | + state.goodInfo = goodInfo | |
109 | + state.carousel = carousel | |
110 | + state.goodsInfo = goodsInfo | |
111 | + state.Tag = Tag | |
112 | + state.specification = specification | |
113 | + state.evaluate = evaluate | |
114 | + state.more = more | |
115 | + state.skuList = skuList | |
116 | + // state.current = 1 | |
117 | + }, | |
118 | + CART: (state, number) => { | |
119 | + state.cartNumber = number | |
120 | + }, | |
121 | + POST: (state, url) => { | |
122 | + state.postUrl = url | |
123 | + }, | |
124 | +} | |
125 | + | |
126 | +const actions = { | |
127 | + // 获取详情 | |
128 | + details({ | |
129 | + commit, | |
130 | + rootState | |
131 | + }, param) { | |
132 | + // console.log('paramparamparamparamparam', param); | |
133 | + return new Promise((resolve, reject) => request({ | |
134 | + url: read, | |
135 | + data: param, | |
136 | + success: ({ | |
137 | + data: { | |
138 | + data | |
139 | + } | |
140 | + }) => { | |
141 | + // console.log('======>>>>>>>>>>>>>>>>datadatadatadatadatadatadata<<<<<<<<<<<<<<<<<<<<<======', data) | |
142 | + // console.log('rootStaterootStaterootStaterootState', rootState.details) | |
143 | + const specification = rootState.details.specification == undefined ? [] : rootState | |
144 | + .details.specification; | |
145 | + specification[0].key = "frame_width"; | |
146 | + specification[0].slength = data.frame_width; | |
147 | + specification[1].key = "lens_width"; | |
148 | + specification[1].slength = data.lens_width; | |
149 | + specification[2].key = "glass_height"; | |
150 | + specification[2].slength = data.glass_height; | |
151 | + specification[3].key = "nose_width"; | |
152 | + specification[3].slength = data.nose_bridge; | |
153 | + specification[4].key = "leg_long"; | |
154 | + specification[4].slength = data.leg_temple; | |
155 | + specification[5].key = "weight"; | |
156 | + specification[5].slength = data.frame_weight; | |
157 | + | |
158 | + const parameter = { | |
159 | + frame_weight: data.frame_weight, | |
160 | + frame_width: data.frame_width, | |
161 | + glass_height: data.glass_height, | |
162 | + nose_width: data.nose_bridge, | |
163 | + lens_width: data.lens_width, | |
164 | + leg_long: data.leg_temple, | |
165 | + weight: data.frame_weight, | |
166 | + } | |
167 | + for (let index = 0; index < specification.length; index++) { | |
168 | + if (specification[index].key !== 'weight') { | |
169 | + specification[index].slength = `${parameter[specification[index].key]}mm` | |
170 | + } else { | |
171 | + if (parameter[specification[index].key] == 0) { | |
172 | + specification[index].slength = '未知重量' | |
173 | + } else { | |
174 | + specification[index].slength = `${parameter[specification[index].key]}克` | |
175 | + } | |
176 | + | |
177 | + } | |
178 | + } | |
179 | + | |
180 | + const Tag = data.tag_defined | |
181 | + if (Tag.Age == undefined || Tag.Age == null) { | |
182 | + Tag.Age = [] | |
183 | + } | |
184 | + console.log('TagTagTagTagTagTagTag=======', Tag); | |
185 | + commit('INIT', { | |
186 | + goodInfo: data, | |
187 | + skuList: data.sku, | |
188 | + carousel: data.sku[0].sku_pic_arr_http, | |
189 | + goodsInfo: { | |
190 | + name: data.shop_wood_name, | |
191 | + price: data.sales_price, | |
192 | + discountPrice: data.sales_price - Number(0), | |
193 | + tradeNumber: data.sales_num, | |
194 | + }, | |
195 | + Tag:Tag, | |
196 | + specification, | |
197 | + evaluate: { | |
198 | + rate: 5, | |
199 | + tag: data.judge.list, | |
200 | + // star: parseInt(5 * Number(data.judgeInfo.good.slice(0, -1)) / 100), | |
201 | + star: 5, | |
202 | + }, | |
203 | + // eslint-disable-next-line | |
204 | + // more: data.prodIntro1.replace(/\<img/gi, '<img style="max-width:100%;height:auto"'), | |
205 | + more: data.shop_wood_desc_rich_text, | |
206 | + // current:1 | |
207 | + }) | |
208 | + resolve(data) | |
209 | + }, | |
210 | + fail: (res) => { | |
211 | + console.log('fail status ===>', res) | |
212 | + }, | |
213 | + })) | |
214 | + }, | |
215 | + // 获取购物车列表 | |
216 | + getCartNumber({ | |
217 | + commit | |
218 | + }, param) { | |
219 | + return new Promise((resolve) => request({ | |
220 | + url: cartList, | |
221 | + data: param, | |
222 | + success: ({ | |
223 | + data: { | |
224 | + data | |
225 | + } | |
226 | + }) => { | |
227 | + let number = 0 | |
228 | + for (let index = 0; index < data.length; index++) { | |
229 | + number += Number(data[index].num) | |
230 | + } | |
231 | + commit('CART', number) | |
232 | + }, | |
233 | + })) | |
234 | + }, | |
235 | + // 生成分享海报 | |
236 | + post({ | |
237 | + commit | |
238 | + }, param) { | |
239 | + return new Promise((resolve) => request({ | |
240 | + url: makePost, | |
241 | + data: param, | |
242 | + success: ({ | |
243 | + data | |
244 | + }) => { | |
245 | + commit('POST', data.data) | |
246 | + resolve() | |
247 | + }, | |
248 | + })) | |
249 | + }, | |
250 | +} | |
251 | + | |
252 | +export default { | |
253 | + namespaced: true, | |
254 | + state, | |
255 | + mutations, | |
256 | + actions, | |
175 | 257 | } | ... | ... |
src/store/modules/myLoveList.js
... | ... | @@ -29,18 +29,18 @@ const actions = { |
29 | 29 | data: param, |
30 | 30 | success: (res) => { |
31 | 31 | // console.log(res.data); |
32 | - commit('INIT', res.data.data) | |
32 | + commit('INIT', res.data.data.list) | |
33 | 33 | }, |
34 | 34 | }) |
35 | 35 | }, |
36 | 36 | addMylove({ commit }, param) { |
37 | - console.log('myloveupdate-parm====>', param) | |
37 | + // console.log('myloveupdate-parm====>', param) | |
38 | 38 | return new Promise((resolve) => request({ |
39 | 39 | url: myloveadd, |
40 | 40 | data: param, |
41 | 41 | success: (res) => { |
42 | 42 | console.log('addMylove-parm====>', param) |
43 | - console.log(res.data) | |
43 | + // console.log(res.data) | |
44 | 44 | resolve(res.data) |
45 | 45 | // commit("ADD", args); |
46 | 46 | }, |
... | ... | @@ -52,7 +52,7 @@ const actions = { |
52 | 52 | data: param, |
53 | 53 | success: (res) => { |
54 | 54 | console.log('myloveupdate-parm====>', param) |
55 | - console.log(res) | |
55 | + // console.log(res) | |
56 | 56 | // commit("UPDATE", param); |
57 | 57 | }, |
58 | 58 | }) | ... | ... |
src/store/modules/myOrder.js
1 | -import urlAlias from '../url'; | |
2 | -import request from '../request'; | |
1 | +import urlAlias from '../url'; | |
2 | +import request from '../request'; | |
3 | + | |
4 | +const { | |
5 | + myOrderList | |
6 | +} = urlAlias | |
3 | 7 | |
4 | -const { | |
5 | - myOrderList | |
6 | -} = urlAlias | |
7 | - | |
8 | -// const data = { | |
9 | -// data: [ | |
10 | -// { | |
11 | -// finished_time: null, | |
12 | -// is_refound: "0", | |
13 | -// mch_id: "1436019502", | |
14 | -// money_of_dcw: "0", | |
15 | -// money_of_partner: "0", | |
16 | -// money_of_shop: "0", | |
17 | -// orderJudge: false, | |
18 | -// order_info: { | |
19 | -// address:{ | |
20 | -// cityName: "镇江市", | |
21 | -// countyName: "丹阳市", | |
22 | -// detailInfo: "延陵镇柳茹村卫生室附近秀野堂农业发展有限公司", | |
23 | -// errMsg: "chooseAddress:ok", | |
24 | -// nationalCode: "321181", | |
25 | -// postalCode: "212300", | |
26 | -// provinceName: "江苏省", | |
27 | -// telNumber: "15896379277", | |
28 | -// userName: "点餐汪客服", | |
29 | -// }, | |
30 | -// cartinfo:['11', '12'], | |
31 | -// keyname: "1_1587129366", | |
32 | -// lefttime: 179995, | |
33 | -// list:[ | |
34 | -// { | |
35 | -// cart_id: "11", | |
36 | -// imgUrl: "https://glass.xiuyetang.com//upload_jk/4/4_0_3FDA03.jpg", | |
37 | -// img_index_url: null, | |
38 | -// memo: "志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流,01-8701", | |
39 | -// mp_id: "1", | |
40 | -// nowPrice: 100, | |
41 | -// num: "2", | |
42 | -// oldPrice: "0", | |
43 | -// p_discount: "1", | |
44 | -// p_name: "01-8701志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流", | |
45 | -// p_root_index: "1", | |
46 | -// p_sale_price: "0", | |
47 | -// peopleName: "me", | |
48 | -// pics: '', | |
49 | -// pid: "4", | |
50 | -// sk_id: "38", | |
51 | -// }, | |
52 | -// ], | |
53 | -// orderDesc: "总共包括有:01-8701志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流在内的1件商品", | |
54 | -// total_fee: 100 | |
55 | -// }, | |
56 | -// partner_uid: "0", | |
57 | -// pay_cate: "2020", | |
58 | -// pay_id: "3", | |
59 | -// pay_time: "2020-04-17 21:16:12", | |
60 | -// pay_wood_desc: "在【非常戴镜】的微信付款凭证", | |
61 | -// pay_wood_id: "fcdj-1-1_1587129366", | |
62 | -// prepay_id: "wx172116124528226bf1a8adad1662456500", | |
63 | -// re_check_staus: "0", | |
64 | -// shopid: "0", | |
65 | -// split_userid: "0", | |
66 | -// status: "1", | |
67 | -// total_fee: "100", | |
68 | -// uid: "1", | |
69 | -// } | |
70 | -// ], | |
71 | -// msg: "订单列表", | |
72 | -// status: 0, | |
73 | -// } | |
74 | - | |
75 | -const state = { | |
76 | - orderList: [], | |
77 | -}; | |
78 | - | |
79 | -const mutations = { | |
80 | - INIT: (state, data) => { | |
81 | - state.orderList = data; | |
82 | - }, | |
83 | -}; | |
84 | - | |
85 | -const actions = { | |
86 | - getList({ | |
87 | - commit | |
88 | - }, param) { | |
89 | - request({ | |
90 | - url: myOrderList, | |
91 | - data: param, | |
92 | - success: (res) => { | |
93 | - console.log('myOrderList', res.data); | |
94 | - commit("INIT", res.data.data); | |
95 | - }, | |
96 | - }) | |
97 | - } | |
8 | +/* | |
9 | +const data = { | |
10 | + data: [ | |
11 | + { | |
12 | + finished_time: null, | |
13 | + is_refound: "0", | |
14 | + mch_id: "1436019502", | |
15 | + money_of_dcw: "0", | |
16 | + money_of_partner: "0", | |
17 | + money_of_shop: "0", | |
18 | + orderJudge: false, | |
19 | + order_info: { | |
20 | + address:{ | |
21 | + cityName: "镇江市", | |
22 | + countyName: "丹阳市", | |
23 | + detailInfo: "延陵镇柳茹村卫生室附近秀野堂农业发展有限公司", | |
24 | + errMsg: "chooseAddress:ok", | |
25 | + nationalCode: "321181", | |
26 | + postalCode: "212300", | |
27 | + provinceName: "江苏省", | |
28 | + telNumber: "15896379277", | |
29 | + userName: "点餐汪客服", | |
30 | + }, | |
31 | + cartinfo:['11', '12'], | |
32 | + keyname: "1_1587129366", | |
33 | + lefttime: 179995, | |
34 | + list:[ | |
35 | + { | |
36 | + cart_id: "11", | |
37 | + imgUrl: "https://glass.xiuyetang.com//upload_jk/4/4_0_3FDA03.jpg", | |
38 | + img_index_url: null, | |
39 | + memo: "志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流,01-8701", | |
40 | + mp_id: "1", | |
41 | + nowPrice: 100, | |
42 | + num: "2", | |
43 | + oldPrice: "0", | |
44 | + p_discount: "1", | |
45 | + p_name: "01-8701志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流", | |
46 | + p_root_index: "1", | |
47 | + p_sale_price: "0", | |
48 | + peopleName: "me", | |
49 | + pics: '', | |
50 | + pid: "4", | |
51 | + sk_id: "38", | |
52 | + }, | |
53 | + ], | |
54 | + orderDesc: "总共包括有:01-8701志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流在内的1件商品", | |
55 | + total_fee: 100 | |
56 | + }, | |
57 | + partner_uid: "0", | |
58 | + pay_cate: "2020", | |
59 | + pay_id: "3", | |
60 | + pay_time: "2020-04-17 21:16:12", | |
61 | + pay_wood_desc: "在【非常戴镜】的微信付款凭证", | |
62 | + pay_wood_id: "fcdj-1-1_1587129366", | |
63 | + prepay_id: "wx172116124528226bf1a8adad1662456500", | |
64 | + re_check_staus: "0", | |
65 | + shopid: "0", | |
66 | + split_userid: "0", | |
67 | + status: "1", | |
68 | + total_fee: "100", | |
69 | + uid: "1", | |
70 | + } | |
71 | + ], | |
72 | + msg: "订单列表", | |
73 | + status: 0, | |
74 | +} | |
75 | +*/ | |
76 | + | |
77 | +const state = { | |
78 | + orderList: [], | |
79 | +}; | |
80 | + | |
81 | +const mutations = { | |
82 | + INIT: (state, data) => { | |
83 | + state.orderList = data; | |
84 | + }, | |
85 | +}; | |
86 | + | |
87 | +const actions = { | |
88 | + getList({ | |
89 | + commit | |
90 | + }, param) { | |
91 | + request({ | |
92 | + url: myOrderList, | |
93 | + data: { | |
94 | + uid: 76, | |
95 | + order_status:200000 | |
96 | + }, | |
97 | + success: (res) => { | |
98 | + // console.log('myOrderList', res.data); | |
99 | + commit("INIT", res.data.data); | |
100 | + // commit(/"INIT", data); | |
101 | + }, | |
102 | + }) | |
103 | + } | |
104 | +} | |
105 | + | |
106 | +export default { | |
107 | + namespaced: true, | |
108 | + state, | |
109 | + mutations, | |
110 | + actions, | |
98 | 111 | } |
99 | - | |
100 | -export default { | |
101 | - namespaced: true, | |
102 | - state, | |
103 | - mutations, | |
104 | - actions, | |
105 | -} | |
106 | 112 | \ No newline at end of file | ... | ... |
src/store/url.js
... | ... | @@ -9,19 +9,19 @@ const urlAlias = { |
9 | 9 | search: '/app/prod/search', // 首页搜索商品 |
10 | 10 | |
11 | 11 | // 登陆 |
12 | - login: '/app/glass/getOpenId', // 登陆 | |
13 | - getUserInfo: '/app/glass/userinfo', // 获取用户信息 | |
12 | + login: '/api/frontend/glass/getOpenId', // 登陆 | |
13 | + getUserInfo: '/api/frontend/glass/userinfo', // 获取用户信息 | |
14 | 14 | |
15 | 15 | // 我的订单 |
16 | - orderList: '/app/order/list', // 获取订单列表 | |
17 | - myOrderList: '/app/order/list3', // 获取订单列表 | |
18 | - orderRead: '/app/order/read', // 获取订单详情 | |
19 | - cancelOrder: '/app/order/wait/del', // 取消订单 | |
20 | - statusConfirm: '/app/order/statusConfirm', // 订单操作 | |
21 | - payLog: '/app/pay/log', // 调起支付 | |
22 | - orderBuild: '/app/order/build', // 加购后生成订单 | |
23 | - buyNow: '/app/order/buynow', // 立即购买生成订单 | |
24 | - pay: '/app/pay/log', // 支付接口 | |
16 | + orderList: '/api/frontend/order/list', // 获取订单列表 | |
17 | + myOrderList: '/api/frontend/order/list', // 获取订单列表 | |
18 | + orderRead: '/api/frontend/order/read', // 获取订单详情 | |
19 | + cancelOrder: '/api/frontend/order/wait/del', // 取消订单 | |
20 | + statusConfirm: '/api/frontend/order/statusConfirm', // 订单操作 | |
21 | + payLog: '/api/frontend/pay/log', // 调起支付 | |
22 | + orderBuild: '/api/frontend/order/build', // 加购后生成订单 | |
23 | + buyNow: '/api/frontend/order/buynow', // 立即购买生成订单 | |
24 | + pay: '/api/frontend/pay/log', // 支付接口 | |
25 | 25 | |
26 | 26 | // 购物车 |
27 | 27 | cartList: '/api/frontend/cart/list', // 获取购物车列表 |
... | ... | @@ -30,24 +30,25 @@ const urlAlias = { |
30 | 30 | cartAdd: '/api/frontend/cart/add', // 添加购物车 |
31 | 31 | |
32 | 32 | // 我的 |
33 | - recommandList: '/app/prod/recommand', // 获取用户个性化推荐商品 | |
33 | + recommandList: '/api/frontend/wood/recommand', // 获取用户个性化推荐商品 | |
34 | 34 | |
35 | 35 | // 镜框选购页 |
36 | - detailStandardList: '/app/prod/read', // 获取商品的详细信息 | |
36 | + detailStandardList: '/api/frontend/prod/read', // 获取商品的详细信息 | |
37 | 37 | // 选购页 |
38 | - detailStandardUrl: '/app/prod/read', // 获取商品的详细信息 | |
39 | - makePost: '/app/glass/makeProdAdvPic', // 生成分享海报 | |
38 | + detailStandardUrl: '/api/frontend/prod/read', // 获取商品的详细信息 | |
39 | + makePost: '/api/frontend/glass/makeProdAdvPic', // 生成分享海报 | |
40 | 40 | |
41 | 41 | // 地址管理 |
42 | - editAddress: '/app/address/edit_address', // 编辑地址 | |
43 | - addressList: '/app/address/get_address_list', // 获取用户地址列表 | |
44 | - getAddress: '/app/address/get_address_by_id', // 获取用户某一地址信息 | |
45 | - getDefaultAddress: '/app/address/get_default_address', // 获取用户默认地址信息 | |
42 | + editAddress: '/api/frontend/user/address/modi', // 编辑地址 | |
43 | + addAddress: '/api/frontend/user/address/add', // 添加地址 | |
44 | + addressList: '/api/frontend/user/address/list', // 获取用户地址列表 | |
45 | + getAddress: '/api/frontend/user/address/get', // 获取用户某一地址信息 | |
46 | + getDefaultAddress: '/api/frontend/user/address/get', // 获取用户默认地址信息 | |
46 | 47 | |
47 | 48 | // 用户数据 |
48 | - mylovelist: '/app/user/mylovelist', // 关心的人的数据 | |
49 | - myloveadd: '/app/user/myloveadd', // 添加关心的人 | |
50 | - myloveupdate: '/app/user/myloveupdate', // 更新关心人的数据 | |
49 | + mylovelist: '/api/frontend/user/mylovelist', // 关心的人的数据 | |
50 | + myloveadd: '/api/frontend/user/myloveadd', // 添加关心的人 | |
51 | + myloveupdate: '/api/frontend/user/myloveupdate', // 更新关心人的数据 | |
51 | 52 | } |
52 | 53 | |
53 | 54 | export default urlAlias | ... | ... |