Ver código fonte

commit -m 订单接口联调

zhengjinyi 3 anos atrás
pai
commit
4a1d2e71eb

+ 1 - 1
components/cm-module/creatOrder/choiceAddress.vue

@@ -8,7 +8,7 @@
 		 	<view class="address-content" v-else>
 		 		<view class="address-cen">
 		 			<view class="top">
-		 				<view class="name">{{addressData.shouHuoRen !== undefined ? addressData.shouHuoRen : ''}}</view>
+		 				<view class="name">{{addressData.receiver !== undefined ? addressData.receiver : ''}}</view>
 		 				<view class="mobile">{{addressData.mobile !== undefined ? addressData.mobile : ''}}</view>
 		 			</view>
 		 			<view class="address">

+ 15 - 15
components/cm-module/creatOrder/freight.vue

@@ -3,18 +3,18 @@
 		 <!-- 运费信息 -->
 		<view class="invoice-freight">
 			<view class="freight-main">
-				<view class="freight-left">运费<text class="tips" v-if="freightData.freePostFlag == 1">运费可选择到付哟~</text></view>
+				<view class="freight-left">运费<text class="tips" v-if="freightData.postageFlag == 1">运费可选择到付哟~</text></view>
 				<view class="freight-right" >
 					<view class="freight-text">{{freightText}}</view>
-					<view class="select" v-if="freightData.freePostFlag == 1"  @click.stop="selectFreight">
+					<view class="select" v-if="freightData.postageFlag == 1"  @click.stop="selectFreight">
 						<text class="select-text">{{orderPriceToFixed(freightMoney)}}</text>
 						<text class="iconfont icon-xiayibu"></text>
 					</view>
 				</view>
 			</view>
 			<view class="freight-bean" v-if="isBeansShow">
-				<view class="bean-le" v-if="freePostFlag == 1">可用{{ deductionBeans }}采美豆抵用{{ freightMoney }}元运费</view>
-				<view class="bean-le" v-if="freePostFlag == -1">可用{{ deductionBeans }}采美豆抵用{{ freightMoney }}运费</view>
+				<view class="bean-le" v-if="postageFlag == 1">可用{{ deductionBeans }}采美豆抵用{{ freightMoney }}元运费</view>
+				<view class="bean-le" v-if="postageFlag == -1">可用{{ deductionBeans }}采美豆抵用{{ freightMoney }}运费</view>
 				<view class="bean-ri">
 					<view class="checkbox-box">
 						<button class="checkbox iconfont"
@@ -40,12 +40,12 @@
 		},
 		data() {
 			return{
-				infoData:'',
+				infoData:{},
 				freightText:'',
 				freightMoney:'',
 				isShowOption:false,
 				optionList:['到付'],
-				freePostFlag:'',
+				postageFlag:0,
 				ischecked:false,
 				isBeansShow:false,
 				userBeans:0,
@@ -63,18 +63,18 @@
 		methods:{
 			initData(res) {
 				this.infoData = res;
-				switch(res.freePostFlag){
+				switch(res.postageFlag){
 					case 0:
 						this.freightText = '包邮'
 						this.freightData.freight  = 0
-						this.freePostFlag = res.freePostFlag
+						this.postageFlag = res.postageFlag
 						this.isBeansShow = false
 						break
 					case 1:
 						this.freightText = ''
-						this.freightMoney = this.freightBeansMoney =  res.freight
+						this.freightMoney = this.freightBeansMoney =  res.postage
 						this.userBeans = res.userBeans
-						this.freePostFlag = res.freePostFlag
+						this.postageFlag = res.postageFlag
 						this.optionList.unshift(this.orderPriceToFixed(this.freightMoney))
 						if( res.userBeans > 0 ){
 							this.isBeansShow = true
@@ -91,7 +91,7 @@
 						this.freightText = '到付'
 						this.freightMoney = '到付'
 						this.userBeans = res.userBeans
-						this.freePostFlag = res.freePostFlag
+						this.postageFlag = res.postageFlag
 						this.freightData.freight  = 0
 						this.freightBeansMoney = 30
 						if( res.userBeans >0 ){
@@ -114,8 +114,8 @@
 				    success: function (res) {
 						switch(res.tapIndex){
 							case 0:
-								self.freightMoney = self.infoData.freight
-								self.freePostFlag = 1
+								self.freightMoney = self.infoData.postage
+								self.postageFlag = 1
 								if( self.userBeans > 0 ){
 									self.isBeansShow = true
 									self.freightBeansMoney = self.freightMoney
@@ -130,7 +130,7 @@
 								}
 								break
 							case 1:
-								self.freePostFlag = -1
+								self.postageFlag = -1
 								self.freightMoney = '到付'
 								if( self.userBeans > 0 ){
 									self.freightBeansMoney = 30
@@ -147,7 +147,7 @@
 								break
 						}
 						let obj = {
-								freePostFlag :self.freePostFlag,
+								postageFlag :self.postageFlag,
 								freightBeansMoney: self.freightBeansMoney
 							}
 						self.$emit('confirmFreight',obj);

+ 105 - 101
pages/user/order/create-order.vue

@@ -57,11 +57,11 @@
 		<view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
 			<view class="footer-le">
 				<view class="footer-count">
-					<text>共{{allCount}}件商品</text>
+					<text>共{{ totalCount }}件商品</text>
 				</view>
 				<view class="footer-price">
 					<view class="sum" :class="totalDiscountAmount == 0 ? 'none' : ''">
-						总价:<text class="price">¥{{payAllPrice | NumFormat}}</text>
+						总价:<text class="price">¥{{ orderShouldPayFee | NumFormat }}</text>
 					</view>
 					<view class="sum-none" v-if="totalDiscountAmount > 0">
 						<text class="money-reduced">共减<text>¥{{ totalDiscountAmount  | NumFormat}}</text></text>
@@ -116,20 +116,39 @@
 	import freight from '@/components/cm-module/creatOrder/freight'
 	import freightAlert from '@/components/cm-module/modelAlert/freightAlert'
 	const defaultProductParam = {
-			productCount:0,
-			productId:0,
-			source:2,
-			userId:0
+			productCount:0, 	// 商品数量
+			productId:0,		// 商品Id
+			source:2,			// 来源:1WWW 2小程序
+			userId:0			// 用户Id
 		};
 	const defaultCartParam = {
-			productIds:0,
-			source:2,
-			userId:0
+			productIds:0,		// 商品Id(逗号隔开)
+			source:2,			// 来源:1WWW 2小程序
+			userId:0			// 用户Id
 		};
 	const defaultPostageParam = {
-			productIds:0,
-			userId:0,
-			townId:0
+			productIds:0,		// 商品Id(逗号隔开)
+			userId:0,			// 用户Id
+			townId:0			// 地区Id
+		};
+	const defaultConfirmParam = {
+			cartType:1, 		// 购买类型:(1自主下单, 3协销下单)
+			orderSource:6,		// 订单来源 1WWW 6小程序[采美,星范]
+			addressId:0,		// 收货地址Id
+			clubCouponId:0,		// 关联优惠券Id
+			clubId:0,			// 机构Id
+			orderInfo:[],		// 订单商品数据
+			orderInvoice:{type:0},	// 订单发票信息
+			payInfo:{			// 订单金额数据
+				orderShouldPayFee: 0,	// 订单最终支付金额
+				balancePayFlag: 0,		// 勾选余额的状态(1使用,0不使用)
+				clauseId:0,				// 条款Id
+				postage: 0,				// 运费金额
+				postageFlag: 0,			// 运费类型
+				userBeans: 0,			// 抵扣采美豆数量
+				rebateFlag:0			// 是否返佣订单
+			},
+			unionId:uni.getStorageSync('unionId'),// 用户unionId
 		};
 	export default {
 		components:{
@@ -147,24 +166,21 @@
 				isSubLoading:false,
 				confirmType:1,
 				orderID:0,
-				cartParam: Object.assign({}, defaultCartParam), 				 // 购物车立即结算确认订单参数
-				productParam: Object.assign({}, defaultProductParam), 			 // 商品立即购买确认订单参数
-				postageParam: Object.assign({}, defaultPostageParam),			 // 邮费计算参数
+				cartParam: Object.assign({}, defaultCartParam), 		// 购物车立即结算确认订单参数
+				productParam: Object.assign({}, defaultProductParam), 	// 商品立即购买确认订单参数
+				postageParam: Object.assign({}, defaultPostageParam),	// 邮费计算参数
+				confirmParam: Object.assign({}, defaultConfirmParam), 	// 提交订单参数
 				productIds:'',			  // 获取上一级页面商品信息
-				classifyIDS:'',			  // 获取上一级页面商品分类
-				clubId:'',				  // 用户ID
 				submitState:'',  		  // 提交状态
-				balanceDeductionFlag:2,   // 勾选余额的状态(1使用,2不使用)
-				allCount:1,				  // 订单提交总数量
+				totalCount:1,			  // 订单提交总数量
 				reducedPrice:0,			  // 满减金额
 				couponAmount:0,	  		  // 优惠券金额
 				totalDiscountAmount:0,	  // 共减金额
-				payAllPrice:0.00,		  // 订单提交总金额
 				allPrice:0.00,			  // 订单总金额
+				orderShouldPayFee:0,	  // 订单最终支付金额
 				surplusMoney:0.00,		  // 显示勾选后的剩余抵扣
 				userMoney:0.00,			  // 显示可使用余额
 				deductMoney:0.00,		  // 显示已使用的余额
-				addressId:'',			  // 地址ID
 				isRequest:false,		  // 是否加载完成渲染子组件
 				isFreight:false,		  // 是否加载完成渲染子组件
 				isAddress:false,		  // 是否加载完成地址
@@ -179,11 +195,8 @@
 				invoiceData:{type:0},	  // 初始化发票信息
 				freightData:{},			  // 邮费数据
 				orderInfo:[],			  // 提交的商品信息
-				payInfo:{},				  // 订单信息
-				clubCouponId:0,			  // 用户关联优惠Id
 				rechargeGoods:null,		  // 判断订单里有定金商品或者充值商品时,余额抵扣部分不显示
 				freightBeansMoney:0,	  // 存储采美豆抵扣金额
-				hanldUserBeans:0,		  // 抵扣的采美豆数	
 				isCouponShow:false,		  // 是否显示可选优惠券
 				isCheckedBeans:false,     // 是否抵扣采美豆
 				isCouponModel:false,	  // 兑换优惠券成功提示
@@ -195,7 +208,7 @@
 			console.log('infodata',data)
 			this.$api.getStorage().then((resolve) =>{
 				this.productParam.userId = this.cartParam.userId = this.postageParam.userId = resolve.userId ? resolve.userId : 0
-				this.clubId = resolve.clubId ? resolve.clubId : 0
+				this.confirmParam.clubId = resolve.clubId ? resolve.clubId : 0
 				if(option.type =='prodcut'){
 					this.confirmType = 1
 					this.productParam.productCount = data.data.productCount
@@ -224,14 +237,15 @@
 					this.couponList = data.couponList
 					this.userMoney = data.userMoney
 					this.reducedPrice = data.reducedPrice
+					this.totalCount = data.totalCount
 					this.allPrice = data.totalPrice
 					this.rechargeGoods = data.rechargeGoods
 					if(this.couponList.length>0){
 						this.isCouponShow = true
 						this.couponAmount = data.couponList[0].couponAmount
-						this.clubCouponId = data.couponList[0].clubCouponId 
-						this.payAllPrice = this.allPrice - this.couponAmount
+						this.confirmParam.clubCouponId = data.couponList[0].clubCouponId 
 					}
+					this.orderShouldPayFee = this.allPrice - this.couponAmount
 					this.totalDiscountAmount = this.reducedPrice + this.couponAmount
 				})
 				.catch(error =>{
@@ -246,14 +260,15 @@
 					this.couponList = data.couponList
 					this.userMoney = data.userMoney
 					this.reducedPrice = data.reducedPrice
+					this.totalCount = data.totalCount
 					this.allPrice = data.totalPrice
 					this.rechargeGoods = data.rechargeGoods
 					if(this.couponList.length>0){
 						this.isCouponShow = true
 						this.couponAmount = data.couponList[0].couponAmount
-						this.clubCouponId = data.couponList[0].clubCouponId 
-						this.payAllPrice = this.allPrice - this.couponAmount
+						this.confirmParam.clubCouponId = data.couponList[0].clubCouponId 
 					}
+					this.orderShouldPayFee = this.allPrice - this.couponAmount
 					this.totalDiscountAmount = this.reducedPrice + this.couponAmount
 				})
 				.catch(error =>{
@@ -263,18 +278,19 @@
 			getFreightData(){// 获取邮费信息
 				this.isFreight = false
 				this.OrderService.GetOrderPostage(this.postageParam).then(response =>{
+					const data = response.data
 					this.isFreight = true
 					this.isCheckedBeans = false
-					this.freightData = response.data
-					this.hanldFreePostFlag = response.data.postageFlag
-					this.hanldFreight = response.data.freight
+					this.freightData = data
+					this.hanldFreePostFlag = data.postageFlag
+					this.hanldFreight = data.postage
 					if(this.hanldFreePostFlag == 1){
 						if( this.freightData.userBeans > 0 ){
 							this.freightBeansMoney = this.hanldFreight
 						}else{
 							this.freightBeansMoney = 0
 						}
-						this.payAllPrice = this.allPrice + response.data.freight
+						this.orderShouldPayFee = this.allPrice + data.postage
 						this.attributePallPrice()
 						this.hanldFreightBeans(this.isCheckedBeans)
 					}else{
@@ -283,7 +299,7 @@
 						}else{
 							this.freightBeansMoney = 0
 						}
-						this.payAllPrice = this.allPrice
+						this.orderShouldPayFee = this.allPrice
 						this.attributePallPrice()
 						this.hanldFreightBeans(this.isCheckedBeans)
 					}
@@ -296,7 +312,7 @@
 						this.isAddress = true
 						this.addressData = {}
 						if( data.list && data.list.length > 0 ){
-							this.addressId = data.list[0].addressId;
+							this.confirmParam.addressId = data.list[0].addressId;
 							this.postageParam.townId = data.list[0].townId;
 							this.addressData = data.list[0];
 							this.getFreightData()
@@ -310,24 +326,24 @@
 				this.goodsData = data;
 			},
 			handleChoiceaInvoiceData(data){//获取发票信息
-				this.invoiceData = data
+				this.confirmParam.orderInvoice = data
 			},
 			hanldFreightFn(data){//显示邮费弹窗
-				console.log(data)
-				switch(data.freePostFlag){
+				console.log('邮费信息',data)
+				switch(data.postageFlag){
 					case 1:
-						this.hanldFreight = this.freightData.freight
-						this.hanldFreePostFlag = data.freePostFlag
+						this.hanldFreight = this.freightData.postage
+						this.hanldFreePostFlag = data.postageFlag
 						this.freightBeansMoney = data.freightBeansMoney
-						this.payAllPrice =this.allPrice + this.hanldFreight
+						this.orderShouldPayFee =this.allPrice + this.hanldFreight
 						this.attributePallPrice()
 						this.hanldFreightBeans(this.isCheckedBeans)
 						break
 					case -1:
 						this.hanldFreight = 0
-						this.hanldFreePostFlag = data.freePostFlag
+						this.hanldFreePostFlag = data.postageFlag
 						this.freightBeansMoney = data.freightBeansMoney
-						this.payAllPrice = this.allPrice
+						this.orderShouldPayFee = this.allPrice
 						this.attributePallPrice()
 						this.hanldFreightBeans(this.isCheckedBeans)
 						break
@@ -338,9 +354,9 @@
 				if(this.isCheckedBeans){
 					// 判断如果采美豆大于等于运费*100
 					if( this.freightData.userBeans > 0 ){
-						this.hanldUserBeans = this.freightBeansMoney*100
+						this.confirmParam.payInfo.userBeans = this.freightBeansMoney*100
 					}else{
-						this.hanldUserBeans = 0
+						this.confirmParam.payInfo.userBeans = 0
 					}
 					// 计算抵扣后的总价
 					if(this.hanldFreePostFlag == 1){	
@@ -348,21 +364,21 @@
 						if(this.ischecked){
 							let totalAmount = this.allPrice - this.couponAmount
 							if(this.userMoney >= totalAmount){
-								this.payAllPrice = 0.00
+								this.orderShouldPayFee = 0.00
 								this.deductMoney = this.allPrice - this.couponAmount		// 当前使用金额等于订单金额
 								this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余金额等于余额-当前使用金额
 							}else{
-								this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
+								this.orderShouldPayFee = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
 								this.deductMoney = this.userMoney				            // 当前使用金额等于总余额
 								this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余余额等于总余额-当前使用金额
 							}
 						}else{
-							this.payAllPrice = this.allPrice + this.hanldFreight - this.freightBeansMoney - this.couponAmount
+							this.orderShouldPayFee = this.allPrice + this.hanldFreight - this.freightBeansMoney - this.couponAmount
 						}
-						console.log('抵扣',this.payAllPrice)
+						console.log('抵扣',this.orderShouldPayFee)
 					}
 				}else{// 采美豆不抵扣运费
-					this.hanldUserBeans = 0
+					this.confirmParam.payInfo.userBeans = 0
 					// 不抵扣时计算总价
 					if(this.hanldFreePostFlag == 1){
 						this.attributeHashfreight(this.hanldFreight)
@@ -373,7 +389,7 @@
 				console.log('优惠券信息',data)
 				this.couponAmount = data.couponAmount
 				this.totalDiscountAmount = this.reducedPrice + this.couponAmount;
-				this.clubCouponId = data.clubCouponId
+				this.confirmParam.clubCouponId = data.clubCouponId
 				this.attributePallPrice()
 				this.hanldFreightBeans(this.isCheckedBeans)
 			},
@@ -381,21 +397,21 @@
 				if(this.userMoney > 0){
 					this.ischecked = !this.ischecked
 					if(this.ischecked){
-						this.balanceDeductionFlag =1
+						this.confirmParam.payInfo.balancePayFlag = 1
 						this.attributePallPrice()
 					}else{
 						if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){ //如果是有运费时
 							if(this.isCheckedBeans){
-								this.payAllPrice =  this.allPrice - this.couponAmount
+								this.orderShouldPayFee =  this.allPrice - this.couponAmount
 							}else{
-								this.payAllPrice = this.allPrice+parseInt(this.freightData.freight) - this.couponAmount
+								this.orderShouldPayFee = this.allPrice+parseInt(this.freightData.postage) - this.couponAmount
 							}
 						}else{
-							this.payAllPrice = this.allPrice - this.couponAmount
+							this.orderShouldPayFee = this.allPrice - this.couponAmount
 						}
-						this.balanceDeductionFlag = 2
+						this.confirmParam.payInfo.balancePayFlag = 0
 					}
-					console.log('最终订单支付金额',this.payAllPrice)
+					console.log('最终订单支付金额',this.orderShouldPayFee)
 					console.log('优惠券金额',this.couponAmount)
 				}else{
 					return
@@ -403,7 +419,7 @@
 			},
 			attributePallPrice(){// 计算价格
 				if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){
-					this.attributeHashfreight(this.freightData.freight)
+					this.attributeHashfreight(this.freightData.postage)
 				}else{
 					this.attributeNofreight()
 				}
@@ -412,60 +428,61 @@
 				if(this.ischecked){
 					let totalAmount = this.allPrice - this.couponAmount
 					if(this.userMoney >= totalAmount){
-						this.payAllPrice = 0.00
+						this.orderShouldPayFee = 0.00
 						this.deductMoney = this.allPrice - this.couponAmount 		// 当前使用金额等于订单金额
 						this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余金额等于余额-当前使用金额
 					}else{
-						this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
+						this.orderShouldPayFee = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
 						this.deductMoney = this.userMoney				            // 当前使用金额等于总余额
 						this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余余额等于总余额-当前使用金额
 					}
 				}else{
-					this.payAllPrice = this.allPrice - this.couponAmount;
+					this.orderShouldPayFee = this.allPrice - this.couponAmount;
 					this.deductMoney = 0.00; // 当前使用
 					this.surplusMoney = this.userMoney; // 剩余余额
 				}
-				console.log('最终订单支付金额',this.payAllPrice)
+				console.log('最终订单支付金额',this.orderShouldPayFee)
 				console.log('优惠券金额',this.couponAmount)
 			},
-			attributeHashfreight(freight){// 计算需要邮费的支付价格
-				let totalAmount = this.allPrice + parseInt(freight) - this.couponAmount//计算不包邮的价格 总价等于商品价格+邮费
+			attributeHashfreight(postage){// 计算需要邮费的支付价格
+				console.log()
+				let totalAmount = this.allPrice + parseInt(postage) - this.couponAmount//计算不包邮的价格 总价等于商品价格+邮费
 				if(this.ischecked){
 					if(this.userMoney >= totalAmount){// 全部抵扣
-						this.payAllPrice =0.00
+						this.orderShouldPayFee =0.00
 						if(this.isCheckedBeans){// 抵扣运费了
 							this.deductMoney =  this.allPrice - this.couponAmount			// 当前使用金额等于订单金额
 							this.surplusMoney = this.userMoney - this.deductMoney	    	// 剩余金额等于余额减去当前使用金额
 						}else{
-							this.deductMoney = this.allPrice + parseInt(freight)- this.couponAmount	// 当前使用金额等于订单金额+运费金额
+							this.deductMoney = this.allPrice + parseInt(postage)- this.couponAmount	// 当前使用金额等于订单金额+运费金额
 							this.surplusMoney = this.userMoney - this.deductMoney	    	// 剩余余额等于总余额-当前使用金额
 						}
 					}else{// 部分抵扣
 						if(this.isCheckedBeans){// 抵扣运费了
-							this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于总订单金额-账户余额-优惠券金额
+							this.orderShouldPayFee = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于总订单金额-账户余额-优惠券金额
 							this.deductMoney = this.userMoney				            		// 当前使用金额等于账户余额
 							this.surplusMoney = this.userMoney - this.deductMoney	    		// 剩余余额等于账户余额-当前使用金额
 						}else{
-							this.payAllPrice = this.allPrice + parseInt(freight) - this.userMoney - this.couponAmount//订单支付金额等于订单金额+运费-账户余额-优惠券
+							this.orderShouldPayFee = this.allPrice + parseInt(postage) - this.userMoney - this.couponAmount//订单支付金额等于订单金额+运费-账户余额-优惠券
 							this.deductMoney = this.userMoney				            		// 当前使用金额等于账户余额
 							this.surplusMoney = this.userMoney - this.deductMoney	    		// 剩余余额等于账户余额-当前使用金额
 						}
 					}
 				}else{
-					this.payAllPrice = this.allPrice + parseInt(freight) - this.couponAmount
+					this.orderShouldPayFee = this.allPrice + parseInt(postage) - this.couponAmount
 					this.deductMoney = 0.00 // 当前使用金额
 					this.surplusMoney = this.userMoney // 剩余余额
 				}
-				console.log('最终订单支付金额',this.payAllPrice)
+				console.log('最终订单支付金额',this.orderShouldPayFee)
 				console.log('优惠券金额',this.couponAmount)
 			},
 			orderSubmitMit(){// 提交订单
 				if(this.isSubLoading){ return; }
-				if(this.addressId == ''){
+				if(this.confirmParam.addressId == ''){
 					this.$util.msg('请先添加收货地址~',2000)
 					return
 				}
-				this.orderInfo = this.goodsData.map(el => {
+				this.confirmParam.orderInfo = this.goodsData.map(el => {
 					let productInfo = [];
 					el.cartList.forEach(item => {
 						productInfo.push({
@@ -475,45 +492,33 @@
 							productType:item.productType
 						})
 					})
-					return {shopId:el.id,note:el.note?el.note:'',productInfo:productInfo}
+					return {shopId:el.shopId,note:el.note?el.note:'',productInfo:productInfo}
 				})
-				//订单信息
-				this.payInfo = {
-						clauseId:0,//条款(暂时保留)
-						orderShouldPayFee:this.payAllPrice.toFixed(2),//提交的总价
-						balancePayFlag:this.balanceDeductionFlag,//余额抵扣的状态
-						freight:parseInt(this.hanldFreight).toFixed(2),//邮费
-						freePostFlag:parseInt(this.hanldFreePostFlag),//运费形式
-						userBeans:this.hanldUserBeans
-					}					
-				let param = {
-						clubCouponId:this.clubCouponId,
-						orderSource:6,
-						clubUserId:this.userID,
-						addressId:this.addressId,
-						orderInfo:this.orderInfo,
-						payInfo:this.payInfo,	//订单信息
-						orderInvoice:this.invoiceData
-					}
-					console.log(param)
+				this.confirmParam.payInfo.postage = parseInt(this.hanldFreight).toFixed(2)
+				this.confirmParam.payInfo.postageFlag = parseInt(this.hanldFreePostFlag)
+				this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
+				this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
+				this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
+				this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
+				console.log(this.confirmParam)
 				this.isSubLoading = true;	
-				this.OrderService.CreatedOrderSubmit({'params':JSON.stringify(param)}).then(response =>{
-					const data = response.data;
+				this.OrderService.CreatedOrderSubmit(this.confirmParam).then(response =>{
+					let data = response.data;
 					// 友盟埋点收集机构自主提交订单
 					if(process.env.NODE_ENV != 'development'){
 						this.$uma.trackEvent('Um_Event_ConfirmOrder', {
 							Um_Key_PageName: '机构提交订单',
 							Um_Key_SourcePage: '确认订单',
-							Um_Key_OrderID:`${data.orderID}`
+							Um_Key_OrderID:`${data.orderId}`
 						})
 					}
-					if(data.code === '1'){
+					console.log('机构提交订单机构提交订单机构提交订单机构提交订单')
+					if(data.code === 1){
 						this.submitState ='success'
 						setTimeout(()=>{
 							this.isSubLoading = false;
 						},2000)
-						let data = {orderID:response.data.orderID}
-						this.$api.navigateTo(`/pages/user/order/success?data=${JSON.stringify({data:data})}`)
+						this.$api.navigateTo(`/pages/user/order/success?data=${JSON.stringify({data:{orderId:data.orderId}})}`)
 					}else{
 						this.submitState ='confirm'
 						this.$util.msg('订单提交成功',3000,true,'success')
@@ -521,7 +526,7 @@
 							this.isSubLoading = false;
 						},2000)
 						setTimeout(()=>{
-							this.$api.redirectTo(`/pages/user/order/order-payment?type=${this.submitState}&orderID=${response.data.orderID}`)
+							this.$api.redirectTo(`/pages/user/order/order-payment?type=${this.submitState}&orderID=${data.orderId}`)
 						},3000)
 					}
 				}).catch(error =>{
@@ -545,13 +550,12 @@
 			},
 		},
 		onShow() {
-			// this.addressID = ''
 			let pages = getCurrentPages();
 			let currPage = pages[pages.length-1];
 			if(currPage.data.select =='select'){
 				this.isAddress = true
 				let SelectData = uni.getStorageSync('selectAddress');
-				this.addressId = SelectData.addressId;
+				this.confirmParam.addressId = SelectData.addressId;
 				this.postageParam.townId = SelectData.townId 
 				this.addressData = SelectData
 				this.getFreightData()

+ 18 - 3
services/order.service.js

@@ -121,18 +121,33 @@ export default class OrderService {
 	 *@param userId		用户ID
 	 */
 	GetFindInvoice (data = {}) {
-		return this.AjaxService.get({ url:'/personalCenter/findInvoice', data, isLoading: false })
+		return this.AjaxService.get({ 
+			url:'/order/club/invoice', 
+			data, 
+			isLoading: false ,
+			isHost:true
+		})
 	}
 	/**
 	 *@确认订单-保存发票信息
 	 *@param userId		用户ID
 	 */
 	UpdateInvoice (data = {}) {
-		return this.AjaxService.post({ url:'/personalCenter/invoice', data, isLoading: true })
+		return this.AjaxService.post({ 
+			url:'/order/club/invoice/update', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/* 提交订单 orderId 订单ID */
 	CreatedOrderSubmit (data = {}) {
-		return this.AjaxService.post({ url:'/order/submit', data, isLoading: true })
+		return this.AjaxService.post({ 
+			url:'/order/submit/generate', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/* 订单支付,效验付款规则 orderId 订单ID */
 	OrderPaymentValidation (data = {}) {

+ 29 - 5
services/pay.service.js

@@ -8,11 +8,21 @@ export default class PayService {
 	}
 	/* 小程序支付-查询线上支付开关状态 */
 	PayOrderOnLineSwitch (data = {}) {
-		return this.AjaxService.get({ url:'/PayOrder/onLineSwitch', data, isLoading: false })
+		return this.AjaxService.get({ 
+			url:'/order/pay/online/switch', 
+			data, 
+			isLoading: false ,
+			isHost:true
+		})
 	}
 	/* 小程序支付-初始化收银台 */
 	PayOrderCheckoutCounter (data = {}) {
-		return this.AjaxService.get({ url:'/PayOrder/checkoutCounter', data, isLoading: true })
+		return this.AjaxService.get({ 
+			url:'/order/pay/checkout/counter', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/**
 	 *小程序支付-微信支付
@@ -23,7 +33,12 @@ export default class PayService {
 	 *@param  orderId  主订单ID
 	 */
 	WeChatMiniWxPay (data = {}) {
-		return this.AjaxService.post({ url:'/PayOrder/miniWxPay', data, isLoading: true })
+		return this.AjaxService.post({ 
+			url:'/order/pay/wechat', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/**
 	 *生成支付链接
@@ -31,13 +46,22 @@ export default class PayService {
 	 *@param  orderId  主订单ID
 	 */
 	PayOrderPayLink (data = {}) {
-		return this.AjaxService.post({ url:'/PayOrder/payLink', data, isLoading: true })
+		return this.AjaxService.post({ 
+			url:'/order/pay/link', 
+			data, isLoading: true ,
+			isHost:true
+		})
 	}
 	/**
 	 *@param 二手发布支付
 	 *@param  orderId  主订单ID
 	 */
 	SecondHandPay (data = {}) {
-		return this.AjaxService.post({ url:'/PayOrder/appletsSecondHandPay', data, isLoading: true })
+		return this.AjaxService.post({
+			url:'/order/pay/second/wechat', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	} 
 }