mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-12 10:00:56 +08:00
加入平团
This commit is contained in:
parent
9009db741a
commit
581d11ebf7
@ -151,7 +151,7 @@
|
||||
},
|
||||
_closeAddProduct: function () {
|
||||
$that.clearAddProductInfo();
|
||||
vc.emit('productManage', 'listProduct', {});
|
||||
vc.emit('groupBuyProductManage', 'listProduct', {});
|
||||
},
|
||||
_initAddGroupBuyProduct: function () {
|
||||
let $summernote = $('.summernote').summernote({
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
<div class="modal fade" id="deleteGroupBuyProductModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">请确认您的操作!</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<tr align="center"><th>确定删除拼团商品信息</th></tr>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeleteGroupBuyProductModel()">点错了</button>
|
||||
<button type="button" class="btn btn-primary" v-on:click="deleteGroupBuyProduct()">确认删除</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,52 @@
|
||||
(function(vc,vm){
|
||||
|
||||
vc.extends({
|
||||
data:{
|
||||
deleteGroupBuyProductInfo:{
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod:function(){
|
||||
|
||||
},
|
||||
_initEvent:function(){
|
||||
vc.on('deleteGroupBuyProduct','openDeleteGroupBuyProductModal',function(_params){
|
||||
|
||||
vc.component.deleteGroupBuyProductInfo = _params;
|
||||
$('#deleteGroupBuyProductModel').modal('show');
|
||||
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
deleteGroupBuyProduct:function(){
|
||||
vc.component.deleteGroupBuyProductInfo.communityId=vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(
|
||||
'/groupBuy/deleteGroupBuyProduct',
|
||||
JSON.stringify(vc.component.deleteGroupBuyProductInfo),
|
||||
{
|
||||
emulateJSON:true
|
||||
},
|
||||
function(json,res){
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#deleteGroupBuyProductModel').modal('hide');
|
||||
vc.emit('groupBuyProductManage', 'listProduct', {});
|
||||
return ;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
},
|
||||
function(errInfo,error){
|
||||
console.log('请求失败处理');
|
||||
vc.message(json);
|
||||
|
||||
});
|
||||
},
|
||||
closeDeleteGroupBuyProductModel:function(){
|
||||
$('#deleteGroupBuyProductModel').modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc,window.vc.component);
|
||||
@ -138,16 +138,14 @@
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="saveProductInfo()"><i
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="updateProductInfo()"><i
|
||||
class="fa fa-check"></i> 保存</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
v-on:click="_closeAddProduct()">取消</button>
|
||||
v-on:click="_closeEditProduct()">取消</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<vc:create path="goods/chooseProduct" emitChooseProduct="editGroupBuyProduct" emitLoadData=""></vc:create>
|
||||
</div>
|
||||
@ -7,6 +7,7 @@
|
||||
},
|
||||
data: {
|
||||
editGroupBuyProductInfo: {
|
||||
groupId: '',
|
||||
productId: '',
|
||||
groupProdName: '',
|
||||
prodName: '',
|
||||
@ -26,24 +27,10 @@
|
||||
vc.on('editGroupBuyProduct', 'openEditProductModal', function (_product) {
|
||||
//加载数据
|
||||
|
||||
vc.copyObject(_product,$that.editGroupBuyProductInfo);
|
||||
vc.copyObject(_product, $that.editGroupBuyProductInfo);
|
||||
|
||||
$that._loadGroupProductInfo(_product);
|
||||
});
|
||||
vc.on('editGroupBuyProduct', 'chooseProduct', function (_product) {
|
||||
vc.copyObject(_product, $that.editGroupBuyProductInfo);
|
||||
$that.editGroupBuyProductInfo.groupProdDesc = _product.prodDesc;
|
||||
$that.editGroupBuyProductInfo.groupProdName = _product.prodName;
|
||||
$that._loadProductInfo(_product.productId);
|
||||
});
|
||||
vc.on("editGroupBuyProduct", "notifyUploadCoverImage", function (_param) {
|
||||
if (_param.length > 0) {
|
||||
vc.component.editGroupBuyProductInfo.coverPhoto = _param[0];
|
||||
} else {
|
||||
vc.component.editGroupBuyProductInfo.coverPhoto = '';
|
||||
}
|
||||
|
||||
});
|
||||
vc.on("editGroupBuyProduct", "notifyUploadCarouselFigureImage", function (_param) {
|
||||
vc.component.editGroupBuyProductInfo.carouselFigurePhoto = _param;
|
||||
});
|
||||
@ -113,14 +100,14 @@
|
||||
]
|
||||
});
|
||||
},
|
||||
saveProductInfo: function () {
|
||||
updateProductInfo: function () {
|
||||
if (!vc.component.editGroupBuyProductValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
vc.http.apiPost(
|
||||
'/groupBuy/saveGroupBuyProduct',
|
||||
'/groupBuy/updateGroupBuyProduct',
|
||||
JSON.stringify(vc.component.editGroupBuyProductInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
@ -140,8 +127,9 @@
|
||||
|
||||
});
|
||||
},
|
||||
clearAddProductInfo: function () {
|
||||
clearEditProductInfo: function () {
|
||||
vc.component.editGroupBuyProductInfo = {
|
||||
groupId: '',
|
||||
productId: '',
|
||||
groupProdName: '',
|
||||
prodName: '',
|
||||
@ -153,9 +141,9 @@
|
||||
productSpecs: []
|
||||
};
|
||||
},
|
||||
_closeAddProduct: function () {
|
||||
$that.clearAddProductInfo();
|
||||
vc.emit('productManage', 'listProduct', {});
|
||||
_closeEditProduct: function () {
|
||||
$that.clearEditProductInfo();
|
||||
vc.emit('groupBuyProductManage', 'listProduct', {});
|
||||
},
|
||||
_initEditGroupBuyProduct: function () {
|
||||
let $summernote = $('.editSummernote').summernote({
|
||||
@ -218,9 +206,6 @@
|
||||
});
|
||||
|
||||
},
|
||||
_openChooseProductModal: function () {
|
||||
vc.emit('chooseProduct', 'openChooseProductModel', {});
|
||||
},
|
||||
_loadGroupProductInfo: function (_product) {
|
||||
var param = {
|
||||
params: {
|
||||
@ -237,11 +222,11 @@
|
||||
let _productInfo = JSON.parse(json);
|
||||
let _product = _productInfo.data[0];
|
||||
|
||||
$that.editGroupBuyProductInfo.productSpecs = _product.productSpecValues;
|
||||
$that.editGroupBuyProductInfo.productSpecs = _product.groupBuyProductSpecs;
|
||||
$that.editGroupBuyProductInfo.content = _product.content;
|
||||
$(".editSummernote").summernote('code', _product.content);
|
||||
|
||||
let _productSpecValues = _product.productSpecValues;
|
||||
let _productSpecValues = _product.groupBuyProductSpecs;
|
||||
|
||||
_productSpecValues.forEach(item => {
|
||||
let _productSpecDetails = item.productSpecDetails;
|
||||
|
||||
@ -115,6 +115,6 @@
|
||||
<div v-bind:class="{no_display:groupBuyProductManageInfo.componentShow != 'editGroupBuyProduct'}">
|
||||
<vc:create path="goods/editGroupBuyProduct" callBackListener="" callBackFunction=""></vc:create>
|
||||
</div>
|
||||
<vc:create path="goods/deleteProduct"></vc:create>
|
||||
<vc:create path="goods/deleteGroupBuyProduct"></vc:create>
|
||||
|
||||
</div>
|
||||
@ -68,7 +68,7 @@
|
||||
vc.emit('editGroupBuyProduct', 'openEditProductModal', _product);
|
||||
},
|
||||
_openDeleteProductModel: function (_product) {
|
||||
vc.emit('deleteProduct', 'openDeleteProductModal', _product);
|
||||
vc.emit('deleteGroupBuyProduct','openDeleteGroupBuyProductModal', _product);
|
||||
},
|
||||
_queryProductMethod: function () {
|
||||
vc.component._listProducts(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user