|
|
@ -25,7 +25,7 @@ |
|
|
<view class="store-log store-image-flex"> |
|
|
<view class="store-log store-image-flex"> |
|
|
<uni-file-picker |
|
|
<uni-file-picker |
|
|
class="stotr-image-width" |
|
|
class="stotr-image-width" |
|
|
v-model="imageValue" |
|
|
|
|
|
|
|
|
v-model="logoImage" |
|
|
file-mediatype="image" |
|
|
file-mediatype="image" |
|
|
mode="grid" |
|
|
mode="grid" |
|
|
file-extname="png,jpg" |
|
|
file-extname="png,jpg" |
|
|
@ -35,6 +35,7 @@ |
|
|
@success="success" |
|
|
@success="success" |
|
|
@fail="fail" |
|
|
@fail="fail" |
|
|
@select="select" |
|
|
@select="select" |
|
|
|
|
|
@delete="deleteLogo" |
|
|
> |
|
|
> |
|
|
<image class="paper-upload-image" src="../../static/imgs/trade/uploadImage.png" mode=""></image> |
|
|
<image class="paper-upload-image" src="../../static/imgs/trade/uploadImage.png" mode=""></image> |
|
|
</uni-file-picker> |
|
|
</uni-file-picker> |
|
|
@ -44,7 +45,7 @@ |
|
|
<view class="store-log"> |
|
|
<view class="store-log"> |
|
|
<view class="tore-setting-name"><text>背景图片</text></view> |
|
|
<view class="tore-setting-name"><text>背景图片</text></view> |
|
|
<view class="store-log store-image-flex"> |
|
|
<view class="store-log store-image-flex"> |
|
|
<uni-file-picker class="stotr-image-widtht" @select="backSelect" :limit="1" fileMediatype="image" :image-styles="imageStylest"> |
|
|
|
|
|
|
|
|
<uni-file-picker @delete="deleteImage" class="stotr-image-widtht" v-model="backgroundImage" @select="backSelect" :limit="1" fileMediatype="image" :image-styles="imageStylest"> |
|
|
<image class="paper-upload-image" src="../../static/imgs/trade/uploadImage.png" mode=""></image> |
|
|
<image class="paper-upload-image" src="../../static/imgs/trade/uploadImage.png" mode=""></image> |
|
|
</uni-file-picker> |
|
|
</uni-file-picker> |
|
|
<view class="store-image-text">建议尺寸:750*370像素,尺寸不匹配时,图片将被压缩或拉伸以铺满画面</view> |
|
|
<view class="store-image-text">建议尺寸:750*370像素,尺寸不匹配时,图片将被压缩或拉伸以铺满画面</view> |
|
|
@ -64,7 +65,8 @@ export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
storeName: '', |
|
|
storeName: '', |
|
|
imageValue: [], |
|
|
|
|
|
|
|
|
logoImage: [], |
|
|
|
|
|
backgroundImage:[], |
|
|
background: '', |
|
|
background: '', |
|
|
logo: '', |
|
|
logo: '', |
|
|
imageStyles: { |
|
|
imageStyles: { |
|
|
@ -82,7 +84,29 @@ export default { |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
if (option) { |
|
|
if (option) { |
|
|
|
|
|
this.logoImage = [] |
|
|
|
|
|
this.backgroundImage = [] |
|
|
this.option = option |
|
|
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) { |
|
|
select(item) { |
|
|
this.postuploadFile(item.tempFiles[0], 'logo') |
|
|
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) { |
|
|
deleteImage(item) { |
|
|
console.log('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) { |
|
|
postuploadFile(path, type) { |
|
|
uploadFile(path.path).then(val => { |
|
|
uploadFile(path.path).then(val => { |
|
|
|