Blame view
src/pages/user/user.vue
12 KB
0db291810 “-mcomfirmOder页面 |
1 |
<template> |
fb85b244c user页面 |
2 |
<view class="wrap"> |
55ddb3f8a 登陆逻辑修改 |
3 |
<view v-if="isAuth" class="content"> |
fb85b244c user页面 |
4 5 |
<view class="userInfo"> <view class="info"> |
55ddb3f8a 登陆逻辑修改 |
6 |
<image :src="headerphoto" mode="aspectFill"></image> |
fb85b244c user页面 |
7 |
<view class="infoText"> |
55ddb3f8a 登陆逻辑修改 |
8 |
<text class="userName">{{nickName}}</text> |
fb85b244c user页面 |
9 10 |
</view> </view> |
9a8f39ae3 订单 |
11 |
<!-- <view class="service"> |
fb85b244c user页面 |
12 |
<image src="../../static/serviceLogo.png" mode="aspectFill"></image> |
9a8f39ae3 订单 |
13 14 15 16 17 18 |
</view> --> </view> <view class="myOpticsData"> <view class="left"> <image src="../../static/img/user/dataWrite.png" mode="aspectFit"></image> <text>验光数据</text> |
fb85b244c user页面 |
19 |
</view> |
9a8f39ae3 订单 |
20 |
<image src="../../static/right.png" mode="aspectFit"></image> |
fb85b244c user页面 |
21 22 23 24 |
</view> <view class="myOrder"> <view class="orderHeader"> <text>全部订单</text> |
9a8f39ae3 订单 |
25 |
<view class="btn" @click="toMyOrder('10')"> |
fb85b244c user页面 |
26 |
全部 |
9a8f39ae3 订单 |
27 |
<image src="../../static/right.png" mode="aspectFit"></image> |
fb85b244c user页面 |
28 29 30 |
</view> </view> <view class="orderBody"> |
9a8f39ae3 订单 |
31 32 |
<view class="item waitPay" @click="toMyOrder('0')"> <image src="../../static/img/user/waitDeliver.png" mode="aspectFit"></image> |
fb85b244c user页面 |
33 34 |
<text>待付款</text> </view> |
9a8f39ae3 订单 |
35 36 |
<view class="item waitDeliver" @click="toMyOrder('1')" > <image src="../../static/img/user/waitPay.png" mode="aspectFit"></image> |
fb85b244c user页面 |
37 38 |
<text>待收货</text> </view> |
9a8f39ae3 订单 |
39 40 41 |
<view class="item waitReceive" @click="toMyOrder('2')"> <image src="../../static/img/user/waitReceive.png" mode="aspectFit"></image> <text>已完成</text> |
fb85b244c user页面 |
42 |
</view> |
9a8f39ae3 订单 |
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
<!-- <view class="item service" @click="toMyOrder('3')"> <image src="../../static/img/user/refound.png" mode="aspectFit"></image> <text>已评价</text> </view> --> </view> </view> <view class="someItem"> <view class="item"> <view class="left"> <image src="../../static/img/user/shouyi.png" mode="aspectFit"></image> <text>推广记录与收益</text> </view> <image src="../../static/right.png" mode="aspectFit"></image> </view> <view class="item"> <view class="left"> <image src="../../static/img/user/introduce.png" mode="aspectFit"></image> <text>系统介绍</text> </view> <image src="../../static/right.png" mode="aspectFit"></image> </view> <view class="item"> <view class="left"> <image src="../../static/img/user/joinUs.png" mode="aspectFit"></image> <text>加入我们</text> </view> <image src="../../static/right.png" mode="aspectFit"></image> </view> <view class="item"> <view class="left"> <image src="../../static/img/user/service.png" mode="aspectFit"></image> <text>联系客服</text> </view> <image src="../../static/right.png" mode="aspectFit"></image> |
fb85b244c user页面 |
77 78 79 80 81 82 83 84 85 86 87 |
</view> </view> <view class="recommend"> <view class="title"> <view class="line"></view> <view class="text">精选推荐</view> <view class="line"></view> </view> <!-- 商品列表 --> <view class="goods-list"> <view class="product-list"> |
7d2bdf29e 修改镜片选购逻辑 添加购物车和用户... |
88 |
<view class="product" v-for="(goods) in goodsList" :key="goods.goods_id" > |
fb85b244c user页面 |
89 90 91 92 93 94 |
<Card :goods = "goods"></Card> </view> </view> <view class="loading-text">{{loadingText}}</view> </view> </view> |
0db291810 “-mcomfirmOder页面 |
95 |
</view> |
55ddb3f8a 登陆逻辑修改 |
96 97 98 99 100 101 102 103 104 105 106 |
<view v-else class="auth"> <view class="icon"></view> <view class="divider"></view> <view class="title">申请获取以下权限</view> <view class="text">获得您的公开信息(昵称、头像等)</view> <button type="primary" open-type="getUserInfo" @getuserinfo="onGotUserInfo" >授权登陆</button> </view> |
0db291810 “-mcomfirmOder页面 |
107 108 109 110 |
</view> </template> <script> |
55ddb3f8a 登陆逻辑修改 |
111 112 113 |
import Card from "@/components/CommodityCard/CommodityCard.vue"; import store from '@/store'; |
0db291810 “-mcomfirmOder页面 |
114 |
export default { |
fb85b244c user页面 |
115 116 117 |
components: { 'Card':Card }, |
0db291810 “-mcomfirmOder页面 |
118 119 |
data() { return { |
fb85b244c user页面 |
120 121 |
//商品数据 goodsList:[ |
ab4209caf update |
122 |
{ goods_id: 0, img: "/static/img/goods/p1.jpg", name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, |
fb85b244c user页面 |
123 124 125 126 127 128 129 130 131 132 |
{ goods_id: 1, img: '/static/img/goods/p2.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, { goods_id: 2, img: '/static/img/goods/p3.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, { goods_id: 3, img: '/static/img/goods/p4.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, { goods_id: 4, img: '/static/img/goods/p5.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, { goods_id: 5, img: '/static/img/goods/p6.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, { goods_id: 6, img: '/static/img/goods/p7.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, { goods_id: 7, img: '/static/img/goods/p8.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, { goods_id: 8, img: '/static/img/goods/p9.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, { goods_id: 9, img: '/static/img/goods/p10.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' } ], |
55ddb3f8a 登陆逻辑修改 |
133 |
isAuth: true, // 是否显示授权页面 |
0db291810 “-mcomfirmOder页面 |
134 135 136 |
} }, onLoad() { |
55ddb3f8a 登陆逻辑修改 |
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
// 判断是否授权 uni.getSetting({ success(res) { console.log('authSetting',res.authSetting) if(res.authSetting['scope.userInfo'] === true) { this.isAuth = true } else { this.isAuth = false } } }) }, computed: { nickName() { console.log('nickName', this.$store.state.user.userInfo) return this.$store.state.user.userInfo.nickName; }, headerphoto() { return this.$store.state.user.userInfo.headerphoto; |
f72f302c7 合并冲突 |
156 |
}, |
db5b5fe00 "修改样式细节" |
157 158 159 |
userRecommandList() { console.log('recommandList', this.$store.state.userRecommand.recommandList); return this.$store.state.userRecommand.recommandList; |
55ddb3f8a 登陆逻辑修改 |
160 |
} |
0db291810 “-mcomfirmOder页面 |
161 |
}, |
f72f302c7 合并冲突 |
162 163 164 165 166 |
onLoad: function() { store.dispatch('userRecommand/getRecommandList', { uid: 2, }); }, |
0db291810 “-mcomfirmOder页面 |
167 |
methods: { |
55ddb3f8a 登陆逻辑修改 |
168 169 170 171 172 173 174 175 176 177 178 |
// 授权 onGotUserInfo(e) { console.log('anthInfo', e); if(e.detail.errMsg == 'getUserInfo:ok') { const { fromInfo } = this.$store.state.user; console.log('=====la', fromInfo) // 用户授权成功 store.dispatch('user/getUserInfo', fromInfo); this.isAuth = true } }, |
9a8f39ae3 订单 |
179 |
toMyOrder(status){ |
066667dc4 add refundProgress |
180 |
uni.navigateTo({ |
9a8f39ae3 订单 |
181 |
url: `../myOrder/myOrder?status=`+status, |
066667dc4 add refundProgress |
182 183 184 185 186 |
success: res => {}, fail: () => {}, complete: () => {} }); }, |
0db291810 “-mcomfirmOder页面 |
187 188 189 190 |
} } </script> |
fb85b244c user页面 |
191 192 193 194 195 196 |
<style lang="scss"> .warp{ font-size: 24rpx; background-color: #f2f2f2; height: 100vh; } |
0db291810 “-mcomfirmOder页面 |
197 198 199 200 201 |
.content { display: flex; flex-direction: column; align-items: center; justify-content: center; |
fb85b244c user页面 |
202 |
background-color: #F2F2F2; |
0db291810 “-mcomfirmOder页面 |
203 |
} |
fb85b244c user页面 |
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
.userInfo{ background-image: linear-gradient(270deg, #FFA481 0%, #FF6B4A 66%); width: 100%; height: 240rpx; color: #FFFFFF; padding: 60rpx 82rpx 80rpx 44rpx; box-sizing: border-box; display: flex; flex-direction: row; justify-content: space-between; align-items: flex-start; .info{ display: flex; flex-direction: row; justify-content: space-between; align-items: center; image{ border-radius: 50rpx; height: 100rpx ; width: 100rpx; margin-right: 40rpx; } .infoText{ display: flex; flex-direction: column; justify-content: space-between; align-items: flex-scetart; .userName{ font-size: 18px; color: #FFFFFF; margin-bottom: 8rpx; } .nickName{ font-size: 12px; color: #FFFFFF; } } } |
9a8f39ae3 订单 |
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
// .service{ // margin-top: 20rpx; // image{ // height: 36rpx; // width: 36rpx; // } // } } .myOpticsData{ width: 670rpx; height: 120rpx; background-color: #FFFFFF; border-radius: 6px; box-shadow: 1px 1px 7px 0 rgba(133,107,107,0.10); position: relative; bottom: 44rpx; padding: 40rpx; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; .left{ font-size: 14px; color: #333333; display: flex; align-items: center; |
fb85b244c user页面 |
268 |
image{ |
9a8f39ae3 订单 |
269 270 271 |
margin-right: 32rpx; width: 30rpx; height: 34rpx; |
fb85b244c user页面 |
272 273 |
} } |
9a8f39ae3 订单 |
274 275 276 277 |
image{ height: 16px; width: 8px; } |
0db291810 “-mcomfirmOder页面 |
278 |
} |
fb85b244c user页面 |
279 280 281 |
.myOrder{ width: 100%; height: 296rpx; |
9a8f39ae3 订单 |
282 |
// margin-top: 116rpx; |
fb85b244c user页面 |
283 284 285 |
margin-bottom: 20rpx; padding: 0 40rpx; box-sizing: border-box; |
9ff2df1bf 文件名称规范 |
286 287 288 |
background: #FFFFFF; box-shadow: 0 0 4px 0 rgba(133,107,107,0.10); border-radius: 6px; |
fb85b244c user页面 |
289 |
border-radius: 6px; |
0db291810 “-mcomfirmOder页面 |
290 |
display: flex; |
fb85b244c user页面 |
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
flex-direction: column; justify-content: space-around; align-items: center; .orderHeader{ width: 100%; height: 100rpx; display: flex; flex-direction: row; justify-content: space-between; align-items: center; border-bottom: 1px solid #E9E9E9;; font-weight: bold; font-size: 18px; color: #333333; .btn{ font-size: 12px; color: #999999; |
9a8f39ae3 订单 |
308 309 |
display: flex; align-items: center; |
fb85b244c user页面 |
310 311 |
image{ margin-left: 20rpx; |
9a8f39ae3 订单 |
312 313 |
height: 32rpx; width: 16rpx; |
fb85b244c user页面 |
314 315 316 317 318 319 320 |
} } } .orderBody{ width: 100%; display: flex; flex-direction: row; |
9a8f39ae3 订单 |
321 |
justify-content: space-around; |
fb85b244c user页面 |
322 323 324 325 326 327 |
align-items: center; .item{ display: flex; flex-direction: column; align-items: center; image{ |
9a8f39ae3 订单 |
328 |
width: 62rpx; |
fb85b244c user页面 |
329 330 331 332 |
height: 46rpx; } text{ margin-top: 24rpx; |
9ff2df1bf 文件名称规范 |
333 |
font-size: 12px; |
fb85b244c user页面 |
334 335 336 337 |
color: #333333; } } } |
0db291810 “-mcomfirmOder页面 |
338 |
} |
9a8f39ae3 订单 |
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
.someItem{ width: 100%; height: 336rpx; background: #FFFFFF; box-shadow: 0 0 4px 0 rgba(133,107,107,0.10); border-radius: 6px; border-radius: 6px; margin-bottom: 18rpx; box-sizing: border-box; padding: 21rpx 48rpx 21rpx 42rpx; box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between; align-items: center; .item{ display: flex; justify-content: space-between; border-bottom: 1px solid #F2F2F2;; align-items: center; height: 72rpx; width: 100%; .left{ font-size: 14px; color: #333333; display: flex; align-items: center; image{ margin-right: 32rpx; width: 30rpx; height: 34rpx; } } image{ height: 16px; width: 8px; } } } |
fb85b244c user页面 |
379 380 381 382 383 |
.recommend{ background: #FFFFFF; box-shadow: 0 0 4px 0 rgba(133,107,107,0.10); border-radius: 6px; border-radius: 6px; |
ab4209caf update |
384 |
width: 100%; |
fb85b244c user页面 |
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 |
.title{ display: flex; flex-direction: row; align-items: center; justify-content: space-between; padding: 20rpx 40rpx; .line{ width: 264rpx; height: 1rpx; border-bottom: 1px solid #EAEAEA; } .text{ font-family: PingFangSC-Medium; font-size: 14px; color: #333333; letter-spacing: -0.26px; text-align: justify; line-height: 24px; } } .goods-list{ .loading-text{ width: 100%; display: flex; justify-content: center; align-items: center; height: 30px; color: #979797; font-size: 12px; } .product-list{ width: 92%; padding: 0 4% 3vw 4%; display: flex; justify-content: space-between; flex-wrap: wrap; .product{ width: 48%; margin: 0 0 20rpx 0; |
9ff2df1bf 文件名称规范 |
424 |
background: #FFFFFF; |
fb85b244c user页面 |
425 426 427 428 |
border: 1px solid #F2F2F2; } } } |
0db291810 “-mcomfirmOder页面 |
429 |
} |
55ddb3f8a 登陆逻辑修改 |
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 |
.auth { height: 100vh; display: flex; flex-direction: column; align-items: center; .icon { width: 140rpx; height: 140rpx; border-radius: 50%; margin-top: 100rpx; background-color: grey; } .divider { height: 1rpx; width: 600rpx; margin-top: 80rpx; background-color: #E6E3E3; } .title { width: 600rpx; margin-top: 50rpx; text-align: left; } .text { width: 600rpx; margin-top: 30rpx; text-align: left; color: #E6E3E3; } button { width: 450rpx; height: 80rpx; line-height: 80rpx; margin-top: 80rpx; border-radius: 30rpx; } } |
fb85b244c user页面 |
467 |
|
9ff2df1bf 文件名称规范 |
468 |
</style> |