|
|
@@ -13,6 +13,22 @@
|
|
|
<div class="scroll">
|
|
|
<div class="si-wrap">
|
|
|
<ul class="infoul" :class="{'no-edit': !isAdmin}">
|
|
|
+ <li class="clearfix" :class="{border: storeState !== 'look'}">
|
|
|
+ <div class="name pull-left" :class="{update: storeState !== 'look'}">店铺LOGO:</div>
|
|
|
+ <div class="file_logo pull-left">
|
|
|
+ <div class="file_img">
|
|
|
+ <img :src="imageUploadUrl ? imageUploadUrl : storeInfo.logoUrl ? storeInfo.logoUrl : '/images/logo/default.png'">
|
|
|
+ </div>
|
|
|
+ <div class="file_input" v-if="storeState !== 'look'">
|
|
|
+ <input type="file"
|
|
|
+ class="file-input"
|
|
|
+ name="name"
|
|
|
+ accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png"
|
|
|
+ @change="uploadImg"/>
|
|
|
+ <span>仅支持JPG、PNG、GIF格式,大小不超过500kb,建议使用220*220的图片</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
<li class="clearfix" :class="{border: storeState !== 'look'}">
|
|
|
<div class="name pull-left" :class="{update: storeState !== 'look'}">店铺名称:</div>
|
|
|
<div class="text pull-left" v-if="storeState === 'look'">
|
|
|
@@ -145,13 +161,14 @@
|
|
|
export default {
|
|
|
layout: 'mobileNoHeader',
|
|
|
middleware: 'authenticated',
|
|
|
- fetch ({ store, route }) {
|
|
|
+ fetch ({ store }) {
|
|
|
return Promise.all([
|
|
|
store.dispatch('loadStoreStatus', { op: 'check' })
|
|
|
])
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ imageUploadUrl: '',
|
|
|
storeState: 'look',
|
|
|
storeInfo: {},
|
|
|
splitText: '', // 省略号文本
|
|
|
@@ -188,6 +205,27 @@
|
|
|
// }
|
|
|
},
|
|
|
methods: {
|
|
|
+ uploadImg (e) {
|
|
|
+ let file = e.target.files[0]
|
|
|
+ if (file && file.size >= 500 * 1025) {
|
|
|
+ this.collectResult = '选择图片过大,请重新选择!'
|
|
|
+ this.timeoutCount++
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (file) {
|
|
|
+ let param = new FormData()
|
|
|
+ param.append('image', file, file.name)
|
|
|
+ let config = {
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'}
|
|
|
+ }
|
|
|
+ this.$http.post('/api/images', param, config)
|
|
|
+ .then(response => {
|
|
|
+ if (response.data) {
|
|
|
+ this.imageUploadUrl = response.data[0].path
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
setRemindText (str) {
|
|
|
this.collectResult = str
|
|
|
this.timeoutCount++
|
|
|
@@ -315,7 +353,8 @@
|
|
|
enterprise: this.storeInfo.enterprise,
|
|
|
storeName: this.storeInfo.storeName,
|
|
|
storeShortName: this.storeInfo.storeShortName,
|
|
|
- storeApplication: this.storeInfo.storeApplication
|
|
|
+ storeApplication: this.storeInfo.storeApplication,
|
|
|
+ logoUrl: this.imageUploadUrl
|
|
|
}
|
|
|
this.$http.put(`/store-service/stores/${this.storeInfo.uuid}?kind=BASIC_INFO`, kay).then(res => {
|
|
|
this.collectResult = '保存成功'
|
|
|
@@ -449,6 +488,36 @@
|
|
|
color: #666;
|
|
|
font-size: 0.28rem;
|
|
|
padding: 0 .24rem;
|
|
|
+ .file_logo{
|
|
|
+ position:relative;
|
|
|
+ width:4.4rem;
|
|
|
+ .file_img{
|
|
|
+ width:1rem;
|
|
|
+ display:inline-block;
|
|
|
+ img{
|
|
|
+ width:100%;
|
|
|
+ height: 1rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .file_input{
|
|
|
+ position:absolute;
|
|
|
+ top:0;
|
|
|
+ left:0;
|
|
|
+ display:inline-block;
|
|
|
+ vertical-align: top;
|
|
|
+ width:4.4rem;
|
|
|
+ input[type=file] {
|
|
|
+ opacity: 0;
|
|
|
+ width: 1rem;
|
|
|
+ height: 1rem;
|
|
|
+ float: left;
|
|
|
+ margin-right:.15rem;
|
|
|
+ }
|
|
|
+ span{
|
|
|
+ font-size: .14rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.upload {
|
|
|
img {
|
|
|
transform: rotate(180deg);
|
|
|
@@ -458,7 +527,7 @@
|
|
|
border-bottom: .01rem solid #d9d9d9;
|
|
|
min-height: 1.16rem;
|
|
|
line-height: normal;
|
|
|
- padding: .4rem .28rem;
|
|
|
+ padding: .4rem .2rem;
|
|
|
&.border {
|
|
|
border-bottom: .01rem solid #d9d9d9;
|
|
|
}
|
|
|
@@ -468,14 +537,14 @@
|
|
|
}
|
|
|
}
|
|
|
.name {
|
|
|
- width: 1.6rem;
|
|
|
+ width: 1.8rem;
|
|
|
text-align: right;
|
|
|
color: #226ce7;
|
|
|
}
|
|
|
&.no-edit {
|
|
|
color: #999;
|
|
|
.name {
|
|
|
- color: #999;
|
|
|
+ color: #226ce7;
|
|
|
}
|
|
|
}
|
|
|
.text {
|