xinfeng hace 5 años
padre
commit
2b56bcdfeb

+ 5 - 1
assets/css/otherpage/money/withdraw.scss

@@ -74,13 +74,17 @@
         }
         .nums {
           margin-left: pxtovw(6);
-          max-width: pxtovw(200);
+          max-width: pxtovw(250);
           height: pxtovw(37);
           font-size: pxtovw(32);
           font-weight: 700;
           text-align: left;
           color: #333333;
           line-height: pxtovw(37);
+
+          &::placeholder {
+            font-size: pxtovw(15);
+          }
         }
       }
       .rightClose {

+ 29 - 7
pages/otherpage/money/withdraw.vue

@@ -13,7 +13,7 @@
       <div class="amountArea">
         <div class="left">
           <div class="pre">¥</div>
-          <input class="nums" v-model="vCoins" placeholder="最少提现10元,每日上限3万元" type="text"/>
+          <input class="nums" v-model="vCoins" placeholder="最少提现10元,每日上限3万元" type="number" />
         </div>
         <div class="rightClose"></div>
       </div>
@@ -29,14 +29,14 @@
       <div class="sdesc">已默认为您选择最低费率缴税方案</div>
       <div class="schemeList">
         <div class="cell" v-for="item in list" :key="item.id">
-          <div class="leftChoose" :class="{ok: item.id === selectedId}"></div>
+          <div class="leftChoose" :class="{ok: item.id === selectedId}" @click="changeSelected(item)"></div>
           <div class="rightContent">
             <div class="taxTop">
               <div class="topLeft">{{item.config_key}}</div>
               <div class="topRight" v-if="item.is_auto != 1">选则扣税方式即表示您同意
                 <a href="">《{{item.config_key}}服务协议》</a></div>
               <div class="topRight" v-else>
-                <span @click="onJumpToUpload">{{fpUrl ? '去上传电子发票' : '已上传电子发票'}}</span>
+                <span @click="onJumpToUpload">{{!fpUrl ? '去上传电子发票' : '已上传电子发票'}}</span>
               </div>
             </div>
             <div class="taxContent">代缴综合费率{{item.kaifabao_rate}}%, 预计到账¥{{calcOkMoney}}元</div>
@@ -81,7 +81,7 @@
       return {
         bankInfo: {},
         list: [],
-        vCoins: 0,
+        vCoins: '',
         fpUrl: '',
         selectedId: -1
       }
@@ -97,8 +97,18 @@
         return this.list.filter(v=>v.id === this.selectedId)[0] || {}
       }
     },
+    watch: {
+      vCoins: {
+        immediate: true,
+        handler(newVal) {
+          this.vCoins = Math.min(newVal, 30000)
+          // this.vCoins = Math.max(newVal, 10)
+          this.vCoins = Math.floor(this.vCoins * 100) / 100
+        }
+      }
+    },
     created() {
-      const {coins=0, fpUrl=0} = this.$route.query || {}
+      const {coins='', fpUrl=''} = this.$route.query || {}
       this.vCoins = coins
       this.fpUrl = fpUrl
       this.getAccountBankInfo()
@@ -128,6 +138,14 @@
       onSetAllMoney() {
         this.vCoins = this.bankInfo.incomeTaxBalance
       },
+      changeSelected(item) {
+        const {id, is_auto} = item
+        if (Number(is_auto) === 1 && !this.fpUrl) {
+          this._toast('请先点击右侧,上传发票')
+          return
+        }
+        this.selectedId = id
+      },
       onJumpToUpload() {
         const {vCoins, fpUrl} = this
         location.href = `/otherpage/money/uploadInvoice?coins=${vCoins}&fpUrl=${fpUrl}`
@@ -138,8 +156,12 @@
           this._toast('请选择缴税方案')
           return
         }
-        if (!(this.coins >= 10 && this.coins <= 30000)) {
-          this._toast('请填写正确的的提现金额')
+        if (this.coins < 10) {
+          this._toast('提现金额不得低于10元')
+          return
+        }
+        if (this.coins > 30000) {
+          this._toast('单日提现总额度不得超过30000元')
           return
         }
 

+ 9 - 2
pages/otherpage/proto/money.vue

@@ -9,15 +9,22 @@
     name: "protoMoney",
     head() {
       return {
-        title: this.item.title
+        title: this.item && this.item.title || ''
       }
     },
     async asyncData({ app, $axios }) {
       let { query: { id = 1} } = app.context.route
       let res = await $axios.post('/api/kaifabao/getBasicConfigList')
       const { list = []} = res.data.data || {}
-      let item = list.filter((v => v.id == id))[0] || []
+      let item = list.filter((v => v.id == id))[0] || {}
       return item
+    },
+
+    created() {
+      this.$axios.post('/api/kaifabao/getBasicConfigList').then(res=>{
+        const { list = []} = res.data.data || {}
+        console.log(list)
+      })
     }
   }
 </script>