提交 cc9bfc74 authored 作者: 刘旭's avatar 刘旭

优化

上级 431864b1
...@@ -793,9 +793,9 @@ export default { ...@@ -793,9 +793,9 @@ export default {
}, },
// sku按钮的点击事件 // sku按钮的点击事件
skuClick(value, index1, index2) { skuClick(value, index1, index2) {
console.log(value, index1, index2); // console.log(value, index1, index2);
console.log(this.selectArr); // console.log(this.selectArr);
console.log(this.goodsInfo); // console.log(this.goodsInfo);
let that = this; let that = this;
if (value.ishow) { if (value.ishow) {
if (that.selectArr[index1] != value.name) { if (that.selectArr[index1] != value.name) {
...@@ -1050,7 +1050,7 @@ export default { ...@@ -1050,7 +1050,7 @@ export default {
defaultSelectSku() { defaultSelectSku() {
let that = this; let that = this;
let { defaultSelect } = that; let { defaultSelect } = that;
console.log(defaultSelect, 'defaultSelect'); // console.log(defaultSelect, 'defaultSelect');
if (defaultSelect && defaultSelect.sku && defaultSelect.sku.length > 0) { if (defaultSelect && defaultSelect.sku && defaultSelect.sku.length > 0) {
that.selectSku(defaultSelect); that.selectSku(defaultSelect);
} }
...@@ -1153,16 +1153,20 @@ export default { ...@@ -1153,16 +1153,20 @@ export default {
// 添加子字段 // 添加子字段
onPlus(index) { onPlus(index) {
let that = this; let that = this;
console.log(index, that.goodsInfo.spec_list[index].isPlus);
that.goodsInfo.spec_list[index].isPlus = false;
that.$emit('plus', index); that.$emit('plus', index);
}, },
// 失去焦点后还原 // 失去焦点后还原
onBlur(val, index) { onBlur(val, index) {
let that = this; let that = this;
if (!val) that.goodsInfo.spec_list[index].isPlus = true;
that.$emit('blur', val, index); that.$emit('blur', val, index);
}, },
// 失去焦点后还原 // 确认后还原
onConfirm(val, index) { onConfirm(val, index) {
let that = this; let that = this;
if (!val) that.goodsInfo.spec_list[index].isPlus = true;
that.$emit('confirm', val, index); that.$emit('confirm', val, index);
}, },
}, },
......
...@@ -84,7 +84,7 @@ let resultSku = (data?: any) => { ...@@ -84,7 +84,7 @@ let resultSku = (data?: any) => {
if(detailData.value.productList.length === 1) { if(detailData.value.productList.length === 1) {
nextTick(() => { nextTick(() => {
defaultSelect.value = { defaultSelect.value = {
sku: '', sku: [...detailData.value.productList[0].specifications],
num: 1 num: 1
} }
// skuPopupRef.value.selectArr = [...detailData.value.productList[0].specifications] // skuPopupRef.value.selectArr = [...detailData.value.productList[0].specifications]
...@@ -150,10 +150,10 @@ let init = (data: any, id: number, partsData?: any) => { ...@@ -150,10 +150,10 @@ let init = (data: any, id: number, partsData?: any) => {
spec_list: specificationList, spec_list: specificationList,
partsData partsData
}; };
console.log(goodsInfo.value, 'goodsInfo.value', data.specificationList); // console.log(goodsInfo.value, 'goodsInfo.value', data.specificationList);
productList = [] productList = []
specificationList = [] specificationList = []
resultSku() // resultSku()
}; };
// sku组件 开始----------------------------------------------------------- // sku组件 开始-----------------------------------------------------------
let onOpenSkuPopup = () => {}; let onOpenSkuPopup = () => {};
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</u-navbar> </u-navbar>
<view class="u-wrap"> <view class="u-wrap">
<view class="u-menu-wrap"> <view class="u-menu-wrap">
<view style="position: fixed; left: 8rpx; top: 6%;"> <scroll-view style="position: fixed; left: 8rpx; top: 6%; height: 100vh;">
<drag-and-drop-sort <drag-and-drop-sort
v-if="flag" v-if="flag"
ref="dragRef" ref="dragRef"
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</view> </view>
</template> </template>
</drag-and-drop-sort> </drag-and-drop-sort>
</view> </scroll-view>
<view class="left-cates" /> <view class="left-cates" />
<view class="right-cates"> <view class="right-cates">
<view style="width: 80px;"> <view style="width: 80px;">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论