Commit 5f77f7e7e63baefc7f4850295573371f8ed7b744
Exists in
master
解决冲突
Showing
5 changed files
Show diff stats
src/components/CommodityCard/CommodityCard.vue
1 | <template> | 1 | <template> |
2 | <view | 2 | <view |
3 | class="card" | 3 | class="card" |
4 | @tap="toGoods(goods.id?goods.id:goods.sk_id)" | 4 | @tap="toGoods(goods.id?goods.id:goods.pid)" |
5 | > | 5 | > |
6 | <image | 6 | <image |
7 | mode="widthFix" | 7 | mode="widthFix" |
8 | :src="goods.imgurl?goods.imgurl:goods.pic" | 8 | :src="goods.imgurl?goods.imgurl:goods.pic" |
9 | ></image> | 9 | ></image> |
10 | <view class="name">{{goods.name?goods.name:goods.p_name}}</view> | 10 | <view class="name">{{goods.name?goods.name:goods.p_name}}</view> |
11 | <view class="info"> | 11 | <view class="info"> |
12 | <view class="priceBox"> | 12 | <view class="priceBox"> |
13 | <view class="price">{{goods.oldPrice !== undefined?goods.oldPrice:goods.old_price}}</view> | 13 | <view class="price">{{goods.oldPrice !== undefined?goods.oldPrice:goods.old_price}}</view> |
14 | <view class="originCost"> | 14 | <view class="originCost"> |
15 | {{goods.price !== undefined?goods.price:goods.real_price}} | 15 | {{goods.price !== undefined?goods.price:goods.real_price}} |
16 | </view> | 16 | </view> |
17 | </view> | 17 | </view> |
18 | <view class="trade_num">{{goods.trade_num}}人购买</view> | 18 | <view class="trade_num">{{goods.trade_num}}人购买</view> |
19 | </view> | 19 | </view> |
20 | </view> | 20 | </view> |
21 | </template> | 21 | </template> |
22 | 22 | ||
23 | <script> | 23 | <script> |
24 | export default { | 24 | export default { |
25 | props: { | 25 | props: { |
26 | /** | 26 | /** |
27 | * 商品数据 | 27 | * 商品数据 |
28 | */ | 28 | */ |
29 | goods: { | 29 | goods: { |
30 | id: Number, | 30 | id: Number, |
31 | imgurl: String, | 31 | imgurl: String, |
32 | name: String, | 32 | name: String, |
33 | rsSon: Object, | 33 | rsSon: Object, |
34 | originCost: String, | 34 | originCost: String, |
35 | price: String, | 35 | price: String, |
36 | trade_num: String, | 36 | trade_num: String, |
37 | goodType: String | 37 | goodType: String |
38 | } | 38 | } |
39 | 39 | ||
40 | }, | 40 | }, |
41 | created () { | 41 | created () { |
42 | }, | 42 | }, |
43 | data () { | 43 | data () { |
44 | return { | 44 | return { |
45 | 45 | ||
46 | } | 46 | } |
47 | }, | 47 | }, |
48 | methods: { | 48 | methods: { |
49 | toGoods (id) { | 49 | toGoods (id) { |
50 | console.log('---', '../frameDetail/frameDetail?pid=' + id) | 50 | console.log('---', '../frameDetail/frameDetail?pid=' + id) |
51 | uni.navigateTo({ | 51 | uni.navigateTo({ |
52 | url: '../frameDetail/frameDetail?pid=' + id, | 52 | url: '../frameDetail/frameDetail?pid=' + id, |
53 | success: res => {}, | 53 | success: res => {}, |
54 | fail: () => {}, | 54 | fail: () => {}, |
55 | complete: () => {} | 55 | complete: () => {} |
56 | }) | 56 | }) |
57 | } | 57 | } |
58 | } | 58 | } |
59 | } | 59 | } |
60 | </script> | 60 | </script> |
61 | 61 | ||
62 | <style lang="scss"> | 62 | <style lang="scss"> |
63 | image { | 63 | image { |
64 | width: 100%; | 64 | width: 100%; |
65 | height: 120rpx; | 65 | height: 120rpx; |
66 | } | 66 | } |
67 | .name { | 67 | .name { |
68 | width: 92%; | 68 | width: 92%; |
69 | height: 54rpx; | 69 | height: 54rpx; |
70 | padding: 5px 4%; | 70 | padding: 5px 4%; |
71 | display: -webkit-box; | 71 | display: -webkit-box; |
72 | -webkit-box-orient: vertical; | 72 | -webkit-box-orient: vertical; |
73 | -webkit-line-clamp: 2; | 73 | -webkit-line-clamp: 2; |
74 | text-align: justify; | 74 | text-align: justify; |
75 | overflow: hidden; | 75 | overflow: hidden; |
76 | font-size: 24rpx; | 76 | font-size: 24rpx; |
77 | color: #333333; | 77 | color: #333333; |
78 | } | 78 | } |
79 | .info { | 79 | .info { |
80 | display: flex; | 80 | display: flex; |
81 | justify-content: space-between; | 81 | justify-content: space-between; |
82 | align-items: center; | 82 | align-items: center; |
83 | width: 92%; | 83 | width: 92%; |
84 | padding: 5px 4% 5px 4%; | 84 | padding: 5px 4% 5px 4%; |
85 | .priceBox { | 85 | .priceBox { |
86 | display: flex; | 86 | display: flex; |
87 | justify-content: space-between; | 87 | justify-content: space-between; |
88 | align-items: center; | 88 | align-items: center; |
89 | .price { | 89 | .price { |
90 | color: #eb5d3b; | 90 | color: #eb5d3b; |
91 | font-size: 28rpx; | 91 | font-size: 28rpx; |
92 | font-weight: 600; | 92 | font-weight: 600; |
93 | margin-right: 10rpx; | 93 | margin-right: 10rpx; |
94 | } | 94 | } |
95 | .originCost { | 95 | .originCost { |
96 | text-decoration: line-through; | 96 | text-decoration: line-through; |
97 | color: #999999; | 97 | color: #999999; |
98 | font-size: 20rpx; | 98 | font-size: 20rpx; |
99 | } | 99 | } |
100 | } | 100 | } |
101 | .trade_num { | 101 | .trade_num { |
102 | color: #999999; | 102 | color: #999999; |
103 | font-size: 20rpx; | 103 | font-size: 20rpx; |
104 | } | 104 | } |
105 | } | 105 | } |
106 | </style> | 106 | </style> |
107 | 107 |
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="item.cart_id" | 17 | <view class="cardBody" v-for="(item,index) in cartList" :key="item.cart_id" |
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.p_root_index)">{{item.p_name}}</view> | 31 | <view class="goodName" @tap="toGoods(item.pid)">{{item.p_name}}</view> |
32 | <!-- <view class="describ"> --> | 32 | <!-- <view class="describ"> --> |
33 | <uni-collapse accordion="true" > | 33 | <uni-collapse accordion="true" > |
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[2].label+'...'" > | 35 | :title="item.tag.prod_tag_fun[0].label+'/'+item.tag.prod_tag_fun[1].label+'/'+item.tag.prod_tag_fun[2].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.mp_id,item.sk_id,item.num,item.cart_id)">-</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.mp_id,item.sk_id,item.num,item.cart_id)">+</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, type) { | 127 | toGoods(id) { |
128 | uni.navigateTo({ | 128 | console.log('---', '../frameDetail/frameDetail?pid=' + id) |
129 | url: '../frameDetail/frameDetail?oderId=' + id, | 129 | uni.navigateTo({ |
130 | success: res => {}, | 130 | url: '../frameDetail/frameDetail?pid=' + id, |
131 | fail: () => {}, | 131 | success: res => {}, |
132 | complete: () => {} | 132 | fail: () => {}, |
133 | }) | 133 | complete: () => {} |
134 | console.log('toGoods =====> id:' + id + '======>type:' + type) | 134 | }) |
135 | switch (type) { | 135 | // uni.navigateTo({ |
136 | case 1: | 136 | // url: '../frameDetail/frameDetail?oderId=' + id, |
137 | uni.navigateTo({ | 137 | // success: res => {}, |
138 | url: '../frameDetail/frameDetail?oderId=' + id + '&goodType=' + type, | 138 | // fail: () => {}, |
139 | success: res => {}, | 139 | // complete: () => {} |
140 | fail: () => {}, | 140 | // }) |
141 | complete: () => {} | 141 | // console.log('toGoods =====> id:' + id + '======>type:' + type) |
142 | }) | 142 | // switch (type) { |
143 | break | 143 | // case 1: |
144 | case 2: | 144 | // uni.navigateTo({ |
145 | uni.navigateTo({ | 145 | // url: '../frameDetail/frameDetail?oderId=' + id + '&goodType=' + type, |
146 | url: '../frameDetail/frameDetail?oderId=' + id + '&goodType=' + type, | 146 | // success: res => {}, |
147 | success: res => {}, | 147 | // fail: () => {}, |
148 | fail: () => {}, | 148 | // complete: () => {} |
149 | complete: () => {} | 149 | // }) |
150 | }) | 150 | // break |
151 | break | 151 | // case 2: |
152 | case 3: | 152 | // uni.navigateTo({ |
153 | uni.navigateTo({ | 153 | // url: '../frameDetail/frameDetail?oderId=' + id + '&goodType=' + type, |
154 | url: '../frameDetail/frameDetail?oderId=' + id + '&goodType=' + type, | 154 | // success: res => {}, |
155 | success: res => {}, | 155 | // fail: () => {}, |
156 | fail: () => {}, | 156 | // complete: () => {} |
157 | complete: () => {} | 157 | // }) |
158 | }) | 158 | // break |
159 | break | 159 | // case 3: |
160 | case 4: | 160 | // uni.navigateTo({ |
161 | uni.navigateTo({ | 161 | // url: '../frameDetail/frameDetail?oderId=' + id + '&goodType=' + type, |
162 | url: '../frameDetail/frameDetail?oderId=' + id + '&goodType=' + type, | 162 | // success: res => {}, |
163 | success: res => {}, | 163 | // fail: () => {}, |
164 | fail: () => {}, | 164 | // complete: () => {} |
165 | complete: () => {} | 165 | // }) |
166 | }) | 166 | // break |
167 | break | 167 | // case 4: |
168 | default : | 168 | // uni.navigateTo({ |
169 | break | 169 | // url: '../frameDetail/frameDetail?oderId=' + id + '&goodType=' + type, |
170 | } | 170 | // success: res => {}, |
171 | // fail: () => {}, | ||
172 | // complete: () => {} | ||
173 | // }) | ||
174 | // break | ||
175 | // default : | ||
176 | // break | ||
177 | // } | ||
171 | }, | 178 | }, |
172 | 179 | ||
173 | counter(index, isadd, mp_id, sk_id, num, cart_id) { | 180 | counter(index, isadd, item) { |
174 | // console.log('===>>counter ===>num',num) | 181 | // console.log('===>>counter ===>num',num) |
175 | // console.log('===>>counter ===>isadd',isadd) | 182 | // console.log('===>>counter ===>isadd',isadd) |
176 | num = parseInt(num) | 183 | console.log('item=====>',item) |
184 | console.log('num=====>',item.num) | ||
185 | let nums = parseInt(item.num) | ||
177 | if (isadd) { | 186 | if (isadd) { |
178 | if (num >= this.maxCount) { | 187 | if (nums >= this.maxCount) { |
179 | this.addDisabled = true | 188 | this.addDisabled = true |
180 | } else { | 189 | } else { |
181 | this.addDisabled = true | 190 | this.addDisabled = true |
182 | // 修改num | 191 | // 修改num |
183 | if (this.childIsOpen[index]) { | 192 | if (this.childIsOpen[index]) { |
184 | this.totalPrice = this.totalPrice + this.$store.state.cart.cartList[index].nowPrice | 193 | this.totalPrice = this.totalPrice + this.$store.state.cart.cartList[index].nowPrice |
185 | } | 194 | } |
186 | store.dispatch('cart/modiCart', { | 195 | store.dispatch('cart/modiCart', { |
187 | uid: this.$store.state.user.userInfo.uid, | 196 | uid: this.$store.state.user.userInfo.uid, |
188 | openid: this.$store.state.user.userInfo.openid, | 197 | openid: this.$store.state.user.userInfo.openid, |
189 | mp_id: mp_id, | 198 | mp_id: item.mp_id, |
190 | sk_id: sk_id, | 199 | sk_id: item.sk_id, |
191 | cart_id: cart_id, | 200 | price: item.nowPrice, |
192 | num: num + 1, | 201 | pid: item.pid, |
202 | num: nums + 1, | ||
203 | cart_id: item.cart_id, | ||
193 | args: { | 204 | args: { |
194 | index: index, | 205 | index: index, |
195 | isadd: isadd | 206 | isadd: isadd |
196 | } | 207 | } |
197 | }) | 208 | }) |
198 | this.addDisabled = false | 209 | this.addDisabled = false |
199 | } | 210 | } |
200 | } else { | 211 | } else { |
201 | if (num <= 1) { | 212 | if (nums <= 1) { |
202 | this.desDisabled = true | 213 | this.desDisabled = true |
203 | } else { | 214 | } else { |
204 | this.desDisabled = false | 215 | this.desDisabled = false |
205 | // post 请求修改相关参数 | 216 | // post 请求修改相关参数 |
206 | if (this.childIsOpen[index]) { | 217 | if (this.childIsOpen[index]) { |
207 | this.totalPrice = this.totalPrice - this.$store.state.cart.cartList[index].nowPrice | 218 | this.totalPrice = this.totalPrice - this.$store.state.cart.cartList[index].nowPrice |
208 | } | 219 | } |
209 | store.dispatch('cart/modiCart', { | 220 | store.dispatch('cart/modiCart', { |
210 | uid: this.$store.state.user.userInfo.uid, | 221 | uid: this.$store.state.user.userInfo.uid, |
211 | openid: this.$store.state.user.userInfo.openid, | 222 | openid: this.$store.state.user.userInfo.openid, |
212 | mp_id: mp_id, | 223 | mp_id: item.mp_id, |
213 | sk_id: sk_id, | 224 | sk_id: item.sk_id, |
214 | cart_id: cart_id, | 225 | price: item.nowPrice, |
215 | num: num - 1, | 226 | pid: item.pid, |
227 | num: nums - 1, | ||
228 | cart_id: item.cart_id, | ||
216 | args: { | 229 | args: { |
217 | index: index, | 230 | index: index, |
218 | isadd: isadd | 231 | isadd: isadd |
219 | } | 232 | } |
220 | }) | 233 | }) |
221 | this.desDisabled = true | 234 | this.desDisabled = true |
222 | } | 235 | } |
223 | } | 236 | } |
224 | // store.dispatch('cart/getCartList', { | 237 | // store.dispatch('cart/getCartList', { |
225 | // uid: this.$store.state.user.userInfo.uid // 用户id | 238 | // uid: this.$store.state.user.userInfo.uid // 用户id |
226 | // }) | 239 | // }) |
227 | }, | 240 | }, |
228 | 241 | ||
229 | Change(isopen, indexC) { | 242 | Change(isopen, indexC) { |
230 | // console.log('lalla===>',isopen) | 243 | // console.log('lalla===>',isopen) |
231 | this.childIsOpen[indexC] = !isopen | 244 | this.childIsOpen[indexC] = !isopen |
232 | if (!isopen) { | 245 | if (!isopen) { |
233 | this.totalPrice = this.totalPrice + (this.$store.state.cart.cartList[indexC].num * this.$store.state.cart.cartList[indexC].nowPrice) | 246 | this.totalPrice = this.totalPrice + (this.$store.state.cart.cartList[indexC].num * this.$store.state.cart.cartList[indexC].nowPrice) |
234 | } else { | 247 | } else { |
235 | this.totalPrice = this.totalPrice - (this.$store.state.cart.cartList[indexC].num * this.$store.state.cart.cartList[indexC].nowPrice) | 248 | this.totalPrice = this.totalPrice - (this.$store.state.cart.cartList[indexC].num * this.$store.state.cart.cartList[indexC].nowPrice) |
236 | } | 249 | } |
237 | let m = true | 250 | let m = true |
238 | for (let i = 0; i < this.childIsOpen.length; i++) { | 251 | for (let i = 0; i < this.childIsOpen.length; i++) { |
239 | m = m & this.childIsOpen[i] | 252 | m = m & this.childIsOpen[i] |
240 | } | 253 | } |
241 | if (m == 1) { | 254 | if (m == 1) { |
242 | this.pIsoPen = true | 255 | this.pIsoPen = true |
243 | } else { | 256 | } else { |
244 | this.pIsoPen = false | 257 | this.pIsoPen = false |
245 | } | 258 | } |
246 | }, | 259 | }, |
247 | pChange(isopen) { | 260 | pChange(isopen) { |
248 | this.pIsoPen = !isopen | 261 | this.pIsoPen = !isopen |
249 | for (let i = 0; i < this.childIsOpen.length; i++) { | 262 | for (let i = 0; i < this.childIsOpen.length; i++) { |
250 | this.childIsOpen[i] = !isopen | 263 | this.childIsOpen[i] = !isopen |
251 | } | 264 | } |
252 | if (this.pIsoPen) { | 265 | if (this.pIsoPen) { |
253 | // 计算总价逻辑 | 266 | // 计算总价逻辑 |
254 | if (this.childIsOpen.length != 0) { | 267 | if (this.childIsOpen.length != 0) { |
255 | for (let i = 0; i < this.childIsOpen.length; i++) { | 268 | for (let i = 0; i < this.childIsOpen.length; i++) { |
256 | if (this.childIsOpen[i]) { | 269 | if (this.childIsOpen[i]) { |
257 | this.totalPrice = this.totalPrice + (this.$store.state.cart.cartList[i].num * this.$store.state.cart.cartList[i].nowPrice) | 270 | this.totalPrice = this.totalPrice + (this.$store.state.cart.cartList[i].num * this.$store.state.cart.cartList[i].nowPrice) |
258 | } | 271 | } |
259 | } | 272 | } |
260 | } | 273 | } |
261 | } else { | 274 | } else { |
262 | this.totalPrice = 0 | 275 | this.totalPrice = 0 |
263 | } | 276 | } |
264 | }, | 277 | }, |
265 | delCart(cart_id, index) { | 278 | delCart(cart_id, index) { |
266 | // console.log('userInfo',this.$store.state.user.userInfo) | 279 | // console.log('userInfo',this.$store.state.user.userInfo) |
267 | cart_id = parseInt(cart_id) | 280 | cart_id = parseInt(cart_id) |
268 | // console.log('delcart------>cart_id',cart_id) | 281 | // console.log('delcart------>cart_id',cart_id) |
269 | // console.log('cartlist====>delcart',this.$store.state.cart.cartList) | 282 | // console.log('cartlist====>delcart',this.$store.state.cart.cartList) |
270 | // console.log('delcart======>index',index) | 283 | // console.log('delcart======>index',index) |
284 | const uid=this.$store.state.user.userInfo.uid | ||
285 | const openid=this.$store.state.user.userInfo.openid | ||
271 | uni.showModal({ | 286 | uni.showModal({ |
272 | title: '是否删除该商品', | 287 | title: '是否删除该商品', |
273 | // content: '是否删除该商品', | 288 | // content: '是否删除该商品', |
274 | success: function (res) { | 289 | success: function (res) { |
275 | if (res.confirm) { | 290 | if (res.confirm) { |
276 | // this.$store.state.cart.cartList.splice(index,1) | 291 | // this.$store.state.cart.cartList.splice(index,1) |
277 | store.dispatch('cart/delCart', { | 292 | store.dispatch('cart/delCart', { |
278 | uid: this.$store.state.user.userInfo.uid, | 293 | uid: uid, |
279 | openid: this.$store.state.user.userInfo.openid, | 294 | openid: openid, |
280 | cart_id: cart_id, // 要修改的购物车id | 295 | cart_id: cart_id, // 要修改的购物车id |
281 | arg: index // 由于action 传参是能接收两参数,因此将index放入对象 | 296 | arg: index // 由于action 传参是能接收两参数,因此将index放入对象 |
282 | }) | 297 | }) |
283 | console.log('用户点击确定') | 298 | console.log('用户点击确定') |
284 | } | 299 | } |
285 | } | 300 | } |
286 | }) | 301 | }) |
287 | } | 302 | } |
288 | } | 303 | } |
289 | } | 304 | } |
290 | </script> | 305 | </script> |
291 | 306 | ||
292 | <style lang="scss"> | 307 | <style lang="scss"> |
293 | .content { | 308 | .content { |
294 | min-height: 100vh; | 309 | min-height: 100vh; |
295 | background-color: #f2f2f2; | 310 | background-color: #f2f2f2; |
296 | display: flex; | 311 | display: flex; |
297 | flex-direction: column; | 312 | flex-direction: column; |
298 | align-items: center; | 313 | align-items: center; |
299 | justify-content: space-between; | 314 | justify-content: space-between; |
300 | padding: 20rpx 40rpx; | 315 | padding: 20rpx 40rpx; |
301 | box-sizing: border-box; | 316 | box-sizing: border-box; |
302 | 317 | ||
303 | .partentCheck{ | 318 | .partentCheck{ |
304 | width: 16px; | 319 | width: 16px; |
305 | height: 16px; | 320 | height: 16px; |
306 | border-radius: 22px; | 321 | border-radius: 22px; |
307 | border: 1px solid #CFCFCF; | 322 | border: 1px solid #CFCFCF; |
308 | background-color: #FFFFFF; | 323 | background-color: #FFFFFF; |
309 | margin: 6px; | 324 | margin: 6px; |
310 | } | 325 | } |
311 | .partentChecked{ | 326 | .partentChecked{ |
312 | width: 18px; | 327 | width: 18px; |
313 | height: 18px; | 328 | height: 18px; |
314 | border-radius: 22px; | 329 | border-radius: 22px; |
315 | background-color: #FF6B4A; | 330 | background-color: #FF6B4A; |
316 | margin: 6px; | 331 | margin: 6px; |
317 | .correct { | 332 | .correct { |
318 | display: inline-block; | 333 | display: inline-block; |
319 | position: relative; | 334 | position: relative; |
320 | width: 10rpx; | 335 | width: 10rpx; |
321 | height: 2rpx; | 336 | height: 2rpx; |
322 | background: #FFFFFF; | 337 | background: #FFFFFF; |
323 | line-height: 0; | 338 | line-height: 0; |
324 | font-size: 0; | 339 | font-size: 0; |
325 | position: relative; | 340 | position: relative; |
326 | top: -7px; | 341 | top: -7px; |
327 | left: 4px; | 342 | left: 4px; |
328 | -webkit-transform: rotate(45deg); | 343 | -webkit-transform: rotate(45deg); |
329 | } | 344 | } |
330 | .correct:after { | 345 | .correct:after { |
331 | content: '/'; | 346 | content: '/'; |
332 | display: block; | 347 | display: block; |
333 | width: 16rpx; | 348 | width: 16rpx; |
334 | height: 2rpx; | 349 | height: 2rpx; |
335 | background: #FFFFFF; | 350 | background: #FFFFFF; |
336 | -webkit-transform: rotate(-90deg) translateY(50%) translateX(50%); | 351 | -webkit-transform: rotate(-90deg) translateY(50%) translateX(50%); |
337 | } | 352 | } |
338 | } | 353 | } |
339 | 354 | ||
340 | .card{ | 355 | .card{ |
341 | background-color: #FFFFFF; | 356 | background-color: #FFFFFF; |
342 | border-radius: 16rpx; | 357 | border-radius: 16rpx; |
343 | box-sizing: border-box; | 358 | box-sizing: border-box; |
344 | padding: 36rpx 36rpx 36rpx 18rpx; | 359 | padding: 36rpx 36rpx 36rpx 18rpx; |
345 | display: flex; | 360 | display: flex; |
346 | flex-direction: column; | 361 | flex-direction: column; |
347 | align-items: center; | 362 | align-items: center; |
348 | justify-content: space-between; | 363 | justify-content: space-between; |
349 | margin-bottom: 180rpx; | 364 | margin-bottom: 180rpx; |
350 | .cardHeader{ | 365 | .cardHeader{ |
351 | width: 100%; | 366 | width: 100%; |
352 | height: 36rpx; | 367 | height: 36rpx; |
353 | display: flex; | 368 | display: flex; |
354 | align-items: center; | 369 | align-items: center; |
355 | justify-content: flex-start; | 370 | justify-content: flex-start; |
356 | margin-bottom: 20rpx; | 371 | margin-bottom: 20rpx; |
357 | image{ | 372 | image{ |
358 | height: 32rpx; | 373 | height: 32rpx; |
359 | width: 32rpx; | 374 | width: 32rpx; |
360 | padding-left: 6px; | 375 | padding-left: 6px; |
361 | padding-right: 10px; | 376 | padding-right: 10px; |
362 | } | 377 | } |
363 | text{ | 378 | text{ |
364 | // font-family: PingFangSC-Regular; | 379 | // font-family: PingFangSC-Regular; |
365 | font-size: 14px; | 380 | font-size: 14px; |
366 | color: #333333; | 381 | color: #333333; |
367 | letter-spacing: -0.26px; | 382 | letter-spacing: -0.26px; |
368 | } | 383 | } |
369 | } | 384 | } |
370 | .cardBody{ | 385 | .cardBody{ |
371 | width: 100%; | 386 | width: 100%; |
372 | min-height: 300rpx; | 387 | min-height: 300rpx; |
373 | display: flex; | 388 | display: flex; |
374 | align-items: center; | 389 | align-items: center; |
375 | justify-content: space-between; | 390 | justify-content: space-between; |
376 | .goodInfo{ | 391 | .goodInfo{ |
377 | width: 390rpx; | 392 | width: 390rpx; |
378 | display: flex; | 393 | display: flex; |
379 | flex-direction: row; | 394 | flex-direction: row; |
380 | justify-content: flex-start; | 395 | justify-content: flex-start; |
381 | padding-left: 6px; | 396 | padding-left: 6px; |
382 | 397 | ||
383 | .imageWrap{ | 398 | .imageWrap{ |
384 | height: 188rpx; | 399 | height: 188rpx; |
385 | width: 188rpx; | 400 | width: 188rpx; |
386 | margin-right: 28rpx; | 401 | margin-right: 28rpx; |
387 | 402 | ||
388 | image{ | 403 | image{ |
389 | border-radius: 4px; | 404 | border-radius: 4px; |
390 | height: 188rpx; | 405 | height: 188rpx; |
391 | width: 188rpx; | 406 | width: 188rpx; |
392 | } | 407 | } |
393 | } | 408 | } |
394 | .infoRight{ | 409 | .infoRight{ |
395 | display: flex; | 410 | display: flex; |
396 | flex-direction: column; | 411 | flex-direction: column; |
397 | align-items: flex-start; | 412 | align-items: flex-start; |
398 | justify-content: space-between; | 413 | justify-content: space-between; |
399 | min-height: 240rpx; | 414 | min-height: 240rpx; |
400 | .goodName{ | 415 | .goodName{ |
401 | display: -webkit-box; | 416 | display: -webkit-box; |
402 | -webkit-box-orient: vertical; | 417 | -webkit-box-orient: vertical; |
403 | -webkit-line-clamp: 2; | 418 | -webkit-line-clamp: 2; |
404 | text-align: justify; | 419 | text-align: justify; |
405 | overflow: hidden; | 420 | overflow: hidden; |
406 | font-size: 28rpx; | 421 | font-size: 28rpx; |
407 | color: #333333; | 422 | color: #333333; |
408 | } | 423 | } |
409 | .describ{ | 424 | .describ{ |
410 | width: 100%; | 425 | width: 100%; |
411 | // min-height: 80rpx; | 426 | // min-height: 80rpx; |
412 | // box-sizing: border-box; | 427 | // box-sizing: border-box; |
413 | // padding: 10rpx; | 428 | // padding: 10rpx; |
414 | font-size: 20rpx; | 429 | font-size: 20rpx; |
415 | letter-spacing: -0.23px; | 430 | letter-spacing: -0.23px; |
416 | text-align: justify; | 431 | text-align: justify; |
417 | color: #999999; | 432 | color: #999999; |
418 | // background: #F9F9F9; | 433 | // background: #F9F9F9; |
419 | // display: flex; | 434 | // display: flex; |
420 | // justify-content: center; | 435 | // justify-content: center; |
421 | // align-items: center; | 436 | // align-items: center; |
422 | // text{ | 437 | // text{ |
423 | // text-overflow: -o-ellipsis-lastline; | 438 | // text-overflow: -o-ellipsis-lastline; |
424 | // overflow: hidden; | 439 | // overflow: hidden; |
425 | // text-overflow: ellipsis; | 440 | // text-overflow: ellipsis; |
426 | // display: -webkit-box; | 441 | // display: -webkit-box; |
427 | // -webkit-line-clamp: 2; | 442 | // -webkit-line-clamp: 2; |
428 | // line-clamp: 2; | 443 | // line-clamp: 2; |
429 | // -webkit-box-orient: vertical; | 444 | // -webkit-box-orient: vertical; |
430 | // } | 445 | // } |
431 | // .icon { | 446 | // .icon { |
432 | // width: 0; | 447 | // width: 0; |
433 | // height: 0; | 448 | // height: 0; |
434 | // border-left: 5px transparent; | 449 | // border-left: 5px transparent; |
435 | // border-right: 5px transparent; | 450 | // border-right: 5px transparent; |
436 | // border-top: 5px #979797; | 451 | // border-top: 5px #979797; |
437 | // border-bottom: 0 transparent; | 452 | // border-bottom: 0 transparent; |
438 | // border-style: solid; | 453 | // border-style: solid; |
439 | // position: relative; | 454 | // position: relative; |
440 | // margin-left: 10px; | 455 | // margin-left: 10px; |
441 | // // transform: scaleY(-1); | 456 | // // transform: scaleY(-1); |
442 | // } | 457 | // } |
443 | // .icon::after{ | 458 | // .icon::after{ |
444 | // content: ''; | 459 | // content: ''; |
445 | // position: absolute; | 460 | // position: absolute; |
446 | // top: -6.5px; | 461 | // top: -6.5px; |
447 | // left: -5px; | 462 | // left: -5px; |
448 | // border-left: 5px transparent; | 463 | // border-left: 5px transparent; |
449 | // border-right: 5px transparent; | 464 | // border-right: 5px transparent; |
450 | // border-top: 5px #FFFFFF; | 465 | // border-top: 5px #FFFFFF; |
451 | // border-bottom: 0 transparent; | 466 | // border-bottom: 0 transparent; |
452 | // border-style: solid; | 467 | // border-style: solid; |
453 | // } | 468 | // } |
454 | } | 469 | } |
455 | .priceBox{ | 470 | .priceBox{ |
456 | display: flex; | 471 | display: flex; |
457 | justify-content: space-between; | 472 | justify-content: space-between; |
458 | align-items: center; | 473 | align-items: center; |
459 | // margin-top: 26px; | 474 | // margin-top: 26px; |
460 | width: 100%; | 475 | width: 100%; |
461 | font-size: 14px; | 476 | font-size: 14px; |
462 | color: #999999; | 477 | color: #999999; |
463 | .maxCount{ | 478 | .maxCount{ |
464 | color: #999999; | 479 | color: #999999; |
465 | font-size: 24rpx; | 480 | font-size: 24rpx; |
466 | } | 481 | } |
467 | .price{ | 482 | .price{ |
468 | color: #FF6B4A; | 483 | color: #FF6B4A; |
469 | font-size: 28rpx; | 484 | font-size: 28rpx; |
470 | } | 485 | } |
471 | .counter{ | 486 | .counter{ |
472 | display: flex; | 487 | display: flex; |
473 | flex-direction: row; | 488 | flex-direction: row; |
474 | justify-content: space-between; | 489 | justify-content: space-between; |
475 | align-items: center; | 490 | align-items: center; |
476 | font-size: 28rpx; | 491 | font-size: 28rpx; |
477 | color: #333333; | 492 | color: #333333; |
478 | width: 122rpx; | 493 | width: 122rpx; |
479 | .btn{ | 494 | .btn{ |
480 | display: flex; | 495 | display: flex; |
481 | justify-content: center; | 496 | justify-content: center; |
482 | line-height: 32rpx; | 497 | line-height: 32rpx; |
483 | height: 32rpx; | 498 | height: 32rpx; |
484 | width: 32rpx; | 499 | width: 32rpx; |
485 | background-color: #F2F2F2; | 500 | background-color: #F2F2F2; |
486 | color: #CFCFCF; | 501 | color: #CFCFCF; |
487 | } | 502 | } |
488 | } | 503 | } |
489 | } | 504 | } |
490 | } | 505 | } |
491 | } | 506 | } |
492 | } | 507 | } |
493 | } | 508 | } |
494 | 509 | ||
495 | .footer{ | 510 | .footer{ |
496 | position: fixed; | 511 | position: fixed; |
497 | left: 0; | 512 | left: 0; |
498 | bottom: 0px; | 513 | bottom: 0px; |
499 | height: 112rpx; | 514 | height: 112rpx; |
500 | width: 100%; | 515 | width: 100%; |
501 | background-color: #FFFFFF; | 516 | background-color: #FFFFFF; |
502 | font-size: 16px; | 517 | font-size: 16px; |
503 | display: flex; | 518 | display: flex; |
504 | justify-content: space-between; | 519 | justify-content: space-between; |
505 | align-items: center; | 520 | align-items: center; |
506 | .footerLeft{ | 521 | .footerLeft{ |
507 | display: flex; | 522 | display: flex; |
508 | justify-content: center; | 523 | justify-content: center; |
509 | align-items: center; | 524 | align-items: center; |
510 | width: 50%; | 525 | width: 50%; |
511 | color: #333333; | 526 | color: #333333; |
512 | text{ | 527 | text{ |
513 | color: #FF6B4A; | 528 | color: #FF6B4A; |
514 | } | 529 | } |
515 | } | 530 | } |
516 | .footerRight{ | 531 | .footerRight{ |
517 | display: flex; | 532 | display: flex; |
518 | justify-content: flex-end; | 533 | justify-content: flex-end; |
519 | align-items: center; | 534 | align-items: center; |
520 | width: 50%; | 535 | width: 50%; |
521 | margin-right: 26rpx; | 536 | margin-right: 26rpx; |
522 | .paybtn{ | 537 | .paybtn{ |
523 | display: flex; | 538 | display: flex; |
524 | justify-content: center; | 539 | justify-content: center; |
525 | align-items: center; | 540 | align-items: center; |
526 | background: #FF6B4A; | 541 | background: #FF6B4A; |
527 | border-radius: 20px; | 542 | border-radius: 20px; |
528 | border-radius: 20px; | 543 | border-radius: 20px; |
529 | color: #FFFFFF; | 544 | color: #FFFFFF; |
530 | width: 204rpx; | 545 | width: 204rpx; |
531 | height: 80rpx; | 546 | height: 80rpx; |
532 | } | 547 | } |
533 | } | 548 | } |
534 | 549 | ||
535 | } | 550 | } |
536 | } | 551 | } |
537 | 552 | ||
538 | </style> | 553 | </style> |
539 | 554 |
src/pages/purchaseLenses/purchaseLenses.vue
1 | <template> | 1 | <template> |
2 | <view class="content"> | 2 | <view class="content"> |
3 | <view class="goodInfo"> | 3 | <view class="goodInfo"> |
4 | <view class="imageWrap"> | 4 | <view class="imageWrap"> |
5 | <image | 5 | <image |
6 | src="../../static/img/detail/d1.png" | 6 | src="../../static/img/detail/d1.png" |
7 | mode="aspectFill" | 7 | mode="aspectFill" |
8 | style="width: 188rpx;height: 168rpx;" | 8 | style="width: 188rpx;height: 168rpx;" |
9 | ></image> | 9 | ></image> |
10 | </view> | 10 | </view> |
11 | <view class="infoRight"> | 11 | <view class="infoRight"> |
12 | <text class="goodName">商品名称商品名称商品名称名称名称商品名称名商品名称名</text> | 12 | <text class="goodName">商品名称商品名称商品名称名称名称商品名称名商品名称名</text> |
13 | <text class="remarks">支持7天无理由退货 顺丰发货</text> | 13 | <text class="remarks">支持7天无理由退货 顺丰发货</text> |
14 | <view class="priceBox"> | 14 | <view class="priceBox"> |
15 | <view class="price">¥198</view> | 15 | <view class="price">¥198</view> |
16 | <text>(限购{{maxCount}}副)</text> | 16 | <text>(限购{{maxCount}}副)</text> |
17 | <view class="counter"> | 17 | <view class="counter"> |
18 | <view | 18 | <view |
19 | class="btn" | 19 | class="btn" |
20 | disabled="this.addDisabled" | 20 | disabled="this.addDisabled" |
21 | type="default" | 21 | type="default" |
22 | @click="counter(false)" | 22 | @click="counter(false)" |
23 | >-</view> | 23 | >-</view> |
24 | <text>{{count}}</text> | 24 | <text>{{count}}</text> |
25 | <view | 25 | <view |
26 | class="btn" | 26 | class="btn" |
27 | disabled="this.desDisabled" | 27 | disabled="this.desDisabled" |
28 | type="default" | 28 | type="default" |
29 | @click="counter(true)" | 29 | @click="counter(true)" |
30 | >+</view> | 30 | >+</view> |
31 | </view> | 31 | </view> |
32 | </view> | 32 | </view> |
33 | </view> | 33 | </view> |
34 | </view> | 34 | </view> |
35 | <view class="goods-data"> | 35 | <view class="goods-data"> |
36 | <view class="opCollapse"> | 36 | <view class="opCollapse"> |
37 | <view class="body"> | 37 | <view class="body"> |
38 | <template v-if="opIsOpen"> | 38 | <template v-if="opIsOpen"> |
39 | <view class="goods-form"> | 39 | <view class="goods-form"> |
40 | <view class="p1"> | 40 | <view class="p1"> |
41 | <image class="image2" src="../../static/img/myOpticsData/dataWrite.png" mode="aspectFit"></image> | 41 | <image class="image2" src="../../static/img/myOpticsData/dataWrite.png" mode="aspectFit"></image> |
42 | 填写验光数据 | 42 | 填写验光数据 |
43 | </view> | 43 | </view> |
44 | <text class="p2">没有验光数据?请到线下眼镜店验光哦~</text> | 44 | <text class="p2">没有验光数据?请到线下眼镜店验光哦~</text> |
45 | <view class="picker"> | 45 | <view class="picker"> |
46 | <view class="picker-choice"> | 46 | <view class="picker-choice"> |
47 | <view class="choice-left"> | 47 | <view class="choice-left"> |
48 | <text class="pd">验光单取名:</text> | 48 | <text class="pd">验光单取名:</text> |
49 | </view> | 49 | </view> |
50 | <input type="text" @blur="handleInput" class="input" | 50 | <input type="text" @blur="handleInput" class="input" |
51 | placeholder="请输入名称" maxlength="20" :value="name" /> | 51 | placeholder="请输入名称" maxlength="20" :value="name" /> |
52 | </view> | 52 | </view> |
53 | </view> | 53 | </view> |
54 | <view class="picker" > | 54 | <view class="picker" > |
55 | <view class="picker-choice"> | 55 | <view class="picker-choice"> |
56 | <view class="choice-left"> | 56 | <view class="choice-left"> |
57 | <text class="p11">{{pickerInfoList[0].nameC}}</text> | 57 | <text class="p11">{{pickerInfoList[0].nameC}}</text> |
58 | <text class="p12">{{pickerInfoList[0].nameE}}</text> | 58 | <text class="p12">{{pickerInfoList[0].nameE}}</text> |
59 | </view> | 59 | </view> |
60 | <text class="p13">左 (OD)</text> | 60 | <text class="p13">左 (OD)</text> |
61 | <!-- <text class="p14">{{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}}</text> --> | 61 | <!-- <text class="p14">{{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}}</text> --> |
62 | <picker @change="bindPickerChange01" :value="pickerInfoList[0].nameIndex1" :range="pickerInfoList[0].nameArray1"> | 62 | <picker @change="bindPickerChange01" :value="pickerInfoList[0].nameIndex1" :range="pickerInfoList[0].nameArray1"> |
63 | <view class="p14"> | 63 | <view class="p14"> |
64 | {{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}} | 64 | {{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}} |
65 | <image src="../../static/detail-tabicon.png" ></image> | 65 | <image src="../../static/detail-tabicon.png" ></image> |
66 | </view> | 66 | </view> |
67 | <!-- <image src="../../static/detail-tabicon.png" ></image> --> | 67 | <!-- <image src="../../static/detail-tabicon.png" ></image> --> |
68 | </picker> | 68 | </picker> |
69 | <text class="p13">右 (OS)</text> | 69 | <text class="p13">右 (OS)</text> |
70 | <!-- <text class="p14">{{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}}</text> --> | 70 | <!-- <text class="p14">{{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}}</text> --> |
71 | <picker @change="bindPickerChange02" :value="pickerInfoList[0].nameIndex2" :range="pickerInfoList[0].nameArray2"> | 71 | <picker @change="bindPickerChange02" :value="pickerInfoList[0].nameIndex2" :range="pickerInfoList[0].nameArray2"> |
72 | <view class="p14"> | 72 | <view class="p14"> |
73 | {{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}} | 73 | {{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}} |
74 | <image src="../../static/detail-tabicon.png" ></image> | 74 | <image src="../../static/detail-tabicon.png" ></image> |
75 | </view> | 75 | </view> |
76 | <!-- <image src="../../static/detail-tabicon.png" ></image> --> | 76 | <!-- <image src="../../static/detail-tabicon.png" ></image> --> |
77 | </picker> | 77 | </picker> |
78 | </view> | 78 | </view> |
79 | </view> | 79 | </view> |
80 | <view class="picker" > | 80 | <view class="picker" > |
81 | <view class="picker-choice"> | 81 | <view class="picker-choice"> |
82 | <view class="choice-left"> | 82 | <view class="choice-left"> |
83 | <text class="p11">{{pickerInfoList[1].nameC}}</text> | 83 | <text class="p11">{{pickerInfoList[1].nameC}}</text> |
84 | <text class="p12">{{pickerInfoList[1].nameE}}</text> | 84 | <text class="p12">{{pickerInfoList[1].nameE}}</text> |
85 | </view> | 85 | </view> |
86 | <text class="p13">左 (OD)</text> | 86 | <text class="p13">左 (OD)</text> |
87 | <!-- <text class="p14">{{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}}</text> --> | 87 | <!-- <text class="p14">{{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}}</text> --> |
88 | <picker @change="bindPickerChange11" :value="pickerInfoList[1].nameIndex1" :range="pickerInfoList[1].nameArray1"> | 88 | <picker @change="bindPickerChange11" :value="pickerInfoList[1].nameIndex1" :range="pickerInfoList[1].nameArray1"> |
89 | <view class="p14"> | 89 | <view class="p14"> |
90 | {{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}} | 90 | {{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}} |
91 | <image src="../../static/detail-tabicon.png" ></image> | 91 | <image src="../../static/detail-tabicon.png" ></image> |
92 | </view> | 92 | </view> |
93 | <!-- <image src="../../static/detail-tabicon.png" ></image> --> | 93 | <!-- <image src="../../static/detail-tabicon.png" ></image> --> |
94 | </picker> | 94 | </picker> |
95 | <text class="p13">右 (OS)</text> | 95 | <text class="p13">右 (OS)</text> |
96 | <!-- <text class="p14">{{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}}</text> --> | 96 | <!-- <text class="p14">{{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}}</text> --> |
97 | <picker @change="bindPickerChange12" :value="pickerInfoList[1].nameIndex2" :range="pickerInfoList[1].nameArray2"> | 97 | <picker @change="bindPickerChange12" :value="pickerInfoList[1].nameIndex2" :range="pickerInfoList[1].nameArray2"> |
98 | <view class="p14"> | 98 | <view class="p14"> |
99 | {{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}} | 99 | {{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}} |
100 | <image src="../../static/detail-tabicon.png" ></image> | 100 | <image src="../../static/detail-tabicon.png" ></image> |
101 | </view> | 101 | </view> |
102 | <!-- <image src="../../static/detail-tabicon.png" ></image> --> | 102 | <!-- <image src="../../static/detail-tabicon.png" ></image> --> |
103 | </picker> | 103 | </picker> |
104 | </view> | 104 | </view> |
105 | </view> | 105 | </view> |
106 | <view class="picker" > | 106 | <view class="picker" > |
107 | <view class="picker-choice"> | 107 | <view class="picker-choice"> |
108 | <view class="choice-left"> | 108 | <view class="choice-left"> |
109 | <text class="p11">{{pickerInfoList[2].nameC}}</text> | 109 | <text class="p11">{{pickerInfoList[2].nameC}}</text> |
110 | <text class="p12">{{pickerInfoList[2].nameE}}</text> | 110 | <text class="p12">{{pickerInfoList[2].nameE}}</text> |
111 | </view> | 111 | </view> |
112 | <text class="p13">左 (OD)</text> | 112 | <text class="p13">左 (OD)</text> |
113 | <picker @change="bindPickerChange21" :value="pickerInfoList[2].nameIndex1" :range="pickerInfoList[2].nameArray1"> | 113 | <picker @change="bindPickerChange21" :value="pickerInfoList[2].nameIndex1" :range="pickerInfoList[2].nameArray1"> |
114 | <view class="p14"> | 114 | <view class="p14"> |
115 | {{pickerInfoList[2].nameArray1[pickerInfoList[2].nameIndex1]}} | 115 | {{pickerInfoList[2].nameArray1[pickerInfoList[2].nameIndex1]}} |
116 | <image src="../../static/detail-tabicon.png" ></image> | 116 | <image src="../../static/detail-tabicon.png" ></image> |
117 | </view> | 117 | </view> |
118 | </picker> | 118 | </picker> |
119 | <text class="p13">右 (OS)</text> | 119 | <text class="p13">右 (OS)</text> |
120 | <!-- <text class="p14">{{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}}</text> --> | 120 | <!-- <text class="p14">{{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}}</text> --> |
121 | <picker @change="bindPickerChange22" :value="pickerInfoList[2].nameIndex2" :range="pickerInfoList[2].nameArray2"> | 121 | <picker @change="bindPickerChange22" :value="pickerInfoList[2].nameIndex2" :range="pickerInfoList[2].nameArray2"> |
122 | <view class="p14"> | 122 | <view class="p14"> |
123 | {{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}} | 123 | {{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}} |
124 | <image src="../../static/detail-tabicon.png" ></image> | 124 | <image src="../../static/detail-tabicon.png" ></image> |
125 | </view> | 125 | </view> |
126 | <!-- <image src="../../static/detail-tabicon.png" ></image> --> | 126 | <!-- <image src="../../static/detail-tabicon.png" ></image> --> |
127 | </picker> | 127 | </picker> |
128 | </view> | 128 | </view> |
129 | </view> | 129 | </view> |
130 | <view class="picker"> | 130 | <view class="picker"> |
131 | <view class="picker-choice"> | 131 | <view class="picker-choice"> |
132 | <view class="choice-left"> | 132 | <view class="choice-left"> |
133 | <text class="pd">瞳距:</text> | 133 | <text class="pd">瞳距:</text> |
134 | </view> | 134 | </view> |
135 | <input type="digit" @change="handleInputPd" class="input" | 135 | <input type="digit" @change="handleInputPd" class="input" |
136 | placeholder="请输入瞳距,单位cm" maxlength="20" :value="pd" /> | 136 | placeholder="请输入瞳距,单位cm" maxlength="20" :value="pd" /> |
137 | </view> | 137 | </view> |
138 | </view> | 138 | </view> |
139 | <view class="picker" > | 139 | <view class="picker" > |
140 | <view class="picker-choice"> | 140 | <view class="picker-choice"> |
141 | <view class="choice-left"> | 141 | <view class="choice-left"> |
142 | <text class="p11">{{pickerInfoList[3].nameC}}</text> | 142 | <text class="p11">{{pickerInfoList[3].nameC}}</text> |
143 | </view> | 143 | </view> |
144 | <text class="p13-date">年 (Y)</text> | 144 | <text class="p13-date">年 (Y)</text> |
145 | <picker @change="bindPickerChange41" :value="pickerInfoList[3].nameIndex1" :range="pickerInfoList[3].nameArray1"> | 145 | <picker @change="bindPickerChange41" :value="pickerInfoList[3].nameIndex1" :range="pickerInfoList[3].nameArray1"> |
146 | <view class="p14" style="width: 30px;"> | 146 | <view class="p14" style="width: 30px;"> |
147 | {{pickerInfoList[3].nameArray1[pickerInfoList[3].nameIndex1]}} | 147 | {{pickerInfoList[3].nameArray1[pickerInfoList[3].nameIndex1]}} |
148 | <image src="../../static/detail-tabicon.png" ></image> | 148 | <image src="../../static/detail-tabicon.png" ></image> |
149 | </view> | 149 | </view> |
150 | </picker> | 150 | </picker> |
151 | <text class="p13-date">月 (M)</text> | 151 | <text class="p13-date">月 (M)</text> |
152 | <picker @change="bindPickerChange42" :value="pickerInfoList[3].nameIndex2" :range="pickerInfoList[3].nameArray2"> | 152 | <picker @change="bindPickerChange42" :value="pickerInfoList[3].nameIndex2" :range="pickerInfoList[3].nameArray2"> |
153 | <view class="p14" style="width: 30px;"> | 153 | <view class="p14" style="width: 30px;"> |
154 | {{pickerInfoList[3].nameArray2[pickerInfoList[3].nameIndex2]}} | 154 | {{pickerInfoList[3].nameArray2[pickerInfoList[3].nameIndex2]}} |
155 | <image src="../../static/detail-tabicon.png" ></image> | 155 | <image src="../../static/detail-tabicon.png" ></image> |
156 | </view> | 156 | </view> |
157 | </picker> | 157 | </picker> |
158 | <text class="p13-date">日 (D)</text> | 158 | <text class="p13-date">日 (D)</text> |
159 | <picker @change="bindPickerChange43" :value="pickerInfoList[3].nameIndex3" :range="pickerInfoList[3].nameArray3"> | 159 | <picker @change="bindPickerChange43" :value="pickerInfoList[3].nameIndex3" :range="pickerInfoList[3].nameArray3"> |
160 | <view class="p14" style="width: 30px;"> | 160 | <view class="p14" style="width: 30px;"> |
161 | {{pickerInfoList[3].nameArray3[pickerInfoList[3].nameIndex3]}} | 161 | {{pickerInfoList[3].nameArray3[pickerInfoList[3].nameIndex3]}} |
162 | <image src="../../static/detail-tabicon.png" ></image> | 162 | <image src="../../static/detail-tabicon.png" ></image> |
163 | </view> | 163 | </view> |
164 | </picker> | 164 | </picker> |
165 | </view> | 165 | </view> |
166 | </view> | 166 | </view> |
167 | <view class="confirm"> | 167 | <view class="confirm"> |
168 | <image class="image1" :src="confirm ? tabicon[0] : tabicon[1]" @tap="changeConfirm"></image> | 168 | <image class="image1" :src="confirm ? tabicon[0] : tabicon[1]" @tap="changeConfirm"></image> |
169 | <text>确认以上输入信息来源于我的验光数据!</text> | 169 | <text>确认以上输入信息来源于我的验光数据!</text> |
170 | </view> | 170 | </view> |
171 | </view> | 171 | </view> |
172 | <!-- <view class="goods-form"> | ||
173 | <view class="data-title"> | ||
174 | <image src="../../static/icon-data.png"></image> | ||
175 | <text class="p1">填写验光数据</text> | ||
176 | </view> | ||
177 | <text class="p2">没有验光数据?请到线下眼镜店验光哦~</text> | ||
178 | <view class="picker"> | ||
179 | <view class="picker-choice"> | ||
180 | <view class="choice-left"> | ||
181 | <text class="p11">验光单取名:</text> | ||
182 | </view> | ||
183 | <input | ||
184 | class="choice-name uni-input" | ||
185 | :value="dataName" | ||
186 | @blur="fillData" | ||
187 | placeholder="下系" | ||
188 | /> | ||
189 | </view> | ||
190 | </view> | ||
191 | <view class="picker"> | ||
192 | <view class="picker-choice"> | ||
193 | <view class="choice-left"> | ||
194 | <text class="p11">{{pickerInfoList[0].nameC}}</text> | ||
195 | <text class="p12">{{pickerInfoList[0].nameE}}</text> | ||
196 | </view> | ||
197 | <text class="p13">左 (OD)</text> | ||
198 | <text class="p14">{{pickerInfoList[0].nameArray1[pickerInfoList[0].nameIndex1]}}</text> | ||
199 | <picker | ||
200 | @change="bindPickerChange01" | ||
201 | :value="pickerInfoList[0].nameIndex1" | ||
202 | :range="pickerInfoList[0].nameArray1" | ||
203 | > | ||
204 | <image src="../../static/detail-tabicon.png"></image> | ||
205 | </picker> | ||
206 | <text class="p13">右 (OS)</text> | ||
207 | <text class="p14">{{pickerInfoList[0].nameArray2[pickerInfoList[0].nameIndex2]}}</text> | ||
208 | <picker | ||
209 | @change="bindPickerChange02" | ||
210 | :value="pickerInfoList[0].nameIndex2" | ||
211 | :range="pickerInfoList[0].nameArray2" | ||
212 | > | ||
213 | <image src="../../static/detail-tabicon.png"></image> | ||
214 | </picker> | ||
215 | </view> | ||
216 | </view> | ||
217 | <view class="picker"> | ||
218 | <view class="picker-choice"> | ||
219 | <view class="choice-left"> | ||
220 | <text class="p11">{{pickerInfoList[1].nameC}}</text> | ||
221 | <text class="p12">{{pickerInfoList[1].nameE}}</text> | ||
222 | </view> | ||
223 | <text class="p13">左 (OD)</text> | ||
224 | <text class="p14">{{pickerInfoList[1].nameArray1[pickerInfoList[1].nameIndex1]}}</text> | ||
225 | <picker | ||
226 | @change="bindPickerChange11" | ||
227 | :value="pickerInfoList[1].nameIndex1" | ||
228 | :range="pickerInfoList[1].nameArray1" | ||
229 | > | ||
230 | <image src="../../static/detail-tabicon.png"></image> | ||
231 | </picker> | ||
232 | <text class="p13">右 (OS)</text> | ||
233 | <text class="p14">{{pickerInfoList[1].nameArray2[pickerInfoList[1].nameIndex2]}}</text> | ||
234 | <picker | ||
235 | @change="bindPickerChange12" | ||
236 | :value="pickerInfoList[1].nameIndex2" | ||
237 | :range="pickerInfoList[1].nameArray2" | ||
238 | > | ||
239 | <image src="../../static/detail-tabicon.png"></image> | ||
240 | </picker> | ||
241 | </view> | ||
242 | </view> | ||
243 | <view class="picker"> | ||
244 | <view class="picker-choice"> | ||
245 | <view class="choice-left"> | ||
246 | <text class="p11">{{pickerInfoList[2].nameC}}</text> | ||
247 | <text class="p12">{{pickerInfoList[2].nameE}}</text> | ||
248 | </view> | ||
249 | <text class="p13">左 (OD)</text> | ||
250 | <text class="p14">{{pickerInfoList[2].nameArray1[pickerInfoList[2].nameIndex1]}}</text> | ||
251 | <picker | ||
252 | @change="bindPickerChange21" | ||
253 | :value="pickerInfoList[2].nameIndex1" | ||
254 | :range="pickerInfoList[2].nameArray1" | ||
255 | > | ||
256 | <image src="../../static/detail-tabicon.png"></image> | ||
257 | </picker> | ||
258 | <text class="p13">右 (OS)</text> | ||
259 | <text class="p14">{{pickerInfoList[2].nameArray2[pickerInfoList[2].nameIndex2]}}</text> | ||
260 | <picker | ||
261 | @change="bindPickerChange22" | ||
262 | :value="pickerInfoList[2].nameIndex2" | ||
263 | :range="pickerInfoList[2].nameArray2" | ||
264 | > | ||
265 | <image src="../../static/detail-tabicon.png"></image> | ||
266 | </picker> | ||
267 | </view> | ||
268 | </view> | ||
269 | <view class="picker"> | ||
270 | <view class="picker-choice"> | ||
271 | <view class="choice-left"> | ||
272 | <text class="p11">{{pickerInfoList[3].nameC}}</text> | ||
273 | <text class="p12">{{pickerInfoList[3].nameE}}</text> | ||
274 | </view> | ||
275 | <text class="p13">左 (OD)</text> | ||
276 | <text class="p14">{{pickerInfoList[3].nameArray1[pickerInfoList[3].nameIndex1]}}</text> | ||
277 | <picker | ||
278 | @change="bindPickerChange31" | ||
279 | :value="pickerInfoList[3].nameIndex1" | ||
280 | :range="pickerInfoList[3].nameArray1" | ||
281 | > | ||
282 | <image src="../../static/detail-tabicon.png"></image> | ||
283 | </picker> | ||
284 | <text class="p13">右 (OS)</text> | ||
285 | <text class="p14">{{pickerInfoList[3].nameArray2[pickerInfoList[3].nameIndex2]}}</text> | ||
286 | <picker | ||
287 | @change="bindPickerChange32" | ||
288 | :value="pickerInfoList[3].nameIndex2" | ||
289 | :range="pickerInfoList[3].nameArray2" | ||
290 | > | ||
291 | <image src="../../static/detail-tabicon.png"></image> | ||
292 | </picker> | ||
293 | </view> | ||
294 | </view> | ||
295 | <view class="picker"> | ||
296 | <view class="picker-choice"> | ||
297 | <view class="choice-left"> | ||
298 | <text class="p11">{{pickerInfoList[4].nameC}}</text> | ||
299 | </view> | ||
300 | <text class="p13-date">年 (Y)</text> | ||
301 | <text | ||
302 | class="p14" | ||
303 | style="width: 34px;" | ||
304 | >{{pickerInfoList[4].nameArray1[pickerInfoList[4].nameIndex1]}}</text> | ||
305 | <picker | ||
306 | @change="bindPickerChange41" | ||
307 | :value="pickerInfoList[4].nameIndex1" | ||
308 | :range="pickerInfoList[4].nameArray1" | ||
309 | > | ||
310 | <image src="../../static/detail-tabicon.png"></image> | ||
311 | </picker> | ||
312 | <text class="p13-date">月 (M)</text> | ||
313 | <text | ||
314 | class="p14" | ||
315 | style="width: 30px;" | ||
316 | >{{pickerInfoList[4].nameArray2[pickerInfoList[4].nameIndex2]}}</text> | ||
317 | <picker | ||
318 | @change="bindPickerChange42" | ||
319 | :value="pickerInfoList[4].nameIndex2" | ||
320 | :range="pickerInfoList[4].nameArray2" | ||
321 | > | ||
322 | <image src="../../static/detail-tabicon.png"></image> | ||
323 | </picker> | ||
324 | <text class="p13-date">日 (D)</text> | ||
325 | <text | ||
326 | class="p14" | ||
327 | style="width: 30px;" | ||
328 | >{{pickerInfoList[4].nameArray3[pickerInfoList[4].nameIndex3]}}</text> | ||
329 | <picker | ||
330 | @change="bindPickerChange43" | ||
331 | :value="pickerInfoList[4].nameIndex3" | ||
332 | :range="pickerInfoList[4].nameArray3" | ||
333 | > | ||
334 | <image src="../../static/detail-tabicon.png"></image> | ||
335 | </picker> | ||
336 | </view> | ||
337 | </view> | ||
338 | <view class="confirm"> | ||
339 | <image | ||
340 | :src="tablist.confirm ? tabicon[0] : tabicon[1]" | ||
341 | @click="changeConfirm" | ||
342 | ></image> | ||
343 | <text>确认以上输入信息来源于我的验光数据!</text> | ||
344 | </view> | ||
345 | </view> --> | ||
346 | |||
347 | </template> | 172 | </template> |
348 | <template v-else> | 173 | <template v-else> |
349 | <view | 174 | <view |
350 | v-for="item in pickerInfoList" | 175 | v-for="item in pickerInfoList" |
351 | :key="item.key" | 176 | :key="item.key" |
352 | class="bodyBox" | 177 | class="bodyBox" |
353 | > | 178 | > |
354 | <template v-if="item.nameC==='验光日期'"> | 179 | <template v-if="item.nameC==='验光日期'"> |
355 | <text class="names">{{item.nameC}}</text> | 180 | <text class="names">{{item.nameC}}</text> |
356 | <text style="margin-right: 5px;">{{item.nameArray1[item.nameIndex1]}}年</text> | 181 | <text style="margin-right: 5px;">{{item.nameArray1[item.nameIndex1]}}年</text> |
357 | <text style="margin-right: 5px;">{{item.nameArray2[item.nameIndex2]}}月</text> | 182 | <text style="margin-right: 5px;">{{item.nameArray2[item.nameIndex2]}}月</text> |
358 | <text>{{item.nameArray3[item.nameIndex2]}}日</text> | 183 | <text>{{item.nameArray3[item.nameIndex2]}}日</text> |
359 | </template> | 184 | </template> |
360 | <template v-else> | 185 | <template v-else> |
361 | <template v-if="item.nameC==='度数'"> | 186 | <template v-if="item.nameC==='度数'"> |
362 | <text style="display: inline;">*</text> | 187 | <text style="display: inline;">*</text> |
363 | </template> | 188 | </template> |
364 | 189 | ||
365 | <text class="names">{{item.nameC}}</text> | 190 | <text class="names">{{item.nameC}}</text> |
366 | <text style="margin-right: 10px;">左 {{item.nameArray1[item.nameIndex1]}}</text> | 191 | <text style="margin-right: 10px;">左 {{item.nameArray1[item.nameIndex1]}}</text> |
367 | <text>右 {{item.nameArray2[item.nameIndex2]}}</text> | 192 | <text>右 {{item.nameArray2[item.nameIndex2]}}</text> |
368 | </template> | 193 | </template> |
369 | </view> | 194 | </view> |
370 | </template> | 195 | </template> |
371 | </view> | 196 | </view> |
372 | </view> | 197 | </view> |
373 | </view> | 198 | </view> |
374 | <view class="choose"> | 199 | <view class="choose"> |
375 | <view | 200 | <view |
376 | class="chooseItem_1_content" | 201 | class="chooseItem_1_content" |
377 | v-for="(item,index) in attrList" | 202 | v-for="(item,index) in attrList" |
378 | :key="index" | 203 | :key="index" |
379 | > | 204 | > |
380 | <UniCollapse @change="change(index)"> | 205 | <UniCollapse @change="change(index)"> |
381 | <UniCollapseItem | 206 | <UniCollapseItem |
382 | :open="show[index]" | 207 | :open="show[index]" |
383 | :title="item.meta_name" | 208 | :title="item.meta_name" |
384 | showAnimation=false | 209 | showAnimation=false |
385 | > | 210 | > |
386 | <view class="chooseItem_1_content"> | 211 | <view class="chooseItem_1_content"> |
387 | <view class="itemsWrap"> | 212 | <view class="itemsWrap"> |
388 | <view | 213 | <view |
389 | class="item2" | 214 | class="item2" |
390 | v-for="(one,i) in item.attr" | 215 | v-for="(one,i) in item.attr" |
391 | :key="i" | 216 | :key="i" |
392 | :class="{ active2: current[index] === i }" | 217 | :class="{ active2: current[index] === i }" |
393 | @click="onClickItem(index, i)" | 218 | @click="onClickItem(index, i)" |
394 | >{{one.name}}</view> | 219 | >{{one.name}}</view> |
395 | </view> | 220 | </view> |
396 | </view> | 221 | </view> |
397 | </UniCollapseItem> | 222 | </UniCollapseItem> |
398 | </UniCollapse> | 223 | </UniCollapse> |
399 | <view | 224 | <view |
400 | class="chooseRes" | 225 | class="chooseRes" |
401 | v-show="!show[index]" | 226 | v-show="!show[index]" |
402 | >* {{attrList[index].attr[current[index]].name}}</view> | 227 | >* {{attrList[index].attr[current[index]].name}}</view> |
403 | </view> | 228 | </view> |
404 | <!-- <view class="chooseItem_1 chooseItem"> | 229 | <!-- <view class="chooseItem_1 chooseItem"> |
405 | <UniCollapse @change="change(1)"> | 230 | <UniCollapse @change="change(1)"> |
406 | <UniCollapseItem | 231 | <UniCollapseItem |
407 | open=true | 232 | open=true |
408 | title="款式挑选" | 233 | title="款式挑选" |
409 | showAnimation=false | 234 | showAnimation=false |
410 | > | 235 | > |
411 | <view | 236 | <view |
412 | class="chooseRes" | 237 | class="chooseRes" |
413 | v-show="show[1]" | 238 | v-show="show[1]" |
414 | >* {{chooseRes1}}</view> | 239 | >* {{chooseRes1}}</view> |
415 | <view class="chooseItem_1_content"> | 240 | <view class="chooseItem_1_content"> |
416 | <view class="itemsWrap"> | 241 | <view class="itemsWrap"> |
417 | <view | 242 | <view |
418 | class="item1" | 243 | class="item1" |
419 | v-for="(item,index) in chooseItem1" | 244 | v-for="(item,index) in chooseItem1" |
420 | :key="index" | 245 | :key="index" |
421 | :style="item.style" | 246 | :style="item.style" |
422 | :class="{ active1: current1 === index }" | 247 | :class="{ active1: current1 === index }" |
423 | @click="onClickItem1(index)" | 248 | @click="onClickItem1(index)" |
424 | ></view> | 249 | ></view> |
425 | </view> | 250 | </view> |
426 | </view> | 251 | </view> |
427 | </UniCollapseItem> | 252 | </UniCollapseItem> |
428 | </UniCollapse> | 253 | </UniCollapse> |
429 | <view | 254 | <view |
430 | class="chooseRes" | 255 | class="chooseRes" |
431 | v-show="show[1]" | 256 | v-show="show[1]" |
432 | >* {{chooseRes1}}</view> | 257 | >* {{chooseRes1}}</view> |
433 | </view> | 258 | </view> |
434 | <view class="chooseItem_2 chooseItem "> | 259 | <view class="chooseItem_2 chooseItem "> |
435 | <UniCollapse @change="change(2)"> | 260 | <UniCollapse @change="change(2)"> |
436 | <UniCollapseItem | 261 | <UniCollapseItem |
437 | open=true | 262 | open=true |
438 | title="直径" | 263 | title="直径" |
439 | showAnimation=false | 264 | showAnimation=false |
440 | > | 265 | > |
441 | <view class="chooseItem_1_content"> | 266 | <view class="chooseItem_1_content"> |
442 | <view class="itemsWrap"> | 267 | <view class="itemsWrap"> |
443 | <view | 268 | <view |
444 | class="item2" | 269 | class="item2" |
445 | v-for="(item,index) in chooseItem2" | 270 | v-for="(item,index) in chooseItem2" |
446 | :key="index" | 271 | :key="index" |
447 | :class="{ active2: current2 === index }" | 272 | :class="{ active2: current2 === index }" |
448 | @click="onClickItem2(index)" | 273 | @click="onClickItem2(index)" |
449 | >{{item.num}}</view> | 274 | >{{item.num}}</view> |
450 | </view> | 275 | </view> |
451 | </view> | 276 | </view> |
452 | </UniCollapseItem> | 277 | </UniCollapseItem> |
453 | </UniCollapse> | 278 | </UniCollapse> |
454 | <view | 279 | <view |
455 | class="chooseRes" | 280 | class="chooseRes" |
456 | v-show="show[2]" | 281 | v-show="show[2]" |
457 | >* {{chooseRes2}}</view> | 282 | >* {{chooseRes2}}</view> |
458 | </view> | 283 | </view> |
459 | <view class="chooseItem_3 chooseItem"> | 284 | <view class="chooseItem_3 chooseItem"> |
460 | <UniCollapse @change="change(3)"> | 285 | <UniCollapse @change="change(3)"> |
461 | <UniCollapseItem | 286 | <UniCollapseItem |
462 | open=true | 287 | open=true |
463 | title="度数" | 288 | title="度数" |
464 | showAnimation=false | 289 | showAnimation=false |
465 | > | 290 | > |
466 | <view class="chooseItem_1_content"> | 291 | <view class="chooseItem_1_content"> |
467 | <view class="itemsWrap"> | 292 | <view class="itemsWrap"> |
468 | <view | 293 | <view |
469 | class="item2" | 294 | class="item2" |
470 | v-for="(item,index) in chooseItem3" | 295 | v-for="(item,index) in chooseItem3" |
471 | :key="index" | 296 | :key="index" |
472 | :class="{ active2: current3 === index }" | 297 | :class="{ active2: current3 === index }" |
473 | @click="onClickItem3(index)" | 298 | @click="onClickItem3(index)" |
474 | >{{item}}</view> | 299 | >{{item}}</view> |
475 | </view> | 300 | </view> |
476 | </view> | 301 | </view> |
477 | </UniCollapseItem> | 302 | </UniCollapseItem> |
478 | </UniCollapse> | 303 | </UniCollapse> |
479 | <view | 304 | <view |
480 | class="chooseRes" | 305 | class="chooseRes" |
481 | v-show="show[3]" | 306 | v-show="show[3]" |
482 | >* {{chooseRes3}}</view> | 307 | >* {{chooseRes3}}</view> |
483 | </view> --> | 308 | </view> --> |
484 | </view> | 309 | </view> |
485 | <view | 310 | <view |
486 | class="button" | 311 | class="button" |
487 | @click="toComfirmOrder" | 312 | @click="toComfirmOrder" |
488 | > | 313 | > |
489 | 立即结算 | 314 | 立即结算 |
490 | </view> | 315 | </view> |
491 | </view> | 316 | </view> |
492 | </template> | 317 | </template> |
493 | 318 | ||
494 | <script> | 319 | <script> |
495 | import UniCollapse from '@/components/UniCollapse/UniCollapse.vue' | 320 | import UniCollapse from '@/components/UniCollapse/UniCollapse.vue' |
496 | import UniCollapseItem from '@/components/UniCollapseItem/UniCollapseItem.vue' | 321 | import UniCollapseItem from '@/components/UniCollapseItem/UniCollapseItem.vue' |
497 | import store from '@/store' | 322 | import store from '@/store' |
498 | 323 | ||
499 | export default { | 324 | export default { |
500 | components: { | 325 | components: { |
501 | UniCollapse, | 326 | UniCollapse, |
502 | UniCollapseItem | 327 | UniCollapseItem |
503 | }, | 328 | }, |
504 | data() { | 329 | data() { |
505 | return { | 330 | return { |
506 | count: 1, | 331 | count: 1, |
507 | pid: 0, | 332 | pid: 0, |
508 | maxCount: 20, | 333 | maxCount: 20, |
509 | dataName: '', // 验光数据人员名称 | 334 | dataName: '', // 验光数据人员名称 |
510 | isDataName: false, // 是否是已存在的人员数据 | 335 | isDataName: false, // 是否是已存在的人员数据 |
511 | dataConfirm: false, // 已确认所输入验光数据 | 336 | dataConfirm: false, // 已确认所输入验光数据 |
512 | opIsOpen: true, | 337 | opIsOpen: true, |
513 | addDisabled: false, | 338 | addDisabled: false, |
514 | desDisabled: false, | 339 | desDisabled: false, |
515 | current1: 0, | 340 | current1: 0, |
516 | current2: 0, | 341 | current2: 0, |
517 | current3: 0, | 342 | current3: 0, |
518 | current: [], | 343 | current: [], |
519 | show: [], | 344 | show: [], |
520 | chooseRes1: { | 345 | chooseRes1: { |
521 | sku_name: 'Miss 黑二代【减龄自然】', | 346 | sku_name: 'Miss 黑二代【减龄自然】', |
522 | sk_id: '128' | 347 | sk_id: '128' |
523 | }, | 348 | }, |
524 | checkedData: { | 349 | checkedData: { |
525 | 350 | ||
526 | }, | 351 | }, |
527 | chooseRes2: '14.0', | 352 | chooseRes2: '14.0', |
528 | chooseRes3: 0, | 353 | chooseRes3: 0, |
529 | chooseItem1: [ | 354 | chooseItem1: [ |
530 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 148%, #ECEAEA 50%, #8D8C8C 100%);', describ: 'Miss 黑1代【减龄自然】' }, | 355 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 148%, #ECEAEA 50%, #8D8C8C 100%);', describ: 'Miss 黑1代【减龄自然】' }, |
531 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑二代【防紫外线】' }, | 356 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑二代【防紫外线】' }, |
532 | { style: 'background-image: radial-gradient(50% 148%, #FDF8F6 50%, #94380B 100%);', describ: 'Miss 黑3代【防紫外线】' }, | 357 | { style: 'background-image: radial-gradient(50% 148%, #FDF8F6 50%, #94380B 100%);', describ: 'Miss 黑3代【防紫外线】' }, |
533 | { style: 'background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);', describ: 'Miss 黑4代【防紫外线】' }, | 358 | { style: 'background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);', describ: 'Miss 黑4代【防紫外线】' }, |
534 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑5代【防紫外线】' }, | 359 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑5代【防紫外线】' }, |
535 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);', describ: 'Miss 黑6代【防紫外线】' }, | 360 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);', describ: 'Miss 黑6代【防紫外线】' }, |
536 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);', describ: 'Miss 黑7代【防紫外线】' }, | 361 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);', describ: 'Miss 黑7代【防紫外线】' }, |
537 | { style: 'background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);', describ: 'Miss 黑4代【防紫外线】' }, | 362 | { style: 'background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);', describ: 'Miss 黑4代【防紫外线】' }, |
538 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑5代【防紫外线】' }, | 363 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑5代【防紫外线】' }, |
539 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);', describ: 'Miss 黑6代【防紫外线】' }, | 364 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);', describ: 'Miss 黑6代【防紫外线】' }, |
540 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);', describ: 'Miss 黑7代【防紫外线】' }, | 365 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);', describ: 'Miss 黑7代【防紫外线】' }, |
541 | { style: 'background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);', describ: 'Miss 黑4代【防紫外线】' }, | 366 | { style: 'background-image: radial-gradient(50% 148%, #FFFFFF 50%, #324A05 100%);', describ: 'Miss 黑4代【防紫外线】' }, |
542 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑5代【防紫外线】' }, | 367 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #624B3F 100%);', describ: 'Miss 黑5代【防紫外线】' }, |
543 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);', describ: 'Miss 黑6代【防紫外线】' }, | 368 | { style: 'opacity: 0.7;background-image: radial-gradient(50% 150%, #F0EEE7 50%, #6F0838 100%);', describ: 'Miss 黑6代【防紫外线】' }, |
544 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);', describ: 'Miss 黑7代【防紫外线】' } | 369 | { style: 'background-image: radial-gradient(50% 143%, #AEA8A8 45%, #370B4E 100%);', describ: 'Miss 黑7代【防紫外线】' } |
545 | ], | 370 | ], |
546 | chooseItem2: [ | 371 | chooseItem2: [ |
547 | { num: '14.0' }, | 372 | { num: '14.0' }, |
548 | { num: '14.2' }, | 373 | { num: '14.2' }, |
549 | { num: '14.4' }, | 374 | { num: '14.4' }, |
550 | { num: '14.5' } | 375 | { num: '14.5' } |
551 | ], | 376 | ], |
552 | chooseItem3: [0, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 470, 500, 525, 550, 575, 600, 1000], | 377 | chooseItem3: [0, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 470, 500, 525, 550, 575, 600, 1000], |
553 | // 度数相关数据 | 378 | // 度数相关数据 |
554 | pickerInfoList:[ | 379 | pickerInfoList:[ |
555 | {nameC:"度数",nameE:"(SPH)",nameArray1:[''],nameIndex1:0,nameArray2:[''],nameIndex2:0,key:0}, | 380 | {nameC:"度数",nameE:"(SPH)",nameArray1:[''],nameIndex1:0,nameArray2:[''],nameIndex2:0,key:0}, |
556 | {nameC:"散光",nameE:"(CYL)",nameArray1:[''],nameIndex1:0,nameArray2:[''],nameIndex2:0,key:1}, | 381 | {nameC:"散光",nameE:"(CYL)",nameArray1:[''],nameIndex1:0,nameArray2:[''],nameIndex2:0,key:1}, |
557 | {nameC:"散光轴位",nameE:"(AXI)",nameArray1:[''],nameIndex1:0,nameArray2:[''],nameIndex2:0,key:2}, | 382 | {nameC:"散光轴位",nameE:"(AXI)",nameArray1:[''],nameIndex1:0,nameArray2:[''],nameIndex2:0,key:2}, |
558 | {nameC:"验光日期",nameE:'',nameArray1:[''],nameIndex1:0,nameArray2:['',1,2,3,4,5,6,7,8,9,10,11,12],nameIndex2:0,nameArray3:[''],nameIndex3:0} | 383 | {nameC:"验光日期",nameE:'',nameArray1:[''],nameIndex1:0,nameArray2:['',1,2,3,4,5,6,7,8,9,10,11,12],nameIndex2:0,nameArray3:[''],nameIndex3:0} |
559 | ], | 384 | ], |
560 | confirm: false, // 用户是否确认 | 385 | confirm: false, // 用户是否确认 |
561 | tabicon:['/static/detail-button.png','/static/detail-button-unselected.png'], | 386 | tabicon:['/static/detail-button.png','/static/detail-button-unselected.png'], |
562 | name: '夏小花', | 387 | name: '夏小花', |
563 | oldname:'',// 用于判读用户是否改变名字 | 388 | oldname:'',// 用于判读用户是否改变名字 |
564 | pickerInfoChioce:{ | 389 | pickerInfoChioce:{ |
565 | "leftSph": '', | 390 | "leftSph": '', |
566 | "rightSph": '', | 391 | "rightSph": '', |
567 | "leftCyl": '', | 392 | "leftCyl": '', |
568 | "rightCyl": '', | 393 | "rightCyl": '', |
569 | "leftAxi": '', | 394 | "leftAxi": '', |
570 | "rightAxi": '', | 395 | "rightAxi": '', |
571 | "time":{ | 396 | "time":{ |
572 | "year":0, | 397 | "year":0, |
573 | "month": 0, | 398 | "month": 0, |
574 | "day":0 , | 399 | "day":0 , |
575 | } | 400 | } |
576 | }, | 401 | }, |
577 | pd: '',// 瞳距 | 402 | pd: '',// 瞳距 |
578 | oldpd: '',// 用于判断用户是否改变瞳距 | 403 | oldpd: '',// 用于判断用户是否改变瞳距 |
579 | kinds:1, // kinds=1,提交为新增验光,2为修改 | 404 | kinds:1, // kinds=1,提交为新增验光,2为修改 |
580 | mp_id: Number | 405 | mp_id: Number |
581 | } | 406 | } |
582 | }, | 407 | }, |
583 | computed: { | 408 | computed: { |
584 | attrList() { | 409 | attrList() { |
585 | return this.$store.state.read.goodInfo.attrList | 410 | return this.$store.state.read.goodInfo.attrList |
586 | }, | 411 | }, |
587 | skuList() { | 412 | skuList() { |
588 | return this.$store.state.read.goodInfo.skuList | 413 | return this.$store.state.read.goodInfo.skuList |
589 | }, | 414 | }, |
590 | mpList() { | 415 | mpList() { |
591 | return this.$store.state.myLoveList.loveList | 416 | return this.$store.state.myLoveList.loveList |
592 | } | 417 | } |
593 | }, | 418 | }, |
594 | onLoad({ pid }) { | 419 | onLoad({ pid }) { |
595 | this.pid = pid | 420 | this.pid = pid |
596 | store.dispatch('read/fetch', { | 421 | store.dispatch('read/fetch', { |
597 | pid | 422 | pid |
598 | }).then(() => { | 423 | }).then(() => { |
599 | const current = [] | 424 | const current = [] |
600 | const show = [] | 425 | const show = [] |
601 | for (let index = 0; index < this.attrList.length; index++) { | 426 | for (let index = 0; index < this.attrList.length; index++) { |
602 | current.push(0) | 427 | current.push(0) |
603 | show.push(true) | 428 | show.push(true) |
604 | } | 429 | } |
605 | this.current = current | 430 | this.current = current |
606 | this.show = show | 431 | this.show = show |
607 | }) | 432 | }) |
608 | store.dispatch('myLoveList/getLoveList') | 433 | store.dispatch('myLoveList/getLoveList') |
609 | 434 | ||
610 | // 初始化SPL、CYL、AXI的值 | 435 | // 初始化SPL、CYL、AXI的值 |
611 | for (let j = 0; j < 3; j++) { | 436 | for (let j = 0; j < 3; j++) { |
612 | for(let i=-12;i<6;i++){ | 437 | for(let i=-12;i<6;i++){ |
613 | this.pickerInfoList[j].nameArray1.push(i) | 438 | this.pickerInfoList[j].nameArray1.push(i) |
614 | this.pickerInfoList[j].nameArray1.push(i+0.5) | 439 | this.pickerInfoList[j].nameArray1.push(i+0.5) |
615 | this.pickerInfoList[j].nameArray2.push(i) | 440 | this.pickerInfoList[j].nameArray2.push(i) |
616 | this.pickerInfoList[j].nameArray2.push(i+0.5) | 441 | this.pickerInfoList[j].nameArray2.push(i+0.5) |
617 | if(i>=-6){ | 442 | if(i>=-6){ |
618 | this.pickerInfoList[j].nameArray1.push(i+0.25) | 443 | this.pickerInfoList[j].nameArray1.push(i+0.25) |
619 | this.pickerInfoList[j].nameArray1.push(i+0.75) | 444 | this.pickerInfoList[j].nameArray1.push(i+0.75) |
620 | this.pickerInfoList[j].nameArray2.push(i+0.25) | 445 | this.pickerInfoList[j].nameArray2.push(i+0.25) |
621 | this.pickerInfoList[j].nameArray2.push(i+0.75) | 446 | this.pickerInfoList[j].nameArray2.push(i+0.75) |
622 | } | 447 | } |
623 | if(i==5){ | 448 | if(i==5){ |
624 | this.pickerInfoList[j].nameArray1.push(i+1) | 449 | this.pickerInfoList[j].nameArray1.push(i+1) |
625 | this.pickerInfoList[j].nameArray2.push(i+1) | 450 | this.pickerInfoList[j].nameArray2.push(i+1) |
626 | } | 451 | } |
627 | } | 452 | } |
628 | } | 453 | } |
629 | // 初始化日期值 | 454 | // 初始化日期值 |
630 | for (let i = 1; i < 32; i++){ | 455 | for (let i = 1; i < 32; i++){ |
631 | this.pickerInfoList[3].nameArray3.push(i) | 456 | this.pickerInfoList[3].nameArray3.push(i) |
632 | } | 457 | } |
633 | // 初始化年份前后五年 | 458 | // 初始化年份前后五年 |
634 | let myDate = new Date(); | 459 | let myDate = new Date(); |
635 | let nowYear = myDate.getFullYear(); | 460 | let nowYear = myDate.getFullYear(); |
636 | for(let i=0;i<5;i++){ | 461 | for(let i=0;i<5;i++){ |
637 | this.pickerInfoList[3].nameArray1.push(nowYear-i) | 462 | this.pickerInfoList[3].nameArray1.push(nowYear-i) |
638 | } | 463 | } |
639 | }, | 464 | }, |
640 | methods: { | 465 | methods: { |
641 | // picker相关功能 | 466 | // picker相关功能 |
642 | handleInput(e){ | 467 | handleInput(e){ |
643 | this.name=e.target.value | 468 | this.name=e.target.value |
644 | this.isDataName = false | 469 | this.isDataName = false |
645 | console.log('e---->', e) | 470 | console.log('e---->', e) |
646 | const mpList = this.mpList | 471 | const mpList = this.mpList |
647 | console.log('mpList===>',mpList) | 472 | console.log('mpList===>',mpList) |
648 | for (let index = 0; index < mpList.length; index++) { | 473 | for (let index = 0; index < mpList.length; index++) { |
649 | if (e.detail.value === mpList[index].name) { | 474 | if (e.detail.value === mpList[index].name) { |
650 | this.isDataName = true | 475 | this.isDataName = true |
651 | uni.showModal({ | 476 | uni.showModal({ |
652 | title: '提示', | 477 | title: '提示', |
653 | content: `是否填充已有的"${e.detail.value}"的数据`, | 478 | content: `是否填充已有的"${e.detail.value}"的数据`, |
654 | success: ({ confirm }) => { | 479 | success: (res) => { |
655 | if (confirm) { | 480 | if (res.confirm) { |
656 | this.kinds=2 | 481 | this.kinds=2 |
657 | console.log('args===>',index) | 482 | console.log('args===>',index) |
658 | // const mpList=Object.assign({},this.$store.state.mympList.mpList) | 483 | // const mpList=Object.assign({},this.$store.state.mympList.mpList) |
659 | console.log('mpList===>',mpList) | 484 | console.log('mpList===>',mpList) |
660 | this.name=mpList[index].name | 485 | this.name=mpList[index].name |
661 | this.pd=mpList[index].pd | 486 | this.pd=mpList[index].pd |
662 | this.mp_id=mpList[index].mp_id | 487 | this.mp_id=mpList[index].mp_id |
663 | this.oldname=mpList[index].name | 488 | this.oldname=mpList[index].name |
664 | this.oldpd=mpList[index].pd | 489 | this.oldpd=mpList[index].pd |
665 | // 将kinds =2时的值传到该页面 | 490 | // 将kinds =2时的值传到该页面 |
666 | this.pickerInfoList[0].nameArray1.unshift(mpList[index].leftSph) | 491 | this.pickerInfoList[0].nameArray1.unshift(mpList[index].leftSph) |
667 | this.pickerInfoList[0].nameArray2.unshift(mpList[index].rightSph) | 492 | this.pickerInfoList[0].nameArray2.unshift(mpList[index].rightSph) |
668 | this.pickerInfoList[1].nameArray1.unshift(mpList[index].leftCyl) | 493 | this.pickerInfoList[1].nameArray1.unshift(mpList[index].leftCyl) |
669 | this.pickerInfoList[1].nameArray2.unshift(mpList[index].rightCyl) | 494 | this.pickerInfoList[1].nameArray2.unshift(mpList[index].rightCyl) |
670 | this.pickerInfoList[2].nameArray1.unshift(mpList[index].leftAxi) | 495 | this.pickerInfoList[2].nameArray1.unshift(mpList[index].leftAxi) |
671 | this.pickerInfoList[2].nameArray2.unshift(mpList[index].rightAxi) | 496 | this.pickerInfoList[2].nameArray2.unshift(mpList[index].rightAxi) |
672 | 497 | ||
673 | this.pickerInfoList[3].nameArray1.unshift(mpList[index].in_time.toString().slice(0,4)) | 498 | this.pickerInfoList[3].nameArray1.unshift(mpList[index].in_time.toString().slice(0,4)) |
674 | if(mpList[index].in_time.toString().slice(5,6)==0){ | 499 | if(mpList[index].in_time.toString().slice(5,6)==0){ |
675 | this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(6,7)) | 500 | this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(6,7)) |
676 | } else{ | 501 | } else{ |
677 | this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(5,7)) | 502 | this.pickerInfoList[3].nameArray2.unshift(mpList[index].in_time.toString().slice(5,7)) |
678 | } | 503 | } |
679 | if(mpList[index].in_time.toString().slice(8,9)==0){ | 504 | if(mpList[index].in_time.toString().slice(8,9)==0){ |
680 | this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(9,10)) | 505 | this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(9,10)) |
681 | } else{ | 506 | } else{ |
682 | this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(8,10)) | 507 | this.pickerInfoList[3].nameArray3.unshift(mpList[index].in_time.toString().slice(8,10)) |
683 | } | 508 | } |
684 | // this.checkedData = mpList[index] | 509 | // this.checkedData = mpList[index] |
685 | // console.log('checkedData', this.checkedData) | 510 | // console.log('checkedData', this.checkedData) |
686 | } | 511 | } else if(res.cancel){ |
512 | this.kinds=2 | ||
513 | } | ||
687 | } | 514 | } |
688 | }) | 515 | }) |
689 | } | 516 | } |
690 | } | 517 | } |
691 | }, | 518 | }, |
692 | handleInputPd(e){ | 519 | handleInputPd(e){ |
693 | // 只能输入正浮点数或正数 | 520 | // 只能输入正浮点数或正数 |
694 | if(/^\d+(\.\d+)?$/.test(e.target.value)){ | 521 | if(/^\d+(\.\d+)?$/.test(e.target.value)){ |
695 | this.pd=e.target.value | 522 | this.pd=e.target.value |
696 | } else { | 523 | } else { |
697 | uni.showToast({ | 524 | uni.showToast({ |
698 | title:"请输入有效数据;示例:89", | 525 | title:"请输入有效数据;示例:89", |
699 | icon: "none", | 526 | icon: "none", |
700 | duration: 2000, | 527 | duration: 2000, |
701 | }) | 528 | }) |
702 | this.pd = '' | 529 | this.pd = '' |
703 | } | 530 | } |
704 | 531 | ||
705 | }, | 532 | }, |
706 | changeConfirm() { | 533 | changeConfirm() { |
707 | this.confirm = !this.confirm | 534 | this.confirm = !this.confirm |
708 | }, | 535 | }, |
709 | bindPickerChange01: function(e) { | 536 | bindPickerChange01: function(e) { |
710 | this.pickerInfoList[0].nameIndex1 = e.target.value | 537 | this.pickerInfoList[0].nameIndex1 = e.target.value |
711 | this.pickerInfoChioce.leftSph=this.pickerInfoList[0].nameArray1[e.target.value] | 538 | this.pickerInfoChioce.leftSph=this.pickerInfoList[0].nameArray1[e.target.value] |
712 | }, | 539 | }, |
713 | bindPickerChange02: function(e) { | 540 | bindPickerChange02: function(e) { |
714 | this.pickerInfoList[0].nameIndex2 = e.target.value | 541 | this.pickerInfoList[0].nameIndex2 = e.target.value |
715 | this.pickerInfoChioce.rightSph=this.pickerInfoList[0].nameArray2[e.target.value] | 542 | this.pickerInfoChioce.rightSph=this.pickerInfoList[0].nameArray2[e.target.value] |
716 | }, | 543 | }, |
717 | 544 | ||
718 | bindPickerChange11: function(e) { | 545 | bindPickerChange11: function(e) { |
719 | this.pickerInfoList[1].nameIndex1 = e.target.value | 546 | this.pickerInfoList[1].nameIndex1 = e.target.value |
720 | this.pickerInfoChioce.leftCyl=this.pickerInfoList[1].nameArray1[e.target.value] | 547 | this.pickerInfoChioce.leftCyl=this.pickerInfoList[1].nameArray1[e.target.value] |
721 | }, | 548 | }, |
722 | bindPickerChange12: function(e) { | 549 | bindPickerChange12: function(e) { |
723 | this.pickerInfoList[1].nameIndex2 = e.target.value | 550 | this.pickerInfoList[1].nameIndex2 = e.target.value |
724 | this.pickerInfoChioce.rightCyl=this.pickerInfoList[1].nameArray2[e.target.value] | 551 | this.pickerInfoChioce.rightCyl=this.pickerInfoList[1].nameArray2[e.target.value] |
725 | }, | 552 | }, |
726 | 553 | ||
727 | bindPickerChange21: function(e) { | 554 | bindPickerChange21: function(e) { |
728 | this.pickerInfoList[2].nameIndex1 = e.target.value | 555 | this.pickerInfoList[2].nameIndex1 = e.target.value |
729 | this.pickerInfoChioce.leftAxi=this.pickerInfoList[2].nameArray1[e.target.value] | 556 | this.pickerInfoChioce.leftAxi=this.pickerInfoList[2].nameArray1[e.target.value] |
730 | }, | 557 | }, |
731 | bindPickerChange22: function(e) { | 558 | bindPickerChange22: function(e) { |
732 | this.pickerInfoList[2].nameIndex2 = e.target.value | 559 | this.pickerInfoList[2].nameIndex2 = e.target.value |
733 | this.pickerInfoChioce.rightAxi=this.pickerInfoList[2].nameArray2[e.target.value] | 560 | this.pickerInfoChioce.rightAxi=this.pickerInfoList[2].nameArray2[e.target.value] |
734 | }, | 561 | }, |
735 | 562 | ||
736 | bindPickerChange41: function(e) { | 563 | bindPickerChange41: function(e) { |
737 | this.pickerInfoList[3].nameIndex1 = e.target.value | 564 | this.pickerInfoList[3].nameIndex1 = e.target.value |
738 | this.pickerInfoChioce.time.year=this.pickerInfoList[3].nameArray1[e.target.value] | 565 | this.pickerInfoChioce.time.year=this.pickerInfoList[3].nameArray1[e.target.value] |
739 | }, | 566 | }, |
740 | bindPickerChange42: function(e) { | 567 | bindPickerChange42: function(e) { |
741 | this.pickerInfoList[3].nameIndex2 = e.target.value | 568 | this.pickerInfoList[3].nameIndex2 = e.target.value |
742 | this.pickerInfoChioce.time.month=this.pickerInfoList[3].nameArray2[e.target.value] | 569 | this.pickerInfoChioce.time.month=this.pickerInfoList[3].nameArray2[e.target.value] |
743 | }, | 570 | }, |
744 | bindPickerChange43: function(e) { | 571 | bindPickerChange43: function(e) { |
745 | this.pickerInfoList[3].nameIndex3 = e.target.value | 572 | this.pickerInfoList[3].nameIndex3 = e.target.value |
746 | this.pickerInfoChioce.time.day=this.pickerInfoList[3].nameArray3[e.target.value] | 573 | this.pickerInfoChioce.time.day=this.pickerInfoList[3].nameArray3[e.target.value] |
747 | }, | 574 | }, |
748 | 575 | ||
749 | // 是否填充人员数据 | ||
750 | // fillData(e) { | ||
751 | // this.isDataName = false | ||
752 | // console.log('e---->', e) | ||
753 | // const mpList = this.mpList | ||
754 | |||
755 | // <<<<<<< HEAD | ||
756 | // for (let index = 0; index < mpList.length; index++) { | ||
757 | // if (e.detail.value === mpList[index].name) { | ||
758 | // this.isDataName = true | ||
759 | // uni.showModal({ | ||
760 | // title: '提示', | ||
761 | // content: `是否填充已有的${e.detail.value}的数据`, | ||
762 | // success: ({ confirm }) => { | ||
763 | // if (confirm) { | ||
764 | // this.checkedData = mpList[index] | ||
765 | // console.log('checkedData', this.checkedData) | ||
766 | // } | ||
767 | // } | ||
768 | // }) | ||
769 | // } | ||
770 | // } | ||
771 | // }, | ||
772 | // ======= | ||
773 | // for (let index = 0; index < mpList.length; index++) { | ||
774 | // if (e.detail.value === mpList[index].name) { | ||
775 | // this.isDataName = true | ||
776 | // uni.showModal({ | ||
777 | // title: '提示', | ||
778 | // content: `是否自动填充已保存的${e.detail.value}的数据`, | ||
779 | // success: ({ confirm }) => { | ||
780 | // if (confirm) { | ||
781 | // this.checkedData = mpList[index] | ||
782 | // console.log('checkedData', this.checkedData) | ||
783 | // } | ||
784 | // } | ||
785 | // }) | ||
786 | // } | ||
787 | // } | ||
788 | // }, | ||
789 | // // 确认验光数据 | ||
790 | // changeConfirm() { | ||
791 | |||
792 | // }, | ||
793 | // >>>>>>> 3a0878cc773855146d390a935b133980a5c0ee88 | ||
794 | change(num) { | 576 | change(num) { |
795 | this.show[num] = !this.show[num] | 577 | this.show[num] = !this.show[num] |
796 | this.$forceUpdate() | 578 | this.$forceUpdate() |
797 | }, | 579 | }, |
798 | onClickItem(index, i) { | 580 | onClickItem(index, i) { |
799 | if (this.current[index] !== i) { | 581 | if (this.current[index] !== i) { |
800 | this.current[index] = i | 582 | this.current[index] = i |
801 | } | 583 | } |
802 | this.$forceUpdate() | 584 | this.$forceUpdate() |
803 | }, | 585 | }, |
804 | onClickItem1(index) { | 586 | onClickItem1(index) { |
805 | if (this.current1 !== index) { | 587 | if (this.current1 !== index) { |
806 | this.current1 = index | 588 | this.current1 = index |
807 | this.chooseRes1 = this.chooseItem1[index].describ | 589 | this.chooseRes1 = this.chooseItem1[index].describ |
808 | } | 590 | } |
809 | }, | 591 | }, |
810 | onClickItem2(index) { | 592 | onClickItem2(index) { |
811 | if (this.current2 !== index) { | 593 | if (this.current2 !== index) { |
812 | this.current2 = index | 594 | this.current2 = index |
813 | this.chooseRes2 = this.chooseItem2[index].num | 595 | this.chooseRes2 = this.chooseItem2[index].num |
814 | } | 596 | } |
815 | }, | 597 | }, |
816 | onClickItem3(index) { | 598 | onClickItem3(index) { |
817 | if (this.current3 !== index) { | 599 | if (this.current3 !== index) { |
818 | this.current3 = index | 600 | this.current3 = index |
819 | this.chooseRes3 = this.chooseItem3[index] | 601 | this.chooseRes3 = this.chooseItem3[index] |
820 | } | 602 | } |
821 | }, | 603 | }, |
822 | counter(isadd) { | 604 | counter(isadd) { |
823 | if (isadd) { | 605 | if (isadd) { |
824 | this.count >= this.maxCount ? this.addDisabled = true : this.count++ | 606 | this.count >= this.maxCount ? this.addDisabled = true : this.count++ |
825 | } else { | 607 | } else { |
826 | this.count <= 1 ? this.desDisabled = true : this.count-- | 608 | this.count <= 1 ? this.desDisabled = true : this.count-- |
827 | } | 609 | } |
828 | }, | 610 | }, |
829 | toComfirmOrder() { | 611 | toComfirmOrder() { |
830 | // 先处理验光部分的逻辑,如果ok在跳转 | 612 | // 先处理验光部分的逻辑,如果ok在跳转 |
831 | let flag=0; | 613 | let flag=0; |
832 | if(this.name==''){ | 614 | if(this.name==''){ |
833 | uni.showToast({ | 615 | uni.showToast({ |
834 | title:"请输入验光单取名", | 616 | title:"请输入验光单取名", |
835 | icon: "none", | 617 | icon: "none", |
836 | duration: 2000, | 618 | duration: 2000, |
837 | }) | 619 | }) |
838 | }else{ | 620 | }else{ |
839 | 621 | ||
840 | if(this.pd==''){ | 622 | if(this.pd==''){ |
841 | uni.showToast({ | 623 | uni.showToast({ |
842 | title:"请输入瞳距", | 624 | title:"请输入瞳距", |
843 | icon: "none", | 625 | icon: "none", |
844 | duration: 2000, | 626 | duration: 2000, |
845 | }) | 627 | }) |
846 | }else{ | 628 | }else{ |
847 | 629 | ||
848 | if(this.kinds==1){ | 630 | if(this.kinds==1){ |
849 | // 添加用户验光单 | 631 | // 添加用户验光单 |
850 | console.log('kinds====>',this.pickerInfoChioce.leftSph) | 632 | console.log('kinds====>',this.pickerInfoChioce.leftSph) |
851 | console.log('kinds====>',this.pickerInfoChioce.leftSph==Number) | 633 | console.log('kinds====>',this.pickerInfoChioce.leftSph==Number) |
852 | console.log('kinds====>',this.pickerInfoChioce.rightSph==Number) | 634 | console.log('kinds====>',this.pickerInfoChioce.rightSph==Number) |
853 | if(this.pickerInfoChioce.rightSph==''||this.pickerInfoChioce.leftSph==''|| | 635 | if(this.pickerInfoChioce.rightSph==''||this.pickerInfoChioce.leftSph==''|| |
854 | this.pickerInfoChioce.leftCyl==''||this.pickerInfoChioce.rightCyl==''|| | 636 | this.pickerInfoChioce.leftCyl==''||this.pickerInfoChioce.rightCyl==''|| |
855 | this.pickerInfoChioce.leftAxi==''||this.pickerInfoChioce.rightAxi=='' | 637 | this.pickerInfoChioce.leftAxi==''||this.pickerInfoChioce.rightAxi=='' |
856 | ){ | 638 | ){ |
857 | uni.showToast({ | 639 | uni.showToast({ |
858 | title:"请输入您的验光数据", | 640 | title:"请输入您的验光数据", |
859 | icon: "none", | 641 | icon: "none", |
860 | duration: 2000, | 642 | duration: 2000, |
861 | }) | 643 | }) |
862 | }else{ | 644 | }else{ |
863 | if(this.confirm){ | 645 | if(this.confirm){ |
864 | store.dispatch('myLoveList/addMylove', { | 646 | store.dispatch('myLoveList/addMylove', { |
865 | uid: this.$store.state.user.userInfo.uid, | 647 | uid: this.$store.state.user.userInfo.uid, |
866 | openid: this.$store.state.user.userInfo.openid, | 648 | openid: this.$store.state.user.userInfo.openid, |
867 | // mp_name: this.$store.state.user.userInfo.mp_name, | 649 | // mp_name: this.$store.state.user.userInfo.mp_name, |
868 | leftSph: this.pickerInfoChioce.leftSph, | 650 | leftSph: this.pickerInfoChioce.leftSph, |
869 | rightSph: this.pickerInfoChioce.rightSph, | 651 | rightSph: this.pickerInfoChioce.rightSph, |
870 | leftCyl: this.pickerInfoChioce.leftCyl, | 652 | leftCyl: this.pickerInfoChioce.leftCyl, |
871 | rightCyl: this.pickerInfoChioce.rightCyl, | 653 | rightCyl: this.pickerInfoChioce.rightCyl, |
872 | leftAxi: this.pickerInfoChioce.leftAxi, | 654 | leftAxi: this.pickerInfoChioce.leftAxi, |
873 | rightAxi: this.pickerInfoChioce.rightAxi, | 655 | rightAxi: this.pickerInfoChioce.rightAxi, |
874 | pd: this.pd,// 瞳距 | 656 | pd: this.pd,// 瞳距 |
875 | mp_name:this.name, | 657 | mp_name:this.name, |
876 | // time: this.pickerInfoChioce.time, | 658 | // time: this.pickerInfoChioce.time, |
877 | // img_url2: "http://localhost:8087/images/shop_1/1/", | 659 | // img_url2: "http://localhost:8087/images/shop_1/1/", |
878 | }); | 660 | }); |
879 | store.dispatch('myLoveList/getLoveList', { | ||
880 | uid: this.$store.state.user.userInfo.uid, | ||
881 | }); | ||
882 | flag=1 | 661 | flag=1 |
883 | } else{ | 662 | } else{ |
884 | uni.showToast({ | 663 | uni.showToast({ |
885 | title:"请确认您的验光数据", | 664 | title:"请确认您的验光数据", |
886 | icon: "none", | 665 | icon: "none", |
887 | duration: 3000, | 666 | duration: 3000, |
888 | }) | 667 | }) |
889 | } | 668 | } |
890 | } | 669 | } |
891 | } | 670 | } |
892 | if(this.kinds==2){ | 671 | if(this.kinds==2){ |
893 | // console.log('kinds====>',this.kinds) | 672 | // console.log('kinds====>',this.kinds) |
894 | // console.log('pickerindex=====>',this.pickerInfoList[0].nameIndex1) | 673 | // console.log('pickerindex=====>',this.pickerInfoList[0].nameIndex1) |
895 | // console.log('this.pickerInfoChioce====>',type(this.pickerInfoChioce)) | 674 | // console.log('this.pickerInfoChioce====>',type(this.pickerInfoChioce)) |
896 | if(this.confirm){ | 675 | if(this.confirm){ |
897 | const leftList = ["leftSph","leftCyl","leftAxi"]; | 676 | const leftList = ["leftSph","leftCyl","leftAxi"]; |
898 | const rightList = ["rightSph", "rightCyl", "rightAxi"]; | 677 | const rightList = ["rightSph", "rightCyl", "rightAxi"]; |
899 | // let flag=0; | 678 | // let flag=0; |
900 | if(this.name!=this.oldname){ | 679 | if(this.name!=this.oldname){ |
901 | store.dispatch('myLoveList/updateMylove', { | 680 | store.dispatch('myLoveList/updateMylove', { |
902 | uid: this.$store.state.user.userInfo.uid, | 681 | uid: this.$store.state.user.userInfo.uid, |
903 | openid: this.$store.state.user.userInfo.openid, | 682 | openid: this.$store.state.user.userInfo.openid, |
904 | mp_id: this.mp_id, | 683 | mp_id: this.mp_id, |
905 | keyname: 'name', | 684 | keyname: 'name', |
906 | keyvalue: this.name, | 685 | keyvalue: this.name, |
907 | }); | 686 | }); |
908 | flag=1 | 687 | flag=1 |
909 | } | 688 | } |
910 | if(this.pd!=this.oldpd){ | 689 | if(this.pd!=this.oldpd){ |
911 | store.dispatch('myLoveList/updateMylove', { | 690 | store.dispatch('myLoveList/updateMylove', { |
912 | uid: this.$store.state.user.userInfo.uid, | 691 | uid: this.$store.state.user.userInfo.uid, |
913 | openid: this.$store.state.user.userInfo.openid, | 692 | openid: this.$store.state.user.userInfo.openid, |
914 | mp_id: this.mp_id, | 693 | mp_id: this.mp_id, |
915 | keyname: 'pd', | 694 | keyname: 'pd', |
916 | keyvalue: this.pd, | 695 | keyvalue: this.pd, |
917 | }); | 696 | }); |
918 | flag=1 | 697 | flag=1 |
919 | } | 698 | } |
920 | // 先验证是否输入有无空 | 699 | // 先验证是否输入有无空 |
921 | let q= true; | 700 | let q= true; |
922 | for(let k=0; k<3;k++){ | 701 | for(let k=0; k<3;k++){ |
923 | q=q&&(this.pickerInfoList[k].nameArray1[this.pickerInfoList[k].nameIndex1]!=''&& | 702 | q=q&&(this.pickerInfoList[k].nameArray1[this.pickerInfoList[k].nameIndex1]!=''&& |
924 | this.pickerInfoList[k].nameArray2[this.pickerInfoList[k].nameIndex2]!='') | 703 | this.pickerInfoList[k].nameArray2[this.pickerInfoList[k].nameIndex2]!='') |
925 | } | 704 | } |
926 | if(q){ | 705 | if(q){ |
927 | 706 | ||
928 | for (let j=0; j<3; j++) { | 707 | for (let j=0; j<3; j++) { |
929 | if(this.pickerInfoList[j].nameIndex1!=0){ | 708 | if(this.pickerInfoList[j].nameIndex1!=0){ |
930 | store.dispatch('myLoveList/updateMylove', { | 709 | store.dispatch('myLoveList/updateMylove', { |
931 | uid: this.$store.state.user.userInfo.uid, | 710 | uid: this.$store.state.user.userInfo.uid, |
932 | openid: this.$store.state.user.userInfo.openid, | 711 | openid: this.$store.state.user.userInfo.openid, |
933 | mp_id: this.mp_id, | 712 | mp_id: this.mp_id, |
934 | keyname: leftList[j], | 713 | keyname: leftList[j], |
935 | keyvalue: this.pickerInfoList[j].nameArray1[this.pickerInfoList[j].nameIndex1], | 714 | keyvalue: this.pickerInfoList[j].nameArray1[this.pickerInfoList[j].nameIndex1], |
936 | }); | 715 | }); |
937 | } | 716 | } |
938 | if(this.pickerInfoList[j].nameIndex2!=0){ | 717 | if(this.pickerInfoList[j].nameIndex2!=0){ |
939 | store.dispatch('myLoveList/updateMylove', { | 718 | store.dispatch('myLoveList/updateMylove', { |
940 | uid: this.$store.state.user.userInfo.uid, | 719 | uid: this.$store.state.user.userInfo.uid, |
941 | openid: this.$store.state.user.userInfo.openid, | 720 | openid: this.$store.state.user.userInfo.openid, |
942 | mp_id: this.mp_id, | 721 | mp_id: this.mp_id, |
943 | keyname: rightList[j], | 722 | keyname: rightList[j], |
944 | keyvalue: this.pickerInfoList[j].nameArray2[this.pickerInfoList[j].nameIndex2] | 723 | keyvalue: this.pickerInfoList[j].nameArray2[this.pickerInfoList[j].nameIndex2] |
945 | }); | 724 | }); |
946 | } | 725 | } |
947 | flag=1; | 726 | flag=1; |
948 | } | 727 | } |
949 | }else{ | 728 | }else{ |
950 | flag=0; | 729 | flag=0; |
951 | uni.showToast({ | 730 | uni.showToast({ |
952 | title:"请输入您的验光数据", | 731 | title:"请输入您的验光数据", |
953 | icon: "none", | 732 | icon: "none", |
954 | duration: 2000, | 733 | duration: 2000, |
955 | }) | 734 | }) |
956 | 735 | ||
957 | } | 736 | } |
958 | if(flag!=0){ | 737 | if(flag!=0){ |
959 | store.dispatch('myLoveList/getLoveList', { | 738 | store.dispatch('myLoveList/getLoveList', { |
960 | uid: this.$store.state.user.userInfo.uid, | 739 | uid: this.$store.state.user.userInfo.uid, |
961 | }); | 740 | }); |
962 | } | 741 | } |
963 | 742 | ||
964 | } else{ | 743 | } else{ |
965 | uni.showToast({ | 744 | uni.showToast({ |
966 | title:"请确认您的验光数据", | 745 | title:"请确认您的验光数据", |
967 | icon: "none", | 746 | icon: "none", |
968 | duration: 3000, | 747 | duration: 3000, |
969 | }) | 748 | }) |
970 | } | 749 | } |
971 | } | 750 | } |
972 | } | 751 | } |
973 | 752 | ||
974 | } | 753 | } |
975 | if(flag!=0){ | 754 | if(flag!=0){ |
755 | // 如果数据验证无误,那么更新验光单的数据 | ||
756 | store.dispatch('myLoveList/getLoveList', { | ||
757 | uid: this.$store.state.user.userInfo.uid, | ||
758 | }); | ||
976 | let i = 0 | 759 | let i = 0 |
977 | // 判断出是哪一个sku被选中 | 760 | // 判断出是哪一个sku被选中 |
978 | for (let index = 0; index < this.current.length; index++) { | 761 | for (let index = 0; index < this.current.length; index++) { |
979 | console.log('index', index, i, index !== this.current.length - 1) | 762 | console.log('index', index, i, index !== this.current.length - 1) |
980 | if (index !== this.current.length - 1) { | 763 | if (index !== this.current.length - 1) { |
981 | console.log('----', this.current[index], this.attrList[1].attr.length, this.attrList) | 764 | console.log('----', this.current[index], this.attrList[1].attr.length, this.attrList) |
982 | i = this.current[index] * this.attrList[1].attr.length | 765 | i = this.current[index] * this.attrList[1].attr.length |
983 | } else { | 766 | } else { |
984 | i += this.current[index] | 767 | i += this.current[index] |
985 | } | 768 | } |
986 | console.log('i', i) | 769 | console.log('i', i) |
987 | } | 770 | } |
988 | console.log('i------>', i) | 771 | console.log('i------>', i) |
989 | // 判断是否其输入的人员数据是否已存在 | 772 | // 判断是否其输入的人员数据是否已存在 |
990 | store.dispatch('order/saveParams', { | 773 | store.dispatch('order/saveParams', { |
991 | sk_id_arr: this.skuList[i], | 774 | sk_id_arr: this.skuList[i], |
992 | current: this.current | 775 | current: this.current |
993 | }) | 776 | }) |
994 | 777 | ||
995 | uni.navigateTo({ | 778 | uni.navigateTo({ |
996 | url: `../confirmOrder/confirmOrder?pid=${this.pid}` | 779 | url: `../confirmOrder/confirmOrder?pid=${this.pid}` |
997 | }) | 780 | }) |
998 | } | 781 | } |
999 | 782 | ||
1000 | } | 783 | } |
1001 | } | 784 | } |
1002 | } | 785 | } |
1003 | </script> | 786 | </script> |
1004 | 787 | ||
1005 | <style lang="scss"> | 788 | <style lang="scss"> |
1006 | .content { | 789 | .content { |
1007 | min-height: 100vh; | 790 | min-height: 100vh; |
1008 | background-color: #f2f2f2; | 791 | background-color: #f2f2f2; |
1009 | // padding-top: 20rpx; | 792 | // padding-top: 20rpx; |
1010 | .goodInfo { | 793 | .goodInfo { |
1011 | width: 100%; | 794 | width: 100%; |
1012 | height: 272rpx; | 795 | height: 272rpx; |
1013 | border-radius: 16rpx; | 796 | border-radius: 16rpx; |
1014 | background-color: #ffffff; | 797 | background-color: #ffffff; |
1015 | box-sizing: border-box; | 798 | box-sizing: border-box; |
1016 | padding: 36rpx; | 799 | padding: 36rpx; |
1017 | display: flex; | 800 | display: flex; |
1018 | flex-direction: row; | 801 | flex-direction: row; |
1019 | justify-content: flex-start; | 802 | justify-content: flex-start; |
1020 | .imageWrap { | 803 | .imageWrap { |
1021 | height: 188rpx; | 804 | height: 188rpx; |
1022 | width: 188rpx; | 805 | width: 188rpx; |
1023 | margin-right: 28rpx; | 806 | margin-right: 28rpx; |
1024 | image { | 807 | image { |
1025 | height: 188rpx; | 808 | height: 188rpx; |
1026 | width: 188rpx; | 809 | width: 188rpx; |
1027 | } | 810 | } |
1028 | } | 811 | } |
1029 | .infoRight { | 812 | .infoRight { |
1030 | display: flex; | 813 | display: flex; |
1031 | flex-direction: column; | 814 | flex-direction: column; |
1032 | align-items: flex-start; | 815 | align-items: flex-start; |
1033 | justify-content: space-between; | 816 | justify-content: space-between; |
1034 | .goodName { | 817 | .goodName { |
1035 | font-size: 28rpx; | 818 | font-size: 28rpx; |
1036 | color: #333333; | 819 | color: #333333; |
1037 | } | 820 | } |
1038 | .remarks { | 821 | .remarks { |
1039 | font-size: 20rpx; | 822 | font-size: 20rpx; |
1040 | color: #999999; | 823 | color: #999999; |
1041 | } | 824 | } |
1042 | .priceBox { | 825 | .priceBox { |
1043 | display: flex; | 826 | display: flex; |
1044 | justify-content: space-between; | 827 | justify-content: space-between; |
1045 | align-items: center; | 828 | align-items: center; |
1046 | width: 100%; | 829 | width: 100%; |
1047 | font-size: 14px; | 830 | font-size: 14px; |
1048 | color: #999999; | 831 | color: #999999; |
1049 | .price { | 832 | .price { |
1050 | color: #ff6b4a; | 833 | color: #ff6b4a; |
1051 | font-size: 28rpx; | 834 | font-size: 28rpx; |
1052 | } | 835 | } |
1053 | .counter { | 836 | .counter { |
1054 | display: flex; | 837 | display: flex; |
1055 | flex-direction: row; | 838 | flex-direction: row; |
1056 | justify-content: space-between; | 839 | justify-content: space-between; |
1057 | align-items: center; | 840 | align-items: center; |
1058 | font-size: 28rpx; | 841 | font-size: 28rpx; |
1059 | color: #333333; | 842 | color: #333333; |
1060 | width: 122rpx; | 843 | width: 122rpx; |
1061 | .btn { | 844 | .btn { |
1062 | display: flex; | 845 | display: flex; |
1063 | justify-content: center; | 846 | justify-content: center; |
1064 | line-height: 32rpx; | 847 | line-height: 32rpx; |
1065 | height: 32rpx; | 848 | height: 32rpx; |
1066 | width: 32rpx; | 849 | width: 32rpx; |
1067 | background-color: #f2f2f2; | 850 | background-color: #f2f2f2; |
1068 | color: #cfcfcf; | 851 | color: #cfcfcf; |
1069 | } | 852 | } |
1070 | } | 853 | } |
1071 | } | 854 | } |
1072 | } | 855 | } |
1073 | } | 856 | } |
1074 | .goods-data { | 857 | .goods-data { |
1075 | width: 100%; | 858 | width: 100%; |
1076 | box-sizing: border-box; | 859 | box-sizing: border-box; |
1077 | padding: 37rpx 40rpx 0 40rpx; | 860 | padding: 37rpx 40rpx 0 40rpx; |
1078 | background: #ffffff; | 861 | background: #ffffff; |
1079 | border-radius: 12rpx; | 862 | border-radius: 12rpx; |
1080 | .opCollapse { | 863 | .opCollapse { |
1081 | width: 100%; | 864 | width: 100%; |
1082 | padding-bottom: 28rpx; | 865 | padding-bottom: 28rpx; |
1083 | margin-top: 7px; | 866 | margin-top: 7px; |
1084 | border-bottom: 1px solid #e9e9e9; | 867 | border-bottom: 1px solid #e9e9e9; |
1085 | .head { | 868 | .head { |
1086 | display: flex; | 869 | display: flex; |
1087 | justify-content: space-between; | 870 | justify-content: space-between; |
1088 | height: 24px; | 871 | height: 24px; |
1089 | // font-family: PingFangSC-Medium; | 872 | // font-family: PingFangSC-Medium; |
1090 | font-size: 16px; | 873 | font-size: 16px; |
1091 | color: #333333; | 874 | color: #333333; |
1092 | letter-spacing: -0.3px; | 875 | letter-spacing: -0.3px; |
1093 | text-align: justify; | 876 | text-align: justify; |
1094 | line-height: 24px; | 877 | line-height: 24px; |
1095 | margin-bottom: 18rpx; | 878 | margin-bottom: 18rpx; |
1096 | .headRighted { | 879 | .headRighted { |
1097 | width: 0; | 880 | width: 0; |
1098 | height: 0; | 881 | height: 0; |
1099 | border-left: 4px solid transparent; | 882 | border-left: 4px solid transparent; |
1100 | border-right: 4px solid transparent; | 883 | border-right: 4px solid transparent; |
1101 | border-bottom: 4px solid #cfcfcf; | 884 | border-bottom: 4px solid #cfcfcf; |
1102 | transform: scaleY(-1); | 885 | transform: scaleY(-1); |
1103 | margin-top: 10px; | 886 | margin-top: 10px; |
1104 | } | 887 | } |
1105 | .headMid { | 888 | .headMid { |
1106 | // font-family: PingFangSC-Regular; | 889 | // font-family: PingFangSC-Regular; |
1107 | font-size: 10px; | 890 | font-size: 10px; |
1108 | color: #999999; | 891 | color: #999999; |
1109 | letter-spacing: -0.19px; | 892 | letter-spacing: -0.19px; |
1110 | margin-left: -120rpx; | 893 | margin-left: -120rpx; |
1111 | } | 894 | } |
1112 | .headRight { | 895 | .headRight { |
1113 | width: 0; | 896 | width: 0; |
1114 | height: 0; | 897 | height: 0; |
1115 | border-left: 4px solid transparent; | 898 | border-left: 4px solid transparent; |
1116 | border-right: 4px solid transparent; | 899 | border-right: 4px solid transparent; |
1117 | border-bottom: 4px solid #cfcfcf; | 900 | border-bottom: 4px solid #cfcfcf; |
1118 | margin-top: 10px; | 901 | margin-top: 10px; |
1119 | } | 902 | } |
1120 | } | 903 | } |
1121 | .body { | 904 | .body { |
1122 | // font-family: PingFangSC-Regular; | 905 | // font-family: PingFangSC-Regular; |
1123 | font-size: 12px; | 906 | font-size: 12px; |
1124 | color: #666666; | 907 | color: #666666; |
1125 | letter-spacing: 0; | 908 | letter-spacing: 0; |
1126 | .bodyBox { | 909 | .bodyBox { |
1127 | margin-top: 15px; | 910 | margin-top: 15px; |
1128 | .names { | 911 | .names { |
1129 | // font-family: PingFangSC-Regular; | 912 | // font-family: PingFangSC-Regular; |
1130 | font-size: 12px; | 913 | font-size: 12px; |
1131 | color: #151515; | 914 | color: #151515; |
1132 | letter-spacing: 0; | 915 | letter-spacing: 0; |
1133 | text-align: justify; | 916 | text-align: justify; |
1134 | line-height: 17px; | 917 | line-height: 17px; |
1135 | margin-left: 5px; | 918 | margin-left: 5px; |
1136 | margin-right: 10px; | 919 | margin-right: 10px; |
1137 | } | 920 | } |
1138 | text { | 921 | text { |
1139 | // font-family: PingFangSC-Regular; | 922 | // font-family: PingFangSC-Regular; |
1140 | font-size: 12px; | 923 | font-size: 12px; |
1141 | color: #666666; | 924 | color: #666666; |
1142 | letter-spacing: 0; | 925 | letter-spacing: 0; |
1143 | text-align: justify; | 926 | text-align: justify; |
1144 | } | 927 | } |
1145 | } | 928 | } |
1146 | } | 929 | } |
1147 | 930 | ||
1148 | // .goods-form { | 931 | // .goods-form { |
1149 | // display: flex; | 932 | // display: flex; |
1150 | // flex-direction: column; | 933 | // flex-direction: column; |
1151 | // align-items: center; | 934 | // align-items: center; |
1152 | // justify-content: center; | 935 | // justify-content: center; |
1153 | // background-color: #fff; | 936 | // background-color: #fff; |
1154 | // width: 100%; | 937 | // width: 100%; |
1155 | // .p1 { | 938 | // .p1 { |
1156 | // font-size: 16px; | 939 | // font-size: 16px; |
1157 | // color: #333333; | 940 | // color: #333333; |
1158 | // letter-spacing: -0.3px; | 941 | // letter-spacing: -0.3px; |
1159 | // text-align: justify; | 942 | // text-align: justify; |
1160 | // line-height: 24px; | 943 | // line-height: 24px; |
1161 | // margin: 4px 0; | 944 | // margin: 4px 0; |
1162 | // } | 945 | // } |
1163 | // .p2 { | 946 | // .p2 { |
1164 | // font-size: 12px; | 947 | // font-size: 12px; |
1165 | // color: #999999; | 948 | // color: #999999; |
1166 | // letter-spacing: -0.23px; | 949 | // letter-spacing: -0.23px; |
1167 | // margin-bottom: 18rpx; | 950 | // margin-bottom: 18rpx; |
1168 | // } | 951 | // } |
1169 | // image { | 952 | // image { |
1170 | // width: 28rpx; | 953 | // width: 28rpx; |
1171 | // height: 26rpx; | 954 | // height: 26rpx; |
1172 | // } | 955 | // } |
1173 | // .confirm { | 956 | // .confirm { |
1174 | // display: flex; | 957 | // display: flex; |
1175 | // align-items: center; | 958 | // align-items: center; |
1176 | // font-size: 12px; | 959 | // font-size: 12px; |
1177 | // color: #666666; | 960 | // color: #666666; |
1178 | // letter-spacing: -0.23px; | 961 | // letter-spacing: -0.23px; |
1179 | // width: 684rpx; | 962 | // width: 684rpx; |
1180 | // image { | 963 | // image { |
1181 | // margin-right: 25rpx; | 964 | // margin-right: 25rpx; |
1182 | // } | 965 | // } |
1183 | // } | 966 | // } |
1184 | // .picker { | 967 | // .picker { |
1185 | // display: flex; | 968 | // display: flex; |
1186 | // flex-direction: column; | 969 | // flex-direction: column; |
1187 | // justify-content: center; | 970 | // justify-content: center; |
1188 | // align-items: center; | 971 | // align-items: center; |
1189 | // width: 100%; | 972 | // width: 100%; |
1190 | // image { | 973 | // image { |
1191 | // width: 10px; | 974 | // width: 10px; |
1192 | // height: 10px; | 975 | // height: 10px; |
1193 | // margin-right: 5px; | 976 | // margin-right: 5px; |
1194 | // } | 977 | // } |
1195 | // .picker-choice { | 978 | // .picker-choice { |
1196 | // display: flex; | 979 | // display: flex; |
1197 | // width: 684rpx; | 980 | // width: 684rpx; |
1198 | // align-items: center; | 981 | // align-items: center; |
1199 | // margin-bottom: 40rpx; | 982 | // margin-bottom: 40rpx; |
1200 | // .choice-left { | 983 | // .choice-left { |
1201 | // width: 210rpx; | 984 | // width: 210rpx; |
1202 | // .p11 { | 985 | // .p11 { |
1203 | // font-size: 14px; | 986 | // font-size: 14px; |
1204 | // color: #333333; | 987 | // color: #333333; |
1205 | // letter-spacing: -0.26px; | 988 | // letter-spacing: -0.26px; |
1206 | // text-align: justify; | 989 | // text-align: justify; |
1207 | // line-height: 24px; | 990 | // line-height: 24px; |
1208 | // } | 991 | // } |
1209 | // .p12 { | 992 | // .p12 { |
1210 | // font-size: 10px; | 993 | // font-size: 10px; |
1211 | // color: #3f3f3f; | 994 | // color: #3f3f3f; |
1212 | // letter-spacing: -0.19px; | 995 | // letter-spacing: -0.19px; |
1213 | // text-align: justify; | 996 | // text-align: justify; |
1214 | // line-height: 24px; | 997 | // line-height: 24px; |
1215 | // } | 998 | // } |
1216 | // } | 999 | // } |
1217 | // .p13 { | 1000 | // .p13 { |
1218 | // font-size: 10px; | 1001 | // font-size: 10px; |
1219 | // color: #999999; | 1002 | // color: #999999; |
1220 | // letter-spacing: -0.19px; | 1003 | // letter-spacing: -0.19px; |
1221 | // margin-right: 10px; | 1004 | // margin-right: 10px; |
1222 | // } | 1005 | // } |
1223 | // .p13-date { | 1006 | // .p13-date { |
1224 | // font-size: 10px; | 1007 | // font-size: 10px; |
1225 | // color: #999999; | 1008 | // color: #999999; |
1226 | // letter-spacing: -0.19px; | 1009 | // letter-spacing: -0.19px; |
1227 | // margin-right: 5px; | 1010 | // margin-right: 5px; |
1228 | // } | 1011 | // } |
1229 | // .p14 { | 1012 | // .p14 { |
1230 | // font-size: 14px; | 1013 | // font-size: 14px; |
1231 | // color: #666666; | 1014 | // color: #666666; |
1232 | // letter-spacing: -0.26px; | 1015 | // letter-spacing: -0.26px; |
1233 | // text-align: center; | 1016 | // text-align: center; |
1234 | // width: 124rpx; | 1017 | // width: 124rpx; |
1235 | // border-bottom: 1px solid #cfcfcf; | 1018 | // border-bottom: 1px solid #cfcfcf; |
1236 | // } | 1019 | // } |
1237 | // } | 1020 | // } |
1238 | // } | 1021 | // } |
1239 | // } | 1022 | // } |
1240 | .goods-form { | 1023 | .goods-form { |
1241 | display: flex; | 1024 | display: flex; |
1242 | flex-direction: column; | 1025 | flex-direction: column; |
1243 | align-items: center; | 1026 | align-items: center; |
1244 | justify-content: center; | 1027 | justify-content: center; |
1245 | background-color: #fff; | 1028 | background-color: #fff; |
1246 | width: 100%; | 1029 | width: 100%; |
1247 | padding: 40rpx 0; | 1030 | padding: 40rpx 0; |
1248 | .p1 { | 1031 | .p1 { |
1249 | font-size: 16px; | 1032 | font-size: 16px; |
1250 | color: #333333; | 1033 | color: #333333; |
1251 | letter-spacing: -0.3px; | 1034 | letter-spacing: -0.3px; |
1252 | text-align: justify; | 1035 | text-align: justify; |
1253 | line-height: 24px; | 1036 | line-height: 24px; |
1254 | margin: 4px 0; | 1037 | margin: 4px 0; |
1255 | 1038 | ||
1256 | } | 1039 | } |
1257 | .p2 { | 1040 | .p2 { |
1258 | font-size: 12px; | 1041 | font-size: 12px; |
1259 | color: #999999; | 1042 | color: #999999; |
1260 | letter-spacing: -0.23px; | 1043 | letter-spacing: -0.23px; |
1261 | margin-bottom: 32rpx; | 1044 | margin-bottom: 32rpx; |
1262 | } | 1045 | } |
1263 | .image2{ | 1046 | .image2{ |
1264 | width: 42rpx; | 1047 | width: 42rpx; |
1265 | height: 34rpx; | 1048 | height: 34rpx; |
1266 | margin-right: 12rpx; | 1049 | margin-right: 12rpx; |
1267 | } | 1050 | } |
1268 | .confirm { | 1051 | .confirm { |
1269 | display: flex; | 1052 | display: flex; |
1270 | align-items: center; | 1053 | align-items: center; |
1271 | font-size: 12px; | 1054 | font-size: 12px; |
1272 | color: #666666; | 1055 | color: #666666; |
1273 | letter-spacing: -0.23px; | 1056 | letter-spacing: -0.23px; |
1274 | width: 684rpx; | 1057 | width: 684rpx; |
1275 | .image1{ | 1058 | .image1{ |
1276 | margin-right:25rpx; | 1059 | margin-right:25rpx; |
1277 | width: 42rpx; | 1060 | width: 42rpx; |
1278 | height: 38rpx; | 1061 | height: 38rpx; |
1279 | } | 1062 | } |
1280 | } | 1063 | } |
1281 | .picker{ | 1064 | .picker{ |
1282 | display: flex; | 1065 | display: flex; |
1283 | flex-direction: column; | 1066 | flex-direction: column; |
1284 | justify-content: center; | 1067 | justify-content: center; |
1285 | align-items: center; | 1068 | align-items: center; |
1286 | width: 100%; | 1069 | width: 100%; |
1287 | 1070 | ||
1288 | .picker-choice{ | 1071 | .picker-choice{ |
1289 | display: flex; | 1072 | display: flex; |
1290 | width: 684rpx; | 1073 | width: 684rpx; |
1291 | align-items: center; | 1074 | align-items: center; |
1292 | margin-bottom: 40rpx; | 1075 | margin-bottom: 40rpx; |
1293 | .input{ | 1076 | .input{ |
1294 | border-bottom: 1px solid #CFCFCF; | 1077 | border-bottom: 1px solid #CFCFCF; |
1295 | height: 40rpx; | 1078 | height: 40rpx; |
1296 | } | 1079 | } |
1297 | .choice-left{ | 1080 | .choice-left{ |
1298 | width: 210rpx; | 1081 | width: 210rpx; |
1299 | .pd{ | 1082 | .pd{ |
1300 | font-size: 14px; | 1083 | font-size: 14px; |
1301 | color: #333333; | 1084 | color: #333333; |
1302 | letter-spacing: -0.26px; | 1085 | letter-spacing: -0.26px; |
1303 | text-align: justify; | 1086 | text-align: justify; |
1304 | line-height: 24px; | 1087 | line-height: 24px; |
1305 | margin-right: 44rpx; | 1088 | margin-right: 44rpx; |
1306 | } | 1089 | } |
1307 | .p11 { | 1090 | .p11 { |
1308 | font-size: 14px; | 1091 | font-size: 14px; |
1309 | color: #333333; | 1092 | color: #333333; |
1310 | letter-spacing: -0.26px; | 1093 | letter-spacing: -0.26px; |
1311 | text-align: justify; | 1094 | text-align: justify; |
1312 | line-height: 24px; | 1095 | line-height: 24px; |
1313 | // margin-right: 10px; | 1096 | // margin-right: 10px; |
1314 | } | 1097 | } |
1315 | .p12 { | 1098 | .p12 { |
1316 | font-size: 10px; | 1099 | font-size: 10px; |
1317 | color: #3F3F3F; | 1100 | color: #3F3F3F; |
1318 | letter-spacing: -0.19px; | 1101 | letter-spacing: -0.19px; |
1319 | text-align: justify; | 1102 | text-align: justify; |
1320 | line-height: 24px; | 1103 | line-height: 24px; |
1321 | } | 1104 | } |
1322 | 1105 | ||
1323 | 1106 | ||
1324 | } | 1107 | } |
1325 | .p13 { | 1108 | .p13 { |
1326 | font-size: 10px; | 1109 | font-size: 10px; |
1327 | color: #999999; | 1110 | color: #999999; |
1328 | letter-spacing: -0.19px; | 1111 | letter-spacing: -0.19px; |
1329 | margin-right: 10px; | 1112 | margin-right: 10px; |
1330 | } | 1113 | } |
1331 | .p13-date { | 1114 | .p13-date { |
1332 | font-size: 10px; | 1115 | font-size: 10px; |
1333 | color: #999999; | 1116 | color: #999999; |
1334 | letter-spacing: -0.19px; | 1117 | letter-spacing: -0.19px; |
1335 | margin-right: 5px; | 1118 | margin-right: 5px; |
1336 | } | 1119 | } |
1337 | picker{ | 1120 | picker{ |
1338 | width: 144rpx; | 1121 | width: 144rpx; |
1339 | height: 40rpx; | 1122 | height: 40rpx; |
1340 | display: flex; | 1123 | display: flex; |
1341 | position: relative; | 1124 | position: relative; |
1342 | .p14 { | 1125 | .p14 { |
1343 | font-size: 14px; | 1126 | font-size: 14px; |
1344 | color: #666666; | 1127 | color: #666666; |
1345 | letter-spacing: -0.26px; | 1128 | letter-spacing: -0.26px; |
1346 | text-align: center; | 1129 | text-align: center; |
1347 | width: 124rpx; | 1130 | width: 124rpx; |
1348 | border-bottom: 1px solid #CFCFCF; | 1131 | border-bottom: 1px solid #CFCFCF; |
1349 | height: 38rpx; | 1132 | height: 38rpx; |
1350 | } | 1133 | } |
1351 | image{ | 1134 | image{ |
1352 | width: 20rpx; | 1135 | width: 20rpx; |
1353 | height: 20rpx; | 1136 | height: 20rpx; |
1354 | position: absolute; | 1137 | position: absolute; |
1355 | right: 20rpx; | 1138 | right: 20rpx; |
1356 | top: 8rpx; | 1139 | top: 8rpx; |
1357 | } | 1140 | } |
1358 | } | 1141 | } |
1359 | 1142 | ||
1360 | 1143 | ||
1361 | } | 1144 | } |
1362 | } | 1145 | } |
1363 | } | 1146 | } |
1364 | } | 1147 | } |
1365 | } | 1148 | } |
1366 | .choose { | 1149 | .choose { |
1367 | width: 100%; | 1150 | width: 100%; |
1368 | background: #ffffff; | 1151 | background: #ffffff; |
1369 | border-radius: 12rpx; | 1152 | border-radius: 12rpx; |
1370 | margin-top: 20rpx; | 1153 | margin-top: 20rpx; |
1371 | padding: 40rpx 40rpx 112rpx 40rpx; | 1154 | padding: 40rpx 40rpx 112rpx 40rpx; |
1372 | box-sizing: border-box; | 1155 | box-sizing: border-box; |
1373 | .chooseItem { | 1156 | .chooseItem { |
1374 | width: 100%; | 1157 | width: 100%; |
1375 | padding-bottom: 32rpx; | 1158 | padding-bottom: 32rpx; |
1376 | border-bottom: 1px solid #e9e9e9; | 1159 | border-bottom: 1px solid #e9e9e9; |
1377 | margin-bottom: 28rpx; | 1160 | margin-bottom: 28rpx; |
1378 | } | 1161 | } |
1379 | .chooseRes { | 1162 | .chooseRes { |
1380 | font-size: 12px; | 1163 | font-size: 12px; |
1381 | color: #666666; | 1164 | color: #666666; |
1382 | } | 1165 | } |
1383 | .itemsWrap { | 1166 | .itemsWrap { |
1384 | display: flex; | 1167 | display: flex; |
1385 | flex-direction: row; | 1168 | flex-direction: row; |
1386 | flex-wrap: wrap; | 1169 | flex-wrap: wrap; |
1387 | justify-content: flex-start; | 1170 | justify-content: flex-start; |
1388 | align-items: center; | 1171 | align-items: center; |
1389 | padding-top: 24rpx; | 1172 | padding-top: 24rpx; |
1390 | .item1 { | 1173 | .item1 { |
1391 | width: 64rpx; | 1174 | width: 64rpx; |
1392 | height: 64rpx; | 1175 | height: 64rpx; |
1393 | border-radius: 32rpx; | 1176 | border-radius: 32rpx; |
1394 | margin: 0 36rpx 24rpx 0; | 1177 | margin: 0 36rpx 24rpx 0; |
1395 | transition: all 0.3s; | 1178 | transition: all 0.3s; |
1396 | border: 1px solid #ffffff; | 1179 | border: 1px solid #ffffff; |
1397 | } | 1180 | } |
1398 | .item2 { | 1181 | .item2 { |
1399 | // width: 100rpx; | 1182 | // width: 100rpx; |
1400 | padding: 0 30rpx; | 1183 | padding: 0 30rpx; |
1401 | height: 60rpx; | 1184 | height: 60rpx; |
1402 | margin: 0 20rpx 20rpx 0; | 1185 | margin: 0 20rpx 20rpx 0; |
1403 | transition: all 0.3s; | 1186 | transition: all 0.3s; |
1404 | background: #f2f2f2; | 1187 | background: #f2f2f2; |
1405 | border-radius: 2px; | 1188 | border-radius: 2px; |
1406 | border-radius: 2px; | 1189 | border-radius: 2px; |
1407 | line-height: 60rpx; | 1190 | line-height: 60rpx; |
1408 | text-align: center; | 1191 | text-align: center; |
1409 | color: #666666; | 1192 | color: #666666; |
1410 | font-size: 12px; | 1193 | font-size: 12px; |
1411 | } | 1194 | } |
1412 | .active1 { | 1195 | .active1 { |
1413 | opacity: 0.7; | 1196 | opacity: 0.7; |
1414 | border: 1px solid #ff6b4a; | 1197 | border: 1px solid #ff6b4a; |
1415 | } | 1198 | } |
1416 | .active2 { | 1199 | .active2 { |
1417 | background: rgba(255, 107, 74, 0.15); | 1200 | background: rgba(255, 107, 74, 0.15); |
1418 | color: #ff6b4a; | 1201 | color: #ff6b4a; |
1419 | } | 1202 | } |
1420 | } | 1203 | } |
1421 | } | 1204 | } |
1422 | .button { | 1205 | .button { |
1423 | width: 100%; | 1206 | width: 100%; |
1424 | height: 112rpx; | 1207 | height: 112rpx; |
1425 | background-color: #ff6b4a; | 1208 | background-color: #ff6b4a; |
1426 | font-size: 16px; | 1209 | font-size: 16px; |
1427 | color: #ffffff; | 1210 | color: #ffffff; |
1428 | line-height: 112rpx; | 1211 | line-height: 112rpx; |
1429 | text-align: center; | 1212 | text-align: center; |
1430 | position: fixed; | 1213 | position: fixed; |
src/pages/user/user.vue
1 | <template> | 1 | <template> |
2 | <view class="wrap"> | 2 | <view class="wrap"> |
3 | <!-- 弹窗 --> | 3 | <!-- 弹窗 --> |
4 | <uni-popup | 4 | <uni-popup |
5 | ref="popup" | 5 | ref="popup" |
6 | type="center" | 6 | type="center" |
7 | > | 7 | > |
8 | <!-- 给一个左边弹窗的样式 --> | 8 | <!-- 给一个左边弹窗的样式 --> |
9 | <!-- 关闭弹窗按钮 --> | 9 | <!-- 关闭弹窗按钮 --> |
10 | <view | 10 | <view |
11 | class="closeBtn" | 11 | class="closeBtn" |
12 | @tap="this.$refs.popup.close()" | 12 | @tap="this.$refs.popup.close()" |
13 | >x</view> | 13 | >x</view> |
14 | <view | 14 | <view |
15 | class="popUpWrap" | 15 | class="popUpWrap" |
16 | v-if="whichTap==0" | 16 | v-if="whichTap==0" |
17 | > | 17 | > |
18 | <text>这是一款眼镜及周边产品的销售平台,我们将帮您进行建立全球销售网络,欢迎入驻。</text> | 18 | <text>这是一款眼镜及周边产品的销售平台,我们将帮您进行建立全球销售网络,欢迎入驻。</text> |
19 | 19 | ||
20 | <!-- 左 --> | 20 | <!-- 左 --> |
21 | <!-- <image class="glassInfo" src="../../static/img/myOpticsData/glassInfo.png" v-if="whichTap == 0" mode="aspectFit"></image> --> | 21 | <!-- <image class="glassInfo" src="../../static/img/myOpticsData/glassInfo.png" v-if="whichTap == 0" mode="aspectFit"></image> --> |
22 | <!-- 右 --> | 22 | <!-- 右 --> |
23 | <!-- <image class="dataInfo" src="../../static/img/myOpticsData/dataInfo.png" v-else mode="aspectFit"></image> --> | 23 | <!-- <image class="dataInfo" src="../../static/img/myOpticsData/dataInfo.png" v-else mode="aspectFit"></image> --> |
24 | </view> | 24 | </view> |
25 | <view | 25 | <view |
26 | class="popUpWrap" | 26 | class="popUpWrap" |
27 | v-if="whichTap==1" | 27 | v-if="whichTap==1" |
28 | > | 28 | > |
29 | <text>本平台欢迎全国各地的眼镜工厂、品牌、眼镜店加入。请联系我们申请注册账号。</text> | 29 | <text>本平台欢迎全国各地的眼镜工厂、品牌、眼镜店加入。请联系我们申请注册账号。</text> |
30 | </view> | 30 | </view> |
31 | <view | 31 | <view |
32 | class="popUpWrap" | 32 | class="popUpWrap" |
33 | v-if="whichTap==2" | 33 | v-if="whichTap==2" |
34 | > | 34 | > |
35 | <button @tap="chatOur(1)">客服1</button> | 35 | <button @tap="chatOur(1)">客服1</button> |
36 | <button @tap="chatOur(2)">客服2</button> | 36 | <button @tap="chatOur(2)">客服2</button> |
37 | </view> | 37 | </view> |
38 | </uni-popup> | 38 | </uni-popup> |
39 | <view | 39 | <view |
40 | v-if="isAuth" | 40 | v-if="isAuth" |
41 | class="content" | 41 | class="content" |
42 | > | 42 | > |
43 | <view class="userInfo"> | 43 | <view class="userInfo"> |
44 | <view class="info"> | 44 | <view class="info"> |
45 | <image | 45 | <image |
46 | :src="headerphoto" | 46 | :src="headerphoto" |
47 | mode="aspectFill" | 47 | mode="aspectFill" |
48 | ></image> | 48 | ></image> |
49 | <view class="infoText"> | 49 | <view class="infoText"> |
50 | <text class="userName">{{nickName}}</text> | 50 | <text class="userName">{{nickName}}</text> |
51 | </view> | 51 | </view> |
52 | </view> | 52 | </view> |
53 | <!-- <view class="service"> | 53 | <!-- <view class="service"> |
54 | <image src="../../static/serviceLogo.png" mode="aspectFill"></image> | 54 | <image src="../../static/serviceLogo.png" mode="aspectFill"></image> |
55 | </view> --> | 55 | </view> --> |
56 | </view> | 56 | </view> |
57 | <view | 57 | <view |
58 | class="myOpticsData" | 58 | class="myOpticsData" |
59 | @tap="toOpticsData" | 59 | @tap="toOpticsData" |
60 | > | 60 | > |
61 | <view class="left"> | 61 | <view class="left"> |
62 | <image | 62 | <image |
63 | src="../../static/img/user/dataWrite.png" | 63 | src="../../static/img/user/dataWrite.png" |
64 | mode="aspectFit" | 64 | mode="aspectFit" |
65 | ></image> | 65 | ></image> |
66 | <text>验光数据</text> | 66 | <text>验光数据</text> |
67 | </view> | 67 | </view> |
68 | <image | 68 | <image |
69 | src="../../static/right.png" | 69 | src="../../static/right.png" |
70 | mode="aspectFit" | 70 | mode="aspectFit" |
71 | ></image> | 71 | ></image> |
72 | </view> | 72 | </view> |
73 | <view class="myOrder"> | 73 | <view class="myOrder"> |
74 | <view class="orderHeader"> | 74 | <view class="orderHeader"> |
75 | <text>全部订单</text> | 75 | <text>全部订单</text> |
76 | <view | 76 | <view |
77 | class="btn" | 77 | class="btn" |
78 | @click="toMyOrder('10')" | 78 | @click="toMyOrder('10')" |
79 | > | 79 | > |
80 | 全部 | 80 | 全部 |
81 | <image | 81 | <image |
82 | src="../../static/right.png" | 82 | src="../../static/right.png" |
83 | mode="aspectFit" | 83 | mode="aspectFit" |
84 | ></image> | 84 | ></image> |
85 | </view> | 85 | </view> |
86 | </view> | 86 | </view> |
87 | <view class="orderBody"> | 87 | <view class="orderBody"> |
88 | <view | 88 | <view |
89 | class="item waitPay" | 89 | class="item waitPay" |
90 | @click="toMyOrder('0')" | 90 | @click="toMyOrder('0')" |
91 | > | 91 | > |
92 | <image | 92 | <image |
93 | src="../../static/img/user/waitDeliver.png" | 93 | src="../../static/img/user/waitDeliver.png" |
94 | mode="aspectFit" | 94 | mode="aspectFit" |
95 | ></image> | 95 | ></image> |
96 | <text>待付款</text> | 96 | <text>待付款</text> |
97 | </view> | 97 | </view> |
98 | <view | 98 | <view |
99 | class="item waitDeliver" | 99 | class="item waitDeliver" |
100 | @click="toMyOrder('1')" | 100 | @click="toMyOrder('1')" |
101 | > | 101 | > |
102 | <image | 102 | <image |
103 | src="../../static/img/user/waitPay.png" | 103 | src="../../static/img/user/waitPay.png" |
104 | mode="aspectFit" | 104 | mode="aspectFit" |
105 | ></image> | 105 | ></image> |
106 | <text>待收货</text> | 106 | <text>待收货</text> |
107 | </view> | 107 | </view> |
108 | <view | 108 | <view |
109 | class="item waitReceive" | 109 | class="item waitReceive" |
110 | @click="toMyOrder('2')" | 110 | @click="toMyOrder('2')" |
111 | > | 111 | > |
112 | <image | 112 | <image |
113 | src="../../static/img/user/waitReceive.png" | 113 | src="../../static/img/user/waitReceive.png" |
114 | mode="aspectFit" | 114 | mode="aspectFit" |
115 | ></image> | 115 | ></image> |
116 | <text>已完成</text> | 116 | <text>已完成</text> |
117 | </view> | 117 | </view> |
118 | <!-- <view class="item service" @click="toMyOrder('3')"> | 118 | <!-- <view class="item service" @click="toMyOrder('3')"> |
119 | <image src="../../static/img/user/refound.png" mode="aspectFit"></image> | 119 | <image src="../../static/img/user/refound.png" mode="aspectFit"></image> |
120 | <text>已评价</text> | 120 | <text>已评价</text> |
121 | </view> --> | 121 | </view> --> |
122 | </view> | 122 | </view> |
123 | </view> | 123 | </view> |
124 | <view class="someItem"> | 124 | <view class="someItem"> |
125 | <!-- <view class="item"> | 125 | <!-- <view class="item"> |
126 | <view class="left"> | 126 | <view class="left"> |
127 | <image src="../../static/img/user/shouyi.png" mode="aspectFit"></image> | 127 | <image src="../../static/img/user/shouyi.png" mode="aspectFit"></image> |
128 | <text>推广记录与收益</text> | 128 | <text>推广记录与收益</text> |
129 | </view> | 129 | </view> |
130 | <image src="../../static/right.png" mode="aspectFit"></image> | 130 | <image src="../../static/right.png" mode="aspectFit"></image> |
131 | </view> --> | 131 | </view> --> |
132 | <view class="item"> | 132 | <view class="item"> |
133 | <view class="left"> | 133 | <view class="left"> |
134 | <image | 134 | <image |
135 | src="../../static/address-icon.png" | 135 | src="../../static/address-icon.png" |
136 | mode="aspectFit" | 136 | mode="aspectFit" |
137 | ></image> | 137 | ></image> |
138 | <text @tap="toAddress">地址管理</text> | 138 | <text @tap="toAddress">地址管理</text> |
139 | </view> | 139 | </view> |
140 | <image | 140 | <image |
141 | src="../../static/right.png" | 141 | src="../../static/right.png" |
142 | mode="aspectFit" | 142 | mode="aspectFit" |
143 | ></image> | 143 | ></image> |
144 | </view> | 144 | </view> |
145 | <view class="item"> | 145 | <view class="item"> |
146 | <view class="left"> | 146 | <view class="left"> |
147 | <image | 147 | <image |
148 | src="../../static/img/user/introduce.png" | 148 | src="../../static/img/user/introduce.png" |
149 | mode="aspectFit" | 149 | mode="aspectFit" |
150 | ></image> | 150 | ></image> |
151 | <text @tap="introduce">系统介绍</text> | 151 | <text @tap="introduce">系统介绍</text> |
152 | </view> | 152 | </view> |
153 | <image | 153 | <image |
154 | src="../../static/right.png" | 154 | src="../../static/right.png" |
155 | mode="aspectFit" | 155 | mode="aspectFit" |
156 | ></image> | 156 | ></image> |
157 | </view> | 157 | </view> |
158 | <view class="item"> | 158 | <view class="item"> |
159 | <view class="left"> | 159 | <view class="left"> |
160 | <image | 160 | <image |
161 | src="../../static/img/user/joinUs.png" | 161 | src="../../static/img/user/joinUs.png" |
162 | mode="aspectFit" | 162 | mode="aspectFit" |
163 | ></image> | 163 | ></image> |
164 | <text @tap="joinUs">加入我们</text> | 164 | <text @tap="joinUs">加入我们</text> |
165 | </view> | 165 | </view> |
166 | <image | 166 | <image |
167 | src="../../static/right.png" | 167 | src="../../static/right.png" |
168 | mode="aspectFit" | 168 | mode="aspectFit" |
169 | ></image> | 169 | ></image> |
170 | </view> | 170 | </view> |
171 | <view class="item"> | 171 | <view class="item"> |
172 | <view class="left"> | 172 | <view class="left"> |
173 | <image | 173 | <image |
174 | src="../../static/img/user/service.png" | 174 | src="../../static/img/user/service.png" |
175 | mode="aspectFit" | 175 | mode="aspectFit" |
176 | ></image> | 176 | ></image> |
177 | <text>联系客服</text> | 177 | <text>联系客服</text> |
178 | </view> | 178 | </view> |
179 | <image | 179 | <image |
180 | src="../../static/right.png" | 180 | src="../../static/right.png" |
181 | mode="aspectFit" | 181 | mode="aspectFit" |
182 | ></image> | 182 | ></image> |
183 | </view> | 183 | </view> |
184 | </view> | 184 | </view> |
185 | <view class="recommend"> | 185 | <view class="recommend"> |
186 | <view class="title"> | 186 | <view class="title"> |
187 | <view class="line"></view> | 187 | <view class="line"></view> |
188 | <view class="text">精选推荐</view> | 188 | <view class="text">精选推荐</view> |
189 | <view class="line"></view> | 189 | <view class="line"></view> |
190 | </view> | 190 | </view> |
191 | <!-- 商品列表 --> | 191 | <!-- 商品列表 --> |
192 | <view class="goods-list"> | 192 | <view class="goods-list"> |
193 | <scroll-view | 193 | <scroll-view |
194 | enable-flex | 194 | enable-flex |
195 | @scrolltolower="handleScrolltolower" | 195 | @scrolltolower="handleScrolltolower" |
196 | scroll-y | 196 | scroll-y |
197 | class="product-list" | 197 | class="product-list" |
198 | > | 198 | > |
199 | <view | 199 | <view |
200 | class="product" | 200 | class="product" |
201 | v-for="(item, index) in userRecommandList" | 201 | v-for="(item, index) in userRecommandList" |
202 | :key="index" | 202 | :key="index" |
203 | > | 203 | > |
204 | <Card :goods="item"></Card> | 204 | <Card :goods="item"></Card> |
205 | </view> | 205 | </view> |
206 | </scroll-view> | 206 | </scroll-view> |
207 | <view class="loading-text">{{loadingText}}</view> | 207 | <view class="loading-text">{{loadingText}}</view> |
208 | </view> | 208 | </view> |
209 | </view> | 209 | </view> |
210 | </view> | 210 | </view> |
211 | <view | 211 | <view |
212 | v-else | 212 | v-else |
213 | class="auth" | 213 | class="auth" |
214 | > | 214 | > |
215 | <view class="icon"></view> | 215 | <view class="icon"></view> |
216 | <view class="divider"></view> | 216 | <view class="divider"></view> |
217 | <view class="title">申请获取以下权限</view> | 217 | <view class="title">申请获取以下权限</view> |
218 | <view class="text">获得您的公开信息(昵称、头像等)</view> | 218 | <view class="text">获得您的公开信息(昵称、头像等)</view> |
219 | <button | 219 | <button |
220 | type="primary" | 220 | type="primary" |
221 | open-type="getUserInfo" | 221 | open-type="getUserInfo" |
222 | @getuserinfo="onGotUserInfo" | 222 | @getuserinfo="onGotUserInfo" |
223 | >授权登陆</button> | 223 | >授权登陆</button> |
224 | </view> | 224 | </view> |
225 | </view> | 225 | </view> |
226 | </template> | 226 | </template> |
227 | 227 | ||
228 | <script> | 228 | <script> |
229 | import Card from '@/components/CommodityCard/CommodityCard.vue' | 229 | import Card from '@/components/CommodityCard/CommodityCard.vue' |
230 | import store from '@/store' | 230 | import store from '@/store' |
231 | import UniPopup from '@/components/UniPopup/uni-popup.vue' | 231 | import UniPopup from '@/components/UniPopup/uni-popup.vue' |
232 | 232 | ||
233 | export default { | 233 | export default { |
234 | components: { | 234 | components: { |
235 | Card, | 235 | Card, |
236 | UniPopup | 236 | UniPopup |
237 | }, | 237 | }, |
238 | data() { | 238 | data() { |
239 | return { | 239 | return { |
240 | isAuth: true, // 是否显示授权页面, | 240 | isAuth: true, // 是否显示授权页面, |
241 | pagesnum: 1, // 分页请求初始值 | 241 | pagesnum: 1, // 分页请求初始值 |
242 | whichTap: 0 // 弹窗渲染选择条件 | 242 | whichTap: 0 // 弹窗渲染选择条件 |
243 | } | 243 | } |
244 | }, | 244 | }, |
245 | onLoad() { | 245 | onLoad() { |
246 | // 判断是否授权 | 246 | // 判断是否授权 |
247 | uni.getSetting({ | 247 | uni.getSetting({ |
248 | success(res) { | 248 | success(res) { |
249 | console.log('authSetting', res.authSetting) | 249 | console.log('authSetting', res.authSetting) |
250 | if (res.authSetting['scope.userInfo'] === true) { | 250 | if (res.authSetting['scope.userInfo'] === true) { |
251 | this.isAuth = true | 251 | this.isAuth = true |
252 | } else { | 252 | } else { |
253 | this.isAuth = false | 253 | this.isAuth = false |
254 | } | 254 | } |
255 | } | 255 | } |
256 | }) | 256 | }) |
257 | store.dispatch('userRecommand/getRecommandList', { | 257 | store.dispatch('userRecommand/getRecommandList', { |
258 | uid: this.$store.state.user.userInfo.uid, | 258 | uid: this.$store.state.user.userInfo.uid, |
259 | openid: this.$store.state.user.userInfo.openid, | 259 | openid: this.$store.state.user.userInfo.openid, |
260 | page: this.pagesnum | 260 | page: this.pagesnum |
261 | }) | 261 | }) |
262 | }, | 262 | }, |
263 | computed: { | 263 | computed: { |
264 | nickName() { | 264 | nickName() { |
265 | return this.$store.state.user.userInfo.nickName | 265 | return this.$store.state.user.userInfo.nickName |
266 | }, | 266 | }, |
267 | headerphoto() { | 267 | headerphoto() { |
268 | return this.$store.state.user.userInfo.headerphoto | 268 | return this.$store.state.user.userInfo.headerphoto |
269 | }, | 269 | }, |
270 | userRecommandList() { | 270 | userRecommandList() { |
271 | console.log('userRecommandList=====>',this.$store.state.userRecommand.recommandList) | ||
271 | return this.$store.state.userRecommand.recommandList | 272 | return this.$store.state.userRecommand.recommandList |
272 | } | 273 | } |
273 | }, | 274 | }, |
274 | methods: { | 275 | methods: { |
275 | // 弹窗 | 276 | // 弹窗 |
276 | changeTap(item) { | 277 | changeTap(item) { |
277 | this.whichTap = item | 278 | this.whichTap = item |
278 | this.$refs.popup.open() | 279 | this.$refs.popup.open() |
279 | }, | 280 | }, |
280 | chatOur(item) { | 281 | chatOur(item) { |
281 | if (item === 1) { | 282 | if (item === 1) { |
282 | uni.makePhoneCall({ | 283 | uni.makePhoneCall({ |
283 | phoneNumber: 13376189297 // 客服1 电话 | 284 | phoneNumber: 13376189297 // 客服1 电话 |
284 | }) | 285 | }) |
285 | } else { | 286 | } else { |
286 | uni.makePhoneCall({ | 287 | uni.makePhoneCall({ |
287 | phoneNumber: 18014995101 // 客服2 电话 | 288 | phoneNumber: 18014995101 // 客服2 电话 |
288 | }) | 289 | }) |
289 | } | 290 | } |
290 | }, | 291 | }, |
291 | // 授权 | 292 | // 授权 |
292 | onGotUserInfo(e) { | 293 | onGotUserInfo(e) { |
293 | if (e.detail.errMsg === 'getUserInfo:ok') { | 294 | if (e.detail.errMsg === 'getUserInfo:ok') { |
294 | const { fromInfo } = this.$store.state.user | 295 | const { fromInfo } = this.$store.state.user |
295 | // 用户授权成功 | 296 | // 用户授权成功 |
296 | store.dispatch('user/getUserInfo', fromInfo) | 297 | store.dispatch('user/getUserInfo', fromInfo) |
297 | this.isAuth = true | 298 | this.isAuth = true |
298 | } | 299 | } |
299 | }, | 300 | }, |
300 | toAddress() { | 301 | toAddress() { |
301 | uni.navigateTo({ | 302 | uni.navigateTo({ |
302 | url: '../address/addressList', | 303 | url: '../address/addressList', |
303 | success: res => {}, | 304 | success: res => {}, |
304 | fail: () => {}, | 305 | fail: () => {}, |
305 | complete: () => {} | 306 | complete: () => {} |
306 | }) | 307 | }) |
307 | }, | 308 | }, |
308 | introduce() { | 309 | introduce() { |
309 | uni.showModal({ | 310 | uni.showModal({ |
310 | content: '这是一款眼镜及周边产品的销售平台,我们将帮您进行建立全球销售网络,欢迎入住。', | 311 | content: '这是一款眼镜及周边产品的销售平台,我们将帮您进行建立全球销售网络,欢迎入住。', |
311 | showCancel: false | 312 | showCancel: false |
312 | }) | 313 | }) |
313 | }, | 314 | }, |
314 | joinUs() { | 315 | joinUs() { |
315 | uni.showModal({ | 316 | uni.showModal({ |
316 | content: '本平台欢迎全国各地的眼镜工厂、品牌、眼镜店加入。请联系我们申请注册账号', | 317 | content: '本平台欢迎全国各地的眼镜工厂、品牌、眼镜店加入。请联系我们申请注册账号', |
317 | showCancel: false | 318 | showCancel: false |
318 | }) | 319 | }) |
319 | }, | 320 | }, |
320 | toMyOrder(status) { | 321 | toMyOrder(status) { |
321 | uni.navigateTo({ | 322 | uni.navigateTo({ |
322 | url: `../myOrder/myOrder?status=${status}`, | 323 | url: `../myOrder/myOrder?status=${status}`, |
323 | success: res => {}, | 324 | success: res => {}, |
324 | fail: () => {}, | 325 | fail: () => {}, |
325 | complete: () => {} | 326 | complete: () => {} |
326 | }) | 327 | }) |
327 | }, | 328 | }, |
328 | toOpticsData() { | 329 | toOpticsData() { |
329 | uni.navigateTo({ | 330 | uni.navigateTo({ |
330 | url: '../addOpticsData/addOpticsData' | 331 | url: '../addOpticsData/addOpticsData' |
331 | }) | 332 | }) |
332 | }, | 333 | }, |
333 | handleScrolltolower() { | 334 | handleScrolltolower() { |
334 | // console.log('usr-my',this.$store.state.user.userInfo) | 335 | // console.log('usr-my',this.$store.state.user.userInfo) |
335 | this.pagesnum++ | 336 | this.pagesnum++ |
336 | store.dispatch('userRecommand/getRecommandList', { | 337 | store.dispatch('userRecommand/getRecommandList', { |
337 | uid: this.$store.state.user.userInfo.uid, | 338 | uid: this.$store.state.user.userInfo.uid, |
338 | openid: this.$store.state.user.userInfo.openid, | 339 | openid: this.$store.state.user.userInfo.openid, |
339 | page: this.pagesnum | 340 | page: this.pagesnum |
340 | }) | 341 | }) |
341 | } | 342 | } |
342 | } | 343 | } |
343 | } | 344 | } |
344 | </script> | 345 | </script> |
345 | 346 | ||
346 | <style lang="scss"> | 347 | <style lang="scss"> |
347 | .warp { | 348 | .warp { |
348 | font-size: 24rpx; | 349 | font-size: 24rpx; |
349 | background-color: #f2f2f2; | 350 | background-color: #f2f2f2; |
350 | height: 100vh; | 351 | height: 100vh; |
351 | } | 352 | } |
352 | .content { | 353 | .content { |
353 | display: flex; | 354 | display: flex; |
354 | flex-direction: column; | 355 | flex-direction: column; |
355 | align-items: center; | 356 | align-items: center; |
356 | justify-content: center; | 357 | justify-content: center; |
357 | background-color: #f2f2f2; | 358 | background-color: #f2f2f2; |
358 | } | 359 | } |
359 | .userInfo { | 360 | .userInfo { |
360 | background-image: linear-gradient(270deg, #ffa481 0%, #ff6b4a 66%); | 361 | background-image: linear-gradient(270deg, #ffa481 0%, #ff6b4a 66%); |
361 | width: 100%; | 362 | width: 100%; |
362 | height: 240rpx; | 363 | height: 240rpx; |
363 | color: #ffffff; | 364 | color: #ffffff; |
364 | padding: 60rpx 82rpx 80rpx 44rpx; | 365 | padding: 60rpx 82rpx 80rpx 44rpx; |
365 | box-sizing: border-box; | 366 | box-sizing: border-box; |
366 | display: flex; | 367 | display: flex; |
367 | flex-direction: row; | 368 | flex-direction: row; |
368 | justify-content: space-between; | 369 | justify-content: space-between; |
369 | align-items: flex-start; | 370 | align-items: flex-start; |
370 | .info { | 371 | .info { |
371 | display: flex; | 372 | display: flex; |
372 | flex-direction: row; | 373 | flex-direction: row; |
373 | justify-content: space-between; | 374 | justify-content: space-between; |
374 | align-items: center; | 375 | align-items: center; |
375 | image { | 376 | image { |
376 | border-radius: 50rpx; | 377 | border-radius: 50rpx; |
377 | height: 100rpx; | 378 | height: 100rpx; |
378 | width: 100rpx; | 379 | width: 100rpx; |
379 | margin-right: 40rpx; | 380 | margin-right: 40rpx; |
380 | } | 381 | } |
381 | .infoText { | 382 | .infoText { |
382 | display: flex; | 383 | display: flex; |
383 | flex-direction: column; | 384 | flex-direction: column; |
384 | justify-content: space-between; | 385 | justify-content: space-between; |
385 | align-items: flex-scetart; | 386 | align-items: flex-scetart; |
386 | .userName { | 387 | .userName { |
387 | font-size: 18px; | 388 | font-size: 18px; |
388 | color: #ffffff; | 389 | color: #ffffff; |
389 | margin-bottom: 8rpx; | 390 | margin-bottom: 8rpx; |
390 | } | 391 | } |
391 | .nickName { | 392 | .nickName { |
392 | font-size: 12px; | 393 | font-size: 12px; |
393 | color: #ffffff; | 394 | color: #ffffff; |
394 | } | 395 | } |
395 | } | 396 | } |
396 | } | 397 | } |
397 | // .service { | 398 | // .service { |
398 | // margin-top: 20rpx; | 399 | // margin-top: 20rpx; |
399 | // image { | 400 | // image { |
400 | // height: 36rpx; | 401 | // height: 36rpx; |
401 | // width: 36rpx; | 402 | // width: 36rpx; |
402 | // } | 403 | // } |
403 | // } | 404 | // } |
404 | } | 405 | } |
405 | .myOpticsData { | 406 | .myOpticsData { |
406 | width: 670rpx; | 407 | width: 670rpx; |
407 | height: 120rpx; | 408 | height: 120rpx; |
408 | background-color: #ffffff; | 409 | background-color: #ffffff; |
409 | border-radius: 6px; | 410 | border-radius: 6px; |
410 | box-shadow: 1px 1px 7px 0 rgba(133, 107, 107, 0.1); | 411 | box-shadow: 1px 1px 7px 0 rgba(133, 107, 107, 0.1); |
411 | position: relative; | 412 | position: relative; |
412 | bottom: 44rpx; | 413 | bottom: 44rpx; |
413 | padding: 40rpx; | 414 | padding: 40rpx; |
414 | box-sizing: border-box; | 415 | box-sizing: border-box; |
415 | display: flex; | 416 | display: flex; |
416 | justify-content: space-between; | 417 | justify-content: space-between; |
417 | align-items: center; | 418 | align-items: center; |
418 | .left { | 419 | .left { |
419 | font-size: 14px; | 420 | font-size: 14px; |
420 | color: #333333; | 421 | color: #333333; |
421 | display: flex; | 422 | display: flex; |
422 | align-items: center; | 423 | align-items: center; |
423 | image { | 424 | image { |
424 | margin-right: 32rpx; | 425 | margin-right: 32rpx; |
425 | width: 30rpx; | 426 | width: 30rpx; |
426 | height: 34rpx; | 427 | height: 34rpx; |
427 | } | 428 | } |
428 | } | 429 | } |
429 | image { | 430 | image { |
430 | height: 16px; | 431 | height: 16px; |
431 | width: 8px; | 432 | width: 8px; |
432 | } | 433 | } |
433 | } | 434 | } |
434 | .myOrder { | 435 | .myOrder { |
435 | width: 100%; | 436 | width: 100%; |
436 | height: 296rpx; | 437 | height: 296rpx; |
437 | // margin-top: 116rpx; | 438 | // margin-top: 116rpx; |
438 | margin-bottom: 20rpx; | 439 | margin-bottom: 20rpx; |
439 | padding: 0 40rpx; | 440 | padding: 0 40rpx; |
440 | box-sizing: border-box; | 441 | box-sizing: border-box; |
441 | background: #ffffff; | 442 | background: #ffffff; |
442 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); | 443 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); |
443 | border-radius: 6px; | 444 | border-radius: 6px; |
444 | border-radius: 6px; | 445 | border-radius: 6px; |
445 | display: flex; | 446 | display: flex; |
446 | flex-direction: column; | 447 | flex-direction: column; |
447 | justify-content: space-around; | 448 | justify-content: space-around; |
448 | align-items: center; | 449 | align-items: center; |
449 | .orderHeader { | 450 | .orderHeader { |
450 | width: 100%; | 451 | width: 100%; |
451 | height: 100rpx; | 452 | height: 100rpx; |
452 | display: flex; | 453 | display: flex; |
453 | flex-direction: row; | 454 | flex-direction: row; |
454 | justify-content: space-between; | 455 | justify-content: space-between; |
455 | align-items: center; | 456 | align-items: center; |
456 | border-bottom: 1px solid #e9e9e9; | 457 | border-bottom: 1px solid #e9e9e9; |
457 | font-weight: bold; | 458 | font-weight: bold; |
458 | font-size: 18px; | 459 | font-size: 18px; |
459 | color: #333333; | 460 | color: #333333; |
460 | .btn { | 461 | .btn { |
461 | font-size: 12px; | 462 | font-size: 12px; |
462 | color: #999999; | 463 | color: #999999; |
463 | display: flex; | 464 | display: flex; |
464 | align-items: center; | 465 | align-items: center; |
465 | image { | 466 | image { |
466 | margin-left: 20rpx; | 467 | margin-left: 20rpx; |
467 | height: 32rpx; | 468 | height: 32rpx; |
468 | width: 16rpx; | 469 | width: 16rpx; |
469 | } | 470 | } |
470 | } | 471 | } |
471 | } | 472 | } |
472 | .orderBody { | 473 | .orderBody { |
473 | width: 100%; | 474 | width: 100%; |
474 | display: flex; | 475 | display: flex; |
475 | flex-direction: row; | 476 | flex-direction: row; |
476 | justify-content: space-around; | 477 | justify-content: space-around; |
477 | align-items: center; | 478 | align-items: center; |
478 | .item { | 479 | .item { |
479 | display: flex; | 480 | display: flex; |
480 | flex-direction: column; | 481 | flex-direction: column; |
481 | align-items: center; | 482 | align-items: center; |
482 | image { | 483 | image { |
483 | width: 62rpx; | 484 | width: 62rpx; |
484 | height: 46rpx; | 485 | height: 46rpx; |
485 | } | 486 | } |
486 | text { | 487 | text { |
487 | margin-top: 24rpx; | 488 | margin-top: 24rpx; |
488 | font-size: 12px; | 489 | font-size: 12px; |
489 | color: #333333; | 490 | color: #333333; |
490 | } | 491 | } |
491 | } | 492 | } |
492 | } | 493 | } |
493 | } | 494 | } |
494 | .someItem { | 495 | .someItem { |
495 | width: 100%; | 496 | width: 100%; |
496 | height: 336rpx; | 497 | height: 336rpx; |
497 | background: #ffffff; | 498 | background: #ffffff; |
498 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); | 499 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); |
499 | border-radius: 6px; | 500 | border-radius: 6px; |
500 | border-radius: 6px; | 501 | border-radius: 6px; |
501 | margin-bottom: 18rpx; | 502 | margin-bottom: 18rpx; |
502 | box-sizing: border-box; | 503 | box-sizing: border-box; |
503 | padding: 21rpx 48rpx 21rpx 42rpx; | 504 | padding: 21rpx 48rpx 21rpx 42rpx; |
504 | box-sizing: border-box; | 505 | box-sizing: border-box; |
505 | display: flex; | 506 | display: flex; |
506 | flex-direction: column; | 507 | flex-direction: column; |
507 | justify-content: space-between; | 508 | justify-content: space-between; |
508 | align-items: center; | 509 | align-items: center; |
509 | .item { | 510 | .item { |
510 | display: flex; | 511 | display: flex; |
511 | justify-content: space-between; | 512 | justify-content: space-between; |
512 | border-bottom: 1px solid #f2f2f2; | 513 | border-bottom: 1px solid #f2f2f2; |
513 | align-items: center; | 514 | align-items: center; |
514 | height: 72rpx; | 515 | height: 72rpx; |
515 | width: 100%; | 516 | width: 100%; |
516 | .left { | 517 | .left { |
517 | font-size: 14px; | 518 | font-size: 14px; |
518 | color: #333333; | 519 | color: #333333; |
519 | display: flex; | 520 | display: flex; |
520 | align-items: center; | 521 | align-items: center; |
521 | image { | 522 | image { |
522 | margin-right: 32rpx; | 523 | margin-right: 32rpx; |
523 | width: 30rpx; | 524 | width: 30rpx; |
524 | height: 34rpx; | 525 | height: 34rpx; |
525 | } | 526 | } |
526 | } | 527 | } |
527 | image { | 528 | image { |
528 | height: 16px; | 529 | height: 16px; |
529 | width: 8px; | 530 | width: 8px; |
530 | } | 531 | } |
531 | } | 532 | } |
532 | } | 533 | } |
533 | .recommend { | 534 | .recommend { |
534 | background: #ffffff; | 535 | background: #ffffff; |
535 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); | 536 | box-shadow: 0 0 4px 0 rgba(133, 107, 107, 0.1); |
536 | border-radius: 6px; | 537 | border-radius: 6px; |
537 | border-radius: 6px; | 538 | border-radius: 6px; |
538 | width: 100%; | 539 | width: 100%; |
539 | .title { | 540 | .title { |
540 | display: flex; | 541 | display: flex; |
541 | flex-direction: row; | 542 | flex-direction: row; |
542 | align-items: center; | 543 | align-items: center; |
543 | justify-content: space-between; | 544 | justify-content: space-between; |
544 | padding: 20rpx 40rpx; | 545 | padding: 20rpx 40rpx; |
545 | .line { | 546 | .line { |
546 | width: 264rpx; | 547 | width: 264rpx; |
547 | height: 1rpx; | 548 | height: 1rpx; |
548 | border-bottom: 1px solid #eaeaea; | 549 | border-bottom: 1px solid #eaeaea; |
549 | } | 550 | } |
550 | .text { | 551 | .text { |
551 | font-family: PingFangSC-Medium; | 552 | font-family: PingFangSC-Medium; |
552 | font-size: 14px; | 553 | font-size: 14px; |
553 | color: #333333; | 554 | color: #333333; |
554 | letter-spacing: -0.26px; | 555 | letter-spacing: -0.26px; |
555 | text-align: justify; | 556 | text-align: justify; |
556 | line-height: 24px; | 557 | line-height: 24px; |
557 | } | 558 | } |
558 | } | 559 | } |
559 | .goods-list { | 560 | .goods-list { |
560 | .loading-text { | 561 | .loading-text { |
561 | width: 100%; | 562 | width: 100%; |
562 | display: flex; | 563 | display: flex; |
563 | justify-content: center; | 564 | justify-content: center; |
564 | align-items: center; | 565 | align-items: center; |
565 | height: 30px; | 566 | height: 30px; |
566 | color: #979797; | 567 | color: #979797; |
567 | font-size: 12px; | 568 | font-size: 12px; |
568 | } | 569 | } |
569 | .product-list { | 570 | .product-list { |
570 | width: 92%; | 571 | width: 92%; |
571 | padding: 0 4% 3vw 4%; | 572 | padding: 0 4% 3vw 4%; |
572 | display: flex; | 573 | display: flex; |
573 | justify-content: space-between; | 574 | justify-content: space-between; |
574 | flex-wrap: wrap; | 575 | flex-wrap: wrap; |
575 | height: 400px; | 576 | height: 400px; |
576 | .product { | 577 | .product { |
577 | width: 48%; | 578 | width: 48%; |
578 | margin: 0 0 20rpx 0; | 579 | margin: 0 0 20rpx 0; |
579 | background: #ffffff; | 580 | background: #ffffff; |
580 | border: 1px solid #f2f2f2; | 581 | border: 1px solid #f2f2f2; |
581 | } | 582 | } |
582 | } | 583 | } |
583 | } | 584 | } |
584 | } | 585 | } |
585 | .auth { | 586 | .auth { |
586 | height: 100vh; | 587 | height: 100vh; |
587 | display: flex; | 588 | display: flex; |
588 | flex-direction: column; | 589 | flex-direction: column; |
589 | align-items: center; | 590 | align-items: center; |
590 | .icon { | 591 | .icon { |
591 | width: 140rpx; | 592 | width: 140rpx; |
592 | height: 140rpx; | 593 | height: 140rpx; |
593 | border-radius: 50%; | 594 | border-radius: 50%; |
594 | margin-top: 100rpx; | 595 | margin-top: 100rpx; |
595 | background-color: grey; | 596 | background-color: grey; |
596 | } | 597 | } |
597 | .divider { | 598 | .divider { |
598 | height: 1rpx; | 599 | height: 1rpx; |
599 | width: 600rpx; | 600 | width: 600rpx; |
600 | margin-top: 80rpx; | 601 | margin-top: 80rpx; |
601 | background-color: #e6e3e3; | 602 | background-color: #e6e3e3; |
602 | } | 603 | } |
603 | .title { | 604 | .title { |
604 | width: 600rpx; | 605 | width: 600rpx; |
605 | margin-top: 50rpx; | 606 | margin-top: 50rpx; |
606 | text-align: left; | 607 | text-align: left; |
607 | } | 608 | } |
608 | .text { | 609 | .text { |
609 | width: 600rpx; | 610 | width: 600rpx; |
610 | margin-top: 30rpx; | 611 | margin-top: 30rpx; |
611 | text-align: left; | 612 | text-align: left; |
612 | color: #e6e3e3; | 613 | color: #e6e3e3; |
613 | } | 614 | } |
614 | button { | 615 | button { |
615 | width: 450rpx; | 616 | width: 450rpx; |
616 | height: 80rpx; | 617 | height: 80rpx; |
617 | line-height: 80rpx; | 618 | line-height: 80rpx; |
618 | margin-top: 80rpx; | 619 | margin-top: 80rpx; |
619 | border-radius: 30rpx; | 620 | border-radius: 30rpx; |
620 | } | 621 | } |
621 | } | 622 | } |
622 | .closeBtn { | 623 | .closeBtn { |
623 | height: 28rpx; | 624 | height: 28rpx; |
624 | width: 28rpx; | 625 | width: 28rpx; |
625 | // border: 1px solid red; | 626 | // border: 1px solid red; |
626 | position: absolute; | 627 | position: absolute; |
627 | top: 20rpx; | 628 | top: 20rpx; |
628 | right: 10rpx; | 629 | right: 10rpx; |
629 | } | 630 | } |
630 | </style> | 631 | </style> |
631 | 632 |
src/store/modules/cart.js
1 | import urlAlias from '../url' | 1 | import urlAlias from '../url' |
2 | import request from '../request' | 2 | import request from '../request' |
3 | 3 | ||
4 | const { cartList, cartModi, cartDel, cartAdd } = urlAlias | 4 | const { cartList, cartModi, cartDel, cartAdd } = urlAlias |
5 | 5 | ||
6 | const state = { | 6 | const state = { |
7 | cartList: [] | 7 | cartList: [] |
8 | } | 8 | } |
9 | 9 | ||
10 | const mutations = { | 10 | const mutations = { |
11 | INIT: (state, cartList) => { | 11 | INIT: (state, cartList) => { |
12 | state.cartList = cartList | 12 | state.cartList = cartList |
13 | }, | 13 | }, |
14 | DEL: (state, index) => { | 14 | DEL: (state, index) => { |
15 | console.log('mutations====>', state.cartList) | 15 | console.log('mutations====>', state.cartList) |
16 | state.cartList.splice(index, 1) | 16 | state.cartList.splice(index, 1) |
17 | console.log('mutations====>index', index) | 17 | console.log('mutations====>index', index) |
18 | // state.cartList=delList | 18 | // state.cartList=delList |
19 | }, | 19 | }, |
20 | MODI: (state, args) => { | 20 | MODI: (state, args) => { |
21 | console.log('the num', state.cartList[args.index].num) | 21 | console.log('the num', state.cartList[args.index].num) |
22 | console.log('mutations====>isadd', args) | 22 | console.log('mutations====>isadd', args) |
23 | state.cartList[args.index].num = args.num | 23 | state.cartList[args.index].num = args.num |
24 | console.log('the num', state.cartList[args.index].num) | 24 | console.log('the num', state.cartList[args.index].num) |
25 | } | 25 | } |
26 | 26 | ||
27 | } | 27 | } |
28 | 28 | ||
29 | const actions = { | 29 | const actions = { |
30 | getCartList({ commit }, param) { | 30 | getCartList({ commit }, param) { |
31 | request({ | 31 | request({ |
32 | url: cartList, | 32 | url: cartList, |
33 | data: param, | 33 | data: param, |
34 | success: (res) => { | 34 | success: (res) => { |
35 | console.log('cart===>接口数据', res.data.data) | 35 | console.log('cart===>接口数据', res.data.data) |
36 | // const resData = { | ||
37 | // ...res, | ||
38 | // data, | ||
39 | // } | ||
40 | commit('INIT', res.data.data) | 36 | commit('INIT', res.data.data) |
41 | }, | 37 | }, |
42 | fail: (res) => { | 38 | fail: (res) => { |
43 | console.log('fail status === > ', res) | 39 | console.log('fail status === > ', res) |
44 | }, | 40 | }, |
45 | complete: (res) => { | 41 | complete: (res) => { |
46 | console.log('complete status === > ', res) | 42 | console.log('complete status === > ', res) |
47 | } | 43 | } |
48 | }) | 44 | }) |
49 | }, | 45 | }, |
50 | 46 | ||
51 | modiCart({ commit }, param) { | 47 | modiCart({ commit }, param) { |
52 | const arg = Object.assign({ num: param.num }, param.args) | 48 | const arg = Object.assign({ num: param.num }, param.args) |
53 | delete param.args | 49 | delete param.args |
54 | request({ | 50 | request({ |
55 | url: cartModi, | 51 | url: cartModi, |
56 | data: param, | 52 | data: param, |
57 | success: (res) => { | 53 | success: (res) => { |
58 | console.log('modiCart-res=====>', res.data) | 54 | console.log('modiCart-res=====>', res.data) |
59 | console.log('modi-parm', param) | 55 | console.log('modi-parm', param) |
60 | commit('MODI', arg) | 56 | commit('MODI', arg) |
61 | }, | 57 | }, |
62 | fail: (res) => { | 58 | fail: (res) => { |
63 | console.log('fail status === > ', res) | 59 | console.log('fail status === > ', res) |
64 | }, | 60 | }, |
65 | complete: (res) => { | 61 | complete: (res) => { |
66 | console.log('complete status === > ', res) | 62 | console.log('complete status === > ', res) |
67 | } | 63 | } |
68 | }) | 64 | }) |
69 | }, | 65 | }, |
70 | 66 | ||
71 | delCart({ commit }, param) { | 67 | delCart({ commit }, param) { |
72 | const arg = param.arg | 68 | const arg = param.arg |
73 | delete param.arg | 69 | delete param.arg |
74 | request({ | 70 | request({ |
75 | url: cartDel, | 71 | url: cartDel, |
76 | data: param, | 72 | data: param, |
77 | success: (res) => { | 73 | success: (res) => { |
78 | console.log('del-parm', param) | 74 | console.log('del-parm', param) |
79 | console.log('del-myparms==>', arg) | 75 | console.log('del-myparms==>', arg) |
80 | // console.log('deacart====>cartList',this.$store.state.cart.cartList) | ||
81 | |||
82 | commit('DEL', arg) | 76 | commit('DEL', arg) |
83 | }, | 77 | }, |
84 | fail: (res) => { | 78 | fail: (res) => { |
85 | console.log('fail status === > ', res) | 79 | console.log('fail status === > ', res) |
86 | }, | 80 | }, |
87 | complete: (res) => { | 81 | complete: (res) => { |
88 | console.log('complete status === > ', res) | 82 | console.log('complete status === > ', res) |
89 | } | 83 | } |
90 | }) | 84 | }) |
91 | }, | 85 | }, |
92 | 86 | ||
93 | addCart({ commit }, param) { | 87 | addCart({ commit }, param) { |
94 | console.log('请求接口开始') | 88 | console.log('请求接口开始') |
95 | request({ | 89 | request({ |
96 | url: cartAdd, | 90 | url: cartAdd, |
97 | data: param, | 91 | data: param, |
98 | success: (res) => { | 92 | success: (res) => { |
99 | console.log('add-parm', param) | 93 | console.log('add-parm', param) |
100 | console.log('addcart===>res.data===>', res.data) | 94 | console.log('addcart===>res.data===>', res.data) |
101 | // commit('INIT', res.data.data) | 95 | // commit('INIT', res.data.data) |
102 | }, | 96 | }, |
103 | fail: (res) => { | 97 | fail: (res) => { |
104 | console.log('fail status === > ', res) | 98 | console.log('fail status === > ', res) |
105 | }, | 99 | }, |
106 | complete: (res) => { | 100 | complete: (res) => { |
107 | console.log('complete status === > ', res) | 101 | console.log('complete status === > ', res) |
108 | } | 102 | } |
109 | }) | 103 | }) |
110 | } | 104 | } |
111 | 105 | ||
112 | } | 106 | } |
113 | 107 | ||
114 | export default { | 108 | export default { |
115 | namespaced: true, | 109 | namespaced: true, |
116 | state, | 110 | state, |
117 | mutations, | 111 | mutations, |
118 | actions | 112 | actions |
119 | } | 113 | } |
120 | 114 |