123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- import * as API from '@/apis/merchant.js'
-
- export default {
- data() {
- return {
- txbool:false,
- txAmount:'',
- myAccount:{
- account:{}
- },
- }
- },
-
- methods: {
- myerror(){
- this.$refs.common.alert("每周"+this.showday(this.myAccount.date)+"可申请将账户内资金提现至银行卡;");
-
- },
- myerror2(){
- this.$refs.common.alert("请输入提现金额");
-
- },
- showday(num){
- if(num==1){
- return "一"
- }
- if(num==2){
- return "二"
- }
- if(num==3){
- return "三"
- }
- if(num==4){
- return "四"
- }
- if(num==5){
- return "五"
- }
- if(num==6){
- return "六"
- }
- if(num==7){
- return "日"
- }
-
- return ""
- },
- show(num){
- if(num){
- var i =num.length
- return num.substring(i-4);
- }
- return ""
- },
-
- gotoTx(){
- if(!this.myAccount.account.bankNumber){
- this.$refs.common.alert("请联系管理员绑定银行卡");
- return "";
- }
- uni.navigateTo({
- url:"/pages/wallet/out"
- })
- },
-
- getWithdrawalSubmit(){
- if(!this.txAmount){
- this.$refs.common.alert("请填写金额");
- return
- }
-
- if(this.txAmount==0){
- this.$refs.common.alert("请填写金额");
- return
- }
- this.$refs.common.showLoading()
- API.withdrawalSubmit(this.txAmount).then(response => {
-
- //this.myAccount=response.data
- if(response.code=="200"){
- uni.redirectTo({
- url:"/pages/wallet/success?number="+this.txAmount
- })
- }else{
- this.$refs.common.showLoading(false,response.message);
- }
-
-
-
- }).catch(error => {
- this.$refs.common.showLoading(false,error);
- })
- },
- getMyAccount(){
- this.$refs.common.showLoading()
- API.myAccount().then(response => {
-
- this.myAccount=response.data
- var d=new Date();
- var week=d.getDay();
-
- if(this.myAccount.date==week){
- this.txbool=true;
- }
- if(this.myAccount.date==7&&week==0){
- this.txbool=true;
- }
- this.$refs.common.showLoading(false);
-
- }).catch(error => {
- this.$refs.common.showLoading(false,error);
- })
- }
-
- },
- mounted() {
- // document.body.style.backgroundColor = '#eee';
- },
- destroyed() {
- //document.body.style.backgroundColor = '';
- },
- onLoad(temp) {
-
- },onReady(){
- this.getMyAccount();
- }
- }
|