|
@@ -18,6 +18,12 @@
|
|
|
<mescroll-body class="" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
|
|
|
<u-checkbox-group placement="column" @change="checkboxChange" >
|
|
|
<view v-for="(item,index) in dataList" :key="item.id" class="product">
|
|
|
+ <view class="u-flex logistics">
|
|
|
+ <text v-for="(logis,logisIndex) in item.logisticsTypeList" :key="logisIndex">
|
|
|
+ {{logis|filterLogisticsType}}
|
|
|
+ <text style="margin: 0 5px;" v-if="logisIndex<item.logisticsTypeList.length-1">/</text>
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
<u-swipe-action>
|
|
|
<u-swipe-action-item :show="item.show" :index="index" @click="swipeClick(index)" :options="options">
|
|
|
<view class="swipe-action">
|
|
@@ -211,6 +217,7 @@
|
|
|
// 接口返回的当前页数据列表 (数组)
|
|
|
let curPageData = data.data.rows;
|
|
|
curPageData = curPageData.map( item =>{
|
|
|
+ item.logisticsTypeList = item.logisticsType?.split(",")||[]
|
|
|
item.checked = false
|
|
|
return item
|
|
|
})
|
|
@@ -228,6 +235,7 @@
|
|
|
//设置列表数据
|
|
|
if(page.num == 1) this.dataList = []; //如果是第一页需手动置空列表
|
|
|
this.dataList = this.dataList.concat(curPageData); //追加新数据
|
|
|
+ // console.log('dataList',this.dataList);
|
|
|
// 请求成功,隐藏加载状态
|
|
|
//方法一(推荐): 后台接口有返回列表的总页数 totalPage
|
|
|
// this.mescroll.endByPage(curPageLen, totalPage);
|
|
@@ -318,6 +326,30 @@
|
|
|
},
|
|
|
submitorder(){
|
|
|
// console.log('submitorder',this.selectGoods);
|
|
|
+
|
|
|
+ // 判断是否有相同的收货方式
|
|
|
+ let logis = [];
|
|
|
+ this.selectGoods.forEach(item=>{
|
|
|
+ logis.push(item.logisticsTypeList)
|
|
|
+ })
|
|
|
+ // console.log('logis',logis);
|
|
|
+ const referenceArray = logis[0];
|
|
|
+ // 使用some()方法遍历数组,并判断每个子数组是否存在与参照数组相同的值
|
|
|
+ const result = logis.some(subArray => {
|
|
|
+ // 遍历参照数组的每个元素,判断是否包含在子数组中
|
|
|
+ return referenceArray.some(element => {
|
|
|
+ return subArray.includes(element);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ if (result) {
|
|
|
+ // console.log("每个子数组中至少存在一个相同的值");
|
|
|
+ } else {
|
|
|
+ // console.log("每个子数组中都没有相同的值");
|
|
|
+ uni.$u.toast('只有相同提货方式的商品才能一起结算哦')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ // 判断是否有相同的收货方式结束
|
|
|
+
|
|
|
this.cansubmit = false;
|
|
|
let param = {};
|
|
|
if(!this.hasAddr){
|
|
@@ -407,6 +439,11 @@
|
|
|
.text{
|
|
|
margin-left: 20rpx;
|
|
|
}
|
|
|
+ .logistics{
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #ccc;
|
|
|
+ margin-bottom: 10rpx;
|
|
|
+ }
|
|
|
}
|
|
|
.product:last-child{
|
|
|
margin-bottom: 0;
|