Commit c4494f932d6cd5a7e5ef737696b305053751d43a
Exists in
master
修改冲突
Showing
13 changed files
Show diff stats
package.json
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | "dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch", |
23 | 23 | "dev:mp-qq": "cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch", |
24 | 24 | "dev:mp-toutiao": "cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch", |
25 | - "dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch", | |
25 | + "dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch --minimize", | |
26 | 26 | "dev:quickapp-light": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-light vue-cli-service uni-build --watch", |
27 | 27 | "dev:quickapp-vue": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-vue vue-cli-service uni-build --watch", |
28 | 28 | "info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js", |
... | ... | @@ -91,4 +91,4 @@ |
91 | 91 | "uni-app": { |
92 | 92 | "scripts": {} |
93 | 93 | } |
94 | 94 | -} |
95 | +} | |
95 | 96 | \ No newline at end of file | ... | ... |
src/pages.json
... | ... | @@ -18,24 +18,24 @@ |
18 | 18 | "navigationBarTitleText": "验光数据" |
19 | 19 | } |
20 | 20 | }, |
21 | - { | |
22 | - "path": "pages/detailsChoiceArgs/detailsChoiceArgs", | |
23 | - "style": { | |
24 | - "navigationBarTitleText": "镜片名称名称" | |
25 | - } | |
26 | - }, | |
27 | - { | |
28 | - "path": "pages/purchaseLenses/purchaseLenses", | |
29 | - "style": { | |
30 | - "navigationBarTitleText": "参数选择" | |
31 | - } | |
32 | - }, | |
33 | - { | |
34 | - "path": "pages/lensDetails/lensDetails", | |
35 | - "style": { | |
36 | - "navigationBarTitleText": "产品详情" | |
37 | - } | |
38 | - }, | |
21 | + // { | |
22 | + // "path": "pages/detailsChoiceArgs/detailsChoiceArgs", | |
23 | + // "style": { | |
24 | + // "navigationBarTitleText": "镜片名称名称" | |
25 | + // } | |
26 | + // }, | |
27 | + // { | |
28 | + // "path": "pages/purchaseLenses/purchaseLenses", | |
29 | + // "style": { | |
30 | + // "navigationBarTitleText": "参数选择" | |
31 | + // } | |
32 | + // }, | |
33 | + // { | |
34 | + // "path": "pages/lensDetails/lensDetails", | |
35 | + // "style": { | |
36 | + // "navigationBarTitleText": "产品详情" | |
37 | + // } | |
38 | + // }, | |
39 | 39 | { |
40 | 40 | "path": "pages/details/details", |
41 | 41 | "style": { |
... | ... | @@ -57,20 +57,20 @@ |
57 | 57 | { |
58 | 58 | "path": "pages/cart/cart", |
59 | 59 | "style": { |
60 | - "navigationBarTitleText": "购物车", | |
61 | - // "disableScroll":true, | |
62 | - "app-plus":{ | |
63 | - "bounce":"none" | |
64 | - } | |
65 | - } | |
66 | - }, | |
67 | - { | |
68 | - "path": "pages/frameDetail/frameDetail", | |
69 | - "style": { | |
70 | - "navigationBarTitleText": "产品详情" | |
60 | + "navigationBarTitleText": "购物车", | |
61 | + // "disableScroll":true, | |
62 | + "app-plus": { | |
63 | + "bounce": "none" | |
64 | + } | |
71 | 65 | } |
72 | 66 | }, |
73 | 67 | // { |
68 | + // "path": "pages/frameDetail/frameDetail", | |
69 | + // "style": { | |
70 | + // "navigationBarTitleText": "产品详情" | |
71 | + // } | |
72 | + // }, | |
73 | + // { | |
74 | 74 | // "path": "pages/refundProgress/refundProgress", |
75 | 75 | // "style": { |
76 | 76 | // "navigationBarTitleText": "申请退款" |
... | ... | @@ -112,24 +112,24 @@ |
112 | 112 | "navigationBarTitleText": "待发货" |
113 | 113 | } |
114 | 114 | }, |
115 | - { | |
116 | - "path": "pages/customerService/customerService", | |
117 | - "style": { | |
118 | - "navigationBarTitleText": "在线客服" | |
119 | - } | |
120 | - }, | |
121 | - { | |
122 | - "path": "pages/detailStandard/detailStandard_sun", | |
123 | - "style": { | |
124 | - "navigationBarTitleText": "太阳镜选购页" | |
125 | - } | |
126 | - }, | |
127 | - { | |
128 | - "path": "pages/detailStandard/detailStandard_k", | |
129 | - "style": { | |
130 | - "navigationBarTitleText": "镜框选购页" | |
131 | - } | |
132 | - }, | |
115 | + // { | |
116 | + // "path": "pages/customerService/customerService", | |
117 | + // "style": { | |
118 | + // "navigationBarTitleText": "在线客服" | |
119 | + // } | |
120 | + // }, | |
121 | + // { | |
122 | + // "path": "pages/detailStandard/detailStandard_sun", | |
123 | + // "style": { | |
124 | + // "navigationBarTitleText": "太阳镜选购页" | |
125 | + // } | |
126 | + // }, | |
127 | + // { | |
128 | + // "path": "pages/detailStandard/detailStandard_k", | |
129 | + // "style": { | |
130 | + // "navigationBarTitleText": "镜框选购页" | |
131 | + // } | |
132 | + // }, | |
133 | 133 | { |
134 | 134 | "path": "pages/newOpticsData/newOpticsData", |
135 | 135 | "style": { |
... | ... | @@ -139,29 +139,50 @@ |
139 | 139 | ], |
140 | 140 | "subpackages": [ |
141 | 141 | { |
142 | - "root": "pages/refundment", | |
142 | + "root": "refundment", | |
143 | 143 | "pages": [ |
144 | - "pages/refundment/refundWays", | |
145 | - "pages/refundment/refundment", | |
146 | - "pages/refundProgress/refundProgress" | |
144 | + { | |
145 | + "path": "refundWays", | |
146 | + "style": {} | |
147 | + }, | |
148 | + { | |
149 | + "path": "refundment", | |
150 | + "style": {} | |
151 | + }, | |
152 | + { | |
153 | + "path": "/pages/refundProgress/refundProgress", | |
154 | + "style": {} | |
155 | + } | |
147 | 156 | ] |
148 | 157 | }, |
149 | 158 | { |
150 | - "root": "pages/address", | |
159 | + "root": "address", | |
151 | 160 | "name": "pack2", |
152 | 161 | "pages": [ |
153 | - "pages/address/addAddress", | |
154 | - "pages/address/addressList" | |
155 | - ] | |
156 | - }, | |
157 | - { | |
158 | - "root": "pages/myOrder", | |
159 | - "name": "pack3", | |
160 | - "pages": [ | |
161 | - "pages/myOrder/myOrder", | |
162 | - "pages/myOrderPaying/myOrderPaying" | |
162 | + { | |
163 | + "path": "addAddress", | |
164 | + "style": {} | |
165 | + }, | |
166 | + { | |
167 | + "path": "addressList", | |
168 | + "style": {} | |
169 | + } | |
163 | 170 | ] |
164 | 171 | } |
172 | + // { | |
173 | + // "root": "pages/myOrder", | |
174 | + // "name": "pack3", | |
175 | + // "pages": [ | |
176 | + // { | |
177 | + // "path": "pages/myOrder/myOrder", | |
178 | + // "style": {} | |
179 | + // }, | |
180 | + // { | |
181 | + // "path": "pages/myOrderPaying/myOrderPaying", | |
182 | + // "style": {} | |
183 | + // } | |
184 | + // ] | |
185 | + // } | |
165 | 186 | ], |
166 | 187 | "globalStyle": { |
167 | 188 | "navigationBarTextStyle": "black", | ... | ... |
src/pages/cart/cart.vue
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | <view class="cardHeader"> |
9 | 9 | <view |
10 | 10 | v-bind:class="pIsoPen? 'partentChecked' : 'partentCheck'" |
11 | - @click="pClick" | |
11 | + @click="pClick" | |
12 | 12 | > |
13 | 13 | <span class="correct"></span> |
14 | 14 | </view> |
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | > |
27 | 27 | <view |
28 | 28 | v-bind:class="cartList[index].isChecked? 'partentChecked':'partentCheck'" |
29 | - @click="childClick(cartList[index],index)" | |
29 | + @click="childClick(cartList[index],index)" | |
30 | 30 | > |
31 | 31 | <span class="correct"></span> |
32 | 32 | </view> |
... | ... | @@ -46,18 +46,25 @@ |
46 | 46 | class="goodName" |
47 | 47 | @tap="toGoods(item.pid,item.sk_id)" |
48 | 48 | >{{item.p_name}}</view> |
49 | - <view class="describ" @click="showBottom(3,item.pid,item.sk_id,item.mp_id,item.cart_id,index)"> | |
50 | - <view class="desL"> | |
51 | - <view class="people"> | |
52 | - 使用人:{{item.peopleName}} | |
53 | - </view> | |
54 | - <view class="skuInfo"> | |
55 | - {{item.sku_name}} | |
56 | - </view> | |
57 | - </view> | |
58 | - <view class="desR"> | |
59 | - <image src="../../static/right.png" mode="aspectFit" style="width: 18rpx;height: 18rpx;"></image> | |
60 | - </view> | |
49 | + <view | |
50 | + class="describ" | |
51 | + @click="showBottom(3,item.pid,item.sk_id,item.mp_id,item.cart_id,index)" | |
52 | + > | |
53 | + <view class="desL"> | |
54 | + <view class="people"> | |
55 | + 使用人:{{item.peopleName}} | |
56 | + </view> | |
57 | + <view class="skuInfo"> | |
58 | + {{item.sku_name}} | |
59 | + </view> | |
60 | + </view> | |
61 | + <view class="desR"> | |
62 | + <image | |
63 | + src="../../static/right.png" | |
64 | + mode="aspectFit" | |
65 | + style="width: 18rpx;height: 18rpx;" | |
66 | + ></image> | |
67 | + </view> | |
61 | 68 | </view> |
62 | 69 | <view class="priceBox"> |
63 | 70 | <view class="price">¥{{item.nowPrice*item.num}}</view> |
... | ... | @@ -86,87 +93,101 @@ |
86 | 93 | <view class="footer"> |
87 | 94 | <view class="footerLeft">实付金额:<text>¥{{totalPrice}}</text></view> |
88 | 95 | <view class="footerRight"> |
89 | - <view class="paybtn" @click="toComfirmOrder">立即结算</view> | |
96 | + <view | |
97 | + class="paybtn" | |
98 | + @click="toComfirmOrder" | |
99 | + >立即结算</view> | |
90 | 100 | </view> |
91 | 101 | </view> |
92 | - <BottomSheet v-if="isShowBottom" :isCart="isCart" @addCart="addCart" :sk_id="sk_id" :propMpId="mp_id" @chooseCartModi="chooseCartModi" :cart_id="cart_id" | |
93 | - :index="cartIndex" | |
94 | - :pid="pid" :goodInfo="goodInfo" :isShowBottom="isShowBottom" @closeBottom="closeBottom"></BottomSheet> | |
102 | + <BottomSheet | |
103 | + v-if="isShowBottom" | |
104 | + :isCart="isCart" | |
105 | + @addCart="addCart" | |
106 | + :sk_id="sk_id" | |
107 | + :propMpId="mp_id" | |
108 | + @chooseCartModi="chooseCartModi" | |
109 | + :cart_id="cart_id" | |
110 | + :index="cartIndex" | |
111 | + :pid="pid" | |
112 | + :goodInfo="goodInfo" | |
113 | + :isShowBottom="isShowBottom" | |
114 | + @closeBottom="closeBottom" | |
115 | + ></BottomSheet> | |
95 | 116 | </view> |
96 | 117 | </template> |
97 | 118 | |
98 | 119 | <script> |
99 | 120 | |
100 | 121 | import store from '@/store' |
101 | -import BottomSheet from '../../components/BottomSheet/BottomSheet.vue'; | |
102 | -export default { | |
103 | - components:{ | |
104 | - BottomSheet, | |
105 | - }, | |
122 | +import BottomSheet from '../../components/BottomSheet/BottomSheet.vue' | |
123 | +export default { | |
124 | + components: { | |
125 | + BottomSheet, | |
126 | + }, | |
106 | 127 | data() { |
107 | 128 | return { |
108 | - pid:Number, | |
109 | - isCart:Number, | |
110 | - sk_id:String, | |
111 | - mp_id:String, | |
112 | - isShowBottom : false, //底部弹窗开关 | |
113 | - cart_id:Number, | |
114 | - maxCount: 20, | |
115 | - cartIndex:Number, | |
116 | - cartList:[] | |
129 | + pid: Number, | |
130 | + isCart: Number, | |
131 | + sk_id: String, | |
132 | + mp_id: String, | |
133 | + isShowBottom: false, // 底部弹窗开关 | |
134 | + cart_id: Number, | |
135 | + maxCount: 20, | |
136 | + cartIndex: Number, | |
137 | + cartList: [], | |
117 | 138 | } |
118 | 139 | }, |
119 | 140 | computed: { |
120 | - pIsoPen (){ | |
121 | - if (this.cartList.length > 0){ | |
122 | - return this.cartList.find(item => !item.isChecked) ? false : true; | |
123 | - } | |
124 | - return false | |
125 | - }, | |
126 | - goodInfo () { | |
141 | + pIsoPen () { | |
142 | + if (this.cartList.length > 0) { | |
143 | + return !this.cartList.find(item => !item.isChecked) | |
144 | + } | |
145 | + return false | |
146 | + }, | |
147 | + goodInfo () { | |
127 | 148 | return this.$store.state.read.goodInfo |
128 | - }, | |
129 | - totalPrice() { | |
130 | - let totalPrice = 0 | |
131 | - this.cartList.forEach((item)=>{ | |
132 | - if(item.isChecked){ | |
133 | - totalPrice += item.nowPrice * item.num; | |
149 | + }, | |
150 | + totalPrice() { | |
151 | + let totalPrice = 0 | |
152 | + this.cartList.forEach((item) => { | |
153 | + if (item.isChecked) { | |
154 | + totalPrice += item.nowPrice * item.num | |
134 | 155 | } |
135 | - }) | |
136 | - return totalPrice | |
137 | - } | |
138 | - }, | |
156 | + }) | |
157 | + return totalPrice | |
158 | + }, | |
159 | + }, | |
139 | 160 | onShow() { |
140 | - this.cartList = this.$store.state.cart.cartList; | |
161 | + this.cartList = this.$store.state.cart.cartList | |
141 | 162 | }, |
142 | 163 | onLoad: async function() { |
143 | 164 | await this.$store.dispatch('cart/getCartList', { |
144 | 165 | uid: this.$store.state.user.userInfo.uid, // 用户id |
145 | 166 | }) |
146 | - | |
147 | - this.cartList = this.$store.state.cart.cartList; | |
148 | - this.cartList.forEach((item)=>{ | |
167 | + | |
168 | + this.cartList = this.$store.state.cart.cartList | |
169 | + this.cartList.forEach((item) => { | |
149 | 170 | item.isChecked = false |
150 | - }) | |
171 | + }) | |
151 | 172 | }, |
152 | 173 | methods: { |
153 | - //全选按钮 | |
154 | - pClick(){ | |
155 | - let pStatus = this.cartList.find(item => !item.isChecked) ? false : true | |
156 | - let oldList = this.cartList; | |
157 | - oldList.forEach((item, index)=>{ | |
174 | + // 全选按钮 | |
175 | + pClick() { | |
176 | + const pStatus = !this.cartList.find(item => !item.isChecked) | |
177 | + const oldList = this.cartList | |
178 | + oldList.forEach((item, index) => { | |
158 | 179 | item.isChecked = !pStatus |
159 | - this.cartList.splice(index,1, item) | |
180 | + this.cartList.splice(index, 1, item) | |
160 | 181 | }) |
161 | 182 | }, |
162 | - //单选按钮 | |
163 | - childClick(type,index){ | |
183 | + // 单选按钮 | |
184 | + childClick(type, index) { | |
164 | 185 | this.cartList[index].isChecked = !this.cartList[index].isChecked |
165 | - //vue没有办法监听数组内部值的变化,所以需要通过这个方法去触发 | |
166 | - this.cartList.splice(index,1, this.cartList[index]) | |
186 | + // vue没有办法监听数组内部值的变化,所以需要通过这个方法去触发 | |
187 | + this.cartList.splice(index, 1, this.cartList[index]) | |
167 | 188 | }, |
168 | - //修改购物车 | |
169 | - chooseCartModi(mp_id,sk_id,price,pid,num,cart_id,index){ | |
189 | + // 修改购物车 | |
190 | + chooseCartModi(mp_id, sk_id, price, pid, num, cart_id, index) { | |
170 | 191 | // console.log('modi',mp_id,sk_id,price,pid,num,cart_id) |
171 | 192 | store.dispatch('cart/modiCart', { |
172 | 193 | uid: this.$store.state.user.userInfo.uid, |
... | ... | @@ -177,57 +198,57 @@ export default { |
177 | 198 | pid: pid, |
178 | 199 | num: num, |
179 | 200 | cart_id: cart_id, |
180 | - args: { | |
201 | + args: { | |
181 | 202 | index: index, |
182 | - }, | |
183 | - }) | |
184 | - this.$nextTick(function(){ | |
185 | - store.dispatch('cart/getCartList', { | |
186 | - uid: this.$store.state.user.userInfo.uid, // 用户id | |
187 | - }).then(()=>{ | |
188 | - this.cartList = this.$store.state.cart.cartList; | |
189 | - }) | |
203 | + }, | |
204 | + }) | |
205 | + this.$nextTick(function() { | |
206 | + store.dispatch('cart/getCartList', { | |
207 | + uid: this.$store.state.user.userInfo.uid, // 用户id | |
208 | + }).then(() => { | |
209 | + this.cartList = this.$store.state.cart.cartList | |
210 | + }) | |
190 | 211 | }) |
191 | 212 | }, |
192 | - //底部弹窗开关 | |
193 | - showBottom(isCart,pid,skId,mp_id,cart_id,index){ | |
213 | + // 底部弹窗开关 | |
214 | + showBottom(isCart, pid, skId, mp_id, cart_id, index) { | |
194 | 215 | store.dispatch('read/fetch', { |
195 | - pid, | |
196 | - sk_id: skId, | |
197 | - }).then(()=>{ | |
216 | + pid, | |
217 | + sk_id: skId, | |
218 | + }).then(() => { | |
198 | 219 | this.cartIndex = index |
199 | - this.sk_id = skId; | |
200 | - this.pid = pid; | |
201 | - this.mp_id = mp_id; | |
202 | - this.isCart = isCart; | |
203 | - this.cart_id = cart_id; | |
204 | - this.isShowBottom = true; | |
220 | + this.sk_id = skId | |
221 | + this.pid = pid | |
222 | + this.mp_id = mp_id | |
223 | + this.isCart = isCart | |
224 | + this.cart_id = cart_id | |
225 | + this.isShowBottom = true | |
205 | 226 | }) |
206 | 227 | }, |
207 | - closeBottom(){ | |
208 | - this.isShowBottom = false; | |
228 | + closeBottom() { | |
229 | + this.isShowBottom = false | |
209 | 230 | }, |
210 | - toGoods(id, sk_id) { | |
231 | + toGoods(id, skId) { | |
211 | 232 | uni.navigateTo({ |
212 | - url: '../frameDetail/frameDetail?pid=' + id + '&sk_id=' + sk_id, | |
233 | + url: '../details/details?pid=' + id + '&sk_id=' + skId, | |
213 | 234 | success: res => {}, |
214 | 235 | fail: () => {}, |
215 | 236 | complete: () => {}, |
216 | 237 | }) |
217 | 238 | }, |
218 | - toComfirmOrder(){ | |
219 | - this.$store.state.cart.checkedCartLst = this.cartList.filter(item => item.isChecked) | |
220 | - if(this.$store.state.cart.checkedCartLst.length>0){ | |
221 | - uni.navigateTo({ | |
222 | - url:`../confirmOrder/confirmOrder?isCart=true`, | |
223 | - }) | |
224 | - }else{ | |
225 | - uni.showToast({ | |
226 | - title:'您还没有选择宝贝哦~', | |
227 | - icon:'none' | |
228 | - }) | |
229 | - } | |
230 | - }, | |
239 | + toComfirmOrder() { | |
240 | + this.$store.state.cart.checkedCartLst = this.cartList.filter(item => item.isChecked) | |
241 | + if (this.$store.state.cart.checkedCartLst.length > 0) { | |
242 | + uni.navigateTo({ | |
243 | + url: '../confirmOrder/confirmOrder?isCart=true', | |
244 | + }) | |
245 | + } else { | |
246 | + uni.showToast({ | |
247 | + title: '您还没有选择宝贝哦~', | |
248 | + icon: 'none', | |
249 | + }) | |
250 | + } | |
251 | + }, | |
231 | 252 | counter(index, isadd, item) { |
232 | 253 | // console.log('item=====>', item) |
233 | 254 | // console.log('num=====>', item.num) |
... | ... | @@ -258,7 +279,7 @@ export default { |
258 | 279 | this.desDisabled = true |
259 | 280 | } else { |
260 | 281 | this.desDisabled = false |
261 | - | |
282 | + | |
262 | 283 | store.dispatch('cart/modiCart', { |
263 | 284 | uid: this.$store.state.user.userInfo.uid, |
264 | 285 | openid: this.$store.state.user.userInfo.openid, |
... | ... | @@ -276,14 +297,13 @@ export default { |
276 | 297 | this.desDisabled = true |
277 | 298 | } |
278 | 299 | } |
279 | - | |
280 | 300 | }, |
281 | 301 | delCart(cart_id, index) { |
282 | 302 | cart_id = parseInt(cart_id) |
283 | 303 | uni.showModal({ |
284 | 304 | title: '是否删除该商品', |
285 | 305 | success: function (res) { |
286 | - if (res.confirm) { | |
306 | + if (res.confirm) { | |
287 | 307 | store.dispatch('cart/delCart', { |
288 | 308 | uid: this.$store.state.user.userInfo.uid, |
289 | 309 | openid: this.$store.state.user.userInfo.openid, |
... | ... | @@ -292,7 +312,7 @@ export default { |
292 | 312 | }) |
293 | 313 | } |
294 | 314 | }.bind(this), |
295 | - }) | |
315 | + }) | |
296 | 316 | // this.cartList.splice(index,1) |
297 | 317 | }, |
298 | 318 | }, |
... | ... | @@ -407,7 +427,7 @@ export default { |
407 | 427 | align-items: flex-start; |
408 | 428 | justify-content: space-between; |
409 | 429 | min-height: 240rpx; |
410 | - width: 100%; | |
430 | + width: 100%; | |
411 | 431 | .goodName { |
412 | 432 | display: -webkit-box; |
413 | 433 | -webkit-box-orient: vertical; |
... | ... | @@ -420,23 +440,21 @@ export default { |
420 | 440 | .describ { |
421 | 441 | width: 100%; |
422 | 442 | min-height: 80rpx; |
423 | - background: #F9F9F9; | |
424 | - border-radius: 2px; | |
443 | + background: #f9f9f9; | |
444 | + border-radius: 2px; | |
425 | 445 | box-sizing: border-box; |
426 | 446 | padding: 10rpx; |
427 | 447 | font-size: 20rpx; |
428 | 448 | letter-spacing: -0.23px; |
429 | 449 | color: #999999; |
430 | - display: flex; | |
431 | - justify-content: space-between; | |
432 | - align-items: center; | |
433 | - .desL{ | |
434 | - | |
435 | - view{ | |
436 | - margin: 10rpx 0 10rpx 0 ; | |
437 | - } | |
438 | - } | |
439 | - | |
450 | + display: flex; | |
451 | + justify-content: space-between; | |
452 | + align-items: center; | |
453 | + .desL { | |
454 | + view { | |
455 | + margin: 10rpx 0 10rpx 0; | |
456 | + } | |
457 | + } | |
440 | 458 | } |
441 | 459 | .priceBox { |
442 | 460 | display: flex; |
... | ... | @@ -519,9 +537,9 @@ export default { |
519 | 537 | } |
520 | 538 | } |
521 | 539 | /* 隐藏滚动条 */ |
522 | - ::-webkit-scrollbar { | |
523 | - width: 0; | |
524 | - height: 0; | |
525 | - color: transparent; | |
526 | - } | |
527 | -</style> | |
528 | 540 | \ No newline at end of file |
541 | +::-webkit-scrollbar { | |
542 | + width: 0; | |
543 | + height: 0; | |
544 | + color: transparent; | |
545 | +} | |
546 | +</style> | ... | ... |
src/pages/details/details.vue
... | ... | @@ -371,10 +371,9 @@ export default { |
371 | 371 | } else { |
372 | 372 | myName = '【' + myName + '】' |
373 | 373 | } |
374 | - const uid = uni.getStorageSync('uid') | |
375 | 374 | return { |
376 | 375 | title: 'Hi,' + myName + '送你300元来试戴最新潮流眼镜!', // 默认是小程序的名称(可以写slogan等) |
377 | - path: '/pages/index/detail/index?uid=' + uid + '&sid=0&pid=' + this.pid, | |
376 | + path: '/pages/details/details?sid=0&pid=' + this.pid, | |
378 | 377 | imageUrl: this.skuList[0].pic, // 不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 |
379 | 378 | success: function (res) { |
380 | 379 | if (res.errMsg === 'shareAppMessage:ok') { |
... | ... | @@ -421,7 +420,7 @@ export default { |
421 | 420 | }, |
422 | 421 | // 加入购物车 |
423 | 422 | addCart (mpId, num, checkedSKU, skId, price) { |
424 | - const addCartList = {} | |
423 | + const addCartList = {} | |
425 | 424 | addCartList.mp_id = mpId |
426 | 425 | addCartList.sk_id = skId |
427 | 426 | addCartList.num = num |
... | ... | @@ -461,6 +460,7 @@ export default { |
461 | 460 | .swiperImage { |
462 | 461 | width: 684rpx; |
463 | 462 | height: 480rpx; |
463 | + text-align: center; | |
464 | 464 | image { |
465 | 465 | max-width: 100%; |
466 | 466 | max-height: 100%; |
... | ... | @@ -641,7 +641,7 @@ export default { |
641 | 641 | .menu { |
642 | 642 | position: fixed; |
643 | 643 | bottom: 0; |
644 | - height: 74px; | |
644 | + min-height: 74px; | |
645 | 645 | width: 100%; |
646 | 646 | background: #ffffff; |
647 | 647 | padding: 20px 20px 8px 20px; |
... | ... | @@ -688,7 +688,7 @@ export default { |
688 | 688 | } |
689 | 689 | .menu_2 { |
690 | 690 | width: 74%; |
691 | - height: 86%; | |
691 | + height: 80rpx; | |
692 | 692 | display: grid; |
693 | 693 | grid-template-columns: 50% 50%; |
694 | 694 | } | ... | ... |
src/pages/index/index.vue
1 | -<template> | |
2 | - <view class="container"> | |
3 | - <view class="content skeleton" v-show="showContent"> | |
4 | - <view class="header"> | |
5 | - <!-- 搜索--> | |
6 | - <view class="searchBar skeleton-rect"> | |
7 | - <icon | |
8 | - class="searchIcon" | |
9 | - type="search" | |
10 | - size="14" | |
11 | - ></icon> | |
12 | - <input | |
13 | - v-model="searchText" | |
14 | - class="searchIpt" | |
15 | - placeholder="老花镜" | |
16 | - confirm-type="search" | |
17 | - @blur="searchKey" | |
18 | - /> | |
19 | - </view> | |
1 | +<template> | |
2 | + <view class="container"> | |
3 | + <view | |
4 | + class="content skeleton" | |
5 | + v-show="showContent" | |
6 | + > | |
7 | + <view class="header"> | |
8 | + <!-- 搜索--> | |
9 | + <view class="searchBar skeleton-rect"> | |
10 | + <icon | |
11 | + class="searchIcon" | |
12 | + type="search" | |
13 | + size="14" | |
14 | + ></icon> | |
15 | + <input | |
16 | + v-model="searchText" | |
17 | + class="searchIpt" | |
18 | + placeholder="老花镜" | |
19 | + confirm-type="search" | |
20 | + @blur="searchKey" | |
21 | + /> | |
22 | + </view> | |
20 | 23 | |
21 | - <!-- 筛选栏--> | |
22 | - <!-- <view class="screenBar"> | |
24 | + <!-- 筛选栏--> | |
25 | + <!-- <view class="screenBar"> | |
23 | 26 | <view |
24 | 27 | v-for="item in screenItems" |
25 | 28 | :key="item.current" |
... | ... | @@ -57,210 +60,244 @@ |
57 | 60 | </view> |
58 | 61 | </view> |
59 | 62 | </view> --> |
60 | - </view> | |
61 | - <Uni-drawer | |
62 | - ref="showRight" | |
63 | - mask="true" | |
64 | - maskClick="true" | |
65 | - mode="right" | |
66 | - :width="320" | |
67 | - @change="change($event,'showRight')" | |
68 | - > | |
69 | - <view class="close"> | |
70 | - <view @click="closeDrawer('showRight')"> | |
71 | - <text class="word-btn-white">关闭</text> | |
72 | - </view> | |
73 | 63 | </view> |
74 | - </Uni-drawer> | |
64 | + <Uni-drawer | |
65 | + ref="showRight" | |
66 | + mask="true" | |
67 | + maskClick="true" | |
68 | + mode="right" | |
69 | + :width="320" | |
70 | + @change="change($event,'showRight')" | |
71 | + > | |
72 | + <view class="close"> | |
73 | + <view @click="closeDrawer('showRight')"> | |
74 | + <text class="word-btn-white">关闭</text> | |
75 | + </view> | |
76 | + </view> | |
77 | + </Uni-drawer> | |
75 | 78 | |
76 | - <!-- 筛选菜单--> | |
77 | - <view class="content-wrap skeleton-rect"> | |
78 | - <view> | |
79 | - <HMfilterDropdown | |
80 | - :filterData="categoryList" | |
81 | - :defaultSelected="filterDropdownValue" | |
82 | - :updateMenuName="true" | |
83 | - @search="search" | |
84 | - @getList="getList" | |
85 | - data-format="Object" | |
86 | - ></HMfilterDropdown> | |
87 | - <!-- 商品列表 --> | |
88 | - <!-- <scroll-view | |
79 | + <!-- 筛选菜单--> | |
80 | + <view class="content-wrap skeleton-rect"> | |
81 | + <view> | |
82 | + <HMfilterDropdown | |
83 | + :filterData="categoryList" | |
84 | + :defaultSelected="filterDropdownValue" | |
85 | + :updateMenuName="true" | |
86 | + @search="search" | |
87 | + @getList="getList" | |
88 | + data-format="Object" | |
89 | + ></HMfilterDropdown> | |
90 | + <!-- 商品列表 --> | |
91 | + <!-- <scroll-view | |
89 | 92 | enable-flex |
90 | 93 | @scrolltolower="handleScrolltolower" |
91 | 94 | scroll-y |
92 | 95 | style="height: 1000px;margin-bottom: 20px;" |
93 | 96 | > --> |
94 | - <view class="goods-list"> | |
95 | - <view class="product-list"> | |
96 | - <view | |
97 | - class="product skeleton-rect" | |
98 | - v-for="(goods) in goodsList" | |
99 | - :key="goods.id" | |
100 | - > | |
101 | - <Card | |
102 | - :goods="goods" | |
103 | - :scrollTop="scrollTop" | |
104 | - :viewHeight="viewHeight" | |
105 | - ></Card> | |
97 | + <view class="goods-list"> | |
98 | + <view class="product-list"> | |
99 | + <view | |
100 | + class="product skeleton-rect" | |
101 | + v-for="(goods) in goodsList" | |
102 | + :key="goods.id" | |
103 | + > | |
104 | + <Card | |
105 | + :goods="goods" | |
106 | + :scrollTop="scrollTop" | |
107 | + :viewHeight="viewHeight" | |
108 | + ></Card> | |
109 | + </view> | |
110 | + </view> | |
111 | + <view class="loading-text"> | |
112 | + <text v-if="isLoading==true">{{loadingText}}</text> | |
113 | + <text v-else>{{loadedText}}</text> | |
106 | 114 | </view> |
107 | 115 | </view> |
108 | - <view class="loading-text"> | |
109 | - <text v-if="isLoading==true">{{loadingText}}</text> | |
110 | - <text v-else>{{loadedText}}</text> | |
111 | - </view> | |
116 | + <!-- </scroll-view> --> | |
112 | 117 | </view> |
113 | - <!-- </scroll-view> --> | |
114 | 118 | </view> |
115 | - </view> | |
116 | - </view> | |
117 | - <!--引用组件--> | |
118 | - <skeleton :show="showSkeleton" ref="skeleton" loading="chiaroscuro" selector="skeleton" bgcolor="#FFF"></skeleton> | |
119 | - </view> | |
119 | + </view> | |
120 | + <!--引用组件--> | |
121 | + <skeleton | |
122 | + :show="showSkeleton" | |
123 | + ref="skeleton" | |
124 | + loading="chiaroscuro" | |
125 | + selector="skeleton" | |
126 | + bgcolor="#FFF" | |
127 | + ></skeleton> | |
128 | + </view> | |
120 | 129 | </template> |
121 | 130 | |
122 | 131 | <script> |
123 | -import UniDrawer from "@/components/UniDrawer/UniDrawer.vue"; | |
124 | -import Card from "@/components/CommodityCard/CommodityCard.vue"; | |
125 | -import HMfilterDropdown from "@/components/HMFilterDropdown/HMFilterDropdown.vue"; | |
126 | -import skeleton from "@/components/quick-skeleton/quick-skeleton.vue"; | |
127 | -import store from "@/store"; | |
128 | - | |
132 | +import UniDrawer from '@/components/UniDrawer/UniDrawer.vue' | |
133 | +import Card from '@/components/CommodityCard/CommodityCard.vue' | |
134 | +import HMfilterDropdown from '@/components/HMFilterDropdown/HMFilterDropdown.vue' | |
135 | +import skeleton from '@/components/quick-skeleton/quick-skeleton.vue' | |
136 | +import store from '@/store' | |
129 | 137 | |
130 | 138 | export default { |
131 | 139 | components: { |
132 | 140 | UniDrawer: UniDrawer, |
133 | 141 | HMfilterDropdown: HMfilterDropdown, |
134 | - Card: Card, | |
135 | - skeleton: skeleton | |
142 | + Card: Card, | |
143 | + skeleton: skeleton, | |
136 | 144 | }, |
137 | 145 | data() { |
138 | 146 | return { |
139 | - indexArr: "", | |
140 | - valueArr: "", | |
141 | - isLoading: true, //初始化加载状态 | |
142 | - loadingText: "data loading...", | |
143 | - loadedText: "~~暂无更多数据~~", | |
147 | + indexArr: '', | |
148 | + valueArr: '', | |
149 | + isLoading: true, // 初始化加载状态 | |
150 | + loadingText: 'data loading...', | |
151 | + loadedText: '~~暂无更多数据~~', | |
144 | 152 | filterDropdownValue: [], |
145 | 153 | filterData: [], |
146 | - searchText: "", | |
147 | - scrollTop: 0, | |
154 | + searchText: '', | |
155 | + scrollTop: 0, | |
148 | 156 | showContent: true, |
149 | - viewHeight: uni.getSystemInfoSync().windowHeight, | |
150 | - showSkeleton: false //骨架屏显示隐藏 | |
151 | - }; | |
157 | + viewHeight: uni.getSystemInfoSync().windowHeight, | |
158 | + showSkeleton: false, // 骨架屏显示隐藏 | |
159 | + } | |
152 | 160 | }, |
153 | 161 | onPageScroll({ scrollTop }) { |
154 | 162 | // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件 |
155 | - this.scrollTop = scrollTop; | |
163 | + this.scrollTop = scrollTop | |
156 | 164 | }, |
157 | 165 | computed: { |
158 | 166 | goodsList() { |
159 | 167 | // 也可以从 getters 获取 |
160 | 168 | // console.log('index-list=====>',this.$store.state.index.list) |
161 | - let list = this.$store.state.index.list; | |
162 | - if(list.length == 0){ | |
163 | - this.isLoading = false; | |
164 | - } | |
165 | - this.scrollTop = 0.1; | |
169 | + const list = this.$store.state.index.list | |
170 | + if (list.length == 0) { | |
171 | + this.isLoading = false | |
172 | + } | |
173 | + this.scrollTop = 0.1 | |
166 | 174 | return list |
167 | 175 | }, |
168 | 176 | categoryList() { |
169 | - return this.$store.state.index.categoryList; | |
170 | - } | |
177 | + return this.$store.state.index.categoryList | |
178 | + }, | |
171 | 179 | }, |
172 | 180 | filters: { |
173 | 181 | outData(value) { |
174 | - return JSON.stringify(value); | |
175 | - } | |
176 | - }, | |
177 | - /** | |
178 | - * 页面载入完成后调用子组件的方法生成预加载效果 | |
179 | - */ | |
180 | - onReady:function(){ | |
181 | - this.getInitData() | |
182 | + return JSON.stringify(value) | |
183 | + }, | |
182 | 184 | }, |
183 | - methods: { | |
184 | - async getInitData (){ | |
185 | - this.showSkeleton = true; | |
186 | - await Promise.all([store.dispatch("index/category"), store.dispatch("index/list")]) | |
187 | - this.showSkeleton = false; | |
188 | - this.showContent = true | |
189 | - }, | |
185 | + /** | |
186 | + * 页面载入完成后调用子组件的方法生成预加载效果 | |
187 | + */ | |
188 | + onReady: function() { | |
189 | + this.getInitData() | |
190 | + }, | |
191 | + methods: { | |
192 | + async getInitData () { | |
193 | + this.showSkeleton = true | |
194 | + await Promise.all([store.dispatch('index/category'), store.dispatch('index/list')]) | |
195 | + this.showSkeleton = false | |
196 | + this.showContent = true | |
197 | + }, | |
190 | 198 | showDrawer(e) { |
191 | - this.$refs[e].open(); | |
199 | + this.$refs[e].open() | |
200 | + }, | |
201 | + // 朋友圈设置页面 | |
202 | + onShareAppMessage() { | |
203 | + let myName = this.$store.state.user.userInfo.nickName | |
204 | + if (myName === '' || myName.length < 1 || myName === '匿名用户' || typeof myName === 'undefined') { | |
205 | + myName = '【神秘人】' | |
206 | + } else { | |
207 | + myName = '【' + myName + '】' | |
208 | + } | |
209 | + return { | |
210 | + title: 'Hi,' + myName + '送你300元来试戴最新潮流眼镜!', // 默认是小程序的名称(可以写slogan等) | |
211 | + path: '/pages/index/index', | |
212 | + // imageUrl: '/static/img/details/d1.png', // 不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 | |
213 | + success: function (res) { | |
214 | + if (res.errMsg === 'shareAppMessage:ok') { | |
215 | + console.log('分享成功!', res) | |
216 | + } | |
217 | + }, | |
218 | + fail: function (res) { | |
219 | + if (res.errMsg === 'shareAppMessage:fail cancel') { | |
220 | + console.log('fail', '放弃分享') | |
221 | + } else if (res.errMsg === 'shareAppMessage:fail') { | |
222 | + console.log('fail', '分享失败') | |
223 | + } | |
224 | + }, | |
225 | + } | |
192 | 226 | }, |
193 | 227 | getList() { |
194 | - store.dispatch("index/list"); | |
195 | - this.isLoading = false; //TODO:::这里不知道怎么改,请同学帮忙写一下。 | |
196 | - //把data里的isLoading 改为false就可以了 | |
228 | + store.dispatch('index/list') | |
229 | + this.isLoading = false // TODO:::这里不知道怎么改,请同学帮忙写一下。 | |
230 | + // 把data里的isLoading 改为false就可以了 | |
197 | 231 | }, |
198 | 232 | // search(params) { |
199 | 233 | // this.$store.index. |
200 | 234 | // }, |
201 | 235 | closeDrawer(e) { |
202 | - this.$refs[e].close(); | |
236 | + this.$refs[e].close() | |
203 | 237 | }, |
204 | 238 | change(e, type) { |
205 | - this[type] = e; | |
239 | + this[type] = e | |
206 | 240 | }, |
207 | 241 | onClickItem(e) { |
208 | 242 | if (this.current !== e) { |
209 | - this.current = e; | |
243 | + this.current = e | |
210 | 244 | } |
211 | 245 | }, |
212 | 246 | dropDown() { |
213 | - console.log("下拉"); | |
247 | + console.log('下拉') | |
214 | 248 | }, |
215 | 249 | searchKey(e) { |
216 | - const { value: keyword } = e.detail; | |
217 | - this.keyWords = keyword; | |
218 | - store.dispatch("index/search", { | |
250 | + const { value: keyword } = e.detail | |
251 | + this.keyWords = keyword | |
252 | + store.dispatch('index/search', { | |
219 | 253 | params: {}, |
220 | - keyword | |
221 | - }); | |
254 | + keyword, | |
255 | + }) | |
222 | 256 | }, |
223 | 257 | // 接收菜单结果 |
224 | 258 | search(e) { |
225 | - const { on, value, selectedData } = e; | |
226 | - let params = {}; | |
227 | - const selectedPayload = {}; | |
259 | + const { on, value, selectedData } = e | |
260 | + let params = {} | |
261 | + const selectedPayload = {} | |
228 | 262 | for (const key in selectedData) { |
229 | 263 | if (Object.prototype.hasOwnProperty.call(selectedData, key)) { |
230 | - selectedPayload[key] = selectedData[key].toString(); | |
264 | + selectedPayload[key] = selectedData[key].toString() | |
231 | 265 | } |
232 | 266 | } |
233 | 267 | if (on[0] === 1) { |
234 | 268 | // 若点击全部 |
235 | - this.searchText = ""; | |
236 | - store.dispatch("index/list"); | |
269 | + this.searchText = '' | |
270 | + store.dispatch('index/list') | |
237 | 271 | } else { |
238 | 272 | for (let i = 1; i <= on.length; i++) { |
239 | 273 | // on[0]是全部 |
240 | 274 | if (on[i] === 1) { |
241 | 275 | // 若该选项被选中 |
242 | - if (this.categoryList[i].value === "filter") { | |
276 | + if (this.categoryList[i].value === 'filter') { | |
243 | 277 | params = { |
244 | 278 | ...selectedPayload, |
245 | - ...params | |
246 | - }; | |
279 | + ...params, | |
280 | + } | |
281 | + } else if (this.categoryList[i].value === 'px') { | |
282 | + params.orderby = value[i][0] | |
247 | 283 | } else { |
248 | - params[`${this.categoryList[i].value}`] = value[i][0]; | |
284 | + params[`${this.categoryList[i].value}`] = value[i][0] | |
249 | 285 | } |
250 | 286 | } |
251 | 287 | } |
252 | - store.dispatch("index/search", { | |
288 | + store.dispatch('index/search', { | |
253 | 289 | params, |
254 | - keyword: this.keyWords | |
255 | - }); | |
290 | + keyword: this.keyWords, | |
291 | + }) | |
256 | 292 | } |
257 | - } | |
258 | - } | |
259 | -}; | |
293 | + }, | |
294 | + }, | |
295 | +} | |
260 | 296 | </script> |
261 | 297 | |
262 | 298 | <style lang="scss"> |
263 | -.content,.container { | |
299 | +.content, | |
300 | +.container { | |
264 | 301 | display: flex; |
265 | 302 | flex-direction: column; |
266 | 303 | align-items: center; |
... | ... | @@ -344,8 +381,8 @@ export default { |
344 | 381 | justify-content: space-between; |
345 | 382 | flex-wrap: wrap; |
346 | 383 | .product { |
347 | - width: 48%; | |
348 | - min-height: 120rpx; | |
384 | + width: 48%; | |
385 | + min-height: 120rpx; | |
349 | 386 | margin: 0 0 20rpx 0; |
350 | 387 | background: #ffffff; |
351 | 388 | border: 1px solid #f2f2f2; | ... | ... |
src/pages/user/user.vue
... | ... | @@ -36,16 +36,16 @@ |
36 | 36 | <button @tap="chatOur(2)">客服2</button> |
37 | 37 | </view> |
38 | 38 | </uni-popup> |
39 | -<!-- <scroll-view | |
39 | + <!-- <scroll-view | |
40 | 40 | enable-flex |
41 | 41 | @scrolltolower="handleScrolltolower" |
42 | 42 | scroll-y |
43 | 43 | style="height: 1000px;" |
44 | 44 | > --> |
45 | - <view | |
46 | - v-if="isAuth" | |
47 | - class="content" | |
48 | - > | |
45 | + <view | |
46 | + v-if="isAuth" | |
47 | + class="content" | |
48 | + > | |
49 | 49 | <view class="userInfo"> |
50 | 50 | <view class="info"> |
51 | 51 | <image |
... | ... | @@ -135,13 +135,16 @@ |
135 | 135 | </view> |
136 | 136 | <image src="../../static/right.png" mode="aspectFit"></image> |
137 | 137 | </view> --> |
138 | - <view class="item"> | |
138 | + <view | |
139 | + @tap="toAddress" | |
140 | + class="item" | |
141 | + > | |
139 | 142 | <image |
140 | 143 | src="../../static/address-icon.png" |
141 | 144 | mode="aspectFit" |
142 | 145 | ></image> |
143 | 146 | <view class="left"> |
144 | - <text @tap="toAddress">地址管理</text> | |
147 | + <text>地址管理</text> | |
145 | 148 | <image |
146 | 149 | class="image2" |
147 | 150 | src="../../static/right.png" |
... | ... | @@ -150,26 +153,32 @@ |
150 | 153 | </view> |
151 | 154 | |
152 | 155 | </view> |
153 | - <view class="item"> | |
156 | + <view | |
157 | + @tap="introduce" | |
158 | + class="item" | |
159 | + > | |
154 | 160 | <image |
155 | 161 | src="../../static/img/user/introduce.png" |
156 | 162 | mode="aspectFit" |
157 | 163 | ></image> |
158 | 164 | <view class="left"> |
159 | - <text @tap="introduce">系统介绍</text> | |
165 | + <text>系统介绍</text> | |
160 | 166 | <image |
161 | 167 | src="../../static/right.png" |
162 | 168 | mode="aspectFit" |
163 | 169 | ></image> |
164 | 170 | </view> |
165 | 171 | </view> |
166 | - <view class="item"> | |
172 | + <view | |
173 | + @tap="joinUs" | |
174 | + class="item" | |
175 | + > | |
167 | 176 | <image |
168 | 177 | src="../../static/img/user/joinUs.png" |
169 | 178 | mode="aspectFit" |
170 | 179 | ></image> |
171 | 180 | <view class="left"> |
172 | - <text @tap="joinUs">加入我们</text> | |
181 | + <text>加入我们</text> | |
173 | 182 | <image |
174 | 183 | src="../../static/right.png" |
175 | 184 | mode="aspectFit" |
... | ... | @@ -198,26 +207,30 @@ |
198 | 207 | </view> |
199 | 208 | <!-- 商品列表 --> |
200 | 209 | <view class="goods-list"> |
201 | -<!-- <scroll-view | |
210 | + <!-- <scroll-view | |
202 | 211 | enable-flex |
203 | 212 | @scrolltolower="handleScrolltolower" |
204 | 213 | scroll-y |
205 | 214 | class="product-list" |
206 | 215 | > --> |
207 | - <view class="product-list"> | |
216 | + <view class="product-list"> | |
208 | 217 | <view |
209 | 218 | class="product" |
210 | 219 | v-for="(item, index) in userRecommandList" |
211 | 220 | :key="index" |
212 | 221 | > |
213 | - <Card :goods="item" :scrollTop="scrollTop" :viewHeight="viewHeight"></Card> | |
222 | + <Card | |
223 | + :goods="item" | |
224 | + :scrollTop="scrollTop" | |
225 | + :viewHeight="viewHeight" | |
226 | + ></Card> | |
214 | 227 | </view> |
215 | - </view> | |
228 | + </view> | |
216 | 229 | <!-- </scroll-view> --> |
217 | 230 | <view class="loading-text">{{loadingText}}</view> |
218 | 231 | </view> |
219 | 232 | </view> |
220 | - </view> | |
233 | + </view> | |
221 | 234 | <view |
222 | 235 | v-else |
223 | 236 | class="auth" |
... | ... | @@ -232,7 +245,7 @@ |
232 | 245 | @getuserinfo="onGotUserInfo" |
233 | 246 | >授权登陆</button> |
234 | 247 | </view> |
235 | - <!-- </scroll-view> --> | |
248 | + <!-- </scroll-view> --> | |
236 | 249 | </view> |
237 | 250 | </template> |
238 | 251 | |
... | ... | @@ -244,38 +257,39 @@ import UniPopup from '@/components/UniPopup/uni-popup.vue' |
244 | 257 | export default { |
245 | 258 | components: { |
246 | 259 | Card, |
247 | - UniPopup | |
260 | + UniPopup, | |
248 | 261 | }, |
249 | 262 | data() { |
250 | 263 | return { |
251 | 264 | isAuth: true, // 是否显示授权页面, |
252 | 265 | pagesnum: 1, // 分页请求初始值 |
253 | - whichTap: 0 ,// 弹窗渲染选择条件 | |
266 | + whichTap: 0, // 弹窗渲染选择条件 | |
254 | 267 | loadingText: '到底了', |
255 | 268 | scrollTop: 0, |
256 | 269 | viewHeight: uni.getSystemInfoSync().windowHeight, |
257 | 270 | } |
258 | 271 | }, |
259 | - onPageScroll({scrollTop}) { | |
272 | + onPageScroll({ scrollTop }) { | |
260 | 273 | // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件 |
261 | - this.scrollTop = scrollTop; | |
274 | + this.scrollTop = scrollTop | |
262 | 275 | }, |
263 | 276 | onLoad() { |
277 | + const that = this | |
264 | 278 | // 判断是否授权 |
265 | 279 | uni.getSetting({ |
266 | 280 | success(res) { |
267 | 281 | console.log('authSetting', res.authSetting) |
268 | 282 | if (res.authSetting['scope.userInfo'] === true) { |
269 | - this.isAuth = true | |
283 | + that.isAuth = true | |
270 | 284 | } else { |
271 | - this.isAuth = false | |
285 | + that.isAuth = false | |
272 | 286 | } |
273 | - } | |
287 | + }, | |
274 | 288 | }) |
275 | 289 | store.dispatch('userRecommand/getRecommandList', { |
276 | - uid: this.$store.state.user.userInfo.uid, | |
277 | - openid: this.$store.state.user.userInfo.openid, | |
278 | - page: this.pagesnum | |
290 | + uid: that.$store.state.user.userInfo.uid, | |
291 | + openid: that.$store.state.user.userInfo.openid, | |
292 | + page: that.pagesnum, | |
279 | 293 | }) |
280 | 294 | }, |
281 | 295 | onReachBottom() { |
... | ... | @@ -284,7 +298,7 @@ export default { |
284 | 298 | store.dispatch('userRecommand/getRecommandList', { |
285 | 299 | uid: this.$store.state.user.userInfo.uid, |
286 | 300 | openid: this.$store.state.user.userInfo.openid, |
287 | - page: this.pagesnum | |
301 | + page: this.pagesnum, | |
288 | 302 | }) |
289 | 303 | }, |
290 | 304 | computed: { |
... | ... | @@ -295,9 +309,9 @@ export default { |
295 | 309 | return this.$store.state.user.userInfo.headerphoto |
296 | 310 | }, |
297 | 311 | userRecommandList() { |
298 | - console.log('userRecommandList=====>',this.$store.state.userRecommand.recommandList) | |
312 | + console.log('userRecommandList=====>', this.$store.state.userRecommand.recommandList) | |
299 | 313 | return this.$store.state.userRecommand.recommandList |
300 | - } | |
314 | + }, | |
301 | 315 | }, |
302 | 316 | methods: { |
303 | 317 | // 弹窗 |
... | ... | @@ -308,11 +322,11 @@ export default { |
308 | 322 | chatOur(item) { |
309 | 323 | if (item === 1) { |
310 | 324 | uni.makePhoneCall({ |
311 | - phoneNumber: 13376189297 // 客服1 电话 | |
325 | + phoneNumber: 13376189297, // 客服1 电话 | |
312 | 326 | }) |
313 | 327 | } else { |
314 | 328 | uni.makePhoneCall({ |
315 | - phoneNumber: 18014995101 // 客服2 电话 | |
329 | + phoneNumber: 18014995101, // 客服2 电话 | |
316 | 330 | }) |
317 | 331 | } |
318 | 332 | }, |
... | ... | @@ -330,19 +344,19 @@ export default { |
330 | 344 | url: '../address/addressList', |
331 | 345 | success: res => {}, |
332 | 346 | fail: () => {}, |
333 | - complete: () => {} | |
347 | + complete: () => {}, | |
334 | 348 | }) |
335 | 349 | }, |
336 | 350 | introduce() { |
337 | 351 | uni.showModal({ |
338 | 352 | content: '这是一款眼镜及周边产品的销售平台,我们将帮您进行建立全球销售网络,欢迎入住。', |
339 | - showCancel: false | |
353 | + showCancel: false, | |
340 | 354 | }) |
341 | 355 | }, |
342 | 356 | joinUs() { |
343 | 357 | uni.showModal({ |
344 | 358 | content: '本平台欢迎全国各地的眼镜工厂、品牌、眼镜店加入。请联系我们申请注册账号', |
345 | - showCancel: false | |
359 | + showCancel: false, | |
346 | 360 | }) |
347 | 361 | }, |
348 | 362 | toMyOrder(status) { |
... | ... | @@ -350,15 +364,15 @@ export default { |
350 | 364 | url: `../myOrder/myOrder?status=${status}`, |
351 | 365 | success: res => {}, |
352 | 366 | fail: () => {}, |
353 | - complete: () => {} | |
367 | + complete: () => {}, | |
354 | 368 | }) |
355 | 369 | }, |
356 | 370 | toOpticsData() { |
357 | 371 | uni.navigateTo({ |
358 | - url: '../addOpticsData/addOpticsData' | |
372 | + url: '../addOpticsData/addOpticsData', | |
359 | 373 | }) |
360 | - } | |
361 | - } | |
374 | + }, | |
375 | + }, | |
362 | 376 | } |
363 | 377 | </script> |
364 | 378 | |
... | ... | @@ -376,7 +390,7 @@ export default { |
376 | 390 | background-color: #f2f2f2; |
377 | 391 | } |
378 | 392 | .userInfo { |
379 | - background-image: linear-gradient(270deg, #f79067 0%, #FF5F3B 66%); | |
393 | + background-image: linear-gradient(270deg, #f79067 0%, #ff5f3b 66%); | |
380 | 394 | width: 100%; |
381 | 395 | height: 240rpx; |
382 | 396 | color: #ffffff; |
... | ... | @@ -472,7 +486,7 @@ export default { |
472 | 486 | flex-direction: row; |
473 | 487 | justify-content: space-between; |
474 | 488 | align-items: center; |
475 | - border-bottom: 1px solid #F5F5F5; | |
489 | + border-bottom: 1px solid #f5f5f5; | |
476 | 490 | font-weight: bold; |
477 | 491 | font-size: 18px; |
478 | 492 | color: #333333; |
... | ... | @@ -538,7 +552,7 @@ export default { |
538 | 552 | align-items: center; |
539 | 553 | justify-content: space-between; |
540 | 554 | height: 72rpx; |
541 | - border-bottom: 1px solid #F2F2F2; | |
555 | + border-bottom: 1px solid #f2f2f2; | |
542 | 556 | image { |
543 | 557 | margin-right: 0; |
544 | 558 | height: 16px; |
... | ... | @@ -550,9 +564,9 @@ export default { |
550 | 564 | width: 40rpx; |
551 | 565 | height: 44rpx; |
552 | 566 | } |
553 | - .lastLeft{ | |
554 | - border-bottom: none; | |
555 | - } | |
567 | + .lastLeft { | |
568 | + border-bottom: none; | |
569 | + } | |
556 | 570 | } |
557 | 571 | } |
558 | 572 | .recommend { | ... | ... |
src/static/img/detail/d11.png
52.9 KB
src/static/img/detail/d12.png
42.1 KB
src/static/img/detail/d13.png
46.4 KB
src/static/img/detail/d8.png
252 KB
src/static/img/detail/delivery.png
55.5 KB
src/static/img/detail/sun_glass.png
25.2 KB
src/vue.config.js
... | ... | @@ -14,4 +14,20 @@ |
14 | 14 | // } |
15 | 15 | // }, |
16 | 16 | // } |
17 | -// } | |
18 | 17 | \ No newline at end of file |
18 | +// } | |
19 | + | |
20 | +module.exports = { | |
21 | + chainWebpack: (config) => { | |
22 | + // 发行或运行时启用了压缩时会生效 | |
23 | + config.optimization.minimizer('terser').tap((args) => { | |
24 | + const compress = args[0].terserOptions.compress | |
25 | + // 非 App 平台移除 console 代码(包含所有 console 方法,如 log,debug,info...) | |
26 | + compress.drop_console = true | |
27 | + compress.pure_funcs = [ | |
28 | + '__f__', // App 平台 vue 移除日志代码 | |
29 | + // 'console.debug' // 可移除指定的 console 方法 | |
30 | + ] | |
31 | + return args | |
32 | + }) | |
33 | + }, | |
34 | +} | ... | ... |