Commit 43f318e26dcdb33fe7b62943a1a723834045797e
Exists in
master
Merge branch 'master' of http://121.40.31.31:8888/jp/gulu-vue
Showing
2 changed files
Show diff stats
src/pages/cart/cart.vue
1 | <template> | 1 | <template> |
2 | <view class="content"> | 2 | <view class="content"> |
3 | <block v-if="cartList.length==0"> | 3 | <block v-if="cartList.length==0"> |
4 | 4 | ||
5 | </block> | 5 | </block> |
6 | <block v-else> | 6 | <block v-else> |
7 | <view class="card"> | 7 | <view class="card"> |
8 | <view class="cardHeader"> | 8 | <view class="cardHeader"> |
9 | <view v-bind:class="pIsoPen? 'partentChecked' : 'partentCheck'" | 9 | <view v-bind:class="pIsoPen? 'partentChecked' : 'partentCheck'" |
10 | @tap="pChange(pIsoPen)"> | 10 | @tap="pChange(pIsoPen)"> |
11 | <span class="correct"></span> | 11 | <span class="correct"></span> |
12 | </view> | 12 | </view> |
13 | <image src="../../static/store.png" mode="aspectFill"></image> | 13 | <image src="../../static/store.png" mode="aspectFill"></image> |
14 | <text>非常戴镜</text> | 14 | <text>非常戴镜</text> |
15 | </view> | 15 | </view> |
16 | 16 | ||
17 | <view class="cardBody" v-for="(item,index) in cartList" :key="index" | 17 | <view class="cardBody" v-for="(item,index) in cartList" :key="index" |
18 | @longpress="delCart(item.cart_id,index)"> | 18 | @longpress="delCart(item.cart_id,index)"> |
19 | <view v-bind:class="childIsOpen[index]? 'partentChecked':'partentCheck'" | 19 | <view v-bind:class="childIsOpen[index]? 'partentChecked':'partentCheck'" |
20 | @tap="Change(childIsOpen[index],index)"> | 20 | @tap="Change(childIsOpen[index],index)"> |
21 | <span class="correct"></span> | 21 | <span class="correct"></span> |
22 | </view> | 22 | </view> |
23 | <view class="imageWrap"> | 23 | <view class="imageWrap"> |
24 | <image :src="item.img_index_url" mode="aspectFit" style="width: 188rpx;height: 168rpx;"></image> | 24 | <image :src="item.img_index_url" mode="aspectFit" style="width: 188rpx;height: 168rpx;"></image> |
25 | </view> | 25 | </view> |
26 | <view class="goodInfo"> | 26 | <view class="goodInfo"> |
27 | <!-- <view class="imageWrap"> | 27 | <!-- <view class="imageWrap"> |
28 | <image :src="item.img_index_url" mode="aspectFit" style="width: 188rpx;height: 168rpx;"></image> | 28 | <image :src="item.img_index_url" mode="aspectFit" style="width: 188rpx;height: 168rpx;"></image> |
29 | </view> --> | 29 | </view> --> |
30 | <view class="infoRight"> | 30 | <view class="infoRight"> |
31 | <view class="goodName" @tap="toGoods(item.pid,item.sk_id)">{{item.p_name}}</view> | 31 | <view class="goodName" @tap="toGoods(item.pid,item.sk_id)">{{item.p_name}}</view> |
32 | <!-- <view class="describ"> --> | 32 | <!-- <view class="describ"> --> |
33 | <uni-collapse accordion="true" style="justify-content: space-around;width: 196px;"> | 33 | <uni-collapse accordion="true" style="justify-content: space-around;width: 196px;"> |
34 | <uni-collapse-item showAnimation='true' | 34 | <uni-collapse-item showAnimation='true' |
35 | :title="item.tag.prod_tag_fun[0].label&&item.tag.prod_tag_fun[1].label?item.tag.prod_tag_fun[0].label+'/'+item.tag.prod_tag_fun[1].label+'...':'暂无数据'" > | 35 | :title="item.tag.prod_tag_fun[0].label&&item.tag.prod_tag_fun[1].label?item.tag.prod_tag_fun[0].label+'/'+item.tag.prod_tag_fun[1].label+'...':'暂无数据'" > |
36 | <text class="describ"> | 36 | <text class="describ"> |
37 | <block v-for="tag in item.tag.prod_tag_fun" :key="tag.value"> | 37 | <block v-for="tag in item.tag.prod_tag_fun" :key="tag.value"> |
38 | {{tag.label+` `}} | 38 | {{tag.label+` `}} |
39 | </block> | 39 | </block> |
40 | </text> | 40 | </text> |
41 | <!-- <text> | 41 | <!-- <text> |
42 | <block v-for="tag in item.tag.prod_tag_style" :key="tag.value"> | 42 | <block v-for="tag in item.tag.prod_tag_style" :key="tag.value"> |
43 | {{tag.label+` `}} | 43 | {{tag.label+` `}} |
44 | </block> | 44 | </block> |
45 | </text> --> | 45 | </text> --> |
46 | </uni-collapse-item> | 46 | </uni-collapse-item> |
47 | </uni-collapse> | 47 | </uni-collapse> |
48 | <!-- <view v-bind:class="collapseList[index]? 'icon':'iconed'"></view> --> | 48 | <!-- <view v-bind:class="collapseList[index]? 'icon':'iconed'"></view> --> |
49 | <!-- </view> --> | 49 | <!-- </view> --> |
50 | <view class="priceBox"> | 50 | <view class="priceBox"> |
51 | <view class="price">¥{{item.nowPrice*item.num}}</view> | 51 | <view class="price">¥{{item.nowPrice*item.num}}</view> |
52 | <text class="maxCount">(限购{{maxCount}}副)</text> | 52 | <text class="maxCount">(限购{{maxCount}}副)</text> |
53 | <view class="counter"> | 53 | <view class="counter"> |
54 | <view class="btn" disabled="this.addDisabled" type="default" | 54 | <view class="btn" disabled="this.addDisabled" type="default" |
55 | @tap="counter(index,false,item)">-</view> | 55 | @tap="counter(index,false,item)">-</view> |
56 | <text>{{item.num}}</text> | 56 | <text>{{item.num}}</text> |
57 | <view class="btn" disabled="this.desDisabled" type="default" | 57 | <view class="btn" disabled="this.desDisabled" type="default" |
58 | @tap="counter(index,true,item)">+</view> | 58 | @tap="counter(index,true,item)">+</view> |
59 | </view> | 59 | </view> |
60 | </view> | 60 | </view> |
61 | </view> | 61 | </view> |
62 | </view> | 62 | </view> |
63 | </view> | 63 | </view> |
64 | </view> | 64 | </view> |
65 | </block> | 65 | </block> |
66 | <view class="footer"> | 66 | <view class="footer"> |
67 | <view class="footerLeft">实付金额:<text>¥{{totalPrice}}</text></view> | 67 | <view class="footerLeft">实付金额:<text>¥{{totalPrice}}</text></view> |
68 | <view class="footerRight"> | 68 | <view class="footerRight"> |
69 | <navigator url="/pages/confirmOrder/confirmOrder" hover-class="navigator-hover"> | 69 | <navigator url="/pages/confirmOrder/confirmOrder" hover-class="navigator-hover"> |
70 | <view class="paybtn" >立即结算</view> | 70 | <view class="paybtn" >立即结算</view> |
71 | </navigator> | 71 | </navigator> |
72 | </view> | 72 | </view> |
73 | </view> | 73 | </view> |
74 | 74 | ||
75 | </view> | 75 | </view> |
76 | </template> | 76 | </template> |
77 | 77 | ||
78 | <script> | 78 | <script> |
79 | import UniCollapse from '@/components/UniCollapse/UniCollapse.vue' | 79 | import UniCollapse from '@/components/UniCollapse/UniCollapse.vue' |
80 | import UniCollapseItem from '@/components/UniCollapseItem/UniCollapseItem.vue' | 80 | import UniCollapseItem from '@/components/UniCollapseItem/UniCollapseItem.vue' |
81 | import store from '@/store' | 81 | import store from '@/store' |
82 | 82 | ||
83 | export default { | 83 | export default { |
84 | components: { UniCollapse, UniCollapseItem }, | 84 | components: { UniCollapse, UniCollapseItem }, |
85 | data() { | 85 | data() { |
86 | return { | 86 | return { |
87 | totalPrice: 0, | 87 | totalPrice: 0, |
88 | pIsoPen: false, | 88 | pIsoPen: false, |
89 | // childIsOpen:[], | 89 | // childIsOpen:[], |
90 | maxCount: 20 | 90 | maxCount: 20 |
91 | } | 91 | } |
92 | }, | 92 | }, |
93 | computed: { | 93 | computed: { |
94 | 94 | ||
95 | cartList() { | 95 | cartList() { |
96 | // console.log('cart-list', this.$store.state.cart.cartList); | 96 | // console.log('cart-list', this.$store.state.cart.cartList); |
97 | return this.$store.state.cart.cartList | 97 | return this.$store.state.cart.cartList |
98 | }, | 98 | }, |
99 | childIsOpen() { | 99 | childIsOpen() { |
100 | const temp = [] | 100 | const temp = [] |
101 | temp.length = this.$store.state.cart.cartList.length | 101 | temp.length = this.$store.state.cart.cartList.length |
102 | for (let i = 0; i < temp.length; i++) { | 102 | for (let i = 0; i < temp.length; i++) { |
103 | temp[i] = false | 103 | temp[i] = false |
104 | } | 104 | } |
105 | console.log('this.childisOPne===>', temp) | 105 | console.log('this.childisOPne===>', temp) |
106 | return temp | 106 | return temp |
107 | } | 107 | } |
108 | }, | 108 | }, |
109 | onLoad: function() { | 109 | onLoad: function() { |
110 | // store.dispatch('cart/addCart', { | 110 | // store.dispatch('cart/addCart', { |
111 | // uid: this.$store.state.user.userInfo.uid, | 111 | // uid: this.$store.state.user.userInfo.uid, |
112 | // openid: this.$store.state.user.userInfo.openid, | 112 | // openid: this.$store.state.user.userInfo.openid, |
113 | // mp_id: 7, | 113 | // mp_id: 7, |
114 | // sk_id: 7, | 114 | // sk_id: 7, |
115 | // num: 1, | 115 | // num: 1, |
116 | // pid: 8, | 116 | // pid: 8, |
117 | // price: 128, | 117 | // price: 128, |
118 | // checkedSKU:{}, | 118 | // checkedSKU:{}, |
119 | // }) | 119 | // }) |
120 | store.dispatch('cart/getCartList', { | 120 | store.dispatch('cart/getCartList', { |
121 | uid: this.$store.state.user.userInfo.uid // 用户id | 121 | uid: this.$store.state.user.userInfo.uid // 用户id |
122 | }) | 122 | }) |
123 | }, | 123 | }, |
124 | 124 | ||
125 | methods: { | 125 | methods: { |
126 | 126 | ||
127 | toGoods(id, sk_id) { | 127 | toGoods(id, sk_id) { |
128 | console.log('cart-list', this.$store.state.cart.cartList); | 128 | console.log('cart-list', this.$store.state.cart.cartList); |
129 | console.log('---', '../frameDetail/frameDetail?pid=' + id +'&sk_id='+sk_id) | 129 | console.log('---', '../frameDetail/frameDetail?pid=' + id +'&sk_id='+sk_id) |
130 | uni.navigateTo({ | 130 | uni.navigateTo({ |
131 | url: '../frameDetail/frameDetail?pid=' + id+'&sk_id='+sk_id, | 131 | url: '../frameDetail/frameDetail?pid=' + id+'&sk_id='+sk_id, |
132 | success: res => {}, | 132 | success: res => {}, |
133 | fail: () => {}, | 133 | fail: () => {}, |
134 | complete: () => {} | 134 | complete: () => {} |
135 | }) | 135 | }) |
136 | }, | 136 | }, |
137 | 137 | ||
138 | counter(index, isadd, item) { | 138 | counter(index, isadd, item) { |
139 | // console.log('===>>counter ===>num',num) | 139 | // console.log('===>>counter ===>num',num) |
140 | // console.log('===>>counter ===>isadd',isadd) | 140 | // console.log('===>>counter ===>isadd',isadd) |
141 | console.log('item=====>',item) | 141 | console.log('item=====>',item) |
142 | console.log('num=====>',item.num) | 142 | console.log('num=====>',item.num) |
143 | let nums = parseInt(item.num) | 143 | let nums = parseInt(item.num) |
144 | if (isadd) { | 144 | if (isadd) { |
145 | if (nums >= this.maxCount) { | 145 | if (nums >= this.maxCount) { |
146 | this.addDisabled = true | 146 | this.addDisabled = true |
147 | } else { | 147 | } else { |
148 | this.addDisabled = true | 148 | this.addDisabled = true |
149 | // 修改num | 149 | // 修改num |
150 | if (this.childIsOpen[index]) { | 150 | if (this.childIsOpen[index]) { |
151 | this.totalPrice = this.totalPrice + this.$store.state.cart.cartList[index].nowPrice | 151 | this.totalPrice = this.totalPrice + this.$store.state.cart.cartList[index].nowPrice |
152 | } | 152 | } |
153 | store.dispatch('cart/modiCart', { | 153 | store.dispatch('cart/modiCart', { |
154 | uid: this.$store.state.user.userInfo.uid, | 154 | uid: this.$store.state.user.userInfo.uid, |
155 | openid: this.$store.state.user.userInfo.openid, | 155 | openid: this.$store.state.user.userInfo.openid, |
156 | mp_id: item.mp_id, | 156 | mp_id: item.mp_id, |
157 | sk_id: item.sk_id, | 157 | sk_id: item.sk_id, |
158 | price: item.nowPrice, | 158 | price: item.nowPrice, |
159 | pid: item.pid, | 159 | pid: item.pid, |
160 | num: nums + 1, | 160 | num: nums + 1, |
161 | cart_id: item.cart_id, | 161 | cart_id: item.cart_id, |
162 | args: { | 162 | args: { |
163 | index: index, | 163 | index: index, |
164 | isadd: isadd | 164 | isadd: isadd |
165 | } | 165 | } |
166 | }) | 166 | }) |
167 | this.addDisabled = false | 167 | this.addDisabled = false |
168 | } | 168 | } |
169 | } else { | 169 | } else { |
170 | if (nums <= 1) { | 170 | if (nums <= 1) { |
171 | this.desDisabled = true | 171 | this.desDisabled = true |
172 | } else { | 172 | } else { |
173 | this.desDisabled = false | 173 | this.desDisabled = false |
174 | // post 请求修改相关参数 | 174 | // post 请求修改相关参数 |
175 | if (this.childIsOpen[index]) { | 175 | if (this.childIsOpen[index]) { |
176 | this.totalPrice = this.totalPrice - this.$store.state.cart.cartList[index].nowPrice | 176 | this.totalPrice = this.totalPrice - this.$store.state.cart.cartList[index].nowPrice |
177 | } | 177 | } |
178 | store.dispatch('cart/modiCart', { | 178 | store.dispatch('cart/modiCart', { |
179 | uid: this.$store.state.user.userInfo.uid, | 179 | uid: this.$store.state.user.userInfo.uid, |
180 | openid: this.$store.state.user.userInfo.openid, | 180 | openid: this.$store.state.user.userInfo.openid, |
181 | mp_id: item.mp_id, | 181 | mp_id: item.mp_id, |
182 | sk_id: item.sk_id, | 182 | sk_id: item.sk_id, |
183 | price: item.nowPrice, | 183 | price: item.nowPrice, |
184 | pid: item.pid, | 184 | pid: item.pid, |
185 | num: nums - 1, | 185 | num: nums - 1, |
186 | cart_id: item.cart_id, | 186 | cart_id: item.cart_id, |
187 | args: { | 187 | args: { |
188 | index: index, | 188 | index: index, |
189 | isadd: isadd | 189 | isadd: isadd |
190 | } | 190 | } |
191 | }) | 191 | }) |
192 | this.desDisabled = true | 192 | this.desDisabled = true |
193 | } | 193 | } |
194 | } | 194 | } |
195 | // store.dispatch('cart/getCartList', { | 195 | // store.dispatch('cart/getCartList', { |
196 | // uid: this.$store.state.user.userInfo.uid // 用户id | 196 | // uid: this.$store.state.user.userInfo.uid // 用户id |
197 | // }) | 197 | // }) |
198 | }, | 198 | }, |
199 | 199 | ||
200 | Change(isopen, indexC) { | 200 | Change(isopen, indexC) { |
201 | // console.log('lalla===>',isopen) | 201 | // console.log('lalla===>',isopen) |
202 | this.childIsOpen[indexC] = !isopen | 202 | this.childIsOpen[indexC] = !isopen |
203 | if (!isopen) { | 203 | if (!isopen) { |
204 | this.totalPrice = this.totalPrice + (this.$store.state.cart.cartList[indexC].num * this.$store.state.cart.cartList[indexC].nowPrice) | 204 | this.totalPrice = this.totalPrice + (this.$store.state.cart.cartList[indexC].num * this.$store.state.cart.cartList[indexC].nowPrice) |
205 | } else { | 205 | } else { |
206 | this.totalPrice = this.totalPrice - (this.$store.state.cart.cartList[indexC].num * this.$store.state.cart.cartList[indexC].nowPrice) | 206 | this.totalPrice = this.totalPrice - (this.$store.state.cart.cartList[indexC].num * this.$store.state.cart.cartList[indexC].nowPrice) |
207 | } | 207 | } |
208 | let m = true | 208 | let m = true |
209 | for (let i = 0; i < this.childIsOpen.length; i++) { | 209 | for (let i = 0; i < this.childIsOpen.length; i++) { |
210 | m = m & this.childIsOpen[i] | 210 | m = m & this.childIsOpen[i] |
211 | } | 211 | } |
212 | if (m == 1) { | 212 | if (m == 1) { |
213 | this.pIsoPen = true | 213 | this.pIsoPen = true |
214 | } else { | 214 | } else { |
215 | this.pIsoPen = false | 215 | this.pIsoPen = false |
216 | } | 216 | } |
217 | }, | 217 | }, |
218 | pChange(isopen) { | 218 | pChange(isopen) { |
219 | this.pIsoPen = !isopen | 219 | this.pIsoPen = !isopen |
220 | for (let i = 0; i < this.childIsOpen.length; i++) { | 220 | for (let i = 0; i < this.childIsOpen.length; i++) { |
221 | this.childIsOpen[i] = !isopen | 221 | this.childIsOpen[i] = !isopen |
222 | } | 222 | } |
223 | if (this.pIsoPen) { | 223 | if (this.pIsoPen) { |
224 | // 计算总价逻辑 | 224 | // 计算总价逻辑 |
225 | if (this.childIsOpen.length != 0) { | 225 | if (this.childIsOpen.length != 0) { |
226 | for (let i = 0; i < this.childIsOpen.length; i++) { | 226 | for (let i = 0; i < this.childIsOpen.length; i++) { |
227 | if (this.childIsOpen[i]) { | 227 | if (this.childIsOpen[i]) { |
228 | this.totalPrice = this.totalPrice + (this.$store.state.cart.cartList[i].num * this.$store.state.cart.cartList[i].nowPrice) | 228 | this.totalPrice = this.totalPrice + (this.$store.state.cart.cartList[i].num * this.$store.state.cart.cartList[i].nowPrice) |
229 | } | 229 | } |
230 | } | 230 | } |
231 | } | 231 | } |
232 | } else { | 232 | } else { |
233 | this.totalPrice = 0 | 233 | this.totalPrice = 0 |
234 | } | 234 | } |
235 | }, | 235 | }, |
236 | delCart(cart_id, index) { | 236 | delCart(cart_id, index) { |
237 | // console.log('userInfo',this.$store.state.user.userInfo) | 237 | // console.log('userInfo',this.$store.state.user.userInfo) |
238 | cart_id = parseInt(cart_id) | 238 | cart_id = parseInt(cart_id) |
239 | // console.log('delcart------>cart_id',cart_id) | 239 | // console.log('delcart------>cart_id',cart_id) |
240 | // console.log('cartlist====>delcart',this.$store.state.cart.cartList) | 240 | // console.log('cartlist====>delcart',this.$store.state.cart.cartList) |
241 | // console.log('delcart======>index',index) | 241 | // console.log('delcart======>index',index) |
242 | const uid=this.$store.state.user.userInfo.uid | 242 | const uid=this.$store.state.user.userInfo.uid |
243 | const openid=this.$store.state.user.userInfo.openid | 243 | const openid=this.$store.state.user.userInfo.openid |
244 | uni.showModal({ | 244 | uni.showModal({ |
245 | title: '是否删除该商品', | 245 | title: '是否删除该商品', |
246 | // content: '是否删除该商品', | 246 | // content: '是否删除该商品', |
247 | success: function (res) { | 247 | success: function (res) { |
248 | if (res.confirm) { | 248 | if (res.confirm) { |
249 | // this.$store.state.cart.cartList.splice(index,1) | 249 | // this.$store.state.cart.cartList.splice(index,1) |
250 | store.dispatch('cart/delCart', { | 250 | store.dispatch('cart/delCart', { |
251 | uid: uid, | 251 | uid: uid, |
252 | openid: openid, | 252 | openid: openid, |
253 | cart_id: cart_id, // 要修改的购物车id | 253 | cart_id: cart_id, // 要修改的购物车id |
254 | arg: index // 由于action 传参是能接收两参数,因此将index放入对象 | 254 | arg: index // 由于action 传参是能接收两参数,因此将index放入对象 |
255 | }) | 255 | }) |
256 | console.log('用户点击确定') | 256 | console.log('用户点击确定') |
257 | } | 257 | } |
258 | } | 258 | } |
259 | }) | 259 | }) |
260 | } | 260 | } |
261 | } | 261 | } |
262 | } | 262 | } |
263 | </script> | 263 | </script> |
264 | 264 | ||
265 | <style lang="scss"> | 265 | <style lang="scss"> |
266 | .content { | 266 | .content { |
267 | min-height: 100vh; | 267 | min-height: 100vh; |
268 | background-color: #f2f2f2; | 268 | background-color: #f2f2f2; |
269 | display: flex; | 269 | display: flex; |
270 | flex-direction: column; | 270 | flex-direction: column; |
271 | align-items: center; | 271 | align-items: center; |
272 | justify-content: space-between; | 272 | justify-content: space-between; |
273 | padding: 20rpx 40rpx; | 273 | padding: 20rpx 40rpx; |
274 | box-sizing: border-box; | 274 | box-sizing: border-box; |
275 | 275 | ||
276 | .partentCheck{ | 276 | .partentCheck{ |
277 | width: 16px; | 277 | width: 16px; |
278 | height: 16px; | 278 | height: 16px; |
279 | border-radius: 22px; | 279 | border-radius: 22px; |
280 | border: 1px solid #CFCFCF; | 280 | border: 1px solid #CFCFCF; |
281 | background-color: #FFFFFF; | 281 | background-color: #FFFFFF; |
282 | margin: 6px; | 282 | margin: 6px; |
283 | } | 283 | } |
284 | .partentChecked{ | 284 | .partentChecked{ |
285 | width: 18px; | 285 | width: 18px; |
286 | height: 18px; | 286 | height: 18px; |
287 | border-radius: 22px; | 287 | border-radius: 22px; |
288 | background-color: #FF6B4A; | 288 | background-color: #FF6B4A; |
289 | margin: 6px; | 289 | margin: 6px; |
290 | .correct { | 290 | .correct { |
291 | display: inline-block; | 291 | display: inline-block; |
292 | position: relative; | 292 | position: relative; |
293 | width: 10rpx; | 293 | width: 10rpx; |
294 | height: 2rpx; | 294 | height: 2rpx; |
295 | background: #FFFFFF; | 295 | background: #FFFFFF; |
296 | line-height: 0; | 296 | line-height: 0; |
297 | font-size: 0; | 297 | font-size: 0; |
298 | position: relative; | 298 | position: relative; |
299 | top: -7px; | 299 | top: -7px; |
300 | left: 4px; | 300 | left: 4px; |
301 | -webkit-transform: rotate(45deg); | 301 | -webkit-transform: rotate(45deg); |
302 | } | 302 | } |
303 | .correct:after { | 303 | .correct:after { |
304 | content: '/'; | 304 | content: '/'; |
305 | display: block; | 305 | display: block; |
306 | width: 16rpx; | 306 | width: 16rpx; |
307 | height: 2rpx; | 307 | height: 2rpx; |
308 | background: #FFFFFF; | 308 | background: #FFFFFF; |
309 | -webkit-transform: rotate(-90deg) translateY(50%) translateX(50%); | 309 | -webkit-transform: rotate(-90deg) translateY(50%) translateX(50%); |
310 | } | 310 | } |
311 | } | 311 | } |
312 | 312 | ||
313 | .card{ | 313 | .card{ |
314 | background-color: #FFFFFF; | 314 | background-color: #FFFFFF; |
315 | border-radius: 16rpx; | 315 | border-radius: 16rpx; |
316 | box-sizing: border-box; | 316 | box-sizing: border-box; |
317 | padding: 36rpx 36rpx 36rpx 18rpx; | 317 | padding: 36rpx 36rpx 36rpx 18rpx; |
318 | display: flex; | 318 | display: flex; |
319 | flex-direction: column; | 319 | flex-direction: column; |
320 | align-items: center; | 320 | align-items: center; |
321 | justify-content: space-between; | 321 | justify-content: space-between; |
322 | margin-bottom: 180rpx; | 322 | margin-bottom: 180rpx; |
323 | .cardHeader{ | 323 | .cardHeader{ |
324 | width: 100%; | 324 | width: 100%; |
325 | height: 36rpx; | 325 | height: 36rpx; |
326 | display: flex; | 326 | display: flex; |
327 | align-items: center; | 327 | align-items: center; |
328 | justify-content: flex-start; | 328 | justify-content: flex-start; |
329 | margin-bottom: 20rpx; | 329 | margin-bottom: 20rpx; |
330 | image{ | 330 | image{ |
331 | height: 32rpx; | 331 | height: 32rpx; |
332 | width: 32rpx; | 332 | width: 32rpx; |
333 | padding-left: 6px; | 333 | padding-left: 6px; |
334 | padding-right: 10px; | 334 | padding-right: 10px; |
335 | } | 335 | } |
336 | text{ | 336 | text{ |
337 | // font-family: PingFangSC-Regular; | 337 | // font-family: PingFangSC-Regular; |
338 | font-size: 14px; | 338 | font-size: 14px; |
339 | color: #333333; | 339 | color: #333333; |
340 | letter-spacing: -0.26px; | 340 | letter-spacing: -0.26px; |
341 | } | 341 | } |
342 | } | 342 | } |
343 | .cardBody{ | 343 | .cardBody{ |
344 | width: 100%; | 344 | width: 100%; |
345 | min-height: 300rpx; | 345 | min-height: 300rpx; |
346 | display: flex; | 346 | display: flex; |
347 | align-items: center; | 347 | align-items: center; |
348 | justify-content: space-between; | 348 | justify-content: space-between; |
349 | .goodInfo{ | 349 | .goodInfo{ |
350 | width: 390rpx; | 350 | width: 390rpx; |
351 | display: flex; | 351 | display: flex; |
352 | flex-direction: row; | 352 | flex-direction: row; |
353 | justify-content: flex-start; | 353 | justify-content: flex-start; |
354 | padding-left: 6px; | 354 | padding-left: 6px; |
355 | 355 | ||
356 | .imageWrap{ | 356 | .imageWrap{ |
357 | height: 188rpx; | 357 | height: 188rpx; |
358 | width: 188rpx; | 358 | width: 188rpx; |
359 | margin-right: 28rpx; | 359 | margin-right: 28rpx; |
360 | 360 | ||
361 | image{ | 361 | image{ |
362 | border-radius: 4px; | 362 | border-radius: 4px; |
363 | height: 188rpx; | 363 | height: 188rpx; |
364 | width: 188rpx; | 364 | width: 188rpx; |
365 | } | 365 | } |
366 | } | 366 | } |
367 | .infoRight{ | 367 | .infoRight{ |
368 | display: flex; | 368 | display: flex; |
369 | flex-direction: column; | 369 | flex-direction: column; |
370 | align-items: flex-start; | 370 | align-items: flex-start; |
371 | justify-content: space-between; | 371 | justify-content: space-between; |
372 | min-height: 240rpx; | 372 | min-height: 240rpx; |
373 | .goodName{ | 373 | .goodName{ |
374 | display: -webkit-box; | 374 | display: -webkit-box; |
375 | -webkit-box-orient: vertical; | 375 | -webkit-box-orient: vertical; |
376 | -webkit-line-clamp: 2; | 376 | -webkit-line-clamp: 2; |
377 | text-align: justify; | 377 | text-align: justify; |
378 | overflow: hidden; | 378 | overflow: hidden; |
379 | font-size: 28rpx; | 379 | font-size: 28rpx; |
380 | color: #333333; | 380 | color: #333333; |
381 | } | 381 | } |
382 | .describ{ | 382 | .describ{ |
383 | width: 100%; | 383 | width: 100%; |
384 | // min-height: 80rpx; | 384 | // min-height: 80rpx; |
385 | // box-sizing: border-box; | 385 | // box-sizing: border-box; |
386 | // padding: 10rpx; | 386 | // padding: 10rpx; |
387 | font-size: 20rpx; | 387 | font-size: 20rpx; |
388 | letter-spacing: -0.23px; | 388 | letter-spacing: -0.23px; |
389 | text-align: justify; | 389 | text-align: justify; |
390 | color: #999999; | 390 | color: #999999; |
391 | // background: #F9F9F9; | 391 | // background: #F9F9F9; |
392 | // display: flex; | 392 | // display: flex; |
393 | // justify-content: center; | 393 | // justify-content: center; |
394 | // align-items: center; | 394 | // align-items: center; |
395 | // text{ | 395 | // text{ |
396 | // text-overflow: -o-ellipsis-lastline; | 396 | // text-overflow: -o-ellipsis-lastline; |
397 | // overflow: hidden; | 397 | // overflow: hidden; |
398 | // text-overflow: ellipsis; | 398 | // text-overflow: ellipsis; |
399 | // display: -webkit-box; | 399 | // display: -webkit-box; |
400 | // -webkit-line-clamp: 2; | 400 | // -webkit-line-clamp: 2; |
401 | // line-clamp: 2; | 401 | // line-clamp: 2; |
402 | // -webkit-box-orient: vertical; | 402 | // -webkit-box-orient: vertical; |
403 | // } | 403 | // } |
404 | // .icon { | 404 | // .icon { |
405 | // width: 0; | 405 | // width: 0; |
406 | // height: 0; | 406 | // height: 0; |
407 | // border-left: 5px transparent; | 407 | // border-left: 5px transparent; |
408 | // border-right: 5px transparent; | 408 | // border-right: 5px transparent; |
409 | // border-top: 5px #979797; | 409 | // border-top: 5px #979797; |
410 | // border-bottom: 0 transparent; | 410 | // border-bottom: 0 transparent; |
411 | // border-style: solid; | 411 | // border-style: solid; |
412 | // position: relative; | 412 | // position: relative; |
413 | // margin-left: 10px; | 413 | // margin-left: 10px; |
414 | // // transform: scaleY(-1); | 414 | // // transform: scaleY(-1); |
415 | // } | 415 | // } |
416 | // .icon::after{ | 416 | // .icon::after{ |
417 | // content: ''; | 417 | // content: ''; |
418 | // position: absolute; | 418 | // position: absolute; |
419 | // top: -6.5px; | 419 | // top: -6.5px; |
420 | // left: -5px; | 420 | // left: -5px; |
421 | // border-left: 5px transparent; | 421 | // border-left: 5px transparent; |
422 | // border-right: 5px transparent; | 422 | // border-right: 5px transparent; |
423 | // border-top: 5px #FFFFFF; | 423 | // border-top: 5px #FFFFFF; |
424 | // border-bottom: 0 transparent; | 424 | // border-bottom: 0 transparent; |
425 | // border-style: solid; | 425 | // border-style: solid; |
426 | // } | 426 | // } |
427 | } | 427 | } |
428 | .priceBox{ | 428 | .priceBox{ |
429 | display: flex; | 429 | display: flex; |
430 | justify-content: space-between; | 430 | justify-content: space-between; |
431 | align-items: center; | 431 | align-items: center; |
432 | // margin-top: 26px; | 432 | // margin-top: 26px; |
433 | width: 100%; | 433 | width: 100%; |
434 | font-size: 14px; | 434 | font-size: 14px; |
435 | color: #999999; | 435 | color: #999999; |
436 | .maxCount{ | 436 | .maxCount{ |
437 | color: #999999; | 437 | color: #999999; |
438 | font-size: 24rpx; | 438 | font-size: 24rpx; |
439 | } | 439 | } |
440 | .price{ | 440 | .price{ |
441 | color: #FF6B4A; | 441 | color: #FF6B4A; |
442 | font-size: 28rpx; | 442 | font-size: 28rpx; |
443 | } | 443 | } |
444 | .counter{ | 444 | .counter{ |
445 | display: flex; | 445 | display: flex; |
446 | flex-direction: row; | 446 | flex-direction: row; |
447 | justify-content: space-between; | 447 | justify-content: space-between; |
448 | align-items: center; | 448 | align-items: center; |
449 | font-size: 28rpx; | 449 | font-size: 28rpx; |
450 | color: #333333; | 450 | color: #333333; |
451 | width: 122rpx; | 451 | width: 122rpx; |
452 | .btn{ | 452 | .btn{ |
453 | display: flex; | 453 | display: flex; |
454 | justify-content: center; | 454 | justify-content: center; |
455 | line-height: 32rpx; | 455 | line-height: 32rpx; |
456 | height: 32rpx; | 456 | height: 32rpx; |
457 | width: 32rpx; | 457 | width: 32rpx; |
458 | background-color: #F2F2F2; | 458 | background-color: #F2F2F2; |
459 | color: #CFCFCF; | 459 | color: #CFCFCF; |
460 | } | 460 | } |
461 | } | 461 | } |
462 | } | 462 | } |
463 | } | 463 | } |
464 | } | 464 | } |
465 | } | 465 | } |
466 | } | 466 | } |
467 | 467 | ||
468 | .footer{ | 468 | .footer{ |
469 | position: fixed; | 469 | position: fixed; |
470 | left: 0; | 470 | left: 0; |
471 | bottom: 0px; | 471 | bottom: 0px; |
472 | height: 112rpx; | 472 | height: 112rpx; |
473 | width: 100%; | 473 | width: 100%; |
474 | background-color: #FFFFFF; | 474 | background-color: #FFFFFF; |
475 | font-size: 16px; | 475 | font-size: 16px; |
476 | display: flex; | 476 | display: flex; |
477 | justify-content: space-between; | 477 | justify-content: space-between; |
478 | align-items: center; | 478 | align-items: center; |
479 | .footerLeft{ | 479 | .footerLeft{ |
480 | display: flex; | 480 | display: flex; |
481 | justify-content: center; | 481 | justify-content: center; |
482 | align-items: center; | 482 | align-items: center; |
483 | width: 50%; | 483 | width: 50%; |
484 | color: #333333; | 484 | color: #333333; |
485 | text{ | 485 | text{ |
486 | color: #FF6B4A; | 486 | color: #FF6B4A; |
487 | } | 487 | } |
488 | } | 488 | } |
489 | .footerRight{ | 489 | .footerRight{ |
490 | display: flex; | 490 | display: flex; |
491 | justify-content: flex-end; | 491 | justify-content: flex-end; |
492 | align-items: center; | 492 | align-items: center; |
493 | width: 50%; | 493 | width: 50%; |
494 | margin-right: 26rpx; | 494 | margin-right: 26rpx; |
495 | .paybtn{ | 495 | .paybtn{ |
496 | display: flex; | 496 | display: flex; |
497 | justify-content: center; | 497 | justify-content: center; |
498 | align-items: center; | 498 | align-items: center; |
499 | background: #FF6B4A; | 499 | background: #FF6B4A; |
500 | border-radius: 20px; | 500 | border-radius: 20px; |
501 | border-radius: 20px; | 501 | border-radius: 20px; |
502 | color: #FFFFFF; | 502 | color: #FFFFFF; |
503 | width: 204rpx; | 503 | width: 204rpx; |
504 | height: 80rpx; | 504 | height: 80rpx; |
505 | } | 505 | } |
506 | } | 506 | } |
507 | 507 | ||
508 | } | 508 | } |
509 | } | 509 | } |
510 | 510 | ||
511 | </style> | 511 | </style> |
512 |
src/pages/frameDetail/frameDetail.vue
1 | <template> | 1 | <template> |
2 | <view class="container"> | 2 | <view class="container"> |
3 | <view class="D1"> | 3 | <view class="D1"> |
4 | <!-- 轮播图 --> | 4 | <!-- 轮播图 --> |
5 | <swiper | 5 | <swiper |
6 | class="swiperImage" | 6 | class="swiperImage" |
7 | :indicator-dots="true" | 7 | :indicator-dots="true" |
8 | :autoplay="true" | 8 | :autoplay="true" |
9 | :interval="4000" | 9 | :interval="4000" |
10 | :duration="500" | 10 | :duration="500" |
11 | > | 11 | > |
12 | <swiper-item | 12 | <swiper-item |
13 | v-for="(item, index) in goodInfo.pics" | 13 | v-for="(item, index) in goodInfo.pics" |
14 | :key="index" | 14 | :key="index" |
15 | > | 15 | > |
16 | <image | 16 | <image |
17 | :src="item" | 17 | :src="item" |
18 | mode="scaleToFill" | 18 | mode="scaleToFill" |
19 | ></image> | 19 | ></image> |
20 | </swiper-item> | 20 | </swiper-item> |
21 | </swiper> | 21 | </swiper> |
22 | <view class="D1_price">¥{{goodInfo.priceArea.Min_Price || '暂无'}}<span class="D1_number">{{goodInfo.trade_num || '暂无'}}人购买过</span></view> | 22 | <view class="D1_price">¥{{goodInfo.priceArea.Min_Price || '暂无'}}<span class="D1_number">{{goodInfo.trade_num || '暂无'}}人购买过</span></view> |
23 | <view class="D1_name"><span class="D1_name1">{{goodInfo.p_name || '暂无'}}</span></view> | 23 | <view class="D1_name"><span class="D1_name1">{{goodInfo.p_name || '暂无'}}</span></view> |
24 | <view class="D1_spans"><span>支持7天无理由退货</span><span>顺丰发货</span><span>30天质量保证</span></view> | 24 | <view class="D1_spans"><span>支持7天无理由退货</span><span>顺丰发货</span><span>30天质量保证</span></view> |
25 | </view> | 25 | </view> |
26 | <view | 26 | <view |
27 | class="D2" | 27 | class="D2" |
28 | v-if="updateGoodType == 2 || updateGoodType == 4" | 28 | v-if="updateGoodType == 2 || updateGoodType == 4" |
29 | > | 29 | > |
30 | <view><span class="D2_span1">框架材质:</span><span class="D2_span2">{{introduction.material}}</span></view> | 30 | <view><span class="D2_span1">框架材质:</span><span class="D2_span2">{{introduction.material}}</span></view> |
31 | <view><span class="D2_span1">风格:</span><span class="D2_span2">{{introduction.func}}</span></view> | 31 | <view><span class="D2_span1">风格:</span><span class="D2_span2">{{introduction.func}}</span></view> |
32 | <view><span class="D2_span1">适用性别:</span><span class="D2_span2">{{introduction.rate}}</span></view> | 32 | <view><span class="D2_span1">适用性别:</span><span class="D2_span2">{{introduction.rate}}</span></view> |
33 | </view> | 33 | </view> |
34 | <!-- <view | 34 | <!-- <view |
35 | class="D2" | 35 | class="D2" |
36 | v-if="updateGoodType == 1" | 36 | v-if="updateGoodType == 1" |
37 | > | 37 | > |
38 | <view><span class="D2_span1">镜片材质:</span><span class="D2_span2">{{introduction.material}}</span></view> | 38 | <view><span class="D2_span1">镜片材质:</span><span class="D2_span2">{{introduction.material}}</span></view> |
39 | <view><span class="D2_span1">功能:</span><span class="D2_span2">{{introduction.func}}</span></view> | 39 | <view><span class="D2_span1">功能:</span><span class="D2_span2">{{introduction.func}}</span></view> |
40 | <view><span class="D2_span1">使用场景:</span><span class="D2_span2">{{introduction.rate}}</span></view> | 40 | <view><span class="D2_span1">使用场景:</span><span class="D2_span2">{{introduction.rate}}</span></view> |
41 | </view> | 41 | </view> |
42 | <view | 42 | <view |
43 | class="D2" | 43 | class="D2" |
44 | v-if="updateGoodType == 3" | 44 | v-if="updateGoodType == 3" |
45 | > | 45 | > |
46 | <view><span class="D2_span1">材质:</span><span class="D2_span2">{{introduction.material}}</span></view> | 46 | <view><span class="D2_span1">材质:</span><span class="D2_span2">{{introduction.material}}</span></view> |
47 | <view><span class="D2_span1">直径/基弧:</span><span class="D2_span2">{{introduction.func}}</span></view> | 47 | <view><span class="D2_span1">直径/基弧:</span><span class="D2_span2">{{introduction.func}}</span></view> |
48 | <view><span class="D2_span1">适用性别:</span><span class="D2_span2">{{introduction.rate}}</span></view> | 48 | <view><span class="D2_span1">适用性别:</span><span class="D2_span2">{{introduction.rate}}</span></view> |
49 | </view> --> | 49 | </view> --> |
50 | <view class="D3"> | 50 | <view class="D3"> |
51 | <view class="screenBar"> | 51 | <view class="screenBar"> |
52 | <view | 52 | <view |
53 | v-for="item in screenItems" | 53 | v-for="item in screenItems" |
54 | :key="item.current" | 54 | :key="item.current" |
55 | @click="tabChange(item.current)" | 55 | @click="tabChange(item.current)" |
56 | > | 56 | > |
57 | <view | 57 | <view |
58 | class="screenItem" | 58 | class="screenItem" |
59 | v-bind:class="{ active: current === item.current }" | 59 | v-bind:class="{ active: current === item.current }" |
60 | >{{ item.text || '暂无' }}</view> | 60 | >{{ item.text || '暂无' }}</view> |
61 | </view> | 61 | </view> |
62 | </view> | 62 | </view> |
63 | <view | 63 | <view |
64 | class="screen-item" | 64 | class="screen-item" |
65 | v-if="current === 1" | 65 | v-if="current === 1" |
66 | > | 66 | > |
67 | <view class="D3_list"> | 67 | <view class="D3_list"> |
68 | <view | 68 | <view |
69 | v-for="(item) in parameter" | 69 | v-for="(item) in parameter" |
70 | :key="item.key" | 70 | :key="item.key" |
71 | > | 71 | > |
72 | <image | 72 | <image |
73 | class="D3_image" | 73 | class="D3_image" |
74 | v-bind:src="item.img" | 74 | v-bind:src="item.img" |
75 | ></image> | 75 | ></image> |
76 | <span>{{item.standard || '暂无'}}</span> | 76 | <span>{{item.standard || '暂无'}}</span> |
77 | <span>{{item.slength || '暂无'}}</span> | 77 | <span>{{item.slength || '暂无'}}</span> |
78 | </view> | 78 | </view> |
79 | </view> | 79 | </view> |
80 | </view> | 80 | </view> |
81 | <view | 81 | <view |
82 | class="screen-item" | 82 | class="screen-item" |
83 | v-if="current === 0" | 83 | v-if="current === 0" |
84 | > | 84 | > |
85 | <view class="D3_list"> | 85 | <view class="D3_list"> |
86 | <!-- <block> | 86 | <!-- <block> |
87 | <view>主体</view> | 87 | <view>主体</view> |
88 | <view>商品产地:韩国</view> | 88 | <view>商品产地:韩国</view> |
89 | <view>包装清单:彩色隐形 * 1</view> | 89 | <view>包装清单:彩色隐形 * 1</view> |
90 | </block> --> | 90 | </block> --> |
91 | <!-- 迭代时建议配合接口修改 为数组 --> | 91 | <!-- 迭代时建议配合接口修改 为数组 --> |
92 | <view v-if="tag.prod_tag_age && tag.prod_tag_age.length !== 0"> | 92 | <view v-if="tag.prod_tag_age && tag.prod_tag_age.length !== 0"> |
93 | <view class=""> | 93 | <view class=""> |
94 | 年龄:<view | 94 | 年龄:<view |
95 | v-for="(item,index) in tag.prod_tag_age" | 95 | v-for="(item,index) in tag.prod_tag_age" |
96 | :key="index" | 96 | :key="index" |
97 | > | 97 | > |
98 | {{item.label}}<text v-if="index !== tag.prod_tag_age.length - 1">/</text> | 98 | {{item.label}}<text v-if="index !== tag.prod_tag_age.length - 1">/</text> |
99 | </view> | 99 | </view> |
100 | </view> | 100 | </view> |
101 | </view> | 101 | </view> |
102 | <view v-if="tag.prod_tag_color && tag.prod_tag_color.length !== 0"> | 102 | <view v-if="tag.prod_tag_color && tag.prod_tag_color.length !== 0"> |
103 | <view class=""> | 103 | <view class=""> |
104 | 颜色:<view | 104 | 颜色:<view |
105 | v-for="(item,index) in tag.prod_tag_color" | 105 | v-for="(item,index) in tag.prod_tag_color" |
106 | :key="index" | 106 | :key="index" |
107 | > | 107 | > |
108 | {{item.label}}<text v-if="index !== tag.prod_tag_color.length - 1">/</text> | 108 | {{item.label}}<text v-if="index !== tag.prod_tag_color.length - 1">/</text> |
109 | </view> | 109 | </view> |
110 | </view> | 110 | </view> |
111 | </view> | 111 | </view> |
112 | <view v-if="tag.prod_tag_face && tag.prod_tag_face.length !== 0"> | 112 | <view v-if="tag.prod_tag_face && tag.prod_tag_face.length !== 0"> |
113 | <view class=""> | 113 | <view class=""> |
114 | 脸型:<view | 114 | 脸型:<view |
115 | v-for="(item,index) in tag.prod_tag_face" | 115 | v-for="(item,index) in tag.prod_tag_face" |
116 | :key="index" | 116 | :key="index" |
117 | > | 117 | > |
118 | {{item.label}}<text v-if="index !== tag.prod_tag_face.length - 1">/</text> | 118 | {{item.label}}<text v-if="index !== tag.prod_tag_face.length - 1">/</text> |
119 | </view> | 119 | </view> |
120 | </view> | 120 | </view> |
121 | </view> | 121 | </view> |
122 | <view v-if="tag.prod_tag_freesend && tag.prod_tag_freesend.length !== 0"> | 122 | <view v-if="tag.prod_tag_freesend && tag.prod_tag_freesend.length !== 0"> |
123 | <view class=""> | 123 | <view class=""> |
124 | 赠品:<view | 124 | 赠品:<view |
125 | v-for="(item,index) in tag.prod_tag_freesend" | 125 | v-for="(item,index) in tag.prod_tag_freesend" |
126 | :key="index" | 126 | :key="index" |
127 | > | 127 | > |
128 | {{item.label}}<text v-if="index !== tag.prod_tag_freesend.length - 1">/</text> | 128 | {{item.label}}<text v-if="index !== tag.prod_tag_freesend.length - 1">/</text> |
129 | </view> | 129 | </view> |
130 | </view> | 130 | </view> |
131 | </view> | 131 | </view> |
132 | <view v-if="tag.prod_tag_insurance && tag.prod_tag_insurance.length !== 0"> | 132 | <view v-if="tag.prod_tag_insurance && tag.prod_tag_insurance.length !== 0"> |
133 | <view class=""> | 133 | <view class=""> |
134 | 保险:<view | 134 | 保险:<view |
135 | v-for="(item,index) in tag.prod_tag_insurance" | 135 | v-for="(item,index) in tag.prod_tag_insurance" |
136 | :key="index" | 136 | :key="index" |
137 | > | 137 | > |
138 | {{item.label}}<text v-if="index !== tag.prod_tag_insurance.length - 1">/</text> | 138 | {{item.label}}<text v-if="index !== tag.prod_tag_insurance.length - 1">/</text> |
139 | </view> | 139 | </view> |
140 | </view> | 140 | </view> |
141 | </view> | 141 | </view> |
142 | <view v-if="tag.prod_tag_metal && tag.prod_tag_metal.length !== 0"> | 142 | <view v-if="tag.prod_tag_metal && tag.prod_tag_metal.length !== 0"> |
143 | <view class=""> | 143 | <view class=""> |
144 | 材质:<view | 144 | 材质:<view |
145 | v-for="(item,index) in tag.prod_tag_metal" | 145 | v-for="(item,index) in tag.prod_tag_metal" |
146 | :key="index" | 146 | :key="index" |
147 | > | 147 | > |
148 | {{item.label}}<text v-if="index !== tag.prod_tag_metal.length - 1">/</text> | 148 | {{item.label}}<text v-if="index !== tag.prod_tag_metal.length - 1">/</text> |
149 | </view> | 149 | </view> |
150 | </view> | 150 | </view> |
151 | </view> | 151 | </view> |
152 | <view v-if="tag.prod_tag_personal && tag.prod_tag_personal.length !== 0"> | 152 | <view v-if="tag.prod_tag_personal && tag.prod_tag_personal.length !== 0"> |
153 | <view class=""> | 153 | <view class=""> |
154 | 个性:<view | 154 | 个性:<view |
155 | v-for="(item,index) in tag.prod_tag_personal" | 155 | v-for="(item,index) in tag.prod_tag_personal" |
156 | :key="index" | 156 | :key="index" |
157 | > | 157 | > |
158 | {{item.label}}<text v-if="index !== tag.prod_tag_personal.length - 1">/</text> | 158 | {{item.label}}<text v-if="index !== tag.prod_tag_personal.length - 1">/</text> |
159 | </view> | 159 | </view> |
160 | </view> | 160 | </view> |
161 | </view> | 161 | </view> |
162 | <view v-if="tag.prod_tag_sense && tag.prod_tag_sense.length !== 0"> | 162 | <view v-if="tag.prod_tag_sense && tag.prod_tag_sense.length !== 0"> |
163 | <view class=""> | 163 | <view class=""> |
164 | 场景:<view | 164 | 场景:<view |
165 | v-for="(item,index) in tag.prod_tag_sense" | 165 | v-for="(item,index) in tag.prod_tag_sense" |
166 | :key="index" | 166 | :key="index" |
167 | > | 167 | > |
168 | {{item.label}}<text v-if="index !== tag.prod_tag_sense.length - 1">/</text> | 168 | {{item.label}}<text v-if="index !== tag.prod_tag_sense.length - 1">/</text> |
169 | </view> | 169 | </view> |
170 | </view> | 170 | </view> |
171 | </view> | 171 | </view> |
172 | <view v-if="tag.prod_tag_sex && tag.prod_tag_sex.length !== 0"> | 172 | <view v-if="tag.prod_tag_sex && tag.prod_tag_sex.length !== 0"> |
173 | <view class=""> | 173 | <view class=""> |
174 | 性别:<view | 174 | 性别:<view |
175 | v-for="(item,index) in tag.prod_tag_sex" | 175 | v-for="(item,index) in tag.prod_tag_sex" |
176 | :key="index" | 176 | :key="index" |
177 | > | 177 | > |
178 | {{item.label}}<text v-if="index !== tag.prod_tag_sex.length - 1">/</text> | 178 | {{item.label}}<text v-if="index !== tag.prod_tag_sex.length - 1">/</text> |
179 | </view> | 179 | </view> |
180 | </view> | 180 | </view> |
181 | </view> | 181 | </view> |
182 | <view v-if="tag.prod_tag_style && tag.prod_tag_style.length !== 0"> | 182 | <view v-if="tag.prod_tag_style && tag.prod_tag_style.length !== 0"> |
183 | <view class=""> | 183 | <view class=""> |
184 | 风格:<view | 184 | 风格:<view |
185 | v-for="(item,index) in tag.prod_tag_style" | 185 | v-for="(item,index) in tag.prod_tag_style" |
186 | :key="index" | 186 | :key="index" |
187 | > | 187 | > |
188 | {{item.label}}<text v-if="index !== tag.prod_tag_style.length - 1">/</text> | 188 | {{item.label}}<text v-if="index !== tag.prod_tag_style.length - 1">/</text> |
189 | </view> | 189 | </view> |
190 | </view> | 190 | </view> |
191 | </view> | 191 | </view> |
192 | <view v-if="tag.prod_tag_weight && tag.prod_tag_weight.length !== 0"> | 192 | <view v-if="tag.prod_tag_weight && tag.prod_tag_weight.length !== 0"> |
193 | <view class=""> | 193 | <view class=""> |
194 | 重量:<view | 194 | 重量:<view |
195 | v-for="(item,index) in tag.prod_tag_weight" | 195 | v-for="(item,index) in tag.prod_tag_weight" |
196 | :key="index" | 196 | :key="index" |
197 | > | 197 | > |
198 | {{item.label}}<text v-if="index !== tag.prod_tag_weight.length - 1">/</text> | 198 | {{item.label}}<text v-if="index !== tag.prod_tag_weight.length - 1">/</text> |
199 | </view> | 199 | </view> |
200 | </view> | 200 | </view> |
201 | </view> | 201 | </view> |
202 | </view> | 202 | </view> |
203 | </view> | 203 | </view> |
204 | <view | 204 | <view |
205 | class="screen-item " | 205 | class="screen-item " |
206 | v-if="current ===2" | 206 | v-if="current ===2" |
207 | > | 207 | > |
208 | <view class="customerService"> | 208 | <view class="customerService"> |
209 | <view class="serviceItem"> | 209 | <view class="serviceItem"> |
210 | <view class="title"> | 210 | <view class="title"> |
211 | <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view> | 211 | <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view> |
212 | <text class="titleText">卖家服务</text> | 212 | <text class="titleText">卖家服务</text> |
213 | </view> | 213 | </view> |
214 | <view class="itemContent">平台卖家服务,为您在平台获得最优的购买体验</view> | 214 | <view class="itemContent">平台卖家服务,为您在平台获得最优的购买体验</view> |
215 | </view> | 215 | </view> |
216 | <view class="serviceItem"> | 216 | <view class="serviceItem"> |
217 | <view class="title"> | 217 | <view class="title"> |
218 | <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view> | 218 | <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view> |
219 | <text class="titleText">平台承诺</text> | 219 | <text class="titleText">平台承诺</text> |
220 | </view> | 220 | </view> |
221 | <view class="itemContent">平台卖家服务,为您在平台获得最优的购买体验阿斯蒂芬的发射点发射点发生的房贷首付的发护法国会国家和国际会更加和</view> | 221 | <view class="itemContent">平台卖家服务,为您在平台获得最优的购买体验阿斯蒂芬的发射点发射点发生的房贷首付的发护法国会国家和国际会更加和</view> |
222 | </view> | 222 | </view> |
223 | <view class="serviceItem"> | 223 | <view class="serviceItem"> |
224 | <view class="title"> | 224 | <view class="title"> |
225 | <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view> | 225 | <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view> |
226 | <text class="titleText">正品保证</text> | 226 | <text class="titleText">正品保证</text> |
227 | </view> | 227 | </view> |
228 | <view class="itemContent">向您保证所售商品均为正品行货</view> | 228 | <view class="itemContent">向您保证所售商品均为正品行货</view> |
229 | </view> | 229 | </view> |
230 | <view class="serviceItem2"> | 230 | <view class="serviceItem2"> |
231 | <view class="title"> | 231 | <view class="title"> |
232 | <text class="titleText">权利申明</text> | 232 | <text class="titleText">权利申明</text> |
233 | </view> | 233 | </view> |
234 | <view class="itemContent">任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知。</view> | 234 | <view class="itemContent">任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知。</view> |
235 | </view> | 235 | </view> |
236 | <view class="serviceItem2"> | 236 | <view class="serviceItem2"> |
237 | <view class="title"> | 237 | <view class="title"> |
238 | <text class="titleText">价格保证</text> | 238 | <text class="titleText">价格保证</text> |
239 | </view> | 239 | </view> |
240 | <view class="itemContent"> | 240 | <view class="itemContent"> |
241 | <view class="itemContent-child"> | 241 | <view class="itemContent-child"> |
242 | <text class="contentTitle">平台价:</text> | 242 | <text class="contentTitle">平台价:</text> |
243 | <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> | 243 | <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> |
244 | </view> | 244 | </view> |
245 | <view class="itemContent-child"> | 245 | <view class="itemContent-child"> |
246 | <text class="contentTitle">划线价:</text> | 246 | <text class="contentTitle">划线价:</text> |
247 | <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> | 247 | <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> |
248 | </view> | 248 | </view> |
249 | <view class="itemContent-child"> | 249 | <view class="itemContent-child"> |
250 | <text class="contentTitle">平折扣:</text> | 250 | <text class="contentTitle">平折扣:</text> |
251 | <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> | 251 | <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> |
252 | </view> | 252 | </view> |
253 | <view class="itemContent-child"> | 253 | <view class="itemContent-child"> |
254 | <text class="contentTitle">异常问题:</text> | 254 | <text class="contentTitle">异常问题:</text> |
255 | <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> | 255 | <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> |
256 | </view> | 256 | </view> |
257 | 257 | ||
258 | </view> | 258 | </view> |
259 | </view> | 259 | </view> |
260 | </view> | 260 | </view> |
261 | </view> | 261 | </view> |
262 | </view> | 262 | </view> |
263 | <view | 263 | <view |
264 | class="D4" | 264 | class="D4" |
265 | v-if="current !==2" | 265 | v-if="current !==2" |
266 | > | 266 | > |
267 | <view class="D4_esvalue"> | 267 | <view class="D4_esvalue"> |
268 | <view>{{esvalue}} {{goodInfo.judgeInfo.good}}</view> | 268 | <view>{{esvalue}} {{goodInfo.judgeInfo.good}}</view> |
269 | <view class="D4_2"> | 269 | <view class="D4_2"> |
270 | <view | 270 | <view |
271 | class="star" | 271 | class="star" |
272 | v-for="o in starCount" | 272 | v-for="o in starCount" |
273 | :key="o" | 273 | :key="o" |
274 | > | 274 | > |
275 | <image | 275 | <image |
276 | src="../../static/img/detail/d_star.png" | 276 | src="../../static/img/detail/d_star.png" |
277 | mode="aspectFill" | 277 | mode="aspectFill" |
278 | style="height: 26rpx; width: 28rpx;" | 278 | style="height: 26rpx; width: 28rpx;" |
279 | ></image> | 279 | ></image> |
280 | </view> | 280 | </view> |
281 | </view> | 281 | </view> |
282 | </view> | 282 | </view> |
283 | <view class="D4_list"> | 283 | <view class="D4_list"> |
284 | <view | 284 | <view |
285 | v-for="(assess) in goodInfo.judge_tag" | 285 | v-for="(assess) in goodInfo.judge_tag" |
286 | :key="assess.key" | 286 | :key="assess.key" |
287 | >{{assess.name}}</view> | 287 | >{{assess.name}}</view> |
288 | </view> | 288 | </view> |
289 | </view> | 289 | </view> |
290 | <view | 290 | <view |
291 | class="D5" | 291 | class="D5" |
292 | v-if="current !==2" | 292 | v-if="current !==2" |
293 | > | 293 | > |
294 | <view class="D5_fixed1" @click="consolg(goodInfo.prodIntro1)"> | 294 | <view class="D5_fixed1" @click="consolg(goodInfo.prodIntro1)"> |
295 | <image src="/static/img/detail/hr.png"></image> | 295 | <image src="/static/img/detail/hr.png"></image> |
296 | <view>商品详细</view> | 296 | <view>商品详细</view> |
297 | <image src="/static/img/detail/hr.png"></image> | 297 | <image src="/static/img/detail/hr.png"></image> |
298 | </view> | 298 | </view> |
299 | <view class="D5_all" v-html="test"> | 299 | <view class="D5_all" v-html="test"> |
300 | <!-- <block> | 300 | <!-- <block> |
301 | <rich-text :nodes="goodInfo.prodIntro1"></rich-text> | 301 | <rich-text :nodes="goodInfo.prodIntro1"></rich-text> |
302 | </block> --> | 302 | </block> --> |
303 | </view> | 303 | </view> |
304 | </view> | 304 | </view> |
305 | <!-- 底部菜单 --> | 305 | <!-- 底部菜单 --> |
306 | <view class="botton"> | 306 | <view class="botton"> |
307 | <view | 307 | <view |
308 | @tap="toCart()" | 308 | @tap="toCart()" |
309 | class="botton_1" | 309 | class="botton_1" |
310 | > | 310 | > |
311 | <image v-bind:src="imgShop.img"></image> | 311 | <image v-bind:src="imgShop.img"></image> |
312 | <view class="botton_image">购物车</view> | 312 | <view class="botton_image">购物车</view> |
313 | </view> | 313 | </view> |
314 | <view class="botton_2"> | 314 | <view class="botton_2"> |
315 | <view | 315 | <view |
316 | class="botton_input" | 316 | class="botton_input" |
317 | @tap="addCart()" | 317 | @tap="addCart()" |
318 | >加入购物车</view> | 318 | >加入购物车</view> |
319 | <view | 319 | <view |
320 | class="botton_now" | 320 | class="botton_now" |
321 | @tap="goPerchase()" | 321 | @tap="goPerchase()" |
322 | >立即购买</view> | 322 | >立即购买</view> |
323 | </view> | 323 | </view> |
324 | </view> | 324 | </view> |
325 | </view> | 325 | </view> |
326 | </template> | 326 | </template> |
327 | 327 | ||
328 | <script> | 328 | <script> |
329 | import store from '@/store' | 329 | import store from '@/store' |
330 | export default { | 330 | export default { |
331 | data () { | 331 | data () { |
332 | return { | 332 | return { |
333 | test: '', | 333 | test: '', |
334 | goodType: 2, | 334 | goodType: 2, |
335 | pid: 0, | 335 | pid: 0, |
336 | // 购物车数据 | 336 | // 购物车数据 |
337 | addCartList: { | 337 | addCartList: { |
338 | mp_id: 0, | 338 | mp_id: 0, |
339 | uid: 0, | ||
340 | sk_id: 0, | 339 | sk_id: 0, |
341 | num: 1, | 340 | num: 1, |
342 | price: '', | 341 | price: '', |
343 | }, | 342 | }, |
344 | screenItems: [ | 343 | screenItems: [ |
345 | { current: 0, text: '商品介绍' }, | 344 | { current: 0, text: '商品介绍' }, |
346 | { current: 1, text: '规格参数' }, | 345 | { current: 1, text: '规格参数' }, |
347 | { current: 2, text: '售后保障' }, | 346 | { current: 2, text: '售后保障' }, |
348 | ], | 347 | ], |
349 | current: 0, | 348 | current: 0, |
350 | starCount: 5, | 349 | starCount: 5, |
351 | parameter: [ | 350 | parameter: [ |
352 | { key: 0, img: '/static/img/detail/d2.png', standard: '框架宽', slength: '139mm' }, | 351 | { key: 0, img: '/static/img/detail/d2.png', standard: '框架宽', slength: '139mm' }, |
353 | { key: 1, img: '/static/img/detail/d3.png', standard: '镜片宽', slength: '51mm' }, | 352 | { key: 1, img: '/static/img/detail/d3.png', standard: '镜片宽', slength: '51mm' }, |
354 | { key: 2, img: '/static/img/detail/d4.png', standard: '镜片高', slength: '45mm' }, | 353 | { key: 2, img: '/static/img/detail/d4.png', standard: '镜片高', slength: '45mm' }, |
355 | { key: 3, img: '/static/img/detail/d5.png', standard: '鼻架宽', slength: '19mm' }, | 354 | { key: 3, img: '/static/img/detail/d5.png', standard: '鼻架宽', slength: '19mm' }, |
356 | { key: 4, img: '/static/img/detail/d6.png', standard: '框架耳长', slength: '138mm' }, | 355 | { key: 4, img: '/static/img/detail/d6.png', standard: '框架耳长', slength: '138mm' }, |
357 | { key: 5, img: '/static/img/detail/d7.png', standard: '框架重', slength: '19mm' }, | 356 | { key: 5, img: '/static/img/detail/d7.png', standard: '框架重', slength: '19mm' }, |
358 | ], | 357 | ], |
359 | esvalue: '宝贝好评率', | 358 | esvalue: '宝贝好评率', |
360 | introduction: { | 359 | introduction: { |
361 | material: '钛合金', | 360 | material: '钛合金', |
362 | func: '抗疲劳/防辐射', | 361 | func: '抗疲劳/防辐射', |
363 | rate: '男/女', | 362 | rate: '男/女', |
364 | }, | 363 | }, |
365 | imgAll: '/static/img/detail/d8.png', | 364 | imgAll: '/static/img/detail/d8.png', |
366 | photoes: [ | 365 | photoes: [ |
367 | { value: '日常办公', img: '/static/img/detail/d9.png' }, | 366 | { value: '日常办公', img: '/static/img/detail/d9.png' }, |
368 | { value: '上网', img: '/static/img/detail/d10.png' }, | 367 | { value: '上网', img: '/static/img/detail/d10.png' }, |
369 | { value: '追剧', img: '/static/img/detail/d11.png' }, | 368 | { value: '追剧', img: '/static/img/detail/d11.png' }, |
370 | { value: '玩游戏', img: '/static/img/detail/d12.png' }, | 369 | { value: '玩游戏', img: '/static/img/detail/d12.png' }, |
371 | ], | 370 | ], |
372 | imgDetail: '/static/img/detail/d13.png', | 371 | imgDetail: '/static/img/detail/d13.png', |
373 | imgShop: { | 372 | imgShop: { |
374 | img: '/static/tab-cart.png', | 373 | img: '/static/tab-cart.png', |
375 | IsShown: false, | 374 | IsShown: false, |
376 | }, | 375 | }, |
377 | tag: { | 376 | tag: { |
378 | prod_tag_freesend: [{ | 377 | prod_tag_freesend: [{ |
379 | label: '眼镜盒', | 378 | label: '眼镜盒', |
380 | value: '262', | 379 | value: '262', |
381 | }], | 380 | }], |
382 | }, | 381 | }, |
383 | } | 382 | } |
384 | }, | 383 | }, |
385 | onLoad: function ({ pid, sk_id }) { | 384 | onLoad: function ({ pid, sk_id }) { |
386 | this.pid = pid | 385 | this.pid = pid |
387 | // console.log('sk_id=====>',sk_id) | 386 | // console.log('sk_id=====>',sk_id) |
388 | store.dispatch('read/fetch', { | 387 | store.dispatch('read/fetch', { |
389 | pid, | 388 | pid, |
390 | sk_id, | 389 | sk_id, |
391 | }).then(() => { | 390 | }).then(() => { |
392 | this.parameter[0].slength = `${this.goodInfo.frame_width}mm` | 391 | this.parameter[0].slength = `${this.goodInfo.frame_width}mm` |
393 | this.parameter[1].slength = `${this.goodInfo.glass_width}mm` | 392 | this.parameter[1].slength = `${this.goodInfo.glass_width}mm` |
394 | this.parameter[2].slength = `${this.goodInfo.glass_height}mm` | 393 | this.parameter[2].slength = `${this.goodInfo.glass_height}mm` |
395 | this.parameter[3].slength = `${this.goodInfo.nose_width}mm` | 394 | this.parameter[3].slength = `${this.goodInfo.nose_width}mm` |
396 | this.parameter[4].slength = `${this.goodInfo.leg_long}mm` | 395 | this.parameter[4].slength = `${this.goodInfo.leg_long}mm` |
397 | this.parameter[5].slength = `${this.goodInfo.weight}mm` | 396 | this.parameter[5].slength = `${this.goodInfo.weight}mm` |
398 | this.tag = this.goodInfo.tag | 397 | this.tag = this.goodInfo.tag |
399 | this.test = this.goodInfo.prodIntro1 | 398 | this.test = this.goodInfo.prodIntro1 |
400 | this.test = this.test.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ') | 399 | this.test = this.test.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ') |
401 | // addCart | 400 | // addCart |
402 | this.addCartList.price = this.goodInfo.p_sale_price | 401 | this.addCartList.price = this.goodInfo.priceArea.Min_Price |
403 | this.addCartList.sk_id = this.goodInfo.skuList[0].sk_id | 402 | this.addCartList.sk_id = this.goodInfo.skuList[0].sk_id |
404 | this.addCartList.mp_id = this.goodInfo.glassData.mp_id | 403 | this.addCartList.mp_id = this.goodInfo.glassData.mp_id |
405 | this.addCartList.uid = this.$store.state.user.userInfo.uid | ||
406 | }) | 404 | }) |
407 | // console.log(this.$store.state.user.userInfo.uid + 'ssss') | 405 | // console.log(this.$store.state.user.userInfo.uid + 'ssss') |
408 | }, | 406 | }, |
409 | computed: { | 407 | computed: { |
410 | updateGoodType () { | 408 | updateGoodType () { |
411 | return this.goodType | 409 | return this.goodType |
412 | }, | 410 | }, |
413 | goodInfo () { | 411 | goodInfo () { |
414 | console.log(this.$store.state.read.goodInfo) | 412 | console.log(this.$store.state.read.goodInfo) |
415 | return this.$store.state.read.goodInfo | 413 | return this.$store.state.read.goodInfo |
416 | }, | 414 | }, |
417 | }, | 415 | }, |
418 | methods: { | 416 | methods: { |
419 | // 前往购物车 | 417 | // 前往购物车 |
420 | toCart() { | 418 | toCart() { |
421 | uni.switchTab({ | 419 | uni.switchTab({ |
422 | url: '/pages/cart/cart', | 420 | url: '/pages/cart/cart', |
423 | success: res => {}, | 421 | success: res => {}, |
424 | fail: (error) => { console.log('跳转购物车失败======>', error) }, | 422 | fail: (error) => { console.log('跳转购物车失败======>', error) }, |
425 | complete: () => { console.log('toCart') }, | 423 | complete: () => { console.log('toCart') }, |
426 | }) | 424 | }) |
427 | }, | 425 | }, |
428 | // 加入购物车 | 426 | // 加入购物车 |
429 | addCart () { | 427 | addCart () { |
430 | store.dispatch('cart/addCart', { | 428 | store.dispatch('cart/addCart', { |
431 | uid: this.$store.state.user.userInfo.uid, | 429 | uid: this.$store.state.user.userInfo.uid, |
432 | openid: this.$store.state.user.userInfo.openid, | 430 | openid: this.$store.state.user.userInfo.openid, |
433 | mp_id: this.addCartList.mp_id, | 431 | mp_id: this.addCartList.mp_id, |
434 | sk_id: this.addCartList.sk_id, | 432 | sk_id: this.addCartList.sk_id, |
435 | num: this.addCartList.num, | 433 | num: this.addCartList.num, |
436 | pid: this.pid, | 434 | pid: this.pid, |
437 | price: this.addCartList.price, | 435 | price: this.addCartList.price, |
438 | checkedSKU: {}, | ||
439 | }) | 436 | }) |
437 | // 再次请求购物车接口,实现实时更新 | ||
440 | store.dispatch('cart/getCartList', { | 438 | store.dispatch('cart/getCartList', { |
441 | uid: this.$store.state.user.userInfo.uid, // 用户id | 439 | uid: this.$store.state.user.userInfo.uid, |
442 | }) | 440 | }) |
443 | }, | 441 | }, |
444 | goPerchase () { | 442 | goPerchase () { |
445 | // switch (this.updateGoodType) { | 443 | // switch (this.updateGoodType) { |
446 | // case '1': | 444 | // case '1': |
447 | console.log('goPerchase') | 445 | console.log('goPerchase') |
448 | uni.navigateTo({ | 446 | uni.navigateTo({ |
449 | url: `../purchaseLenses/purchaseLenses?pid=${this.pid}`, | 447 | url: `../purchaseLenses/purchaseLenses?pid=${this.pid}`, |
450 | success: res => {}, | 448 | success: res => {}, |
451 | fail: (error) => { console.log('跳转参数选择失败======>', error) }, | 449 | fail: (error) => { console.log('跳转参数选择失败======>', error) }, |
452 | complete: () => { console.log('goPerchase') }, | 450 | complete: () => { console.log('goPerchase') }, |
453 | }) | 451 | }) |
454 | // break | 452 | // break |
455 | // case '2': | 453 | // case '2': |
456 | // uni.navigateTo({ | 454 | // uni.navigateTo({ |
457 | // url: '../detailStandard/detailStandard_k', | 455 | // url: '../detailStandard/detailStandard_k', |
458 | // success: res => {}, | 456 | // success: res => {}, |
459 | // fail: () => {}, | 457 | // fail: () => {}, |
460 | // complete: () => {} | 458 | // complete: () => {} |
461 | // }) | 459 | // }) |
462 | // break | 460 | // break |
463 | // case '3': | 461 | // case '3': |
464 | // uni.navigateTo({ | 462 | // uni.navigateTo({ |
465 | // url: '../purchaseLenses/purchaseLenses', | 463 | // url: '../purchaseLenses/purchaseLenses', |
466 | // success: res => {}, | 464 | // success: res => {}, |
467 | // fail: () => {}, | 465 | // fail: () => {}, |
468 | // complete: () => {} | 466 | // complete: () => {} |
469 | // }) | 467 | // }) |
470 | // break | 468 | // break |
471 | // case '4': | 469 | // case '4': |
472 | // uni.navigateTo({ | 470 | // uni.navigateTo({ |
473 | // url: '../detailStandard/detailStandard_sun', | 471 | // url: '../detailStandard/detailStandard_sun', |
474 | // success: res => {}, | 472 | // success: res => {}, |
475 | // fail: () => {}, | 473 | // fail: () => {}, |
476 | // complete: () => {} | 474 | // complete: () => {} |
477 | // }) | 475 | // }) |
478 | // break | 476 | // break |
479 | // default : | 477 | // default : |
480 | // break | 478 | // break |
481 | // } | 479 | // } |
482 | }, | 480 | }, |
483 | // 加入购物车 | 481 | // 加入购物车 |
484 | // addCart () { | 482 | // addCart () { |
485 | // store.dispatch('cart/addCart', { | 483 | // store.dispatch('cart/addCart', { |
486 | // uid: this.$store.state.user.userInfo.uid, | 484 | // uid: this.$store.state.user.userInfo.uid, |
487 | // openid: this.$store.state.user.userInfo.openid, | 485 | // openid: this.$store.state.user.userInfo.openid, |
488 | // pid: this.pid, | 486 | // pid: this.pid, |
489 | // checkedSKU: {}, | 487 | // checkedSKU: {}, |
490 | // }) | 488 | // }) |
491 | // store.dispatch('cart/getCartList', { | 489 | // store.dispatch('cart/getCartList', { |
492 | // uid: this.$store.state.user.userInfo.uid, // 用户id | 490 | // uid: this.$store.state.user.userInfo.uid, // 用户id |
493 | // }) | 491 | // }) |
494 | // }, | 492 | // }, |
495 | tabChange (e) { | 493 | tabChange (e) { |
496 | if (this.current !== e) { | 494 | if (this.current !== e) { |
497 | this.current = e | 495 | this.current = e |
498 | } | 496 | } |
499 | }, | 497 | }, |
500 | }, | 498 | }, |
501 | } | 499 | } |
502 | </script> | 500 | </script> |
503 | <style lang='scss'> | 501 | <style lang='scss'> |
504 | .container { | 502 | .container { |
505 | background-color: #f8f8f8; | 503 | background-color: #f8f8f8; |
506 | } | 504 | } |
507 | .D1, | 505 | .D1, |
508 | .D2, | 506 | .D2, |
509 | .D3, | 507 | .D3, |
510 | .D4, | 508 | .D4, |
511 | .D6 { | 509 | .D6 { |
512 | background: #ffffff; | 510 | background: #ffffff; |
513 | margin-bottom: 10px; | 511 | margin-bottom: 10px; |
514 | padding: 8px 20px 8px 20px; | 512 | padding: 8px 20px 8px 20px; |
515 | box-sizing: border-box; | 513 | box-sizing: border-box; |
516 | .swiperImage { | 514 | .swiperImage { |
517 | width: 684rpx; | 515 | width: 684rpx; |
518 | height: 480rpx; | 516 | height: 480rpx; |
519 | image { | 517 | image { |
520 | max-width: 100%; | 518 | max-width: 100%; |
521 | max-height: 100%; | 519 | max-height: 100%; |
522 | border-radius: 16rpx; | 520 | border-radius: 16rpx; |
523 | } | 521 | } |
524 | } | 522 | } |
525 | } | 523 | } |
526 | .D5 { | 524 | .D5 { |
527 | background: #ffffff; | 525 | background: #ffffff; |
528 | padding: 8px 20px 8px 20px; | 526 | padding: 8px 20px 8px 20px; |
529 | box-sizing: border-box; | 527 | box-sizing: border-box; |
530 | } | 528 | } |
531 | .swiperImage { | 529 | .swiperImage { |
532 | width: 100%; | 530 | width: 100%; |
533 | height: 560rpx; | 531 | height: 560rpx; |
534 | .swiper-item { | 532 | .swiper-item { |
535 | width: 100%; | 533 | width: 100%; |
536 | image { | 534 | image { |
537 | width: 100%; | 535 | width: 100%; |
538 | } | 536 | } |
539 | } | 537 | } |
540 | } | 538 | } |
541 | .D1 { | 539 | .D1 { |
542 | .D1_price { | 540 | .D1_price { |
543 | color: #eb5d3b; | 541 | color: #eb5d3b; |
544 | font-size: 18px; | 542 | font-size: 18px; |
545 | margin-top: 5px; | 543 | margin-top: 5px; |
546 | font-family: "PingFangSC-Semibold"; | 544 | font-family: "PingFangSC-Semibold"; |
547 | display: flex; | 545 | display: flex; |
548 | justify-content: space-between; | 546 | justify-content: space-between; |
549 | .D1_number { | 547 | .D1_number { |
550 | color: #999999; | 548 | color: #999999; |
551 | font-size: 14px; | 549 | font-size: 14px; |
552 | font-family: "PingFangSC-Regular"; | 550 | font-family: "PingFangSC-Regular"; |
553 | } | 551 | } |
554 | } | 552 | } |
555 | .D1_name { | 553 | .D1_name { |
556 | font-size: 16px; | 554 | font-size: 16px; |
557 | font-family: "PingFangSC-Semibold"; | 555 | font-family: "PingFangSC-Semibold"; |
558 | margin-top: 5px; | 556 | margin-top: 5px; |
559 | .D1_name1 { | 557 | .D1_name1 { |
560 | font-weight: bold; | 558 | font-weight: bold; |
561 | font-size: 16px; | 559 | font-size: 16px; |
562 | color: #333333; | 560 | color: #333333; |
563 | } | 561 | } |
564 | } | 562 | } |
565 | .D1_spans { | 563 | .D1_spans { |
566 | font-size: 10px; | 564 | font-size: 10px; |
567 | color: #999999; | 565 | color: #999999; |
568 | margin-top: 5px; | 566 | margin-top: 5px; |
569 | span { | 567 | span { |
570 | height: 14px; | 568 | height: 14px; |
571 | margin-right: 10px; | 569 | margin-right: 10px; |
572 | } | 570 | } |
573 | } | 571 | } |
574 | } | 572 | } |
575 | .D2 { | 573 | .D2 { |
576 | font-size: 14px; | 574 | font-size: 14px; |
577 | font-family: "PingFangSC-Regular"; | 575 | font-family: "PingFangSC-Regular"; |
578 | view { | 576 | view { |
579 | height: 24px; | 577 | height: 24px; |
580 | } | 578 | } |
581 | .D2_span1 { | 579 | .D2_span1 { |
582 | color: #999999; | 580 | color: #999999; |
583 | } | 581 | } |
584 | .D2_span2 { | 582 | .D2_span2 { |
585 | color: #333333; | 583 | color: #333333; |
586 | } | 584 | } |
587 | } | 585 | } |
588 | .D3 { | 586 | .D3 { |
589 | .screenBar { | 587 | .screenBar { |
590 | width: 670rpx; | 588 | width: 670rpx; |
591 | margin-top: 20rpx; | 589 | margin-top: 20rpx; |
592 | margin-bottom: 24rpx; | 590 | margin-bottom: 24rpx; |
593 | display: flex; | 591 | display: flex; |
594 | flex-direction: row; | 592 | flex-direction: row; |
595 | justify-content: space-between; | 593 | justify-content: space-between; |
596 | align-items: center; | 594 | align-items: center; |
597 | font-size: 14px; | 595 | font-size: 14px; |
598 | color: #333333; | 596 | color: #333333; |
599 | transition: all 0.2s; | 597 | transition: all 0.2s; |
600 | } | 598 | } |
601 | .screen-item { | 599 | .screen-item { |
602 | font-size: 32rpx; | 600 | font-size: 32rpx; |
603 | color: #333333; | 601 | color: #333333; |
604 | display: flex; | 602 | display: flex; |
605 | transition: all 0.2s; | 603 | transition: all 0.2s; |
606 | .D3_list { | 604 | .D3_list { |
607 | margin-bottom: 4px; | 605 | margin-bottom: 4px; |
608 | } | 606 | } |
609 | .D3_list view { | 607 | .D3_list view { |
610 | display: flex; | 608 | display: flex; |
611 | align-content: center; | 609 | align-content: center; |
612 | font-size: 14px; | 610 | font-size: 14px; |
613 | color: #333333; | 611 | color: #333333; |
614 | } | 612 | } |
615 | .D3_list image { | 613 | .D3_list image { |
616 | width: 50px; | 614 | width: 50px; |
617 | height: 25px; | 615 | height: 25px; |
618 | margin-right: 6px; | 616 | margin-right: 6px; |
619 | } | 617 | } |
620 | .D3_list span { | 618 | .D3_list span { |
621 | margin-left: 6px; | 619 | margin-left: 6px; |
622 | margin-right: 5px; | 620 | margin-right: 5px; |
623 | font-family: "PingFangSC-Regular"; | 621 | font-family: "PingFangSC-Regular"; |
624 | } | 622 | } |
625 | } | 623 | } |
626 | .active { | 624 | .active { |
627 | border-bottom: 4rpx solid #ff6b4a; | 625 | border-bottom: 4rpx solid #ff6b4a; |
628 | } | 626 | } |
629 | .customerService { | 627 | .customerService { |
630 | margin-bottom: 90rpx; | 628 | margin-bottom: 90rpx; |
631 | .serviceItem { | 629 | .serviceItem { |
632 | margin-bottom: 32rpx; | 630 | margin-bottom: 32rpx; |
633 | .title { | 631 | .title { |
634 | display: flex; | 632 | display: flex; |
635 | flex-direction: row; | 633 | flex-direction: row; |
636 | align-items: center; | 634 | align-items: center; |
637 | .titleText { | 635 | .titleText { |
638 | font-size: 14px; | 636 | font-size: 14px; |
639 | color: #333333; | 637 | color: #333333; |
640 | margin-bottom: 12rpx; | 638 | margin-bottom: 12rpx; |
641 | } | 639 | } |
642 | } | 640 | } |
643 | .itemContent { | 641 | .itemContent { |
644 | font-size: 14px; | 642 | font-size: 14px; |
645 | color: #999999; | 643 | color: #999999; |
646 | margin-left: 18rpx; | 644 | margin-left: 18rpx; |
647 | } | 645 | } |
648 | } | 646 | } |
649 | .serviceItem2 { | 647 | .serviceItem2 { |
650 | margin-left: 18rpx; | 648 | margin-left: 18rpx; |
651 | margin-bottom: 32rpx; | 649 | margin-bottom: 32rpx; |
652 | .titleText { | 650 | .titleText { |
653 | font-size: 14px; | 651 | font-size: 14px; |
654 | color: #ff6b4a; | 652 | color: #ff6b4a; |
655 | } | 653 | } |
656 | .itemContent { | 654 | .itemContent { |
657 | font-size: 14px; | 655 | font-size: 14px; |
658 | color: #999999; | 656 | color: #999999; |
659 | .itemContent-child { | 657 | .itemContent-child { |
660 | margin-bottom: 40rpx; | 658 | margin-bottom: 40rpx; |
661 | .contentTitle { | 659 | .contentTitle { |
662 | border-bottom: 1px solid #ff6b4a; | 660 | border-bottom: 1px solid #ff6b4a; |
663 | } | 661 | } |
664 | } | 662 | } |
665 | } | 663 | } |
666 | } | 664 | } |
667 | } | 665 | } |
668 | } | 666 | } |
669 | .D4 { | 667 | .D4 { |
670 | .D4_esvalue { | 668 | .D4_esvalue { |
671 | font-size: 14px; | 669 | font-size: 14px; |
672 | color: #333333; | 670 | color: #333333; |
673 | display: flex; | 671 | display: flex; |
674 | justify-content: space-between; | 672 | justify-content: space-between; |
675 | margin-bottom: 10px; | 673 | margin-bottom: 10px; |
676 | .D4_2 { | 674 | .D4_2 { |
677 | width: 90px; | 675 | width: 90px; |
678 | display: flex; | 676 | display: flex; |
679 | align-items: center; | 677 | align-items: center; |
680 | justify-content: space-between; | 678 | justify-content: space-between; |
681 | } | 679 | } |
682 | } | 680 | } |
683 | .D4_esvalue view { | 681 | .D4_esvalue view { |
684 | font-size: 14px; | 682 | font-size: 14px; |
685 | color: #333333; | 683 | color: #333333; |
686 | font-weight: bold; | 684 | font-weight: bold; |
687 | } | 685 | } |
688 | .D4_list{ | 686 | .D4_list{ |
689 | display: grid; | 687 | display: grid; |
690 | grid-row-gap: 10px; | 688 | grid-row-gap: 10px; |
691 | grid-column-gap: 4px; | 689 | grid-column-gap: 4px; |
692 | } | 690 | } |
693 | .D4_list view { | 691 | .D4_list view { |
694 | display: flex; | 692 | display: flex; |
695 | justify-content: center; | 693 | justify-content: center; |
696 | align-items: center; | 694 | align-items: center; |
697 | font-size: 12px; | 695 | font-size: 12px; |
698 | width: 118px; | 696 | width: 118px; |
699 | height: 24px; | 697 | height: 24px; |
700 | border-radius: 2px; | 698 | border-radius: 2px; |
701 | background: #f2f2f2; | 699 | background: #f2f2f2; |
702 | color: #666666; | 700 | color: #666666; |
703 | // letter-spacing: 1px; | 701 | // letter-spacing: 1px; |
704 | } | 702 | } |
705 | } | 703 | } |
706 | .D5 { | 704 | .D5 { |
707 | .D5_fixed1 { | 705 | .D5_fixed1 { |
708 | display: flex; | 706 | display: flex; |
709 | justify-content: space-between; | 707 | justify-content: space-between; |
710 | align-content: center; | 708 | align-content: center; |
711 | margin-bottom: 12px; | 709 | margin-bottom: 12px; |
712 | view { | 710 | view { |
713 | font-size: 14px; | 711 | font-size: 14px; |
714 | color: #333333; | 712 | color: #333333; |
715 | font-weight: bold; | 713 | font-weight: bold; |
716 | font-family: "PingFangSC-Medium"; | 714 | font-family: "PingFangSC-Medium"; |
717 | line-height: 24px; | 715 | line-height: 24px; |
718 | } | 716 | } |
719 | image { | 717 | image { |
720 | width: 240rpx; | 718 | width: 240rpx; |
721 | height: 3px; | 719 | height: 3px; |
722 | margin-top: 10px; | 720 | margin-top: 10px; |
723 | } | 721 | } |
724 | } | 722 | } |
725 | .D5_all { | 723 | .D5_all { |
726 | width: 100%; | 724 | width: 100%; |
727 | margin-top: 30rpx; | 725 | margin-top: 30rpx; |
728 | margin-right: 30rpx; | 726 | margin-right: 30rpx; |
729 | margin-bottom: 180rpx; | 727 | margin-bottom: 180rpx; |
730 | font-family: "PingFangSC-Regular"; | 728 | font-family: "PingFangSC-Regular"; |
731 | // border: #999999 solid 1.5px; | 729 | // border: #999999 solid 1.5px; |
732 | } | 730 | } |
733 | } | 731 | } |
734 | .D6 { | 732 | .D6 { |
735 | width: 100%; | 733 | width: 100%; |
736 | height: 430px; | 734 | height: 430px; |
737 | background: #f9f6ed; | 735 | background: #f9f6ed; |
738 | margin-bottom: 74px; | 736 | margin-bottom: 74px; |
739 | view { | 737 | view { |
740 | text-align: center; | 738 | text-align: center; |
741 | } | 739 | } |
742 | .D6_v1 { | 740 | .D6_v1 { |
743 | font-weight: bold; | 741 | font-weight: bold; |
744 | } | 742 | } |
745 | .D6_v2 { | 743 | .D6_v2 { |
746 | font-size: 14px; | 744 | font-size: 14px; |
747 | margin-bottom: 30px; | 745 | margin-bottom: 30px; |
748 | } | 746 | } |
749 | .D6_v5 { | 747 | .D6_v5 { |
750 | .D6_v5_s1 { | 748 | .D6_v5_s1 { |
751 | font-weight: bold; | 749 | font-weight: bold; |
752 | } | 750 | } |
753 | .D6_v5_s2 { | 751 | .D6_v5_s2 { |
754 | font-size: 14px; | 752 | font-size: 14px; |
755 | } | 753 | } |
756 | } | 754 | } |
757 | } | 755 | } |
758 | .botton { | 756 | .botton { |
759 | position: fixed; | 757 | position: fixed; |
760 | bottom: 0; | 758 | bottom: 0; |
761 | height: 74px; | 759 | height: 74px; |
762 | width: 100%; | 760 | width: 100%; |
763 | background: #ffffff; | 761 | background: #ffffff; |
764 | padding: 20px 20px 8px 20px; | 762 | padding: 20px 20px 8px 20px; |
765 | font-family: "PingFangSC-Regular"; | 763 | font-family: "PingFangSC-Regular"; |
766 | box-sizing: border-box; | 764 | box-sizing: border-box; |
767 | display: flex; | 765 | display: flex; |
768 | justify-content: space-between; | 766 | justify-content: space-between; |
769 | align-content: center; | 767 | align-content: center; |
770 | .botton_1 { | 768 | .botton_1 { |
771 | width: 20%; | 769 | width: 20%; |
772 | height: 100%; | 770 | height: 100%; |
773 | text-align: center; | 771 | text-align: center; |
774 | color: #989898; | 772 | color: #989898; |
775 | } | 773 | } |
776 | image { | 774 | image { |
777 | width: 60%; | 775 | width: 60%; |
778 | height: 30px; | 776 | height: 30px; |
779 | } | 777 | } |
780 | .botton_image { | 778 | .botton_image { |
781 | font-size: 12px; | 779 | font-size: 12px; |
782 | text-align: center; | 780 | text-align: center; |
783 | } | 781 | } |
784 | .botton_2 { | 782 | .botton_2 { |
785 | width: 74%; | 783 | width: 74%; |
786 | height: 86%; | 784 | height: 86%; |
787 | display: grid; | 785 | display: grid; |
788 | grid-template-columns: 50% 50%; | 786 | grid-template-columns: 50% 50%; |
789 | } | 787 | } |
790 | .botton_input { | 788 | .botton_input { |
791 | display: inline-flex; | 789 | display: inline-flex; |
792 | align-items: center; | 790 | align-items: center; |
793 | justify-content: space-around; | 791 | justify-content: space-around; |
794 | background: #fff0ec; | 792 | background: #fff0ec; |
795 | font-size: 16px; | 793 | font-size: 16px; |
796 | color: #ff6b4a; | 794 | color: #ff6b4a; |
797 | border-radius: 20px 0 0 20px; | 795 | border-radius: 20px 0 0 20px; |
798 | } | 796 | } |
799 | .botton_now { | 797 | .botton_now { |
800 | display: inline-flex; | 798 | display: inline-flex; |
801 | align-items: center; | 799 | align-items: center; |
802 | justify-content: space-around; | 800 | justify-content: space-around; |
803 | background: #ff6b4a; | 801 | background: #ff6b4a; |
804 | font-size: 16px; | 802 | font-size: 16px; |
805 | color: #ffffff; | 803 | color: #ffffff; |
806 | border-radius: 0 20px 20px 0; | 804 | border-radius: 0 20px 20px 0; |
807 | } | 805 | } |
808 | } | 806 | } |
809 | </style> | 807 | </style> |