Commit 16749c922a24e335fb9f8dcc66f5ccb3360a6fff

Authored by 范牧
Exists in master

合并冲突

src/components/BottomSheet/BottomSheet.vue
1 <template> 1 <template>
2 <view class="BottomSheetContent"> 2 <view class="BottomSheetContent">
3 <view class="sheet" :class="{sheetShow:isShowBottom,sheeHide:!isShowBottom}" @touchmove.stop.prevent="moveHandle" @click="closeSheet()"> 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()" > 4 <scroll-view scroll-y="true" class="sheetView" :class="{sheetView_active:isShowBottom}" @click.stop="stopEvent()" >
5 <view class="BottomSheetContent"> 5 <view class="BottomSheetContent">
6 <view class="goodInfo"> 6 <view class="goodInfo">
7 <view class="imageWrap"> 7 <view class="imageWrap">
8 <image 8 <image
9 :src="skuItem.pic" 9 :src="skuItem.pic"
10 mode="aspectFill" 10 mode="aspectFill"
11 style="width: 188rpx;height: 168rpx;" 11 style="width: 188rpx;height: 168rpx;"
12 12
13 ></image> 13 ></image>
14 14
15 </view> 15 </view>
16 <view class="infoRight"> 16 <view class="infoRight">
17 <text class="goodName">{{goodInfo.p_name}}</text> 17 <text class="goodName">{{goodInfo.p_name}}</text>
18 <text class="remarks">支持7天无理由退货 顺丰发货</text> 18 <text class="remarks">支持7天无理由退货 顺丰发货</text>
19 <view class="priceBox"> 19 <view class="priceBox">
20 <view class="price">¥{{skuItem.real_price || '暂无'}}</view> 20 <view class="price">¥{{skuItem.real_price || '暂无'}}</view>
21 <text>(限购{{maxCount}}副)</text> 21 <text>(限购{{maxCount}}副)</text>
22 <view class="counter"> 22 <view class="counter">
23 <view 23 <view
24 class="btn" 24 class="btn"
25 disabled="this.addDisabled" 25 disabled="this.addDisabled"
26 type="default" 26 type="default"
27 @click="counter(false)" 27 @click="counter(false)"
28 >-</view> 28 >-</view>
29 <text>{{count}}</text> 29 <text>{{count}}</text>
30 <view 30 <view
31 class="btn" 31 class="btn"
32 disabled="this.desDisabled" 32 disabled="this.desDisabled"
33 type="default" 33 type="default"
34 @click="counter(true)" 34 @click="counter(true)"
35 >+</view> 35 >+</view>
36 </view> 36 </view>
37 </view> 37 </view>
38 </view> 38 </view>
39 </view> 39 </view>
40 <view class="peopleChoose"> 40 <view class="peopleChoose">
41 <view class="title">选择使用人</view> 41 <view class="title">选择使用人</view>
42 <view class="loveList"> 42 <view class="loveList">
43 <view class="peopleName" v-for="(item,index) in loveList" :key='index' :class="{ active2: loveCurrent === index }" 43 <view class="peopleName" v-for="(item,index) in loveList" :key='index' :class="{ active2: loveCurrent === index }"
44 @click="onClickLoveItem(index,item.name)"> 44 @click="onClickLoveItem(index,item.name)">
45 {{item.name}} 45 {{item.name}}
46 </view> 46 </view>
47 </view> 47 </view>
48 </view> 48 </view>
49 <view class="goods-data" v-if="isCart !== 3"> 49 <view class="goods-data" v-if="isCart !== 3">
50 <view class="opCollapse"> 50 <view class="opCollapse">
51 <view class="body"> 51 <view class="body">
52 <template v-if="opIsOpen"> 52 <template v-if="opIsOpen">
53 <view class="goods-form"> 53 <view class="goods-form">
54 <view class="p1"> 54 <view class="p1">
55 <image class="image2" src="../../static/img/myOpticsData/dataWrite.png" mode="aspectFit"></image> 55 <image class="image2" src="../../static/img/myOpticsData/dataWrite.png" mode="aspectFit"></image>
56 填写验光数据 56 填写验光数据
57 </view> 57 </view>
58 <text class="p2">没有验光数据?请到线下眼镜店验光哦~</text> 58 <text class="p2">没有验光数据?请到线下眼镜店验光哦~</text>
59 <view class="picker"> 59 <view class="picker">
60 <view class="picker-choice"> 60 <view class="picker-choice">
61 <view class="choice-left"> 61 <view class="choice-left">
62 <text class="pd">验光单取名:</text> 62 <text class="pd">验光单取名:</text>
63 </view> 63 </view>
64 <input type="text" @blur="handleInput" class="input" 64 <input type="text" @blur="handleInput" class="input"
65 placeholder="请输入名称" maxlength="20" :value="name" /> 65 placeholder="请输入名称" maxlength="20" :value="name" />
66 </view> 66 </view>
67 </view> 67 </view>
68 <view class="picker" > 68 <view class="picker" >
69 <view class="picker-choice"> 69 <view class="picker-choice">
70 <view class="choice-left"> 70 <view class="choice-left">
71 <text class="p11">{{pickerInfoList[0].nameC}}</text> 71 <text class="p11">{{pickerInfoList[0].nameC}}</text>
72 <text class="p12">{{pickerInfoList[0].nameE}}</text> 72 <text class="p12">{{pickerInfoList[0].nameE}}</text>
73 </view> 73 </view>
74 <text class="p13">左&nbsp;&nbsp;&nbsp;(OD)</text> 74 <text class="p13">左&nbsp;&nbsp;&nbsp;(OD)</text>
75 <!-- <text class="p14">{{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}}</text> --> 75 <!-- <text class="p14">{{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}}</text> -->
76 <picker @change="bindPickerChange01" :value="pickerInfoList[0].nameIndex1" :range="pickerInfoList[0].nameArray1"> 76 <picker @change="bindPickerChange01" :value="pickerInfoList[0].nameIndex1" :range="pickerInfoList[0].nameArray1">
77 <view class="p14"> 77 <view class="p14">
78 {{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}} 78 {{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}}
79 <image src="../../static/detail-tabicon.png" ></image> 79 <image src="../../static/detail-tabicon.png" ></image>
80 </view> 80 </view>
81 <!-- <image src="../../static/detail-tabicon.png" ></image> --> 81 <!-- <image src="../../static/detail-tabicon.png" ></image> -->
82 </picker> 82 </picker>
83 <text class="p13">右&nbsp;&nbsp;&nbsp;(OS)</text> 83 <text class="p13">右&nbsp;&nbsp;&nbsp;(OS)</text>
84 <!-- <text class="p14">{{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}}</text> --> 84 <!-- <text class="p14">{{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}}</text> -->
85 <picker @change="bindPickerChange02" :value="pickerInfoList[0].nameIndex2" :range="pickerInfoList[0].nameArray2"> 85 <picker @change="bindPickerChange02" :value="pickerInfoList[0].nameIndex2" :range="pickerInfoList[0].nameArray2">
86 <view class="p14"> 86 <view class="p14">
87 {{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}} 87 {{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}}
88 <image src="../../static/detail-tabicon.png" ></image> 88 <image src="../../static/detail-tabicon.png" ></image>
89 </view> 89 </view>
90 <!-- <image src="../../static/detail-tabicon.png" ></image> --> 90 <!-- <image src="../../static/detail-tabicon.png" ></image> -->
91 </picker> 91 </picker>
92 </view> 92 </view>
93 </view> 93 </view>
94 <view class="picker" > 94 <view class="picker" >
95 <view class="picker-choice"> 95 <view class="picker-choice">
96 <view class="choice-left"> 96 <view class="choice-left">
97 <text class="p11">{{pickerInfoList[1].nameC}}</text> 97 <text class="p11">{{pickerInfoList[1].nameC}}</text>
98 <text class="p12">{{pickerInfoList[1].nameE}}</text> 98 <text class="p12">{{pickerInfoList[1].nameE}}</text>
99 </view> 99 </view>
100 <text class="p13">左&nbsp;&nbsp;&nbsp;(OD)</text> 100 <text class="p13">左&nbsp;&nbsp;&nbsp;(OD)</text>
101 <!-- <text class="p14">{{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}}</text> --> 101 <!-- <text class="p14">{{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}}</text> -->
102 <picker @change="bindPickerChange11" :value="pickerInfoList[1].nameIndex1" :range="pickerInfoList[1].nameArray1"> 102 <picker @change="bindPickerChange11" :value="pickerInfoList[1].nameIndex1" :range="pickerInfoList[1].nameArray1">
103 <view class="p14"> 103 <view class="p14">
104 {{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}} 104 {{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}}
105 <image src="../../static/detail-tabicon.png" ></image> 105 <image src="../../static/detail-tabicon.png" ></image>
106 </view> 106 </view>
107 <!-- <image src="../../static/detail-tabicon.png" ></image> --> 107 <!-- <image src="../../static/detail-tabicon.png" ></image> -->
108 </picker> 108 </picker>
109 <text class="p13">右&nbsp;&nbsp;&nbsp;(OS)</text> 109 <text class="p13">右&nbsp;&nbsp;&nbsp;(OS)</text>
110 <!-- <text class="p14">{{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}}</text> --> 110 <!-- <text class="p14">{{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}}</text> -->
111 <picker @change="bindPickerChange12" :value="pickerInfoList[1].nameIndex2" :range="pickerInfoList[1].nameArray2"> 111 <picker @change="bindPickerChange12" :value="pickerInfoList[1].nameIndex2" :range="pickerInfoList[1].nameArray2">
112 <view class="p14"> 112 <view class="p14">
113 {{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}} 113 {{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}}
114 <image src="../../static/detail-tabicon.png" ></image> 114 <image src="../../static/detail-tabicon.png" ></image>
115 </view> 115 </view>
116 <!-- <image src="../../static/detail-tabicon.png" ></image> --> 116 <!-- <image src="../../static/detail-tabicon.png" ></image> -->
117 </picker> 117 </picker>
118 </view> 118 </view>
119 </view> 119 </view>
120 <view class="picker" > 120 <view class="picker" >
121 <view class="picker-choice"> 121 <view class="picker-choice">
122 <view class="choice-left"> 122 <view class="choice-left">
123 <text class="p11">{{pickerInfoList[2].nameC}}</text> 123 <text class="p11">{{pickerInfoList[2].nameC}}</text>
124 <text class="p12">{{pickerInfoList[2].nameE}}</text> 124 <text class="p12">{{pickerInfoList[2].nameE}}</text>
125 </view> 125 </view>
126 <text class="p13">左&nbsp;&nbsp;&nbsp;(OD)</text> 126 <text class="p13">左&nbsp;&nbsp;&nbsp;(OD)</text>
127 <picker @change="bindPickerChange21" :value="pickerInfoList[2].nameIndex1" :range="pickerInfoList[2].nameArray1"> 127 <picker @change="bindPickerChange21" :value="pickerInfoList[2].nameIndex1" :range="pickerInfoList[2].nameArray1">
128 <view class="p14"> 128 <view class="p14">
129 {{pickerInfoList[2].nameArray1[pickerInfoList[2].nameIndex1]}} 129 {{pickerInfoList[2].nameArray1[pickerInfoList[2].nameIndex1]}}
130 <image src="../../static/detail-tabicon.png" ></image> 130 <image src="../../static/detail-tabicon.png" ></image>
131 </view> 131 </view>
132 </picker> 132 </picker>
133 <text class="p13">右&nbsp;&nbsp;&nbsp;(OS)</text> 133 <text class="p13">右&nbsp;&nbsp;&nbsp;(OS)</text>
134 <!-- <text class="p14">{{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}}</text> --> 134 <!-- <text class="p14">{{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}}</text> -->
135 <picker @change="bindPickerChange22" :value="pickerInfoList[2].nameIndex2" :range="pickerInfoList[2].nameArray2"> 135 <picker @change="bindPickerChange22" :value="pickerInfoList[2].nameIndex2" :range="pickerInfoList[2].nameArray2">
136 <view class="p14"> 136 <view class="p14">
137 {{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}} 137 {{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}}
138 <image src="../../static/detail-tabicon.png" ></image> 138 <image src="../../static/detail-tabicon.png" ></image>
139 </view> 139 </view>
140 <!-- <image src="../../static/detail-tabicon.png" ></image> --> 140 <!-- <image src="../../static/detail-tabicon.png" ></image> -->
141 </picker> 141 </picker>
142 </view> 142 </view>
143 </view> 143 </view>
144 <view class="picker"> 144 <view class="picker">
145 <view class="picker-choice"> 145 <view class="picker-choice">
146 <view class="choice-left"> 146 <view class="choice-left">
147 <text class="pd">瞳距:</text> 147 <text class="pd">瞳距:</text>
148 </view> 148 </view>
149 <input type="digit" @change="handleInputPd" class="input" 149 <input type="digit" @change="handleInputPd" class="input"
150 placeholder="请输入瞳距,单位cm" maxlength="20" :value="pd" /> 150 placeholder="请输入瞳距,单位cm" maxlength="20" :value="pd" />
151 </view> 151 </view>
152 </view> 152 </view>
153 <view class="picker" > 153 <view class="picker" >
154 <view class="picker-choice"> 154 <view class="picker-choice">
155 <view class="choice-left"> 155 <view class="choice-left">
156 <text class="p11">{{pickerInfoList[3].nameC}}</text> 156 <text class="p11">{{pickerInfoList[3].nameC}}</text>
157 </view> 157 </view>
158 <text class="p13-date">年&nbsp;&nbsp;&nbsp;(Y)</text> 158 <text class="p13-date">年&nbsp;&nbsp;&nbsp;(Y)</text>
159 <picker @change="bindPickerChange41" :value="pickerInfoList[3].nameIndex1" :range="pickerInfoList[3].nameArray1"> 159 <picker @change="bindPickerChange41" :value="pickerInfoList[3].nameIndex1" :range="pickerInfoList[3].nameArray1">
160 <view class="p14" style="width: 30px;"> 160 <view class="p14" style="width: 30px;">
161 {{pickerInfoList[3].nameArray1[pickerInfoList[3].nameIndex1]}} 161 {{pickerInfoList[3].nameArray1[pickerInfoList[3].nameIndex1]}}
162 <image src="../../static/detail-tabicon.png" ></image> 162 <image src="../../static/detail-tabicon.png" ></image>
163 </view> 163 </view>
164 </picker> 164 </picker>
165 <text class="p13-date">月&nbsp;&nbsp;&nbsp;(M)</text> 165 <text class="p13-date">月&nbsp;&nbsp;&nbsp;(M)</text>
166 <picker @change="bindPickerChange42" :value="pickerInfoList[3].nameIndex2" :range="pickerInfoList[3].nameArray2"> 166 <picker @change="bindPickerChange42" :value="pickerInfoList[3].nameIndex2" :range="pickerInfoList[3].nameArray2">
167 <view class="p14" style="width: 30px;"> 167 <view class="p14" style="width: 30px;">
168 {{pickerInfoList[3].nameArray2[pickerInfoList[3].nameIndex2]}} 168 {{pickerInfoList[3].nameArray2[pickerInfoList[3].nameIndex2]}}
169 <image src="../../static/detail-tabicon.png" ></image> 169 <image src="../../static/detail-tabicon.png" ></image>
170 </view> 170 </view>
171 </picker> 171 </picker>
172 <text class="p13-date">日&nbsp;&nbsp;&nbsp;(D)</text> 172 <text class="p13-date">日&nbsp;&nbsp;&nbsp;(D)</text>
173 <picker @change="bindPickerChange43" :value="pickerInfoList[3].nameIndex3" :range="pickerInfoList[3].nameArray3"> 173 <picker @change="bindPickerChange43" :value="pickerInfoList[3].nameIndex3" :range="pickerInfoList[3].nameArray3">
174 <view class="p14" style="width: 30px;"> 174 <view class="p14" style="width: 30px;">
175 {{pickerInfoList[3].nameArray3[pickerInfoList[3].nameIndex3]}} 175 {{pickerInfoList[3].nameArray3[pickerInfoList[3].nameIndex3]}}
176 <image src="../../static/detail-tabicon.png" ></image> 176 <image src="../../static/detail-tabicon.png" ></image>
177 </view> 177 </view>
178 </picker> 178 </picker>
179 </view> 179 </view>
180 </view> 180 </view>
181 <view class="ipts"> 181 <view class="ipts">
182 <view class="inputItem"> 182 <view class="inputItem">
183 <text class="text">镜片宽度</text> 183 <text class="text">镜片宽度</text>
184 <input class="input" @input="glassInfoInput($event,0)" type="text" :value="glassInfo.glassWidth!=='0'?glassInfo.glassWidth:''" placeholder="请输入镜片宽度"/> 184 <input class="input" @input="glassInfoInput($event,0)" type="text" :value="glassInfo.glassWidth!=='0'?glassInfo.glassWidth:''" placeholder="请输入镜片宽度"/>
185 </view> 185 </view>
186 <view class="inputItem"> 186 <view class="inputItem">
187 <text class="text">鼻梁宽度</text> 187 <text class="text">鼻梁宽度</text>
188 <input class="input" @input="glassInfoInput($event,1)" type="text" :value="glassInfo.norseWidth!=='0'?glassInfo.norseWidth:''" placeholder="请输入鼻梁宽度"/> 188 <input class="input" @input="glassInfoInput($event,1)" type="text" :value="glassInfo.norseWidth!=='0'?glassInfo.norseWidth:''" placeholder="请输入鼻梁宽度"/>
189 </view> 189 </view>
190 <view class="inputItem"> 190 <view class="inputItem">
191 <text class="text">镜腿长度</text> 191 <text class="text">镜腿长度</text>
192 <input class="input" @input="glassInfoInput($event,2)" type="text" :value="glassInfo.legWidth!=='0'?glassInfo.legWidth:''" placeholder="请输入镜腿长度"/> 192 <input class="input" @input="glassInfoInput($event,2)" type="text" :value="glassInfo.legWidth!=='0'?glassInfo.legWidth:''" placeholder="请输入镜腿长度"/>
193 </view> 193 </view>
194 194
195 </view> 195 </view>
196 <!-- <view class="confirm"> 196 <!-- <view class="confirm">
197 <image class="image1" :src="confirm ? tabicon[0] : tabicon[1]" @tap="changeConfirm"></image> 197 <image class="image1" :src="confirm ? tabicon[0] : tabicon[1]" @tap="changeConfirm"></image>
198 <text>确认以上输入信息来源于我的验光数据!</text> 198 <text>确认以上输入信息来源于我的验光数据!</text>
199 </view> --> 199 </view> -->
200 </view> 200 </view>
201 </template> 201 </template>
202 <template v-else> 202 <template v-else>
203 <view 203 <view
204 v-for="item in pickerInfoList" 204 v-for="item in pickerInfoList"
205 :key="item.key" 205 :key="item.key"
206 class="bodyBox" 206 class="bodyBox"
207 > 207 >
208 <template v-if="item.nameC==='验光日期'"> 208 <template v-if="item.nameC==='验光日期'">
209 <text class="names">{{item.nameC}}</text> 209 <text class="names">{{item.nameC}}</text>
210 <text style="margin-right: 5px;">{{item.nameArray1[item.nameIndex1]}}年</text> 210 <text style="margin-right: 5px;">{{item.nameArray1[item.nameIndex1]}}年</text>
211 <text style="margin-right: 5px;">{{item.nameArray2[item.nameIndex2]}}月</text> 211 <text style="margin-right: 5px;">{{item.nameArray2[item.nameIndex2]}}月</text>
212 <text>{{item.nameArray3[item.nameIndex2]}}日</text> 212 <text>{{item.nameArray3[item.nameIndex2]}}日</text>
213 </template> 213 </template>
214 <template v-else> 214 <template v-else>
215 <template v-if="item.nameC==='度数'"> 215 <template v-if="item.nameC==='度数'">
216 <text style="display: inline;">*</text> 216 <text style="display: inline;">*</text>
217 </template> 217 </template>
218 218
219 <text class="names">{{item.nameC}}</text> 219 <text class="names">{{item.nameC}}</text>
220 <text style="margin-right: 10px;">左&nbsp;{{item.nameArray1[item.nameIndex1]}}</text> 220 <text style="margin-right: 10px;">左&nbsp;{{item.nameArray1[item.nameIndex1]}}</text>
221 <text>右&nbsp;{{item.nameArray2[item.nameIndex2]}}</text> 221 <text>右&nbsp;{{item.nameArray2[item.nameIndex2]}}</text>
222 </template> 222 </template>
223 </view> 223 </view>
224 </template> 224 </template>
225 </view> 225 </view>
226 </view> 226 </view>
227 </view> 227 </view>
228 <view class="choose"> 228 <view class="choose">
229 <view 229 <view
230 class="chooseItem_1_content" 230 class="chooseItem_1_content"
231 v-for="(item,index) in attrList" 231 v-for="(item,index) in attrList"
232 :key="index" 232 :key="index"
233 > 233 >
234 <UniCollapse @change="changeShow(index)"> 234 <UniCollapse @change="changeShow(index)">
235 <UniCollapseItem 235 <UniCollapseItem
236 :open="show[index]" 236 :open="show[index]"
237 :title="item.meta_name" 237 :title="item.meta_name"
238 showAnimation=false 238 showAnimation=false
239 > 239 >
240 <view class="chooseItem_1_content"> 240 <view class="chooseItem_1_content">
241 <view class="itemsWrap" v-if="isCart ==3"> 241 <view class="itemsWrap" v-if="isCart ==3">
242 <view 242 <view
243 class="item2" 243 class="item2"
244 v-for="(one,i) in item.attr" 244 v-for="(one,i) in item.attr"
245 :key="i" 245 :key="i"
246 :class="{ active2: current[index] === i}" 246 :class="{ active2: current[index] === i}"
247 @click="cartOnClickItem(index, i,one.aid)" 247 @click="cartOnClickItem(index, i,one.aid)"
248 >{{one.name}}</view> 248 >{{one.name}}</view>
249 </view> 249 </view>
250 <view class="itemsWrap" v-else> 250 <view class="itemsWrap" v-else>
251 <view 251 <view
252 class="item2" 252 class="item2"
253 v-for="(one,i) in item.attr" 253 v-for="(one,i) in item.attr"
254 :key="i" 254 :key="i"
255 :class="{ active2: current[index] === i }" 255 :class="{ active2: current[index] === i }"
256 @click="cartOnClickItem(index, i,one.aid)" 256 @click="cartOnClickItem(index, i,one.aid)"
257 >{{one.name}}</view> 257 >{{one.name}}</view>
258 </view> 258 </view>
259 </view> 259 </view>
260 </UniCollapseItem> 260 </UniCollapseItem>
261 </UniCollapse> 261 </UniCollapse>
262 <view 262 <view
263 class="chooseRes" 263 class="chooseRes"
264 v-show="!show[index]" 264 v-show="!show[index]"
265 >* {{attrList[index].attr[current[index]].name}}</view> 265 >* {{attrList[index].attr[current[index]].name}}</view>
266 </view> 266 </view>
267 </view> 267 </view>
268 <view 268 <view
269 class="button" 269 class="button"
270 @click.native="addCart" 270 @click.native="addCart"
271 v-if="isCart == 1" 271 v-if="isCart == 1"
272 > 272 >
273 加入购物车 273 加入购物车
274 </view> 274 </view>
275 <view 275 <view
276 class="button" 276 class="button"
277 @click="toComfirmOrder" 277 @click="toComfirmOrder"
278 v-if="isCart == 2" 278 v-if="isCart == 2"
279 > 279 >
280 立即结算 280 立即结算
281 </view> 281 </view>
282 <view 282 <view
283 class="button" 283 class="button"
284 @click="comfirmChoose" 284 @click="comfirmChoose"
285 v-if="isCart == 3" 285 v-if="isCart == 3"
286 > 286 >
287 确定 287 确定
288 </view> 288 </view>
289 </view> 289 </view>
290 </scroll-view> 290 </scroll-view>
291 </view> 291 </view>
292 </view> 292 </view>
293 </template> 293 </template>
294 <script> 294 <script>
295 import UniCollapse from '@/components/UniCollapse/UniCollapse.vue' 295 import UniCollapse from '@/components/UniCollapse/UniCollapse.vue'
296 import UniCollapseItem from '@/components/UniCollapseItem/UniCollapseItem.vue' 296 import UniCollapseItem from '@/components/UniCollapseItem/UniCollapseItem.vue'
297 import store from '@/store' 297 import store from '@/store'
298 export default { 298 export default {
299 components: { 299 components: {
300 UniCollapse, 300 UniCollapse,
301 UniCollapseItem, 301 UniCollapseItem,
302 }, 302 },
303 props: { 303 props: {
304 isShowBottom : Boolean, 304 isShowBottom : Boolean,
305 pid: Number, 305 pid: Number,
306 sk_id:String, 306 sk_id:String,
307 propMpId:String, 307 propMpId:String,
308 goodInfo:Object, 308 goodInfo:Object,
309 isCart:Number, 309 isCart:Number,
310 cart_id:Number, 310 cart_id:Number,
311 index:Number 311 index:Number
312 }, 312 },
313 data() { 313 data() {
314 return { 314 return {
315 loveCurrent:Number, 315 loveCurrent:Number,
316 count: 1, 316 count: 1,
317 // pid: 0, 317 // pid: 0,
318 maxCount: 20, 318 maxCount: 20,
319 dataName: '', // 验光数据人员名称 319 dataName: '', // 验光数据人员名称
320 isDataName: false, // 是否是已存在的人员数据 320 isDataName: false, // 是否是已存在的人员数据
321 dataConfirm: false, // 已确认所输入验光数据 321 dataConfirm: false, // 已确认所输入验光数据
322 opIsOpen: true, 322 opIsOpen: true,
323 addDisabled: false, 323 addDisabled: false,
324 desDisabled: false, 324 desDisabled: false,
325 current: [], 325 current: [],
326 show: [true,true], 326 show: [true,true],
327 checkedData: {}, 327 checkedData: {},
328 // 度数相关数据 328 // 度数相关数据
329 pickerInfoList: [ 329 pickerInfoList: [
330 { nameC: '度数', nameE: '(SPH)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 0 }, 330 { nameC: '度数', nameE: '(SPH)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 0 },
331 { nameC: '散光', nameE: '(CYL)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 1 }, 331 { nameC: '散光', nameE: '(CYL)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 1 },
332 { nameC: '散光轴位', nameE: '(AXI)', nameArray1: [''], nameIndex1: 0, nameArray2: [''], nameIndex2: 0, key: 2 }, 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 }, 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 ], 334 ],
335 // confirm: false, // 用户是否确认 335 // confirm: false, // 用户是否确认
336 // tabicon: ['/static/detail-button.png', '/static/detail-button-unselected.png'], 336 // tabicon: ['/static/detail-button.png', '/static/detail-button-unselected.png'],
337 name: '', 337 name: '',
338 oldname: '', // 用于判读用户是否改变名字 338 oldname: '', // 用于判读用户是否改变名字
339 pickerInfoChioce: { 339 pickerInfoChioce: {
340 leftSph: '', 340 leftSph: '',
341 rightSph: '', 341 rightSph: '',
342 leftCyl: '', 342 leftCyl: '',
343 rightCyl: '', 343 rightCyl: '',
344 leftAxi: '', 344 leftAxi: '',
345 rightAxi: '', 345 rightAxi: '',
346 time: { 346 time: {
347 year: 0, 347 year: 0,
348 month: 0, 348 month: 0,
349 day: 0, 349 day: 0,
350 }, 350 },
351 }, 351 },
352 glassInfo:{ 352 glassInfo:{
353 glassWidth:Number,//镜片宽度 353 glassWidth:Number,//镜片宽度
354 norseWidth:Number,//鼻宽 354 norseWidth:Number,//鼻宽
355 legWidth:Number//镜腿长度 355 legWidth:Number//镜腿长度
356 }, 356 },
357 pd: '', // 瞳距 357 pd: '', // 瞳距
358 oldpd: '', // 用于判断用户是否改变瞳距 358 oldpd: '', // 用于判断用户是否改变瞳距
359 kinds: 1, // kinds=1,提交为新增验光,2为修改 359 kinds: 1, // kinds=1,提交为新增验光,2为修改
360 mp_id: Number, 360 mp_id: Number,
361 skuValueArray:[], 361 skuValueArray:[],
362 skId:String 362 skId:String
363 } 363 }
364 }, 364 },
365 computed: { 365 computed: {
366 //进购物车选择的人的index 366 //进购物车选择的人的index
367 p_current(){ 367 p_current(){
368 const getLoveItemIndex = (item) => item.mp_id == this.propMpId 368 const getLoveItemIndex = (item) => item.mp_id == this.propMpId
369 const p_current = this.$store.state.myLoveList.loveList.findIndex(getLoveItemIndex ) 369 const p_current = this.$store.state.myLoveList.loveList.findIndex(getLoveItemIndex )
370 if(this.isCart == 3){ 370 if(this.isCart == 3){
371 this.loveCurrent = p_current 371 this.loveCurrent = p_current
372 } 372 }
373 return p_current 373 return p_current
374 }, 374 },
375 arr_current(){ 375 arr_current(){
376 if(this.isCart == 3){ 376 if(this.isCart == 3){
377 const skId = this.sk_id 377 const skId = this.sk_id
378 const skuValue = this.skuItem.sku_value 378 const skuValue = this.skuItem.sku_value
379 const skuValueArray = skuValue.split('_') 379 const skuValueArray = skuValue.split('_')
380 this.skuValueArray = skuValueArray 380 this.skuValueArray = skuValueArray
381 const attrList = this.$store.state.read.goodInfo.attrList 381 const attrList = this.$store.state.read.goodInfo.attrList
382 for (let i = 0;i<attrList.length;i++) { 382 for (let i = 0;i<attrList.length;i++) {
383 const getArrIndex = (item) => item.aid == skuValueArray[i] 383 const getArrIndex = (item) => item.aid == skuValueArray[i]
384 const arr_current = this.$store.state.read.goodInfo.attrList[i].attr.findIndex(getArrIndex ) 384 const arr_current = this.$store.state.read.goodInfo.attrList[i].attr.findIndex(getArrIndex )
385 // console.log('arr_current',arr_current) 385 // console.log('arr_current',arr_current)
386 this.current.push(arr_current) 386 this.current.push(arr_current)
387 } 387 }
388 }else{ 388 }else{
389 return null 389 return null
390 } 390 }
391 }, 391 },
392 loveList() { 392 loveList() {
393 return this.$store.state.myLoveList.loveList || [] 393 return this.$store.state.myLoveList.loveList || []
394 }, 394 },
395 attrList() { 395 attrList() {
396 // console.log('attrList',this.$store.state.read.goodInfo.attrList) 396 // console.log('attrList',this.$store.state.read.goodInfo.attrList)
397 let attrList = this.$store.state.read.goodInfo.attrList 397 let attrList = this.$store.state.read.goodInfo.attrList
398 if(attrList !== undefined){ 398 if(attrList !== undefined){
399 return attrList 399 return attrList
400 }else{ 400 }else{
401 return [] 401 return []
402 } 402 }
403 }, 403 },
404 skuList() { 404 skuList() {
405 // console.log('skuList',this.$store.state.read.goodInfo.skuList) 405 // console.log('skuList',this.$store.state.read.goodInfo.skuList)
406 return this.$store.state.read.goodInfo.skuList 406 return this.$store.state.read.goodInfo.skuList
407 }, 407 },
408 skuItem(){ 408 skuItem(){
409 // if(this.isCart == 3){ 409 // if(this.isCart == 3){
410 const skuList = this.$store.state.read.goodInfo.skuList 410 const skuList = this.$store.state.read.goodInfo.skuList
411 const skuItem = skuList.filter(item => item.sk_id === this.skId)[0] 411 const skuItem = skuList.filter(item => item.sk_id === this.skId)[0]
412 return skuItem 412 return skuItem
413 // }else{ 413 // }else{
414 // const skuList = this.$store.state.read.goodInfo.skuList 414 // const skuList = this.$store.state.read.goodInfo.skuList
415 // const skuItem = skuList[0] 415 // const skuItem = skuList[0]
416 // return skuItem 416 // return skuItem
417 // } 417 // }
418 }, 418 },
419 mpList() { 419 mpList() {
420 420
421 return this.$store.state.myLoveList.loveList 421 return this.$store.state.myLoveList.loveList
422 }, 422 },
423 glassInfoRight(){ 423 glassInfoRight(){
424 const glassInfoArr = Object.values(this.glassInfo) 424 const glassInfoArr = Object.values(this.glassInfo)
425 // console.log('glassInfoArr',glassInfoArr.find(item => item == '0')) 425 // console.log('glassInfoArr',glassInfoArr.find(item => item == '0'))
426 return glassInfoArr.find(item => item == '0') ==undefined 426 return glassInfoArr.find(item => item == '0') ==undefined
427 } 427 }
428 }, 428 },
429 created() { 429 created() {
430 this.skuValueArray = this.skuList[0].sku_value.split("_") 430 this.skuValueArray = this.skuList[0].sku_value.split("_")
431 // console.log(this.sk_id) 431 // console.log(this.sk_id)
432 this.mp_id = this.propMpId 432 this.mp_id = this.propMpId
433 const pid = this.pid 433 const pid = this.pid
434 if(this.isCart!==3){ 434 if(this.isCart!==3){
435 this.skId = this.skuList[0].sk_id 435 this.skId = this.skuList[0].sk_id
436 const current = [] 436 const current = []
437 const show = [] 437 const show = []
438 for (let index = 0; index < this.attrList.length; index++) { 438 for (let index = 0; index < this.attrList.length; index++) {
439 current.push(0) 439 current.push(0)
440 show.push(true) 440 show.push(true)
441 } 441 }
442 this.current = current 442 this.current = current
443 this.show = show 443 this.show = show
444 }else{ 444 }else{
445 this.skId = this.sk_id 445 this.skId = this.sk_id
446 } 446 }
447 //获取关心的人列表 447 //获取关心的人列表
448 store.dispatch('myLoveList/getLoveList', { 448 store.dispatch('myLoveList/getLoveList', {
449 uid: this.$store.state.user.userInfo.uid, 449 uid: this.$store.state.user.userInfo.uid,
450 }); 450 });
451 // 初始化SPL、CYL、AXI的值 451 // 初始化SPL、CYL、AXI的值
452 for (let j = 0; j < 3; j++) { 452 for (let j = 0; j < 3; j++) {
453 for (let i = -12; i < 6; i++) { 453 for (let i = -12; i < 6; i++) {
454 this.pickerInfoList[j].nameArray1.push(i) 454 this.pickerInfoList[j].nameArray1.push(i)
455 this.pickerInfoList[j].nameArray1.push(i + 0.5) 455 this.pickerInfoList[j].nameArray1.push(i + 0.5)
456 this.pickerInfoList[j].nameArray2.push(i) 456 this.pickerInfoList[j].nameArray2.push(i)
457 this.pickerInfoList[j].nameArray2.push(i + 0.5) 457 this.pickerInfoList[j].nameArray2.push(i + 0.5)
458 if (i >= -6) { 458 if (i >= -6) {
459 this.pickerInfoList[j].nameArray1.push(i + 0.25) 459 this.pickerInfoList[j].nameArray1.push(i + 0.25)
460 this.pickerInfoList[j].nameArray1.push(i + 0.75) 460 this.pickerInfoList[j].nameArray1.push(i + 0.75)
461 this.pickerInfoList[j].nameArray2.push(i + 0.25) 461 this.pickerInfoList[j].nameArray2.push(i + 0.25)
462 this.pickerInfoList[j].nameArray2.push(i + 0.75) 462 this.pickerInfoList[j].nameArray2.push(i + 0.75)
463 } 463 }
464 if (i === 5) { 464 if (i === 5) {
465 this.pickerInfoList[j].nameArray1.push(i + 1) 465 this.pickerInfoList[j].nameArray1.push(i + 1)
466 this.pickerInfoList[j].nameArray2.push(i + 1) 466 this.pickerInfoList[j].nameArray2.push(i + 1)
467 } 467 }
468 } 468 }
469 } 469 }
470 // 初始化日期值 470 // 初始化日期值
471 for (let i = 1; i < 32; i++) { 471 for (let i = 1; i < 32; i++) {
472 this.pickerInfoList[3].nameArray3.push(i) 472 this.pickerInfoList[3].nameArray3.push(i)
473 } 473 }
474 // 初始化年份前后五年 474 // 初始化年份前后五年
475 const myDate = new Date() 475 const myDate = new Date()
476 const nowYear = myDate.getFullYear() 476 const nowYear = myDate.getFullYear()
477 for (let i = 0; i < 5; i++) { 477 for (let i = 0; i < 5; i++) {
478 this.pickerInfoList[3].nameArray1.push(nowYear - i) 478 this.pickerInfoList[3].nameArray1.push(nowYear - i)
479 } 479 }
480 }, 480 },
481 name : "bottomSheet", 481 name : "bottomSheet",
482 methods: { 482 methods: {
483 //判断眼镜数据是否为0 483 //判断眼镜数据是否为0
484 checkGlassInfo(){ 484 checkGlassInfo(){
485 // const glassInfoArr = Object.values(this.glassInfo) 485 // const glassInfoArr = Object.values(this.glassInfo)
486 // console.log(this.glassInfoRight) 486 // console.log(this.glassInfoRight)
487 if(!this.glassInfoRight){ 487 if(!this.glassInfoRight){
488 uni.showToast({ 488 uni.showToast({
489 title:'请完善镜框数据~', 489 title:'请完善镜框数据~',
490 icon:'none' 490 icon:'none'
491 }) 491 })
492 } 492 }
493 }, 493 },
494 updateMylove(){ 494 updateMylove(){
495 const loveItem = this.loveList[this.loveCurrent] 495 const loveItem = this.loveList[this.loveCurrent]
496 const glassWidth = this.glassInfo.glassWidth 496 // console.log(this.loveList)
497 const norseWidth = this.glassInfo.norseWidth 497 // console.log(this.loveCurrent)
498 const legWidth = this.glassInfo.legWidth 498 // console.log(loveItem)
499 if(loveItem.glassWidth !== glassWidth){ 499 if(loveItem != undefined){
500 store.dispatch('myLoveList/updateMylove', { 500 const glassWidth = this.glassInfo.glassWidth
501 uid: this.$store.state.user.userInfo.uid, 501 const norseWidth = this.glassInfo.norseWidth
502 openid: this.$store.state.user.userInfo.openid, 502 const legWidth = this.glassInfo.legWidth
503 mp_id: this.mp_id, 503 if(loveItem.glassWidth !== glassWidth){
504 keyname: 'glassWidth', 504 store.dispatch('myLoveList/updateMylove', {
505 keyvalue: glassWidth 505 uid: this.$store.state.user.userInfo.uid,
506 }); 506 openid: this.$store.state.user.userInfo.openid,
507 } 507 mp_id: this.mp_id,
508 if(loveItem.norseWidth !== norseWidth){ 508 keyname: 'glassWidth',
509 store.dispatch('myLoveList/updateMylove', { 509 keyvalue: glassWidth
510 uid: this.$store.state.user.userInfo.uid, 510 });
511 openid: this.$store.state.user.userInfo.openid, 511 }
512 mp_id: this.mp_id, 512 if(loveItem.norseWidth !== norseWidth){
513 keyname: 'norseWidth', 513 store.dispatch('myLoveList/updateMylove', {
514 keyvalue: norseWidth 514 uid: this.$store.state.user.userInfo.uid,
515 }); 515 openid: this.$store.state.user.userInfo.openid,
516 } 516 mp_id: this.mp_id,
517 if(loveItem.legWidth !== legWidth){ 517 keyname: 'norseWidth',
518 store.dispatch('myLoveList/updateMylove', { 518 keyvalue: norseWidth
519 uid: this.$store.state.user.userInfo.uid, 519 });
520 openid: this.$store.state.user.userInfo.openid, 520 }
521 mp_id: this.mp_id, 521 if(loveItem.legWidth !== legWidth){
522 keyname: 'legWidth', 522 store.dispatch('myLoveList/updateMylove', {
523 keyvalue: legWidth 523 uid: this.$store.state.user.userInfo.uid,
524 }); 524 openid: this.$store.state.user.userInfo.openid,
525 mp_id: this.mp_id,
526 keyname: 'legWidth',
527 keyvalue: legWidth
528 });
529 }
530 }else{
531 uni.showToast({
532 title:'请选择使用人',
533 icon:'none'
534 })
525 } 535 }
526 }, 536 },
527 glassInfoInput(e,type){ 537 glassInfoInput(e,type){
528 switch(type){ 538 switch(type){
529 case 0: 539 case 0:
530 this.glassInfo.glassWidth = e.detail.value 540 this.glassInfo.glassWidth = e.detail.value
531 break; 541 break;
532 case 1: 542 case 1:
533 this.glassInfo.norseWidth = e.detail.value 543 this.glassInfo.norseWidth = e.detail.value
534 break; 544 break;
535 case 2: 545 case 2:
536 this.glassInfo.legWidth = e.detail.value 546 this.glassInfo.legWidth = e.detail.value
537 break; 547 break;
538 default: 548 default:
539 break; 549 break;
540 } 550 }
541 }, 551 },
542 //参数点击事件==》改变对应图片 552 //参数点击事件==》改变对应图片
543 cartOnClickItem(index, i,aid) { 553 cartOnClickItem(index, i,aid) {
544 //根据aid拼接skuValue 554 //根据aid拼接skuValue
545 this.skuValueArray[index] = aid 555 this.skuValueArray[index] = aid
546 const sku_value = this.skuValueArray.join('_') 556 const sku_value = this.skuValueArray.join('_')
547 //根据sku_value获取对应的sk_id 557 //根据sku_value获取对应的sk_id
548 const itemSk_id = this.skuList.filter(item=>item.sku_value == sku_value)[0].sk_id 558 const itemSk_id = this.skuList.filter(item=>item.sku_value == sku_value)[0].sk_id
549 //修改sk_id 559 //修改sk_id
550 this.skId = itemSk_id 560 this.skId = itemSk_id
551 if (this.current[index] !== i) { 561 if (this.current[index] !== i) {
552 this.current[index] = i 562 this.current[index] = i
553 } 563 }
554 this.$forceUpdate() 564 this.$forceUpdate()
555 }, 565 },
556 comfirmChoose(){ 566 comfirmChoose(){
557 this.checkGlassInfo() 567 this.checkGlassInfo()
558 if(this.glassInfoRight){ 568 if(this.glassInfoRight){
559 this.updateMylove() 569 this.updateMylove()
560 const price = this.skuList.filter(item=>item.sk_id == this.skId)[0].real_price 570 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)//添加购物车 571 this.$emit("chooseCartModi",this.mp_id,this.skId,price,this.pid,this.count,this.cart_id,this.index)//添加购物车
562 this.$emit("closeBottom") 572 this.$emit("closeBottom")
563 } 573 }
564 }, 574 },
565 addCart(){ 575 addCart(){
566 this.checkGlassInfo() 576 this.checkGlassInfo()
567 if(this.glassInfoRight){ 577 // console.log(this.glassInfoRight)
568 this.updateMylove() 578 this.updateMylove()
579 if(this.glassInfoRight&&this.mp_id!==''){
569 const that = this 580 const that = this
570 const checkedSKUName = [that.goodInfo.attrList[0].meta_name,that.goodInfo.attrList[1].meta_name] 581 const checkedSKUName = [that.goodInfo.attrList[0].meta_name,that.goodInfo.attrList[1].meta_name]
571 const checkedSKU = [] 582 const checkedSKU = []
572 let j; 583 let j;
573 for (let i = 0;i<that.current.length;i++) { 584 for (let i = 0;i<that.current.length;i++) {
574 checkedSKU.push(that.goodInfo.attrList[i].attr[that.current[i]]) 585 checkedSKU.push(that.goodInfo.attrList[i].attr[that.current[i]])
575 // console.log('i', i, j, i !== this.current.length - 1) 586 // console.log('i', i, j, i !== this.current.length - 1)
576 if (i !== this.current.length - 1) { 587 if (i !== this.current.length - 1) {
577 // 后续需修改算法:目前暂定只有两个参数选择,后续若有多个参数需要修改实现自适应 588 // 后续需修改算法:目前暂定只有两个参数选择,后续若有多个参数需要修改实现自适应
578 j = this.current[i] * this.attrList[1].attr.length 589 j = this.current[i] * this.attrList[1].attr.length
579 } else { 590 } else {
580 j += this.current[i] 591 j += this.current[i]
581 } 592 }
582 } 593 }
583 const price = this.skuList.filter(item=>item.sk_id == this.skuList[j].sk_id)[0].real_price 594 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 595 let sk_id = this.skuList[j].sk_id
585 // console.log('选择的商品sk_id',sk_id,'选择的商品参数',checkedSKU) 596 // console.log('选择的商品sk_id',sk_id,'选择的商品参数',checkedSKU)
586 // console.log('mp_id',this.mp_id,'数量',this.count) 597 // console.log('mp_id',this.mp_id,'数量',this.count)
587 this.$emit("addCart",this.mp_id,this.count,checkedSKU,sk_id,price)//添加购物车 598 this.$emit("addCart",this.mp_id,this.count,checkedSKU,sk_id,price)//添加购物车
588 this.$emit("closeBottom")//关闭弹窗 599 this.$emit("closeBottom")//关闭弹窗
589 } 600 }
590 }, 601 },
591 onClickLoveItem(index,name){ 602 onClickLoveItem(index,name){
592 const loveList = this.loveList 603 const loveList = this.loveList
593 this.glassInfo.glassWidth = loveList[index].glassWidth 604 this.glassInfo.glassWidth = loveList[index].glassWidth
594 this.glassInfo.norseWidth = loveList[index].norseWidth 605 this.glassInfo.norseWidth = loveList[index].norseWidth
595 this.glassInfo.legWidth = loveList[index].legWidth 606 this.glassInfo.legWidth = loveList[index].legWidth
596 for (let index = 0; index < loveList.length; index++) { 607 for (let index = 0; index < loveList.length; index++) {
597 if (name === loveList[index].name && name!==this.name) { 608 if (name === loveList[index].name && name!==this.name) {
598 this.isDataName = true 609 this.isDataName = true
599 this.kinds = 2 610 this.kinds = 2
600 this.name = loveList[index].name 611 this.name = loveList[index].name
601 this.pd = loveList[index].pd 612 this.pd = loveList[index].pd
602 this.mp_id = loveList[index].mp_id 613 this.mp_id = loveList[index].mp_id
603 this.oldname = loveList[index].name 614 this.oldname = loveList[index].name
604 this.oldpd = loveList[index].pd 615 this.oldpd = loveList[index].pd
605 this.pickerInfoList[0].nameArray1.unshift(loveList[index].leftSph) 616 this.pickerInfoList[0].nameArray1.unshift(loveList[index].leftSph)
606 this.pickerInfoList[0].nameArray2.unshift(loveList[index].rightSph) 617 this.pickerInfoList[0].nameArray2.unshift(loveList[index].rightSph)
607 this.pickerInfoList[1].nameArray1.unshift(loveList[index].leftCyl) 618 this.pickerInfoList[1].nameArray1.unshift(loveList[index].leftCyl)
608 this.pickerInfoList[1].nameArray2.unshift(loveList[index].rightCyl) 619 this.pickerInfoList[1].nameArray2.unshift(loveList[index].rightCyl)
609 this.pickerInfoList[2].nameArray1.unshift(loveList[index].leftAxi) 620 this.pickerInfoList[2].nameArray1.unshift(loveList[index].leftAxi)
610 this.pickerInfoList[2].nameArray2.unshift(loveList[index].rightAxi) 621 this.pickerInfoList[2].nameArray2.unshift(loveList[index].rightAxi)
611 this.pickerInfoList[3].nameArray1.unshift(loveList[index].in_time.toString().slice(0, 4)) 622 this.pickerInfoList[3].nameArray1.unshift(loveList[index].in_time.toString().slice(0, 4))
612 if (loveList[index].in_time.toString().slice(5, 6) === 0) { 623 if (loveList[index].in_time.toString().slice(5, 6) === 0) {
613 this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(6, 7)) 624 this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(6, 7))
614 } else { 625 } else {
615 this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(5, 7)) 626 this.pickerInfoList[3].nameArray2.unshift(loveList[index].in_time.toString().slice(5, 7))
616 } 627 }
617 if (loveList[index].in_time.toString().slice(8, 9) === 0) { 628 if (loveList[index].in_time.toString().slice(8, 9) === 0) {
618 this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(9, 10)) 629 this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(9, 10))
619 } else { 630 } else {
620 this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(8, 10)) 631 this.pickerInfoList[3].nameArray3.unshift(loveList[index].in_time.toString().slice(8, 10))
621 } 632 }
622 } 633 }
623 } 634 }
624 this.name = name; 635 this.name = name;
625 this.loveCurrent = index; 636 this.loveCurrent = index;
626 }, 637 },
627 closeSheet(){ 638 closeSheet(){
628 this.$emit('closeBottom'); 639 this.$emit('closeBottom');
629 }, 640 },
630 stopEvent(){ //@click.stop防止事件冒泡 641 stopEvent(){ //@click.stop防止事件冒泡
631 642
632 }, 643 },
633 moveHandle(){ //不让页面滚动 644 moveHandle(){ //不让页面滚动
634 645
635 }, 646 },
636 // picker相关功能 647 // picker相关功能
637 handleInput(e) { 648 handleInput(e) {
638 this.name = e.target.value 649 this.name = e.target.value
639 this.isDataName = false 650 this.isDataName = false
640 const mpList = this.mpList 651 const mpList = this.mpList
641 // console.log('mpList===>', mpList) 652 // console.log('mpList===>', mpList)
642 for (let index = 0; index < mpList.length; index++) { 653 for (let index = 0; index < mpList.length; index++) {
643 if (e.detail.value === mpList[index].name) { 654 if (e.detail.value === mpList[index].name) {
644 this.isDataName = true 655 this.isDataName = true
645 uni.showModal({ 656 uni.showModal({
646 title: '提示', 657 title: '提示',
647 content: `是否填充已有的"${e.detail.value}"的数据`, 658 content: `是否填充已有的"${e.detail.value}"的数据`,
648 success: (res) => { 659 success: (res) => {
649 if (res.confirm) { 660 if (res.confirm) {
650 this.kinds = 2 661 this.kinds = 2
651 // console.log('args===>', index) 662 // console.log('args===>', index)
652 // const mpList=Object.assign({},this.$store.state.mympList.mpList) 663 // const mpList=Object.assign({},this.$store.state.mympList.mpList)
653 this.name = mpList[index].name 664 this.name = mpList[index].name
654 this.pd = mpList[index].pd 665 this.pd = mpList[index].pd
655 this.mp_id = mpList[index].mp_id 666 this.mp_id = mpList[index].mp_id
656 this.oldname = mpList[index].name 667 this.oldname = mpList[index].name
657 this.oldpd = mpList[index].pd 668 this.oldpd = mpList[index].pd
658 // 将kinds =2时的值传到该页面 669 // 将kinds =2时的值传到该页面
659 this.pickerInfoList[0].nameArray1.unshift(mpList[index].leftSph) 670 this.pickerInfoList[0].nameArray1.unshift(mpList[index].leftSph)
660 this.pickerInfoList[0].nameArray2.unshift(mpList[index].rightSph) 671 this.pickerInfoList[0].nameArray2.unshift(mpList[index].rightSph)
661 this.pickerInfoList[1].nameArray1.unshift(mpList[index].leftCyl) 672 this.pickerInfoList[1].nameArray1.unshift(mpList[index].leftCyl)
662 this.pickerInfoList[1].nameArray2.unshift(mpList[index].rightCyl) 673 this.pickerInfoList[1].nameArray2.unshift(mpList[index].rightCyl)
663 this.pickerInfoList[2].nameArray1.unshift(mpList[index].leftAxi) 674 this.pickerInfoList[2].nameArray1.unshift(mpList[index].leftAxi)
664 this.pickerInfoList[2].nameArray2.unshift(mpList[index].rightAxi) 675 this.pickerInfoList[2].nameArray2.unshift(mpList[index].rightAxi)
665 this.pickerInfoList[3].nameArray1.unshift(mpList[index].in_time.toString().slice(0, 4)) 676 this.pickerInfoList[3].nameArray1.unshift(mpList[index].in_time.toString().slice(0, 4))
666 if (mpList[index].in_time.toString().slice(5, 6) === 0) { 677 if (mpList[index].in_time.toString().slice(5, 6) === 0) {
667 this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(6, 7)) 678 this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(6, 7))
668 } else { 679 } else {
669 this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(5, 7)) 680 this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(5, 7))
670 } 681 }
671 if (mpList[index].in_time.toString().slice(8, 9) === 0) { 682 if (mpList[index].in_time.toString().slice(8, 9) === 0) {
672 this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(9, 10)) 683 this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(9, 10))
673 } else { 684 } else {
674 this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(8, 10)) 685 this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(8, 10))
675 } 686 }
676 // this.checkedData = mpList[index] 687 // this.checkedData = mpList[index]
677 // console.log('checkedData', this.checkedData) 688 // console.log('checkedData', this.checkedData)
678 } else if (res.cancel) { 689 } else if (res.cancel) {
679 this.kinds = 2 690 this.kinds = 2
680 } 691 }
681 }, 692 },
682 }) 693 })
683 } 694 }
684 } 695 }
685 }, 696 },
686 handleInputPd(e) { 697 handleInputPd(e) {
687 // 只能输入正浮点数或正数 698 // 只能输入正浮点数或正数
688 if (/^\d+(\.\d+)?$/.test(e.target.value)) { 699 if (/^\d+(\.\d+)?$/.test(e.target.value)) {
689 this.pd = e.target.value 700 this.pd = e.target.value
690 } else { 701 } else {
691 uni.showToast({ 702 uni.showToast({
692 title: '请输入有效数据;示例:89', 703 title: '请输入有效数据;示例:89',
693 icon: 'none', 704 icon: 'none',
694 duration: 2000, 705 duration: 2000,
695 }) 706 })
696 this.pd = '' 707 this.pd = ''
697 } 708 }
698 }, 709 },
699 // changeConfirm() { 710 // changeConfirm() {
700 // this.confirm = !this.confirm 711 // this.confirm = !this.confirm
701 // }, 712 // },
702 bindPickerChange01: function(e) { 713 bindPickerChange01: function(e) {
703 this.pickerInfoList[0].nameIndex1 = e.target.value 714 this.pickerInfoList[0].nameIndex1 = e.target.value
704 this.pickerInfoChioce.leftSph = this.pickerInfoList[0].nameArray1[e.target.value] 715 this.pickerInfoChioce.leftSph = this.pickerInfoList[0].nameArray1[e.target.value]
705 }, 716 },
706 bindPickerChange02: function(e) { 717 bindPickerChange02: function(e) {
707 this.pickerInfoList[0].nameIndex2 = e.target.value 718 this.pickerInfoList[0].nameIndex2 = e.target.value
708 this.pickerInfoChioce.rightSph = this.pickerInfoList[0].nameArray2[e.target.value] 719 this.pickerInfoChioce.rightSph = this.pickerInfoList[0].nameArray2[e.target.value]
709 }, 720 },
710 721
711 bindPickerChange11: function(e) { 722 bindPickerChange11: function(e) {
712 this.pickerInfoList[1].nameIndex1 = e.target.value 723 this.pickerInfoList[1].nameIndex1 = e.target.value
713 this.pickerInfoChioce.leftCyl = this.pickerInfoList[1].nameArray1[e.target.value] 724 this.pickerInfoChioce.leftCyl = this.pickerInfoList[1].nameArray1[e.target.value]
714 }, 725 },
715 bindPickerChange12: function(e) { 726 bindPickerChange12: function(e) {
716 this.pickerInfoList[1].nameIndex2 = e.target.value 727 this.pickerInfoList[1].nameIndex2 = e.target.value
717 this.pickerInfoChioce.rightCyl = this.pickerInfoList[1].nameArray2[e.target.value] 728 this.pickerInfoChioce.rightCyl = this.pickerInfoList[1].nameArray2[e.target.value]
718 }, 729 },
719 730
720 bindPickerChange21: function(e) { 731 bindPickerChange21: function(e) {
721 this.pickerInfoList[2].nameIndex1 = e.target.value 732 this.pickerInfoList[2].nameIndex1 = e.target.value
722 this.pickerInfoChioce.leftAxi = this.pickerInfoList[2].nameArray1[e.target.value] 733 this.pickerInfoChioce.leftAxi = this.pickerInfoList[2].nameArray1[e.target.value]
723 }, 734 },
724 bindPickerChange22: function(e) { 735 bindPickerChange22: function(e) {
725 this.pickerInfoList[2].nameIndex2 = e.target.value 736 this.pickerInfoList[2].nameIndex2 = e.target.value
726 this.pickerInfoChioce.rightAxi = this.pickerInfoList[2].nameArray2[e.target.value] 737 this.pickerInfoChioce.rightAxi = this.pickerInfoList[2].nameArray2[e.target.value]
727 }, 738 },
728 739
729 bindPickerChange41: function(e) { 740 bindPickerChange41: function(e) {
730 this.pickerInfoList[3].nameIndex1 = e.target.value 741 this.pickerInfoList[3].nameIndex1 = e.target.value
731 this.pickerInfoChioce.time.year = this.pickerInfoList[3].nameArray1[e.target.value] 742 this.pickerInfoChioce.time.year = this.pickerInfoList[3].nameArray1[e.target.value]
732 }, 743 },
733 bindPickerChange42: function(e) { 744 bindPickerChange42: function(e) {
734 this.pickerInfoList[3].nameIndex2 = e.target.value 745 this.pickerInfoList[3].nameIndex2 = e.target.value
735 this.pickerInfoChioce.time.month = this.pickerInfoList[3].nameArray2[e.target.value] 746 this.pickerInfoChioce.time.month = this.pickerInfoList[3].nameArray2[e.target.value]
736 }, 747 },
737 bindPickerChange43: function(e) { 748 bindPickerChange43: function(e) {
738 this.pickerInfoList[3].nameIndex3 = e.target.value 749 this.pickerInfoList[3].nameIndex3 = e.target.value
739 this.pickerInfoChioce.time.day = this.pickerInfoList[3].nameArray3[e.target.value] 750 this.pickerInfoChioce.time.day = this.pickerInfoList[3].nameArray3[e.target.value]
740 }, 751 },
741 changeShow(num) { 752 changeShow(num) {
742 this.show[num] = !this.show[num] 753 this.show[num] = !this.show[num]
743 this.$forceUpdate() 754 this.$forceUpdate()
744 }, 755 },
745 counter(isadd) { 756 counter(isadd) {
746 if (isadd) { 757 if (isadd) {
747 this.count >= this.maxCount ? this.addDisabled = true : this.count++ 758 this.count >= this.maxCount ? this.addDisabled = true : this.count++
748 } else { 759 } else {
749 this.count <= 1 ? this.desDisabled = true : this.count-- 760 this.count <= 1 ? this.desDisabled = true : this.count--
750 } 761 }
751 }, 762 },
752 toComfirmOrder() { 763 toComfirmOrder() {
753 this.checkGlassInfo() 764 this.checkGlassInfo()
754 this.updateMylove() 765 this.updateMylove()
755 // 先处理验光部分的逻辑,如果ok在跳转 766 // 先处理验光部分的逻辑,如果ok在跳转
756 let flag = 0 767 let flag = 0
757 if (this.name === '') { 768 if (this.name === '') {
758 uni.showToast({ 769 uni.showToast({
759 title: '请输入验光单取名', 770 title: '请输入验光单取名',
760 icon: 'none', 771 icon: 'none',
761 duration: 2000, 772 duration: 2000,
762 }) 773 })
763 } else { 774 } else {
764 if (this.pd === '') { 775 if (this.pd === '') {
765 uni.showToast({ 776 uni.showToast({
766 title: '请输入瞳距', 777 title: '请输入瞳距',
767 icon: 'none', 778 icon: 'none',
768 duration: 2000, 779 duration: 2000,
769 }) 780 })
770 } else { 781 } else {
771 if (this.kinds === 1) { 782 if (this.kinds === 1) {
772 // 添加用户验光单 783 // 添加用户验光单
773 if (this.pickerInfoChioce.rightSph === '' || this.pickerInfoChioce.leftSph === '' || 784 if (this.pickerInfoChioce.rightSph === '' || this.pickerInfoChioce.leftSph === '' ||
774 this.pickerInfoChioce.leftCyl === '' || this.pickerInfoChioce.rightCyl === '' || 785 this.pickerInfoChioce.leftCyl === '' || this.pickerInfoChioce.rightCyl === '' ||
775 this.pickerInfoChioce.leftAxi === '' || this.pickerInfoChioce.rightAxi === '' 786 this.pickerInfoChioce.leftAxi === '' || this.pickerInfoChioce.rightAxi === ''
776 ) { 787 ) {
777 uni.showToast({ 788 uni.showToast({
778 title: '请输入您的验光数据', 789 title: '请输入您的验光数据',
779 icon: 'none', 790 icon: 'none',
780 duration: 2000, 791 duration: 2000,
781 }) 792 })
782 } else { 793 } else {
783 // if (this.confirm) { 794 // if (this.confirm) {
784 store.dispatch('myLoveList/addMylove', { 795 store.dispatch('myLoveList/addMylove', {
785 uid: this.$store.state.user.userInfo.uid, 796 uid: this.$store.state.user.userInfo.uid,
786 openid: this.$store.state.user.userInfo.openid, 797 openid: this.$store.state.user.userInfo.openid,
787 // mp_name: this.$store.state.user.userInfo.mp_name, 798 // mp_name: this.$store.state.user.userInfo.mp_name,
788 leftSph: this.pickerInfoChioce.leftSph, 799 leftSph: this.pickerInfoChioce.leftSph,
789 rightSph: this.pickerInfoChioce.rightSph, 800 rightSph: this.pickerInfoChioce.rightSph,
790 leftCyl: this.pickerInfoChioce.leftCyl, 801 leftCyl: this.pickerInfoChioce.leftCyl,
791 rightCyl: this.pickerInfoChioce.rightCyl, 802 rightCyl: this.pickerInfoChioce.rightCyl,
792 leftAxi: this.pickerInfoChioce.leftAxi, 803 leftAxi: this.pickerInfoChioce.leftAxi,
793 rightAxi: this.pickerInfoChioce.rightAxi, 804 rightAxi: this.pickerInfoChioce.rightAxi,
794 pd: this.pd, // 瞳距 805 pd: this.pd, // 瞳距
795 mp_name: this.name, 806 mp_name: this.name,
796 // time: this.pickerInfoChioce.time, 807 // time: this.pickerInfoChioce.time,
797 // img_url2: "http://localhost:8087/images/shop_1/1/", 808 // img_url2: "http://localhost:8087/images/shop_1/1/",
798 }).then(({ mp_id: mpId }) => { 809 }).then(({ mp_id: mpId }) => {
799 this.mp_id = mpId 810 this.mp_id = mpId
800 }) 811 })
801 flag = 1 812 flag = 1
802 } 813 }
803 } 814 }
804 if (this.kinds === 2) { 815 if (this.kinds === 2) {
805 // if (this.confirm) { 816 // if (this.confirm) {
806 const leftList = ['leftSph', 'leftCyl', 'leftAxi'] 817 const leftList = ['leftSph', 'leftCyl', 'leftAxi']
807 const rightList = ['rightSph', 'rightCyl', 'rightAxi'] 818 const rightList = ['rightSph', 'rightCyl', 'rightAxi']
808 // let flag=0; 819 // let flag=0;
809 if (this.name !== this.oldname) { 820 if (this.name !== this.oldname) {
810 store.dispatch('myLoveList/updateMylove', { 821 store.dispatch('myLoveList/updateMylove', {
811 uid: this.$store.state.user.userInfo.uid, 822 uid: this.$store.state.user.userInfo.uid,
812 openid: this.$store.state.user.userInfo.openid, 823 openid: this.$store.state.user.userInfo.openid,
813 mp_id: this.mp_id, 824 mp_id: this.mp_id,
814 keyname: 'name', 825 keyname: 'name',
815 keyvalue: this.name, 826 keyvalue: this.name,
816 }) 827 })
817 flag = 1 828 flag = 1
818 } 829 }
819 if (this.pd !== this.oldpd) { 830 if (this.pd !== this.oldpd) {
820 store.dispatch('myLoveList/updateMylove', { 831 store.dispatch('myLoveList/updateMylove', {
821 uid: this.$store.state.user.userInfo.uid, 832 uid: this.$store.state.user.userInfo.uid,
822 openid: this.$store.state.user.userInfo.openid, 833 openid: this.$store.state.user.userInfo.openid,
823 mp_id: this.mp_id, 834 mp_id: this.mp_id,
824 keyname: 'pd', 835 keyname: 'pd',
825 keyvalue: this.pd, 836 keyvalue: this.pd,
826 }) 837 })
827 flag = 1 838 flag = 1
828 } 839 }
829 // 先验证是否输入有无空 840 // 先验证是否输入有无空
830 let q = true 841 let q = true
831 for (let k = 0; k < 3; k++) { 842 for (let k = 0; k < 3; k++) {
832 q = q && (this.pickerInfoList[k].nameArray1[this.pickerInfoList[k].nameIndex1] !== '' && 843 q = q && (this.pickerInfoList[k].nameArray1[this.pickerInfoList[k].nameIndex1] !== '' &&
833 this.pickerInfoList[k].nameArray2[this.pickerInfoList[k].nameIndex2] !== '') 844 this.pickerInfoList[k].nameArray2[this.pickerInfoList[k].nameIndex2] !== '')
834 } 845 }
835 if (q) { 846 if (q) {
836 for (let j = 0; j < 3; j++) { 847 for (let j = 0; j < 3; j++) {
837 if (this.pickerInfoList[j].nameIndex1 !== 0) { 848 if (this.pickerInfoList[j].nameIndex1 !== 0) {
838 store.dispatch('myLoveList/updateMylove', { 849 store.dispatch('myLoveList/updateMylove', {
839 uid: this.$store.state.user.userInfo.uid, 850 uid: this.$store.state.user.userInfo.uid,
840 openid: this.$store.state.user.userInfo.openid, 851 openid: this.$store.state.user.userInfo.openid,
841 mp_id: this.mp_id, 852 mp_id: this.mp_id,
842 keyname: leftList[j], 853 keyname: leftList[j],
843 keyvalue: this.pickerInfoList[j].nameArray1[this.pickerInfoList[j].nameIndex1], 854 keyvalue: this.pickerInfoList[j].nameArray1[this.pickerInfoList[j].nameIndex1],
844 }) 855 })
845 } 856 }
846 if (this.pickerInfoList[j].nameIndex2 !== 0) { 857 if (this.pickerInfoList[j].nameIndex2 !== 0) {
847 store.dispatch('myLoveList/updateMylove', { 858 store.dispatch('myLoveList/updateMylove', {
848 uid: this.$store.state.user.userInfo.uid, 859 uid: this.$store.state.user.userInfo.uid,
849 openid: this.$store.state.user.userInfo.openid, 860 openid: this.$store.state.user.userInfo.openid,
850 mp_id: this.mp_id, 861 mp_id: this.mp_id,
851 keyname: rightList[j], 862 keyname: rightList[j],
852 keyvalue: this.pickerInfoList[j].nameArray2[this.pickerInfoList[j].nameIndex2], 863 keyvalue: this.pickerInfoList[j].nameArray2[this.pickerInfoList[j].nameIndex2],
853 }) 864 })
854 } 865 }
855 flag = 1 866 flag = 1
856 } 867 }
857 } else { 868 } else {
858 flag = 0 869 flag = 0
859 uni.showToast({ 870 uni.showToast({
860 title: '请输入您的验光数据', 871 title: '请输入您的验光数据',
861 icon: 'none', 872 icon: 'none',
862 duration: 2000, 873 duration: 2000,
863 }) 874 })
864 } 875 }
865 876
866 // } else { 877 // } else {
867 // uni.showToast({ 878 // uni.showToast({
868 // title: '请确认您的验光数据', 879 // title: '请确认您的验光数据',
869 // icon: 'none', 880 // icon: 'none',
870 // duration: 3000, 881 // duration: 3000,
871 // }) 882 // })
872 // } 883 // }
873 } 884 }
874 } 885 }
875 } 886 }
876 if (flag !== 0) { 887 if (flag !== 0) {
877 // 如果数据验证无误,那么更新验光单的数据 888 // 如果数据验证无误,那么更新验光单的数据
878 store.dispatch('myLoveList/getLoveList', { 889 store.dispatch('myLoveList/getLoveList', {
879 uid: this.$store.state.user.userInfo.uid, 890 uid: this.$store.state.user.userInfo.uid,
880 }) 891 })
881 let i = 0 892 let i = 0
882 // 判断出是哪一个sku被选中 893 // 判断出是哪一个sku被选中
883 for (let index = 0; index < this.current.length; index++) { 894 for (let index = 0; index < this.current.length; index++) {
884 // console.log('index', index, i, index !== this.current.length - 1) 895 // console.log('index', index, i, index !== this.current.length - 1)
885 if (index !== this.current.length - 1) { 896 if (index !== this.current.length - 1) {
886 // 后续需修改算法:目前暂定只有两个参数选择,后续若有多个参数需要修改实现自适应 897 // 后续需修改算法:目前暂定只有两个参数选择,后续若有多个参数需要修改实现自适应
887 i = this.current[index] * this.attrList[1].attr.length 898 i = this.current[index] * this.attrList[1].attr.length
888 } else { 899 } else {
889 i += this.current[index] 900 i += this.current[index]
890 } 901 }
891 } 902 }
892 // 判断是否其输入的人员数据是否已存在 903 // 判断是否其输入的人员数据是否已存在
893 store.dispatch('order/saveParams', { 904 store.dispatch('order/saveParams', {
894 sk_id_arr: this.skuList[i], 905 sk_id_arr: this.skuList[i],
895 current: this.current, 906 current: this.current,
896 mp_id: this.mp_id, 907 mp_id: this.mp_id,
897 attrList: this.attrList, 908 attrList: this.attrList,
898 }) 909 })
899 this.$store.state.cart.buyItem = this.skuItem 910 this.$store.state.cart.buyItem = this.skuItem
900 // 跳转到确认订单页面 911 // 跳转到确认订单页面
901 uni.navigateTo({ 912 uni.navigateTo({
902 url: `../confirmOrder/confirmOrder?pid=${this.pid}&count=${this.count}&name=${this.name}&isCart=false`, 913 url: `../confirmOrder/confirmOrder?pid=${this.pid}&count=${this.count}&name=${this.name}&isCart=false`,
903 }) 914 })
904 } 915 }
905 }, 916 },
906 } 917 }
907 } 918 }
908 </script> 919 </script>
909 920
910 <style lang="scss"> 921 <style lang="scss">
911 .BottomSheetContent { 922 .BottomSheetContent {
912 min-height: 100vh; 923 min-height: 100vh;
913 background-color: #f2f2f2; 924 background-color: #f2f2f2;
914 // padding-top: 20rpx; 925 // padding-top: 20rpx;
915 .goodInfo { 926 .goodInfo {
916 width: 100%; 927 width: 100%;
917 height: 272rpx; 928 height: 272rpx;
918 border-radius: 16rpx; 929 border-radius: 16rpx;
919 background-color: #ffffff; 930 background-color: #ffffff;
920 box-sizing: border-box; 931 box-sizing: border-box;
921 padding: 36rpx; 932 padding: 36rpx;
922 display: flex; 933 display: flex;
923 flex-direction: row; 934 flex-direction: row;
924 justify-content: flex-start; 935 justify-content: flex-start;
925 position: sticky; 936 position: sticky;
926 top: 0rpx; 937 top: 0rpx;
927 left: 0rpx; 938 left: 0rpx;
928 z-index: 99999; 939 z-index: 99999;
929 .imageWrap { 940 .imageWrap {
930 height: 188rpx; 941 height: 188rpx;
931 width: 188rpx; 942 width: 188rpx;
932 margin-right: 28rpx; 943 margin-right: 28rpx;
933 image { 944 image {
934 height: 188rpx; 945 height: 188rpx;
935 width: 188rpx; 946 width: 188rpx;
936 } 947 }
937 } 948 }
938 .infoRight { 949 .infoRight {
939 display: flex; 950 display: flex;
940 flex-direction: column; 951 flex-direction: column;
941 align-items: flex-start; 952 align-items: flex-start;
942 justify-content: space-between; 953 justify-content: space-between;
943 width: 100%; 954 width: 100%;
944 .goodName { 955 .goodName {
945 font-size: 28rpx; 956 font-size: 28rpx;
946 color: #333333; 957 color: #333333;
947 } 958 }
948 .remarks { 959 .remarks {
949 font-size: 20rpx; 960 font-size: 20rpx;
950 color: #999999; 961 color: #999999;
951 } 962 }
952 .priceBox { 963 .priceBox {
953 display: flex; 964 display: flex;
954 justify-content: space-between; 965 justify-content: space-between;
955 align-items: center; 966 align-items: center;
956 width: 100%; 967 width: 100%;
957 font-size: 14px; 968 font-size: 14px;
958 color: #999999; 969 color: #999999;
959 .price { 970 .price {
960 color: #ff6b4a; 971 color: #ff6b4a;
961 font-size: 28rpx; 972 font-size: 28rpx;
962 } 973 }
963 .counter { 974 .counter {
964 display: flex; 975 display: flex;
965 flex-direction: row; 976 flex-direction: row;
966 justify-content: space-between; 977 justify-content: space-between;
967 align-items: center; 978 align-items: center;
968 font-size: 28rpx; 979 font-size: 28rpx;
969 color: #333333; 980 color: #333333;
970 width: 122rpx; 981 width: 122rpx;
971 .btn { 982 .btn {
972 display: flex; 983 display: flex;
973 justify-content: center; 984 justify-content: center;
974 line-height: 32rpx; 985 line-height: 32rpx;
975 height: 32rpx; 986 height: 32rpx;
976 width: 32rpx; 987 width: 32rpx;
977 background-color: #f2f2f2; 988 background-color: #f2f2f2;
978 color: #cfcfcf; 989 color: #cfcfcf;
979 } 990 }
980 } 991 }
981 } 992 }
982 } 993 }
983 } 994 }
984 .peopleChoose{ 995 .peopleChoose{
985 width: 100%; 996 width: 100%;
986 min-height: 200rpx; 997 min-height: 200rpx;
987 border-radius: 16rpx; 998 border-radius: 16rpx;
988 background-color: #ffffff; 999 background-color: #ffffff;
989 box-sizing: border-box; 1000 box-sizing: border-box;
990 padding: 36rpx; 1001 padding: 36rpx;
991 margin: 10px 0; 1002 margin: 10px 0;
992 display: flex; 1003 display: flex;
993 flex-direction: column; 1004 flex-direction: column;
994 justify-content: flex-start; 1005 justify-content: flex-start;
995 align-items: center; 1006 align-items: center;
996 .title{ 1007 .title{
997 font-size: 16px; 1008 font-size: 16px;
998 color: #333333; 1009 color: #333333;
999 letter-spacing: -0.3px; 1010 letter-spacing: -0.3px;
1000 text-align: justify; 1011 text-align: justify;
1001 line-height: 24px; 1012 line-height: 24px;
1002 margin: 4px 0; 1013 margin: 4px 0;
1003 } 1014 }
1004 .loveList{ 1015 .loveList{
1005 display: flex; 1016 display: flex;
1006 flex-direction: row; 1017 flex-direction: row;
1007 flex-wrap: wrap; 1018 flex-wrap: wrap;
1008 justify-content: flex-start; 1019 justify-content: flex-start;
1009 align-items: center; 1020 align-items: center;
1010 padding-top: 24rpx; 1021 padding-top: 24rpx;
1011 width: 100%; 1022 width: 100%;
1012 .peopleName { 1023 .peopleName {
1013 padding: 0 30rpx; 1024 padding: 0 30rpx;
1014 height: 60rpx; 1025 height: 60rpx;
1015 margin: 0 20rpx 20rpx 0; 1026 margin: 0 20rpx 20rpx 0;
1016 transition: all 0.3s; 1027 transition: all 0.3s;
1017 background: #f2f2f2; 1028 background: #f2f2f2;
1018 border-radius: 2px; 1029 border-radius: 2px;
1019 border-radius: 2px; 1030 border-radius: 2px;
1020 line-height: 60rpx; 1031 line-height: 60rpx;
1021 text-align: center; 1032 text-align: center;
1022 color: #666666; 1033 color: #666666;
1023 font-size: 12px; 1034 font-size: 12px;
1024 } 1035 }
1025 .active2 { 1036 .active2 {
1026 background: rgba(255, 107, 74, 0.15); 1037 background: rgba(255, 107, 74, 0.15);
1027 color: #ff6b4a; 1038 color: #ff6b4a;
1028 } 1039 }
1029 } 1040 }
1030 } 1041 }
1031 .goods-data { 1042 .goods-data {
1032 width: 100%; 1043 width: 100%;
1033 box-sizing: border-box; 1044 box-sizing: border-box;
1034 padding: 37rpx 40rpx 0 40rpx; 1045 padding: 37rpx 40rpx 0 40rpx;
1035 background: #ffffff; 1046 background: #ffffff;
1036 border-radius: 12rpx; 1047 border-radius: 12rpx;
1037 .opCollapse { 1048 .opCollapse {
1038 width: 100%; 1049 width: 100%;
1039 padding-bottom: 28rpx; 1050 padding-bottom: 28rpx;
1040 margin-top: 7px; 1051 margin-top: 7px;
1041 border-bottom: 1px solid #e9e9e9; 1052 border-bottom: 1px solid #e9e9e9;
1042 .head { 1053 .head {
1043 display: flex; 1054 display: flex;
1044 justify-content: space-between; 1055 justify-content: space-between;
1045 height: 24px; 1056 height: 24px;
1046 // font-family: PingFangSC-Medium; 1057 // font-family: PingFangSC-Medium;
1047 font-size: 16px; 1058 font-size: 16px;
1048 color: #333333; 1059 color: #333333;
1049 letter-spacing: -0.3px; 1060 letter-spacing: -0.3px;
1050 text-align: justify; 1061 text-align: justify;
1051 line-height: 24px; 1062 line-height: 24px;
1052 margin-bottom: 18rpx; 1063 margin-bottom: 18rpx;
1053 .headRighted { 1064 .headRighted {
1054 width: 0; 1065 width: 0;
1055 height: 0; 1066 height: 0;
1056 border-left: 4px solid transparent; 1067 border-left: 4px solid transparent;
1057 border-right: 4px solid transparent; 1068 border-right: 4px solid transparent;
1058 border-bottom: 4px solid #cfcfcf; 1069 border-bottom: 4px solid #cfcfcf;
1059 transform: scaleY(-1); 1070 transform: scaleY(-1);
1060 margin-top: 10px; 1071 margin-top: 10px;
1061 } 1072 }
1062 .headMid { 1073 .headMid {
1063 font-size: 10px; 1074 font-size: 10px;
1064 color: #999999; 1075 color: #999999;
1065 letter-spacing: -0.19px; 1076 letter-spacing: -0.19px;
1066 margin-left: -120rpx; 1077 margin-left: -120rpx;
1067 } 1078 }
1068 .headRight { 1079 .headRight {
1069 width: 0; 1080 width: 0;
1070 height: 0; 1081 height: 0;
1071 border-left: 4px solid transparent; 1082 border-left: 4px solid transparent;
1072 border-right: 4px solid transparent; 1083 border-right: 4px solid transparent;
1073 border-bottom: 4px solid #cfcfcf; 1084 border-bottom: 4px solid #cfcfcf;
1074 margin-top: 10px; 1085 margin-top: 10px;
1075 } 1086 }
1076 } 1087 }
1077 .body { 1088 .body {
1078 font-size: 12px; 1089 font-size: 12px;
1079 color: #666666; 1090 color: #666666;
1080 letter-spacing: 0; 1091 letter-spacing: 0;
1081 .bodyBox { 1092 .bodyBox {
1082 margin-top: 15px; 1093 margin-top: 15px;
1083 .names { 1094 .names {
1084 font-size: 12px; 1095 font-size: 12px;
1085 color: #151515; 1096 color: #151515;
1086 letter-spacing: 0; 1097 letter-spacing: 0;
1087 text-align: justify; 1098 text-align: justify;
1088 line-height: 17px; 1099 line-height: 17px;
1089 margin-left: 5px; 1100 margin-left: 5px;
1090 margin-right: 10px; 1101 margin-right: 10px;
1091 } 1102 }
1092 text { 1103 text {
1093 font-size: 12px; 1104 font-size: 12px;
1094 color: #666666; 1105 color: #666666;
1095 letter-spacing: 0; 1106 letter-spacing: 0;
1096 text-align: justify; 1107 text-align: justify;
1097 } 1108 }
1098 } 1109 }
1099 } 1110 }
1100 .goods-form { 1111 .goods-form {
1101 display: flex; 1112 display: flex;
1102 flex-direction: column; 1113 flex-direction: column;
1103 align-items: center; 1114 align-items: center;
1104 justify-content: center; 1115 justify-content: center;
1105 background-color: #fff; 1116 background-color: #fff;
1106 width: 100%; 1117 width: 100%;
1107 padding: 40rpx 0; 1118 padding: 40rpx 0;
1108 .p1 { 1119 .p1 {
1109 font-size: 16px; 1120 font-size: 16px;
1110 color: #333333; 1121 color: #333333;
1111 letter-spacing: -0.3px; 1122 letter-spacing: -0.3px;
1112 text-align: justify; 1123 text-align: justify;
1113 line-height: 24px; 1124 line-height: 24px;
1114 margin: 4px 0; 1125 margin: 4px 0;
1115 1126
1116 } 1127 }
1117 .p2 { 1128 .p2 {
1118 font-size: 12px; 1129 font-size: 12px;
1119 color: #999999; 1130 color: #999999;
1120 letter-spacing: -0.23px; 1131 letter-spacing: -0.23px;
1121 margin-bottom: 32rpx; 1132 margin-bottom: 32rpx;
1122 } 1133 }
1123 .image2{ 1134 .image2{
1124 width: 42rpx; 1135 width: 42rpx;
1125 height: 34rpx; 1136 height: 34rpx;
1126 margin-right: 12rpx; 1137 margin-right: 12rpx;
1127 } 1138 }
1128 .confirm { 1139 .confirm {
1129 display: flex; 1140 display: flex;
1130 align-items: center; 1141 align-items: center;
1131 font-size: 12px; 1142 font-size: 12px;
1132 color: #666666; 1143 color: #666666;
1133 letter-spacing: -0.23px; 1144 letter-spacing: -0.23px;
1134 width: 684rpx; 1145 width: 684rpx;
1135 .image1{ 1146 .image1{
1136 margin-right:25rpx; 1147 margin-right:25rpx;
1137 width: 42rpx; 1148 width: 42rpx;
1138 height: 38rpx; 1149 height: 38rpx;
1139 } 1150 }
1140 } 1151 }
1141 .picker{ 1152 .picker{
1142 display: flex; 1153 display: flex;
1143 flex-direction: column; 1154 flex-direction: column;
1144 justify-content: center; 1155 justify-content: center;
1145 align-items: center; 1156 align-items: center;
1146 width: 100%; 1157 width: 100%;
1147 1158
1148 .picker-choice{ 1159 .picker-choice{
1149 display: flex; 1160 display: flex;
1150 width: 684rpx; 1161 width: 684rpx;
1151 align-items: center; 1162 align-items: center;
1152 margin-bottom: 40rpx; 1163 margin-bottom: 40rpx;
1153 .input{ 1164 .input{
1154 border-bottom: 1px solid #CFCFCF; 1165 border-bottom: 1px solid #CFCFCF;
1155 height: 40rpx; 1166 height: 40rpx;
1156 } 1167 }
1157 .choice-left{ 1168 .choice-left{
1158 width: 210rpx; 1169 width: 210rpx;
1159 .pd{ 1170 .pd{
1160 font-size: 14px; 1171 font-size: 14px;
1161 color: #333333; 1172 color: #333333;
1162 letter-spacing: -0.26px; 1173 letter-spacing: -0.26px;
1163 text-align: justify; 1174 text-align: justify;
1164 line-height: 24px; 1175 line-height: 24px;
1165 margin-right: 44rpx; 1176 margin-right: 44rpx;
1166 } 1177 }
1167 .p11 { 1178 .p11 {
1168 font-size: 14px; 1179 font-size: 14px;
1169 color: #333333; 1180 color: #333333;
1170 letter-spacing: -0.26px; 1181 letter-spacing: -0.26px;
1171 text-align: justify; 1182 text-align: justify;
1172 line-height: 24px; 1183 line-height: 24px;
1173 // margin-right: 10px; 1184 // margin-right: 10px;
1174 } 1185 }
1175 .p12 { 1186 .p12 {
1176 font-size: 10px; 1187 font-size: 10px;
1177 color: #3F3F3F; 1188 color: #3F3F3F;
1178 letter-spacing: -0.19px; 1189 letter-spacing: -0.19px;
1179 text-align: justify; 1190 text-align: justify;
1180 line-height: 24px; 1191 line-height: 24px;
1181 } 1192 }
1182 1193
1183 } 1194 }
1184 .p13 { 1195 .p13 {
1185 font-size: 10px; 1196 font-size: 10px;
1186 color: #999999; 1197 color: #999999;
1187 letter-spacing: -0.19px; 1198 letter-spacing: -0.19px;
1188 margin-right: 10px; 1199 margin-right: 10px;
1189 } 1200 }
1190 .p13-date { 1201 .p13-date {
1191 font-size: 10px; 1202 font-size: 10px;
1192 color: #999999; 1203 color: #999999;
1193 letter-spacing: -0.19px; 1204 letter-spacing: -0.19px;
1194 margin-right: 5px; 1205 margin-right: 5px;
1195 } 1206 }
1196 picker{ 1207 picker{
1197 width: 144rpx; 1208 width: 144rpx;
1198 height: 40rpx; 1209 height: 40rpx;
1199 display: flex; 1210 display: flex;
1200 position: relative; 1211 position: relative;
1201 .p14 { 1212 .p14 {
1202 font-size: 14px; 1213 font-size: 14px;
1203 color: #666666; 1214 color: #666666;
1204 letter-spacing: -0.26px; 1215 letter-spacing: -0.26px;
1205 text-align: center; 1216 text-align: center;
1206 width: 124rpx; 1217 width: 124rpx;
1207 border-bottom: 1px solid #CFCFCF; 1218 border-bottom: 1px solid #CFCFCF;
1208 height: 38rpx; 1219 height: 38rpx;
1209 } 1220 }
1210 image{ 1221 image{
1211 width: 20rpx; 1222 width: 20rpx;
1212 height: 20rpx; 1223 height: 20rpx;
1213 position: absolute; 1224 position: absolute;
1214 right: 20rpx; 1225 right: 20rpx;
1215 top: 8rpx; 1226 top: 8rpx;
1216 } 1227 }
1217 } 1228 }
1218 1229
1219 } 1230 }
1220 } 1231 }
1221 1232
1222 .ipts{ 1233 .ipts{
1223 width: 100%; 1234 width: 100%;
1224 display: flex; 1235 display: flex;
1225 flex-direction: column; 1236 flex-direction: column;
1226 justify-content: center; 1237 justify-content: center;
1227 align-items: flex-start; 1238 align-items: flex-start;
1228 // padding: 20rpx 36rpx; 1239 // padding: 20rpx 36rpx;
1229 box-sizing: border-box; 1240 box-sizing: border-box;
1230 .inputItem{ 1241 .inputItem{
1231 display: flex; 1242 display: flex;
1232 flex-direction: row; 1243 flex-direction: row;
1233 justify-content: center; 1244 justify-content: center;
1234 align-items: center; 1245 align-items: center;
1235 margin-bottom: 36rpx; 1246 margin-bottom: 36rpx;
1236 .text{ 1247 .text{
1237 margin-right: 100rpx; 1248 margin-right: 100rpx;
1238 } 1249 }
1239 .input{ 1250 .input{
1240 border-bottom: 1px solid #CFCFCF; 1251 border-bottom: 1px solid #CFCFCF;
1241 } 1252 }
1242 } 1253 }
1243 1254
1244 } 1255 }
1245 } 1256 }
1246 } 1257 }
1247 } 1258 }
1248 .choose { 1259 .choose {
1249 width: 100%; 1260 width: 100%;
1250 background: #ffffff; 1261 background: #ffffff;
1251 border-radius: 12rpx; 1262 border-radius: 12rpx;
1252 margin-top: 20rpx; 1263 margin-top: 20rpx;
1253 padding: 40rpx 40rpx 112rpx 40rpx; 1264 padding: 40rpx 40rpx 112rpx 40rpx;
1254 box-sizing: border-box; 1265 box-sizing: border-box;
1255 .chooseItem { 1266 .chooseItem {
1256 width: 100%; 1267 width: 100%;
1257 padding-bottom: 32rpx; 1268 padding-bottom: 32rpx;
1258 border-bottom: 1px solid #e9e9e9; 1269 border-bottom: 1px solid #e9e9e9;
1259 margin-bottom: 28rpx; 1270 margin-bottom: 28rpx;
1260 } 1271 }
1261 .chooseRes { 1272 .chooseRes {
1262 font-size: 12px; 1273 font-size: 12px;
1263 color: #666666; 1274 color: #666666;
1264 } 1275 }
1265 .itemsWrap { 1276 .itemsWrap {
1266 display: flex; 1277 display: flex;
1267 flex-direction: row; 1278 flex-direction: row;
1268 flex-wrap: wrap; 1279 flex-wrap: wrap;
1269 justify-content: flex-start; 1280 justify-content: flex-start;
1270 align-items: center; 1281 align-items: center;
1271 padding-top: 24rpx; 1282 padding-top: 24rpx;
1272 .item1 { 1283 .item1 {
1273 width: 64rpx; 1284 width: 64rpx;
1274 height: 64rpx; 1285 height: 64rpx;
1275 border-radius: 32rpx; 1286 border-radius: 32rpx;
1276 margin: 0 36rpx 24rpx 0; 1287 margin: 0 36rpx 24rpx 0;
1277 transition: all 0.3s; 1288 transition: all 0.3s;
1278 border: 1px solid #ffffff; 1289 border: 1px solid #ffffff;
1279 } 1290 }
1280 .item2 { 1291 .item2 {
1281 // width: 100rpx; 1292 // width: 100rpx;
1282 padding: 0 30rpx; 1293 padding: 0 30rpx;
1283 height: 60rpx; 1294 height: 60rpx;
1284 margin: 0 20rpx 20rpx 0; 1295 margin: 0 20rpx 20rpx 0;
1285 transition: all 0.3s; 1296 transition: all 0.3s;
1286 background: #f2f2f2; 1297 background: #f2f2f2;
1287 border-radius: 2px; 1298 border-radius: 2px;
1288 border-radius: 2px; 1299 border-radius: 2px;
1289 line-height: 60rpx; 1300 line-height: 60rpx;
1290 text-align: center; 1301 text-align: center;
1291 color: #666666; 1302 color: #666666;
1292 font-size: 12px; 1303 font-size: 12px;
1293 } 1304 }
1294 .active1 { 1305 .active1 {
1295 opacity: 0.7; 1306 opacity: 0.7;
1296 border: 1px solid #ff6b4a; 1307 border: 1px solid #ff6b4a;
1297 } 1308 }
1298 .active2 { 1309 .active2 {
1299 background: rgba(255, 107, 74, 0.15); 1310 background: rgba(255, 107, 74, 0.15);
1300 color: #ff6b4a; 1311 color: #ff6b4a;
1301 } 1312 }
1302 } 1313 }
1303 } 1314 }
1304 .button { 1315 .button {
1305 width: 100%; 1316 width: 100%;
1306 height: 112rpx; 1317 height: 112rpx;
1307 background-color: #ff6b4a; 1318 background-color: #ff6b4a;
1308 font-size: 16px; 1319 font-size: 16px;
1309 color: #ffffff; 1320 color: #ffffff;
1310 line-height: 112rpx; 1321 line-height: 112rpx;
1311 text-align: center; 1322 text-align: center;
1312 position: sticky; 1323 position: sticky;
1313 bottom: 0rpx; 1324 bottom: 0rpx;
1314 left: 0rpx; 1325 left: 0rpx;
1315 z-index: 9999; 1326 z-index: 9999;
1316 } 1327 }
1317 } 1328 }
1318 /* sheet弹窗 */ 1329 /* sheet弹窗 */
1319 .sheet{ 1330 .sheet{
1320 width: 100%; 1331 width: 100%;
1321 height: 100%; 1332 height: 100%;
1322 position: fixed; 1333 position: fixed;
1323 top: 150%; 1334 top: 150%;
1324 left: 0upx; 1335 left: 0upx;
1325 bottom: 0upx; 1336 bottom: 0upx;
1326 right: 0upx; 1337 right: 0upx;
1327 background:rgba(0,0,0,0.3); 1338 background:rgba(0,0,0,0.3);
1328 z-index: 10000; 1339 z-index: 10000;
1329 } 1340 }
1330 1341
1331 /* 显示时候的动画默认0.5s */ 1342 /* 显示时候的动画默认0.5s */
1332 .sheetView{ 1343 .sheetView{
1333 width: 100%; 1344 width: 100%;
1334 height: 0upx; 1345 height: 0upx;
1335 position: absolute; 1346 position: absolute;
1336 bottom: 0upx; 1347 bottom: 0upx;
1337 background: white; 1348 background: white;
1338 z-index: 10001; 1349 z-index: 10001;
1339 transition: all 0.5s; 1350 transition: all 0.5s;
1340 } 1351 }
1341 .sheetShow{ 1352 .sheetShow{
1342 top:0upx !important; 1353 top:0upx !important;
1343 } 1354 }
1344 /* 关闭时的动画,时间自己可以设置0.5s*/ 1355 /* 关闭时的动画,时间自己可以设置0.5s*/
1345 .sheeHide{ 1356 .sheeHide{
1346 top:120% !important; 1357 top:120% !important;
1347 transition: all 0.5s; 1358 transition: all 0.5s;
1348 } 1359 }
1349 1360
1350 /* 项目需求根据设计稿要展示的高度,超出这个高度就自动滚动*/ 1361 /* 项目需求根据设计稿要展示的高度,超出这个高度就自动滚动*/
1351 .sheetView_active{ 1362 .sheetView_active{
1352 height: 1042upx; 1363 height: 1042upx;
1353 } 1364 }
1354 1365
1355 </style> 1366 </style>
1356 1367