Pārlūkot izejas kodu

购物车调整&团长申请&专区

junyuanz 5 gadi atpakaļ
vecāks
revīzija
d8e9805547

+ 2 - 0
app.json

@@ -4,6 +4,7 @@
     "pages/home/home",
     "pages/user/all/all",
     "pages/cart/cart",
+    "pages/areacart/areacart",
     "pages/projects/projects",
     "pages/helpfarm/helpfarm",
     "pages/helpfarm/helpfarm-detail/helpfarm-detail",
@@ -35,6 +36,7 @@
         "pages/user/bindsuccess/bindsuccess",
         "pages/user/address/address",
         "pages/user/newAddress/newAddress",
+        "pages/user/applyLeader/applyLeader",
         "pages/user/radish/radish",
         "pages/user/radishDetail/radishDetail",
         "pages/user/orders/orders",

+ 173 - 0
packageUser/pages/user/applyLeader/applyLeader.js

@@ -0,0 +1,173 @@
+var _request = require('../../../../utils/request.js')
+var validator = require('../../../../utils/validator.js')
+var _handle = require('../../../../utils/handle.js')
+Page({
+  data: {
+    address: '请选择',
+    region: ['北京市', '北京市', '东城区'],
+    name: '',
+    tel: 0,
+    more: '',
+    countdown: 0,
+    yzm:'',
+    remark:''
+  },
+  onLoad: function (options) {
+  },
+  getTel (val) {
+    console.log(val)
+    if (val.detail.encryptedData) {
+      this.bindWxTel(val.detail)
+    }
+  },
+  bindWxTel (res) {
+    var str = JSON.stringify({
+      encryptedData: res.encryptedData,
+      iv: res.iv
+    })
+    var that = this
+    var url = 'v1/wxuser/one_click/binding/phonumer'
+    var params = {
+      userinfo: str
+    }
+    var success = function (res) {
+    	console.log(res);
+    }
+    _request.$post(url, params, success)
+  },
+  getYzm (e) {
+    _handle.setFormId(e)
+    if (validator.telphone(this.data.tel)) {
+      this.requireYzm()
+    } else {
+      wx.showToast({
+        title: '手机号码格式不正确',
+        icon: 'none',
+        duration: 2000
+      })
+    }
+  },
+  startCountdown: function () {
+    var smsRequestTime = wx.getStorageSync('sms_request_time')
+    if (smsRequestTime) {
+      var count = parseInt((60000 - (new Date() - smsRequestTime)) / 1000)
+      this.setData({
+        countdown: count
+      })
+      if (this.data.countdown > 0) {
+        var timer = setInterval(() => {
+          var countdown = this.data.countdown - 1
+          this.setData({
+            countdown: countdown
+          })
+          if (this.data.countdown <= 0) {
+            clearInterval(timer)
+          }
+        }, 1000)
+        // clearInterval(this.interval)
+      }
+    } else {
+    }
+  },
+  requireYzm () {
+    var that = this
+    var url = 'v1/code/send'
+    console.log(typeof(this.data.tel))
+    var params = {
+      tel: this.data.tel,
+      valid_type: 'shop_application'
+    }
+    var success = function (res) {
+      wx.setStorageSync('sms_request_time', Date.now())
+      that.startCountdown()
+    }
+    _request.$post(url, params, success)
+  },
+  bindPhone (e) {
+    this.setData({
+      tel: e.detail.value
+    })
+  },
+  bindYzm (e) {
+    this.setData({
+      yzm: e.detail.value
+    })
+  },
+  bindName: function (e) {
+    this.setData({
+      name: e.detail.value
+    })
+  },
+  bindMore: function (e) {
+    this.setData({
+      more: e.detail.value
+    })
+  },
+  bindRemark: function (e) {
+    this.setData({
+      remark: e.detail.value
+    })
+  },
+  validate () {
+    var msg
+    if (!validator.required(this.data.name)) {
+      msg = '姓名不能为空'
+    } else if (!validator.required(this.data.tel)) {
+      msg = '联系电话不能为空'
+    } else if (!validator.telphone(this.data.tel)) {
+      msg = '手机号码格式不正确'
+    } else if (this.data.address === '请选择') {
+      msg = '请选择所在地区'
+    } else if (!validator.required(this.data.more)) {
+      msg = '详细地址不能为空'
+    }
+    return { isOk: !msg, msg }
+  },
+  save: function (e) {
+    _handle.setFormId(e)
+    var { isOk, msg } = this.validate()
+    if (isOk) {
+      this.shopApplication()
+    } else {
+      wx.showToast({
+        title: msg,
+        icon: 'none',
+        duration: 2000
+      })
+    }
+  },
+  shopApplication () {
+    var that = this
+    var url = 'v1/user/shop_application'
+    var params = {
+      name: this.data.name,
+      mobile: this.data.tel,
+      code:this.data.yzm,
+      province: this.data.region[0],
+      city: this.data.region[1],
+      district: this.data.region[2],
+      address: this.data.more,
+      remark: this.data.remark
+    }
+    var success = function (res) {
+      wx.showToast({
+        title: '申请成功@',
+        icon: 'none',
+        duration: 2000
+      })
+    }
+    _request.$put(url, params, success)
+  },
+  bindRegionChange: function (e) {
+    console.log(e)
+    this.setData({
+      region: e.detail.value,
+      address: e.detail.value[0] + e.detail.value[1] + e.detail.value[2]
+    })
+  },
+  onShareAppMessage: function (val) {
+    return _request.share({
+      sc: 'xcx_user_newaddress'
+    })
+  }
+})

+ 4 - 0
packageUser/pages/user/applyLeader/applyLeader.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "申请团长",
+  "backgroundColor": "#f3f3f3"
+}

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

@@ -0,0 +1,51 @@
+<view class="bg">
+  <view class="newAddress-top"></view>
+  <view class="newAddress-line">
+    <view class="newAddress-title">姓 名</view>
+    <input maxlength="11" class="nameText" placeholder="你的姓名" placeholder-class="text-placeholder" bindinput="bindName" />
+    <view class="clean"></view>
+  </view>
+  <view class="newAddress-line">
+  <view class="newAddress-title">手 机</view>
+	   <input type="number" maxlength="11" class="nameText" placeholder="你的手机号码" placeholder-class="text-placeholder" bindinput="bindPhone" />
+	 <!--<button class="bind-wx" open-type="getPhoneNumber" bindgetphonenumber="getTel">使用微信手机号</button>-->
+	</view>
+	<view class="newAddress-line">
+	  <view class="yzm-textBlock">
+	  <view class="newAddress-title">验证码</view>
+	    <input type="number" maxlength="11" class="nameText" placeholder="请输入短信验证码" placeholder-class="text-placeholder" bindinput="bindYzm" />
+	  </view>
+	  <form wx:if="{{ countdown <= 0 }}"  bindsubmit="getYzm" report-submit="{{true}}" class="getyzm">
+	    <button formType="submit" class="getyzm-btn">
+	      获取验证码
+	    </button>
+	  </form>
+	  <view class="nogetyzm" wx:if="{{ countdown > 0 }}" >重新发送({{countdown}})</view>
+	  <view class="clean"></view>
+	</view>
+    
+  <picker mode="region" bindchange="bindRegionChange" value="{{region}}" >
+    <view class="newAddress-line">
+      <view class="newAddress-title">所在地区</view>
+      <view class="newAddress-picker ">
+        <image class="newAddress-picker__icon" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>
+        <view class="ellipsis newAddress-picker__text">{{address}}</view>
+      </view>
+      <view class="clean"></view>
+    </view>
+  </picker>
+  <view class="newAddress-more">
+    <view class="newAddress-more__title">详细地址</view>
+    <textarea maxlength="120" class="textarea"  auto-height placeholder="如道路、门牌号等"  placeholder-class="text-placeholder" bindinput="bindMore" />
+  </view>
+  <view class="newAddress-more">
+    <view class="newAddress-more__title">备注(选填)</view>
+    <textarea maxlength="120" class="textarea"  auto-height placeholder="可留言给客服哦"  placeholder-class="text-placeholder" bindinput="bindRemark" />
+  </view>
+  <form bindsubmit="save" report-submit="{{true}}" class="newAddress-form">
+    <button formType="submit" class="newAddress-btn">
+      保存
+    </button>
+    <p class="submittips">说明:申请后,我们会尽快与您做进一步沟通,请耐心等待。</p>
+  </form>
+</view>

+ 179 - 0
packageUser/pages/user/applyLeader/applyLeader.wxss

@@ -0,0 +1,179 @@
+.bg {
+  position: relative;
+  width: 100%;
+  min-height: 100%;
+  background-color: #f3f3f3;
+}
+.newAddress-top {
+  height: 20rpx;
+}
+.newAddress-line {
+  height: 90rpx;
+  line-height: 90rpx;
+  background-color: #fff;
+  font-size: 28rpx;
+  border-bottom: 1px solid #eeeeee;
+  overflow:hidden;
+}
+.bind-wx{
+font-size: 20rpx;
+background: #eab86a;
+color: #FFF;
+padding: 0;
+width: inhert;
+margin: 11px 5px;
+border-radius:15px;
+}
+.getyzm-btn{
+font-size: 24rpx;
+border: 1px solid #eab86a;
+color: #eab86a;
+margin: 5px;
+
+}
+.newAddress-title {
+  float: left;
+  margin-left: 20rpx;
+  color: #4c4c4c;
+  width:80px;
+}
+.text-placeholder {
+  color: #bbbbbb;
+}
+.nameText {
+  width: 330rpx;
+  height: 90rpx;
+  line-height: 90rpx;
+  color: #4c4c4c;
+  float: left;
+  text-align: left;
+  padding-right: 20rpx;
+}
+.newAddress-picker {
+  float: right;
+  text-align: right;
+  color: #bbbbbb;
+}
+.newAddress-picker__icon {
+  float: right;
+  margin-top: 33rpx;
+  margin-right: 20rpx;
+  margin-left: 12rpx;
+  width: 13rpx;
+  height: 24rpx;
+}
+.newAddress-picker__text {
+  float: right;
+  width: 500rpx;
+}
+.newAddress-more {
+  background-color: #fff;
+}
+.newAddress-more {
+  padding: 30rpx 20rpx;
+}
+.newAddress-more__title {
+  font-size: 28rpx;
+  color: #4c4c4c;
+}
+.newAddress-form {
+
+}
+.submittips{
+font-size: 24rpx;
+text-align: center;
+width: 100%;
+display: block;
+padding: 5px 0;
+padding-bottom: 30px;
+color: #666;
+}
+.newAddress-btn {
+width: 90%;
+height: 100%;
+background-color: #eab86a;
+color: #fff;
+line-height: 90rpx;
+text-align: center;
+font-size: 28rpx;
+margin: 35px 5% 0 5%;
+border-radius: 45px;
+
+}
+.textarea {
+  padding-top: 20rpx;
+  display: block;
+  width: 710rpx;
+  min-height: 200rpx;
+  line-height: 40rpx;
+  font-size: 28rpx;
+  color: #4c4c4c
+}
+.distpicker {
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    z-index: 999;
+    width: 100%;
+    height: 560rpx;
+    display: flex;
+    justify-content: center;
+    flex-wrap: wrap;
+    background-color: #fff;
+    font-size:28rpx;
+    color:#666;
+}
+.distpicker-btn {
+    display: flex;
+    justify-content: space-between;
+    box-sizing: border-box;
+    width: 100%;
+    padding: 0 40rpx;
+    height: 80rpx;
+    line-height: 80rpx;
+    background-color: #fafafa;
+    color: #eab86a;
+}
+.distpicker-content {
+    box-sizing: border-box;
+    width: 100%;
+    height: 560rpx;
+    background-color: #fff;
+    text-align: center;
+}
+.mask {
+    position: fixed;
+    left: 0;
+    top: 0;
+    z-index: 998;
+    width: 100%;
+    height: 100%;
+    background-color: rgba(0, 0, 0, .4);
+}
+.hidden {
+  display: none;
+}
+.area-item {
+  line-height: 80rpx;
+}
+.newAddress-tip {
+  height: 245rpx;
+  margin-top: 30rpx;
+  background: #ffffff;
+  padding-top: 40rpx;
+  padding-left: 30rpx;
+  padding-right: 20rpx;
+}
+.tip-title {
+  font-size: 33rpx;
+  color: #4e4e4e;
+  padding-bottom: 20rpx;
+}
+.tip-in {
+  font-size: 28rpx;
+  color: #4e4e4e;
+  line-height: 45rpx;
+}
+.tip-color {
+  color: #fe6565;
+}

+ 387 - 0
pages/areacart/areacart.js

@@ -0,0 +1,387 @@
+var _request = require('../../utils/request.js')
+var _handle = require('../../utils/handle.js')
+var validator = require('../../utils/validator.js')
+Page({
+  data: {
+    orderId: 0,
+    count:1,
+    cartList:{},
+    cartCount:0,
+    cartTotal:0,
+    checkeditems:'',
+    checkeditemsnum:'',
+    checkedtotal:0,
+    selectedall:false,
+    submitlock:false,
+    x:0,
+    currentX: 0
+  },
+  handleMovableChange: function(e) {
+    // this.data.currentX = e.detail.x;
+    this.data.currentX = e.detail.x;
+    
+  },
+ 
+  handleTouchend: function(e) {
+    this.isMove = true;
+    let index = e.currentTarget.id;
+    let clist = this.data.cartList;
+//  if (this.data.currentX < -46) {
+////    this.data.x = -92;
+//    clist[index]['movex'] = -100;
+//    this.setData({
+//      cartList: clist
+//    });
+//  } else {
+      clist[index]['movex'] = 0;
+      this.setData({
+        cartList: clist
+      });
+//  }
+  },
+  onLoad: function (options) {
+  	this.getCartList();
+  },
+  onShow: function () {
+  	this.getCartList();
+  	this.setData({submitlock: false});
+  	this.setData({selectedall: false});
+  	this.getCartListAndSelected();
+  },
+  getCartList:function(){
+  	console.log('getCartList')
+  	var that = this
+    var url = 'v1/products?ptype=shop_sale&&page=1&&per_page=3'
+    var params = {}
+    var success = function (res) {
+      console.log(res)
+    	if(res.data.list){
+    		for(let i in res.data.list){
+    			res.data.list[i]['movex'] = 0;
+    			res.data.list[i]['IsBuy'] = false;
+    			res.data.list[i]['count'] = 1;
+    		}
+    		that.setData({
+	        cartList: res.data.list,
+	        cartCount: res.data.count,
+	        cartTotal: res.data.total
+	      })
+    	}else{
+    		wx.showToast({
+	        title: '请先授权登录~',
+	        icon: 'none',
+	        duration: 2000
+	      })
+    	}
+    }
+    _request.$get(url, params, success)
+  },
+  getCartListAndSelected:function(){
+  	console.log('getCartList')
+  	var that = this
+    var url = 'v1/products?ptype=shop_sale&&page=1&&per_page=3'
+    var params = {}
+    var success = function (res) {
+      console.log(res)
+      for(let i in res.data.list){
+      	res.data.list[i]['movex'] = 0;
+    			res.data.list[i]['IsBuy'] = false;
+    			res.data.list[i]['count'] = 1;
+      }
+    	if(res.data.list){
+    		that.setData({
+	        cartList: res.data.list,
+	        cartCount: res.data.count,
+	        cartTotal: res.data.total
+	      })
+    		that.allSelect();
+    	}else{
+    		wx.showToast({
+	        title: '请先授权登录~',
+	        icon: 'none',
+	        duration: 2000
+	      })
+    	}
+    }
+    _request.$get(url, params, success)
+  },
+  add: function (e) {
+  	console.log('tapadd',e)
+  	var itemid = e.currentTarget.dataset.id;
+  	var itemcount = e.currentTarget.dataset.count;
+  	console.log('itemcount',itemcount)
+    if (itemcount) {
+    	var index = e.currentTarget.dataset.index;
+      var count = itemcount + 1;
+      this.setData({
+	      ['cartList[' + index + '].count']:count 
+	    })
+      this.checkSelected();
+//    this.changeServercount(count,itemid);
+    }
+  },
+  mius: function (e) {
+  	console.log('tapmius',e)
+  	var that = this;
+  	var itemid = e.currentTarget.dataset.id;
+  	var itemcount = e.currentTarget.dataset.count;
+    if (itemcount > 1) {
+      var count = itemcount - 1;
+      var index = e.currentTarget.dataset.index;
+      this.setData({
+	      ['cartList[' + index + '].count']:count 
+	    })
+      this.checkSelected();
+//    this.changeServercount(count,itemid);
+    }/*else{
+    	wx.showModal({
+		  title: '提示',
+		  content: '需要删除改商品吗?',
+		  success: function (sm) {
+		    if (sm.confirm) {
+		        var url = "/v1/cart/mult_delele";
+				    var params = {
+				    	ids:itemid
+				    }
+				    var success = function (res) {
+				      console.log(res)
+				      if(res.data.result){
+				      	
+				      }
+				      that.getCartList();
+				    }
+				    _request.$post(url, params, success);
+		      } else if (sm.cancel) {
+		        console.log('用户点击取消')
+		      }
+		    }
+		  })
+    }*/
+  },
+  delitem:function(e){
+  	var that = this;
+  	var itemid = e.currentTarget.dataset.id;
+  	console.log('itemid',itemid);
+//	wx.showModal({
+//		  title: '提示',
+//		  content: '需要删除改商品吗?',
+//		  success: function (sm) {
+//		    if (sm.confirm) {
+//		        var url = "/v1/cart/mult_delele";
+//				    var params = {
+//				    	ids:itemid
+//				    }
+//				    var success = function (res) {
+//				      console.log(res)
+//				      if(res.data.result){
+//				      	
+//				      }
+//				      that.getCartList();
+//				    }
+//				    _request.$post(url, params, success);
+//		      } else if (sm.cancel) {
+//		        console.log('用户点击取消')
+//		      }
+//		    }
+//		  })
+  },
+  changeCount: function (val) {
+    var count = val.detail.value
+    var itemid = val.target.dataset.id;
+    var index = val.target.dataset.index;
+    if (count <= 0) {
+    	this.setData({
+	      ['cartList[' + index + '].count']:1 
+	    })
+    	this.checkSelected();
+//    this.changeServercount(1,itemid);
+    } /*else if (count > this.data.project.left_count) {
+      this.setData({
+        count: this.data.project.left_count
+      })
+      this.changeCountService(this.data.project.left_count,itemid)
+    }*/ else {
+    	this.setData({
+	      ['cartList[' + index + '].count']:count 
+	    })
+    	this.checkSelected();
+//    this.changeServercount(count,itemid);
+    }
+  },
+  changeServercount:function(val,itemid){
+  	console.log('changeCountService')
+  	var that = this
+    var url = "/v1/cart/change_nums/" + itemid + "/" + val
+    var params = {}
+    var success = function (res) {
+      console.log(res)
+      if(res.result){
+      	//修改成功
+      }
+    }
+    _request.$post(url, params, success);
+    this.getCartList();
+  },
+  itemselected:function(e){
+  	console.log(this)
+  	var nowitems = this.data.selectedItems;
+  	let index = e.currentTarget.dataset.index;
+  	var bool = this.data.cartList[index].IsBuy;
+  	console.log('bool',bool)
+    this.setData({
+      ['cartList[' + index + '].IsBuy']: !bool
+    })
+    
+  	this.checkSelected();
+  },
+  allSelect:function(){
+  	if(this.data.selectedall){
+  		for(var i in this.data.cartList){
+  			this.setData({
+		      ['cartList[' + i + '].IsBuy']: false
+		    })
+  		}
+  		this.setData({
+	      selectedall: false
+	    })
+  	}else{
+  		for(var i in this.data.cartList){
+  			this.setData({
+		      ['cartList[' + i + '].IsBuy']: true
+		    })
+  		}
+  		this.setData({
+	      selectedall: true
+	    })
+  	}
+  	this.checkSelected();
+  },
+  checkSelected:function(){
+  	var cartList = this.data.cartList;
+  	var checkitem = '';
+  	var checkitemnum = '';
+  	var checktotal = 0;
+  	var checkcount = 0;
+//	console.log('cartList',cartList)
+  	for(var i in cartList){
+  		if(cartList[i].IsBuy){
+  			checkitem = checkitem + cartList[i].id+',';
+  			checkitemnum = checkitemnum + cartList[i].count+',';
+  			checktotal = checktotal + (parseFloat(cartList[i].price) * parseInt(cartList[i].count));
+  			checkcount = checkcount + parseInt(cartList[i].count);
+  		}
+  	}
+  	checkitem = checkitem.substr(0,checkitem.length - 1);
+  	checkitemnum = checkitemnum.substr(0,checkitemnum.length - 1);
+  	
+  	
+  	this.setData({
+		  checkeditems:checkitem,
+		  checkeditemsnum:checkitemnum,
+		  cartCount: checkcount,
+    	cartTotal: checktotal
+		})
+//		this.mulChangeState();
+  },
+  mulChangeState:function(){
+  	var that = this;
+  	var itemid = this.data.checkeditems;
+  	var itemnum = this.data.checkeditemsnum;
+  	var url = "v1/cart/mult_change_state";
+    var params = {
+    	ids:itemid,
+    	nums:itemnum
+    }
+    var success = function (res) {
+      console.log('mulChangeState',res)
+      if(res.data.result){
+      	that.getCartList();
+      }
+    }
+    _request.$post(url, params, success);
+    
+  },
+  mulChangeStateToPay:function(){
+  	var that = this;
+  	var lock = this.data.submitlock;
+  	if(!lock){
+  		that.setData({submitlock: true})
+  		var itemid = this.data.checkeditems;
+	  	var itemnum = this.data.checkeditemsnum;
+	  	var url = "v1/shop/order_mul";
+	    var params = {
+	    	ids:itemid,
+	    	nums:itemnum
+	    }
+	    var success = function (res) {
+	    	wx.showToast({
+			    title: '正在跳转到结算页,请稍后~',
+			    icon: 'none',
+			    duration: 2000
+			  })
+	      console.log('mulChangeState',res)
+	      if (res.data.order_id) {
+	        wx.navigateTo({
+	          url: '../pay/pay?orderId=' + res.data.order_id
+	        })
+	      }
+	    }
+	    var err = function(err){
+	    	console.log(err)
+	    	that.setData({submitlock: false})
+	    }
+	    _request.$post(url, params, success, err);
+  	}
+  	
+    
+  },
+  toPay:function(){
+  	
+  	var that = this;
+		var url = "/v1/cart/order_mul";
+    var params = {}
+    var success = function (res) {
+      console.log(res)
+  		if (res.data.order_id) {
+        wx.navigateTo({
+          url: '../pay/pay?orderId=' + res.data.order_id
+        })
+      }
+    }
+    _request.$get(url, params, success);
+  },
+  delSelected:function(){
+  	var that = this;
+  	var itemid = this.data.checkeditems;
+  	if(itemid== ''){
+  		wx.showToast({
+        title: '没有选中任何商品~',
+        icon: 'none',
+        duration: 2000
+      })
+  	}else{
+  		wx.showModal({
+		  title: '提示',
+		  content: '确定要删除选中的商品吗?',
+		  success: function (sm) {
+		    if (sm.confirm) {
+		        var url = "/v1/cart/mult_delele";
+				    var params = {
+				    	ids:itemid
+				    }
+				    var success = function (res) {
+				      console.log(res)
+				      if(res.data.result){
+				      	
+				      }
+				      that.getCartList();
+				    }
+				    _request.$post(url, params, success);
+		      } else if (sm.cancel) {
+		        console.log('用户点击取消')
+		      }
+		    }
+		  })
+  	}
+  }
+})

+ 7 - 0
pages/areacart/areacart.json

@@ -0,0 +1,7 @@
+{
+  "navigationBarTitleText": "专区商品",
+  "usingComponents": {
+    "currency": "../../component/currency/currency"
+  },
+  "backgroundColor": "#f3f3f3"
+}

+ 162 - 0
pages/areacart/areacart.wxml

@@ -0,0 +1,162 @@
+<view class="app app-bg">
+	<view class="pay-payway bgwhile">
+	  <view class="pay-payway-item">
+	  	<!--<view class="fl pay-balance-cash {{selectedall ? 'active' : ''}}" bindtap="allSelect">
+	      <text class="pay-circle" bindtap="selectClick" data-payway="weixinpay">
+	        <text class="pay-select" wx:if="{{curPayway === 'quanxuan'}}"></text>
+	      </text>
+	      <text style="margin-left:5px">全选</text>
+	    </view>-->
+	    已选中 <text style="color:red">{{cartCount}}</text> 件商品
+	    
+	    <view class="pay-payway-balance fr">
+	    	<text bindtap="delSelected" data-payway="weixinpay">删除选中</text>
+	    </view>
+	    
+	    <view class="clean"></view>
+	  </view>
+	</view>
+	
+	<view style="height:55px"></view>
+	<!--购物车列表-->
+	<view class="cartlistbox">
+	<!--
+		<view class="cartlist" wx:for="{{cartList}}" wx:key="id">
+		  <view class="cartlist_item">
+		   	  <view class="cartlist_select {{item.IsBuy ? 'active' : ''}}" bindtap="itemselected" data-count="{{item.count}}" data-id='{{item.id}}' data-price="{{item.price}}" data-index="{{index}}">
+		   	  	<text class="pay-circle"></text>
+		   	  </view>
+		      <view class="cartlist_img">
+		        <image src="{{item.cover}}" />
+		      </view>
+		      <view class="cartlist_info">
+		        <view class="cartlist_title">{{item.name}} <span wx:if="{{item.color_name || item.size_name}}">|</span> {{item.color_name}} {{item.size_name}}</view>
+		        <view class="cartlist_type">---</view>
+		        <currency class="cartlist_price" symbol="¥" value="{{item.price}}" />
+		        <view class="cartlist_num">
+		        	<button bindtap="mius" data-id='{{item.id}}' data-count="{{item.count}}" data-index="{{index}}">-</button>
+		        	<input type="number" value="{{item.count}}" bindinput="changeCount" data-id='{{item.id}}' data-index="{{index}}"/>
+		        	<button bindtap="add" data-id='{{item.id}}' data-count="{{item.count}}" data-index="{{index}}">+</button>
+		        </view>
+		      </view>
+		      <view class='clear'></view>
+		  </view>
+		</view>
+	-->	
+		<view class="cartlist" wx:for="{{cartList}}" wx:key="id">
+			<view class="main_item">
+		      <movable-area>
+		        <movable-view damping="100" out-of-bounds="true" direction="horizontal" x="{{item.movex}}" id="{{index}}" animation="false" bindchange="handleMovableChange" capture-bind:touchstart="handleTouchestart" capture-bind:touchend="handleTouchend">
+		          <view class="main_item_content ">
+		          		  <view class="cartlist_item">
+						   	  <view class="cartlist_select {{item.IsBuy ? 'active' : ''}}" bindtap="itemselected" data-count="{{item.count}}" data-id='{{item.id}}' data-price="{{item.price}}" data-index="{{index}}">
+						   	  	<text class="pay-circle"></text>
+						   	  </view>
+						      <view class="cartlist_img">
+						        <image src="{{item.cover}}" />
+						      </view>
+						      <view class="cartlist_info">
+						        <view class="cartlist_title">{{item.name}} <span wx:if="{{item.color_name || item.size_name}}">|</span> {{item.color_name}} {{item.size_name}}</view>
+						        <view class="cartlist_type">---</view>
+						        <currency class="cartlist_price" symbol="¥" value="{{item.price}}" />
+						        <view class="cartlist_num">
+						        	<button bindtap="mius" data-id='{{item.id}}' data-count="{{item.count}}" data-index="{{index}}" class="mius">-</button>
+						        	<input type="number" value="{{item.count}}" bindinput="changeCount" data-id='{{item.id}}' data-index="{{index}}"/>
+						        	<button bindtap="add" data-id='{{item.id}}' data-count="{{item.count}}" data-index="{{index}}" class="add">+</button>
+						        </view>
+						      </view>
+						      <view class='clear'></view>
+						  </view>
+		          </view>
+		        </movable-view>
+		      </movable-area>
+		      <view class="delete_btn" data-productIndex="{{index}}" data-id='{{item.id}}' bindtap="delitem"></view>
+		    </view>
+	    </view>
+	</view>
+
+	<view style="height:50px"></view>
+  <view class="pay-footer">
+    <view class="pay-footer-bar"> 
+      <view class="pay-footer-item">
+        <!-- <currency wx:if="{{useRadishSelect && payData.total_price - balanceInfo.total > 0}}" symbol="¥" value="{{payData.total_price - balanceInfo.total}}" class="red"></currency>
+        <currency wx:if="{{!useRadishSelect}}" symbol="¥" value="{{payData.total_price}}" class="red"></currency>
+        <currency wx:if="{{useRadishSelect && payData.total_price - balanceInfo.total <= 0}}" symbol="¥" value="0" class="red"></currency> -->
+        
+        <view class="fl pay-balance-cash {{selectedall ? 'active' : ''}}" bindtap="allSelect">
+	      <text class="pay-circle" bindtap="selectClick" data-payway="weixinpay">
+	        <text class="pay-select" wx:if="{{curPayway === 'quanxuan'}}"></text>
+	      </text>
+	      <text style="margin-left:5px">全选</text>
+	    </view>
+	    
+        <!--<currency symbol="¥" value="{{cartTotal}}" class="red"></currency>-->
+        
+        <!-- 
+        <text class="red" wx:if="{{curPayway === 'balance'}}">{{project.robo_balance_price * payData.count}}代金券</text>
+        <text class="red" wx:if="{{curPayway === 'integral'}}">{{project.mall_balance_price * payData.count}}代金券</text> -->
+        <view style="float: right;padding-right: 10px;">
+      	<!--共 <text class="red">{{cartCount}}</text> 件商品-->
+      	
+      	应付:<currency symbol="¥" value="{{cartTotal}}" class="red"></currency>
+      	</view>
+      </view>
+      
+      <form bindsubmit="mulChangeStateToPay" report-submit="{{true}}" class="pay-footer-item2">
+      <button formType="submit" class="pay-footer-botton">
+        去结算
+      </button>
+      </form>
+    </view>
+  </view>
+</view>
+
+<view wx:if="{{pwdDialog}}">
+  <view class="pay-panel">
+    <view class="pay-panel-title">立即支付</view>
+    <view>
+      <input type="password" bindinput="inputPwd" placeholder="请输入交易密码" class="pay-panel-input" />
+    </view>
+    <view class="pay-panel-footer">
+      <text class="pay-panel-cancel" bindtap="cancelDialog">取消</text>
+      <text class="pay-panel-confirm" bindtap="pay">确定</text>
+    </view>
+  </view>
+  <view class="pay-dialog"></view>
+</view>
+
+<!-- 弹框 -->
+<view class="modal-mask" bindtap="hideModal" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
+<view class="modal-dialog" wx:if="{{showModal}}">
+  <view class="modal-content1">
+    <view>
+      <image wx:if="{{curPayway === 'balance'}}" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/icon/luobo.png" style="width:120rpx;height:120rpx;margin:0 auto;display:block;"></image>
+      <image wx:if="{{curPayway === 'integral'}}" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/image/pay/d5cpay.jpg" style="width:120rpx;height:120rpx;margin:0 auto;display:block;border-radius: 50%;"></image>
+    </view>
+    <view class="modal-span">还差<text class="modal-count">{{luoboCount}}</text><text wx:if="{{curPayway === 'balance'}}">代金券</text><text wx:if="{{curPayway === 'integral'}}">代金券</text></view>
+    <view class="modal-span1">您可通过如下操作<text wx:if="{{curPayway === 'balance'}}">完成兑换</text></view>
+  </view>
+  <view class="modal-footer1">
+    <view class="btn-confirm" bindtap="onConfirm" data-status="confirm" wx:if="{{curPayway === 'balance'}}">前往代金券兑换代金券</view>
+    <view class="btn-confirm" bindtap="onConfirm1" data-status="confirm" wx:if="{{curPayway === 'balance'}}">购买代金券( {{countMoney}} )元</view>
+    <view class="btn-confirm" bindtap="onConfirm2" data-status="confirm" wx:if="{{curPayway === 'integral'}}">获取更多第五创代金券</view>
+    <view class="btn-cancel" bindtap="onCancel" data-status="cancel">取消</view>
+  </view>
+</view>
+
+<!--
+<view class="modal-mask" bindtap="hideModal" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
+<view class="modal-dialog" wx:if="{{showModal}}">
+  <view class="modal-title">代金券不足</view>
+  <view class="modal-content">
+    <view>
+      <image src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/icon/luobo.png" style="width:215rpx;height:215rpx;margin:0 auto;display:block;"></image>
+    </view>
+    <view class="modal-span">立即前往汇兑页获取代金券</view>
+  </view>
+  <view class="modal-footer">
+    <view class="btn-cancel" bindtap="onCancel" data-status="cancel">取消</view>
+    <view class="btn-confirm" bindtap="onConfirm" data-status="confirm">前往兑换</view>
+  </view>
+</view>
+-->

+ 560 - 0
pages/areacart/areacart.wxss

@@ -0,0 +1,560 @@
+.pay-address {
+  position: relative;
+  width: 100%;
+  background-color: #fff;
+  padding: 30rpx 20rpx 15rpx;
+  box-sizing: border-box;
+}
+.pay-arrowR {
+  position: absolute;
+  top: 50rpx;
+  right: 10rpx;
+  width: 35rpx;
+  height: 35rpx;
+  display: block;
+}
+.pay-font {
+  width: 660rpx;
+  line-height: 30rpx;
+  font-size: 28rpx;
+  color: #4c4c4c;
+  margin-bottom: 24rpx;
+}
+.pay-border {
+  width: 100%;
+  height: 2rpx;
+  display: block;
+  margin-bottom: 15rpx;
+}
+.pay-project {
+  width: 100%;
+  background-color: #fff;
+  padding: 20rpx;
+  box-sizing: border-box;
+}
+.pay-project-content {
+  position: relative;
+  width: 100%;
+  background-color: #fcfcfc;
+}
+.pay-project-img {
+  display: block;
+  width: 200rpx;
+  height: 200rpx;
+  float: left;
+}
+.pay-project-info {
+  float: left;
+  width: 480rpx;
+  font-size: 24rpx;
+  margin-left: 20rpx;
+  margin-top: 12rpx;
+}
+.pay-project-title {
+  /*display: block;*/
+  /*height: 60rpx;*/
+  -webkit-line-clamp: 2;
+}
+.pay-project-spec {
+  display: block;
+  color: #bbb;
+  line-height: 36rpx;
+  margin-top: 16rpx;
+}
+.pay-project-price {
+  display: block;
+  color: #eab86a;
+  margin-top: 25rpx;
+}
+.pay-project-price .pay-gray {
+  color: #bbb;
+}
+.pay-count {
+  margin-top: 40rpx;
+  margin-bottom: 20rpx;
+}
+.pay-count-word {
+  display: block;
+  height: 66rpx;
+  line-height: 66rpx;
+  float: left;
+  font-size: 28rpx;
+  color: #4c4c4c;
+}
+.pay-count-select {
+  float: right;
+  height: 66rpx;
+}
+.pay-count-select button {
+  width: 60rpx;
+  height: 66rpx;
+  color: #999;
+  font-size: 28rpx;
+  text-align: center;
+  padding: 0;
+  display: inline-block;
+}
+.pay-count-select button:first-child {
+  border-top-right-radius: 0;
+  border-bottom-right-radius: 0;
+}
+.pay-count-select button:last-child {
+  border-top-left-radius: 0;
+  border-bottom-left-radius: 0;
+}
+.pay-count-select button:after {
+  border-radius: 0;
+}
+.pay-count-select input {
+  width: 154rpx;
+  height: 66rpx;
+  background-color: #ddd;
+  color: #4c4c4c;
+  font-size: 28rpx;
+  text-align: center;
+  display: inline-block;
+}
+.pay-title {
+  display: block;
+  width: 100%;
+  height: 50rpx;
+  line-height: 50rpx;
+  font-size: 24rpx;
+  color: #bbb;
+  text-align: center;
+  border-bottom: 1rpx solid #ddd;
+}
+.pay-module {
+  width: 100%;
+  background-color: #fff;
+  margin-top: 20rpx;
+}
+.pay-integral {
+  margin-top: 30rpx;
+  margin-bottom: 30rpx;
+}
+.pay-integral-info {
+  width: 646rpx;
+  font-size: 28rpx;
+  color: #4c4c4c;
+  margin-left: 20rpx;
+}
+.pay-integral .block {
+  display: block;
+}
+.pay-integral .red {
+  color: #eab86a;
+}
+.pay-integral .gray {
+  color: #bbb;
+}
+.pay-checked {
+  margin-right: 20rpx;
+  margin-top: 30rpx;
+}
+.pay-mb {
+  margin-bottom: 18rpx;
+}
+.pay-icon {
+  width: 60rpx;
+  height: 60rpx;
+  vertical-align: middle;
+  display: inline-block;
+  margin-right: 20rpx;
+}
+.pay-payway {
+  width: 100%;
+  padding: 0 20rpx;
+  box-sizing: border-box;
+  font-size: 28rpx;
+  color: #4c4c4c;
+  position: fixed;
+	top: 0;
+	z-index: 99;
+	  
+}
+.pay-payway-item {
+  width: 100%;
+  height: 100rpx;
+  line-height: 100rpx;
+  border-bottom: 1rpx solid #f3f3f3;
+}
+.pay-balance-cash {
+  color: #bbb;
+}
+.pay-circle {
+  position: relative;
+  width: 44rpx;
+  height: 44rpx;
+  background-color: #eee;
+  display: inline-block;
+  border-radius: 50%;
+  vertical-align: middle;
+}
+.pay-select {
+  position: absolute;
+  top: 7rpx;
+  left: 7rpx;
+  width: 30rpx;
+  height: 30rpx;
+  background-color: #eab86a;
+  display: inline-block;
+  border-radius: 50%;
+}
+.pay-footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  z-index: 99;
+}
+.pay-footer-bar {
+  width: 100%;
+  height: 88rpx;
+  line-height: 44rpx;
+}
+.pay-footer-item {
+  float: left;
+  display: block;
+  width: 65%;
+  height: 88rpx;
+  line-height: 88rpx;
+  background-color: #fff;
+  color: #bbbbbb;
+  font-size: 28rpx;
+  padding-left: 20rpx;
+  box-sizing: border-box;
+  border-top: 1rpx solid #f3f3f3;
+}
+.pay-footer-item .red {
+  color: #eab86a;
+  font-size: 40rpx;
+  
+}
+.pay-payway-item:last-child {
+  border-bottom: none;
+}
+.pay-footer-item2 {
+  float: right;
+  display: block;
+  width: 35%;
+  height: 88rpx;
+  line-height: 88rpx;
+
+}
+.pay-footer-botton {
+  display: block;
+  width: 100%;
+  height: 100%;
+  line-height: 88rpx;
+  background-color: #eab86a;
+  color: #fff;
+  font-size: 28rpx;
+  text-align: center;
+}
+.pay-mt {
+  margin-bottom: 108rpx; 
+}
+.pay-address-add {
+  text-align: center;
+  font-size: 28rpx;
+  color: #999;
+  line-height: 90rpx;
+}
+.product-count {
+  color: #4c4c4c;
+  margin-top:25rpx; 
+}
+.product-info {
+  position: absolute;
+  bottom: 10rpx;
+  width: 490rpx;
+}
+.pay-dialog {
+  position: absolute;
+  top: 0;
+  width: 100%;
+  height: 100%;
+  background: rgba(0,0,0,0.4);
+  z-index: 99;
+}
+.pay-panel {
+  position: fixed;
+  left: 50%;
+  top: 20%;
+  width: 580rpx;
+  margin-left: -290rpx;
+  background-color: #fff;
+  z-index: 100;
+}
+.pay-panel-title {
+  font-size: 32rpx;
+  color: #4c4c4c;
+  text-align: center;
+  margin-top: 48rpx;
+}
+.pay-panel-input {
+  width: 500rpx;
+  height: 100rpx;
+  background-color: #f7f7f7;
+  border: 1px solid #cccccc;
+  font-size: 28rpx;
+  color: #bbb;
+  margin: 60rpx auto 40rpx;
+  display: block;
+  text-align: center;
+}
+.pay-panel-footer {
+  width: 100%;
+  height: 100rpx;
+  border-top: 1rpx solid #dddddd;
+}
+.pay-panel-footer text {
+  display: inline-block;
+  width: 50%;
+  height: 100rpx;
+  text-align: center;
+  font-size: 28rpx;
+  box-sizing: border-box;
+  line-height: 100rpx;
+}
+.pay-panel-cancel {
+  border-right: 1rpx solid #dddddd;
+  color: #4c4c4c;
+}
+.pay-panel-confirm {
+  color: #eab86a;
+}
+.modal-mask {
+  width: 100%;
+  height: 100%;
+  position: fixed;
+  top: 0;
+  left: 0;
+  background: #000;
+  opacity: 0.3;
+  overflow: hidden;
+  z-index: 9000;
+  color: #fff;
+}
+.modal-dialog {
+  width: 540rpx;
+  overflow: hidden;
+  position: fixed;
+  top: 35%;
+  left: 0;
+  z-index: 9999;
+  background: #f9f9f9;
+  margin: -180rpx 105rpx;
+  border-radius: 4rpx;
+}
+.modal-title {
+  padding-top: 30rpx;
+  font-size: 24rpx;
+  color: #535353;
+  text-align: center;
+}
+.modal-content {
+  padding: 50rpx 32rpx;
+}
+.modal-content1 {
+  padding: 30rpx 32rpx 40rpx;
+}
+.modal-span{
+  text-align: center;
+  width: 100%;
+  margin-top: 40rpx;
+  /* margin-bottom: 10rpx; */
+  margin-bottom: 28rpx; 
+  /* font-size: 24rpx; */
+  font-size: 33rpx;
+  color: #4c4c4c;
+}
+.modal-span1{
+  text-align: center;
+  width: 100%;
+  /* margin-top: 40rpx; */
+  /* font-size: 24rpx; */
+  font-size: 33rpx;
+  color: #4c4c4c;
+}
+.modal-count{
+  color: #eab86a;
+}
+.modal-footer {
+  display: flex;
+  flex-direction: row;
+  height: 86rpx;
+  border-top: 1rpx solid #dedede;
+  font-size: 34rpx;
+  line-height: 86rpx;
+}
+.modal-footer1 {
+  /* display: flex;
+  flex-direction: row; */
+  /* height: 86rpx; */
+  border-top: 1rpx solid #dedede;
+  font-size: 34rpx;
+  /* line-height: 86rpx; */
+}
+.btn-cancel {
+  width: 100%;
+  color: #666;
+  text-align: center;
+  /* border-right: 1px solid #dedede; */
+  font-size: 28rpx;
+  height: 86rpx;
+  line-height: 86rpx;
+}
+.btn-confirm {
+  width: 100%;
+  color: #eab86a;
+  text-align: center;
+  font-size: 28rpx;
+  height: 86rpx;
+  line-height: 86rpx;
+  border-bottom: 1rpx solid #dedede;
+}
+
+
+.bgwhile{
+	background-color:#FFFFFF;
+}
+
+
+.cartlist{}
+.cartlist_item{
+background-color: #FFFFFF;
+padding: 15rpx;
+}
+.cartlist_select{
+width: 35rpx;
+display: inline;
+}
+.cartlist_select.active .pay-circle,.pay-balance-cash.active .pay-circle{
+background-color: #eab86a;
+border: 5rpx solid #eee;
+width: 39rpx;
+height: 39rpx;
+
+}
+
+.cartlist_img{
+width: 180rpx;
+display: inline-block;
+height: 180rpx;
+vertical-align: middle;
+margin-left: 15rpx;
+margin-right: 15rpx;
+}
+.cartlist_img image{
+width: 100%;
+height: 100%;
+}
+.cartlist_info{
+display: inline-block;
+vertical-align: middle;
+width:calc(100% - 320rpx)
+}
+.cartlist_title{
+font-size: 16px;
+overflow: hidden;
+text-overflow: ellipsis;
+display: -webkit-box;
+word-wrap: break-word;
+-webkit-line-clamp: 2;
+-webkit-box-orient: vertical;
+color:#666;
+}
+.cartlist_type{
+color: #999;
+margin: 5px 0;
+font-size:12px;
+}
+.cartlist_price{
+float: left;
+color: #F00;
+font-size: 1.2rem;
+margin-top: 5rpx;
+}
+.cartlist_num{float: right;}
+.cartlist_num button{
+width: 27px;
+height: 27px;
+line-height: 23px;
+text-align: center;
+display: inline-block;
+border: 1px solid #ddd;
+border-radius: 50%;
+}
+.cartlist_num button.mius{
+border:1px solid #eab86a;
+color:#eab86a;
+}
+.cartlist_num button.add{
+
+background: #eab86a;
+color: #FFF;
+border: 0;
+line-height: 24px;
+
+}
+.cartlist_num input{
+width: 30px;
+height: 25px;
+text-align: center;
+display: inline-block;
+border-left: 0;
+border-right: 0;
+font-size: 18px;
+margin: 0 10rpx;
+
+}
+
+.cartlistbox{
+	padding:15rpx;
+}
+
+
+
+.main {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+ 
+.main_item {
+  display: flex;
+  flex-direction: row;
+  overflow: hidden;
+  margin-top: 10px;
+  border-radius:10px;
+  
+}
+ 
+movable-area {
+  width: 100%;
+  height: 210rpx;
+  background: #fff;
+}
+ 
+movable-view {
+  width: calc(100% + 184rpx);
+  height: 210rpx;
+}
+ 
+.main_item_content {
+
+}
+ 
+.delete_btn {
+  width: 184rpx;
+  height: 210rpx;
+  background-color: #f2f4f6;
+  border-top-right-radius: 10px;
+  border-bottom-right-radius: 10px;
+  color: #fff;
+  font-size: 28rpx;
+  text-align: center;
+  line-height: 210rpx;
+}

+ 79 - 0
pages/cart/cart.js

@@ -13,6 +13,31 @@ Page({
     checkedtotal:0,
     selectedall:false,
     submitlock:false,
+    x:0,
+    currentX: 0
+  },
+  handleMovableChange: function(e) {
+    // this.data.currentX = e.detail.x;
+    this.data.currentX = e.detail.x;
+    
+  },
+ 
+  handleTouchend: function(e) {
+    this.isMove = true;
+    let index = e.currentTarget.id;
+    let clist = this.data.cartList;
+    if (this.data.currentX < -46) {
+//    this.data.x = -92;
+      clist[index]['movex'] = -100;
+      this.setData({
+        cartList: clist
+      });
+    } else {
+      clist[index]['movex'] = 0;
+      this.setData({
+        cartList: clist
+      });
+    }
   },
   onLoad: function (options) {
   	this.getCartList();
@@ -31,6 +56,9 @@ Page({
     var success = function (res) {
       console.log(res)
     	if(res.data.list){
+    		for(let i in res.data.list){
+    			res.data.list['movex'] = 0;
+    		}
     		that.setData({
 	        cartList: res.data.list,
 	        cartCount: res.data.count,
@@ -87,6 +115,7 @@ Page({
   },
   mius: function (e) {
   	console.log('tapmius',e)
+  	var that = this;
   	var itemid = e.currentTarget.dataset.id;
   	var itemcount = e.currentTarget.dataset.count;
     if (itemcount > 1) {
@@ -97,8 +126,58 @@ Page({
 	    })
       this.checkSelected();
 //    this.changeServercount(count,itemid);
+    }else{
+    	wx.showModal({
+		  title: '提示',
+		  content: '需要删除改商品吗?',
+		  success: function (sm) {
+		    if (sm.confirm) {
+		        var url = "/v1/cart/mult_delele";
+				    var params = {
+				    	ids:itemid
+				    }
+				    var success = function (res) {
+				      console.log(res)
+				      if(res.data.result){
+				      	
+				      }
+				      that.getCartList();
+				    }
+				    _request.$post(url, params, success);
+		      } else if (sm.cancel) {
+		        console.log('用户点击取消')
+		      }
+		    }
+		  })
     }
   },
+  delitem:function(e){
+  	var that = this;
+  	var itemid = e.currentTarget.dataset.id;
+  	console.log('itemid',itemid);
+  	wx.showModal({
+		  title: '提示',
+		  content: '需要删除改商品吗?',
+		  success: function (sm) {
+		    if (sm.confirm) {
+		        var url = "/v1/cart/mult_delele";
+				    var params = {
+				    	ids:itemid
+				    }
+				    var success = function (res) {
+				      console.log(res)
+				      if(res.data.result){
+				      	
+				      }
+				      that.getCartList();
+				    }
+				    _request.$post(url, params, success);
+		      } else if (sm.cancel) {
+		        console.log('用户点击取消')
+		      }
+		    }
+		  })
+  },
   changeCount: function (val) {
     var count = val.detail.value
     var itemid = val.target.dataset.id;

+ 48 - 6
pages/cart/cart.wxml

@@ -1,12 +1,14 @@
 <view class="app app-bg">
 	<view class="pay-payway bgwhile">
 	  <view class="pay-payway-item">
-	  	<view class="fl pay-balance-cash {{selectedall ? 'active' : ''}}" bindtap="allSelect">
+	  	<!--<view class="fl pay-balance-cash {{selectedall ? 'active' : ''}}" bindtap="allSelect">
 	      <text class="pay-circle" bindtap="selectClick" data-payway="weixinpay">
 	        <text class="pay-select" wx:if="{{curPayway === 'quanxuan'}}"></text>
 	      </text>
 	      <text style="margin-left:5px">全选</text>
-	    </view>
+	    </view>-->
+	    已选中 <text style="color:red">{{cartCount}}</text> 件商品
+	    
 	    <view class="pay-payway-balance fr">
 	    	<text bindtap="delSelected" data-payway="weixinpay">删除选中</text>
 	    </view>
@@ -17,7 +19,8 @@
 	
 	<view style="height:55px"></view>
 	<!--购物车列表-->
-	<view>
+	<view class="cartlistbox">
+	<!--
 		<view class="cartlist" wx:for="{{cartList}}" wx:key="id">
 		  <view class="cartlist_item">
 		   	  <view class="cartlist_select {{item.IsBuy ? 'active' : ''}}" bindtap="itemselected" data-count="{{item.count}}" data-id='{{item.id}}' data-price="{{item.original_price}}" data-index="{{index}}">
@@ -39,24 +42,63 @@
 		      <view class='clear'></view>
 		  </view>
 		</view>
+	-->	
+		<view class="cartlist" wx:for="{{cartList}}" wx:key="id">
+			<view class="main_item">
+		      <movable-area>
+		        <movable-view damping="100" out-of-bounds="true" direction="horizontal" x="{{item.movex}}" id="{{index}}" animation="false" bindchange="handleMovableChange" capture-bind:touchstart="handleTouchestart" capture-bind:touchend="handleTouchend">
+		          <view class="main_item_content ">
+		          		  <view class="cartlist_item">
+						   	  <view class="cartlist_select {{item.IsBuy ? 'active' : ''}}" bindtap="itemselected" data-count="{{item.count}}" data-id='{{item.id}}' data-price="{{item.original_price}}" data-index="{{index}}">
+						   	  	<text class="pay-circle"></text>
+						   	  </view>
+						      <view class="cartlist_img">
+						        <image src="{{item.cover}}" />
+						      </view>
+						      <view class="cartlist_info">
+						        <view class="cartlist_title">{{item.product_name}} <span wx:if="{{item.color_name || item.size_name}}">|</span> {{item.color_name}} {{item.size_name}}</view>
+						        <view class="cartlist_type">---</view>
+						        <currency class="cartlist_price" symbol="¥" value="{{item.original_price}}" />
+						        <view class="cartlist_num">
+						        	<button bindtap="mius" data-id='{{item.id}}' data-count="{{item.count}}" data-index="{{index}}" class="mius">-</button>
+						        	<input type="number" value="{{item.count}}" bindinput="changeCount" data-id='{{item.id}}' data-index="{{index}}"/>
+						        	<button bindtap="add" data-id='{{item.id}}' data-count="{{item.count}}" data-index="{{index}}" class="add">+</button>
+						        </view>
+						      </view>
+						      <view class='clear'></view>
+						  </view>
+		          </view>
+		        </movable-view>
+		      </movable-area>
+		      <view class="delete_btn" data-productIndex="{{index}}" data-id='{{item.id}}' bindtap="delitem">删除</view>
+		    </view>
+	    </view>
 	</view>
 
 	<view style="height:50px"></view>
   <view class="pay-footer">
     <view class="pay-footer-bar"> 
       <view class="pay-footer-item">
-        应付:
         <!-- <currency wx:if="{{useRadishSelect && payData.total_price - balanceInfo.total > 0}}" symbol="¥" value="{{payData.total_price - balanceInfo.total}}" class="red"></currency>
         <currency wx:if="{{!useRadishSelect}}" symbol="¥" value="{{payData.total_price}}" class="red"></currency>
         <currency wx:if="{{useRadishSelect && payData.total_price - balanceInfo.total <= 0}}" symbol="¥" value="0" class="red"></currency> -->
         
-        <currency symbol="¥" value="{{cartTotal}}" class="red"></currency>
+        <view class="fl pay-balance-cash {{selectedall ? 'active' : ''}}" bindtap="allSelect">
+	      <text class="pay-circle" bindtap="selectClick" data-payway="weixinpay">
+	        <text class="pay-select" wx:if="{{curPayway === 'quanxuan'}}"></text>
+	      </text>
+	      <text style="margin-left:5px">全选</text>
+	    </view>
+	    
+        <!--<currency symbol="¥" value="{{cartTotal}}" class="red"></currency>-->
         
         <!-- 
         <text class="red" wx:if="{{curPayway === 'balance'}}">{{project.robo_balance_price * payData.count}}代金券</text>
         <text class="red" wx:if="{{curPayway === 'integral'}}">{{project.mall_balance_price * payData.count}}代金券</text> -->
         <view style="float: right;padding-right: 10px;">
-      	共 <text class="red">{{cartCount}}</text> 件商品
+      	<!--共 <text class="red">{{cartCount}}</text> 件商品-->
+      	
+      	应付:<currency symbol="¥" value="{{cartTotal}}" class="red"></currency>
       	</view>
       </view>
       

+ 71 - 8
pages/cart/cart.wxss

@@ -190,7 +190,6 @@
   display: inline-block;
   border-radius: 50%;
   vertical-align: middle;
-  margin-left: 20rpx;
 }
 .pay-select {
   position: absolute;
@@ -229,6 +228,8 @@
 }
 .pay-footer-item .red {
   color: #eab86a;
+  font-size: 40rpx;
+  
 }
 .pay-payway-item:last-child {
   border-bottom: none;
@@ -423,7 +424,6 @@
 
 .cartlist{}
 .cartlist_item{
-margin: 15rpx 0;
 background-color: #FFFFFF;
 padding: 15rpx;
 }
@@ -440,9 +440,9 @@ height: 39rpx;
 }
 
 .cartlist_img{
-width: 120rpx;
+width: 180rpx;
 display: inline-block;
-height: 120rpx;
+height: 180rpx;
 vertical-align: middle;
 margin-left: 15rpx;
 margin-right: 15rpx;
@@ -454,7 +454,7 @@ height: 100%;
 .cartlist_info{
 display: inline-block;
 vertical-align: middle;
-width:calc(100% - 220rpx)
+width:calc(100% - 320rpx)
 }
 .cartlist_title{
 font-size: 16px;
@@ -481,17 +481,80 @@ margin-top: 5rpx;
 .cartlist_num button{
 width: 27px;
 height: 27px;
-line-height: 20px;
+line-height: 23px;
 text-align: center;
 display: inline-block;
 border: 1px solid #ddd;
+border-radius: 50%;
+}
+.cartlist_num button.mius{
+border:1px solid #eab86a;
+color:#eab86a;
+}
+.cartlist_num button.add{
+
+background: #eab86a;
+color: #FFF;
+border: 0;
+line-height: 24px;
+
 }
 .cartlist_num input{
-width: 50px;
+width: 30px;
 height: 25px;
 text-align: center;
 display: inline-block;
-border: 1px solid #DDD;
 border-left: 0;
 border-right: 0;
+font-size: 18px;
+margin: 0 10rpx;
+
+}
+
+.cartlistbox{
+	padding:15rpx;
+}
+
+
+
+.main {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
 }
+ 
+.main_item {
+  display: flex;
+  flex-direction: row;
+  overflow: hidden;
+  margin-top: 10px;
+  border-radius:10px;
+  
+}
+ 
+movable-area {
+  width: 100%;
+  height: 210rpx;
+  background: #fff;
+}
+ 
+movable-view {
+  width: calc(100% + 184rpx);
+  height: 210rpx;
+}
+ 
+.main_item_content {
+
+}
+ 
+.delete_btn {
+  width: 184rpx;
+  height: 210rpx;
+  background-color: #eab86a;
+  border-top-right-radius: 10px;
+  border-bottom-right-radius: 10px;
+  color: #fff;
+  font-size: 28rpx;
+  text-align: center;
+  line-height: 210rpx;
+}

+ 1 - 1
pages/pay/pay.js

@@ -117,7 +117,7 @@ Page({
         cache: false,
 //      curPayway:val.data.total >= (that.data.total + that.data.yunfei)?'balance':'weixinpay'
 				curPayway:'weixinpay',
-				useBalance:val.data.total > 0 ? true:false,
+				useBalance:(val.data.total > 0 && that.data.payData.order_type == 0)? true:false,
 				afterdec:parseInt(val.data.total) >= parseInt(that.data.total) + parseInt(that.data.yunfei)?'0':(that.data.total + that.data.yunfei)-val.data.total
       });
     }

+ 2 - 2
pages/pay/pay.wxml

@@ -104,7 +104,7 @@
         <view class="clean"></view>
       </view>
 -->
-	<view class="pay-payway-item" wx:if="{{payData.order_type != 1 && balanceInfo.total && payData.pay_way == ''}}">
+	<view class="pay-payway-item" wx:if="{{payData.order_type == 0 && balanceInfo.total && 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" bindtap="selectClick" data-payway="balance"></image>
           <text bindtap="selectClick" data-payway="balance">代金券抵扣 (剩余:{{balanceInfo.total / 100}})</text>
@@ -114,7 +114,7 @@
         </view>
 	</view>
 <!--
-      <view class="pay-payway-item" wx:if="{{payData.order_type != 1 && balanceInfo.total}}" bindtap="selectClick" data-payway="balance">
+      <view class="pay-payway-item" wx:if="{{payData.order_type == 0 && balanceInfo.total}}" bindtap="selectClick" data-payway="balance">
         <view class="pay-payway-balance fl">
           <image class="pay-icon" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/image/pay/luobopay.jpg" bindtap="selectClick" data-payway="balance"></image>
           <text bindtap="selectClick" data-payway="balance">代金券支付</text>

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

@@ -326,6 +326,16 @@ Page({
       url: '/pages/customservice/customservice'
     })
   },
+  toApplyLeader () {
+    wx.navigateTo({
+      url: '/packageUser/pages/user/applyLeader/applyLeader'
+    })
+  },
+  toAreaCart () {
+    wx.navigateTo({
+      url: '/pages/areacart/areacart'
+    })
+  },
   toBindTel () {
     wx.navigateTo({
       url: '/packageUser/pages/user/bind/bind'

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

@@ -128,6 +128,16 @@
         <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="toApplyLeader" >
+        <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="toAreaCart" >
+        <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="toCustom" >
         <view class="user-line__title">联系客服</view>
         <image class="user-line__right" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>

+ 6 - 0
project.config.json

@@ -82,6 +82,12 @@
 				},
 				{
 					"id": -1,
+					"name": "团长申请",
+					"pathName": "pages/user/applyLeader/applyLeader",
+					"query": ""
+				},
+				{
+					"id": -1,
 					"name": "代金券列表",
 					"pathName": "pages/user/radish/radish",
 					"query": ""