Pārlūkot izejas kodu

修改结算逻辑
修改快递查询
购物车金额问题
修改退款和退货处理
修改售后处理
修改优惠券的查询和使用
修改价格均摊的方法
修改拼团处理
修改双token登录
修改注册来源处理
修改客服处理

yongzonghuang 4 gadi atpakaļ
vecāks
revīzija
ca091d3925
31 mainītis faili ar 3810 papildinājumiem un 3094 dzēšanām
  1. 3 1
      App.vue
  2. 10 4
      components/adWindow.vue
  3. 2 2
      components/canvasShow/basics/product/app/index.vue
  4. 6 0
      config/api.js
  5. BIN
      config/attachment/logo.png
  6. 1 1
      manifest.json
  7. 96 3
      pages/tabbar/user/index.vue
  8. 95 44
      pages_category_page1/coupon/list.vue
  9. 140 118
      pages_category_page1/distributionModule/index.vue
  10. 82 2
      pages_category_page1/distributionModule/salesIndex.vue
  11. 20 7
      pages_category_page1/distributionModule/shareProduct.vue
  12. 1 3
      pages_category_page1/goodsModule/evaluateDetails.vue
  13. 1 1
      pages_category_page1/goodsModule/evaluateList.vue
  14. 156 14
      pages_category_page1/goodsModule/goodsDetails.vue
  15. 2 2
      pages_category_page1/goodsModule/goodsList.vue
  16. 567 465
      pages_category_page1/goodsModule/inviteSpell.vue
  17. 159 54
      pages_category_page1/orderModule/afterSaleApply.vue
  18. 18 43
      pages_category_page1/orderModule/afterSaleApplyRefund.vue
  19. 12 31
      pages_category_page1/orderModule/afterSaleApplyRetund.vue
  20. 1 1
      pages_category_page1/orderModule/index.vue
  21. 0 1
      pages_category_page1/orderModule/logisticsInfo.vue
  22. 2220 2183
      pages_category_page1/orderModule/orderConfirm.vue
  23. 52 37
      pages_category_page1/orderModule/orderDetails.vue
  24. 3 3
      pages_category_page1/store/index.vue
  25. 12 7
      pages_category_page2/userModule/accountLogin.vue
  26. 2 1
      pages_category_page2/userModule/login.vue
  27. 22 4
      pages_category_page2/userModule/register.vue
  28. BIN
      static/empty.png
  29. BIN
      static/images/img.png
  30. BIN
      static/images/logo.png
  31. 127 62
      utils/request.js

+ 3 - 1
App.vue

@@ -47,7 +47,9 @@ export default {
 			  let cartNum = 0
 			  resCart.data.forEach(shopItem=>{
 			    shopItem.skus.forEach(goodsItem=>{
-			      cartNum += goodsItem.number
+            if (goodsItem.shelveState !== 0) {
+              cartNum += goodsItem.number
+            }
 			    })
 			  })
 			  uni.setStorageSync('allCartNum', cartNum)

+ 10 - 4
components/adWindow.vue

@@ -7,7 +7,7 @@
         <view class="ad-boxs">
           <image class="img"
                  :src="adInfo.popupImg"
-                 mode="widthFix"></image>
+                 ></image>
           <view class="coupon-list">
             <scroll-view :scroll-top="0"
                          class="scrollBox"
@@ -287,25 +287,31 @@ export default {
 .ad-coupons {
   .ad-box-warp {
     width: 510rpx;
+    position: relative;
 
     .ad-boxs {
+      min-height: 700rpx;
       .img {
+        position: absolute;
+        top:0;
+        left:0;
         width: 100%;
+        height: 100%;
       }
     }
   }
 
   .coupon-list {
     width: 446rpx;
-    height: 295rpx;
+    height: 450rpx;
     overflow: auto;
     position: absolute;
-    top: 308rpx;
+    top: 20rpx;
     left: 50%;
     margin-left: -223rpx;
 
     .scrollBox {
-      height: 294upx;
+      height: 450upx;
     }
 
     .item {

+ 2 - 2
components/canvasShow/basics/product/app/index.vue

@@ -24,7 +24,7 @@
                     <img :src="item.shopLogo">
                   </div>
                 </div>
-                <label class="buy-count">{{item.users?item.users: 0}}人付款</label>
+                <label class="buy-count">已售{{item.number?item.number: 0}}件</label>
               </div>
               <div class="price-warp">
                 <!-- #ifdef MP-WEIXIN -->
@@ -77,7 +77,7 @@
                     <img :src="item.shopLogo">
                   </div>
                 </div>
-                <label class="buy-count">{{item.users?item.users: 0}}人付款</label>
+                <label class="buy-count">已售{{item.number?item.number: 0}}件</label>
               </div>
               <div class="price-warp">
                 <!-- #ifdef MP-WEIXIN -->

+ 6 - 0
config/api.js

@@ -27,6 +27,9 @@ module.exports = {
 	// shareLink: DOMAIN_PREFIX + '/h5', // 分享地址
 	shareLink: 'https://ceres.zkthink.com/h5', // 分享地址
 
+	// refreshtoken
+	RefreshToken:WX_API_BASE + "/app/refreshToken",
+
 	//登录注册
 	Verify: WX_API_BASE + '/app/getCode', //  获取短信验证码
 	Login: WX_API_BASE + '/app/login', //  手机号验证码登录、注册
@@ -61,9 +64,11 @@ module.exports = {
 	DeleteSearch: WX_API_BASE + '/app/deleteSearch', //  删除搜索记录
 	Getindexdata: WX_API_BASE + '/app/index', //  首页数据查询
 	GetremenList: WX_API_BASE + '/product/getRandomSortProduct', //  获取热门推荐
+	GetBroadCastList: WX_API_BASE + '/product/getBroadCastList', //  获取拼团数据
 
 	QueryProductDetail: WX_API_BASE + '/product/getById', //  查询商品详情
 	QueryProductSku: WX_API_BASE + '/product/getProducts', //  查询商品sku详情
+	getSpecificSku: WX_API_BASE + '/product/getSpecificSku', // 查询指定的sku详情
 	getCouponProducts: WX_API_BASE + '/coupon/getCouponProducts', //  优惠券商品列表查询
 
 
@@ -142,6 +147,7 @@ module.exports = {
 	//分销中心
 	FindSaleStoreList: WX_API_BASE + '/distributor/getDistributorAll', //  分销中心列表查询
 	QuerySalesMainInfo: WX_API_BASE + '/distributor/getShopDistributor', //  店铺分销数据查询
+	getDistributionLevelConfig: WX_API_BASE + '/distributor/getDistributionLevelConfig', //  分销规则查询
 	FindSalesOrderPage: WX_API_BASE + '/distributor/getReward', //  累计奖励查询
 	GetNotReward: WX_API_BASE + '/distributor/getNotReward', //  累计未结算奖励查询
 	FindSalesCustomerList: WX_API_BASE + '/distributor/getBuyers', //  累计客户查询

BIN
config/attachment/logo.png


+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "cereshop",
-    "appid" : "__UNI__ECAA86F",
+    "appid" : "__UNI__F5FF24E",
     "description" : "cereshop",
     "versionName" : "1.7.4",
     "versionCode" : 174,

+ 96 - 3
pages/tabbar/user/index.vue

@@ -222,13 +222,20 @@
             <image class="item-btn-icon" src="https://ceres.zkthink.com/static/img/user/service.png" mode="widthFix"></image>
             <view class="item-btn-text">平台客服</view>
           </view> -->
-        <button open-type="contact"
+<!--        <button open-type="contact"
                 class="item-btn btnNone">
           <image class="item-btn-icon"
                  src="https://ceres.zkthink.com/static/img/user/service.png"
                  mode="widthFix"></image>
           <view class="item-btn-text">平台客服</view>
-        </button>
+        </button>-->
+        <view @click="flyToService"
+              class="item-btn btnNone">
+          <image class="item-btn-icon"
+                 src="https://ceres.zkthink.com/static/img/user/service.png"
+                 mode="widthFix"></image>
+          <view class="item-btn-text">平台客服</view>
+        </view>
 
         <!-- <view class="item-btn" @click="toSuccess">
           <image class="item-btn-icon" src="https://ceres.zkthink.com/static/img/user/userCouponIcon.png" mode="widthFix"></image>
@@ -267,6 +274,7 @@ export default {
     }
   },
   onLoad() {
+    this.getServiceUrl()
   },
   onShow() {
     if (uni.getStorageSync('storage_key')) {
@@ -506,7 +514,7 @@ export default {
       } else {
         uni.navigateTo({
           url: '../../../pages_category_page1/coupon/list'
-        })````
+        })
       }
     },
     //判断是否是分销员
@@ -531,6 +539,91 @@ export default {
         })
       }
     },
+
+    getServiceUrl() {
+      const shopids = uni.getStorageSync('service_shopids') || []
+      const corpIds = uni.getStorageSync('service_corpIds') || []
+      const urls = uni.getStorageSync('service_urls') || []
+
+        this.isLoading = true
+        const id = null
+        NET.request(API.CustomerService, {
+
+        }, 'get').then(res => {
+          if (res.code === '' && res.data.corpId && res.data.url) {
+            shopids.push(this.shopId)
+            corpIds.push(res.data.corpId)
+            urls.push(res.data.url)
+
+            uni.setStorageSync('service_shopids', shopids);
+            uni.setStorageSync('service_corpIds', corpIds);
+            uni.setStorageSync('service_urls', urls);
+
+            this.corpId = res.data.corpId
+            this.serviceURL = res.data.url
+            if (this.serviceURL) {
+              this.hasService = true
+            }
+          }
+          this.isLoading = false
+        }).catch(err => {
+          console.log(err)
+          this.isLoading = false
+        })
+
+    },
+    flyToService() {
+      let self = this
+      // #ifdef MP-WEIXIN
+      console.log(self.serviceURL, self.corpId)
+      if (!self.serviceURL || !self.corpId) {
+        self.hasService = false
+        return
+      }
+      wx.openCustomerServiceChat({
+        extInfo: {
+          url: self.serviceURL
+        },
+        corpId: self.corpId, // 企业ID
+        success(res) {
+        },
+        fail(err) {
+        }
+      })
+      // #endif
+      // #ifdef APP-PLUS
+      try {
+        let sweixin = null
+        plus.share.getServices(res=>{
+          sweixin = res.find(i => i.id === 'weixin')
+          if(sweixin){
+            sweixin.openCustomerServiceChat({
+              corpid: self.corpId,
+              url: self.serviceURL,
+            },success=>{
+              console.log("success",JSON.stringify(success))
+            },err=>{
+              console.log("error",JSON.stringify(err))
+            })
+          }else{
+            plus.nativeUI.alert('当前环境不支持微信操作!')
+          }
+        },function(err){
+          console.log(err)
+          uni.showToast({title: "获取服务失败,不支持该操作。"+JSON.stringify(e), icon: 'error'})
+        })
+      } catch (err) {
+        console.log(err)
+        uni.showToast({title: "调用失败,不支持该操作。"+JSON.stringify(err), icon: 'error'})
+      }
+      /*plus.runtime.openURL(self.serviceURL, function(res) {
+        uni.showToast({
+          title: JSON.stringify(res),
+          icon: "success"
+        })
+      })*/
+      // #endif
+    },
   }
 }
 </script>

+ 95 - 44
pages_category_page1/coupon/list.vue

@@ -1,37 +1,47 @@
 <template>
   <view class="couponList">
-    <view
-      class="couponItem flex-items"
-      v-for="item of couponList"
-      :key="item.couponId"
-    >
-      <view class="itemLeft" @click="goProductList(item)">
-        <view class="topIcon"></view>
-        <view class="bottomIcon"></view>
-        <view class="price flex-items">
-          <view class="flex-column flex-end unitBox" v-if="item.discountMode === 1">
-            <view class="unit">¥</view>
+    <template v-if="couponList.length>0">
+      <view
+          class="couponItem flex-items"
+          v-for="item of couponList"
+          :key="item.couponId"
+      >
+        <view class="itemLeft" @click="goProductList(item)">
+          <view class="topIcon"></view>
+          <view class="bottomIcon"></view>
+          <view class="price flex-items">
+            <view class="flex-column flex-end unitBox" v-if="item.discountMode === 1">
+              <view class="unit">¥</view>
+            </view>
+            <view class="priceValue">{{ item.reduceMoney }}{{ item.discountMode === 1 ? '' : '折' }}</view>
           </view>
-          <view class="priceValue">{{item.reduceMoney}}{{item.discountMode === 1 ? '' : '折'}}</view>
+          <text class="fs24 font-color-999">满{{ item.fullMoney }}元可用</text>
         </view>
-        <text class="fs24 font-color-999">满{{item.fullMoney}}元可用</text>
-      </view>
-      <view class="itemRight">
-        <view class="topInfo flex-items flex-sp-between">
-          <view @click="goProductList(item)">
-            <view class="couponTit fs32 font-color-FFF">{{item.activityName}}</view>
-            <view class="couponDate fs24 font-color-999">{{item.endTime}}到期</view>
+        <view class="itemRight">
+          <view class="topInfo flex-items flex-sp-between">
+            <view @click="goProductList(item)">
+              <view class="couponTit fs32 font-color-FFF">{{ item.activityName }}</view>
+              <view class="couponDate fs24 font-color-999">{{ item.endTime }}到期</view>
+            </view>
+            <view class="exchangeBtnBox flex-column flex-end">
+              <view class="exchangeBtn fs24 font-color-FFF" v-if="item.state === 0">已领取</view>
+              <wx-send-coupon v-else @success="success" :couponList="[item]">
+                <view class="exchangeBtn fs24 font-color-FFF">{{ item.ifCredit ? '立即兑换' : '立即领取' }}</view>
+              </wx-send-coupon>
+            </view>
           </view>
-          <view class="exchangeBtnBox flex-column flex-end">
-            <view class="exchangeBtn fs24 font-color-FFF" v-if="item.state === 0">已领取</view>
-            <wx-send-coupon v-else @success="success" :couponList="[item]">
-              <view class="exchangeBtn fs24 font-color-FFF">{{item.ifCredit?'立即兑换':'立即领取'}}</view>
-            </wx-send-coupon>
+          <view @click="goProductList(item)" class="couponType fs28 font-color-FFF">
+            {{ item.discountMode === 1 ? '满减券' : '折扣券' }}
           </view>
         </view>
-        <view @click="goProductList(item)" class="couponType fs28 font-color-FFF">{{item.discountMode === 1 ? '满减券' : '折扣券'}}</view>
       </view>
-    </view>
+    </template>
+    <template v-else>
+      <div class="empty-content">
+        <image class="img" src="@/static/empty.png"/>
+        <p>你还没有优惠券哦~</p>
+      </div>
+    </template>
     <!-- 触底 -->
     <view class="reachBottom" v-if="topLeft > 400 && couponList.length>0">
       <image class="reach-icon" src="https://ceres.zkthink.com/static/img/reachBottom.png" mode="widthFix"></image>
@@ -43,6 +53,7 @@
 <script>
 
 import WxSendCoupon from "../../components/wx/wxSendCoupon";
+
 const NET = require('../../utils/request')
 const API = require('../../config/api')
 export default {
@@ -57,13 +68,13 @@ export default {
       topLeft: 0
     }
   },
-  onLoad () {
+  onLoad() {
     this.getCouponList()
   },
-  onReachBottom (){
+  onReachBottom() {
     if (this.loadingType == 1) {
       uni.stopPullDownRefresh()
-    }else{
+    } else {
       this.page = this.page + 1
       this.getCouponList()
     }
@@ -93,13 +104,13 @@ export default {
       })
     },
     // 跳转到可用商品列表
-    goProductList (item) {
+    goProductList(item) {
       console.log(item, 'test')
       uni.navigateTo({
         url: `../coupon/product?id=${item.couponId}`
       })
     },
-    success(){
+    success() {
       this.page = 1
       this.couponList = []
       this.getCouponList()
@@ -111,9 +122,33 @@ export default {
 <style lang="scss" scoped>
 page {
   background: #F8F8F8;
+
+  .empty-content {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+
+    p {
+      text-align: center;
+      color: #999999;
+      margin: 20rpx 0;
+    }
+
+    .img {
+      width: 225rpx;
+      height: 196rpx
+    }
+  }
+
   .couponList {
     padding: 0 20rpx 40upx;
     margin-top: 30rpx;
+
     .couponItem {
       background: #333333;
       margin-top: 40rpx;
@@ -123,11 +158,13 @@ page {
       background-repeat: no-repeat;
       background-size: contain;
       background-position: right top;
+
       .itemLeft {
         padding-right: 10rpx;
         position: relative;
         border-right: 2rpx dashed #666666;
         width: 170rpx;
+
         .topIcon {
           position: absolute;
           right: -16rpx;
@@ -137,6 +174,7 @@ page {
           background: #FFFFFF;
           border-radius: 50%;
         }
+
         .bottomIcon {
           position: absolute;
           right: -16rpx;
@@ -146,35 +184,43 @@ page {
           background: #FFFFFF;
           border-radius: 50%;
         }
+
         //.price {
         //  width: 100rpx;
         //}
         .unitBox {
           height: 70rpx;
         }
+
         .unit {
           color: #FFEBC4;
           font-size: 36rpx;
         }
+
         .priceValue {
           font-size: 52rpx;
           color: #FFEBC4;
         }
       }
+
       .itemRight {
         padding-left: 45rpx;
         flex: 1;
+
         .topInfo {
           padding-bottom: 10rpx;
           border-bottom: 2rpx solid #444444;
           margin-bottom: 10rpx;
+
           .couponDate {
             width: 300rpx;
           }
+
           .exchangeBtnBox {
             width: 110rpx;
             height: 70rpx;
             text-align: center;
+
             .exchangeBtn {
               padding: 5rpx;
               border: 2rpx solid #999999;
@@ -184,6 +230,7 @@ page {
       }
     }
   }
+
   .Put-box1 {
     .btn {
       text-align: center;
@@ -194,6 +241,7 @@ page {
       width: 100%;
       color: #333333;
     }
+
     .submit {
       background-color: #333333;
       color: #FFEBC4;
@@ -201,19 +249,22 @@ page {
     }
   }
 }
+
 // 触底样式
-.reachBottom{
-	margin-top: 30rpx;
-	display: flex;
-	flex-direction: column;
-	align-items: center;
-	.reach-icon{
-		width: 150rpx;
-		height: 150rpx;
-	}
-	.reach-text{
-		margin: 20rpx 0;
-		color: #CCCCCC;
-	}
+.reachBottom {
+  margin-top: 30rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+
+  .reach-icon {
+    width: 150rpx;
+    height: 150rpx;
+  }
+
+  .reach-text {
+    margin: 20rpx 0;
+    color: #CCCCCC;
+  }
 }
 </style>

+ 140 - 118
pages_category_page1/distributionModule/index.vue

@@ -1,139 +1,161 @@
 <template>
-	<view class="container flex-center flex-column">
-		<view class="inStoreBackImg flex-items-plus" v-if="StoreListData.length>0">
-			<label>选择进入的店铺</label>
-		</view>
-		<view>
-			<view class="flex-items-plus flex-column" v-for="(item,index) in StoreListData" :key="index" @click="getStore(item)">
-				<view class="store-box flex-items-plus flex-sp-between mar-top-30 bor-line-E5E5E5 pad-bot-30">
+  <view class="container flex-center flex-column">
+    <view
+        class="inStoreBackImg flex-items-plus"
+        v-if="StoreListData.length>0"
+    >
+      <label>选择进入的店铺</label>
+    </view>
+    <view>
+      <view
+          class="flex-items-plus flex-column"
+          v-for="(item,index) in StoreListData"
+          :key="index"
+          @click="getStore(item)"
+      >
+        <view class="store-box flex-items-plus flex-sp-between mar-top-30 bor-line-E5E5E5 pad-bot-30">
           <view class="flex-items-plus">
-            <image class="storeLogoImg" :src="item.shopLogo"></image>
+            <image
+                class="storeLogoImg"
+                :src="item.shopLogo"
+            ></image>
             <view class="font-color-656 fs24 mar-left-20">
-              <label class="fs30 font-color-333">{{item.shopName}}</label>
+              <label class="fs30 font-color-333">{{ item.shopName }}</label>
               <view class="flex-row-plus mar-top-20">
-                <label>等级:{{item.levelName}} </label>
+                <label>等级:{{ item.levelName }} </label>
               </view>
-              <view class="mar-top-10">关系:<label>{{item.state==1?'有效':'被清退'}}</label></view>
+              <view class="mar-top-10">关系:<label>{{ item.state == 1 ? '有效' : '被清退' }}</label></view>
             </view>
           </view>
           <view class="income">
             <view class="font-color-333 fs30">总收益</view>
-            <view class="font-color-C5AA7B fs30">{{item.price}}元</view>
+            <view class="font-color-C5AA7B fs30">{{ item.price }}元</view>
           </view>
-				</view>
-			</view>
-		</view>
-		<view v-if="ifEmpty" class="emptyCart-box flex-items-plus flex-column">
-			<image class="emptyCart-img" src="https://ceres.zkthink.com/static/img/bgnull.png"></image>
-			<label class="font-color-999 fs26 mar-top-30">这里空空如也~</label>
-		</view>
-	</view>
+        </view>
+      </view>
+    </view>
+    <view
+        v-if="ifEmpty"
+        class="emptyCart-box flex-items-plus flex-column"
+    >
+      <image
+          class="emptyCart-img"
+          src="https://ceres.zkthink.com/static/img/bgnull.png"
+      ></image>
+      <label class="font-color-999 fs26 mar-top-30">这里空空如也~</label>
+    </view>
+  </view>
 </template>
 
 <script>
-	const NET = require('../../utils/request')
-	const API = require('../../config/api')
-	export default {
-		data() {
-			return {
-				currentId: '',
-				StoreListData: [],
-				StoreListQuery: {
-					id: '',
-				},
-				page: 1,
-				pageSize: 20,
-				loadingType:0,
-        ifEmpty: false
-			}
-		},
-		onLoad() {
-			this.getStoreList()
-		},
-		onReachBottom(){
-			if(this.loadingType == 1){
-				uni.stopPullDownRefresh()
-			}else{
-				this.page = this.page+1
-				this.getStoreList()
-			}
-		},
-		onBackPress(e) {
-			if (e.from === 'navigateBack') {
-				return false;
-			}
-			this.back();
-			return true;
-		},
-		methods: {
-			back(){
-				uni.switchTab({
-					url:'../../pages/tabbar/user/index'
-				});
-			},
-			getStoreList() {
-				uni.showLoading({
-          mask: true,
-					title: '加载中...'
-				})
-				NET.request(API.FindSaleStoreList, {
-					page: this.page,
-					pageSize: this.pageSize
-				}, 'GET').then(res => {
-					uni.hideLoading()
-					if(res.data.list.length == 0){
-						this.loadingType = 1
-						this.page = this.page
-					}
-					this.StoreListData = this.StoreListData.concat(res.data.list)
-          if (this.StoreListData.length === 0) {
-            this.ifEmpty = true
-          }
-				}).catch(res => {
-					uni.hideLoading()
-				})
-			},
-			getStore(item) {
-				uni.navigateTo({
-					url: 'salesIndex?distributeInfo=' + JSON.stringify(item)
-				});
-			}
-		}
-	}
+const NET = require('../../utils/request')
+const API = require('../../config/api')
+export default {
+  data() {
+    return {
+      currentId: '',
+      StoreListData: [],
+      StoreListQuery: {
+        id: '',
+      },
+      page: 1,
+      pageSize: 20,
+      loadingType: 0,
+      ifEmpty: false
+    }
+  },
+  onLoad() {
+    this.getStoreList()
+  },
+  onReachBottom() {
+    if (this.loadingType == 1) {
+      uni.stopPullDownRefresh()
+    } else {
+      this.page = this.page + 1
+      this.getStoreList()
+    }
+  },
+  onBackPress(e) {
+    if (e.from === 'navigateBack') {
+      return false;
+    }
+    this.back();
+    return true;
+  },
+  methods: {
+    back() {
+      uni.switchTab({
+        url: '../../pages/tabbar/user/index'
+      });
+    },
+    getStoreList() {
+      uni.showLoading({
+        mask: true,
+        title: '加载中...'
+      })
+      NET.request(API.FindSaleStoreList, {
+        page: this.page,
+        pageSize: this.pageSize
+      }, 'GET').then(res => {
+        uni.hideLoading()
+        if (res.data.list.length == 0) {
+          this.loadingType = 1
+          this.page = this.page
+        }
+        this.StoreListData = this.StoreListData.concat(res.data.list)
+        if (this.StoreListData.length === 0) {
+          this.ifEmpty = true
+        }
+      }).catch(res => {
+        uni.hideLoading()
+      })
+    },
+    getStore(item) {
+      uni.navigateTo({
+        url: 'salesIndex?distributeInfo=' + JSON.stringify(item)
+      });
+    }
+  }
+}
 </script>
 
 <style lang="scss">
 page {
   background: #F8F8F8;
 }
-	.emptyCart-box{
-		margin-top: 70upx;
-		.emptyCart-img{
-			width: 113upx;
-			height: 98upx;
-		}
-	}
-	.container {
-		.inStoreBackImg {
-			width: 100%;
-			height: 100upx;
-      background: #333333;
-			color: #FFFFFF;
-		}
 
-		.store-box {
-			width: 690upx;
-      background: #FFFFFF;
-      padding: 22rpx;
-			.storeLogoImg {
-				width: 140upx;
-				height: 140upx;
-			}
-      .income {
-        width: 200rpx;
-        text-align: center;
-        border-left: 2rpx solid #F3F4F5;
-      }
-		}
-	}
+.emptyCart-box {
+  margin-top: 70upx;
+
+  .emptyCart-img {
+    width: 113upx;
+    height: 98upx;
+  }
+}
+
+.container {
+  .inStoreBackImg {
+    width: 100%;
+    height: 100upx;
+    background: #333333;
+    color: #FFFFFF;
+  }
+
+  .store-box {
+    width: 690upx;
+    background: #FFFFFF;
+    padding: 22rpx;
+
+    .storeLogoImg {
+      width: 140upx;
+      height: 140upx;
+    }
+
+    .income {
+      width: 200rpx;
+      text-align: center;
+      border-left: 2rpx solid #F3F4F5;
+    }
+  }
+}
 </style>

+ 82 - 2
pages_category_page1/distributionModule/salesIndex.vue

@@ -58,6 +58,25 @@
 				</view>
 			</view>
 		</view>
+    <view class="rule-box">
+      <view class="rule-box-bg">
+        <view class="rule-box-tit">
+          <view class="fs32 font-color-FFF">分销规则</view>
+          <view class="font-color-FFF fs24 mar-top-10">分销比例均按照成交商品金额计算</view>
+        </view>
+        <view class="rule-list">
+          <view class="rule-item" v-for="(item, index) of levelConfig" :key="index">
+            <view class="item-left">
+              <image :src="item.levelLogo"></image>
+            </view>
+            <view class="item-right">
+              <view class="rule-item-tit fs28 font-color-333">{{item.levelName}}</view>
+              <view class="fs24 font-color-666">{{item.levelDesc}}</view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
 	</view>
 </template>
 
@@ -69,12 +88,14 @@
 			return {
 				item: {},
 				SalesMainItem: {},
+        levelConfig: []
 			}
 		},
 		onLoad(options) {
 			this.item = JSON.parse(options.distributeInfo)
 			uni.setStorageSync("salesId", this.item.distributorId)
 			this.getSalesMainInfo()
+      this.getRuleInfo()
 		},
 
 		methods: {
@@ -93,6 +114,14 @@
 				uni.hideLoading()
 				})
 			},
+      getRuleInfo() {
+        NET.request(API.getDistributionLevelConfig, {
+          shopId:this.item.shopId
+        }, 'GET').then(res => {
+          this.levelConfig = res.data
+        }).catch(res => {
+        })
+      },
 			//累计奖励
 			gototalAward() {
 				uni.navigateTo({
@@ -239,6 +268,7 @@
         height: 158upx;
         width: 690upx;
         margin-top: 30upx;
+        border-radius: 8rpx;
         label {
           color: #FDEDD3;
         }
@@ -250,6 +280,7 @@
           background: linear-gradient(90deg, #FDEDD3 0%, #EDDABA 100%);
           text-align: center;
           margin-bottom: 28rpx;
+          border-radius: 8rpx;
         }
         .salesIcon {
           width: 60upx;
@@ -258,11 +289,13 @@
       }
     }
     .awardInfo {
+      padding: 0 20rpx;
       .award-box {
         height: 158upx;
-        width: 690upx;
+        width: 100%;
         margin-top: 30upx;
         background: #FFFFFF;
+        border-radius: 8rpx;
         .salesIcon {
           width: 60upx;
           height: 56upx;
@@ -275,15 +308,62 @@
       margin-top: 30upx;
       flex-flow: wrap;
       justify-content: center;
+      padding: 0 20rpx;
       .btnListBox {
         background: #FFFFFF;
         height: 196upx;
-        width: 690upx;
+        width: 100%;
+        border-radius: 8rpx;
       }
       .salesIcon {
         width: 90rpx;
         height: 90rpx;
       }
+    }
+    .rule-box {
+      margin-top: 20rpx;
+      padding: 0 20rpx;
+      border-radius: 16rpx;
+      overflow: hidden;
+      width: 100%;
+      .rule-box-bg {
+        background: url("https://ceres.zkthink.com/static/images/distributionBg.png") no-repeat top left;
+        background-size: contain;
+        padding: 32rpx 24rpx 0 24rpx;
+        width: 100%;
+        min-height: 764rpx;
+        .rule-box-tit {
+          width: 100%;
+        }
+        .rule-list {
+          background: #FFFFFF;
+          border-radius: 16rpx;
+          margin-top: 20rpx;
+          padding: 32rpx 24rpx;
+          width: 100%;
+          .rule-item {
+            display: flex;
+            width: 100%;
+            margin-bottom: 30rpx;
+            margin-right: 15rpx;
+            .item-left {
+              width: 64rpx;
+              margin-right: 20rpx;
+              image {
+                width: 64rpx;
+                height: 64rpx;
+              }
+            }
+            .item-right {
+              flex: 1;
+              .rule-item-tit {
+                height: 64rpx;
+                line-height: 64rpx;
+              }
+            }
+          }
+        }
+      }
     }
 	}
 </style>

+ 20 - 7
pages_category_page1/distributionModule/shareProduct.vue

@@ -109,12 +109,12 @@
 
 			// 保存图片到本地
 			WXfenx() {
-				// #ifdef APP-PLUS || MP-WEIXIN || MP-ALIPAY 
+				// #ifdef APP-PLUS || MP-WEIXIN || MP-ALIPAY
 				uni.showLoading({
 					title: '图片保存中...'
 				})
-				// #endif	
-				
+				// #endif
+
 				// #ifdef APP-PLUS
 				uni.downloadFile({
 					url: this.erweima,
@@ -136,12 +136,25 @@
 									});
 								}
 							});
+						} else {
+							uni.hideLoading()
+							uni.showToast({
+								title: "保存失败",
+								icon: "none"
+							});
 						}
+					},
+					fail: (res) => {
+						uni.hideLoading()
+						uni.showToast({
+							title: "保存失败",
+							icon: "none"
+						});
 					}
 				})
-				// #endif	
-				
-				// #ifdef MP-WEIXIN || MP-ALIPAY 
+				// #endif
+
+				// #ifdef MP-WEIXIN || MP-ALIPAY
 				uni.getImageInfo({
 					src: this.erweima,
 					success: function(image) {
@@ -195,7 +208,7 @@
 					}
 				});
 				// #endif
-				// #ifdef H5 
+				// #ifdef H5
 				var oA = document.createElement('a');
 				oA.download = ''; // 设置下载的文件名,默认是’下载’
 				oA.href = this.erweima;

+ 1 - 3
pages_category_page1/goodsModule/evaluateDetails.vue

@@ -134,9 +134,7 @@
 						  icon:"none"
 						})
 					}
-				}).catch(res => {
-				  uni.hideLoading()
-				}).finally(()=>{uni.hideLoading()})
+				}).finally(()=>{setTimeout(()=>{uni.hideLoading()}),1000})
 			},
 			//追加评论
 			addCommentsClick(){

+ 1 - 1
pages_category_page1/goodsModule/evaluateList.vue

@@ -38,7 +38,7 @@
           <text class="font-color-999 fs22">{{item.createTime}}</text>
 					<view class="praise-box flex-items flex-row">
 						<!-- <image class="praise-icon" src="https://ceres.zkthink.com/static/images/praiseIcon.png"></image> -->
-						<image class="praise-icon" @click="zanTap(index,item.commen0tId,0)" src="https://ceres.zkthink.com/static/images/praiseActiveIcon.png"
+						<image class="praise-icon" @click="zanTap(index,item.commentId,0)" src="https://ceres.zkthink.com/static/images/praiseActiveIcon.png"
 						 v-if="item.ifLike == 1"></image>
 						<image class="praise-icon" @click="zanTap(index,item.commentId,1)" src="https://ceres.zkthink.com/static/images/praiseIcon.png" v-else></image>
 						<text class="mar-left-10 font-color-999">{{item.likes}}</text>

+ 156 - 14
pages_category_page1/goodsModule/goodsDetails.vue

@@ -376,7 +376,51 @@
         </view>
       </view>
     </view>
+<!--    拼团滚动-->
+    <view class="news-box">
+      <view class="news-bg">
+        <swiper class="goodsImgswiper-box"
+                :vertical="true"
+                :circular="true"
+                interval="8000"
+                duration="2000"
+                :autoplay="true">
+          <swiper-item v-for="(item, index) of broadCastList" :key="index">
+            <view class="news-item flex-items">
+              <image class="item-avatar" :src="item.headImage"></image>
+              <view class="news-item-user">{{item.name}}</view>
+              <view class="news-item-info">{{item.timeStr}}</view>
+              <view class="news-item-info" v-if="item.type === 1">给了好评</view>
+              <view class="news-item-info" v-if="item.type === 2">正在拼单</view>
+              <view class="news-item-info" v-if="item.type === 3">拼单成功</view>
+              <view class="news-item-info" v-if="item.type === 4">下单</view>
+            </view>
+          </swiper-item>
+        </swiper>
+      </view>
+    </view>
     <view class="buygoods-box">
+<!--      底部去拼团按钮-->
+      <view v-if="selectedSku.activityType === 1&&topThreeCollageOrders.length > 0">
+        <view class="groupByInfo" v-for="(Gitem, index) in topThreeCollageOrders">
+          <view v-if="Gitem.time > 0" class="flex-items flex-sp-between groupByInfoBox">
+            <view class="groupByLeft flex-items">
+              <view class="groupByAvatar flex-items">
+                <img :src="Gitem.headImage"
+                     alt="">
+                <span class="fs26">{{ Gitem.name }}</span>
+              </view>
+              <view class="groupByNum fs26">还差<b>{{ Gitem.person }}人</b>拼成</view>
+              <view class="groupByTime">
+                <view class="endDate fs26">剩余{{ timeChange(Gitem.time) }}</view>
+              </view>
+            </view>
+            <view class="groupByRight">
+              <view class="groupByBtn" @click="getGroupShow(Gitem.collageId)">去拼单</view>
+            </view>
+          </view>
+        </view>
+      </view>
       <view class="buygoodsBut-box flex-row-plus"
             :style="{'height':(isIphone === true? 160:130)+'rpx'}">
         <view class="btns_container">
@@ -386,7 +430,7 @@
                    src="https://ceres.zkthink.com/static/images/storeIcon.png"></image>
             <label class="fs22">店铺</label>
           </view>
-          <!-- #ifdef MP-WEIXIN -->
+          <!-- #ifdef MP-WEIXIN || APP-PLUS -->
           <view v-if="hasService"
                 class="btns flex-column-plus mar-left-10"
                 @click="flyToService">
@@ -451,7 +495,7 @@
             <view class="font-color-C5AA7B">
               <label class="fs24">¥</label>
               <label class="fs36 mar-left-10"
-                     v-text="selectedSku.activityType === 1 && btnType === 4 ? selectedSku.originalPrice : selectedSku.price"></label>
+                     v-text="selectedSku.activityType === 1 && btnType === 4 ? selectedSku.salePrice : selectedSku.price"></label>
             </view>
             <label class="fs24 font-color-999 mar-top-20">库存 {{ selectedSku.stockNumber }} 件</label>
             <label class="fs24 mar-top-20">已选</label>
@@ -719,7 +763,8 @@ export default {
       shopMarkTools: [], //店铺优惠券
       ifShow: false,
       topLeft: 0,
-      currentActive: 0
+      currentActive: 0,
+      broadCastList: []
     }
   },
   computed: {
@@ -745,7 +790,6 @@ export default {
 		this.getProblems()
 	},
   onLoad(options) {
-    console.log("options----", options)
     this.isIphone = getApp().globalData.isIphone;
     if (getApp().globalData.productShareItem) {
       const item = getApp().globalData.productShareItem
@@ -755,7 +799,6 @@ export default {
       this.salesId = parseInt(item.salesId)
       getApp().globalData.productShareItem = undefined
     } else {
-      console.log(options, '001001')
       this.shopId = parseInt(options.shopId)
       this.productId = options.productId
       this.paramSkuId = options.skuId
@@ -770,6 +813,7 @@ export default {
     this.getProblems()
     this.allCartNum = uni.getStorageSync('allCartNum')
     this.getServiceUrl()
+    this.getBroadCastListFn()
   },
   onUnload() {
     if (this.countdownInterval) {
@@ -781,7 +825,6 @@ export default {
     if (this.funtimeOut) {
       clearTimeout(this.funtimeOut)
     }
-    console.log('onUnload')
   },
   mounted() {
     // 获取手机的屏幕高度
@@ -796,10 +839,17 @@ export default {
     this.topLeft = e.scrollTop
   },
   methods: {
+    getBroadCastListFn() {
+      NET.request(API.GetBroadCastList, {
+        productId: this.productId,
+        shopGroupWorkId: this.shopGroupWorkId,
+      }, 'GET').then(res => {
+        this.broadCastList = res.data
+      }).catch(res => {
+      })
+    },
     onDetailScroll(e) {
-      console.log(e)
       this.topLeft = e.scrollTop
-      console.log(this.topLeft)
     },
     previewImg(index, cindex) {
       let img = this.commentList[index].images[cindex]
@@ -1127,7 +1177,6 @@ export default {
       if (skuId) {
         let mapinfo = this.productData.map
         for (var key in mapinfo) {
-          console.log(skuId, mapinfo[key].skuId, 'test')
           if (parseInt(mapinfo[key].skuId) === parseInt(skuId)) {
             this.selectedSku = mapinfo[key]
             // 选中sku对应的规格
@@ -1213,7 +1262,6 @@ export default {
       this.$forceUpdate(); // 重绘
     },
     selectSkuPostProcessor() {
-      console.log('selectSkuPostProcessor')
       const ifEnable = this.selectedSku.ifEnable
       if (this.selectedSku.activityType === 1 && ifEnable === 0) {
         this.topThreeCollageOrders = this.selectedSku.collageOrders.slice(0, 3)
@@ -1659,7 +1707,7 @@ export default {
     },
     flyToService() {
       let self = this
-      console.log(self.serviceURL, self.corpId)
+      // #ifdef MP-WEIXIN
       if (!self.serviceURL || !self.corpId) {
         self.hasService = false
         return
@@ -1674,6 +1722,39 @@ export default {
         fail(err) {
         }
       })
+      // #endif
+      // #ifdef APP-PLUS
+      try {
+        let sweixin = null
+        plus.share.getServices(res=>{
+          sweixin = res.find(i => i.id === 'weixin')
+          if(sweixin){
+            sweixin.openCustomerServiceChat({
+              corpid: self.corpId,
+              url: self.serviceURL,
+            },success=>{
+              console.log("success",JSON.stringify(success))
+            },err=>{
+              console.log("error",JSON.stringify(err))
+            })
+          }else{
+            plus.nativeUI.alert('当前环境不支持微信操作!')
+          }
+        },function(err){
+          console.log(err)
+          uni.showToast({title: "获取服务失败,不支持该操作。"+JSON.stringify(e), icon: 'error'})
+        })
+      } catch (err) {
+        console.log(err)
+        uni.showToast({title: "调用失败,不支持该操作。"+JSON.stringify(err), icon: 'error'})
+      }
+      /*plus.runtime.openURL(self.serviceURL, function(res) {
+        uni.showToast({
+          title: JSON.stringify(res),
+          icon: "success"
+        })
+      })*/
+      // #endif
     },
   }
 }
@@ -2230,7 +2311,41 @@ export default {
     position: fixed;
     bottom: 0upx;
     box-sizing: border-box;
-
+    .groupByInfo {
+      background: #fffbe9;
+      padding:  0 30rpx;
+      height: 80rpx;
+      .groupByInfoBox {
+        height: 80rpx;
+      }
+      .groupByLeft {
+        .groupByAvatar {
+          margin-right: 15rpx;
+        }
+        img {
+          width: 50rpx;
+          height: 50rpx;
+        }
+        .name {
+          font-size: 24rpx;
+        }
+        .groupByNum {
+          margin-right: 10rpx;
+        }
+        .groupByTime {
+          color: #333333;
+        }
+      }
+      .groupByBtn {
+        height: 60rpx;
+        background: #333333;
+        color: #FFEBC4;
+        font-size: 14rpx;
+        line-height: 60rpx;
+        text-align: center;
+        padding: 0 20rpx;
+      }
+    }
     .buygoodsBut-box {
       background-color: #FFFFFF;
       width: 750upx;
@@ -2333,7 +2448,7 @@ export default {
 
   .returnTopService-box {
     position: fixed;
-    bottom: 160upx;
+    bottom: 240upx;
     right: 30upx;
 
     .fs16 {
@@ -2346,7 +2461,6 @@ export default {
       border-radius: 50%;
       background: #FFFFFF;
       opacity: 0.8;
-
       .returnTopImg {
         width: 58upx;
         height: 58upx;
@@ -3207,4 +3321,32 @@ export default {
   //  }
   //}
 }
+//拼团提示
+.news-box {
+  position: fixed;
+  left: 20rpx;
+  top: 200rpx;
+  .news-bg {
+    height: 70rpx;
+    overflow: hidden;
+    .news-item {
+      background: rgba(0, 0, 0, 0.75);
+      border-radius: 16rpx;
+      height: 70rpx;
+      color: #FFFFFF;
+      font-size: 24rpx;
+      padding: 0 20rpx;
+      display: inline-flex;
+      .item-avatar {
+        width: 50rpx;
+        height: 50rpx;
+        border-radius: 50%;
+        margin-right: 20rpx;
+      }
+      .news-item-user {
+        margin-right: 8rpx;
+      }
+    }
+  }
+}
 </style>

+ 2 - 2
pages_category_page1/goodsModule/goodsList.vue

@@ -38,8 +38,8 @@
 				    </view>
 				    <view class="itemInfo">
 				      <p>{{item.productName}}</p>
-				      <view class="number" v-if="item.users != null">
-                <view class="numText">{{item.users}}人付款</view>
+				      <view class="number" v-if="item.number != null">
+                <view class="numText">已售{{item.number}}件</view>
                 <view class="numText" v-if="item.total !=0 && item.activityType !== 0">限量{{item.total}}件</view>
               </view>
 					  <view class="flex-row-plus flex-item mar-top-30">

+ 567 - 465
pages_category_page1/goodsModule/inviteSpell.vue

@@ -1,49 +1,59 @@
 <template>
 	<view class="inviteSpell-con">
-    <view class="grouped">
-      <view class="fs32 font-color-FFF">{{remainPerson !== 0?'等待成团':'已成团'}}</view>
-      <view class="fs26 number">{{inviteSpell.person}}人团</view>
-    </view>
-    <view class="topBox">
-      <view class="title-box flex-row-plus">
-        <image class="pro-img" :src="inviteSpell.image"></image>
-        <view class="flex-column-plus mar-left-30">
-          <view class="title-lab fs28">{{inviteSpell.productName}}</view>
-          <view class="flex-row-plus flex-sp-between">
-            <view class="flex-column-plus">
-<!--              <view class="spellNum flex-items-plus font-color-C5AA7B mar-top-30 fs24">{{inviteSpell.person}}人团</view>-->
-              <view class="flex-row-plus mar-top-30 flex-items">
-                <label class="font-color-C83732 fs24">¥</label>
-                <label class="font-color-C83732 fs36 mar-left-5">{{inviteSpell.price}}</label>
-                <label class="font-color-CCC discountsPriceLine fs26 mar-left-20">¥{{inviteSpell.originalPrice}}</label>
-              </view>
-            </view>
-<!--            <view class="mar-top-20">-->
-<!--              <image class="issueregiment" src="https://ceres.zkthink.com/static/images/issueregiment.png"></image>-->
-<!--            </view>-->
-          </view>
-        </view>
-      </view>
-    </view>
+		<global-loading />
+
+		<view class="grouped">
+			<view v-if="showJoinGroup" class="fs32 font-color-FFF">{{remainPerson !== 0?'等待成团':'已成团'}}</view>
+			<view class="fs26 number">{{inviteSpell.person}}人团</view>
+		</view>
+		<view class="topBox">
+			<view class="title-box flex-row-plus" @click="goodsDateils()">
+				<image class="pro-img" :src="inviteSpell.image"></image>
+				<view class="flex-column-plus mar-left-30">
+					<view class="title-lab fs28">{{inviteSpell.productName}}</view>
+					<view class="flex-row-plus flex-sp-between">
+						<view class="flex-column-plus">
+							<!--              <view class="spellNum flex-items-plus font-color-C5AA7B mar-top-30 fs24">{{inviteSpell.person}}人团</view>-->
+							<view class="flex-row-plus mar-top-30 flex-items">
+								<label class="font-color-C83732 fs24">¥</label>
+								<label class="font-color-C83732 fs36 mar-left-5">{{inviteSpell.price}}</label>
+								<label
+									class="font-color-CCC discountsPriceLine fs26 mar-left-20">¥{{inviteSpell.originalPrice}}</label>
+							</view>
+						</view>
+						<!--            <view class="mar-top-20">-->
+						<!--              <image class="issueregiment" src="https://ceres.zkthink.com/static/images/issueregiment.png"></image>-->
+						<!--            </view>-->
+					</view>
+				</view>
+			</view>
+		</view>
 		<view class="spellpersonnel-box">
-      <view class="bgBox flex-items-plus flex-column">
-        <view class="flex-items flex-sp-around flex-row-plus mar-right-20">
-          <view class="flex-column flex-items-plus mar-left-20" v-for="(item,index) in inviteSpell.personList" :key="index">
-            <image v-if="index == 0" class="head-icon border-FF7 z-index-0" :src="item.headImage"></image>
-            <image v-else class="head-icon " :src="item.headImage"></image>
-            <view v-if="index == 0" class="fs18 colonel-box">团长</view>
-          </view>
-          <view v-for="ritem in remainPerson">
-            <view class="replenish-icon flex-items-plus mar-left-20">?</view>
-          </view>
-        </view>
-		  <view v-if="remainPerson !== 0">
-			  <view class="mar-top-50 font-color-333">还差<label class="font-color-C5AA7B">{{remainPerson}}</label>人成团,距结束还剩{{hou}}:{{min}}:{{sec}}</view>
-			  <view v-if="type == 1" @click="shareClick" class="offered-but font-color-FFF flex-items-plus mar-top-60">邀请好友拼单</view>
-			  <view v-if="type == 0" @click="getOffered" class="offered-but font-color-FFF flex-items-plus mar-top-60">立即参团</view>
-			  <view v-if="type == 1" @click="goinvitePoster" class="poster-but flex-items-plus mar-top-40">生成邀请海报</view>
-		  </view>
-      </view>
+			<view class="bgBox flex-items-plus flex-column">
+				<view class="flex-items flex-sp-around flex-row-plus mar-right-20">
+					<view class="flex-column flex-items-plus mar-left-20" v-for="(item,index) in inviteSpell.personList"
+						:key="index">
+						<image v-if="index == 0" class="head-icon border-FF7 z-index-0" :src="item.headImage"></image>
+						<image v-else class="head-icon " :src="item.headImage"></image>
+						<view v-if="index == 0" class="fs18 colonel-box">团长</view>
+					</view>
+					<view v-for="ritem in remainPerson">
+						<view class="replenish-icon flex-items-plus mar-left-20">?</view>
+					</view>
+				</view>
+				<view v-if="remainPerson !== 0">
+					<view v-if="showJoinGroup" class="mar-top-50 font-color-333">还差<label
+							class="font-color-C5AA7B">{{remainPerson}}</label>人成团,距结束还剩{{hou}}:{{min}}:{{sec}}</view>
+					<view v-if="type === 1 && showJoinGroup" @click="shareClick"
+						class="offered-but font-color-FFF flex-items-plus mar-top-60">邀请好友拼单</view>
+					<view v-if="type === 0 && showJoinGroup" @click="getOffered"
+						class="offered-but font-color-FFF flex-items-plus mar-top-60">立即参团</view>
+					<view v-else-if="!showJoinGroup" class="group-disabled font-color-FFF flex-items-plus mar-top-60">{{showGroupText}}
+					</view>
+					<view v-if="type === 1 && showJoinGroup" @click="goinvitePoster" class="poster-but flex-items-plus mar-top-40">生成邀请海报
+					</view>
+				</view>
+			</view>
 		</view>
 		<view class="spellrule flex-items-plus flex-column mar-top-20">
 			<view class="flex-row-plus">
@@ -64,7 +74,7 @@
 			</view>
 		</view>
 		<!-- 商品详情 -->
-		<u-popup class="goosDetailshow-box" v-model="goosDetailshowFlag" mode="bottom" border-radius="14">
+		<u-popup class="goosDetailshow-box" v-model="goodsDetailShowFlag" mode="bottom" border-radius="14">
 			<view>
 				<view class="detailImg-box flex-row-plus">
 					<image class="detailImg" :src="skuImg"></image>
@@ -82,7 +92,8 @@
 						<label class="fs24 font-color-999">{{attritem.skuName}}</label>
 						<view class="colorName-box">
 							<view class="pad-bot-30" v-for="(attrRes, resIndex) in attritem.values" :key="resIndex">
-								<label class="colorName" :class="{'colorName-on' :subIndex[index] == resIndex}" @click="colorActiveClick(attrRes,index,resIndex)">{{attrRes.skuValue}}</label>
+								<label class="colorName" :class="{'colorName-on' :subIndex[index] == resIndex}"
+									@click="colorActiveClick(attrRes,index,resIndex)">{{attrRes.skuValue}}</label>
 							</view>
 						</view>
 					</view>
@@ -95,12 +106,14 @@
 						<label class="add" @click="numAdd">+</label>
 					</view>
 				</view>
-				<view class="goosDetailbut-box flex-items-plus" :style="{'padding-bottom':(isIphone===true? 50:20)+'rpx'}">
+				<view class="goosDetailbut-box flex-items-plus"
+					:style="{'padding-bottom':(isIphone===true? 50:20)+'rpx'}">
 					<view class="joinbuyBut" @click="getGroupSettlement(2)">确定</view>
 				</view>
 			</view>
 		</u-popup>
-		<shareSpell ref="shareSpell" @shareCancel='shareCancel' :url="url"></shareSpell>
+		<shareSpell ref="shareSpell" @shareCancel='shareCancel' :url="url" :img="inviteSpell.image" title="好友邀请您来拼单啦">
+		</shareSpell>
 	</view>
 </template>
 
@@ -121,39 +134,40 @@
 				}, {
 					name: '人满成团 失败退款'
 				}, ],
-				collageId:0,
-				orderId:0,
-				type:0,
-				inviteSpell:{},
-				personLen:0,
-				remainPerson:0,
+				collageId: 0,
+				orderId: 0,
+				type: 0,
+				inviteSpell: {},
+				personLen: 0,
+				remainPerson: 0,
 				hou: "00",
 				min: "00",
 				sec: "00",
-				timeOut:undefined,
-				goosDetailshowFlag: false,
-				productId:0,
-				skuId:0,
-				shopGroupWorkId:0,
-				buyNum:1,
-				skuProdId:0,
-				skuImg:'',
-				skuPrice:0,
-				stockNumber:0,
-				skuProdList:{},
+				timeOut: undefined,
+				goodsDetailShowFlag: false,
+				productId: 0,
+				skuId: 0,
+				shopGroupWorkId: 0,
+				buyNum: 1,
+				skuProdId: 0,
+				skuImg: '',
+				skuPrice: 0,
+				stockNumber: 0,
+				skuProdList: {},
 				isIphone: "",
 				selectArr: [], // 存放被选中的值
 				subIndex: [], // 是否选中 因为不确定是多规格还是单规格,所以这里定义数组来判断
 				attrItemIdArr: [], //存放被选中的id
-				shopId:0,
+				shopId: 0,
 				attrList: [],
-				productDetail:{},
 				userInfo: {},
-				url:'',
-				shareTitle: ''
+				url: '',
+				shareTitle: '',
+				showJoinGroup: false,
+				showGroupText: '立即参团'
 			};
 		},
-		components:{
+		components: {
 			shareSpell
 		},
 		onShareAppMessage: function(res) {
@@ -161,11 +175,12 @@
 			//console.log('res=====',res);
 			if (res.from === 'button') {
 				//console.log('来自页面内转发按钮');
-			} else if (res.from === 'menu'){
+			} else if (res.from === 'menu') {
 				//console.log('右上角菜单转发按钮');
 			}
-			this.url = '/pages_category_page1/goodsModule/inviteSpell?collageId='
-					+ this.collageId +'&orderId='+ this.orderId+'&type=0'+'&productId='+this.productId+'&skuId='+this.skuId+'&shopGroupWorkId='+this.shopGroupWorkId
+			this.url = '/pages_category_page1/goodsModule/inviteSpell?collageId=' +
+				this.collageId + '&orderId=' + this.orderId + '&type=0' + '&productId=' + this.productId + '&skuId=' +
+				this.skuId + '&shopGroupWorkId=' + this.shopGroupWorkId
 			this.shareTitle = `【仅剩${this.remainPerson}个名额】我${this.inviteSpell.price}元拼了${this.inviteSpell.productName}`
 			// 返回数据
 			return {
@@ -188,36 +203,66 @@
 				}
 			}
 		},
-		onUnload() {
-			if(this.timeOut){
-			    clearTimeout(this.timeOut)
+		onShareTimeline: function(res) {
+			var that = this;
+			//console.log('res=====',res);
+			if (res.from === 'button') {
+				//console.log('来自页面内转发按钮');
+			} else if (res.from === 'menu') {
+				//console.log('右上角菜单转发按钮');
+			}
+			this.url = '/pages_category_page1/goodsModule/inviteSpell?collageId=' +
+					this.collageId + '&orderId=' + this.orderId + '&type=0' + '&productId=' + this.productId + '&skuId=' +
+					this.skuId + '&shopGroupWorkId=' + this.shopGroupWorkId
+			this.shareTitle = `【仅剩${this.remainPerson}个名额】我${this.inviteSpell.price}元拼了${this.inviteSpell.productName}`
+			// 返回数据
+			return {
+				title: that.shareTitle,
+				path: that.url,
+				success: function(res) {
+					// 转发成功,可以把当前页面的链接发送给后端,用于记录当前页面被转发了多少次或其他业务
+					wx.request({
+						url: app.buildUrl("/member/share"),
+						data: {
+							url: utils.getCurrentPageUrlWithArgs()
+						},
+						success: function(res) {
+							//console.log('成功');
+						}
+					});
+				},
+				fail: function(res) {
+					// 转发失败
+				}
 			}
 		},
-		onShow(){
-            //判断是否登录
-			let item = {}
-			if(uni.getStorageSync('storage_key')){
-				item = uni.getStorageSync('storage_key');
+		onUnload() {
+			if (this.timeOut) {
+				clearTimeout(this.timeOut)
 			}
-			if(JSON.stringify(item) == '{}'){
+		},
+		onShow() {
+			//判断是否登录
+			this.userInfo = uni.getStorageSync('storage_key');
+			if (!(this.userInfo && this.userInfo.buyerUserId)) {
 				let data = {
 					collageId : this.collageId,
 					orderId : this.orderId,
 					productId : this.productId,
 					skuId : this.skuId,
 					type : this.type,
+					shopGroupWorkId: this.shopGroupWorkId
 				}
 				uni.setStorageSync("inviteSpell",data)
-				// uni.navigateTo({
-				// 	url:'../../pages_category_page2/userModule/accountLogin?inviteSpell=1'
-				// })
-			}else{
-				this.userInfo = uni.getStorageSync('storage_userInfo')
+				uni.navigateTo({
+					url:'../../pages_category_page2/userModule/accountLogin?inviteSpell=1'
+				})
+			} else {
+				this.getInviteSpell()
 			}
-			this.getInviteSpell()
 		},
 		onLoad(options) {
-			console.log(options,'options')
+			console.log(options, 'options')
 			this.isIphone = getApp().globalData.isIphone;
 			let item = getApp().globalData.inviteSpellShareItem
 			if (item) {
@@ -234,73 +279,69 @@
 				this.skuId = parseInt(options.skuId)
 				this.shopGroupWorkId = parseInt(options.shopGroupWorkId)
 			}
-			this.getProductSku()
-			this.queryProductDetail()
-			this.url = '/pages_category_page1/goodsModule/inviteSpell?collageId='
-					+ this.collageId +'&orderId='+ this.orderId+'&productId='+this.productId+'&skuId='+this.skuId+'&shopGroupWorkId='+this.shopGroupWorkId
+			// #ifdef MP-WEIXIN
+			this.url = '/pages_category_page1/goodsModule/inviteSpell?collageId=' +
+				this.collageId + '&orderId=' + this.orderId + '&productId=' + this.productId + '&skuId=' + this.skuId +
+				'&shopGroupWorkId=' + this.shopGroupWorkId
+			// #endif
+			// #ifndef MP-WEIXIN
+			this.url = '/h5/#/pages_category_page1/goodsModule/inviteSpell?collageId=' +
+				this.collageId + '&orderId=' + this.orderId + '&productId=' + this.productId + '&skuId=' + this.skuId +
+				'&shopGroupWorkId=' + this.shopGroupWorkId
+			// #endif
 		},
-		methods:{
-			getOffered(){
-        this.goosDetailshowFlag = true
+		methods: {
+			getOffered() {
+				this.goodsDetailShowFlag = true
+			},
+			goodsDateils() {
+				uni.navigateTo({
+					url: '/pages_category_page1/goodsModule/goodsDetails?shopId=' + this.shopId + '&productId=' +
+						this.productId + '&skuId=' +
+						this.skuId
+				})
 			},
 			//拼团下单
-			getGroupSettlement(type){
-        uni.removeStorageSync("skuItemDTOList")
-				let data={}
-				data= {
-					collageId:this.collageId,
-					number:this.buyNum,
-					productId:this.productId,
-					shopId:this.shopId,
-					skuId:this.skuProdId,
-					shopGroupWorkId:this.shopGroupWorkId,
-					type:type
+			getGroupSettlement(type) {
+				uni.removeStorageSync("skuItemDTOList")
+				let data = {}
+				data = {
+					collageId: this.collageId,
+					number: this.buyNum,
+					productId: this.productId,
+					shopId: this.shopId,
+					skuId: this.skuProdId,
+					shopGroupWorkId: this.shopGroupWorkId,
+					type: type
 				}
-				uni.setStorageSync('skuItemList',data)
-				this.goosDetailshowFlag = false
+				uni.setStorageSync('skuItemList', data)
+				this.goodsDetailShowFlag = false
 				this.buyNum = 1
 				uni.navigateTo({
 					url: '../orderModule/orderConfirm?type=1',
 				})
 			},
-			//获取商品详情
-			queryProductDetail() {
-				NET.request(API.QueryProductDetail,
-				{
-					shopId:this.shopId,
-					productId:this.productId,
-					skuId:this.skuId,
-					terminal:1
-				},
-				"GET").then(res => {
-					this.productDetail = res.data
-					for (let i = 0; i < res.data.attrList.length; i++) {
-						this.subIndex[i] = 0
-					}
-					this.attrItemIdArr[0] = res.data.attrList[0].attrValueList[0].id
-				}).catch(res => {
-				})
-			},
-			getProductSku(){
-				NET.request(API.QueryProductSku, {
-					skuId:this.skuId,
-					productId:this.productId
+			getProductSku() {
+				NET.request(API.getSpecificSku, {
+					skuId: this.skuId,
+					productId: this.productId
 				}, 'GET').then(res => {
 					this.skuProdList = res.data
 					this.attrList = res.data.names
 					this.attrValueList = res.data.names[0].values
 					//渲染商详之后,默认先选中第一个规格
-					this.colorActiveClick(this.attrValueList[0],0,0)
+					this.colorActiveClick(this.attrValueList[0], 0, 0)
 					this.skuProdId = this.skuId
 					this.skuImg = res.data.image
 					this.skuPrice = res.data.price
 					this.stockNumber = res.data.stockNumber
 					this.shopId = res.data.shopId
-
 				}).catch(res => {
-
+					uni.showToast({
+						title: '查询sku信息失败',
+						icon: "none"
+					})
 				})
-
 			},
 			// 数量减
 			numSub() {
@@ -315,9 +356,9 @@
 			},
 			// 数量加
 			numAdd() {
-				if(this.buyNum < this.stockNumber){
+				if (this.buyNum < this.stockNumber) {
 					this.buyNum = this.buyNum + 1
-				}else{
+				} else {
 					uni.showToast({
 						title: '库存不足!',
 						icon: "none"
@@ -357,13 +398,13 @@
 			},
 			checkItemDataClick(attrItemIdArr) {
 				let attrkey = ''
-				for(let i =0;i<attrItemIdArr.length;i++){
-					attrkey += attrItemIdArr[i]+','
+				for (let i = 0; i < attrItemIdArr.length; i++) {
+					attrkey += attrItemIdArr[i] + ','
 				}
-				attrkey = attrkey.substring(0,attrkey.length - 1)
+				attrkey = attrkey.substring(0, attrkey.length - 1)
 				let mapinfo = this.skuProdList.map
-				for (var key in mapinfo){
-					if(attrkey == key){
+				for (var key in mapinfo) {
+					if (attrkey == key) {
 						this.skuProdId = mapinfo[key].skuId
 						this.skuImg = mapinfo[key].skuImg
 						this.skuPrice = mapinfo[key].price
@@ -371,53 +412,68 @@
 					}
 				}
 			},
-			shareClick(){
+			shareClick() {
 				this.$refs.shareSpell.shareShow = true
 			},
-			shareCancel(){
+			shareCancel() {
 				this.$refs.shareSpell.shareShow = false
 			},
-			goinvitePoster(){
-			  console.log(this.inviteSpell, 'test')
+			goinvitePoster() {
+				console.log(this.inviteSpell, 'test')
 				let data = {
-					image:this.inviteSpell.image,
-					headImage:this.inviteSpell.headImage,
-					productName:this.inviteSpell.productName,
-					person:this.inviteSpell.person,
-					originalPrice:this.inviteSpell.originalPrice,
-					price:this.inviteSpell.price,
-					collageId:this.collageId,
-          productId:this.productId,
-          skuId:this.skuId,
-					orderId:this.orderId
+					image: this.inviteSpell.image,
+					headImage: this.inviteSpell.headImage,
+					productName: this.inviteSpell.productName,
+					person: this.inviteSpell.person,
+					originalPrice: this.inviteSpell.originalPrice,
+					price: this.inviteSpell.price,
+					collageId: this.collageId,
+					productId: this.productId,
+					skuId: this.skuId,
+					orderId: this.orderId
 				}
 				uni.navigateTo({
-					url:'invitePoster?data='+ JSON.stringify(data)
+					url: 'invitePoster?data=' + JSON.stringify(data)
 				})
 			},
-			getInviteSpell(){
+			getInviteSpell() {
 				uni.showLoading({
-                  mask: true,
-				  title: '加载中...',
+					mask: true,
+					title: '加载中...',
 				})
 				NET.request(API.getInviteSpell, {
-					collageId:this.collageId,
+					collageId: this.collageId,
 					orderId: this.orderId
 				}, 'POST').then(res => {
 					this.inviteSpell = res.data
 					this.type = 0
-					this.inviteSpell.personList.forEach(item=>{
-						if(item.name === this.userInfo.name){
+					this.inviteSpell.personList.forEach(item => {
+						if (this.userInfo && item.buyerUserId === this.userInfo.buyerUserId) {
 							this.type = 1
 						}
 					})
 					this.personLen = res.data.personList.length
 					this.remainPerson = res.data.person - this.personLen
-					this.dateformat(res.data.time)
-					this.countDown()
+					const orderState = res.data.orderState
+					const activityState = res.data.activityState
+					const collageOrderState = res.data.collageOrderState
+					if (orderState !== 6 || activityState !== 1 || collageOrderState !== 0 || res.data.time <= 1) {
+						this.showJoinGroup = false
+						if (activityState !== 1) {
+							this.showGroupText = '活动已结束'
+						}
+						if (collageOrderState !== 0 || orderState !== 6 || res.data.time <= 1) {
+							this.showGroupText = '拼单已失效'
+						}
+					} else {
+						this.showJoinGroup = true;
+						this.dateformat(res.data.time)
+						this.countDown()
+						this.getProductSku()
+					}
 					uni.hideLoading()
 				}).catch(res => {
-				  uni.hideLoading()
+					uni.hideLoading()
 				})
 			},
 			//时分秒换算
@@ -436,357 +492,403 @@
 				this.min = min
 				this.sec = sec
 			},
-			countDown(){
-			    let timeOut = setTimeout(() => {
-			      let hou = parseInt(this.hou);
-			      let min = parseInt(this.min);
-			      let sec = parseInt(this.sec);
-
-			      let netxSec = sec - 1;
-			      let netxMin = min
-			      let netxHou = hou;
-
-			      if (netxHou == 0 && netxMin == 0 && netxSec == -1) {
-			        clearTimeout(timeOut)
-					// uni.switchTab({
-					// 	url:'../../pages/tabbar/index/index'
-					// })
-			      } else {
-			        if (netxSec == -1) {
-			          netxSec = 59
-			          netxMin = netxMin - 1;
-			        }
-			        if (netxMin == -1) {
-			          netxMin = 59
-			          netxHou = netxHou - 1
-			        }
-			        if (netxHou == -1) {
-			          netxHou = 23
-			        }
-
-			        this.hou = this.timeFormat(netxHou),
-			        this.min = this.timeFormat(netxMin),
-			        this.sec = this.timeFormat(netxSec),
-			        this.timeOut = timeOut
-			        this.countDown();
-			      }
-			    }, 1000)
+			countDown() {
+				let timeOut = setTimeout(() => {
+					let hou = parseInt(this.hou);
+					let min = parseInt(this.min);
+					let sec = parseInt(this.sec);
+
+					let netxSec = sec - 1;
+					let netxMin = min
+					let netxHou = hou;
+
+					if (netxHou === 0 && netxMin === 0 && netxSec === -1) {
+						this.showJoinGroup = false
+						clearTimeout(timeOut)
+						// uni.switchTab({
+						// 	url:'../../pages/tabbar/index/index'
+						// })
+					} else {
+						if (netxSec === -1) {
+							netxSec = 59
+							netxMin = netxMin - 1;
+						}
+						if (netxMin === -1) {
+							netxMin = 59
+							netxHou = netxHou - 1
+						}
+						if (netxHou === -1) {
+							netxHou = 23
+						}
+
+						this.hou = this.timeFormat(netxHou)
+						this.min = this.timeFormat(netxMin)
+						this.sec = this.timeFormat(netxSec)
+						this.timeOut = timeOut
+						this.countDown();
+					}
+				}, 1000)
 			},
 			timeFormat(param) { //小于10的格式化函数
-			    return param < 10 ? '0' + param : param;
+				return param < 10 ? '0' + param : param;
 			},
 		}
 	}
 </script>
 
 <style lang="scss">
-page{background-color: #F7F7F7;}
-.copy-color{
-	display: flex;
-	justify-content: center;
-	align-items:center;
-	flex-direction: column;
-}
-.inviteSpell-con{
-  background: url("https://ceres.zkthink.com/static/images/pintuanbg.png") no-repeat left top;
-  background-size: contain;
-  .grouped {
-    text-align: center;
-    padding-top: 40rpx;
-    .number {
-      display: inline-block;
-      color: #FFEBC4;
-      height: 48rpx;
-      line-height: 48rpx;
-      padding: 0 30rpx;
-      background: #525252;
-      margin-top: 10rpx;
-    }
-  }
-	.z-index-0{
-		z-index: 0;
-	}
-	.border-FF7{
-		border: 2rpx solid #FFF;
-	}
-	.colonel-box{
-		color: #FFEBC4;
-		background-color: #333333;
-		width: 86rpx;
-		height: 32rpx;
-		line-height: 32rpx;
-		border-radius: 15rpx;
-		text-align: center;
-		margin-top: -20rpx;
-		z-index: 2;
+	page {
+		background-color: #F7F7F7;
 	}
-	.font-color-C5AA7B{
-		color: #C5AA7B;
+
+	.copy-color {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		flex-direction: column;
 	}
-  .topBox {
-    padding: 40rpx 20rpx 0 20rpx;
-  }
-	.title-box{
-		padding: 30rpx;
-    background: #FFFFFF;
-		.title-lab{
-			width: 400rpx;
-      height: 130rpx;
-		}
-		.spellNum{
-			background-color: #FFEDDF;
-			border-radius: 22rpx;
-			width: 144rpx;
-			height: 44rpx;
-		}
-		.pro-img{
-			width: 222rpx;
-			height: 222rpx;
-		}
-		.issueregiment{
-			width: 120rpx;
-			height: 122rpx;
+
+	.inviteSpell-con {
+		background: url("https://ceres.zkthink.com/static/images/pintuanbg.png") no-repeat left top;
+		background-size: contain;
+
+		.grouped {
+			text-align: center;
+			padding-top: 40rpx;
+
+			.number {
+				display: inline-block;
+				color: #FFEBC4;
+				height: 48rpx;
+				line-height: 48rpx;
+				padding: 0 30rpx;
+				background: #525252;
+				margin-top: 10rpx;
+			}
 		}
-	}
-	.spellpersonnel-box{
-		margin-top: 20rpx;
-    padding: 0 20rpx;
-    .bgBox {
-      background-color: #FFFFFF;
-      padding: 30rpx 0;
-    }
-		.head-icon{
-			width: 102rpx;
-			height: 102rpx;
-			border-radius: 50%;
+
+		.z-index-0 {
+			z-index: 0;
 		}
-		.replenish-icon{
-			width: 102rpx;
-			height: 102rpx;
-			border-radius: 50%;
-			border: 1rpx #E5E5E5 dashed;
-			font-size: 60rpx;
-			color: #DBDBDB;
+
+		.border-FF7 {
+			border: 2rpx solid #FFF;
 		}
-		.offered-but{
+
+		.colonel-box {
+			color: #FFEBC4;
 			background-color: #333333;
-			border-radius: 5rpx;
-			width: 420rpx;
-			height: 66rpx;
-      color: #FFEBC4;
+			width: 86rpx;
+			height: 32rpx;
+			line-height: 32rpx;
+			border-radius: 15rpx;
+			text-align: center;
+			margin-top: -20rpx;
+			z-index: 2;
 		}
-		.poster-but{
-			border: #C5AA7B 1rpx solid;
-			border-radius: 5rpx;
-			width: 420rpx;
-			height: 66rpx;
+
+		.font-color-C5AA7B {
 			color: #C5AA7B;
 		}
-	}
-	.spellrule{
-		background-color: #FFFFFF;
-		padding: 50rpx 20rpx;
-		.dot1{
-			width: 4rpx;
-			height: 4rpx;
-			background-color: #B6B6C1;
-			border-radius: 50%;
-			margin-left: 10rpx;
-		}
-		.dot2{
-			width: 6rpx;
-			height: 6rpx;
-			background-color: #B6B6C1;
-			border-radius: 50%;
-			margin-left: 10rpx;
-		}
-		.dot3{
-			width: 8rpx;
-			height: 8rpx;
-			background-color: #B6B6C1;
-			border-radius: 50%;
-			margin-left: 10rpx;
+
+		.topBox {
+			padding: 40rpx 20rpx 0 20rpx;
 		}
-	}
-	.inactive-box{
-		padding: 40rpx 40rpx;
-		.weixin-box{
-			width: 100rpx;
-			height: 100rpx;
-			background-color: #F5F5F5;
-			border-radius: 50%;
-			image{
-				width: 55rpx;
-				height: 55rpx;
+
+		.title-box {
+			padding: 30rpx;
+			background: #FFFFFF;
+
+			.title-lab {
+				width: 400rpx;
+				height: 130rpx;
+			}
+
+			.spellNum {
+				background-color: #FFEDDF;
+				border-radius: 22rpx;
+				width: 144rpx;
+				height: 44rpx;
+			}
+
+			.pro-img {
+				width: 222rpx;
+				height: 222rpx;
+			}
+
+			.issueregiment {
+				width: 120rpx;
+				height: 122rpx;
 			}
 		}
-	}
-	.goosDetailshow-box {
-		.detailImg-box {
-			margin-top: 30upx;
-			margin-left: 30upx;
-			border-radius: 10upx;
-			border-bottom: 1upx solid #EDEDED;
-			padding-bottom: 20upx;
-			width: 690upx;
-
-			.detailImg {
-				width: 180upx;
-				height: 180upx;
+
+		.spellpersonnel-box {
+			margin-top: 20rpx;
+			padding: 0 20rpx;
+
+			.bgBox {
+				background-color: #FFFFFF;
+				padding: 30rpx 0;
+			}
+
+			.head-icon {
+				width: 102rpx;
+				height: 102rpx;
+				border-radius: 50%;
+			}
+
+			.replenish-icon {
+				width: 102rpx;
+				height: 102rpx;
+				border-radius: 50%;
+				border: 1rpx #E5E5E5 dashed;
+				font-size: 60rpx;
+				color: #DBDBDB;
+			}
+
+			.offered-but {
+				background-color: #333333;
+				border-radius: 5rpx;
+				width: 420rpx;
+				height: 66rpx;
+				color: #FFEBC4;
+			}
+
+			.group-disabled {
+				background: #b7b7b7;
+				border-radius: 5rpx;
+				width: 420rpx;
+				height: 66rpx;
+				line-height: 80upx;
+				justify-content: center;
+				color: #333333;
+			}
+
+			.poster-but {
+				border: #C5AA7B 1rpx solid;
+				border-radius: 5rpx;
+				width: 420rpx;
+				height: 66rpx;
+				color: #C5AA7B;
 			}
 		}
 
-		.color-box {
-			padding: 30upx 30upx;
-			border-bottom: 1upx solid #EDEDED;
-			width: 690upx;
-
-			.colorName-box {
-				display: flex;
-				flex-wrap: wrap;
-				flex-direction: row;
-				justify-content: flex-start;
-				align-items: center;
-				margin-top: 30upx;
-				margin-left: -30upx;
+		.spellrule {
+			background-color: #FFFFFF;
+			padding: 50rpx 20rpx;
 
-				.colorName-on {
-					background-color: #FFE5D0;
-					color: #C5AA7B;
-					margin-left: 30upx;
-					padding: 10upx 32upx;
-					border-radius: 28upx;
-					border: 1upx solid #C5AA7B;
-					font-size: 26upx;
-					text-align: center;
-					z-index: 1;
-				}
+			.dot1 {
+				width: 4rpx;
+				height: 4rpx;
+				background-color: #B6B6C1;
+				border-radius: 50%;
+				margin-left: 10rpx;
+			}
 
-				.colorName {
-					background-color: #F5F5F5;
-					margin-left: 30upx;
-					padding: 10upx 32upx;
-					border-radius: 28upx;
-					font-size: 26upx;
-					z-index: 2;
-				}
+			.dot2 {
+				width: 6rpx;
+				height: 6rpx;
+				background-color: #B6B6C1;
+				border-radius: 50%;
+				margin-left: 10rpx;
 			}
 
+			.dot3 {
+				width: 8rpx;
+				height: 8rpx;
+				background-color: #B6B6C1;
+				border-radius: 50%;
+				margin-left: 10rpx;
+			}
 		}
 
-		.modelNum-box {
-			padding: 30upx 30upx;
-			border-bottom: 1upx solid #EDEDED;
-			width: 690upx;
-
-			.modelNumName-box {
-				display: flex;
-				flex-wrap: wrap;
-				flex-direction: row;
-				justify-content: flex-start;
-				align-items: center;
-				margin-top: 30upx;
-				margin-left: -30upx;
+		.inactive-box {
+			padding: 40rpx 40rpx;
 
-				.modelNumName-on {
-					background-color: #FFE4D0;
-					color: #C5AA7B;
-					margin-left: 30upx;
-					padding: 10upx 32upx;
-					border-radius: 28upx;
-					border: 1upx solid #C5AA7B;
-					font-size: 26upx;
-					text-align: center;
-				}
+			.weixin-box {
+				width: 100rpx;
+				height: 100rpx;
+				background-color: #F5F5F5;
+				border-radius: 50%;
 
-				.modelNumName {
-					background-color: #F5F5F5;
-					margin-left: 30upx;
-					padding: 10upx 32upx;
-					border-radius: 28upx;
-					font-size: 26upx;
+				image {
+					width: 55rpx;
+					height: 55rpx;
 				}
 			}
 		}
-	.joinbuyBut{
-		width: 690upx;
-		height: 80upx;
-		border-radius: 40upx 40upx;
-		background-color: #3D3C3D;
-		color: #FFFEFE;
-		font-size: 28upx;
-		line-height: 80upx;
-		text-align: center;
-	}
-		.goodsNum-box {
-			padding: 30upx 30upx;
-			width: 690upx;
-			padding-bottom: 268upx;
-
-			.goodsNumber {
-				border: 1upx solid #999999;
-				padding: 3upx 20upx;
+
+		.goosDetailshow-box {
+			.detailImg-box {
+				margin-top: 30upx;
+				margin-left: 30upx;
+				border-radius: 10upx;
+				border-bottom: 1upx solid #EDEDED;
+				padding-bottom: 20upx;
+				width: 690upx;
+
+				.detailImg {
+					width: 180upx;
+					height: 180upx;
+				}
 			}
 
-			.subtract {
-				border: 1upx solid #999999;
-				padding: 3upx 20upx;
-				margin-right: -1upx;
+			.color-box {
+				padding: 30upx 30upx;
+				border-bottom: 1upx solid #EDEDED;
+				width: 690upx;
+
+				.colorName-box {
+					display: flex;
+					flex-wrap: wrap;
+					flex-direction: row;
+					justify-content: flex-start;
+					align-items: center;
+					margin-top: 30upx;
+					margin-left: -30upx;
+
+					.colorName-on {
+						background-color: #FFE5D0;
+						color: #C5AA7B;
+						margin-left: 30upx;
+						padding: 10upx 32upx;
+						border-radius: 28upx;
+						border: 1upx solid #C5AA7B;
+						font-size: 26upx;
+						text-align: center;
+						z-index: 1;
+					}
+
+					.colorName {
+						background-color: #F5F5F5;
+						margin-left: 30upx;
+						padding: 10upx 32upx;
+						border-radius: 28upx;
+						font-size: 26upx;
+						z-index: 2;
+					}
+				}
+
 			}
 
-			.add {
-				border: 1upx solid #999999;
-				padding: 3upx 20upx;
-				margin-left: -1upx;
+			.modelNum-box {
+				padding: 30upx 30upx;
+				border-bottom: 1upx solid #EDEDED;
+				width: 690upx;
+
+				.modelNumName-box {
+					display: flex;
+					flex-wrap: wrap;
+					flex-direction: row;
+					justify-content: flex-start;
+					align-items: center;
+					margin-top: 30upx;
+					margin-left: -30upx;
+
+					.modelNumName-on {
+						background-color: #FFE4D0;
+						color: #C5AA7B;
+						margin-left: 30upx;
+						padding: 10upx 32upx;
+						border-radius: 28upx;
+						border: 1upx solid #C5AA7B;
+						font-size: 26upx;
+						text-align: center;
+					}
+
+					.modelNumName {
+						background-color: #F5F5F5;
+						margin-left: 30upx;
+						padding: 10upx 32upx;
+						border-radius: 28upx;
+						font-size: 26upx;
+					}
+				}
 			}
-		}
 
-		.goosDetailbut-box {
-			.joinShopCartBut {
-				width: 343upx;
+			.joinbuyBut {
+				width: 690upx;
 				height: 80upx;
-				border-radius: 40upx 0 0 40upx;
+				border-radius: 40upx 40upx;
 				background-color: #3D3C3D;
 				color: #FFFEFE;
 				font-size: 28upx;
 				line-height: 80upx;
 				text-align: center;
-				margin-left: 30upx;
 			}
 
-			.buyNowBut {
-				width: 343upx;
-				height: 80upx;
-				border-radius: 0 40upx 40upx 0;
-				background-color: #3D3C3D;
-				color: #FFFEFE;
-				font-size: 28upx;
-				line-height: 80upx;
-				text-align: center;
+			.goodsNum-box {
+				padding: 30upx 30upx;
+				width: 690upx;
+				padding-bottom: 268upx;
+
+				.goodsNumber {
+					border: 1upx solid #999999;
+					padding: 3upx 20upx;
+				}
+
+				.subtract {
+					border: 1upx solid #999999;
+					padding: 3upx 20upx;
+					margin-right: -1upx;
+				}
+
+				.add {
+					border: 1upx solid #999999;
+					padding: 3upx 20upx;
+					margin-left: -1upx;
+				}
+			}
+
+			.goosDetailbut-box {
+				.joinShopCartBut {
+					width: 343upx;
+					height: 80upx;
+					border-radius: 40upx 0 0 40upx;
+					background-color: #3D3C3D;
+					color: #FFFEFE;
+					font-size: 28upx;
+					line-height: 80upx;
+					text-align: center;
+					margin-left: 30upx;
+				}
+
+				.buyNowBut {
+					width: 343upx;
+					height: 80upx;
+					border-radius: 0 40upx 40upx 0;
+					background-color: #3D3C3D;
+					color: #FFFEFE;
+					font-size: 28upx;
+					line-height: 80upx;
+					text-align: center;
+				}
 			}
 		}
 	}
-}
 </style>
 <style scoped>
- .spellrule /deep/ .u-steps__item__num {
-   background: #F3F4F5 !important;
-   border: none !important;
-   width: 60rpx;
-   height: 60rpx;
- }
- .spellrule /deep/ .u-steps .u-steps__item--row .u-steps__item__line {
-   left: 66%;
-   width: 67%;
- }
- .spellrule /deep/ .u-steps .u-steps__item--row .u-line {
-   height: 6rpx;
-   border-bottom: none;
-   background: #F3F4F5;
-   border-bottom: none !important;
- }
- .spellrule /deep/ .u-steps .u-steps__item--row .u-steps__item__text--row {
-   width: 180rpx;
-   padding: 0 25rpx;
- }
+	.spellrule /deep/ .u-steps__item__num {
+		background: #F3F4F5 !important;
+		border: none !important;
+		width: 60rpx;
+		height: 60rpx;
+	}
+
+	.spellrule /deep/ .u-steps .u-steps__item--row .u-steps__item__line {
+		left: 66%;
+		width: 67%;
+	}
+
+	.spellrule /deep/ .u-steps .u-steps__item--row .u-line {
+		height: 6rpx;
+		border-bottom: none;
+		background: #F3F4F5;
+		border-bottom: none !important;
+	}
+
+	.spellrule /deep/ .u-steps .u-steps__item--row .u-steps__item__text--row {
+		width: 180rpx;
+		padding: 0 25rpx;
+	}
 </style>

+ 159 - 54
pages_category_page1/orderModule/afterSaleApply.vue

@@ -11,12 +11,31 @@
                     active-color="#C5AA7B"
                     shape="circle"
                     size="40"
-                    v-for="(item, index) in item.skus"
+                    v-for="(item, index) in this.wrapperList"
                     :key="index"
                     v-model="item.checked"
-                    :name='item.skuId'
                     @change="checkboxChange(item)">
-                  <view class="order-info-item">
+                  <view v-if="item.dataType === 1" class="order-info-price">
+                    <view>
+                      <text class="price-notice">定价捆绑商品</text>
+                    </view>
+                    <view class="order-info-item" v-for="priceItem in item.skus">
+                      <image :src="priceItem.image"
+                             class="product-img"></image>
+                      <view class="info-box">
+                        <text class="product-name">{{ priceItem.productName }}</text>
+                        <view class="product-sku">{{ priceItem.value }}</view>
+                        <view class="price-sku-box">
+                          <text class="product-price">
+                            <text class="fuhao">¥</text>
+                            {{ priceItem.price }}
+                          </text>
+                          <text class="product-num">x {{ priceItem.number }}</text>
+                        </view>
+                      </view>
+                    </view>
+                  </view>
+                  <view v-else class="order-info-item">
                     <image :src="item.image"
                            class="product-img"></image>
                     <view class="info-box">
@@ -79,7 +98,7 @@ export default {
     return {
       item: {},
       checkboxChangelist: [],
-      xuanzlist: [],
+      checkedList: [],
       allCheck: {
         name: '全选',
         value: 'all',
@@ -90,10 +109,28 @@ export default {
       distribution: null,
       isAllSelect: 0,
       evaluated: 0,//待评价订单申请
+      wrapperList: []
     }
   },
   onLoad(options) {
     this.item = JSON.parse(options.item)
+    const priceList = []
+    this.item.skus.forEach(sku => {
+      console.log('sku', sku.actualPrice)
+      //定价捆绑特殊处理
+      if (sku.activityType === 6) {
+        priceList.push(sku)
+      } else {
+        const newItem = Object.assign({}, sku, {'dataType': 2})
+        this.wrapperList.push(newItem)
+      }
+    })
+    if (priceList.length > 0) {
+      this.wrapperList.push({
+        'dataType': 1,
+        'skus': priceList
+      })
+    }
     this.distribution = this.item.skus[0].distribution
     this.evaluated = options.isAllSelect
     // this.item.skus.forEach((item) => {
@@ -103,61 +140,67 @@ export default {
   },
   methods: {
     // 算钱
-    HandleGetRefundMoney() {
-      return new Promise((resolve, reject) => {
-        if (this.xuanzlist.length <= 0) {
-          resolve(0)
-          return
+    calcRefundMoney() {
+        if (this.checkedList.length <= 0) {
+          return 0
         }
-        uni.showLoading({
-          title: "计算中..."
+        console.log('calc')
+        let total = 0
+        this.checkedList.forEach(item => {
+          if (item.dataType === 1) {
+            item.skus.forEach(sku => {
+              total += sku.actualPrice
+            })
+          } else {
+            total += item.actualPrice
+          }
         })
-        let postData = {
-          orderId: this.item.orderId,
-          isAllSelect: this.evaluated == 1 ? this.xuanzlist.length === this.item.skus.length ? 1 : 0 : 0,
-          skus: this.xuanzlist
-        }
-        NET.request(API.GetRefundMoney, postData, "POST").then(res => {
-          uni.hideLoading()
-          resolve(parseFloat(res.json))
-        })
-      })
+        return total
     },
-    // 申请退款
-    ReturnMoney(item) {
-      if (this.xuanzlist.length <= 0) {
-        uni.showToast({
-          title: '请选择退款的商品',
-          duration: 2000,
-          icon: 'none'
-        })
-      } else {
-        uni.setStorageSync('afterSaleApplyRefund', this.xuanzlist)
-        uni.navigateTo({
-          url: 'afterSaleApplyRefund?orderId=' + this.item.orderId + '&isAllSelect=' + (this.evaluated==1?this.isAllSelect:0)
-        })
+    checkRemainPrice() {
+      let totalPrice = 0
+      this.item.skus.forEach(item => {
+        totalPrice += item.actualPrice
+      })
+      let refundPrice = 0
+      this.checkedList.forEach(item => {
+        refundPrice += item.actualPrice
+      })
+      if (totalPrice - refundPrice < 0.01) {
+        return false
       }
+      return true
     },
     // 全选
     async changeAll(e) {
-      if (e.detail.value.length == 0) {
-        this.item.skus.map(item => this.$set(item, 'checked', false));
+      if (e.detail.value.length === 0) {
+        this.wrapperList.map(item => this.$set(item, 'checked', false));
         this.$set(this.allCheck, 'checked', false);
-        this.xuanzlist = []
-        if (this.item.state === 4 && this.evaluated != undefined) {
+        this.checkedList = []
+        if (this.item.state === 4 && this.evaluated !== undefined) {
           this.isAllSelect = this.evaluated
         } else {
           this.isAllSelect = 0
         }
+        this.number = 0
       } else {
-        this.item.skus.map(item => this.$set(item, 'checked', true));
+        this.wrapperList.map(item => this.$set(item, 'checked', true));
         this.$set(this.allCheck, 'checked', true);
-        if (this.item.state === 4 && this.evaluated != undefined) {
+        if (this.item.state === 4 && this.evaluated !== undefined) {
           this.isAllSelect = this.evaluated
         } else {
           this.isAllSelect = 1
         }
-        this.xuanzlist = this.item.skus.filter(item => item.checked == true)
+        this.checkedList = []
+        this.wrapperList.forEach(item => {
+          if (item.checked) {
+            if (item.dataType === 1) {
+              this.checkedList = this.checkedList.concat(item.skus)
+            } else {
+              this.checkedList.push(item)
+            }
+          }
+        })
         this.number = 0
         // this.total = 0
         this.item.skus.forEach((item) => {
@@ -165,19 +208,46 @@ export default {
           // this.total = this.total + item.total
         })
       }
-      this.total = await this.HandleGetRefundMoney()
+      this.total = this.calcRefundMoney()
+    },
+    // 申请退款
+    ReturnMoney(item) {
+      if (this.checkedList.length <= 0) {
+        uni.showToast({
+          title: '请选择退款的商品',
+          duration: 2000,
+          icon: 'none'
+        })
+      } else if (this.checkedList.length !== this.item.skus.length && !this.checkRemainPrice()) {
+        uni.showToast({
+          title: '剩余商品价值过低,请一起退款',
+          duration: 2000,
+          icon: 'none'
+        })
+      } else {
+        uni.setStorageSync('afterSaleApplyRefund', this.checkedList)
+        uni.navigateTo({
+          url: 'afterSaleApplyRefund?orderId=' + this.item.orderId + '&isAllSelect=' + (this.evaluated === 1 ? this.isAllSelect : 0)
+        })
+      }
     },
     // 申请退货
     ReturnGoods(item) {
-      if (this.xuanzlist.length <= 0) {
+      if (this.checkedList.length <= 0) {
         uni.showToast({
           title: '请选择退货的商品',
           duration: 2000,
           icon: 'none'
         })
+      } else if (this.checkedList.length !== this.item.skus.length && !this.checkRemainPrice()) {
+        uni.showToast({
+          title: '剩余商品价值过低,请一起退款',
+          duration: 2000,
+          icon: 'none'
+        })
       } else {
         uni.navigateTo({
-          url: 'afterSaleApplyRetund?list=' + encodeURIComponent(JSON.stringify(this.xuanzlist)) + '&orderId=' + this.item.orderId + '&isAllSelect='+ (this.evaluated==1?this.isAllSelect:0)
+          url: 'afterSaleApplyRetund?list=' + encodeURIComponent(JSON.stringify(this.checkedList)) + '&orderId=' + this.item.orderId + '&isAllSelect='+ (this.evaluated === 1 ? this.isAllSelect : 0)
         })
       }
     },
@@ -188,41 +258,64 @@ export default {
     async checkboxChange(e) {
       // 动态设置商品件数和总计
       if (e.checked) {
-        this.number = this.number + e.number
+        if (e.dataType === 1) {
+          e.skus.forEach(item => {
+            this.number += item.number
+          })
+        } else {
+          this.number = this.number + e.number
+        }
         // this.total = this.total + e.total
       } else {
-        this.number = this.number - e.number
+        if (e.dataType === 1) {
+          e.skus.forEach(item => {
+            this.number -= item.number
+          })
+        } else {
+          this.number = this.number - e.number
+        }
         // this.total = this.total - e.total
       }
       // 筛选勾选的
-      this.xuanzlist = this.item.skus.filter(item => item.checked == true)
+      this.checkedList = []
+      this.wrapperList.forEach(item => {
+        if (item.checked) {
+          if (item.dataType === 1) {
+            this.checkedList = this.checkedList.concat(item.skus)
+          } else {
+            this.checkedList.push(item)
+          }
+        }
+      })
+
+      //this.checkedList = this.item.skus.filter(item => item.checked === true)
 
       // 是否为全选
-      if (this.item.skus.length == this.xuanzlist.length) {
-        if (this.item.state === 4 && this.evaluated != undefined) {
+      if (this.item.skus.length === this.checkedList.length) {
+        if (this.item.state === 4 && this.evaluated !== undefined) {
           this.isAllSelect = this.evaluated
         } else {
           this.isAllSelect = 1
         }
         this.$set(this.allCheck, 'checked', true);
       } else {
-        if (this.item.state === 4 && this.evaluated != undefined) {
+        if (this.item.state === 4 && this.evaluated !== undefined) {
           this.isAllSelect = this.evaluated
         } else {
           this.isAllSelect = 0
         }
         this.$set(this.allCheck, 'checked', false);
       }
-      this.total = await this.HandleGetRefundMoney()
+      this.total = this.calcRefundMoney()
 
-      //     if(this.xuanzlist.findIndex(item=>item.checked===true)==-1){
+      //     if(this.checkedList.findIndex(item=>item.checked===true)==-1){
       //   console.log(this.allCheck,'this.allCheck')
-      //   console.log(this.xuanzlist,'this.xuanzlist')
+      //   console.log(this.checkedList,'this.checkedList')
       //       this.$set(this.allCheck, 'checked', false);
       //     } else {
       //   console.log(this.allCheck,'this.allCheck')
       //       this.$set(this.allCheck, 'checked', true);
-      // console.log(this.xuanzlist,'this.xuanzlist')
+      // console.log(this.checkedList,'this.checkedList')
       //     }
     }
   }
@@ -295,6 +388,18 @@ page {
   /* border-bottom: 1px solid #eee; */
 }
 
+.order-info-price {
+  display: block;
+  padding: 10upx 20upx;
+  width: 600rpx;
+  border-top: 1px solid #eee;
+
+  .price-notice {
+    font-size: 12upx;
+    color: red;
+  }
+}
+
 .order-info-item {
   display: flex;
   flex-direction: row;

+ 18 - 43
pages_category_page1/orderModule/afterSaleApplyRefund.vue

@@ -109,7 +109,9 @@
         </view>
       </view>
     </u-popup>
-    <u-popup v-model="cargoStatusShowFalg" mode="bottom" border-radius="14">
+    <u-popup v-model="cargoStatusShowFalg"
+             mode="bottom"
+             border-radius="14">
       <view class="alert-box">
         <view class="afterSale-status-box">
           <view class="status-title">货物状态</view>
@@ -130,9 +132,13 @@
       </view>
     </u-popup>
     <!-- 退款原因弹框 -->
-    <u-popup v-model="reasonShowFalg" mode="bottom" border-radius="14">
+    <u-popup v-model="reasonShowFalg"
+             mode="bottom"
+             border-radius="14"
+             width="80%"
+             height="60%">
       <view class="alert-box">
-        <view class="afterSale-status-box" scroll-y style="height:60%;">
+        <view class="afterSale-status-box" scroll-y style="height:100%;">
           <view class="status-title">退款原因</view>
           <view class="item-box">
             <view class="item" @click="returnReasonTap(item,index)" v-for="(item,index) in liyouData" :key="index">
@@ -191,60 +197,25 @@ export default {
     this.fileList = this.$refs.uUpload.lists
   },
   async onLoad(options) {
-	  console.log(options,'options')
     if (uni.getStorageSync('applyItem')) {
       this.afterRefund = uni.getStorageSync('applyItem')
       this.list.push(this.afterRefund)
     } else if (uni.getStorageSync('afterSaleApplyRefund')) {
       this.list = uni.getStorageSync('afterSaleApplyRefund')
     }
-	console.log(this.list,'this.list')
     this.orderId = parseInt(options.orderId)
 	this.isAllSelect = options.isAllSelect
-	console.log(this.isAllSelect,'this.isAllSelect')
     const res = uni.getStorageSync('storage_key');
     this.headerToken.Authorization = res.token
     this.list.forEach(el => {
-		if(this.isAllSelect > 0){
-			this.sellPriceitem = this.sellPriceitem + (el.number*el.price) + el.logisticsPrice
-		}else{
-			this.sellPriceitem = this.sellPriceitem + (el.number*el.price)
-		}
-
+		this.sellPriceitem = this.sellPriceitem + el.actualPrice + el.logisticsPrice
     })
-    // this.sellPriceitem = options.sellPriceitem
-    // this.sellPriceitem = options.sellPriceitem
     this.getReasonEnums()
     uni.removeStorageSync('applyItem')
     uni.removeStorageSync('afterSaleApplyRefund')
-    this.sellPriceitem=await this.HandleGetRefundMoney()
   },
   methods: {
-    // 算钱
-    HandleGetRefundMoney() {
-      return new Promise((resolve, reject) => {
-        uni.showLoading({
-          title: "计算中..."
-        })
-        let postData = {
-          orderId: this.orderId,
-          isAllSelect: this.isAllSelect==1 ? 1 : 0,
-          skus: this.list,
-          afterType:2,
-          goodsState:this.ReturnMoneyQuery.goodsState
-        }
-        NET.request(API.GetRefundMoney, postData, "POST").then(res => {
-          uni.hideLoading()
-          resolve (parseFloat(res.json))
-        }).catch(err=>{
-          uni.hideLoading()
-        })
-      })
-    },
-
-
     confirmTap() {
-      console.log(this.fileList, 'commentImgs')
       if(this.fileList.length>0){
         this.commentImgsFlag = true
         for(let i=0;i<this.fileList.length;i++){
@@ -277,7 +248,6 @@ export default {
           title: '正在提交...',
         })
         let skusobjdata = []
-        console.log(this.list)
         this.list.forEach((i) => {
           let skusobj = {}
           skusobj["skuId"] = i.skuId
@@ -325,7 +295,6 @@ export default {
       this.ReturnMoneyQuery.returnReason = index
       this.liyoutext = item
     },
-
     openStatusSelect() {
       this.cargoStatusShowFalg = true
     },
@@ -337,8 +306,14 @@ export default {
     },
     async closeStatusSelect() {
       this.cargoStatusShowFalg = false
-      this.sellPriceitem=await this.HandleGetRefundMoney()
-
+      this.sellPriceitem = 0
+      this.list.forEach(el => {
+        this.sellPriceitem += el.actualPrice
+        //已收到货物,就不退运费
+        if (this.ReturnMoneyQuery.goodsState === 0) {
+          this.sellPriceitem += el.logisticsPrice
+        }
+      })
     },
     closeAfterSelect() {
       this.refundTypeShow = false

+ 12 - 31
pages_category_page1/orderModule/afterSaleApplyRetund.vue

@@ -110,8 +110,7 @@
     <u-popup v-model="cargoStatusShowFalg"
              mode="center"
              border-radius="14"
-             width="80%"
-             closeable="true">
+             width="80%">
       <view class="alert-box">
         <view class="afterSale-status-box">
           <view class="status-title">货物状态</view>
@@ -152,8 +151,7 @@
     <u-popup v-model="reasonShowFalg"
              mode="center"
              border-radius="14"
-             width="80%"
-             closeable="true">
+             width="80%">
       <view class="alert-box">
         <view class="afterSale-status-box"
               scroll-y>
@@ -227,41 +225,18 @@ export default {
   },
   async onLoad(option) {
     this.retundlist = JSON.parse(decodeURIComponent(option.list))
-    console.log(option,'this.retundlist')
 
     this.orderId = option.orderId
     this.isAllSelect = option.isAllSelect
-    // console.log(this.retundlist, 'retundlist')
     this.retundlist.forEach(el => {
-      this.sellPriceitem = this.sellPriceitem + el.number * el.price
+      this.sellPriceitem = this.sellPriceitem + el.actualPrice
     })
     this.getReasonEnums()
-    this.sellPriceitem = await this.HandleGetRefundMoney()
   },
   methods: {
-    // 算钱
-    HandleGetRefundMoney() {
-      return new Promise((resolve, reject) => {
-        uni.showLoading({
-          title: "计算中..."
-        })
-        let postData = {
-          orderId: this.orderId,
-          isAllSelect: this.isAllSelect==1 ? 1 : 0,
-          skus: this.retundlist,
-          afterType:2,
-          goodsState:this.ReturnMoneyQuery.goodsState
-        }
-        NET.request(API.GetRefundMoney, postData, "POST").then(res => {
-          uni.hideLoading()
-          resolve (parseFloat(res.json))
-        }).catch(err=>{
-          uni.hideLoading()
-        })
-      })
-    },
     confirmTap() {
       if (this.fileList.length > 0) {
+        this.commentImgs=''
         this.commentImgsFlag = true
         for (let i = 0; i < this.fileList.length; i++) {
           this.commentImgs += this.fileList[i].response.data.url + ','
@@ -343,7 +318,13 @@ export default {
     },
     async closeStatusSelect() {
       this.cargoStatusShowFalg = false
-      this.sellPriceitem = await this.HandleGetRefundMoney()
+      this.sellPriceitem = 0
+      this.retundlist.forEach(el => {
+        this.sellPriceitem += el.actualPrice
+        if (this.ReturnMoneyQuery.goodsState === 0) {
+          this.sellPriceitem += el.logisticsPrice
+        }
+      })
     },
     closeReasonSelect() {
       this.reasonShowFalg = false
@@ -710,7 +691,7 @@ export default {
 }
 
 .afterSale-status-box .item-box {
-  padding: 0 0 60upx 0;
+  padding: 0 0 10upx 0;
 }
 
 .afterSale-status-box .status-select-title {

+ 1 - 1
pages_category_page1/orderModule/index.vue

@@ -544,7 +544,7 @@ export default {
         type: 2
       }
       // #ifdef H5
-      let ua = navigator.userAgent.toLowerCase();		
+      let ua = navigator.userAgent.toLowerCase();
       if (ua.match(/MicroMessenger/i) == "micromessenger") {
       	this.payRequest(submitResult)
       } else {

+ 0 - 1
pages_category_page1/orderModule/logisticsInfo.vue

@@ -55,7 +55,6 @@
 			          desc: item.time,
 			        })
 			      }
-			      this.steps = this.steps.reverse()
 			    }).catch(res => {
 			    })
 			},

+ 2220 - 2183
pages_category_page1/orderModule/orderConfirm.vue

@@ -1,2202 +1,2239 @@
 <template>
-  <!-- 提交订单 -->
-  <view v-if="ifShow">
-    <view class="content">
-      <view class="address-box"
-            @click="addAddressTap">
-        <image src="https://ceres.zkthink.com/static/images/orderAddress.png"
-               class="address-img"></image>
-        <!-- 有地址的 -->
-        <view class="address-r"
-              v-if="userAddressInfo.receiveName">
-          <view class="address-name-box">
-            <text>{{ userAddressInfo.receiveName }}</text>
-            <text class="phone">{{ userAddressInfo.receivePhone }}</text>
-          </view>
-          <view class="address-info">
-            <text>{{ userAddressInfo.receiveAdress }} {{ userAddressInfo.address }}</text>
-          </view>
-        </view>
-        <!-- 没有地址的 -->
-        <view class="address-r"
-              v-else>
-          <text>你还没有收货地址哦,点击这里添加</text>
-        </view>
-        <image src="https://ceres.zkthink.com/static/images/greyArrow.png"
-               class="arrow-right-img"></image>
-      </view>
-      <view class="order-list-box">
-        <view class="item"
-              v-for="(item, sIndex) in settlement.shops"
-              :key="item.shopId">
-          <view class="order-list-top">
-            <view class="top-l">
-              <image src="https://ceres.zkthink.com/static/images/orderStoreIcon.png"
-                     class="shop-img"></image>
-              <text class="shop-name">{{ item.shopName }}</text>
-            </view>
-          </view>
-          <view class="order-info-box">
-            <view class="order-info">
-              <view class="order-info-item"
-                    v-for="(cItem, index) in item.skus"
-                    :key="cItem.productId">
-                <image :src="cItem.image"
-                       class="product-img"></image>
-                <view class="info-box">
-                  <text class="product-name">{{ cItem.productName }}</text>
-                  <view class="product-sku">
-                    <view v-for="(vItem, index) in cItem.values">
-                      <label class="mar-left-20">{{ vItem }}</label>
-                    </view>
-                  </view>
-                  <view class="price-sku-box flex-display flex-sp-between">
-                    <view class="product-price">
-                      <text class="fuhao">¥</text>
-                      {{ cItem.price }}
-                    </view>
-                    <view class="product-num">x {{ cItem.number }}</view>
-                  </view>
-                </view>
-              </view>
+	<!-- 提交订单 -->
+	<view v-if="ifShow">
+		<view class="content">
+			<view class="address-box" @click="addAddressTap">
+				<image src="https://ceres.zkthink.com/static/images/orderAddress.png" class="address-img"></image>
+				<!-- 有地址的 -->
+				<view class="address-r" v-if="userAddressInfo.receiveName">
+					<view class="address-name-box">
+						<text>{{ userAddressInfo.receiveName }}</text>
+						<text class="phone">{{ userAddressInfo.receivePhone }}</text>
+					</view>
+					<view class="address-info">
+						<text>{{ userAddressInfo.receiveAdress }} {{ userAddressInfo.address }}</text>
+					</view>
+				</view>
+				<!-- 没有地址的 -->
+				<view class="address-r" v-else>
+					<text>你还没有收货地址哦,点击这里添加</text>
+				</view>
+				<image src="https://ceres.zkthink.com/static/images/greyArrow.png" class="arrow-right-img"></image>
+			</view>
+			<view class="order-list-box">
+				<view class="item" v-for="(item, sIndex) in settlement.shops" :key="item.shopId">
+					<view class="order-list-top">
+						<view class="top-l">
+							<image src="https://ceres.zkthink.com/static/images/orderStoreIcon.png" class="shop-img">
+							</image>
+							<text class="shop-name">{{ item.shopName }}</text>
+						</view>
+					</view>
+					<view class="order-info-box">
+						<view class="order-info">
+							<view class="order-info-item" v-for="(cItem, index) in item.skus" :key="cItem.productId">
+								<image :src="cItem.image" class="product-img"></image>
+								<view class="info-box">
+									<text class="product-name">{{ cItem.productName }}</text>
+									<view class="product-sku">
+										<view v-for="(vItem, index) in cItem.values">
+											<label class="mar-left-20">{{ vItem }}</label>
+										</view>
+									</view>
+									<view class="price-sku-box flex-display flex-sp-between">
+										<view class="product-price">
+											<text class="fuhao">¥</text>
+											{{ cItem.price }}
+										</view>
+										<view class="product-num">x {{ cItem.number }}</view>
+									</view>
+								</view>
+							</view>
 							<view v-if="item.receiveNotMatch" class="adressTips">当前地址不支持配送,可更换其他地址试试</view>
-              <view class="delivery-way-box">
-                <view>
-                  <view class="item">
-                    <view class="flex-items">
-                      <text>配送方式</text>
-                    </view>
-                    <view class="flex-row-plus flex-items">
-                      <text v-if="item.distribution.distributionPrice > 0">快递 ¥
-                                                                           {{ item.distribution.distributionPrice }}
-                      </text>
-                      <text v-else>快递 免邮</text>
-                    </view>
-                  </view>
-                  <view class="flex-item">
-                    <text class="font-color-666 fs24"
-                          v-for="(hItem, hIndex) of item.skuDiscountInfoMap">{{ hItem[0] }}
-                    </text>
-                  </view>
-                </view>
-              </view>
-            </view>
-            <view class="discount-item1"
-                  v-if="item.shopCoupons.length>0"
-                  @click="showShopCoupons(item,sIndex)">
-              <view class="discount-label">店铺优惠</view>
-              <view class="discount-info-box flex-items">
-                <view class="discount-info2"
-                      v-if="item.currentCoupon && item.currentCoupon.couponType === 1">
-                  -¥{{ item.currentCoupon.reduceMoney }}
-                </view>
-                <view class="discount-info2"
-                      v-if="item.currentCoupon && item.currentCoupon.couponType === 2">
-                  {{ item.currentCoupon.reduceMoney }}折券
-                </view>
-                <image class="discount-img"
-                       src="https://ceres.zkthink.com/static/images/arrowRight.png"></image>
-              </view>
-              <!--							<view class="discount-info-box flex-items" v-else>-->
-              <!--								<view class="discount-info1"></view>-->
-              <!--								<image class="discount-img" src="https://ceres.zkthink.com/static/images/arrowRight.png"></image>-->
-              <!--							</view>-->
-            </view>
-            <view class="order-total-box">
-              <text class="total-num">共{{ item.number }}件</text>
-              <text class="total-num ml10">总计</text>
-              <text class="total-price ml10"
-                    v-if="item.totalNum > 0">
-                ¥{{ (parseFloat(item.totalNum) + parseFloat(item.distribution.distributionPrice || 0)).toFixed(2) }}
-              </text>
-              <text class="total-price ml10"
-                    v-else>¥0.00
-              </text>
-            </view>
-          </view>
-        </view>
-
-      </view>
-      <view class="discount-item"
-            @click="showDiscount">
-        <view class="discount-label">平台优惠</view>
-        <view class="discount-info-box flex-items">
-          <view class="discount-info2"
-                v-if="promotionInfoDTO.couponId">
-            <text v-if="promotionInfoDTO.couponType === 2">{{ promotionInfoDTO.reduceMoney }}折</text>
-            <text v-else> -¥{{ promotionInfoDTO.reduceMoney | clip2Decimal }}</text>
-          </view>
-          <view class="discount-info1"
-                v-else-if="couponsList.length<1">无
-          </view>
-          <view class="discount-info1"
-                v-else>不使用
-          </view>
-          <image class="discount-img"
-                 src="https://ceres.zkthink.com/static/images/arrowRight.png"></image>
-        </view>
-      </view>
-      <!--      积分支付-->
-      <view class="integralPayBox"
-            v-if="integralShow">
-        <view class="integralBg">
-          <view class="integralTit fs26">可用{{ integralNum }}积分抵扣{{ integralPrice.toFixed(2) }}元</view>
-          <view class="maxIntegral">
-            <checkbox-group @change="changeIntegral"
-                            style="width: 50rpx">
-              <checkbox style="transform:scale(0.7);"
-                        class="integralCheckbox"
-                        color="#C5AA7B"
-                        value="1"
-                        :checked="selectIntegral"/>
-            </checkbox-group>
-          </view>
-        </view>
-      </view>
-      <view class="pay-type-item">
-        <radio-group @change="payTypeChange">
-          <view class="pay-type-radio"
-                v-if="showWechatPayType">
-            <view class="pay-type-img">
-              <image class="pay-type-img-inner"
-                     src="https://ceres.zkthink.com/static/images/wechat_pay.png"
-                     mode="widthFix"/>
-            </view>
-            <label class="pay-type-label">微信支付</label>
-            <radio class="pay-type-radio-item"
-                   style="transform:scale(0.7)"
-                   value="1"
-                   :checked="paymentMode == 1"/>
-          </view>
-          <view class="pay-type-radio"
-                v-if="showAlipayPayType">
-            <view class="pay-type-img">
-              <image class="pay-type-img-inner"
-                     src="https://ceres.zkthink.com/static/images/alipay.png"
-                     mode="widthFix"/>
-            </view>
-            <label class="pay-type-label">支付宝支付</label>
-            <radio class="pay-type-radio-item"
-                   style="transform:scale(0.7)"
-                   value="2"
-                   :checked="paymentMode == 2"/>
-          </view>
-          <view class="pay-type-radio"
-                v-if="showHuabeiPayType">
-            <view class="pay-type-img">
-              <image class="pay-type-img-inner"
-                     src="https://ceres.zkthink.com/static/images/huabei.png"
-                     mode="widthFix"/>
-            </view>
-            <label class="pay-type-label">花呗分期</label>
-            <radio class="pay-type-radio-item"
-                   style="transform:scale(0.7)"
-                   value="3"
-                   :checked="paymentMode == 3"/>
-            <view class="huabei-detail"
-                  v-if="huabeiDetail"
-                  @click="showHuabeiDetail">
-              <view>
-                <label class="fenqi-wenzi">花呗分期</label>
-                <label class="fenqi-charge-fee">手续费 ¥{{ chargeFee|clip2Decimal }}</label>
-              </view>
-              <label class="fenqi-amount">分期总额 ¥{{ totalPrice | clip2Decimal }}</label>
-              <img class="fenqi-modal"
-                   src="https://ceres.zkthink.com/static/images/arrowRight.png"/>
-            </view>
-          </view>
-        </radio-group>
-      </view>
-      <view class="order-flow-box">
-        <view class="flow-word">交易流程:</view>
-        <view class="flow-word mt25">
-          <text>1、填写收货信息并完成支付</text>
-          <text>2、双方根据物品的交易方式进行交易</text>
-          <text>3、拿到物品,交易结束</text>
-        </view>
-        <!--        实付款不含邮费,涉及邮寄双方协定好费用,提醒发起人修改价格再完成支付;-->
-        <view class="flow-word mt50">注:应国家邮政总局的要求,即日起涉及到个人快递包裹必须收件人实名制,否则将影响到收寄配送。请避免使用「先生,男士,小姐,女士,昵称」等模糊称谓。</view>
-      </view>
-    </view>
-    <view class="order-confirm-box"
-          style="padding-bottom:30upx;">
-      <view class="flex-items flex-sp-between">
-        <text class="num-box">共{{ totalCount }}件</text>
-        <view>
-          <text class="total">合计:</text>
-          <text v-if="totalPrice>0"
-                class="price">¥{{ totalPrice.toFixed(2) }}
-          </text>
-          <text v-else
-                class="price">¥0.00
-          </text>
-        </view>
-      </view>
-      <!-- active 当有地址时按钮加上active选中的样式-->
+							<view class="delivery-way-box">
+								<view>
+									<view class="item">
+										<view class="flex-items">
+											<text>配送方式</text>
+										</view>
+										<view class="flex-row-plus flex-items">
+											<text v-if="item.distribution.distributionPrice > 0">快递 ¥
+												{{ item.distribution.distributionPrice }}
+											</text>
+											<text v-else>快递 免邮</text>
+										</view>
+									</view>
+									<view class="flex-item">
+										<text class="font-color-666 fs24"
+											v-for="(hItem, hIndex) of item.skuDiscountInfoMap">{{ hItem[0] }}
+										</text>
+									</view>
+								</view>
+							</view>
+						</view>
+						<view class="discount-item1" v-if="item.shopCoupons.length>0"
+							@click="showShopCoupons(item,sIndex)">
+							<view class="discount-label">店铺优惠</view>
+							<view class="discount-info-box flex-items">
+								<view class="discount-info2"
+									v-if="item.currentCoupon && item.currentCoupon.couponType === 1">
+									-¥{{ item.currentCoupon.reduceMoney }}
+								</view>
+								<view class="discount-info2"
+									v-if="item.currentCoupon && item.currentCoupon.couponType === 2">
+									{{ item.currentCoupon.reduceMoney }}折券
+								</view>
+								<image class="discount-img"
+									src="https://ceres.zkthink.com/static/images/arrowRight.png"></image>
+							</view>
+							<!--							<view class="discount-info-box flex-items" v-else>-->
+							<!--								<view class="discount-info1"></view>-->
+							<!--								<image class="discount-img" src="https://ceres.zkthink.com/static/images/arrowRight.png"></image>-->
+							<!--							</view>-->
+						</view>
+						<view class="order-total-box">
+							<text class="total-num">共{{ item.number }}件</text>
+							<text class="total-num ml10">总计</text>
+							<text class="total-price ml10" v-if="item.totalAfterDiscount > 0">
+								¥{{ (parseFloat(item.totalAfterDiscount) + parseFloat(item.distribution.distributionPrice || 0)).toFixed(2) }}
+							</text>
+							<text class="total-price ml10" v-else>¥0.00
+							</text>
+						</view>
+					</view>
+				</view>
+
+			</view>
+			<view class="discount-item" @click="showDiscount">
+				<view class="discount-label">平台优惠</view>
+				<view class="discount-info-box flex-items">
+					<view class="discount-info2" v-if="promotionInfoDTO.couponId">
+						<text v-if="promotionInfoDTO.couponType === 2">{{ promotionInfoDTO.reduceMoney }}折</text>
+						<text v-else> -¥{{ promotionInfoDTO.reduceMoney | clip2Decimal }}</text>
+					</view>
+					<view class="discount-info1" v-else-if="couponsList.length<1">无
+					</view>
+					<view class="discount-info1" v-else>不使用
+					</view>
+					<image class="discount-img" src="https://ceres.zkthink.com/static/images/arrowRight.png"></image>
+				</view>
+			</view>
+			<!--      积分支付-->
+			<view class="integralPayBox" v-if="integralShow">
+				<view class="integralBg">
+					<view class="integralTit fs26">可用{{ integralNum }}积分抵扣{{ integralPrice.toFixed(2) }}元</view>
+					<view class="maxIntegral">
+						<checkbox-group @change="changeIntegral" style="width: 50rpx">
+							<checkbox style="transform:scale(0.7);" class="integralCheckbox" color="#C5AA7B" value="1"
+								:checked="selectIntegral" />
+						</checkbox-group>
+					</view>
+				</view>
+			</view>
+			<view class="pay-type-item">
+				<radio-group @change="payTypeChange">
+					<view class="pay-type-radio" v-if="showWechatPayType">
+						<view class="pay-type-img">
+							<image class="pay-type-img-inner"
+								src="https://ceres.zkthink.com/static/images/wechat_pay.png" mode="widthFix" />
+						</view>
+						<label class="pay-type-label">微信支付</label>
+						<radio class="pay-type-radio-item" style="transform:scale(0.7)" value="1"
+							:checked="paymentMode == 1" />
+					</view>
+					<view class="pay-type-radio" v-if="showAlipayPayType">
+						<view class="pay-type-img">
+							<image class="pay-type-img-inner" src="https://ceres.zkthink.com/static/images/alipay.png"
+								mode="widthFix" />
+						</view>
+						<label class="pay-type-label">支付宝支付</label>
+						<radio class="pay-type-radio-item" style="transform:scale(0.7)" value="2"
+							:checked="paymentMode == 2" />
+					</view>
+					<view class="pay-type-radio" v-if="showHuabeiPayType">
+						<view class="pay-type-img">
+							<image class="pay-type-img-inner" src="https://ceres.zkthink.com/static/images/huabei.png"
+								mode="widthFix" />
+						</view>
+						<label class="pay-type-label">花呗分期</label>
+						<radio class="pay-type-radio-item" style="transform:scale(0.7)" value="3"
+							:checked="paymentMode == 3" />
+						<view class="huabei-detail" v-if="huabeiDetail" @click="showHuabeiDetail">
+							<view>
+								<label class="fenqi-wenzi">花呗分期</label>
+								<label class="fenqi-charge-fee">手续费 ¥{{ chargeFee|clip2Decimal }}</label>
+							</view>
+							<label class="fenqi-amount">分期总额 ¥{{ totalPrice | clip2Decimal }}</label>
+							<img class="fenqi-modal" src="https://ceres.zkthink.com/static/images/arrowRight.png" />
+						</view>
+					</view>
+				</radio-group>
+			</view>
+			<view class="order-flow-box">
+				<view class="flow-word">交易流程:</view>
+				<view class="flow-word mt25">
+					<text>1、填写收货信息并完成支付</text>
+					<text>2、双方根据物品的交易方式进行交易</text>
+					<text>3、拿到物品,交易结束</text>
+				</view>
+				<!--        实付款不含邮费,涉及邮寄双方协定好费用,提醒发起人修改价格再完成支付;-->
+				<view class="flow-word mt50">注:应国家邮政总局的要求,即日起涉及到个人快递包裹必须收件人实名制,否则将影响到收寄配送。请避免使用「先生,男士,小姐,女士,昵称」等模糊称谓。
+				</view>
+			</view>
+		</view>
+		<view class="order-confirm-box" style="padding-bottom:30upx;">
+			<view class="flex-items flex-sp-between">
+				<text class="num-box">共{{ totalCount }}件</text>
+				<view>
+					<text class="total">合计:</text>
+					<text v-if="totalPrice>0" class="price">¥{{ totalPrice.toFixed(2) }}
+					</text>
+					<text v-else class="price">¥0.00
+					</text>
+				</view>
+			</view>
+			<!-- active 当有地址时按钮加上active选中的样式-->
 			<button v-if="isRegionalScope" class="btn unActive" type="default" :disabled="false">提交订单</button>
-      <button v-else :class="[submitActive ? 'btn active' : 'btn']"
-            @click="submitOrder">提交订单
-      </button>
-      <!-- <text class="btn" v-else>提交订单</text> -->
-
-    </view>
-    <!-- 活动弹框 -->
-    <u-popup class="activity-con"
-             v-model="isShowDiscount"
-             mode="bottom"
-             border-radius="14"
-             close-icon-pos="top-right"
-             close-icon-size="20">
-      <view class="activity-box"
-            style="height: 1000rpx;">
-        <view class="title-box">
-          <image class="close-btn"
-                 @click="onDiscountClose"
-                 src="https://ceres.zkthink.com/static/images/close.png"></image>
-        </view>
-        <view class="activity-coupon-box">
-          <scroll-view scroll-y="true"
-                       style="height: 900rpx;">
-            <view class="content-box">
-              <view v-if="usableListLength">
-                <view class="label-lingqu">可用优惠券列表</view>
-                <view class="couponBox">
-                  <view class="coupon-item"
-                        v-for="(usableItem, index) in settlement.coupons"
-                        :key="index"
-                        @click="couponItemTap(index,usableItem)"
-                  >
-                    <view class="money-box"
-                          v-if="usableItem.couponType === 1">¥{{ usableItem.reduceMoney }}
-                    </view>
-                    <view class="money-box"
-                          v-else>{{ usableItem.reduceMoney }}折券
-                    </view>
-                    <view class="info-box">
-                      <view class="date font-color-999"
-                            style="font-size:22upx;  margin-top: 20upx;">
-                        {{ getDate(usableItem.startTime.replace(/-/g, '.'))
+			<button v-else :class="[submitActive ? 'btn active' : 'btn']" @click="submitOrder">提交订单
+			</button>
+			<!-- <text class="btn" v-else>提交订单</text> -->
+
+		</view>
+		<!-- 活动弹框 -->
+		<u-popup class="activity-con" v-model="isShowDiscount" mode="bottom" border-radius="14"
+			close-icon-pos="top-right" close-icon-size="20">
+			<view class="activity-box" style="height: 1000rpx;">
+				<view class="title-box">
+					<image class="close-btn" @click="onDiscountClose"
+						src="https://ceres.zkthink.com/static/images/close.png"></image>
+				</view>
+				<view class="activity-coupon-box">
+					<scroll-view scroll-y="true" style="height: 900rpx;">
+						<view class="content-box">
+							<view v-if="usableListLength">
+								<view class="label-lingqu">可用优惠券列表</view>
+								<view class="couponBox">
+									<view class="coupon-item" v-for="(usableItem, index) in settlement.coupons"
+										:key="index" @click="couponItemTap(index, usableItem)">
+										<view class="money-box" v-if="usableItem.couponType === 1">
+											¥{{ usableItem.reduceMoney }}
+										</view>
+										<view class="money-box" v-else>{{ usableItem.reduceMoney }}折券
+										</view>
+										<view class="info-box">
+											<view class="date font-color-999"
+												style="font-size:22upx;  margin-top: 20upx;">
+												{{ getDate(usableItem.startTime.replace(/-/g, '.'))
                         }}-{{ getDate(usableItem.endTime.replace(/-/g, '.')) }}
-                      </view>
-                      <view class="info font-color-999">满{{ usableItem.fullMoney }}元可用</view>
-                    </view>
-                    <image class="check-img"
-                           src="https://ceres.zkthink.com/static/images/selectActive.png"
-                           v-if="usableItem.checked"></image>
-                    <image class="check-img"
-                           src="https://ceres.zkthink.com/static/images/selectEmpty.png"
-                           v-else></image>
-                  </view>
-                </view>
-              </view>
-            </view>
-          </scroll-view>
-        </view>
-      </view>
-    </u-popup>
-    <u-popup class="activity-con"
-             v-model="isShopCoupons"
-             mode="bottom"
-             border-radius="14"
-             close-icon-pos="top-right"
-             close-icon-size="20">
-      <view class="activity-box">
-        <view class="title-box">
-          <image class="close-btn"
-                 @click="onshopClose"
-                 src="https://ceres.zkthink.com/static/images/close.png"></image>
-        </view>
-        <view class="activity-coupon-box">
-          <scroll-view scroll-y="true"
-                       style="height: 900rpx;">
-            <view class="content-box">
-              <view v-if="shopCouponsLength">
-                <view class="label-lingqu">可用优惠券列表</view>
-                <view class="couponBox">
-                  <view class="coupon-item"
-                        v-for="(sItem, index) in shopCouponslist.shopCoupons"
-                        :key="sItem.id"
-                        @click="shopCouponItemTap(index,sItem)">
-                    <view class="money-box"
-                          v-if="sItem.couponType === 1">¥{{ sItem.reduceMoney }}
-                    </view>
-                    <view class="money-box"
-                          v-else>{{ sItem.reduceMoney }}折券
-                    </view>
-                    <view class="date font-color-999"
-                          style="font-size:22upx;  margin-top: 10upx;">
-                      {{ getDate(sItem.startTime.replace(/-/g, '.')) }}-{{ getDate(sItem.endTime.replace(/-/g, '.')) }}
-                    </view>
-                    <view class="info-box">
-                      <view class="info font-color-999">满{{ sItem.fullMoney }}元可用</view>
-                    </view>
-                    <image class="check-img"
-                           src="https://ceres.zkthink.com/static/images/selectActive.png"
-                           v-if="sItem.checked"></image>
-                    <image class="check-img"
-                           src="https://ceres.zkthink.com/static/images/selectEmpty.png"
-                           v-else></image>
-                  </view>
-                </view>
-              </view>
-            </view>
-          </scroll-view>
-        </view>
-      </view>
-    </u-popup>
-    <u-popup class="huabei-popup"
-             v-model="showHuabeiPopup"
-             mode="bottom"
-             border-radius="14"
-             close-icon-pos="top-right"
-             close-icon-size="20">
-      <view class="huabei-box">
-        <radio-group @change="huabeiPeriodChange"
-                     v-model="huabeiPeriod">
-          <view class="period-radio">
-            <view class="period-amount">
-              <label class="period-each">¥ {{ fenqiFeeList[0]|clip2Decimal }}x3期</label>
-              <label class="period-each-charge">手续费¥{{ chargeFeeList[0]|clip2Decimal }}/期</label>
-            </view>
-            <radio class="period-type-radio-item"
-                   style="transform:scale(0.7)"
-                   :checked="huabeiPeriod == 3"
-                   value="3"/>
-          </view>
-          <view class="period-radio">
-            <view class="period-amount">
-              <label class="period-each">¥ {{ fenqiFeeList[1]|clip2Decimal }}x6期</label>
-              <label class="period-each-charge">手续费¥{{ chargeFeeList[1]|clip2Decimal }}/期</label>
-            </view>
-            <radio class="period-type-radio-item"
-                   style="transform:scale(0.7)"
-                   :checked="huabeiPeriod == 6"
-                   value="6"/>
-          </view>
-          <view class="period-radio">
-            <view class="period-amount">
-              <label class="period-each">¥ {{ fenqiFeeList[2]|clip2Decimal }}x12期</label>
-              <label class="period-each-charge">手续费¥{{ chargeFeeList[2]|clip2Decimal }}/期</label>
-            </view>
-            <radio class="period-type-radio-item"
-                   style="transform:scale(0.7)"
-                   :checked="huabeiPeriod == 12"
-                   value="12"/>
-          </view>
-        </radio-group>
-      </view>
-      <view class="huabei-confirm">
-        <view class="fenqi-total-amount">
-          <label class="fenqi-all">分期总额 ¥{{ (totalPrice - reduceMoney)|clip2Decimal }}</label>
-          <label class="charge-fee-all">手续费 ¥{{ chargeFee|clip2Decimal }}</label>
-        </view>
-        <view class="fenqi-confirm">
-          <text class="btn active"
-                @click="showHuabeiPopup=false">确认
-          </text>
-        </view>
-      </view>
-    </u-popup>
-  </view>
+											</view>
+											<view class="info font-color-999">满{{ usableItem.fullMoney }}元可用</view>
+										</view>
+										<image class="check-img"
+											src="https://ceres.zkthink.com/static/images/selectActive.png"
+											v-if="usableItem.checked"></image>
+										<image class="check-img"
+											src="https://ceres.zkthink.com/static/images/selectEmpty.png" v-else>
+										</image>
+									</view>
+								</view>
+							</view>
+						</view>
+					</scroll-view>
+				</view>
+			</view>
+		</u-popup>
+		<u-popup class="activity-con" v-model="isShopCoupons" mode="bottom" border-radius="14"
+			close-icon-pos="top-right" close-icon-size="20">
+			<view class="activity-box">
+				<view class="title-box">
+					<image class="close-btn" @click="onshopClose"
+						src="https://ceres.zkthink.com/static/images/close.png"></image>
+				</view>
+				<view class="activity-coupon-box">
+					<scroll-view scroll-y="true" style="height: 900rpx;">
+						<view class="content-box">
+							<view v-if="shopCouponsLength">
+								<view class="label-lingqu">可用优惠券列表</view>
+								<view class="couponBox">
+									<view class="coupon-item" v-for="(sItem, index) in shopCouponslist.shopCoupons"
+										:key="sItem.id" @click="shopCouponItemTap(index,sItem)">
+										<view class="money-box" v-if="sItem.couponType === 1">¥{{ sItem.reduceMoney }}
+										</view>
+										<view class="money-box" v-else>{{ sItem.reduceMoney }}折券
+										</view>
+										<view class="date font-color-999" style="font-size:22upx;  margin-top: 10upx;">
+											{{ getDate(sItem.startTime.replace(/-/g, '.')) }}-{{ getDate(sItem.endTime.replace(/-/g, '.')) }}
+										</view>
+										<view class="info-box">
+											<view class="info font-color-999">满{{ sItem.fullMoney }}元可用</view>
+										</view>
+										<image class="check-img"
+											src="https://ceres.zkthink.com/static/images/selectActive.png"
+											v-if="sItem.checked"></image>
+										<image class="check-img"
+											src="https://ceres.zkthink.com/static/images/selectEmpty.png" v-else>
+										</image>
+									</view>
+								</view>
+							</view>
+						</view>
+					</scroll-view>
+				</view>
+			</view>
+		</u-popup>
+		<u-popup class="huabei-popup" v-model="showHuabeiPopup" mode="bottom" border-radius="14"
+			close-icon-pos="top-right" close-icon-size="20">
+			<view class="huabei-box">
+				<radio-group @change="huabeiPeriodChange" v-model="huabeiPeriod">
+					<view class="period-radio">
+						<view class="period-amount">
+							<label class="period-each">¥ {{ fenqiFeeList[0]|clip2Decimal }}x3期</label>
+							<label class="period-each-charge">手续费¥{{ chargeFeeList[0]|clip2Decimal }}/期</label>
+						</view>
+						<radio class="period-type-radio-item" style="transform:scale(0.7)" :checked="huabeiPeriod == 3"
+							value="3" />
+					</view>
+					<view class="period-radio">
+						<view class="period-amount">
+							<label class="period-each">¥ {{ fenqiFeeList[1]|clip2Decimal }}x6期</label>
+							<label class="period-each-charge">手续费¥{{ chargeFeeList[1]|clip2Decimal }}/期</label>
+						</view>
+						<radio class="period-type-radio-item" style="transform:scale(0.7)" :checked="huabeiPeriod == 6"
+							value="6" />
+					</view>
+					<view class="period-radio">
+						<view class="period-amount">
+							<label class="period-each">¥ {{ fenqiFeeList[2]|clip2Decimal }}x12期</label>
+							<label class="period-each-charge">手续费¥{{ chargeFeeList[2]|clip2Decimal }}/期</label>
+						</view>
+						<radio class="period-type-radio-item" style="transform:scale(0.7)" :checked="huabeiPeriod == 12"
+							value="12" />
+					</view>
+				</radio-group>
+			</view>
+			<view class="huabei-confirm">
+				<view class="fenqi-total-amount">
+					<label class="fenqi-all">分期总额 ¥{{ (totalPrice - reduceMoney)|clip2Decimal }}</label>
+					<label class="charge-fee-all">手续费 ¥{{ chargeFee|clip2Decimal }}</label>
+				</view>
+				<view class="fenqi-confirm">
+					<text class="btn active" @click="showHuabeiPopup=false">确认
+					</text>
+				</view>
+			</view>
+		</u-popup>
+	</view>
 </template>
 
 <script>
-import {hidden} from "../../utils/hidden";
-
-const NET = require('../../utils/request')
-const API = require('../../config/api')
-// #ifdef H5
-var jweixin = require('jweixin-module')
-// #endif
-export default {
-  data() {
-    return {
-      couponActiveShowFalg: false,
-      settlement: {},
-      type: 0,
-      skuItemDTOList: [],
-      userAddressInfo: {},
-      isShowDiscount: false,
-      isShopCoupons: false,
-      usableListLength: 0,
-      shopCouponsLength: 0,
-      shopCouponslist: [],
-      promotionInfoDTO: {
-        couponId: 0,
-        ifAdd: 1,
-        reduceMoney: 0
-      },
-      shopInfoDTO: {},
-      reduceMoney: 0,
-      submitActive: true,
-      distributionPrice: 0, //运费
-      totalPrice: 0, //合计
-      receiveId: '',
-      totalCount: 0,
-      skuItemList: {},
-      shopGroupWorkId: 0,
-      sumitType: '',
-      collageId: null,
-      couponIfAdd: true,
-      couponsList: [],
-      shopCouIndex: 0, //优惠券index
-      shopIndex: 0,
-      shopCheckedType: true,
-      discountPrice: 0,
-      selectShopCoupon: [], // 已选择店铺优惠券
-      chargeFee: 0,  //花呗分期手续费,如果是商户支付手续费,则为0,否则默认计算3期手续费
-      huabeiDetail: true,
-      showHuabeiPopup: false,
-      huabeiChargeType: 0,
-      huabeiFeerateList: [],
-      paymentMode: 0, //支付方式 1-微信支付 2-支付宝支付 3-花呗分期
-      huabeiPeriod: 3, //选择的花呗分期数 有 3 6 12 3种选项,默认是3
-      chargeFeeList: [], //花呗每期的手续费
-      fenqiFeeList: [], //花呗每期的支付额
-      showWechatPayType: false,
-      showAlipayPayType: false,
-      showHuabeiPayType: false,
-      orderId: null,
-      couponType: 0,
-      selectIntegral: true,
-      integralNum: 0,
-      ifShow: false,
-      integralRatio: 0, // 积分兑换比例
-      integralPrice: 0, // 总积分可减多少元
-      orderCreditThreshold: 0, // 满多少元可以抵扣
-      integralShow: false, // 显示隐藏积分
-      checkedPlatformCoupon: undefined,
-      oneClickSubmit: true, //只提交订单一次
-			isRegionalScope: false, //是否在商家配置范围内地址
-    }
-  },
-  onLoad(options) {
-    this.getQuery()
-		console.log(options,'options')
-    this.type = options.type
-    if (options.receiveId) {
-      this.receiveId = options.receiveId
-    }
-    this.decidePayType()
-  },
-  onShow() {
-    if (uni.getStorageSync("receiveItem")) {
-      this.receiveId = uni.getStorageSync("receiveItem").receiveId
-    }
-    if (uni.getStorageSync("skuItemDTOList") != "") {
-      this.skuItemDTOList = uni.getStorageSync('skuItemDTOList')
-      console.log(this.skuItemDTOList, '66666')
-      if (this.skuItemDTOList[0].shopDiscountId > 0) {
-        this.sumitType = 4
-      } else if (this.skuItemDTOList[0].shopSeckillId > 0) {
-        this.sumitType = 3
-      }
-      this.getSettlement(false)
-    } else if (uni.getStorageSync("skuItemList") != "") {
-      this.skuItemList = uni.getStorageSync("skuItemList")
-      //console.log(this.skuItemList, 999)
-      this.shopGroupWorkId = this.skuItemList.shopGroupWorkId
-      this.sumitType = this.skuItemList.type
-      this.collageId = this.skuItemList.collageId
-      this.getSettlement(true)
-    }
-  },
-  onBackPress(e) {
-    if (e.from === 'navigateBack') {
-      return false;
-    }
-    this.back();
-    return true
-  },
-  filters: {
-    clip2Decimal(value) {
-      if (value === undefined || value === null) {
-        return "0.00"
-      }
-      return (parseInt(value * 100) / 100).toFixed(2)
-    }
-  },
-  methods: {
-    getQuery() {
-      NET.request(API.Query, {
-        name: 'credit_exchange_rate'
-      }, 'GET').then(res => {
-        this.integralRatio = parseFloat(res.data.dictDescribe)
-      }).catch(res => {
-        console.log('平台端未配置积分兑换比例(1积分抵扣多少金额)')
-      })
-    },
-    // 积分价格计算
-    changeIntegral() {
-      this.selectIntegral = !this.selectIntegral
-      if (this.selectIntegral) {
-        this.totalPrice = this.totalPrice - this.integralPrice
-      } else {
-        this.totalPrice = this.totalPrice + this.integralPrice
-      }
-    },
-    back() {
-      if (this.type == 2 || this.type) {
-        uni.switchTab({
-          url: '../../pages/tabbar/cart/index'
-        })
-      } else {
-        uni.navigateBack({
-          delta: 1
-        });
-      }
-    },
-    // 获取订单信息
-    getSettlement(isGroup) {
-      uni.showLoading({
-        title: '加载中...',
-      })
-      this.ifShow = true
-      let _url = '',
-          _data = ''
-      // 是否是拼团
-      if (isGroup) {
-        _url = API.getGroupSettlement
-        _data = this.skuItemList
-      } else {
-        _url = API.Settlement
-        _data = {
-          type: this.type,
-          shops: this.skuItemDTOList,
-          receiveId: this.receiveId
-        }
-				// composeId: 68
-				console.log(this.skuItemDTOList,'this.skuItemDTOList')
-      }
-      NET.request(_url, _data, 'POST').then(res => {
-        uni.hideLoading()
-        this.settlement = res.data
-        this.couponsList = res.data.coupons
-        this.huabeiChargeType = res.data.huabeiChargeType
-        if (this.huabeiChargeType === 2) {
-          this.huabeiFeerateList = res.data.huabeiFeerateList
-        } else {
-          this.huabeiFeerateList = [0, 0, 0]
-        }
-        let shopLen = this.settlement.shops.length
-        this.settlement.shops.forEach((value) => {
-          value['totalNum'] = value.total
-          value['pricing'] = 0
-        })
-        // 如果没有地址时进入购买宝贝页面对下面的商品件数和总计进行赋值
-        if (!this.settlement.receive.receiveAdress) {
-          this.settlement.shops.map(item => {
-            this.totalCount += item.number
-            this.totalPrice += item.total || item.totalNum
-          })
-        }
-        // 初始化平台券选中状态
-        if (this.settlement.coupons.length > 0) {
-          this.settlement.coupons.forEach((item) => {
-            item.checked = false
-          })
-        }
-        // 默认选中商家的第一张优惠券
-        for (let s = 0; s < shopLen; s++) {
-          const curShop = this.settlement.shops[s]
-          curShop.skus.forEach((item) => {
-            item['skuTotalNum'] = item.total
-          })
-          if (curShop.shopCoupons.length > 0) {
-            curShop.shopCoupons.forEach((item) => {
-              item.checked = false
-            })
-            const firstShopCoupon = curShop.shopCoupons[0];
-            let useCoupon = this.useShopCoupon(s, 0)
-            if (useCoupon) {
-              firstShopCoupon.checked = true
-              this.selectShopCoupon.push(firstShopCoupon)
-              curShop['currentCoupon'] = firstShopCoupon
-            } else {
-              curShop.totalNum = curShop.total
-            }
-          }
-        }
-        if (uni.getStorageSync('receiveItem')) {
-          let receiveItem = uni.getStorageSync('receiveItem')
-          this.userAddressInfo = receiveItem
-          this.receiveId = receiveItem.receiveId
-          this.userAddressInfo.receivePhone = hidden(this.userAddressInfo.receivePhone, 3, 4)
-        } else if (res.data.receive) {
-          this.receiveId = res.data.receive.receiveId
-          this.userAddressInfo = res.data.receive
-          this.userAddressInfo.receivePhone = hidden(this.userAddressInfo.receivePhone, 3, 4)
-        }
-        uni.removeStorageSync('receiveItem')
-        this.usableListLength = res.data.coupons.length
-        this.getTotal()
-				this.isReceiveCan()
-
-      }).catch(res => {
-        uni.hideLoading()
-      })
-    },
-		// 根据地址判断是否能下单
-		isReceiveCan(){
-			this.settlement.shops.map(item=>{
-				if(item.receiveNotMatch){
-					this.isRegionalScope = item.receiveNotMatch
+	import {
+		hidden
+	} from "../../utils/hidden";
+
+	const NET = require('../../utils/request')
+	const API = require('../../config/api')
+	// #ifdef H5
+	var jweixin = require('jweixin-module')
+	// #endif
+	export default {
+		data() {
+			return {
+				couponActiveShowFalg: false,
+				settlement: {},
+				type: 0,
+				skuItemDTOList: [],
+				userAddressInfo: {},
+				isShowDiscount: false,
+				isShopCoupons: false,
+				usableListLength: 0,
+				shopCouponsLength: 0,
+				shopCouponslist: [],
+				promotionInfoDTO: {
+					couponId: 0,
+					ifAdd: 1,
+					reduceMoney: 0
+				},
+				shopInfoDTO: {},
+				reduceMoney: 0,
+				submitActive: true,
+				distributionPrice: 0, //运费
+				totalPrice: 0, //合计
+				receiveId: '',
+				totalCount: 0,
+				skuItemList: {},
+				shopGroupWorkId: 0,
+				sumitType: '',
+				collageId: null,
+				couponIfAdd: true,
+				couponsList: [],
+				shopIndex: 0,
+				shopCheckedType: true,
+				discountPrice: 0,
+				selectShopCoupon: [], // 已选择店铺优惠券
+				chargeFee: 0, //花呗分期手续费,如果是商户支付手续费,则为0,否则默认计算3期手续费
+				huabeiDetail: true,
+				showHuabeiPopup: false,
+				huabeiChargeType: 0,
+				huabeiFeerateList: [],
+				paymentMode: 0, //支付方式 1-微信支付 2-支付宝支付 3-花呗分期
+				huabeiPeriod: 3, //选择的花呗分期数 有 3 6 12 3种选项,默认是3
+				chargeFeeList: [], //花呗每期的手续费
+				fenqiFeeList: [], //花呗每期的支付额
+				showWechatPayType: false,
+				showAlipayPayType: false,
+				showHuabeiPayType: false,
+				orderId: null,
+				couponType: 0,
+				selectIntegral: true,
+				integralNum: 0,
+				ifShow: false,
+				integralRatio: 0, // 积分兑换比例
+				integralPrice: 0, // 总积分可减多少元
+				orderCreditThreshold: 0, // 满多少元可以抵扣
+				integralShow: false, // 显示隐藏积分
+				checkedPlatformCoupon: undefined,
+				oneClickSubmit: true, //只提交订单一次
+				isRegionalScope: false, //是否在商家配置范围内地址
+			}
+		},
+		onLoad(options) {
+			this.getQuery()
+			this.type = options.type
+			if (options.receiveId) {
+				this.receiveId = options.receiveId
+			}
+			this.decidePayType()
+		},
+		onShow() {
+			if (uni.getStorageSync("receiveItem")) {
+				this.receiveId = uni.getStorageSync("receiveItem").receiveId
+			}
+			if (uni.getStorageSync("skuItemDTOList") != "") {
+				this.skuItemDTOList = uni.getStorageSync('skuItemDTOList')
+				if (this.skuItemDTOList[0].shopDiscountId > 0) {
+					this.sumitType = 4
+				} else if (this.skuItemDTOList[0].shopSeckillId > 0) {
+					this.sumitType = 3
+				}
+				this.getSettlement(false)
+			} else if (uni.getStorageSync("skuItemList") != "") {
+				this.skuItemList = uni.getStorageSync("skuItemList")
+				//console.log(this.skuItemList, 999)
+				this.shopGroupWorkId = this.skuItemList.shopGroupWorkId
+				this.sumitType = this.skuItemList.type
+				this.collageId = this.skuItemList.collageId
+				this.getSettlement(true)
+			}
+		},
+		onBackPress(e) {
+			if (e.from === 'navigateBack') {
+				return false;
+			}
+			this.back();
+			return true
+		},
+		filters: {
+			clip2Decimal(value) {
+				if (value === undefined || value === null) {
+					return "0.00"
+				}
+				return (parseInt(value * 100) / 100).toFixed(2)
+			}
+		},
+		methods: {
+			getQuery() {
+				NET.request(API.Query, {
+					name: 'credit_exchange_rate'
+				}, 'GET').then(res => {
+					this.integralRatio = parseFloat(res.data.dictDescribe)
+				}).catch(res => {
+					console.log('平台端未配置积分兑换比例(1积分抵扣多少金额)')
+				})
+			},
+			// 积分价格计算
+			changeIntegral() {
+				this.selectIntegral = !this.selectIntegral
+				if (this.selectIntegral) {
+					this.totalPrice = this.totalPrice - this.integralPrice
+				} else {
+					this.totalPrice = this.totalPrice + this.integralPrice
+				}
+			},
+			back() {
+				if (this.type == 2 || this.type) {
+					uni.switchTab({
+						url: '../../pages/tabbar/cart/index'
+					})
+				} else {
+					uni.navigateBack({
+						delta: 1
+					});
+				}
+			},
+			// 获取订单信息
+			getSettlement(isGroup) {
+				uni.showLoading({
+					title: '加载中...',
+				})
+				this.ifShow = true
+				let _url = '',
+					_data = ''
+				// 是否是拼团
+				if (isGroup) {
+					_url = API.getGroupSettlement
+					_data = this.skuItemList
+				} else {
+					_url = API.Settlement
+					_data = {
+						type: this.type,
+						shops: this.skuItemDTOList,
+						receiveId: this.receiveId
+					}
+					// composeId: 68
 				}
-				if(this.isRegionalScope){
+				NET.request(_url, _data, 'POST').then(res => {
+					uni.hideLoading()
+					this.settlement = res.data
+					this.couponsList = res.data.coupons
+					this.huabeiChargeType = res.data.huabeiChargeType
+					if (this.huabeiChargeType === 2) {
+						this.huabeiFeerateList = res.data.huabeiFeerateList
+					} else {
+						this.huabeiFeerateList = [0, 0, 0]
+					}
+					let shopLen = this.settlement.shops.length
+					this.settlement.shops.forEach((value) => {
+						value['totalAfterDiscount'] = value.total
+						value['pricing'] = 0
+					})
+					// 如果没有地址时进入购买宝贝页面对下面的商品件数和总计进行赋值
+					if (!this.settlement.receive.receiveAdress) {
+						this.settlement.shops.map(item => {
+							this.totalCount += item.number
+							this.totalPrice += item.total || item.totalAfterDiscount
+						})
+					}
+					// 初始化平台券选中状态
+					if (this.settlement.coupons.length > 0) {
+						this.settlement.coupons.forEach((item) => {
+							item.checked = false
+						})
+					}
+					// 默认选中商家的第一张优惠券
+					for (let s = 0; s < shopLen; s++) {
+						const curShop = this.settlement.shops[s]
+						curShop.skus.forEach((item) => {
+							item['skuTotalNum'] = item.total
+						})
+						if (curShop.shopCoupons.length > 0) {
+							curShop.shopCoupons.forEach((item) => {
+								item.checked = false
+							})
+							const firstShopCoupon = curShop.shopCoupons[0];
+							let useCoupon = this.useShopCoupon(s, 0)
+							if (useCoupon) {
+								firstShopCoupon.checked = true
+								this.selectShopCoupon.push(firstShopCoupon)
+								curShop['currentCoupon'] = firstShopCoupon
+							} else {
+								curShop.totalAfterDiscount = curShop.total
+							}
+						}
+					}
+					if (uni.getStorageSync('receiveItem')) {
+						let receiveItem = uni.getStorageSync('receiveItem')
+						this.userAddressInfo = receiveItem
+						this.receiveId = receiveItem.receiveId
+						this.userAddressInfo.receivePhone = hidden(this.userAddressInfo.receivePhone, 3, 4)
+					} else if (res.data.receive) {
+						this.receiveId = res.data.receive.receiveId
+						this.userAddressInfo = res.data.receive
+						this.userAddressInfo.receivePhone = hidden(this.userAddressInfo.receivePhone, 3, 4)
+					}
+					uni.removeStorageSync('receiveItem')
+					this.usableListLength = res.data.coupons.length
+					this.getTotal()
+					this.isReceiveCan()
+
+				}).catch(res => {
+					uni.hideLoading()
+				})
+			},
+			// 根据地址判断是否能下单
+			isReceiveCan() {
+				this.settlement.shops.map(item => {
+					if (item.receiveNotMatch) {
+						this.isRegionalScope = item.receiveNotMatch
+					}
+					if (this.isRegionalScope) {
+						uni.showToast({
+							title: '当前地址不支持配送,请参与红色字提示',
+							icon: 'none'
+						})
+					}
+				})
+			},
+
+			addAddressTap() {
+				uni.navigateTo({
+					url: '../../pages_category_page2/userModule/address?type=' + this.type,
+				})
+			},
+			getDate(time) {
+				if (!time) return '';
+				return time.split(' ')[0]
+			},
+			// 平台优惠券选择
+			couponItemTap(index, coupon) {
+				if (!coupon.checked && this.selectShopCoupon.length) { // 判断商家券情况
 					uni.showToast({
-						title: '当前地址不支持配送,请参与红色字提示',
+						title: '不可与商家券叠加使用!',
 						icon: 'none'
 					})
+					return false
+				}
+				// 已选中的情况下取消选中
+				if (coupon.checked) {
+					let promotionInfoDTO = {}
+					if (coupon.couponId) {
+						promotionInfoDTO['couponId'] = 0
+						promotionInfoDTO['ifAdd'] = 1
+						promotionInfoDTO['reduceMoney'] = 0
+					}
+					this.promotionInfoDTO = promotionInfoDTO
+					coupon.checked = false
+					this.isShowDiscount = false
+					this.checkedPlatformCoupon = undefined
+					this.settlement.shops.forEach(shopItem => {
+						if (shopItem.skus) {
+							shopItem.skus.forEach(skuItem => {
+								skuItem.buyerCouponId = null
+							})
+						}
+					})
+					this.getTotal()
+				} else {
+					// 先把所有已选中的平台优惠券改为未选中
+					this.settlement.coupons.forEach((item) => {
+						item.checked = false
+					})
+					let totalPrice = 0 // 订单总价
+					let shopsLen = this.settlement.shops.length // 结算页店铺数量
+					let matchCouponSkuList = []
+					for (let i = 0; i < shopsLen; i++) {
+						let matchCouponNormalPrice = 0
+						let priceCount = 0
+						const curShop = this.settlement.shops[i]
+						let skuLen = curShop.skus.length
+						let tmpPriceSkuList = []
+						for (let j = 0; j < skuLen; j++) {
+							const curSku = curShop.skus[j]
+							if (curSku.priceId > 0) {
+								priceCount++
+							}
+							const ids = coupon.ids
+							if (ids.indexOf(curSku.productId) > -1) {
+								if (curSku.priceId > 0) {
+									tmpPriceSkuList.push(curSku)
+								} else {
+									matchCouponSkuList.push(curSku)
+									matchCouponNormalPrice = matchCouponNormalPrice + curSku.price * curSku.number
+								}
+							}
+						}
+						if (priceCount === tmpPriceSkuList.length) {
+							totalPrice += curShop.priceAfterDiscount
+							matchCouponSkuList = matchCouponSkuList.concat(tmpPriceSkuList)
+						}
+						totalPrice += matchCouponNormalPrice
+					}
+					if (this.settlement.shops[this.shopIndex].total < coupon.fullMoney) {
+						uni.showToast({
+							title: '不满足优惠券使用条件!',
+							icon: 'none'
+						})
+						return false
+					}
+					if (coupon.couponType === 1 && coupon.reduceMoney >= totalPrice) {
+						uni.showToast({
+							title: '不可使用大于等于合计金额的优惠劵!',
+							icon: 'none'
+						})
+						return false
+					}
+					// 如果是折扣券,需要记录,在什么基数上打折
+					coupon.useMoney = totalPrice
+					let promotionInfoDTO = {}
+					if (coupon.couponId) {
+						promotionInfoDTO['couponId'] = coupon.couponId
+						promotionInfoDTO['ifAdd'] = coupon.ifAdd
+						promotionInfoDTO['couponType'] = coupon.couponType
+						promotionInfoDTO['reduceMoney'] = coupon.reduceMoney
+					}
+					this.promotionInfoDTO = promotionInfoDTO
+					this.isShowDiscount = false
+					this.checkedPlatformCoupon = coupon
+					matchCouponSkuList.forEach(item => {
+						item.buyerCouponId = coupon.couponId
+					})
+					this.getTotal()
+					// 选中优惠券
+					coupon.checked = true
+				}
+			},
+			// 店铺优惠券选择
+			shopCouponItemTap(index, coupon) {
+				// 取消选择优惠券
+				if (coupon.checked) {
+					coupon.checked = false
+					this.settlement.shops[this.shopIndex].totalAfterDiscount = this.settlement.shops[this.shopIndex].total
+					this.settlement.shops[this.shopIndex].currentCoupon = {}
+					this.settlement.shops[this.shopIndex].skus.forEach(item => {
+						item.buyerShopCouponId = null
+					})
+					this.isShopCoupons = false
+					this.selectShopCoupon = []
+					this.getTotal()
+					return false
+				}
+				if (this.settlement.shops[this.shopIndex].total < coupon.fullMoney) {
+					uni.showToast({
+						title: '不满足优惠券使用条件!',
+						icon: 'none'
+					})
+				} else if (coupon.couponType === 1 && this.settlement.shops[this.shopIndex].total < coupon.reduceMoney) {
+					uni.showToast({
+						title: '不可使用大于商品金额的优惠劵!',
+						icon: 'none'
+					})
+				} else {
+					// 选择优惠券
+					if (this.promotionInfoDTO.couponId !== 0) {
+						uni.showToast({
+							title: '此券不可与平台券叠加!',
+							icon: 'none'
+						})
+						return false
+					}
+					if (coupon.couponType === 1) {
+						if (coupon.reduceMoney >= this.settlement.shops[this.shopIndex].total) {
+							uni.showToast({
+								title: '优惠券优惠金额不能大于等于合计金额!',
+								icon: 'none'
+							})
+							return false
+						}
+					}
+
+					this.isShopCoupons = false
+					let useCoupon = this.useShopCoupon(this.shopIndex, index)
+					if (useCoupon) {
+						// 确认使用当前点击的商家券,先将所有的商家券取消选中
+						for (let i = 0; i < this.selectShopCoupon.length; i++) {
+							this.selectShopCoupon[i].checked = false
+						}
+						this.selectShopCoupon = []
+
+						coupon.checked = true
+						this.settlement.shops[this.shopIndex].currentCoupon = coupon
+						this.settlement.shops[this.shopIndex].skus.forEach(item => {
+							if (item.buyerShopCouponId > 0 && item.buyerShopCouponId !== coupon.shopCouponId) {
+								item.buyerShopCouponId = null
+							}
+						})
+						this.selectShopCoupon.push(coupon)
+					} else {
+						this.settlement.shops[this.shopIndex].totalAfterDiscount = this.settlement.shops[this.shopIndex].total
+					}
+					this.getTotal()
+				}
+			},
+			useShopCoupon (shopIndex, couponIndex) {
+				const curShop = this.settlement.shops[shopIndex]
+				curShop.totalAfterDiscount = 0
+				let curCoupon
+				if (curShop.shopCoupons && curShop.shopCoupons.length > 0) {
+					curCoupon = curShop.shopCoupons[couponIndex]
+				}
+				if (!curCoupon) {
+					return false
+				}
+				let useCoupon = false
+				let matchCouponNormalSkuList = []
+				let matchCouponPriceSkuList = []
+				if (curCoupon.applyType !== 1) {
+					const ids = curCoupon.ids
+					let skuLength = curShop.skus.length
+					// 符合优惠券商品列表中的普通sku价格综合
+					let matchCouponNormalPrice = 0
+					// 符合定价捆绑且在优惠券商品列表中的价格综合
+					let matchCouponPricePrice = 0
+					// 符合定价捆绑活动的sku数量
+					let priceCount = 0
+					for (let idx = 0; idx < skuLength; idx++) {
+						let curSku = curShop.skus[idx]
+						if (curSku.priceId > 0) {
+							priceCount++
+						}
+						if (ids.indexOf(curSku.productId) > -1) {
+							if (curSku.priceId > 0) {
+								matchCouponPriceSkuList.push(curSku)
+							} else {
+								matchCouponNormalSkuList.push(curSku)
+								matchCouponNormalPrice = matchCouponNormalPrice + curSku.price * curSku.number
+							}
+						}
+					}
+					// 如果定价捆绑的所有sku都符合优惠券
+					if (priceCount === matchCouponPriceSkuList.length) {
+						matchCouponPricePrice = curShop.priceAfterDiscount
+					}
+					// 符合的sku的price加起来是否满足满减的条件
+					const priceFinal = matchCouponPricePrice + matchCouponNormalPrice
+					if (priceFinal < curCoupon.fullMoney || (curCoupon.couponType === 1 && priceFinal <= curCoupon
+							.reduceMoney)) {
+						return false
+					}
+					// 判断是满减,还是折扣
+					if (curCoupon.couponType === 1) {
+						curShop.totalAfterDiscount = curShop.total - curCoupon.reduceMoney
+						useCoupon = true
+					} else {
+						// 打折后优惠抵扣的金额
+						let priceDiscount = (priceFinal * ((10 - curCoupon.reduceMoney) / 10)).toFixed(2)
+						let tmpTotal = curShop.total - priceDiscount
+						if (tmpTotal.toFixed(2) >= 0.01) {
+							curShop.totalAfterDiscount = tmpTotal.toFixed(2)
+							useCoupon = true
+						}
+					}
+					if (useCoupon) {
+						// 满足的sku设置buyerShopCouponId
+						if (priceCount === matchCouponPriceSkuList.length) {
+							let length1 = matchCouponPriceSkuList.length
+							for (let idx = 0; idx < length1; idx++) {
+								matchCouponPriceSkuList[idx].buyerShopCouponId = curCoupon.shopCouponId
+							}
+						}
+						let length2 = matchCouponNormalSkuList.length
+						for (let idx = 0; idx < length2; idx++) {
+							matchCouponNormalSkuList[idx].buyerShopCouponId = curCoupon.shopCouponId
+						}
+					}
+				} else {
+					if (curCoupon.couponType === 1) {
+						if (curShop.total > curCoupon.reduceMoney) {
+							curShop.totalAfterDiscount = curShop.total - curCoupon.reduceMoney
+							useCoupon = true
+						}
+					} else {
+						if (curShop.total > curCoupon.fullMoney) {
+							if (curShop.total > curCoupon.fullMoney) {
+								let priceDiscount = (curShop.total * ((10 - curCoupon.reduceMoney) / 10)).toFixed(2)
+								let tmpTotal = curShop.total - priceDiscount
+								if (tmpTotal.toFixed(2) >= 0.01) {
+									curShop.totalAfterDiscount = tmpTotal.toFixed(2)
+									useCoupon = true
+								}
+							}
+						}
+					}
+					if (useCoupon) {
+						let skuLength = curShop.skus.length
+						for (let idx = 0; idx < skuLength; idx++) {
+							curShop.skus[idx].buyerShopCouponId = curCoupon.shopCouponId
+						}
+					}
+				}
+				return useCoupon
+			},
+			/**
+			 * 计算总价,商家券的优惠计算,在调用本方法之前已经计算好在shops[].totalAfterDiscount
+			 */
+			getTotal() {
+				this.totalPrice = 0
+				this.totalCount = 0
+				this.integralPrice = 0
+				this.integralNum = 0
+				let shopSumPrice = 0
+				let shopsLen = this.settlement.shops.length
+
+				for (let i = 0; i < shopsLen; i++) {
+					this.totalPrice += parseFloat(this.settlement.shops[i].totalAfterDiscount)
+					shopSumPrice += parseFloat(this.settlement.shops[i].totalAfterDiscount)
+					this.totalCount += this.settlement.shops[i].number
 				}
-			})
-		},
 
-    addAddressTap() {
-			console.log(this.type, 'this.type')
-      uni.navigateTo({
-        url: '../../pages_category_page2/userModule/address?type='+ this.type,
-      })
-    },
-    getDate(time) {
-      if (!time) return '';
-      return time.split(' ')[0]
-    },
-    // 平台优惠券选择
-    couponItemTap(index, usableItem) {
-      if (!usableItem.checked && this.selectShopCoupon.length) { // 判断商家券情况
-        uni.showToast({
-          title: '不可与商家券券叠加使用!',
-          icon: 'none'
-        })
-        return false
-      }
-      // 已选中的情况下取消选中
-      if (usableItem.checked) {
-        let promotionInfoDTO = {}
-        if (usableItem.couponId) {
-          promotionInfoDTO['couponId'] = 0
-          promotionInfoDTO['ifAdd'] = 1
-          promotionInfoDTO['reduceMoney'] = 0
-        }
-        this.promotionInfoDTO = promotionInfoDTO
-        usableItem.checked = false
-        this.isShowDiscount = false
-        this.checkedPlatformCoupon = undefined
-        this.getTotal()
-      } else {
-        // 先把所有已选中的平台优惠券改为未选中
-        this.settlement.coupons.forEach((item) => {
-          item.checked = false
-        })
-        let shopSumPrice = 0 // 订单总价
-        let shopsLen = this.settlement.shops.length // 结算页店铺数量
-        for (let i = 0; i < shopsLen; i++) {
-          shopSumPrice += this.settlement.shops[i].totalNum
-        }
-        if (usableItem.couponType === 1 && usableItem.reduceMoney >= shopSumPrice) {
-          uni.showToast({
-            title: '不可使用大于等于合计金额的优惠劵!',
-            icon: 'none'
-          })
-          return false
-        }
-        let promotionInfoDTO = {}
-        if (usableItem.couponId) {
-          promotionInfoDTO['couponId'] = usableItem.couponId
-          promotionInfoDTO['ifAdd'] = usableItem.ifAdd
-          promotionInfoDTO['couponType'] = usableItem.couponType
-          promotionInfoDTO['reduceMoney'] = usableItem.reduceMoney
-        }
-        this.promotionInfoDTO = promotionInfoDTO
-        this.isShowDiscount = false
-        this.checkedPlatformCoupon = usableItem
-        this.getTotal()
-        // 选中优惠券
-        usableItem.checked = true
-      }
-    },
-    // 店铺优惠券选择
-    shopCouponItemTap(index, sItem) {
-      // 取消选择优惠券
-      if (sItem.checked) {
-        sItem.checked = false
-        this.settlement.shops[this.shopIndex].totalNum = this.settlement.shops[this.shopIndex].total
-        this.settlement.shops[this.shopIndex].currentCoupon = {}
-        this.isShopCoupons = false
-        this.selectShopCoupon = []
-        this.getTotal()
-        return false
-      }
-      if (sItem.couponType === 1 && this.settlement.shops[this.shopIndex].total < sItem.reduceMoney) {
-        uni.showToast({
-          title: '不可使用大于商品金额的优惠劵!',
-          icon: 'none'
-        })
-      } else {
-        // 选择优惠券
-        if (this.promotionInfoDTO.couponId !== 0) {
-          uni.showToast({
-            title: '此券不可与平台券叠加!',
-            icon: 'none'
-          })
-          return false
-        }
-        if (sItem.couponType === 1) {
-          if (sItem.reduceMoney >= this.settlement.shops[this.shopIndex].total) {
-            uni.showToast({
-              title: '优惠券优惠金额不能大于等于合计金额!',
-              icon: 'none'
-            })
-            return false
-          }
-        }
-
-        this.isShopCoupons = false
-        this.shopCouIndex = index
-        let useCoupon = this.useShopCoupon(this.shopIndex, this.shopCouIndex)
-        if (useCoupon) {
-          // 确认使用当前点击的商家券,先将所有的商家券取消选中
-          for (let i = 0; i < this.selectShopCoupon.length; i++) {
-            this.selectShopCoupon[i].checked = false
-          }
-          this.selectShopCoupon = []
-
-          sItem.checked = true
-          this.settlement.shops[this.shopIndex].currentCoupon = sItem
-          this.selectShopCoupon.push(sItem)
-        } else {
-          this.settlement.shops[this.shopIndex].totalNum = this.settlement.shops[this.shopIndex].total
-        }
-        this.getTotal()
-      }
-    },
-    useShopCoupon(shopIndex, couponIndex) {
-      const curShop = this.settlement.shops[shopIndex]
-      curShop.totalNum = 0
-      let curCoupon = undefined
-      if (curShop.shopCoupons && curShop.shopCoupons.length > 0) {
-        curCoupon = curShop.shopCoupons[couponIndex]
-      }
-      if (!curCoupon) {
-        return false
-      }
-      let useCoupon = false
-      if (curCoupon.couponType === 1) {
-        if (curShop.total > curCoupon.reduceMoney) {
-          curShop.totalNum = curShop.total - curCoupon.reduceMoney
-          useCoupon = true
-        }
-      } else {
-        let shopTotal = 0
-        let skuLen = curShop.skus.length
-        let priceCount = 0
-        let couponMatchPriceCount = 0
-        for (let k = 0; k < skuLen; k++) {
-          let idsLen = curCoupon.ids.length
-          // 定价捆绑的优惠额外处理
-          let priceId = curShop.skus[k].priceId
-          for (let i = 0; i < idsLen; i++) {
-            if (curShop.skus[k].productId === curCoupon.ids[i]) {
-              if (priceId > 0) {
-                couponMatchPriceCount++
-              } else {
-                curShop.skus[k].skuTotalNum = curShop.skus[k].total * (curCoupon.reduceMoney / 10)
-                useCoupon = true
-              }
-            }
-          }
-          if (priceId > 0) {
-            priceCount++;
-          } else {
-            shopTotal += curShop.skus[k].skuTotalNum
-            curShop.totalNum = parseFloat(shopTotal.toFixed(2))
-          }
-        }
-        if (couponMatchPriceCount >= priceCount && curShop.priceAfterDiscount >= curCoupon.fullMoney) {
-          let priceTotal = curShop.priceAfterDiscount * (curCoupon.reduceMoney / 10)
-          curShop.totalNum += priceTotal
-          useCoupon = true
-        }
-      }
-      return useCoupon
-    },
-    /**
-     * 计算总价,商家券的优惠计算,在调用本方法之前已经计算好在shops[].totalNum
-     */
-    getTotal() {
-      this.totalPrice = 0
-      this.totalCount = 0
-      this.integralPrice = 0
-      this.integralNum = 0
-      let shopSumPrice = 0
-      let shopsLen = this.settlement.shops.length
-
-      for (let i = 0; i < shopsLen; i++) {
-        this.totalPrice += parseFloat(this.settlement.shops[i].totalNum)
-        shopSumPrice += parseFloat(this.settlement.shops[i].totalNum)
-        this.totalCount += this.settlement.shops[i].number
-      }
-      console.log(this.settlement.shops, this.totalPrice)
-
-      if (this.checkedPlatformCoupon) {
-        if (this.checkedPlatformCoupon.couponType === 1 && this.totalPrice - this.checkedPlatformCoupon.reduceMoney > 0) { // 满减
-          this.totalPrice = shopSumPrice - this.checkedPlatformCoupon.reduceMoney
-        } else if (this.checkedPlatformCoupon.couponType === 2 && this.checkedPlatformCoupon.reduceMoney > 0) { // 折扣
-          this.totalPrice = shopSumPrice * this.checkedPlatformCoupon.reduceMoney / 10
-        }
-      }
-      // 积分支付计算
-      this.calcCredit()
-      // 加上每个商家的运费
-      this.settlement.shops.forEach((item) => {
-        this.totalPrice = this.totalPrice + (item.distribution.distributionPrice || 0)
-      })
-      this.recalcHuabei()
-    },
-    calcCredit() {
-      let shopsLen = this.settlement.shops.length
-      const skuRemainMap = this.calcSkuRemainMap()
-      const skuCreditMap = this.settlement.skuCreditMap;
-      if (skuCreditMap && this.integralRatio > 0) {
-        this.orderCreditThreshold = this.settlement.orderCreditThreshold
-        let remainUserCredit = this.settlement.userTotalCredit
-        let remainTotalPrice = Math.round((this.totalPrice + Number.EPSILON) * 100) / 100
-        let remainDeductLimit = this.settlement.creditDeductLimit
-        // 只有订单金额达到阈值,并且用户还有剩余的积分,才能进行积分抵扣
-        if (this.totalPrice >= this.orderCreditThreshold && remainUserCredit > 0 && remainDeductLimit > 0) {
-          for (let i = 0; i < shopsLen; i++) {
-            const curShop = this.settlement.shops[i]
-            let skuLen = curShop.skus.length
-            for (let j = 0; j < skuLen; j++) {
-              const curSku = curShop.skus[j]
-              const skuId = curSku.skuId
-              if (skuCreditMap[skuId] > 0 && skuRemainMap[skuId] > 0 && remainUserCredit > 0 && remainTotalPrice > 0) {
-                // 抵扣之后,必须保证整个订单至少还有0.01元,可用于支付
-                if (remainTotalPrice - skuRemainMap[skuId] < 0.01) {
-                  skuRemainMap[skuId] -= 0.01
-                }
-                // 按照比例换算成需要多少积分抵扣(取整)
-                let finalSkuCredit = parseInt((skuRemainMap[skuId] / this.integralRatio).toString());
-                // 优先以商家配置的商品可抵扣积分为准
-                if (skuCreditMap[skuId] < finalSkuCredit) {
-                  finalSkuCredit = skuCreditMap[skuId]
-                }
-                // 不能超过用户剩余积分
-                if (remainUserCredit < finalSkuCredit) {
-                  finalSkuCredit = remainUserCredit
-                }
-                // 不能超过整个订单可抵扣积分
-                if (remainDeductLimit < finalSkuCredit) {
-                  finalSkuCredit = remainDeductLimit
-                }
-                curSku.cachedCredit = finalSkuCredit
-                this.integralNum += finalSkuCredit
-                remainUserCredit -= finalSkuCredit
-                remainDeductLimit -= finalSkuCredit
-                remainTotalPrice -= finalSkuCredit
-              }
-            }
-          }
-        }
-        //计算抵扣价格
-        if (this.integralNum !== 0) {
-          this.integralNum = parseInt(this.integralNum)
-          this.integralPrice = this.integralNum * this.integralRatio
-          if (this.integralNum !== 0) {
-            this.integralShow = true
-          }
-          if (this.selectIntegral) {
-            this.totalPrice = this.totalPrice - this.integralPrice
-          }
-        } else {
-          this.integralShow = false
-        }
-      }
-    },
-    /**
-     * 计算sku在整个运单价格中的剩余价值 1元的订单,打1折优惠之后,剩余价值就是0.1元
-     */
-    calcSkuRemainMap() {
-      let skuRemainMap = {}
-      let shopsLen = this.settlement.shops.length
-      const skuCreditMap = this.settlement.skuCreditMap
-      for (let i = 0; i < shopsLen; i++) {
-        const curShop = this.settlement.shops[i]
-        let skuLen = curShop.skus.length
-        let checkedShopCoupon = undefined
-        curShop.shopCoupons.forEach((item) => {
-          if (item.checked) {
-            checkedShopCoupon = item
-          }
-        })
-        for (let j = 0; j < skuLen; j++) {
-          const curSku = curShop.skus[j]
-          const skuId = curSku.skuId
-          // 不是定价捆绑,并且有配置可抵扣的积分,才有必要计算比例
-          if (!curSku.priceId > 0 && skuCreditMap[skuId] > 0) {
-            let remainSkuMoney = curSku.price * curSku.number
-            if (checkedShopCoupon) {
-              let skuShopPercent = remainSkuMoney / curShop.total
-              let curReduceMoney = 0
-              if (checkedShopCoupon.couponType === 1) {
-                curReduceMoney = checkedShopCoupon.reduceMoney * skuShopPercent
-              } else {
-                curReduceMoney = remainSkuMoney * (10 - checkedShopCoupon.reduceMoney) / 10
-              }
-              remainSkuMoney = remainSkuMoney - curReduceMoney
-            }
-            // 使用平台券
-            if (this.checkedPlatformCoupon && remainSkuMoney > 0) {
-              // 满减
-              if (this.checkedPlatformCoupon.couponType === 1) {
-                let skuTotalPercent = remainSkuMoney / this.totalPrice
-                remainSkuMoney -= this.checkedPlatformCoupon.reduceMoney * skuTotalPercent
-              }
-              // 折扣
-              else {
-                remainSkuMoney = remainSkuMoney * this.checkedPlatformCoupon.reduceMoney / 10
-              }
-            }
-            skuRemainMap[skuId] = remainSkuMoney
-          }
-        }
-      }
-      return skuRemainMap
-    },
-    recalcHuabei() {
-      if (this.paymentMode === 3) {
-        this.fenqiFeeList[0] = this.totalPrice * (1 + this.huabeiFeerateList[0] / 100) / 3
-        this.fenqiFeeList[1] = this.totalPrice * (1 + this.huabeiFeerateList[1] / 100) / 6
-        this.fenqiFeeList[2] = this.totalPrice * (1 + this.huabeiFeerateList[2] / 100) / 12
-
-        this.chargeFeeList[0] = this.totalPrice * (this.huabeiFeerateList[0] / 100) / 3
-        this.chargeFeeList[1] = this.totalPrice * (this.huabeiFeerateList[1] / 100) / 6
-        this.chargeFeeList[2] = this.totalPrice * (this.huabeiFeerateList[2] / 100) / 12
-
-        var index = 0;
-        if (this.huabeiPeriod === 6) {
-          index = 1
-        } else if (this.huabeiPeriod === 12) {
-          index = 2
-        }
-        this.chargeFee = (this.totalPrice * (this.huabeiFeerateList[index] / 100)).toFixed(2)
-      }
-    },
-    // 展示平台端优惠券
-    showDiscount() {
-      // let shopifAdd = 1
-      // if(this.settlement.shops[this.shopIndex].shopCoupons.length>0){
-      // 	shopifAdd = this.settlement.shops[this.shopIndex].shopCoupons[this.shopCouIndex].ifAdd
-      // }
-      if (this.settlement.coupons.length > 0) {
-        for (let i = 0; i < this.selectShopCoupon.length; i++) {
-          if (this.selectShopCoupon[i].ifAdd == 0) {
-            uni.showToast({
-              title: '不可叠加已选择的店铺券',
-              icon: 'none'
-            })
-            return false
-          }
-        }
-        this.isShowDiscount = true
-      } else {
-        uni.showToast({
-          title: '暂无可用优惠券',
-          icon: 'none'
-        })
-      }
-    },
-    // 显示店铺优惠券
-    showShopCoupons(item, sIndex) {
-      if (item.shopCoupons.length > 0) {
-        this.isShopCoupons = true
-        this.shopCouponslist = item
-        this.shopCouponsLength = item.shopCoupons.length
-        this.shopIndex = sIndex
-      } else {
-        uni.showToast({
-          title: '暂无可用优惠券',
-          icon: 'none'
-        })
-      }
-    },
-    onDiscountClose() {
-      this.isShowDiscount = false
-    },
-    onshopClose() {
-      this.isShopCoupons = false
-    },
-    payTypeChange(event) {
-      this.paymentMode = event.target.value;
-      if (this.paymentMode === 3) {
-        this.huabeiDetail = true
-      } else {
-        this.huabeiDetail = false
-      }
-      this.recalcHuabei()
-    },
-    huabeiPeriodChange(event) {
-      this.huabeiPeriod = event.target.value
-      var feeRate = this.huabeiFeerateList[2]
-      if (this.huabeiPeriod === 3) {
-        feeRate = this.huabeiFeerateList[0]
-      } else if (this.huabeiPeriod === 6) {
-        feeRate = this.huabeiFeerateList[1]
-      }
-      this.chargeFee = (this.totalPrice * feeRate / 100).toFixed(2)
-    },
-    showHuabeiDetail() {
-      this.showHuabeiPopup = true
-    },
-		// submitOrder() {
-		// 	console.log('确认订单')
-		// },
-    submitOrder() {
-      const that = this
-      if (this.paymentMode === 0) {
-        uni.showToast({
-          title: '请选择支付方式',
-          icon: 'none'
-        })
-      } else {
-
-        if (this.oneClickSubmit) {
-          this.oneClickSubmit = false
-          if (this.userAddressInfo.receiveName) {
-            uni.showLoading({
-              mask: true,
-              title: '订单提交中...',
-            })
-            let couponIdinfo = 0
-            if (this.promotionInfoDTO.couponId) {
-              couponIdinfo = this.promotionInfoDTO.couponId
-            }
-            let data = {
-              shopDiscountId: null,
-              collageId: this.collageId,
-              type: this.sumitType,
-              shopGroupWorkId: null,
-              receiveId: this.receiveId,
-              couponId: couponIdinfo,
-              price: this.totalPrice,
-              remark: "",
-              shops: [],
-              discountPrice: this.discountPrice,
-              shopSeckillId: null
-            }
-            if (this.shopGroupWorkId > 0) {
-              data.shopGroupWorkId = this.shopGroupWorkId
-            }
-            if (this.skuItemDTOList != '') {
-              if (this.skuItemDTOList[0].shopDiscountId > 0) {
-                data.shopDiscountId = this.skuItemDTOList[0].shopDiscountId
-              } else if (this.skuItemDTOList[0].shopSeckillId > 0) {
-                data.shopSeckillId = this.skuItemDTOList[0].shopSeckillId
-              }
-            }
-            let datashopslen = this.settlement.shops.length
-            for (let n = 0; n < datashopslen; n++) {
-              let shopsobj = {}
-              shopsobj["shopId"] = this.settlement.shops[n].shopId
-              shopsobj["sceneId"] = this.settlement.shops[n].sceneId
-              shopsobj["distribution"] = {}
-              shopsobj["skus"] = []
-              if (this.settlement.shops[n].currentCoupon) {
-                shopsobj["id"] = this.settlement.shops[n].currentCoupon.id
-              }
-              data.shops.push(shopsobj)
-              data.shops[n].distribution.distributionPrice = this.settlement.shops[n].distribution.distributionPrice
-              data.shops[n].distribution.distributionName = this.settlement.shops[n].distribution.distributionName
-              let dataskuslen = this.settlement.shops[n].skus.length
-              for (let m = 0; m < dataskuslen; m++) {
-                let skusobj = {}
-                const curSku = this.settlement.shops[n].skus[m]
-                skusobj["skuId"] = curSku.skuId
-                skusobj["number"] = curSku.number
-                skusobj["ifLogistics"] = curSku.ifLogistics
-                skusobj["selected"] = curSku.selected
-                skusobj["platformSeckillId"] = curSku.platformSeckillId
-                skusobj["platformDiscountId"] = curSku.platformDiscountId
-                skusobj["shopSeckillId"] = curSku.shopSeckillId
-                skusobj["shopDiscountId"] = curSku.shopDiscountId
-                skusobj["sceneId"] = curSku.sceneId
-                skusobj["priceId"] = curSku.priceId
-                skusobj["useMember"] = curSku.useMember
-                skusobj["composeId"] = curSku.composeId
-                // 积分传参
-                if (this.selectIntegral && curSku.cachedCredit) {
-                  skusobj["useCredit"] = curSku.cachedCredit
-                  skusobj["useCreditAmount"] = (curSku.cachedCredit * this.integralRatio).toFixed(2)
-                }
-                data.shops[n].skus.push(skusobj)
-              }
-            }
-            // #ifdef H5
-            data.paymentMode = 1
-            data.subPaymentMode = 3
-            // #endif
-
-            // #ifdef MP-WEIXIN
-            data.paymentMode = 1
-            data.subPaymentMode = 1
-            // #endif
-
-            // #ifdef APP-PLUS
-            data.paymentMode = 1
-            // #endif
-
-            // #ifdef MP-ALIPAY
-            data.paymentMode = 2
-            data.subPaymentMode = 1
-            // #endif
-
-            uni.hideLoading()
-            uni.showLoading({
-              mask: true,
-              title: '结算中...',
-            })
-            NET.request(API.PlaceOrder, data, 'POST').then(res => {
-              uni.hideLoading()
-              if (this.type == 2) {
-                let carSkusData = data.shops
-                let skusArr = []
-                for (let i = 0; i < carSkusData.length; i++) {
-                  carSkusData[i].skus.map(item => {
-                    skusArr.push(item.skuId)
-                  })
-                }
-                // 从购物车中点击结算时删除对应购物车商品
-                NET.request(API.DeleteCart, {
-                  ids: skusArr
-                }, 'POST').then(res => {
-                  console.log(res, '删除对应购物车商品')
-                }).catch(res => {
-                })
-              }
-              let submitResult = res.data
-              that.orderId = res.data.orderId
-              //console.log(submitResult, '测试')
-              submitResult.type = 1
-              submitResult.paymentMode = data.paymentMode
-              // #ifdef H5
-              let ua = navigator.userAgent.toLowerCase();
-              if (ua.match(/MicroMessenger/i) == "micromessenger") {
-                this.payRequest(submitResult)
-              } else {
-                NET.request(API.gotoH5Pay, submitResult, 'POST').then(res => {
-                  //console.dir(res)
-                  location.replace(res.data.mwebUrl)
-                  // window.location.replace(url)
-                }).catch(err => {
-                  this.submitActive = true
-                  uni.hideLoading()
-                  uni.showToast({
-                    title: '支付失败',
-                    icon: 'none'
-                  })
-                  uni.navigateTo({
-                    url: '../orderModule/index?type=1'
-                  })
-                })
-              }
-              // #endif
-              // #ifdef MP-ALIPAY
-              submitResult.huabeiPeriod = this.huabeiPeriod
-              submitResult.paymentMode = this.paymentMode
-              this.aliPay(submitResult)
-              // #endif
-
-              // #ifdef MP-WEIXIN
-              uni.showLoading({
-                mask: true,
-                title: '支付中...',
-              })
-              NET.request(API.gotoPay, submitResult, 'POST').then(res => {
-                uni.hideLoading()
-                console.dir(res, 'API.gotoPay')
-                let param = {
-                  orderId: submitResult.orderId,
-                  collageId: submitResult.collageId
-                }
-                uni.requestPayment({
-                  provider: 'wxpay',
-                  timeStamp: res.data.timeStamp,
-                  nonceStr: res.data.nonceStr,
-                  package: res.data.package,
-                  signType: res.data.signType,
-                  paySign: res.data.paySign,
-                  success: function (payRes) {
-                    // 拼团微信支付成功回调
-                    if (param.collageId) {
-                      console.log(param, ' param999999')
-                      NET.request(API.paySuccess, param, 'POST').then(res => {
-                        console.log(res, '支付成功')
-                      })
-                    }
-                    uni.showToast({
-                      icon: 'none',
-                      title: '支付成功'
-                    })
-                    //console.log(submitResult.orderId, 'order Id')
-                    uni.navigateTo({
-                      url: 'paySuccessful?orderId=' + submitResult.orderId
-                    })
-                  },
-                  fail: function (err) {
-                    uni.showToast({
-                      icon: 'none',
-                      title: '支付取消'
-                    })
-                    uni.navigateTo({
-                      url: '../orderModule/index?type=1'
-                    })
-                  }
-                })
-              }).catch(err => {
-                uni.showToast({
-                  title: '支付失败',
-                  icon: 'none'
-                })
-                uni.navigateTo({
-                  url: '../orderModule/index?type=1'
-                })
-              })
-              // #endif
-              // #ifdef APP-PLUS
-              uni.showLoading({
-                mask: true,
-                title: '支付中...',
-              })
-              //console.log(submitResult, 'app-submitResult')
-              NET.request(API.gotoAppPay, submitResult, 'POST').then(res => {
-                uni.hideLoading()
-                var obj = {
-                  appid: res.data.appId,
-                  noncestr: res.data.nonceStr,
-                  package: 'Sign=WXPay',
-                  prepayid: res.data.prepayId,
-                  timestamp: res.data.timeStamp,
-                  sign: res.data.paySign,
-                  partnerid: res.data.partnerId
-                }
-                uni.requestPayment({
-                  provider: 'wxpay',
-                  orderInfo: obj,
-                  success: function (payRes) {
-										console.log('支付成功',payRes)
-                    uni.showToast({
-                      icon: 'none',
-                      title: '支付成功'
-                    })
-                    uni.navigateTo({
-                      url: 'paySuccessful?orderId=' + that.orderId
-                    })
-                  },
-                  fail: function (err) {
-                    //console.log(err)
-										console.log('支付失败',err)
-                    uni.showToast({
-                      icon: 'none',
-                      title: '支付取消'
-                    })
-                    uni.navigateTo({
-                      url: '../orderModule/index?type=1'
-                    })
-                  }
-                })
-              }).catch(err => {
-								console.log(err, 'catch支付失败')
-                uni.hideLoading()
-                uni.showToast({
-                  title: '支付失败',
-                  icon: 'none'
-                })
-                uni.navigateTo({
-                  url: '../orderModule/index?type=1'
-                })
-              })
-              // #endif
-            }).catch(res => {
-              uni.hideLoading()
-              this.oneClickSubmit = true
-              uni.showToast({
-                title: '提交失败',
-                icon: 'none'
-              })
-            })
-          } else {
-            uni.showToast({
-              icon: 'none',
-              title: '请选择收货地址'
-            })
-          }
-        } else {
-          uni.showToast({
-            title: "已提交,请勿重新操作!",
-            icon: 'none'
-          })
-        }
-      }
-    },
-    // H5支付微信内置浏览器支付
-    // #ifdef H5
-    payRequest(payInfo) {
-      payInfo.paymentMode = 1
-      const that = this
-      NET.request(API.gotoPay, payInfo, 'POST').then(res => {
-        jweixin.config({
-          debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-          appId: res.data.appId, // 必填,公众号的唯一标识
-          timestamp: res.data.timeStamp, // 必填,生成签名的时间戳
-          nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
-          signature: res.data.paySign, // 必填,签名,见附录1
-          jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
-        });
-        jweixin.ready(function () {
-          jweixin.checkJsApi({
-            jsApiList: ['chooseWXPay'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
-            success: function (res) {
-              // console.log('checkjsapi Success')
-              // console.log(res);
-            },
-            fail: function (res) {
-              // console.log('res')
-              // console.log(res);
-            }
-          });
-          jweixin.chooseWXPay({
-            timestamp: res.data.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
-            nonceStr: res.data.nonceStr, // 支付签名随机串,不长于 32 位
-            package: res.data.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***)
-            signType: res.data.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
-            paySign: res.data.paySign, // 支付签名
-            success: function (res) {
-              // 支付成功后的回调函数
-              uni.showToast({
-                icon: 'none',
-                title: '支付成功'
-              })
-              uni.navigateTo({
-                url: 'paySuccessful?orderId=' + that.orderId
-              })
-            },
-            cancel: function (r) {
-              uni.showToast({
-                icon: 'none',
-                title: '取消支付'
-              })
-              uni.navigateTo({
-                url: '../orderModule/index?type=1'
-              })
-            },
-            fail: function (res) {
-              uni.showToast({
-                icon: 'none',
-                title: '支付失败'
-              })
-              uni.navigateTo({
-                url: '../orderModule/index?type=1'
-              })
-            }
-          });
-        });
-        jweixin.error(function (res) {
-          console.log('error')
-          console.log(res)
-          uni.showToast({
-            icon: 'none',
-            title: '支付失败了',
-            duration: 3000
-          });
-          uni.navigateTo({
-            url: '../orderModule/index?type=1'
-          })
-        });
-      }).catch(err => {
-      })
-    },
-    // #endif
-    aliPay(payInfo) {
-      const that = this
-      NET.request(API.gotoPay, payInfo, 'POST').then(res => {
-        console.log('alipay gotoPay-----------')
-        console.dir(res)
-        uni.requestPayment({
-          provider: 'alipay',
-          orderInfo: res.data.tradeNo,
-          success: function (payRes) {
-            if (payRes.resultCode == '6001') {
-              uni.showToast({
-                icon: 'none',
-                title: '取消支付'
-              })
-              uni.navigateTo({
-                url: '../orderModule/index?type=1'
-              })
-            }
-            if (payRes.resultCode == '9000') {
-              uni.showToast({
-                icon: 'none',
-                title: '支付成功'
-              })
-              uni.navigateTo({
-                url: 'paySuccessful?orderId=' + that.orderId
-              })
-            }
-          },
-          fail: function (err) {
-            uni.showToast({
-              icon: 'none',
-              title: '支付取消'
-            })
-            uni.navigateTo({
-              url: '../orderModule/index?type=1'
-            })
-          }
-        });
-      }).catch(err => {
-        uni.hideLoading()
-        uni.showToast({
-          title: '支付失败',
-          icon: 'none'
-        })
-        uni.navigateTo({
-          url: '../orderModule/index?type=1'
-        })
-      })
-    },
-    decidePayType() {
-      // #ifdef H5 || MP-WEIXIN || APP-PLUS
-      this.showWechatPayType = true
-      this.paymentMode = 1
-      // #endif
-
-      // #ifdef MP-ALIPAY
-      this.showAlipayPayType = true
-      this.showHuabeiPayType = true
-      this.paymentMode = 2
-      // #endif
-    }
-  }
-}
+				if (this.checkedPlatformCoupon) {
+					const couponType = this.checkedPlatformCoupon.couponType
+					const reduceMoney = this.checkedPlatformCoupon.reduceMoney
+					if (couponType === 1 && this.totalPrice - reduceMoney > 0) { // 满减
+						this.totalPrice = shopSumPrice - reduceMoney
+					} else if (couponType === 2 && reduceMoney > 0) { // 折扣
+						const useMoney = this.checkedPlatformCoupon.useMoney
+						this.totalPrice = (shopSumPrice - useMoney) + useMoney * reduceMoney / 10
+					}
+				}
+				// 积分支付计算
+				this.calcCredit()
+				// 加上每个商家的运费
+				this.settlement.shops.forEach((item) => {
+					this.totalPrice = this.totalPrice + (item.distribution.distributionPrice || 0)
+				})
+				this.recalcHuabei()
+			},
+			calcCredit() {
+				let shopsLen = this.settlement.shops.length
+				const skuRemainMap = this.calcSkuRemainMap()
+				const skuCreditMap = this.settlement.skuCreditMap;
+				if (skuCreditMap && this.integralRatio > 0) {
+					this.orderCreditThreshold = this.settlement.orderCreditThreshold
+					let remainUserCredit = this.settlement.userTotalCredit
+					let remainTotalPrice = Math.round((this.totalPrice + Number.EPSILON) * 100) / 100
+					let remainDeductLimit = this.settlement.creditDeductLimit
+					// 只有订单金额达到阈值,并且用户还有剩余的积分,才能进行积分抵扣
+					if (this.totalPrice >= this.orderCreditThreshold && remainUserCredit > 0 && remainDeductLimit > 0) {
+						for (let i = 0; i < shopsLen; i++) {
+							const curShop = this.settlement.shops[i]
+							let skuLen = curShop.skus.length
+							for (let j = 0; j < skuLen; j++) {
+								const curSku = curShop.skus[j]
+								const skuId = curSku.skuId
+								if (skuCreditMap[skuId] > 0 && skuRemainMap[skuId] > 0 && remainUserCredit > 0 &&
+									remainTotalPrice > 0) {
+									// 抵扣之后,必须保证整个订单至少还有0.01元,可用于支付
+									if (remainTotalPrice - skuRemainMap[skuId] < 0.01) {
+										skuRemainMap[skuId] -= 0.01
+									}
+									// 按照比例换算成需要多少积分抵扣(取整)
+									let finalSkuCredit = parseInt((skuRemainMap[skuId] / this.integralRatio).toString());
+									// 优先以商家配置的商品可抵扣积分为准
+									if (skuCreditMap[skuId] < finalSkuCredit) {
+										finalSkuCredit = skuCreditMap[skuId]
+									}
+									// 不能超过用户剩余积分
+									if (remainUserCredit < finalSkuCredit) {
+										finalSkuCredit = remainUserCredit
+									}
+									// 不能超过整个订单可抵扣积分
+									if (remainDeductLimit < finalSkuCredit) {
+										finalSkuCredit = remainDeductLimit
+									}
+									curSku.cachedCredit = finalSkuCredit
+									this.integralNum += finalSkuCredit
+									remainUserCredit -= finalSkuCredit
+									remainDeductLimit -= finalSkuCredit
+									remainTotalPrice -= finalSkuCredit
+								}
+							}
+						}
+					}
+					//计算抵扣价格
+					if (this.integralNum !== 0) {
+						this.integralNum = parseInt(this.integralNum)
+						this.integralPrice = this.integralNum * this.integralRatio
+						if (this.integralNum !== 0) {
+							this.integralShow = true
+						}
+						if (this.selectIntegral) {
+							this.totalPrice = this.totalPrice - this.integralPrice
+						}
+					} else {
+						this.integralShow = false
+					}
+				}
+			},
+			/**
+			 * 计算sku在整个运单价格中的剩余价值 1元的订单,打1折优惠之后,剩余价值就是0.1元
+			 */
+			calcSkuRemainMap() {
+				let skuRemainMap = {}
+				let shopsLen = this.settlement.shops.length
+				const skuCreditMap = this.settlement.skuCreditMap
+				for (let i = 0; i < shopsLen; i++) {
+					const curShop = this.settlement.shops[i]
+					let skuLen = curShop.skus.length
+					let checkedShopCoupon = undefined
+					curShop.shopCoupons.forEach((item) => {
+						if (item.checked) {
+							checkedShopCoupon = item
+						}
+					})
+					for (let j = 0; j < skuLen; j++) {
+						const curSku = curShop.skus[j]
+						const skuId = curSku.skuId
+						// 不是定价捆绑,并且有配置可抵扣的积分,才有必要计算比例
+						if (!curSku.priceId > 0 && skuCreditMap[skuId] > 0) {
+							let remainSkuMoney = curSku.price * curSku.number
+							if (checkedShopCoupon) {
+								let skuShopPercent = remainSkuMoney / curShop.total
+								let curReduceMoney = 0
+								if (checkedShopCoupon.couponType === 1) {
+									curReduceMoney = checkedShopCoupon.reduceMoney * skuShopPercent
+								} else {
+									curReduceMoney = remainSkuMoney * (10 - checkedShopCoupon.reduceMoney) / 10
+								}
+								remainSkuMoney = remainSkuMoney - curReduceMoney
+							}
+							// 使用平台券
+							if (this.checkedPlatformCoupon && remainSkuMoney > 0) {
+								// 满减
+								if (this.checkedPlatformCoupon.couponType === 1) {
+									let skuTotalPercent = remainSkuMoney / this.totalPrice
+									remainSkuMoney -= this.checkedPlatformCoupon.reduceMoney * skuTotalPercent
+								}
+								// 折扣
+								else {
+									remainSkuMoney = remainSkuMoney * this.checkedPlatformCoupon.reduceMoney / 10
+								}
+							}
+							skuRemainMap[skuId] = remainSkuMoney
+						}
+					}
+				}
+				return skuRemainMap
+			},
+			recalcHuabei() {
+				if (this.paymentMode === 3) {
+					this.fenqiFeeList[0] = this.totalPrice * (1 + this.huabeiFeerateList[0] / 100) / 3
+					this.fenqiFeeList[1] = this.totalPrice * (1 + this.huabeiFeerateList[1] / 100) / 6
+					this.fenqiFeeList[2] = this.totalPrice * (1 + this.huabeiFeerateList[2] / 100) / 12
+
+					this.chargeFeeList[0] = this.totalPrice * (this.huabeiFeerateList[0] / 100) / 3
+					this.chargeFeeList[1] = this.totalPrice * (this.huabeiFeerateList[1] / 100) / 6
+					this.chargeFeeList[2] = this.totalPrice * (this.huabeiFeerateList[2] / 100) / 12
+
+					var index = 0;
+					if (this.huabeiPeriod === 6) {
+						index = 1
+					} else if (this.huabeiPeriod === 12) {
+						index = 2
+					}
+					this.chargeFee = (this.totalPrice * (this.huabeiFeerateList[index] / 100)).toFixed(2)
+				}
+			},
+			// 展示平台端优惠券
+			showDiscount() {
+				// let shopifAdd = 1
+				// if(this.settlement.shops[this.shopIndex].shopCoupons.length>0){
+				// 	shopifAdd = this.settlement.shops[this.shopIndex].shopCoupons[this.shopCouIndex].ifAdd
+				// }
+				if (this.settlement.coupons.length > 0) {
+					for (let i = 0; i < this.selectShopCoupon.length; i++) {
+						if (this.selectShopCoupon[i].ifAdd == 0) {
+							uni.showToast({
+								title: '不可叠加已选择的店铺券',
+								icon: 'none'
+							})
+							return false
+						}
+					}
+					this.isShowDiscount = true
+				} else {
+					uni.showToast({
+						title: '暂无可用优惠券',
+						icon: 'none'
+					})
+				}
+			},
+			// 显示店铺优惠券
+			showShopCoupons(item, sIndex) {
+				if (item.shopCoupons.length > 0) {
+					this.isShopCoupons = true
+					this.shopCouponslist = item
+					this.shopCouponsLength = item.shopCoupons.length
+					this.shopIndex = sIndex
+				} else {
+					uni.showToast({
+						title: '暂无可用优惠券',
+						icon: 'none'
+					})
+				}
+			},
+			onDiscountClose() {
+				this.isShowDiscount = false
+			},
+			onshopClose() {
+				this.isShopCoupons = false
+			},
+			payTypeChange(event) {
+				this.paymentMode = event.target.value;
+				if (this.paymentMode === 3) {
+					this.huabeiDetail = true
+				} else {
+					this.huabeiDetail = false
+				}
+				this.recalcHuabei()
+			},
+			huabeiPeriodChange(event) {
+				this.huabeiPeriod = event.target.value
+				var feeRate = this.huabeiFeerateList[2]
+				if (this.huabeiPeriod === 3) {
+					feeRate = this.huabeiFeerateList[0]
+				} else if (this.huabeiPeriod === 6) {
+					feeRate = this.huabeiFeerateList[1]
+				}
+				this.chargeFee = (this.totalPrice * feeRate / 100).toFixed(2)
+			},
+			showHuabeiDetail() {
+				this.showHuabeiPopup = true
+			},
+			// submitOrder() {
+			// 	console.log('确认订单')
+			// },
+			submitOrder() {
+				const that = this
+				if (this.paymentMode === 0) {
+					uni.showToast({
+						title: '请选择支付方式',
+						icon: 'none'
+					})
+				} else {
+					if (this.oneClickSubmit) {
+						this.oneClickSubmit = false
+						if (this.userAddressInfo.receiveName) {
+							uni.showLoading({
+								mask: true,
+								title: '订单提交中...',
+							})
+							let couponIdinfo = 0
+							if (this.promotionInfoDTO.couponId) {
+								couponIdinfo = this.promotionInfoDTO.couponId
+							}
+							let data = {
+								shopDiscountId: null,
+								collageId: this.collageId,
+								type: this.sumitType,
+								shopGroupWorkId: null,
+								receiveId: this.receiveId,
+								couponId: couponIdinfo,
+								price: this.totalPrice,
+								remark: "",
+								shops: [],
+								discountPrice: this.discountPrice,
+								shopSeckillId: null
+							}
+							if (this.shopGroupWorkId > 0) {
+								data.shopGroupWorkId = this.shopGroupWorkId
+							}
+							if (this.skuItemDTOList != '') {
+								if (this.skuItemDTOList[0].shopDiscountId > 0) {
+									data.shopDiscountId = this.skuItemDTOList[0].shopDiscountId
+								} else if (this.skuItemDTOList[0].shopSeckillId > 0) {
+									data.shopSeckillId = this.skuItemDTOList[0].shopSeckillId
+								}
+							}
+							let datashopslen = this.settlement.shops.length
+							for (let n = 0; n < datashopslen; n++) {
+								let shopsobj = {}
+								shopsobj["shopId"] = this.settlement.shops[n].shopId
+								shopsobj["sceneId"] = this.settlement.shops[n].sceneId
+								shopsobj["distribution"] = {}
+								shopsobj["skus"] = []
+								if (this.settlement.shops[n].currentCoupon) {
+									shopsobj["id"] = this.settlement.shops[n].currentCoupon.id
+								}
+								data.shops.push(shopsobj)
+								data.shops[n].distribution.distributionPrice = this.settlement.shops[n].distribution
+									.distributionPrice
+								data.shops[n].distribution.distributionName = this.settlement.shops[n].distribution
+									.distributionName
+								let dataskuslen = this.settlement.shops[n].skus.length
+								for (let m = 0; m < dataskuslen; m++) {
+									let skusobj = {}
+									const curSku = this.settlement.shops[n].skus[m]
+									skusobj["skuId"] = curSku.skuId
+									skusobj["number"] = curSku.number
+									skusobj["ifLogistics"] = curSku.ifLogistics
+									skusobj["selected"] = curSku.selected
+									skusobj["platformSeckillId"] = curSku.platformSeckillId
+									skusobj["platformDiscountId"] = curSku.platformDiscountId
+									skusobj["shopSeckillId"] = curSku.shopSeckillId
+									skusobj["shopDiscountId"] = curSku.shopDiscountId
+									skusobj["sceneId"] = curSku.sceneId
+									skusobj["priceId"] = curSku.priceId
+									skusobj["useMember"] = curSku.useMember
+									skusobj["composeId"] = curSku.composeId
+									skusobj["buyerShopCouponId"] = curSku.buyerShopCouponId
+									skusobj["buyerCouponId"] = curSku.buyerCouponId
+									// 积分传参
+									if (this.selectIntegral && curSku.cachedCredit) {
+										skusobj["useCredit"] = curSku.cachedCredit
+										skusobj["useCreditAmount"] = (curSku.cachedCredit * this.integralRatio).toFixed(2)
+									}
+									data.shops[n].skus.push(skusobj)
+								}
+							}
+							// #ifdef H5
+							data.paymentMode = 1
+							data.subPaymentMode = 3
+							// #endif
+
+							// #ifdef MP-WEIXIN
+							data.paymentMode = 1
+							data.subPaymentMode = 1
+							// #endif
+
+							// #ifdef APP-PLUS
+							data.paymentMode = 1
+							// #endif
+
+							// #ifdef MP-ALIPAY
+							data.paymentMode = 2
+							data.subPaymentMode = 1
+							// #endif
+
+							uni.hideLoading()
+							uni.showLoading({
+								mask: true,
+								title: '结算中...',
+							})
+							NET.request(API.PlaceOrder, data, 'POST').then(res => {
+								uni.hideLoading()
+								if (this.type == 2) {
+									let carSkusData = data.shops
+									let skusArr = []
+									for (let i = 0; i < carSkusData.length; i++) {
+										carSkusData[i].skus.map(item => {
+											skusArr.push(item.skuId)
+										})
+									}
+									// 从购物车中点击结算时删除对应购物车商品
+									/*NET.request(API.DeleteCart, {
+									  ids: skusArr
+									}, 'POST').then(res => {
+									  console.log(res, '删除对应购物车商品')
+									}).catch(res => {
+									})*/
+								}
+								let submitResult = res.data
+								that.orderId = res.data.orderId
+								//console.log(submitResult, '测试')
+								submitResult.type = 1
+								submitResult.paymentMode = data.paymentMode
+								// #ifdef H5
+								let ua = navigator.userAgent.toLowerCase();
+								if (ua.match(/MicroMessenger/i) == "micromessenger") {
+									this.payRequest(submitResult)
+								} else {
+									NET.request(API.gotoH5Pay, submitResult, 'POST').then(res => {
+										//console.dir(res)
+										location.replace(res.data.mwebUrl)
+										// window.location.replace(url)
+									}).catch(err => {
+										this.submitActive = true
+										uni.hideLoading()
+										uni.showToast({
+											title: '支付失败',
+											icon: 'none'
+										})
+										uni.navigateTo({
+											url: '../orderModule/index?type=1'
+										})
+									})
+								}
+								// #endif
+								// #ifdef MP-ALIPAY
+								submitResult.huabeiPeriod = this.huabeiPeriod
+								submitResult.paymentMode = this.paymentMode
+								this.aliPay(submitResult)
+								// #endif
+
+								// #ifdef MP-WEIXIN
+								uni.showLoading({
+									mask: true,
+									title: '支付中...',
+								})
+								NET.request(API.gotoPay, submitResult, 'POST').then(res => {
+									uni.hideLoading()
+									let param = {
+										orderId: submitResult.orderId,
+										collageId: submitResult.collageId
+									}
+									uni.requestPayment({
+										provider: 'wxpay',
+										timeStamp: res.data.timeStamp,
+										nonceStr: res.data.nonceStr,
+										package: res.data.package,
+										signType: res.data.signType,
+										paySign: res.data.paySign,
+										success: function(payRes) {
+											// 拼团微信支付成功回调
+											if (param.collageId) {
+												NET.request(API.paySuccess, param, 'POST')
+													.then(res => {
+														console.log(res, '支付成功')
+													})
+											}
+											uni.showToast({
+												icon: 'none',
+												title: '支付成功'
+											})
+											//console.log(submitResult.orderId, 'order Id')
+											uni.navigateTo({
+												url: 'paySuccessful?orderId=' +
+													submitResult.orderId
+											})
+										},
+										fail: function(err) {
+											uni.showToast({
+												icon: 'none',
+												title: '支付取消'
+											})
+											uni.navigateTo({
+												url: '../orderModule/index?type=1'
+											})
+										}
+									})
+								}).catch(err => {
+									uni.showToast({
+										title: '支付失败',
+										icon: 'none'
+									})
+									uni.navigateTo({
+										url: '../orderModule/index?type=1'
+									})
+								})
+								// #endif
+								// #ifdef APP-PLUS
+								uni.showLoading({
+									mask: true,
+									title: '支付中...',
+								})
+								//console.log(submitResult, 'app-submitResult')
+								NET.request(API.gotoAppPay, submitResult, 'POST').then(res => {
+									uni.hideLoading()
+									var obj = {
+										appid: res.data.appId,
+										noncestr: res.data.nonceStr,
+										package: 'Sign=WXPay',
+										prepayid: res.data.prepayId,
+										timestamp: res.data.timeStamp,
+										sign: res.data.paySign,
+										partnerid: res.data.partnerId
+									}
+									uni.requestPayment({
+										provider: 'wxpay',
+										orderInfo: obj,
+										success: function(payRes) {
+											console.log('支付成功', payRes)
+											uni.showToast({
+												icon: 'none',
+												title: '支付成功'
+											})
+											uni.navigateTo({
+												url: 'paySuccessful?orderId=' + that
+													.orderId
+											})
+										},
+										fail: function(err) {
+											//console.log(err)
+											console.log('支付失败', err)
+											uni.showToast({
+												icon: 'none',
+												title: '支付取消'
+											})
+											uni.navigateTo({
+												url: '../orderModule/index?type=1'
+											})
+										}
+									})
+								}).catch(err => {
+									console.log(err, 'catch支付失败')
+									uni.hideLoading()
+									uni.showToast({
+										title: '支付失败',
+										icon: 'none'
+									})
+									uni.navigateTo({
+										url: '../orderModule/index?type=1'
+									})
+								})
+								// #endif
+							}).catch(res => {
+								uni.hideLoading()
+								this.oneClickSubmit = true
+								uni.showToast({
+									title: '提交失败',
+									icon: 'none'
+								})
+							})
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: '请选择收货地址'
+							})
+						}
+					} else {
+						uni.showToast({
+							title: "已提交,请勿重新操作!",
+							icon: 'none'
+						})
+					}
+				}
+			},
+			// H5支付微信内置浏览器支付
+			// #ifdef H5
+			payRequest(payInfo) {
+				payInfo.paymentMode = 1
+				const that = this
+				NET.request(API.gotoPay, payInfo, 'POST').then(res => {
+					jweixin.config({
+						debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+						appId: res.data.appId, // 必填,公众号的唯一标识
+						timestamp: res.data.timeStamp, // 必填,生成签名的时间戳
+						nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
+						signature: res.data.paySign, // 必填,签名,见附录1
+						jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
+					});
+					jweixin.ready(function() {
+						jweixin.checkJsApi({
+							jsApiList: ['chooseWXPay'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
+							success: function(res) {
+								// console.log('checkjsapi Success')
+								// console.log(res);
+							},
+							fail: function(res) {
+								// console.log('res')
+								// console.log(res);
+							}
+						});
+						jweixin.chooseWXPay({
+							timestamp: res.data
+							.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
+							nonceStr: res.data.nonceStr, // 支付签名随机串,不长于 32 位
+							package: res.data
+							.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***)
+							signType: res.data.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
+							paySign: res.data.paySign, // 支付签名
+							success: function(res) {
+								// 支付成功后的回调函数
+								uni.showToast({
+									icon: 'none',
+									title: '支付成功'
+								})
+								uni.navigateTo({
+									url: 'paySuccessful?orderId=' + that.orderId
+								})
+							},
+							cancel: function(r) {
+								uni.showToast({
+									icon: 'none',
+									title: '取消支付'
+								})
+								uni.navigateTo({
+									url: '../orderModule/index?type=1'
+								})
+							},
+							fail: function(res) {
+								uni.showToast({
+									icon: 'none',
+									title: '支付失败'
+								})
+								uni.navigateTo({
+									url: '../orderModule/index?type=1'
+								})
+							}
+						});
+					});
+					jweixin.error(function(res) {
+						console.log('error')
+						console.log(res)
+						uni.showToast({
+							icon: 'none',
+							title: '支付失败了',
+							duration: 3000
+						});
+						uni.navigateTo({
+							url: '../orderModule/index?type=1'
+						})
+					});
+				}).catch(err => {})
+			},
+			// #endif
+			aliPay(payInfo) {
+				const that = this
+				NET.request(API.gotoPay, payInfo, 'POST').then(res => {
+					console.log('alipay gotoPay-----------')
+					console.dir(res)
+					uni.requestPayment({
+						provider: 'alipay',
+						orderInfo: res.data.tradeNo,
+						success: function(payRes) {
+							if (payRes.resultCode == '6001') {
+								uni.showToast({
+									icon: 'none',
+									title: '取消支付'
+								})
+								uni.navigateTo({
+									url: '../orderModule/index?type=1'
+								})
+							}
+							if (payRes.resultCode == '9000') {
+								uni.showToast({
+									icon: 'none',
+									title: '支付成功'
+								})
+								uni.navigateTo({
+									url: 'paySuccessful?orderId=' + that.orderId
+								})
+							}
+						},
+						fail: function(err) {
+							uni.showToast({
+								icon: 'none',
+								title: '支付取消'
+							})
+							uni.navigateTo({
+								url: '../orderModule/index?type=1'
+							})
+						}
+					});
+				}).catch(err => {
+					uni.hideLoading()
+					uni.showToast({
+						title: '支付失败',
+						icon: 'none'
+					})
+					uni.navigateTo({
+						url: '../orderModule/index?type=1'
+					})
+				})
+			},
+			decidePayType() {
+				// #ifdef H5 || MP-WEIXIN || APP-PLUS
+				this.showWechatPayType = true
+				this.paymentMode = 1
+				// #endif
+
+				// #ifdef MP-ALIPAY
+				this.showAlipayPayType = true
+				this.showHuabeiPayType = true
+				this.paymentMode = 2
+				// #endif
+			}
+		}
+	}
 </script>
 
 <style lang="scss">
-page {
-  background-color: #F7F7F7;
-}
-
-.content {
-  padding: 0 30upx 198upx;
-  box-sizing: border-box;
-}
-
-.address-box {
-  margin-top: 20upx;
-  background: #fff;
-  border-radius: 10upx;
-  width: 100%;
-  padding: 30upx;
-  box-sizing: border-box;
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  margin-bottom: 20rpx;
-}
-
-.address-box .address-img {
-  width: 71upx;
-  height: 57upx;
-  margin-right: 20upx;
-}
-
-.address-box .address-r {
-  flex: 1;
-  display: flex;
-  flex-direction: column;
-  font-size: 28upx;
-  color: #333;
-}
-
-.arrow-right-img {
-  width: 62upx;
-  height: 62upx;
-  margin-left: 20upx;
-}
-
-.address-name-box {
-  font-size: 30upx;
-  color: #333;
-}
-
-.phone {
-  font-size: 24upx;
-  color: #999;
-  margin-left: 20upx;
-}
-
-.address-info {
-  font-size: 28upx;
-  color: #333;
-  margin-top: 15upx;
-}
-
-.order-list-box .item {
-  background: #fff;
-  border-radius: 10upx;
-}
-
-.order-list-top {
-  height: 96upx;
-  padding: 0 30upx;
-  box-sizing: border-box;
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: space-between;
-  border-bottom: 2rpx solid #eee;
-}
-
-.top-l {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-}
-
-.shop-img {
-  width: 34upx;
-  height: 34upx;
-  margin-right: 10upx;
-}
-
-.shop-name {
-  font-size: 30upx;
-  color: #333;
-  font-weight: bold;
-}
-
-.arrow-img {
-  margin-left: 15upx;
-  width: 62upx;
-  height: 62upx;
-}
-
-.order-info-box {
-  padding: 0 30upx;
-  box-sizing: border-box;
-}
-
-.order-info-item {
-  display: flex;
-  flex-direction: row;
-  padding: 20upx 0;
-}
-
-.product-img {
-  width: 180upx;
-  height: 180upx;
-  border-radius: 10upx;
-  margin-right: 30upx;
-}
-
-.info-box {
-  flex: 1;
-}
-
-.product-name {
-  font-size: 26upx;
-  color: #333;
-  height: 68upx;
-  line-height: 34upx;
-  display: -webkit-box;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  word-break: break-all;
-  -webkit-box-orient: vertical;
-  -webkit-line-clamp: 2;
-}
-
-.price-sku-box {
-  width: 100%;
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-}
-
-.product-sku {
-  font-size: 24upx;
-  font-weight: 500;
-  color: #999;
-  margin-left: -20upx;
-  width: 100%;
-  display: flex;
-  flex-direction: row;
-}
-
-.product-price {
-  font-size: 32upx;
-  color: #C83732;
-  font-weight: 400;
-}
-
-.product-price .fuhao {
-  font-size: 28upx;
-}
-
-.product-num {
-  font-size: 28upx;
-  color: #999;
-  font-weight: 400;
-}
-.adressTips{
-	margin-bottom: 19rpx;
-	color: #D53912;
-}
-
-.delivery-way-box {
-  display: flex;
-  flex-direction: column;
-  border: 2rpx solid #E4E5E6;
-  padding: 20rpx;
-  margin-bottom: 20rpx;
-  box-sizing: content-box;
-}
-
-.delivery-way-box .item {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: space-between;
-  font-size: 26upx;
-  color: #333;
-}
-
-.delivery-way-box .item .way {
-  color: #999;
-  margin-left: 30upx;
-}
-
-.order-total-box {
-  padding: 20upx 0;
-  text-align: right;
-}
-
-.total-num {
-  font-size: 26upx;
-  color: #333;
-}
-
-.total-price {
-  font-size: 46rpx;
-  color: #333333;
-}
-
-.ml10 {
-  margin-left: 10upx;
-}
-
-.order-flow-box {
-  display: flex;
-  flex-direction: column;
-}
-
-.flow-word {
-  font-size: 24upx;
-  color: #999;
-  display: flex;
-  flex-direction: column;
-}
-
-.mt25 {
-  margin-top: 20upx;
-}
-
-.mt50 {
-  margin-top: 30upx;
-  margin-bottom: 20upx;
-}
-
-.order-confirm-box {
-  position: fixed;
-  bottom: 0;
-  left: 0;
-  width: 100%;
-  background: #fff;
-  padding: 30upx;
-}
-
-.num-box {
-  font-size: 30upx;
-  color: #999;
-}
-
-.num-box .total {
-  color: #333;
-}
-
-.num-box .price {
-  color: #ff7911;
-  font-weight: bold;
-}
-
-.order-confirm-box .btn {
-  width: 100%;
-  height: 80rpx;
-  line-height: 80rpx;
-  background: #eee;
-  font-size: 28rpx;
-  color: #FFEBC4;
-  text-align: center;
-  margin-top: 20rpx;
-}
-
-.order-confirm-box .btn.active {
-  background: #333333;
-  color: #FFEBC4;
-}
-.order-confirm-box .btn.unActive {
-	background: #333333;
-	color: #FFEBC4;
-	opacity: 0.7;
-}
-
-.discount-item1 {
-  width: 100%;
-  box-sizing: border-box;
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: space-between;
-  background: white;
-  padding: 20rpx;
-  border: 2rpx solid #E4E5E6;
-}
-
-.discount-item {
-  width: 100%;
-  height: 98upx;
-  box-sizing: border-box;
-  margin: 30upx 0;
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: space-between;
-  padding: 0 20upx;
-  background: white;
-}
-
-.pay-type-item {
-  .pay-type-radio {
-    background-color: white;
-    border-bottom: 1upx solid #EDEDED;
-    margin-bottom: 20upx;
-    padding: 24upx 20upx 24upx 20upx;
-
-    .pay-type-img {
-      display: inline-block;
-
-      .pay-type-img-inner {
-        width: 50upx;
-        height: 50upx;
-        vertical-align: middle;
-      }
-    }
-
-    .pay-type-label {
-      vertical-align: middle;
-      margin-left: 30upx;
-    }
-
-    .pay-type-radio-item {
-      float: right;
-      width: 50upx;
-      height: 50upx;
-    }
-
-    .huabei-detail {
-      margin-top: 20upx;
-
-      .fenqi-wenzi {
-        display: inline-block;
-        margin-left: 64upx;
-      }
-
-      .fenqi-amount {
-        display: block;
-        margin-left: 64upx;
-        margin-top: 14upx;
-        color: #BABBBC;
-      }
-
-      .fenqi-charge-fee {
-        float: right;
-        margin-right: 68upx;
-        color: #BABBBC;
-      }
-
-      .fenqi-modal {
-        width: 40upx;
-        height: 40upx;
-        margin-left: 20upx;
-        float: right;
-        position: relative;
-        top: -80upx;
-      }
-    }
-  }
-}
-
-.period-radio {
-  margin: 30upx;
-  width: 95%;
-  border-bottom: 1px solid #EFEFEF;
-
-  .period-amount {
-    display: inline-block;
-
-    .period-each-charge {
-      display: inline-block;
-      margin-top: 12upx;
-      margin-left: 6upx;
-      font-size: 26upx;
-      color: #b7b7b7;
-      margin-bottom: 13upx;
-    }
-  }
-
-  .period-each {
-    display: block;
-  }
-
-  .period-type-radio-item {
-    float: right;
-  }
-}
-
-.huabei-confirm {
-  height: 120upx;
-  padding: 0upx 108upx 0upx 32upx;
-
-  .fenqi-all {
-    display: inline-block;
-    width: 100%;
-  }
-
-  .fenqi-total-amount {
-    float: left;
-  }
-
-  .fenqi-confirm {
-    float: right;
-    width: 160upx;
-    padding: 0upx 20upx;
-
-    .btn {
-      width: 216upx;
-      height: 80upx;
-      line-height: 80upx;
-      border-radius: 40upx;
-      font-size: 28upx;
-      text-align: center;
-      background: linear-gradient(90deg, rgba(255, 162, 0, 1), rgba(255, 121, 17, 1));
-      color: #fff;
-      display: inline-block;
-      margin-right: 66upx;
-    }
-  }
-}
-
-.discount-info-box {
-  display: flex;
-  flex-direction: row;
-}
-
-.discount-label,
-.discount-info1 {
-  font-size: 26upx;
-  color: #333;
-}
-
-.discount-info2 {
-  color: #C5AA7B;
-}
-
-.discount-img {
-  width: 30upx;
-  height: 30upx;
-  margin-left: 20upx;
-}
-
-.activity-con {
-  .activity-box {
-    display: flex;
-    flex-direction: column;
-    width: 100%;
-    height: 1000upx;
-  }
-
-}
-
-.activity-box .title-box {
-  width: 100%;
-  height: 100upx;
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: center;
-  position: relative;
-  border-bottom: solid 1px #EEEEEE;
-}
-
-.activity-coupon-box {
-  display: flex;
-  flex-direction: column;
-  width: 100%;
-  overflow: auto;
-  flex: 1;
-}
-
-.title-box .close-btn {
-  width: 100upx;
-  height: 100upx;
-  box-sizing: border-box;
-  padding: 30upx;
-  position: absolute;
-  top: 0;
-  right: 0;
-}
-
-.content-box {
-  width: 100%;
-  box-sizing: border-box;
-  display: flex;
-  flex-direction: column;
-  padding: 30upx;
-}
-
-.tag-box {
-  width: 100%;
-  box-sizing: border-box;
-  height: 80upx;
-  line-height: 80upx;
-  font-size: 28upx;
-  font-weight: 500;
-  color: #FF7911;
-}
-
-.label-lingqu {
-  width: 100%;
-  font-size: 28upx;
-  font-weight: 500;
-  color: rgba(51, 51, 51, 1);
-}
-
-.coupon-item1 {
-  width: 690upx;
-  height: 120upx;
-  margin-top: 20upx;
-  color: #FFFFFF;
-  flex-shrink: 0;
-}
-
-.coupon-item2 {
-  width: 690upx;
-  height: 120upx;
-  background-size: 690upx 120upx;
-  margin-top: 20upx;
-  color: rgba(255, 121, 17, 1);
-  flex-shrink: 0
-}
-
-.un-coupon-item {
-  color: #bbb;
-}
-
-.money-box {
-  font-size: 40upx;
-  font-weight: 500;
-
-}
-
-.info-box {
-  font-size: 24upx;
-  font-weight: 400;
-  margin: 10rpx;
-}
-
-
-.receive-success {
-  width: 100%;
-  position: fixed;
-  top: 0;
-  bottom: 0;
-  left: 0;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-  z-index: 9999;
-}
-
-.success-box {
-  width: 380upx;
-  height: 280upx;
-  background: rgba(0, 0, 0, 0.5);
-  border-radius: 10upx;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-}
-
-.success-box .success-img {
-  width: 200upx;
-  height: 130upx;
-}
-
-.success-box .text {
-  font-size: 28upx;
-  margin-top: 50upx;
-  font-weight: 400;
-  color: rgba(255, 255, 255, 1);
-}
-
-.check-img {
-  width: 40upx;
-  height: 40upx;
-  margin-top: 40rpx;
-}
-
-.mt30 {
-  margin-top: 30upx;
-}
-
-.activity-con {
-  .activity-box {
-    display: flex;
-    flex-direction: column;
-    width: 100%;
-    height: 1000upx;
-  }
-
-}
-
-.activity-box .title-box {
-  width: 100%;
-  height: 100upx;
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: center;
-  position: relative;
-  border-bottom: solid 1px #EEEEEE;
-}
-
-.activity-coupon-box {
-  display: flex;
-  flex-direction: column;
-  width: 100%;
-  overflow: auto;
-  flex: 1;
-}
-
-.title-box .close-btn {
-  width: 100upx;
-  height: 100upx;
-  box-sizing: border-box;
-  padding: 30upx;
-  position: absolute;
-  top: 0;
-  right: 0;
-}
-
-.content-box {
-  width: 100%;
-  box-sizing: border-box;
-  display: flex;
-  flex-direction: column;
-  padding: 30upx;
-}
-
-.tag-box {
-  width: 100%;
-  box-sizing: border-box;
-  height: 80upx;
-  line-height: 80upx;
-  font-size: 28upx;
-  font-weight: 500;
-  color: #FF7911;
-}
-
-.label-lingqu {
-  width: 100%;
-  font-size: 28upx;
-  font-weight: 500;
-  color: rgba(51, 51, 51, 1);
-}
-
-.couponBox {
-  display: flex;
-  flex-flow: wrap;
-  margin-top: 30rpx;
-  justify-content: space-between;
-}
-
-.coupon-item {
-  width: 48%;
-  height: 291rpx;
-  background: url("https://ceres.zkthink.com/static/images/couponsIcon.png") no-repeat center top;
-  margin-top: 20upx;
-  color: #C5AA7B;
-  flex-shrink: 0;
-  text-align: center;
-  padding-top: 1rpx;
-  background-size: contain;
-}
-
-.un-coupon-item {
-  color: #bbb;
-}
-
-.money-box {
-  font-size: 40upx;
-  font-weight: 500;
-  margin-top: 30rpx;
-}
-
-.integralPayBox {
-  margin: 20rpx 0;
-
-  .integralBg {
-    height: 98rpx;
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    background: #FFFFFF;
-    padding: 0 20rpx;
-
-    .maxDeduction {
-      margin-right: 15rpx;
-    }
-  }
-}
+	page {
+		background-color: #F7F7F7;
+	}
+
+	.content {
+		padding: 0 30upx 198upx;
+		box-sizing: border-box;
+	}
+
+	.address-box {
+		margin-top: 20upx;
+		background: #fff;
+		border-radius: 10upx;
+		width: 100%;
+		padding: 30upx;
+		box-sizing: border-box;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		margin-bottom: 20rpx;
+	}
+
+	.address-box .address-img {
+		width: 71upx;
+		height: 57upx;
+		margin-right: 20upx;
+	}
+
+	.address-box .address-r {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		font-size: 28upx;
+		color: #333;
+	}
+
+	.arrow-right-img {
+		width: 62upx;
+		height: 62upx;
+		margin-left: 20upx;
+	}
+
+	.address-name-box {
+		font-size: 30upx;
+		color: #333;
+	}
+
+	.phone {
+		font-size: 24upx;
+		color: #999;
+		margin-left: 20upx;
+	}
+
+	.address-info {
+		font-size: 28upx;
+		color: #333;
+		margin-top: 15upx;
+	}
+
+	.order-list-box .item {
+		background: #fff;
+		border-radius: 10upx;
+	}
+
+	.order-list-top {
+		height: 96upx;
+		padding: 0 30upx;
+		box-sizing: border-box;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: space-between;
+		border-bottom: 2rpx solid #eee;
+	}
+
+	.top-l {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+	}
+
+	.shop-img {
+		width: 34upx;
+		height: 34upx;
+		margin-right: 10upx;
+	}
+
+	.shop-name {
+		font-size: 30upx;
+		color: #333;
+		font-weight: bold;
+	}
+
+	.arrow-img {
+		margin-left: 15upx;
+		width: 62upx;
+		height: 62upx;
+	}
+
+	.order-info-box {
+		padding: 0 30upx;
+		box-sizing: border-box;
+	}
+
+	.order-info-item {
+		display: flex;
+		flex-direction: row;
+		padding: 20upx 0;
+	}
+
+	.product-img {
+		width: 180upx;
+		height: 180upx;
+		border-radius: 10upx;
+		margin-right: 30upx;
+	}
+
+	.info-box {
+		flex: 1;
+	}
+
+	.product-name {
+		font-size: 26upx;
+		color: #333;
+		height: 68upx;
+		line-height: 34upx;
+		display: -webkit-box;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		word-break: break-all;
+		-webkit-box-orient: vertical;
+		-webkit-line-clamp: 2;
+	}
+
+	.price-sku-box {
+		width: 100%;
+		display: flex;
+		flex-direction: row;
+		justify-content: space-between;
+	}
+
+	.product-sku {
+		font-size: 24upx;
+		font-weight: 500;
+		color: #999;
+		margin-left: -20upx;
+		width: 100%;
+		display: flex;
+		flex-direction: row;
+	}
+
+	.product-price {
+		font-size: 32upx;
+		color: #C83732;
+		font-weight: 400;
+	}
+
+	.product-price .fuhao {
+		font-size: 28upx;
+	}
+
+	.product-num {
+		font-size: 28upx;
+		color: #999;
+		font-weight: 400;
+	}
+
+	.adressTips {
+		margin-bottom: 19rpx;
+		color: #D53912;
+	}
+
+	.delivery-way-box {
+		display: flex;
+		flex-direction: column;
+		border: 2rpx solid #E4E5E6;
+		padding: 20rpx;
+		margin-bottom: 20rpx;
+		box-sizing: content-box;
+	}
+
+	.delivery-way-box .item {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: space-between;
+		font-size: 26upx;
+		color: #333;
+	}
+
+	.delivery-way-box .item .way {
+		color: #999;
+		margin-left: 30upx;
+	}
+
+	.order-total-box {
+		padding: 20upx 0;
+		text-align: right;
+	}
+
+	.total-num {
+		font-size: 26upx;
+		color: #333;
+	}
+
+	.total-price {
+		font-size: 46rpx;
+		color: #333333;
+	}
+
+	.ml10 {
+		margin-left: 10upx;
+	}
+
+	.order-flow-box {
+		display: flex;
+		flex-direction: column;
+	}
+
+	.flow-word {
+		font-size: 24upx;
+		color: #999;
+		display: flex;
+		flex-direction: column;
+	}
+
+	.mt25 {
+		margin-top: 20upx;
+	}
+
+	.mt50 {
+		margin-top: 30upx;
+		margin-bottom: 20upx;
+	}
+
+	.order-confirm-box {
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		width: 100%;
+		background: #fff;
+		padding: 30upx;
+	}
+
+	.num-box {
+		font-size: 30upx;
+		color: #999;
+	}
+
+	.num-box .total {
+		color: #333;
+	}
+
+	.num-box .price {
+		color: #ff7911;
+		font-weight: bold;
+	}
+
+	.order-confirm-box .btn {
+		width: 100%;
+		height: 80rpx;
+		line-height: 80rpx;
+		background: #eee;
+		font-size: 28rpx;
+		color: #FFEBC4;
+		text-align: center;
+		margin-top: 20rpx;
+	}
+
+	.order-confirm-box .btn.active {
+		background: #333333;
+		color: #FFEBC4;
+	}
+
+	.order-confirm-box .btn.unActive {
+		background: #333333;
+		color: #FFEBC4;
+		opacity: 0.7;
+	}
+
+	.discount-item1 {
+		width: 100%;
+		box-sizing: border-box;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: space-between;
+		background: white;
+		padding: 20rpx;
+		border: 2rpx solid #E4E5E6;
+	}
+
+	.discount-item {
+		width: 100%;
+		height: 98upx;
+		box-sizing: border-box;
+		margin: 30upx 0;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: space-between;
+		padding: 0 20upx;
+		background: white;
+	}
+
+	.pay-type-item {
+		.pay-type-radio {
+			background-color: white;
+			border-bottom: 1upx solid #EDEDED;
+			margin-bottom: 20upx;
+			padding: 24upx 20upx 24upx 20upx;
+
+			.pay-type-img {
+				display: inline-block;
+
+				.pay-type-img-inner {
+					width: 50upx;
+					height: 50upx;
+					vertical-align: middle;
+				}
+			}
+
+			.pay-type-label {
+				vertical-align: middle;
+				margin-left: 30upx;
+			}
+
+			.pay-type-radio-item {
+				float: right;
+				width: 50upx;
+				height: 50upx;
+			}
+
+			.huabei-detail {
+				margin-top: 20upx;
+
+				.fenqi-wenzi {
+					display: inline-block;
+					margin-left: 64upx;
+				}
+
+				.fenqi-amount {
+					display: block;
+					margin-left: 64upx;
+					margin-top: 14upx;
+					color: #BABBBC;
+				}
+
+				.fenqi-charge-fee {
+					float: right;
+					margin-right: 68upx;
+					color: #BABBBC;
+				}
+
+				.fenqi-modal {
+					width: 40upx;
+					height: 40upx;
+					margin-left: 20upx;
+					float: right;
+					position: relative;
+					top: -80upx;
+				}
+			}
+		}
+	}
+
+	.period-radio {
+		margin: 30upx;
+		width: 95%;
+		border-bottom: 1px solid #EFEFEF;
+
+		.period-amount {
+			display: inline-block;
+
+			.period-each-charge {
+				display: inline-block;
+				margin-top: 12upx;
+				margin-left: 6upx;
+				font-size: 26upx;
+				color: #b7b7b7;
+				margin-bottom: 13upx;
+			}
+		}
+
+		.period-each {
+			display: block;
+		}
+
+		.period-type-radio-item {
+			float: right;
+		}
+	}
+
+	.huabei-confirm {
+		height: 120upx;
+		padding: 0upx 108upx 0upx 32upx;
+
+		.fenqi-all {
+			display: inline-block;
+			width: 100%;
+		}
+
+		.fenqi-total-amount {
+			float: left;
+		}
+
+		.fenqi-confirm {
+			float: right;
+			width: 160upx;
+			padding: 0upx 20upx;
+
+			.btn {
+				width: 216upx;
+				height: 80upx;
+				line-height: 80upx;
+				border-radius: 40upx;
+				font-size: 28upx;
+				text-align: center;
+				background: linear-gradient(90deg, rgba(255, 162, 0, 1), rgba(255, 121, 17, 1));
+				color: #fff;
+				display: inline-block;
+				margin-right: 66upx;
+			}
+		}
+	}
+
+	.discount-info-box {
+		display: flex;
+		flex-direction: row;
+	}
+
+	.discount-label,
+	.discount-info1 {
+		font-size: 26upx;
+		color: #333;
+	}
+
+	.discount-info2 {
+		color: #C5AA7B;
+	}
+
+	.discount-img {
+		width: 30upx;
+		height: 30upx;
+		margin-left: 20upx;
+	}
+
+	.activity-con {
+		.activity-box {
+			display: flex;
+			flex-direction: column;
+			width: 100%;
+			height: 1000upx;
+		}
+
+	}
+
+	.activity-box .title-box {
+		width: 100%;
+		height: 100upx;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+		position: relative;
+		border-bottom: solid 1px #EEEEEE;
+	}
+
+	.activity-coupon-box {
+		display: flex;
+		flex-direction: column;
+		width: 100%;
+		overflow: auto;
+		flex: 1;
+	}
+
+	.title-box .close-btn {
+		width: 100upx;
+		height: 100upx;
+		box-sizing: border-box;
+		padding: 30upx;
+		position: absolute;
+		top: 0;
+		right: 0;
+	}
+
+	.content-box {
+		width: 100%;
+		box-sizing: border-box;
+		display: flex;
+		flex-direction: column;
+		padding: 30upx;
+	}
+
+	.tag-box {
+		width: 100%;
+		box-sizing: border-box;
+		height: 80upx;
+		line-height: 80upx;
+		font-size: 28upx;
+		font-weight: 500;
+		color: #FF7911;
+	}
+
+	.label-lingqu {
+		width: 100%;
+		font-size: 28upx;
+		font-weight: 500;
+		color: rgba(51, 51, 51, 1);
+	}
+
+	.coupon-item1 {
+		width: 690upx;
+		height: 120upx;
+		margin-top: 20upx;
+		color: #FFFFFF;
+		flex-shrink: 0;
+	}
+
+	.coupon-item2 {
+		width: 690upx;
+		height: 120upx;
+		background-size: 690upx 120upx;
+		margin-top: 20upx;
+		color: rgba(255, 121, 17, 1);
+		flex-shrink: 0
+	}
+
+	.un-coupon-item {
+		color: #bbb;
+	}
+
+	.money-box {
+		font-size: 40upx;
+		font-weight: 500;
+
+	}
+
+	.info-box {
+		font-size: 24upx;
+		font-weight: 400;
+		margin: 10rpx;
+	}
+
+
+	.receive-success {
+		width: 100%;
+		position: fixed;
+		top: 0;
+		bottom: 0;
+		left: 0;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		z-index: 9999;
+	}
+
+	.success-box {
+		width: 380upx;
+		height: 280upx;
+		background: rgba(0, 0, 0, 0.5);
+		border-radius: 10upx;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.success-box .success-img {
+		width: 200upx;
+		height: 130upx;
+	}
+
+	.success-box .text {
+		font-size: 28upx;
+		margin-top: 50upx;
+		font-weight: 400;
+		color: rgba(255, 255, 255, 1);
+	}
+
+	.check-img {
+		width: 40upx;
+		height: 40upx;
+		margin-top: 40rpx;
+	}
+
+	.mt30 {
+		margin-top: 30upx;
+	}
+
+	.activity-con {
+		.activity-box {
+			display: flex;
+			flex-direction: column;
+			width: 100%;
+			height: 1000upx;
+		}
+
+	}
+
+	.activity-box .title-box {
+		width: 100%;
+		height: 100upx;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+		position: relative;
+		border-bottom: solid 1px #EEEEEE;
+	}
+
+	.activity-coupon-box {
+		display: flex;
+		flex-direction: column;
+		width: 100%;
+		overflow: auto;
+		flex: 1;
+	}
+
+	.title-box .close-btn {
+		width: 100upx;
+		height: 100upx;
+		box-sizing: border-box;
+		padding: 30upx;
+		position: absolute;
+		top: 0;
+		right: 0;
+	}
+
+	.content-box {
+		width: 100%;
+		box-sizing: border-box;
+		display: flex;
+		flex-direction: column;
+		padding: 30upx;
+	}
+
+	.tag-box {
+		width: 100%;
+		box-sizing: border-box;
+		height: 80upx;
+		line-height: 80upx;
+		font-size: 28upx;
+		font-weight: 500;
+		color: #FF7911;
+	}
+
+	.label-lingqu {
+		width: 100%;
+		font-size: 28upx;
+		font-weight: 500;
+		color: rgba(51, 51, 51, 1);
+	}
+
+	.couponBox {
+		display: flex;
+		flex-flow: wrap;
+		margin-top: 30rpx;
+		justify-content: space-between;
+	}
+
+	.coupon-item {
+		width: 48%;
+		height: 291rpx;
+		background: url("https://ceres.zkthink.com/static/images/couponsIcon.png") no-repeat center top;
+		margin-top: 20upx;
+		color: #C5AA7B;
+		flex-shrink: 0;
+		text-align: center;
+		padding-top: 1rpx;
+		background-size: contain;
+	}
+
+	.un-coupon-item {
+		color: #bbb;
+	}
+
+	.money-box {
+		font-size: 40upx;
+		font-weight: 500;
+		margin-top: 30rpx;
+	}
+
+	.integralPayBox {
+		margin: 20rpx 0;
+
+		.integralBg {
+			height: 98rpx;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			background: #FFFFFF;
+			padding: 0 20rpx;
+
+			.maxDeduction {
+				margin-right: 15rpx;
+			}
+		}
+	}
 </style>
 <style>
-.pay-type-item /deep/ .uni-radio-input-checked {
-  background-color: #C5AA7B !important;
-  border-color: #C5AA7B !important;
-}
-
-.maxIntegral /deep/ .uni-checkbox-input {
-  width: 30rpx;
-  height: 30rpx;
-}
-
-.maxIntegral /deep/ .uni-checkbox-input-checked:before {
-  font-size: 30rpx;
-}
-
-.maxIntegral /deep/ .uni-checkbox-input-checked {
-  border: 2rpx solid #C5AA7B !important;
-}
+	.pay-type-item /deep/ .uni-radio-input-checked {
+		background-color: #C5AA7B !important;
+		border-color: #C5AA7B !important;
+	}
+
+	.maxIntegral /deep/ .uni-checkbox-input {
+		width: 30rpx;
+		height: 30rpx;
+	}
+
+	.maxIntegral /deep/ .uni-checkbox-input-checked:before {
+		font-size: 30rpx;
+	}
+
+	.maxIntegral /deep/ .uni-checkbox-input-checked {
+		border: 2rpx solid #C5AA7B !important;
+	}
 </style>

+ 52 - 37
pages_category_page1/orderModule/orderDetails.vue

@@ -103,7 +103,7 @@
 								<image src="https://ceres.zkthink.com/static/images/arrowRight.png" class="arrow-img">
 								</image>
 							</view>
-							<view class="toService" @click="openService">
+							<view class="toService" @click="openService(dataList.shopId)">
 								<image src="https://ceres.zkthink.com/static/images/serviceImg-order-detail.png"
 									class="service-img"></image>
 								<text>联系客服</text>
@@ -515,8 +515,6 @@
 					this.dataList = data
 					this.dataList.receivePhone = hidden(this.dataList.receivePhone, 3, 4)
 					this.ifShow = true
-					console.log(this.dataList)
-					console.log(dataList.collageDetail.length, 888)
 					this.getShippingTrace(this.dataList.express, this.dataList.deliverFormid)
 					if (this.dataList.state == 1 || this.dataList.state == 6) {
 						this.countDown();
@@ -1128,52 +1126,69 @@
 					}
 				})
 			},
-			openService() {
-				if (this.isLoading || !this.shopId || this.shopId === 'null') {
-					return
-				}
-				const shopids = uni.getStorageSync('service_shopids') || []
-				const corpIds = uni.getStorageSync('service_corpIds') || []
-				const urls = uni.getStorageSync('service_urls') || []
-
-				const index = shopids.indexOf(this.shopId)
-				if (index === -1) {
+			openService(shopId){
 					this.isLoading = true
-					const id = this.shopId || null
 					NET.request(API.CustomerService, {
-						id
+						id:shopId
 					}, 'get').then(res => {
 						if (res.code === '') {
-							shopids.push(this.shopId)
-							corpIds.push(res.data.corpId)
-							urls.push(res.data.url)
-
-							uni.setStorageSync('service_shopids', shopids);
-							uni.setStorageSync('service_corpIds', corpIds);
-							uni.setStorageSync('service_urls', urls);
-
 							this.corpId = res.data.corpId
 							this.serviceURL = res.data.url
-							// #ifdef MP-WEIXIN
-							this.flyToService()
-							// #endif
+							this.flyToService({
+                corpId:res.data.corpId,
+                serviceURL:res.data.url
+              })
 						}
 						this.isLoading = false
 					}).catch(err => {
 						console.log(err)
 						this.isLoading = false
 					})
-				} else {
-					this.corpId = corpIds[index]
-					this.serviceURL = urls[index]
-
-					// #ifdef MP-WEIXIN
-					this.flyToService()
-					// #endif
-				}
 			},
-			flyToService() {
-				if (!this.serviceURL || !this.corpId) {
+			flyToService(data) {
+        let self = data
+        console.log(self.serviceURL, self.corpId)
+        // #ifdef MP-WEIXIN
+        if (!self.serviceURL || !self.corpId) {
+          self.hasService = false
+          return
+        }
+        wx.openCustomerServiceChat({
+          extInfo: {
+            url: self.serviceURL
+          },
+          corpId: self.corpId, // 企业ID
+          success(res) {
+          },
+          fail(err) {
+          }
+        })
+        // #endif
+        // #ifdef APP-PLUS
+        try {
+          let sweixin = null
+          plus.share.getServices(res=>{
+            sweixin = res.find(i => i.id === 'weixin')
+            if(sweixin){
+              sweixin.openCustomerServiceChat({
+                corpid: self.corpId,
+                url: self.serviceURL,
+              },suc=>{
+                console.log("success",JSON.stringify(res))
+              },err=>{
+                console.log("error",JSON.stringify(err))
+              })
+            }else{
+              plus.nativeUI.alert('当前环境不支持微信操作!')
+            }
+          },function(){
+            uni.showToast({title: "获取服务失败,不支持该操作。"+JSON.stringify(e), icon: 'error'})
+          })
+        } catch (err) {
+          uni.showToast({title: "调用失败,不支持该操作。"+JSON.stringify(err), icon: 'error'})
+        }
+        // #endif
+			/*	if (!this.serviceURL || !this.corpId) {
 					return
 				}
 				// 获取店铺id、客服链接
@@ -1183,7 +1198,7 @@
 				wx.openCustomerServiceChat({
 					extInfo,
 					corpId: this.corpId // 企业ID
-				})
+				})*/
 			}
 		},
 		filters: {

+ 3 - 3
pages_category_page1/store/index.vue

@@ -114,14 +114,14 @@
 									<image :src="cItem.image" class="product-img default-img"></image>
 									<view class="product-bottom-box">
 										<view class="product-name">{{cItem.productName}}</view>
-										<view class="product-num font-color-C5AA7B mar-top-10">{{cItem.users}}人付款</view>
+										<view class="product-num font-color-C5AA7B mar-top-10">已售{{cItem.number}}件</view>
 										<view class="product-price-box">
 											<image v-if="cItem.activityType===1" class="iconImg" src="https://ceres.zkthink.com/static/images/groupBuyIcon.png" alt="拼团icon"></image>
 											<image v-if="cItem.activityType === 2" class="iconImg"  src="https://ceres.zkthink.com/static/images/spikeIcon.png" alt="秒杀活动"></image>
 											<image v-if="cItem.activityType === 3" class="iconImg discountIcon" src="https://zk-cereshop.oss-cn-shenzhen.aliyuncs.com/zkthink/2022-03-14/38184785db4b4fbca767ada611097ae9_discount.png" alt="限时折扣活动"></image>
 											<image v-if="cItem.activityType === 4" class="iconImg" src="https://ceres.zkthink.com/static/images/spikeIcon.png" alt="平台秒杀"></image>
 											<image v-if="cItem.activityType===5" class="iconImg" src="https://ceres.zkthink.com/static/images/discountListIcon.png" alt="平台折扣"></image>
-											<image v-if="cItem.activityType===9" class="iconImg" src="https://ceres.zkthink.com/static/images/memberCenterIcon.png" alt="会员价"></image>			
+											<image v-if="cItem.activityType===9" class="iconImg" src="https://ceres.zkthink.com/static/images/memberCenterIcon.png" alt="会员价"></image>
 											<image v-if="cItem.activityType === 8" class="iconImg" src="https://zk-cereshop.oss-cn-shenzhen.aliyuncs.com/zkthink/2022-02-15/d0d8d96f28904167b271de4ae924d1a8_sceneMarketing.png" alt="场景营销"></image>
 											<text class="price-box fs40 font-color-C83732 mar-right-20">¥{{cItem.price}}</text>
 											<text class="price-through">¥{{cItem.originalPrice}}</text>
@@ -844,7 +844,7 @@ page {
 	flex-direction: row;
 	align-items: center;
 	margin-top: 30rpx;
-	
+
 	.iconImg {
 		width: 58rpx;
 		height: 36rpx;

+ 12 - 7
pages_category_page2/userModule/accountLogin.vue

@@ -26,6 +26,7 @@
         </view>
         <view>
           <input v-model="loginQuery.code"
+                 :maxlength="4"
                  placeholder-class="codeNum-input"
                  placeholder="请输入验证码"/>
         </view>
@@ -69,11 +70,12 @@ export default {
   },
   mixins: [sendVerifyCode],
   onLoad(options) {
-    if (options.inviteSpell == 1) {
+    if (options.inviteSpell && parseInt(options.inviteSpell) === 1) {
       this.inviteSpelltype = true
-      this.inviteSpell = uni.getStorageSync('inviteSpell');
+      this.inviteSpell = uni.getStorageSync('inviteSpell')
+      console.log('this.inviteSpell', this.inviteSpell)
     }
-    this.loginQuery.salesId = uni.getStorageSync('salesId');
+    this.loginQuery.salesId = uni.getStorageSync('salesId')
     var pages = getCurrentPages()
     if (pages.length >= 2) {
       this.beforePage = pages[pages.length - 2]
@@ -139,10 +141,13 @@ export default {
           if (this.inviteSpelltype == true) {
             setTimeout(function () {
               uni.reLaunch({
-                url: '../../pages_category_page1/goodsModule/inviteSpell?collageId=' +
-                    this.inviteSpell.collageId + '&orderId=' + this.inviteSpell
-                        .orderId + '&type=0' + '&productId=' + this.inviteSpell
-                        .productId + '&skuId=' + this.inviteSpell.skuId
+                url: '../../pages_category_page1/goodsModule/inviteSpell?collageId='
+                        + that.inviteSpell.collageId
+                        + '&orderId=' + that.inviteSpell.orderId
+                        + '&type=0'
+                        + '&productId=' + that.inviteSpell.productId
+                        + '&skuId=' + that.inviteSpell.skuId
+                        + '&shopGroupWorkId=' + that.inviteSpell.shopGroupWorkId
               })
               uni.removeStorageSync('inviteSpell');
             }, 2000)

+ 2 - 1
pages_category_page2/userModule/login.vue

@@ -35,7 +35,8 @@
 				WXloginQuery: {
 					"code": "",
 					"salesId": 0,
-					"headImg": ''
+					"headImg": '',
+          "terminal":1
 				},
 				noMp: false,
 				// beforePage: undefined,

+ 22 - 4
pages_category_page2/userModule/register.vue

@@ -20,8 +20,8 @@
 						<image class="loginIcon" src="https://ceres.zkthink.com/static/images/code.png"></image>
 					</view>
 					<view style="margin-left: 40rpx;">
-						<input v-model="RegisterQuery.code" class="codeNum-inputbox" placeholder-class="codeNum-input"
-							placeholder="请输入验证码" />
+						<input :maxlength="4" v-model="RegisterQuery.code" class="codeNum-inputbox"
+							placeholder-class="codeNum-input" placeholder="请输入验证码" />
 					</view>
 				</view>
 				<view :class="disabled === true ? 'on' : ''" :disabled="disabled" class="getcode" @click="codede">
@@ -93,7 +93,7 @@
 						duration: 2000,
 						icon: 'none'
 					});
-				} else if(!this.agreement){
+				} else if (!this.agreement) {
 					uni.showToast({
 						title: '请先阅读并同意《用户服务协议和个人隐私协议》',
 						duration: 2000,
@@ -105,10 +105,27 @@
 						title: '正在注册...',
 						duration: 2000,
 					})
+
+					// 判断用户类型
+					let terminal = 0
+					//#ifdef APP-PLUS
+					terminal = 1
+					//#endif
+					//#ifdef MP-WEIXIN
+					terminal = 2
+					//#endif
+					//#ifdef H5
+					terminal = 3
+					//#endif
+					//#ifdef MP-ALIPAY
+					terminal = 4
+					//#endif
+
 					NET.request(API.Login, {
 						type: 1,
 						phone: this.phone,
 						verificationCode: this.RegisterQuery.code,
+						terminal
 					}, 'POST').then(res => {
 						uni.hideLoading()
 						uni.showToast({
@@ -321,7 +338,8 @@
 		.agreement {
 			margin: 100rpx 50rpx;
 			line-height: 50rpx;
-			image{
+
+			image {
 				width: 34rpx;
 				height: 34rpx;
 				margin-right: 15upx;

BIN
static/empty.png


BIN
static/images/img.png


BIN
static/images/logo.png


+ 127 - 62
utils/request.js

@@ -1,70 +1,135 @@
+const API = require("../config/api")
+let antiShake = false
 const request = (url, data, method = 'GET') => {
-	return new Promise((resolve, reject) => {
-		let header = {
-			"Content-Type": "application/json"
-		}
-		const res = uni.getStorageSync('storage_key');
-		const token = res.token
-		if (token) {
-			header['Authorization'] = token
-		}
-		uni.request({
-			url: url,
-			data: data,
-			method: method,
-			header: header,
-			success: res => {
-				if (res.statusCode == 200) {
-					if (res.data.code === "200" || res.data.code === "") {
-						resolve(res.data)
-					} else if (res.data.code === "20004" || res.data.code === "20005") {
-						uni.removeStorageSync("storage_key")
-						uni.navigateTo({
-							url: '/pages_category_page2/userModule/login'
-						})
-					} else {
-						uni.showToast({
-							title: res.data.message,
-							icon: "none"
-						})
-					}
-				} else {
-					reject(res)
-				}
-			},
-			fail: res => {
-				reject(res)
-			}
-		})
-	});
+    return new Promise((resolve, reject) => {
+        let header = {
+            "Content-Type": "application/json"
+        }
+        const res = uni.getStorageSync('storage_key');
+        const token = res.token
+        if (token) {
+            header['Authorization'] = token
+        }
+        uni.request({
+            url: url,
+            data: data,
+            method: method,
+            header: header,
+            success: async res => {
+                if (res.statusCode == 200) {
+                    if (res.data.code === "200" || res.data.code === "") {
+                        resolve(res.data)
+                    } else if (res.data.code === "20004" || res.data.code === "20005") {
+                       if(token){
+                           //  refreshToken
+                           try {
+                               await refreshToken();
+                               //  重新发送上一次请求
+                               setTimeout(async () => {
+                                   const retryRequest =  await request(url, data, method)
+                                   resolve(retryRequest)
+                               },500)
+                           } catch (e) {
+                               goLogin()
+                           }
+                       }else{
+                           goLogin()
+                       }
+                    } else {
+                        uni.showToast({
+                            title: res.data.message,
+                            icon: "none"
+                        })
+                    }
+                } else {
+                    reject(res)
+                }
+            },
+            fail: res => {
+                reject(res)
+            }
+        })
+    });
 }
 //不带token接口请求,首页
 const request1 = (url, data, method = 'GET') => {
-	return new Promise((resolve, reject) => {
-		let header = {
-			'Content-Type': 'application/json',
-			'tenant': 'MDAwMA==',
-		}
-		uni.request({
-			url: url,
-			data: data,
-			method: method,
-			header: header,
-			success: res => {
-				if (res.data.code === "200" || data.code === "") {
-					resolve(res.data)
-				} else {
-					reject(res)
-				}
-			},
-			fail: res => {
-				reject(res)
-			}
-		})
-	});
+    return new Promise((resolve, reject) => {
+        let header = {
+            'Content-Type': 'application/json',
+            'tenant': 'MDAwMA==',
+        }
+        uni.request({
+            url: url,
+            data: data,
+            method: method,
+            header: header,
+            success: res => {
+                if (res.data.code === "200" || data.code === "") {
+                    resolve(res.data)
+                } else {
+                    reject(res)
+                }
+            },
+            fail: res => {
+                reject(res)
+            }
+        })
+    });
+}
+
+// refreshToken
+const refreshToken = () => {
+    // 防抖
+    if(antiShake) return
+    antiShake = true
+    setTimeout(()=>{
+        antiShake = false
+    },3000)
+    return new Promise((resolve, reject) => {
+        let header = {
+            "Content-Type": "application/json"
+        }
+        const res = uni.getStorageSync('storage_key');
+        const token = res.token
+        if (token) {
+            header['Authorization'] = token
+        }
+        const data = {
+            refreshToken: res.refreshToken
+        }
+        console.log("原有token过期,请求refreshToken")
+        uni.request({
+            url: API.RefreshToken,
+            data: data,
+            method: "POST",
+            header: header,
+            success: res => {
+                if (res.statusCode == 200) {
+                    if (res.data.code === "200" || res.data.code === "") {
+                        resolve(res.data.data)
+                        uni.setStorageSync('storage_key', res.data.data);
+                        return
+                    }
+                }
+                reject()
+                goLogin()
+            },
+            fail: res => {
+                reject(res)
+                goLogin()
+            }
+        })
+    });
+}
+
+const goLogin = () => {
+    uni.removeStorageSync("storage_key")
+    uni.navigateTo({
+        url: '/pages_category_page2/userModule/login'
+    })
 }
 
 module.exports = {
-	request: request,
-	request1: request1
+    request: request,
+    request1: request1
 }