Commit c2c3d49e by wangzhihui

fixed

1 parent 52f9ae33
...@@ -79,14 +79,12 @@ Component({ ...@@ -79,14 +79,12 @@ Component({
cancel:点击选择按钮的操作;只有选中后,取消才可以触发 cancel:点击选择按钮的操作;只有选中后,取消才可以触发
*/ */
watchAllChose(index, cancel) { async watchAllChose(index, cancel) {
let { let {
goodsList, goodsList,
strTemp strTemp
} = this.data; } = this.data;
let result = goodsList[index].multipleSpecificationsGoods.specificationList.every(item => item.value) let result = goodsList[index].multipleSpecificationsGoods.specificationList.every(item => item.value)
console.log(result, goodsList[index], 1)
if (result) { if (result) {
if (!cancel) { if (!cancel) {
let arr = [] let arr = []
...@@ -95,16 +93,40 @@ Component({ ...@@ -95,16 +93,40 @@ Component({
}) })
let str = arr.join(';~;') let str = arr.join(';~;')
// strTemp用来存储上一次选中的值,判断规格是否重新选择 ,避免页面交互闪烁
// if (type && str != strTemp) {
//获取该规格的商品是否存在 //获取该规格的商品是否存在
console.log(str) goodsList[index].multipleSpecificationsGoods.skuGoodsList=[]
if (goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]) { if (goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]) {
goodsList[index].active = true goodsList[index].active = false
console.log(goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str], 'str') let goodsArr = goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]
goodsList[index].multipleSpecificationsGoods.goods = goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str] goodsArr.forEach(item => {
goodsList[index].multipleSpecificationsGoods.goods.goodsId = goodsList[index].multipleSpecificationsGoods.goods.merchantGoodsId item.count = 1
goodsList[index].multipleSpecificationsGoods.goods.specificationStr = goodsList[index].multipleSpecificationsGoods.goods.specificationData.replace(/;~;/g, '/') 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 { } else {
console.log(88888) console.log(88888)
wx.$util.showToast('暂无该规格商品') wx.$util.showToast('暂无该规格商品')
...@@ -182,10 +204,10 @@ Component({ ...@@ -182,10 +204,10 @@ Component({
} }
} }
//初始化进来不显示标识 //初始化进来不显示标识
if (!s.isFlag) { // if (!s.isFlag) {
if (s.multipleSpecificationsGoods && e.multipleSpecificationsGoods) { if (s.multipleSpecificationsGoods && e.multipleSpecificationsGoods) {
if (s.multipleSpecificationsGoods.id == e.multipleSpecificationsGoods.id) { if (s.multipleSpecificationsGoods.id == e.multipleSpecificationsGoods.id) {
e.active = true // e.active = true
e.count = s.count e.count = s.count
// e.multipleSpecificationsGoods.goods = JSON.parse(JSON.stringify(s.multipleSpecificationsGoods.goods)) // e.multipleSpecificationsGoods.goods = JSON.parse(JSON.stringify(s.multipleSpecificationsGoods.goods))
// e.multipleSpecificationsGoods.goods.goodsId = JSON.parse(JSON.stringify(s.multipleSpecificationsGoods.goods.merchantGoodsId)) // e.multipleSpecificationsGoods.goods.goodsId = JSON.parse(JSON.stringify(s.multipleSpecificationsGoods.goods.merchantGoodsId))
...@@ -195,14 +217,14 @@ Component({ ...@@ -195,14 +217,14 @@ Component({
// } // }
} }
} }
} // }
//多规格初始化不需要回显逻辑
}) })
}) })
} }
console.log(goodsList,'goodsList999')
this.setData({ this.setData({
goodsList, goodsList,
// recordList // recordList
...@@ -268,7 +290,7 @@ Component({ ...@@ -268,7 +290,7 @@ Component({
return acc; return acc;
}, []); }, []);
}, },
async getChooseList() { async getChooseList(isValid) {
let { let {
goodsList, goodsList,
chooseGoodsList, chooseGoodsList,
...@@ -281,13 +303,15 @@ Component({ ...@@ -281,13 +303,15 @@ Component({
chooseList.push(e) chooseList.push(e)
} }
}); });
if(isValid){
if (!chooseList?.length) return wx.$util.showToast("请勾选商品"); if (!chooseList?.length) return wx.$util.showToast("请勾选商品");
//处理多规格选择重复商品时,数量相加逻辑
console.log(chooseGoodsList.length, 'chooseGoodsList.length')
if (chooseGoodsList.length > 0) {
await this.addMMultipleSpecificationsGoods(chooseList, chooseGoodsList)
} }
//处理多规格选择重复商品时,数量相加逻辑
// if (chooseGoodsList.length > 0) {
// await this.addMMultipleSpecificationsGoods(chooseList, chooseGoodsList)
// }
// debugger // debugger
let arr = this.removeDuplicates( let arr = this.removeDuplicates(
chooseList.concat(chooseGoodsList), chooseList.concat(chooseGoodsList),
...@@ -497,7 +521,7 @@ Component({ ...@@ -497,7 +521,7 @@ Component({
}); });
}, },
async confirm() { async confirm() {
let chooseList = await this.getChooseList(); let chooseList = await this.getChooseList(true);
console.log(chooseList, '99999') console.log(chooseList, '99999')
let { let {
goodsList 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 \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ 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 \ 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 \ No newline at end of file
...@@ -79,7 +79,7 @@ Component({ ...@@ -79,7 +79,7 @@ Component({
this.watchAllChose(index, true) this.watchAllChose(index, true)
}) })
}, },
watchAllChose(index, type) { async watchAllChose(index, type) {
let { let {
goodsList, goodsList,
recordList, recordList,
...@@ -100,19 +100,37 @@ Component({ ...@@ -100,19 +100,37 @@ Component({
goodsList[index].active = true goodsList[index].active = true
// strTemp用来存储上一次选中的值,判断规格是否重新选择 ,避免页面交互闪烁 // strTemp用来存储上一次选中的值,判断规格是否重新选择 ,避免页面交互闪烁
// if (type && str != strTemp) { // if (type && str != strTemp) {
if( goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]){ console.log(str)
goodsList[index].multipleSpecificationsGoods.goods = goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str] console.log(goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str])
goodsList[index].multipleSpecificationsGoods.goods.goodsId = goodsList[index].multipleSpecificationsGoods.goods.merchantGoodsId goodsList[index].multipleSpecificationsGoods.skuGoodsList=[]
goodsList[index].multipleSpecificationsGoods.goods.specificationStr = goodsList[index].multipleSpecificationsGoods.goods.specificationData.replace(/;~;/g, '/') if (goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]) {
recordList.forEach(record => { goodsList[index].active = false
if (record.goodsFlag == 2) { console.log(goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str], 'str')
if (goodsList[index].multipleSpecificationsGoods.id ==record.multipleSpecificationsGoods.id) { let goodsArr = goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]
record.active=true goodsArr.forEach(item => {
record.multipleSpecificationsGoods = goodsList[index].multipleSpecificationsGoods 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{ }else{
wx.$util.showToast('暂无该规格商品') wx.$util.showToast('暂无该规格商品')
goodsList[index].active=false goodsList[index].active=false
...@@ -324,7 +342,6 @@ Component({ ...@@ -324,7 +342,6 @@ Component({
chooseGoodsList chooseGoodsList
} = this.data } = this.data
let chooseList = [] let chooseList = []
console.log(recordList,chooseGoodsList,'999999')
recordList.map(c => { recordList.map(c => {
if (c.active) { if (c.active) {
if (c.goods) { if (c.goods) {
...@@ -392,12 +409,10 @@ Component({ ...@@ -392,12 +409,10 @@ Component({
let arr = chooseList.filter(item => item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) let arr = chooseList.filter(item => item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods)
chooseGoodsList.forEach(oldval => { chooseGoodsList.forEach(oldval => {
if (oldval.multipleSpecificationsGoods) { if (oldval.multipleSpecificationsGoods) {
if (!arr.some(newVal => newVal.multipleSpecificationsGoods.goods.goodsId == oldval.multipleSpecificationsGoods.goods.goodsId)) if (!arr.some(newVal => newVal.multipleSpecificationsGoods.goods.goodsId == oldval.multipleSpecificationsGoods.goods.goodsId))
chooseList.push(oldval) chooseList.push(oldval)
} }
}) })
console.log(chooseList, 'chooseList')
return chooseList return chooseList
}, },
choose(e) { choose(e) {
...@@ -522,7 +537,6 @@ Component({ ...@@ -522,7 +537,6 @@ Component({
}, },
confirm() { confirm() {
let chooseList = this.getChooseList() let chooseList = this.getChooseList()
// console.log(chooseList, 'chooseList');
let { let {
goodsList goodsList
} = this.data } = this.data
......
// packageEquity/pages/carEquity/components/SecondStep/SecondStep.js // packageEquity/pages/carEquity/components/SecondStep/SecondStep.js
import data from "../constant/stepData"; import data from "../constant/stepData";
// import fn from '../constant/ruleFn' // import fn from '../constant/ruleFn'
import { priceCounter } from "~/packageEquity/api"; import {
priceCounter
} from "~/packageEquity/api";
import NP from "number-precision"; import NP from "number-precision";
const defaultLabelWidth = "var(--fontSize140)"; const defaultLabelWidth = "var(--fontSize140)";
const djPayTypeList = [ const djPayTypeList = [{
{
value: 1, value: 1,
name: "线上支付", name: "线上支付",
}, },
...@@ -18,12 +19,10 @@ const djPayTypeList = [ ...@@ -18,12 +19,10 @@ const djPayTypeList = [
name: "其它收款", name: "其它收款",
}, },
] ]
const merchantPayTypeList = [ const merchantPayTypeList = [{
{
value: 2, value: 2,
name: "门店收款", name: "门店收款",
} }]
]
Component({ Component({
options: { options: {
// styleIsolation: 'apply-shared' // styleIsolation: 'apply-shared'
...@@ -88,8 +87,7 @@ Component({ ...@@ -88,8 +87,7 @@ Component({
// if (value) { // if (value) {
paytype && paytype &&
this.setData({ this.setData({
["textNameObj.confirmName"]: ["textNameObj.confirmName"]: paytype == 1 ? "下一步·去支付(1/2)" : "下一步·上传凭证",
paytype == 1 ? "下一步·去支付(1/2)" : "下一步·上传凭证",
payTypeList: paytype == 2 ? merchantPayTypeList : djPayTypeList payTypeList: paytype == 2 ? merchantPayTypeList : djPayTypeList
}); });
// } // }
...@@ -131,7 +129,8 @@ Component({ ...@@ -131,7 +129,8 @@ Component({
}, },
// '1', '2', '3', // '1', '2', '3',
activeNames: ["1", "2", "3", "4"], activeNames: ["1", "2", "3", "4"],
goodsBox:false, goodsBox: false,
skuGoodsBox: false,
showPicker: false, showPicker: false,
// optionsSelect: Object.freeze(optionsSelect), // optionsSelect: Object.freeze(optionsSelect),
popObj: { popObj: {
...@@ -152,6 +151,8 @@ Component({ ...@@ -152,6 +151,8 @@ Component({
}], }],
payTypeList: djPayTypeList, payTypeList: djPayTypeList,
successDateTime: "", successDateTime: "",
skuGoodsData: {
}, //多规格商品数据
}, },
/** /**
...@@ -159,8 +160,13 @@ Component({ ...@@ -159,8 +160,13 @@ Component({
*/ */
methods: { methods: {
changePrice(e) { changePrice(e) {
let { value } = e.detail; let {
let { index, item } = e.currentTarget.dataset; value
} = e.detail;
let {
index,
item
} = e.currentTarget.dataset;
console.log(item, "item"); console.log(item, "item");
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
let target = `orderInfo.vdQuotationGoodsList[${index}].goods.price`; let target = `orderInfo.vdQuotationGoodsList[${index}].goods.price`;
...@@ -186,9 +192,14 @@ Component({ ...@@ -186,9 +192,14 @@ Component({
this.setGoodsListTotal(); this.setGoodsListTotal();
}, },
//多规格单价修改 //多规格单价修改
changeSpecific(e){ changeSpecific(e) {
let { value } = e.detail; let {
let { index, item } = e.currentTarget.dataset; value
} = e.detail;
let {
index,
item
} = e.currentTarget.dataset;
console.log(item, "item"); console.log(item, "item");
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
let target = `orderInfo.vdQuotationGoodsList[${index}].multipleSpecificationsGoods.goods.price`; let target = `orderInfo.vdQuotationGoodsList[${index}].multipleSpecificationsGoods.goods.price`;
...@@ -199,12 +210,20 @@ Component({ ...@@ -199,12 +210,20 @@ Component({
this.setGoodsListTotal(); this.setGoodsListTotal();
}, },
changePricePackage(e) { changePricePackage(e) {
let { value } = e.detail; let {
let { index, item, childind } = e.currentTarget.dataset; value
} = e.detail;
let {
index,
item,
childind
} = e.currentTarget.dataset;
// console.log(item, 'item'); // console.log(item, 'item');
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
let { let {
orderInfo: { vdQuotationGoodsList }, orderInfo: {
vdQuotationGoodsList
},
} = thisPage.data; } = thisPage.data;
// console.log(childind, 'childind'); // console.log(childind, 'childind');
// console.log(thisPage.data.orderInfo.vdQuotationGoodsList[index].packageGoods.goodsList[childind], 'orderInfo.vdQuotationGoodsList[${index}].packageGoods[${childind}]'); // console.log(thisPage.data.orderInfo.vdQuotationGoodsList[index].packageGoods.goodsList[childind], 'orderInfo.vdQuotationGoodsList[${index}].packageGoods[${childind}]');
...@@ -261,9 +280,13 @@ Component({ ...@@ -261,9 +280,13 @@ Component({
this.setGoodsListTotal(); this.setGoodsListTotal();
}, },
delGoodsList(e) { delGoodsList(e) {
let { index } = e.currentTarget.dataset; let {
index
} = e.currentTarget.dataset;
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
let { orderInfo } = thisPage.data; let {
orderInfo
} = thisPage.data;
// console.log(orderInfo,'orderInfo'); // console.log(orderInfo,'orderInfo');
orderInfo.vdQuotationGoodsList.splice(index, 1); orderInfo.vdQuotationGoodsList.splice(index, 1);
thisPage.setData({ thisPage.setData({
...@@ -274,8 +297,10 @@ Component({ ...@@ -274,8 +297,10 @@ Component({
}, },
setGoodsListTotal() { setGoodsListTotal() {
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
let { orderInfo } = thisPage.data; let {
console.log(orderInfo,'orderInfo'); orderInfo
} = thisPage.data;
console.log(orderInfo, 'orderInfo');
let total = 0; let total = 0;
orderInfo.vdQuotationGoodsList.map((i) => { orderInfo.vdQuotationGoodsList.map((i) => {
if (i.goods) { if (i.goods) {
...@@ -296,7 +321,7 @@ Component({ ...@@ -296,7 +321,7 @@ Component({
}); });
} }
//多规格 //多规格
if(i.multipleSpecificationsGoods){ if (i.multipleSpecificationsGoods) {
if (i.multipleSpecificationsGoods.goods) { if (i.multipleSpecificationsGoods.goods) {
// total += parseFloat(i.goods.count || 1) * parseFloat(i.goods.price) // total += parseFloat(i.goods.count || 1) * parseFloat(i.goods.price)
total = NP.plus( total = NP.plus(
...@@ -320,8 +345,12 @@ Component({ ...@@ -320,8 +345,12 @@ Component({
// chooseGoods // chooseGoods
}, },
showPopup(e) { showPopup(e) {
let { quotationGoodsList } = this.data; let {
let { showName } = e.currentTarget.dataset; quotationGoodsList
} = this.data;
let {
showName
} = e.currentTarget.dataset;
if (showName == "goodsBox" && quotationGoodsList.length < 1) { if (showName == "goodsBox" && quotationGoodsList.length < 1) {
// if (!data.length) // if (!data.length)
return wx.showModal({ return wx.showModal({
...@@ -345,12 +374,18 @@ Component({ ...@@ -345,12 +374,18 @@ Component({
}, },
onChangeInsurance(e) { onChangeInsurance(e) {
console.log(e); console.log(e);
let { detail } = e; let {
let { id } = e.currentTarget.dataset; detail
} = e;
let {
id
} = e.currentTarget.dataset;
if (!detail) return false; if (!detail) return false;
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
// console.log(detail, 'detail') // console.log(detail, 'detail')
let { quotationGoodsList } = this.data; let {
quotationGoodsList
} = this.data;
let goodsItem = quotationGoodsList.find((item) => item.id == id); let goodsItem = quotationGoodsList.find((item) => item.id == id);
let params = thisPage.getInsurance(); let params = thisPage.getInsurance();
...@@ -378,7 +413,11 @@ Component({ ...@@ -378,7 +413,11 @@ Component({
.then((result) => { .then((result) => {
wx.hideLoading(); wx.hideLoading();
console.log("result", result); console.log("result", result);
let { data, code, message } = result; let {
data,
code,
message
} = result;
if (code) { if (code) {
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
...@@ -387,7 +426,10 @@ Component({ ...@@ -387,7 +426,10 @@ Component({
// }) // })
// 如果是补录订单,还要做一个订单最低价格对比 // 如果是补录订单,还要做一个订单最低价格对比
let { orderInfo, totalFee } = thisPage.data; let {
orderInfo,
totalFee
} = thisPage.data;
let minEquityPrice = wx.$util.divideByHundred(data.minEquityPrice); let minEquityPrice = wx.$util.divideByHundred(data.minEquityPrice);
// debugger // debugger
if (orderInfo.outTradeNo && data.minEquityPrice > totalFee) { if (orderInfo.outTradeNo && data.minEquityPrice > totalFee) {
...@@ -431,7 +473,9 @@ Component({ ...@@ -431,7 +473,9 @@ Component({
// 弹出框确认事件 // 弹出框确认事件
onConfirm(e) { onConfirm(e) {
// console.log(e, 1111) // console.log(e, 1111)
let { value } = e.detail; let {
value
} = e.detail;
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
console.log(value, "value"); console.log(value, "value");
thisPage.setData({ thisPage.setData({
...@@ -474,16 +518,12 @@ Component({ ...@@ -474,16 +518,12 @@ Component({
let currentDate = new Date(); let currentDate = new Date();
console.log(currentDate.getFullYear()); console.log(currentDate.getFullYear());
for ( for (
let j = currentDate.getFullYear() - 25; let j = currentDate.getFullYear() - 25; j < currentDate.getFullYear(); j++
j < currentDate.getFullYear();
j++
) { ) {
year.push(j); year.push(j);
} }
for ( for (
let i = currentDate.getFullYear(); let i = currentDate.getFullYear(); i <= currentDate.getFullYear() + 25; i++
i <= currentDate.getFullYear() + 25;
i++
) { ) {
year.push(i); year.push(i);
} }
...@@ -494,10 +534,16 @@ Component({ ...@@ -494,10 +534,16 @@ Component({
}, },
handlePopupShow(e) { handlePopupShow(e) {
// console.log(e) // console.log(e)
let { disable } = this.data; let {
disable
} = this.data;
if (disable) return false; //修改权益价时,不可修改 if (disable) return false; //修改权益价时,不可修改
// let { attrtype, attrname, typename } = e.target.dataset // let { attrtype, attrname, typename } = e.target.dataset
let { attrtype, attrname, typename } = e.currentTarget.dataset; let {
attrtype,
attrname,
typename
} = e.currentTarget.dataset;
console.log(attrtype, attrname, typename, "attrType, attrName"); console.log(attrtype, attrname, typename, "attrType, attrName");
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
let popValue = thisPage.data.orderInfo?.[attrtype]?.[attrname] || ""; let popValue = thisPage.data.orderInfo?.[attrtype]?.[attrname] || "";
...@@ -514,10 +560,15 @@ Component({ ...@@ -514,10 +560,15 @@ Component({
}, },
handlePopInputShow(e) { handlePopInputShow(e) {
// console.log(e) // console.log(e)
let { disable } = this.data; let {
disable
} = this.data;
if (disable) return false; //修改权益价时,不可修改 if (disable) return false; //修改权益价时,不可修改
let { handletype, index } = e.target.dataset; let {
handletype,
index
} = e.target.dataset;
console.log(handletype, index, "type, index"); console.log(handletype, index, "type, index");
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
let popValue = ""; let popValue = "";
...@@ -537,10 +588,17 @@ Component({ ...@@ -537,10 +588,17 @@ Component({
}, },
btnTap(e) { btnTap(e) {
// console.log(e) // console.log(e)
let { name } = e.detail; let {
name
} = e.detail;
// debugger // debugger
// let { attrtype, attrname, typename } = this.data.tableObj // let { attrtype, attrname, typename } = this.data.tableObj
let { showError, insuranceCheck, orderInfo, successDateTime } = this.data; let {
showError,
insuranceCheck,
orderInfo,
successDateTime
} = this.data;
if (successDateTime && !orderInfo.resetOrder) { if (successDateTime && !orderInfo.resetOrder) {
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
const _temp = new Date(successDateTime).format("yyyy-MM-dd hh:mm:ss"); const _temp = new Date(successDateTime).format("yyyy-MM-dd hh:mm:ss");
...@@ -600,9 +658,13 @@ Component({ ...@@ -600,9 +658,13 @@ Component({
}, },
// 切换收款方式 // 切换收款方式
changePayee(e) { changePayee(e) {
let { payee } = e.currentTarget.dataset let {
let { orderInfo } = this.data payee
if (orderInfo.resetOrder||orderInfo.outTradeArr) return } = e.currentTarget.dataset
let {
orderInfo
} = this.data
if (orderInfo.resetOrder || orderInfo.outTradeArr) return
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
thisPage.setData({ thisPage.setData({
["orderInfo.payee"]: payee ["orderInfo.payee"]: payee
...@@ -626,7 +688,9 @@ Component({ ...@@ -626,7 +688,9 @@ Component({
// 切换支付方式 // 切换支付方式
changePayType(e) { changePayType(e) {
console.log(e); console.log(e);
let { paytype } = e.currentTarget.dataset; let {
paytype
} = e.currentTarget.dataset;
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
thisPage.setData({ thisPage.setData({
// ['orderInfo.quotedPriceUpdate']: '', // ['orderInfo.quotedPriceUpdate']: '',
...@@ -639,7 +703,11 @@ Component({ ...@@ -639,7 +703,11 @@ Component({
handleInput(e) { handleInput(e) {
let value = e.detail; let value = e.detail;
console.log(e); console.log(e);
let { attrname, attrtype, type } = e.currentTarget.dataset; let {
attrname,
attrtype,
type
} = e.currentTarget.dataset;
value = type == "number" ? wx.$util.numberFixedDigit(value) : value; value = type == "number" ? wx.$util.numberFixedDigit(value) : value;
if (type == "number") { if (type == "number") {
...@@ -650,7 +718,9 @@ Component({ ...@@ -650,7 +718,9 @@ Component({
// onChangeInsurance // onChangeInsurance
// onChangeInsurance // onChangeInsurance
if (attrname == "quotedPriceUpdate") { if (attrname == "quotedPriceUpdate") {
let { orderInfo } = this.data; let {
orderInfo
} = this.data;
let showError = orderInfo.minEquityPrice <= value ? false : true; let showError = orderInfo.minEquityPrice <= value ? false : true;
this.setData({ this.setData({
showError, showError,
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"van-checkbox": "@vant/weapp/checkbox/index", "van-checkbox": "@vant/weapp/checkbox/index",
"popup-input": "../PopupInput/PopupInput", "popup-input": "../PopupInput/PopupInput",
"goods": "../GoodsPackage/Goods", "goods": "../GoodsPackage/Goods",
"sku-goods": "/components/SkuGoods/Goods",
"date-select":"/components/DateSelect/dateSelect" "date-select":"/components/DateSelect/dateSelect"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<view class="price-box"> <view class="price-box">
<text>¥</text> <text>¥</text>
<view class="price"> <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> </view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<view class="price-box"> <view class="price-box">
<text>¥</text> <text>¥</text>
<view class="price"> <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> </view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{child.count||1}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{child.count||1}}</view>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<view class="price-box"> <view class="price-box">
<text>¥</text> <text>¥</text>
<view class="price"> <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> </view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view>
...@@ -151,4 +151,5 @@ ...@@ -151,4 +151,5 @@
<Gl-Button-Group bindbtnTap="btnTap" textNameObj="{{ textNameObj }}" /> <Gl-Button-Group bindbtnTap="btnTap" textNameObj="{{ textNameObj }}" />
</view> </view>
<goods show="{{ goodsBox }}" wx:if="{{goodsBox}}" bindconfirm="chooseGoods" goodsData="{{ quotationGoodsList }}" chooseGoodsList="{{ orderInfo.vdQuotationGoodsList }}" /> <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> <date-select show="{{ showDateSelect }}" bind:close="closeDateModal" selectPay="{{orderInfo.payType}}" bind:confirm="onChanteSuccessDate"></date-select>
\ No newline at end of file \ No newline at end of file
...@@ -280,7 +280,10 @@ Page({ ...@@ -280,7 +280,10 @@ Page({
supplementaryFlag: true supplementaryFlag: true
}) // 补录订单标识 }) // 补录订单标识
// 获取保险信息 // 获取保险信息
let { outTradeNo, userInfo } = this.data let {
outTradeNo,
userInfo
} = this.data
let orderInfo = this.getInsurance() let orderInfo = this.getInsurance()
let owner = this.getOwnerInfo() let owner = this.getOwnerInfo()
owner.salesType = owner.salesType == '售后' ? 1 : 0 owner.salesType = owner.salesType == '售后' ? 1 : 0
...@@ -697,7 +700,7 @@ Page({ ...@@ -697,7 +700,7 @@ Page({
item = item.multipleSpecificationsGoods.goods item = item.multipleSpecificationsGoods.goods
const obj = { const obj = {
goodsId: item.merchantGoodsId, goodsId: item.merchantGoodsId,
goodsName: item.upgradeGoodsName||item.goodsName, goodsName: item.upgradeGoodsName || item.goodsName,
goodsNameAlias: item.goodsAlias || item.goodsNameAlias, goodsNameAlias: item.goodsAlias || item.goodsNameAlias,
specificationsName: item.specificationNameSequence, specificationsName: item.specificationNameSequence,
specificationsValue: item.specificationData ? specificationsValue: item.specificationData ?
...@@ -733,7 +736,9 @@ Page({ ...@@ -733,7 +736,9 @@ Page({
// 获取保险信息 // 获取保险信息
let orderInfo = this.getInsurance() let orderInfo = this.getInsurance()
let owner = this.getOwnerInfo() let owner = this.getOwnerInfo()
let { userInfo } = this.data let {
userInfo
} = this.data
owner.salesType = owner.salesType == '售后' ? 1 : 0 owner.salesType = owner.salesType == '售后' ? 1 : 0
orderInfo.owner = owner orderInfo.owner = owner
orderInfo.check = check orderInfo.check = check
...@@ -886,7 +891,7 @@ Page({ ...@@ -886,7 +891,7 @@ Page({
)?.goods?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段 )?.goods?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段
} }
pre.push({ pre.push({
goodsFlag:1, goodsFlag: 1,
goods: obj, goods: obj,
packageGoods: null packageGoods: null
}) })
...@@ -929,7 +934,7 @@ Page({ ...@@ -929,7 +934,7 @@ Page({
} else { } else {
pre.push({ pre.push({
goods: null, goods: null,
goodsFlag:3, goodsFlag: 3,
price: item.price, price: item.price,
packageGoods: { packageGoods: {
...item, ...item,
...@@ -942,10 +947,9 @@ Page({ ...@@ -942,10 +947,9 @@ Page({
} }
} }
//多规格商品 //多规格商品
if (!item.packageName&&item.specificationsValue) { if (!item.packageName && item.specificationsValue) {
console.log(item)
let specificdata = this.handleSpecificationsEcho(item) let specificdata = this.handleSpecificationsEcho(item)
pre.push(specificdata) pre= pre.concat(specificdata)
} }
// item.price = // item.price =
...@@ -981,38 +985,43 @@ Page({ ...@@ -981,38 +985,43 @@ Page({
.catch(err => {}) .catch(err => {})
}, },
handleSpecificationsEcho(item) { handleSpecificationsEcho(item) {
let {quotationGoodsList} = this.data,
let {
quotationGoodsList
} = this.data, skuArr = [],
arr = item.specificationsValue.split('/'), arr = item.specificationsValue.split('/'),
str = arr.join(';~;'), str = arr.join(';~;'),
obj = { obj = {
goodsFlag:2, goodsFlag: 2,
goods: null, goods: null,
}; };
quotationGoodsList.forEach(data => { quotationGoodsList.forEach(data => {
if (data.goodsFlag == 2) { if (data.goodsFlag == 2) {
let tempData = data.multipleSpecificationsGoods.specificationGoodsMap[str] let tempData = data.multipleSpecificationsGoods.specificationGoodsMap[str]
if (tempData) { if (tempData) {
if (tempData.merchantGoodsId == item.goodsId) { tempData.forEach(temp => {
tempData.price = this.divideByHundred(item.goodsPrice) if (temp.merchantGoodsId == item.goodsId) {
tempData.goodsId= item.goodsId temp.price = this.divideByHundred(item.goodsPrice)
tempData.specificationStr=item.specificationsValue temp.goodsId = item.goodsId
data.multipleSpecificationsGoods.goods = tempData temp.specificationStr = item.specificationsValue
data.multipleSpecificationsGoods.goods = temp
data.multipleSpecificationsGoods.baseGoodsName = item.goodsName data.multipleSpecificationsGoods.baseGoodsName = item.goodsName
data.multipleSpecificationsGoods.specificationList.forEach((value, index) => { data.multipleSpecificationsGoods.specificationList.forEach((value, index) => {
value.value = arr[index] value.value = arr[index]
}) })
obj.multipleSpecificationsGoods = data.multipleSpecificationsGoods obj.multipleSpecificationsGoods = data.multipleSpecificationsGoods
skuArr.push(obj)
} }
})
} }
} }
}) })
console.log(obj) console.log(skuArr)
return obj return skuArr
}, },
totalFee() { totalFee() {
let { let {
......
...@@ -133,10 +133,108 @@ Page({ ...@@ -133,10 +133,108 @@ Page({
}, },
], ],
packageBox: false, packageBox: false,
skuGoodsBox: false,
djPayList: [], // 嘀加收款方对应支付方式 djPayList: [], // 嘀加收款方对应支付方式
merchantPayList: [], // 门店收款方对应支付方式 merchantPayList: [], // 门店收款方对应支付方式
configPayTypeList: [], // 园区店配置支持的支付方式 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() { closeTips() {
this.setData({ this.setData({
...@@ -383,7 +481,12 @@ Page({ ...@@ -383,7 +481,12 @@ Page({
value value
}, },
} = e.currentTarget.dataset } = e.currentTarget.dataset
let { isErrorOrder, switchVlaue, merchantPayList, djPayList } = this.data let {
isErrorOrder,
switchVlaue,
merchantPayList,
djPayList
} = this.data
if (isErrorOrder || switchVlaue) return if (isErrorOrder || switchVlaue) return
this.setData({ this.setData({
["orderObj.payeeType"]: value, ["orderObj.payeeType"]: value,
...@@ -1505,6 +1608,7 @@ Page({ ...@@ -1505,6 +1608,7 @@ Page({
}) })
} }
if (e && !e.packageName) { if (e && !e.packageName) {
console.log(e.specificationData, e, e.specificationData.indexOf(';~;') > -1)
if (e.specificationData.indexOf(';~;') > -1) { if (e.specificationData.indexOf(';~;') > -1) {
// 修复取值字段名字错误问题 // 修复取值字段名字错误问题
if (!e.price) { if (!e.price) {
...@@ -1520,12 +1624,11 @@ Page({ ...@@ -1520,12 +1624,11 @@ Page({
e.count = e.number; e.count = e.number;
e.merchantGoodsId = e.merchantGoodsId || e.id; e.merchantGoodsId = e.merchantGoodsId || e.id;
let specificdata = this.handleSpecificationsEcho(e) let specificdata = this.handleSpecificationsEcho(e)
chooseList.push(specificdata) chooseList= chooseList.concat(specificdata)
} }
} }
}); });
} }
console.log(chooseList, 'chooseList')
this.setData({ this.setData({
goodsList: chooseList, goodsList: chooseList,
first: false, first: false,
...@@ -1533,7 +1636,7 @@ Page({ ...@@ -1533,7 +1636,7 @@ Page({
this.setGoodsTotal(chooseList); this.setGoodsTotal(chooseList);
}, },
handleSpecificationsEcho(item) { handleSpecificationsEcho(item) {
console.log(item) let skuArr = [];
let { let {
otherProduct otherProduct
} = this.data, } = this.data,
...@@ -1550,26 +1653,30 @@ Page({ ...@@ -1550,26 +1653,30 @@ Page({
if (data.goodsFlag == 2) { if (data.goodsFlag == 2) {
let tempData = data.multipleSpecificationsGoods.specificationGoodsMap[str] let tempData = data.multipleSpecificationsGoods.specificationGoodsMap[str]
if (tempData) { if (tempData) {
if (tempData.merchantGoodsId == item.goodsId) { tempData.forEach(temp => {
if (temp.merchantGoodsId == item.goodsId) {
obj.multipleSpecificationsGoods = { obj.multipleSpecificationsGoods = {
...data.multipleSpecificationsGoods, ...data.multipleSpecificationsGoods,
baseGoodsName: item.goodsName || item.upgradeGoodsName, baseGoodsName: item.goodsName || item.upgradeGoodsName,
goods: { goods: {
...tempData, ...temp,
price: item.price, price: item.price,
sellPrice: item.price, sellPrice: item.price,
goodsId: item.goodsId, goodsId: item.goodsId,
specificationStr: item.specificationData.replace(/;~;/g, '/') specificationStr: item.specificationData.replace(/;~;/g, '/')
} }
} }
skuArr.push(obj)
} }
})
} }
} }
}) })
console.log(obj) console.log(skuArr)
return obj return skuArr
}, },
divideByHundred: str => { divideByHundred: str => {
let floatVal = parseFloat(str) let floatVal = parseFloat(str)
...@@ -1639,7 +1746,12 @@ Page({ ...@@ -1639,7 +1746,12 @@ Page({
}); });
}, },
settingPayType(orderObj) { settingPayType(orderObj) {
let { configPayTypeList, isErrorOrder, switchVlaue, outTradeArr } = this.data let {
configPayTypeList,
isErrorOrder,
switchVlaue,
outTradeArr
} = this.data
// 补录或标记错误订单 // 补录或标记错误订单
if (isErrorOrder || switchVlaue) { if (isErrorOrder || switchVlaue) {
this.setData({ this.setData({
...@@ -1756,7 +1868,7 @@ Page({ ...@@ -1756,7 +1868,7 @@ Page({
}); });
} }
}) })
.catch((err) => { }); .catch((err) => {});
}, },
async onRoute(res) { async onRoute(res) {
// debugger // debugger
...@@ -1944,15 +2056,15 @@ Page({ ...@@ -1944,15 +2056,15 @@ Page({
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { }, onPullDownRefresh: function () {},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { }, onReachBottom: function () {},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { }, onShareAppMessage: function () {},
}); });
\ No newline at end of file \ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"merchant-seles": "/components/Merchant-Seles/Merchant-Seles", "merchant-seles": "/components/Merchant-Seles/Merchant-Seles",
"coupon": "/components/Coupon/Coupon", "coupon": "/components/Coupon/Coupon",
"goods": "/components/Goods/Goods", "goods": "/components/Goods/Goods",
"sku-goods": "/components/SkuGoods/Goods",
"customerInfo": "/components/CustomerInfo/CustomerInfo", "customerInfo": "/components/CustomerInfo/CustomerInfo",
"sub-shop-merchant": "/components/subShopMerchant/subShopMerchant", "sub-shop-merchant": "/components/subShopMerchant/subShopMerchant",
"van-picker": "@vant/weapp/picker/index", "van-picker": "@vant/weapp/picker/index",
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<view class="price_count"> <view class="price_count">
<view class="price"> <view class="price">
<text>¥</text> <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>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="1">x{{item.count}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="1">x{{item.count}}</view>
</view> </view>
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
<view class="price_count"> <view class="price_count">
<view class="price"> <view class="price">
<text>¥</text> <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>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view> </view>
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
<view class="price_count"> <view class="price_count">
<view class="price"> <view class="price">
<text>¥</text> <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>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view> </view>
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
<view class="price_count"> <view class="price_count">
<view class="price"> <view class="price">
<text>¥</text> <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>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view> </view>
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
<view class="price_count"> <view class="price_count">
<view class="price"> <view class="price">
<text>¥</text> <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>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="3">x{{item.count}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="3">x{{item.count}}</view>
</view> </view>
...@@ -318,7 +318,7 @@ ...@@ -318,7 +318,7 @@
<view class="price_count"> <view class="price_count">
<view class="price"> <view class="price">
<text>¥</text> <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>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="3">x{{item.count}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="3">x{{item.count}}</view>
</view> </view>
...@@ -352,7 +352,7 @@ ...@@ -352,7 +352,7 @@
<view class="price_count"> <view class="price_count">
<view class="price"> <view class="price">
<text>¥</text> <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>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="4">x{{item.count}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="4">x{{item.count}}</view>
</view> </view>
...@@ -378,7 +378,7 @@ ...@@ -378,7 +378,7 @@
<view class="price_count"> <view class="price_count">
<view class="price"> <view class="price">
<text>¥</text> <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>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="4">x{{item.count}}</view> <view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="4">x{{item.count}}</view>
</view> </view>
...@@ -472,6 +472,7 @@ ...@@ -472,6 +472,7 @@
<remark-popup wx:if="{{ showRemark }}" show="{{ showRemark }}" bindconfirm="remarkConfirm" placeholder="请填写内容,最多30个字" maxlength="30" value="{{ orderObj.remark }}" /> <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 }}" /> <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 }}" /> <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" /> <customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" />
<van-popup show="{{ showSource }}" position="bottom" bind:close="onCloseSource"> <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" /> <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!