jiangping
2025-07-18 ecd27a09017e33598070ccdcfaf67e579c860348
前端
已修改4个文件
56 ■■■■ 文件已修改
small-program/pages/balance-details/balance-details.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
small-program/pages/mine/mine.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
small-program/pages/withdrawal/withdrawal.vue 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
small-program/utils/http.api.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
small-program/pages/balance-details/balance-details.vue
@@ -34,6 +34,9 @@
                    { name: '收入', id: 2 },
                    { name: '支出', id: 3 }
                ],
                capacity:10,
                page:1,
                list:[]
            };
        },
        methods: {
small-program/pages/mine/mine.vue
@@ -28,7 +28,7 @@
                    </view>
                    <view class="info-box-label">账户余额</view>
                    <view class="info-box-price">
                        <text>¥{{isLogin?(userInfo.amount || 0) :0.00}}</text>
                        <text>¥{{isLogin?((userInfo.amount|| 0)/100).toFixed(2) :0.00}}</text>
                        <view class="info-box-price-btn" @click="jump(6)">去提现</view>
                    </view>
                </view>
small-program/pages/withdrawal/withdrawal.vue
@@ -3,7 +3,7 @@
        <view class="tx-content">
            <view class="tx-content-title">可提现余额(元)</view>
            <view class="tx-content-price">
                <text>1000.00</text>
                <text>{{((userInfo.amount|| 0)/100).toFixed(2)}}</text>
                <view class="tx-content-price-btn" @click="jump">余额明细</view>
            </view>
            <view class="content">
@@ -16,10 +16,10 @@
                    <view class="content-input-icon">
                        <image src="/static/icon/ic_money@2x.png" mode="widthFix"></image>
                    </view>
                    <input type="number" placeholder="请输入提现金额" />
                    <view class="content-input-btn">全部提现</view>
                    <input type="number" v-model="amount" @input="changeAmount" placeholder="请输入提现金额" />
                    <view class="content-input-btn" @click="inputAll">全部提现</view>
                </view>
                <view class="content-tips">输入的金额已经超过可提现金额</view>
                <view class="content-tips">{{tips}}</view>
                <view class="content-button" @click="submit">2小时到账,确认提现</view>
            </view>
        </view>
@@ -27,10 +27,16 @@
</template>
<script>
    import { mapState } from 'vuex'
    export default {
        computed: {
            ...mapState(['userInfo' ])
        },
        data() {
            return {
                tips:'',//
                changing1:false,
                amount: null
            };
        },
        methods: {
@@ -39,11 +45,44 @@
                    url: '/pages/balance-details/balance-details'
                })
            },
            inputAll(){
                this.amount = ((this.userInfo.amount|| 0)/100).toFixed(2)
            },
            changeAmount(){
                this.tips=''
            },
            submit() {
                  if(this.changing1){
                        return
                  }
                  this.changing1 = true
                  if(this.amount == null || this.amount<=0){
                      this.tips = '提交金额必须大于0,至少提现0.1元'
                      this.changing1 = false
                      return
                  }
                  if(this.amount *100 > this.userInfo.amount){
                      this.tips = '输入的金额已经超过可提现金额'
                      this.changing1 = false
                      return
                  }
                  this.changing1 = true
                  var that = this
                  var param ={amount:this.amount }
                  that.$u.api.applyWithdrawal(param)
                  .then(res =>{
                        if(res.code ===200){
                uni.navigateTo({
                    url: '/pages/withdrawal-successful/withdrawal-successful'
                })
            }
                   }).finally(() => {
                        that.changing1 = false
                        that.tips=''
                        that.amount =null
                    })
            },
        }
    }
</script>
small-program/utils/http.api.js
@@ -31,11 +31,13 @@
    let logOff = (params = {}) => vm.$u.http.get('web/account/logOff', { params });    // 退出登录
    let getPlatformAboutUs = (params = {}) => vm.$u.http.get('web/user/getPlatformAboutUs', { params });    // 获取系统配置
    let getTotal = (data = {}) => vm.$u.http.post('web/orders/getTotal', data);    // 获取预计金额(分)
    let applyWithdrawal = (data = {}) => vm.$u.http.post('web/user/applyWithdrawal', data);    // 提现申请
    let upload = (data = {}) => vm.$u.http.post('web/public/upload', data);    // 上传 
         
    vm.$u.api = {
        wxLogin,
        logOff,
        applyWithdrawal,
        getPlatformAboutUs,
        wxAuthPhone,
        applyForIdentity,