|
|
@@ -43,7 +43,7 @@
|
|
|
{{storeInfo.enterprise.address || '暂无信息'}}
|
|
|
</div>
|
|
|
<div v-else class="text pull-left">
|
|
|
- <input v-model="storeInfo.enterprise.address" type="text"/>
|
|
|
+ <input v-model="storeInfo.enterprise.address" type="text" maxlength="50"/>
|
|
|
</div>
|
|
|
</li>
|
|
|
<li class="clearfix" :class="{border: storeState !== 'look'}">
|
|
|
@@ -52,7 +52,7 @@
|
|
|
{{storeInfo.enterprise.enTel || '暂无信息'}}
|
|
|
</div>
|
|
|
<div v-else class="text pull-left">
|
|
|
- <input v-model="storeInfo.enterprise.enTel" type="text"/>
|
|
|
+ <input v-model="storeInfo.enterprise.enTel" type="text" maxlength="20"/>
|
|
|
</div>
|
|
|
</li>
|
|
|
<li class="clearfix" :class="{border: storeState !== 'look'}">
|
|
|
@@ -61,7 +61,7 @@
|
|
|
{{storeInfo.enterprise.enFax || '暂无信息'}}
|
|
|
</div>
|
|
|
<div v-else class="text pull-left">
|
|
|
- <input v-model="storeInfo.enterprise.enFax" type="text"/>
|
|
|
+ <input v-model="storeInfo.enterprise.enFax" type="text" maxlength="20"/>
|
|
|
</div>
|
|
|
</li>
|
|
|
<li class="clearfix" :class="{border: storeState !== 'look'}">
|
|
|
@@ -70,7 +70,7 @@
|
|
|
{{storeInfo.enterprise.enPhone || '暂无信息'}}
|
|
|
</div>
|
|
|
<div v-else class="text pull-left">
|
|
|
- <input v-model="storeInfo.enterprise.enPhone" type="text"/>
|
|
|
+ <input v-model="storeInfo.enterprise.enPhone" type="text" maxlength="11"/>
|
|
|
</div>
|
|
|
</li>
|
|
|
<li class="clearfix" :class="{border: storeState !== 'look'}">
|
|
|
@@ -79,7 +79,7 @@
|
|
|
{{storeInfo.enterprise.enWeixin || '暂无信息'}}
|
|
|
</div>
|
|
|
<div v-else class="text pull-left">
|
|
|
- <input v-model="storeInfo.enterprise.enWeixin" type="text"/>
|
|
|
+ <input v-model="storeInfo.enterprise.enWeixin" type="text" maxlength="20"/>
|
|
|
</div>
|
|
|
</li>
|
|
|
<li class="clearfix" :class="{border: storeState !== 'look'}">
|
|
|
@@ -88,7 +88,7 @@
|
|
|
{{storeInfo.enterprise.enQQ || '暂无信息'}}
|
|
|
</div>
|
|
|
<div v-else class="text pull-left">
|
|
|
- <input v-model="storeInfo.enterprise.enQQ" type="text"/>
|
|
|
+ <input v-model="storeInfo.enterprise.enQQ" type="text" maxlength="11"/>
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
@@ -140,12 +140,7 @@
|
|
|
watch: {
|
|
|
'storeInfo.description': {
|
|
|
handler: function (val) {
|
|
|
- let el = this.$refs.descTextarea
|
|
|
- if (el) {
|
|
|
- console.log(el.scrollHeight)
|
|
|
- console.log(el.clientHeight)
|
|
|
- el.style.height = (el.scrollHeight + 92) / 100 + 'rem'
|
|
|
- }
|
|
|
+ this.setTextareaHeight()
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -162,6 +157,7 @@
|
|
|
this.storeState = 'update'
|
|
|
this.Islook = true
|
|
|
this.hidelook = true
|
|
|
+ this.setTextareaHeight()
|
|
|
},
|
|
|
dealWithText2(tp) {
|
|
|
if (tp === 'open') {
|
|
|
@@ -216,22 +212,27 @@
|
|
|
this.timeoutCount++
|
|
|
return false
|
|
|
}
|
|
|
- if (!this.storeInfo.enterprise.enTel || this.storeInfo.enterprise.enTel === '') {
|
|
|
+ if (!this.storeInfo.enterprise.enFax || this.storeInfo.enterprise.enFax === '' || !/^[\d-]{8,20}$/.test(this.storeInfo.enterprise.enTel)) {
|
|
|
+ this.collectResult = '请输入正确的传真'
|
|
|
+ this.timeoutCount++
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (!this.storeInfo.enterprise.enTel || this.storeInfo.enterprise.enTel === '' || !/^[\d-]{8,20}$/.test(this.storeInfo.enterprise.enTel)) {
|
|
|
this.collectResult = '请输入正确的电话号码'
|
|
|
this.timeoutCount++
|
|
|
return false
|
|
|
}
|
|
|
- if (!/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(this.storeInfo.enterprise.enPhone) && this.storeInfo.enterprise.enPhone) {
|
|
|
+ if (!this.storeInfo.enterprise.enPhone || this.storeInfo.enterprise.enPhone === '' || !/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(this.storeInfo.enterprise.enPhone)) {
|
|
|
this.collectResult = '请输入正确的手机号码'
|
|
|
this.timeoutCount++
|
|
|
return false
|
|
|
}
|
|
|
- if (!/^[0-9a-zA-Z]{6,20}$/.test(this.storeInfo.enterprise.enWeixin) && this.storeInfo.enterprise.enWeixin) {
|
|
|
+ if (!this.storeInfo.enterprise.enWeixin || this.storeInfo.enterprise.enWeixin === '' || !/^[0-9a-zA-Z]{6,20}$/.test(this.storeInfo.enterprise.enWeixin)) {
|
|
|
this.collectResult = '请输入正确的微信号'
|
|
|
this.timeoutCount++
|
|
|
return false
|
|
|
}
|
|
|
- if (!/^[1-9][0-9]{4,10}$/.test(this.storeInfo.enterprise.enQQ) && this.storeInfo.enterprise.enQQ) {
|
|
|
+ if (!this.storeInfo.enterprise.enQQ || this.storeInfo.enterprise.enQQ === '' || !/^[1-9][0-9]{4,10}$/.test(this.storeInfo.enterprise.enQQ)) {
|
|
|
this.collectResult = '请输入正确的QQ号'
|
|
|
this.timeoutCount++
|
|
|
return false
|
|
|
@@ -252,6 +253,15 @@
|
|
|
let str = JSON.stringify(this.$store.state.option.storeStatus.data)
|
|
|
this.storeInfo = JSON.parse(str)
|
|
|
})
|
|
|
+ },
|
|
|
+ setTextareaHeight () {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let el = this.$refs.descTextarea
|
|
|
+ if (el) {
|
|
|
+// console.log(el.scrollHeight - el.clientHeight)
|
|
|
+ el.style.height = (el.scrollHeight * 2 - el.clientHeight + 50) / 100 + 'rem'
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
computed: {
|