|
|
|
@ -2,9 +2,10 @@ |
|
|
|
|
<view class="addressList"> |
|
|
|
|
<view class="addressList-hd"> |
|
|
|
|
<view class="items"> |
|
|
|
|
<view class="a">首页广告图片<text>(最多可上传 5张 尺寸 230px*236px 大小5M)</text></view> |
|
|
|
|
<view class="a">门店相册图片<text>(最多可上传 5张 尺寸 230px*236px 大小5M)</text></view> |
|
|
|
|
<view class="c"> |
|
|
|
|
<u-upload :action="action" width="160" height="160" :file-list="fileList" :custom-btn="true" max-count="5"> |
|
|
|
|
<u-upload :action="action" :header="header" width="160" @on-uploaded="success" max-count="5" |
|
|
|
|
height="160" :file-list="fileList" :custom-btn="true" :max-size="1 * 1024 * 1024"> |
|
|
|
|
<template v-slot:addBtn> |
|
|
|
|
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> |
|
|
|
|
<image src="/static/news/icon-upload.png"></image> |
|
|
|
@ -15,35 +16,10 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="items"> |
|
|
|
|
<view class="a">进群分享图<text>(最多可上传 5张 尺寸 230px*236px 大小5M)</text></view> |
|
|
|
|
<view class="a">进群分享图<text>(最多可上传 1张 )</text></view> |
|
|
|
|
<view class="c"> |
|
|
|
|
<u-upload :action="action" width="160" height="160" :file-list="fileList" :custom-btn="true" max-count="5"> |
|
|
|
|
<template v-slot:addBtn> |
|
|
|
|
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> |
|
|
|
|
<image src="/static/news/icon-upload.png"></image> |
|
|
|
|
<view class="1">上传图片</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</u-upload> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="items"> |
|
|
|
|
<view class="a">活动广告图片<text>(最多可上传 5张 尺寸 230px*236px 大小5M)</text></view> |
|
|
|
|
<view class="c"> |
|
|
|
|
<u-upload :action="action" width="160" height="160" :file-list="fileList" :custom-btn="true" max-count="5"> |
|
|
|
|
<template v-slot:addBtn> |
|
|
|
|
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> |
|
|
|
|
<image src="/static/news/icon-upload.png"></image> |
|
|
|
|
<view class="1">上传图片</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</u-upload> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="items"> |
|
|
|
|
<view class="a">首页广告图片<text>(最多可上传 5张 尺寸 230px*236px 大小5M)</text></view> |
|
|
|
|
<view class="c"> |
|
|
|
|
<u-upload :action="action" width="160" height="160" :file-list="fileList" :custom-btn="true" max-count="5"> |
|
|
|
|
<u-upload :action="action" :header="header" @on-uploaded="success" width="160" height="160" |
|
|
|
|
:file-list="fileList" :custom-btn="true" max-count="1"> |
|
|
|
|
<template v-slot:addBtn> |
|
|
|
|
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> |
|
|
|
|
<image src="/static/news/icon-upload.png"></image> |
|
|
|
@ -54,37 +30,75 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="addressList-fd"> |
|
|
|
|
<view class="addressList-fd" @click="onSaveSubmit"> |
|
|
|
|
<view class="btn">保存</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
export default { |
|
|
|
|
import Config from '@/core/config' |
|
|
|
|
import * as help from '@/api/help' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
checked: false, |
|
|
|
|
action: '', |
|
|
|
|
header: {}, |
|
|
|
|
value: "", |
|
|
|
|
fileList: [ |
|
|
|
|
{ |
|
|
|
|
url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg', |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
fileList: [], |
|
|
|
|
image_ids: [] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
onReady() { |
|
|
|
|
this.action = (Config.get('apiUrl') + 'upload/image').replace("index.php?s=/", "") |
|
|
|
|
this.header = { |
|
|
|
|
'Storeid': uni.getStorageSync('Store').storeInfo.store_id, |
|
|
|
|
'Access-Token': uni.getStorageSync('AccessToken'), |
|
|
|
|
'platform': "MP-WEIXIN", |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//接受上传返回的数据 |
|
|
|
|
success(list) { |
|
|
|
|
if (list.length > 0) { |
|
|
|
|
const { response } = list[0]; |
|
|
|
|
if (response.status == 200) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "上传成功" |
|
|
|
|
}) |
|
|
|
|
// this.image_ids = response.data.fileInfo.file_id |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onSaveSubmit() { |
|
|
|
|
help.storeSet({image_ids:this.image_ids}) |
|
|
|
|
.then(res => { |
|
|
|
|
if (res.status) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '设置成功', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.finally() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.addressList{ |
|
|
|
|
.addressList { |
|
|
|
|
padding: 0 0 20rpx; |
|
|
|
|
overflow: hidden; |
|
|
|
|
&-hd{ |
|
|
|
|
|
|
|
|
|
&-hd { |
|
|
|
|
background-color: #fff; |
|
|
|
|
padding: 0 25rpx 25rpx; |
|
|
|
|
overflow: hidden; |
|
|
|
|
.item{ |
|
|
|
|
|
|
|
|
|
.item { |
|
|
|
|
padding: 20rpx 0; |
|
|
|
|
line-height: 50rpx; |
|
|
|
|
font-size: 28rpx; |
|
|
|
@ -93,41 +107,49 @@ |
|
|
|
|
align-items: center; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
border-bottom: 1px solid #F7F7F7; |
|
|
|
|
.b{ |
|
|
|
|
|
|
|
|
|
.b { |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
color: #9D9D9D; |
|
|
|
|
flex: 1; |
|
|
|
|
text-align: right; |
|
|
|
|
input{ |
|
|
|
|
|
|
|
|
|
input { |
|
|
|
|
width: 100%; |
|
|
|
|
line-height: 50rpx; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
color: #212121; |
|
|
|
|
} |
|
|
|
|
.select{ |
|
|
|
|
|
|
|
|
|
.select { |
|
|
|
|
color: #C7C7C7; |
|
|
|
|
&-on{ |
|
|
|
|
|
|
|
|
|
&-on { |
|
|
|
|
color: #212121; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.items{ |
|
|
|
|
|
|
|
|
|
.items { |
|
|
|
|
padding: 20rpx 0; |
|
|
|
|
line-height: 50rpx; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
color: #212121; |
|
|
|
|
.a{ |
|
|
|
|
text{ |
|
|
|
|
|
|
|
|
|
.a { |
|
|
|
|
text { |
|
|
|
|
font-size: 24rpx; |
|
|
|
|
font-weight: 400; |
|
|
|
|
color: #ABABAB; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.c{ |
|
|
|
|
|
|
|
|
|
.c { |
|
|
|
|
padding-top: 20rpx; |
|
|
|
|
overflow: hidden; |
|
|
|
|
.slot-btn{ |
|
|
|
|
|
|
|
|
|
.slot-btn { |
|
|
|
|
width: 80px; |
|
|
|
|
height: 80px; |
|
|
|
|
background: #FFFFFF; |
|
|
|
@ -137,7 +159,8 @@ |
|
|
|
|
font-size: 24rpx; |
|
|
|
|
font-weight: 500; |
|
|
|
|
color: #D1D1D1; |
|
|
|
|
image{ |
|
|
|
|
|
|
|
|
|
image { |
|
|
|
|
width: 50rpx; |
|
|
|
|
height: 50rpx; |
|
|
|
|
margin-top: 20rpx; |
|
|
|
@ -148,20 +171,23 @@ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
&-fd{ |
|
|
|
|
&-fd { |
|
|
|
|
width: 100%; |
|
|
|
|
position: fixed; |
|
|
|
|
left: 0; |
|
|
|
|
bottom: 0; |
|
|
|
|
padding: 30rpx; |
|
|
|
|
text-align: center; |
|
|
|
|
background-color: #fafafa; |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
.btn{ |
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
|
|
.btn { |
|
|
|
|
width: 630rpx; |
|
|
|
|
line-height: 96rpx; |
|
|
|
|
background: #F34A40; |
|
|
|
|
border-radius: 8rpx; |
|
|
|
|
border-radius: 72rpx; |
|
|
|
|
text-align: center; |
|
|
|
|
display: inline-block; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
font-weight: 500; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|