Commit c2c3d49e by wangzhihui

fixed

1 parent 52f9ae33
......@@ -79,14 +79,12 @@ Component({
cancel:点击选择按钮的操作;只有选中后,取消才可以触发
*/
watchAllChose(index, cancel) {
async watchAllChose(index, cancel) {
let {
goodsList,
strTemp
} = this.data;
let result = goodsList[index].multipleSpecificationsGoods.specificationList.every(item => item.value)
console.log(result, goodsList[index], 1)
if (result) {
if (!cancel) {
let arr = []
......@@ -95,16 +93,40 @@ Component({
})
let str = arr.join(';~;')
// strTemp用来存储上一次选中的值,判断规格是否重新选择 ,避免页面交互闪烁
// if (type && str != strTemp) {
//获取该规格的商品是否存在
console.log(str)
goodsList[index].multipleSpecificationsGoods.skuGoodsList=[]
if (goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]) {
goodsList[index].active = true
console.log(goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str], 'str')
goodsList[index].multipleSpecificationsGoods.goods = goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]
goodsList[index].multipleSpecificationsGoods.goods.goodsId = goodsList[index].multipleSpecificationsGoods.goods.merchantGoodsId
goodsList[index].multipleSpecificationsGoods.goods.specificationStr = goodsList[index].multipleSpecificationsGoods.goods.specificationData.replace(/;~;/g, '/')
goodsList[index].active = false
let goodsArr = goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]
goodsArr.forEach(item => {
item.count = 1
item.active = false
item.goodsId = item.merchantGoodsId
item.specificationStr = item.specificationData.replace(/;~;/g, '/')
})
goodsList[index].multipleSpecificationsGoods.skuGoodsList = goodsArr
let chooseList = await this.getChooseList(false);
this.setData({
show: false,
goodsList
},()=>{
let thisPage = wx.$router.getPageInstance();
thisPage.setData({
skuGoodsData: goodsList[index],
skuGoodsBox: true,
goodsList: chooseList
})
thisPage?.setGoodsTotal && thisPage.setGoodsTotal(chooseList);
});
// let thisPage = wx.$router.getPageInstance();
// thisPage.setData({
// skuGoodsData: goodsList[index],
// skuGoodsBox: true
// })
// goodsList[index].multipleSpecificationsGoods.goods = goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]
// goodsList[index].multipleSpecificationsGoods.goods.goodsId = goodsList[index].multipleSpecificationsGoods.goods.merchantGoodsId
// goodsList[index].multipleSpecificationsGoods.goods.specificationStr = goodsList[index].multipleSpecificationsGoods.goods.specificationData.replace(/;~;/g, '/')
} else {
console.log(88888)
wx.$util.showToast('暂无该规格商品')
......@@ -182,10 +204,10 @@ Component({
}
}
//初始化进来不显示标识
if (!s.isFlag) {
// if (!s.isFlag) {
if (s.multipleSpecificationsGoods && e.multipleSpecificationsGoods) {
if (s.multipleSpecificationsGoods.id == e.multipleSpecificationsGoods.id) {
e.active = true
// e.active = true
e.count = s.count
// e.multipleSpecificationsGoods.goods = JSON.parse(JSON.stringify(s.multipleSpecificationsGoods.goods))
// e.multipleSpecificationsGoods.goods.goodsId = JSON.parse(JSON.stringify(s.multipleSpecificationsGoods.goods.merchantGoodsId))
......@@ -195,14 +217,14 @@ Component({
// }
}
}
}
//多规格初始化不需要回显逻辑
// }
})
})
}
console.log(goodsList,'goodsList999')
this.setData({
goodsList,
// recordList
......@@ -268,7 +290,7 @@ Component({
return acc;
}, []);
},
async getChooseList() {
async getChooseList(isValid) {
let {
goodsList,
chooseGoodsList,
......@@ -281,12 +303,14 @@ Component({
chooseList.push(e)
}
});
if (!chooseList?.length) return wx.$util.showToast("请勾选商品");
//处理多规格选择重复商品时,数量相加逻辑
console.log(chooseGoodsList.length, 'chooseGoodsList.length')
if (chooseGoodsList.length > 0) {
await this.addMMultipleSpecificationsGoods(chooseList, chooseGoodsList)
if(isValid){
if (!chooseList?.length) return wx.$util.showToast("请勾选商品");
}
//处理多规格选择重复商品时,数量相加逻辑
// if (chooseGoodsList.length > 0) {
// await this.addMMultipleSpecificationsGoods(chooseList, chooseGoodsList)
// }
// debugger
let arr = this.removeDuplicates(
......@@ -441,8 +465,8 @@ Component({
if (value < 1) value = 1;
if (value > 999) value = 999;
this.setData({
[target]: Number(value),
},
[target]: Number(value),
},
() => {
this.synchronousChange(this.data.goodsList[ind])
}
......@@ -497,7 +521,7 @@ Component({
});
},
async confirm() {
let chooseList = await this.getChooseList();
let chooseList = await this.getChooseList(true);
console.log(chooseList, '99999')
let {
goodsList
......
// packageEquity/pages/carQuotation/components/skuGoods/Goods.js
Component({
/**
* 组件的属性列表
*/
properties: {
//1:精品升级 0 会员权益
sceneType: {
type: String,
},
show: {
type: Boolean,
observer: function () {
}
},
goodsData: {
type: Object,
observer: function (n) {
console.log(n, '999', this.data.chooseGoodsList)
this.setGoodsActive();
}
},
chooseGoodsList: {
type: Array,
observer: function (n) {
// this.setGoodsActive();
},
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
setGoodsActive() {
//同步数量
let {
chooseGoodsList,
goodsData
} = this.data;
goodsData.multipleSpecificationsGoods.skuGoodsList.forEach(c => {
if (chooseGoodsList.length > 0) {
chooseGoodsList.map(x => {
if (x.goodsFlag == 2) {
if (x.multipleSpecificationsGoods.goods && x.multipleSpecificationsGoods.goods.goodsId == c.goodsId) {
c.count = x.count || 0
}
}
})
}
})
this.setData({
goodsData
})
},
hidePopup() {
this.setData({
show: false
})
this.triggerEvent('cancel')
},
choose(e) {
let {
item,
index
} = e.currentTarget.dataset
let {
goodsData
} = this.data
let {
active
} = item
//全部取消选择
goodsData.multipleSpecificationsGoods.skuGoodsList.forEach(item => item.active = false)
goodsData.multipleSpecificationsGoods.skuGoodsList[index].active = !active
this.setData({
goodsData
})
},
input(e) {
let {
index
} = e.currentTarget.dataset
let {
goodsData
} = this.data
console.log(e)
let {
value
} = e.detail
if (value < 1) value = 1
if (value > 999) value = 999
goodsData.multipleSpecificationsGoods.skuGoodsList[index].count = value
this.setData({
goodsData
})
},
getChooseList() {
let {
chooseGoodsList,
goodsData
} = this.data;
console.log(chooseGoodsList, goodsData)
let chooseList = [],
selectList = []
goodsData.multipleSpecificationsGoods.skuGoodsList.forEach(c => {
if (c.active) {
//构建多规格需要的数据格式
selectList.push({
active: true,
count: c.count,
goods: null,
goodsFlag: 2,
isFlag: true,
multipleSpecificationsGoods: {
baseGoodsName: goodsData.multipleSpecificationsGoods.baseGoodsName,
id: goodsData.multipleSpecificationsGoods.id,
specificationGoodsMap: goodsData.multipleSpecificationsGoods.specificationGoodsMap,
specificationList: goodsData.multipleSpecificationsGoods.specificationList,
goods: c
}
})
}
})
console.log(selectList, 'selectList')
//精品升级需要处理数量,会员权益不需要
if (selectList.length) {
selectList.forEach(c => {
if (!c.count) c.count = 1
c.multipleSpecificationsGoods.goods.price = c.multipleSpecificationsGoods.goods.sellPrice || 0
if (chooseGoodsList.length > 0) {
chooseGoodsList.map(x => {
if (x.goodsFlag == 2&&x.multipleSpecificationsGoods) {
console.log(x.multipleSpecificationsGoods.goods && x.multipleSpecificationsGoods.goods.goodsId == c.multipleSpecificationsGoods.goods.goodsId, 'x.multipleSpecificationsGoods.goods && x.multipleSpecificationsGoods.goods.goodsId == c.multipleSpecificationsGoods.goods.goodsId')
if (x.multipleSpecificationsGoods.goods && x.multipleSpecificationsGoods.goods.goodsId == c.multipleSpecificationsGoods.goods.goodsId) {
console.log(c)
//精品升级需要处理数量,会员权益不需要
x.count = c.multipleSpecificationsGoods.goods.count || 0
}
}
})
let arr = chooseGoodsList.filter(item => item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods)
console.log(arr)
selectList.forEach(oldval => {
if (oldval.multipleSpecificationsGoods) {
if (!arr.some(newVal => newVal.multipleSpecificationsGoods.goods.goodsId == oldval.multipleSpecificationsGoods.goods.goodsId)) {
chooseList.push(oldval)
}
}
})
} else {
chooseList = selectList
}
})
}
console.log(chooseList, 'chooseList')
chooseList = chooseList.concat(chooseGoodsList)
console.log(chooseList, 'chooseList')
return [selectList, chooseList]
},
confirm() {
let [selectList, chooseList] = this.getChooseList()
console.log(selectList, chooseList)
if (!selectList.length) return wx.$util.showToast('请勾选商品')
this.triggerEvent('confirm', chooseList)
let thisPage = wx.$router.getPageInstance()
if (this.data.sceneType == 1) {
thisPage.setData({
goodsList: chooseList,
});
thisPage?.setGoodsTotal && thisPage.setGoodsTotal(chooseList);
} else {
thisPage.setData({
['orderInfo.vdQuotationGoodsList']: chooseList
}, () => {
//会员权益
thisPage.totalFee()
})
}
this.setData({
show: false
})
},
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageEquity/pages/carQuotation/components/skuGoods/Goods.wxss */
.title {
width: 100%;
font-weight: 500;
font-size: 32rpx;
color: #222222;
text-align: center;
line-height: 48rpx;
padding: 32rpx 0;
border-bottom: 1rpx solid #EBEDF0;
}
.tips {
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 36rpx;
text-align: center;
padding: 20rpx 0;
}
.goods {
margin: 0 24rpx;
max-height:700rpx;
overflow-Y:scroll;
}
.goods .active {
background: #347bff14!important;
border: 2rpx solid #347BFF;
}
.goods .item-wrap {
background: #F7F8FA;
border-radius: 12rpx;
display: flex;
align-items: center;
padding: 24rpx;
box-sizing: border-box;
min-height: 184rpx;
margin-bottom:16rpx;
}
.item-wrap .icon {
display: block;
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: 20rpx;
}
.item-wrap.active {
color: #347BFF;
}
.item-wrap .icon .arc {
width: var(--fontSize32);
height: var(--fontSize32);
border: var(--fontSize2) solid #979797;
border-radius: 100%;
box-sizing: border-box;
}
.value {
width: calc(100% - 56rpx);
}
.value .alias {
font-weight: 400;
font-size: 24rpx;
color: #222222;
line-height: 36rpx;
margin-bottom: 16rpx;
}
.bottom_box {
display: flex;
align-items: center;
justify-content: space-between;
}
.bottom_box .left {
margin-right:8rpx;
}
.bottom_box .left .name {
font-weight: 400;
font-size: 28rpx;
color: #EA6612;
margin-bottom: 8rpx;
}
.bottom_box .left .position {
font-weight: 400;
font-size: 24rpx;
color: #9B9B9E;
line-height: 36rpx;
}
.right {
display: flex;
align-items: center;
font-weight: 400;
font-size: 28rpx;
color: #333333;
}
.right .price-box {
display: flex;
align-items: center;
margin-right: 16rpx;
}
.input {
width: 84rpx;
height: 72rpx;
background: #FFFFFF;
border: 2rpx solid #EFF0F2;
border-radius: 12rpx;
}
.popup-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--fontSize20) var(--fontSize32) ;
}
.popup-footer.isFullSucreen {
padding-bottom: var(--fontSize68) !important;
}
.popup-footer .btn {
width: var(--fontSize330);
height: var(--fontSize80);
box-sizing: border-box;
border-radius: var(--fontSize12);
font-size: var(--fontSize32);
}
.popup-footer .cancel {
/* color: #323233;
border: var(--fontSize2) solid #DCDEE0; */
color: #292D33;
background: #F7F8FA;
}
.popup-footer .confirm {
background: #347BFF;
color: #fff;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file
<van-popup custom-style="min-height: 280px;width:var(--fontSize686);" round z-index="999999" custom-class="popclass" bind:click-overlay="closeMenu" bind:before-enter="hideTabBar" bind:after-leave="showTabBar" show="{{ show }}">
<view class="title">确认需购买的商品</view>
<view class="tips">温馨提示:请根据实际需求选择正确的价格方案</view>
<view class="goods">
<view class="item-wrap {{i.active?'active':''}}" wx:for="{{goodsData.multipleSpecificationsGoods.skuGoodsList}}" wx:key="ind" wx:for-index="index" wx:for-item="i">
<view class="icon" catchtap="choose" data-index="{{index}}" data-item="{{i}}">
<block wx:if="{{i.active}}">
<image src="./images/radio.png" />
</block>
<block wx:else>
<view class="arc" />
</block>
</view>
<view class="value">
<view class="alias" wx:if="{{i.goodsAlias}}">
商品别名:{{i.goodsAlias}}
</view>
<view class="bottom_box">
<view class="left">
<view class="name">{{goodsData.multipleSpecificationsGoods.baseGoodsName}}</view>
<view class="position" wx:if="{{ i.specificationStr }}">{{i.specificationStr}}</view>
</view>
<view class="right">
<view class="price-box">
<text>¥</text>
<view class="price">
<!-- {{i}} -->
{{i.sellPrice}}
</view>
</view>
<view style="display:flex;align-items: center;" wx:if="{{i.active&&sceneType==1}}" >x <input type="number" catchtap="noScroll"class="input" value="{{i.count || 1}}" catchinput="input" data-index="{{index}}" data-item="{{i}}" /></view>
<view class="count" catchtap="showPopup" wx:else data-show-name="goodsBox">x{{i.count||1}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="popup-footer {{ isFullSucreen?'isFullSucreen':'' }}">
<view class="cancel btn text-center" bind:tap="hidePopup">取消</view>
<view class="confirm btn text-center" bind:tap="confirm">确认</view>
</view>
</van-popup>
\ No newline at end of file
......@@ -79,7 +79,7 @@ Component({
this.watchAllChose(index, true)
})
},
watchAllChose(index, type) {
async watchAllChose(index, type) {
let {
goodsList,
recordList,
......@@ -100,19 +100,37 @@ Component({
goodsList[index].active = true
// strTemp用来存储上一次选中的值,判断规格是否重新选择 ,避免页面交互闪烁
// if (type && str != strTemp) {
if( goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]){
goodsList[index].multipleSpecificationsGoods.goods = goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]
goodsList[index].multipleSpecificationsGoods.goods.goodsId = goodsList[index].multipleSpecificationsGoods.goods.merchantGoodsId
goodsList[index].multipleSpecificationsGoods.goods.specificationStr = goodsList[index].multipleSpecificationsGoods.goods.specificationData.replace(/;~;/g, '/')
recordList.forEach(record => {
if (record.goodsFlag == 2) {
if (goodsList[index].multipleSpecificationsGoods.id ==record.multipleSpecificationsGoods.id) {
record.active=true
record.multipleSpecificationsGoods = goodsList[index].multipleSpecificationsGoods
}
}
console.log(str)
console.log(goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str])
goodsList[index].multipleSpecificationsGoods.skuGoodsList=[]
if (goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]) {
goodsList[index].active = false
console.log(goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str], 'str')
let goodsArr = goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]
goodsArr.forEach(item => {
item.count = 1
item.active = false
item.goodsId = item.merchantGoodsId
item.specificationStr = item.specificationData.replace(/;~;/g, '/')
})
goodsList[index].multipleSpecificationsGoods.skuGoodsList = goodsArr
let chooseList = await this.getChooseList(false);
this.setData({
show: false,
goodsList
},()=>{
let thisPage = wx.$router.getPageInstance();
let secondPage = thisPage.selectComponent(`#SecondStep`)
thisPage.setData({
['orderInfo.vdQuotationGoodsList']: chooseList
}, () => {
thisPage.totalFee()
})
secondPage.setData({
skuGoodsData: goodsList[index],
skuGoodsBox: true
})
});
}else{
wx.$util.showToast('暂无该规格商品')
goodsList[index].active=false
......@@ -324,7 +342,6 @@ Component({
chooseGoodsList
} = this.data
let chooseList = []
console.log(recordList,chooseGoodsList,'999999')
recordList.map(c => {
if (c.active) {
if (c.goods) {
......@@ -392,12 +409,10 @@ Component({
let arr = chooseList.filter(item => item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods)
chooseGoodsList.forEach(oldval => {
if (oldval.multipleSpecificationsGoods) {
if (!arr.some(newVal => newVal.multipleSpecificationsGoods.goods.goodsId == oldval.multipleSpecificationsGoods.goods.goodsId))
chooseList.push(oldval)
}
})
console.log(chooseList, 'chooseList')
return chooseList
},
choose(e) {
......@@ -522,7 +537,6 @@ Component({
},
confirm() {
let chooseList = this.getChooseList()
// console.log(chooseList, 'chooseList');
let {
goodsList
} = this.data
......
......@@ -8,6 +8,7 @@
"van-checkbox": "@vant/weapp/checkbox/index",
"popup-input": "../PopupInput/PopupInput",
"goods": "../GoodsPackage/Goods",
"sku-goods": "/components/SkuGoods/Goods",
"date-select":"/components/DateSelect/dateSelect"
}
}
\ No newline at end of file
......@@ -30,7 +30,7 @@
<view class="price-box">
<text>¥</text>
<view class="price">
<input type="digit" value="{{ item.goods.price }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.checkError ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
<input type="digit" value="{{ item.goods.price }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0||item.goods.goodsPriceModify }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.checkError ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view>
......@@ -51,7 +51,7 @@
<view class="price-box">
<text>¥</text>
<view class="price">
<input type="digit" value="{{ child.price }}" bindinput="changePricePackage" disabled="{{ orderObj.selectPayType ==0 }}" data-childind="{{ childind }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ child.checkError ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
<input type="digit" value="{{ child.price }}" bindinput="changePricePackage" disabled="{{ orderObj.selectPayType ==0 ||child.goodsPriceModify}}" data-childind="{{ childind }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ child.checkError ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{child.count||1}}</view>
......@@ -77,7 +77,7 @@
<view class="price-box">
<text>¥</text>
<view class="price">
<input type="digit" value="{{item.multipleSpecificationsGoods.goods.price}}" bindinput="changeSpecific" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.multipleSpecificationsGoods.goods.checkError ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
<input type="digit" value="{{item.multipleSpecificationsGoods.goods.price}}" bindinput="changeSpecific" disabled="{{ orderObj.selectPayType ==0||item.multipleSpecificationsGoods.goods.goodsPriceModify }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.multipleSpecificationsGoods.goods.checkError ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view>
......@@ -151,4 +151,5 @@
<Gl-Button-Group bindbtnTap="btnTap" textNameObj="{{ textNameObj }}" />
</view>
<goods show="{{ goodsBox }}" wx:if="{{goodsBox}}" bindconfirm="chooseGoods" goodsData="{{ quotationGoodsList }}" chooseGoodsList="{{ orderInfo.vdQuotationGoodsList }}" />
<sku-goods show="{{ skuGoodsBox }}" wx:if="{{skuGoodsBox}}" sceneType="0" goodsData="{{ skuGoodsData }}" chooseGoodsList="{{ orderInfo.vdQuotationGoodsList }}"></sku-goods>
<date-select show="{{ showDateSelect }}" bind:close="closeDateModal" selectPay="{{orderInfo.payType}}" bind:confirm="onChanteSuccessDate"></date-select>
\ No newline at end of file
......@@ -280,7 +280,10 @@ Page({
supplementaryFlag: true
}) // 补录订单标识
// 获取保险信息
let { outTradeNo, userInfo } = this.data
let {
outTradeNo,
userInfo
} = this.data
let orderInfo = this.getInsurance()
let owner = this.getOwnerInfo()
owner.salesType = owner.salesType == '售后' ? 1 : 0
......@@ -697,7 +700,7 @@ Page({
item = item.multipleSpecificationsGoods.goods
const obj = {
goodsId: item.merchantGoodsId,
goodsName: item.upgradeGoodsName||item.goodsName,
goodsName: item.upgradeGoodsName || item.goodsName,
goodsNameAlias: item.goodsAlias || item.goodsNameAlias,
specificationsName: item.specificationNameSequence,
specificationsValue: item.specificationData ?
......@@ -733,7 +736,9 @@ Page({
// 获取保险信息
let orderInfo = this.getInsurance()
let owner = this.getOwnerInfo()
let { userInfo } = this.data
let {
userInfo
} = this.data
owner.salesType = owner.salesType == '售后' ? 1 : 0
orderInfo.owner = owner
orderInfo.check = check
......@@ -868,7 +873,7 @@ Page({
)
wx.hideLoading()
if (code == 0) {
tableInfo.vdQuotationGoodsList =
tableInfo.vdQuotationGoodsList.reduce((pre, item) => {
// 是普通商品
......@@ -886,7 +891,7 @@ Page({
)?.goods?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段
}
pre.push({
goodsFlag:1,
goodsFlag: 1,
goods: obj,
packageGoods: null
})
......@@ -929,7 +934,7 @@ Page({
} else {
pre.push({
goods: null,
goodsFlag:3,
goodsFlag: 3,
price: item.price,
packageGoods: {
...item,
......@@ -942,10 +947,9 @@ Page({
}
}
//多规格商品
if (!item.packageName&&item.specificationsValue) {
console.log(item)
if (!item.packageName && item.specificationsValue) {
let specificdata = this.handleSpecificationsEcho(item)
pre.push(specificdata)
pre= pre.concat(specificdata)
}
// item.price =
......@@ -981,38 +985,43 @@ Page({
.catch(err => {})
},
handleSpecificationsEcho(item) {
let {quotationGoodsList} = this.data,
let {
quotationGoodsList
} = this.data, skuArr = [],
arr = item.specificationsValue.split('/'),
str = arr.join(';~;'),
str = arr.join(';~;'),
obj = {
goodsFlag:2,
goodsFlag: 2,
goods: null,
};
quotationGoodsList.forEach(data => {
if (data.goodsFlag == 2) {
let tempData = data.multipleSpecificationsGoods.specificationGoodsMap[str]
if (tempData) {
if (tempData.merchantGoodsId == item.goodsId) {
tempData.price = this.divideByHundred(item.goodsPrice)
tempData.goodsId= item.goodsId
tempData.specificationStr=item.specificationsValue
data.multipleSpecificationsGoods.goods = tempData
data.multipleSpecificationsGoods.baseGoodsName = item.goodsName
data.multipleSpecificationsGoods.specificationList.forEach((value, index) => {
value.value = arr[index]
})
tempData.forEach(temp => {
if (temp.merchantGoodsId == item.goodsId) {
temp.price = this.divideByHundred(item.goodsPrice)
temp.goodsId = item.goodsId
temp.specificationStr = item.specificationsValue
data.multipleSpecificationsGoods.goods = temp
data.multipleSpecificationsGoods.baseGoodsName = item.goodsName
data.multipleSpecificationsGoods.specificationList.forEach((value, index) => {
value.value = arr[index]
})
obj.multipleSpecificationsGoods = data.multipleSpecificationsGoods
}
obj.multipleSpecificationsGoods = data.multipleSpecificationsGoods
skuArr.push(obj)
}
})
}
}
})
console.log(obj)
return obj
console.log(skuArr)
return skuArr
},
totalFee() {
let {
......
......@@ -52,22 +52,22 @@ Page({
phoneShow: false,
customerInfoBox: false,
payTypeList: [{
name: "门店收款",
value: 2,
},
{
name: "POS机",
value: 3,
},
{
name: '嘀加收款',
value: 5
},
{
name: "微信支付",
value: 1,
imgurl: "../../images/wxPayIcon.png",
},
name: "门店收款",
value: 2,
},
{
name: "POS机",
value: 3,
},
{
name: '嘀加收款',
value: 5
},
{
name: "微信支付",
value: 1,
imgurl: "../../images/wxPayIcon.png",
},
],
showPayList: [],
payeeList: [{
......@@ -124,19 +124,117 @@ Page({
baseConfigData: {},
showSource: false,
Sourcecolumns: [{
type: 0,
name: "售前",
},
{
type: 1,
name: "售后",
},
type: 0,
name: "售前",
},
{
type: 1,
name: "售后",
},
],
packageBox: false,
skuGoodsBox: false,
djPayList: [], // 嘀加收款方对应支付方式
merchantPayList: [], // 门店收款方对应支付方式
configPayTypeList: [], // 园区店配置支持的支付方式
recordOrderFlag: true // 补录订单入口标识
recordOrderFlag: true, // 补录订单入口标识
skuGoodsData: {
active: true,
count: 1,
goods: null,
goodsFlag: 2,
isFlag: true,
multipleSpecificationsGoods: {
skuGoodsList: [{
count: 1,
active: true,
errorTarget: false,
goodsAlias: "别名001",
goodsId: 15961,
lastOnShelfTime: 1747903884000,
maxSuitCarPrice: null,
merchantGoodsCode: "MG2025052215304361811",
merchantGoodsId: 15961,
merchantGoodsPosition: null,
minSellPrice: 1,
minSuitCarPrice: null,
position: null,
price: 4,
sellPrice: 4,
specificationData: "111111111;~;红色;~;超大大大;~;烦躁",
specificationNameSequence: "型号;~;颜色;~;规格;~;上班",
specificationStr: "111111111/红色/超大大大/烦躁",
specificationTypeSequence: "0;~;0;~;0;~;0",
upgradeGoodsAlias: null,
upgradeGoodsId: 6119,
upgradeGoodsName: "0522ymt其他精品002",
upgradeGoodsPosition: null,
upgradeGoodsServiceItemsList: null,
upgradeGoodsType: null,
upgradeGoodsTypeName: null,
validMinSellPrice: "N"
}, {
count: 1,
errorTarget: false,
goodsAlias: "别名001",
goodsId: 15969,
lastOnShelfTime: 1747903884000,
maxSuitCarPrice: null,
merchantGoodsCode: "MG2025052215304361811",
merchantGoodsId: 15961,
merchantGoodsPosition: null,
minSellPrice: 1,
minSuitCarPrice: null,
position: null,
price: 4,
sellPrice: 4,
specificationData: "111111111;~;红色;~;超大大大;~;烦躁",
specificationNameSequence: "型号;~;颜色;~;规格;~;上班",
specificationStr: "111111111/红色/超大大大/烦躁",
specificationTypeSequence: "0;~;0;~;0;~;0",
upgradeGoodsAlias: null,
upgradeGoodsId: 6119,
upgradeGoodsName: "0522ymt其他精品002",
upgradeGoodsPosition: null,
upgradeGoodsServiceItemsList: null,
upgradeGoodsType: null,
upgradeGoodsTypeName: null,
validMinSellPrice: "N"
},
{
count: 1,
active: true,
errorTarget: false,
goodsAlias: "别名001",
goodsId: 15960,
lastOnShelfTime: 1747903884000,
maxSuitCarPrice: null,
merchantGoodsCode: "MG2025052215304361811",
merchantGoodsId: 15961,
merchantGoodsPosition: null,
minSellPrice: 1,
minSuitCarPrice: null,
position: null,
price: 4,
sellPrice: 4,
specificationData: "111111111;~;红色;~;超大大大;~;烦躁",
specificationNameSequence: "型号;~;颜色;~;规格;~;上班",
specificationStr: "111111111/红色/超大大大/烦躁",
specificationTypeSequence: "0;~;0;~;0;~;0",
upgradeGoodsAlias: null,
upgradeGoodsId: 6119,
upgradeGoodsName: "0522ymt其他精品002",
upgradeGoodsPosition: null,
upgradeGoodsServiceItemsList: null,
upgradeGoodsType: null,
upgradeGoodsTypeName: null,
validMinSellPrice: "N"
}
],
baseGoodsName: '太阳膜'
},
packageGoods: null
}, //多规格商品数据
},
closeTips() {
this.setData({
......@@ -383,7 +481,12 @@ Page({
value
},
} = e.currentTarget.dataset
let { isErrorOrder, switchVlaue, merchantPayList, djPayList } = this.data
let {
isErrorOrder,
switchVlaue,
merchantPayList,
djPayList
} = this.data
if (isErrorOrder || switchVlaue) return
this.setData({
["orderObj.payeeType"]: value,
......@@ -472,8 +575,8 @@ Page({
goodsList[index].totalPrice = wx.$util.decimal(total, 2);
this.setData({
goodsList,
},
goodsList,
},
() => {
this.setGoodsTotal(goodsList);
}
......@@ -755,10 +858,10 @@ Page({
// return
let apiName =
save && !isErrorOrder ?
"createPrerecordedOrder" :
isErrorOrder ?
"correctionOrder" :
"createWithPay";
"createPrerecordedOrder" :
isErrorOrder ?
"correctionOrder" :
"createWithPay";
apiName = orderCreateType == 'additionRecordOrder' ? 'supplementOrder' : apiName
// 太阳膜下单入口
submitObj.filmOrder = 0;
......@@ -1505,6 +1608,7 @@ Page({
})
}
if (e && !e.packageName) {
console.log(e.specificationData, e, e.specificationData.indexOf(';~;') > -1)
if (e.specificationData.indexOf(';~;') > -1) {
// 修复取值字段名字错误问题
if (!e.price) {
......@@ -1520,12 +1624,11 @@ Page({
e.count = e.number;
e.merchantGoodsId = e.merchantGoodsId || e.id;
let specificdata = this.handleSpecificationsEcho(e)
chooseList.push(specificdata)
chooseList= chooseList.concat(specificdata)
}
}
});
}
console.log(chooseList, 'chooseList')
this.setData({
goodsList: chooseList,
first: false,
......@@ -1533,7 +1636,7 @@ Page({
this.setGoodsTotal(chooseList);
},
handleSpecificationsEcho(item) {
console.log(item)
let skuArr = [];
let {
otherProduct
} = this.data,
......@@ -1550,26 +1653,30 @@ Page({
if (data.goodsFlag == 2) {
let tempData = data.multipleSpecificationsGoods.specificationGoodsMap[str]
if (tempData) {
if (tempData.merchantGoodsId == item.goodsId) {
obj.multipleSpecificationsGoods = {
...data.multipleSpecificationsGoods,
baseGoodsName: item.goodsName || item.upgradeGoodsName,
goods: {
...tempData,
price: item.price,
sellPrice: item.price,
goodsId: item.goodsId,
specificationStr: item.specificationData.replace(/;~;/g, '/')
tempData.forEach(temp => {
if (temp.merchantGoodsId == item.goodsId) {
obj.multipleSpecificationsGoods = {
...data.multipleSpecificationsGoods,
baseGoodsName: item.goodsName || item.upgradeGoodsName,
goods: {
...temp,
price: item.price,
sellPrice: item.price,
goodsId: item.goodsId,
specificationStr: item.specificationData.replace(/;~;/g, '/')
}
}
skuArr.push(obj)
}
}
})
}
}
})
console.log(obj)
return obj
console.log(skuArr)
return skuArr
},
divideByHundred: str => {
let floatVal = parseFloat(str)
......@@ -1639,7 +1746,12 @@ Page({
});
},
settingPayType(orderObj) {
let { configPayTypeList, isErrorOrder, switchVlaue, outTradeArr } = this.data
let {
configPayTypeList,
isErrorOrder,
switchVlaue,
outTradeArr
} = this.data
// 补录或标记错误订单
if (isErrorOrder || switchVlaue) {
this.setData({
......@@ -1742,21 +1854,21 @@ Page({
// isStaff &&
// console.log(isErrorOrder, isAlreadyExistOrder);
!(isErrorOrder || isAlreadyExistOrder) &&
api
.waitinputorder()
.then((result) => {
let {
code,
data
} = result;
this.setTime();
if (code == 0) {
this.setData({
waitInputCount: data.waitInputCount,
});
}
})
.catch((err) => { });
api
.waitinputorder()
.then((result) => {
let {
code,
data
} = result;
this.setTime();
if (code == 0) {
this.setData({
waitInputCount: data.waitInputCount,
});
}
})
.catch((err) => {});
},
async onRoute(res) {
// debugger
......@@ -1885,8 +1997,8 @@ Page({
} else {
wx.$util.showLoading("加载中...");
this.setData({
flag: true,
},
flag: true,
},
() => {
wx.$util.hideLoading();
}
......@@ -1944,15 +2056,15 @@ Page({
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { },
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { },
onShareAppMessage: function () {},
});
\ No newline at end of file
......@@ -5,6 +5,7 @@
"merchant-seles": "/components/Merchant-Seles/Merchant-Seles",
"coupon": "/components/Coupon/Coupon",
"goods": "/components/Goods/Goods",
"sku-goods": "/components/SkuGoods/Goods",
"customerInfo": "/components/CustomerInfo/CustomerInfo",
"sub-shop-merchant": "/components/subShopMerchant/subShopMerchant",
"van-picker": "@vant/weapp/picker/index",
......
......@@ -148,7 +148,7 @@
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 ||item.goods.goodsPriceModify}}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="1">x{{item.count}}</view>
</view>
......@@ -181,7 +181,7 @@
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0||item.goods.goodsPriceModify }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view>
......@@ -214,7 +214,7 @@
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 ||item.goods.goodsPriceModify}}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view>
......@@ -247,7 +247,7 @@
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 ||item.goods.goodsPriceModify}}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view>
......@@ -280,7 +280,7 @@
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0||item.goods.goodsPriceModify }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="3">x{{item.count}}</view>
</view>
......@@ -318,7 +318,7 @@
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ g.price }}" class="{{ g.errorTarget? 'error':'' }}" bindinput="changeMealPrice" data-item="{{ g }}" data-gindex="{{ gInx }}" data-index="{{ index }}" always-embed />
<input type="digit" value="{{ g.price }}" disabled="{{g.goodsPriceModify }}" class="{{ g.errorTarget? 'error':'' }}" bindinput="changeMealPrice" data-item="{{ g }}" data-gindex="{{ gInx }}" data-index="{{ index }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="3">x{{item.count}}</view>
</view>
......@@ -352,7 +352,7 @@
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
<input type="digit" value="{{ item.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0||item.goods.goodsPriceModify }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="4">x{{item.count}}</view>
</view>
......@@ -375,10 +375,10 @@
</view>
<view class="bottom_box">
<view class="position" wx:if="{{ item.multipleSpecificationsGoods.goods.specificationStr }}">{{item.multipleSpecificationsGoods.goods.specificationStr}}</view>
<view class="price_count">
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.multipleSpecificationsGoods.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.multipleSpecificationsGoods.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
<input type="digit" value="{{ item.multipleSpecificationsGoods.goods.sellPrice }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0||item.multipleSpecificationsGoods.goods.goodsPriceModify }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.multipleSpecificationsGoods.goods.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="4">x{{item.count}}</view>
</view>
......@@ -472,6 +472,7 @@
<remark-popup wx:if="{{ showRemark }}" show="{{ showRemark }}" bindconfirm="remarkConfirm" placeholder="请填写内容,最多30个字" maxlength="30" value="{{ orderObj.remark }}" />
<coupon id="coupon" show="{{ couponBox }}" class="coupon" orderCreateType="{{ orderCreateType }}" bindconfirm="chooseCoupon" merchantId="{{ orderObj.merchantId }}" customerPhone="{{ orderObj.customer.customerPhone }}" yqMerchantId="{{ orderObj.sellerMerchantId }}" selectPayType="{{ orderObj.selectPayType }}" returnFun="{{ scene }}" />
<goods show="{{ goodsBox }}" bindconfirm="chooseGoods" goodsData="{{ goodsData }}" chooseGoodsList="{{ goodsList }}" isSolarFilm="{{ true }}" baseConfigData="{{ baseConfigData }}" />
<sku-goods show="{{ skuGoodsBox }}" sceneType="1" goodsData="{{ skuGoodsData }}" chooseGoodsList="{{ goodsList }}"></sku-goods>
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" />
<van-popup show="{{ showSource }}" position="bottom" bind:close="onCloseSource">
<van-picker show-toolbar title="客户来源" bind:cancel="onCloseSource" columns="{{ Sourcecolumns }}" value-key="name" bind:confirm="onChangeSource" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!