소스 검색

个人中心 修改

zhashaonan 6 년 전
부모
커밋
ccce7591f6

+ 7 - 7
app.json

@@ -31,22 +31,22 @@
     "borderStyle": "black",
     "list": [
       {
-        "iconPath": "./image/tabbar/tabbar_default_index.png",
-        "selectedIconPath": "./image/tabbar/tabbar_home_hight@2x.png",
+        "iconPath": "./image/tabbar/index.png",
+        "selectedIconPath": "./image/tabbar/selected_index.png",
         "pagePath": "pages/index/index",
         "text": "首页"
       },   
       {
-        "iconPath": "./image/tabbar/tabbar_default_shopcart.png",
-        "selectedIconPath": "./image/tabbar/tabbar_shopcar_hight@2x.png",
+        "iconPath": "./image/tabbar/shopcart.png",
+        "selectedIconPath": "./image/tabbar/selected_shopcart.png",
         "pagePath": "pages/shopCart/shopCart",
         "text": "购物车"
       },
       {
-        "iconPath": "./image/tabbar/tabbar_set_default@2x.png",
-        "selectedIconPath": "./image/tabbar/tabbar_person_selected.png",
+        "iconPath": "./image/tabbar/person.png",
+        "selectedIconPath": "./image/tabbar/selected_person.png",
         "pagePath": "pages/person/person",
-        "text": "我"
+        "text": "我"
       }
     ]
   },

+ 3 - 0
app.wxss

@@ -94,6 +94,9 @@ page {
 .mt10 {
   margin-top: 10rpx;
 }
+.mt15 {
+  margin-top: 15rpx;
+}
 .mt20 {
   margin-top: 20rpx;
 }

BIN
image/person/card_bg.png


BIN
image/tabbar/index.png


BIN
image/tabbar/person.png


BIN
image/tabbar/selected_index.png


BIN
image/tabbar/selected_person.png


BIN
image/tabbar/selected_shopcart.png


BIN
image/tabbar/shopcart.png


BIN
image/tabbar/tabbar_default_index.png


BIN
image/tabbar/tabbar_default_shopcart.png


BIN
image/tabbar/tabbar_home_default@2x.png


BIN
image/tabbar/tabbar_home_hight@2x.png


BIN
image/tabbar/tabbar_person_selected.png


BIN
image/tabbar/tabbar_set_default@2x.png


BIN
image/tabbar/tabbar_set_hight@2x.png


BIN
image/tabbar/tabbar_shopcar_default@2x.png


BIN
image/tabbar/tabbar_shopcar_hight@2x.png


BIN
image/tabbar/tabbar_shopguide_default@2x.png


BIN
image/tabbar/tabbar_shopguide_hight@2x.png


+ 1 - 1
pages/details/details.js

@@ -48,7 +48,7 @@ Page({
     }, 1000);
     
 
-    // console.log(options.goods_id);
+    console.log(options.goods_id);
     this.getDatas(options.goods_id)
     // this.getDatas(7636)
     // this.getDatas(4569) // a.lrlz.com 有多条评论

+ 2 - 2
pages/details/details.wxml

@@ -22,13 +22,13 @@
   <!-- <text decode="{{true}}">¥{{getOneSummary['act_type'] == 0?getOneSummary.bonus_price:getOneSummary['goods_promotion_price']}}&nbsp;&nbsp;</text> -->
   <view class="n_goods_content">
     <view class="n_price_content align_center">
-      <text class="f24 col333" wx:if="{{getOneSummary['act_type'] == 0}}">红包价:</text>
+      <!-- <text class="f24 col333" wx:if="{{getOneSummary['act_type'] == 0}}">红包价:</text> -->
       <text class="f34 col2B2B2B ft_bold">¥{{getOneSummary['act_type'] == 0?getOneSummary.bonus_price:getOneSummary['goods_promotion_price']}}</text>
       <text class="f24 col999 ml10 line-through">专柜价:¥{{getOneSummary.goods_price}}</text>
     </view>
     <view class="f24 col666 l_height34 mt4">库存:{{getOneSummary.goods_storage}}件</view>
     <view class="n_goods_title">
-      <view class="brand_auth">{{getOneSummary.brand_author_desc}}</view>
+      <view class="brand_auth" wx:if="{{getOneSummary.brand_author_desc}}">{{getOneSummary.brand_author_desc}}</view>
       <text decode="{{true}}">{{getOneSummary.goods_mobile_name}}&nbsp;&nbsp;{{getOneSummary.goods_jingle}}</text>
     </view>
   </view>

+ 112 - 35
pages/person/person.js

@@ -7,27 +7,33 @@ Page({
    * 页面的初始数据
    */
   data: {
-    userInfo:{
-      nickName:'',
-      avatarUrl:''
+    userInfo: {
+      nickName: '',
+      avatarUrl: ''
     },
-    bonus_rate:[],
-    bonus_list_show:false,
-    login_count:1
+    bonus_rate: [],
+    bonus_list_show: false,
+    login_count: 1,
+    addr_num: '',
+    pre_pay_count: 0, // 待付款 10
+    pre_send_count: 0, // 待发货 20
+    pre_receive_count: 0, // 待收货 30
+    evaluate_count: 0, // 已收货 40
+    
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-  
+
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady: function () {
-    
+
   },
 
   /**
@@ -35,25 +41,25 @@ Page({
    */
   onShow: function () {
     const count = this.data.login_count;
-      if (!app.globalData.userInfo && count <= 2) {
-        this.setData({
-          login_count: this.data.login_count+1
-        })
-        wx.navigateTo({
-          url: '/pages/login/login'
-        });
-        return;
-      }
-      if (!app.globalData.userInfo && count > 2) {
-        this.setData({
-          login_count: 1
-        })
-        wx.switchTab({
-          url: '/pages/index/index'
-        });
-        return;
-      }
-    
+    if (!app.globalData.userInfo && count <= 2) {
+      this.setData({
+        login_count: this.data.login_count + 1
+      })
+      wx.navigateTo({
+        url: '/pages/login/login'
+      });
+      return;
+    }
+    if (!app.globalData.userInfo && count > 2) {
+      this.setData({
+        login_count: 1
+      })
+      wx.switchTab({
+        url: '/pages/index/index'
+      });
+      return;
+    }
+
     const userInfo = app.globalData.userInfo || null;
     const nickName = userInfo.nickName || '';
     const avatarUrl = userInfo.avatarUrl || '';
@@ -63,58 +69,129 @@ Page({
       op: 'rate_money'
     }, function (res) {
       if (res.code == 200) {
+        console.log(res);
         self.setData({
           userInfo: { nickName, avatarUrl },
           bonus_rate: res.datas.bonus_rate
         })
       }
     })
+
+    getReq({
+      act: 'member_info',
+      op: 'get'
+    }, function (res) {
+      if (res.code == 200) {
+        console.log('member_info:', res);
+        self.setData({
+          addr_num: res.datas.sub_titles.addr_num
+        })
+      }
+    })
+    getReq({
+      act: 'member_order',
+      op: 'orderCountState'
+    }, function (res) {
+      if (res.code == 200) {
+        console.log('member_order:', res);
+        let { order_count } = res.datas;
+        if(order_count.length) {
+          let length = order_count.length
+          for(let i = 0; i < length; i++) {
+            let state_name = ''
+            if(order_count[i]['order_state'] == 10) {
+              state_name = 'pre_pay_count'
+              // self.setData({
+              //   pre_pay_count: order_count[i]['count']
+              // })
+              // continue
+            }
+            if(order_count[i]['order_state'] == 20) {
+              state_name = 'pre_send_count'
+              // self.setData({
+              //   pre_send_count: order_count[i]['count']
+              // })
+              // continue
+            }
+            if(order_count[i]['order_state'] == 30) {
+              state_name = 'pre_receive_count'
+              // self.setData({
+              //   pre_receive_count: order_count[i]['count']
+              // })
+              // continue
+            }
+            if(order_count[i]['order_state'] == 40) {
+              state_name = 'evaluate_count'
+              // self.setData({
+              //   evaluate_count: order_count[i]['count']
+              // })
+              // continue
+            }
+            if(state_name) {
+              self.setData({
+                [state_name]: order_count[i]['count']
+              })
+            }
+          }
+        }
+      }
+    })
+    getReq({
+      act: 'member_talk',
+      op: 'authon'
+    }, function (res) {
+      if (res.code == 200) {
+        console.log('member_talk:', res);
+      }
+    })
+
+    
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
   onHide: function () {
-  
+
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-  
+
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
-  
+
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-  
+
   },
 
-  bonus_list(){
+  bonus_list() {
     this.setData({
       bonus_list_show: !this.data.bonus_list_show
     })
   },
-  skip_help(){
+  skip_help() {
     wx.navigateTo({
       url: '/pages/webView/webView?url=https://passport.lrlz.com/hfive/feed_back/question_answer.html'
     })
   },
-  skip_all_order(){
+  skip_all_order() {
     wx.navigateTo({
       url: '/pages/order_tabs/orderTabs'
     })
   },
-  refund(){
+  refund() {
     wx.showToast({
       title: '客官!请在APP中完成退款申请',
       icon: 'none',

+ 100 - 64
pages/person/person.wxml

@@ -1,4 +1,21 @@
-<view class="person_info">
+<view>
+  <view class="person_header">
+    <div class="card">
+      <image class="card_bg" src="../../image/person/card_bg.png"></image>
+      <view class="card_content">
+        <view class="card_title">红包余额</view>
+        <view class="bonus_balance">
+          <text class="f34 mr10">¥</text>120.00</view>
+        <view class="mt15">
+          <text class="bonus_balance_detail">红包明细></text>
+        </view>
+        <view class="use_bonus_rules">红包使用规则></view>
+      </view>
+    </div>
+  </view>
+
+
+  <view class="person_info">
   <block wx:if="{{userInfo.avatarUrl != ''}}">
      <image mode='widthFix' src="{{userInfo.avatarUrl}}" class='person_avatar_image'></image>
      <text class='person_name'>{{userInfo.nickName}}</text>
@@ -11,81 +28,100 @@
   </block>
 </view>
 
-<view class="order_list">
-  <view class='order_title flex_1px_d' bindtap='skip_all_order'>
-    <text>我的订单</text>
-    <text class='look_all_order arrow_right'>查看全部订单</text>
-  </view>
-
-  <view class='order_info'>
-    <view>
-      <navigator url="/pages/order_tabs/orderTabs?state_type=state_new">
-        <image style='width:35rpx;' mode='widthFix' src='../../image/person/payments_due_icon.png'></image>
-        <view>
-          <text>待付款</text>
-        </view>
-      </navigator>
-    </view>
-    <view>
-      <navigator url="/pages/order_tabs/orderTabs?state_type=state_pay">
-        <image style='width:35rpx;' mode='widthFix' src='../../image/person/shipping_term_icon.png'></image>
-        <view>
-          <text>待发货</text>
-        </view>
-      </navigator>  
-    </view>
-    <view>
-      <navigator url="/pages/order_tabs/orderTabs?state_type=state_send">
-        <image style='width:35rpx;' mode='widthFix' src='../../image/person/goods_receipt_icon.png'></image>
-        <view>
-          <text>待收货</text>
-        </view>
-      </navigator>
+  <view class="order_list">
+    <view class='order_title flex_1px_d' bindtap='skip_all_order'>
+      <text>我的订单</text>
+      <text class='look_all_order arrow_right' decode="{{true}}">查看全部订单&nbsp;</text>
     </view>
-    <view>
-      <navigator url="/pages/order_tabs/orderTabs?state_type=state_success">
-        <image style='width:32rpx;' mode='widthFix' src='../../image/person/evaluated_icon.png'></image>
+
+    <view class='order_info'>
+      <view>
+        <navigator url="/pages/order_tabs/orderTabs?state_type=state_new" class="pos_rel">
+          <image style='width:35rpx;' mode='widthFix' src='../../image/person/payments_due_icon.png'></image>
+          <view>
+            <text>待付款</text>
+          </view>
+          <view class="sub_count" wx:if="{{pre_pay_count}}">{{pre_pay_count}}</view>
+        </navigator>
+      </view>
+      <view>
+        <navigator url="/pages/order_tabs/orderTabs?state_type=state_pay" class="pos_rel">
+          <image style='width:35rpx;' mode='widthFix' src='../../image/person/shipping_term_icon.png'></image>
+          <view>
+            <text>待发货</text>
+          </view>
+          <view class="sub_count" wx:if="{{pre_send_count}}">{{pre_send_count}}</view>
+        </navigator>
+      </view>
+      <view>
+        <navigator url="/pages/order_tabs/orderTabs?state_type=state_send" class="pos_rel">
+          <image style='width:35rpx;' mode='widthFix' src='../../image/person/goods_receipt_icon.png'></image>
+          <view>
+            <text>待收货</text>
+          </view>
+          <view class="sub_count" wx:if="{{pre_receive_count}}">{{pre_receive_count}}</view>
+        </navigator>
+      </view>
+      <view>
+        <navigator url="/pages/order_tabs/orderTabs?state_type=state_success" class="pos_rel">
+          <image style='width:32rpx;' mode='widthFix' src='../../image/person/evaluated_icon.png'></image>
+          <view>
+            <text>已收货</text>
+          </view>
+          <view class="sub_count" wx:if="{{evaluate_count}}">{{evaluate_count}}</view>
+        </navigator>
+      </view>
+      <view bindtap='refund'>
+        <image style='width:35rpx;' mode='widthFix' src='../../image/person/refund_terms_icon.png'></image>
         <view>
-          <text>已收货</text>
+          <text>退款/售后</text>
         </view>
-      </navigator>
-    </view>
-    <view bindtap='refund'>
-      <image style='width:35rpx;' mode='widthFix' src='../../image/person/refund_terms_icon.png'></image>
-      <view>
-        <text>退款/售后</text>
       </view>
     </view>
   </view>
-</view>
 
-<view class='person_info_cell'>
-  <view class='item flex_1px_d' bindtap='bonus_list'>
-    <image style='width:32rpx;' mode='widthFix' src='../../image/person/bonus_icon.png'></image>
-    <text class='arrow_right'>熊猫红包</text>
+  <view class="order_list">
+    <navigator url="/pages/address/address">
+      <view class='order_title flex_1px_d'>
+        <text>收货地址</text>
+        <text class='look_all_order arrow_right' decode="{{true}}">{{addr_num}}&nbsp;</text>
+      </view>
+    </navigator>
+    <view class='order_title'>
+      <text>帮助中心</text>
+      <text class='look_all_order arrow_right' decode="{{true}}">在线客服&nbsp;</text>
+    </view>
   </view>
-  <view class="bonus_list {{bonus_list_show ? 'show' : 'hide' }}">
-    <block wx:key="{{index}}" wx:for="{{bonus_rate}}">
-       <view class='bonus_item flex_1px_d'>
+
+  <!-- <view class='person_info_cell'>
+    <view class='item flex_1px_d' bindtap='bonus_list'>
+      <image style='width:32rpx;' mode='widthFix' src='../../image/person/bonus_icon.png'></image>
+      <text class='arrow_right'>熊猫红包</text>
+    </view>
+    <view class="bonus_list {{bonus_list_show ? 'show' : 'hide' }}">
+      <block wx:key="{{index}}" wx:for="{{bonus_rate}}">
+        <view class='bonus_item flex_1px_d'>
           <text>{{item.rate}}%</text>
           <text class='total'>{{item.total}}元</text>
-       </view>
-    </block>
-  </view>
-  <navigator url="/pages/address/address">
-    <view class='item flex_1px_d'>
+        </view>
+      </block>
+    </view>
+    <navigator url="/pages/address/address">
+      <view class='item flex_1px_d'>
         <image style='width:32rpx;' mode='widthFix' src='../../image/person/address_icon.png'></image>
         <text class='arrow_right'>收货地址</text>
-    </view>
-  </navigator>
-  <navigator url="/pages/fcode/fcode">
+      </view>
+    </navigator>
+    <navigator url="/pages/fcode/fcode">
+      <view class='item flex_1px_d'>
+        <image style='width:32rpx;' mode='widthFix' src='../../image/person/fcode_icon.png'></image>
+        <text class='arrow_right'>我的F码</text>
+      </view>
+    </navigator>
     <view class='item flex_1px_d'>
-      <image style='width:32rpx;' mode='widthFix' src='../../image/person/fcode_icon.png'></image>
-      <text class='arrow_right'>我的F码</text>
+      <image style='width:32rpx;' mode='widthFix' src='../../image/person/help_icon.png'></image>
+      <text class='arrow_right' bindtap='skip_help'>帮助中心</text>
     </view>
-  </navigator>
-  <view class='item flex_1px_d'>
-    <image style='width:32rpx;' mode='widthFix' src='../../image/person/help_icon.png'></image>
-    <text class='arrow_right' bindtap='skip_help'>帮助中心</text>
-  </view>
+  </view> -->
+
 </view>

+ 91 - 1
pages/person/person.wxss

@@ -2,7 +2,7 @@
   position: relative;
   padding: 30rpx 40rpx;
   background: #fff;
-  margin-top: 22rpx;
+  /* margin-top: 22rpx; */
   font-size: 30rpx;
 }
 
@@ -24,6 +24,7 @@
   margin-right: 32rpx;
   border-radius: 10rpx;
   vertical-align: middle;
+  border-radius: 50%;
 }
 
 .order_list {
@@ -42,10 +43,12 @@
   padding: 0 40rpx;
 }
 .order_list .order_title text {
+  color: #666;
   flex: 1;
 }
 
 .order_list .order_title .look_all_order {
+  font-size: 24rpx;
   text-align: right;
   color: #999;
 }
@@ -95,6 +98,7 @@
 .person_info_cell .item text {
   display: inline-block;
   width: 615rpx;
+  /* width: 615rpx; */
 }
 .bonus_item {
   font-size: 30rpx;
@@ -125,3 +129,89 @@
   -webkit-transform: rotate(45deg);
   transform: rotate(45deg);
 }
+
+
+/* 新增 card */
+.person_header {
+  position: relative;
+  height: 406rpx;
+  background-image: linear-gradient(-180deg, #FFE4A6 13%, rgba(255,238,213,0.00) 100%);
+}
+.card {
+  position: absolute;
+  left: 0;
+  right: 0;
+  top: 40rpx;
+  margin: auto;
+  width: 600rpx;
+  height: 320rpx;
+  text-align: center;
+}
+.card_bg, .card_content {
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+}
+.card_content {
+  z-index: 1;
+}
+.card_title {
+  padding: 40rpx 0 18rpx;
+  font-size: 30rpx;
+  color: #FFFFFF;
+  line-height: 44rpx;
+}
+.bonus_balance {
+  font-size: 70rpx;
+  color: #FFEEA6;
+  height: 80rpx;
+  line-height: 80rpx;
+}
+.bonus_balance_detail {
+  position: relative;
+  padding: 8rpx 34rpx;
+  font-size: 24rpx;
+color: #FFEEA6;
+line-height: 44rpx;
+}
+.bonus_balance_detail::after {
+  content: '';
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 200%;
+  height: 200%;
+  transform: scale(.5);
+  transform-origin: 0 0;
+  pointer-events: none;
+  box-sizing: border-box;
+  border: 0 solid #FFEEA6;
+  border-radius: 100rpx;
+  border-width: 1px;
+  box-shadow: 0 4rpx 20rpx 0 rgba(77,17,17,0.10);
+}
+.use_bonus_rules {
+  margin-right: 20rpx;
+  font-size: 22rpx;
+  color: #FFFFFF;
+  text-align: right;
+  line-height: 44rpx;
+  text-decoration: underline;
+}
+.sub_count {
+  position: absolute;
+  z-index: 1;
+  /* padding: 5rpx 10rpx; */
+  width: 36rpx;
+  height: 36rpx;
+  line-height: 40rpx;
+  left: 50%;
+  top: -18rpx;
+  background: #2b2b2b;
+  color: #fff;
+  font-size: 20rpx;
+  border-radius: 50%;
+  transform: scale(.8);
+}