|
@@ -5,9 +5,9 @@ var decoration = new Vue({
|
|
|
iconflag:true,
|
|
|
bgflag:false,
|
|
|
logoShow:false,
|
|
|
- formData:new FormData(),
|
|
|
params:{
|
|
|
- shopID:'',
|
|
|
+ id: '',
|
|
|
+ shopId:'',
|
|
|
title:'',
|
|
|
link:'',
|
|
|
info:'',
|
|
@@ -18,15 +18,16 @@ var decoration = new Vue({
|
|
|
list:[],
|
|
|
},
|
|
|
methods:{
|
|
|
- uploadlogo:function () { //上传图片
|
|
|
+ uploadlogo: function () { //上传图片
|
|
|
var _this = this;
|
|
|
var inputDOM = _this.$refs.images;
|
|
|
var file = inputDOM.files;
|
|
|
- _this.formData.append('file', file[0]);
|
|
|
- SupplierApi.uploadimg(_this.formData,function(response){
|
|
|
- _this.params.image = response.data;
|
|
|
- _this.logoShow = true;
|
|
|
- _this.iconflag = false;
|
|
|
+ var formData = new FormData();
|
|
|
+ formData.append('file', file[0]);
|
|
|
+ SupplierApi.uploadimg(formData, function (response) {
|
|
|
+ _this.params.image = response.data;
|
|
|
+ _this.logoShow = true;
|
|
|
+ _this.iconflag = false;
|
|
|
event.target.value = '';
|
|
|
});
|
|
|
},
|
|
@@ -49,15 +50,16 @@ var decoration = new Vue({
|
|
|
if(_this.params.image==''){
|
|
|
CAIMEI.dialog('请上传广告图片')
|
|
|
}else {
|
|
|
- console.log(_this.params)
|
|
|
- SupplierApi.ShopBanner(_this.params,function (res) {
|
|
|
- CAIMEI.dialog('提交成功');
|
|
|
+ console.log(_this.params);
|
|
|
+ SupplierApi.ShopBanner(_this.params, function (res) {
|
|
|
+ debugger
|
|
|
+ CAIMEI.dialog('提交成功');
|
|
|
location.reload()
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- editpictures:function(item){
|
|
|
- var _this = this;
|
|
|
+ editpictures: function (item) {
|
|
|
+ var _this = this;
|
|
|
_this.name = '编辑主页广告图';
|
|
|
_this.shopBannerId = item.shopBannerID;
|
|
|
_this.bgflag = true;
|
|
@@ -65,28 +67,40 @@ var decoration = new Vue({
|
|
|
_this.params.link = item.link;
|
|
|
_this.params.info = item.info;
|
|
|
_this.params.image = item.image;
|
|
|
- if(item.image !=''){
|
|
|
- _this.params.image=item.image;
|
|
|
- _this.logoShow = true;
|
|
|
- _this.iconflag = false;
|
|
|
- }else {
|
|
|
+ _this.params.id = item.id;
|
|
|
+ if (item.image != '') {
|
|
|
+ _this.params.image = item.image;
|
|
|
+ _this.logoShow = true;
|
|
|
+ _this.iconflag = false;
|
|
|
+ } else {
|
|
|
_this.logoShow = false;
|
|
|
_this.iconflag = true;
|
|
|
- }
|
|
|
+ }
|
|
|
},
|
|
|
deletepictures:function(item){
|
|
|
var _this = this;
|
|
|
- var shopBannerId = item.shopBannerID;
|
|
|
- console.log(shopBannerId)
|
|
|
+ var id = item.id;
|
|
|
CAIMEI.Modal('您确定要删除么?','取消','确定',function () {
|
|
|
- SupplierApi.deleteShopBanner({shopBannerId:shopBannerId},function (res) {
|
|
|
- if(res.code==0){
|
|
|
+ SupplierApi.deleteShopBanner({id: id}, function (res) {
|
|
|
+ if (res.code == 0) {
|
|
|
CAIMEI.dialog('删除成功');
|
|
|
location.reload()
|
|
|
}
|
|
|
- })
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
+ // 获取广告图片列表
|
|
|
+ fetchDressUpList: function () {
|
|
|
+ var _self = this;
|
|
|
+ SupplierApi.dressUpList({shopId: _self.params.shopId}, function (res) {
|
|
|
+ if (res.code == 0) {
|
|
|
+ console.log(res);
|
|
|
+ if (res.data.length > 0) {
|
|
|
+ _self.list = res.data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
close:function () {
|
|
|
var _this = this;
|
|
|
_this.bgflag = false;
|
|
@@ -95,22 +109,13 @@ var decoration = new Vue({
|
|
|
_this.params.info = '';
|
|
|
_this.params.image = '';
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
mounted:function () {
|
|
|
var _self = this;
|
|
|
- if(globalUserData){
|
|
|
- _self.params.shopID = globalUserData.shopId;
|
|
|
-
|
|
|
- }
|
|
|
- SupplierApi.dressUpList({shopId:_self.params.shopID},function (res) {
|
|
|
- if(res.code==0){
|
|
|
- console.log(res)
|
|
|
- if(res.data.length>0){
|
|
|
- _self.list =res.data;
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ if (globalUserData) {
|
|
|
+ _self.params.shopId = globalUserData.shopId;
|
|
|
+ }
|
|
|
+ this.fetchDressUpList();
|
|
|
$('.navLayout').find('.navList').removeClass("on").find('.con').hide().find('a').removeClass("on");
|
|
|
$('.navLayout').find('.navList').eq(1).addClass("on").find('.con').show().find('a').eq(1).addClass("on");
|
|
|
}
|