Browse Source

Merge branch 'feature-201817-yc' into dev

yangc 7 years ago
parent
commit
20f107cf79
49 changed files with 4742 additions and 710 deletions
  1. 1 1
      app.html
  2. 17 2
      assets/scss/mobileCenter.scss
  3. 281 0
      assets/scss/mobilePayCenter.scss
  4. 2 2
      components/brandCenter/BrandIndex.vue
  5. 2 2
      components/home/floor/FloorList.vue
  6. 19 1
      components/mobile/MobileHeader.vue
  7. 7 3
      components/mobile/base/ModalWrapper.vue
  8. 175 0
      components/mobile/base/SelectAddress.vue
  9. 235 0
      components/mobile/base/addressEdit.vue
  10. 303 0
      components/mobile/base/addressView.vue
  11. 4 1
      components/mobile/base/index.js
  12. 12 6
      components/mobile/common/PullUp.vue
  13. 113 148
      pages/mobile/center/user/cart.vue
  14. 31 29
      pages/mobile/center/user/index.vue
  15. 322 125
      pages/mobile/center/user/pay/_orderId.vue
  16. 479 0
      pages/mobile/center/user/payCenter.vue
  17. 25 16
      pages/mobile/center/vendor/index.vue
  18. 224 0
      pages/mobile/center/vendor/logistics/distributionSpec.vue
  19. 709 0
      pages/mobile/center/vendor/payCenter.vue
  20. 51 24
      pages/mobile/center/vendor/product.vue
  21. 617 0
      pages/mobile/center/vendor/productList/index.vue
  22. 68 13
      pages/mobile/center/vendor/productdetails.vue
  23. 471 249
      pages/mobile/order/details.vue
  24. 171 69
      pages/mobile/order/index.vue
  25. 1 5
      pages/mobile/order/logistics.vue
  26. 7 3
      pages/mobile/product/_batchCode.vue
  27. 70 0
      pages/mobile/user/address.vue
  28. 9 1
      pages/mobile/user/index.vue
  29. 1 8
      pages/supplier/index.vue
  30. 2 1
      plugins/element-ui.js
  31. 6 0
      static/data/bank.json
  32. BIN
      static/images/mobile/@2x/addPro_icon.png
  33. BIN
      static/images/mobile/@2x/labelTop2.png
  34. BIN
      static/images/mobile/center/user/delivery-active.png
  35. BIN
      static/images/mobile/center/user/delivery.png
  36. BIN
      static/images/mobile/center/user/finance_icon.png
  37. BIN
      static/images/mobile/center/user/invoice_icon.png
  38. BIN
      static/images/mobile/center/user/payfor_icon.png
  39. BIN
      static/images/mobile/center/user/wuliu_icon.png
  40. BIN
      static/images/mobile/product/mine_icon.png
  41. BIN
      static/images/mobile/select-arrow.png
  42. BIN
      static/images/mobile/user/icon_06.png
  43. BIN
      static/images/order/remem_icon.png
  44. 43 0
      store/mobileAddress.js
  45. 44 0
      store/payCenter.js
  46. 61 0
      store/payCenter/data.js
  47. 16 0
      store/product/component.js
  48. 27 1
      utils/baseUtils.js
  49. 116 0
      utils/mixin.js

+ 1 - 1
app.html

@@ -6,7 +6,7 @@
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" />
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/element-ui/1.3.7/theme-default/index.css" />
   <!--<link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_0d1jjt5tukcblnmi.css"/>-->
-  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_6hf7erbfhh9.css">
+  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_0aqseo0wttvu.css">
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.css" />
   <script src="https://wechatfe.github.io/vconsole/lib/vconsole.min.js?v=3.2.0"></script>
   {{ HEAD }}

+ 17 - 2
assets/scss/mobileCenter.scss

@@ -28,7 +28,7 @@
     }*/
   }
   .seek-operation {
-    height: 2.09rem;
+    min-height: 2.09rem;
     padding: 0 .24rem;
     > p {
       height: .55rem;
@@ -46,19 +46,34 @@
     ul {
       margin-top: .27rem;
       li {
+        position: relative;
         display: inline-block;
         width: 1.48rem;
         margin-right: 1.05rem;
         text-align: center;
         font-size: .28rem;
+        margin-bottom: 0.2rem;
         color: #666;
-        &:last-child {
+        &:nth-child(3n) {
           margin-right: 0;
         }
         img {
           width: .8rem;
           margin-bottom: .05rem;
         }
+        span.text{
+          position: absolute;
+          font-size: 0.18rem;
+          color: #fff;
+          background: #e60012;
+          width: 0.28rem;
+          height: 0.28rem;
+          border-radius: 50%;
+          top: -0.04rem;
+          right: 0.2rem;
+          line-height: 0.28rem;
+          text-align: center;
+        }
       }
     }
   }

+ 281 - 0
assets/scss/mobilePayCenter.scss

@@ -0,0 +1,281 @@
+$base-color: #3f84f6;
+.mobile-pay-center {
+  .mp-head {
+    height: .82rem;
+    line-height: .82rem;
+    text-align: center;
+    background: #fff;
+    span {
+      font-size: .28rem;
+      &:first-child {
+        margin-right: 1.24rem;
+      }
+      &.active {
+        color: $base-color;
+        border-bottom: 1px solid $base-color;
+      }
+    }
+  }
+  .mp-content {
+    padding: 0 .3rem;
+    .mp-content-header {
+      font-size: .28rem;
+      font-weight: bold;
+      padding: .25rem 0;
+      color: #666;
+      .fr {
+        font-weight: normal;
+        i {
+          font-size: .3rem;
+          color: #88d4af;
+          margin-right: .1rem;
+        }
+      }
+    }
+  }
+  .mp-list {
+    li {
+      padding: 0 .26rem .24rem .21rem;
+      background: #fff;
+      border-radius: .04rem;
+      border: 1px solid #d2d2d2;
+      margin-bottom: .24rem;
+      .content-line {
+        padding-top: .24rem;
+        font-size: .28rem;
+        i {
+          margin-right: .05rem;
+        }
+        .title {
+          color: #666;
+          width: 23%;
+        }
+        .content {
+          text-align: right;
+          width: 77%;
+        }
+        .fr {
+          color: $base-color;
+          border: 1px solid $base-color;
+          font-size: .28rem;
+          padding: .1rem .16rem;
+          margin-left: .2rem;
+          border-radius: .04rem;
+          &.set-default-icon {
+            color: #fff;
+            background: #15b464;
+            border-color: #15b464;
+          }
+          &.default-icon {
+            color: #fff;
+            background: $base-color;
+            border-color: $base-color;
+          }
+        }
+      }
+    }
+  }
+  .add-account-modal {
+    .account-modal {
+      padding: 0 .24rem;
+      .title {
+        height: .73rem;
+        line-height: .73rem;
+        font-size: .28rem;
+        border-bottom: 1px solid #dcdcdc;
+        margin-bottom: .24rem;
+      }
+      i {
+        font-style: normal;
+        color: #ff0000;
+      }
+      .modal-content-line {
+        margin-bottom: .3rem;
+        position: relative;
+        span {
+          width: 2.5rem;
+          color: #226ce7;
+          font-size: .28rem;
+          text-align: right;
+        }
+        input[type='text'] {
+          width: 3.59rem;
+          height: .56rem;
+          font-size: .24rem;
+          border-radius: .04rem;
+          border: 1px solid #d2d2d2;
+          padding: 0 .2rem;
+        }
+        input[readonly] {
+          background: url('/images/mobile/select-arrow.png') no-repeat;
+          background-size: .24rem .15rem;
+          background-position: 3.1rem .2rem;
+        }
+        .similar {
+          position: absolute;
+          left: 2.5rem;
+          border: 1px solid $base-color;
+          border-radius: .04rem;
+          top: .56rem;
+          width: 3.59rem;
+          background: #fff;
+          z-index: 1;
+          max-height: 3.96rem;
+          overflow-y: auto;
+          li {
+            height: .66rem;
+            line-height: .66rem;
+            padding: 0 .19rem;
+            font-size: .24rem;
+            &:active, &:focus {
+              background: #f7f7f7;
+            }
+          }
+        }
+      }
+      .remind {
+        color: #666;
+        font-size: .24rem;
+        width: 3.59rem;
+        float: right;
+        margin-right: .44rem;
+        line-height: .37rem;
+        i {
+          margin-right: .05rem;
+        }
+      }
+      .am-btn-wrap {
+        margin-top: .74rem;
+        button {
+          width: 3.16rem;
+          height: .77rem;
+          line-height: .77rem;
+          color: #fff;
+          font-size: .32rem;
+          border-radius: .08rem;
+          background: #bfbfbf;
+          &:last-child {
+            background: $base-color;
+            margin-left: .3rem;
+          }
+        }
+      }
+    }
+  }
+  .account-modal-wrap {
+    position: absolute;
+    top: 50%;
+    bottom: unset;
+    left: 50%;
+    right: unset;
+    width: 7.1rem;
+    height: 7.58rem;
+    margin-left: -3.55rem;
+    margin-top: -3.79rem;
+    border-radius: .05rem;
+    background: #fff;
+  }
+  .mp-record {
+    .search-content {
+      padding: .25rem 0;
+      text-align: center;
+      input {
+        width: 6.9rem;
+        border: 1px solid #376ff3;
+      }
+    }
+    .filters-wrap {
+      background: #fff;
+      text-align: center;
+      .date-wrap {
+        label {
+          width: 2.22rem;
+          height: .5rem;
+          line-height: .5rem;
+          border-radius: .04rem;
+          border: 1px solid #a0a0a0;
+          background: url('/images/mobile/select-arrow.png')no-repeat;
+          background-size: .12rem .06rem;
+          vertical-align: middle;
+          background-color: #fff;
+          background-position: 1.9rem .2rem;
+          position: relative;
+          margin: .24rem 0 .4rem;
+          input {
+            opacity: 0;
+            width: 2.22rem;
+            height: .5rem;
+            position: absolute;
+            left: 0;
+            z-index: 1;
+          }
+          i {
+            font-size: .28rem;
+            color: $base-color;
+            margin-left: .2rem;
+            float: left;
+          }
+        }
+        p {
+          font-weight: normal;
+          font-size: .22rem;
+          padding-right: .2rem;
+        }
+        span {
+          color: #a0a0a0;
+          margin: 0 .1rem;
+        }
+      }
+      .select-wrap {
+        padding: .24rem 0;
+        border-top: 1px solid #d2d2d2;
+        li.inline-block {
+          width: 33.3%;
+          position: relative;
+          div {
+            width: 1.85rem;
+            height: .5rem;
+            line-height: .5rem;
+            font-size: .28rem;
+            color: #666;
+            border: 1px solid #bfbfbf;
+            border-radius: .04rem;
+            margin: 0 auto;
+            text-align: left;
+            padding: 0 .23rem;
+            background: url('/images/mobile/select-arrow.png')no-repeat;
+            background-size: .12rem .06rem;
+            background-position: 1.55rem .2rem;
+          }
+          .select-list {
+            position: absolute;
+            left: .32rem;
+            top: .49rem;
+            border: 1px solid #bfbfbf;
+            width: 1.85rem;
+            -webkit-box-shadow: 0 1px 5px 0 #aaa;
+            -moz-box-shadow: 0 1px 5px 0 #aaa;
+            box-shadow: 0 1px 5px 0 #aaa;
+            border-radius: .04rem;
+            li {
+              background: #fff;
+              text-align: left;
+              padding: 0 .24rem;
+              font-size: .28rem;
+              height: .53rem;
+              line-height: .53rem;
+              &:active, &:focus {
+                background: $base-color;
+                color: #fff;
+              }
+            }
+          }
+        }
+      }
+    }
+    .record-list {
+      width: 6.9rem;
+      margin: .24rem auto;
+    }
+  }
+}

+ 2 - 2
components/brandCenter/BrandIndex.vue

@@ -573,9 +573,9 @@
         background-size: cover;
         padding-bottom: 20px;
         position: relative;
-        height: 1034px;
+        height: 1037px;
         background: #fff;
-        border-bottom: 1px solid #dcdcdc;
+        /*border-bottom: 1px solid #dcdcdc;*/
         border-bottom-left-radius: 5px;
         border-bottom-right-radius: 5px;
         .search-modal-wrap {

+ 2 - 2
components/home/floor/FloorList.vue

@@ -120,8 +120,8 @@
     },
     filters: {
       date: function (date) {
-        const now = baseUtils.formatDate('yyyy-MM-dd', Date.now())
-        const day = Math.floor((now - date) / (1000 * 60 * 60 * 24))
+        const now = baseUtils.formatDate(new Date(), 'yyyy-MM-dd')
+        const day = Math.floor((new Date(now).getTime() - new Date(baseUtils.formatDate(new Date(date), 'yyyy-MM-dd')).getTime()) / (1000 * 60 * 60 * 24))
         return day <= 0 ? '今天' : day + '天前'
       },
       enterpriseFilter ([str, user]) {

+ 19 - 1
components/mobile/MobileHeader.vue

@@ -108,7 +108,7 @@
         return this.$store.state.componentDetail.detail.data
       },
       showEnHeader () {
-        return this.startWith(this.$route.path, '/mobile/center') || this.startWith(this.$route.path, '/mobile/order')
+        return this.startWith(this.$route.path, '/mobile/center') || this.startWith(this.$route.path, '/mobile/order') || this.startWith(this.$route.path, '/mobile/user/address')
       }
 //      showHeader () {
 //        return this.$route.path !== '/' || !this.$route.path || this.$route.path === ''
@@ -165,6 +165,12 @@
 //          this.rightIcon = 'phone'
         } else if (this.startWith(val, '/mobile/shop')) {
           title = '店铺列表'
+//          this.rightIcon = 'phone'
+        } else if (this.startWith(val, '/mobile/center/vendor/productList')) {
+          title = '产品信息'
+//          this.rightIcon = 'phone'
+        } else if (this.startWith(val, '/mobile/center/vendor/productdetails')) {
+          title = '产品信息'
 //          this.rightIcon = 'phone'
         } else if (this.startWith(val, '/mobile/center/vendor/product')) {
           if (this.$route.query.providerType === 'enterprise') {
@@ -184,6 +190,9 @@
         } else if (this.startWith(val, '/mobile/user/info/admin')) {
           this.showSearchIcon = false
           title = '管理员信息'
+        } else if (this.startWith(val, '/mobile/user/address')) {
+          this.showSearchIcon = false
+          title = '收货地址信息'
         } else if (this.startWith(val, '/mobile/product')) {
           this.showSearchIcon = false
           title = '产品详情'
@@ -199,6 +208,12 @@
         } else if (val === '/mobile/center/user/cart') {
           this.showSearchIcon = false
           title = '购物车'
+        } else if (this.startWith(val, '/mobile/center/user/payCenter')) {
+          this.showSearchIcon = false
+          title = '支付中心'
+        } else if (this.startWith(val, '/mobile/center/vendor/payCenter')) {
+          this.showSearchIcon = false
+          title = '财务对账'
         } else if (this.startWith(val, '/mobile/center/user/pay')) {
           this.showSearchIcon = false
           title = '填写订单'
@@ -208,6 +223,9 @@
         } else if (this.startWith(val, '/mobile/order/details')) {
           this.showSearchIcon = false
           title = '订单详情'
+        } else if (this.startWith(val, '/mobile/order/logistics')) {
+          this.showSearchIcon = false
+          title = '物流信息'
         } else if (this.startWith(val, '/mobile/order')) {
           this.showSearchIcon = false
           if (query.type === 'buyer') {

+ 7 - 3
components/mobile/base/ModalWrapper.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="mobile-modal" v-if="showModal" @click="$emit('closeAction')">
     <div class="mobile-modal-box mobile-modal-wrapper" @click="stopPropagation($event)">
-      <div class="mobile-modal-header">{{title}}<i @click="$emit('closeAction')" class="icon-guanbi iconfont"></i></div>
+      <div class="mobile-modal-header" v-if="!noHeader">{{title}}<i @click="$emit('closeAction')" class="icon-guanbi iconfont"></i></div>
       <div ref="mobileModalBox" class="mobile-scroll-wrap"><div><slot></slot></div></div>
     </div>
   </div>
@@ -16,6 +16,10 @@
       title: {
         type: String,
         default: ''
+      },
+      noHeader: {
+        type: Boolean,
+        default: false
       }
     },
     watch: {
@@ -41,8 +45,8 @@
 </script>
 <style lang="scss" scoped>
   .mobile-modal .mobile-modal-wrapper {
-    top: 11%;
-    bottom: 11%;
+    top: 1.6rem;
+    bottom: 1.6rem;
     left: 5%;
     right: 5%;
   }

+ 175 - 0
components/mobile/base/SelectAddress.vue

@@ -0,0 +1,175 @@
+<template>
+  <div class="base-select-address mobile-modal" v-if="isShow">
+    <div class="bs-wrap">
+      <p class="bs-wrap-title">选择地址<i class="iconfont icon-guanbi1" @click="$emit('closeAction')"></i></p>
+      <ul class="bs-selected-list">
+        <li class="inline-block" v-for="(addrVal, addrName, index) in currentAddress" :class="{active: isActive(addrName)}" @click="resetAddr(addrName)">{{addrVal}}</li>
+      </ul>
+      <ul class="bs-current-list">
+        <li v-for="(item, index) in currentArr" @click="checkItem(index)">
+          {{item}}
+        </li>
+      </ul>
+    </div>
+  </div>
+</template>
+<script>
+  export default {
+    props: {
+      isShow: {
+        type: Boolean,
+        default: false
+      }
+    },
+    data () {
+      return {
+        addressData: '',
+        provinces: [],
+        activeObj: {
+          // 省
+          province: -1,
+          // 市
+          city: -1,
+          // 区
+          area: -1
+        }
+      }
+    },
+    created () {
+      this.$http.get('/data/city.json').then(res => {
+        this.addressData = res.data
+        for (let provinceAttr in this.addressData) {
+          this.provinces.push(provinceAttr)
+        }
+      })
+    },
+    computed: {
+      currentType () {
+        if (this.activeObj.area > -1) {
+          return 'full'
+        } else if (this.activeObj.city > -1) {
+          return 'area'
+        } else if (this.activeObj.province > -1) {
+          return 'city'
+        } else {
+          return 'province'
+        }
+      },
+      currentAddress () {
+        let obj = {
+          province: '',
+          city: '',
+          area: ''
+        }
+        if (this.activeObj.province > -1) {
+          obj.province = this.provinces[this.activeObj.province]
+        }
+        if (this.activeObj.city > -1) {
+          obj.city = this.cityObject.attrArr[this.activeObj.city]
+        }
+        if (this.activeObj.area > -1) {
+          obj.area = this.cityObject.valArr[this.activeObj.city][this.activeObj.area]
+        }
+        return obj
+      },
+      cityObject () {
+        let attrArr = []
+        let valArr = []
+        let tmp = this.addressData[this.provinces[this.activeObj.province]]
+        for (let attr in tmp) {
+          attrArr.push(attr)
+          valArr.push(tmp[attr])
+        }
+        return {
+          attrArr: attrArr,
+          valArr: valArr
+        }
+      },
+      currentArr () {
+        let arr = []
+        if (this.currentType === 'area') {
+          arr = this.cityObject.valArr[this.activeObj.city]
+        } else if (this.currentType === 'city') {
+          arr = this.cityObject.attrArr
+        } else if (this.currentType === 'province') {
+          arr = this.provinces
+        }
+        return arr
+      }
+    },
+    methods: {
+      checkItem (index) {
+        if (this.currentType === 'province') {
+          this.activeObj.province = index
+          this.activeObj.area = -1
+          this.activeObj.city = -1
+        } else if (this.currentType === 'city') {
+          this.activeObj.city = index
+          this.activeObj.area = -1
+        } else {
+          this.activeObj.area = index
+          this.$emit('closeAction', this.currentAddress)
+        }
+      },
+      isActive (type) {
+        return (type === 'province' && this.currentType === 'city') || (type === 'city' && this.currentType === 'area') || (type === 'area' && this.currentType === 'full')
+      },
+      resetAddr (addrName) {
+        if (addrName === 'province') {
+          this.activeObj.province = -1
+          this.activeObj.area = -1
+          this.activeObj.city = -1
+        } else if (addrName === 'city') {
+          this.activeObj.city = -1
+          this.activeObj.area = -1
+        } else {
+          this.activeObj.area = -1
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .bs-wrap {
+    position: absolute;
+    bottom: 0;
+    background: #fff;
+    width: 100%;
+    height: 8.17rem;
+    .bs-wrap-title {
+      text-align: center;
+      font-size: .3rem;
+      color: #666;
+      margin: .34rem 0;
+      i {
+        font-size: .24rem;
+        color: #666;
+        position: absolute;
+        right: .12rem;
+        top: .09rem;
+      }
+    }
+    .bs-selected-list {
+      border-bottom: 1px solid #e7e8ec;
+      li {
+        height: .48rem;
+        line-height: .48rem;
+        margin: 0 .33rem;
+        font-size: .28rem;
+        &.active {
+          border-bottom: .02rem solid #f38c8c;
+        }
+      }
+    }
+    .bs-current-list {
+      height: 100%;
+      overflow-y: auto;
+      li {
+        padding: .27rem .39rem;
+        &:hover, &:active, &:focus {
+          background: #f7f7f7;
+        }
+      }
+    }
+  }
+</style>

+ 235 - 0
components/mobile/base/addressEdit.vue

@@ -0,0 +1,235 @@
+<template>
+  <div class="shipments_address_edit">
+    <div class="form_line">
+      <ul class="list-unstyled" ref="addressContent">
+        <li class="clearfix">
+          <div class="com_left pull-left"><span>*</span>发货人姓名:</div>
+          <div class="form_input">
+            <input type="text" placeholder="请输入您的姓名" v-model="params.name" maxlength="10">
+          </div>
+        </li>
+        <li class="clearfix">
+          <div class="com_left pull-left"><span>*</span>联系电话:</div>
+          <div class="form_input">
+            <input type="tel" placeholder="请输入您的联系电话" v-model="params.tel" maxlength="11">
+          </div>
+        </li>
+        <li class="clearfix">
+          <div class="com_left pull-left">邮箱:</div>
+          <div class="form_input">
+            <input type="email" placeholder="请输入正确邮箱,用于接收订单提醒" v-model="params.email">
+          </div>
+        </li>
+        <li class="clearfix">
+          <div class="com_left pull-left"><span>*</span>所在地区:</div>
+          <div class="form_input" @click="addressShow = true">
+            <span v-text="params.area || '选择地区'">选择地区</span>
+          </div>
+        </li>
+        <li class="clearfix">
+          <div class="com_left pull-left"><span>*</span>详细地址:</div>
+          <div class="form_input">
+            <input type="text" placeholder="请您填写详细地址,街道名、门牌号等" v-model="params.detailAddress" maxlength="30">
+          </div>
+        </li>
+        <li class="clearfix">
+          <div class="com_left pull-left"><span>*</span>默认地址:</div>
+          <div class="form_input">
+            <el-switch
+              v-model="isActive"
+              on-text="ON"
+              off-text="OFF">
+            </el-switch>
+          </div>
+        </li>
+      </ul>
+    </div>
+    <div class="control clearfix">
+      <div class="cancel" @click="storeInfosave('cancel')">取消</div>
+      <div class="save" @click="storeInfosave()">保存</div>
+    </div>
+    <select-address :isShow="addressShow" @closeAction="addressData"></select-address>
+    <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
+  </div>
+</template>
+
+<script>
+  import BScroll from 'better-scroll'
+  import { RemindBox } from '~components/mobile/common'
+  import SelectAddress from './SelectAddress.vue'
+  export default {
+    name: 'AddressEditView',
+    props: {
+      data: {},
+      isSend: {
+        default: true,
+        type: Boolean
+      },
+      isPersonal: {
+        default: true,
+        type: Boolean
+      }
+    },
+    data() {
+      return {
+        params: {
+          area: '',
+          detailAddress: '',
+          email: '',
+          tel: '',
+          name: '',
+          province: '',
+          city: '',
+          district: ''
+        },
+        isActive: false,
+        addressShow: false,
+        timeoutCount: 0,
+        collectResult: ''
+      }
+    },
+    watch: {
+      data(newVal) {
+        this.isActive = false
+        this.params = this.baseUtils.deepCopy(newVal)
+      }
+    },
+    methods: {
+      editClick () {
+        this.$emit('isEditEvent', [], false)
+      },
+      addressData (type) {
+        this.addressShow = false
+        if (type) {
+          this.params.area = `${type.province},${type.city},${type.area}`
+          this.params.province = type.province
+          this.params.city = type.city
+          this.params.district = type.area
+        }
+      },
+      setRemindText (str) {
+        this.collectResult = str
+        this.timeoutCount++
+      },
+      storeInfosave(_tp) {
+        this.BScroll.refresh()
+        if (_tp === 'cancel') {
+          this.editClick()
+          return false
+        }
+        if (!this.params.name || this.params.name === '') {
+          this.setRemindText('发货人姓名不能为空')
+          return false
+        }
+        if (!this.params.tel || this.params.tel === '' || !/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(this.params.tel)) {
+          this.setRemindText('请输入正确的手机号码')
+          return false
+        }
+        if (this.params.email && !/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/.test(this.params.email)) {
+          this.setRemindText('请输入正确的邮箱')
+          return false
+        }
+        if (!this.params.area || this.params.area === '') {
+          this.setRemindText('请选择所在地区')
+          return false
+        }
+        if (!this.params.detailAddress || this.params.detailAddress === '') {
+          this.setRemindText('请填写详细地址信息')
+          return false
+        }
+        this.$http.post(`/trade/address/shipping/save?isPersonal=${this.isPersonal}&isSetTop=${this.isActive}&send=${this.isSend}`, this.params)
+          .then(() => {
+            this.setRemindText('保存成功')
+            this.editClick()
+          }).catch(err => {
+            this.collectResult = err.response.data
+            this.timeoutCount++
+            this.params = this.data
+          })
+      }
+    },
+    components: {
+      RemindBox,
+      SelectAddress
+    },
+    mounted() {
+      this.$nextTick(() => {
+        if (this.BScroll) {
+          this.BScroll.refresh()
+        } else {
+          this.BScroll = new BScroll(this.$refs.addressContent, {
+            click: true
+          })
+        }
+      })
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .shipments_address_edit{
+    .control {
+      width: 90%;
+      margin: 0.4rem auto 0rem;
+      height: .88rem;
+      line-height: 0.88rem;
+      .save {
+        border-radius: 3px;
+        width: 48%;
+        color: #fff;
+        text-align: center;
+        height: .88rem;
+        line-height: 0.88rem;
+        background: #3e82f5;
+        float: right;
+      }
+      .cancel {
+        border-radius: 3px;
+        width: 48%;
+        background: #acabab;
+        color: #fff;
+        text-align: center;
+        height: .88rem;
+        line-height: 0.88rem;
+        float: left;
+      }
+    }
+    .form_line{
+      margin:.2rem;
+      padding:.2rem;
+      background: #ffffff;
+      border-radius:.05rem;
+      ul{
+        li{
+          line-height: 1.2rem;
+          height:1.2rem;
+          border-bottom:1px solid #d3d3d3;
+          vertical-align: middle;
+          &:last-child{
+            border:none;
+          }
+          .com_left{
+            width:1.85rem;
+            color:#4c8cf7;
+            text-align: right;
+            font-size: .28rem;
+            span{
+              color:#ff3333;
+            }
+          }
+          .form_input{
+            margin-left:1.85rem;
+            padding-right:.2rem;
+            input{
+              width:100%;
+              line-height: .3rem;
+              height:.3rem;
+              border:none;
+              font-size: .28rem;
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 303 - 0
components/mobile/base/addressView.vue

@@ -0,0 +1,303 @@
+<template>
+  <div class="address_info">
+    <div class="add_rule">
+      <a @click="editClick()"><i class="iconfont icon-add"></i>{{isSend ? '新增发货地址' : '新增收货地址'}}</a>
+    </div>
+    <div class="deleteKuang" v-if="showLogout">
+      <div class="kuangContent">
+        <div class="title">系统提示</div>
+        <div class="titleinfo">是否删除?</div>
+        <div class="K_btn">
+          <div class="cancelBtn" @click="showLogout = false">取消</div>
+          <div class="answerBtn" @click="goNext">确定</div>
+        </div>
+      </div>
+    </div>
+    <ul class="list-unstyled">
+      <li v-for="(item, index) in addressList">
+        <div class="wrapper-line clearfix">
+          <div class="name pull-left">{{isSend ? '发货地址:' : '收货地址:'}}</div>
+          <div class="name-text">{{item.area}}{{item.detailAddress}}</div>
+        </div>
+        <div class="wrapper-line clearfix">
+          <div class="name pull-left">{{isSend ? '发货人:' : '收货人:'}}</div>
+          <div class="name-text">{{item.name}}</div>
+        </div>
+        <div class="wrapper-line clearfix">
+          <div class="name pull-left">电话:</div>
+          <div class="name-text">{{item.tel}}</div>
+        </div>
+        <div class="item-bottom clearfix">
+          <div class="pull-left" >
+            <label class="bottom-modal-check mobile-cart-check" :class="{active: item.num === 1}">
+              <input type="checkbox" @change="setActiveClick(item.id)">
+              <span>默认地址</span>
+            </label>
+          </div>
+          <div class="pull-right" >
+            <span @click="editClick(item)"><i class="iconfont icon-edit"></i>修改</span>
+            <span @click="deleteClick(item.id, index)"><i class="iconfont icon-lajitong"></i>删除</span>
+          </div>
+        </div>
+      </li>
+    </ul>
+
+    <pull-up
+      :searchMore="fetching"
+      :allPage="allPage"
+      :page="param.page"
+      :fixId="'logisticsContent'"
+      @pullUpAction="getPullAddress">
+    </pull-up>
+  </div>
+</template>
+
+<script type="text/javascript">
+  import { PullUp } from '~components/mobile/common'
+  export default {
+    name: 'AddressInfoView',
+    props: {
+      isSend: {
+        default: true,
+        type: Boolean
+      }
+    },
+    data() {
+      return {
+        addressList: [],
+        showLogout: false,
+        // 保存操作数据的序号
+        saveId: {
+          id: '',
+          active: 0
+        },
+        param: {
+          count: 10,
+          page: 1,
+          sorting: { 'num': 'asc' }
+        },
+        isChange: false
+      }
+    },
+    watch: {
+      'listInfo': {
+        handler: function (val) {
+          val.content = val.content.sort((a, b) => { return a.num - b.num })
+          if (this.isChange) {
+            this.addressList = val.content
+            this.isChange = false
+          } else {
+            this.addressList = [...this.addressList, ...val.content]
+          }
+        },
+        immediate: true
+      }
+    },
+    methods: {
+      // 设置默认地址
+      setActiveClick (type) {
+        this.$http.put(`/trade/address/settop/${type}`).then(() => {
+          this.initList()
+        })
+      },
+      // 删除事件
+      deleteClick (type, index) {
+        this.saveId.id = type
+        this.saveId.active = index
+        this.showLogout = true
+      },
+      goNext() {
+        if (this.saveId.active === 0) {
+          this.setActiveClick(this.addressList[1].id)
+        }
+        this.$http.put(`/trade/address/delete/${this.saveId.id}`)
+          .then(() => {
+            this.initList()
+            this.showLogout = false
+          })
+      },
+      // 编辑事件
+      editClick (type) {
+        this.$emit('isEditEvent', type || {}, true)
+      },
+      // 加载更多
+      getPullAddress() {
+        this.param.page++
+        this.reloadList()
+      },
+      // 初始化数据页面
+      initList () {
+        this.isChange = true
+        this.param.page = 1
+        this.reloadList()
+      },
+      // 发送请求数据
+      reloadList () {
+        this.$store.dispatch('mobileAddress/loadAddressData', {count: this.param.count, page: this.param.page, isSend: this.isSend, sorting: this.param.sorting})
+      }
+    },
+    computed: {
+      listInfo() {
+        return this.baseUtils.deepCopy(this.$store.state.mobileAddress.address.data)
+      },
+      fetching () {
+        return this.$store.state.mobileAddress.address.fetching
+      },
+      allPage() {
+        return this.listInfo.totalPages
+      }
+    },
+    components: {
+      PullUp
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  @mixin overFlowHidden {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  @mixin lineHeight($value) {
+    height: $value;
+    line-height: $value;
+  }
+  .deleteKuang {
+    position: fixed;
+    background: rgba(0,0,0,0.5);
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    z-index: 9999;
+    .kuangContent {
+      border-radius: 5px;
+      background: #fff;
+      width: 5rem;
+      position: absolute;
+      left: 50%;
+      top: 50%;
+      transform: translate3d(-50%, -50%, 0);
+      overflow: hidden;
+      .titleinfo {
+        font-size: .3rem;
+        color: #666;
+        text-align: center;
+        margin-top: 0.5rem;
+        margin-bottom: 0.1rem;
+      }
+      .title {
+        background: #5078cb;
+        height: .7rem;
+        line-height: .7rem;
+        font-size: .3rem;
+        color: #fff;
+        text-align: center;
+      }
+      .info {
+        color: #f00;
+        text-align: center;
+      }
+      .K_btn {
+        margin-top: 0.4rem;
+        line-height: 0.7rem;
+        height: 0.7rem;
+        &::after{
+          clear: both;
+          display: block;
+          content: ' ';
+          visibility: hidden;
+          zoom: 1;
+        }
+        div {
+          float: left;
+          width: 50%;
+          font-size: 0.3rem;
+          text-align: center;
+          &.cancelBtn {
+            background: #b4b5b9;
+            color: #333;
+          }
+          &.answerBtn {
+            background: #5078cb;
+            color: #fff;
+          }
+        }
+      }
+    }
+  }
+  .add_rule{
+    position:absolute;
+    bottom:.2rem;
+    left:0;
+    right:0;
+    a{
+      display:block;
+      margin: 0 auto;
+      width:95%;
+      height:.78rem;
+      line-height: .78rem;
+      text-align: center;
+      font-size: .32rem;
+      color:#fff;
+      background: #3f84f6;
+      border-radius:.05rem;
+      i{
+        margin-right:.05rem;
+      }
+    }
+  }
+  .address_info{
+    padding:.2rem .2rem 1.2rem;
+    ul {
+      li {
+        margin-bottom: 0.2rem;
+        padding: 0.3rem 0.24rem 0;
+        border: 1px solid #e4e6e9;
+        border-radius: 5px;
+        background: #fefefe;
+        .wrapper-line {
+          margin-bottom: 0.16rem;
+          .name{
+            display:inline-block;
+            text-align: right;
+            width:1.4rem;
+            font-size: .28rem;
+            color: #4c8cf7;
+          }
+          .name-text {
+            margin-left:1.4rem;
+            word-break: break-all;
+            word-wrap: break-word;
+            font-size: 0.28rem;
+            color: #333;
+          }
+        }
+        .item-bottom {
+          color: #333;
+          @include lineHeight(0.8rem);
+          font-size: 0.26rem;
+          text-align: center;
+          border-top: 1px solid #d3d3d3;
+          .pull-left {
+            text-align: left;
+          }
+          .pull-right {
+            width: 50%;
+            text-align: right;
+          }
+          span{
+            font-size: 0.28rem;
+            margin-right:.2rem;
+            i {
+              font-size: 0.34rem;
+              vertical-align: middle;
+            }
+          }
+
+        }
+      }
+    }
+  }
+</style>

+ 4 - 1
components/mobile/base/index.js

@@ -3,5 +3,8 @@ import SearchHeader2 from './SearchHeader2.vue'
 import LinkUser from './LinkUser.vue'
 import ModalWrapper from './ModalWrapper.vue'
 import BottomModalWrapper from './BottomModalWrapper.vue'
+import SelectAddress from './SelectAddress.vue'
+import AddressView from './addressView.vue'
+import AddressEdit from './addressEdit'
 
-export { SearchHeader, SearchHeader2, LinkUser, ModalWrapper, BottomModalWrapper }
+export { SearchHeader, SearchHeader2, LinkUser, ModalWrapper, BottomModalWrapper, SelectAddress, AddressView, AddressEdit }

+ 12 - 6
components/mobile/common/PullUp.vue

@@ -33,11 +33,13 @@
       let _this = this
       _this.$nextTick(function () {
         let obj = this.fixId ? document.getElementById(this.fixId) : window
-        obj.addEventListener('scroll', function () {
-          if (_this.isValid) {
-            _this.scroll()
-          }
-        }, false)
+        if (obj) {
+          obj.addEventListener('scroll', function () {
+            if (_this.isValid) {
+              _this.scroll()
+            }
+          }, false)
+        }
       })
     },
     methods: {
@@ -49,7 +51,11 @@
         if (this.fixId) {
           let obj = document.getElementById(this.fixId)
           height = obj.scrollHeight
-          scrolled = obj.scrollTop - document.body.scrollWidth / 750 * 100 * 0.88
+          let _scrollHeight = 0.88
+          if (this.$route.fullPath.indexOf('order') > -1) {
+            _scrollHeight = 1.26
+          }
+          scrolled = obj.scrollTop - document.body.scrollWidth / 750 * 100 * _scrollHeight
         } else {
           height = document.body.scrollHeight
           scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop

+ 113 - 148
pages/mobile/center/user/cart.vue

@@ -8,7 +8,7 @@
               <input type="checkbox" @change="setActive('store', storeIndex)">
             </label>
             <span class="store-tag inline-block" :style="getStoreTypeColor(item.storeType)">{{item.storeType | storeTypeFilter}}</span>
-            <p class="store-name inline-block text-ellipse">{{item.storeName}}</p>
+            <p class="store-name inline-block text-ellipse">卖&nbsp;&nbsp;家:{{item.storeName}}</p>
             <a class="com-mobile-link" @click="linkSaler(item)"><i class="iconfont icon-kefu1"></i>联系卖家</a>
           </div>
           <ul class="goods-list">
@@ -17,33 +17,41 @@
                 <input type="checkbox" @change="setActive('goods', storeIndex, goodsIndex)">
               </label>
               <div class="params inline-block">
-                <p class="param text-ellipse"><span>品牌:</span>{{goods.goods.brandNameEn || '-'}}</p>
-                <p class="param text-ellipse"><span>类目:</span>{{goods.kiName || '-'}}</p>
-                <p class="param text-ellipse"><span>型号:</span>{{goods.code || '-'}}</p>
-                <p class="param text-ellipse"><span>规格:</span>{{goods.spec || '-'}}</p>
+                <p class="param text-ellipse"><span class="title">品牌:</span>{{goods.goods.brandNameEn || '-'}}</p>
+                <p class="param text-ellipse"><span class="title">类目:</span>{{goods.kiName || '-'}}</p>
+                <p class="param text-ellipse"><span class="title">型号:</span>{{goods.code || '-'}}</p>
+                <p class="param text-ellipse"><span class="title">规格:</span>{{goods.spec || '-'}}</p>
               </div>
-              <div class="fr">
-                <!--<p class="goods-tag">{{goods.goods.tag || '-'}}</p>-->
-                <div class="input-line">
-                  <span class="inline-block" @click="setGoods('sub', goods)" :class="{disab: !goods.goods.canSub}">-</span>
-                  <input type="number" v-model="goods.goods.purchaseNumber" @blur="setGoods('set', goods)">
-                  <span class="inline-block" @click="setGoods('add', goods)" :class="{disab: !goods.goods.canAdd}">+</span>
-                </div>
-                <div class="price-line">
+              <div class="inline-block params param-operate">
+                <p class="param text-ellipse"><span class="title">交期(天):</span>{{goods.goods.b2cMinDelivery + '-' + goods.goods.b2cMaxDelivery}}</p>
+                <p class="param text-ellipse"><span class="title">单价:</span>{{baseUtils.getPriceByLevel(goods.goods.prices, goods.number, goods.currencyName)}}</p>
+                <p class="param"><span class="title">数量(PCS):</span>
+                  <span class="input-line inline-block">
+                    <span class="inline-block" @click="setGoods('sub', goods)" :class="{disab: !goods.goods.canSub}">-</span>
+                    <input type="number" v-model="goods.goods.purchaseNumber" @blur="setGoods('set', goods)">
+                    <span class="inline-block" @click="setGoods('add', goods)" :class="{disab: !goods.goods.canAdd}">+</span>
+                  </span>
+                </p>
+                <p class="param text-ellipse"><span class="title">小计:</span><span class="ol-price"><span>{{goods.currencyName | currencyFilter}}</span>{{goods.goods.currentPrice}}</span></p>
+                <!--<div class="price-line">
                   <span>{{goods.currencyName | currencyFilter}}</span>{{goods.goods.currentPrice}}
-                </div>
+                </div>-->
               </div>
             </li>
           </ul>
         </li>
       </ul>
       <div class="buy-wrap">
-        <label class="mobile-cart-check" :class="{'active': isAllChecked}">
-          <input type="checkbox" @change="setActive('all')">
-          <span>全选</span>
-        </label>
-        <div class="fr">
-          <i class="fare">不含运费</i>
+        <div class="wrap-select line">
+          <label class="mobile-cart-check" :class="{'active': isAllChecked}">
+            <input type="checkbox" @change="setActive('all')">
+            <span>全选</span>
+          </label>
+          <a class="operate-btn fr" @click="removeInvalidGoods">清空失效产品</a>
+          <a class="operate-btn fr" @click="batchDelete">批量删除</a>
+        </div>
+        <div class="wrap-count line">
+          <!--<i class="fare">不含运费</i>-->
           <span class="title">合计:</span><span class="price"><span v-show="allCount > 0">{{allCurrency | currencyFilter}}</span>{{allPrice}}</span>
           <button class="buy-btn" @click="submit">结算({{allCount}})</button>
         </div>
@@ -62,6 +70,7 @@
 <script>
   import {RemindBox, PullUp, EmptyStatus} from '~components/mobile/common'
   import {LinkUser} from '~components/mobile/base'
+  import { goodsPurchaseOperate } from '~utils/mixin'
   export default {
     layout: 'mobile',
     middleware: 'authenticated',
@@ -75,9 +84,11 @@
         count: 10,
         allCurrency: 'RMB', // 选定币别
         currentStoreInfo: {},
-        showLink: false
+        showLink: false,
+        isChange: false
       }
     },
+    mixins: [goodsPurchaseOperate],
     components: {
       RemindBox,
       PullUp,
@@ -94,29 +105,16 @@
         handler: function (val) {
           let tmpVal = this.baseUtils.deepCopy(val)
 //          this.cartList = []
+          if (this.isChange) {
+            this.cartList = []
+          }
           tmpVal.content.forEach(item => {
             let current = this.cartList.find(objItem => {
               return objItem.storeUuid === item.storeUuid
             })
             item.$active = false
             // 初始化购买数量及状态
-            let goodsItem = item.goods
-            let pack = goodsItem.perQty || goodsItem.minPackQty
-            if (goodsItem.breakUp) {
-              goodsItem.purchaseNumber = goodsItem.minBuyQty
-              goodsItem.canSub = false
-              goodsItem.canAdd = goodsItem.purchaseNumber < goodsItem.reserve
-            } else {
-              if (pack >= goodsItem.minBuyQty) {
-                goodsItem.purchaseNumber = pack
-              } else {
-                let max = Math.max(pack, goodsItem.minBuyQty)
-                goodsItem.purchaseNumber = max + max % pack
-              }
-              goodsItem.canSub = false
-              goodsItem.canAdd = goodsItem.purchaseNumber + goodsItem.minPackQty <= goodsItem.reserve
-            }
-            goodsItem.currentPrice = Number((this.baseUtils.getPriceByLevel(goodsItem.prices, goodsItem.purchaseNumber, goodsItem.currencyName) * goodsItem.purchaseNumber).toFixed(6))
+            this.initGoodsStatus(item.goods)
             if (!current) {
               this.cartList.push({
                 storeName: item.storeName,
@@ -258,96 +256,6 @@
         })
         this.isAllChecked = activeFlag
       },
-      onPurchaseNumberInput: function (goods) {
-        let showPrice = this.baseUtils.getPriceByLevel(goods.goods.prices, goods.goods.purchaseNumber, goods.goods.currencyName)
-        goods.goods.currentPrice = Number(((showPrice || goods.goods.currentPrice) * goods.goods.purchaseNumber).toFixed(6))
-//        console.log(goods.goods.currentPrice)
-      },
-      checkPurchaseNumber: function (goods) {
-        if ((/^[\d]*$/).test(goods.goods.purchaseNumber)) {
-          this.changeNum(goods.goods.purchaseNumber, goods)
-        } else {
-          this.setRemindText('请输入整数')
-          goods.goods.purchaseNumber = goods.goods.minBuyQty
-        }
-      },
-      setGoods: function (type, goods) {
-        if (type === 'set') {
-          this.checkPurchaseNumber(goods)
-        } else {
-          let isAdd = type === 'add'
-          let pack = goods.goods.perQty || goods.goods.minPackQty
-          let newNum = 0
-          if (goods.goods.breakUp) {
-            newNum = isAdd ? goods.goods.purchaseNumber + 1 : goods.goods.purchaseNumber - 1
-          } else {
-            newNum = isAdd ? goods.goods.purchaseNumber + pack : goods.goods.purchaseNumber - pack
-          }
-          this.changeNum(newNum, goods)
-        }
-      },
-      changeNum: function (newNum, goods) {
-        let pack = goods.goods.perQty || goods.goods.minPackQty
-        let buy = goods.goods.minBuyQty
-        let reserve = goods.goods.reserve
-        let breakUp = goods.goods.breakUp
-        if (!newNum && newNum !== 0) {
-          goods.goods.purchaseNumber = buy
-        } else {
-          newNum = parseInt(newNum)
-          if (breakUp) {
-            if (newNum < buy) {
-              this.setRemindText('最小起订量为' + buy)
-              goods.goods.purchaseNumber = buy
-              goods.goods.canSub = false
-              goods.goods.canAdd = true
-            } else if (newNum > reserve) {
-              this.setRemindText('库存不足')
-              goods.goods.purchaseNumber = reserve
-              goods.goods.canAdd = false
-              goods.goods.canSub = true
-            } else {
-              goods.goods.canSub = true
-              goods.goods.canAdd = true
-              goods.goods.purchaseNumber = newNum
-              newNum === buy && (goods.goods.canSub = false)
-              newNum === reserve && (goods.goods.canAdd = false)
-            }
-          } else {
-            if (newNum < buy) {
-              this.setRemindText('最小起订量为' + buy)
-              goods.goods.purchaseNumber = buy
-              goods.goods.canSub = false
-              if (newNum > reserve) {
-                this.setRemindText('库存不足')
-                goods.goods.purchaseNumber = reserve - (reserve % pack)
-                goods.goods.canAdd = false
-              }
-            } else if (newNum > reserve) {
-              goods.goods.canSub = true
-              goods.goods.canAdd = false
-              this.setRemindText('库存不足')
-              goods.goods.purchaseNumber = reserve - (reserve % pack)
-            } else {
-              goods.goods.canSub = true
-              goods.goods.canAdd = true
-              let remainder = newNum % pack
-              if (remainder !== 0) {
-//                console.log(this.fragment.num)
-                this.setRemindText('不支持拆包且包装量为' + pack)
-                // 这个直接赋值的,应该给这个值进行判断(Math.floor(newNum / pack) + 1) * pack
-                let res = (Math.floor(newNum / pack) + 1) * pack
-                goods.goods.purchaseNumber = res > reserve ? Math.floor(newNum / pack) * pack : res
-              } else {
-                goods.goods.purchaseNumber = newNum
-              }
-              newNum === buy && (goods.goods.canSub = false)
-              newNum === reserve && (goods.goods.canAdd = false)
-            }
-          }
-        }
-        this.onPurchaseNumberInput(goods)
-      },
       onPullUpAction: function () {
         this.page++
         this.reloadList()
@@ -398,13 +306,47 @@
       linkSaler (item) {
         this.currentStoreInfo = item.enterprise
         this.showLink = true
+      },
+      removeInvalidGoods () {
+        let arr = []
+        this.allActiveObj.forEach(item => {
+          if (item.status === 1) {
+            arr.push(item.id)
+          }
+        })
+        if (!arr.length) {
+          this.setRemindText('购物车内目前没有失效的产品')
+        } else {
+          this.doDelete(arr, '成功清除购物车内的无效产品')
+        }
+      },
+      batchDelete () {
+        if (!this.allActiveObj.length) {
+          this.setRemindText('请选择要删除的商品')
+        } else {
+          let arr = []
+          this.allActiveObj.forEach(item => {
+            arr.push(item.id)
+          })
+          this.doDelete(arr, '删除成功')
+        }
+      },
+      doDelete (idArr, successStr) {
+        this.$http.delete(`/trade/cart/deleteById?ids=${JSON.stringify(idArr)}`).then(res => {
+          this.isChange = true
+          this.page = 1
+          this.reloadList()
+          this.setRemindText(successStr)
+        }, err => {
+          this.setRemindText(err.response.data || '系统错误')
+        })
       }
     }
   }
 </script>
 <style lang="scss" scoped>
   .mobile-cart {
-    bottom: 2rem;
+    bottom: 3.02rem;
     &.empty-mobile-cart {
       bottom: .98rem;
     }
@@ -439,25 +381,23 @@
             border-top: 1px solid #e4e4e4;
             .params {
               margin-left: .17rem;
+              width: 3.03rem;
               .param {
-                width: 3.65rem;
                 margin-top: .22rem;
                 &:first-child {
                   margin-top: 0;
                 }
-                span {
+                .title {
                   color: #666;
                 }
               }
             }
-            .fr {
-              width: 2.6rem;
-              text-align: center;
+            .param-operate {
+              width: 3.23rem;
               .input-line {
                 $group-height: .4rem;
-                margin-top: .52rem;
                 input {
-                  width: 1.31rem;
+                  width: .91rem;
                   height: $group-height;
                   border-top: 1px solid #ddd;
                   border-bottom: 1px solid #ddd;
@@ -470,9 +410,9 @@
                   top: .01rem;*/
                 }
                 span {
-                  width: .5rem;
+                  width: .35rem;
                   height: $group-height;
-                  line-height: $group-height;
+                  line-height: .38rem;
                   text-align: center;
                   border: 1px solid #ddd;
                   font-size: .24rem;
@@ -489,7 +429,7 @@
                   }
                 }
               }
-              .price-line {
+              /*.price-line {
                 font-size: .32rem;
                 color: #f43938;
                 margin-top: .2rem;
@@ -497,7 +437,7 @@
                   margin-right: .06rem;
                   font-size: .24rem;
                 }
-              }
+              }*/
             }
           }
         }
@@ -506,21 +446,24 @@
     .buy-wrap {
       position: fixed;
       bottom: .98rem;
-      height: 1.02rem;
-      line-height: 1.02rem;
-      padding-left: .27rem;
       background: #fff;
       width: 100%;
-      border-top: .02rem solid #ccc;
-      .fr {
-        .fare {
+      .line {
+        border-top: .02rem solid #ccc;
+        height: 1.02rem;
+        line-height: 1.02rem;
+        padding-left: .27rem;
+      }
+      .wrap-count {
+       /* .fare {
           font-size: .24rem;
           color: #999;
           margin-right: .15rem;
           font-style: normal;
           display: inline-block;
           vertical-align: middle;
-        }
+        }*/
+        text-align: right;
         .title {
           font-size: .28rem;
           margin-right: .1rem;
@@ -548,9 +491,31 @@
           text-align: center;
           font-size: .28rem;
           color: #fff;
-          background: #fc2706;
+          background: #3f84f6;
+        }
+      }
+      .wrap-select {
+        padding-right: .15rem;
+        .operate-btn {
+          display: inline-block;
+          font-size: .26rem;
+          padding: .16rem .12rem;
+          color: #3f84f6;
+          border: 1px solid #3f84f6;
+          margin-left: .28rem;
+          border-radius: .04rem;
+          line-height: normal;
+          margin-top: .16rem;
         }
       }
     }
+    .ol-price {
+      font-size: .28rem;
+      color: #f43938 !important;
+      span {
+        color: #f43938 !important;
+        font-size: .24rem;
+      }
+    }
   }
 </style>

+ 31 - 29
pages/mobile/center/user/index.vue

@@ -26,33 +26,37 @@
           </li>
         </ul>
       </div>
-      <div class="block-wrap collect-block">
-        <nuxt-link tag="div" to="/mobile/order?type=buyer" class="content-line">
-          <img src="/images/mobile/center/user/order.jpg" alt="">
-          <span>采购订单</span>
-          <i class="iconfont icon-xiangyou"></i>
-        </nuxt-link>
-        <nuxt-link tag="div" to="/mobile/center/user/cart" class="content-line">
-          <img src="/images/mobile/center/user/cart.jpg" alt="">
-          <span>购物车<span class="text">({{carCount || 0}})</span></span>
-          <i class="iconfont icon-xiangyou"></i>
-        </nuxt-link>
-        <nuxt-link tag="div" to="/mobile/center/user/collect/component" class="content-line">
-          <img src="/images/mobile/center/user/comp-collect.png" alt="">
-          <span>器件收藏<span class="text">({{compCount.data || 0}})</span></span>
-          <i class="iconfont icon-xiangyou"></i>
-        </nuxt-link>
-        <nuxt-link tag="div" to="/mobile/center/user/collect/store" class="content-line">
-          <img src="/images/mobile/center/user/store-focus.png" alt="">
-          <span>店铺关注<span class="text">({{storeCount.data || 0}})</span></span>
-          <i class="iconfont icon-xiangyou"></i>
-        </nuxt-link>
-        <nuxt-link tag="div" to="/mobile/center/user/collect/message" class="content-line" v-if="user.data.enterprise.uu">
-          <img src="/images/mobile/center/user/message.png" alt="">
-          <span>消息中心<span class="text">({{messageCount.count || 0}})</span></span>
-          <i class="iconfont icon-xiangyou"></i>
-        </nuxt-link>
+
+      <div class="block-wrap seek-operation">
+        <p><i></i>更多服务</p>
+        <ul>
+          <nuxt-link tag="li" to="/mobile/order?type=buyer" class="content-line">
+            <img src="/images/mobile/center/user/order.jpg" alt="">
+            <p>采购订单</p>
+          </nuxt-link>
+          <nuxt-link tag="li" to="/mobile/center/user/cart" class="content-line">
+            <img src="/images/mobile/center/user/cart.jpg" alt="">
+            <p>购物车<span class="text">{{carCount && carCount >= 99 ? 99 : carCount || 0}}</span></p>
+          </nuxt-link>
+          <nuxt-link tag="li" to="/mobile/center/user/collect/component" class="content-line">
+            <img src="/images/mobile/center/user/comp-collect.png" alt="">
+            <p>器件收藏<span class="text">{{compCount.data && compCount.data >= 99 ? 99 : compCount.data || 0}}</span></p>
+          </nuxt-link>
+          <nuxt-link tag="li" to="/mobile/center/user/collect/store" class="content-line">
+            <img src="/images/mobile/center/user/store-focus.png" alt="">
+            <p>店铺关注<span class="text">{{storeCount.data && storeCount.data >= 99 ? 99 : storeCount.data || 0}}</span></p>
+          </nuxt-link>
+          <nuxt-link tag="li" to="/mobile/center/user/payCenter" class="content-line">
+            <img src="/images/mobile/center/user/payfor_icon.png" alt="">
+            <p>支付中心</p>
+          </nuxt-link>
+          <nuxt-link tag="li" to="/mobile/center/user/collect/message" class="content-line" v-if="user.data.enterprise.uu">
+            <img src="/images/mobile/center/user/message.png" alt="">
+            <p>消息中心<span class="text">{{messageCount.count && messageCount.count >= 99 ? 99 : messageCount.count || 0}}</span></p>
+          </nuxt-link>
+        </ul>
       </div>
+
     </div>
     <publish-seek :showSayPriceBox="showPublishBox" @cancelAction="showPublishBox = false" @remindAction="onRemind"></publish-seek>
     <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
@@ -81,9 +85,7 @@
      if (user.enterprise.uu) {
        promises.push(store.dispatch('messageShow/loadMessageCount', {receiverUu: user.userUU, receiverEnuu: user.enterprise.uu, consumerApp: 'MALL', isRead: 0}))
      }
-      return Promise.all([
-        promises
-      ])
+      return Promise.all(promises)
     },
     components: {
       RemindBox,

+ 322 - 125
pages/mobile/center/user/pay/_orderId.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="mobile-content mobile-content-long mobile-pay">
-    <div class="pay-head" @click="openAddrModal">
+    <!--<div class="pay-head" @click="openAddrModal">
       <template v-if="selectedAddress && selectedAddress.name">
         <p class="info">
           {{selectedAddress.name}}&nbsp;&nbsp;&nbsp;{{selectedAddress.tel}}
@@ -14,35 +14,44 @@
       <template v-else>
         <div class="no-addr">暂无收货地址信息</div>
       </template>
-    </div>
+    </div>-->
     <ul class="pay-store-list">
       <li class="ps-item" v-for="item in orderData">
-        <p class="ps-store-name">{{item.storeName}}
-          <a class="com-mobile-link" @click="linkSaler(item)"><i class="iconfont icon-kefu1"></i>联系卖家</a>
+        <p class="ps-store-name">
+          <span class="inline-block text-ellipse seller-name"><span>卖&nbsp;&nbsp;家:</span>{{item.storeName}}&nbsp;<i class="iconfont icon-arrow-right"></i></span>
+          <a class="com-mobile-link" @click.stop="linkSaler(item)"><i class="iconfont icon-kefu1"></i>联系卖家</a>
         </p>
-        <div class="ps-goods-info clearfix"  @click="showDetailList(item.goods)">
-          <div class="fl">
-            <!--<span class="inline-block arrow" @click="goodsScroll('left')">
-            <i class="iconfont icon-xiangzuo"></i>
-            </span>-->
-            <ul class="ps-goods-list">
-              <li class="inline-block" v-for="goods in item.goods">
-                <div class="ps-goods-item text-ellipse" :class="{'pg-item-long': item.goods.length === 1}"><span>品牌:</span>{{goods.brName || '-'}}</div>
-                <div class="ps-goods-item text-ellipse" :class="{'pg-item-long': item.goods.length === 1}"><span>类目:</span>{{goods.kiName || '-'}}</div>
-                <div class="ps-goods-item text-ellipse" :class="{'pg-item-long': item.goods.length === 1}"><span>型号:</span>{{goods.cmpCode || '-'}}</div>
-                <div class="ps-goods-item text-ellipse" :class="{'pg-item-long': item.goods.length === 1}"><span>规格:</span>{{goods.spec || '-'}}</div>
-              </li>
-            </ul>
-            <span class="inline-block arrow" @click="goodsScroll('right')">
-            <i class="iconfont icon-xiangyou"></i>
-          </span>
-          </div>
-          <div class="fr">
-            <p class="price text-ellipse"><span>{{payData.currency | currencyFilter}}</span>{{item.goodsPrice}}</p>
-            <p class="count text-ellipse">共{{item.goods.length || 0}}件产品</p>
+        <div class="ps-goods-info"  @click="showDetailList(item.goods)">
+          <ul class="ps-goods-list">
+            <li class="inline-block" v-for="goods in (item.$expand && item.goods.length > 3 ? item.goods : item.goods.slice(0, 3))">
+              <div class="clearfix" style="padding: .31rem .25rem;">
+                <div class="fl">
+                  <div class="ps-goods-item text-ellipse"><span>品牌:</span>{{goods.brName || '-'}}</div>
+                  <div class="ps-goods-item text-ellipse"><span>类目:</span>{{goods.kiName || '-'}}</div>
+                  <div class="ps-goods-item text-ellipse"><span>型号:</span>{{goods.cmpCode || '-'}}</div>
+                  <div class="ps-goods-item text-ellipse"><span>规格:</span>{{goods.spec || '-'}}</div>
+                </div>
+                <div class="fr">
+                  <div class="ps-goods-item text-ellipse"><span>交期(天):</span>{{goods.goodsHistory.b2cMinDelivery + '-' +  goods.goodsHistory.b2cMaxDelivery}}</div>
+                  <div class="ps-goods-item text-ellipse"><span>单价:</span>{{baseUtils.getPriceByLevel(goods.goods.prices, goods.goods.purchaseNumber, goods.currencyName)}}</div>
+                  <div class="ps-goods-item text-ellipse"><span>起拍:</span>{{goods.minBuyQty}}</div>
+                  <div class="ps-goods-item"><span>数量(PCS):</span>
+                    <span class="input-line inline-block">
+                    <span class="inline-block" @click="setGoods('sub', goods)" :class="{disab: !goods.goods.canSub}">-</span>
+                    <input type="number" v-model="goods.goods.purchaseNumber" @blur="setGoods('set', goods)">
+                    <span class="inline-block" @click="setGoods('add', goods)" :class="{disab: !goods.goods.canAdd}">+</span>
+                  </span>
+                  </div>
+                </div>
+              </div>
+              <div class="single-count text-ellipse"><span class="pay-price-title inline-block">小计:</span><span class="ol-price"><span>{{goods.currencyName | currencyFilter}}</span>{{goods.goods.currentPrice}}</span></div>
+            </li>
+          </ul>
+          <div class="show-more-psgoods" v-if="item.goods.length > 3 && !item.$expand" @click="item.$expand = true">
+            查看更多 <i class="iconfont icon-arrow-down"></i>
           </div>
         </div>
-        <div class="ps-operate-line" @click="showRuleSet(item.storeid)">
+       <!-- <div class="ps-operate-line" @click="showRuleSet(item.storeid)">
           <span class="title">配送方式</span>
           <div class="fr">
             <div class="inline-block">
@@ -52,8 +61,15 @@
             </div>
             <i class="iconfont icon-xiangyou" v-if="fareRule[item.storeid] && fareRule[item.storeid][0]"></i>
           </div>
-        </div>
-        <div class="ps-operate-line ps-operate-takeself" v-if="checkShowTakeSelf(item)" @click="showTakeSelfSet(item.storeid)">
+        </div>-->
+     <!--   <div class="ps-operate-line">
+          <span class="title">物流选择</span>
+          <div class="fr">
+            <div class="delivery-select active inline-block">最省钱</div>
+            <div class="delivery-select inline-block">最快</div>
+          </div>
+        </div>-->
+        <!--<div class="ps-operate-line ps-operate-takeself" v-if="checkShowTakeSelf(item)" @click="showTakeSelfSet(item.storeid)">
           <span class="title">自提点</span>
           <div class="fr">
             <div class="inline-block">
@@ -66,46 +82,73 @@
             </div>
           </div>
         </div>
-        <div class=""></div>
         <div class="ps-operate-line">
           <span class="title">订单备注</span>
           <input type="text" v-model="item.remark" placeholder="选填:填写内容需和卖家协商确认">
+        </div>-->
+        <div class="ps-operate-line ps-fare">
+          <div class="text-ellipse">
+            <span class="pay-price-title inline-block">运费:</span><span class="ol-price" v-if="item.fare"><span v-if="item.fare.fare > 0">{{item.fare.currencyName | currencyFilter}}</span>{{item.fare.fare}}</span>
+            <span class="ol-price" v-else>0</span>
+          </div>
+          <div class="text-ellipse">
+             <span class="pay-price-title inline-block">手续费:</span><span class="ol-price"><span>{{payData.currency | currencyFilter}}</span>0.00</span>
+            <!--(<span class="ol-price fare"><span>{{payData.currency | currencyFilter}}</span>{{getPoundage(item)}}</span>)-->
+            <span class="inline-block tag">减免</span>
+            <i class="fa fa-exclamation-circle"></i>
+          </div>
         </div>
         <div class="ps-operate-line ps-price">
-          <span class="inline-block text-ellipse">
-             运费:<span class="ol-price" v-if="item.fare"><span v-if="item.fare.fare > 0">{{item.fare.currencyName | currencyFilter}}</span>{{item.fare.fare || 0}}</span>
-          </span>
-          <span class="inline-block text-ellipse">
-             店铺合计:<span class="ol-price"><span>{{payData.currency | currencyFilter}}</span>{{item.goodsFarePrice || 0}}</span>
-          </span>
+          <span class="pay-price-title inline-block">店铺合计:</span>
+          <span class="ol-price"><span>{{payData.currency | currencyFilter}}</span>
+          {{item.goodsFarePrice || 0}}</span>
         </div>
       </li>
     </ul>
-    <div class="ps-operate-line pay-operate">
-      <span class="title">支付方式</span>
-      <div class="fr">
-        <span>线下支付</span>
-        <!--<i class="iconfont icon-xiangyou"></i>-->
+    <div class="ps-operate-line ps-address" @click="openAddrModal">
+      <div class="inline-block">
+        <template v-if="selectedAddress && selectedAddress.name">
+          <p class="addr">
+            <span class="addr-title inline-block">收货地址:</span>
+            <span class="inline-block area">{{selectedAddress.area + selectedAddress.detailAddress}}</span>
+          </p>
+          <p class="text-ellipse info">
+            <span class="info-name">收货人:</span>{{selectedAddress.name}}
+            <span class="info-phone">电话:</span>{{selectedAddress.tel}}
+          </p>
+        </template>
+        <template v-else>
+          <p class="no-addr">暂无收货地址信息</p>
+        </template>
       </div>
+      <i class="iconfont icon-xiangyou inline-block"></i>
     </div>
     <div class="ps-operate-line pay-invoice" @click="openInvoiceModal">
-      <span class="title">开具发票</span>
+      <span class="title">发票信息:</span>
       <div class="fr">
-        <div class="inline-block" :style="!selectedInvoice ? 'line-height: unset;' : ''">
+        <p class="inline-block text-ellipse">
           <template v-if="selectedInvoice">
-            <span>{{selectedInvoice.head}}</span>
-            <span>{{selectedInvoice.kind === 1205 ? '增值税专用发票' : '增值税普通发票'}}</span>
+            <span class="inv-head inline-block text-ellipse">{{selectedInvoice.head}}</span>
+            <span class="inv-type inline-block">({{selectedInvoice.kind === 1205 ? '专用发票' : '普通发票'}})</span>
           </template>
           <template v-else>
             <span>暂不开具发票</span>
           </template>
-        </div>
+        </p>
         <i class="iconfont icon-xiangyou"></i>
       </div>
     </div>
+    <div class="ps-operate-line pay-operate">
+      <span class="title">支付方式</span>
+      <div class="fr">
+        <span>线下支付</span>
+        <!--<i class="iconfont icon-xiangyou"></i>-->
+      </div>
+    </div>
     <div class="buy-wrap">
       <div class="fr">
-        <span class="title">实付:</span><span class="ol-price price inline-block text-ellipse"><span>{{payData.currency | currencyFilter}}</span>{{allOrderPrice}}</span>
+        <span class="title">实付:</span><span class="ol-price price inline-block text-ellipse"><span>{{payData.currency | currencyFilter}}</span>
+        {{allPriceNew}}</span>
         <button class="buy-btn" @click="confirmOrder">提交订单</button>
       </div>
     </div>
@@ -119,7 +162,7 @@
     <!-- 联系卖家弹框end -->
 
     <!-- 产品清单弹框start -->
-    <modal-wrapper :showModal="showModal"
+    <!--<modal-wrapper :showModal="showModal"
                    :title="'产品清单'"
                    @closeAction="showModal = false">
       <ul class="cGoods-list">
@@ -144,7 +187,7 @@
           </div>
         </li>
       </ul>
-    </modal-wrapper>
+    </modal-wrapper>-->
     <!-- 产品清单弹框end -->
 
     <!-- 选择配送方式弹框start -->
@@ -157,7 +200,7 @@
             <input type="checkbox">
             <span>{{cdr.method | deliveryRuleFilter}}</span>
           </label>
-          <div class="fr" v-if="cdr.fare && cdr.fare > 0">运费:<span class="ol-price"><span>{{cdr.currencyName | currencyFilter}}</span>{{cdr.fare}}</span></div>
+          <div class="fr" v-if="cdr.fare && cdr.fare > 0">运费:<span class="ol-price"><span>{{cdr.currencyName | currencyFilter}}</span>{{cdr.fare || 0}}</span></div>
         </li>
       </ul>
     </bottom-modal-wrapper>
@@ -262,6 +305,7 @@
 <script>
   import { LinkUser, ModalWrapper, BottomModalWrapper } from '~components/mobile/base'
   import { RemindBox } from '~components/mobile/common'
+  import { goodsPurchaseOperate } from '~utils/mixin'
   export default {
     layout: 'mobile',
     middleware: 'authenticated',
@@ -295,6 +339,7 @@
         currentTakeSelfStoreId: ''
       }
     },
+    mixins: [goodsPurchaseOperate],
     components: {
       LinkUser,
       ModalWrapper,
@@ -335,7 +380,7 @@
 //        // 默认选择第三方配送  --1301第三方配送 --卖家配送  --1303上门自提
 //        invoices.deliverytype = 1301
 //        return invoices
-        return this.$store.state.userCenter.list.pay.data
+        return this.baseUtils.deepCopy(this.$store.state.userCenter.list.pay.data)
       },
       addressData () {
         return this.$store.state.userCenter.list.address.data
@@ -367,6 +412,18 @@
           })
         })
         return arr
+      },
+      allPriceNew () {
+        let allOrderPrice = 0
+        this.orderData.forEach((item, index) => {
+          item.goodsPrice = this.getTotalPrice(item) // 总价
+          // 包含运费的价格
+//          item.goodsFarePrice = this.baseUtils.priceFixed(item.goodsPrice + (item.fare && item.fare.fare ? item.fare.fare : 0))
+          item.goodsFarePrice = item.goodsPrice
+//          this.$set(item, 'goodsFarePrice', item.goodsPrice)
+          allOrderPrice += item.goodsPrice
+        })
+        return allOrderPrice
       }
 //      // 选择自提点的列表统计
 //      showTakeSelfList () {
@@ -390,6 +447,8 @@
     methods: {
       initOrderData () {
         this.payData.orderDetails.forEach(item => {
+          item.goods = item.goodsHistory
+          this.initGoodsStatus(item.goods, item.number)
           let current = this.orderData.find(objItem => {
             return objItem.storeid === item.storeid
           })
@@ -398,7 +457,10 @@
               storeName: item.storeName,
               storeid: item.storeid,
               supEnUU: item.supEnUU,
-              goods: [item]
+              goods: [item],
+              $expand: false,
+              goodsFarePrice: 0,
+              goodsPrice: 0
             })
           } else {
             current.goods.push(item)
@@ -408,7 +470,7 @@
         this.getTakeSelfInfo()
       },
       getDeliveryRule () {
-        return this.$http.post(`/trade/distributionRule/usable/rule?area=${this.selectedAddress.area}`, this.ruleParamsArr)
+        return !this.selectedAddress.id ? {} : this.$http.post(`/trade/distributionRule/usable/rule?area=${this.selectedAddress.area}`, this.ruleParamsArr)
           .then(res => {
             this.fareRule = res.data || {}
             this.initFare()
@@ -430,17 +492,21 @@
           item.fare = this.fareRule[item.storeid] && this.fareRule[item.storeid].length ? this.fareRule[item.storeid][0] : {}
           item.goodsPrice = this.getTotalPrice(item) // 总价
           // 包含运费的价格
-          item.goodsFarePrice = this.baseUtils.priceFixed(item.goodsPrice + (item.fare && item.fare.fare ? item.fare.fare : 0))
+//          item.goodsFarePrice = this.baseUtils.priceFixed(item.goodsPrice + (item.fare && item.fare.fare ? item.fare.fare : 0))
+          item.goodsFarePrice = item.goodsPrice
           this.allOrderPrice += item.goodsFarePrice
         })
       },
       getTotalPrice (storeItem) {
         let price = 0
         storeItem.goods.forEach(item => {
-          price += item.price
+          price += item.goods.currentPrice
         })
         return Number(price.toFixed(6))
       },
+      getPoundage (item) {
+        return this.baseUtils.priceFixed((item.goodsFarePrice || item.goodsPrice) * 0.00453)
+      },
       linkSaler (item) {
         this.$http.get(`/basic/enterprise/${item.supEnUU}/info`).then(res => {
           this.currentStoreInfo = res.data
@@ -613,7 +679,6 @@
         let param = {
           orderid: this.baseUtils.enidfilter(arr.join('-'))
         }
-        console.log(param)
         // 跳转至付款页面
         console.log('订单已存在,直接跳转至付款页面')
         this.$router.push(`/mobile/center/user/doPay/${encodeURIComponent(param.orderid)}`)
@@ -702,7 +767,7 @@
         this.payData.orderDetails.forEach(item => {
           orderDetails.push({
             id: item.id,
-            number: item.number,
+            number: item.goods.purchaseNumber,
             taxUnitprice: item.taxUnitprice,
             remark: item.remark,
             goodsnumber: item.goodsnumber,
@@ -805,69 +870,77 @@
           padding: 0 .25rem;
           font-size: .28rem;
           text-align: left;
+          .seller-name {
+            max-width: 5rem;
+            position: relative;
+            padding-right: .2rem;
+            span {
+              color: #666;
+            }
+            i {
+              position: absolute;
+              right: 0;
+              font-size: .32rem;
+              color: #bebebe;
+            }
+          }
         }
         .ps-goods-info {
-          background: #f0f0f0;
-          .fl {
-            padding: 0 .29rem 0 .1rem;
-            position: relative;
-            .ps-goods-list {
-              width: 4.5rem;
-              height: 100%;
-              padding: .22rem 0;
-              overflow-x: auto;
-              white-space: nowrap;
-              li {
-                border-right: 1px solid #969696;
-                .ps-goods-item {
-                  width: 2.25rem;
-                  padding-left: .12rem;
-                  font-size: .24rem;
-                  &.pg-item-long {
-                    width: 4.5rem;
-                  }
-                  span {
-                    color: #666;
-                  }
+          border-top: 1px solid #e4e4e4;
+          border-bottom: 1px solid #e4e4e4;
+          .ps-goods-list {
+            background: #f9f9f8;
+            height: 100%;
+            li {
+              border-bottom: 1px solid #e4e4e4;
+              width: 100%;
+              .fl {
+                margin-right: .23rem;
+                width: 3.49rem;
+              }
+              .fr {
+                width: 3.2rem;
+                .ol-price {
+                  font-size: .26rem;
                 }
               }
-            }
-            .arrow {
-              position: absolute;
-              height: 100%;
-              color: #666;
-              background: #dfdfdf;
-              padding-top: .66rem;
-              top: 0;
-              &:first-child {
-                left: 0;
+              .ps-goods-item {
+                font-size: .28rem;
+                > span {
+                  color: #666;
+                }
               }
-              &:last-child {
-                right: 0;
+              .single-count {
+                height: .61rem;
+                line-height: .61rem;
+                background: #ebebeb;
+                font-size: .28rem;
+                color: #666;
+                text-align: right;
+                padding: 0 .21rem 0 .25rem;
+                .ol-price {
+                  font-size: .26rem;
+                }
               }
             }
           }
-          .fr {
-            width: 2.6rem;
+          .show-more-psgoods {
+            height: .67rem;
+            line-height: .67rem;
+            font-size: .24rem;
+            color: #999;
             text-align: center;
-            .price {
-              color: #f43938;
-              font-size: .32rem;
-              margin-top: .44rem;
-              padding-right: .05rem;
-              span {
-                font-size: .24rem;
-              }
-            }
-            .count {
-              font-size: .28rem;
-              font-weight: bold;
-              margin-top: .2rem;
+            i {
+              font-size: .24rem;
+              color: #999;
             }
           }
         }
       }
     }
+    .pay-price-title {
+      float: left;
+    }
     .ps-operate-line {
       height: .89rem;
       line-height: .89rem;
@@ -880,18 +953,40 @@
           line-height: normal;
           text-align: right;
           span {
-            font-size: .27rem;
             color: #666;
-            &:first-child {
+           /* &:first-child {
               color: #333;
               font-weight: bold;
               display: block;
-            }
+            }*/
             &.red {
               color: $red-text;
             }
           }
         }
+        .delivery-select {
+          width: 1.54rem;
+          height: .5rem;
+          line-height: .5rem;
+          text-align: center;
+          border: 1px solid #a1a1a1;
+          color: #999;
+          background: url('/images/mobile/center/user/delivery.png') no-repeat;
+          background-size: .2rem .2rem;
+          background-position: 1.3rem .25rem;
+          border-radius: .03rem;
+          margin-left: .56rem;
+          &:first-child {
+            margin-left: 0;
+          }
+          &.active {
+            background: url('/images/mobile/center/user/delivery-active.png') no-repeat;
+            background-size: .2rem .2rem;
+            background-position: 1.3rem .25rem;
+            color: #3e85f7;
+            border-color: #3e85f7;
+          }
+        }
         i {
           color: #bebebe;
           margin-left: .14rem;
@@ -908,11 +1003,79 @@
         padding-right: .31rem;
         .inline-block {
           font-size: .26rem;
-          max-width: 64%;
-          &:first-child {
-            max-width: 32%;
-            margin-right: .18rem;
+        }
+      }
+      &.ps-fare {
+        line-height: .43rem;
+        font-size: .24rem;
+        .text-ellipse {
+          text-align: right;
+          color: #333;
+          .ol-price {
+            font-size: .22rem;
+            span {
+              font-size: .22rem;
+            }
+          }
+          .fare {
+            text-decoration: line-through;
+            color: #666!important;
+          }
+          i {
+            font-size: .28rem;
+            color: #adacac;
+          }
+          .tag {
+            height: .25rem;
+            line-height: .25rem;
+            width: .48rem;
+            font-size: .22rem;
+            color: #fff;
+            background: #15b262;
+            border-radius: .02rem;
+            text-align: center;
+            margin-left: .14rem;
+            margin-right: .06rem;
+            position: relative;
+            top: -.02rem;
+          }
+        }
+      }
+      &.ps-address {
+        height: auto;
+        line-height: unset;
+        padding: .25rem 0;
+        position: relative;
+        padding-left: .21rem;
+        border-bottom: .11rem solid #f1f3f7;
+        > div {
+          width: 6.76rem;
+          padding-right: .26rem;
+          p {
+            font-size: .28rem;
+          }
+        }
+        i {
+          color: #bebebe;
+        }
+        .addr {
+          margin-bottom: .33rem;
+          .area {
+            width: 5rem;
+            word-break: break-all;
+            padding-left: .2rem;
+          }
+        }
+        .info {
+          .info-name {
+            margin-right: .46rem;
           }
+          .info-phone {
+            margin-left: .5rem;
+          }
+        }
+        .no-addr {
+          text-align: center;
         }
       }
       &.pay-operate {
@@ -932,21 +1095,20 @@
       &.pay-invoice {
         border-bottom: .11rem solid #f1f3f7;
         .fr {
-          padding-top: 0;
-          .inline-block {
-            vertical-align: top;
-          }
+          font-size: .28rem;
           i {
             float: right;
           }
-          span {
-            font-size: .28rem;
-            color: #333;
-            font-weight: normal !important;
-            max-width: 5rem;
-            overflow: hidden;
-            text-overflow: ellipsis;
-            white-space: nowrap;
+          p {
+            position: relative;
+            bottom: .06rem;
+          }
+          .inv-head {
+            max-width: 4rem;
+          }
+          .inv-type {
+            font-size: .24rem;
+            color: #999;
           }
         }
       }
@@ -965,7 +1127,7 @@
       }
     }
     .ol-price {
-      color: #f43938;
+      color: #f43938 !important;
       font-size: .32rem;
       span {
         font-size: .24rem;
@@ -1000,7 +1162,7 @@
           text-align: center;
           font-size: .28rem;
           color: #fff;
-          background: #fc2706;
+          background: #3f84f6;
         }
       }
     }
@@ -1150,5 +1312,40 @@
         }
       }
     }
+    .input-line {
+      $group-height: .4rem;
+      input {
+        width: .91rem;
+        height: $group-height;
+        border-top: 1px solid #ddd;
+        border-bottom: 1px solid #ddd;
+        vertical-align: middle;
+        border-radius: 0;
+        padding: 0 .05rem;
+        text-align: center;
+        line-height: $group-height;
+        /*  position: relative;
+          top: .01rem;*/
+      }
+      span {
+        width: .35rem;
+        height: $group-height;
+        line-height: .38rem;
+        text-align: center;
+        border: 1px solid #ddd;
+        font-size: .24rem;
+        &:first-child {
+          border-top-left-radius: .05rem;
+          border-bottom-left-radius: .05rem;
+        }
+        &:last-child {
+          border-top-right-radius: .05rem;
+          border-bottom-right-radius: .05rem;
+        }
+        &.disab {
+          background: #e8e8e8;
+        }
+      }
+    }
   }
 </style>

+ 479 - 0
pages/mobile/center/user/payCenter.vue

@@ -0,0 +1,479 @@
+<template>
+  <div class="mobile-pay-center mobile-fix-content mobile-centerfix-content" id="mobileFixContent" @click="setShowSelect('all', false)">
+    <div class="mp-head">
+      <span class="inline-block" :class="{'active': switchType === 'record'}" @click="setSwitchType('record')">交易记录</span>
+      <span class="inline-block" :class="{'active': switchType === 'account'}" @click="setSwitchType('account')">付款账户</span>
+    </div>
+    <div class="mp-content" v-if="switchType == 'account'">
+      <p class="mp-content-header">已设置的账户信息<span class="fr" @click="openAddAccount"><i class="iconfont icon-xinzeng"></i>新增账户</span></p>
+      <ul class="mp-list">
+        <li v-for="account in accountList">
+          <div class="content-line">
+            <span class="inline-block title">开户银行:</span>
+            <span class="inline-block content text-ellipse">{{account.bankname}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">开户支行:</span>
+            <span class="inline-block content text-ellipse">{{account.branchname}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">银行账户:</span>
+            <span class="inline-block content text-ellipse">{{account.number}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">开户名称:</span>
+            <span class="inline-block content text-ellipse">{{account.accountname}}</span>
+          </div>
+          <div class="content-line clearfix">
+            <span class="inline-block title">操作:</span>
+            <a class="fr inline-block default-icon" v-if="account.num == 1">默认账户</a>
+            <a class="fr inline-block set-default-icon" v-if="account.num != 1" @click="setDefaultAccount(account)">设为默认</a>
+            <a class="fr inline-block" @click="deleteAccount(account)">删除</a>
+          </div>
+        </li>
+      </ul>
+    </div>
+    <div class="mp-record" v-if="switchType == 'record'">
+      <div class="search-content">
+        <input type="text" placeholder="商家名称/订单号" v-model="filterParams.keyword" @keyup.13="filterRecord">
+        <span @click="filterRecord"><i class="iconfont icon-sousuo"></i></span>
+      </div>
+      <div class="filters-wrap">
+        <div class="date-wrap">
+          <label>
+            <i class="iconfont icon-ico-date"></i>
+            <input type="date" v-model="filterParams.fromDate" @change="setDate('fromDate')">
+            <p v-if="filterParams.fromDate">{{filterParams.fromDate | date}}</p>
+          </label>
+          <span>—</span>
+          <label>
+            <i class="iconfont icon-ico-date"></i>
+            <input type="date" v-model="filterParams.toDate" @change="setDate('toDate')">
+            <p v-if="filterParams.toDate">{{filterParams.toDate | date}}</p>
+          </label>
+        </div>
+        <ul class="select-wrap">
+          <li class="inline-block">
+            <div @click.stop="setShowSelect('method', !showSelectMethod)">{{filterParams.method ? filterParams.method == 1103 ? '线下支付' : '线上支付' : '交易方式'}}</div>
+            <ul class="select-list" v-show="showSelectMethod">
+              <li @click.stop="setSelect('method', null)">交易方式</li>
+              <li @click.stop="setSelect('method', 1103)">线下支付</li>
+              <li @click.stop="setSelect('method', 1102)">线上支付</li>
+            </ul>
+          </li>
+          <li class="inline-block">
+            <div @click.stop="setShowSelect('currency', !showSelectCurrency)">{{filterParams.currency || '币种'}}</div>
+            <ul class="select-list" v-show="showSelectCurrency">
+              <li @click.stop="setSelect('currency', null)">币种</li>
+              <li @click.stop="setSelect('currency', 'RMB')">RMB</li>
+              <li @click.stop="setSelect('currency', 'USD')">USD</li>
+            </ul>
+          </li>
+          <li class="inline-block">
+            <div @click.stop="setShowSelect('status', !showSelectStatus)">{{filterParams.status || '状态'}}</div>
+            <ul class="select-list" v-show="showSelectStatus">
+              <li @click.stop="setSelect('status', null)">状态</li>
+              <li @click.stop="setSelect('status', '支付成功')">支付成功</li>
+            </ul>
+          </li>
+        </ul>
+      </div>
+      <ul class="mp-list record-list">
+        <li v-for="record in recordList">
+          <div class="content-line">
+            <span class="inline-block title">时间:</span>
+            <span class="inline-block content text-ellipse">{{record.paytime | time}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">订单号:</span>
+            <span class="inline-block content text-ellipse">{{record.orderid}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">商家名称:</span>
+            <span class="inline-block content text-ellipse">{{record.sellername}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">币种:</span>
+            <span class="inline-block content text-ellipse">{{record.currencyName}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">金额:</span>
+            <span class="inline-block content text-ellipse"><i class="fa fa-minus" style="color: #1da902;"></i>{{record.ensurePrice}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">交易方式:</span>
+            <span class="inline-block content text-ellipse">{{record.paytype == 1103 ? '线下支付' : '线上支付'}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">状态:</span>
+            <span class="inline-block content text-ellipse">支付成功</span>
+          </div>
+        </li>
+      </ul>
+    </div>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+    <pull-up :fixId="'mobileFixContent'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>
+    <!-- 新增账户弹框start -->
+    <div class="mobile-modal account-modal" @click="showSimilar = false" v-if="showModal">
+      <div class="account-modal-wrap add-account-modal">
+        <div class="account-modal">
+          <p class="title">新增账户</p>
+          <div class="modal-content-line">
+            <span class="inline-block"><i>*</i>开户银行:</span>
+            <input type="text" readonly placeholder="例如:中国银行" v-model="bankAccountObj.bankname" @click.stop="showSimilar = !showSimilar">
+            <ul v-if="showSimilar" class="similar">
+              <li class="text-ellipse" v-for="bank in bankList" @click.stop="setBankName(bank)">{{bank}}</li>
+            </ul>
+          </div>
+          <div class="modal-content-line">
+            <span class="inline-block"><i>*</i>开户支行:</span>
+            <input type="text" placeholder="例如:乔香支行" v-model="bankAccountObj.branchname" @blur="checkBranchname">
+          </div>
+          <div class="modal-content-line">
+            <span class="inline-block"><i>*</i>银行账号:</span>
+            <input type="text" placeholder="请填写银行账号" v-model="bankAccountObj.number" @blur="checkNumber">
+          </div>
+          <div class="modal-content-line">
+            <span class="inline-block"><i>*</i>开户名称:</span>
+            <input type="text" placeholder="请填写开户人姓名或企业名称" v-model="bankAccountObj.accountname" @blur="checkAccountname">
+          </div>
+          <div class="modal-content-line clearfix">
+            <p class="remind"><i>*</i>为保障您的资金安全,账户信息加密显示且不可修改,只能删除后重新提交。</p>
+          </div>
+          <div class="am-btn-wrap">
+            <button @click="showModal = false">取消</button>
+            <button @click="addAccount">确认</button>
+          </div>
+        </div>
+      </div>
+    </div>
+    <empty-status v-if="isEmpty" :text="switchType == 'record' ? '暂无支付记录,请下单购买商品吧!' : '暂无账户信息'" :showLink="true"></empty-status>
+    <!-- 新增账户弹框end -->
+  </div>
+</template>
+<script>
+  import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
+  import { ModalWrapper } from '~components/mobile/base'
+  export default {
+    layout: 'mobile',
+    middleware: 'authenticated',
+    data () {
+      return {
+        remindText: '',
+        timeoutCount: '',
+        page: 1,
+        count: 10,
+        accountList: [],
+        recordList: [],
+        switchType: 'record',
+        // 分页重置标志
+        isChange: false,
+        showModal: false,
+        bankList: [],
+        showSimilar: false,
+        bankAccountObj: {
+          bankname: '',
+          branchname: '',
+          number: '',
+          accountname: ''
+        },
+        validBankAccountObj: {
+          bankname: false,
+          branchname: false,
+          number: false,
+          accountname: false
+        },
+        filterParams: {
+          keyword: '',
+          fromDate: '',
+          toDate: '',
+          currencyName: '',
+          // 交易方式
+          method: ''
+        },
+        showSelectMethod: false,
+        showSelectCurrency: false,
+        showSelectStatus: false
+      }
+    },
+    components: {
+      RemindBox,
+      PullUp,
+      ModalWrapper,
+      EmptyStatus
+    },
+    fetch ({store}) {
+      return Promise.all([
+//        store.dispatch('payCenter/loadBuyerAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'buyer'})
+        store.dispatch('payCenter/loadBuyerRecord', {count: 10, page: 1, sorting: {'paytime': 'DESC'}})
+      ])
+    },
+    watch: {
+      'buyerAccount': {
+        handler: function (val) {
+          if (val && val.content) {
+            if (this.isChange) {
+              this.accountList = []
+              this.isChange = false
+            }
+            this.accountList = [...this.accountList, ...val.content]
+          }
+        }
+      },
+      'buyerRecord': {
+        handler: function (val) {
+          if (val && val.content) {
+            if (this.isChange) {
+              this.recordList = []
+              this.isChange = false
+            }
+            this.recordList = [...this.recordList, ...val.content]
+          }
+        },
+        immediate: true
+      }
+    },
+    computed: {
+      accountData () {
+        return this.$store.state.payCenter.data.buyerAccount
+      },
+      recordData () {
+        return this.$store.state.payCenter.data.buyerRecord
+      },
+      buyerAccount () {
+        return this.accountData.data
+      },
+      buyerRecord () {
+        return this.recordData.data
+      },
+      fetching () {
+        return this.switchType === 'account' ? this.accountData.fetching : this.recordData.fetching
+      },
+      allPage () {
+        return this.switchType === 'account' ? this.buyerAccount.totalPages : this.buyerRecord.totalPages
+      },
+      isEmpty () {
+        return (this.switchType === 'record' && this.recordList.length === 0) || (this.switchType === 'account' && this.accountList.length === 0)
+      }
+    },
+    methods: {
+      setRemindText: function (str) {
+        this.remindText = str
+        this.timeoutCount++
+      },
+      reloadList () {
+        if (this.switchType === 'account') {
+          this.$store.dispatch('payCenter/loadBuyerAccount', {
+            count: this.count,
+            page: this.page,
+            sorting: {num: 'ASC'},
+            type: 'buyer'
+          })
+        } else {
+          this.$store.dispatch('payCenter/loadBuyerRecord', {
+            count: this.count,
+            page: this.page,
+            sorting: {'paytime': 'DESC'},
+            currencyName: this.filterParams.currencyName || null,
+            fromDate: this.filterParams.fromDate || null,
+            toDate: this.filterParams.toDate || null,
+            method: this.filterParams.method || null,
+            keyword: this.filterParams.keyword || null
+          })
+        }
+      },
+      initList () {
+        this.isChange = true
+        this.page = 1
+        this.reloadList()
+      },
+      onPullUpAction () {
+        this.page++
+        this.reloadList()
+      },
+      setSwitchType (type) {
+        this.switchType = type
+        if (type === 'record') {
+          this.initFilterParams()
+        }
+        this.initList()
+      },
+      initFilterParams () {
+        this.filterParams = {
+          keyword: '',
+          fromDate: '',
+          toDate: '',
+          currencyName: '',
+          method: ''
+        }
+      },
+      filterRecord () {
+        this.isChange = true
+        this.reloadList()
+      },
+      setShowSelect (type, flag) {
+        if (type === 'all') {
+          this.showSelectMethod = flag
+          this.showSelectCurrency = flag
+          this.showSelectStatus = flag
+        } else if (type === 'method') {
+          this.showSelectMethod = flag
+          this.showSelectCurrency = false
+          this.showSelectStatus = false
+        } else if (type === 'currency') {
+          this.showSelectCurrency = flag
+          this.showSelectStatus = false
+          this.showSelectMethod = false
+        } else if (type === 'status') {
+          this.showSelectStatus = flag
+          this.showSelectMethod = false
+          this.showSelectCurrency = false
+        }
+      },
+      setSelect (type, val) {
+        if (type === 'method') {
+          this.filterParams.method = val
+          this.setShowSelect('method', false)
+        } else if (type === 'currency') {
+          this.filterParams.currency = val
+          this.setShowSelect('currency', false)
+        } else if (type === 'status') {
+          this.filterParams.status = val
+          this.setShowSelect('status', false)
+        }
+        this.filterRecord()
+      },
+      setDate (type) {
+        this.filterParams[type] = new Date(this.filterParams[type]).getTime()
+        if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate > this.filterParams.toDate) {
+          this.setRemindText('起始时间不能大于结束时间')
+          this.filterParams[type] = null
+        } else {
+          this.filterRecord()
+        }
+      },
+      setDefaultAccount (account) {
+        this.$http.get(`/trade/bankInfo/setDefaultAccount/${account.id}`).then(() => {
+          this.setRemindText('设置完成')
+          this.initList()
+        })
+      },
+      deleteAccount (account) {
+        this.$http.delete(`/trade/bankInfo/delete/${account.id}`).then(res => {
+          if (res.data === 'success') {
+            this.setRemindText('删除成功')
+            this.initList()
+          }
+        })
+      },
+      initAccount () {
+        this.bankAccountObj = {
+          bankname: '',
+          branchname: '',
+          number: '',
+          accountname: ''
+        }
+        this.validBankAccountObj = {
+          bankname: false,
+          branchname: false,
+          number: false,
+          accountname: false
+        }
+      },
+      openAddAccount () {
+        if (!this.bankList || !this.bankList.length) {
+          this.$http.get('/data/bank.json').then(res => {
+            this.bankList = res.data.list
+            this.initAccount()
+            this.showModal = true
+          })
+        } else {
+          this.initAccount()
+          this.showModal = true
+        }
+      },
+      setBankName (name) {
+        this.bankAccountObj.bankname = name
+        this.showSimilar = false
+        this.validBankAccountObj.bankname = true
+      },
+      checkBranchname () {
+        this.validBankAccountObj.branchname = true
+        if (!(this.bankAccountObj.branchname && this.bankAccountObj.branchname.length)) {
+          this.setRemindText('开户支行不能为空')
+          this.validBankAccountObj.branchname = false
+        } else if (this.baseUtils.getRealLen(this.bankAccountObj.branchname) > 40) {
+          this.setRemindText('开户支行不能大于40字符')
+          this.validBankAccountObj.branchname = false
+        } else if (!/^[\u2E80-\u9FFF]+$/.test(this.bankAccountObj.branchname)) {
+          this.setRemindText('请输入正确的开户支行')
+          this.validBankAccountObj.branchname = false
+        }
+      },
+      checkNumber () {
+        this.validBankAccountObj.number = true
+        if (!(this.bankAccountObj.number && this.bankAccountObj.number.length)) {
+          this.validBankAccountObj.number = false
+          this.setRemindText('银行账号不能为空')
+        } else if (this.baseUtils.getRealLen(this.bankAccountObj.number) > 30) {
+          this.setRemindText('银行账号不能大于30字符')
+          this.validBankAccountObj.number = false
+        } else if (!/^[0-9]+$/.test(this.bankAccountObj.number)) {
+          this.setRemindText('请输入正确的银行账号')
+          this.validBankAccountObj.number = false
+        }
+        if (this.validBankAccountObj.number) {
+          this.$http.get('/trade/bankInfo/number/count', {params: {type: 1061, number: this.bankAccountObj.number}}).then(res => {
+            if (res.data.success) {
+              this.validBankAccountObj.number = res.data.data === 0
+            } else {
+              this.validBankAccountObj.number = false
+              this.setRemindText(res.data.message || '银行账号校验失败')
+            }
+          }, err => {
+            this.validBankAccountObj.number = false
+            this.setRemindText(err.response.data || '银行账号校验失败')
+            console.log(err)
+          })
+        }
+      },
+      checkAccountname () {
+        this.validBankAccountObj.accountname = true
+        if (!(this.bankAccountObj.accountname && this.bankAccountObj.accountname.length)) {
+          this.validBankAccountObj.accountname = false
+          this.setRemindText('账户名称不能为空')
+        } else if (this.baseUtils.getRealLen(this.bankAccountObj.accountname) > 100) {
+          this.setRemindText('账户名称不能大于100个字符')
+          this.validBankAccountObj.accountname = false
+        }
+      },
+      addAccount () {
+        if (!this.validBankAccountObj.bankname) {
+          this.setRemindText('请选择开户银行')
+        } else if (!this.validBankAccountObj.branchname) {
+          this.setRemindText('请填写正确的开户支行')
+        } else if (!this.validBankAccountObj.number) {
+          this.setRemindText('请填写正确的银行账号')
+        } else if (!this.validBankAccountObj.accountname) {
+          this.setRemindText('请填写正确的开户名称')
+        } else {
+          this.$http.post('/trade/bankInfo/save/personal?type=buyer', this.bankAccountObj).then(res => {
+            if (res.data.id) {
+              this.setRemindText('新增账户成功')
+              this.initList()
+              this.showModal = false
+            } else {
+              this.setRemindText('新增账户失败')
+            }
+          }, err => {
+            this.setRemindText(err.response.data || '新增账户失败')
+            console.log(err)
+          })
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  @import '~assets/scss/mobilePayCenter';
+</style>

+ 25 - 16
pages/mobile/center/vendor/index.vue

@@ -43,23 +43,32 @@
           </nuxt-link>
         </ul>
       </div>
-      <div class="block-wrap collect-block">
-        <!--<div class="content-line" @click="goStore">
-          <img src="/images/mobile/center/vendor/shop.png" alt="">
-          <span>我的店铺</span>
-          <i class="iconfont icon-xiangyou"></i>
-        </div>-->
-        <nuxt-link tag="div" to="/mobile/order?type=saler" class="content-line">
-          <img src="/images/mobile/center/user/order.jpg" alt="">
-          <span>销售订单</span>
-          <i class="iconfont icon-xiangyou"></i>
-        </nuxt-link>
-        <nuxt-link tag="div" to="/mobile/center/vendor/message"  class="content-line" v-if="user.data.enterprise.uu">
-          <img src="/images/mobile/center/user/message.png" alt="">
-          <span>消息中心<span class="text">({{messageCount.count || 0}})</span></span>
-          <i class="iconfont icon-xiangyou"></i>
-        </nuxt-link>
+      <div class="block-wrap seek-operation">
+        <p><i></i>更多服务</p>
+        <ul>
+          <nuxt-link tag="li" to="/mobile/order?type=saler">
+            <img src="/images/mobile/center/user/order.jpg" alt="">
+            <p>销售订单</p>
+          </nuxt-link>
+          <!--<nuxt-link tag="li" to="/">-->
+            <!--<img src="/images/mobile/center/user/wuliu_icon.png" alt="">-->
+            <!--<p>物流管理</p>-->
+          <!--</nuxt-link>-->
+          <nuxt-link tag="li" to="/mobile/center/vendor/payCenter">
+            <img src="/images/mobile/center/user/finance_icon.png" alt="">
+            <p>财务对账</p>
+          </nuxt-link>
+          <nuxt-link tag="li" to="/">
+            <img src="/images/mobile/center/user/invoice_icon.png" alt="">
+            <p>发票管理</p>
+          </nuxt-link>
+          <nuxt-link tag="li" to="/mobile/center/vendor/message"  v-if="user.data.enterprise.uu">
+            <img src="/images/mobile/center/user/message.png" alt="">
+            <p>消息中心<span class="text">{{messageCount.count && messageCount.count >= 99 ? 99 : messageCount.count || 0}}</span></p>
+          </nuxt-link>
+        </ul>
       </div>
+
     </div>
     <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
   </div>

+ 224 - 0
pages/mobile/center/vendor/logistics/distributionSpec.vue

@@ -0,0 +1,224 @@
+<template>
+  <div class="logistics-wrapper">
+    <div class="com-mobile-header">
+      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
+      <p>物流信息
+      </p>
+    </div>
+    <div class="logistics-content" id="logistics-content">
+      <div class="logistics-nav">
+        <div class="order-nav">
+          <div class="active"><span>配送规则</span></div>
+          <div><span>配送商</span></div>
+          <div><span>自提点</span></div>
+          <div><span>发货地址</span></div>
+        </div>
+      </div>
+      <ul class="distributionSpec_ul">
+        <li v-for="(item, index) in resourceList.content">
+          <div class="clearfix">
+            <div class="pull-left Textoverhiden">
+              <div class="wrapper-line clearfix">
+                <div class="name pull-left">优先级:</div>
+                <div class="name-text pull-left">{{item.num}}</div>
+              </div>
+              <div class="wrapper-line clearfix">
+                <div class="name pull-left">配送方式:</div>
+                <div class="name-text pull-left">
+                  {{item.shippingMethod === 1301 ? '第三方配送' : (item.shippingMethod === 1302 ? '卖家配送': '上门自提')}}
+                </div>
+              </div>
+              <div class="wrapper-line clearfix">
+                <div class="name pull-left">规则名称:</div>
+                <div class="name-text pull-left">{{item.ruleName}}</div>
+              </div>
+            </div>
+            <div class="pull-right">
+              <div class="dropMenu" @click="showDropMenu(index)">{{item.active === 1 ? '已生成' : '暂不生效'}}<i class="iconfont icon-arrow-down"></i></div>
+              <div class="dropList">
+                <div @click="SaveBtn()">暂不生效</div>
+                <div @click="SaveBtn()">生效</div>
+              </div>
+            </div>
+          </div>
+          <div class="item-bottom clearfix">
+            <div class="pull-left w50">
+              <i class="iconfont icon-edit"></i>修改
+            </div>
+            <div class="pull-right w50">
+              <i class="iconfont icon-lajitong"></i>删除
+            </div>
+          </div>
+        </li>
+      </ul>
+    </div>
+
+    <pull-up :fixId="'logistics-content'"
+             :searchMore="isSearchSearchingMore"
+             :allPage="allPage"
+             :page="param.page"
+             @pullUpAction="getMoreSearch"></pull-up>
+  </div>
+</template>
+
+<script type="text/javascript">
+  import { PullUp } from '~components/mobile/common'
+  import axios from '~plugins/axios'
+  export default {
+    name: 'distributionSpec',
+    layout: 'mobile',
+    middleware: 'authenticated',
+    data() {
+      return {
+        showDropMenuIndex: '',
+        param: {
+          count: 10,
+          page: 1,
+          sorting: { 'num': 'asc' }
+        },
+        isSearchSearchingMore: false,
+        resourceList: {}  // 实际渲染网页的资源
+      }
+    },
+    async asyncData({store, commit}) {
+      let { data } = await axios.get(`/trade/distributionRule/page`, {count: 10, page: 1, sorting: { 'num': 'asc' }})
+      return {
+        resourceList: data
+      }
+    },
+    methods: {
+      // 生效按钮事件
+      SaveBtn() {},
+      // 显示下拉按钮
+      showDropMenu(index) {
+        this.showDropMenuIndex = index
+      },
+      // 加载更多
+      getMoreSearch() {}
+    },
+    computed: {
+      allPage() {
+        return this.resourceList.totalElements
+      }
+    },
+    components: {
+      PullUp
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  @mixin overFlowHidden {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  @mixin lineHeight($value) {
+    height: $value;
+    line-height: $value;
+  }
+  @mixin Fixed() {
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    top: 0
+  }
+  .logistics-wrapper {
+    @include Fixed();
+    z-index: 111;
+    background: #f1f3f6;
+    .logistics-content {
+      margin-top: 0.88rem;
+      overflow-y: scroll;
+      height: calc(100vh - 0.88rem)
+    }
+    .order-nav {
+      background: #fff;
+      div {
+        height: 0.82rem;
+        line-height: 0.82rem;
+        display: inline-block;
+        width: 25%;
+        text-align: center;
+        font-size: .28rem;
+        color: #666;
+        &.active span{
+          color: #3f84f6;
+          border-bottom: 0.04rem solid #3f84f6;
+          padding-bottom: 0.2rem;
+        }
+      }
+    }
+    .distributionSpec_ul {
+      li {
+        margin: 0.2rem auto 0;
+        background: #fefefe;
+        width: 7.1rem;
+        height: 2.64rem;
+        padding: 0.3rem 0.24rem 0;
+        border: 1px solid #e4e6e9;
+        border-radius: 5px;
+        .Textoverhiden {
+          @include overFlowHidden();
+          width: 5rem;
+        }
+        .dropMenu {
+          font-size: 0.26rem;
+          color: #666;
+          border: 1px solid #d9d9d9;
+          background: #fff;
+          width: 1.37rem;
+          @include lineHeight(0.46rem);
+          border-radius: 0.46rem;
+          text-align: center;
+          i {
+            font-size: 0.2rem;
+          }
+        }
+        .pull-right {position: relative}
+        .dropList {
+          position: absolute;
+          border: 1px solid #d9d9d9;
+          background: #fff;
+          font-size: 0.26rem;
+          width: 1.37rem;
+          top: 0.46rem;
+          text-align: center;
+          div {
+            @include lineHeight(0.46rem);
+          }
+        }
+        .wrapper-line {
+          margin-bottom: 0.16rem;
+          .name {
+            font-size: 0.28rem;
+            color: rgba(63, 132, 246, 0.9);
+            width: 1.4rem;
+            text-align: right;
+          }
+          .name-text {
+            font-size: 0.28rem;
+            color: #333;
+          }
+        }
+        .item-bottom {
+          color: #333;
+          @include lineHeight(0.8rem);
+          font-size: 0.26rem;
+          text-align: center;
+          border-top: 1px solid #d3d3d3;
+          .pull-left {border-right: 1px solid #d3d3d3;}
+          .pull-left, .pull-right {
+            width: 50%;
+            text-align: center;
+          }
+          i {
+            font-size: 0.34rem;
+            vertical-align: middle;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 709 - 0
pages/mobile/center/vendor/payCenter.vue

@@ -0,0 +1,709 @@
+<template>
+  <div class="mobile-pay-center mobile-fix-content mobile-centerfix-content" id="mobileFixContent" @click="setShowSelect('all', false)">
+    <div class="mp-head">
+      <span class="inline-block" :class="{'active': switchType === 'record'}" @click="setSwitchType('record')">交易记录</span>
+      <span class="inline-block" :class="{'active': switchType === 'account'}" @click="setSwitchType('account')">收款账户</span>
+    </div>
+
+    <!-- 账户信息start -->
+    <div class="mp-content" v-if="switchType == 'account'">
+      <p class="mp-content-header">已设置的账户信息<span class="fr" @click="openAddAccount"><i class="iconfont icon-xinzeng"></i>新增账户</span></p>
+      <ul class="mp-list">
+        <li v-for="account in accountList">
+          <div class="content-line">
+            <span class="inline-block title">开户银行:</span>
+            <span class="inline-block content text-ellipse">{{account.bankname}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">开户支行:</span>
+            <span class="inline-block content text-ellipse">{{account.branchname}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">银行账户:</span>
+            <span class="inline-block content text-ellipse">{{account.number}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">开户名称:</span>
+            <span class="inline-block content text-ellipse">{{account.accountname}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">状态:</span>
+            <span class="inline-block content text-ellipse">
+              {{account.status | bankStatusFilter}}
+              <i v-if="account.status == 101" class="iconfont icon-tixing"></i>
+            </span>
+          </div>
+          <div class="content-line clearfix">
+            <span class="inline-block title">操作:</span>
+            <a class="fr inline-block set-default-icon" @click="reuseAccount(account)" v-if="account.status == 105">重新使用</a>
+            <a class="fr inline-block" @click="deleteAccount(account)">删除</a>
+          </div>
+        </li>
+      </ul>
+    </div>
+    <!-- 账户信息end -->
+
+    <!-- 交易记录start -->
+    <div class="mp-record" v-if="switchType == 'record'">
+      <div class="search-content">
+        <input type="text" placeholder="商家名称/订单号" v-model="filterParams.keyword" @keyup.13="filterRecord">
+        <span @click="filterRecord"><i class="iconfont icon-sousuo"></i></span>
+      </div>
+      <div class="filters-wrap">
+        <div class="date-wrap">
+          <label>
+            <i class="iconfont icon-ico-date"></i>
+            <input type="date" v-model="filterParams.fromDate" @change="setDate('fromDate')">
+            <p v-if="filterParams.fromDate">{{filterParams.fromDate | date}}</p>
+          </label>
+          <span>—</span>
+          <label>
+            <i class="iconfont icon-ico-date"></i>
+            <input type="date" v-model="filterParams.toDate" @change="setDate('toDate')">
+            <p v-if="filterParams.toDate">{{filterParams.toDate | date}}</p>
+          </label>
+        </div>
+        <ul class="select-wrap clearfix">
+          <li class="inline-block fl">
+            <div @click.stop="setShowSelect('method', !showSelectMethod)">{{filterParams.method ? filterParams.method == 1103 ? '线下支付' : '线上支付' : '交易方式'}}</div>
+            <ul class="select-list" v-show="showSelectMethod">
+              <li @click.stop="setSelect('method', null)">交易方式</li>
+              <li @click.stop="setSelect('method', 1103)">线下支付</li>
+            </ul>
+          </li>
+          <li class="inline-block fr">
+            <div @click.stop="setShowSelect('status', !showSelectStatus)">{{filterParams.status || '状态'}}</div>
+            <ul class="select-list" v-show="showSelectStatus">
+              <li @click.stop="setSelect('status', null)">状态</li>
+              <li @click.stop="setSelect('status', '收款成功')">收款成功</li>
+            </ul>
+          </li>
+        </ul>
+      </div>
+      <ul class="mp-list record-list" v-if="recordList.length">
+        <li v-for="record in recordList">
+          <div class="content-line">
+            <span class="inline-block title">时间:</span>
+            <span class="inline-block content text-ellipse">{{record.transferTime | time}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">订单号:</span>
+            <span class="inline-block content text-ellipse">{{record.orderid}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">商家名称:</span>
+            <span class="inline-block content text-ellipse">{{record.buyerentername || record.buyername}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">币种:</span>
+            <span class="inline-block content text-ellipse">{{record.currencyName}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">金额:</span>
+            <span class="inline-block content text-ellipse"><i class="fa fa-plus" style="color: #f51c24;"></i>{{record.total}}</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">交易方式:</span>
+            <span class="inline-block content text-ellipse">线下付款</span>
+          </div>
+          <div class="content-line">
+            <span class="inline-block title">状态:</span>
+            <span class="inline-block content text-ellipse">收款成功</span>
+          </div>
+        </li>
+      </ul>
+      <div class="fix-count-wrap" v-if="recordList.length">
+        <span class="content">收入总计:<span>{{currencySymbol | currencyFilter}}&nbsp;{{totalRecordPrice}}</span></span>
+        <span class="content">支出总计:<span>{{currencySymbol | currencyFilter}}&nbsp;0</span></span>
+        <p>结余:{{currencySymbol | currencyFilter}}&nbsp;{{totalRecordPrice}} (共计{{recordList.length || 0}}笔交易)</p>
+      </div>
+    </div>
+    <!-- 交易记录end -->
+
+    <!-- 新增账户弹框start -->
+    <modal-wrapper :noHeader="true" :showModal="showModal" @closeAction="showModal = false">
+      <div class="add-account-modal in-wrapper">
+        <div class="account-modal">
+          <p class="title">新增账户</p>
+          <div class="modal-content-line">
+            <span class="inline-block"><i>*</i>开户银行:</span>
+            <input type="text" readonly placeholder="例如:中国银行" v-model="bankAccountObj.bankname" @click.stop="showSimilar = !showSimilar">
+            <ul v-if="showSimilar" class="similar">
+              <li class="text-ellipse" v-for="bank in bankList" @click.stop="setBankName(bank)">{{bank}}</li>
+            </ul>
+          </div>
+          <div class="modal-content-line">
+            <span class="inline-block"><i>*</i>开户支行:</span>
+            <input type="text" placeholder="例如:乔香支行" v-model="bankAccountObj.branchname" @blur="checkBranchname">
+          </div>
+          <div class="modal-content-line">
+            <span class="inline-block"><i>*</i>银行账号:</span>
+            <input type="text" placeholder="请填写银行账号" v-model="bankAccountObj.number" @blur="checkNumber">
+          </div>
+          <div class="modal-content-line">
+            <span class="inline-block"><i>*</i>开户名称:</span>
+            <input type="text" placeholder="请填写开户人姓名或企业名称" v-model="bankAccountObj.accountname" @blur="checkAccountname">
+          </div>
+          <div class="modal-content-line upload">
+            <span class="inline-block"><i>*</i>上传开户许可证:</span>
+            <input type="text" v-model="file.name" disabled>
+            <label class="upload-btn">选择文件
+              <input type="file" @change="onUpload($event)" accept="image/jpeg,image/jpg,image/png,.pdf">
+            </label>
+          </div>
+          <div class="am-btn-wrap">
+            <button @click="showModal = false">取消</button>
+            <button @click="addAccount">确认</button>
+          </div>
+          <p class="am-remind-text clearfix">
+            <i class="fl">*声明:</i>
+            <span class="fr">
+              1. 此账户为卖家收款账户,请仔细核对信息内容,若由信息错误造成的损失,优软商城不承担赔偿责任。
+              <br/>
+              2. 卖家只能有唯一一个“使用中”的收款账户,新增账户审核通过后,原账户将自动失效。
+              <br/>
+              3. 如您的企业名称、开户银行及账号变更,您须在优软商城开展资金结算前进行更正,否则发生转账错误优软商城不承担赔偿责任。
+              <br/>
+              4. 更多的条款请阅读《优软商城代收代付协议》 。
+              <br/>
+              5. 附件仅支持JPG、PNG、PDF格式,大小超过3M。
+            </span>
+          </p>
+        </div>
+      </div>
+    </modal-wrapper>
+    <!-- 新增账户弹框end -->
+
+    <!-- 重新使用账户提示框start -->
+    <div class="mobile-modal reuse-account-modal" v-show="showReuseModal">
+      <div class="ra-remind">
+        <div class="header"><i class="iconfont icon-guanbi1" @click="showReuseModal = false"></i></div>
+        <div class="content"><i class="fa fa-exclamation-circle"></i>
+          <span>此操作会让使用中的收款账户失效,是否确定重新使用?</span>
+        </div>
+        <div class="footer">
+          <button @click="showReuseModal = false">取消</button>
+          <button @click="setDefaultAccount()">确认</button>
+        </div>
+      </div>
+    </div>
+    <!-- 重新使用账户提示框end -->
+
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+    <pull-up :fixId="'mobileFixContent'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>
+    <empty-status v-if="isEmpty" :text="switchType == 'record' ? '暂无交易记录' : '暂无账户信息'" :showLink="true"></empty-status>
+  </div>
+</template>
+<script>
+  import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
+  import { ModalWrapper } from '~components/mobile/base'
+  export default {
+    layout: 'mobile',
+    middleware: 'authenticated',
+    data () {
+      return {
+        remindText: '',
+        timeoutCount: '',
+        page: 1,
+        count: 10,
+        accountList: [],
+        recordList: [],
+        switchType: 'record',
+        // 分页重置标志
+        isChange: false,
+        showModal: false,
+        bankList: [],
+        showSimilar: false,
+        bankAccountObj: {
+          bankname: '',
+          branchname: '',
+          number: '',
+          accountname: ''
+        },
+        validBankAccountObj: {
+          bankname: false,
+          branchname: false,
+          number: false,
+          accountname: false
+        },
+        filterParams: {
+          keyword: '',
+          fromDate: '',
+          toDate: '',
+          method: '',
+          status: ''
+        },
+        showSelectMethod: false,
+        showSelectStatus: false,
+        currentId: '',
+        showReuseModal: false,
+        totalRecordPrice: 0,
+        file: ''
+      }
+    },
+    components: {
+      RemindBox,
+      PullUp,
+      ModalWrapper,
+      EmptyStatus
+    },
+    fetch ({store}) {
+      return Promise.all([
+        store.dispatch('payCenter/loadVendorRecord', {count: 10, page: 1, sorting: {'transferTime': 'DESC'}, type: 'sup'})
+      ])
+    },
+    watch: {
+      'vendorAccount': {
+        handler: function (val) {
+          if (val && val.content) {
+            if (this.isChange) {
+              this.accountList = []
+              this.isChange = false
+            }
+            this.accountList = [...this.accountList, ...val.content]
+          }
+        }
+      },
+      'vendorRecord': {
+        handler: function (val) {
+          if (val && val.content) {
+            if (this.isChange) {
+              this.recordList = []
+              this.isChange = false
+            }
+            this.totalRecordPrice = this.baseUtils.priceFixed(this.totalRecordPrice + this.recordData.data.data.total)
+            this.recordList = [...this.recordList, ...val.content]
+          }
+        },
+        immediate: true
+      }
+    },
+    filters: {
+      bankStatusFilter: function (status) {
+        let result = '未知状态'
+        switch (status) {
+          case 101 :
+            result = '待审核'
+            break
+          case 104:
+            result = '使用中'
+            break
+          case 103:
+            result = '未通过'
+            break
+          case 105:
+            result = '已失效'
+            break
+          case 112:
+            result = '已删除'
+            break
+        }
+        return result
+      }
+    },
+    computed: {
+      accountData () {
+        return this.$store.state.payCenter.data.vendorAccount
+      },
+      recordData () {
+        return this.$store.state.payCenter.data.vendorRecord
+      },
+      vendorAccount () {
+        return this.accountData.data
+      },
+      vendorRecord () {
+        return this.recordData.data.data.data
+      },
+      fetching () {
+        return this.switchType === 'account' ? this.accountData.fetching : this.recordData.fetching
+      },
+      allPage () {
+        return this.switchType === 'account' ? this.vendorAccount.totalPages : this.vendorRecord.totalPages
+      },
+      isEmpty () {
+        return (this.switchType === 'record' && this.recordList.length === 0) || (this.switchType === 'account' && this.accountList.length === 0)
+      },
+      currencySymbol () {
+        return this.recordList[0] ? this.recordList[0].currencyName : 'RMB'
+      }
+    },
+    methods: {
+      setRemindText: function (str) {
+        this.remindText = str
+        this.timeoutCount++
+      },
+      reloadList () {
+        if (this.switchType === 'account') {
+            this.$store.dispatch('payCenter/loadVendorAccount', {
+            count: this.count,
+            page: this.page,
+            sorting: {num: 'ASC'},
+            type: 'sup'
+          })
+        } else {
+          this.$store.dispatch('payCenter/loadVendorRecord', {
+            count: this.count,
+            page: this.page,
+            sorting: {'transferTime': 'DESC'},
+            type: 'sup',
+            fromDate: this.filterParams.fromDate || null,
+            toDate: this.filterParams.toDate || null,
+            keyword: this.filterParams.keyword || null
+          })
+        }
+      },
+      initList () {
+        this.isChange = true
+        this.page = 1
+        this.reloadList()
+      },
+      onPullUpAction () {
+        this.page++
+        this.reloadList()
+      },
+      setSwitchType (type) {
+        this.switchType = type
+        if (type === 'record') {
+          this.initFilterParams()
+        }
+        this.initList()
+      },
+      initFilterParams () {
+        this.filterParams = {
+          keyword: '',
+          fromDate: '',
+          toDate: '',
+          currencyName: '',
+          method: ''
+        }
+      },
+      filterRecord () {
+        this.isChange = true
+        this.reloadList()
+      },
+      setShowSelect (type, flag) {
+        if (type === 'all') {
+          this.showSelectMethod = flag
+          this.showSelectStatus = flag
+        } else if (type === 'method') {
+          this.showSelectMethod = flag
+          this.showSelectStatus = false
+        } else if (type === 'status') {
+          this.showSelectStatus = flag
+          this.showSelectMethod = false
+        }
+      },
+      setSelect (type, val) {
+        if (type === 'method') {
+          this.filterParams.method = val
+          this.setShowSelect('method', false)
+        } else if (type === 'status') {
+          this.filterParams.status = val
+          this.setShowSelect('status', false)
+        }
+        this.filterRecord()
+      },
+      setDate (type) {
+        this.filterParams[type] = new Date(this.filterParams[type]).getTime()
+        if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate > this.filterParams.toDate) {
+          this.setRemindText('起始时间不能大于结束时间')
+          this.filterParams[type] = null
+        } else {
+          this.filterRecord()
+        }
+      },
+      reuseAccount (account) {
+        this.currentId = account.id
+        this.showReuseModal = true
+      },
+      setDefaultAccount () {
+        this.$http.get(`/trade/bankInfo/setDefaultAccount/${this.currentId}`).then(() => {
+          this.setRemindText('重新使用完成')
+          this.initList()
+          this.showReuseModal = false
+        })
+      },
+      deleteAccount (account) {
+        this.$http.delete(`/trade/bankInfo/delete/${account.id}`).then(res => {
+          if (res.data === 'success') {
+            this.setRemindText('删除成功')
+            this.initList()
+          }
+        })
+      },
+      initAccount () {
+        this.bankAccountObj = {
+          bankname: '',
+          branchname: '',
+          number: '',
+          accountname: ''
+        }
+        this.validBankAccountObj = {
+          bankname: false,
+          branchname: false,
+          number: false,
+          accountname: false
+        }
+      },
+      openAddAccount () {
+        if (!this.bankList || !this.bankList.length) {
+          this.$http.get('/data/bank.json').then(res => {
+            this.bankList = res.data.list
+            this.initAccount()
+            this.showModal = true
+          })
+        } else {
+          this.initAccount()
+          this.showModal = true
+        }
+      },
+      setBankName (name) {
+        this.bankAccountObj.bankname = name
+        this.showSimilar = false
+        this.validBankAccountObj.bankname = true
+      },
+      checkBranchname () {
+        this.validBankAccountObj.branchname = true
+        if (!(this.bankAccountObj.branchname && this.bankAccountObj.branchname.length)) {
+          this.setRemindText('开户支行不能为空')
+          this.validBankAccountObj.branchname = false
+        } else if (this.baseUtils.getRealLen(this.bankAccountObj.branchname) > 40) {
+          this.setRemindText('开户支行不能大于40字符')
+          this.validBankAccountObj.branchname = false
+        } else if (!/^[\u2E80-\u9FFF]+$/.test(this.bankAccountObj.branchname)) {
+          this.setRemindText('请输入正确的开户支行')
+          this.validBankAccountObj.branchname = false
+        }
+      },
+      checkNumber () {
+        this.validBankAccountObj.number = true
+        if (!(this.bankAccountObj.number && this.bankAccountObj.number.length)) {
+          this.validBankAccountObj.number = false
+          this.setRemindText('银行账号不能为空')
+        } else if (this.baseUtils.getRealLen(this.bankAccountObj.number) > 30) {
+          this.setRemindText('银行账号不能大于30字符')
+          this.validBankAccountObj.number = false
+        } else if (!/^[0-9]+$/.test(this.bankAccountObj.number)) {
+          this.setRemindText('请输入正确的银行账号')
+          this.validBankAccountObj.number = false
+        }
+        if (this.validBankAccountObj.number) {
+          this.$http.get('/trade/bankInfo/number/count', {params: {type: 1061, number: this.bankAccountObj.number}}).then(res => {
+            if (res.data.success) {
+              if (res.data.data === 0) {
+                this.validBankAccountObj.number = true
+              } else {
+                this.validBankAccountObj.number = false
+                this.setRemindText('银行账号校验失败')
+              }
+            } else {
+              this.validBankAccountObj.number = false
+              this.setRemindText(res.data.message || '银行账号校验失败')
+            }
+          }, err => {
+            this.validBankAccountObj.number = false
+            this.setRemindText(err.response.data || '银行账号校验失败')
+            console.log(err)
+          })
+        }
+      },
+      checkAccountname () {
+        this.validBankAccountObj.accountname = true
+        if (!(this.bankAccountObj.accountname && this.bankAccountObj.accountname.length)) {
+          this.validBankAccountObj.accountname = false
+          this.setRemindText('账户名称不能为空')
+        } else if (this.baseUtils.getRealLen(this.bankAccountObj.accountname) > 100) {
+          this.setRemindText('账户名称不能大于100个字符')
+          this.validBankAccountObj.accountname = false
+        }
+      },
+      addAccount () {
+        if (!this.validBankAccountObj.bankname) {
+          this.setRemindText('请选择开户银行')
+        } else if (!this.validBankAccountObj.branchname) {
+          this.setRemindText('请填写正确的开户支行')
+        } else if (!this.validBankAccountObj.number) {
+          this.setRemindText('请填写正确的银行账号')
+        } else if (!this.validBankAccountObj.accountname) {
+          this.setRemindText('请填写正确的开户名称')
+        } else if (!this.file) {
+          this.setRemindText('请上传开户许可证')
+        } else {
+          let param = new FormData()
+          param.append('file', this.file, this.file.name)
+          param.append('bankInfo', JSON.stringify(this.bankAccountObj))
+          let config = {
+            headers: {'Content-Type': 'multipart/form-data'}
+          }
+          this.$http.post('/trade/bankInfo/save/enterprise?type=sup', param, config).then(res => {
+            if (res.data.id) {
+              this.setRemindText('新增账户成功')
+              this.initList()
+              this.showModal = false
+            } else {
+              this.setRemindText('新增账户失败')
+            }
+          }, err => {
+            this.setRemindText(err.response.data || '新增账户失败')
+            console.log(err)
+          })
+        }
+      },
+      onUpload (e) {
+        let file = e.target.files[0]
+        let arr = file.name.split('.')
+        let type = arr[arr.length - 1]
+        if ('pdf/png/jpg'.indexOf(type) === -1) {
+          this.setRemindText('仅支持jpg/png/pdf格式的文件')
+        } else if (file.size > 1024 * 1024 * 3) {
+          this.setRemindText('请勿大于3M')
+        } else {
+          this.file = file
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss">
+  @import '~assets/scss/mobilePayCenter';
+  .reuse-account-modal {
+    .ra-remind {
+      width: 6.3rem;
+      height: 3.5rem;
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      margin-top: -1.75rem;
+      margin-left: -3.15rem;
+      border-radius: .15rem;
+      .header {
+        height: .6rem;
+        line-height: .6rem;
+        background: #3976f4;
+        border-top-left-radius: .15rem;
+        border-top-right-radius: .15rem;
+        i {
+          font-size: .32rem;
+          color: #fff;
+          float: right;
+          margin-right: .28rem;
+        }
+      }
+      .content {
+        background: #fff;
+        padding: .53rem .77rem;
+        span {
+          font-size: .32rem;
+        }
+        i {
+          font-size: .44rem;
+          color: #3976f4;
+          float: left;
+          margin-right: .2rem;
+        }
+      }
+      .footer {
+        background: #fff;
+        padding-bottom: .37rem;
+        text-align: center;
+        border-bottom-left-radius: .15rem;
+        border-bottom-right-radius: .15rem;
+        margin-top: -0.05rem;
+        button {
+          width: 2.22rem;
+          height: .77rem;
+          line-height: .77rem;
+          color: #fff;
+          font-size: .32rem;
+          border-radius: .08rem;
+          background: #bfbfbf;
+          &:last-child {
+            background: $base-color;
+            margin-left: .3rem;
+          }
+        }
+      }
+    }
+  }
+  .record-list {
+    margin-bottom: 1.26rem
+  }
+  .upload {
+    input[disabled] {
+      background: #eee;
+      width: 2.88rem !important;
+    }
+    .upload-btn {
+      display: inline-block;
+      vertical-align: middle;
+      width: 1.2rem;
+      height: .56rem;
+      line-height: .56rem;
+      text-align: center;
+      color: #fff;
+      background: #fe9d03;
+      position: relative;
+      left: .2rem;
+      border-radius: .04rem;
+      font-size: .24rem;
+      font-weight: normal;
+      margin: 0;
+      input {
+        opacity: 0;
+        width: 1.2rem;
+        height: .56rem;
+        position: absolute;
+        top: 0;
+      }
+    }
+  }
+  .fix-count-wrap {
+    position: fixed;
+    bottom: .98rem;
+    height: 1.25rem;
+    text-align: right;
+    background: #fff;
+    border-radius: .02rem;
+    border-top: 1px solid #bfbfbf;
+    line-height: .63rem;
+    font-size: .28rem;
+    width: 100%;
+    padding-right: .3rem;
+    .content {
+      margin-left: .39rem;
+      &:first-child {
+        span {
+          color: #fd0303;
+        }
+      }
+      &:nth-of-type(2) {
+        span {
+          color: #15b262;
+        }
+      }
+    }
+  }
+  .mp-list .content-line .icon-tixing {
+    font-size: .32rem;
+    color: $base-color;
+    margin-left: .05rem;
+  }
+  .am-remind-text {
+    font-size: .26rem;
+    color: #999;
+    margin-top: .29rem;
+    padding: .45rem 0;
+    border-top: 1px solid #d2d2d2;
+    i {
+      color: #fd0303;
+      width: 12%;
+    }
+    .fr {
+      width: 88%;
+    }
+  }
+  .mobile-pay-center .mobile-modal .mobile-modal-wrapper {
+    left: .2rem !important;
+    right: .2rem !important;
+  }
+</style>

+ 51 - 24
pages/mobile/center/vendor/product.vue

@@ -21,10 +21,10 @@
             <div class="text">
               {{item.pcmpcode}}
             </div>
-            <img v-if="item.addProductPerson" class="person-flag" src="/images/mobile/product/personalMaterial.png" alt="">
+            <img v-if="item.addProductPerson" class="person-flag" src="/images/mobile/product/mine_icon.png" alt="">
           </div>
           <div class="content">
-            <div class="fl">
+            <div class="fl" :class="providerType === 'enterprise' ? 'fullWidth': ''">
               <div class="linetext">品牌:{{item.pbranden}}</div>
               <div class="linetext">物料名称(类目):
                 <template v-if="!item.kind">
@@ -37,12 +37,18 @@
               <div class="linetext">规格:{{item.spec}}</div>
               <div class="linetext">单位:PCS</div>
             </div>
-            <div class="fr" :class="providerType == 'enterprise' && item.batchCount > 0 ? '' : 'addtop'" >
-              <div class="look" v-if="item.batchCount && providerType == 'enterprise'" @click="lookProductitem(item.id, item)" >查看产品</div>
-              <div class="add" v-if="providerType == 'enterprise'" @click="addProtoperson(item)" :class="{noadd: item.addProductPerson}">加入个人产品</div>
+            <div class="fr" v-if="providerType !== 'enterprise'"  :class="providerType == 'enterprise' && item.batchCount > 0 ? '' : 'addtop'" >
+              <!--<div class="look"  >查看产品</div>-->
+              <!--<div class="add" >加入个人产品</div>-->
               <div class="delete" v-if="providerType == 'person'" @click="deleteProvider(item.id, index)">删除</div>
             </div>
           </div>
+          <!--v-if="item.batchCount && providerType == 'enterprise'"-->
+          <!--v-if="providerType == 'enterprise'"-->
+          <div class="clearfix" v-if="providerType === 'enterprise'">
+            <div class="pull-right add" v-if="providerType === 'enterprise'" @click="addProtoperson(item)" :class="{noadd: item.addProductPerson}">加入个人产品</div>
+            <div class="pull-right look" @click="lookProductitem(item.id, item)">查看产品</div>
+          </div>
         </div>
         <div v-else>
           <div class="top top2">
@@ -451,11 +457,13 @@
       // 查看企业产品库更多信息
       lookProductitem: function(id, item) {
         this.chooseItem = item
-        this.$http.get(`/trade/products/goods/productid/${id}`).then(res => {
-          this._initscroll()
-          this.showMoreinfn = true
-          this.vendorlist = res.data
-        })
+        this.$store.commit('product/component/REQUEST_NOWPRODUCTINFO_SUCCESS', item)
+        this.$router.push(`/mobile/center/vendor/productList?uuid=${id}`)
+        // this.$http.get(`/trade/products/goods/productid/${id}`).then(res => {
+        //   this._initscroll()
+        //   this.showMoreinfn = true
+        //   this.vendorlist = res.data
+        // })
       },
       closeMoreinfo: function() {
         this.showMoreinfn = false
@@ -978,6 +986,11 @@
         float: left;
         border-right: 1px dashed #e0e0e4;
         width: 4.68rem;
+        &.fullWidth {
+          width: 100%;
+          border: 0;
+          float: left
+        }
       }
       .fr {
         float: right;
@@ -1002,25 +1015,12 @@
           text-align: center;
           line-height: 0.6rem;
           border-radius: 3px;
-          &.look{
-            background: #0067e7;
-            color: #fff;
-          }
-          &.add{
-            background: #fff;
-            color: #0067e7;
-            border: 1px solid #0067e7;
-          }
           &.delete{
             background: #fff;
             color: #f70415;
             border: 1px solid #f70415;
           }
-          &.noadd{
-            background: #cccbcb;
-            color: #fff;
-            border:1px solid #cccbcb;
-          }
+
         }
         div:nth-child(1){
           margin-bottom: 0.26rem
@@ -1034,6 +1034,33 @@
         zoom: 1;
       }
     }
+    div.clearfix {
+      padding: 0.2rem 0;
+      margin: 0 0.2rem;
+      border-top: 1px solid #d3d3d3;
+      div {
+        width: 2.1rem;
+        height: 0.6rem;
+        text-align: center;
+        line-height: 0.6rem;
+        border-radius: 3px;
+        margin-right: 0.2rem;
+        &.look {
+          color: #008bf7;
+          border: 1px solid #008bf7;
+        }
+        &.add {
+          background: #fff;
+          color: #f57710;
+          border: 1px solid #f57710;
+        }
+        &.noadd{
+          background: #cccbcb;
+          color: #fff;
+          border:1px solid #cccbcb;
+        }
+      }
+    }
   }
   .middle {
     padding: 0.24rem 0.24rem 0px;

+ 617 - 0
pages/mobile/center/vendor/productList/index.vue

@@ -0,0 +1,617 @@
+<template>
+  <div class="product-list-wrapper">
+    <div class="Kuang">
+      <div class="overflow-hidden fixedOver">
+        <div class="content">
+          <div class="infob">
+            <div class="info"><div class="name">品牌:</div><div>{{cnmpBand}}</div></div>
+            <div class="info"><div class="name">物料名称(类目):</div><div>{{cnmpType || '-'}}</div></div>
+            <div class="info"><div class="name">型号:</div><div>{{cnmpCode}}</div></div>
+            <div class="info"><div class="name">规格:</div><div>{{cnmpSpec}}</div></div>
+            <div class="info"><div class="name">单位:</div><div>{{cnmpUnit}}</div></div>
+            <img v-if="ItemInfo.addProductPerson" class="person-flag" src="/images/mobile/product/personalMaterial.png" alt="">
+          </div>
+          <div ref="mobileModalBox" class="scrollWrapper">
+            <div>
+              <div class="content_sq" v-bind:key="item.id" v-if="vendorlist.length > 0" v-for="(item, index) in vendorlist" >
+                <div class="labelBg">
+                  <img class="store-type" v-if="item.storeid === '33069557578d44e69bd91ad12d28a8d4'" src="/images/mobile/product/consignment.png" alt="">
+                  <img class="store-type" src="/images/mobile/product/self.png" alt="" v-else >
+                  <div class="clearfix">
+                    <div class="pull-left labelinfo" style="margin-left: -0.1rem">
+                      <div class="labelicon" style="vertical-align:top;margin-top: 0.09rem">标签</div>
+                      <div class="labeltext">{{item.tag}}</div>
+                    </div>
+                    <div class="pull-right pullbtn">
+                      <span class="update" @click="update(item)">编辑</span>
+                      <span class="offbtn" @click="offFn(item)" v-if="item.status != 601 && item.status != 602">上架</span>
+                      <span class="offbtn" @click="deleteItem(item, index)">删除</span>
+                    </div>
+                  </div>
+                  <div class="middle">
+                    <div class="list clearfix" style="height: auto">
+                      <!--<div class="fl">-->
+                        <!--<div class="name">-->
+                          <!--<div class="pms">-->
+                            <!--{{item.storeid === '33069557578d44e69bd91ad12d28a8d4' ? '寄售' : '自营'}}-->
+                          <!--</div>-->
+                        <!--</div>-->
+                        <!--<span @click="update(item)">编辑</span>-->
+                      <!--</div>-->
+                      <div class="fl clearfix">
+                        <div class="textinfo pull-left" v-if="item.status != 601 && item.status != 602" style="background: #ffcccc;color: #db0303;margin-right:0.2rem;">未上架</div>
+                        <div class="textinfo pull-left" v-else style="background: #cff6e0;color: #037c03;margin-right:0.2rem;">已上架</div>
+                        <div class="textinfo pull-left" v-if="item.breakUp" style="">可拆卖</div>
+                      </div>
+                    </div>
+                    <div class="list clearfix" style="height: auto">
+                      <div class="fl">
+                        <div class="name">最小包装数:</div>
+                        <div class="text">{{item.minPackQty}}</div>
+                      </div>
+                      <div class="fr">
+                        <div class="name">交期(天):</div>
+                        <div class="text" v-if="item.b2cMaxDelivery && (item.b2cMaxDelivery != item.b2cMinDelivery)" v-text="item.b2cMinDelivery + '-'+ item.b2cMaxDelivery"></div>
+                        <div class="text" v-if="item.b2cMaxDelivery && (item.b2cMaxDelivery == item.b2cMinDelivery)" v-text="item.b2cMinDelivery"></div>
+                      </div>
+                    </div>
+
+                    <div class="list clearfix" style="height: auto">
+                      <div class="fl">
+                        <div class="name">包装方式:</div>
+                        <div class="text">{{item.packaging || '无包装信息'}}</div>
+                      </div>
+                      <div class="fr">
+                        <div class="name">库存:</div>
+                        <div class="text">{{item.reserve}}</div>
+                      </div>
+                    </div>
+
+                    <div class="list clearfix" style="height: auto">
+                      <div class="fl">
+                        <div class="name">生产日期:</div>
+                        <div class="text" :title="item.produceDate">{{item.produceDate || '-'}}</div>
+                      </div>
+                      <div class="fr">
+                        <div class="name">最小起订量:</div>
+                        <div class="text" style="color: #f31919">{{item.minBuyQty}}</div>
+                      </div>
+                    </div>
+
+                    <div class="list clearfix" style="height: auto">
+                      <div class="name left">价格梯度:</div>
+                      <div class="table left">
+                        <ul>
+                          <li class="title">
+                            <div>分段数量/PCS</div>
+                            <div>分段单价</div>
+                          </li>
+                          <li v-for="price in item.prices">
+                            <div>{{price.start}}+</div>
+                            <div v-if="item.currencyName == 'RMB'">¥{{price.rMBPrice}}</div>
+                            <div v-else>${{price.rMBPrice}}</div>
+                          </li>
+                        </ul>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+              <div v-if="vendorlist.length === 0"  class="com-none-state">
+            <img src="/images/mobile/@2x/empty-collect.png">
+            <p>抱歉,暂无产品信息</p>
+            <nuxt-link to="/">返回首页</nuxt-link>
+          </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="deleteKuang" v-if="showLogout">
+        <div class="kuangContent">
+          <div class="title">系统提示</div>
+          <div class="titleinfo">是否删除此信息</div>
+          <div class="info" v-if="isUploadpro">*存在已上架信息</div>
+          <div class="K_btn">
+            <div class="cancelBtn" @click="showLogout = false">取消</div>
+            <div class="answerBtn" @click="ReadyDelete()">确定</div>
+          </div>
+        </div>
+      </div>
+      <div class="addPro" @click="toAddpro()">
+        <img src="/images/mobile/@2x/addPro_icon.png"/>
+      </div>
+      <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
+    </div>
+  </div>
+</template>
+
+<script type="text/javascript">
+  import { RemindBox } from '~components/mobile/common'
+  import axios from '~plugins/axios'
+  export default {
+    name: 'productList',
+    layout: 'mobile',
+    middleware: 'authenticated',
+    methods: {
+      closeMoreinfo() {},
+      update(item) {
+        this.$store.commit('product/brand/GET_ONSALE_DETAILS_SUCCESS', item)
+        this.$router.push('/mobile/center/vendor/productdetails')
+      },
+      offFn(item) {
+        this.$http.put(`/trade/goods/putOn/${item.id}`).then(res => {
+          if (res.data.success) {
+            this.collectResult = '上架成功'
+            this.timeoutCount++
+            item.status = 601
+          }
+        })
+      },
+      toAddpro() {
+        console.log(this.vendorlist)
+        let item = {
+          brandNameEn: this.cnmpBand,
+          kindNameCn: this.cnmpType,
+          code: this.cnmpCode,
+          spec: this.cnmpSpec,
+          prices: [{
+            end: '',
+            rMBNTPrice: '',
+            rMBPrice: '',
+            start: '1'
+          }],
+          minBuyQty: 1,
+          productid: this.$route.query.uuid,
+          prodNum: this.ItemInfo.prodNum,
+          currencyName: this.$store.state.option.storeStatus.data.enType === 'MAINLAND' ? 'RMB' : 'USD',
+          breakUp: false
+        }
+        this.$store.commit('product/brand/GET_ONSALE_DETAILS_SUCCESS', item)
+        this.$router.push(`/mobile/center/vendor/productdetails?formurl=productlist`)
+      },
+      deleteItem(item, index) {
+        this.deleteItemId = item.id
+        this.deleteItemIndex = index
+        this.$http.get(`/trade/goods/isRecommend/${item.id}`).then(res => {
+          this.showLogout = true
+          if (res.data.code === 1) {
+            if (item.status === 601 || item.status === 602) {
+              this.isUploadpro = true
+            }
+          }
+        })
+      },
+      ReadyDelete() {
+        let params = {
+          isPerson: 1
+        }
+        this.$http.delete(`/trade/goods/delete/${this.deleteItemId}`, params).then(res => {
+          this.collectResult = '删除成功'
+          this.timeoutCount++
+          this.vendorlist.splice(this.deleteItemIndex, 1)
+          this.showLogout = false
+          this.isUploadpro = false
+        })
+      }
+    },
+    async asyncData({route}) {
+     let { data } = await axios.get(`/trade/products/goods/productid/${route.query.uuid}`)
+      return {
+        vendorlist: data
+      }
+    },
+    mounted() {
+      this._initscroll()
+    },
+    data() {
+      return {
+        vendorlist: {},
+        showLogout: false,
+        isUploadpro: false,
+        collectResult: '',
+        timeoutCount: 0
+      }
+    },
+    components: {
+      RemindBox
+    },
+    computed: {
+      ItemInfo() {
+        return this.$store.state.product.component.nowProductInfo.data
+      },
+      cnmpCode() { // 型号
+        return this.ItemInfo.pcmpcode || '-'
+      },
+      cnmpType() { // 类目
+        return this.ItemInfo.kind || this.ItemInfo.kinden || '-'
+      },
+      cnmpBand() { // 品牌
+        return this.ItemInfo.pbranden || '-'
+      },
+      cnmpSpec () {
+        return this.ItemInfo.spec
+      },
+      cnmpUnit() {
+        return this.ItemInfo.unit || 'PCS'
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  @mixin overFlowHidden {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  @mixin lineHeight($value) {
+    height: $value;
+    line-height: $value;
+  }
+  @mixin Fixed() {
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    top: 0
+  }
+  .product-list-wrapper {
+    .fixedOver {
+      position: absolute;
+      top: 1.26rem;
+      bottom: 0.98rem;
+      overflow: hidden;
+      background: #f1f3f6;
+      padding: 0 0.2rem;
+      width: 100%;
+    }
+    i {
+      font-size: .6rem;
+      position: absolute;
+      right: -0.3rem;
+      top: -0.35rem;
+      color: #fff;
+      &::after {
+        position: absolute;
+        top: -0.1rem;
+        left: -0.1rem;
+        right: -0.1rem;
+        bottom: -0.1rem;
+        content: ' '
+      }
+    }
+    .title {
+      background: #3f84f6;
+      height: 0.7rem;
+      line-height: 0.7rem;
+      color: #fff;
+      text-align: center;
+      font-size: 0.3rem;
+      position: relative;
+    }
+    .content {
+      .infob {
+        background: #fff;
+        padding: 0.2rem;
+        margin: 0.18rem 0;
+        .info {
+          color: #333;
+          font-size: 0.3rem;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+          margin-bottom: 0.18rem;
+          .name {
+            color: #666;
+          }
+          div {
+            display: inline-block;
+          }
+        }
+      }
+      .content_sq {
+        background: #fff;
+        padding: 0.2rem 0;
+        position: relative;
+        margin-bottom: 0.2rem;
+        .list {
+          margin-bottom: 0.18rem;
+        }
+        .fl {
+          width: 3.2rem;
+        }
+        .table {
+          width: 4.2rem;
+          margin-top: -0.1rem;
+        }
+        .labelinfo {
+          background-image: url('/images/mobile/@2x/labelTop2.png');
+          background-repeat: no-repeat;
+          width: 3.25rem;
+          height: 0.64rem;
+          line-height: 0.64rem;
+          background-size: 100%;
+          margin-top: 0rem;
+          margin-right: 0rem;
+          background-color: rgba(0, 0, 0, 0);
+          color: #666;
+        }
+        .pullbtn {
+          margin-right: 0.4rem;
+          span {
+            display: inline-block;
+            width: 0.92rem;
+            @include lineHeight(0.43rem);
+            background: #008bf7;
+            color: #fff;
+            font-size: 0.26rem;
+            border-radius: 3px;
+            text-align: center;
+            margin-top: 0.1rem;
+            margin-right: 0.15rem;
+          }
+        }
+      }
+    }
+    .labelinfo {
+      padding: 0 .24rem;
+      background: #e6e6e6;
+      height: 0.6rem;
+      line-height: 0.6rem;
+      width: 100%;
+      color: #666;
+      font-size: 0.26rem;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      .labelicon {
+        background-image: url('/images/mobile/@2x/label_icon.png');
+        background-repeat: no-repeat;
+        width: 0.61rem;
+        height: 0.38rem;
+        line-height: 0.38rem;
+        background-size: 100%;
+        color: #fff;
+        margin-right: 0.1rem;
+        display: inline-block;
+        font-size: 0.22rem;
+        text-align: center;
+        /*vertical-align: middle;*/
+      }
+      .labeltext{
+        display: inline-block;
+        /*vertical-align: middle;*/
+      }
+    }
+    .label-text {
+      padding: .09rem .21rem;
+      border-radius: .22rem;
+      background: #ddd;
+      font-size: .26rem;
+      color: #666;
+      display: inline-block;
+      margin-left: .22rem;
+      margin-bottom: .25rem;
+    }
+    .middle {
+      padding: 0.24rem 0.24rem 0px;
+      background: #fff;
+      .pms {
+        color: #f57710;
+        border: 1px solid #f57710;
+        border-radius: 0.4rem;
+        background: #fff;
+        font-size: 0.24rem;
+        height: 0.4rem;
+        line-height: 0.4rem;
+        width: 0.8rem;
+        text-align: center;
+      }
+      .list {
+        /*height: 0.46rem;*/
+        .left {
+          float: left;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+        }
+        .textinfo {
+          color: #0067e7;
+          font-size: 0.28rem;
+          width: 0.98rem;
+          background: #d7e4fd;
+          border-radius: 3px;
+          @include lineHeight(0.42rem);
+          text-align: center;
+        }
+        .button {
+          font-size: 0.26rem;
+          color: #fff;
+          width: 0.92rem;
+          text-align: center;
+          border-radius: 5px;
+          /*border:1px solid #1a58dd;*/
+          background: #1a58dd;
+          display: inline-block;
+          margin-right: 0.2rem;
+          line-height: 0.33rem;
+          height: 0.37rem;
+        }
+        margin-bottom: 0.18rem;
+        &::after{
+          clear: both;
+          display: block;
+          content: ' ';
+          visibility: hidden;
+          zoom: 1;
+        }
+        .fl {
+          width: 4rem;
+          float: left;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+        }
+        .fr {
+          text-align: left;
+          width: 2.6rem;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+        }
+        &.list-long {
+          .fl {
+            width: 100% !important;
+          }
+        }
+        .name {
+          color: #666;
+          font-size: 0.3rem;
+          display: inline-block;
+        }
+        .text {
+          display: inline-block;
+          color: #333;
+          font-size: 0.3rem
+        }
+        .table {
+          width: 5rem;
+          margin-bottom: 0;
+          margin-top: 0;
+          li {
+            height: 0.43rem;
+            line-height: 0.43rem;
+            border-left: .01rem solid #c5c5c5;
+            font-size: .28rem;
+            &::after {
+              clear: both;
+              display: block;
+              content: ' ';
+              visibility: hidden;
+              zoom: 1;
+            }
+            div {
+              text-align: center;
+              width: 50%;
+              float: left;
+              border-right: .01rem solid #c5c5c5;
+              border-bottom: .01rem solid #c5c5c5;
+            }
+            &:nth-child(odd) {
+              background: #ddd;
+              color: #666;
+              font-size: 0.28rem;
+            }
+            &:nth-child(even) {
+              background: #fcfcfc;
+              color: #666;
+              font-size: 0.28rem;
+            }
+            &:nth-last-of-type(1){
+              color: #f31919;
+            }
+            &.title {
+              font-size: 0.28rem;
+              color: #333;
+            }
+          }
+        }
+      }
+    }
+    .person-flag {
+      width: .75rem;
+      position: absolute;
+      right: 0;
+      top: 0.4rem;
+    }
+    .store-type {
+      width: .77rem;
+      height: .77rem;
+      position: absolute;
+      right: 0;
+      top: 0;
+    }
+    .scrollWrapper {
+      position: fixed;
+      top: 4.69rem;
+      bottom: 0.96rem;
+      overflow-y: hidden;
+      right: 0.2rem;
+      left: 0.2rem;
+    }
+    .deleteKuang {
+      position: fixed;
+      background: rgba(0,0,0,0.5);
+      top: 0;
+      left: 0;
+      right: 0;
+      bottom: 0;
+      z-index: 9999;
+      .kuangContent {
+        border-radius: 5px;
+        background: #fff;
+        width: 5rem;
+        position: absolute;
+        left: 50%;
+        top: 50%;
+        transform: translate3d(-50%, -50%, 0);
+        overflow: hidden;
+        .titleinfo {
+          font-size: .3rem;
+          color: #666;
+          text-align: center;
+          margin-top: 0.5rem;
+          margin-bottom: 0.1rem;
+        }
+        .title {
+          background: #5078cb;
+          height: .7rem;
+          line-height: .7rem;
+          font-size: .3rem;
+          color: #fff;
+          text-align: center;
+        }
+        .info {
+          color: #f00;
+          text-align: center;
+        }
+        .K_btn {
+          margin-top: 0.4rem;
+          line-height: 0.7rem;
+          height: 0.7rem;
+          &::after{
+            clear: both;
+            display: block;
+            content: ' ';
+            visibility: hidden;
+            zoom: 1;
+          }
+          div {
+            float: left;
+            width: 50%;
+            font-size: 0.3rem;
+            text-align: center;
+            &.cancelBtn {
+              background: #b4b5b9;
+              color: #333;
+            }
+            &.answerBtn {
+              background: #5078cb;
+              color: #fff;
+            }
+          }
+        }
+      }
+    }
+    .addPro {
+      position: fixed;
+      bottom: 1.2rem;
+      right: 0.4rem;
+      z-index: 11;
+      img {
+        width: 1.12rem;
+        height: 1.12rem;
+      }
+    }
+  }
+</style>

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

@@ -27,7 +27,7 @@
           </div>
         </div>
       </div>
-      <div class="list clearfix">
+      <div class="over list clearfix">
         <div class="pull-left">
           <span class="name">规格:</span>
           <span>{{chooseItem.spec}}</span>
@@ -60,11 +60,11 @@
       <div class="list clearfix">
         <div class="pull-left">
           <span class="name">最小包装数:</span>
-          <input type="tel" placeholder="请输入最小包装数" v-model="chooseItem.minPackQty" class="input minPackQtyInput" maxlength="6" @blur="minBuyQtyBlur()"/>
+          <input type="tel" placeholder="请输入最小包装数" v-model.lazy="chooseItem.minPackQty" class="input minPackQtyInput" maxlength="6" @blur="minBuyQtyBlur()"/>
         </div>
         <div class="pull-right">
           <span class="name">最小起订量:</span>
-          <input type="tel" placeholder="请输入最小起订量" v-model="chooseItem.minBuyQty" class="input minBuyQtyInput" maxlength="6" @blur="minBuyQtyBlur()" />
+          <input type="tel" placeholder="请输入最小起订量"  v-model.lazy="chooseItem.minBuyQty" class="input minBuyQtyInput" maxlength="6" @blur="minBuyQtyBlur()" />
         </div>
       </div>
       <div class="list clearfix">
@@ -101,7 +101,20 @@
         <li v-for="(item, index) in chooseItem.prices" v-bind:key="index">
           <div class="clearfix">
             <div class="pull-left">
-              <input oninput="if(value.length>5)value=value.slice(0,9)" type="number" placeholder="数量" class="otherNumber" :class="{firstNumber: index === 0}" v-model.lazy.trim="item.start" :disabled="index === 0" :readonly="index === 0" @blur="startpriceBlur(item, index)" maxlength="9"/>
+              <input v-if="index > 0" oninput="if(value.length>5)value=value.slice(0,9)"
+                     type="number" placeholder="数量" class="otherNumber"
+                     :class="{firstNumber: index === 0}"
+                     v-model.lazy.trim="item.start"
+                     :disabled="index === 0" :readonly="index === 0"
+                     @blur="startpriceBlur(item, index)" maxlength="9"
+              />
+              <input v-else oninput="if(value.length>5)value=value.slice(0,9)"
+                     type="number" placeholder="数量" class="otherNumber"
+                     :class="{firstNumber: index === 0}"
+                     v-model.lazy.trim="chooseItem.minBuyQty"
+                     :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 oninput="if(value.length>5)value=value.slice(0,9)" type="number" placeholder="数量" class="otherNumber" v-model.lazy.trim="item.end" v-if="index !== chooseItem.prices.length - 1" @blur="endpriceBlur(item, index)" maxlength="9"/>
@@ -200,17 +213,20 @@
           this.chooseItem.tag = ''
         }
       },
+      changeBuyQtyBlur() {
+        this.chooseItem.prices[0].start = this.chooseItem.minBuyQty
+      },
       // 最低起订量失去焦点操作
       minBuyQtyBlur() {
-        if (this.chooseItem.minPackQty <= 0) {
+        if (Math.abs(this.chooseItem.minPackQty) <= 0) {
           this.timeoutCount++
           this.collectResult = '包装数必须是大于0的整数'
           this.chooseItem.minPackQty = 1
-        } else if (this.chooseItem.minBuyQty <= 0) {
+        } else if (Math.abs(this.chooseItem.minBuyQty) <= 0) {
           this.timeoutCount++
           this.collectResult = '起订量必须是大于0的整数'
           this.chooseItem.minBuyQty = 1
-        } else if (!this.chooseItem.breakUp && this.chooseItem.minBuyQty % this.chooseItem.minPackQty !== 0) {
+        } else if ((!this.chooseItem.breakUp && this.chooseItem.minBuyQty) && this.chooseItem.minBuyQty % this.chooseItem.minPackQty !== 0) {
           this.timeoutCount++
           this.collectResult = '不可拆卖时,起订量必须是包装数量的倍数'
           if (this.chooseItem.minPackQty > this.chooseItem.minBuyQty) {
@@ -256,6 +272,7 @@
             this.chooseItem.prices.splice(2, 1)
           } else {
             index++
+            if (this.chooseItem.prices.length === 1) return
             this.chooseItem.prices[0].rMBPrice = this.chooseItem.prices[1].rMBPrice
             this.chooseItem.prices[0].end = '9999999999'
             this.chooseItem.prices.splice(index, 1)
@@ -302,11 +319,8 @@
       },
       // 结束价格阶段失去焦点
       endpriceBlur(item, index) {
-        console.log(index === 1)
-        console.log(Math.abs(item.end) + 1 <= Math.abs(item.start))
         if (item.end === '') {
           return false
-        } else if (index === 1 && Math.abs(item.end) + 1 >= Math.abs(item.start)) {
         } else if (Math.abs(item.end) + 1 <= Math.abs(item.start)) {
           this.timeoutCount++
           this.collectResult = `输入值不能小于${item.start}`
@@ -328,7 +342,7 @@
       },
       // 交期失去焦点
       minDeliveryBlur() {
-        if (this.chooseItem.minDelivery > this.chooseItem.maxDelivery) {
+        if (Math.abs(this.chooseItem.minDelivery) > Math.abs(this.chooseItem.maxDelivery)) {
           this.timeoutCount++
           this.collectResult = `最短交期应小于等于最长交期`
           this.chooseItem.maxDelivery = ''
@@ -459,6 +473,42 @@
           }
         }
         this.chooseItem.prices[this.chooseItem.prices.length - 1].end = '9999999999'
+        if (this.$route.query.formurl === 'productlist') {
+          let is = {
+            currencyName: 'RMB',
+            maxDelivery: this.chooseItem.maxDelivery,
+            minBuyQty: this.chooseItem.minBuyQty,
+            minDelivery: this.chooseItem.minDelivery,
+            minPackQty: this.chooseItem.minPackQty,
+            packaging: this.chooseItem.packaging,
+            prices: this.chooseItem.prices,
+            produceDate: this.chooseItem.produceDate,
+            reserve: this.chooseItem.reserve,
+            selfSale: this.chooseItem.selfSale,
+            spec: this.chooseItem.spec,
+            storeInfoOms: this.chooseItem.storeInfoOms,
+            prodNum: this.chooseItem.prodNum,
+            productid: this.chooseItem.productid,
+            tag: this.chooseItem.tag,
+            breakUp: this.chooseItem.breakUp
+          }
+          this.$http.post('/trade/goods/addGoods', is).then(res => {
+            if (res.data.success) {
+              this.timeoutCount++
+              this.collectResult = '保存成功'
+              setTimeout(() => {
+                this.goLastPage()
+              }, 300)
+            } else {
+              this.timeoutCount++
+              this.collectResult = res.data.message
+            }
+          }, err => {
+            this.timeoutCount++
+            this.collectResult = err.response.data
+          })
+          return
+        }
         this.$http.put('/trade/goods', this.chooseItem).then(res => {
           if (res.data.success) {
             this.timeoutCount++
@@ -480,10 +530,15 @@
 </script>
 
 <style lang="scss" scoped>
+  @mixin overFlowHidden {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
   .productDetails {
     background: #fff;
-    margin: .2rem 0.2rem 0;
-    padding: 0.9rem 0 0.5rem 0;
+    margin: 1.26rem 0.2rem 0;
+    padding: 0 0 0.5rem 0;
     .product {
       /*background: #fff;*/
       /*margin: .2rem 0.2rem 0;*/

File diff suppressed because it is too large
+ 471 - 249
pages/mobile/order/details.vue


+ 171 - 69
pages/mobile/order/index.vue

@@ -1,21 +1,32 @@
 <template>
-  <div class="order-wrapper" id="order-wrapper">
+  <div class="order-wrapper">
     <div class="order-nav">
       <div :class="activeType === '' ? 'active': ''" @click="ChangeList('')"><span>全部</span></div>
       <div :class="activeType === 'tobeconfirmed' ? 'active' : ''" @click="ChangeList('tobeconfirmed')"><span>待付款</span></div>
       <div :class="activeType === 'comfirmed' ? 'active' : ''" @click="ChangeList('comfirmed')"><span>待发货</span></div>
       <div :class="activeType === 'inbound' ? 'active' : ''" @click="ChangeList('inbound')"><span>待收货</span></div>
     </div>
-    <ul class="order-list-wrap">
+    <div class="search-content search-content2" >
+      <input type="text" placeholder="订单号/产品信息/买家名字" v-model="keyword" @keyup.13="searchOrderlist">
+      <span @click="searchOrderlist" >
+          <i class="iconfont icon-sousuo"></i>
+      </span>
+    </div>
+    <ul class="order-list-wrap"  id="order-wrapper" v-show="orderList.length > 0">
       <li class="clearfix" v-for="item in orderList">
+        <div class="orderNumber clearfix">
+          <div class="pull-left">订单号:<span>{{item.orderid}}</span></div>
+          <div class="pull-right">{{item.createtime || item.creattime | time}}</div>
+        </div>
         <div class="list-wrap-title clearfix">
           <div class="pull-left" v-if="vendorType !== 'buyer'" @click="toShopdetails(item)">
-            <span class="labelInfo_ForItem" v-if="item.storeid === '33069557578d44e69bd91ad12d28a8d4'">寄售</span>
-            {{item.buyername}}&nbsp;|&nbsp;{{item.buyentername || '(个人账户)'}}
+            <span>买家:</span>
+            <!--<span class="labelInfo_ForItem" v-if="item.storeid === '33069557578d44e69bd91ad12d28a8d4'">寄售</span>-->
+            <span>{{item.buyentername || '(个人账户)'}}</span><span>&nbsp;|&nbsp;{{item.buyername}}</span>
           </div>
-          <div class="pull-left" v-else @click="toShopdetails(item)">
-            <span class="labelInfo_ForItem" v-if="item.storeid === '33069557578d44e69bd91ad12d28a8d4'">寄售</span>
-            {{item.sellername}}</div>
+          <div class="pull-left" v-else @click="toShopdetails(item)">卖家:
+            <!--<span class="labelInfo_ForItem" v-if="item.storeid === '33069557578d44e69bd91ad12d28a8d4'">寄售</span>-->
+            {{item.sellername}}<img src="/images/mobile/user/icon-right.png"/></div>
           <div class="pull-right">
             <template v-if="vendorType === 'buyer'">
               <span class="red" v-if="item.status === 505 || item.status === 406 || item.status === 407 || item.status === 403 || item.status === 408">待卖家发货</span>
@@ -40,7 +51,7 @@
             </template>
           </div>
         </div>
-        <div class="list-wrap-content" @click="toproductdetails(details)" v-for="(details, index) in item.purchaseDetails" v-if="index < 3">
+        <div class="list-wrap-content" @click="toproductdetails(details)" v-for="(details, index) in item.purchaseDetails" v-if="index < item.showItem">
           <div class="list-item clearfix">
             <div class="list-wrap-content-brand clearfix pull-left">
               <div class="name pull-left">品牌:</div>
@@ -55,8 +66,9 @@
               <div class="name pull-left">类目:</div>
               <div class="pull-left spec">{{details.kiName || '-'}}</div>
             </div>
-            <div class="pull-right pri">
-              <span>¥</span>{{details.taxUnitprice || details.taxUnitPrice}}
+            <div class="pull-left list-wrap-content-brand clearfix">
+              <div class="name pull-left">单价:</div>
+              <div class="pull-left spec noMargin">{{details.taxUnitprice || details.taxUnitPrice}}</div>
             </div>
           </div>
           <div class="list-item clearfix">
@@ -64,8 +76,9 @@
               <div class="name pull-left">型号:</div>
               <div class="pull-left spec">{{details.cmpCode || '-'}}</div>
             </div>
-            <div class="pull-right lab">
-              <span>x</span>{{details.number}}
+            <div class="pull-left list-wrap-content-brand clearfix">
+              <div class="name pull-left">数量:</div>
+              <div class="pull-left spec noMargin"><span>x</span>{{details.number}}</div>
             </div>
           </div>
           <div class="list-item clearfix">
@@ -73,28 +86,30 @@
               <div class="name pull-left">规格:</div>
               <div class="pull-left spec">{{details.spec || '-'}}</div>
             </div>
+            <div class="pull-left pri clearfix">
+              <div class="name pull-left">小计:</div>
+              <span>¥</span>{{details.ensurePrice}}
+            </div>
           </div>
         </div>
+        <div class="lookMorePro" @click="item.showItem = item.purchaseDetails.length" v-if="item.showItem === 3 && item.purchaseDetails && item.purchaseDetails.length > 3">查看更多<img src="/images/mobile/user/icon-right.png"/></div>
         <div class="list-all-info clearfix">
-          <div class="orderNumber clearfix">
-            <div class="pull-left">{{item.createtime || item.creattime | time}}</div>
-            <div class="pull-right">订单号:{{item.orderid}}</div>
-          </div>
-          <div>共<span>{{item.batchQty}}</span>件商品&nbsp;&nbsp;合计:
+          <!--共<span>{{item.batchQty}}</span>件商品&nbsp;&nbsp;-->
+          <div>合计:
             <span class="pri"><a class="red">¥</a>{{item.ensurePrice }}</span>
             <span class="lab">(含运费:<a class="red">¥</a><a class="red">{{item.fare | priceFiter}}</a>)</span></div>
         </div>
         <div class="list-btn clearfix">
           <template v-if="vendorType === 'buyer'">
             <div class="pull-right sendGoods" v-if="item.status === 404" @click="buyerGetGoods(item)">确认收货</div>
-            <div class="pull-right sendGoods" v-if="!item.installmentId && (item.status === 503 || item.status === 501)" @click="gotoPay(item)">确认付款</div>
+            <div class="pull-right sendGoods" v-if="!item.installmentId && (item.status === 503 || item.status === 501)" @click="gotoPay(item)">立即付款</div>
             <div class="pull-right" @click="lookOrderDetail(item)">订单详情</div>
             <div class="pull-right sendGoods" @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" v-if="item.installmentId && (item.status === 503 || item.status === 504 || item.status === 524 ) && item.installment.status !== 505 && !item.againUpload">立即付款</div>
             <div class="pull-right" @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" v-if="item.installmentId && (item.status === 503 || item.status === 504 || item.status === 524 ) && item.installment.status !== 505 && item.againUpload">重新上传</div>
             <div class="pull-right" @click="cancelOrder(item)" v-if="item.status === 503 || item.status === 501 || item.status === 502">取消订单</div>
             <div class="pull-right" @click="deleteOrder(item)" v-if="item.status === 602 || item.status === 603 || item.status === 315 || item.status === 604 || item.status === 605 || item.status === 606">
               删除订单</div>
-            <div @click="paidTime(item)" class="pull-right" v-if="_getHoursFromNow(item.paytime) > sellsendGoodsTime - 1 && item.status !== 404">提醒发货</div>
+            <div @click="paidTime(item)" class="pull-right" v-if="_getHoursFromNow(item.paytime) > sellsendGoodsTime - 1 && item.status !== 404 && item.status !== 524">提醒发货</div>
             <div @click="lookLogisticsInfo(item)" class="pull-right" v-if="item.status === 404 || item.status === 520 || item.status === 405 || item.status === 521">查看物流</div>
             <div class="pull-right cancat" @click="cancatAlert(item)">
               <i class="iconfont icon-kefu1"></i>联系卖家
@@ -299,7 +314,8 @@
         cancelList: ['我不想买了', '信息填写有误,重新购买', '先看看样品再下单', '付款遇到问题(如余额不足、超出限额等)', '买错了', '其他原因'], // 取消订单原因数组
         $CancenOrderId: '', // 取消订单id
         $Orderreason: '', // 取消订单原因
-        OrderCancelIndex: '' // 取消订单原因下标
+        OrderCancelIndex: '', // 取消订单原因下标
+        keyword: ''
       }
     },
     computed: {
@@ -330,6 +346,17 @@
       }
     },
     methods: {
+      // 搜索
+      searchOrderlist() {
+        this.page = 1
+        if (this.$route.query.type !== 'buyer') {
+          // 卖家中心
+          this.sellOrderList(this.activeType)
+        } else {
+          // 买家中心
+          this.buyerOrderList(this.activeType)
+        }
+      },
       // 确认付款
       gotoPay(item) {
         let id = EncryptionFilter(item.orderid)
@@ -369,7 +396,8 @@
           status: this.$status,
           storeType: 'other',
           isRate: false,
-          currentPage: this.page
+          currentPage: this.page,
+          keyword: this.keyword
         }
         if (this.vendorType === 'buyer') {
           params.sorting = { creattime: 'DESC' }
@@ -382,6 +410,7 @@
         })
       },
       ChangeList(_tp) {
+        this.keyword = ''
         this.activeType = _tp
         this.page = 1
         if (this.$route.query.type !== 'buyer') {
@@ -403,13 +432,15 @@
           status = '404'
         }
         this.$status = status
+        this.orderList = []
         this.$store.dispatch('order/getBuyerOrderList', {
           count: 5,
           page: 1,
           isRate: false,
           currentPage: 1,
           sorting: { creattime: 'DESC' },
-          status: status
+          status: status,
+          keyword: this.keyword
         })
       },
       // 卖家中心订单列表加载数据
@@ -425,12 +456,14 @@
         this.peisongShowName = ''
         this.sendGoodsInfo.kuaidinumber = ''
         this.$status = status
+        this.orderList = []
         this.$store.dispatch('order/getSellOrderList', {
           count: 5,
           page: 1,
           sorting: {createtime: 'DESC'},
           status: status,
-          storeType: 'other'
+          storeType: 'other',
+          keyword: this.keyword
         })
       },
       // 是否为分期付款
@@ -446,26 +479,44 @@
       },
       // 发货
       sendGoods(item) {
-        this.sendGoodstype = 'add'
-        if (item.inid) {
-          this._id = EncryptionFilter(item.inid)
-          this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
-            this.sendGoodsInfo = res.data[0]
-            this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
-            this.showSend = true
-          })
-        } else {
-          this.$http.get(`/trade/purchase/vendor/tobeshiped/${item.id}`).then(res => {
-            this._id = EncryptionFilter(res.data.inId)
-            this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
-              this.sendGoodsInfo = res.data[0]
-              this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
-              this.showSend = true
-            })
-          }, err => {
-            this.onMind('转出货单失败' + err.data)
-          })
+        if (!(this.user.data.pwdEnable && this.user.data.haveUserQuestion && this.user.data.emailValidCode === 2)) {
+          // 等级不够
+          this.onMind('您的账户安全等级较低,请先在pc端进行信息完善')
+          return
         }
+        this.$http.get(`/trade/bankInfo/vender/enterprise?status=104&type=sup`).then(res => {
+          if (res.data && res.data[0]) {
+            this.$http.get(`/trade/address/enterprise?ship=false`).then(res => {
+              // 选择发货地址
+              if (res.data[0]) {
+                this.sendGoodstype = 'add'
+                if (item.inid) {
+                  this._id = EncryptionFilter(item.inid)
+                  this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
+                    this.sendGoodsInfo = res.data[0]
+                    this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
+                    this.showSend = true
+                  })
+                } else {
+                  this.$http.get(`/trade/purchase/vendor/tobeshiped/${item.id}`).then(res => {
+                    this._id = EncryptionFilter(res.data.inId)
+                    this.$http.get(`/trade/inFpu/tobeshipped/${this._id}`).then(res => {
+                      this.sendGoodsInfo = res.data[0]
+                      this.sendGoodsInfo.area = JSON.parse(res.data[0].jsonSpAddress)
+                      this.showSend = true
+                    })
+                  }, err => {
+                    this.onMind('转出货单失败' + err.response.data)
+                  })
+                }
+              } else {
+                this.onMind('您还未填写设置发货地址 ,请进行完善')
+              }
+            })
+          } else {
+            this.onMind('您还未填写收款账户信息 ,请进行完善')
+          }
+        })
       },
       // 选择配送商
       choosePeisong() {
@@ -625,6 +676,8 @@
           if (returnResult.status === 505 || returnResult.status === 406 || returnResult.status === 407 || returnResult.status === 403 || returnResult.status === 408) {
             this.onMind('提醒成功')
             this.ChangeList(this.activeType)
+          } else {
+            this.onMind('提醒发货失败:' + returnResult.message)
           }
         })
       },
@@ -758,9 +811,10 @@
             _obj[i].purchaseDetails = _obj[i].orderDetails
           }
           if (_obj[i].status === 505 || _obj[i].status === 406 || _obj[i].status === 407 || _obj[i].status === 403 || _obj[i].status === 408) {
-            _obj[i].paidTimeFromNow = this._getHoursFromNow(_obj[i].paytime)
-            _obj[i].lastNotiDelivery = this._getHoursFromNow(_obj[i].lastNotifyDeliveryTime)
+            // _obj[i].paidTimeFromNow = this._getHoursFromNow(_obj[i].paytime)
+            // _obj[i].lastNotiDelivery = this._getHoursFromNow(_obj[i].lastNotifyDeliveryTime)
           }
+          _obj[i].showItem = _obj[i].purchaseDetails.length > 3 ? 3 : _obj[i].purchaseDetails.length
         }
         return _obj
       },
@@ -772,6 +826,7 @@
         let newTime = new Date()
         let msec = newTime.getTime() - time
         let hours = parseInt(parseInt(msec) / (1000 * 60 * 60))
+        console.log(hours)
         return hours
       },
       onMind(str) {
@@ -828,8 +883,7 @@
 .order-wrapper {
   background: #f1f3f6;
   margin: 1.26rem 0 0.98rem 0;
-  height: calc(100vh - 0.88rem - 0.96rem);
-  overflow-y: scroll;
+  height: calc(100vh - 1.26rem - 0.98rem);
   /*padding-bottom: 0.96rem;*/
   .order-nav {
     background: #fff;
@@ -848,19 +902,47 @@
       }
     }
   }
+  .search-content2 {
+    text-align: center;
+    padding: .25rem 0 0 0;
+    margin-top: 0 !important;
+    input {
+      width: 7.1rem;
+      border: 1px solid #376ff3;
+    }
+    span {
+      height: .46rem;
+      line-height: .46rem;
+    }
+  }
   .order-list-wrap {
+    height: calc(100vh - 1.26rem - 0.96rem - 0.84rem - 1rem);
+    overflow-y: scroll;
     li {
-      margin-top: 0.2rem;
+      margin-bottom: 0.2rem;
     }
     .list-wrap-title{
        padding: 0 0.2rem;
        background: #fff;
-       @include lineHeight(0.88rem);
+       @include lineHeight(0.67rem);
        font-size: 0.28rem;
        color: #333;
+       border-bottom: 1px solid #e4e4e4;
        .pull-left {
          width: 5rem;
-         @include overFlowHidden()
+         @include overFlowHidden();
+         span {
+           max-width: 3rem;
+           @include overFlowHidden();
+           display: inline-block;
+         }
+         img {
+           width: 0.18rem;
+           height: 0.32rem;
+           vertical-align: top;
+           margin-top: 0.18rem;
+           margin-left: 0.1rem;
+         }
        }
        .pull-right {
          .red {
@@ -877,21 +959,20 @@
         font-size: 0.28rem;
         color: #333;
         /*line-height: 0.5rem;*/
-        margin-top: 0.18rem;
+        margin-top: 0.22rem;
         &:nth-child(1) {
           margin-top: 0px;
         }
-        &:nth-child(2) {
-          margin-top: 0.21rem;
-        }
-        &:nth-child(3) {
-          margin-top: 0.1rem;
-        }
         .list-wrap-content-brand {
           @include overFlowHidden();
           .spec {
-            width: 4rem;
-            @include overFlowHidden()
+            width: 3.4rem;
+            @include overFlowHidden();
+            margin-right: 0.2rem;
+            &.noMargin {
+              margin-right: 0;
+              width: 1.5rem;
+            }
           }
         }
         .name {
@@ -907,13 +988,23 @@
           }
         }
         .pri {
-          font-size: 0.32rem;
+          font-size: 0.28rem;
           color: #f43938;
-          max-width: 2.2rem;
-          @include overFlowHidden();
-          span {
-            font-size: 0.24rem;
-          }
+        }
+      }
+    }
+    .orderNumber {
+      font-size: 0.27rem;
+      color: #666;
+      border-bottom: 1px solid #e4e4e4;
+      @include lineHeight(0.88rem);
+      background: #fff;
+      padding: 0 0.2rem;
+      .pull-left {
+        width: 5rem;
+        @include overFlowHidden();
+        span {
+          color: #3f84f6
         }
       }
     }
@@ -926,11 +1017,6 @@
       font-size: 0.26rem;
       color: #333;
       border-bottom: 1px solid #e4e4e4;
-      .orderNumber {
-        font-size: 0.24rem;
-        color: #999;
-        border-bottom: 1px solid #e4e4e4;
-      }
       .pri {
         font-size: 0.32rem;
         color: #f43938;
@@ -980,6 +1066,22 @@
         }
       }
     }
+    .lookMorePro {
+      background: #fff;
+      font-size: 0.28rem;
+      color: #999;
+      text-align: center;
+      border-bottom: 1px solid #e4e4e4;
+      @include lineHeight(0.67rem);
+      img {
+        transform: rotate(90deg);
+        width: 0.16rem;
+        height: 0.26rem;
+        vertical-align: top;
+        margin-top: 0.23rem;
+        margin-left: 0.1rem;
+      }
+    }
   }
   .sendGoods_Alert {
     background: #fff;

+ 1 - 5
pages/mobile/order/logistics.vue

@@ -1,10 +1,5 @@
 <template>
     <div class="order-wrapper">
-      <div class="com-mobile-header">
-        <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
-        <p>物流信息
-        </p>
-      </div>
       <div class="logistics_top clearfix">
         <div class="pull-left">
           <div class="name">订单编号:<span class="red">{{detailsInfo.orderid}}</span></div>
@@ -57,6 +52,7 @@
         let resultInfo
         if (route.query.type === 'buyer') {
           res = await axios.get(`/trade/order/${route.query.uuid}`)
+          res.data[0].sendType = JSON.parse(res.data[0].jsonRule).method
           resultInfo = res.data[0]
         } else {
           res = await axios.get(`/trade/purchase/purchaseId/${route.query.uuid}`)

+ 7 - 3
pages/mobile/product/_batchCode.vue

@@ -608,11 +608,15 @@
         button {
           width: 50%;
           height: 100%;
-          color: #fff;
-          background: #ff9c00;
+          background: #fff;
           border: none;
+          color: #3f84f6;
+          &:first-child {
+            border: 1px solid #3f84f6;
+          }
           &:last-child {
-            background: #f80915;
+            background: #3f84f6;
+            color: #fff;
           }
         }
       }

+ 70 - 0
pages/mobile/user/address.vue

@@ -0,0 +1,70 @@
+<template>
+  <div class="logistics-wrapper">
+    <div class="logistics-content" id="logisticsContent">
+      <address-view ref="addressView" v-show="!isEdit" :isSend="isSend" @isEditEvent="editClick"></address-view>
+      <address-edit v-show="isEdit" :data="setData" :isPersonal="isPersonal" :isSend="isSend" @isEditEvent="editClick"></address-edit>
+    </div>
+  </div>
+</template>
+
+<script type="text/javascript">
+  import { AddressView, AddressEdit } from '~components/mobile/base'
+  export default {
+    name: 'NoSendAddress',
+    layout: 'mobile',
+    middleware: 'authenticated',
+    fetch({store}) {
+      return Promise.all([
+        store.dispatch('mobileAddress/loadAddressData', {count: 10, page: 1, isSend: false, sorting: { 'num': 'ASC' }})
+      ])
+    },
+    components: {
+      AddressView,
+      AddressEdit
+    },
+    data () {
+      return {
+        isEdit: false,
+        setData: {}
+      }
+    },
+    computed: {
+      isSend () {
+        return false
+      },
+      isPersonal () {
+        return true
+      }
+    },
+    methods: {
+      editClick (item, type) {
+        this.isEdit = type
+        if (item) {
+          this.setData = item
+        }
+        if (type === false) {
+          this.$refs.addressView.initList()
+        }
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  @mixin Fixed() {
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    top: 1.26rem;
+  }
+  .logistics-wrapper {
+    @include Fixed();
+    z-index: 111;
+    background: #f1f3f6;
+    .logistics-content {
+      overflow-y: scroll;
+      height: calc(100vh - 1.26rem)
+    }
+  }
+</style>

+ 9 - 1
pages/mobile/user/index.vue

@@ -23,7 +23,7 @@
         </div>
        <!-- <span>公司</span>-->
         <i class="iconfont icon-xiangyou"></i>
-        <span class="l-right">{{currentEnName}}</span>
+        <span class="l-right inline-block">{{currentEnName}}</span>
       </div>
       <!--v-if="storeStatus.uuid"-->
       <div class="line" @click="go('/mobile/user/storeinfo')" v-if="storeStatus.uuid">
@@ -64,6 +64,14 @@
         <i class="iconfont icon-xiangyou"></i>
         <div class="border-line"></div>
       </div>
+      <div @click="go('/mobile/user/address')" class="line block-line">
+        <div class="img-wrap">
+          <img src="/images/mobile/user/icon_06.png" alt="">
+        </div>
+        <span>收货地址信息</span>
+        <i class="iconfont icon-xiangyou"></i>
+        <div class="border-line"></div>
+      </div>
       <div class="deleteKuang" v-if="showLogout">
         <div class="kuangContent">
           <div class="title">系统提示</div>

+ 1 - 8
pages/supplier/index.vue

@@ -27,9 +27,7 @@
         store.dispatch('supplier/loadVendorList', {page: 1, size: 10}),
         store.dispatch('supplier/loadVendorAll', {page: 1, size: 20}),
         store.dispatch('supplier/loadNewMerchant', {filter: 'page', size: 10}),
-        store.dispatch('supplier/loadRecommend', {size: 19}),
-        store.dispatch('loadBanners', {type: 'home'}),
-        store.dispatch('loadProductKinds', { id: 0 })
+        store.dispatch('supplier/loadRecommend', {size: 19})
       ])
     },
     components: {
@@ -39,11 +37,6 @@
       Banner,
       ArticleOne,
       ArticleTwo
-    },
-    methods: {
-      loadProductKinds (id) {
-        this.$store.dispatch('loadAllProductKinds', {id})
-      }
     }
   }
 </script>

+ 2 - 1
plugins/element-ui.js

@@ -1,5 +1,5 @@
 import Vue from 'vue'
-import { Message, Breadcrumb, BreadcrumbItem, Tree, Pagination, Upload, Dialog, DatePicker } from 'element-ui'
+import { Message, Breadcrumb, BreadcrumbItem, Tree, Pagination, Upload, Dialog, DatePicker, Switch } from 'element-ui'
 
 Vue.use(Breadcrumb)
 Vue.use(BreadcrumbItem)
@@ -8,5 +8,6 @@ Vue.use(Pagination)
 Vue.use(Upload)
 Vue.use(Dialog)
 Vue.use(DatePicker)
+Vue.use(Switch)
 
 Vue.prototype.$message = Message

+ 6 - 0
static/data/bank.json

@@ -0,0 +1,6 @@
+{
+  "list": [
+    "中国银行", "中国建设银行", "中国工商银行", "中国农业银行", "交通银行", "招商银行", "中国民生银行",
+    "兴业银行", "中信银行", "中国光大银行", "广发银行", "平安银行", "中国邮政储蓄银行", "华夏银行", "浦发银行"
+  ]
+}

BIN
static/images/mobile/@2x/addPro_icon.png


BIN
static/images/mobile/@2x/labelTop2.png


BIN
static/images/mobile/center/user/delivery-active.png


BIN
static/images/mobile/center/user/delivery.png


BIN
static/images/mobile/center/user/finance_icon.png


BIN
static/images/mobile/center/user/invoice_icon.png


BIN
static/images/mobile/center/user/payfor_icon.png


BIN
static/images/mobile/center/user/wuliu_icon.png


BIN
static/images/mobile/product/mine_icon.png


BIN
static/images/mobile/select-arrow.png


BIN
static/images/mobile/user/icon_06.png


BIN
static/images/order/remem_icon.png


+ 43 - 0
store/mobileAddress.js

@@ -0,0 +1,43 @@
+import axios from '~plugins/axios'
+/**
+ * 发 收货地址管理数据
+ */
+export const state = () => ({
+  // 收发货切换
+  send: true,
+  // 地址数据
+  address: {
+    fetching: false,
+    data: []
+  }
+})
+
+export const mutations = {
+  SET_SEND (state, result) {
+    state.send = result || true
+  },
+  REQUEST_ADDRESS (state) {
+    state.address.fetching = true
+  },
+  REQUEST_ADDRESS_SUCCESS (state, result) {
+    state.address.fetching = false
+    state.address.data = result
+  },
+  REQUEST_ADDRESS_FAILURE (state) {
+    state.address.fetching = false
+  }
+}
+
+export const actions = {
+  // 获取地址数据
+  loadAddressData ({ commit }, params = {}) {
+    commit('REQUEST_ADDRESS')
+    return axios.get('/trade/address/page', {params})
+      .then(response => {
+        commit('REQUEST_ADDRESS_SUCCESS', response.data)
+      }, err => {
+        commit('REQUEST_ADDRESS_FAILURE', err)
+      })
+  }
+}
+

+ 44 - 0
store/payCenter.js

@@ -0,0 +1,44 @@
+import axios from '~plugins/axios'
+
+export const actions = {
+  // 获取买家付款账户
+  loadBuyerAccount ({ commit }, params = {}) {
+    commit('data/REQUEST_BUYER_ACCOUNT')
+    return axios.get('/trade/bankInfo/buy/personal', {params: params})
+      .then(response => {
+        commit('data/GET_BUYER_ACCOUNT_SUCCESS', response.data)
+      }, err => {
+        commit('data/GET_BUYER_ACCOUNT_FAILURE', err)
+      })
+  },
+  // 获取买家交易记录
+  loadBuyerRecord ({ commit }, params = {}) {
+    commit('data/REQUEST_BUYER_RECORD')
+    return axios.get('/trade/order/buyer/payRecord', {params: params})
+      .then(response => {
+        commit('data/GET_BUYER_RECORD_SUCCESS', response.data)
+      }, err => {
+        commit('data/GET_BUYER_RECORD_FAILURE', err)
+      })
+  },
+  // 获取卖家交易记录
+  loadVendorRecord ({ commit }, params = {}) {
+    commit('data/REQUEST_VENDOR_RECORD')
+    return axios.get('/trade/transfer/vendor/bankTransfer/page', {params: params})
+      .then(response => {
+        commit('data/GET_VENDOR_RECORD_SUCCESS', response.data)
+      }, err => {
+        commit('data/GET_VENDOR_RECORD_FAILURE', err)
+      })
+  },
+  // 获取卖家收款账户
+  loadVendorAccount ({ commit }, params = {}) {
+    commit('data/REQUEST_VENDOR_ACCOUNT')
+    return axios.get('/trade/bankInfo/sale/enterprise', {params: params})
+      .then(response => {
+        commit('data/GET_VENDOR_ACCOUNT_SUCCESS', response.data)
+      }, err => {
+        commit('data/GET_VENDOR_ACCOUNT_FAILURE', err)
+      })
+  }
+}

+ 61 - 0
store/payCenter/data.js

@@ -0,0 +1,61 @@
+export const state = () => ({
+  buyerAccount: {
+    fetching: false,
+    data: []
+  },
+  buyerRecord: {
+    fetching: false,
+    data: []
+  },
+  vendorAccount: {
+    fetching: false,
+    data: []
+  },
+  vendorRecord: {
+    fetching: false,
+    data: []
+  }
+})
+
+export const mutations = {
+  REQUEST_BUYER_ACCOUNT (state) {
+    state.buyerAccount.fetching = true
+  },
+  GET_BUYER_ACCOUNT_FAILURE (state) {
+    state.buyerAccount.fetching = false
+  },
+  GET_BUYER_ACCOUNT_SUCCESS (state, result) {
+    state.buyerAccount.fetching = false
+    state.buyerAccount.data = result
+  },
+  REQUEST_BUYER_RECORD (state) {
+    state.buyerRecord.fetching = true
+  },
+  GET_BUYER_RECORD_FAILURE (state) {
+    state.buyerRecord.fetching = false
+  },
+  GET_BUYER_RECORD_SUCCESS (state, result) {
+    state.buyerRecord.fetching = false
+    state.buyerRecord.data = result
+  },
+  REQUEST_VENDOR_ACCOUNT (state) {
+    state.vendorAccount.fetching = true
+  },
+  GET_VENDOR_ACCOUNT_FAILURE (state) {
+    state.vendorAccount.fetching = false
+  },
+  GET_VENDOR_ACCOUNT_SUCCESS (state, result) {
+    state.vendorAccount.fetching = false
+    state.vendorAccount.data = result
+  },
+  REQUEST_VENDOR_RECORD (state) {
+    state.vendorRecord.fetching = true
+  },
+  GET_VENDOR_RECORD_FAILURE (state) {
+    state.vendorRecord.fetching = false
+  },
+  GET_VENDOR_RECORD_SUCCESS (state, result) {
+    state.vendorRecord.fetching = false
+    state.vendorRecord.data = result
+  }
+}

+ 16 - 0
store/product/component.js

@@ -11,6 +11,11 @@ export const state = () => ({
     // 类目关注
     fetching: false,
     data: []
+  },
+  // 当个物料信息
+  nowProductInfo: {
+    fetching: false,
+    data: []
   }
 })
 
@@ -44,5 +49,16 @@ export const mutations = {
   },
   REQUEST_COLLECTCODE_FAILURE (state) {
     state.collectCode = false
+  },
+
+  REQUEST_NOWPRODUCTINFO (state) {
+    state.nowProductInfo.fetching = true
+  },
+  REQUEST_NOWPRODUCTINFO_SUCCESS (state, result) {
+    state.nowProductInfo.fetching = false
+    state.nowProductInfo.data = result
+  },
+  REQUEST_NOWPRODUCTINFO_FAILURE (state) {
+    state.nowProductInfo = false
   }
 }

+ 27 - 1
utils/baseUtils.js

@@ -433,6 +433,29 @@ const _priceFixed = (price) => {
   return Number((num + adder).toFixed(2))
 }
 
+const _onFileUpload = ($this, file) => {
+  if (file && file.size > 3 * 1024 * 1024) {
+    _setMessage($this, '上传文件不得超过3M', $this.isMobile)
+  } else {
+    let param = new FormData()
+    param.append('file', file, file.name)
+    param.append('chunk', '0')
+    let promises = []
+    if (file.type !== 'application/pdf') {
+      let config = {
+        headers: {'Content-Type': 'multipart/form-data'}
+      }
+      promises.push($this.$http.post('/api/images', param, config))
+    } else {
+      let config = {
+        headers: {'Content-Type': file.type}
+      }
+      promises.push($this.$http.post('/file', param, config))
+    }
+    return Promise.all(promises)
+  }
+}
+
 export default {
   // 获取字符串字符长度
   getRealLen: _getRealLen,
@@ -471,5 +494,8 @@ export default {
   filterDate: _filterDate,
   // 计算标准订单金额
   priceFixed: _priceFixed,
-  setMessage: _setMessage
+  // 统一通知框
+  setMessage: _setMessage,
+  // 文件上传
+  onFileUpload: _onFileUpload
 }

+ 116 - 0
utils/mixin.js

@@ -115,3 +115,119 @@ export const sayPriceReplace = {
     }
   }
 }
+
+/*
+* 商品购买数量操作
+* */
+export const goodsPurchaseOperate = {
+  methods: {
+    initGoodsStatus (goodsItem, purchaseNumber) {
+      let pack = goodsItem.perQty || goodsItem.minPackQty
+      if (goodsItem.breakUp) {
+        goodsItem.purchaseNumber = purchaseNumber || goodsItem.minBuyQty
+        goodsItem.canSub = false
+        goodsItem.canAdd = goodsItem.purchaseNumber < goodsItem.reserve
+      } else {
+        if (pack >= goodsItem.minBuyQty) {
+          goodsItem.purchaseNumber = purchaseNumber || pack
+        } else {
+          let max = Math.max(pack, goodsItem.minBuyQty)
+          goodsItem.purchaseNumber = purchaseNumber || (max + max % pack)
+        }
+        goodsItem.canSub = false
+        goodsItem.canAdd = goodsItem.purchaseNumber + goodsItem.minPackQty <= goodsItem.reserve
+      }
+      goodsItem.currentPrice = Number((this.baseUtils.getPriceByLevel(goodsItem.prices, goodsItem.purchaseNumber, goodsItem.currencyName) * goodsItem.purchaseNumber).toFixed(6))
+    },
+    onPurchaseNumberInput: function (goods) {
+      let showPrice = this.baseUtils.getPriceByLevel(goods.goods.prices, goods.goods.purchaseNumber, goods.goods.currencyName)
+      goods.goods.currentPrice = Number(((showPrice || goods.goods.currentPrice) * goods.goods.purchaseNumber).toFixed(6))
+//        console.log(goods.goods.currentPrice)
+    },
+    checkPurchaseNumber: function (goods) {
+      if ((/^[\d]*$/).test(goods.goods.purchaseNumber)) {
+        this.changeNum(goods.goods.purchaseNumber, goods)
+      } else {
+        this.setRemindText('请输入整数')
+        goods.goods.purchaseNumber = goods.goods.minBuyQty
+      }
+    },
+    setGoods: function (type, goods) {
+      if (type === 'set') {
+        this.checkPurchaseNumber(goods)
+      } else {
+        let isAdd = type === 'add'
+        let pack = goods.goods.perQty || goods.goods.minPackQty
+        let newNum = 0
+        if (goods.goods.breakUp) {
+          newNum = isAdd ? goods.goods.purchaseNumber + 1 : goods.goods.purchaseNumber - 1
+        } else {
+          newNum = isAdd ? goods.goods.purchaseNumber + pack : goods.goods.purchaseNumber - pack
+        }
+        this.changeNum(newNum, goods)
+      }
+    },
+    changeNum: function (newNum, goods) {
+      let pack = goods.goods.perQty || goods.goods.minPackQty
+      let buy = goods.goods.minBuyQty
+      let reserve = goods.goods.reserve
+      let breakUp = goods.goods.breakUp
+      if (!newNum && newNum !== 0) {
+        goods.goods.purchaseNumber = buy
+      } else {
+        newNum = parseInt(newNum)
+        if (breakUp) {
+          if (newNum < buy) {
+            this.setRemindText('最小起订量为' + buy)
+            goods.goods.purchaseNumber = buy
+            goods.goods.canSub = false
+//              goods.goods.canAdd = true
+          } else if (newNum > reserve) {
+            this.setRemindText('库存不足')
+            goods.goods.purchaseNumber = reserve
+            goods.goods.canAdd = false
+//              goods.goods.canSub = true
+          } else {
+            goods.goods.canSub = true
+            goods.goods.canAdd = true
+            goods.goods.purchaseNumber = newNum
+            newNum === buy && (goods.goods.canSub = false)
+            newNum === reserve && (goods.goods.canAdd = false)
+          }
+        } else {
+          if (newNum < buy) {
+            this.setRemindText('最小起订量为' + buy)
+            goods.goods.purchaseNumber = buy
+            goods.goods.canSub = false
+            if (newNum > reserve) {
+              this.setRemindText('库存不足')
+              goods.goods.purchaseNumber = reserve - (reserve % pack)
+              goods.goods.canAdd = false
+            }
+          } else if (newNum > reserve) {
+            goods.goods.canSub = true
+            goods.goods.canAdd = false
+            this.setRemindText('库存不足')
+            goods.goods.purchaseNumber = reserve - (reserve % pack)
+          } else {
+            goods.goods.canSub = true
+            goods.goods.canAdd = true
+            let remainder = newNum % pack
+            if (remainder !== 0) {
+//                console.log(this.fragment.num)
+              this.setRemindText('不支持拆包且包装量为' + pack)
+              // 这个直接赋值的,应该给这个值进行判断(Math.floor(newNum / pack) + 1) * pack
+              let res = (Math.floor(newNum / pack) + 1) * pack
+              goods.goods.purchaseNumber = res > reserve ? Math.floor(newNum / pack) * pack : res
+            } else {
+              goods.goods.purchaseNumber = newNum
+            }
+            newNum === buy && (goods.goods.canSub = false)
+            newNum === reserve && (goods.goods.canAdd = false)
+          }
+        }
+      }
+      this.onPurchaseNumberInput(goods)
+    }
+  }
+}

Some files were not shown because too many files changed in this diff