| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <template>
- <view class="cash-out-box">
- <view style="color:#666;font-size: 32rpx;">
- 提现申请需要审核,请耐心等待,注意查收微信红包。
- </view>
-
- <view class="cash-input-box">
- <text>¥</text>
- <input type="number" v-model="money">
- </view>
-
- <view class="all-cash-out-box">
- <text>当前积分为{{userInfoObj.scorenumber || '0'}},可抵现金{{userInfoObj.nowmoney || '0'}},</text>
- <text style="color: #1a9ed3;" @click.stop="getAll">全部提现</text>
- </view>
-
- <button type="primary" @click="getCash">提现</button>
-
- </view>
- </template>
- <script>
- var md5 = require('../../../../common/md5.js')
- export default {
- data() {
- return {
- money:'',
- userInfoObj:{},
- };
- },
- onLoad() {
- },
- onShow() {
- this.getUserInfo();
- },
- methods: {
- getUserInfo(){
- let that = this;
- uni.request({
- url: getApp().globalData.shareUrl, //需要设置为全局
- method: 'POST',
- header: {
- 'content-type': 'application/x-www-form-urlencoded'
- },
- data: {
- method: 'getUserInfo',
- timestamp: getApp().globalData.globalTimestamp, //Date.now()
- uid:getApp().globalData.user_id,
- sign: md5('getUserInfo' + getApp().globalData.globalTimestamp)
- },
- success: res => {
- if (res.data.code === 200) {
- that.userInfoObj = res.data.msg
- }
- }
- });
- },
- getCash(){
- let that = this;
- if(that.money > 0 && that.money <= that.userInfoObj.nowmoney){
- uni.request({
- url: getApp().globalData.shareUrl, //需要设置为全局
- method: 'POST',
- header: {
- 'content-type': 'application/x-www-form-urlencoded'
- },
- data: {
- method: 'tixian',
- timestamp: getApp().globalData.globalTimestamp, //Date.now()
- uid:getApp().globalData.user_id,
- num:that.money,
- sign: md5('tixian' + getApp().globalData.globalTimestamp)
- },
- success: res => {
- if (res.data.code === 200) {
- uni.showToast({
- title:'递交已申请',
- icon: 'none',
- duration:2000
- });
- that.money = 0;
- that.getUserInfo();
- }else{
- uni.showToast({
- title: res.data.msg,
- icon: 'none',
- duration:2000
- });
- }
- }
- });
- }else {
- that.money = '';
- uni.showToast({
- title: '可提现金额不足,请重新填写',
- icon: 'none',
- duration:3000
- });
- }
-
- },
- getAll(){
- this.money = this.userInfoObj.nowmoney
- }
- }
- };
- </script>
- <style>
- .cash-out-box {
- width: 85%;
- height: 600rpx;
- background: #fff;
- border-radius: 15rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- margin: 5% auto;
- padding: 15px;
- }
- .cash-input-box {
- width: 100%;
- margin-top: 5%;
- border-bottom: 1px solid #dbdbdb;
- display: flex;
- align-items: center;
- height: 80rpx;
- }
- .cash-input-box text {
- margin-right: 2%;
- }
- .all-cash-out-box {
- margin-top: 3%;
- font-size: 28rpx;
- width: 99%;
- color: #999;
- }
- .cash-out-box button {
- background: #1a9ed3;
- color: #fff;
- width: 99%;
- margin-top: 5%;
- }
- </style>
|