Browse Source

Merge branch 'master' into release-20170915

yangc 7 years ago
parent
commit
c8f76aae38

+ 3 - 47
components/mobile/applyPurchase/PublishSeek.vue

@@ -47,49 +47,7 @@
   </div>
 </template>
 <script>
-  let formatDate = function (date, fmt) {
-    if (typeof date === 'string') {
-      date = new Date(Date.parse(date.replace(/-/g, '/')))
-    }
-    let o = {
-      'M+': date.getMonth() + 1, // 月份
-      'd+': date.getDate(), // 日
-      'h+': 23, // 小时
-      'm+': 59, // 分
-      's+': 59, // 秒
-      'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
-      'S': date.getMilliseconds() // 毫秒
-    }
-    if (/(y+)/.test(fmt)) {
-      fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
-    }
-    for (let k in o) {
-      if (new RegExp('(' + k + ')').test(fmt)) {
-        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
-      }
-    }
-    return fmt
-  }
-  let getRealLen = function (str) {
-    let len = 0
-    for (let i = 0; i < str.length; i++) {
-      if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
-        len += 2
-      } else {
-        len++
-      }
-    }
-    return len
-  }
-  let cutOutString = function (str, length) {
-    for (let i = 1; i <= str.length; i++) {
-      if (getRealLen(str.substr(0, i)) > length) {
-        str = str.substr(0, i - 1)
-        break
-      }
-    }
-    return str
-  }
+  import { formatDate, getRealLen, cutOutString } from '~utils/baseUtils'
   export default {
     props: ['showSayPriceBox'],
     data () {
@@ -122,10 +80,8 @@
         return formatDate(new Date(), 'yyyy-MM-dd')
       },
       maxDay: function () {
-        let deadDate = new Date()
-        deadDate.setMonth(deadDate.getMonth() + 3)
-        deadDate.setDate(deadDate.getDate() + 1)
-        deadDate = formatDate(deadDate, 'yyyy-MM-dd')
+        let deadDate = new Date().getTime() + 1000 * 60 * 60 * 24 * 90
+        deadDate = formatDate(new Date(deadDate), 'yyyy-MM-dd')
         return deadDate
       }
     },

+ 2 - 2
components/mobile/applyPurchase/PublishSupplierSeek.vue

@@ -46,8 +46,8 @@
         return formatDate(new Date(), 'yyyy-MM-dd')
       },
       maxDay: function () {
-        let deadDate = new Date(Date.now() + 1000 * 60 * 60 * 24 * 30 * 3)
-        deadDate = formatDate(deadDate, 'yyyy-MM-dd')
+        let deadDate = new Date().getTime() + 1000 * 60 * 60 * 24 * 90
+        deadDate = formatDate(new Date(deadDate), 'yyyy-MM-dd')
         return deadDate
       }
     },

+ 9 - 8
components/mobile/search/MainSearch.vue

@@ -32,7 +32,7 @@
         <img src="/images/mobile/@2x/home/hot-search.png" alt="">
         <ul>
           <li v-for="hotword in hotwords">
-            <nuxt-link :to="hotword.url" v-text="hotword.name"></nuxt-link>
+            <a :href="hotword.url" v-text="hotword.name"></a>
           </li>
         </ul>
       </div>
@@ -57,12 +57,13 @@
         type: Array,
         default () {
           return [
-            {name: 'DSP1-DC5V-F', url: '/mobile/brand/componentDetail/0900300200000669'},
-            {name: 'Vishay', url: '/mobile/brand/30327265e42a871be050007f01003d96'},
-            {name: 'Panasonic', url: '/mobile/brand/30327265e47d871be050007f01003d96'},
-            {name: 'Taiyo Yuden', url: '/mobile/brand/30327265e4be871be050007f01003d96'},
-            {name: 'AE324FB5PN', url: '/mobile/brand/componentDetail/0900502200684613'}
-          ]
+            {name: '深圳华商龙', url: 'https://www.usoftmall.com/mobile/shop/worldshine'},
+            {name: 'DSP1-DC5V-F', url: 'https://www.usoftmall.com/mobile/brand/componentDetail/0900300200000669'},
+            {name: 'Vishay', url: 'https://www.usoftmall.com/mobile/brand/30327265e42a871be050007f01003d96'},
+            {name: 'Panasonic', url: 'https://www.usoftmall.com/mobile/brand/30327265e47d871be050007f01003d96'},
+            {name: 'Taiyo Yuden', url: 'https://www.usoftmall.com/mobile/brand/30327265e4be871be050007f01003d96'},
+            {name: 'AE324FB5PN', url: 'https://www.usoftmall.com/mobile/brand/componentDetail/0900502200684613'}
+            ]
         }
       }
     },
@@ -337,7 +338,7 @@
           margin-top: .31rem;
           li {
             display: inline-block;
-            max-width: 2.83rem;
+            /*max-width: 2.83rem;*/
             overflow: hidden;
             text-overflow: ellipsis;
             white-space: nowrap;

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

@@ -10,11 +10,16 @@
       <span :class="activeType=='product'?'mobile-switch-btn active':'mobile-switch-btn'" @click="activeType='product'">产品</span>
       <span :class="activeType=='detail'?'mobile-switch-btn active':'mobile-switch-btn'" @click="activeType='detail'">介绍</span>
     </div>
-    <div class="store-description" v-if="activeType=='detail'">
+    <div class="store-description" v-if="activeType=='detail' && store.description && store.description.length">
       <p>
         {{store.description}}
       </p>
     </div>
+    <div class="com-none-state" v-if="activeType=='detail' && (!store.description || !store.description.length)">
+      <img src="/images/mobile/@2x/empty-collect.png">
+      <p>抱歉,暂无店铺简介</p>
+      <nuxt-link to="/">返回首页</nuxt-link>
+    </div>
     <div class="product-store" v-if="activeType == 'product'">
       <table v-if="commodities.content&&commodities.content.length > 0">
         <thead id="product-head" >

+ 25 - 5
components/mobile/supplier/List.vue

@@ -10,18 +10,18 @@
       </div>
     </div>
     <ul>
-      <!--<li v-for="item in listData">-->
-      <nuxt-link v-bind:key="item.id" v-for="item in listData" tag="li" :to="`/mobile/supplier/detail/${item.enUU}?isStore=${item.isStore}`">
+      <li v-for="item in listData" @click="goSupplierDetail(item)">
         <img v-if="item.isStore == 1" class="open" src="/images/mobile/supplier/is-open.png" alt="">
         <span>{{item.enName}}</span>
         <!--<img class="tag" src="/images/mobile/supplier/tag.png" alt="">-->
         <i class="tag iconfont icon-xiangyou"></i>
-      </nuxt-link>
-      <!--</li>-->
+      </li>
     </ul>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
   </div>
 </template>
 <script>
+  import { RemindBox } from '~components/mobile/common'
   export default {
     data () {
       return {
@@ -31,9 +31,14 @@
         size: 10,
         listData: [],
         isChange: false,
-        isDataChange: false
+        isDataChange: false,
+        remindText: '',
+        timeoutCount: 0
       }
     },
+    components: {
+      RemindBox
+    },
     mounted: function () {
       this.$nextTick(() => {
         window.addEventListener('scroll', this.scroll, false)
@@ -86,6 +91,21 @@
         this.page = 1
         this.isChange = true
         this.reloadData()
+      },
+      goSupplierDetail: function (item) {
+        // /mobile/supplier/detail/${item.enUU}?isStore=${item.isStore}
+        this.$http.get('/vendor/introduction/product/count', {params: {vendUU: item.enUU}})
+          .then(response => {
+            if (response.data.success && response.data.count > 0) {
+              this.$router.push(`/mobile/supplier/detail/${item.enUU}?isStore=${item.isStore}`)
+            } else {
+              this.onRemind('供应商正在完善产品信息,暂时不能查看更多。')
+            }
+          })
+      },
+      onRemind: function(str) {
+        this.remindText = str
+        this.timeoutCount++
       }
     }
   }

+ 20 - 8
pages/mobile/user/index.vue

@@ -8,7 +8,7 @@
           <span class="en-name">{{enterpriseInfo.enName}}</span>
           <a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a>
           <span class="vir">|</span>
-          <a class="exit" @click="logout">退出</a>
+          <a class="exit" @click="showLogout = true">退出</a>
         </p>
         <ul class="en-list" v-show="showEnterpriseToggle">
           <li class="menu-item"
@@ -251,6 +251,17 @@
         </div>
       </div>
     </div>
+    <div class="deleteKuang" v-if="showLogout">
+      <div class="kuangContent">
+        <div class="title">系统提示</div>
+        <div class="titleinfo">是否退出登录</div>
+        <!--<div class="info" v-show="isUploadpro">*存在已上架信息</div>-->
+        <div class="K_btn">
+          <div class="cancelBtn" @click="showLogout = false">取消</div>
+          <div class="answerBtn" @click="logout()">确定</div>
+        </div>
+      </div>
+    </div>
     <!-- /end 删除提示框 -->
     <!-- 企业产品库 查看信息 -->
     <div class="deleteKuang" v-show="showMoreinfn">
@@ -376,7 +387,8 @@
         EnterprisePage: 1,
         vendorlist: [], // 查看更多信息
         showMoreinfn: false, // 是否打开更多信息
-        chooseItem: {}
+        chooseItem: {},
+        showLogout: false  // 退出登录提示框
       }
     },
     components: {
@@ -921,6 +933,8 @@
           max-height: 3rem;
           overflow-y: auto;
           border-radius: .05rem;
+          background: rgba(0, 0, 0, .6);
+          z-index: 10;
           .menu-item {
             height: .6rem;
             line-height: .6rem;
@@ -929,7 +943,6 @@
             overflow: hidden;
             white-space: nowrap;
             text-overflow: ellipsis;
-            background: rgba(0, 0, 0, .6);
             &:active, &:focus, &:hover {
               background: #7d7d7d;
             }
@@ -1397,10 +1410,10 @@
   .deleteKuang {
     position: fixed;
     background: rgba(0,0,0,0.5);
-    top: 0px;
-    left: 0px;
-    right: 0px;
-    bottom: 0px;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
     z-index: 9999;
     .kuangContent {
       border-radius: 5px;
@@ -1410,7 +1423,6 @@
       left: 50%;
       top: 50%;
       transform: translate3d(-50%, -50%, 0);
-      border-radius: 5px;
       overflow: hidden;
       .titleinfo {
         font-size: .3rem;