瀏覽代碼

提现单,期数字段,改为取当前的期数

theojeng 3 年之前
父節點
當前提交
e358d52055
共有 2 個文件被更改,包括 150 次插入149 次删除
  1. 6 3
      common/models/Withdraw.php
  2. 144 146
      frontendEle/src/views/finance/withdraw-add.vue

+ 6 - 3
common/models/Withdraw.php

@@ -157,13 +157,16 @@ class Withdraw extends \common\components\ActiveRecord {
      */
     public static function getPeriod($nowTime) {
         $period = Period::instance();
+        $nowPeriodNum = $period->getNowPeriodNum();
         $year = $period->getNowYear();
         $month = $period->getNowMonth();
         $yearMonth = $period->getNowYearMonth();
-        $thisMonth = Period::getPeriodNumRangeFromMonth($year, $month);
-        $period->setPeriodNum($thisMonth['min']);
+//        $thisMonth = Period::getPeriodNumRangeFromMonth($year, $month);
+//        $period->setPeriodNum($thisMonth['min']);
+        $period->setPeriodNum($nowPeriodNum);
         $endTime = $period->getNowPeriodEnd();
-        return ['nowPeriodNum' => $thisMonth['min'], 'nowYear' => $year, 'nowMonth' => $month, 'yearMonth'=>$yearMonth, 'endTime' => $endTime];
+//        return ['nowPeriodNum' => $thisMonth['min'], 'nowYear' => $year, 'nowMonth' => $month, 'yearMonth'=>$yearMonth, 'endTime' => $endTime];
+        return ['nowPeriodNum' => $nowPeriodNum, 'nowYear' => $year, 'nowMonth' => $month, 'yearMonth'=>$yearMonth, 'endTime' => $endTime];
     }
 
     /**

+ 144 - 146
frontendEle/src/views/finance/withdraw-add.vue

@@ -57,160 +57,158 @@
 </template>
 
 <script>
-  import Vue from 'vue'
-  import store from '@/utils/vuexStore'
-  import network from '@/utils/network'
-  import tool from '@/utils/tool'
-  import userInfo from '@/utils/userInfo'
-  import {CDN_IMG_URL} from '@/utils/config'
+import Vue from 'vue'
+import store from '@/utils/vuexStore'
+import network from '@/utils/network'
+import tool from '@/utils/tool'
+import userInfo from '@/utils/userInfo'
+import {CDN_IMG_URL} from '@/utils/config'
 
-  export default {
-    name: 'finance_withdraw-add',
-    mounted() {
-      this.init()
-      this.chkWithdrawUserinfo()
-    },
-    data() {
-      return {
-        form: {
-          applyAmount: 0,
-          payPassword: '',
-          withdrawCode: '',
-        },
-        balance: 0,
-        loading: true,
-        userInfo: {
-          WITHDRAW_PROP:100
-        },
-        submitButtonStat: false,
-        openBanks: null,
-        isPact: null,
-        checked: this.chkAgree(),
-        content: null,
-        dialogVisible: false,
-        idCardDialogVisible: false,
-        withdrawProp: 100,
-        maxAmount: 0,
-        minAmount: 0,
-        withdrawFee: 0,
-        idCardInfoQrCodeUrl:'',
-      }
-    },
-    methods: {
-      init() {
-        this.idCardInfoQrCodeUrl = CDN_IMG_URL + "img_data/idCardInfo.png"
+export default {
+  name: 'finance_withdraw-add',
+  mounted () {
+    this.init()
+    this.chkWithdrawUserinfo()
+  },
+  data () {
+    return {
+      form: {
+        applyAmount: 0,
+        payPassword: '',
+        withdrawCode: ''
       },
-      chkAgree() {
-        if (this.isPact === '0') return true
-        return tool.getStorage('withdrawAgree'+userInfo.userId()) === '1' ? true : false
+      balance: 0,
+      loading: true,
+      userInfo: {
+        WITHDRAW_PROP: 100
       },
-      chkWithdrawUserinfo() {
-        network.getData(`finance/chk-withdraw-user`).then(response => {
-          this.loading = false
-          this.userInfo = response.userInfo
-          this.isPact = response.isPact
-          this.checked=this.chkAgree()
-          this.content = response.content
-          this.minAmount = response.minAmount
-          this.withdrawFee = response.withdrawFee
-            this.getBalance()
-        }).catch(() => {
-          this.$router.go(-1)
-        })
-      },
-      getBalance() {
-        this.$message({
-          message: '正获取您的奖金...',
-          type: 'info'
-        })
-        network.getData('finance/available-balance').then(response => {
-          this.$message.closeAll()
-          this.balance = response.bonus
-          this.getMaxAmount()
-          this.loading = false
-        })
-      },
-      getMaxAmount(){
-          this.maxAmount = this.balance
-        // this.maxAmount = Math.floor(tool.formatPrice(this.balance * this.userInfo.WITHDRAW_PROP * 0.01))
-        // this.withdrawProp = this.userInfo.WITHDRAW_PROP
-      },
-      onSubmit() {
-        this.submitButtonStat = true
-        tool.setStorage('withdrawAgree'+userInfo.userId(), 1)
-        console.log(tool.getStorage('withdrawAgree'))
-        let path = 'finance/withdraw-add'
-
-          network.getData('finance/wd-mult-point').then(response => {
-              this.form.withdrawCode = response.withdrawCode
+      submitButtonStat: false,
+      openBanks: null,
+      isPact: null,
+      checked: this.chkAgree(),
+      content: null,
+      dialogVisible: false,
+      idCardDialogVisible: false,
+      withdrawProp: 100,
+      maxAmount: 0,
+      minAmount: 0,
+      withdrawFee: 0,
+      idCardInfoQrCodeUrl: ''
+    }
+  },
+  methods: {
+    init () {
+      this.idCardInfoQrCodeUrl = CDN_IMG_URL + 'img_data/idCardInfo.png'
+    },
+    chkAgree () {
+      if (this.isPact === '0') return true
+      return tool.getStorage('withdrawAgree' + userInfo.userId()) === '1' ? true : false
+    },
+    chkWithdrawUserinfo () {
+      network.getData(`finance/chk-withdraw-user`).then(response => {
+        this.loading = false
+        this.userInfo = response.userInfo
+        this.isPact = response.isPact
+        this.checked = this.chkAgree()
+        this.content = response.content
+        this.minAmount = response.minAmount
+        this.withdrawFee = response.withdrawFee
+        this.getBalance()
+      }).catch(() => {
+        this.$router.go(-1)
+      })
+    },
+    getBalance () {
+      this.$message({
+        message: '正获取您的奖金...',
+        type: 'info'
+      })
+      network.getData('finance/available-balance').then(response => {
+        this.$message.closeAll()
+        this.balance = response.bonus
+        this.getMaxAmount()
+        this.loading = false
+      })
+    },
+    getMaxAmount () {
+      this.maxAmount = this.balance
+      // this.maxAmount = Math.floor(tool.formatPrice(this.balance * this.userInfo.WITHDRAW_PROP * 0.01))
+      // this.withdrawProp = this.userInfo.WITHDRAW_PROP
+    },
+    onSubmit () {
+      this.submitButtonStat = true
+      tool.setStorage('withdrawAgree' + userInfo.userId(), 1)
+      console.log(tool.getStorage('withdrawAgree'))
+      let path = 'finance/withdraw-add'
 
-              this.$prompt('请输入支付密码', '提示', {
-                  confirmButtonText: '确定',
-                  cancelButtonText: '取消',
-                  inputType: 'password',
-                  inputPattern: /\S+/,
-                  inputErrorMessage: '请输入支付密码',
-                  beforeClose:async (action, instance, done)=>{
-                      if (action === 'confirm') {
-                          instance.confirmButtonLoading = true;
-                          instance.confirmButtonText = '执行中...';
-                          console.log(instance.inputValue);
-                          this.form.payPassword = instance.inputValue;
-                          await network.postData(path, this.form).then(response => {
+      network.getData('finance/wd-mult-point').then(response => {
+        this.form.withdrawCode = response.withdrawCode
 
-                              instance.confirmButtonLoading = false;
-                              done();
-                              this.$message({
-                                  message: response,
-                                  type: 'success'
-                              })
-                              tool.setStorage('withdrawAgree', 1)
-                              this.submitButtonStat = false
-                              this.$router.go(-1)
-                          }).catch(error=>{
-                              instance.confirmButtonLoading = false;
-                              this.submitButtonStat = false
-                              if( error.status === 424 ) {
-                                  this.idCardDialogVisible = true
-                              }
-                              done();
-                          })
-                      }else {
-                          this.submitButtonStat = false
-                          done();
-                      }
-                  }
+        this.$prompt('请输入支付密码', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          inputType: 'password',
+          inputPattern: /\S+/,
+          inputErrorMessage: '请输入支付密码',
+          beforeClose: async (action, instance, done) => {
+            if (action === 'confirm') {
+              instance.confirmButtonLoading = true
+              instance.confirmButtonText = '执行中...'
+              console.log(instance.inputValue)
+              this.form.payPassword = instance.inputValue
+              await network.postData(path, this.form).then(response => {
+                instance.confirmButtonLoading = false
+                done()
+                this.$message({
+                  message: response,
+                  type: 'success'
+                })
+                tool.setStorage('withdrawAgree', 1)
+                this.submitButtonStat = false
+                this.$router.go(-1)
+              }).catch(error => {
+                instance.confirmButtonLoading = false
+                this.submitButtonStat = false
+                if (error.status === 424) {
+                  this.idCardDialogVisible = true
+                }
+                done()
               })
-
-          })
-        // this.$prompt('请输入支付密码', '提示', {
-        //   confirmButtonText: '确定',
-        //   cancelButtonText: '取消',
-        //   inputType: 'password',
-        //   inputPattern: /\S+/,
-        //   inputErrorMessage: '请输入支付密码'
-        // }).then(({value}) => {
-        //   this.form.payPassword = value
-        //   return network.postData(path, this.form).then(response => {
-        //     this.$message({
-        //       message: response,
-        //       type: 'success'
-        //     })
-        //     tool.setStorage('withdrawAgree', 1)
-        //     this.submitButtonStat = false
-        //     this.$router.go(-1)
-        //   }).catch((error) => {
-        //     this.submitButtonStat = false
-        //     if( error.status === 424 ) {
-        //         this.idCardDialogVisible = true
-        //     }
-        //   })
-        // }).catch((response) => {
-        //   this.submitButtonStat = false
-        // })
-      },
+            } else {
+              this.submitButtonStat = false
+              done()
+            }
+          }
+        })
+      })
+      // this.$prompt('请输入支付密码', '提示', {
+      //   confirmButtonText: '确定',
+      //   cancelButtonText: '取消',
+      //   inputType: 'password',
+      //   inputPattern: /\S+/,
+      //   inputErrorMessage: '请输入支付密码'
+      // }).then(({value}) => {
+      //   this.form.payPassword = value
+      //   return network.postData(path, this.form).then(response => {
+      //     this.$message({
+      //       message: response,
+      //       type: 'success'
+      //     })
+      //     tool.setStorage('withdrawAgree', 1)
+      //     this.submitButtonStat = false
+      //     this.$router.go(-1)
+      //   }).catch((error) => {
+      //     this.submitButtonStat = false
+      //     if( error.status === 424 ) {
+      //         this.idCardDialogVisible = true
+      //     }
+      //   })
+      // }).catch((response) => {
+      //   this.submitButtonStat = false
+      // })
     }
   }
+}
 </script>
 
 <style scoped>