Browse Source

下单页面地址选择优化 首页购物车数量动态显示 发现详情和发现列表无用户信息时的优化

master
Enzo 4 years ago
parent
commit
cdc1df9431
  1. 2
      common/js/config.js
  2. 4
      pages/discover/discover.vue
  3. 18
      pages/discover/discoverdetails.vue
  4. 36
      pages/index/index/index.vue
  5. 20
      pages/order/confirm/confirm.vue

2
common/js/config.js

@ -16,7 +16,7 @@ export default {
//https://demo-guojiang-ec-api.guojiang.club/
baseUrl: process.env.NODE_ENV === 'development' ?
'http://192.168.3.165/' : 'https://v3-ec-admin-dev.guojiang.club/', // 运行时自动替换变量
'https://jincheng.lubanhudong.com/' : 'https://v3-ec-admin-dev.guojiang.club/', // 运行时自动替换变量
},
PACKAGES: {
activity: false,

4
pages/discover/discover.vue

@ -12,11 +12,13 @@
<view class="lf-p-32">
<view class="lf-flex" @click="$url('/pages/user/my/my?user_id='+item.user_id)">
<view class="tag-father">
<image :src="item.user.avatar" mode="aspectFill" class="head-img"></image>
<image :src="item.user.avatar" v-if="item.user.avatar" mode="aspectFill" class="head-img"></image>
<image src="../../static/images/empty.png" v-else mode="aspectFill" class="head-img"></image>
<view class="head-tag">V</view>
</view>
<view class="lf-flex-column lf-m-l-20">
<view class="lf-font-32 lf-color-black lf-font-bold" v-if="item.user.nick_name">{{item.user.nick_name}}</view>
<view class="lf-font-32 lf-color-black lf-font-bold" v-else>{{item.user.mobile_replace}}</view>
<view class="lf-font-24 lf-color-777 lf-m-t-15">{{item.created_at}}</view>
</view>
</view>

18
pages/discover/discoverdetails.vue

@ -9,7 +9,8 @@
</view>
<view class="lf-flex-column lf-m-l-20">
<view>
<text class="lf-font-32 lf-color-black lf-font-bold lf-m-r-15">{{discover_details.user.nick_name}}</text>
<text class="lf-font-32 lf-color-black lf-font-bold lf-m-r-15" v-if="discover_details.user.nick_name">{{discover_details.user.nick_name}}</text>
<text class="lf-font-32 lf-color-black lf-font-bold lf-m-r-15" v-else>{{discover_details.user.mobile_replace}}</text>
<text class="lf-iconfont icon-xiangyou lf-color-777 lf-text-vertical" style="font-size: 18rpx;"></text>
</view>
<view class="lf-font-24 lf-color-777 lf-m-t-15">{{discover_details.updated_at}}</view>
@ -46,10 +47,12 @@
<view class="lf-m-t-20" @click="applySub(commentitem.user.id,commentitem.id)">
<view class="lf-flex">
<view @click="$url('/pages/user/my/my?user_id='+commentitem.user_id)">
<image class="comment-img" :src="commentitem.user.avatar" mode="aspectFill"></image>
<image class="comment-img" :src="commentitem.user.avatar" v-if="commentitem.user.avatar" mode="aspectFill"></image>
<image class="comment-img" src="../../static/images/empty.png" v-else mode="aspectFill"></image>
</view>
<view class="lf-flex-column lf-m-l-20">
<view class="lf-color-999 lf-font-24">{{commentitem.user.nick_name}}</view>
<view class="lf-color-999 lf-font-24" v-if="commentitem.user.nick_name">{{commentitem.user.nick_name}}</view>
<view class="lf-color-999 lf-font-24" v-else>{{commentitem.user.mobile_replace}}</view>
<view>
<view class="lf-color-black lf-line-2" style="max-width:550rpx;">{{commentitem.content}}<text class="lf-color-999 lf-font-24 lf-m-l-10">{{commentitem.created_at}}</text></view>
</view>
@ -67,14 +70,17 @@
<view class="lf-flex" @click="applySub(subitem.user.id,subitem.parent_id)">
<view class="lf-flex lf-m-t-30">
<view @click="$url('/pages/user/my/my?user_id='+subitem.user_id)">
<image class="comment-img" :src="subitem.user.avatar" mode="aspectFill"></image>
<image class="comment-img" :src="subitem.user.avatar" v-if="subitem.user.avatar" mode="aspectFill"></image>
<image class="comment-img" src="../../static/images/empty.png" v-else mode="aspectFill"></image>
</view>
<view class="lf-flex-column lf-m-l-20">
<view class="lf-flex">
<view class="lf-color-999 lf-font-24 lf-m-r-10">{{subitem.user.nick_name}}</view>
<view class="lf-color-999 lf-font-24 lf-m-r-10" v-if="subitem.user.nick_name">{{subitem.user.nick_name}}</view>
<view class="lf-color-999 lf-font-24 lf-m-r-10" v-else>{{subitem.user.mobile_replace}}</view>
<view class="lf-row-center" style="max-width: 446rpx;">
<text class="lf-color-333 lf-m-r-10">回复</text>
<text class="lf-font-24 lf-color-999">{{subitem.to_user.nick_name}}:</text>
<text class="lf-font-24 lf-color-999" v-if="subitem.to_user.nick_name">{{subitem.to_user.nick_name}}:</text>
<text class="lf-font-24 lf-color-999" v-else>{{subitem.to_user.mobile_replace}}:</text>
</view>
</view>
<view style="max-width: 460rpx;">

36
pages/index/index/index.vue

@ -26,7 +26,7 @@
<indexNav :nav-data="item.value" :meta="item.meta"></indexNav>
</view>
<!-- 今日头条 -->
<view class="fuwu-tips" v-if="item.name == 'micro_page_componet_tips'">
<view class="fuwu-tips" v-if="item.name == 'micro_page_componet_article_-' || item.name == 'micro_page_componet_article_|'">
<view class="fuwu-tips-title">今日头条</view>
<view>
<text class="fuwu-tips-desc1">{{ item.title }}</text>
@ -63,7 +63,7 @@
<view v-if="item.name == 'micro_page_componet_recommended' && item.value && item.value.length">
<view class="lf-module-title" v-if="item.is_show_title">{{ item.title }}</view>
<view style="padding: 0 11px;">
<lf-waterfall :list="transformList(item.value)"></lf-waterfall>
<lf-waterfall :ifsale="false" :list="transformList(item.value)"></lf-waterfall>
</view>
</view>
</view>
@ -316,7 +316,7 @@
<view class="fixed-cart" hover-class="lf-opacity" @click="$url('/pages/store/cart/cart')">
<text class="lf-iconfont icon-gouwulan icon-text"></text>
<text class="tips">购物车</text>
<view class="angle-mark">99+</view>
<view class="angle-mark">{{car_num}}</view>
</view>
</view>
<!-- ad广告弹出组件 TODO 暂时先注释 -->
@ -384,6 +384,7 @@
show_ad: false, // ad广
ad_modal_list: [], // ad广
nav_bg_color: 'rgba(255,255,255,0)' ,//
car_num: 0
};
},
//
@ -421,7 +422,6 @@
}
},
onShow(e) {
this.isLogin=!!this.$cookieStorage.get('user_token')
@ -429,6 +429,7 @@
if (toekn) {
this.getUserInfo();
this.getcarNum()
}
@ -544,6 +545,33 @@
changeAbout() {
this.is_show_about = false;
},
getcarNum() {
this.$http
.get({
api: 'api/shopping/cart/count',
header: {
Authorization: this.$cookieStorage.get('user_token')
},
})
.then(res => {
if (res.data.code == 200) {
this.car_num = res.data.data;
} else {
wx.showModal({
content: '请下拉页面刷新重试',
showCancel: false
});
}
})
.catch(() => {
wx.stopPullDownRefresh();
wx.hideLoading();
wx.showModal({
content: '请求失败',
showCancel: false
});
});
},
//
queryMicroData() {
this.$http

20
pages/order/confirm/confirm.vue

@ -14,12 +14,17 @@
<text class="lf-font-28 lf-color-primary lf-m-r-10">更换收获地址</text>
<text class="lf-iconfont icon-xiangyou lf-font-24 lf-color-777"></text>
</view>
<view class="lf-m-t-20">
<text class="lf-font-28 lf-color-222 lf-font-bold">{{ address.accept_name }}</text>
<text class="lf-font-28 lf-color-777 lf-m-l-20">{{ address.mobile }}</text>
<view v-if="address">
<view class="lf-m-t-20">
<text class="lf-font-28 lf-color-222 lf-font-bold">{{ address.accept_name }}</text>
<text class="lf-font-28 lf-color-777 lf-m-l-20">{{ address.mobile }}</text>
</view>
<view class="lf-font-28 lf-color-333 lf-m-t-10">
<text>{{ address.address_name }}{{ address.address }}</text>
</view>
</view>
<view class="lf-font-28 lf-color-333 lf-m-t-10">
<text>{{ address.address_name }}{{ address.address }}</text>
<view v-else class="lf-font-28 lf-color-777">
暂无收货地址,请前往添加
</view>
</view>
<view class="card goods">
@ -223,6 +228,11 @@
},
//
confirm(){
console.log(this.address)
if(this.address == null) {
this.$msg('请先添加收货地址!');
return
}
this.$http.post({
api: 'api/shopping/order/confirm',
data: {

Loading…
Cancel
Save