Commit 61c550e3a82e52e4532cf156bc07f77cf7f85d65
1 parent
67e523f3
sdg
Showing
2 changed files
with
434 additions
and
332 deletions
uniapp-wuduhuajiao/pages/user.vue
| 1 | 1 | <template> |
| 2 | 2 | <view> |
| 3 | 3 | <!-- #ifdef MP --> |
| 4 | - <view class="cu-custom text-white" :style="{color: common.appStyle.user_font_color == 'light'?'#ffffff':'#222222'}"> | |
| 5 | - <view class="cu-bar fixed" :style="{ height: $wanlshop.wanlsys().height + 'px', paddingTop: $wanlshop.wanlsys().top + 'px' }"> | |
| 4 | + <view class="cu-custom text-white" | |
| 5 | + :style="{color: common.appStyle.user_font_color == 'light'?'#ffffff':'#222222'}" v-if="false"> | |
| 6 | + <view class="cu-bar fixed" | |
| 7 | + :style="{ height: $wanlshop.wanlsys().height + 'px', paddingTop: $wanlshop.wanlsys().top + 'px' }"> | |
| 6 | 8 | <view class="action mp text-bold"> |
| 7 | - <text class="wlIcon-shezhi" style="margin-right: 0.6em;" @tap="$wanlshop.auth('/pages/user/setting/setting')"></text> | |
| 9 | + <text class="wlIcon-shezhi" style="margin-right: 0.6em;" | |
| 10 | + @tap="$wanlshop.auth('/pages/user/setting/setting')"></text> | |
| 8 | 11 | <text class="wlIcon-shiyongbangzhu1" @tap="help"></text> |
| 9 | 12 | </view> |
| 10 | 13 | <!-- 背景 --> |
| ... | ... | @@ -18,11 +21,14 @@ |
| 18 | 21 | </view> |
| 19 | 22 | <!-- #endif --> |
| 20 | 23 | <!-- #ifndef MP --> |
| 21 | - <view class="cu-custom" :style="{color: common.appStyle.user_font_color == 'light'?'#ffffff':'#222222'}"> | |
| 22 | - <view class="cu-bar fixed" :style="{ height: $wanlshop.wanlsys().height + 'px', paddingTop: $wanlshop.wanlsys().top + 'px' }"> | |
| 24 | + <view class="cu-custom" v-if="false" :style="{color: common.appStyle.user_font_color == 'light'?'#ffffff':'#222222'}"> | |
| 25 | + <view class="cu-bar fixed" | |
| 26 | + :style="{ height: $wanlshop.wanlsys().height + 'px', paddingTop: $wanlshop.wanlsys().top + 'px' }"> | |
| 23 | 27 | <view class="text-lg" @tap="$wanlshop.auth('/pages/user/setting/user')"> |
| 24 | 28 | <view v-if="headerOpacity == 1"> |
| 25 | - <view class="cu-avatar round margin-right-xs" :style="{ backgroundImage: 'url(' + $wanlshop.oss(user.avatar, 35, 35, 2, 'avatar') + ')' }"></view> | |
| 29 | + <view class="cu-avatar round margin-right-xs" | |
| 30 | + :style="{ backgroundImage: 'url(' + $wanlshop.oss(user.avatar, 35, 35, 2, 'avatar') + ')' }"> | |
| 31 | + </view> | |
| 26 | 32 | <text v-if="user.isLogin">{{ user.nickname }}</text> |
| 27 | 33 | <text v-else>登录 / 注册</text> |
| 28 | 34 | </view> |
| ... | ... | @@ -42,18 +48,23 @@ |
| 42 | 48 | </block> |
| 43 | 49 | <text class="wlIcon-shezhi" @tap="$wanlshop.auth('/pages/user/setting/setting')"></text> |
| 44 | 50 | <text class="wlIcon-xiaoxizhongxin" @tap="$wanlshop.to('/pages/notice/notice')"></text> |
| 45 | - <view class="cu-tag badge" v-if="statistics.notice.notice +statistics.notice.order +statistics.notice.chat > 0">{{ statistics.notice.notice +statistics.notice.order +statistics.notice.chat }}</view> | |
| 51 | + <view class="cu-tag badge" | |
| 52 | + v-if="statistics.notice.notice +statistics.notice.order +statistics.notice.chat > 0"> | |
| 53 | + {{ statistics.notice.notice +statistics.notice.order +statistics.notice.chat }} | |
| 54 | + </view> | |
| 46 | 55 | </view> |
| 47 | 56 | </view> |
| 48 | 57 | </view> |
| 49 | 58 | <!-- #endif --> |
| 50 | - <view class="wanl-user" :style="{ | |
| 51 | - backgroundColor: common.appStyle.user_bg_color?common.appStyle.user_bg_color:'#f7f7f7', | |
| 52 | - backgroundImage: 'url(' + $wanlshop.oss(common.appStyle.user_bg_image, 414, 0, 1, 'transparent', 'png') + ')', | |
| 53 | - color: common.appStyle.user_font_color == 'light'?'#ffffff':'#222222'}"> | |
| 59 | + <view class="wanl-user" v-if="true" :style="{ | |
| 54 | 60 | |
| 61 | + backgroundImage: 'url(../../static/home/banck1.png)', | |
| 62 | + color: common.appStyle.user_font_color == 'light'?'#ffffff':'#222222'}"> | |
| 63 | + | |
| 55 | 64 | <view class="user" :style="{ paddingTop: $wanlshop.wanlsys().height + 'px' }"> |
| 56 | - <view class="avatar margin-right-bj" @tap="portrai"><image class="round" :src="$wanlshop.oss(user.avatar, 62, 62, 2, 'avatar')" mode="widthFix"></image></view> | |
| 65 | + <view class="avatar margin-right-bj" @tap="portrai"> | |
| 66 | + <image class="round" :src="$wanlshop.oss(user.avatar, 62, 62, 2, 'avatar')" mode="widthFix"></image> | |
| 67 | + </view> | |
| 57 | 68 | <view class="content" v-if="user.isLogin"> |
| 58 | 69 | <view class="text-xxl" @tap="$wanlshop.auth('/pages/user/setting/user')">{{ user.nickname }}</view> |
| 59 | 70 | <view class="text-sm" @tap="$wanlshop.auth('/pages/user/signin/signin')"> |
| ... | ... | @@ -71,7 +82,7 @@ |
| 71 | 82 | <view class="cu-tag wanl-bg-pink sm radius">Hi,欢迎登录</view> |
| 72 | 83 | </view> |
| 73 | 84 | </view> |
| 74 | - <view class="operate"> | |
| 85 | + <!-- <view class="operate"> | |
| 75 | 86 | <view class="text-sm" @tap="$wanlshop.auth('/pages/user/collect')"> |
| 76 | 87 | <text class="text-bold">{{ statistics.dynamic.collection }}</text> |
| 77 | 88 | 收藏夹 |
| ... | ... | @@ -88,7 +99,7 @@ |
| 88 | 99 | <text class="text-bold">{{ $wanlshop.toFormat(statistics.order.whole, 'hundred') }}</text> |
| 89 | 100 | 全部订单 |
| 90 | 101 | </view> |
| 91 | - | |
| 102 | + | |
| 92 | 103 | </view> |
| 93 | 104 | <view class="activity padding-bj"> |
| 94 | 105 | <view class="bg-white radius grid text-center col-2 padding-lr-bj padding-tb-sm"> |
| ... | ... | @@ -100,7 +111,9 @@ |
| 100 | 111 | <text class="wlIcon-fanhui2 margin-left-xs"></text> |
| 101 | 112 | </view> |
| 102 | 113 | </view> |
| 103 | - <view class="cu-avatar" :style="{ backgroundImage: 'url(' + $wanlshop.appstc('/user/icon_card_bag.png') + ')' }"></view> | |
| 114 | + <view class="cu-avatar" | |
| 115 | + :style="{ backgroundImage: 'url(' + $wanlshop.appstc('/user/icon_card_bag.png') + ')' }"> | |
| 116 | + </view> | |
| 104 | 117 | </view> |
| 105 | 118 | <view class="flex justify-between" @tap="$wanlshop.auth('/pages/user/signin/log')"> |
| 106 | 119 | <view class="content margin-left-bj"> |
| ... | ... | @@ -110,38 +123,66 @@ |
| 110 | 123 | <text class="wlIcon-fanhui2 margin-left-xs"></text> |
| 111 | 124 | </view> |
| 112 | 125 | </view> |
| 113 | - <view class="cu-avatar" :style="{ backgroundImage: 'url(' + $wanlshop.appstc('/user/icon_super_vip.png') + ')' }"></view> | |
| 126 | + <view class="cu-avatar" | |
| 127 | + :style="{ backgroundImage: 'url(' + $wanlshop.appstc('/user/icon_super_vip.png') + ')' }"> | |
| 128 | + </view> | |
| 114 | 129 | </view> |
| 115 | 130 | </view> |
| 116 | - </view> | |
| 131 | + </view> --> | |
| 117 | 132 | </view> |
| 118 | - | |
| 119 | - <view class="wanl-user-order padding-sm margin-bj"> | |
| 120 | - <view class="project text-sm wanl-gray-dark"> | |
| 133 | + | |
| 134 | + <view class="wanl-user-order padding-sm margin-bj operate"> | |
| 135 | + <view class="project text-sm wanl-gray-dark" > | |
| 136 | + | |
| 121 | 137 | <view @tap="$wanlshop.auth('/pages/user/order/order?state=1')"> |
| 122 | - <text class="wlIcon-31daifukuan wanl-pip"></text> | |
| 138 | + <view> | |
| 139 | + <image src="../static/home/order1.png" style="width: 50rpx;" mode="widthFix"> | |
| 140 | + </image> | |
| 141 | + </view> | |
| 123 | 142 | 待支付 |
| 124 | - <view class="cu-tag badge bg-orange" v-if="statistics.order.pay > 0">{{ $wanlshop.toFormat(statistics.order.pay, 'hundred') }}</view> | |
| 143 | + <view class="cu-tag badge bg-orange" v-if="statistics.order.pay > 0"> | |
| 144 | + {{ $wanlshop.toFormat(statistics.order.pay, 'hundred') }} | |
| 145 | + </view> | |
| 125 | 146 | </view> |
| 126 | 147 | <view @tap="$wanlshop.auth('/pages/user/order/order?state=2')"> |
| 127 | - <text class="wlIcon-31daifahuo wanl-pip"></text> | |
| 148 | + <view> | |
| 149 | + <image src="../static/home/order2.png" style="width: 50rpx;" mode="widthFix"> | |
| 150 | + </image> | |
| 151 | + </view> | |
| 128 | 152 | 待发货 |
| 129 | - <view class="cu-tag badge bg-orange" v-if="statistics.order.delive > 0">{{ $wanlshop.toFormat(statistics.order.delive, 'hundred') }}</view> | |
| 153 | + <view class="cu-tag badge bg-orange" v-if="statistics.order.delive > 0"> | |
| 154 | + {{ $wanlshop.toFormat(statistics.order.delive, 'hundred') }} | |
| 155 | + </view> | |
| 130 | 156 | </view> |
| 131 | 157 | <view @tap="$wanlshop.auth('/pages/user/order/order?state=3')"> |
| 132 | - <text class="wlIcon-31daishouhuo wanl-pip"></text> | |
| 158 | + <view> | |
| 159 | + <image src="../static/home/order3.png" style="width: 50rpx;" mode="widthFix"> | |
| 160 | + </image> | |
| 161 | + </view> | |
| 133 | 162 | 待收货 |
| 134 | - <view class="cu-tag badge bg-orange" v-if="statistics.order.receiving > 0">{{ $wanlshop.toFormat(statistics.order.receiving, 'hundred') }}</view> | |
| 163 | + <view class="cu-tag badge bg-orange" v-if="statistics.order.receiving > 0"> | |
| 164 | + {{ $wanlshop.toFormat(statistics.order.receiving, 'hundred') }} | |
| 165 | + </view> | |
| 135 | 166 | </view> |
| 136 | 167 | <view @tap="$wanlshop.auth('/pages/user/order/order?state=4')"> |
| 137 | - <text class="wlIcon-31daipingjia wanl-pip"></text> | |
| 168 | + <view> | |
| 169 | + <image src="../static/home/order6.png" style="width: 50rpx;" mode="widthFix"> | |
| 170 | + </image> | |
| 171 | + </view> | |
| 138 | 172 | 待评价 |
| 139 | - <view class="cu-tag badge bg-orange" v-if="statistics.order.evaluate > 0">{{ $wanlshop.toFormat(statistics.order.evaluate, 'hundred') }}</view> | |
| 173 | + <view class="cu-tag badge bg-orange" v-if="statistics.order.evaluate > 0"> | |
| 174 | + {{ $wanlshop.toFormat(statistics.order.evaluate, 'hundred') }} | |
| 175 | + </view> | |
| 140 | 176 | </view> |
| 141 | 177 | <view class="solid-left" @tap="$wanlshop.auth('/pages/user/refund/lists')"> |
| 142 | - <text class="wlIcon-31youhuiquan wanl-orange"></text> | |
| 178 | + <view> | |
| 179 | + <image src="../static/home/order5.png" style="width: 50rpx;" mode="widthFix"> | |
| 180 | + </image> | |
| 181 | + </view> | |
| 143 | 182 | 退货/售后 |
| 144 | - <view class="cu-tag badge bg-orange" v-if="statistics.order.customer > 0">{{ $wanlshop.toFormat(statistics.order.customer, 'hundred') }}</view> | |
| 183 | + <view class="cu-tag badge bg-orange" v-if="statistics.order.customer > 0"> | |
| 184 | + {{ $wanlshop.toFormat(statistics.order.customer, 'hundred') }} | |
| 185 | + </view> | |
| 145 | 186 | </view> |
| 146 | 187 | </view> |
| 147 | 188 | <!-- <view class="logistics margin-top-bj padding-sm" v-if="statistics.logistics.length > 0"> |
| ... | ... | @@ -165,8 +206,8 @@ |
| 165 | 206 | </swiper> |
| 166 | 207 | </view> --> |
| 167 | 208 | </view> |
| 168 | - | |
| 169 | - <view class="wanl-user-order padding-sm margin-bj" style="margin-top: 25rpx;"> | |
| 209 | + | |
| 210 | + <!-- <view class="wanl-user-order padding-sm margin-bj" style="margin-top: 25rpx;"> | |
| 170 | 211 | <view class="project text-sm wanl-gray-dark"> |
| 171 | 212 | <view style="line-height: 1.8;" @tap="$wanlshop.auth('/pages/user/coupon/mycard')"> |
| 172 | 213 | <view class="wanl-pip text-lg text-bold6">{{ statistics.dynamic.coupon }}</view> |
| ... | ... | @@ -189,31 +230,45 @@ |
| 189 | 230 | 账单明细 |
| 190 | 231 | </view> |
| 191 | 232 | </view> |
| 192 | - </view> | |
| 193 | - | |
| 233 | + </view> --> | |
| 234 | + | |
| 194 | 235 | <view class="wanl-user-tool padding-top-bj margin-lr-bj"> |
| 195 | - <view class="list text-sm grid col-5 wanl-gray-dark"> | |
| 196 | - <view @tap="$wanlshop.auth('/pages/user/money/money')"> | |
| 236 | + <view class="list text-sm col-5 wanl-gray-dark"> | |
| 237 | + <view class="flex justify-content-between" | |
| 238 | + style="align-items: center;border-bottom: 2rpx solid #fff;line-height: 50rpx;padding: 0 20rpx;border-bottom: 1rpx solid #efefef;" | |
| 239 | + v-for="(item, index) of lists" :key="index" @click="goNav(item.link)" | |
| 240 | + @tap="$wanlshop.auth(item.link)"> | |
| 241 | + <view class="list_text">{{ item.name }}</view> | |
| 242 | + <uni-icons type="forward" size="20" color="#000"></uni-icons> | |
| 243 | + </view> | |
| 244 | + <view class="flex justify-content-between" | |
| 245 | + style="align-items: center;border-bottom: 2rpx solid #fff;line-height: 50rpx;padding: 0 20rpx;" @tap="setting"> | |
| 246 | + 设置 | |
| 247 | + <uni-icons type="forward" size="20" color="#000"></uni-icons> | |
| 248 | + </view> | |
| 249 | + | |
| 250 | + <!-- <view @tap="$wanlshop.auth('/pages/user/money/money')"> | |
| 197 | 251 | <text class="wlIcon-youhuiquantuangou wanl-orange"></text> |
| 198 | 252 | 钱包 |
| 199 | 253 | </view> |
| 200 | 254 | <view @tap="$wanlshop.auth('/pages/apps/groups/order/order')"> |
| 201 | 255 | <text class="wlIcon-pintuan2 wanl-text-yellow"></text> |
| 202 | 256 | 拼团订单 |
| 203 | - <view class="cu-tag badge bg-orange" v-if="statistics.order.groups > 0">{{ $wanlshop.toFormat(statistics.order.groups, 'hundred') }}</view> | |
| 257 | + <view class="cu-tag badge bg-orange" v-if="statistics.order.groups > 0"> | |
| 258 | + {{ $wanlshop.toFormat(statistics.order.groups, 'hundred') }}</view> | |
| 204 | 259 | </view> |
| 205 | 260 | <view @tap="$wanlshop.auth('/pages/user/comment/comment')"> |
| 206 | 261 | <text class="wlIcon-icon_pinglun wanl-text-red"></text> |
| 207 | 262 | 评论 |
| 208 | 263 | </view> |
| 209 | - <!-- <view @tap="$wanlshop.auth('/pages/user/distribution/distribution')"> | |
| 264 | + <view @tap="$wanlshop.auth('/pages/user/distribution/distribution')"> | |
| 210 | 265 | <text class="wlIcon-fenxiao wanl-text-yellow"></text> |
| 211 | 266 | 分销 |
| 212 | 267 | </view> |
| 213 | 268 | <view @tap="$wanlshop.auth('/pages/user/order/bargain')"> |
| 214 | 269 | <text class="wlIcon-jiage wanl-text-light-blue"></text> |
| 215 | 270 | 我的砍价 |
| 216 | - </view> --> | |
| 271 | + </view> | |
| 217 | 272 | <view @tap="$wanlshop.auth('/pages/user/address/address')"> |
| 218 | 273 | <text class="wlIcon-dizhi wanl-text-yellow"></text> |
| 219 | 274 | 收货地址 |
| ... | ... | @@ -241,311 +296,344 @@ |
| 241 | 296 | <view @tap="$wanlshop.auth('/pages/apps/find/user')"> |
| 242 | 297 | <text class="wlIcon-pengyouquan wanl-text-red"></text> |
| 243 | 298 | 创作中心 |
| 244 | - </view> | |
| 245 | - <view @tap="setting"> | |
| 246 | - <text class="wlIcon-shezhi1 wanl-text-green"></text> | |
| 247 | - 设置 | |
| 248 | - </view> | |
| 299 | + </view> --> | |
| 300 | + | |
| 249 | 301 | </view> |
| 250 | 302 | </view> |
| 251 | - <view class="wanl-you-like" :style="{ backgroundImage: 'url(' + $wanlshop.appstc('/common/guess_you_like_it.png') + ')' }"></view> | |
| 252 | - <wanl-product :dataList="likeData"/> | |
| 303 | + <!-- <view class="wanl-you-like" | |
| 304 | + :style="{ backgroundImage: 'url(' + $wanlshop.appstc('/common/guess_you_like_it.png') + ')' }"></view> --> | |
| 305 | + <!-- <wanl-product :dataList="likeData" /> --> | |
| 253 | 306 | <uni-load-more :status="status" :content-text="contentText" /> |
| 254 | 307 | <view class="edgeInsetBottom"></view> |
| 255 | 308 | </view> |
| 256 | 309 | </template> |
| 257 | 310 | |
| 258 | 311 | <script> |
| 259 | -import { mapState } from 'vuex'; | |
| 260 | -export default { | |
| 261 | - data() { | |
| 262 | - return { | |
| 263 | - headerOpacity: 0, | |
| 264 | - // 上拉刷新 | |
| 265 | - reload: true, | |
| 266 | - likeData: [], | |
| 267 | - current_page: 1, //当前页码 | |
| 268 | - last_page: 1, //总页码 | |
| 269 | - status: 'loading', | |
| 270 | - contentText: { | |
| 271 | - contentdown: ' ', | |
| 272 | - contentrefresh: '正在加载...', | |
| 273 | - contentnomore: '没有更多数据了' | |
| 274 | - } | |
| 275 | - }; | |
| 276 | - }, | |
| 277 | - computed: { | |
| 278 | - ...mapState(['user', 'statistics','common']) | |
| 279 | - }, | |
| 280 | - onPullDownRefresh() { | |
| 281 | - this.loadData(); | |
| 282 | - }, | |
| 283 | - onShow() { | |
| 284 | - setTimeout(()=> { | |
| 285 | - uni.setNavigationBarColor({ | |
| 286 | - frontColor: this.$store.state.common.appStyle.user_font_color == 'light'?'#ffffff':'#000000', | |
| 287 | - backgroundColor: this.$store.state.common.appStyle.user_nav_color | |
| 288 | - }) | |
| 289 | - }, 200); | |
| 290 | - }, | |
| 291 | - onLoad() { | |
| 292 | - if (this.$store.state.user.isLogin) { | |
| 312 | + import { | |
| 313 | + mapState | |
| 314 | + } from 'vuex'; | |
| 315 | + export default { | |
| 316 | + data() { | |
| 317 | + return { | |
| 318 | + headerOpacity: 0, | |
| 319 | + // 上拉刷新 | |
| 320 | + reload: true, | |
| 321 | + likeData: [], | |
| 322 | + current_page: 1, //当前页码 | |
| 323 | + last_page: 1, //总页码 | |
| 324 | + status: 'loading', | |
| 325 | + contentText: { | |
| 326 | + contentdown: ' ', | |
| 327 | + contentrefresh: '正在加载...', | |
| 328 | + contentnomore: '没有更多数据了' | |
| 329 | + }, | |
| 330 | + lists: [{ | |
| 331 | + name: '需求发布', | |
| 332 | + // link: '/pages/my/news/index' | |
| 333 | + }, | |
| 334 | + { | |
| 335 | + name: '收货地址', | |
| 336 | + // link: '/pages/my/pay/index' | |
| 337 | + }, | |
| 338 | + { | |
| 339 | + name: '建议', | |
| 340 | + link: '/pages/my/opinion/index' | |
| 341 | + }, { | |
| 342 | + name: '投诉', | |
| 343 | + // link: '/pages/my/news/index' | |
| 344 | + }, | |
| 345 | + { | |
| 346 | + name: '黑名单', | |
| 347 | + // link: '/pages/my/pay/index' | |
| 348 | + }, | |
| 349 | + { | |
| 350 | + name: '免责声明', | |
| 351 | + // link: '/pages/my/opinion/index' | |
| 352 | + }, { | |
| 353 | + name: '入驻协议', | |
| 354 | + // link: '/pages/my/opinion/index' | |
| 355 | + } | |
| 356 | + ] | |
| 357 | + }; | |
| 358 | + }, | |
| 359 | + computed: { | |
| 360 | + ...mapState(['user', 'statistics', 'common']) | |
| 361 | + }, | |
| 362 | + onPullDownRefresh() { | |
| 293 | 363 | this.loadData(); |
| 294 | - } | |
| 295 | - this.loadlikeData(); | |
| 296 | - }, | |
| 297 | - onPageScroll(e) { | |
| 298 | - let tmpY = 50; | |
| 299 | - e.scrollTop = e.scrollTop > tmpY ? 50 : e.scrollTop; //如果当前高度大于250则250否则当前高度 | |
| 300 | - this.headerOpacity = e.scrollTop * (1 / tmpY); //$headerOpacity 赋值当前高度x(1÷250) | |
| 301 | - }, | |
| 302 | - onReachBottom() { | |
| 303 | - //判断是否最后一页 | |
| 304 | - if (this.current_page >= this.last_page) { | |
| 305 | - this.status = 'noMore'; | |
| 306 | - } else { | |
| 307 | - this.reload = false; | |
| 308 | - this.current_page = this.current_page + 1; //页码+1 | |
| 309 | - this.status = 'loading'; | |
| 310 | - this.loadlikeData(); | |
| 311 | - } | |
| 312 | - }, | |
| 313 | - methods: { | |
| 314 | - async loadData() { | |
| 315 | - this.$api.post({ | |
| 316 | - url: '/wanlshop/user/refresh', | |
| 317 | - success: res => { | |
| 318 | - this.$store.commit('statistics/edit', res.statistics); | |
| 319 | - this.$store.commit('user/setUserInfo', res.userinfo); | |
| 320 | - } | |
| 321 | - }); | |
| 322 | - uni.stopPullDownRefresh(); | |
| 323 | 364 | }, |
| 324 | - // 滚动底部加载猜你喜欢 | |
| 325 | - async loadlikeData() { | |
| 326 | - this.$api.get({ | |
| 327 | - url: '/wanlshop/product/likes?pages=user', | |
| 328 | - data: { | |
| 329 | - page: this.current_page | |
| 330 | - }, | |
| 331 | - success: res => { | |
| 332 | - this.likeData = this.reload ? res.data : this.likeData.concat(res.data); //评论数据 追加 | |
| 333 | - this.current_page = res.current_page; //当前页码 | |
| 334 | - this.last_page = res.last_page; //总页码 | |
| 335 | - this.status = res.total == 0 ? 'noMore' : 'more'; | |
| 336 | - } | |
| 337 | - }); | |
| 365 | + onShow() { | |
| 366 | + setTimeout(() => { | |
| 367 | + uni.setNavigationBarColor({ | |
| 368 | + frontColor: this.$store.state.common.appStyle.user_font_color == 'light' ? '#ffffff' : | |
| 369 | + '#000000', | |
| 370 | + backgroundColor: this.$store.state.common.appStyle.user_nav_color | |
| 371 | + }) | |
| 372 | + }, 200); | |
| 338 | 373 | }, |
| 339 | - // 帮助 | |
| 340 | - help() { | |
| 341 | - this.$wanlshop.to('/pages/user/help'); | |
| 374 | + onLoad() { | |
| 375 | + if (this.$store.state.user.isLogin) { | |
| 376 | + this.loadData(); | |
| 377 | + } | |
| 378 | + this.loadlikeData(); | |
| 342 | 379 | }, |
| 343 | - // 设置 | |
| 344 | - setting() { | |
| 345 | - this.$wanlshop.to('/pages/user/setting/setting'); | |
| 380 | + onPageScroll(e) { | |
| 381 | + let tmpY = 50; | |
| 382 | + e.scrollTop = e.scrollTop > tmpY ? 50 : e.scrollTop; //如果当前高度大于250则250否则当前高度 | |
| 383 | + this.headerOpacity = e.scrollTop * (1 / tmpY); //$headerOpacity 赋值当前高度x(1÷250) | |
| 384 | + }, | |
| 385 | + onReachBottom() { | |
| 386 | + //判断是否最后一页 | |
| 387 | + if (this.current_page >= this.last_page) { | |
| 388 | + this.status = 'noMore'; | |
| 389 | + } else { | |
| 390 | + this.reload = false; | |
| 391 | + this.current_page = this.current_page + 1; //页码+1 | |
| 392 | + this.status = 'loading'; | |
| 393 | + this.loadlikeData(); | |
| 394 | + } | |
| 346 | 395 | }, |
| 347 | - portrai() { | |
| 348 | - this.$wanlshop.to('/pages/user/portrait/portrait'); | |
| 396 | + methods: { | |
| 397 | + async loadData() { | |
| 398 | + this.$api.post({ | |
| 399 | + url: '/wanlshop/user/refresh', | |
| 400 | + success: res => { | |
| 401 | + this.$store.commit('statistics/edit', res.statistics); | |
| 402 | + this.$store.commit('user/setUserInfo', res.userinfo); | |
| 403 | + } | |
| 404 | + }); | |
| 405 | + uni.stopPullDownRefresh(); | |
| 406 | + }, | |
| 407 | + // 滚动底部加载猜你喜欢 | |
| 408 | + async loadlikeData() { | |
| 409 | + this.$api.get({ | |
| 410 | + url: '/wanlshop/product/likes?pages=user', | |
| 411 | + data: { | |
| 412 | + page: this.current_page | |
| 413 | + }, | |
| 414 | + success: res => { | |
| 415 | + this.likeData = this.reload ? res.data : this.likeData.concat(res.data); //评论数据 追加 | |
| 416 | + this.current_page = res.current_page; //当前页码 | |
| 417 | + this.last_page = res.last_page; //总页码 | |
| 418 | + this.status = res.total == 0 ? 'noMore' : 'more'; | |
| 419 | + } | |
| 420 | + }); | |
| 421 | + }, | |
| 422 | + // 帮助 | |
| 423 | + help() { | |
| 424 | + this.$wanlshop.to('/pages/user/help'); | |
| 425 | + }, | |
| 426 | + // 设置 | |
| 427 | + setting() { | |
| 428 | + this.$wanlshop.to('/pages/user/setting/setting'); | |
| 429 | + }, | |
| 430 | + portrai() { | |
| 431 | + this.$wanlshop.to('/pages/user/portrait/portrait'); | |
| 432 | + } | |
| 349 | 433 | } |
| 350 | - } | |
| 351 | -}; | |
| 434 | + }; | |
| 352 | 435 | </script> |
| 353 | 436 | |
| 354 | 437 | <style> |
| 355 | -.cu-bar .action.mp:first-child > text[class*='wlIcon-'] { | |
| 356 | - margin-left: 0; | |
| 357 | -} | |
| 358 | - | |
| 359 | -.wanl-user { | |
| 360 | - background-repeat: no-repeat; | |
| 361 | - background-size: 100%; | |
| 362 | - position: relative; | |
| 363 | -} | |
| 364 | - | |
| 365 | -.wanl-user .user { | |
| 366 | - display: flex; | |
| 367 | - align-items: center; | |
| 368 | - justify-content: space-between; | |
| 369 | - padding: 0 30rpx; | |
| 370 | - padding-bottom: 30rpx; | |
| 371 | -} | |
| 372 | - | |
| 373 | -.wanl-user .user .avatar { | |
| 374 | - position: relative; | |
| 375 | - height: 123rpx; | |
| 376 | - width: 123rpx; | |
| 377 | - border-radius: 5000rpx; | |
| 378 | - overflow: hidden; | |
| 379 | - border: 3px solid rgba(255, 255, 255, .25); | |
| 380 | -} | |
| 381 | - | |
| 382 | -.wanl-user .user .avatar image { | |
| 383 | - height: 120rpx; | |
| 384 | -} | |
| 385 | - | |
| 386 | -.wanl-user .user .avatar .tag { | |
| 387 | - position: absolute; | |
| 388 | - bottom: 0; | |
| 389 | - right: 0; | |
| 390 | -} | |
| 391 | - | |
| 392 | -.wanl-user .user .content { | |
| 393 | - flex: 1; | |
| 394 | -} | |
| 395 | - | |
| 396 | -/* 操作 */ | |
| 397 | -.wanl-user .operate { | |
| 398 | - display: flex; | |
| 399 | - justify-content: space-around; | |
| 400 | - text-align: center; | |
| 401 | - padding-bottom: 70rpx; | |
| 402 | - line-height: 1.3; | |
| 403 | -} | |
| 404 | - | |
| 405 | -.wanl-user .operate text { | |
| 406 | - display: block; | |
| 407 | - font-size: 32rpx; | |
| 408 | -} | |
| 409 | - | |
| 410 | -/* 活动 */ | |
| 411 | -.wanl-user .activity { | |
| 412 | - position: absolute; | |
| 413 | - width: 100%; | |
| 414 | - bottom: -80rpx; | |
| 415 | -} | |
| 416 | - | |
| 417 | -.wanl-user .activity .radius { | |
| 418 | - border-radius: 24rpx; | |
| 419 | -} | |
| 420 | - | |
| 421 | -.wanl-user .activity .cu-avatar { | |
| 422 | - width: 69rpx; | |
| 423 | - height: 69rpx; | |
| 424 | - margin-right: 30rpx; | |
| 425 | - background-color: transparent; | |
| 426 | - /* border: 1px solid rgba(255,255,255,.6); */ | |
| 427 | -} | |
| 428 | - | |
| 429 | -.wanl-user .activity .content { | |
| 430 | - text-align: left; | |
| 431 | - height: 68rpx; | |
| 432 | -} | |
| 433 | - | |
| 434 | -/* 订单 */ | |
| 435 | -.wanl-user-order { | |
| 436 | - margin-top: 80rpx; | |
| 437 | - border-radius: 24rpx; | |
| 438 | - background-color: white; | |
| 439 | -} | |
| 440 | - | |
| 441 | -.wanl-user-order .title { | |
| 442 | - display: flex; | |
| 443 | - justify-content: space-between; | |
| 444 | - align-items: flex-end; | |
| 445 | -} | |
| 446 | - | |
| 447 | -.wanl-user-order .title text {} | |
| 448 | - | |
| 449 | - | |
| 450 | - | |
| 451 | -/* 状态 */ | |
| 452 | -.wanl-user-order .project { | |
| 453 | - display: flex; | |
| 454 | - justify-content: space-around; | |
| 455 | - text-align: center; | |
| 456 | -} | |
| 457 | - | |
| 458 | -.wanl-user-order .project>view { | |
| 459 | - position: relative; | |
| 460 | - flex: 1; | |
| 461 | -} | |
| 462 | - | |
| 463 | -.wanl-user-order .project>view .cu-tag { | |
| 464 | - top: -4rpx; | |
| 465 | - right: 26rpx; | |
| 466 | -} | |
| 467 | - | |
| 468 | -.wanl-user-order .project text { | |
| 469 | - display: block; | |
| 470 | - font-size: 50rpx; | |
| 471 | - margin-bottom: 6rpx; | |
| 472 | -} | |
| 473 | - | |
| 474 | -/* 物流 */ | |
| 475 | -.wanl-user-order .logistics { | |
| 476 | - background-color: #f9f9f9; | |
| 477 | - border-radius: 24rpx; | |
| 478 | -} | |
| 479 | - | |
| 480 | -.wanl-user-order .logistics .swiper { | |
| 481 | - height: 120rpx; | |
| 482 | -} | |
| 483 | - | |
| 484 | -.wanl-user-order .logistics .swiper .title { | |
| 485 | - display: flex; | |
| 486 | - justify-content: space-between; | |
| 487 | - margin-bottom: 10rpx; | |
| 488 | - color: #999999; | |
| 489 | -} | |
| 490 | - | |
| 491 | -.wanl-user-order .logistics .swiper .cu-avatar { | |
| 492 | - margin-right: 10rpx; | |
| 493 | - height: 66rpx; | |
| 494 | - width: 66rpx; | |
| 495 | - border-radius: 12rpx; | |
| 496 | - background-color: #ffffff; | |
| 497 | -} | |
| 498 | - | |
| 499 | -.wanl-user-order .logistics .swiper .content .text-df { | |
| 500 | - color: #3797e0; | |
| 501 | - font-size: 27rpx; | |
| 502 | - margin-bottom: 2rpx; | |
| 503 | -} | |
| 504 | - | |
| 505 | -.wanl-user-order .logistics .swiper .content .text-sm { | |
| 506 | - color: #999999; | |
| 507 | -} | |
| 508 | - | |
| 509 | -.wanl-user-order .logistics .swiper .content text { | |
| 510 | - font-size: 32rpx; | |
| 511 | - margin-left: 15rpx; | |
| 512 | - margin-right: 10rpx; | |
| 513 | -} | |
| 514 | - | |
| 515 | -/* 工具箱 */ | |
| 516 | -.wanl-user-tool { | |
| 517 | - background-color: #ffffff; | |
| 518 | - border-radius: 24rpx; | |
| 519 | -} | |
| 520 | - | |
| 521 | -.wanl-user-tool .title { | |
| 522 | - display: flex; | |
| 523 | - justify-content: space-between; | |
| 524 | - align-items: flex-end; | |
| 525 | -} | |
| 526 | - | |
| 527 | -.wanl-user-tool .title text { | |
| 528 | - margin-left: 2rpx; | |
| 529 | -} | |
| 530 | - | |
| 531 | -/* 状态 */ | |
| 532 | -.wanl-user-tool .list { | |
| 533 | - text-align: center; | |
| 534 | -} | |
| 535 | - | |
| 536 | -.wanl-user-tool .list>view { | |
| 537 | - margin-bottom: 28rpx; | |
| 538 | - position: relative; | |
| 539 | -} | |
| 540 | -.wanl-user-tool .list>view .cu-tag { | |
| 541 | - top: -8rpx; | |
| 542 | - left: 80rpx; | |
| 543 | - right: unset; | |
| 544 | -} | |
| 545 | - | |
| 546 | -.wanl-user-tool .list text { | |
| 547 | - display: block; | |
| 548 | - font-size: 54rpx; | |
| 549 | - margin-bottom: 8rpx; | |
| 550 | -} | |
| 438 | + .cu-bar .action.mp:first-child>text[class*='wlIcon-'] { | |
| 439 | + margin-left: 0; | |
| 440 | + } | |
| 441 | + | |
| 442 | + .wanl-user { | |
| 443 | + background-repeat: no-repeat; | |
| 444 | + background-size: 100%; | |
| 445 | + position: relative; | |
| 446 | + border-radius: 0 0 20% 20%; | |
| 447 | + height: 360rpx; | |
| 448 | + } | |
| 449 | + | |
| 450 | + .wanl-user .user { | |
| 451 | + display: flex; | |
| 452 | + align-items: center; | |
| 453 | + justify-content: space-between; | |
| 454 | + padding: 0 30rpx; | |
| 455 | + padding-bottom: 30rpx; | |
| 456 | + } | |
| 457 | + | |
| 458 | + .wanl-user .user .avatar { | |
| 459 | + position: relative; | |
| 460 | + height: 123rpx; | |
| 461 | + width: 123rpx; | |
| 462 | + border-radius: 5000rpx; | |
| 463 | + overflow: hidden; | |
| 464 | + border: 3px solid rgba(255, 255, 255, .25); | |
| 465 | + } | |
| 466 | + | |
| 467 | + .wanl-user .user .avatar image { | |
| 468 | + height: 120rpx; | |
| 469 | + } | |
| 470 | + | |
| 471 | + .wanl-user .user .avatar .tag { | |
| 472 | + position: absolute; | |
| 473 | + bottom: 0; | |
| 474 | + right: 0; | |
| 475 | + } | |
| 476 | + | |
| 477 | + .wanl-user .user .content { | |
| 478 | + flex: 1; | |
| 479 | + } | |
| 480 | + | |
| 481 | + /* 操作 */ | |
| 482 | + .wanl-user .operate { | |
| 483 | + display: flex; | |
| 484 | + justify-content: space-around; | |
| 485 | + text-align: center; | |
| 486 | + padding-bottom: 70rpx; | |
| 487 | + line-height: 1.3; | |
| 488 | + } | |
| 489 | + | |
| 490 | + .wanl-user .operate text { | |
| 491 | + display: block; | |
| 492 | + font-size: 32rpx; | |
| 493 | + } | |
| 494 | + | |
| 495 | + /* 活动 */ | |
| 496 | + .wanl-user .activity { | |
| 497 | + position: absolute; | |
| 498 | + width: 100%; | |
| 499 | + bottom: -80rpx; | |
| 500 | + } | |
| 501 | + | |
| 502 | + .wanl-user .activity .radius { | |
| 503 | + border-radius: 24rpx; | |
| 504 | + } | |
| 505 | + | |
| 506 | + .wanl-user .activity .cu-avatar { | |
| 507 | + width: 69rpx; | |
| 508 | + height: 69rpx; | |
| 509 | + margin-right: 30rpx; | |
| 510 | + background-color: transparent; | |
| 511 | + /* border: 1px solid rgba(255,255,255,.6); */ | |
| 512 | + } | |
| 513 | + | |
| 514 | + .wanl-user .activity .content { | |
| 515 | + text-align: left; | |
| 516 | + height: 68rpx; | |
| 517 | + } | |
| 518 | + | |
| 519 | + /* 订单 */ | |
| 520 | + .wanl-user-order { | |
| 521 | + position: relative; | |
| 522 | + margin-top: -100rpx; | |
| 523 | + border-radius: 24rpx; | |
| 524 | + background-color: white; | |
| 525 | + z-index: 99; | |
| 526 | + } | |
| 527 | + | |
| 528 | + .wanl-user-order .title { | |
| 529 | + display: flex; | |
| 530 | + justify-content: space-between; | |
| 531 | + align-items: flex-end; | |
| 532 | + } | |
| 533 | + | |
| 534 | + .wanl-user-order .title text {} | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + /* 状态 */ | |
| 539 | + .wanl-user-order .project { | |
| 540 | + display: flex; | |
| 541 | + justify-content: space-around; | |
| 542 | + text-align: center; | |
| 543 | + } | |
| 544 | + | |
| 545 | + .wanl-user-order .project>view { | |
| 546 | + position: relative; | |
| 547 | + flex: 1; | |
| 548 | + } | |
| 549 | + | |
| 550 | + .wanl-user-order .project>view .cu-tag { | |
| 551 | + top: -4rpx; | |
| 552 | + right: 26rpx; | |
| 553 | + } | |
| 554 | + | |
| 555 | + .wanl-user-order .project text { | |
| 556 | + display: block; | |
| 557 | + font-size: 50rpx; | |
| 558 | + margin-bottom: 6rpx; | |
| 559 | + } | |
| 560 | + | |
| 561 | + /* 物流 */ | |
| 562 | + .wanl-user-order .logistics { | |
| 563 | + background-color: #f9f9f9; | |
| 564 | + border-radius: 24rpx; | |
| 565 | + } | |
| 566 | + | |
| 567 | + .wanl-user-order .logistics .swiper { | |
| 568 | + height: 120rpx; | |
| 569 | + } | |
| 570 | + | |
| 571 | + .wanl-user-order .logistics .swiper .title { | |
| 572 | + display: flex; | |
| 573 | + justify-content: space-between; | |
| 574 | + margin-bottom: 10rpx; | |
| 575 | + color: #999999; | |
| 576 | + } | |
| 577 | + | |
| 578 | + .wanl-user-order .logistics .swiper .cu-avatar { | |
| 579 | + margin-right: 10rpx; | |
| 580 | + height: 66rpx; | |
| 581 | + width: 66rpx; | |
| 582 | + border-radius: 12rpx; | |
| 583 | + background-color: #ffffff; | |
| 584 | + } | |
| 585 | + | |
| 586 | + .wanl-user-order .logistics .swiper .content .text-df { | |
| 587 | + color: #3797e0; | |
| 588 | + font-size: 27rpx; | |
| 589 | + margin-bottom: 2rpx; | |
| 590 | + } | |
| 591 | + | |
| 592 | + .wanl-user-order .logistics .swiper .content .text-sm { | |
| 593 | + color: #999999; | |
| 594 | + } | |
| 595 | + | |
| 596 | + .wanl-user-order .logistics .swiper .content text { | |
| 597 | + font-size: 32rpx; | |
| 598 | + margin-left: 15rpx; | |
| 599 | + margin-right: 10rpx; | |
| 600 | + } | |
| 601 | + | |
| 602 | + /* 工具箱 */ | |
| 603 | + .wanl-user-tool { | |
| 604 | + background-color: #ffffff; | |
| 605 | + border-radius: 24rpx; | |
| 606 | + } | |
| 607 | + | |
| 608 | + .wanl-user-tool .title { | |
| 609 | + display: flex; | |
| 610 | + justify-content: space-between; | |
| 611 | + align-items: flex-end; | |
| 612 | + } | |
| 613 | + | |
| 614 | + .wanl-user-tool .title text { | |
| 615 | + margin-left: 2rpx; | |
| 616 | + } | |
| 617 | + | |
| 618 | + /* 状态 */ | |
| 619 | + .wanl-user-tool .list { | |
| 620 | + text-align: center; | |
| 621 | + } | |
| 622 | + | |
| 623 | + .wanl-user-tool .list>view { | |
| 624 | + margin-bottom: 28rpx; | |
| 625 | + position: relative; | |
| 626 | + } | |
| 627 | + | |
| 628 | + .wanl-user-tool .list>view .cu-tag { | |
| 629 | + top: -8rpx; | |
| 630 | + left: 80rpx; | |
| 631 | + right: unset; | |
| 632 | + } | |
| 633 | + | |
| 634 | + .wanl-user-tool .list text { | |
| 635 | + display: block; | |
| 636 | + font-size: 54rpx; | |
| 637 | + margin-bottom: 8rpx; | |
| 638 | + } | |
| 551 | 639 | </style> | ... | ... |
uniapp-wuduhuajiao/pages/wanl-home/components/list1.vue
| ... | ... | @@ -16,18 +16,32 @@ |
| 16 | 16 | </view> |
| 17 | 17 | |
| 18 | 18 | <view class="flex " > |
| 19 | - <view style="position: relative;margin-right: 20rpx;" v-for="item of 3"> | |
| 20 | - <image src="../../../static/home/index4.png" class="img" mode="aspectFill"></image> | |
| 19 | + <view style="position: relative;margin-right: 20rpx;" v-if="item.user.cz"> | |
| 20 | + <image :src="'http://t1.sherkxuan.cn/'+item.user.cz.image" class="img" mode="aspectFill"></image> | |
| 21 | 21 | <view class="postion"> |
| 22 | 22 | <image src="/static/home/shi.png" mode="widthFix"></image> |
| 23 | 23 | <text style="font-size: 21rpx;color: #fff;">村长</text> |
| 24 | 24 | </view> |
| 25 | 25 | </view> |
| 26 | + <view style="position: relative;margin-right: 20rpx;" v-if="item.user.sz"> | |
| 27 | + <image :src="'http://t1.sherkxuan.cn/'+item.user.cz.image" class="img" mode="aspectFill"></image> | |
| 28 | + <view class="postion"> | |
| 29 | + <image src="/static/home/shi.png" mode="widthFix"></image> | |
| 30 | + <text style="font-size: 21rpx;color: #fff;">社长</text> | |
| 31 | + </view> | |
| 32 | + </view> | |
| 33 | + <view style="position: relative;margin-right: 20rpx;" v-if="item.user.cm"> | |
| 34 | + <image :src="'http://t1.sherkxuan.cn/'+item.user.cz.image" class="img" mode="aspectFill"></image> | |
| 35 | + <view class="postion"> | |
| 36 | + <image src="/static/home/shi.png" mode="widthFix"></image> | |
| 37 | + <text style="font-size: 21rpx;color: #fff;">村民</text> | |
| 38 | + </view> | |
| 39 | + </view> | |
| 26 | 40 | </view> |
| 27 | 41 | </view> |
| 28 | 42 | </view> |
| 29 | 43 | |
| 30 | - <view style="width:300rpx;margin-left: 15rpx;" > | |
| 44 | + <view style="width:170rpx;margin-left: 15rpx;" > | |
| 31 | 45 | <view class="flex justify-content-around" @click="goNav('/pages/wanl-home/detail?id='+item.id)"> |
| 32 | 46 | <image src="../../../static/home/message.png" style="width: 30rpx;" mode="widthFix"></image> |
| 33 | 47 | <image src="../../../static/home/v.png" style="width: 30rpx;" mode="widthFix"></image> | ... | ... |