Explorar o código

呵呵商城拼团,分享减免接口调试

喻文俊 %!s(int64=3) %!d(string=hai) anos
pai
achega
d29c01173f

+ 88 - 43
components/cm-module/cm-goods-nav/cm-goods-nav.vue

@@ -18,7 +18,7 @@
                     <view class="right">
                         <view class="number">
                             <text>数量:</text>
-                            <number-box :value="count" @change="countChange" :max="collageProduct.limitedNum || 99999999"></number-box>
+                            <cm-number-box v-model="count" :min="1" :max="maxCount"></cm-number-box>        
                         </view>
                         <view class="single-price">
                             <text>单价:¥</text> <text class="price">{{ buyRetailPrice | formatPrice }}</text>
@@ -34,11 +34,13 @@
 <script>
 import CmDrawer from '@/components/cm-module/cm-drawer/cm-drawer.vue'
 import NumberBox from '@/components/cm-module/cm-cart-product/number-box.vue'
+import CmNumberBox from '@/components/cm-module/cm-number-box/cm-number-box.vue'
 import { mapGetters, mapActions, mapMutations } from 'vuex'
 export default {
     components: {
         NumberBox,
-        CmDrawer
+        CmDrawer,
+        CmNumberBox
     },
     props: {
         productInfo: {
@@ -52,8 +54,8 @@ export default {
             count: 1,
             navType: 1,
             countVisible: false,
-            buyPrice: 0,
-            btnClickType: -1,
+            // 购买类型: 0:正常价格购买 1:拼团价购买
+            handleClickType : 0,
             options: [
                 {
                     icon: 'home',
@@ -75,14 +77,14 @@ export default {
 
             leftButton: {
                 text: '加入购物车',
-                price: 1000,
+                price: 0,
                 backgroundColor: '#FFEFF4',
                 color: '#FF457B'
             },
 
             rightButton: {
                 text: '立即购买',
-                price: 800,
+                price: 0,
                 backgroundColor: 'linear-gradient(90deg, #FC32B4 0%, #F83C6C 100%)',
                 color: '#fff'
             }
@@ -93,11 +95,19 @@ export default {
         buttonGroup() {
             return [this.leftButton, this.rightButton]
         },
+        // 最终购买价格
         buyRetailPrice() {
-            return this.processActivityPrice()
+            return this.processPrice()
         },
         collageProduct(){
             return this.productInfo.collageProduct || {}
+        },
+        maxCount(){
+            if(this.collageProduct.unlimitedFlag === 1){
+                return this.collageProduct.limitedNum
+            }else{
+                return this.productInfo.stock
+            }
         }
     },
     watch: {
@@ -111,24 +121,28 @@ export default {
                 this.navType = this.productInfo.collageStatus === 1 ? 2 : 1
                 this.resetButtonInfo()
             }
+        },
+        count(nVal){
+            console.log(nVal)
         }
     },
     created() {
         this.options[2].info = this.kindCount
-        // this.initBuyPrice()
     },
     methods: {
         ...mapActions('cart', ['addToCart', 'getCartNumber']),
 
         // 处理购买按钮信息
         resetButtonInfo() {
+            // 导航类型1
             if (this.navType === 1) {
                 this.leftButton.text = '加入购物车'
                 this.rightButton.text = '立即购买'
             }
+            // 导航类型2
             if (this.navType === 2) {
                 this.leftButton.text = '单独购买'
-                this.leftButton.price = this.buyRetailPrice
+                this.leftButton.price = this.productInfo.normalPrice
                 this.rightButton.text = '拼团购买'
                 this.rightButton.price = this.productInfo.price
             }
@@ -141,12 +155,7 @@ export default {
             this.countVisible = false
             this.count = 1
         },
-        // 初始化购买价格
-        initBuyPrice() {
-            if (this.productInfo.activeStatus === 1 && this.productInfo.ladderList && this.productInfo.length > 0) {
-                this.count = this.productInfo.ladderList[0].buyNum
-            }
-        },
+       
         // 左边按钮
         onClick(e) {
             const clickFns = {
@@ -155,30 +164,70 @@ export default {
                 2: this.toCart
             }
             clickFns[e.index]()
-            console.log(e.index)
         },
         // 右边按钮
         buttonClick(e) {
             this.countVisible = true
-            this.btnClickType = e.index
+            this.handleClickType = e.index
         },
-        // 确认
+        // 确认操作
         confirm() {
             this.countVisible = false
+            // 判断登录
+            if (!this.hasLogin) return this.toLogin()
+            // 导航类型1
             if(this.navType === 1){
                 const clickFns = {
                     0: this.joinCart,
                     1: this.buyNow
                 }
-                clickFns[this.btnClickType]()
+                clickFns[this.handleClickType]()
             }
+            
+            // 导航类型2
             if(this.navType === 2){
                 const clickFns = {
                     0: this.buyNow,
                     1: this.buyGroupNow
                 }
-                clickFns[this.btnClickType]()
+                clickFns[this.handleClickType]()
+            }
+        },
+        
+        // 立即购买
+        buyNow() {
+            let productStp = {
+                allPrice: this.count * this.buyRetailPrice,
+                allCount: this.count,
+                productId: this.productInfo.productId,
+                productCount: this.count,
+                heUserId: this.productInfo.heUserId,
+                collageFlag: 0
+            }
+			uni.setStorageSync('commitProductInfo', productStp)
+            this.countVisible = false
+            this.toCreateOrder()
+        },
+        // 拼团购买
+        buyGroupNow(){
+            console.log('拼团购买')
+            let productStp = {
+                allPrice: this.count * this.buyRetailPrice,
+                allCount: this.count,
+                productId: this.productInfo.productId,
+                productCount: this.count,
+                heUserId: this.productInfo.heUserId,
+                collageFlag: 1
             }
+            uni.setStorageSync('commitProductInfo', productStp)
+            this.countVisible = false
+            this.toCreateOrder()
+        },
+        
+        
+        // 跳转到创建订单
+        toCreateOrder() {
+            this.$api.navigateTo('/pages/order/create-order?type=prodcut')
         },
         // 跳转首页
         toHome() {
@@ -194,12 +243,10 @@ export default {
         },
         // 去购物车
         toCart() {
-            if (!this.hasLogin) return this.toLogin()
             uni.navigateTo({ url: '/pages/goods/cart' })
         },
         // 加入购物车
         joinCart() {
-            if (!this.hasLogin) return this.toLogin()
             this.addToCart({
                 productId: this.productInfo.productId,
                 productCount: this.count
@@ -207,28 +254,24 @@ export default {
                 this.countVisible = false
             })
         },
-        // 立即购买
-        buyNow() {
-            if (!this.hasLogin) return this.toLogin()
-            let productStp = {
-                allPrice: this.count * this.buyRetailPrice,
-                allCount: this.count,
-                productId: this.productInfo.productId,
-                productCount: this.count,
-                heUserId: this.productInfo.heUserId
+        
+        //处理最终的购买价格
+        processPrice() {
+            
+            // 拼团价 
+            if(this.productInfo.collageStatus === 1){
+                // 购买方式为拼团购买
+                if(this.handleClickType === 1){
+                    return this.productInfo.price
+                }
+                // 购买方式为正常价购买
+                if(this.handleClickType === 0){
+                    return this.productInfo.normalPrice
+                }
+                
             }
-			uni.setStorageSync('commitProductInfo', productStp)
-            this.$api.navigateTo('/pages/order/create-order?type=prodcut')
-            this.countVisible = false
-        },
-        // 拼团购买
-        buyGroupNow(){
-            if (!this.hasLogin) return this.toLogin()
-            console.log('拼团购买')
-            this.countVisible = false
-        },
-        //单独处理活动价格和阶梯价格
-        processActivityPrice() {
+            
+            // 活动价
             if (this.productInfo.activeStatus === 1 && this.productInfo.ladderList) {
                 this.productInfo.ladderList.forEach((item, index) => {
                     if (this.count >= item.buyNum) {
@@ -236,6 +279,8 @@ export default {
                     }
                 })
             }
+            
+            // 其它价格
             return this.productInfo.price
         }
     }

+ 103 - 0
components/cm-module/cm-number-box/cm-number-box.vue

@@ -0,0 +1,103 @@
+<template>
+    <view class="number-box">
+        <view class="sub iconfont icon-jianhao" @click="sub"></view>
+        <input class="number" type="number" v-model="count" @blur="blur" />
+        <view class="add iconfont icon-jiahao" @click="add"></view>
+    </view>
+</template>
+
+<script>
+export default {
+    name: 'number-box',
+    data() {
+        return {
+            count: 1
+        }
+    },
+    model: {
+        prop: 'value',
+        event: 'input'
+    },
+    props: {
+        value: {
+            type: Number,
+            default: 0
+        },
+        max: {
+            type: Number,
+            default: 99999999
+        },
+        min: {
+            type: Number,
+            default: 1
+        }
+    },
+    watch: {
+        count(nVal){
+            this.count = parseInt(nVal)
+        }
+    },
+    created() {
+      this.count = this.value  
+    },
+    methods: {
+        add() {
+            if (this.count === this.max) {
+                this.$util.msg(`购买数量不能大于${this.max}`, 2000)
+                return
+            }
+            this.count++
+            this.$emit('input', this.count)
+        },
+        sub() {
+            if (this.count === this.min) {
+                this.$util.msg(`购买数量不能少于${this.min}`, 2000)
+                return
+            }
+            this.count--
+            this.$emit('input', this.count)
+        },
+        blur() {
+            if (this.count > this.max) {
+                this.count = this.max
+                this.$util.msg(`购买数量不能大于${this.max}`, 2000)
+            }
+            if (this.count < this.min) {
+                this.count = this.min
+                this.$util.msg(`购买数量不能少于${this.min}`, 2000)
+            }
+            this.$emit('input', this.count)
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.number-box {
+    width: 148rpx;
+    height: 48rpx;
+    box-sizing: border-box;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    border-radius: 24rpx;
+    border: 1rpx solid #e1e1e1;
+    .sub,
+    .add {
+        flex: 1;
+        text-align: center;
+        font-size: 28rpx;
+        color: #ccc;
+    }
+    .number {
+        text-align: center;
+        width: 56rpx;
+        font-size: 26rpx;
+        font-weight: 500;
+        color: #333333;
+        box-sizing: border-box;
+        border-right: 1rpx solid #e1e1e1;
+        border-left: 1rpx solid #e1e1e1;
+    }
+}
+</style>

+ 3 - 1
components/cm-module/cm-order-control-nav/cm-order-control-nav.vue

@@ -1,6 +1,7 @@
 <template>
     <view class="cm-order-control-nav">
-        <view class="btn type1" v-if="btnState.share" @click.stop="handleClick('share')">邀好友拼单</view>
+        <view class="btn type2" v-if="btnState.share" @click.stop="handleClick('fightDetail')">拼团详情</view>
+        <view class="btn type1" v-if="btnState.share" @click.stop="handleClick('share')">邀好友拼团</view>
         <view class="btn type2" v-if="btnState.cancel" @click.stop="handleClick('cancel')">取消订单</view>
         <view class="btn type2" v-if="btnState.delete" @click.stop="handleClick('delete')">删除订单</view>
         <view class="btn type2" v-if="btnState.query" @click.stop="handleClick('query')">查看物流</view>
@@ -22,6 +23,7 @@ export default {
     data() {
         return {
             mapState: {
+                fightDetail:[],
                 share: [],
                 query: [4, 5, 12, 13, 33, 22, 23, 32, 77],
                 delete: [6],

+ 5 - 2
components/cm-module/cm-order-information/cm-order-information.vue

@@ -25,7 +25,10 @@
             <view class="col" v-if="orderInfo.receiptDate">
                 <view class="label">支付时间:</view> <view class="content"> {{ orderInfo.receiptDate }} </view>
             </view>
-            <view class="col"> <view class="label">分享减免:</view> <view class="content">¥100.00</view> </view>
+            <view class="col">
+                <view class="label">分享减免:</view>
+                <view class="content">¥{{ orderInfo.reductionAmount | formatPrice }}</view>
+            </view>
         </view>
         <view class="row">
             <view class="col" v-if="orderInfo.couponAmount">
@@ -48,7 +51,7 @@ export default {
             default: () => {}
         }
     },
- 
+
     methods: {
         copyOrderNum() {
             uni.setClipboardData({

+ 12 - 6
components/cm-module/cm-order-prodcut/cm-order-prodcut.vue

@@ -5,15 +5,17 @@
             <view class="title">{{ goodsData.name || goodsData.productName }}</view>
             <view class="unit">规格:{{ goodsData.productUnit || goodsData.unit }}</view>
             <view class="tags">
-                <view class="tag type1" v-if="userId === goodsData.heUserId">促销</view>
-                <view class="tag type1" v-else>自营</view>
-                <view class="tag type3">拼团价</view> 
-                <view class="tag type2" v-if="goodsData.ladderList.length > 0">活动价</view>
-                <view class="tag type2">优惠券</view>
+                <view class="tag type3" v-if="goodsData.collageStatus">拼团价</view> 
+                <template v-if="goodsData.activeStatus">
+                    <view class="tag type1" v-if="userId === goodsData.heUserId">促销</view>
+                    <view class="tag type1" v-else>自营</view>
+                    <view class="tag type2" v-if="goodsData.ladderList.length > 0">活动价</view>
+                </template>
+                <!-- <view class="tag type2" v-if="false">优惠券</view> -->
             </view>
             <view class="price"> 
                 <text>¥{{ goodsData.price | formatPrice }}</text> 
-                <text class="delete">单买价:¥400.00</text> 
+                <text class="delete" v-if="normal && goodsData.normalPrice">单买价:¥{{ goodsData.normalPrice | formatPrice }}</text> 
             </view>
         </view>
         <text class="count" v-if="countVisible">×{{ goodsData.num || goodsData.productCount }}</text>
@@ -30,6 +32,10 @@ export default {
         goodsData: {
             type: Object,
             default:()=>{}
+        },
+        normal: {
+            type: Boolean,
+            default: false
         }
     },
 	computed:{

+ 80 - 0
components/cm-module/cm-order-share-reduce/cm-order-share-reduce.vue

@@ -0,0 +1,80 @@
+<template>
+    <view class="share-reduce">
+        <template v-if="!reductionData.status">
+            <view class="left-title high">
+                <text>金额满{{ reduction.touchPrice }}元,分享可立减{{ reduction.reducedAmount }}元</text>
+            </view>
+            <view class="right-content">
+                <view class="share-btn">
+                    <!-- 分享按钮 -->
+                    <button open-type="share">点击分享</button>
+                </view>
+            </view>
+        </template>
+        <template v-else>
+            <view class="left-title">分享减免</view>
+            <view class="right-content">
+                <view class="reduce-amount">-¥{{ reduction.reducedAmount | formatPrice }}</view>
+                <view class="iconfont icon-chakangengduo"></view>
+            </view>
+        </template>
+    </view>
+</template>
+
+<script>
+export default {
+    props: {
+        reductionData: {
+            type: Object,
+            default: () => {}
+        }
+    },
+    computed: {
+        reduction() {
+            return this.reductionData.reduction || {}
+        }
+    },
+    created() {
+        console.log(this.reductionData)
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.share-reduce {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 0 24rpx;
+    height: 90rpx;
+    background: #fff;
+    .left-title {
+        font-weight: bold;
+        color: #333333;
+        font-size: 28rpx;
+        &.high {
+            color: #ff457b;
+        }
+    }
+    .right-content {
+        display: flex;
+        justify-content: flex-start;
+        align-items: center;
+        .coupon-amount,
+        .reduce-amount,
+        .share-btn {
+            font-size: 28rpx;
+            color: #ff457b;
+            margin-right: 12rpx;
+            button {
+                display: inline;
+                color: #ff457b;
+            }
+        }
+        .iconfont {
+            font-size: 28rpx;
+            color: #b2b2b2;
+        }
+    }
+}
+</style>

+ 2 - 2
components/cm-module/cm-product/cm-product.vue

@@ -9,7 +9,7 @@
             <!-- 标签 -->
             <view class="tags">
                 <!-- <view class="tag type1">自营</view> -->
-                <view class="tag type3" v-if="data.collageStatus">拼团价</view>
+                <view class="tag type3" v-if="data.collageStatus === 1">拼团价</view>
                 <view class="tag type2" v-if="data.activeStatus == 1 && data.collageStatus === 0">活动价</view>
                 <view class="tag type2" v-if="data.couponsLogo">优惠券</view>
             </view>
@@ -21,7 +21,7 @@
                     <text class="delete" v-if="data.normalPrice">¥{{ data.normalPrice | formatPrice }}</text>
                 </view>
                 <!-- 加入购物车 --> 
-                <view class="add-cart iconfont icon-gouwuche" @click.stop="addCart"></view>
+                <view class="add-cart iconfont icon-gouwuche" @click.stop="addCart" v-if="data.collageStatus !== 1"></view>
             </view>
         </view>
     </view>

+ 488 - 374
pages/order/create-order.vue

@@ -1,67 +1,69 @@
 <template>
-	<view class="create-order">
-		<!-- 收货地址 -->
-		<view class="order-top">
-			<cm-choose-address :addressData="addressData"></cm-choose-address>
-		</view>
-		<view class="grid"></view>
-		<!-- 订单列表 -->
-		<view class="order-list">
-			<view class="order-section" v-for="(shopInfo, shopInfoIndex) in goodsData" :key="shopInfoIndex">
-				<!-- 供应商 -->
-				<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>
-				</view>
-				<!-- 留言 -->
-				<view class="remark">
-					<view class="label">留言:</view>
-					<input class="control" type="text" v-model="shopInfo.note" placeholder="请输入内容" />
-				</view>
-			</view>
-		</view>
-		<view class="grid"></view>
-		<!-- 优惠券 -->
-		<cm-order-coupon-section
-			@click="couponVisible = true"
-			:coupon="currentCoupon"
-			v-if="receiveCouponList.length > 0"
-		></cm-order-coupon-section>
-		<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="currentCouponId"
-		></cm-coupon-list>
-		<cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
-		<view class="reserved" v-if="isIphoneX"></view>
-	</view>
+    <view class="create-order">
+        <!-- 收货地址 -->
+        <view class="order-top"> <cm-choose-address :addressData="addressData"></cm-choose-address> </view>
+        <view class="grid"></view>
+        <!-- 订单列表 -->
+        <view class="order-list">
+            <view class="order-section" v-for="(shopInfo, shopInfoIndex) in goodsData" :key="shopInfoIndex">
+                <!-- 供应商 -->
+                <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>
+                </view>
+                <!-- 留言 -->
+                <view class="remark">
+                    <view class="label">留言:</view>
+                    <input class="control" type="text" v-model="shopInfo.note" placeholder="请输入内容" />
+                </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>
+
+        <!-- 提交导航 -->
+        <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="currentCouponId"
+        ></cm-coupon-list>
+        <cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
+        <view class="reserved" v-if="isIphoneX"></view>
+    </view>
 </template>
 
 <script>
@@ -70,6 +72,7 @@ import CmOrderProdcut from '@/components/cm-module/cm-order-prodcut/cm-order-pro
 import CmOrderSubmitNav from '@/components/cm-module/cm-order-submit-nav/cm-order-submit-nav.vue'
 import CmOrderCouponSection from '@/components/cm-module/cm-order-coupon-section/cm-order-coupon-section.vue'
 import CmOrderFreightSection from '@/components/cm-module/cm-order-freight-section/cm-order-freight-section.vue'
+import CmOrderShareReduce from '@/components/cm-module/cm-order-share-reduce/cm-order-share-reduce.vue'
 import CmLoading from '@/components/cm-module/cm-loading/cm-loading.vue'
 import CmCouponList from '@/components/cm-module/cm-coupon-list/cm-coupon-list'
 
@@ -78,334 +81,445 @@ import { mapGetters } from 'vuex'
 import wechatPay from './mixins/wechatPay.js'
 
 export default {
-	// 混入
-	mixins: [wechatPay],
-	components: {
-		CmOrderProdcut,
-		CmChooseAddress,
-		CmOrderSubmitNav,
-		CmOrderCouponSection,
-		CmOrderFreightSection,
-		CmCouponList,
-		CmLoading
-	},
-	data() {
-		return {
-			// 收货地址
-			addressData: {},
-
-			productIds: '',
-			params: {},
-			subParams: {
-				userId: 0,
-				orderInfo: [], //提交的商品信息
-				addressId: 0,
-				cartType: 0,
-				payInfo: {
-					orderShouldPayFee: 0
-				}
-			},
-			goodsData: [], // 供应商下的商品
-			allPrice: 0,
-			productList: [], // 商品列表
-			allCount: 0,
-			hanldOrder: {},
-			
-			// 优惠券
-			couponVisible: false,
-			receiveCouponList: [],
-			currentCouponId: -1,
-			currentCoupon: {},
-			canUseCouponList: [],
-			notUseCouponList: [],
-			
-		}
-	},
-	computed: {
-		...mapGetters(['userId', 'isIphoneX']),
-		// 选中的优惠券的金额
-		couponAmount() {
-			return this.currentCouponId > -1 ? this.currentCoupon.couponAmount : 0
-		},
-		// 优惠价格
-		discountedPrice() {
-			return this.couponAmount
-		},
-		// 支付金额
-		payAllPrice() {
-			const payAllPrice = this.allPrice - this.couponAmount
-			return payAllPrice <= 0 ? 0 : payAllPrice
-		},
-		submitOrderInfo(){
-			return {
-				allCount: this.allCount,
-				payAllPrice: this.payAllPrice,
-				discountedPrice: this.discountedPrice
-			}
-		}
-	},
-	onLoad(options) {
-		this.getAddressData()
-		this.initOptions(options)
-	},
-	beforeDestroy() {
-		uni.removeStorageSync('commitProductInfo')
-		uni.removeStorageSync('commitCartPramsData')
-	},
-	methods: {
-		// 初始化参数信息
-		initOptions(options) {
-			// 从商品详情进入
-			if (options.type == 'prodcut') {
-				const productInfo = uni.getStorageSync('commitProductInfo')
-				this.params.productCount = productInfo.productCount
-				this.params.productId = productInfo.productId
-				this.params.heUserId = productInfo.heUserId || 0
-				this.productIds = productInfo.productId.toString()
-				this.allCount = productInfo.allCount
-			} else {
-				const cartPramsData = uni.getStorageSync('commitCartPramsData')
-				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.currentCouponId = 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.currentCouponId)
-			// 从列表中删除
-			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.currentCouponId = coupon.uniqueId
-			} else {
-				this.currentCoupon = null
-				this.currentCouponId = -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()
-				})
-				.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)
-		    // 选中的优惠券id
-		    this.subParams.couponId = this.currentCouponId === -1 ? '' : this.currentCoupon.couponId
-		    this.subParams.couponShareId = this.currentCoupon ? this.currentCoupon.couponShareId : null
-		    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 }
-		    })
-		    this.isSubLoading = true
-		    this.loadingText = '正在创建订单...'
-		    this.OrderService.CreatedOrderSubmit(this.subParams)
-		        .then(response => {
-		            const data = response.data
-		            this.hanldOrder.order = response.data
-		            if (parseFloat(data.payableAmount) === 0) {
-		                uni.setStorageSync('orderInfo', this.hanldOrder.order)
-		                uni.redirectTo({ url: '/pages/user/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 {
+            // 收货地址
+            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: [],
+            currentCouponId: -1,
+            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.currentCouponId > -1 ? this.currentCoupon.couponAmount : 0
+        },
+        // 优惠价格
+        discountedPrice() {
+            return this.couponAmount + this.shareReducedAmount
+        },
+        // 支付金额
+        payAllPrice() {
+            const payAllPrice = this.allPrice - this.couponAmount - this.shareReducedAmount
+            return payAllPrice <= 0 ? 0 : payAllPrice
+        },
+        submitOrderInfo() {
+            return {
+                allCount: this.allCount,
+                payAllPrice: this.payAllPrice,
+                discountedPrice: this.discountedPrice,
+            }
+        },
+        // 优惠券,分享活动相关参数
+        discountInfo() {
+            return {
+                //优惠券ID
+                couponId: this.currentCouponId === -1 ? 0 : this.currentCoupon.couponId,
+                //优惠券分享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.getAddressData()
+        this.initOptions(options)
+        this.$on('orderPaySuccess', ()=>{
+            if(this.collageFlag === 1){
+                uni.reLaunch({ url: '/pages/fight-order/fight-detail' })
+            }else{
+                uni.reLaunch({ url: '/pages/order/success' })
+            }
+        })
+    },
+    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: {
+        // 分享
+        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.productIds = productInfo.productId.toString()
+                this.allCount = productInfo.allCount
+                this.params.collageFlag = this.collageFlag = productInfo.collageFlag
+            } 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.currentCouponId = 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.currentCouponId)
+            // 从列表中删除
+            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.currentCouponId = coupon.uniqueId
+            } else {
+                this.currentCoupon = null
+                this.currentCouponId = -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
+                })
+                .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
+                    if (parseFloat(data.payableAmount) === 0) {
+                        uni.setStorageSync('orderInfo', this.hanldOrder.order)
+                        uni.redirectTo({ url: '/pages/user/order/success' })
+                    } else {
+                        this.miniWxPayFor(data)
+                    }
+                })
+                .catch(error => {
+                    this.isSubLoading = false
+                    this.$util.msg(error.msg, 2000)
+                    this.isSubLoading = false
+                })
+        }
+    }
 }
 </script>
 
 <style lang="scss" scoped>
 .create-order {
-	background: #f7f7f7;
-	min-height: 100vh;
-	padding-top: 134rpx;
+    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;
-	}
+    box-sizing: border-box;
+
+    .order-top {
+        width: 100%;
+        position: fixed;
+        top: 0;
+        left: 0;
+        z-index: 999;
+    }
 }
 
 .grid {
-	width: 100%;
-	height: 20rpx;
-	background: #f7f7f7;
+    width: 100%;
+    height: 20rpx;
+    background: #f7f7f7;
 }
 
 .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 {
-	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 {
-	padding: 0 24rpx;
-	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: 0 24rpx;
+    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>

+ 17 - 8
pages/order/mixins/orderList.js

@@ -14,6 +14,7 @@ const orderList = {
         handleConfirmClick(e) {
             const { type, order } = (this.hanldOrder = e)
             switch (type) {
+
             // 其他操作
             case 'again':
                 this.buyAgain()
@@ -25,7 +26,13 @@ const orderList = {
                 this.isModalLayer = true
                 this.$api.navigateTo('/pages/order/order-logistics?orderId=' + order.orderId)
                 break
-                // 常规操作
+            case 'fightDetail':
+                console.log('拼团详情')
+                break
+            case 'share':
+                console.log('邀请好友拼团')
+                break        
+            // 常规操作
             case 'cancel':
                 this.modal = true
                 this.modalText = '确认取消该订单吗?'
@@ -132,9 +139,8 @@ const orderList = {
             }
             try {
                 const res = await confirmFunc[type](order)
-				// 确认操作订单成功后的回调都在这里执行
-				this.$emit('orderAction')
-                // this.resetOrderList()
+                // 确认操作订单成功后的回调都在这里执行 在this.$on 中监听 orderAction 事件的执行
+                this.$emit('orderAction')
                 if (res && res.msg) this.$util.msg(res.msg, 2000, true, 'success')
             } catch (error) {
                 this.$util.msg(error.msg, 2000)
@@ -151,13 +157,16 @@ const orderList = {
                 11: '待付款待发货',
                 12: '待付款部分发货',
                 13: '待付款已发货',
-                21: '部分付款待发货',
-                22: '部分付款部分发货',
-                23: '部分付款已发货',
+                // 21: '部分付款待发货',
+                // 22: '部分付款部分发货',
+                // 23: '部分付款已发货',
                 31: '已付款待发货',
                 32: '已付款部分发货',
                 33: '已付款已发货',
-                111: '待付款待发货'
+                111: '待付款待发货',
+                81: '拼团中',
+                82: '拼团成功待发货',
+                83: '拼团成功已发货'
             }
             return stateTextObject[status] || ''
         },

+ 3 - 1
pages/order/mixins/wechatPay.js

@@ -58,8 +58,10 @@ const wechatPay = {
                 const payFlag = await wxRequestPayment(payment)
                 // 支付成功重定向
                 uni.setStorageSync('orderInfo', this.hanldOrder.order)
+                
                 if (payFlag) {
-                    uni.reLaunch({ url: '/pages/order/success' })
+                    // 微信支付成功回调 在页面onload中通过this.$on监听orderPaySuccess事件回调
+                    this.$emit('orderPaySuccess')
                 } else {
                     uni.reLaunch({ url: '/pages/order/error' })
                 }

+ 17 - 5
pages/order/order-list.vue

@@ -28,7 +28,8 @@
 			:buttonGroup="screenTabBar"
 			v-if="isDealer"
 		></cm-order-filter-control>
-
+        
+        <!-- 订单列表 -->
 		<swiper
 			:indicator-dots="false"
 			:autoplay="false"
@@ -111,7 +112,10 @@
 				</scroll-view>
 			</swiper-item>
 		</swiper>
-
+        
+        <!-- 加载框 -->
+        <cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
+        
 		<!-- 操作弹窗 -->
 		<tui-modal
 			:show="modal"
@@ -122,8 +126,7 @@
 			shape="circle"
 			@click="handleModalConfirm"
 		></tui-modal>
-		<!-- 加载框 -->
-		<cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
+		
 		<!-- 失效商品列表 -->
 		<cm-order-invalid-modal
 			:goodsList="invalidList"
@@ -172,6 +175,12 @@ export default {
 					pageNum: 1,
 					orderList: []
 				},
+                {
+                	name: '待分享',
+                	state: 5,
+                	pageNum: 1,
+                	orderList: []
+                },
 				{
 					name: '待发货',
 					state: 2,
@@ -296,7 +305,7 @@ export default {
 			this.loadmore = true
 
 			const params = {
-				orderState: this.currentTab,
+				orderState: this.tabs[this.currentTab].state,
 				userId: this.userId,
 				orderType: this.screenTab,
 				pageNum: this.tabInfo.pageNum,
@@ -357,6 +366,9 @@ export default {
 
 		// 跳转详情
 		handleToDetail(orderInfo) {
+            // 如果是拼单商品订单
+            // do something
+            // 如果是普通订单
 			this.$api.navigateTo('/pages/order/order-detail?orderId=' + orderInfo.orderId)
 		},
 

+ 0 - 7
pages/tabBar/index/index.vue

@@ -101,13 +101,6 @@ export default {
             this.getCouponActivity()
         }
     },
-    onShareTimeline() {
-        return {
-            title: '分享标题',
-            query: '',
-            imageUrl: 'https://picsum.photos/40/40'
-        }
-    },
     computed: {
         ...mapGetters(['hasLogin', 'activePopupType', 'userId', 'otherCouponFlag', 'showCouponPopup']),
         couponActivityIcon() {

+ 10 - 0
services/order.service.js

@@ -6,6 +6,16 @@ export default class OrderService {
         Object.assign(this, { AjaxService })
         this.name = 'OrderService'
     }
+    
+    /* 订单分享减免 */
+    OrderReductionShare(data = {}) {
+        return this.AjaxService.post({
+            url: '/order/reduction/share',
+            data,
+            isLoading: false,
+        })
+    }
+    
     /* 订单结算初始化 */
     QueryOrderConfirm(data = {}) {
         return this.AjaxService.get({