|
|
@ -4,13 +4,8 @@ |
|
|
|
<navbar title="提现记录" leftClick @leftClick="$utils.navigateBack" color="#fff" /> |
|
|
|
|
|
|
|
<view class="tools"> |
|
|
|
<uv-datetime-picker |
|
|
|
ref="datetimePicker" |
|
|
|
v-model="selectedTime" |
|
|
|
mode="year-month" |
|
|
|
confirmColor="#84A73F" |
|
|
|
@confirm="onTimeChange" |
|
|
|
></uv-datetime-picker> |
|
|
|
<uv-datetime-picker ref="datetimePicker" v-model="selectedTime" mode="year-month" confirmColor="#84A73F" |
|
|
|
@confirm="onTimeChange"></uv-datetime-picker> |
|
|
|
<button plain class="flex btn" @click="openTimePicker"> |
|
|
|
<text>{{ displaySelectedTime }}</text> |
|
|
|
<image class="btn-icon" src="../static/runningWater/icon-arrow.png" mode="widthFix"></image> |
|
|
@ -19,19 +14,15 @@ |
|
|
|
|
|
|
|
<view class="card list"> |
|
|
|
<template v-if="list.length"> |
|
|
|
<view class="flex list-item" |
|
|
|
v-for="(item, index) in list" |
|
|
|
:key="index" |
|
|
|
> |
|
|
|
<image class="list-item-icon" src="../static/runningWater/icon-commission.png" mode="widthFix"></image> |
|
|
|
<view class="flex list-item" v-for="(item, index) in list" :key="index"> |
|
|
|
<image class="list-item-icon" src="../static/runningWater/icon-commission.png" mode="widthFix"> |
|
|
|
</image> |
|
|
|
<view class="list-item-info"> |
|
|
|
<view class="highlight">佣金提现</view> |
|
|
|
<view>{{ item.createTime }}</view> |
|
|
|
</view> |
|
|
|
<view class="list-item-value">{{ `-${item.amount}` }}</view> |
|
|
|
<view class="uni-color-btn" |
|
|
|
@click="withdraw(item)" |
|
|
|
v-if="item.status == 0">领取</view> |
|
|
|
<view class="uni-color-btn" @click="withdraw(item)" v-if="item.status == 0">领取</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
@ -51,12 +42,12 @@ |
|
|
|
selectedTime: new Date(), |
|
|
|
|
|
|
|
x: ['+', '-', '-', '+'], |
|
|
|
mixinsListApi: "queryCashoutLog",//getWaterPageList |
|
|
|
mixinsListApi: "queryCashoutLog", //getWaterPageList |
|
|
|
beforeDate: new Date(), //开始日期 |
|
|
|
afterDate: new Date(), //结束日期 |
|
|
|
|
|
|
|
totalMoney : 0, |
|
|
|
totalWithdraw : 0, |
|
|
|
|
|
|
|
totalMoney: 0, |
|
|
|
totalWithdraw: 0, |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -74,9 +65,9 @@ |
|
|
|
|
|
|
|
// 选择了日期 |
|
|
|
handleSelectCalendars(day) { |
|
|
|
|
|
|
|
|
|
|
|
console.log(day); |
|
|
|
|
|
|
|
|
|
|
|
// let beforeDate = this.getYearMonth(day?.range?.before) |
|
|
|
// let afterDate = this.getYearMonth(day?.range?.after) |
|
|
|
// this.beforeYear = beforeDate.year; |
|
|
@ -84,8 +75,8 @@ |
|
|
|
// this.afterYear = afterDate.year; |
|
|
|
// this.afterMonth = afterDate.month; |
|
|
|
}, |
|
|
|
|
|
|
|
getDataThen(list, total, result){ |
|
|
|
|
|
|
|
getDataThen(list, total, result) { |
|
|
|
this.totalMoney = result.totalMoney |
|
|
|
this.totalWithdraw = result.totalWithdraw |
|
|
|
this.list = result.page.records |
|
|
@ -99,45 +90,82 @@ |
|
|
|
// todo |
|
|
|
console.log('--onTimeChange', e) |
|
|
|
}, |
|
|
|
withdraw(item){ |
|
|
|
requestMerchantTransferH5(item, fn) { |
|
|
|
wx.ready(function() { |
|
|
|
wx.checkJsApi({ |
|
|
|
jsApiList: ['requestMerchantTransfer'], |
|
|
|
success: function(res) { |
|
|
|
if (res.checkResult['requestMerchantTransfer']) { |
|
|
|
WeixinJSBridge.invoke('requestMerchantTransfer', { |
|
|
|
appId: this.$config.appId, |
|
|
|
mchId: this.$config.mchId, |
|
|
|
package: item.packageInfo, |
|
|
|
}, |
|
|
|
function(res) { |
|
|
|
if (res.err_msg === 'requestMerchantTransfer:ok') { |
|
|
|
// res.err_msg将在页面展示成功后返回应用时返回success,并不代表付款成功 |
|
|
|
fn && fn() |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
} else { |
|
|
|
alert('你的微信版本过低,请更新至最新版本。'); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
withdraw(item) { |
|
|
|
|
|
|
|
// #ifdef H5 |
|
|
|
|
|
|
|
this.requestMerchantTransferH5(item, () => { |
|
|
|
this.$store.commit('getUserInfo') |
|
|
|
this.$store.commit('getRiceInfo') |
|
|
|
this.$api('getMoney', { |
|
|
|
id: item.id, |
|
|
|
}).then(res => { |
|
|
|
this.getData() |
|
|
|
}) |
|
|
|
}) |
|
|
|
return |
|
|
|
// #endif |
|
|
|
|
|
|
|
// 拉起微信收款确认页面 |
|
|
|
if (!wx.canIUse('requestMerchantTransfer')) { |
|
|
|
wx.showModal({ |
|
|
|
content: '你的微信版本过低,请更新至最新版本。', |
|
|
|
showCancel: false, |
|
|
|
}); |
|
|
|
return |
|
|
|
wx.showModal({ |
|
|
|
content: '你的微信版本过低,请更新至最新版本。', |
|
|
|
showCancel: false, |
|
|
|
}); |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 在真机环境中,调用API |
|
|
|
wx.requestMerchantTransfer({ |
|
|
|
mchId: this.$config.mchId, |
|
|
|
appId: wx.getAccountInfoSync().miniProgram.appId, |
|
|
|
package: item.packageInfo, |
|
|
|
success: (res) => { |
|
|
|
uni.showToast({ |
|
|
|
title: '提现申请已提交', |
|
|
|
icon: 'success' |
|
|
|
}) |
|
|
|
this.$store.commit('getUserInfo') |
|
|
|
appId: wx.getAccountInfoSync().miniProgram.appId, |
|
|
|
mchId: this.$config.mchId, |
|
|
|
package: item.packageInfo, |
|
|
|
success: (res) => { |
|
|
|
this.$store.commit('getUserInfo') |
|
|
|
this.$store.commit('getRiceInfo') |
|
|
|
|
|
|
|
|
|
|
|
this.$api('getMoney', { |
|
|
|
id : item.id, |
|
|
|
id: item.id, |
|
|
|
}).then(res => { |
|
|
|
this.getData() |
|
|
|
}) |
|
|
|
}, |
|
|
|
fail: (res) => { |
|
|
|
console.log('fail:', res); |
|
|
|
uni.showToast({ |
|
|
|
title: '提现失败,请稍后再试', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
}, |
|
|
|
complete: (res) => { |
|
|
|
console.log('requestMerchantTransfer完成:', res); |
|
|
|
} |
|
|
|
}, |
|
|
|
fail: (res) => { |
|
|
|
console.log('fail:', res); |
|
|
|
uni.showToast({ |
|
|
|
title: '提现失败,请稍后再试', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
}, |
|
|
|
complete: (res) => { |
|
|
|
console.log('requestMerchantTransfer完成:', res); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
} |
|
|
@ -148,13 +176,13 @@ |
|
|
|
.page { |
|
|
|
background-color: $uni-bg-color; |
|
|
|
min-height: 100vh; |
|
|
|
|
|
|
|
|
|
|
|
/deep/ .nav-bar__view { |
|
|
|
background-image: linear-gradient(#84A73F, #D8FF8F); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.uni-color-btn{ |
|
|
|
|
|
|
|
.uni-color-btn { |
|
|
|
padding: 10rpx 20rpx; |
|
|
|
margin: 0; |
|
|
|
font-size: 26rpx; |
|
|
@ -179,7 +207,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.list { |
|
|
|
margin: 9rpx 13rpx; |
|
|
|
padding: 31rpx 20rpx; |
|
|
|