|
|
@ -44,7 +44,7 @@ |
|
|
|
:disable-default-padding="false" v-model.trim="productData.astrict" placeholder="请输入限制" |
|
|
|
:disable-default-padding="false" v-model.trim="productData.astrict" placeholder="请输入限制" |
|
|
|
placeholder-class="font15" :maxlength="999"></textarea> |
|
|
|
placeholder-class="font15" :maxlength="999"></textarea> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="dis-flex marb10 bor-botm1"> |
|
|
|
<view class="dis-flex marb10 "> |
|
|
|
<view class="group-title marRight10 fontwig6 padleft15 paddtright10 flex-s0 self-top">团购图片: |
|
|
|
<view class="group-title marRight10 fontwig6 padleft15 paddtright10 flex-s0 self-top">团购图片: |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="imageUploadContainer flex-1"> |
|
|
|
<view class="imageUploadContainer flex-1"> |
|
|
@ -70,7 +70,11 @@ |
|
|
|
<uni-collapse-item v-for="(item,index) in productDetailList" :key="index" :title="item.name"> |
|
|
|
<uni-collapse-item v-for="(item,index) in productDetailList" :key="index" :title="item.name"> |
|
|
|
<view class="content dis-flex flex-sp" v-for="(item2,index2) in item.list" :key="index2"> |
|
|
|
<view class="content dis-flex flex-sp" v-for="(item2,index2) in item.list" :key="index2"> |
|
|
|
<view class="text">{{item2.productName}}</view> |
|
|
|
<view class="text">{{item2.productName}}</view> |
|
|
|
<view class="text">{{item2.count}}份</view> |
|
|
|
<view class="dis-flex"> |
|
|
|
|
|
|
|
<view class="text">{{item2.count}}份</view> |
|
|
|
|
|
|
|
<view class="icon shanchu margle20 font16 fcorred" @click.stop="deleteGroupDetail(item2.id)"></view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-collapse-item> |
|
|
|
</uni-collapse-item> |
|
|
|
</uni-collapse> |
|
|
|
</uni-collapse> |
|
|
@ -89,9 +93,10 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 底部按钮 --> |
|
|
|
<!-- 底部按钮 --> |
|
|
|
<view class="footer-btn"> |
|
|
|
<view class="footer-btn backcorfff"> |
|
|
|
<button class="backcor89 fcorfff" @click="clickToSave" v-if="merchart!=2">保存</button> |
|
|
|
<view v-if="(status==2&&merchart>1)" class="height50 flex-1 fcor089 fotct" @click="merchart--">上一步</view> |
|
|
|
<button v-if="(status==2&&merchart<3)||merchart==2" class="backcor89 fcorfff" @click="merchart++">下一步</button> |
|
|
|
<button class="backcor89 flex-1 fcorfff" @click="clickToSave" v-if="merchart!=2">保存</button> |
|
|
|
|
|
|
|
<view v-if="(status==2&&merchart<3)||merchart==2" class="height50 flex-1 fcor089 fotct" @click="merchart++">下一步</view> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
@ -158,9 +163,10 @@ |
|
|
|
getStoreProductByList, |
|
|
|
getStoreProductByList, |
|
|
|
editGroupContentDetail, |
|
|
|
editGroupContentDetail, |
|
|
|
getStoreGroupDetailList, |
|
|
|
getStoreGroupDetailList, |
|
|
|
insertGroupServeRule, |
|
|
|
|
|
|
|
editGroupServeRule, |
|
|
|
editGroupServeRule, |
|
|
|
findGroupServeRuleByGroup, |
|
|
|
findGroupServeRuleByGroup, |
|
|
|
|
|
|
|
deleteGroupDetail, |
|
|
|
|
|
|
|
findStoreGroupContent |
|
|
|
} from '@/Utils/groupBuying.js'; |
|
|
|
} from '@/Utils/groupBuying.js'; |
|
|
|
const app = getApp(); |
|
|
|
const app = getApp(); |
|
|
|
export default { |
|
|
|
export default { |
|
|
@ -204,11 +210,7 @@ |
|
|
|
return true |
|
|
|
return true |
|
|
|
}, |
|
|
|
}, |
|
|
|
isShowAdd() { |
|
|
|
isShowAdd() { |
|
|
|
/* if(this.imgValue.length>=1){ |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
return true |
|
|
|
|
|
|
|
} */ |
|
|
|
|
|
|
|
return true |
|
|
|
return true |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -218,6 +220,14 @@ |
|
|
|
this.storeId = option.storeId; |
|
|
|
this.storeId = option.storeId; |
|
|
|
this.productData.storeId = option.storeId; |
|
|
|
this.productData.storeId = option.storeId; |
|
|
|
this.status = option.status; |
|
|
|
this.status = option.status; |
|
|
|
|
|
|
|
if (option.id) { |
|
|
|
|
|
|
|
this.productData.id = option.id; |
|
|
|
|
|
|
|
/* */ |
|
|
|
|
|
|
|
this.groupId =option.id; |
|
|
|
|
|
|
|
this.productDetail.groupId =option.id; |
|
|
|
|
|
|
|
this.ruleData.groupId =option.id; |
|
|
|
|
|
|
|
/* */ |
|
|
|
|
|
|
|
} |
|
|
|
if (this.status == 1) { |
|
|
|
if (this.status == 1) { |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: "添加团购产品" |
|
|
|
title: "添加团购产品" |
|
|
@ -226,14 +236,11 @@ |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: "编辑团购产品" |
|
|
|
title: "编辑团购产品" |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.findStoreGroupContent();//查询基本信息 |
|
|
|
this.getStoreGroupDetailList();//查询产品详情 |
|
|
|
this.getStoreGroupDetailList();//查询产品详情 |
|
|
|
this.findGroupServeRuleByGroup();//查询产品规则 |
|
|
|
this.findGroupServeRuleByGroup();//查询产品规则 |
|
|
|
} |
|
|
|
} |
|
|
|
if (option.id) { |
|
|
|
|
|
|
|
this.productData.id = option.id; |
|
|
|
|
|
|
|
this.ruleData.id = option.id; |
|
|
|
|
|
|
|
// this.getStoreProductById() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
console.log(option, "=======") |
|
|
|
console.log(option, "=======") |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: { |
|
|
|
components: { |
|
|
@ -278,7 +285,7 @@ |
|
|
|
if (this.merchart == 1) { |
|
|
|
if (this.merchart == 1) { |
|
|
|
/* 第一步:团购基本内容*/ |
|
|
|
/* 第一步:团购基本内容*/ |
|
|
|
if (!this.validate()) return; //校验是否有空 |
|
|
|
if (!this.validate()) return; //校验是否有空 |
|
|
|
this.productData.img = this.imgValue.join(""); |
|
|
|
this.productData.img = this.imgValue.join(","); |
|
|
|
if (this.status == 1) { //1.新增 2.编辑 |
|
|
|
if (this.status == 1) { //1.新增 2.编辑 |
|
|
|
this.insertGroupContent(); |
|
|
|
this.insertGroupContent(); |
|
|
|
return |
|
|
|
return |
|
|
@ -298,18 +305,36 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.editGroupServeRule(); |
|
|
|
|
|
|
|
|
|
|
|
if (this.status == 1) { //1.新增 2.编辑 |
|
|
|
|
|
|
|
this.insertGroupServeRule(); |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.status == 2) { |
|
|
|
|
|
|
|
this.editGroupServeRule(); |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
/* 查询配置基本内容 */ |
|
|
|
|
|
|
|
findStoreGroupContent(){ |
|
|
|
|
|
|
|
let params={ |
|
|
|
|
|
|
|
groupId:this.groupId |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
findStoreGroupContent(params).then(res=>{ |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.productData.name = res.return_data.name; |
|
|
|
|
|
|
|
this.productData.price = res.return_data.price; |
|
|
|
|
|
|
|
this.productData.astrict = res.return_data.astrict; |
|
|
|
|
|
|
|
this.productData.img = res.return_data.img; |
|
|
|
|
|
|
|
this.productData.serviceTime = res.return_data.serviceTime; |
|
|
|
|
|
|
|
this.productData.validity = res.return_data.validity; |
|
|
|
|
|
|
|
this.imgValue = this.productData.img.split(","); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.return_msg, |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
/* 新增配置团购基本内容 */ |
|
|
|
/* 新增配置团购基本内容 */ |
|
|
|
insertGroupContent() { |
|
|
|
insertGroupContent() { |
|
|
|
insertGroupContent(this.productData).then(res => { |
|
|
|
insertGroupContent(this.productData).then(res => { |
|
|
@ -409,7 +434,6 @@ |
|
|
|
//查看临时图片路径 |
|
|
|
//查看临时图片路径 |
|
|
|
getImgSignedUrl(item1) { |
|
|
|
getImgSignedUrl(item1) { |
|
|
|
this.imgValue.push(item1); |
|
|
|
this.imgValue.push(item1); |
|
|
|
console.log(this.imgValue, "this.imgValue") |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 弹窗关闭 |
|
|
|
// 弹窗关闭 |
|
|
|
hide() { |
|
|
|
hide() { |
|
|
@ -426,9 +450,7 @@ |
|
|
|
getStoreGroupDetailList(params).then(res=>{ |
|
|
|
getStoreGroupDetailList(params).then(res=>{ |
|
|
|
uni.hideLoading(); |
|
|
|
uni.hideLoading(); |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if(res.return_data.length>0){ |
|
|
|
this.productDetailList = res.return_data |
|
|
|
this.productDetailList = res.return_data |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: res.return_msg, |
|
|
|
title: res.return_msg, |
|
|
@ -477,7 +499,6 @@ |
|
|
|
/* 产品列表复选款 */ |
|
|
|
/* 产品列表复选款 */ |
|
|
|
checkClick(e) { |
|
|
|
checkClick(e) { |
|
|
|
this.productSelectIdList = e.detail.value; |
|
|
|
this.productSelectIdList = e.detail.value; |
|
|
|
console.log(this.productSelectIdList, "this.productSelectIdList") |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
/* 保存产品详情 */ |
|
|
|
/* 保存产品详情 */ |
|
|
|
saveProductDetail() { |
|
|
|
saveProductDetail() { |
|
|
@ -508,6 +529,43 @@ |
|
|
|
this.editGroupContentDetail(this.productDetail) |
|
|
|
this.editGroupContentDetail(this.productDetail) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//删除团购产品详情单个产品 |
|
|
|
|
|
|
|
deleteGroupDetail(id){ |
|
|
|
|
|
|
|
let _this = this; |
|
|
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
|
|
title: '提示', |
|
|
|
|
|
|
|
content: '确定删除吗?', |
|
|
|
|
|
|
|
success: function(res) { |
|
|
|
|
|
|
|
if (res.confirm) { |
|
|
|
|
|
|
|
let params ={ |
|
|
|
|
|
|
|
id:id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
|
|
title: "加载中..." |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
deleteGroupDetail(params).then(res => { |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
_this.getStoreGroupDetailList(); |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.return_data, |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.return_msg, |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else if (res.cancel) { |
|
|
|
|
|
|
|
// console.log('用户点击取消'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
validateProductDetail() { |
|
|
|
validateProductDetail() { |
|
|
|
if (!this.productDetail.name) { |
|
|
|
if (!this.productDetail.name) { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
@ -545,27 +603,6 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
/* 团购规则 */ |
|
|
|
/* 团购规则 */ |
|
|
|
/* 新增团购规则 */ |
|
|
|
|
|
|
|
insertGroupServeRule(){ |
|
|
|
|
|
|
|
insertGroupServeRule(this.ruleData).then(res=>{ |
|
|
|
|
|
|
|
let title ; |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
title = res.return_data; |
|
|
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
|
|
|
uni.navigateBack(); |
|
|
|
|
|
|
|
},1000) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
title = res.return_msg; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: title, |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 编辑团购规则 |
|
|
|
// 编辑团购规则 |
|
|
|
editGroupServeRule(){ |
|
|
|
editGroupServeRule(){ |
|
|
|
editGroupServeRule(this.ruleData).then(res=>{ |
|
|
|
editGroupServeRule(this.ruleData).then(res=>{ |
|
|
@ -597,6 +634,7 @@ |
|
|
|
findGroupServeRuleByGroup(params).then(res=>{ |
|
|
|
findGroupServeRuleByGroup(params).then(res=>{ |
|
|
|
uni.hideLoading(); |
|
|
|
uni.hideLoading(); |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
this.ruleData.content = res.return_data.content; |
|
|
|
console.log(res.return_data,"res.return_data") |
|
|
|
console.log(res.return_data,"res.return_data") |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
@ -811,6 +849,7 @@ |
|
|
|
bottom: 0; |
|
|
|
bottom: 0; |
|
|
|
left: 0; |
|
|
|
left: 0; |
|
|
|
right: 0; |
|
|
|
right: 0; |
|
|
|
|
|
|
|
z-index: 99; |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
|