k.zhang 4 years ago
parent
commit
6166e71566

+ 3 - 3
app.json

@@ -3,8 +3,8 @@
     "pages/shouye/shouye",
     "pages/index/index",
     "pages/logs/logs",
-    "pages/details/details"
-   
+    "pages/details/details",
+    "pages/order/order"
   ],
   "window": {
     "backgroundTextStyle": "light",
@@ -13,7 +13,7 @@
     "navigationBarTextStyle": "black"
   },
   "tabBar": {
-    
+  
    "color": "#a9b7b7",  
    "selectedColor": "#11cd6e",  
    "borderStyle": "black" ,

File diff suppressed because it is too large
+ 1 - 0
dist/grid-item/index.js


+ 1 - 0
dist/grid-item/index.json

@@ -0,0 +1 @@
+{"component":true,"usingComponents":{}}

+ 3 - 0
dist/grid-item/index.wxml

@@ -0,0 +1,3 @@
+<view hover-class="{{isHover?'l-gird-item-hover':''}}" hover-start-time="20" hover-stay-time="50" class="l-grid-item l-grid-item-class grid-item" mut-bind:tap="tapGridItem">
+    <slot></slot>
+</view>

+ 1 - 0
dist/grid-item/index.wxss

@@ -0,0 +1 @@
+.grid-item{display:flex;justify-content:center;align-items:center;flex-direction:column;padding:32rpx 16rpx;box-sizing:border-box}.l-gird-item-hover{opacity:.8}

File diff suppressed because it is too large
+ 1 - 0
dist/grid/index.js


+ 1 - 0
dist/grid/index.json

@@ -0,0 +1 @@
+{"component":true,"usingComponents":{"l-grid-item":"../grid-item/index"}  }

+ 5 - 0
dist/grid/index.wxml

@@ -0,0 +1,5 @@
+<view class="l-grid l-class" bind:tap="tapGrid">
+    <view bind:tap="tapGridItem" data-grid-index="{{item.index}}" class="l-grid-item l-class-grid l-grid-class {{index%rowNum !== rowNum-1 &&(showBorder||showColBorder) ? 'side-grid':''}} {{(index<gridItems.length-(gridItems.length%rowNum||rowNum)) &&(showBorder||showRowBorder)? 'center-grid':''}}" wx:for="{{gridItems}}" wx:key="key" style="min-width:{{100/rowNum}}%;">
+        <slot name="{{item.key}}"></slot>
+    </view>
+</view>

+ 1 - 0
dist/grid/index.wxss

@@ -0,0 +1 @@
+.l-grid{display:flex;width:inherit;flex-wrap:wrap}.l-grid .l-grid-item{display:flex;justify-content:center;flex-direction:column;text-align:center;box-sizing:border-box;border-style:solid;border-color:#ededed;border-width:0}.l-grid .center-grid{border-bottom-width:2rpx}.l-grid .side-grid{border-right-width:2rpx}

+ 2 - 2
pages/details/details.wxml

@@ -20,7 +20,7 @@
     </view>
     <view class="goodsPrice">
       <text class="jprice">劵后价¥{{(item.min_group_price-item.coupon_discount)/100}}元</text>  
-      <!-- <l-button plain="{{true}}" type="error"  width="50" height="40" class="fanli"  >返利{{item.promotion_rate/100}}元</l-button> -->
+      <l-button plain="{{true}}" type="error"  width="50" height="40" class="fanli"  >返利{{(item.promotion_rate/100)*0.5}}元</l-button>
     </view>
     <view class="goodsbtm">
       <text class="yprice">原价¥{{item.min_group_price/100}} </text>
@@ -34,7 +34,7 @@
 </l-popup> -->
 
     <l-button bg-color="#FF6A6A"  size="large" bind:lintap="counponBtn" data-searchId="{{searchId}}" data-goodsSignList="{{item.goods_sign}}">
-      <text >领取{{item.coupon_discount/100}}元优惠劵</text>
+      <text >领取{{item.coupon_discount/100}}元优惠劵/购物</text>
      
     </l-button>
     </view>

+ 91 - 0
pages/index/index.js

@@ -1,9 +1,60 @@
 // index.js
 // 获取应用实例
 const app = getApp()
+const link = app.globalData.url
 
 Page({
   data: {
+    grids1: [{
+      image: 'order',
+      text: '我的订单'
+    }, {
+      image: 'user',
+      text: '好友列表'
+    }, {
+      image: 'help',
+      text: '帮助中心'
+    }, {
+      image: 'add',
+      text: '邀请好友'
+    }, {
+      image: 'to-top',
+      text: '手动同步订单'
+    }, {
+      image: 'customer-service',
+      text: '联系客服'
+    }, {
+      image: 'setting',
+      text: '设置'
+    },
+     {
+      image: 'success',
+      text: '体现'
+    }, 
+    //{
+    //   image: 'eye',
+    //   text: '我的足迹'
+    // }, {
+    //   image: 'scan',
+    //   text: '扫一扫'
+    // }, 
+  ],
+    // grids2: [{
+    //   image: 'cart',
+    //   text: '我的购物车'
+    // }, {
+    //   image: 'help',
+    //   text: '帮助中心'
+    // }, {
+    //   image: 'address',
+    //   text: '地址管理'
+    // }, {
+    //   image: 'order',
+    //   text: '我的订单'
+    // }, {
+    //   image: 'customer-service',
+    //   text: '联系客服'
+    // }, ],
     motto: 'Hello World',
     userInfo: {},
     hasUserInfo: false,
@@ -18,11 +69,51 @@ Page({
     })
   },
   onLoad() {
+    var that = this
+    var opneId = wx.getStorageSync('openId')
     if (wx.getUserProfile) {
       this.setData({
         canIUseGetUserProfile: true
       })
     }
+    //获取金额
+    wx.request( { 
+      url: link + "/v1/user/wallet/get", 
+      header: { 
+       "Content-Type": "application/json"
+      }, 
+      method: "POST",
+      data:  { openId: opneId }, 
+      success (res) {
+        console.log(res)
+       
+        // if (res.data.code == 200){
+        //   pid = res.data.data.pid
+        // }
+        that.setData({
+          wallet: res.data.data.wallet
+         })
+        
+      
+      }
+     }) 
+
+
+  },
+  clickGrid(e) {
+
+    if (e.detail.cell.text == "我的订单"){
+      wx.navigateTo({
+        url:"/pages/order/order"
+      })
+    } else {
+       wx.showToast({
+        title: "功能开发中...",
+        icon: 'none'
+      });
+    }
+
+   
   },
   getUserProfile(e) {
     // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗

+ 6 - 2
pages/index/index.json

@@ -3,6 +3,10 @@
   "usingComponents": {
     "content-title": "/components/content-title/index",
     "content-card": "/components/content-card/index",
-    "l-avatar": "/dist/avatar/index"
-  }
+    "l-avatar": "/dist/avatar/index",
+    "l-grid-item": "/dist/grid-item/index",
+    "l-grid": "/dist/grid/index",
+    "l-icon":"/dist/icon/index"
+  },
+  "navigationBarTitleText": "个人中心"
 }

+ 55 - 27
pages/index/index.wxml

@@ -1,34 +1,62 @@
 <!--index.wxml-->
-<!-- <view class="container">
-  <view class="userinfo">
-    <block wx:if="{{canIUseOpenData}}" calss="userinfo-opendata">
-      <view class="userinfo-avatar" bindtap="bindViewTap">
-        <open-data type="userAvatarUrl"></open-data>
-      </view>
-      <open-data type="userNickName"></open-data>
-    </block>
-    <block wx:elif="{{!hasUserInfo}}">
-      <button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
-      <button wx:elif="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
-      <view wx:else> 请使用1.4.4及以上版本基础库 </view>
-    </block>
-    <block wx:else>
-      <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
-      <text class="userinfo-nickname">{{userInfo.nickName}}</text>
-    </block>
-  </view>
-  <view class="usermotto">
-    <text class="user-motto">{{motto}}</text>
-  </view>
-</view> -->
 
-<!-- <content-card l-content="content" name="">
+
+<content-card l-content="content" name="头像">
       <view class="content-item">
         <l-avatar open-data="{{['userAvatarUrl','userNickName']}}" />
-        <text>总金额</text>
       </view>
-      <view class="content-item">
-      
+</content-card>
+
+   
+    <content-card class="content" name="收益">
+      <view class="view-container">
+        <l-grid>
+          <l-grid-item key="one" slot="one">
+            <view class="num">{{wallet.totalAmount}}</view>
+            <view class="text">历史总收益</view>
+          </l-grid-item>
+          <l-grid-item key="two" slot="two">
+            <view class="num">{{wallet.todayAmount}}</view>
+            <view class="text">今日预估收益</view>
+          </l-grid-item>
+          <l-grid-item key="three" slot="three">
+            <view class="num">{{wallet.yesterdayAmount}}</view>
+            <view class="text">昨日预估收益</view>
+          </l-grid-item>
+          <l-grid-item key="four" slot="four">
+            <view class="num">{{wallet.latelyAmount}}</view>
+            <view class="text">近30日收益</view>
+          </l-grid-item>
+          <l-grid-item key="five" slot="five">
+            <view class="num">{{wallet.availableAmount}}</view>
+            <view class="text">可提现金额</view>
+          </l-grid-item>
+          <l-grid-item key="six" slot="six">
+            <view class="num">{{wallet.withdrawalAmount}}</view>
+            <view class="text">已到账金额</view>
+          </l-grid-item>
+        </l-grid>
+      </view>
+    </content-card>
+
+    <!-- <content-card class="content" name="功能">
+      <view class="view-container" >
+        <l-grid  show-border="{{true}}" l-class="grid-container" >
+          <l-grid-item wx:for="{{grids1}}" wx:key="index" key="{{index}}" slot="{{index}}" l-grid-item="grid-item" bind:linitemtap="clickGrid">
+            <l-icon name="{{item.image}}" />
+            <view class="text">{{item.text}}</view>
+          </l-grid-item>
+        </l-grid>
       </view>
     </content-card> -->
-    <l-avatar open-data="{{['userAvatarUrl','userNickName']}}" />
+
+    <content-card class="content" name="功能">
+      <view class="view-container">
+        <l-grid show-border="{{true}}">
+          <l-grid-item wx:for="{{grids1}}" wx:key="index" key="{{index}}" slot="{{index}}" bind:linitemtap="clickGrid" cell="{{item}}" l-grid-item="grid-item">
+            <l-icon name="{{item.image}}" />
+            <view class="text">{{item.text}}</view>
+          </l-grid-item>
+        </l-grid>
+      </view>
+    </content-card>

+ 22 - 1
pages/index/index.wxss

@@ -49,4 +49,25 @@
   display       : flex;
   flex-direction: column;
   align-items   : center;
-}
+}
+
+
+.num {
+  color: #fc6517;
+  font-size: 42rpx;
+  
+}
+
+.text {
+  height: 30rpx;
+  font-size: 22rpx;
+  font-family: PingFangSC-Regular;
+  font-weight: 400;
+  color: rgba(102, 102, 102, 1);
+  line-height: 30rpx;
+  margin-top: 9rpx;
+}
+
+.grid-item {
+  height: 200rpx;
+} 

+ 66 - 0
pages/order/order.js

@@ -0,0 +1,66 @@
+// pages/order/order.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/order/order.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 29 - 0
pages/order/order.wxml

@@ -0,0 +1,29 @@
+<!--pages/order/order.wxml-->
+<view wx:for="{{goodsList}}" wx:key="msg">
+  <l-card  type="primary" l-img-class="right-card" position="left" image="{{item.goods_image_url}}"
+  bindtap="goodsDetail"  data-sign="{{item.goods_sign}}" data-searchId="{{item.search_id}}"   full="true" >
+
+    <view class="super-long-test">
+      <image class="empty-icon" src="/pages/image/dd.png" ></image>
+      {{item.goods_name}}
+    </view>
+    <view class="containertag">
+      <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag" class="describe" >{{item.coupon_discount/100}}元券</l-tag>
+      <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag"  class="fanli">返利{{(item.promotion_rate/100)}}</l-tag>
+     
+    </view>
+    <view class="price-v">
+     <text class="price">劵后¥{{(item.min_group_price-item.coupon_discount)/100}}</text> <text class="yprice">原价{{item.min_group_price/100}}</text>  
+    </view>
+    <text class="contentcard">
+    销量:{{item.sales_tip}}
+   </text>
+      <text class="contentcard">店铺:{{item.mall_name}}</text>
+  </l-card>
+</view>
+
+<l-loadmore show="{{true}}" end-text="我是有底线的~" type="{{lType}}">
+  <!-- <view slot="content">
+    我是有底线的~
+  </view> -->
+</l-loadmore>

+ 236 - 0
pages/order/order.wxss

@@ -0,0 +1,236 @@
+/* pages/order/order.wxss */
+.content-name {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular;
+  font-weight: 400;
+  color: rgba(69, 82, 107, 1);
+  line-height: 20px;
+  margin-left: 8px;
+}
+
+.icon-container{
+  display: flex;
+  flex-direction: row;
+  align-items: center
+}
+
+.city{
+  font-size: 28rpx;
+  color: #333;
+  margin-right: 10rpx;
+}
+
+.aa{
+  margin-top: 20rpx;
+}
+
+.bb{
+  width: 500rpx !important; 
+}
+
+
+.header{
+  position: fixed;
+  top: 0;
+  left: 0;
+}
+
+.content {
+  /* height: 400rpx; */
+  position: relative;
+}
+
+.tab-content {
+  min-height: 140rpx;
+  height: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: 28rpx;
+  color: rgba(140, 152, 174, 1);
+}
+
+.toggle-button {
+  position: absolute !important;
+  top: -80rpx;
+  right: 20rpx;
+  min-width: 72rpx !important;
+  padding: 0 !important;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  border-radius: 50% !important;
+  background: transparent !important;
+}
+
+.swipeable-header {
+  margin: 0 auto;
+  width: 327rpx !important;
+  border: 0 !important;
+}
+
+.swipeable-class-inactive {
+  border-width: 8rpx !important;
+}
+
+.swipeable-class-active {
+  font-weight: 900 !important;
+  font-size: 34rpx !important;
+  border-width: 6rpx !important;
+}
+
+.line-tabs {
+  background: rgba(90, 120, 158, 1) !important;
+}
+
+.tab-image {
+  width: 44rpx !important;
+  height: 44rpx !important;
+}
+
+.line-class {
+  width: 30rpx !important;
+}
+
+
+.card {
+  margin: 10rpx auto !important;
+}
+
+.right-card {
+  height: 250rpx !important;
+  width: 250rpx !important;
+  border-radius: 12rpx !important;
+}
+
+.card-dot {
+  width: 18rpx;
+  height: 18rpx;
+  border-radius: 50%;
+  border: 6rpx solid #3963bc;
+  margin-left: 26rpx;
+}
+
+.card-top {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  width: 750rpx;
+  height: 100rpx;
+}
+
+
+.contentcard-name {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular;
+  font-weight: 400;
+  color: rgba(69, 82, 107, 1);
+  line-height: 20px;
+  margin-left: 8px;
+}
+
+.contentcard {
+  margin:5rpx 0rpx 0rpx 0rpx;   
+  color: #666;
+  font-size: 25rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 5;
+}
+
+.avter-contentcard {
+  margin-top: 10rpx;
+  color: #333;
+  font-size: 26rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 5;
+}
+
+
+.super-long-test{
+  display: -webkit-box;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ font-size: 30rpx;
+ overflow: hidden;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp:2;
+}
+
+
+.empty-icon{
+  width: 30rpx;
+  height: 30rpx;
+  background-color:rgb(252, 248, 248);
+}
+
+
+.containertag{
+  display: flex;
+  flex-direction: row;
+  align-items: flex-end;
+  flex-wrap: wrap;
+}
+
+.btn{
+  margin-bottom: 5rpx;
+}
+.describe{
+  color: #f4f4f5;
+    font-size: 28rpx;
+    
+}
+
+.fanli{
+  position: absolute;
+  right: 10rpx;
+  
+}
+
+.l-tag {
+  padding: 0 16rpx;
+ 
+  display: inline-flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: row;
+  color: #fff;
+  background-color: #3963bc;
+  margin-left: 15rpx;
+}
+.tag{
+  margin: 6rpx 15rpx 6rpx 0 !important;
+}
+.price-container{
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-left: 10rpx;
+}
+
+
+.price{
+  color:#d81e06;
+  font-size: 30rpx;
+ 
+ 
+  position: absolute;
+  
+}
+.yprice{
+  position: absolute;
+  right: 30rpx;
+  color: #999;
+  font-size: 25rpx;
+  text-decoration:line-through;
+
+  
+}
+.price-v{
+  margin:5rpx 0rpx 10rpx 0rpx;   
+}

+ 0 - 3
pages/shouye/shouye.js

@@ -174,9 +174,6 @@ Page({
       } 
      }) 
 
-
-
-
    
   },
 

+ 2 - 2
pages/shouye/shouye.wxml

@@ -17,8 +17,8 @@
     </view>
     <view class="containertag">
       <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag" class="describe" >{{item.coupon_discount/100}}元券</l-tag>
-      <!-- <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag"  class="fanli">返利{{item.promotion_rate/100}}</l-tag>
-      -->
+      <l-tag plain="{{true}}" font-color="#d81e06" shape="circle" size="medium"  l-class="tag"  class="fanli">返利{{(item.promotion_rate/100)}}</l-tag>
+     
     </view>
     <view class="price-v">
      <text class="price">劵后¥{{(item.min_group_price-item.coupon_discount)/100}}</text> <text class="yprice">原价{{item.min_group_price/100}}</text>