huanggang 7 anos atrás
pai
commit
91d09d5151

+ 7 - 0
app.js

@@ -56,6 +56,13 @@ App({
               }
             })
           }
+          else {
+            wx.getUserInfo({
+              success: res => {
+                self.globalData.userInfo = res.userInfo;
+              }
+            })
+          }
         }
         else {
           wx.authorize({

+ 2 - 2
app.json

@@ -1,7 +1,6 @@
 {
   "pages": [
     "pages/index/index",
-    "pages/login/login",
     "pages/discover/discover",
     "pages/shopCart/shopCart",
     "pages/person/person",
@@ -11,7 +10,8 @@
     "pages/brand/brand",
     "pages/comments/comments",
     "pages/search/search",
-    "pages/confirmOrder/confirmOrder"
+    "pages/confirmOrder/confirmOrder",
+    "pages/order_tabs/orderTabs"
   ],
   "window": {
     "backgroundTextStyle": "dark",

+ 32 - 1
app.wxss

@@ -2,7 +2,7 @@
 
 page {
   font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", 微软雅黑, Arial, sans-serif;
-  background-color: #f9f9f9;
+  background-color: #f7f7f7;
 }
 .container {
   height: 100%;
@@ -116,3 +116,34 @@ page {
   -webkit-transform: scaleY(0.5);
   transform: scaleY(0.5);
 }
+.flex_1px_d {
+  position: relative;
+}
+.flex_1px_d::after {
+  content: "";
+  position: absolute;
+  bottom: 0;
+  right: 0;
+  width: 720rpx;
+  height: 2rpx;
+  background: #d9d9d9;
+  -webkit-transform: scaleY(0.5);
+  transform: scaleY(0.5);
+}
+.arrow_right {
+  position: relative;
+}
+.arrow_right::after {
+    position: absolute;
+    content: " ";
+    height: 14rpx;
+    width: 14rpx;
+    border-width: 2rpx 2rpx 0 0;
+    border-color: #999999;
+    border-style: solid;
+    -webkit-transform: rotate(45deg);
+    transform: rotate(45deg);
+    top: 50%;
+    right: -15rpx;
+    margin-top: -7rpx;
+}

BIN
image/mine_logo_icon.png


BIN
image/person/address_icon.png


BIN
image/person/bonus_icon.png


BIN
image/person/evaluated_icon.png


BIN
image/person/fcode_icon.png


BIN
image/person/goods_receipt_icon.png


BIN
image/person/help_icon.png


BIN
image/person/payments_due_icon.png


BIN
image/person/refund_terms_icon.png


BIN
image/person/shipping_term_icon.png


+ 0 - 1
pages/login/login.json

@@ -1 +0,0 @@
-{}

+ 0 - 1
pages/login/login.wxml

@@ -1 +0,0 @@
-

+ 0 - 1
pages/login/login.wxss

@@ -1 +0,0 @@
-/* pages/login/login.wxss */

+ 17 - 3
pages/login/login.js

@@ -1,18 +1,32 @@
-// pages/login/login.js
+// pages/order_tabs/orderTabs.js
+const getReq = require('./../../config.js').getReq;
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-  
+      hasmore:false,
+      orders:[]
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-  
+    let self = this;
+    getReq({
+      act: 'member_order',
+      op: 'list',
+      page: 15,
+      curpage : 1
+      },function(res){
+        let orders = res.datas.orders;
+        self.setData({
+          orders
+        });
+        console.log(self.data.orders);
+      })
   },
 
   /**

+ 3 - 0
pages/order_tabs/orderTabs.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "我的订单"
+}

+ 36 - 0
pages/order_tabs/orderTabs.wxml

@@ -0,0 +1,36 @@
+<view class="order_list">
+  <block wx:key="{{index}}" wx:for="{{orders}}">
+    <view class='order_item'>
+      <view class='order_time'>
+          <text class='add_time'>2018-03-14</text>
+          <text class='state_desc'>{{item.order_info.state_desc}}</text>
+      </view>
+      <block wx:key="{{index}}" wx:for-item="goods_list"  wx:for="{{item.order_goods}}">
+        <view class='order_content'>
+        <view class='order_image'>
+          <image style='width:140rpx;' mode='widthFix' src='{{goods_list.goods_image}}'></image>
+        </view>
+        <view class='order_info'>
+          <view>
+            <text class='goods_name'>{{goods_list.goods_name}}</text>
+          </view>
+          <view>
+            <text class='goods_spec'>{{goods_list.goods_spec}}</text>
+          </view>
+        </view>
+        <view class='order_price'>
+          <view>¥430</view>
+          <view>x{{goods_list.goods_num}}</view>
+        </view>
+      </view>
+      </block>
+      <view class='order_total'>
+        <text>共1件 合计¥430(含运费¥0)</text>
+      </view>
+      <view class='order_handle'>
+        <text>删除订单</text>
+        <text>查看物流</text>
+      </view>
+    </view>
+  </block>    
+</view>

+ 79 - 0
pages/order_tabs/orderTabs.wxss

@@ -0,0 +1,79 @@
+.order_item {
+  font-size: 24rpx;
+  margin-top: 15rpx;
+  background: #fff;
+}
+
+.order_time {
+  position: relative;
+  display: flex;
+  padding: 0 15rpx 5rpx 15rpx;
+}
+
+.order_time::after {
+  content: "";
+  position: absolute;
+  bottom: 0;
+  right: 0;
+  width: 100%;
+  height: 2rpx;
+  background: #d9d9d9;
+  -webkit-transform: scaleY(0.5);
+  transform: scaleY(0.5);
+}
+
+.order_time text {
+  flex: 1;
+}
+
+.order_time text.state_desc, .order_price, .order_total, .order_handle {
+  text-align: right;
+}
+
+.order_content {
+  display: flex;
+  position: relative;
+  padding: 5rpx 15rpx;
+}
+
+.order_content::after {
+  content: "";
+  position: absolute;
+  bottom: 0;
+  right: 0;
+  width: 100%;
+  height: 2rpx;
+  background: #d9d9d9;
+  -webkit-transform: scaleY(0.5);
+  transform: scaleY(0.5);
+}
+
+.order_info {
+  width: 500rpx;
+  padding-left: 15rpx;
+}
+
+.order_handle {
+  margin-top: 8rpx;
+}
+
+.order_total {
+  padding-right: 15rpx;
+}
+
+.order_handle text {
+  display: inline-block;
+  color: grey;
+  border: 1rpx solid grey;
+  border-radius: 5rpx;
+  padding: 0 10rpx;
+  margin: 15rpx;
+  font-size: 22rpx;
+}
+.goods_spec {
+  font-size:20rpx;
+  color:grey;
+  margin-top:20rpx;
+  display:inline-block;
+
+}

+ 39 - 2
pages/person/person.js

@@ -1,18 +1,39 @@
 // pages/person/person.js
+const app = getApp();
+const getReq = require('./../../config.js').getReq;
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-  
+    userInfo:{
+      nickName:'',
+      avatarUrl:''
+    },
+    bonus_rate:[],
+    bonus_list_show:false
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-  
+    const userInfo = app.globalData.userInfo;
+    const nickName = userInfo.nickName;
+    const avatarUrl = userInfo.avatarUrl;
+    let self = this
+    getReq({
+      act: 'cart',
+      op: 'rate_money'
+    }, function (res) {
+      if (res.code == 200) {
+        self.setData({
+          userInfo: { nickName, avatarUrl },
+          bonus_rate:res.datas.bonus_rate
+        })
+      }
+    })
   },
 
   /**
@@ -62,5 +83,21 @@ Page({
    */
   onShareAppMessage: function () {
   
+  },
+
+  bonus_list(){
+    this.setData({
+      bonus_list_show: !this.data.bonus_list_show
+    })
+  },
+  skip_help(){
+    wx.navigateTo({
+      url: '/pages/webView/webView?url=https://passport.lrlz.com/hfive/feed_back/question_answer.html'
+    })
+  },
+  skip_all_order(){
+    wx.navigateTo({
+      url: '/pages/order_tabs/orderTabs'
+    })
   }
 })

+ 76 - 0
pages/person/person.wxml

@@ -1 +1,77 @@
+<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>
+  </block>
+  <block wx:else>
+     <image mode='widthFix' src="../../image/mine_logo_icon.png" class='person_avatar_image'></image>
+     <text class='person_name'>请登录</text>
+  </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>
+      <image style='width:35rpx;' mode='widthFix' src='../../image/person/payments_due_icon.png'></image>
+      <view>
+        <text>待付款</text>
+      </view>
+    </view>
+    <view>
+      <image style='width:35rpx;' mode='widthFix' src='../../image/person/shipping_term_icon.png'></image>
+      <view>
+        <text>待发货</text>
+      </view>
+    </view>
+    <view>
+      <image style='width:35rpx;' mode='widthFix' src='../../image/person/goods_receipt_icon.png'></image>
+      <view>
+        <text>待收货</text>
+      </view>
+    </view>
+    <view>
+      <image style='width:32rpx;' mode='widthFix' src='../../image/person/evaluated_icon.png'></image>
+      <view>
+        <text>已收货</text>
+      </view>
+    </view>
+    <view>
+      <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>
+  <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>
+  <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>
+  <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>
+  <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>

+ 127 - 1
pages/person/person.wxss

@@ -1 +1,127 @@
-/* pages/person/person.wxss */
+.person_info {
+  position: relative;
+  padding: 30rpx 40rpx;
+  background: #fff;
+  margin-top: 22rpx;
+  font-size: 30rpx;
+}
+
+.person_info::after,.order_list::after {
+  content: "";
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  height: 2rpx;
+  background: #d9d9d9;
+  -webkit-transform: scaleY(0.5);
+  transform: scaleY(0.5);
+}
+
+.person_info .person_avatar_image {
+  width: 122rpx;
+  height: 118rpx;
+  margin-right: 32rpx;
+  border-radius: 10rpx;
+  vertical-align: middle;
+}
+
+.order_list {
+  position: relative;
+  margin-top: 22rpx;
+  font-size: 30rpx;
+  background: #ffffff;
+}
+
+.order_list .order_title {
+  position: relative;
+  display: flex;
+  height: 104rpx;
+  box-sizing: border-box;
+  line-height: 104rpx;
+  padding: 0 40rpx;
+}
+.order_list .order_title text {
+  flex: 1;
+}
+
+.order_list .order_title .look_all_order {
+  text-align: right;
+  color: #999;
+}
+
+.order_list .order_info {
+  display: flex;
+  padding: 40rpx;
+}
+
+.order_list .order_info>view {
+  flex: 1;
+  text-align: center;
+  font-size: 20rpx;
+  color: #999;
+}
+.order_list .order_info image {
+  vertical-align: middle;
+}
+.order_list .order_info text {
+   display: inline-block;
+   height: 30rpx;
+   margin-top: 10rpx; 
+}
+.person_info_cell {
+  margin-top: 22rpx;
+  background: #ffffff;
+  position: relative;
+}
+.person_info_cell::after {
+  content: "";
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  height: 2rpx;
+  background: #d9d9d9;
+  -webkit-transform: scaleY(0.5);
+  transform: scaleY(0.5);
+}
+.person_info_cell .item {
+  padding: 40rpx;
+  font-size: 30rpx;
+}
+.person_info_cell .item image {
+  margin-right: 25rpx;
+}
+.person_info_cell .item text {
+  display: inline-block;
+  width: 615rpx;
+}
+.bonus_item {
+  font-size: 30rpx;
+  padding: 10rpx 40rpx;
+}
+.bonus_item text {
+  display: inline-block;
+  width: 50%;  
+}
+.bonus_item text.total {
+  color: #eb4e4f;
+  text-align: right;
+}
+.bonus_list {
+  overflow: hidden;
+}
+.show {
+  max-height: 999rpx;
+  -webkit-transition: max-height .5s;
+  transition: max-height .5s;
+}
+.hide {
+  max-height: 0;
+  -webkit-transition: max-height .5s;
+  transition: max-height .5s;
+}
+.arrow_down {
+  -webkit-transform: rotate(45deg);
+  transform: rotate(45deg);
+}

+ 12 - 1
project.config.json

@@ -30,7 +30,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": -1,
+			"current": 4,
 			"list": [
 				{
 					"id": 0,
@@ -49,6 +49,17 @@
 					"name": "shopcart",
 					"pathName": "pages/shopCart/shopCart",
 					"query": ""
+				},
+				{
+					"id": -1,
+					"name": "person",
+					"pathName": "pages/person/person",
+					"query": ""
+				},
+				{
+					"id": -1,
+					"name": "orderTabs",
+					"pathName": "pages/order_tabs/orderTabs"
 				}
 			]
 		}