shenjj преди 7 години
родител
ревизия
6f2b0ab984
променени са 6 файла, в които са добавени 143 реда и са изтрити 329 реда
  1. 135 115
      components/mobile/applyPurchase/SeekList.vue
  2. 0 3
      components/vendor/index.js
  3. 0 62
      components/vendor/toul.vue
  4. 2 1
      pages/applyPurchase/index.vue
  5. 2 1
      pages/provider/home.vue
  6. 4 147
      pages/vendor/index.vue

+ 135 - 115
components/mobile/applyPurchase/SeekList.vue

@@ -2,29 +2,35 @@
   <div>
     <ul class="seek-list">
       <li v-for="(item, index) in purchaseManList">
-        <div class="top">
+        <p>
           <span v-if="item.inquiry.enterprise && item.inquiry.enterprise.enName">{{[item.inquiry.enterprise.enName, user.logged] | enterpriseFilter}}</span>
           <span v-else>{{[item.userName, user.logged] | userNameFilter}}</span>
-        </div>
+        </p>
         <div>
           <div class="fl">
             <div>
-              类目(产品名称):<span>{{item.prodTitle || '-'}}</span>
+              类目(产品名称):
+              <span>{{item.prodTitle || '-'}}</span>
             </div>
             <div>
-              型号:<span>{{item.cmpCode || '-'}}</span>
+              型号:
+              <span>{{item.cmpCode || '-'}}</span>
             </div>
             <div>
-              品牌:<span>{{item.inbrand || '-'}}</span>
+              品牌:
+              <span>{{item.inbrand || '-'}}</span>
             </div>
             <div>
-              规格:<span>{{item.spec || '-'}}</span>
+              规格:
+              <span>{{item.spec || '-'}}</span>
             </div>
             <div>
-              采购数量:<span>{{item.needquantity || '-'}}</span>
+              采购数量:
+              <span>{{item.needquantity || '-'}}</span>
             </div>
             <div>
-              截止日期:<span class="date">{{item.endDate | date}}</span>
+              截止日期:
+              <span class="date">{{item.endDate | date}}</span>
             </div>
           </div>
           <div class="fr">
@@ -32,12 +38,12 @@
               <span v-if="getDay(item.remainingTime) > 0" v-text="getDay(item.remainingTime)"></span>
               <i v-if="getDay(item.remainingTime) > 0">&nbsp;天&nbsp;</i>
               <span v-if="getDay(item.remainingTime) <= 0" v-text="getHours(item.remainingTime)"></span>
-              <i v-if="getDay(item.remainingTime) <= 0" >&nbsp;小时</i>
+              <i v-if="getDay(item.remainingTime) <= 0">&nbsp;小时</i>
             </p>
             <p class="over-deadline" v-else>已截止</p>
             <!--<a v-if="!userType && item.quoted == 1">已报价</a>-->
             <a v-if="!userType && item.remainingTime > 0 && (!item.quoted || item.quoted != 1) && (user.logged && ((item.inquiry.enterprise && user.data.enterprise && (item.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && item.userUU == user.data.userUU  && !item.inquiry.enterprise)))" class="self-publish" @click="onRemind('此为贵公司的求购')">我要报价</a>
-            <a v-if="!(userType == 'saler' && seekType  && seekType != 'wait') && (item.remainingTime > 0 && (!item.quoted || item.quoted != 1) && !(user.logged && ((item.inquiry.enterprise && user.data.enterprise && (item.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && item.userUU == user.data.userUU  && !item.inquiry.enterprise))))"  @click="goSayPrice(item.id, index)">我要报价</a>
+            <a v-if="!(userType == 'saler' && seekType  && seekType != 'wait') && (item.remainingTime > 0 && (!item.quoted || item.quoted != 1) && !(user.logged && ((item.inquiry.enterprise && user.data.enterprise && (item.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && item.userUU == user.data.userUU  && !item.inquiry.enterprise))))" @click="goSayPrice(item.id, index)">我要报价</a>
             <a v-if="((!userType || userType == 'buyer') && (seekType  && seekType != 'wait')) || (userType == 'saler' && seekType  && seekType != 'wait') || item.quoted == 1" @click="goSayPriceInfo(item.quteId || item.id, item.agreed, index)">查看报价</a>
           </div>
         </div>
@@ -54,125 +60,146 @@
   </div>
 </template>
 <script>
-  import {LoginBox, RemindBox} from '~components/mobile/common'
-  import {SayPrice, SayPriceInfo} from '~components/mobile/applyPurchase'
-  export default {
-    components: {
-      LoginBox,
-      SayPrice,
-      RemindBox,
-      SayPriceInfo
-    },
-    data () {
-      return {
-        showLoginBox: false,
-        showSayPriceBox: false,
-        showSayPriceInfoBox: false,
-        activeIndex: -1,
-        remindText: '',
-        timeoutCount: 0,
-        agreed: 0
+import { LoginBox, RemindBox } from '~components/mobile/common'
+import { SayPrice, SayPriceInfo } from '~components/mobile/applyPurchase'
+export default {
+  components: {
+    LoginBox,
+    SayPrice,
+    RemindBox,
+    SayPriceInfo
+  },
+  data() {
+    return {
+      showLoginBox: false,
+      showSayPriceBox: false,
+      showSayPriceInfoBox: false,
+      activeIndex: -1,
+      remindText: '',
+      timeoutCount: 0,
+      agreed: 0
+    }
+  },
+  props: ['userType', 'seekType', 'purchaseManList', 'isDataChange'],
+  filters: {
+    date: function(date) {
+      if (date) {
+        const d = new Date(Number(date))
+        const year = d.getFullYear()
+        const monthTemp = d.getMonth() + 1
+        const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
+        const day =
+          d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
+        return year + '-' + month + '-' + day
+      } else {
+        return '-'
       }
     },
-    props: ['userType', 'seekType', 'purchaseManList', 'isDataChange'],
-    filters: {
-      date: function (date) {
-        if (date) {
-          const d = new Date(Number(date))
-          const year = d.getFullYear()
-          const monthTemp = d.getMonth() + 1
-          const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
-          const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
-          return year + '-' + month + '-' + day
-        } else {
-          return '-'
-        }
-      },
-      enterpriseFilter ([str, logged]) {
-        if (logged) {
-          return str
-        } else {
-          return str && str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str || '-'
-        }
-      },
-      userNameFilter ([str, logged]) {
-        if (logged) {
-          return str
-        } else {
-          return str ? str.substring(0, 1) + '**' : '-'
-        }
+    enterpriseFilter([str, logged]) {
+      if (logged) {
+        return str
+      } else {
+        return str && str.length > 4
+          ? str.substring(0, 2) +
+              '**' +
+              str.substring(str.length - 2, str.length)
+          : str || '-'
       }
     },
-    computed: {
-//      purchaseManList () {
-//        return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
-//      },
-      user () {
-        return this.$store.state.option.user
+    userNameFilter([str, logged]) {
+      if (logged) {
+        return str
+      } else {
+        return str ? str.substring(0, 1) + '**' : '-'
       }
+    }
+  },
+  computed: {
+    //      purchaseManList () {
+    //        return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
+    //      },
+    user() {
+      return this.$store.state.option.user
+    }
+  },
+  methods: {
+    getDay: function(timeStamp) {
+      return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
     },
-    methods: {
-      getDay: function (timeStamp) {
-        return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
-      },
-      getHours: function (timeStamp) {
-        return Math.floor((timeStamp / (1000 * 60 * 60)) % 24)
-      },
-      goSayPrice: function (id, index) {
-        if (this.user.logged) {
-          if (this.user.data.enterprise.uu) {
-            if (this.user.data.enterprise.isVendor && this.user.data.enterprise.isVendor !== '1690') {
-              this.$store.dispatch('applyPurchase/loadPurchaseManDetail', {itemId: id, enuu: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null})
-              this.showSayPriceBox = true
-              this.activeIndex = index
-            } else {
-              this.onRemind('抱歉,您需开通卖家功能才可报价')
-            }
+    getHours: function(timeStamp) {
+      return Math.floor((timeStamp / (1000 * 60 * 60)) % 24)
+    },
+    goSayPrice: function(id, index) {
+      if (this.user.logged) {
+        if (this.user.data.enterprise.uu) {
+          if (
+            this.user.data.enterprise.isVendor &&
+            this.user.data.enterprise.isVendor !== '1690'
+          ) {
+            this.$store.dispatch('applyPurchase/loadPurchaseManDetail', {
+              itemId: id,
+              enuu: this.$store.state.option.user.data.enterprise
+                ? this.$store.state.option.user.data.enterprise.uu
+                : null
+            })
+            this.showSayPriceBox = true
+            this.activeIndex = index
           } else {
-            this.onRemind('个人账户暂不可报价')
+            this.onRemind('抱歉,您需开通卖家功能才可报价')
           }
         } else {
-          this.showLoginBox = true
+          this.onRemind('个人账户暂不可报价')
         }
-      },
-      goSayPriceInfo: function (id, agreed, index) {
-        this.userType === 'buyer' ? this.$store.dispatch('applyPurchase/loadBuyerInquiryDetail', {id: id}) : this.$store.dispatch('applyPurchase/loadVendorInquiryDetail', {id: id})
-        this.agreed = agreed
-        this.showSayPriceInfoBox = true
-        this.activeIndex = index
-//        '/mobile/applyPurchase/list/' + (userType ? (item.quteId || item.id) + '?type=' + userType : (item.quteId || item.id)) + (userType ? '&' : '?') + 'status=' + item.agreed
-      },
-      onSayPriceCancel: function (flag, quteId) {
-        if (flag) {
-          this.purchaseManList[this.activeIndex].quoted = 1
-          this.purchaseManList[this.activeIndex].quteId = quteId
-          this.onRemind('报价成功')
-        }
-        this.showSayPriceBox = false
-      },
-      onSayPriceInfoCancel: function (flag) {
-        if (flag) {
-          this.purchaseManList[this.activeIndex].agreed = 1
-          this.onRemind('采纳成功')
-        }
-        this.showSayPriceInfoBox = false
-      },
-      onRemind: function (str) {
-        this.remindText = str
-        this.timeoutCount ++
+      } else {
+        this.showLoginBox = true
+      }
+    },
+    goSayPriceInfo: function(id, agreed, index) {
+      this.userType === 'buyer'
+        ? this.$store.dispatch('applyPurchase/loadBuyerInquiryDetail', {
+            id: id
+          })
+        : this.$store.dispatch('applyPurchase/loadVendorInquiryDetail', {
+            id: id
+          })
+      this.agreed = agreed
+      this.showSayPriceInfoBox = true
+      this.activeIndex = index
+      //        '/mobile/applyPurchase/list/' + (userType ? (item.quteId || item.id) + '?type=' + userType : (item.quteId || item.id)) + (userType ? '&' : '?') + 'status=' + item.agreed
+    },
+    onSayPriceCancel: function(flag, quteId) {
+      if (flag) {
+        this.purchaseManList[this.activeIndex].quoted = 1
+        this.purchaseManList[this.activeIndex].quteId = quteId
+        this.onRemind('报价成功')
+      }
+      this.showSayPriceBox = false
+    },
+    onSayPriceInfoCancel: function(flag) {
+      if (flag) {
+        this.purchaseManList[this.activeIndex].agreed = 1
+        this.onRemind('采纳成功')
       }
+      this.showSayPriceInfoBox = false
+    },
+    onRemind: function(str) {
+      this.remindText = str
+      this.timeoutCount++
     }
   }
+}
 </script>
 <style lang="scss" scoped>
   .seek-list {
     width: 7.26rem;
     margin: .13rem auto 0;
+
     li {
       border: 1px solid #e0e0e4;
       height: 4.2rem;
       margin-bottom: .2rem;
-      div.top {
+
+      > p {
         font-size: .32rem;
         color: #3a3a3a;
         background: #f8f7fa;
@@ -189,14 +216,7 @@
       }
       > div {
         font-size: .3rem;
-        // display: inline-block;
-        &::after {
-          clear: both;
-          visibility: hidden;
-          zoom: 1;
-          display: block;
-          content: ' ';
-        }
+
         .fl {
           color: #666;
           width: 4.8rem;

+ 0 - 3
components/vendor/index.js

@@ -1,3 +0,0 @@
-import toul from './toul.vue'
-
-export { toul }

+ 0 - 62
components/vendor/toul.vue

@@ -1,62 +0,0 @@
-<template>
-  <div class="center-toul">
-    <div class="center-toul-title active">买家中心</div>
-    <ul>
-      <li>购物车<span>(9)</span></li>
-      <li>订单中心</li>
-      <li>我的求购</li>
-      <li>支付中心</li>
-      <li>发票管理</li>
-      <li>账户管理</li>
-    </ul>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'toul'
-}
-</script>
-
-<style lang="scss" scoped>
-.center-toul {
-  width: 146px;
-  border: #ddd 1px solid;
-  background: #fff;
-  border-bottom: none;
-  text-align: center;
-  float: left;
-  .center-toul-title {
-    background: #ecf2fd;
-    color: #666;
-    height: 40px;
-    line-height: 40px;
-    font-weight: bold;
-    &.active {
-      background: #5078cb;
-      color: #fff
-    }
-    &:hover {
-      background: #67afe4;
-      color: #fff;
-      cursor: pointer;
-    }
-  }
-  ul
-   li {
-      line-height: 50px;
-      height: 50px;
-      color: #333;
-      border-bottom: 1px solid #ddd;
-      transition: all 0.3s;
-      &.active {
-        background: #5078cb
-      }
-      &:hover {
-        background: #67afe4;
-        color: #fff;
-        cursor: pointer;
-      }
-   }
-}
-</style>

+ 2 - 1
pages/applyPurchase/index.vue

@@ -19,7 +19,8 @@
       return Promise.all([
         store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null}),
         store.dispatch('applyPurchase/loadPurchaseApplyRank'),
-        store.dispatch('applyPurchase/loadGoodPurchaseManList')
+        store.dispatch('applyPurchase/loadGoodPurchaseManList'),
+        store.dispatch('loadStoreStatus', { op: 'check' })
       ])
     }
   }

+ 2 - 1
pages/provider/home.vue

@@ -24,7 +24,8 @@ export default{
       store.dispatch('provider/loadSalesStore', { isOriginal: false }),
       store.dispatch('provider/loadNewStores', { types: 'AGENCY-DISTRIBUTION' }),
       store.dispatch('provider/loadRecommendStores', { types: 'AGENCY-DISTRIBUTION', num: 5 }),
-      store.dispatch('provider/loadHotComponents')
+      store.dispatch('provider/loadHotComponents'),
+      store.dispatch('loadStoreStatus', { op: 'check' })
     ])
   },
   components: {

+ 4 - 147
pages/vendor/index.vue

@@ -1,155 +1,12 @@
 <template>
-  <!-- <div class="container" style="height: 300px;line-height: 300px;text-align: center;font-size: 24px;"> -->
-    
-    <!-- 暂未开放卖家中心SSR版 -->
-  <!-- </div> -->
-  <div class="container">
-    <div class="vendor-index clear">
-      <left-toul></left-toul>
-      <div class="vendor-content">
-        <div class="vendor-topinfo clear">
-          <div class="vendor-user">
-            <img src="/images/vendor/user_photo.png"/>
-          </div>
-          <div class="vendor-user-name">杨超|优软测试二123</div>
-          <a href="#/accountManager/">账户设置&nbsp;》</a>
-        </div>
-
-        <div class="vendor-list-item clear">
-          <span>收货信息</span>
-          <a href="#"><img src="/images/vendor/edit.png"/></a>
-        </div>
-
-        <div class="vendor-list-item clear">
-          <span class="nobold">云南省,丽江市,古城区123  123 123333333</span>
-        </div>
-
-        <div class="vendor-list-item clear">
-          <span>开票信息</span>
-          <a href="#"><img src="/images/vendor/edit.png"/></a>
-        </div>
-
-        <div class="vendor-list-item clear">
-          <span class="nobold">目前暂无发票信息</span>
-        </div>
-
-
-         <div class="vendor_main">
-          <ul class="clear">
-            <li>
-              <img src="/images/vendor/menu01.png"/>
-              <p>产品收藏</p>
-            </li>
-
-            <li>
-              <img src="/images/vendor/menu02.png"/>
-              <p>店铺关注</p>
-            </li>
-
-            <li>
-              <img src="/images/vendor/menu04.png"/>
-              <p>优软快讯</p>
-            </li>
-
-            <li>
-              <img src="/images/vendor/menu05.png"/>
-              <p>浏览历史</p>
-            </li>
-          </ul>
-        </div>
-
-        <div class=""></div>
-      </div>     
-    </div>
+  <div class="container" style="height: 300px;line-height: 300px;text-align: center;font-size: 24px;">
+    暂未开放卖家中心SSR版
   </div>
 </template>
 <script>
-import { toul } from '~components/vendor'
-
-export default {
-  layout: 'uservendor',
-  middleware: 'authenticated',
-  components: {
-    leftToul: toul
-  }
-}
+export default {}
 </script>
 
 <style lang="scss" scoped>
-.clear {
-  &::after {
-    content: ' ';
-    clear: both;
-    display: block;
-    visibility: hidden;
-  }
-}
-.vendor-index {
-  margin-top: 16px;
-  .vendor-content {
-    margin-left: 18px;
-    float: left;
-    width: 734px; 
-    .vendor-topinfo {
-      background: #ecf2fd;
-      padding: 14px;
-      border: 1px solid #ddd;
-      .vendor-user {
-        float: left;
-      }
-      .vendor-user-name {
-        color: #323232;
-        font-size: 14px;
-        float: left;
-        margin-left: 24px;
-        margin-top: 8px;
-      }
-      a {
-        float: right;
-        color: #666;
-        margin-top: 20px;
-        &:hover {
-          color: #5078cb;
-        }
-      }
-    }
-    .vendor-list-item {
-      padding: 15px;
-      background: #fff;
-      border: 1px solid #ddd;
-      border-bottom: 1px dashed #ddd;
-      border-top: 0px;
-      span {
-        font-weight: bold;
-        color: #323232;
-        float: left;
-        &.nobold {
-          font-weight: 500;
-        }
-      }
-      a {
-        float: right;
-      }
-      &:nth-child(3) {
-        border-bottom: 1px solid #ddd;
-      }
-    }
-    .vendor_main {
-      background: #fff;
-      padding: 10px;
-      margin-top: 12px;
-      li {
-        width: 25%;
-        float: left;
-        text-align: center;
-        p {
-          margin-top: 10px;
-          // &:hover {
-          //   color: 
-          // }
-        }
-      }
-    }
-  }
-}
+
 </style>