Blame view
src/pages/purchaseLenses/purchaseLenses.vue
9.95 KB
9ff2df1bf 文件名称规范 |
1 2 |
<template> <view class="content"> |
71166190e add purchase |
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
<view class="goodInfo"> <view class="imageWrap"> <image src="../../static/img/detail/d1.png" mode="aspectFill" style="width: 188rpx;height: 168rpx;"></image> </view> <view class="infoRight"> <text class="goodName">商品名称商品名称商品名称名称名称商品名称名商品名称名</text> <text class="remarks">支持7天无理由退货 顺丰发货</text> <view class="priceBox"> <view class="price">¥198</view> <text>(限购{{maxCount}}副)</text> <view class="counter"> <view class="btn" disabled="this.addDisabled" type="default" @click="counter(false)">-</view> <text>{{count}}</text> <view class="btn" disabled="this.desDisabled" type="default" @click="counter(true)">+</view> </view> </view> </view> </view> <view class="choose"> <view class="chooseItem_1 chooseItem"> <UniCollapse @change="change(1)" > <UniCollapseItem open=true title="款式挑选" showAnimation=false> <view class="chooseRes" v-show="!showChooseRes1">* {{chooseRes1}}</view> <view class="chooseItem_1_content"> <view class="itemsWrap"> <view class="item1" v-for="(item,index) in chooseItem1" :key="index" :style="item.style" :class="{ active1: current1 === index }" @click="onClickItem1(index)" ></view> </view> </view> </UniCollapseItem> </UniCollapse> <view class="chooseRes" v-show="showChooseRes1">* {{chooseRes1}}</view> </view> <view class="chooseItem_2 chooseItem "> <UniCollapse @change="change(2)" > <UniCollapseItem open=true title="直径" showAnimation=false> <!-- <view class="chooseRes" v-show="!showChooseRes2">* {{chooseRes2}}</view> --> <view class="chooseItem_1_content"> <view class="itemsWrap"> <view class="item2" v-for="(item,index) in chooseItem2" :key="index" :class="{ active2: current2 === index }" @click="onClickItem2(index)" >{{item.num}}</view> </view> </view> </UniCollapseItem> </UniCollapse> <view class="chooseRes" v-show="showChooseRes2">* {{chooseRes2}}</view> </view> <view class="chooseItem_3 chooseItem"> <UniCollapse @change="change(3)" > <UniCollapseItem open=true title="度数" showAnimation=false> <!-- <view class="chooseRes" v-show="!showChooseRes3">* {{chooseRes3}}</view> --> <view class="chooseItem_1_content"> <view class="itemsWrap"> <view class="item2" v-for="(item,index) in chooseItem3" :key="index" :class="{ active2: current3 === index }" @click="onClickItem3(index)" >{{item}}</view> </view> </view> </UniCollapseItem> </UniCollapse> <view class="chooseRes" v-show="showChooseRes3">* {{chooseRes3}}</view> </view> </view> <view class="button" @click="toComfirmOrder"> 立即结算 |
9ff2df1bf 文件名称规范 |
80 81 82 83 |
</view> </view> </template> |
71166190e add purchase |
84 |
<script> |
9ff2df1bf 文件名称规范 |
85 86 |
import UniCollapse from '@/components/UniCollapse/UniCollapse.vue' import UniCollapseItem from '@/components/UniCollapseItem/UniCollapseItem.vue' |
71166190e add purchase |
87 |
export default { |
9ff2df1bf 文件名称规范 |
88 89 |
components: {UniCollapse,UniCollapseItem}, data() { |
71166190e add purchase |
90 91 92 93 94 95 96 |
return { count:1, maxCount:20, addDisabled:false, desDisabled:false, current1:0, current2:0, |
9ff2df1bf 文件名称规范 |
97 98 99 |
current3:0, showChooseRes1:false, showChooseRes2:false, |
71166190e add purchase |
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
showChooseRes3:false, chooseRes1:'Miss 黑二代【减龄自然】', chooseRes2:'14.0', chooseRes3:0, chooseItem1:[ {style:"opacity: 0.7;background-image: radial-gradient(50% 148%, #ECEAEA 50%, #8D8C8C 100%);",describ:"Miss 黑1代【减龄自然】"}, {style:"background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);",describ:"Miss 黑二代【防紫外线】"}, {style:"background-image: radial-gradient(50% 148%, #FDF8F6 50%, #94380B 100%);",describ:"Miss 黑3代【防紫外线】"}, {style:"background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);",describ:"Miss 黑4代【防紫外线】"}, {style:"background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);",describ:"Miss 黑5代【防紫外线】"}, {style:"opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);",describ:"Miss 黑6代【防紫外线】"}, {style:"background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);",describ:"Miss 黑7代【防紫外线】"}, {style:"background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);",describ:"Miss 黑4代【防紫外线】"}, {style:"background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);",describ:"Miss 黑5代【防紫外线】"}, {style:"opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);",describ:"Miss 黑6代【防紫外线】"}, {style:"background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);",describ:"Miss 黑7代【防紫外线】"}, {style:"background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);",describ:"Miss 黑4代【防紫外线】"}, {style:"background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);",describ:"Miss 黑5代【防紫外线】"}, {style:"opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);",describ:"Miss 黑6代【防紫外线】"}, {style:"background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);",describ:"Miss 黑7代【防紫外线】"}, ], chooseItem2:[ {num:"14.0"}, {num:"14.2"}, {num:"14.4"}, {num:"14.5"}, ], |
9ff2df1bf 文件名称规范 |
127 128 |
chooseItem3:[0,100,125,150,175,200,225,250,275,300,325,350,375,400,425,450,470,500,525,550,575,600,1000] }; |
71166190e add purchase |
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
}, methods:{ change(num){ switch (num){ case 1: if(this.showChooseRes1===true){ this.showChooseRes1 = false }else{ this.showChooseRes1 = true } break; case 2: if(this.showChooseRes2===true){ this.showChooseRes2 = false }else{ this.showChooseRes2 = true } break; case 3: if(this.showChooseRes3===true){ this.showChooseRes3 = false }else{ this.showChooseRes3 = true } break; default: break; } }, onClickItem1(index) { if (this.current1 !== index) { this.current1 = index; this.chooseRes1 =this.chooseItem1[index].describ } }, onClickItem2(index) { if (this.current2 !== index) { this.current2 = index; this.chooseRes2 =this.chooseItem2[index].num } }, onClickItem3(index) { if (this.current3 !== index) { this.current3 = index; this.chooseRes3 =this.chooseItem3[index] } }, counter(isadd){ if(isadd){ this.count >= this.maxCount? this.addDisabled = true:this.count++; }else{ this.count <= 1? this.desDisabled = true:this.count--; } }, toComfirmOrder(){ uni.navigateTo({ url:'../confirmOrder/confirmOrder' }) } |
9ff2df1bf 文件名称规范 |
188 189 190 191 192 |
} } </script> <style lang="scss"> |
71166190e add purchase |
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
.content{ min-height: 100vh; background-color: #F2F2F2; // padding-top: 20rpx; .goodInfo{ width: 100%; height: 272rpx; border-radius: 16rpx; background-color: #FFFFFF; box-sizing: border-box; padding: 36rpx; display: flex; flex-direction: row; justify-content: flex-start; .imageWrap{ height: 188rpx; width: 188rpx; margin-right: 28rpx; image{ height: 188rpx; width: 188rpx; } } .infoRight{ display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; .goodName{ font-size: 28rpx; color: #333333; } .remarks{ font-size: 20rpx; color: #999999; } .priceBox{ display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: 14px; color: #999999; .price{ color: #FF6B4A; font-size: 28rpx; } .counter{ display: flex; flex-direction: row; justify-content: space-between; align-items: center; font-size: 28rpx; color: #333333; width: 122rpx; .btn{ display: flex; justify-content: center; line-height: 32rpx; height: 32rpx; width: 32rpx; background-color: #F2F2F2; color: #CFCFCF; } } } } } .choose{ width: 100%; background: #FFFFFF; border-radius: 12rpx; margin-top: 20rpx; padding: 40rpx 40rpx 112rpx 40rpx; box-sizing: border-box; .chooseItem{ width: 100%; padding-bottom: 32rpx; border-bottom: 1px solid #E9E9E9; margin-bottom: 28rpx; } .chooseRes{ font-size: 12px; color: #666666; } .itemsWrap{ display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: center; padding-top: 24rpx; .item1{ width: 64rpx; height: 64rpx; border-radius: 32rpx; margin: 0 36rpx 24rpx 0; transition: all 0.3s; border: 1px solid #FFFFFF; } .item2{ width: 100rpx; height: 60rpx; margin: 0 20rpx 20rpx 0; transition: all 0.3s; background: #F2F2F2; border-radius: 2px; border-radius: 2px; line-height: 60rpx; text-align: center; color: #666666; font-size: 12px; } .active1{ opacity: 0.7; border: 1px solid #FF6B4A; } .active2{ background: rgba(255,107,74,0.15); color: #FF6B4A; } } } .button{ width: 100%; height: 112rpx; background-color: #FF6B4A; font-size: 16px; color: #FFFFFF; line-height: 112rpx; text-align: center; position: fixed; bottom: 0; left: 0; } } |
9ff2df1bf 文件名称规范 |
329 330 |
</style> |