Ver código fonte

commit -m采美豆

zhengjinyi 4 anos atrás
pai
commit
472990b60f

+ 42 - 23
components/cm-module/creatOrder/freight.vue

@@ -12,8 +12,8 @@
 					</view>
 				</view>
 			</view>
-			<view class="freight-bean" v-if="freePostFlag == 1">
-				<view class="bean-le">可用{{ freightMoney*100 }}采美豆抵用{{ freightMoney }}元运费</view>
+			<view class="freight-bean" v-if="isBeansShow">
+				<view class="bean-le">可用{{ freightBeansMoney*100 }}采美豆抵用{{ freightBeansMoney }}元运费</view>
 				<view class="bean-ri">
 					<view class="checkbox-box">
 						<button class="checkbox iconfont"
@@ -45,7 +45,10 @@
 				isShowOption:false,
 				optionList:['到付'],
 				freePostFlag:'',
-				ischecked:false
+				ischecked:false,
+				isBeansShow:false,
+				userBeans:0,
+				freightBeansMoney:0,
 				
 			}
 		},
@@ -63,17 +66,31 @@
 						this.freightText = '包邮'
 						this.freightData.freight  = 0
 						this.freePostFlag = res.freePostFlag
+						this.isBeansShow = false
 						break
 					case 1:
 						this.freightText = ''
-						this.freightMoney = res.freight
+						this.freightMoney = this.freightBeansMoney =  res.freight
+						this.userBeans = res.userBeans
 						this.freePostFlag = res.freePostFlag
 						this.optionList.unshift(this.orderPriceToFixed(this.freightMoney))
+						if( res.userBeans >= this.freightMoney*100 ){
+							this.isBeansShow = true
+						}else{
+							this.isBeansShow = false
+						}
 						break
 					case -1:
 						this.freightText = '到付'
+						this.userBeans = res.userBeans
 						this.freePostFlag = res.freePostFlag
 						this.freightData.freight  = 0
+						if( res.userBeans >= 3000 ){
+							this.freightBeansMoney = 30
+							this.isBeansShow = true
+						}else{
+							this.isBeansShow = false
+						}
 						break
 				}
 			},
@@ -86,37 +103,39 @@
 							case 0:
 								self.freightMoney = self.infoData.freight
 								self.freePostFlag = 1
+								self.freightBeansMoney = self.freightMoney
+								if( self.userBeans >= self.freightMoney*100 ){
+									self.isBeansShow = true
+								}else{
+									self.isBeansShow = false
+								}
 								break
 							case 1:
 								self.freePostFlag = -1
-								self.freightMoney ='到付'
+								self.freightMoney = '到付'
+								self.freightBeansMoney = 30
+								if( self.userBeans >= 3000 ){
+									self.freightBeansMoney = 30
+									self.isBeansShow = true
+								}else{
+									self.isBeansShow = false
+								}
 								break
 						}
-						self.$emit('confirmFreight',self.freePostFlag);
+						let obj = {
+								freePostFlag :self.freePostFlag,
+								freightBeansMoney: self.freightBeansMoney
+							}
+						self.$emit('confirmFreight',obj);
 				    },
 				    fail: function (res) {
 				        console.log(res.errMsg);
 				    }
 				});
 			},
-			checkedBalabce(){//勾选使用余额
+			checkedBalabce(){//勾选使用采美豆抵扣
 				this.ischecked = !this.ischecked
-				if(this.userMoney > 0){
-					this.ischecked = !this.ischecked
-					if(this.ischecked){
-						this.balanceDeductionFlag =1
-						this.attributePallPrice()
-					}else{
-						if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){
-							this.payAllPrice = this.allPrice+parseInt(this.freightData.freight)
-						}else{
-							this.payAllPrice = this.allPrice
-						}
-						this.balanceDeductionFlag = 2
-					}
-				}else{
-					return
-				}
+				this.$emit('confirmFreightBeans',this.ischecked);
 			},
 			orderPriceToFixed (value){
 				let price ='';

+ 1 - 1
pages/tabBar/home/index.vue

@@ -21,7 +21,7 @@
 		<!-- 活动弹窗 -->
 		<!-- <activityAlert :show="isActivity" @click="handleClick" @cancel="handleCancelClick"></activityAlert> -->
 		<!-- 采美豆提示弹窗 -->
-		<activityBean v-if="isActivityBean" :show="isActivityBean" :beansType="beansType" @cancel="handleBeanlClick" ></activityBean>
+		<activityBean v-if="isActivityBean" :show="isActivityBean" :beansType="beansType" :beanNumber="beanNumber"  @cancel="handleBeanlClick"></activityBean>
 	</view>
 </template>
 

+ 3 - 3
pages/user/account/account-bean.vue

@@ -129,8 +129,8 @@
 				let	stateTextObject={
 						1:'注册机构',
 						2:'升级会员机构',
-						3:'普通机构完善资料',
-						4:'会员机构完善资料',
+						3:'完善资料',
+						4:'完善资料',
 						5:'下单',
 						6:'线上支付订单',
 						7:'确认收货',
@@ -470,7 +470,7 @@ page, .container{
 			display: flex;
 			.t-t{
 				flex: 1;
-				color: #9aa5b5;
+				color: #999999;
 				&:nth-child(1){
 					text-align: left;
 				}

+ 28 - 8
pages/user/order/create-order.vue

@@ -14,7 +14,9 @@
 		<freight ref="freight"
 				 v-if="isFreight"
 				 :freightData="freightData"
-				 @confirmFreight="hanldFreightFn">
+				 @confirmFreight="hanldFreightFn"
+				 @confirmFreightBeans = "hanldFreightBeans"
+				 >
 		</freight>
 		<freight-alert v-if="isfreightTip" ref="csPhone"></freight-alert>
 		<!-- 余额抵扣 -->
@@ -115,7 +117,9 @@
 				orderInfo:[],			  //提交的商品信息
 				payInfo:{},				  //订单信息
 				rechargeGoods:null,		  //判断订单里有定金商品或者充值商品时,余额抵扣部分不显示
-				isIphoneX:this.$store.state.isIphoneX
+				isIphoneX:this.$store.state.isIphoneX,
+				freightBeansMoney:0,	  //存储采美豆抵扣金额
+				hanldUserBeans:0			
 			}
 		},
 		onLoad(option){//商品数据
@@ -173,9 +177,11 @@
 					this.hanldFreePostFlag = response.data.freePostFlag
 					this.hanldFreight = response.data.freight
 					if(this.hanldFreePostFlag == 1){
+						this.freightBeansMoney = response.data.freight
 						this.payAllPrice = this.allPrice + response.data.freight
 						this.attributePallPrice()
 					}else{
+						this.freightBeansMoney = 30
 						this.payAllPrice = this.allPrice
 						this.attributePallPrice()
 					}
@@ -204,21 +210,34 @@
 				this.invoiceData = data
 			},
 			hanldFreightFn(data){//显示邮费弹窗
-				switch(data){
+				console.log(data)
+				switch(data.freePostFlag){
 					case 1:
 						this.hanldFreight = this.freightData.freight
-						this.hanldFreePostFlag = data
+						this.hanldFreePostFlag = data.freePostFlag
+						this.freightBeansMoney = data.freightBeansMoney
 						this.payAllPrice =this.allPrice + this.hanldFreight
 						this.attributePallPrice()
 						break
 					case -1:
 						this.hanldFreight = 0
-						this.hanldFreePostFlag = data
+						this.hanldFreePostFlag = data.freePostFlag
+						this.freightBeansMoney = data.freightBeansMoney
 						this.payAllPrice = this.allPrice
 						this.attributePallPrice()
 						break
 				}
 			},
+			hanldFreightBeans(data){//是否勾选采美豆抵扣
+				if(data){
+					this.hanldUserBeans = this.freightBeansMoney*100
+					if(this.hanldFreePostFlag == 1){
+						this.payAllPrice = this.allPrice + this.hanldFreight - this.freightBeansMoney
+					}
+				}else{
+					this.hanldUserBeans = 0
+				}
+			},
 			checkedBalabce(){//勾选使用余额
 				if(this.userMoney > 0){
 					this.ischecked = !this.ischecked
@@ -303,8 +322,9 @@
 						orderShouldPayFee:this.payAllPrice.toFixed(2),//提交的总价
 						balancePayFlag:this.balanceDeductionFlag,//余额抵扣的状态
 						freight:parseInt(this.hanldFreight).toFixed(2),//邮费
-						freePostFlag:parseInt(this.hanldFreePostFlag)//运费形式
-					}
+						freePostFlag:parseInt(this.hanldFreePostFlag),//运费形式
+						userBeans:this.hanldUserBeans
+					}					
 				let param = {
 						orderSource:6,
 						clubUserId:this.userID,
@@ -314,7 +334,7 @@
 						payInfo:this.payInfo,	//订单信息
 						orderInvoice:this.invoiceData
 					}
-					// console.log(param)
+					console.log(param)
 				this.isSubLoading = true;	
 				this.OrderService.CreatedOrderSubmit({'params':JSON.stringify(param)}).then(response =>{
 					const data = response.data;

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

@@ -306,8 +306,9 @@
 			handOrderConfirm(){//确认收货
 				this.$util.modal('提示','是否确认收货','确定','取消',true,() =>{
 					this.OrderService.ConfirmReceipt({orderID:this.orderID}).then(response =>{
-						this.$util.msg(response.msg,2000,true,'success');
-						this.initOrderDetaileData()
+						this.beansType = 7
+						this.beanNumber = 10
+						this.isActivityBean = true
 					}).catch(error =>{
 						this.$util.msg(error.msg,2000)
 					})
@@ -317,7 +318,9 @@
 				this.$util.modal('提示','确认此订单?','确定','取消',true,() =>{
 					this.OrderService.AffirmOrder({orderID:this.orderID}).then(response =>{
 						this.$util.msg(response.msg,2000,true,'success');
-						this.initOrderDetaileData()
+						setTimeout(() => {
+							this.initOrderDetaileData()
+						},2000)
 					}).catch(error =>{
 						this.$util.msg(error.msg,2000)
 					})
@@ -394,6 +397,7 @@
 			},
 			handleBeanlClick(){//关闭采美豆弹窗
 				this.isActivityBean = false
+				this.initOrderDetaileData()
 			},
 		},
 		onShow() {

+ 4 - 4
pages/user/order/order-list.vue

@@ -434,10 +434,9 @@
 			handOrderConfirm (id){//确认收货
 				this.$util.modal('提示','是否确认收货','确定','取消',true,() =>{
 					this.OrderService.ConfirmReceipt({orderID:id}).then(response =>{
-						this.$util.msg(response.msg,2000,true,'success');
-						setTimeout(() => {
-							this.getOrderDatainit(this.currentTab)
-						},2000)
+						this.beansType = 7
+						this.beanNumber = 10
+						this.isActivityBean = true
 					}).catch(error =>{
 						this.$util.msg(error.msg,2000)
 					})
@@ -565,6 +564,7 @@
 			},
 			handleBeanlClick(){//关闭采美豆弹窗
 				this.isActivityBean = false
+				this.getOrderDatainit(this.currentTab)
 			},
 		},
 		onPageScroll(e) {

+ 19 - 4
search/pages/search/search-order.vue

@@ -109,6 +109,9 @@
 		</share-alert>
 		<!-- 透明模态层 -->
 		<modal-layer v-if='isModalLayer'></modal-layer>
+		<!-- 采美豆提示弹窗 -->
+		<activityBean v-if="isActivityBean" :show="isActivityBean" :beansType="beansType" :beanNumber="beanNumber"  @cancel="handleBeanlClick"></activityBean>
+		
 	</view>
 </template>
 
@@ -121,6 +124,8 @@
 	import empty from "@/components/empty";
 	import shareAlert from '@/components/cm-module/modelAlert/shareAlert'			 //分享弹窗
 	import authorize from '@/common/config/authorize.js'
+	import activityBean from '@/components/cm-module/activity/activityBean.vue'
+	
 	export default {
 		components: {
 			orSearch,
@@ -129,6 +134,7 @@
 			orderButton,
 			empty,
 			shareAlert,
+			activityBean
 		},
 		data() {
 			return {
@@ -160,7 +166,11 @@
 				pullFlag: true,
 				navbarHeight:'',
 				nomoreText: '上拉显示更多',
-				scrollHeight:''
+				scrollHeight:'',
+				beansType:1,
+				beanNumber:0,
+				isActivityBean:false,
+				
 			}
 		},
 		onLoad() {
@@ -336,8 +346,9 @@
 			handOrderConfirm (id){//确认收货
 				this.$util.modal('提示','是否确认收货','确定','取消',true,() =>{
 					this.OrderService.ConfirmReceipt({orderID:id}).then(response =>{
-						this.$util.msg(response.msg,2000,true,'success');
-						this.getOrderDatainit()
+						this.beansType = 7
+						this.beanNumber = 10
+						this.isActivityBean = true
 					}).catch(error =>{
 						this.$util.msg(error.msg,2000)
 					})
@@ -430,7 +441,11 @@
 					}
 				});
 				return HtmlStateText;
-			}
+			},
+			handleBeanlClick(){//关闭采美豆弹窗
+				this.isActivityBean = false
+				this.getOrderDatainit()
+			},
 		},
 		onPageScroll(e) {
 			this.scrollTop = e.scrollTop;

+ 2 - 2
services/ajax.env.js

@@ -2,10 +2,10 @@ let URL_CONFIG = ''
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
 	// URL_CONFIG = 'http://192.168.2.68:8008'	 //涛涛联调地址
-	// URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
+	URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.2.81:8008'
 	// URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境

+ 2 - 2
services/config.env.js

@@ -2,8 +2,8 @@ let URL_CONFIG = ''
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
     // URL_CONFIG = 'http://192.168.2.75:18002'	 //超超联调地址
-	// URL_CONFIG = 'http://192.168.2.67:18002'	 //裴裴联调地址
-	URL_CONFIG = 'https://core-b.caimei365.com'
+	URL_CONFIG = 'http://192.168.2.67:18002'	 //裴裴联调地址
+	// URL_CONFIG = 'https://core-b.caimei365.com'
 	// URL_CONFIG = 'https://core.caimei365.com'
 }else{
     // 生产环境