|
|
@@ -46,6 +46,21 @@
|
|
|
<textarea v-model="storeInfo.storeApplication" maxlength="100" ref="applicationTextarea"></textarea>
|
|
|
</div>
|
|
|
</li>
|
|
|
+ <li class="clearfix" :class="{border: storeState !== 'look'}">
|
|
|
+ <div class="name pull-left" :class="{update: storeState !== 'look'}">企业简介:</div>
|
|
|
+ <div class="text pull-left clearfix" v-if="storeState === 'look'">
|
|
|
+ {{IsEnlook ? dealWithEnText(storeInfo.enterprise.description) : dealWithEnText()}}
|
|
|
+ <a class="pull-right" @click="dealWithEnText2('open')" v-show="IsEnlook">
|
|
|
+ 全部<img src="/images/store/default/openblack.png"/>
|
|
|
+ </a>
|
|
|
+ <a class="pull-right upload" @click="dealWithEnText2('hide')" v-show="!hideEnlook">
|
|
|
+ 收起<img src="/images/store/default/openblack.png"/>
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ <div class="text pull-left" v-else>
|
|
|
+ <textarea v-model="storeInfo.enterprise.description" maxlength="500" ref="enTextarea"></textarea>
|
|
|
+ </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'">
|
|
|
@@ -143,6 +158,9 @@
|
|
|
normalText: '', // 原来文本
|
|
|
Islook: true,
|
|
|
hidelook: true,
|
|
|
+ normalEnText: '', // 原来文本
|
|
|
+ IsEnlook: true,
|
|
|
+ hideEnlook: true,
|
|
|
timeoutCount: 0,
|
|
|
collectResult: ''
|
|
|
}
|
|
|
@@ -153,9 +171,14 @@
|
|
|
this.setTextareaHeight()
|
|
|
}
|
|
|
},
|
|
|
- 'storeInfo.storeApplication': {
|
|
|
+// 'storeInfo.storeApplication': {
|
|
|
+// handler: function (val) {
|
|
|
+// this.setApplicationTextareaHeight()
|
|
|
+// }
|
|
|
+// },
|
|
|
+ 'storeInfo.enterprise.description': {
|
|
|
handler: function (val) {
|
|
|
- this.setApplicationTextareaHeight()
|
|
|
+ this.setEnTextareaHeight()
|
|
|
}
|
|
|
}
|
|
|
// 'storeInfo.enterprise.address': {
|
|
|
@@ -177,8 +200,11 @@
|
|
|
this.storeState = 'update'
|
|
|
this.Islook = true
|
|
|
this.hidelook = true
|
|
|
+ this.IsEnlook = true
|
|
|
+ this.hideEnlook = true
|
|
|
this.setTextareaHeight()
|
|
|
this.setApplicationTextareaHeight()
|
|
|
+ this.setEnTextareaHeight()
|
|
|
// this.setAddarea()
|
|
|
},
|
|
|
dealWithText2(tp) {
|
|
|
@@ -190,6 +216,15 @@
|
|
|
this.hidelook = true
|
|
|
}
|
|
|
},
|
|
|
+ dealWithEnText2(tp) {
|
|
|
+ if (tp === 'open') {
|
|
|
+ this.IsEnlook = false
|
|
|
+ this.hideEnlook = false
|
|
|
+ } else {
|
|
|
+ this.IsEnlook = true
|
|
|
+ this.hideEnlook = true
|
|
|
+ }
|
|
|
+ },
|
|
|
dealWithText(_T) {
|
|
|
if (_T !== undefined) {
|
|
|
// 文本处理
|
|
|
@@ -206,6 +241,22 @@
|
|
|
return this.normalText && this.normalText.length ? this.normalText : '暂无信息'
|
|
|
}
|
|
|
},
|
|
|
+ dealWithEnText(_T) {
|
|
|
+ if (_T !== undefined) {
|
|
|
+ // 文本处理
|
|
|
+ this.normalEnText = _T
|
|
|
+ if (_T.length < 140) {
|
|
|
+ this.IsEnlook = false
|
|
|
+ return _T
|
|
|
+ } else {
|
|
|
+ this.IsEnlook = true
|
|
|
+ return _T.substr(0, 140) + '...'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.IsEnlook = false
|
|
|
+ return this.normalEnText && this.normalEnText.length ? this.normalEnText : '暂无信息'
|
|
|
+ }
|
|
|
+ },
|
|
|
storeInfosave(_tp) {
|
|
|
this.BScroll.refresh()
|
|
|
if (_tp === 'cancel') {
|
|
|
@@ -229,8 +280,8 @@
|
|
|
this.timeoutCount++
|
|
|
return false
|
|
|
}
|
|
|
- if (!this.storeInfo.enterprise.address || this.storeInfo.enterprise.address === '') {
|
|
|
- this.collectResult = '企业地址不能为空'
|
|
|
+ if (!this.storeInfo.enterprise.description || this.storeInfo.enterprise.description === '') {
|
|
|
+ this.collectResult = '企业简介不能为空'
|
|
|
this.timeoutCount++
|
|
|
return false
|
|
|
}
|
|
|
@@ -295,6 +346,15 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ setEnTextareaHeight () {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let el = this.$refs.enTextarea
|
|
|
+ if (el) {
|
|
|
+ el.style.height = '2rem'
|
|
|
+ el.style.height = (el.scrollHeight * 2.06 - el.clientHeight + 150) / 100 + 'rem'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// setAddarea () {
|
|
|
// this.$nextTick(() => {
|
|
|
// let el = this.$refs.addTextarea
|
|
|
@@ -327,7 +387,6 @@
|
|
|
storeI() {
|
|
|
let str = JSON.stringify(this.$store.state.option.storeStatus.data)
|
|
|
this.storeInfo = JSON.parse(str)
|
|
|
- console.log(this.storeInfo)
|
|
|
return ''
|
|
|
},
|
|
|
isAdmin () {
|