Explorar o código

新增提成页面

junyuanz %!s(int64=3) %!d(string=hai) anos
pai
achega
73b92a77b0

+ 1 - 0
app.json

@@ -55,6 +55,7 @@
         "pages/user/orders/orders",
         "pages/user/order/order",
         "pages/user/comment/comment",
+        "pages/user/commission/commission",
         "pages/user/logistics/logistics",
         "pages/user/safe/safe",
         "pages/user/exchange/exchange",

+ 70 - 0
packageUser/pages/user/commission/commission.js

@@ -0,0 +1,70 @@
+var _request = require('../../../../utils/request.js')
+var util = require('../../../../utils/util.js')
+Page({
+  data: {
+    page: 1,
+    per_page: 20,
+    list: [],
+    more: true,
+    balance: 0
+  },
+  onLoad: function (options) {
+    // this.getBalanceInfo()
+    this.getBalanceList()
+  },
+  onShow () {
+  },
+  onReachBottom: function () {
+    if (this.data.more) {
+      var page = this.data.page + 1
+      this.setData({
+        page: page
+      })
+      this.getBalanceList()
+    }
+  },
+  getBalanceInfo () {
+    var that = this
+    var url = 'v1/user/balance/info'
+    var params = {
+    }
+    var success = function (res) {
+      var result = res.data.silver_total
+      that.setData({
+        balance: result
+      })
+    }
+    _request.$get(url, params, success)
+  },
+  getBalanceList () {
+    var that = this
+    var url = 'v1/district/orders'
+    var params = {
+      page: this.data.page,
+      per_page: this.data.per_page
+    }
+    var success = function (res) {
+      var result = that.data.list.concat(res.data.list || []);
+	  console.log('result',result)
+      that.setData({
+        list: result
+      })
+      var listMore = res.data.list_count > that.data.list.length
+      that.setData({
+        more: listMore
+      })
+    }
+    _request.$get(url, params, success)
+  },
+  // getDetail (val) {
+  //   var id = val.currentTarget.dataset.val
+  //   wx.navigateTo({
+  //     url: '/packageUser/pages/user/silverDetail/silverDetail?id=' + id
+  //   })
+  // },
+  onShareAppMessage: function (val) {
+    return _request.share({
+      sc: 'xcx_user_silver'
+    })
+  }
+})

+ 7 - 0
packageUser/pages/user/commission/commission.json

@@ -0,0 +1,7 @@
+{
+  "navigationBarTitleText": "我的提成",
+  "usingComponents": {
+    "format-time": "../../../../component/formatTime/formatTime"
+  },
+  "backgroundColor": "#f3f3f3"
+}

+ 18 - 0
packageUser/pages/user/commission/commission.wxml

@@ -0,0 +1,18 @@
+<view class="bg">
+  <!-- <view class="radish-top">
+    <view class="radish-top__title">我的提成</view>
+    <view class="radish-top__count">{{balance / 100}}</view>
+  </view> -->
+  <!-- <view class="silver-help-height"></view> -->
+  <view class="radish-main">
+    <!-- <view class="radish-main__title">交易记录</view> -->
+    <view class="radish-main__line" wx:key="{{index}}" data-val="{{item.id}}" wx:for="{{list}}">
+      <view class="radish-main__left">
+        <view class="radish-main__text ellipsis">{{item.order_id}} - {{item.contact}}</view>
+        <view class="radish-main__time"><format-time type="formatTime" value="{{item.ctime}}" ></format-time></view>
+        <view class="clean"></view>
+      </view>
+      <view class="radish-main__count">{{item.dis_amount / 100}}</view>
+    </view>
+  </view>
+</view>

+ 116 - 0
packageUser/pages/user/commission/commission.wxss

@@ -0,0 +1,116 @@
+.bg {
+  position: relative;
+  width: 100%;
+  min-height: 100%;
+  background-color: #f3f3f3;
+}
+.radish-top {
+  width: 100%;
+  height: 360rpx;
+  background-image: url('http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/djquan.jpg');
+  background-size: 100%;
+}
+.radish-top__title {
+    padding: 95rpx 0 0;
+    font-size: 34rpx;
+    color: #FFF;
+    text-align: center;
+    text-shadow: 1px 1px 1px #bb954d;
+}
+.radish-top__count {
+    font-size: 70rpx;
+    color: #fff;
+    text-align: center;
+    text-shadow: 1px 1px 1px #e6231d;
+}
+.radish-top__btn {
+  position: absolute;
+  top: 190rpx;
+  left: 150rpx;
+  width: 196rpx;
+  height: 60rpx;
+  border: 2rpx solid #fff;
+  margin: 48rpx auto 0;
+  text-align: center;
+  line-height: 60rpx;
+  border-radius: 8rpx;
+  font-size: 28rpx;
+  color: #fff;
+}
+.radish-top__btn1 {
+    position: absolute;
+    top: 210rpx;
+    width: 206rpx;
+    height: 60rpx;
+    border: 2rpx solid #eb4d20;
+    margin: 48rpx auto 0;
+    text-align: center;
+    line-height: 60rpx;
+    border-radius: 45px;
+    font-size: 32rpx;
+    color: #fff;
+    right: calc(50% - 103rpx);
+    background: linear-gradient(to right,#eb712c,#e71f1c);
+}
+.radish-main {
+  background-color: #fff;
+}
+.radish-main__title {
+  height: 50rpx;
+  line-height: 50rpx;
+  color: #bbbbbb;
+  background-color: #f3f3f3;
+  text-align: center;
+  font-size: 24rpx;
+}
+.radish-main__line {
+  margin: 0 20rpx;
+  height: 100rpx;
+  border-bottom: 1rpx solid #eeeeee;
+}
+.radish-main__left {
+  float: left;
+  width: 450rpx;
+}
+.radish-main__text {
+  float: left;
+  padding-top: 16rpx;
+  font-size: 28rpx;
+  color: #4c4c4c;
+  width: 450rpx;
+}
+.radish-main__time {
+  float: left;
+  font-size: 18rpx;
+  color: #bbbbbb;
+  padding-top: 5rpx;
+}
+.radish-main__count {
+  float: right;
+  width: 260rpx;
+  font-size: 28rpx;
+  line-height: 100rpx;
+  text-align: right;
+  color: #eab86a;
+}
+
+.silver-help-height{
+	height: 240rpx;
+	    background: linear-gradient(#f2bb2d, #f3f3f3);
+}
+.silver-help{
+    padding: 15px;
+    background: rgb(230 35 29 / 0.7);
+    font-size: 26rpx;
+    position: absolute;
+    width: 96%;
+    left: 2%;
+    box-sizing: border-box;
+	top: 250rpx;
+    border-radius: 4px;
+}
+.silver-help text{
+margin-bottom: 10rpx;
+    display: block;
+    color: #fff;
+}

+ 5 - 0
pages/user/all/all.js

@@ -525,6 +525,11 @@ Page({
       url: '/packageUser/pages/user/cash/cash'
     })
   },
+  toCommission () {
+    wx.navigateTo({
+      url: '/packageUser/pages/user/commission/commission'
+    })
+  },
   toIntegral () {
     wx.navigateTo({
       url: '/packageUser/pages/user/integral/integral'

+ 4 - 0
pages/user/all/all.wxml

@@ -137,6 +137,10 @@
         <view class="user-line__title">我的收入</view>
         <image class="user-line__right" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>
       </view>
+	  <view class="user-line" bindtap="toCommission" style="border:0;" wx:if="{{userInfo.tc_bl>0}}">
+	    <view class="user-line__title">我的提成</view>
+	    <image class="user-line__right" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>
+	  </view>
     </view>
     <view class="user-padding">
       <!-- <view class="user-line" bindtap="toBindOldSys" wx:if="{{info.wx_user.can_bind}}">

+ 2 - 2
utils/request.js

@@ -1,7 +1,7 @@
 // 新正式(未审批)
-const apiHost = 'https://fohowapi.hiwavo.com/' 
+// const apiHost = 'https://fohowapi.hiwavo.com/' 
 // 测试
-// const apiHost = 'https://tfohowapi.hiwavo.com/'
+const apiHost = 'https://tfohowapi.hiwavo.com/'
 
 
 function $get (url, params, success, fail) {