junyuanz před 3 roky
rodič
revize
72c836b648

+ 2 - 0
app.json

@@ -48,6 +48,8 @@
         "pages/user/integral/checkin/checkin",
         "pages/user/radish/radish",
         "pages/user/radishDetail/radishDetail",
+		"pages/user/cash/cash",
+		"pages/user/cashDetail/cashDetail",
 		"pages/user/silver/silver",
 		"pages/user/silverDetail/silverDetail",
         "pages/user/orders/orders",

+ 200 - 0
packageUser/pages/user/cash/cash.js

@@ -0,0 +1,200 @@
+var _request = require('../../../../utils/request.js')
+var util = require('../../../../utils/util.js')
+Page({
+  data: {
+    page: 1,
+    per_page: 20,
+    list: [],
+    more: true,
+    balance: 0,
+	confirmDialog:false,
+	min_cash:0,
+	max_cahs:0,
+	fee:0,
+	withdraw_num:0,
+	view_withdraw:0,
+	view_fee:0
+  },
+  onLoad: function (options) {
+    this.getBalanceInfo()
+    this.getBalanceList()
+	// this.getCashTotal()
+  },
+  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/cash/balance/info'
+    var params = {
+    }
+    var success = function (res) {
+      var result = res.data.total
+      that.setData({
+        balance: result,
+		cashTotal: res.data
+      })
+	  
+	  
+	  that.getWithDrawlimit()
+    }
+    _request.$get(url, params, success)
+  },
+  getBalanceList () {
+    var that = this
+    var url = 'v1/user/cash/balances'
+    var params = {
+      page: this.data.page,
+      per_page: this.data.per_page
+    }
+    var success = function (res) {
+      var result = that.data.list.concat(res.data.balance_list || [])
+      that.setData({
+        list: result
+      })
+      var listMore = res.data.balance_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/cashDetail/cashDetail?id=' + id
+    })
+  },
+  onShareAppMessage: function (val) {
+    return _request.share({
+      sc: 'xcx_user_radish'
+    })
+  },
+  getCashTotal () {
+    var that = this
+    var url = 'v1/user/cash/balance/info'
+    var params = {
+    }
+    var success = function (res) {
+  		console.log('res.data',res.data)
+      that.setData({
+        cashTotal: res.data
+      })
+    }
+    _request.$get(url, params, success)
+  },
+  getWithDrawlimit () {
+    var that = this
+  		var url = 'v1/user/takecash/limit'
+    var params = {}
+    var success = function (res) {
+		var withdrawnum = that.data.balance > res.data.max_limit_cash ? res.data.max_limit_cash:that.data.balance;
+      that.setData({
+        min_cash: res.data.min_limit_cash,
+        max_cash: res.data.max_limit_cash,
+		fee:res.data.fee_bl ? res.data.fee_bl : 0,
+		withdraw_num: withdrawnum,
+		view_withdraw:parseFloat(withdrawnum/100).toFixed(2),
+		view_fee:parseFloat(withdrawnum * (res.data.fee_bl?res.data.fee_bl/100:0)/100).toFixed(2)
+      })
+    }
+    _request.$get(url, params, success)
+  },
+  goWithdrawClick () {
+    wx.navigateTo({
+      url: '/packageUser/pages/user/withdraw/withdraw'
+    })
+  },
+  getBankInfoAndTip(){
+  	var that = this
+   //  var url = 'v1/user/get_bank_info'
+   //  var params = {
+   //  }
+   //  var success = function (res) {
+   //    	that.setData({
+  			//     has_bank:res.data.has_bank
+   //      })
+      	
+      	// if(that.data.has_bank){
+  			that.data.confirmDialog = !that.data.confirmDialog
+  			if (that.data.withdraw_num > that.data.min_cash) {
+  			  that.setData({
+  				confirmDialog: that.data.confirmDialog
+  			  })
+  			} else {
+  			  wx.showToast({
+  				title: '单次提现金额范围,大于'+parseFloat(that.data.min_cash/100).toFixed(2) +'元 单次最高'+parseFloat(that.data.max_cash/100).toFixed(2) +'元',
+  				icon: 'none',
+  				duration: 2000
+  			  })
+  			}
+  		// }else{
+  		// 	wx.showToast({
+  		// 	title: '提现请先绑定银行卡~',
+  		// 	icon: 'none',
+  		// 	duration: 2000
+  		//   })
+  		// 	setTimeout(function(){
+  		// 		wx.navigateTo({
+  		// 		  url: '/packageUser/pages/user/bankinfo/bankinfo'
+  		// 		})
+  		// 	},1000)
+  		// }
+    // }
+    // _request.$get(url, params, success)
+  },
+  confrimClick () {
+      var that = this
+      console.log('that.data.has_bank',that.data.has_bank)
+  //  if (that.data.has_bank) {
+        that.withdrawClick()
+  //  } else {
+  //    that.setData({
+  //      confirmDialog: false,
+  //      identityDialog: true
+  //    })
+  //  }
+    },
+    closedDialog () {
+      var that = this
+      that.setData({
+        confirmDialog: false
+      })
+    },
+    withdrawClick () {
+      var that = this
+      var url = 'v1/user/takecash'
+      var params = {
+        amount: that.data.withdraw_num
+      }
+      var success = function (res) {
+        if (res.data) {
+          that.setData({
+            confirmDialog: false
+          })
+          // that.data.lockWithdraw = false
+          wx.showToast({
+            title: '提现成功~',
+            icon: 'none',
+            duration: 2000
+          })
+		  that.getBalanceInfo()
+		  that.getBalanceList()
+		  that.getCashTotal()
+		  that.getWithDrawlimit()
+          wx.navigateTo({
+            url: '/packageUser/pages/user/withdraw/withdraw'
+          })
+        }
+      }
+      _request.$post(url, params, success)
+    },
+})

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

@@ -0,0 +1,7 @@
+{
+  "navigationBarTitleText": "佣金",
+  "usingComponents": {
+    "format-time": "../../../../component/formatTime/formatTime"
+  },
+  "backgroundColor": "#f3f3f3"
+}

+ 51 - 0
packageUser/pages/user/cash/cash.wxml

@@ -0,0 +1,51 @@
+<view class="bg">
+  <view class="radish-top">
+	<view class="wd-list" bindtap="goWithdrawClick">提现记录</view>
+    <view class="radish-top__title">我的佣金</view>
+    <view class="radish-top__count">{{balance / 100}}</view>
+	<view class="radish-top__btn22" bindtap="getBankInfoAndTip">点击提现</view>
+    <!--<navigator url="/packageUser/pages/user/exchange/exchange" >
+      <view class="radish-top__btn">兑换佣金</view>
+    </navigator>-->
+    <!-- <navigator url="/packageUser/pages/user/buy/buy" >
+      <view class="radish-top__btn1">购买佣金</view>
+    </navigator> -->
+  </view>
+  <view class="radish-main">
+    <view class="radish-main__title">交易记录</view>
+    <view class="radish-main__line" wx:key="{{index}}" bindtap="getDetail" data-val="{{item.id}}" wx:for="{{list}}">
+      <view class="radish-main__left">
+        <view class="radish-main__text ellipsis">{{item.source_name}} - {{item.remark}}</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.count / 100}}佣金</view>
+    </view>
+  </view>
+  
+  
+  <!-- 确认提现弹框 -->
+  <view class="fund__modal" wx:if="{{confirmDialog}}" bindtap="closedDialog">
+    <view class="content">
+      <image class="image2" src="{{bannerList[0].img}}"></image>
+      <view class="doing">{{bannerList[0].name}} </view>
+	  <view >剩余 {{balance / 100}}</view>
+	  <view >本次提现金额 {{view_withdraw}},手续费 {{view_fee}}</view>
+      <view class="continue" bindtap="buyClick">继续赚钱</view>
+      <view class="withdraw" bindtap="confrimClick">确认提现</view>
+    </view>
+  </view>
+  <!-- 未认证提示弹框 -->
+  <view class="fund__modal" wx:if="{{identityDialog}}">
+    <view class="content">
+      <image class="image1" src="https://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/xcx/rabbitimg/identity_bg.png"></image>
+      <view class="p1">尚未认证身份</view>
+      <view class="p2">提现前需完成认证操作</view>
+      <view class="btn">
+        <view class="noBtn" bindtap="cancelIdentity">暂不认证</view>
+        <view class="goBtn" bindtap="goIdentityClick">前往认证</view>
+        <view class="clean"></view>
+      </view>
+    </view>
+  </view>
+</view>

+ 208 - 0
packageUser/pages/user/cash/cash.wxss

@@ -0,0 +1,208 @@
+.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;
+}
+
+.fund__modal {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  padding: 0 20rpx;
+  background: rgba(0, 0, 0, 0.3);
+  box-sizing: border-box;
+  z-index: 200;
+}
+.fund__modal .content {
+  width: 560rpx;
+  background: #fff;
+  text-align: center;
+  font-size: 32rpx;
+  color: #7f93ae;
+  margin: 360rpx auto 0;
+}
+.fund__modal .image1 {
+  display: block;
+  width: 82rpx;
+  height: 102rpx;
+  margin: 0 auto 20rpx;
+  padding-top: 90rpx;
+}
+.fund__modal .image2 {
+  display: block;
+  width: 560rpx;
+  height: 472rpx;
+  margin-bottom: 20rpx;
+}
+.fund__modal .p1{
+  font-size: 36rpx;
+  font-weight: 600;
+  margin-bottom: 30rpx;
+}
+.fund__modal .p2{
+  font-size: 28rpx;
+  margin-bottom: 42rpx;
+}
+.fund__modal .btn {
+  width: 560rpx;
+  height: 100rpx;
+  line-height: 100rpx;
+  font-size: 28rpx;
+  text-align: center;
+}
+.fund__modal .noBtn {
+  float: left;
+  width: 50%;
+  height: 100rpx;
+  background-image: linear-gradient(90deg, 
+    #e5e9ec 0%, 
+    #cfd9e0 100%);
+  line-height: 100rpx;
+  font-size: 28rpx;
+  text-align: center;
+  color: #7f93ae;
+}
+.fund__modal .goBtn {
+  float: left;
+  width: 50%;
+  height: 100rpx;
+  background-image: linear-gradient(90deg, 
+    #eab86a 0%, 
+    #e23232 100%);
+  line-height: 100rpx;
+  font-size: 28rpx;
+  text-align: center;
+  color: #fff;
+}
+.fund__modal .doing {
+  font-size: 28rpx;
+}
+.fund__modal .continue {
+  width: 376rpx;
+  height: 88rpx;
+  background-image: linear-gradient(90deg, 
+    #eab86a 0%, 
+    #e23232 100%);
+  border-radius: 44rpx;
+  margin: 40rpx auto 30rpx;
+  font-size: 28rpx;
+  color: #fff;
+  line-height: 88rpx;
+  letter-spacing: 6rpx;
+}
+.fund__modal .withdraw {
+  font-size: 28rpx;
+  padding-bottom: 44rpx;
+}
+
+.radish-top__btn22{
+	width: 196rpx;
+    height: 60rpx;
+    border: 2rpx solid #fff;
+    background: rgba(255,255,255,0.2);
+    margin: 30rpx auto 0;
+    text-align: center;
+    line-height: 60rpx;
+    border-radius: 8rpx;
+    font-size: 28rpx;
+    color: #fff;
+}
+
+.wd-list{
+  position: absolute;
+      right: 20rpx;
+      top: 20rpx;
+      color: #fff;
+}

+ 29 - 0
packageUser/pages/user/cashDetail/cashDetail.js

@@ -0,0 +1,29 @@
+var _request = require('../../../../utils/request.js')
+var rid
+Page({
+  data: {
+    detail: {}
+  },
+  onLoad: function (options) {
+    rid = options.id
+    this.getRadish()
+  },
+  getRadish () {
+    var that = this
+    var url = 'v1/user/balance/' + rid
+    var params = {
+    }
+    var success = function (res) {
+      var data = res.data
+      that.setData({
+        detail: data
+      })
+    }
+    _request.$get(url, params, success)
+  },
+  onShareAppMessage: function (val) {
+    return _request.share({
+      sc: 'xcx_user_radishdetail'
+    })
+  }
+})

+ 6 - 0
packageUser/pages/user/cashDetail/cashDetail.json

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "佣金",
+  "usingComponents": {
+    "format-time": "../../../../component/formatTime/formatTime"
+  }
+}

+ 34 - 0
packageUser/pages/user/cashDetail/cashDetail.wxml

@@ -0,0 +1,34 @@
+<view class="bg">
+  <view class="radishDetail">
+    <view class="radishDetail-count">
+      <view class="radishDetail-count__title">数量</view>
+      <view class="radishDetail-count__value">{{detail.count / 100}}佣金</view>
+      <view class="clean"></view>
+    </view>
+    <view class="radishDetail-line">
+      <view class="radishDetail-line__title">类型</view>
+      <view class="radishDetail-line__value ellipsis">{{detail.source_name}}</view>
+      <view class="clean"></view>
+    </view>
+    <view class="radishDetail-line">
+      <view class="radishDetail-line__title">时间</view>
+      <view class="radishDetail-line__value ellipsis"><format-time type="formatTime" value="{{detail.ctime}}" ></format-time></view>
+      <view class="clean"></view>
+    </view>
+    <view class="radishDetail-line">
+      <view class="radishDetail-line__title">交易单号</view>
+      <view class="radishDetail-line__value ellipsis">{{detail.relate_id}}</view>
+      <view class="clean"></view>
+    </view>
+<!--     <view class="radishDetail-line">
+      <view class="radishDetail-line__title">剩余佣金</view>
+      <view class="radishDetail-line__value ellipsis">此字段接口无返回</view>
+      <view class="clean"></view>
+    </view> -->
+    <view class="radishDetail-line">
+      <view class="radishDetail-line__title">备注</view>
+      <view class="radishDetail-line__value">{{detail.remark}}</view>
+      <view class="clean"></view>
+    </view>
+  </view>
+</view>

+ 37 - 0
packageUser/pages/user/cashDetail/cashDetail.wxss

@@ -0,0 +1,37 @@
+.bg {
+  position: relative;
+  width: 100%;
+  min-height: 100%;
+  background-color: #ffffff;
+}
+.radishDetail {
+  padding: 0 20rpx;
+}
+.radishDetail-count {
+  font-size: 28rpx;
+  line-height: 120rpx;
+  border-bottom: 1rpx solid #eeeeee;
+  margin-bottom: 20rpx;
+}
+.radishDetail-count__title {
+  color: #999999;
+  float: left;
+}
+.radishDetail-count__value {
+  color: #4c4c4c;
+  float: right;
+}
+.radishDetail-line {
+  font-size: 28rpx;
+  line-height: 72rpx;
+}
+.radishDetail-line__title {
+  color: #999999;
+  float: left;
+}
+.radishDetail-line__value {
+  color: #4c4c4c;
+  float: right;
+  width: 540rpx;
+  text-align: right;
+}

+ 21 - 4
packageUser/pages/user/order/order.wxml

@@ -90,19 +90,36 @@
       <view wx:if="{{order.status === 'unpay'}}">
 	      <view>
 	      	<view class="orderDetail-payPrice__title">还需支付合计总额</view>
-	      	<text class="orderDetail-payPrice__count">{{(order.total_price+order.freight-order.coupon_price) / 100}}</text>
+	      	<text class="orderDetail-payPrice__count">{{(order.total_price+order.freight-order.paied_silver-order.coupon_price-order.dis_amount-order.paied_cash) / 100}}</text>
 	      </view>
       </view>
       <view wx:if="{{order.status !== 'unpay'}}">
-      	<view style="overflow: hidden;width: 100%;">
+		  <view wx:if="{{order.dis_amount > 0}}" style="overflow: hidden;width: 100%;">
+		    	<view class="orderDetail-payPrice__title">店长折扣</view>
+		    	<text class="orderDetail-payPrice__count">-{{order.dis_amount / 100}}</text>
+		    </view>
+			
+		  <view style="overflow: hidden;width: 100%;">
+		    	<view class="orderDetail-payPrice__title">银豆抵扣</view>
+		    	<text class="orderDetail-payPrice__count">-{{order.paied_silver / 100}}</text>
+		    </view>
+			
+		<view style="overflow: hidden;width: 100%;">
 	      	<view class="orderDetail-payPrice__title">积分抵扣</view>
-	      	<text class="orderDetail-payPrice__count">{{order.cent_price / 100}}积分</text>
-	      </view>
+	      	<text class="orderDetail-payPrice__count">-{{order.cent_price / 100}}积分</text>
+	    </view>
 	      
 	      <view style="overflow: hidden;width: 100%;">
 	      	<view class="orderDetail-payPrice__title">提货券抵扣</view>
 	      	<text class="orderDetail-payPrice__count">{{order.coupon_price / 100}}提货券</text>
 	      </view>
+		  
+		  <view style="overflow: hidden;width: 100%;">
+			<view class="orderDetail-payPrice__title">佣金抵扣</view>
+			<text class="orderDetail-payPrice__count">-{{order.paied_cash / 100}}佣金</text>
+		  </view>
+				  
+				  
 	      <view style="overflow: hidden;width: 100%;">
 	      	<view class="orderDetail-payPrice__title">微信支付</view>
 	      	<currency style="float: right;height: 44px;color: #eab86a;" symbol="¥" value="{{order.paied_price}}"></currency>

+ 1 - 1
packageUser/pages/user/radish/radish.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "提货券",
+  "navigationBarTitleText": "佣金",
   "usingComponents": {
     "format-time": "../../../../component/formatTime/formatTime"
   },

+ 4 - 4
pages/home/home.wxml

@@ -29,7 +29,7 @@
         </navigator>-->
         <view wx:key="{{index}}" bindtap="toviewfunc" data-val="{{item}}" wx:for="{{iconslist}}" class="item-box">
           <image src="{{item.cover}}" class="item-index" />
-          <view class="item-name"><i wx:if="{{item.pv < item.price}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>{{item.name}}</view>
+          <view class="item-name"><!-- <i wx:if="{{!item.use_quan}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i> -->{{item.name}}</view>
         </view>
       <!-- <view bindtap="tocentcart" class="item-box">
         <image src="http://fohow.oss-cn-shenzhen.aliyuncs.com/navigation_icons/cent.png" class="item-index" />
@@ -384,7 +384,7 @@
 			<view class="project-pack" wx:if="{{item.package}}">
 				<view class="project-left-pack">
 					<view class="project-title ellipsisLn" style="min-height: 48rpx;max-height:102">
-						<i wx:if="{{item.pv < item.price}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>
+						<i wx:if="{{!item.use_quan}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>
 						{{item.name}}
 					</view>
 
@@ -412,7 +412,7 @@
 			<view  class="project" wx:else>
 				<view class="project-left">
 					<view class="project-title ellipsisLn">
-						<i wx:if="{{item.pv < item.price}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>
+						<i wx:if="{{!item.use_quan}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>
 						{{item.name}}
 					</view>
 				
@@ -444,7 +444,7 @@
           <video class="project-video" custom-cache="{{false}}" bindtap='videoTap' data-index="{{index}}"  id='video{{index}}' show-fullscreen-btn="{{false}}" enable-progress-gesture="{{false}}" src="{{item.video_url}}" controls="{{false}}" show-center-play-btn='{{false}}'>
           	<cover-image class="playImg" src="../../images/footer/play.png"  wx:if="{{!item.video_play}}"></cover-image>
           </video>
-          <view class="project-title ellipsisLn"><i wx:if="{{item.pv < item.price}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>{{item.name}}</view>
+          <view class="project-title ellipsisLn"><i wx:if="{{!item.use_quan}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>{{item.name}}</view>
           <view class="project-price" style="color: #999;text-decoration: line-through;font-size: 23rpx;">零售价:<currency symbol="¥" value="{{item.user_sale_price}}" /><!-- <currency symbol="¥" value="{{item.price}}" wx:if="{{balance === 0 || balance < item.price}}"></currency><text wx:if="{{balance !== 0 && balance >= item.price}}" class="project-point">{{item.price}}提货券</text> --></view>
           <view class="project-price" style="float: left;font-size:35rpx;"><currency symbol="¥" value="{{item.price}}" /><!-- <currency symbol="¥" value="{{item.price}}" wx:if="{{balance === 0 || balance < item.price}}"></currency><text wx:if="{{balance !== 0 && balance >= item.price}}" class="project-point">{{item.price}}提货券</text> --></view>
           <view class="project-count">已售{{item.sold_count}}件</view>

+ 27 - 4
pages/pay/pay.js

@@ -12,6 +12,7 @@ Page({
 	selectpickaddress:false,
     balanceInfo: {},
     centInfo:{},
+	cashInfo:{},
     userInfo: {},
     radish: 0,
     pwd: '',
@@ -42,7 +43,8 @@ Page({
 	pickindex:0,
 	pickid:0,
 	has_unuse_quan:false,
-	use_silver:0
+	use_silver:0,
+	pay_cash:0//佣金抵扣
   },
   onLoad: function (options) {
     this.data.orderId = options.orderId;
@@ -162,7 +164,7 @@ Page({
       if(that.data.payData.order_type == 3){
       	that.getCentInfo();
       }else{
-      	that.getBalanceInfo();
+		that.getCashInfo();
       }
       
 	  if(val.data.pay_way != '' && (val.data.address_id != 0 || val.data.pick_dept != 0)){
@@ -213,6 +215,20 @@ Page({
     }
     __request.$get(url, params, success)
   },
+  getCashInfo: function(){
+	  var that = this
+	  var url = "v1/user/cash/balance/info";
+	  var params = {}
+	  var success = function (res) {
+	    console.log('res.data',res.data)
+	    that.setData({
+	      cashInfo: res.data
+	    })
+		
+		that.getBalanceInfo();
+	  }
+	  __request.$get(url, params, success)
+  },
   getBalanceInfo: function () {
     var that = this
     var url = "v1/user/balance/info";
@@ -321,6 +337,7 @@ Page({
 		console.log('mins_nouse',mins_nouse);
 		console.log('left_silver',left_silver);
 		console.log('sour_total',sour_total);
+		
 
 		//旧未减银豆
 		// if(that.data.payData.pay_way == ''){
@@ -341,8 +358,13 @@ Page({
 		// 	afterdec = that.data.total+that.data.yunfei-that.data.payData.coupon_price;
 		// }
 		
-	
-	
+		var minus_cash = 0;
+		var trueafter = afterdec - that.data.payData.dis_amount;
+		if(that.data.cashInfo.total > 0 && trueafter > 0){
+			minus_cash = that.data.cashInfo.total < trueafter ? that.data.cashInfo.total : trueafter;
+		}
+		console.log('minus_cash',minus_cash);
+		
       that.setData({
         balanceInfo: val.data,
         cache: false,
@@ -356,6 +378,7 @@ Page({
 		minusTotal: sour_total,
 		discountBl: val.data.discount_bl,
 		sourceAfterdec: source_afterdec,
+		pay_cash: minus_cash
 		// disAmount:dis_amount
       });
     }

+ 45 - 11
pages/pay/pay.wxml

@@ -173,6 +173,24 @@
 		</view>
 	</view>
 	
+	<view class="pay-payway-item" wx:if="{{cashInfo.total > 0 && payData.pay_way == ''}}">
+		<view class="pay-payway-balance fl">
+	      <image class="pay-icon" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/image/pay/luobopay.jpg"></image>
+	      <text >佣金抵扣 (剩余:{{cashInfo.total / 100}})</text>
+	    </view>
+	    <view class="fr pay-balance-cash" wx:if="{{!payData.shut_wechat}}">
+			<text class="pay-circle">
+			  <text class="pay-select"></text>
+			</text>
+	      <!-- <switch checked bindchange="switchChange" color="#eab86a" style="zoom:0.75"/> -->
+	    </view>
+		<view class="fr pay-balance-cash" wx:else>
+		  <text class="pay-circle">
+		    <text class="pay-select"></text>
+		  </text>
+		</view>
+	</view>
+	
 	<!-- <view class="pay-payway-item" wx:if="{{balanceInfo.total && payData.pay_way == '' && payData.pv < payData.total_price}}"> -->
 	<view class="pay-payway-item" wx:if="{{balanceInfo.total && payData.pay_way == '' && has_unuse_quan}}">
 		<view class="pay-payway-balance fr">
@@ -252,27 +270,43 @@
 	  	订单总金额 <text style="color:#F00">{{receivetype == 0 ? ((payData.total_price + payData.freight) / 100) : (payData.total_price / 100)}}</text>
 	  </view>
 	  
-	  <view wx:if="{{payData.pay_way == ''}}" style="padding:15rpx;text-align:right">
-	  	使用银豆抵扣 <text style="color:#F00">-{{useSeilver / 100}}</text>
-	  </view>
-	  <view wx:if="{{payData.pay_way != ''}}" style="padding:15rpx;text-align:right">
-	  	使用银豆抵扣 <text style="color:#F00">-{{payData.paied_silver / 100}}</text>
+	  <view wx:if="{{payData.paied_silver>0 || useSeilver>0}}">
+		  <view wx:if="{{payData.pay_way == ''}}" style="padding:15rpx;text-align:right">
+		  	使用银豆抵扣 <text style="color:#F00">-{{useSeilver / 100}}</text>
+		  </view>
+		  <view wx:if="{{payData.pay_way != ''}}" style="padding:15rpx;text-align:right">
+		  	使用银豆抵扣 <text style="color:#F00">-{{payData.paied_silver / 100}}</text>
+		  </view>
 	  </view>
 	  
 	  
+	  
 	  <view wx:if="{{disAmount > 0 || payData.dis_amount > 0}}" style="padding:15rpx;text-align:right">
 	  	店长折扣优惠金额 
 		<text style="color:#F00" wx:if="{{payData.dis_amount}}">-{{payData.dis_amount / 100}}</text>
 		<text style="color:#F00" wx:else>-{{disAmount / 100}}</text>
 	  </view>
 	  
-	  <view wx:if="{{useBalance && payData.pay_way == ''}}" style="padding:15rpx;text-align:right">
-	  	使用提货券抵扣 <text style="color:#F00">-{{payData.coupon_price>0?payData.coupon_price/100:((minusTotal+yunfei)-afterdec) / 100}}</text> 提货券
+	  <view wx:if="{{payData.coupon_price>0 || ((minusTotal+yunfei)-afterdec)>0}}">
+		<view wx:if="{{useBalance && payData.pay_way == ''}}" style="padding:15rpx;text-align:right">
+			使用提货券抵扣 <text style="color:#F00">-{{payData.coupon_price>0?payData.coupon_price/100:((minusTotal+yunfei)-afterdec) / 100}}</text> 提货券
+		</view>
+		<view wx:if="{{payData.pay_way != ''}}" style="padding:15rpx;text-align:right">
+			使用提货券抵扣 <text style="color:#F00">-{{payData.coupon_price/100}}</text> 提货券
+		</view>
 	  </view>
-	  <view wx:if="{{payData.pay_way != ''}}" style="padding:15rpx;text-align:right">
-	  	使用提货券抵扣 <text style="color:#F00">-{{payData.coupon_price}}</text> 提货券
+	  
+	  
+	  <view wx:if="{{payData.paied_cash>0 || pay_cash>0}}">
+		  <view wx:if="{{payData.pay_way == ''}}" style="padding:15rpx;text-align:right">
+			使用佣金抵扣 <text style="color:#F00">-{{payData.paied_cash>0?payData.paied_cash/100:pay_cash / 100}}</text> 佣金
+		  </view>
+		  <view wx:if="{{payData.pay_way != ''}}" style="padding:15rpx;text-align:right">
+			使用佣金抵扣 <text style="color:#F00">-{{payData.paied_cash/100}}</text> 佣金
+		  </view>
 	  </view>
 	  
+	  
     </view>
 	
 	<view class="remark">
@@ -295,9 +329,9 @@
         	<text class="red">{{(minusTotal+yunfei) / 100}}积分</text>
         </view>
         <view wx:else style="display: inline;">
-        	<currency wx:if="{{useBalance}}" symbol="¥" value="{{afterdec - payData.dis_amount}}" class="red"></currency>
+        	<currency wx:if="{{useBalance}}" symbol="¥" value="{{afterdec - payData.dis_amount - pay_cash}}" class="red"></currency>
 	        <!-- <currency wx:else symbol="¥" value="{{payData.pay_way == '' ? total+yunfei : payData.paied_price}}" class="red"></currency> -->
-	        <currency wx:else symbol="¥" value="{{payData.pay_way == '' ? minusTotal+yunfei : minusTotal+yunfei-payData.coupon_price}}" class="red"></currency>
+	        <currency wx:else symbol="¥" value="{{payData.pay_way == '' ? minusTotal+yunfei : minusTotal+yunfei-payData.coupon_price-payData.paied_cash}}" class="red"></currency>
 	        
 	        <text class="red" wx:if="{{curPayway === 'balance'}}">{{(minusTotal+yunfei) / 100}}<currency value="{{minusTotal}}" class="red"></currency>提货券</text>
 	        <text class="red" wx:if="{{curPayway === 'integral'}}">{{(minusTotal+yunfei) / 100}}提货券</text>

+ 3 - 3
pages/projects/project-detail/project-detail.wxml

@@ -48,7 +48,7 @@
       <view><image src="http://fohow.oss-cn-shenzhen.aliyuncs.com/neverse/otherskill.png" class="seckill-img" /></view>
     </view>
     
-    <h3 class="detail-width detail-title"><i wx:if="{{project.pv < project.price}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>{{project.name}}</h3>
+    <h3 class="detail-width detail-title"><i wx:if="{{!project.use_quan}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>{{project.name}}</h3>
     <button bindtap="sharetips" class="sharebtn" wx:if="{{readOnly != 1}}"><image src="../../../images/footer/pyq.png" /><text>分享到朋友圈</text></button>
     <!--<view class="detail-width">
       <text class="detail-normal detail-mr">价格</text>
@@ -245,7 +245,7 @@
         <image class="dialog-img" src="{{project.pics[0].img}}"></image>
         
         <view class="dialog-info" style="margin-top: 20rpx;">
-          <h6 style="font-size: 35rpx;font-weight: bold;color: #666;"><i wx:if="{{project.pv < project.price}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>{{project.name}}</h6>
+          <h6 style="font-size: 35rpx;font-weight: bold;color: #666;"><i wx:if="{{!project.use_quan}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>{{project.name}}</h6>
           <view class="dialog-word dialog-black" style="margin-top: 15rpx;color: #999;">库存{{project.left_count}}件   <text wx:if="{{project.have_size && (sname || cname)}}">(已选:{{cname}} {{sname}})</text></view>
           <view class="dialog-word dialog-red" style="font-size: 35rpx;margin-top: 25rpx;">
             <!-- {{project.price}}提货券 -->
@@ -315,7 +315,7 @@
       <view class="dialog-content">
         <image class="dialog-img" src="{{project.pics[0].img}}"></image>
         <view class="dialog-info" style="margin-top: 20rpx;">
-          <h6 style="font-size: 35rpx;font-weight: bold;color: #666;"><i wx:if="{{project.pv < project.price}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>{{project.name}}</h6>
+          <h6 style="font-size: 35rpx;font-weight: bold;color: #666;"><i wx:if="{{!project.use_quan}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>{{project.name}}</h6>
           <view class="dialog-word dialog-black" style="margin-top: 15rpx;color: #999;">库存{{project.left_count}}件   <text wx:if="{{project.have_size && (sname || cname)}}">(已选:{{cname}} {{sname}})</text></view>
           <view class="dialog-word dialog-red" style="font-size: 35rpx;margin-top: 25rpx;">
             <!-- {{project.price}}提货券 -->

+ 1 - 1
pages/projects/projects.wxml

@@ -38,7 +38,7 @@
       </view>
       <view class="project" wx:key="{{index}}" wx:for="{{projects}}"  data-val="{{item.id}}" bindtap="toProject">
         <view class="project-left">
-          <view class="project-title ellipsisLn"><i wx:if="{{item.pv < item.price}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>{{item.name}}</view>
+          <view class="project-title ellipsisLn"><i wx:if="{{!item.use_quan}}" style="display: inline-block;background: #F44336;color: #fff;padding: 0px 5px;font-size: 11px;line-height: 35rpx;margin-right: 10rpx;vertical-align: middle;">特惠</i>{{item.name}}</view>
           <view class="project-count">已售{{item.sold_count}}件</view>
           <view class="project-price" style="padding-top:25rpx">
             <image wx:if="{{item.seckill_state === 'seckill'}}" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/image/icon/miaosha.png" class="project-miaosha-img"/>

+ 23 - 1
pages/user/all/all.js

@@ -21,7 +21,8 @@ Page({
     show: 0,
 	checkhead:true,
 	wxlogincode:'',
-	bindTelfirst:0
+	bindTelfirst:0,
+	cashbalance:0
   },
   onLoad: function () {
 ////	console.log(options)
@@ -52,6 +53,7 @@ Page({
 	// that.checkLogin();
     this.info();
 	that.getBalanceInfo()
+	that.getCashBalanceInfo()
 	// that.getIntegralInfo()
     // if (this.data.bindTel) {
     //   this.getBalanceInfo()
@@ -97,6 +99,7 @@ Page({
 							})
 							that.info()
 							that.getBalanceInfo()
+							that.getCashBalanceInfo()
 							// that.getIntegralInfo()
 							
 							// if (that.data.checkData.merchant_id > 0) {
@@ -339,6 +342,7 @@ Page({
           //   bindTel: true
           // })
           that.getBalanceInfo()
+		  that.getCashBalanceInfo()
           // that.getIntegralInfo()
           that.info()
         }
@@ -395,6 +399,19 @@ Page({
     }
     _request.$get(url, params, success)
   },
+  getCashBalanceInfo () {
+    var that = this
+    var url = 'v1/user/cash/balance/info'
+    var params = {
+    }
+    var success = function (res) {
+      var result = res.data.total
+      that.setData({
+        cashbalance: result
+      })
+    }
+    _request.$get(url, params, success)
+  },
   getSilverInfo () {
     var that = this
     var url = 'v1/user/cent/info'
@@ -500,6 +517,11 @@ Page({
       url: '/packageUser/pages/user/radish/radish'
     })
   },
+  toCash () {
+    wx.navigateTo({
+      url: '/packageUser/pages/user/cash/cash'
+    })
+  },
   toIntegral () {
     wx.navigateTo({
       url: '/packageUser/pages/user/integral/integral'

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

@@ -41,6 +41,11 @@
         <image class="user-points__right" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>
         <view class="user-points__num">{{integral / 100}}</view>
       </view> -->
+	  <view class="user-points" bindtap="toCash">
+		  <view class="user-points__title">我的收入</view>
+		  <image class="user-points__right" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>
+		  <view class="user-points__num">{{cashbalance / 100}}</view>
+		</view>
       <view class="user-points" bindtap="toRadish">
         <view class="user-points__title">我的提货券</view>
         <image class="user-points__right" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>

+ 6 - 0
project.private.config.json

@@ -0,0 +1,6 @@
+{
+  "setting": {
+    "urlCheck": false
+  },
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
+}