diff --git a/pages/mall/index.vue b/pages/mall/index.vue index 184943b..22227dd 100644 --- a/pages/mall/index.vue +++ b/pages/mall/index.vue @@ -111,7 +111,8 @@ export default { }, listData: [], logo: 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif', - backgroundStyle: 'background: url("/static/imgs/mall/zsc-bg-icon.png") no-repeat;' + backgroundStyle: 'background: url("/static/imgs/mall/zsc-bg-icon.png") no-repeat;', + stoteInfo:'' } }, onShow() { @@ -132,6 +133,7 @@ export default { storeDetail(id) .then((res) => { if (res) { + this.stoteInfo = res this.$set(this.storeInformation, 'productNumber', res.productNumber) this.$set(this.storeInformation, 'currentProductNumber', res.currentProductNumber) if (res.logo === '') { @@ -214,7 +216,7 @@ export default { }, // 店铺设置按钮 setting(item) { - go2('store-settings') + go2('store-settings',this.stoteInfo) }, // 详情点击事件 detailInfo(item) { diff --git a/pages/store-settings/index.vue b/pages/store-settings/index.vue index 62e3d91..9fc422b 100644 --- a/pages/store-settings/index.vue +++ b/pages/store-settings/index.vue @@ -25,7 +25,7 @@ @@ -44,7 +45,7 @@ 背景图片 - + 建议尺寸:750*370像素,尺寸不匹配时,图片将被压缩或拉伸以铺满画面 @@ -64,7 +65,8 @@ export default { data() { return { storeName: '', - imageValue: [], + logoImage: [], + backgroundImage:[], background: '', logo: '', imageStyles: { @@ -82,7 +84,29 @@ export default { }, onLoad(option) { if (option) { + this.logoImage = [] + this.backgroundImage = [] this.option = option + this.storeName = this.option.name + this.background = this.option.backgroundImg + this.logo = this.option.logo + if(this.option.logo !== ""){ + var logoImage = { + name:'text', + type:'image', + url:this.option.logo + } + this.logoImage.push(logoImage) + } + if(this.option.backgroundImg !== ""){ + var backgroundImage = { + name:'text', + type:'image', + url:this.option.backgroundImg + } + this.backgroundImage.push(backgroundImage) + } + } }, @@ -102,18 +126,19 @@ export default { select(item) { this.postuploadFile(item.tempFiles[0], 'logo') }, - backSelect(item) { - this.postuploadFile(item.tempFiles[0], 'background') + // 删除logo + deleteLogo(item) { + console.log('deleteImage', item) + this.logo = '' }, - // 删除图片 + // 删除背景图 deleteImage(item) { console.log('deleteImage', item) - for (let i = 0; i < this.imageValue.length; i++) { - if (this.imageValue[i].uuid === item.tempFile.uuid) { - this.imageValue.splice(i, 1) - } - } - console.log(this.imageValue) + this.background = '' + }, + backSelect(item) { + console.log('item',item) + this.postuploadFile(item.tempFiles[0], 'background') }, postuploadFile(path, type) { uploadFile(path.path).then(val => {