Browse Source

commit -m 采美豆

zhengjinyi 4 years ago
parent
commit
06d698db51

+ 6 - 2
components/cm-module/productDetails/recommend.vue

@@ -40,18 +40,22 @@
 				isEmpty:false,
 				pageSize:4,
 				productID:'',
+				userId:0,
 			}
 		},
 		created() {
 			this.productID = this.queryProductid
-			this.infoRecommend(this.queryProductid,this.queryType)
+			this.$api.getStorage().then((resolve) => {
+				this.userId = resolve.userId ? resolve.userId : 0;
+				this.infoRecommend(this.queryProductid,this.queryType)
+			})	
 		},
 		computed: {
 			...mapState(['identity'])
 		},
 		methods:{
 			infoRecommend(id,type){
-				this.ProductService.queryProductDetilsRelevant({ productId:id,recommendType:type ? type : 0,identity:this.identity }).then(response =>{
+				this.ProductService.queryProductDetilsRelevant({ productId:id,recommendType:type ? type : 0,userId : this.userId }).then(response =>{
 					if( response.data && response.data.length > 0){
 						this.isEmpty = false
 						this.recommendList = response.data

+ 49 - 29
pages/user/order/create-order.vue

@@ -253,16 +253,28 @@
 						this.hanldUserBeans = 0
 					}
 					// 计算抵扣后的总价
-					if(this.hanldFreePostFlag == 1){
-						this.payAllPrice = this.allPrice + this.hanldFreight - this.freightBeansMoney
+					if(this.hanldFreePostFlag == 1){	
+						// 如果使用了余额 最终价格
+						if(this.ischecked){
+							if(this.userMoney>=this.payAllPrice){
+								this.payAllPrice = 0.00
+								this.deductMoney = this.allPrice							// 当前使用金额等于订单金额
+								this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余金额等于余额-当前使用金额
+							}else{
+								this.payAllPrice = this.allPrice - this.userMoney       	// 订单最终支付金额等于订单金额-账户余额
+								this.deductMoney = this.userMoney				            // 当前使用金额等于总余额
+								this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余余额等于总余额-当前使用金额
+							}
+						}else{
+							this.payAllPrice = this.allPrice + this.hanldFreight - this.freightBeansMoney
+						}
 						console.log('抵扣',this.payAllPrice)
 					}
-				}else{
+				}else{// 采美豆不抵扣运费
 					this.hanldUserBeans = 0
 					// 不抵扣时计算总价
 					if(this.hanldFreePostFlag == 1){
-						this.payAllPrice = this.allPrice + this.hanldFreight
-						console.log('不抵扣',this.payAllPrice)
+						this.attributeHashfreight(this.hanldFreight)
 					}
 				}
 			},
@@ -272,10 +284,13 @@
 					if(this.ischecked){
 						this.balanceDeductionFlag =1
 						this.attributePallPrice()
-						this.hanldFreightBeans(this.isCheckedBeans)
 					}else{
-						if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){
-							this.payAllPrice = this.allPrice+parseInt(this.freightData.freight)
+						if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){ //如果是有运费时
+							if(this.isCheckedBeans){
+								this.payAllPrice =  this.allPrice
+							}else{
+								this.payAllPrice = this.allPrice+parseInt(this.freightData.freight)
+							}
 						}else{
 							this.payAllPrice = this.allPrice
 						}
@@ -285,49 +300,54 @@
 					return
 				}
 			},
-			attributePallPrice(){//计算价格
+			attributePallPrice(){// 计算价格
 				if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){
 					this.attributeHashfreight(this.freightData.freight)
 				}else{
 					this.attributeNofreight()
 				}
 			},
-			attributeNofreight(){//计算没有邮费的支付价格
+			attributeNofreight(){// 计算没有邮费的支付价格
 				if(this.ischecked){
-					if(this.userMoney>this.payAllPrice){
+					if(this.userMoney>=this.payAllPrice){
 						this.payAllPrice = 0.00
-						this.deductMoney = this.allPrice							//勾选后使用抵余
-						this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+						this.deductMoney = this.allPrice							// 当前使用金额等于订单金
+						this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余金额等于余额-当前使用金额
 					}else{
-						this.payAllPrice = this.allPrice - this.userMoney       	//勾选后的总价
-						this.deductMoney = this.userMoney				            //勾选后使用抵余额
-						this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+						this.payAllPrice = this.allPrice - this.userMoney       	// 订单最终支付金额等于订单金额-账户余额
+						this.deductMoney = this.userMoney				            // 当前使用金额等于总余额
+						this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余余额等于总余额-当前使用金额
 					}
 				}else{
 					this.payAllPrice = this.allPrice;
-					this.deductMoney = 0.00;
-					this.surplusMoney = this.userMoney;
+					this.deductMoney = 0.00; // 当前使用
+					this.surplusMoney = this.userMoney; // 剩余余额
 				}
 			},
-			attributeHashfreight(freight){//计算需要邮费的支付价格
-				this.payAllPrice = this.allPrice+parseInt(freight)//计算不包邮的价格 总价等于商品价格+邮费
+			attributeHashfreight(freight){// 计算需要邮费的支付价格
+				this.payAllPrice = this.allPrice+parseInt(freight)// 计算不包邮的价格 总价等于商品价格+邮费
 				if(this.ischecked){
-					if(this.userMoney>this.payAllPrice){							//余额大于支付金额
+					if(this.userMoney>=this.payAllPrice){// 余额大于支付金额
 						this.payAllPrice =0.00
-						this.deductMoney = this.allPrice+parseInt(freight)			//勾选后使用抵余额
-						this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+						if(this.isCheckedBeans){
+							this.deductMoney = this.allPrice								// 当前使用金额等于订单金额
+							this.surplusMoney = this.userMoney - this.deductMoney	    	// 剩余金额等于余额减去当前使用金额
+						}else{
+							this.deductMoney = this.allPrice + parseInt(freight)			// 当前使用金额等于订单金额+运费金额
+							this.surplusMoney = this.userMoney - this.deductMoney	    	// 剩余余额等于总余额-当前使用金额
+						}
 					}else{
-						this.payAllPrice = this.allPrice+parseInt(freight) - this.userMoney       	//勾选后的总价
-						this.deductMoney = this.userMoney				            //勾选后使用抵余额
-						this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+						this.payAllPrice = this.allPrice+parseInt(freight) - this.userMoney // 订单最终支付金额等于订单金额+运费-账户余额
+						this.deductMoney = this.userMoney				            		// 当前使用金额等于账户余额
+						this.surplusMoney = this.userMoney - this.deductMoney	    		// 剩余余额等于账户余额-当前使用金额
 					}
 				}else{
 					this.payAllPrice = this.allPrice+parseInt(freight)
-					this.deductMoney = 0.00
-					this.surplusMoney = this.userMoney
+					this.deductMoney = 0.00 // 当前使用金额
+					this.surplusMoney = this.userMoney // 剩余余额
 				}
 			},
-			orderSubmitMit(){//提交订单
+			orderSubmitMit(){// 提交订单
 				if(this.isSubLoading){ return; }
 				if(this.addressID == ''){
 					this.$util.msg('请先添加收货地址~',2000)

+ 5 - 3
pages/user/order/order-details.vue

@@ -145,7 +145,10 @@
 				
 			}
 			this.getHeaderTopHeight()
-			this.initOrderDetaileData()
+			this.$api.getStorage().then((resolve) =>{
+				this.userID = resolve.userId ? resolve.userId : 0
+				this.initOrderDetaileData()
+			})	
 		},
 		filters:{
 			TextFormat(status) {//处理金额
@@ -181,11 +184,10 @@
 				this.$api.navigateTo(`/pages/service/sellconten?clauseId=${id}`)
 			},
 			initOrderDetaileData(){//初始化页面数据@参数:订单ID
-				this.OrderService.QueryOrderDetails({ orderID : this.orderID }).then(response =>{
+				this.OrderService.QueryOrderDetails({ orderID : this.orderID, userId : this.userID}).then(response =>{
 					let resData = response.data;
 					this.isRequest = true
 					this.orderInfo = resData.order
-					this.userID = resData.order.userID
 					this.shareCode = resData.shareCode
 					this.addressData = resData.userInfo
 					this.information = resData.order

+ 1 - 0
pages/user/order/success.vue

@@ -48,6 +48,7 @@
 			initData(e){
 				let data = JSON.parse(e.data);
 				this.orderID = data.data.orderID
+				console.log(this.orderID)
 			}
 		},
 		onShow() {

+ 3 - 1
seller/pages/order/order-details.vue

@@ -89,6 +89,7 @@
 				state:0,
 				userID:'',
 				orderID:'',
+				clubUserId:0,
 				serviceProviderId:'',		//协销ID
 				shareCode:'',				//分享码
 				shareType:'',               //分享登录页过来记录的状态
@@ -130,6 +131,7 @@
 			console.log(option)
 			this.shareType = option.type;
 			this.orderID = option.orderID
+			this.clubUserId = option.userId
 			if(this.shareType ==='share'){
 				this.listType = 0
 				this.isOrderShare = true
@@ -182,7 +184,7 @@
 				this.$api.navigateTo(`/pages/service/sellconten?clauseId=${id}`)
 			},
 			initOrderDetaileData(){//初始化页面数据@参数:订单ID
-				this.OrderService.QueryOrderDetails({ orderID : this.orderID }).then(response =>{
+				this.OrderService.QueryOrderDetails({ orderID : this.orderID ,userId : this.clubUserId}).then(response =>{
 					let resData = response.data;
 					this.isRequest = true
 					this.userID = resData.order.userID

+ 3 - 3
seller/pages/order/order-historylist.vue

@@ -21,7 +21,7 @@
 						<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0" :typeIndex="currentTab" :navbarHeight="navbarHeight"></empty>
 						<!-- 列表 -->
 						<view v-else class="tui-order-content">
-							<view  class="tui-order-item" v-for="(order,orderIndex) in tabItem.orderList" :key="orderIndex" @click.stop="detail(order.orderID)">
+							<view  class="tui-order-item" v-for="(order,orderIndex) in tabItem.orderList" :key="orderIndex" @click.stop="detail(order)">
 								<view class="order-title">
 									<view class="order-title-name">{{order.clubName}}</view>
 									<view class="order-title-t">
@@ -314,9 +314,9 @@
 					this.getOnReachBottomData(this.currentTab);
 				}	
 			},
-			detail(id) {//订单详情跳转
+			detail(order) {//订单详情跳转
 				this.isModalLayer = true;	
-				this.$api.navigateTo(`/seller/pages/order/order-details?listType=${this.currentTab}&orderID=${id}`)
+				this.$api.navigateTo(`/seller/pages/order/order-details?listType=${this.currentTab}&orderID=${order.orderID}&userId=${order.userID}`)
 			},
 			handButtonConfirm(data) {//获取点击
 				this.handShowAlert(data)

+ 3 - 3
seller/pages/order/order-list.vue

@@ -29,7 +29,7 @@
 						<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0" :typeIndex="currentTab" :navbarHeight="navbarHeight"></empty>
 						<!-- 列表 -->
 						<view v-else class="tui-order-content">
-							<view  class="tui-order-item" v-for="(order,orderIndex) in tabItem.orderList" :key="orderIndex" @click.stop="detail(order.orderID)">
+							<view  class="tui-order-item" v-for="(order,orderIndex) in tabItem.orderList" :key="orderIndex" @click.stop="detail(order)">
 								<view class="order-title">
 									<view class="order-title-name">{{order.clubName ? order.clubName : ''}}</view>
 									<view class="order-title-t">
@@ -372,9 +372,9 @@
 					this.getOnReachBottomData(this.currentTab);
 				}	
 			},
-			detail(id) {//订单详情跳转
+			detail(order) {//订单详情跳转
 				this.isModalLayer = true;	
-				this.$api.navigateTo(`/seller/pages/order/order-details?listType=${this.currentTab}&orderID=${id}`)
+				this.$api.navigateTo(`/seller/pages/order/order-details?listType=${this.currentTab}&orderID=${order.orderID}&userId=${order.userID}`)
 			},
 			handButtonConfirm(data) {//获取点击
 				this.handShowAlert(data)

+ 3 - 3
seller/pages/search/search-order.vue

@@ -28,7 +28,7 @@
 					<empty v-if="isShowEmpty" :navbarHeight="navbarHeight"></empty>
 					<!-- 列表 -->
 					<view v-else class="tui-order-content">
-						<view  class="tui-order-item" v-for="(order,orderIndex) in orderList" :key="orderIndex" @click.stop="detail(order.orderID)">
+						<view  class="tui-order-item" v-for="(order,orderIndex) in orderList" :key="orderIndex" @click.stop="detail(order)">
 							<view class="order-title">
 								<view class="order-title-name">{{order.clubName ? order.clubName : ''}}</view>
 								<view class="order-title-t">
@@ -309,9 +309,9 @@
 					this.getOnReachBottomData();
 				}	
 			},
-			detail(id) {//订单详情跳转
+			detail(order) {//订单详情跳转
 				this.isModalLayer = true;	
-				this.$api.navigateTo(`/seller/pages/order/order-details?type=seacrch&orderID=${id}`)
+				this.$api.navigateTo(`/seller/pages/order/order-details?type=seacrch&orderID=${order.orderID}&userId=${order.userID}`)
 			},
 			handButtonConfirm(data) {//获取点击
 				this.handShowAlert(data)