yangc 7 years ago
parent
commit
bb012a32e4

+ 2 - 1
components/help/left.vue

@@ -37,7 +37,8 @@
     },
     computed: {
       helps () {
-        let list = this.$store.state.help.snapsho.data.sort(compare('detno'))
+        let data = this.$store.state.help.snapsho.data.slice()
+        let list = data.sort(compare('detno'))
         if (list) {
           for (let i = 0; i < list.length; i++) {
             list[i].children = list[i].children.sort(compare('detno'))

+ 1 - 0
components/mobile/store/StoreDetail.vue

@@ -305,6 +305,7 @@
         height: 95%;
         box-shadow: 0 .03rem .01rem 0 #cdcbcb96;
         line-height: .5rem;
+        word-break: break-all;
       }
     }
     .product-store {

+ 2 - 1
pages/mobile/center/index.vue

@@ -433,7 +433,8 @@
       return Promise.all([
         store.dispatch('product/saveStores', { count: 100, page: 1, type: 'component' }),
         store.dispatch('shop/StoreFocusPage', { count: 100, page: 1 }),
-        store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadVendorPushList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', params)
+        store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadVendorPushList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', params),
+        store.dispatch('loadStoreStatus', { op: 'check' })
       ])
     },
     watch: {

+ 26 - 16
pages/mobile/user/storeinfo.vue

@@ -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: {