ソースを参照

修改订单模块问题

zhengjinyi 3 年 前
コミット
41c7b58d61

+ 23 - 21
components/cm-module/creatOrder/coupon.vue

@@ -67,7 +67,7 @@
 
 <script>
 	export default{
-		name:"coupon",
+		name:'coupon',
 		props:{
 			couponList:{
 				type:Array
@@ -87,25 +87,25 @@
 		},
 		filters:{
 			NumFormat(value) {//处理金额
-				return Number(value).toFixed(2);
+				return Number(value).toFixed(2)
 			},
 			TypeFormat(value) {
 				switch (value) {
 					case 0:
-						return  '活动券';
-						break;
+						return  '活动券'
+						break
 					case 1:
-						return  '品类券';
-						break;
+						return  '品类券'
+						break
 					case 2:
-						return  '用户专享券';
-						break;
+						return  '用户专享券'
+						break
 					case 3:
-						return  '店铺券';
-						break;
+						return  '店铺券'
+						break
 					case 4:
-						return  '新用户券';
-						break;
+						return  '新用户券'
+						break
 				}
 			}
 		},	
@@ -123,17 +123,19 @@
 		},
 		methods:{
 			initData(data){
-				data.forEach((el,index) => {
-					this.dataList.push(Object.assign({},el,{ischecked:false}))
-				})
-				this.coupon.couponAmount = data[0].couponAmount
-				this.dataList[0].ischecked = true
+				if(data.length>0){
+					data.forEach((el,index) => {
+						this.dataList.push(Object.assign({},el,{ischecked:false}))
+					})
+					this.coupon.couponAmount = data[0].couponAmount
+					this.dataList[0].ischecked = true
+				}
 			},
 			checkedCoupon(idx){// 选择优惠券
-				this.checkedIndex = idx;
+				this.checkedIndex = idx
 				this.dataList.forEach((el,index) => {
 					if(this.checkedIndex == index){
-						el.ischecked = !el.ischecked;
+						el.ischecked = !el.ischecked
 					}else{
 						el.ischecked = false
 					}
@@ -151,7 +153,7 @@
 				let coupon = {
 						couponAmount:0,
 						clubCouponId:0,
-					};
+					}
 				this.dataList.forEach((el,index) => {
 					if(el.ischecked){
 						coupon.couponAmount = el.couponAmount
@@ -159,7 +161,7 @@
 					}
 				})
 				this.coupon = coupon
-				this.$emit('handleChoiceaCoupon',this.coupon);
+				this.$emit('handleChoiceaCoupon',this.coupon)
 			}
 		}
 	}

+ 2 - 2
components/cm-module/orderDetails/sellerOrderButton.vue

@@ -6,7 +6,7 @@
 			<view class="btn btn-cancel" v-if="btnState.isCancel" @click.stop="btnConfirm('cancel',orderId)">取消订单</view>
 			<!-- <view class="btn btn-cancel" v-if="btnState.isDelete" @click.stop="btnConfirm('delete',orderId)">删除订单</view> -->
 			<view class="btn btn-cancel"  @click.stop="onShareCode(orderId,userId)">分享订单</view>	
-			<view class="btn btn-query" v-if="btnState.isQuery && order.secondHandOrderFlag!=1" @click.stop="btnConfirm('query',order)">查看物流</view>
+			<view class="btn btn-query" v-if="btnState.isQuery && order.secondHandOrderFlag!=1" @click.stop="btnConfirm('query',orderId)">查看物流</view>
 			<view class="btn btn-color" v-if="btnState.isConfirm" @click.stop="btnConfirm('confirm',orderId)">确认订单</view>
 		</view>
 	</view>
@@ -14,7 +14,7 @@
 
 <script>
 	export default{
-		name:"button",
+		name:'button',
 		props:{
 			status: {
 				type:Number

+ 21 - 21
pages/seller/address/address.vue

@@ -65,19 +65,19 @@
 			}
 		},
 		onLoad(option){	
-			if(option.type=='select'){this.isSelect = true;}
-			this.setScrollHeight();
+			if(option.type=='select'){this.isSelect = true}
+			this.setScrollHeight()
 		},
 		methods: {
 			setScrollHeight() {	// 窗口高度 - 底部距离
 				setTimeout(()=> {
-					const query = wx.createSelectorQuery().in(this);
-					query.selectAll('.add-btn').boundingClientRect();
+					const query = wx.createSelectorQuery().in(this)
+					query.selectAll('.add-btn').boundingClientRect()
 					query.exec(res => {
 						if(res[0][0]){
 							let winHeight = this.$api.getWindowHeight(),
-								eleTop = res[0][0].top - 1;
-								this.scrollHeight =  eleTop;
+								eleTop = res[0][0].top - 1
+								this.scrollHeight =  eleTop
 						}
 					})
 				}, 500)
@@ -111,16 +111,16 @@
 			},
 			checkAddress(item){//选择地址
 				//是否需要返回地址(从订单确认页跳过来选收货地址)
-				if(!this.isSelect){return ;}
+				if(!this.isSelect){return }
 				uni.setStorageSync('selectAddress',item)
-				var pages = getCurrentPages();
-				var prevPage = pages[pages.length - 2];  //上一个页面	
+				var pages = getCurrentPages()
+				var prevPage = pages[pages.length - 2]  //上一个页面	
 					prevPage.setData({select:'select'})
-				uni.navigateBack();
+				uni.navigateBack()
 			},
 			addAddress(type,item){
 				uni.navigateTo({
-					url: `/pages/user/address/addressManage?type=${type}&data=${JSON.stringify(item)}`
+					url: `/pages/seller/address/addressManage?type=${type}&data=${JSON.stringify(item)}`
 				})
 			},
 			deleteAddress(addressId){//删除收货地址
@@ -128,29 +128,29 @@
 					this.UserService.DeleteAddress({addressId:addressId,userId:this.listQuery.userId}).then(response =>{
 						this.$util.msg('删除成功',2000,true,'success')
 						setTimeout(() =>{
-							this.listQuery.pageNum = 1;
-							this.addressList = [];
-							this.getQueryAddressList();
+							this.listQuery.pageNum = 1
+							this.addressList = []
+							this.getQueryAddressList()
 						},2000)
 					}).catch(error =>{
-						this.$util.msg(error.msg,2000);
+						this.$util.msg(error.msg,2000)
 					})
 				})
 			}
 		},
 		onReachBottom() {
 			if(this.hasNextPage) {
-				this.getOnReachBottomData();
+				this.getOnReachBottomData()
 			}
 		},
 		onShow() {
 			this.$api.getComStorage('orderUserInfo').then((resolve) =>{
 				this.listQuery.userId = resolve.userID? resolve.userID : 0
-				this.listQuery.pageNum = 1;
-				this.addressList = [];
-				this.getQueryAddressList();
-				var pages = getCurrentPages();
-				var prevPage = pages[pages.length - 2];  //上一个页面	
+				this.listQuery.pageNum = 1
+				this.addressList = []
+				this.getQueryAddressList()
+				var pages = getCurrentPages()
+				var prevPage = pages[pages.length - 2]  //上一个页面	
 					// prevPage.setData({select:''})
 			})
 		}

+ 33 - 32
pages/seller/address/addressManage.vue

@@ -78,17 +78,17 @@
 			let title = '添加新地址'
 			if(option.type==='edit'){
 				title = '编辑收货地址'
-				this.isConfirm = false;
-				this.addType = 2;			
+				this.isConfirm = false
+				this.addType = 2			
 				let optionData = JSON.parse(option.data)
 				this.addressData.allAddress = `${optionData.province}-${optionData.city}-${optionData.town}`
 				this.addressData.address = optionData.address?optionData.address:''
-				this.addressData.defaultFlag = optionData.defaultFlag;
-				this.addressData.userId = optionData.userId;
-				this.addressData.mobile = optionData.mobile;
-				this.addressData.townId = optionData.townId;
-				this.addressData.addressId = optionData.addressId;
-				this.addressData.receiver = optionData.receiver;
+				this.addressData.defaultFlag = optionData.defaultFlag
+				this.addressData.userId = optionData.userId
+				this.addressData.mobile = optionData.mobile
+				this.addressData.townId = optionData.townId
+				this.addressData.addressId = optionData.addressId
+				this.addressData.receiver = optionData.receiver
 				if(this.addressData.defaultFlag == 1){
 					this.switchDefault = true
 				}else{
@@ -102,9 +102,9 @@
 		methods: {			
 			switchChange(e){
 				if(e.detail.value== true){
-					this.addressData.defaultFlag = '1';
+					this.addressData.defaultFlag = '1'
 				}else{
-					this.addressData.defaultFlag = '0';
+					this.addressData.defaultFlag = '0'
 				}
 			},
 			// 三级联动选择
@@ -114,22 +114,22 @@
 			},
 			onConfirm(e) {
 				console.log(e)
-				this.addressData.allAddress = e.name;
-				this.addressData.townId = e.townCode;	
-				this.initInput();
+				this.addressData.allAddress = e.name
+				this.addressData.townId = e.townCode	
+				this.initInput()
 			},			
 			//提交
 			confirm(){
-				let data = this.addressData;
+				let data = this.addressData
 				if(!data.receiver){
-					this.$util.msg('请填写收货人');
+					this.$util.msg('请填写收货人')
 				}
 				if(data.address =='所在地区'){
-					this.$util.msg('请选择所在地区');
+					this.$util.msg('请选择所在地区')
 				}
 				if(!/(^1[0-9][0-9]{9}$)/.test(data.mobile)){
-					this.$util.msg('请输入正确的手机号码');
-					return;
+					this.$util.msg('请输入正确的手机号码')
+					return
 				}
 				if(this.addType ==1){
 					this.params ={
@@ -142,7 +142,7 @@
 						}
 					this.postAddressData(this.params)	
 				}else{
-					this.params =  this.addressData;
+					this.params =  this.addressData
 					this.postAddressData(this.params)
 				}
 			},
@@ -152,45 +152,46 @@
 					this.$util.msg('保存成功',1500,true,'success')
 					this.btnText(false)
 					setTimeout(()=>{
-						uni.navigateBack();
+						uni.navigateBack()
 					},2000)
 				}).catch(error =>{
-					this.$util.msg(error.msg,2000);
+					this.$util.msg(error.msg,2000)
 					this.btnText(false)
 				})
 			},
 			btnText(flg){
 				if(flg){
-					this.isConfirm = true;
+					this.isConfirm = true
 					this.buttonText = '保存中...'
 				}else{
-					this.isConfirm = false;
+					this.isConfirm = false
 					this.buttonText = '保存'
 				}
 			},
 			onShouHuoRen(e){
-			   this.addressData.receiver = e.detail.value;
-			   this.initInput();
+			   this.addressData.receiver = e.detail.value
+			   this.initInput()
 			},
 			onMobile(e){
-			   this.addressData.mobile = e.detail.value;
-			   this.initInput();
+			   this.addressData.mobile = e.detail.value
+			   this.initInput()
 			},
 			onTextareaInput(e){
-			   this.addressData.address = e.detail.value;
-			   this.initInput();
+			   this.addressData.address = e.detail.value
+			   this.initInput()
 			},
 			initInput(){
-				if(this.addressData.receiver !== "" && this.addressData.mobile !=="" && this.addressData.address !=="" && this.addressData.townId!==""){
-					this.isConfirm =false;
+				if(this.addressData.receiver !== '' && this.addressData.mobile !=='' && this.addressData.address !=='' && this.addressData.townId!==''){
+					this.isConfirm =false
 				}else{
-					this.isConfirm =true;
+					this.isConfirm =true
 				}
 			}
 		},
 		onShow() {
 			this.$api.getComStorage('orderUserInfo').then((resolve) =>{
 				this.addressData.userId = resolve.userID ? resolve.userID : 0
+				console.log('userID',this.addressData.userId)
 			})
 		}
 	}

+ 1 - 1
pages/seller/cart/cart.vue

@@ -18,7 +18,7 @@
 								<view v-if="item.promotions" class="floor-item-act">
 									<view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>	
 								</view>
-								<view class="text">{{item.name}}</view> 
+								<view class="text">{{item.shopName}}</view> 
 							</view>
 							<view class="productlist">
 								<view 	class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx">

+ 97 - 50
pages/seller/order/create-order.vue

@@ -1,7 +1,5 @@
 <template>
 	<view class="container order clearfix" :style="{paddingBottom :isIphoneX ? '170rpx' : '134rpx'}">
-		<!-- 透明模态层 -->
-		<modal-layer v-if='modallayer'></modal-layer>
 		<!-- 地址选择 -->
 		<choice-address ref="choiceAddress" v-if="isAddress" :addressData="addressData"></choice-address>
 		<!-- 商品 -->
@@ -83,7 +81,7 @@
 				</view>
 			</view>
 			<view class="footer-submit" @click.stop="orderSubmitMit">
-				<view class="btn">提交订单</view>
+				<view class="btn" :class="isSubLoading ? 'disabled' : ''">提交订单</view>
 			</view>
 		</view>
 		<!-- 优惠券 -->
@@ -119,6 +117,19 @@
 				</view>
 			</view>
 		</view>
+		<!-- 弹窗提示 -->
+		<tui-modal
+			:show="modal"
+			@click="handleClick"
+			@cancel="hideMobel"
+			:content="contentModalText"
+			:button="modalButton"
+			color="#333"
+			:size="32"
+			shape="circle"
+			:maskClosable="false"
+		>
+		</tui-modal>
 	</view>
 </template>
 
@@ -131,24 +142,23 @@
 	import sellerCoupon from '@/components/cm-module/creatOrder/sellerCoupon'
 	import sellerExchangeCoupon from '@/components/cm-module/creatOrder/sellerExchangeCoupon'
 	import sellerRegulations from '@/components/cm-module/creatOrder/sellerRegulations.vue'
-	import modalLayer from "@/components/modal-layer"
 	
 	const defaultProductParam = {
 			productCount:0, 	// 商品数量
 			productId:0,		// 商品Id
 			serviceProviderId:0,// 协销Id
 			clubId:0			// 机构Id
-		};
+		}
 	const defaultCartParam = {
 			productIds:0,		// 商品Id(逗号隔开)
 			serviceProviderId:0,// 协销Id
 			clubId:0			// 机构Id
-		};
+		}
 	const defaultPostageParam = {
 			productIds:0,		// 商品Id(逗号隔开)
 			userId:0,			// 用户Id
 			townId:0			// 地区Id
-		};
+		}
 	const defaultConfirmParam = {
 			cartType:3, 		// 购买类型:(1自主下单, 3协销下单)
 			orderSource:6,		// 订单来源 1WWW 6小程序[采美,星范]
@@ -167,7 +177,7 @@
 				rebateFlag:0			// 是否返佣订单
 			},
 			unionId:uni.getStorageSync('unionId'),// 用户unionId
-		};
+		}
 	export default {
 		components:{
 			choiceAddress,
@@ -177,12 +187,28 @@
 			sellerCoupon,
 			sellerExchangeCoupon,
 			freightAlert,
-			modalLayer,
 			sellerRegulations
 		},
 		data() {
 			return {
-				modallayer:false,
+				isSubLoading:false,
+				modalButton: [
+					{
+						text: '再想一想',
+						type: 'gray',
+						plain: true //是否空心
+					},
+					{
+						text: '继续提交',
+						customStyle: {
+							color: '#fff',
+							bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
+						},
+						plain: false
+					}
+				],
+				contentModalText: '', //操作文字提示语句
+				modal: false,
 				isIphoneX:this.$store.state.isIphoneX,
 				cartParam: Object.assign({}, defaultCartParam), 		// 购物车立即结算确认订单参数
 				productParam: Object.assign({}, defaultProductParam), 	// 二手商品立即购买确认订单参数
@@ -231,7 +257,7 @@
 		},
 		filters:{
 			NumFormat(value) {//处理金额
-				return Number(value).toFixed(2);
+				return Number(value).toFixed(2)
 			},
 		},
 		methods: {
@@ -287,7 +313,7 @@
 				})
 			},
 			getInitProdcutCrearOrder(){//二手下单初始化查询
-				this.seconDepositFlg = false;
+				this.seconDepositFlg = false
 				this.SellerService.GetSettlementBySencondProduct(this.productParam).then(response =>{
 					const data = response.data
 					this.isRequest = true
@@ -329,17 +355,17 @@
 					this.isAddress = true
 					this.addressData = {}
 					if(response.data.results != ''){
-						this.confirmParam.addressId = data.list[0].addressId;
-						this.postageParam.townId = data.list[0].townId;
-						this.addressData = data.list[0];
+						this.confirmParam.addressId = data.list[0].addressId
+						this.postageParam.townId = data.list[0].townId
+						this.addressData = data.list[0]
 						this.getFreightData()
 					}else{
-						this.addressData = this.addressData;
+						this.addressData = this.addressData
 					}
 				})
 			},
 			handChangeInputGoodsList(data){//对应供应商的留言信息
-				this.goodsData = data;
+				this.goodsData = data
 			},
 			handleChoiceaInvoiceData(data){//获取发票信息
 				this.confirmParam.orderInvoice = data
@@ -356,12 +382,12 @@
 				}
 			},
 			handleClauseData(clauseId){// 条款Id
-				this.confirmParam.payInfo.clauseId = parseInt(clauseId);
+				this.confirmParam.payInfo.clauseId = parseInt(clauseId)
 			},
 			handleChoiceaCouponData(data){// 勾选使用优惠券
 				console.log('优惠券信息',data)
 				this.couponAmount = data.couponAmount
-				this.totalDiscountAmount = this.reducedPrice + this.couponAmount;
+				this.totalDiscountAmount = this.reducedPrice + this.couponAmount
 				this.clubCouponId = data.clubCouponId
 				this.attributePallPrice()
 			},
@@ -405,7 +431,7 @@
 						this.surplusMoney = this.userMoney - this.deductMoney	    // 勾选后的剩余抵扣
 					}
 				}else{
-					this.orderShouldPayFee = this.allPrice  - this.couponAmount;
+					this.orderShouldPayFee = this.allPrice  - this.couponAmount
 					this.deductMoney = 0.00
 					this.surplusMoney = this.userMoney
 				}
@@ -433,12 +459,25 @@
 				console.log('优惠券金额',this.couponAmount)
 			},
 			orderSubmitMit(){//提交订单
+				this.modal = true
+				this.contentModalText = '请仔细确认订单是否为返佣订单后再提交订单'
+			},
+			handleClick(e){
+				//确认提交
+				if (e.index == 1) {
+					this.SellerCreateOrderSubmit()
+				}
+				this.modal = false
+			},
+			SellerCreateOrderSubmit(){
+				//提交订单
+				if(this.isSubLoading){ return }
 				if(this.confirmParam.addressId == ''){
 					this.$util.msg('请先添加收货地址~',2000)
 					return
 				}
 				this.confirmParam.orderInfo = this.goodsData.map(el => {
-					let productInfo = [];
+					let productInfo = []
 					el.cartList.forEach(item => {
 						productInfo.push({
 							productId:item.productId,
@@ -456,53 +495,57 @@
 				this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
 				this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
 				console.log(this.confirmParam)
-				this.modalLayer = true;	
-				this.$util.modal('','请仔细确认订单是否为返佣订单后再提交订单','继续提交','再想一想',true,() =>{
-					this.SellerService.SellerCreateOrderSubmit(this.confirmParam).then(response =>{
-						const data = response.data;
-						if(data.code === 1){
-							this.$util.msg('支付成功',2000,true,'success')
-							setTimeout(() =>{
-								this.$api.redirectTo(`/pages/seller/order/order-details?type=cash&orderId=${data.orderId}&userId=${this.postageParam.userId}`)
-							},2000)
-						}else{
-							this.$util.msg('订单提交成功',2000,true,'success')
-							setTimeout(()=>{
-								this.$api.redirectTo(`/pages/seller/order/order-details?type=cash&orderId=${data.orderId}&userId=${this.postageParam.userId}`)
-							},2000)
-						}
-					}).catch(error =>{
-						this.$util.msg(error.msg,2000);
-					})
+				this.isSubLoading = true	
+				this.SellerService.SellerCreateOrderSubmit(this.confirmParam).then(response =>{
+					const data = response.data
+					if(data.code === 1){
+						this.$util.msg('支付成功',2000,true,'success')
+						setTimeout(() =>{
+							this.isSubLoading = false
+							this.$api.redirectTo(`/pages/seller/order/order-details?type=cash&orderId=${data.orderId}&userId=${this.postageParam.userId}`)
+						},2000)
+					}else{
+						this.$util.msg('订单提交成功',2000,true,'success')
+						setTimeout(()=>{
+							this.isSubLoading = false
+							this.$api.redirectTo(`/pages/seller/order/order-details?type=cash&orderId=${data.orderId}&userId=${this.postageParam.userId}`)
+						},2000)
+					}
+				}).catch(error =>{
+					this.isSubLoading = false
+					this.$util.msg(error.msg,2000)
 				})
 			},
 			RebateChang(){//  返佣订单勾选
-				this.rebatecheck = !this.rebatecheck;
+				this.rebatecheck = !this.rebatecheck
 				if(this.rebatecheck){
-					this.confirmParam.payInfo.rebateFlag=1;
+					this.confirmParam.payInfo.rebateFlag=1
 				}else{
-					this.confirmParam.payInfo.rebateFlag=0;
+					this.confirmParam.payInfo.rebateFlag=0
 				}
 				console.log(this.confirmParam.payInfo.rebateFlag)
 			},
 			handFreightAlertShow(){//显示邮费弹窗
-				this.isfreightTip = true;
+				this.isfreightTip = true
 			},
 			handleClickCancel(){// 关闭优惠券弹窗
-				this.isCouponModel = false;
-				this.getInitCrearOrder();
+				this.isCouponModel = false
+				this.getInitCrearOrder()
 			},
 			hideFreight(){//关闭邮费弹窗
-				this.isfreightTip = false;
+				this.isfreightTip = false
+			},
+			hideMobel() {
+				this.modal = false
 			},
 		},
 		onShow() {
-			let pages = getCurrentPages();
-			let currPage = pages[pages.length-1];
+			let pages = getCurrentPages()
+			let currPage = pages[pages.length-1]
 			if(currPage.data.select =='select'){
 				this.isAddress = true
-				let SelectData = uni.getStorageSync('selectAddress');
-				this.confirmParam.addressId = SelectData.addressId;
+				let SelectData = uni.getStorageSync('selectAddress')
+				this.confirmParam.addressId = SelectData.addressId
 				this.postageParam.townId = SelectData.townId 
 				this.addressData = SelectData
 				this.getFreightData()
@@ -707,6 +750,10 @@
 				text-align: center;
 				line-height: 80rpx;
 				border-radius: 40rpx;
+				&.disabled{
+					background: #e4e8eb;
+					color: #999999;
+				}
 			}
 		}
 	}

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

@@ -488,7 +488,7 @@ export default {
 			switch (data.type) {
 				case 'query':
 					this.isModalLayer = true
-					this.$api.navigateTo('/pages/user/order/order-logistics?orderId=' + data.orderId)
+					this.$api.navigateTo('/pages/user/order/order-logistics?orderId='+ data.orderId)
 					break
 				case 'delete':
 					this.handOrderDetele(data.orderId)

+ 2 - 1
pages/seller/order/order-list.vue

@@ -502,10 +502,11 @@ export default {
 		},
 		handShowAlert(data) {
 			//执行
+			console.log(data)
 			switch (data.type) {
 				case 'query':
 					this.isModalLayer = true
-					this.$api.navigateTo('/pages/user/order/order-logistics?orderId=' + data.orderId)
+					this.$api.navigateTo('/pages/user/order/order-logistics?orderId='+ data.orderId)
 					break
 				case 'delete':
 					this.handOrderDetele(data.orderId)

+ 24 - 24
pages/user/order/create-order.vue

@@ -120,17 +120,17 @@
 			productId:0,		// 商品Id
 			source:2,			// 来源:1WWW 2小程序
 			userId:0			// 用户Id
-		};
+		}
 	const defaultCartParam = {
 			productIds:0,		// 商品Id(逗号隔开)
 			source:2,			// 来源:1WWW 2小程序
 			userId:0			// 用户Id
-		};
+		}
 	const defaultPostageParam = {
 			productIds:0,		// 商品Id(逗号隔开)
 			userId:0,			// 用户Id
 			townId:0			// 地区Id
-		};
+		}
 	const defaultConfirmParam = {
 			cartType:1, 		// 购买类型:(1自主下单, 3协销下单)
 			orderSource:6,		// 订单来源 1WWW 6小程序[采美,星范]
@@ -149,7 +149,7 @@
 				rebateFlag:0			// 是否返佣订单
 			},
 			unionId:uni.getStorageSync('unionId'),// 用户unionId
-		};
+		}
 	export default {
 		components:{
 			choiceAddress,
@@ -220,12 +220,13 @@
 				this.confirmParam.clubId = userInfo.clubId ? userInfo.clubId : 0
 				console.log('userInfo',this.productParam.userId)
 				if(option.type =='prodcut'){
-					this.confirmType = 1
+					this.confirmParam.cartType = 2 
 					this.productParam.productCount = data.data.productCount
 					this.productParam.productId = data.data.productIds
 					this.productIds = this.postageParam.productIds = data.data.productIds
 					this.GetProductCreateOrderInfo()
 				}else{
+					this.confirmParam.cartType = 1
 					this.confirmType = 2
 					this.productIds = this.cartParam.productIds = this.postageParam.productIds = data.data.productIds
 					this.CartCreateOrderInfo()
@@ -320,9 +321,9 @@
 					this.isAddress = true
 					this.addressData = {}
 					if( data.list && data.list.length > 0 ){
-						this.confirmParam.addressId = data.list[0].addressId;
-						this.postageParam.townId = data.list[0].townId;
-						this.addressData = data.list[0];
+						this.confirmParam.addressId = data.list[0].addressId
+						this.postageParam.townId = data.list[0].townId
+						this.addressData = data.list[0]
 						this.getFreightData()
 					}else{
 						this.addressData = this.addressData
@@ -395,7 +396,7 @@
 			handleChoiceaCouponData(data){// 勾选使用优惠券
 				console.log('优惠券信息',data)
 				this.couponAmount = data.couponAmount
-				this.totalDiscountAmount = this.reducedPrice + this.couponAmount;
+				this.totalDiscountAmount = this.reducedPrice + this.couponAmount
 				this.confirmParam.clubCouponId = data.clubCouponId
 				this.attributePallPrice()
 				this.hanldFreightBeans(this.isCheckedBeans)
@@ -444,9 +445,9 @@
 						this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余余额等于总余额-当前使用金额
 					}
 				}else{
-					this.orderShouldPayFee = this.allPrice - this.couponAmount;
-					this.deductMoney = 0.00; // 当前使用
-					this.surplusMoney = this.userMoney; // 剩余余额
+					this.orderShouldPayFee = this.allPrice - this.couponAmount
+					this.deductMoney = 0.00 // 当前使用
+					this.surplusMoney = this.userMoney // 剩余余额
 				}
 				console.log('最终订单支付金额',this.orderShouldPayFee)
 				console.log('优惠券金额',this.couponAmount)
@@ -484,13 +485,13 @@
 				console.log('优惠券金额',this.couponAmount)
 			},
 			orderSubmitMit(){// 提交订单
-				if(this.isSubLoading){ return; }
+				if(this.isSubLoading){ return }
 				if(this.confirmParam.addressId == ''){
 					this.$util.msg('请先添加收货地址~',2000)
 					return
 				}
 				this.confirmParam.orderInfo = this.goodsData.map(el => {
-					let productInfo = [];
+					let productInfo = []
 					el.cartList.forEach(item => {
 						productInfo.push({
 							productId:item.productId,
@@ -508,9 +509,9 @@
 				this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
 				this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
 				console.log(this.confirmParam)
-				this.isSubLoading = true;	
+				this.isSubLoading = true	
 				this.OrderService.CreatedOrderSubmit(this.confirmParam).then(response =>{
-					let data = response.data;
+					let data = response.data
 					// 友盟埋点收集机构自主提交订单
 					if(process.env.NODE_ENV != 'development'){
 						this.$uma.trackEvent('Um_Event_ConfirmOrder', {
@@ -531,12 +532,11 @@
 						this.$util.msg('订单提交成功',3000,true,'success')
 						setTimeout(()=>{
 							this.isSubLoading = false
-						},2000)
-						setTimeout(()=>{
 							this.$api.redirectTo(`/pages/user/order/order-payment?type=${this.submitState}&orderId=${data.orderId}`)
 						},3000)
 					}
 				}).catch(error =>{
+					this.isSubLoading = false
 					this.$util.msg(error.msg,3000)
 				})
 			},
@@ -544,11 +544,11 @@
 				this.isfreightTip = true
 			},
 			handleClickCancel(){// 关闭优惠券弹窗
-				this.isCouponModel = false;
+				this.isCouponModel = false
 				if(this.confirmType == 1){
 					this.GetProductCreateOrderInfo()
 				}else{
-					this.CartCreateOrderInfo();
+					this.CartCreateOrderInfo()
 				}
 			},
 			hideFreight(){//关闭邮费弹窗
@@ -556,12 +556,12 @@
 			},
 		},
 		onShow() {
-			let pages = getCurrentPages();
-			let currPage = pages[pages.length-1];
+			let pages = getCurrentPages()
+			let currPage = pages[pages.length-1]
 			if(currPage.data.select =='select'){
 				this.isAddress = true
-				let SelectData = uni.getStorageSync('selectAddress');
-				this.confirmParam.addressId = SelectData.addressId;
+				let SelectData = uni.getStorageSync('selectAddress')
+				this.confirmParam.addressId = SelectData.addressId
 				this.postageParam.townId = SelectData.townId 
 				this.addressData = SelectData
 				this.getFreightData()

+ 5 - 6
services/ajax.env.js

@@ -1,15 +1,14 @@
 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.81:8008'
+    // URL_CONFIG = 'http://192.168.2.67:8008'	 //智捷联调地址
+    // URL_CONFIG = 'http://192.168.2.68: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{ 
     // 生产环境
-    // URL_CONFIG = 'https://spi-b.caimei365.com'
-    URL_CONFIG = 'https://spi.caimei365.com'
+    URL_CONFIG = 'https://spi-b.caimei365.com'
+    // URL_CONFIG = 'https://spi.caimei365.com'
 }
 export default URL_CONFIG

+ 2 - 2
services/config.env.js

@@ -7,7 +7,7 @@ if(process.env.NODE_ENV === 'development'){
     // URL_CONFIG = 'https://core.caimei365.com'
 }else{
     // 生产环境
-    // URL_CONFIG = 'https://core-b.caimei365.com'
-    URL_CONFIG = 'https://core.caimei365.com'
+    URL_CONFIG = 'https://core-b.caimei365.com'
+    // URL_CONFIG = 'https://core.caimei365.com'
 }
 export default URL_CONFIG