Browse Source

买卖家支付中心

yangc 7 years ago
parent
commit
453aaf7a5d

+ 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" />
   {{ HEAD }}
   <script>

+ 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;
+    }
+  }
+}

+ 6 - 0
components/mobile/MobileHeader.vue

@@ -199,6 +199,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 = '填写订单'

+ 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%;
   }

+ 7 - 5
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: {

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

@@ -46,7 +46,7 @@
             <img src="/images/mobile/center/user/store-focus.png" alt="">
             <p>店铺关注<span class="text">{{storeCount.data || 0}}</span></p>
           </nuxt-link>
-          <nuxt-link tag="li" to="/" class="content-line">
+          <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>

+ 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>

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

@@ -54,7 +54,7 @@
             <img src="/images/mobile/center/user/wuliu_icon.png" alt="">
             <p>物流管理</p>
           </nuxt-link>
-          <nuxt-link tag="li" to="/">
+          <nuxt-link tag="li" to="/mobile/center/vendor/payCenter">
             <img src="/images/mobile/center/user/finance_icon.png" alt="">
             <p>财务对账</p>
           </nuxt-link>

+ 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>

+ 1 - 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">

+ 6 - 0
static/data/bank.json

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

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


+ 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
+  }
+}

+ 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
 }