Browse Source

修改登录返回404的问题

shenjj 7 years ago
parent
commit
adbb790785

+ 3 - 3
components/news/Right.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="news-content col-md-9">
     <h4><span class="label label-primary">News</span>新闻资讯</h4>
-    <div class="news" v-for="item in news_show">
+    <div class="news" v-if="news_show && news_show.length > 0"  v-for="item in news_show">
       <div class="new">
         <div style="width: 120px;">
           <div class="thumbnail-news">
@@ -42,10 +42,10 @@
         return this.$store.state.newsData.newsPage.allNews
       },
       news_show () {
-        return this.new.data.content
+        return this.new.data.content ? this.new.data.content : []
       },
       totalCount () {
-        return this.new.data.count
+        return this.new.data.count ? this.new.data.count : 0
       }
     },
     filters: {

+ 31 - 0
layouts/mobileNoFooter.vue

@@ -0,0 +1,31 @@
+<template>
+  <div id="mobile">
+    <mobile-header></mobile-header>
+    <nuxt/>
+  </div>
+</template>
+<script>
+  import { MobileHeader } from '~components/mobile'
+  export default {
+    name: 'mobile',
+    components: {
+      MobileHeader
+    },
+//    middleware: 'authenticated',
+    head () {
+      return {
+        meta: [
+          { name: 'apple-mobile-web-app-capable', content: 'yes' },
+          { name: 'MobileOptimized', content: '320' },
+          { name: 'HandheldFriendly', content: 'true' },
+          { name: 'viewport', content: 'width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no' },
+          { 'http-equiv': 'Cache-Control', content: 'no-siteapp' },
+          { name: 'format-detection', content: 'telephone=no, email=no' }
+        ]
+      }
+    }
+  }
+</script>
+<style lang="scss">
+  @import '~assets/scss/mobileCommon';
+</style>

+ 2 - 2
pages/mobile/center/vendor/product.vue

@@ -248,7 +248,7 @@
     <div class="deleteKuang" v-show="showoffshelf">
       <div class="kuangContent">
         <div class="title">系统信息</div>
-        <div class="titleinfo">是否下架该产品</div>
+        <div class="titleinfo">是否下架该产品</div>
         <!--<div class="info" v-show="isUploadpro">*存在已上架信息</div>-->
         <div class="K_btn">
           <div class="cancelBtn" @click="cancelFn()">取消</div>
@@ -257,7 +257,7 @@
       </div>
     </div>
     <div class="none-state" v-show="StateNone">
-      <img src="/images/mobile/@2x/empty-collect.png">
+      <img src="/images/mobile/@2x/search-empty.png">
       <p>暂无数据</p>
       <nuxt-link to="/">返回首页</nuxt-link>
     </div>

+ 55 - 13
pages/mobile/center/vendor/productdetails.vue

@@ -31,13 +31,13 @@
         <div class="pull-left">
           <span class="name">规格:</span>
           <div class="specInput input">
-            <input type="text" placeholder="请输入规格" v-model="chooseItem.spec" maxlength="40"/>
+            <input type="text" placeholder="请输入规格" v-model="chooseItem.spec" maxlength="50"/>
             <img src="/images/mobile/product/close_icon.png" @click="deleteText('spec')"/>
           </div>
         </div>
         <div class="pull-right">
           <span class="name">库存:</span>
-          <input type="tel" placeholder="1" v-model="chooseItem.reserve" class="input reserveInput" maxlength="9" />
+          <input type="tel" placeholder="数量" v-model="chooseItem.reserve" class="input reserveInput" maxlength="9" />
         </div>
       </div>
       <div class="list clearfix">
@@ -100,7 +100,7 @@
         <li v-for="(item, index) in chooseItem.prices" v-bind:key="index">
           <div class="clearfix">
             <div class="pull-left">
-              <input type="number" placeholder="数量" class="otherNumber" v-model.lazy="item.start" :disabled="index === 0" :readonly="index === 0" @blur="startpriceBlur(item, index)" maxlength="9"/>
+              <input type="number" placeholder="数量" class="otherNumber" :class="{firstNumber: index === 0}" v-model.lazy="item.start" :disabled="index === 0" :readonly="index === 0" @blur="startpriceBlur(item, index)" maxlength="9"/>
               <label v-if="index !== chooseItem.prices.length - 1">-</label>
               <label v-if="index === chooseItem.prices.length - 1">以上</label>
               <input type="number" placeholder="数量" class="otherNumber" v-model.lazy="item.end" v-if="index !== chooseItem.prices.length - 1" @blur="endpriceBlur(item, index)" maxlength="9"/>
@@ -144,7 +144,7 @@
   import { RemindBox } from '~components/mobile/common'
   export default {
     name: 'productDetails',
-    layout: 'mobile',
+    layout: 'mobileNoFooter',
     components: {
       RemindBox
     },
@@ -226,7 +226,7 @@
       addPrice() {
         if (this.chooseItem.prices.length === 3) {
           this.timeoutCount++
-          this.collectResult = '批次最多只能有三个分段'
+          this.collectResult = '价格梯度最多只能有三个分段'
           return false
         }
         let copy = Object.assign({}, this.chooseItem.prices[this.chooseItem.prices.length - 1], {
@@ -338,9 +338,29 @@
       //     this.collectResult = '请输入正确的生产日期'
       //     return false
       //   }
-        if (!this.chooseItem.reserve) {
+        if (!this.chooseItem.reserve && toString(this.chooseItem.reserve).trim()) {
           this.timeoutCount++
-          this.collectResult = '库存'
+          this.collectResult = '库存不能为空'
+          return false
+        } else if (!/^\d{1,9}$/.test(this.chooseItem.reserve)) {
+          this.timeoutCount++
+          this.collectResult = '库存只能输入数字'
+          return false
+        } else if (!/^\d{1,6}$/.test(this.chooseItem.minPackQty)) {
+          this.timeoutCount++
+          this.collectResult = '最小包装数只能输入数字'
+          return false
+        } else if (this.chooseItem.minPackQty && !toString(this.chooseItem.minPackQty).trim()) {
+          this.timeoutCount++
+          this.collectResult = '最小包装数不能为空'
+          return false
+        } else if (!/^\d{1,6}$/.test(this.chooseItem.minBuyQty)) {
+          this.timeoutCount++
+          this.collectResult = '最小起订量只能输入数字'
+          return false
+        } else if (this.chooseItem.minBuyQty && !toString(this.chooseItem.minBuyQty).trim()) {
+          this.timeoutCount++
+          this.collectResult = '最小起订量不能为空'
           return false
         } else if (!this.chooseItem.tag) {
           this.timeoutCount++
@@ -350,6 +370,18 @@
           this.timeoutCount++
           this.collectResult = '请填写生产日期'
           return false
+        } else if (!this.chooseItem.minDelivery && !toString(this.chooseItem.minDelivery).trim()) {
+          this.timeoutCount++
+          this.collectResult = '请填写最小交期时间'
+          return false
+        } else if (!this.chooseItem.maxDelivery && !toString(this.chooseItem.maxDelivery).trim()) {
+          this.timeoutCount++
+          this.collectResult = '请填写最大交期时间'
+          return false
+        } else if (!/^\d{1,3}$/.test(this.chooseItem.minDelivery) || !/^\d{1,3}$/.test(this.chooseItem.maxDelivery)) {
+          this.timeoutCount++
+          this.collectResult = '交期时间只能输入数字'
+          return false
         } else {
           let isHas = false
           for (let i = 0; i < this.chooseItem.prices.length; i++) {
@@ -368,6 +400,16 @@
               this.collectResult = '单价必须是大于0的数字'
               isHas = true
               break
+            } else if (!/^\d+$/.test(this.chooseItem.prices[i].start) || !/^\d+$/.test(this.chooseItem.prices[i].end)) {
+              this.timeoutCount++
+              this.collectResult = '分段数量必须是正整数'
+              isHas = true
+              break
+            } else if (!/^[0-9]+([.]{1}[1-9]{1,6})?$/.test(this.chooseItem.prices[i].rMBPrice)) {
+              this.timeoutCount++
+              this.collectResult = '单价只能输入数字'
+              isHas = true
+              break
             }
           }
           if (isHas === true) {
@@ -403,7 +445,7 @@
   .productDetails {
     background: #fff;
     margin: .2rem 0.2rem 0;
-    padding: 0.9rem 0 1.2rem 0;
+    padding: 0.9rem 0 0.5rem 0;
     .product {
       /*background: #fff;*/
       /*margin: .2rem 0.2rem 0;*/
@@ -465,7 +507,7 @@
           vertical-align: top;
           margin-left: 0.3rem;
           margin-top: 0.26rem;
-          background: #f1f3f7;
+          background: #c4c5c6;
           .progress-btn {
             position: absolute;
             height: 0.28rem;
@@ -498,7 +540,7 @@
           text-indent: 0;
           input {
             width: 2.02rem;
-            color: #999;
+            color: #333;
             font-size: .24rem;
             height: 0.46rem;
             vertical-align: top;
@@ -586,7 +628,7 @@
           text-indent: 0;
           input {
             width: 4.7rem;
-            color: #999;
+            color: #333;
             font-size: .24rem;
             height: 0.44rem;
             vertical-align: top;
@@ -646,7 +688,7 @@
           }
           .firstNumber {
             width: 0.4rem;
-            background: #eeeeee;
+            background: #eeeeee !important;
             height: 0.5rem;
             border:1px solid #d2d2d2;
             border-radius: 3px;
@@ -656,7 +698,7 @@
           }
           .otherNumber {
             width: 1.6rem;
-            background: #eeeeee;
+            background: #fff;
             height: 0.5rem;
             border:1px solid #d2d2d2;
             border-radius: 3px;