Blame view

src/pages/detailStandard/detailStandard_k.vue 16.5 KB
7d9acd27a   尹聃   选购页
1
2
3
  <template>
      <view class="container">
          <view class="detail">
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
4
              <view class="detail1"><image v-bind:src="details.data.img_index_url"></image></view>
7d9acd27a   尹聃   选购页
5
              <view class="detail2">
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
6
                  <view class="detail2_name">{{details.data.p_name}}</view>
7d9acd27a   尹聃   选购页
7
                  <view class="detail2_tui"><span>支持7天无条件退货</span><span>顺丰发货</span></view>
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
8
9
10
11
12
13
                  <view class="detail2_price">
                      <span>¥{{details.data.p_sale_price*count}}</span>
                      <view class="counter">
                              <view class="btn" disabled="this.disabled" @click="counter(false)">-</view>
                              <text>{{count}}</text>
                              <view class="btn" @click="counter(true)">+</view>
f112b6434   范牧   全面屏适配
14
                      </view>
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
15
                  </view>
7d9acd27a   尹聃   选购页
16
17
18
19
              </view>
          </view>
          <view class="choose">
              <view class="colour">
0c6c0f3c4   尹聃   选购页折叠
20
21
22
23
24
                  <view class="colour1"  @click="xialachange(0)">
                      <text>框架颜色</text>
                      <image  v-bind:src="isNone[0].img"></image>
                  </view>
                  <view class="colour_exp">*{{navData.colour}}</view>
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
25
                  <view>
0c6c0f3c4   尹聃   选购页折叠
26
                  <view class="colour2"  v-bind:class="{'colour2_none' : isNone[0].state}">
f112b6434   范牧   全面屏适配
27
28
29
                      <view
                      v-for="(items,index) in details.data.skuList"
                      :key="index"
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
30
31
32
33
                      @click="viewChoose(index)"
                      class="colour2_view"
                      v-bind:class="{'colour2_viewed': chooseNum == index}"
                      >
f112b6434   范牧   全面屏适配
34
                          <image v-bind:src="items.pic" @click="colourChange(index,items.sku_name)"></image>
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
35
36
                      </view>
                  </view>
7d9acd27a   尹聃   选购页
37
38
39
40
                  </view>
                  <hr/>
              </view>
              <view class="size">
0c6c0f3c4   尹聃   选购页折叠
41
                  <view class="size1" @click="xialachange(1)">
7d9acd27a   尹聃   选购页
42
                      <view class="size1_1">框架尺寸</view>
0c6c0f3c4   尹聃   选购页折叠
43
                      <view><image v-bind:src="isNone[1].img"></image></view>
7d9acd27a   尹聃   选购页
44
                  </view>
f112b6434   范牧   全面屏适配
45
                  <view class="colour">
0c6c0f3c4   尹聃   选购页折叠
46
                      <view class="colour_exp">*{{navData.colour}}</view>
7d9acd27a   尹聃   选购页
47
                  </view>
0c6c0f3c4   尹聃   选购页折叠
48
                  <view class="D3_list"  v-bind:class="{'colour2_none' : isNone[1].state}">
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
49
50
51
52
53
54
55
56
                      <view>
                          <view><image class="D3_image"  v-bind:src ="parameter[0].img"></image></view>
                          <view class="D3_list_jDu">
                              <view class="D3_list1">
                                  <c-progress class="c-progress"  :inner_widthProp="300"/>
                                  <text>{{details.data.frame_width}}mm</text>
                             </view>
                              <view>{{parameter[0].standard}}</view>
f112b6434   范牧   全面屏适配
57
                          </view>
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
58
59
60
                      </view>
                      <view>
                          <view><image class="D3_image"  v-bind:src ="parameter[1].img"></image></view>
7d9acd27a   尹聃   选购页
61
                          <view class="D3_list_jDu">
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
62
63
64
65
66
                              <view class="D3_list1">
                                  <c-progress class="c-progress"  :inner_widthProp="190"/>
                                  <view>{{details.data.glass_width}}mm</view>
                              </view>
                              <view>{{parameter[1].standard}}</view>
f112b6434   范牧   全面屏适配
67
                          </view>
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
68
69
70
71
72
73
74
75
76
                      </view>
                      <view>
                          <view><image class="D3_image"  v-bind:src ="parameter[2].img"></image></view>
                          <view class="D3_list_jDu">
                              <view class="D3_list1">
                              <c-progress class="c-progress"  :inner_widthProp="210"/>
                              <view>{{details.data.glass_height}}mm</view>
                              </view>
                              <view>{{parameter[2].standard}}</view>
f112b6434   范牧   全面屏适配
77
                          </view>
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
78
79
80
81
                      </view>
                      <view>
                          <view><image class="D3_image"  v-bind:src ="parameter[3].img"></image></view>
                          <view class="D3_list_jDu">
f112b6434   范牧   全面屏适配
82

8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
83
84
85
86
87
                              <view class="D3_list1">
                                  <c-progress class="c-progress"  :inner_widthProp="160"/>
                                  <view>{{details.data.nose_width}}mm</view>
                              </view>
                              <view>{{parameter[3].standard}}</view>
f112b6434   范牧   全面屏适配
88
                          </view>
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
89
90
91
92
93
94
95
96
97
                      </view>
                      <view>
                          <view><image class="D3_image"  v-bind:src ="parameter[4].img"></image></view>
                          <view class="D3_list_jDu">
                              <view class="D3_list1">
                                  <c-progress class="c-progress"  :inner_widthProp="260"/>
                                  <view>{{details.data.leg_long}}mm</view>
                              </view>
                             <view>{{parameter[4].standard}}</view>
f112b6434   范牧   全面屏适配
98
                          </view>
7d9acd27a   尹聃   选购页
99
100
101
102
103
                      </view>
                      <hr/>
                  </view>
              </view>
              <view class="part">
0c6c0f3c4   尹聃   选购页折叠
104
105
106
107
108
109
                  <view class="size1" @click="xialachange(2)">
                      <view class="size1_1" >配件</view>
                      <view>
                          <span>+¥0.00</span>
                          <image  v-bind:src="isNone[2].img"></image>
                      </view>
7d9acd27a   尹聃   选购页
110
111
                  </view>
                  <view class="colour_exp">*0290</view>
0c6c0f3c4   尹聃   选购页折叠
112
                  <view class="part_som"  v-bind:class="{'colour2_none' : isNone[2].state}">
f112b6434   范牧   全面屏适配
113
114
                      <view
                      v-for="(part) in part"
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
115
116
117
118
119
                      :key="part.key"
                      v-bind:class="{'size_viewed': part.is_actived}"
                      >
                      <image v-bind:src="part.img"></image>
                  </view>
7d9acd27a   尹聃   选购页
120
121
122
123
124
125
126
127
                  </view>
              </view>
          </view>
          <view class="buy">
              <view class="buy1">选了镜框,想选镜片?</view>
              <view class="buy2">系统已为你保存好已选镜框,放心去选镜片吧!</view>
              <view class="buy3">
                  <view class="buy3_1">暂时不选</view>
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
128
                  <view class="buy3_2" @click="popArgs">立即去选</view>
7d9acd27a   尹聃   选购页
129
130
131
              </view>
          </view>
          <view class="zhanwei"></view>
29f4d5fe5   尹聃   选购页传递参数
132
          <view class="button"><view  @click="popSure(details.data.p_name,details.data.p_sale_price)" >立即结算</view></view>
7d9acd27a   尹聃   选购页
133
134
135
136
      </view>
  </template>
  <script>
  import CProgress from '../../components/UniSliper/UniSliper'
c4c4f1251   尹聃   修改镜框选购页
137
  import store from '@/store'
7d9acd27a   尹聃   选购页
138
139
  
  export default {
f112b6434   范牧   全面屏适配
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
    components: {
      CProgress,
    },
    data() {
      return {
        count: 1,
        // colour: '1.56非球面防蓝光_亚黑色',
        chooseNum: '',
        isNone: [
          { state: false, img: '/static/img/detail/xiala.png' },
          { state: false, img: '/static/img/detail/xiala.png' },
          { state: false, img: '/static/img/detail/xiala.png' },
          { state: false, img: '/static/img/detail/xiala.png' },
          { state: false, img: '/static/img/detail/xiala.png' },
        ],
        // 传参
        navData: {
          pid: '26',
          p_root_index: '2',
          name: '',
          price: '',
          colour: '1.56非球面防蓝光_亚黑色',
        },
0c6c0f3c4   尹聃   选购页折叠
163

f112b6434   范牧   全面屏适配
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
        // 尺寸
        parameter: [
          { key: 0, img: '/static/img/detail/d2.png', standard: '框架宽', slength: 139 },
          { key: 1, img: '/static/img/detail/d3.png', standard: '镜片宽', slength: 51 },
          { key: 2, img: '/static/img/detail/d4.png', standard: '镜片高', slength: 45 },
          { key: 3, img: '/static/img/detail/d5.png', standard: '鼻架宽', slength: 19 },
          { key: 4, img: '/static/img/detail/d6.png', standard: '框架耳长', slength: 138 },
        ],
        // 配饰
        part: [
          { key: 0, img: '/static/img/detail/Kuang/g1.png', is_actived: true },
          { key: 1, img: '/static/img/detail/Kuang/g1.png', is_actived: false },
          { key: 2, img: '/static/img/detail/Kuang/g2.png', is_actived: false },
          { key: 3, img: '/static/img/detail/Kuang/g1.png', is_actived: false },
          { key: 4, img: '/static/img/detail/Kuang/g1.png', is_actived: false },
          { key: 5, img: '/static/img/detail/Kuang/g3.png', is_actived: false },
          { key: 6, img: '/static/img/detail/Kuang/g3.png', is_actived: false },
          { key: 7, img: '/static/img/detail/Kuang/g2.png', is_actived: false },
        ],
      }
    },
c4c4f1251   尹聃   修改镜框选购页
185

f112b6434   范牧   全面屏适配
186
187
188
    computed: {
      details() {
        return this.$store.state.detailStandard_k.list
c4c4f1251   尹聃   修改镜框选购页
189
      },
f112b6434   范牧   全面屏适配
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
    },
    onLoad: function() {
      store.dispatch('detailStandard_k/fetch', {
        uid: '1',
        pid: '26',
        p_root_index: '2',
      })
      // console.log(this.$store.state.detailStandard_k.list+'ssss');
    },
    methods: {
      counter(isadd) {
  		    if (isadd) {
          this.count++
        } else {
          this.count <= 1 ? this.disabled = true : this.count--
        }
c4c4f1251   尹聃   修改镜框选购页
206
      },
f112b6434   范牧   全面屏适配
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
      xialachange(index) {
        this.isNone[index].state = !this.isNone[index].state
        if (this.isNone[index].state) {
          this.isNone[index].img = '/static/img/detail/right.png'
        } else {
          this.isNone[index].img = '/static/img/detail/xiala.png'
        }
      },
      colourChange(index, e) {
        this.navData.colour = e // 颜色选择
        console.log(index, this.navData.colour)
      },
      viewChoose(index, e) {
        this.chooseNum = index
      },
      popArgs() {
        uni.navigateTo({
          url: '../detailsChoiceArgs/detailsChoiceArgs',
          success: res => {},
          fail: () => {},
          complete: () => {},
        })
      },
      // 跳转确认订单页及传参
      popSure(name, price) {
        this.navData.name = name
        this.navData.price = price
        var navData = JSON.stringify(this.navData)
        uni.navigateTo({
          url: '../confirmOrder/confirmOrder?index=' + navData,
        })
        console.log(this.navData)
      },
    },
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
241

7d9acd27a   尹聃   选购页
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
  }
  </script>
  
  <style lang="scss">
  .container{
      min-height: 100vh;
      background: #F2F2F2;
      padding-top: 10px;
      box-sizing: border-box;
  }
  hr{
      border: none;
      height: 1px;
      background: #F2F2F2;
      margin-top: 18px;
  }
  .detail{
      height: 272rpx;
      background: #FFFFFF;
      border-radius: 8px;
      padding: 16px;
      box-sizing: border-box;
      display: flex;
      justify-content: space-between;
      align-items: center;
  }
  .detail1{
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
269
      height: 178rpx;
7d9acd27a   尹聃   选购页
270
271
272
273
274
275
276
277
278
279
      width: 188rpx;
      image{
          width: 100%;
          height: 100%;
          border-radius: 8px;
      }
  }
  .detail2{
      width: 68%;
      view{
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
280
          margin-bottom: 6px;
7d9acd27a   尹聃   选购页
281
282
283
284
285
286
287
          font-family: PingFangSC-Regular;
      }
      .detail2_name{
          font-size: 14px;
          color: #333333;
          letter-spacing: -0.26px;
          line-height: 18px;
f112b6434   范牧   全面屏适配
288
          overflow:hidden;
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
289
          text-overflow:ellipsis;
f112b6434   范牧   全面屏适配
290
          display:-webkit-box;
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
291
          -webkit-box-orient:vertical;
f112b6434   范牧   全面屏适配
292
          -webkit-line-clamp:2;
7d9acd27a   尹聃   选购页
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
      }
      .detail2_tui{
          font-size: 10px;
          color: #999999;
          letter-spacing: -0.19px;
          span{
              margin-right: 10px;
          }
      }
      .detail2_price{
          font-size: 14px;
          color: #FF6B4A;
          letter-spacing: -0.26px;
      }
  }
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
  .counter{
  	display: flex;
  	flex-direction: row;
  	justify-content: space-between;
  	font-size: 28rpx;
  	color: #333333;
  	width: 122rpx;
      float: right;
  	.btn{
  		display: flex;
  		justify-content: center;
  		line-height: 32rpx;
          height: 32rpx;
  		width: 32rpx;
  		background-color: #F2F2F2;
  		color: #CFCFCF;
  		}
  }
7d9acd27a   尹聃   选购页
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
  .choose{
      background: #FFFFFF;
      padding: 16px;
      box-sizing: border-box;
      margin-top: 10px;
      border-radius: 8px;
      .colour1{
          span{
              font-family: PingFangSC-Medium;
              font-size: 16px;
              color: #333333;
              letter-spacing: -0.3px;
              text-align: justify;
              line-height: 24px;
              font-weight: bold;
          }
          image{
              float: right;
              width: 40rpx;
              height: 36rpx;
          }
      }
      .colour_exp{
          font-family: PingFangSC-Regular;
          font-size: 12px;
          color: #666666;
          letter-spacing: 0;
          margin-top: 10px;
          margin-bottom: 10px;
      }
      .colour2{
          display: grid;
          grid-template-columns: repeat(5, 17%);
          justify-content: space-between ;
          grid-row-gap: 10px;
          margin-bottom: 14px;
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
362
          .colour2_view{
7d9acd27a   尹聃   选购页
363
364
              border: 1px solid #F2F2F2;
              image{
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
365
366
                  width: 100rpx;
                  height: 60rpx;
7d9acd27a   尹聃   选购页
367
368
              }
          }
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
369
          .colour2_viewed{
7d9acd27a   尹聃   选购页
370
              border: 1px solid #FF6B4A;
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
371
372
373
374
              image{
                  width: 100rpx;
                  height: 60rpx;
              }
7d9acd27a   尹聃   选购页
375
376
          }
      }
0c6c0f3c4   尹聃   选购页折叠
377
378
379
      .colour2_none{
          display: none;
      }
7d9acd27a   尹聃   选购页
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
  }
  .size,.part{
      margin-top:14px;
      .size1{
          display: flex;
          justify-content: space-between;
          margin-bottom: 10px;
          .size1_1{
              font-weight: bold;
              font-family: PingFangSC-Medium;
              font-size: 16px;
              color: #333333;
              letter-spacing: -0.3px;
              line-height: 24px;
          }
          view{
              span{
                  font-family: PingFangSC-Regular;
                  font-size: 14px;
                  color: #FF6B4A;
                  letter-spacing: -0.26px;
                  margin-right: 12px;
              }
              image{
                  width: 40rpx;
                  height: 36rpx;
              }
          }
      }
      .size2{
          view{
              display: inline-flex;
              align-items: center;
              justify-content: center; //字体居中
              margin-right: 12px;
              margin-bottom: 20px;
              width: 136rpx;
              height: 60rpx;
              background: #F2F2F2;
              border-radius: 2px;
              font-family: PingFangSC-Regular;
              font-size: 12px;
              color: #666666;
          }
          view:hover{
              color: #FF6B4A;
              background: rgba(255,107,74,0.15);
          }
      }
      .D3_list{
          margin-bottom: 4px;
      }
      .D3_list>view{
          display: flex;
          align-content: center;
          margin-bottom: 10px;
          view{
              margin-right: 10px;
          }
      }
      .D3_list image{
          width: 50px;
          height: 25px;
          margin-right: 6px;
      }
      .D3_list span{
          margin-left: 6px;
          margin-right: 5px;
          font-family: 'PingFangSC-Regular';
      }
      .D3_list_jDu{
          view{
              font-family: PingFangSC-Regular;
              font-size: 10px;
              color: #999999;
              letter-spacing: -0.19px;
          }
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
457
458
459
          .D3_list1{
              display: flex;
          }
7d9acd27a   尹聃   选购页
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
      }
  }
  .part{
      .part_som{
          display: grid;
          justify-content: space-between;
          grid-template-columns: repeat(4, 22%);
          grid-row-gap: 12px;
          margin-bottom: 14px;
          view{
              border: 1px solid #F2F2F2;
              height: 72rpx;
              image{
                  width: 100%;
                  height: 100%;
              }
          }
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
477
          .size_viewed{
7d9acd27a   尹聃   选购页
478
              border: 1px solid #FF6B4A;
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
479
480
481
482
483
              height: 72rpx;
              image{
                  width: 100%;
                  height: 100%;
              }
7d9acd27a   尹聃   选购页
484
485
          }
      }
0c6c0f3c4   尹聃   选购页折叠
486
487
488
      .colour2_none{
          display: none;
      }
7d9acd27a   尹聃   选购页
489
  }
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
490

7d9acd27a   尹聃   选购页
491
  .buy{
8fdae7108   尹聃   完成镜框和太阳镜的选购页功能
492
      height: 300rpx;
7d9acd27a   尹聃   选购页
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
      background: #FFFFFF ;
      margin-top: 10px;
      border-radius: 8px;
      padding-top: 20px;
      box-sizing: border-box;
      margin-bottom: 20px;
  }
  .buy1{
      font-family: PingFangSC-Medium;
      font-size: 16px;
      font-weight: bold;
      color: #333333;
      text-align: center;
  }
  .buy2{
      font-family: PingFangSC-Regular;
      font-size: 12px;
      color: #999999;
      text-align: center;
      margin: 10px;
  }
  .buy3{
      font-family: PingFangSC-Regular;
      font-size: 16px;
      display: flex;
      justify-content: center;
      margin-top: 14px;
      view{
          border-radius: 20px;
          width: 240rpx;
          height: 80rpx;
          display: flex;
          justify-content: center;
          align-items: center;
      }
      .buy3_1{
          margin-right: 20px;
          background: rgba(255,107,74,0.15);
          color: #FF6B4A ;
      }
      .buy3_2{
          background: #FF6B4A;
          color: #FFFFFF ;
      }
  }
  .zhanwei{
      background: #F2F2F2;
      height: 120rpx;
  }
  .button{
      position: fixed;
      bottom: 0;
      width:100%;
      height: 112rpx;
      background: #FF6B4A 100%;
f112b6434   范牧   全面屏适配
548
549
550
551
552
    /* iphonex 等安全区设置,底部安全区适配 */
    /* #ifndef APP-NVUE */
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
    /* #endif */
7d9acd27a   尹聃   选购页
553
554
555
556
557
558
559
560
561
562
      view{
          color: #FFFFFF;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;
          font-family: PingFangSC-Regular;
          font-size: 16px;
      }
  }
f112b6434   范牧   全面屏适配
563
  </style>