Sfoglia il codice sorgente

订单接口修改

yuwenjun1997 3 anni fa
parent
commit
c65ce746b5

+ 3 - 2
pages/order/mixins/orderList.js

@@ -48,8 +48,9 @@ const orderList = {
                 this.modalText = '是否确认收货?'
                 this.modalText = '是否确认收货?'
                 break
                 break
             case 'pay':
             case 'pay':
-                this.modal = true
-                this.modalText = '确认支付?'
+                // this.modal = true
+                // this.modalText = '确认支付?'
+				this.$api.navigateTo('/pages/order/order-pay?orderId=' + order.orderId)
                 break
                 break
             }
             }
         },
         },

+ 509 - 507
pages/order/order-create.vue

@@ -1,75 +1,76 @@
 <template>
 <template>
-    <view class="create-order">
-        <tui-skeleton v-if="isRequest" loadingType="2"></tui-skeleton>
-        <!-- 收货地址 -->
-        <view class="order-top"> <cm-choose-address :addressData="addressData"></cm-choose-address> </view>
-        <view class="grid"></view>
-        <!-- 订单列表 -->
-        <view class="order-list">
-            <view v-for="(shopInfo, shopInfoIndex) in goodsData" :key="shopInfoIndex">
-                <view class="line"></view>
-                <view class="order-section">
-                    <!-- 供应商 -->
-                    <view class="origin">
-                        <image class="cover" :src="shopInfo.logo"></image> <view class="name">{{ shopInfo.name }}</view>
-                    </view>
-                    <!-- 商品列表 -->
-                    <view class="goods-list">
-                        <!-- 商品信息 -->
-                        <view class="order-goods" v-for="goods in shopInfo.productList" :key="goods.productId">
-                            <cm-order-prodcut :goods-data="goods"></cm-order-prodcut>
-                        </view>
-                    </view>
-                    <!-- 合计 -->
-                    <!-- <view class="total-price">
+	<view class="create-order">
+		<tui-skeleton v-if="isRequest" loadingType="2"></tui-skeleton>
+		<!-- 收货地址 -->
+		<view class="order-top"><cm-choose-address :addressData="addressData"></cm-choose-address></view>
+		<view class="grid"></view>
+		<!-- 订单列表 -->
+		<view class="order-list">
+			<view v-for="(shopInfo, shopInfoIndex) in goodsData" :key="shopInfoIndex">
+				<view class="line"></view>
+				<view class="order-section">
+					<!-- 供应商 -->
+					<view class="origin">
+						<image class="cover" :src="shopInfo.logo"></image>
+						<view class="name">{{ shopInfo.name }}</view>
+					</view>
+					<!-- 商品列表 -->
+					<view class="goods-list">
+						<!-- 商品信息 -->
+						<view class="order-goods" v-for="goods in shopInfo.productList" :key="goods.productId">
+							<cm-order-prodcut :goods-data="goods"></cm-order-prodcut>
+						</view>
+					</view>
+					<!-- 合计 -->
+					<!-- <view class="total-price">
                         <text>合计:</text> <text class="price">¥{{ shopInfo.shopTotalPrice | formatPrice }}</text>
                         <text>合计:</text> <text class="price">¥{{ shopInfo.shopTotalPrice | formatPrice }}</text>
                     </view> -->
                     </view> -->
-                    <!-- 留言 -->
-                    <view class="remark">
-                        <view class="label">留言:</view>
-                        <input class="control" type="text" v-model="shopInfo.note" placeholder="请输入内容" />
-                    </view>
-                </view>
-            </view>
-        </view>
-
-        <!-- 优惠券 -->
-        <template v-if="receiveCouponList.length > 0">
-            <view class="grid"></view>
-            <cm-order-coupon-section @click="couponVisible = true" :coupon="currentCoupon"></cm-order-coupon-section>
-        </template>
-
-        <!-- 分享减免 -->
-        <template v-if="reduction">
-            <view class="grid"></view>
-            <cm-order-share-reduce :reductionData="shareReductionData"></cm-order-share-reduce>
-        </template>
-
-        <!-- 运费 -->
-        <view class="grid"></view>
-        <cm-order-freight-section></cm-order-freight-section>
-
-        <view class="grid"></view>
-
-        <!-- 提交导航 -->
-        <cm-order-submit-nav :orderInfo="submitOrderInfo" @commit="orderSubmit"></cm-order-submit-nav>
-
-        <!-- 优惠券列表 -->
-        <cm-coupon-list
-            title="优惠券"
-            listType="use"
-            :visible="couponVisible"
-            @close="closeCouponList"
-            :chooseAble="true"
-            :showStatus="false"
-            :couponList="receiveCouponList"
-            @chooseCoupon="chooseCoupon"
-            @confirm="closeCouponList"
-            :currentId="currentCouponUniqueId"
-        ></cm-coupon-list>
-        <cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
-        <view class="reserved" v-if="isIphoneX"></view>
-    </view>
+					<!-- 留言 -->
+					<view class="remark">
+						<view class="label">留言:</view>
+						<input class="control" type="text" v-model="shopInfo.note" placeholder="请输入内容" />
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<!-- 优惠券 -->
+		<template v-if="receiveCouponList.length > 0">
+			<view class="grid"></view>
+			<cm-order-coupon-section @click="couponVisible = true" :coupon="currentCoupon"></cm-order-coupon-section>
+		</template>
+
+		<!-- 分享减免 -->
+		<template v-if="reduction">
+			<view class="grid"></view>
+			<cm-order-share-reduce :reductionData="shareReductionData"></cm-order-share-reduce>
+		</template>
+
+		<!-- 运费 -->
+		<view class="grid"></view>
+		<cm-order-freight-section></cm-order-freight-section>
+
+		<view class="grid"></view>
+
+		<!-- 提交导航 -->
+		<cm-order-submit-nav :orderInfo="submitOrderInfo" @commit="orderSubmit"></cm-order-submit-nav>
+
+		<!-- 优惠券列表 -->
+		<cm-coupon-list
+			title="优惠券"
+			listType="use"
+			:visible="couponVisible"
+			@close="closeCouponList"
+			:chooseAble="true"
+			:showStatus="false"
+			:couponList="receiveCouponList"
+			@chooseCoupon="chooseCoupon"
+			@confirm="closeCouponList"
+			:currentId="currentCouponUniqueId"
+		></cm-coupon-list>
+		<cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
+		<view class="reserved" v-if="isIphoneX"></view>
+	</view>
 </template>
 </template>
 
 
 <script>
 <script>
@@ -87,463 +88,464 @@ import { mapGetters } from 'vuex'
 import wechatPay from './mixins/wechatPay.js'
 import wechatPay from './mixins/wechatPay.js'
 
 
 export default {
 export default {
-    // 混入
-    mixins: [wechatPay],
-    components: {
-        CmOrderProdcut,
-        CmChooseAddress,
-        CmOrderSubmitNav,
-        CmOrderCouponSection,
-        CmOrderFreightSection,
-        CmOrderShareReduce,
-        CmCouponList,
-        CmLoading
-    },
-    data() {
-        return {
-            isRequest: true,
-
-            // 收货地址
-            addressData: {},
-
-            productIds: '',
-            // 初始化订单信息参数列表
-            params: {},
-
-            // 订单提交参数
-            subParams: {
-                userId: 0,
-                orderInfo: [], //提交的商品信息
-                addressId: 0,
-                cartType: 0,
-                payInfo: {
-                    orderShouldPayFee: 0
-                },
-                discountInfo: null
-            },
-
-            goodsData: [], // 供应商下的商品
-            allPrice: 0,
-            productList: [], // 商品列表
-            allCount: 0,
-            hanldOrder: {},
-
-            // 优惠券
-            couponVisible: false,
-            receiveCouponList: [], // 已领取优惠券列表
-            currentCouponUniqueId: -1, // 选中的优惠券唯一id 注意:非优惠券id,选中优惠券id通过currentCoupon.couponId获取
-            currentCoupon: {}, // 选中的优惠券信息
-            canUseCouponList: [], // 能够使用的优惠券列表
-            notUseCouponList: [], // 暂未满足条件的优惠券列表
-
-            // 拼团
-            collageFlag: 0, //拼团标识:0不参与拼团,1参与拼团
-            collageId: 0, //拼团id:参与拼团,若拼团id为空则发起拼团,不为空则与他人拼团
-
-            // 分享抵扣
-            shareReductStatus: false,
-            reduction: null,
-            reductionUserId: 0, //分享抵扣用户id
-            shareData: {
-                type: 0
-            }
-        }
-    },
-    computed: {
-        ...mapGetters(['userId', 'isIphoneX']),
-        // 选中的优惠券的金额
-        couponAmount() {
-            return this.currentCoupon.couponAmount || 0
-        },
-        // 最终支付金额
-        payAllPrice() {
-            const payAllPrice = this.allPrice - this.couponAmount - this.shareReducedAmount
-            return payAllPrice <= 0 ? 0 : payAllPrice
-        },
-        // 总优惠价格
-        discountedPrice() {
-            return this.couponAmount + this.shareReducedAmount
-        },
-        // 提交组件状态信息
-        submitOrderInfo() {
-            return {
-                allCount: this.allCount,
-                payAllPrice: this.payAllPrice,
-                discountedPrice: this.discountedPrice
-            }
-        },
-        // 优惠券,分享活动相关参数
-        discountInfo() {
-            return {
-                //优惠券ID
-                couponId: this.currentCoupon.couponId || 0,
-                //优惠券分享ID
-                couponShareId: this.currentCoupon.couponShareId || 0,
-                //拼团标识:0不参与拼团,1参与拼团
-                collageFlag: this.collageFlag,
-                //拼团id:参与拼团,若拼团id为空则发起拼团,不为空则与他人拼团
-                collageId: this.collageId,
-                //分享抵扣用户id
-                reductionUserId: this.reductionUserId
-            }
-        },
-        // 分享减免金额
-        shareReducedAmount() {
-            return this.reduction && this.shareReductStatus ? this.reduction.reducedAmount : 0
-        },
-        // 分享减免组件状态信息
-        shareReductionData() {
-            return {
-                status: this.shareReductStatus,
-                reduction: this.reduction
-            }
-        }
-    },
-    onLoad(options) {
-        this.isRequest = true
-        this.getAddressData()
-        this.initOptions(options)
-        this.orderPaySuccess() // 支付回调
-    },
-    onShow() {
-        let pages = getCurrentPages()
-        let currPage = pages[pages.length - 1]
-        if (currPage.data.select == 'select') {
-            this.isAddress = true
-            let SelectData = uni.getStorageSync('selectAddress')
-            this.subParams.addressId = SelectData.addressId
-            this.addressData = SelectData
-        } else {
-            this.getAddressData()
-        }
-    },
-    beforeDestroy() {
-        uni.removeStorageSync('commitProductInfo')
-        uni.removeStorageSync('commitCartPramsData')
-    },
-    // 分享朋友圈
-    // onShareTimeline() {
-    //     this.handleShare(2)
-    //     // 加密
-    //     const state_str = encodeURIComponent(this.$crypto.encrypt(this.shareData))
-    //     return {
-    //         title: '护肤上颜选,正品有好货~',
-    //         query: `/pages/tabBar/index/index?state_str=${state_str}`,
-    //         imageUrl: this.$Static + 'icon-index-share.jpg'
-    //     }
-    // },
-    // 分享
-    onShareAppMessage(e) {
-        this.handleShare(1)
-        // 加密
-        const state_str = encodeURIComponent(this.$crypto.encrypt(this.shareData))
-        return {
-            title: '护肤上颜选,正品有好货~',
-            path: `/pages/tabBar/index/index?state_str=${state_str}`,
-            imageUrl: this.$Static + 'icon-index-share.jpg'
-        }
-    },
-
-    methods: {
-        // 支付回调执行函数
-        orderPaySuccess() {
-            this.$on('orderPaySuccess', () => {
-                if (this.collageFlag === 1) {
-                    uni.redirectTo({ url: `/pages/fight-order/fight-detail?collageId=${this.collageId}` })
-                } else {
-                    uni.redirectTo({ url: '/pages/order/success' })
-                }
-            })
-        },
-        // 分享
-        handleShare(shareType) {
-            if (!this.reduction) return
-            const { reductionId } = this.reduction
-            this.OrderService.OrderReductionShare({ reductionId, shareType, userId: this.userId })
-                .then(res => {
-                    this.$util.msg(res.msg, 2000)
-                    this.reductionUserId = res.data
-                    this.shareReductStatus = true
-                })
-                .catch(err => {
-                    this.$util.msg(error.msg, 2000)
-                    this.shareReductStatus = false
-                })
-        },
-
-        // 初始化参数信息
-        initOptions(options) {
-            // 从商品详情进入
-            if (options.type == 'prodcut') {
-                const productInfo = uni.getStorageSync('commitProductInfo')
-                this.subParams.cartType = 2 // 从商品详情提交
-                this.params.productCount = productInfo.productCount
-                this.params.productId = productInfo.productId
-                this.params.heUserId = productInfo.heUserId || 0
-                this.params.collageFlag = this.collageFlag = productInfo.collageFlag
-                this.productIds = productInfo.productId.toString()
-                this.allCount = productInfo.allCount
-                this.collageId = parseInt(productInfo.collageId) || 0
-            } else {
-                const cartPramsData = uni.getStorageSync('commitCartPramsData')
-                this.subParams.cartType = 1 // 从购物车提交
-                this.params.cartIds = cartPramsData.cartIds
-                this.productIds = cartPramsData.productIds
-                this.allCount = cartPramsData.allCount
-            }
-
-            this.params.userId = this.userId
-            this.subParams.userId = this.userId
-            this.getInitCrearOrder(this.params)
-        },
-
-        // 获取可用优惠券
-        fetchCouponList() {
-            this.CouponService.GetCouponByProductIds({ userId: this.userId, productIds: this.productIds }).then(res => {
-                this.receiveCouponList = setCouponUniqueId(res.data.receiveCouponList) // 去掉重复的优惠券
-                this.filterCouponList()
-            })
-        },
-
-        // 对优惠券进行分类排序
-        filterCouponList() {
-            this.goodsData.forEach(shop => this.productList.push(...shop.productList.map(prod => prod)))
-            this.canUseCouponList = [] // 可以使用的优惠券
-            this.notUseCouponList = [] // 需要凑单使用的优惠券
-            this.receiveCouponList.forEach(coupon => {
-                if (
-                    coupon.noThresholdFlag === 1 ||
-                    (coupon.productType === 1 && allProdoceUseCheck(this.productList, coupon)) ||
-                    (coupon.productType === 2 && someProductUseCheck(this.productList, coupon))
-                ) {
-                    coupon.canSelect = true
-                    this.canUseCouponList.push(coupon)
-                } else {
-                    coupon.canSelect = false
-                    this.notUseCouponList.push(coupon)
-                }
-            })
-            // 金额高的排前面
-            this.receiveCouponList = [...couponSort(this.canUseCouponList), ...couponSort(this.notUseCouponList)]
-            // 当有可用优惠券时 默认选取第一个最优惠的
-            if (this.canUseCouponList.length > 0) {
-                this.currentCouponUniqueId = this.receiveCouponList[0].uniqueId
-                this.currentCoupon = this.receiveCouponList[0] || {}
-            }
-            // 显示界面
-            this.isRequest = false
-        },
-
-        // 处理优惠券列表
-        resetCouponList() {
-            // 1将当前选中的优惠券从列表中删除
-            // 2将当前选中的优惠券放入最前面
-            // 3返回最新的优惠券列表
-            // 4查找选中优惠券的索引
-            const index = this.canUseCouponList.findIndex(coupon => coupon.uniqueId === this.currentCouponUniqueId)
-            // 从列表中删除
-            const currentCoupon = this.canUseCouponList.splice(index, 1)
-            // 重新排序 将选中的优惠券放到最前面
-            this.canUseCouponList = [...currentCoupon, ...couponSort(this.canUseCouponList)]
-            // 重新生成receiveCouponList
-            this.receiveCouponList = [...this.canUseCouponList, ...this.notUseCouponList]
-        },
-
-        // 确认选中
-        closeCouponList() {
-            this.couponVisible = false
-            this.resetCouponList()
-        },
-
-        // 选中优惠券
-        chooseCoupon(coupon) {
-            if (coupon.couponId > -1) {
-                this.currentCoupon = coupon
-                this.currentCouponUniqueId = coupon.uniqueId
-            } else {
-                this.currentCoupon = {}
-                this.currentCouponUniqueId = -1
-            }
-            // this.couponVisible = false
-        },
-        //确认订单初始化信息
-        getInitCrearOrder(params) {
-            this.OrderService.QueryOrderConfirm(params)
-                .then(res => {
-                    let data = res.data
-                    this.goodsData = this.bindRemark(data.shopList)
-                    console.log(this.goodsData)
-                    this.allPrice = data.totalPrice
-                    this.fetchCouponList()
-                    this.reduction = res.data.reduction
-                    this.isRequest = false
-                })
-                .catch(error => {
-                    this.$util.msg(error.msg, 2000)
-                })
-        },
-        // 为共供应商绑定留言信息
-        bindRemark(shopList) {
-            return shopList.map(item => {
-                item.note = ''
-                return item
-            })
-        },
-        //获取地址信息
-        getAddressData() {
-            this.UserService.QueryAddressList({ pageNum: 1, pageSize: 1, userId: this.userId }).then(res => {
-                this.addressData = res.data.list[0]
-                // 设置收货地址
-                this.subParams.addressId = this.addressData.addressId
-            })
-        },
-        orderSubmit() {
-            //提交订单
-            if (this.isSubLoading) return
-            if (this.subParams.addressId == '') return this.$util.msg('请先添加收货地址~', 2000)
-            // 优惠券,分享活动相关参数
-            this.subParams.discountInfo = this.discountInfo
-            // 要支付的金额
-            this.subParams.payInfo.orderShouldPayFee = this.payAllPrice
-            // 处理商品信息及留言
-            this.subParams.orderInfo = this.goodsData.map(el => {
-                let productInfo = []
-                el.productList.forEach(pros => {
-                    productInfo.push({
-                        productId: pros.productId,
-                        productNum: pros.productCount,
-                        heUserId: pros.heUserId
-                    })
-                })
-                return { shopId: el.shopId, note: el.note ? el.note : '', productInfo }
-            })
-
-            // 调试提交参数
-            console.log(this.subParams)
-            // return
-
-            this.isSubLoading = true
-            this.loadingText = '正在创建订单...'
-            this.OrderService.CreatedOrderSubmit(this.subParams)
-                .then(response => {
-                    const data = response.data
-                    this.hanldOrder.order = response.data
-                    this.collageId = data.collageId
-                    if (parseFloat(data.payableAmount) === 0) {
-                        uni.setStorageSync('orderInfo', this.hanldOrder.order)
-                        uni.redirectTo({ url: '/pages/order/success' })
-                    } else {
-                        this.miniWxPayFor(data)
-                    }
-                })
-                .catch(error => {
-                    this.isSubLoading = false
-                    this.$util.msg(error.msg, 2000)
-                    this.isSubLoading = false
-                })
-        }
-    }
+	// 混入
+	mixins: [wechatPay],
+	components: {
+		CmOrderProdcut,
+		CmChooseAddress,
+		CmOrderSubmitNav,
+		CmOrderCouponSection,
+		CmOrderFreightSection,
+		CmOrderShareReduce,
+		CmCouponList,
+		CmLoading
+	},
+	data() {
+		return {
+			isRequest: true,
+
+			// 收货地址
+			addressData: {},
+
+			productIds: '',
+			// 初始化订单信息参数列表
+			params: {},
+
+			// 订单提交参数
+			subParams: {
+				userId: 0,
+				orderInfo: [], //提交的商品信息
+				addressId: 0,
+				cartType: 0,
+				payInfo: {
+					orderShouldPayFee: 0
+				},
+				discountInfo: null
+			},
+
+			goodsData: [], // 供应商下的商品
+			allPrice: 0,
+			productList: [], // 商品列表
+			allCount: 0,
+			hanldOrder: {},
+
+			// 优惠券
+			couponVisible: false,
+			receiveCouponList: [], // 已领取优惠券列表
+			currentCouponUniqueId: -1, // 选中的优惠券唯一id 注意:非优惠券id,选中优惠券id通过currentCoupon.couponId获取
+			currentCoupon: {}, // 选中的优惠券信息
+			canUseCouponList: [], // 能够使用的优惠券列表
+			notUseCouponList: [], // 暂未满足条件的优惠券列表
+
+			// 拼团
+			collageFlag: 0, //拼团标识:0不参与拼团,1参与拼团
+			collageId: 0, //拼团id:参与拼团,若拼团id为空则发起拼团,不为空则与他人拼团
+
+			// 分享抵扣
+			shareReductStatus: false,
+			reduction: null,
+			reductionUserId: 0, //分享抵扣用户id
+			shareData: {
+				type: 0
+			}
+		}
+	},
+	computed: {
+		...mapGetters(['userId', 'isIphoneX']),
+		// 选中的优惠券的金额
+		couponAmount() {
+			return this.currentCoupon.couponAmount || 0
+		},
+		// 最终支付金额
+		payAllPrice() {
+			const payAllPrice = this.allPrice - this.couponAmount - this.shareReducedAmount
+			return payAllPrice <= 0 ? 0 : payAllPrice
+		},
+		// 总优惠价格
+		discountedPrice() {
+			return this.couponAmount + this.shareReducedAmount
+		},
+		// 提交组件状态信息
+		submitOrderInfo() {
+			return {
+				allCount: this.allCount,
+				payAllPrice: this.payAllPrice,
+				discountedPrice: this.discountedPrice
+			}
+		},
+		// 优惠券,分享活动相关参数
+		discountInfo() {
+			return {
+				//优惠券ID
+				couponId: this.currentCoupon.couponId || 0,
+				//优惠券分享ID
+				couponShareId: this.currentCoupon.couponShareId || 0,
+				//拼团标识:0不参与拼团,1参与拼团
+				collageFlag: this.collageFlag,
+				//拼团id:参与拼团,若拼团id为空则发起拼团,不为空则与他人拼团
+				collageId: this.collageId,
+				//分享抵扣用户id
+				reductionUserId: this.reductionUserId
+			}
+		},
+		// 分享减免金额
+		shareReducedAmount() {
+			return this.reduction && this.shareReductStatus ? this.reduction.reducedAmount : 0
+		},
+		// 分享减免组件状态信息
+		shareReductionData() {
+			return {
+				status: this.shareReductStatus,
+				reduction: this.reduction
+			}
+		}
+	},
+	onLoad(options) {
+		this.isRequest = true
+		this.getAddressData()
+		this.initOptions(options)
+		// this.orderPaySuccess() // 支付回调
+	},
+	onShow() {
+		let pages = getCurrentPages()
+		let currPage = pages[pages.length - 1]
+		if (currPage.data.select == 'select') {
+			this.isAddress = true
+			let SelectData = uni.getStorageSync('selectAddress')
+			this.subParams.addressId = SelectData.addressId
+			this.addressData = SelectData
+		} else {
+			this.getAddressData()
+		}
+	},
+	beforeDestroy() {
+		uni.removeStorageSync('commitProductInfo')
+		uni.removeStorageSync('commitCartPramsData')
+	},
+	// 分享朋友圈
+	// onShareTimeline() {
+	//     this.handleShare(2)
+	//     // 加密
+	//     const state_str = encodeURIComponent(this.$crypto.encrypt(this.shareData))
+	//     return {
+	//         title: '护肤上颜选,正品有好货~',
+	//         query: `/pages/tabBar/index/index?state_str=${state_str}`,
+	//         imageUrl: this.$Static + 'icon-index-share.jpg'
+	//     }
+	// },
+	// 分享
+	onShareAppMessage(e) {
+		this.handleShare(1)
+		// 加密
+		const state_str = encodeURIComponent(this.$crypto.encrypt(this.shareData))
+		return {
+			title: '护肤上颜选,正品有好货~',
+			path: `/pages/tabBar/index/index?state_str=${state_str}`,
+			imageUrl: this.$Static + 'icon-index-share.jpg'
+		}
+	},
+
+	methods: {
+		// 支付回调执行函数
+		orderPaySuccess() {
+			this.$on('orderPaySuccess', () => {
+				if (this.collageFlag === 1) {
+					uni.redirectTo({ url: `/pages/fight-order/fight-detail?collageId=${this.collageId}` })
+				} else {
+					uni.redirectTo({ url: '/pages/order/success' })
+				}
+			})
+		},
+		// 分享
+		handleShare(shareType) {
+			if (!this.reduction) return
+			const { reductionId } = this.reduction
+			this.OrderService.OrderReductionShare({ reductionId, shareType, userId: this.userId })
+				.then(res => {
+					this.$util.msg(res.msg, 2000)
+					this.reductionUserId = res.data
+					this.shareReductStatus = true
+				})
+				.catch(err => {
+					this.$util.msg(error.msg, 2000)
+					this.shareReductStatus = false
+				})
+		},
+
+		// 初始化参数信息
+		initOptions(options) {
+			// 从商品详情进入
+			if (options.type == 'prodcut') {
+				const productInfo = uni.getStorageSync('commitProductInfo')
+				this.subParams.cartType = 2 // 从商品详情提交
+				this.params.productCount = productInfo.productCount
+				this.params.productId = productInfo.productId
+				this.params.heUserId = productInfo.heUserId || 0
+				this.params.collageFlag = this.collageFlag = productInfo.collageFlag
+				this.productIds = productInfo.productId.toString()
+				this.allCount = productInfo.allCount
+				this.collageId = parseInt(productInfo.collageId) || 0
+			} else {
+				const cartPramsData = uni.getStorageSync('commitCartPramsData')
+				this.subParams.cartType = 1 // 从购物车提交
+				this.params.cartIds = cartPramsData.cartIds
+				this.productIds = cartPramsData.productIds
+				this.allCount = cartPramsData.allCount
+			}
+
+			this.params.userId = this.userId
+			this.subParams.userId = this.userId
+			this.getInitCrearOrder(this.params)
+		},
+
+		// 获取可用优惠券
+		fetchCouponList() {
+			this.CouponService.GetCouponByProductIds({ userId: this.userId, productIds: this.productIds }).then(res => {
+				this.receiveCouponList = setCouponUniqueId(res.data.receiveCouponList) // 去掉重复的优惠券
+				this.filterCouponList()
+			})
+		},
+
+		// 对优惠券进行分类排序
+		filterCouponList() {
+			this.goodsData.forEach(shop => this.productList.push(...shop.productList.map(prod => prod)))
+			this.canUseCouponList = [] // 可以使用的优惠券
+			this.notUseCouponList = [] // 需要凑单使用的优惠券
+			this.receiveCouponList.forEach(coupon => {
+				if (
+					coupon.noThresholdFlag === 1 ||
+					(coupon.productType === 1 && allProdoceUseCheck(this.productList, coupon)) ||
+					(coupon.productType === 2 && someProductUseCheck(this.productList, coupon))
+				) {
+					coupon.canSelect = true
+					this.canUseCouponList.push(coupon)
+				} else {
+					coupon.canSelect = false
+					this.notUseCouponList.push(coupon)
+				}
+			})
+			// 金额高的排前面
+			this.receiveCouponList = [...couponSort(this.canUseCouponList), ...couponSort(this.notUseCouponList)]
+			// 当有可用优惠券时 默认选取第一个最优惠的
+			if (this.canUseCouponList.length > 0) {
+				this.currentCouponUniqueId = this.receiveCouponList[0].uniqueId
+				this.currentCoupon = this.receiveCouponList[0] || {}
+			}
+			// 显示界面
+			this.isRequest = false
+		},
+
+		// 处理优惠券列表
+		resetCouponList() {
+			// 1将当前选中的优惠券从列表中删除
+			// 2将当前选中的优惠券放入最前面
+			// 3返回最新的优惠券列表
+			// 4查找选中优惠券的索引
+			const index = this.canUseCouponList.findIndex(coupon => coupon.uniqueId === this.currentCouponUniqueId)
+			// 从列表中删除
+			const currentCoupon = this.canUseCouponList.splice(index, 1)
+			// 重新排序 将选中的优惠券放到最前面
+			this.canUseCouponList = [...currentCoupon, ...couponSort(this.canUseCouponList)]
+			// 重新生成receiveCouponList
+			this.receiveCouponList = [...this.canUseCouponList, ...this.notUseCouponList]
+		},
+
+		// 确认选中
+		closeCouponList() {
+			this.couponVisible = false
+			this.resetCouponList()
+		},
+
+		// 选中优惠券
+		chooseCoupon(coupon) {
+			if (coupon.couponId > -1) {
+				this.currentCoupon = coupon
+				this.currentCouponUniqueId = coupon.uniqueId
+			} else {
+				this.currentCoupon = {}
+				this.currentCouponUniqueId = -1
+			}
+			// this.couponVisible = false
+		},
+		//确认订单初始化信息
+		getInitCrearOrder(params) {
+			this.OrderService.QueryOrderConfirm(params)
+				.then(res => {
+					let data = res.data
+					this.goodsData = this.bindRemark(data.shopList)
+					console.log(this.goodsData)
+					this.allPrice = data.totalPrice
+					this.fetchCouponList()
+					this.reduction = res.data.reduction
+					this.isRequest = false
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
+		// 为共供应商绑定留言信息
+		bindRemark(shopList) {
+			return shopList.map(item => {
+				item.note = ''
+				return item
+			})
+		},
+		//获取地址信息
+		getAddressData() {
+			this.UserService.QueryAddressList({ pageNum: 1, pageSize: 1, userId: this.userId }).then(res => {
+				this.addressData = res.data.list[0]
+				// 设置收货地址
+				this.subParams.addressId = this.addressData.addressId
+			})
+		},
+		orderSubmit() {
+			//提交订单
+			if (this.isSubLoading) return
+			if (this.subParams.addressId == '') return this.$util.msg('请先添加收货地址~', 2000)
+			// 优惠券,分享活动相关参数
+			this.subParams.discountInfo = this.discountInfo
+			// 要支付的金额
+			this.subParams.payInfo.orderShouldPayFee = this.payAllPrice
+			//
+			// 处理商品信息及留言
+			this.subParams.orderInfo = this.goodsData.map(el => {
+				let productInfo = []
+				el.productList.forEach(pros => {
+					productInfo.push({
+						productId: pros.productId,
+						productNum: pros.productCount,
+						heUserId: pros.heUserId
+					})
+				})
+				return { shopId: el.shopId, note: el.note ? el.note : '', productInfo, splitCode: el.splitCode }
+			})
+
+			// 调试提交参数
+			console.log(this.subParams)
+			// return
+
+			this.isSubLoading = true
+			this.loadingText = '正在创建订单...'
+			this.OrderService.CreatedOrderSubmit(this.subParams)
+				.then(response => {
+					this.isSubLoading = false
+					// const data = response.data
+					// this.hanldOrder.order = response.data
+					// this.collageId = data.collageId
+					// if (parseFloat(data.payableAmount) === 0) {
+					// 	uni.setStorageSync('orderInfo', this.hanldOrder.order)
+					// 	uni.redirectTo({ url: '/pages/order/success' })
+					// } else {
+					// 	this.miniWxPayFor(data)
+					// }
+					uni.redirectTo({ url: `/pages/order/order-pay?orderId=${response.data.orderId}` })
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		}
+	}
 }
 }
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 .create-order {
 .create-order {
-    background: #f7f7f7;
-    min-height: 100vh;
-    padding-top: 134rpx;
-    padding-bottom: 100rpx;
-    box-sizing: border-box;
-
-    .order-top {
-        width: 100%;
-        position: fixed;
-        top: 0;
-        left: 0;
-        z-index: 999;
-    }
+	background: #f7f7f7;
+	min-height: 100vh;
+	padding-top: 134rpx;
+	padding-bottom: 100rpx;
+	box-sizing: border-box;
+
+	.order-top {
+		width: 100%;
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 999;
+	}
 }
 }
 
 
 .grid {
 .grid {
-    width: 100%;
-    height: 20rpx;
-    background: #f7f7f7;
+	width: 100%;
+	height: 20rpx;
+	background: #f7f7f7;
 }
 }
 
 
 .line {
 .line {
-    width: 702rpx;
-    height: 1rpx;
-    margin: 0 auto;
-    background: #f7f7f7;
+	width: 702rpx;
+	height: 1rpx;
+	margin: 0 auto;
+	background: #f7f7f7;
 }
 }
 
 
 .order-list {
 .order-list {
-    background: #fff;
-
-    .order-section {
-        padding: 38rpx 0;
-    }
-
-    .goods-list {
-        .order-goods {
-            padding-top: 32rpx;
-            &:first-child {
-                padding-top: 0;
-            }
-        }
-    }
-
-    .origin {
-        padding: 0 24rpx;
-        margin-bottom: 16rpx;
-        display: flex;
-        justify-content: flex-start;
-        align-items: center;
-        .cover {
-            width: 56rpx;
-            height: 56rpx;
-            border-radius: 4rpx;
-        }
-        .name {
-            margin-left: 16rpx;
-            font-size: 30rpx;
-            color: #333333;
-        }
-    }
+	background: #fff;
+
+	.order-section {
+		padding: 38rpx 0;
+	}
+
+	.goods-list {
+		.order-goods {
+			padding-top: 32rpx;
+			&:first-child {
+				padding-top: 0;
+			}
+		}
+	}
+
+	.origin {
+		padding: 0 24rpx;
+		margin-bottom: 16rpx;
+		display: flex;
+		justify-content: flex-start;
+		align-items: center;
+		.cover {
+			width: 56rpx;
+			height: 56rpx;
+			border-radius: 4rpx;
+		}
+		.name {
+			margin-left: 16rpx;
+			font-size: 30rpx;
+			color: #333333;
+		}
+	}
 }
 }
 
 
 .total-price {
 .total-price {
-    padding: 24rpx;
-    text-align: right;
-    font-size: 26rpx;
-    color: #333;
-    background: #fff;
-
-    .price {
-        color: #ff457b;
-    }
+	padding: 24rpx;
+	text-align: right;
+	font-size: 26rpx;
+	color: #333;
+	background: #fff;
+
+	.price {
+		color: #ff457b;
+	}
 }
 }
 
 
 .remark {
 .remark {
-    padding: 24rpx 24rpx 0;
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    background: #fff;
-
-    .label {
-        width: 78rpx;
-        font-size: 26rpx;
-        color: #999999;
-        margin-right: 16rpx;
-    }
-
-    .control {
-        flex: 1;
-        font-size: 26rpx;
-        color: #333333;
-        padding: 8rpx 16rpx;
-        background: #f7f7f7;
-        border-radius: 8rpx;
-    }
+	padding: 24rpx 24rpx 0;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	background: #fff;
+
+	.label {
+		width: 78rpx;
+		font-size: 26rpx;
+		color: #999999;
+		margin-right: 16rpx;
+	}
+
+	.control {
+		flex: 1;
+		font-size: 26rpx;
+		color: #333333;
+		padding: 8rpx 16rpx;
+		background: #f7f7f7;
+		border-radius: 8rpx;
+	}
 }
 }
 </style>
 </style>

+ 62 - 30
pages/order/order-detail.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-	<view class="order-detail" :class="{ hasBottom: hasControlNav }">
+	<view class="order-detail" :class="{ 'has-bottom': hasControlNav }">
 		<tui-skeleton v-if="isRequest" loadingType="2"></tui-skeleton>
 		<tui-skeleton v-if="isRequest" loadingType="2"></tui-skeleton>
 
 
 		<view class="detail-top">
 		<view class="detail-top">
@@ -36,35 +36,35 @@
 				</view> -->
 				</view> -->
 				<view class="remark">
 				<view class="remark">
 					<text class="label">留言:</text>
 					<text class="label">留言:</text>
-					<text class="content">这是留言这是留言这是留言这是留言这是留言</text>
+					<text class="content">{{ shopOrder.note }}</text>
 				</view>
 				</view>
 				<view class="line"></view>
 				<view class="line"></view>
 				<view class="description">
 				<view class="description">
-					<uni-transition :show="isCollapse" modeClass="slide-top" >
-						<view class="collapse-content">
-							<view class="row">
-								<text class="label">商品总额:</text>
-								<text class="content">¥200</text>
-							</view>
-							<view class="row">
-								<text class="label">优惠:</text>
-								<text class="content">¥200</text>
-							</view>
-							<view class="row">
-								<text class="label">应付金额:</text>
-								<text class="content">¥200</text>
-							</view>
-							<view class="row">
-								<text class="label">已付金额:</text>
-								<text class="content">¥200</text>
-							</view>
+					<view class="collapse-content" v-if="isCollapse">
+						<view class="row">
+							<text class="label">商品总额:</text>
+							<text class="content">¥{{ shopOrder.needPayAmount | formatPrice }}</text>
 						</view>
 						</view>
-					</uni-transition>
+						<view class="row">
+							<text class="label">优惠:</text>
+							<text class="content">¥{{ shopOrder.eachDiscount | formatPrice }}</text>
+						</view>
+						<view class="row">
+							<text class="label">应付金额:</text>
+							<text class="content">¥{{ shopOrder.realPay | formatPrice }}</text>
+						</view>
+						<view class="row">
+							<text class="label">已付金额:</text>
+							<text class="content">¥{{ shopOrder.receiptAmount | formatPrice }}</text>
+						</view>
+					</view>
 					<view class="row">
 					<view class="row">
 						<text class="label active">待付金额:</text>
 						<text class="label active">待付金额:</text>
-						<text class="content active">¥200</text>
+						<text class="content active">¥{{ shopOrder.restAmount | formatPrice }}</text>
+					</view>
+					<view class="collapse" :class="isCollapse ? 'arrowup' : 'arrowdown'" @click="onCollapse">
+						{{ isCollapse ? '收起' : '展开' }}
 					</view>
 					</view>
-					<view class="collapse iconfont" @click="onCollapse">收起</view>
 				</view>
 				</view>
 			</view>
 			</view>
 		</template>
 		</template>
@@ -75,11 +75,24 @@
 
 
 		<!-- 操作 -->
 		<!-- 操作 -->
 		<view class="order-control" v-if="hasControlNav" :class="{ 'has-bottom': isIphoneX }">
 		<view class="order-control" v-if="hasControlNav" :class="{ 'has-bottom': isIphoneX }">
-			<cm-order-control-nav :orderInfo="orderInfo" @confirm="handleConfirmClick" :hasBottom="isIphoneX" @change="getButtonCount"></cm-order-control-nav>
+			<cm-order-control-nav
+				:orderInfo="orderInfo"
+				@confirm="handleConfirmClick"
+				:hasBottom="isIphoneX"
+				@change="getButtonCount"
+			></cm-order-control-nav>
 		</view>
 		</view>
 
 
 		<!-- 操作弹窗 -->
 		<!-- 操作弹窗 -->
-		<tui-modal :show="modal" :content="modalText" :size="32" :maskClosable="false" color="#333" shape="circle" @click="handleModalConfirm"></tui-modal>
+		<tui-modal
+			:show="modal"
+			:content="modalText"
+			:size="32"
+			:maskClosable="false"
+			color="#333"
+			shape="circle"
+			@click="handleModalConfirm"
+		></tui-modal>
 
 
 		<!-- 加载框 -->
 		<!-- 加载框 -->
 		<cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
 		<cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
@@ -120,7 +133,7 @@ export default {
 	},
 	},
 	data() {
 	data() {
 		return {
 		return {
-			isRequest: false,
+			isRequest: true,
 			orderId: '',
 			orderId: '',
 			discernReceiptList: [],
 			discernReceiptList: [],
 			shopOrderList: [],
 			shopOrderList: [],
@@ -128,8 +141,8 @@ export default {
 			userInfo: {},
 			userInfo: {},
 			isCollapse: false
 			isCollapse: false
 		}
 		}
-	}, 
-	computed: {  
+	},
+	computed: {
 		...mapGetters(['userId', 'userIdentity', 'isIphoneX']),
 		...mapGetters(['userId', 'userIdentity', 'isIphoneX']),
 		// 当前用户是否为协销
 		// 当前用户是否为协销
 		isDealer() {
 		isDealer() {
@@ -183,7 +196,7 @@ export default {
 			this.buttonCount = e.count
 			this.buttonCount = e.count
 			console.log(e.count)
 			console.log(e.count)
 		},
 		},
-		onCollapse(){
+		onCollapse() {
 			this.isCollapse = !this.isCollapse
 			this.isCollapse = !this.isCollapse
 		}
 		}
 	}
 	}
@@ -199,7 +212,7 @@ export default {
 	box-sizing: border-box;
 	box-sizing: border-box;
 
 
 	&.has-bottom {
 	&.has-bottom {
-		padding-bottom: 100rpx;
+		padding-bottom: 120rpx;
 	}
 	}
 
 
 	.order-status {
 	.order-status {
@@ -351,6 +364,25 @@ export default {
 			border-radius: 8rpx;
 			border-radius: 8rpx;
 			font-size: 24rpx;
 			font-size: 24rpx;
 			color: #b2b2b2;
 			color: #b2b2b2;
+			&.arrowdown,
+			&.arrowup {
+				&::after {
+					content: '';
+					display: block;
+					width: 30rpx;
+					height: 30rpx;
+					margin-left: 6rpx;
+					background-repeat: no-repeat;
+					background-size: 30rpx;
+					background-position: center;
+					background-image: url(https://static.caimei365.com/app/mini-hehe/icon/icon-arrowdown.png);
+				}
+			}
+			&.arrowup {
+				&::after {
+					transform: rotateZ(180deg);
+				}
+			}
 		}
 		}
 	}
 	}
 }
 }

+ 108 - 102
pages/order/order-pay.vue

@@ -1,110 +1,55 @@
 <template>
 <template>
 	<view class="order-pay">
 	<view class="order-pay">
 		<view class="top-tip">请对每家店铺分别进行付款</view>
 		<view class="top-tip">请对每家店铺分别进行付款</view>
-		<view class="shop-info">
-			<view class="shop-name">浙江瑞琪</view>
-			<view class="product-list">
-				<view class="product">
-					<image class="cover" src="https://picsum.photos/200/200" mode="widthFix"></image>
-					<view class="content">
-						<view class="title">韩国恩盛进口氢洁气小气泡清韩国恩盛盛进口氢洁气小气泡清...</view>
-						<view class="unit">规格:10ml/盒</view>
-						<view class="tags">
-							<view class="tag type1">促销</view>
-							<view class="tag type1">自营</view>
-							<view class="tag type2">活动价</view>
+		<template v-for="item in orderList">
+			<view class="shop-info" :key="item.shopId">
+				<view class="shop-name">{{ item.shopName }}</view>
+				<view class="product-list">
+					<template v-for="product in item.orderProductList">
+						<view class="product" :key="product.orderProductId">
+							<image class="cover" :src="product.productImage" mode="widthFix"></image>
+							<view class="content">
+								<view class="title">{{ product.name }}</view>
+								<view class="unit">规格:{{ product.productUnit }}</view>
+								<view class="tags">
+									<template v-if="product.activeStatus">
+										<view class="tag type1" v-if="userId === product.heUserId">促销</view>
+										<view class="tag type1" v-else>自营</view>
+										<view
+											class="tag type2"
+											v-if="product.ladderList && product.ladderList.length > 0"
+										>
+											活动价
+										</view>
+									</template>
+								</view>
+								<view class="price">
+									<text class="active">¥{{ product.price | formatPrice }}</text>
+									<text class="deleted">¥{{ product.normalPrice | formatPrice }}</text>
+								</view>
+							</view>
 						</view>
 						</view>
-						<view class="price">
-							<text class="active">¥50.00</text>
-							<text class="deleted">¥80.00</text>
-						</view>
-					</view>
+					</template>
 				</view>
 				</view>
-			</view>
-			<view class="total">
-				<text>优惠:¥20.00</text>
-				<text>已付:¥0</text>
-			</view>
-			<view class="foot">
-				<view class="price">
-					<text>待付:</text>
-					<text class="active">¥100.00</text>
+				<view class="total">
+					<text v-if="item.eachDiscount">优惠:¥{{ item.eachDiscount }}</text>
+					<text v-if="item.receiptAmount">已付:¥{{ item.receiptAmount }}</text>
 				</view>
 				</view>
-				<view class="submit">付款</view>
-			</view>
-		</view>
-
-		<view class="shop-info">
-			<view class="shop-name">浙江瑞琪</view>
-			<view class="product-list">
-				<view class="product">
-					<image class="cover" src="https://picsum.photos/200/200" mode="widthFix"></image>
-					<view class="content">
-						<view class="title">韩国恩盛进口氢洁气小气泡清韩国恩盛盛进口氢洁气小气泡清...</view>
-						<view class="unit">规格:10ml/盒</view>
-						<view class="tags">
-							<view class="tag type1">促销</view>
-							<view class="tag type1">自营</view>
-							<view class="tag type2">活动价</view>
-						</view>
-						<view class="price">
-							<text class="active">¥50.00</text>
-							<text class="deleted">¥80.00</text>
-						</view>
+				<view class="foot">
+					<view class="price">
+						<text>待付:</text>
+						<text class="active">¥{{ item.restAmount | formatPrice }}</text>
 					</view>
 					</view>
+					<view class="submit" @click="onPayOrder(item)">付款</view>
 				</view>
 				</view>
 			</view>
 			</view>
-			<view class="total">
-				<text>优惠:¥20.00</text>
-				<text>已付:¥0</text>
-			</view>
-			<view class="foot">
-				<view class="price">
-					<text>待付:</text>
-					<text class="active">¥100.00</text>
-				</view>
-				<view class="submit">付款</view>
-			</view>
-		</view>
+		</template>
 
 
-		<view class="shop-info">
-			<view class="shop-name">浙江瑞琪</view>
-			<view class="product-list">
-				<view class="product">
-					<image class="cover" src="https://picsum.photos/200/200" mode="widthFix"></image>
-					<view class="content">
-						<view class="title">韩国恩盛进口氢洁气小气泡清韩国恩盛盛进口氢洁气小气泡清...</view>
-						<view class="unit">规格:10ml/盒</view>
-						<view class="tags">
-							<view class="tag type1">促销</view>
-							<view class="tag type1">自营</view>
-							<view class="tag type2">活动价</view>
-						</view>
-						<view class="price">
-							<text class="active">¥50.00</text>
-							<text class="deleted">¥80.00</text>
-						</view>
-					</view>
-				</view>
-			</view>
-			<!-- <view class="total">
-				<text>优惠:¥20.00</text>
-				<text>已付:¥0</text>
-			</view> -->
-			<view class="foot">
-				<view class="price">
-					<text>待付:</text>
-					<text class="active">¥100.00</text>
-				</view>
-				<view class="submit">付款</view>
-			</view>
-		</view>
-
-		<view class="shop-info">
+		<!-- <view class="shop-info">
 			<view class="shop-name">采美快递物流商</view>
 			<view class="shop-name">采美快递物流商</view>
 			<view class="product-list">
 			<view class="product-list">
 				<view class="product">
 				<view class="product">
-					<image class="cover" src="https://picsum.photos/200/200" mode="widthFix"></image>
+					<image class="cover" src="https://static.caimei365.com/app/mini-hehe/icon/icon-logistics.png" mode="widthFix"></image>
 					<view class="content between">
 					<view class="content between">
 						<view class="title">运费</view>
 						<view class="title">运费</view>
 						<view class="price"><text>¥50.00</text></view>
 						<view class="price"><text>¥50.00</text></view>
@@ -113,7 +58,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 			<view class="total">
 			<view class="total">
-				<!-- <text>优惠:¥20.00</text> -->
+				<text>优惠:¥20.00</text>
 				<text>已付:¥0</text>
 				<text>已付:¥0</text>
 			</view>
 			</view>
 			<view class="foot">
 			<view class="foot">
@@ -123,10 +68,10 @@
 				</view>
 				</view>
 				<view class="submit" @click="onPay">付款</view>
 				<view class="submit" @click="onPay">付款</view>
 			</view>
 			</view>
-		</view>
+		</view> -->
 
 
 		<!-- 弹框 -->
 		<!-- 弹框 -->
-		<tui-modal
+		<!-- <tui-modal
 			:show="modal"
 			:show="modal"
 			:size="30"
 			:size="30"
 			:button="[{ text: '确定', type: 'danger' }]"
 			:button="[{ text: '确定', type: 'danger' }]"
@@ -135,24 +80,83 @@
 			title="提示"
 			title="提示"
 			content="抱歉,该商品支付正在调整暂不支持下单!"
 			content="抱歉,该商品支付正在调整暂不支持下单!"
 			@click="onConfirm"
 			@click="onConfirm"
+		></tui-modal> -->
+
+		<!-- 操作弹窗 -->
+		<tui-modal
+			:show="modal"
+			content="确认支付?"
+			:size="32"
+			:maskClosable="false"
+			color="#333"
+			shape="circle"
+			@click="handleModalConfirm"
 		></tui-modal>
 		></tui-modal>
+
+		<!-- 加载框 -->
+		<cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+import { mapGetters } from 'vuex'
+import wechatPay from './mixins/wechatPay.js'
+import CmLoading from '@/components/cm-module/cm-loading/cm-loading.vue'
 export default {
 export default {
+	mixins: [wechatPay],
+	components: {
+		CmLoading
+	},
 	data() {
 	data() {
 		return {
 		return {
-			modal: false
+			orderId: '',
+			modal: false,
+			orderList: [],
+			hanldOrder: {
+				order: {}
+			}
 		}
 		}
 	},
 	},
+	computed: {
+		...mapGetters(['userId'])
+	},
+	onLoad(option) {
+		this.orderId = option.orderId
+		this.getOrderDetail()
+	},
 	methods: {
 	methods: {
-		onConfirm(e) {
-			if (e.index) return
+		// 支付回调执行函数
+		orderPaySuccess() {
+			this.$on('orderPaySuccess', () => {
+				const orderInfo = this.hanldOrder.order
+				this.getOrderDetail()
+				if (orderInfo.collageFlag) {
+					uni.navigateTo({ url: `/pages/fight-order/fight-detail?collageId=${orderInfo.collageId}` })
+				} else {
+					uni.redirectTo({ url: '/pages/order/success' })
+				}
+			})
+		},
+		handleModalConfirm() {
 			this.modal = false
 			this.modal = false
+			this.miniWxPayFor(this.hanldOrder.order)
 		},
 		},
-		onPay() {
+		// 子订单支付
+		onPayOrder(orderInfo) {
+			orderInfo.payableAmount = orderInfo.restAmount
+			this.hanldOrder.order = orderInfo
 			this.modal = true
 			this.modal = true
+		},
+		getOrderDetail() {
+			this.OrderService.QueryOrderDetails({ orderId: this.orderId })
+				.then(res => {
+					this.orderList = res.data.shopOrderList
+				})
+				.catch(err => {
+					this.$util.modal('提示', '订单查询失败,请稍后重试~', '确定', '', false, () => {
+						this.$api.switchTabTo('/pages/tabBar/index/index')
+					})
+				})
 		}
 		}
 	}
 	}
 }
 }
@@ -249,7 +253,8 @@ export default {
 							&.type2 {
 							&.type2 {
 								width: 80rpx;
 								width: 80rpx;
 								color: #f83c6c;
 								color: #f83c6c;
-								background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-active.png) top center no-repeat;
+								background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-active.png) top
+									center no-repeat;
 								background-size: contain;
 								background-size: contain;
 							}
 							}
 							&.type3 {
 							&.type3 {
@@ -274,6 +279,7 @@ export default {
 					}
 					}
 
 
 					.deleted {
 					.deleted {
+						margin-left: 24rpx;
 						font-size: 24rpx;
 						font-size: 24rpx;
 						color: #999;
 						color: #999;
 						text-decoration: line-through;
 						text-decoration: line-through;

+ 2 - 2
services/config.env.js

@@ -3,9 +3,9 @@ if (process.env.NODE_ENV === 'development') {
     // 开发环境
     // 开发环境
     // URL_CONFIG = 'http://192.168.2.75:8011'	 //采美测试地址
     // URL_CONFIG = 'http://192.168.2.75:8011'	 //采美测试地址
     // URL_CONFIG = 'http://192.168.2.67:8011'	 //裴裴联调地址
     // URL_CONFIG = 'http://192.168.2.67:8011'	 //裴裴联调地址
-    // URL_CONFIG = 'http://192.168.2.68:8011'	 //涛涛联调地址
+    URL_CONFIG = 'http://192.168.2.68:8011'	 //涛涛联调地址
     // URL_CONFIG = 'http://127.0.0.1:8011'	 //本地联调地址
     // URL_CONFIG = 'http://127.0.0.1:8011'	 //本地联调地址
-    URL_CONFIG = 'https://mall2c-b.caimei365.com'
+    // URL_CONFIG = 'https://mall2c-b.caimei365.com'
     // URL_CONFIG = 'https://mall2c.caimei365.com'
     // URL_CONFIG = 'https://mall2c.caimei365.com'
 } else {
 } else {
     // 生产环境
     // 生产环境