Browse Source

基础提现代码

master
前端-胡立永 2 weeks ago
parent
commit
86cc1da01b
4 changed files with 77 additions and 7 deletions
  1. +5
    -0
      api/model/index.js
  2. +3
    -3
      components/userShop/userShopCommission.vue
  3. +1
    -1
      config.js
  4. +68
    -3
      pages_order/mine/runningWater.vue

+ 5
- 0
api/model/index.js View File

@ -162,6 +162,11 @@ const api = {
url: '/index/getAddOrderInfo', url: '/index/getAddOrderInfo',
method: 'GET', method: 'GET',
}, },
// 领取提现
requestMerchantTransfer: {
url: '/info/requestMerchantTransfer',
method: 'POST',
},
} }
export default api export default api

+ 3
- 3
components/userShop/userShopCommission.vue View File

@ -37,13 +37,13 @@
return { return {
list : [ list : [
{ {
name : '余额记录',
name : '收入记录',
}, },
{ {
name : '提现记录',
name : '支出记录',
}, },
{ {
name : '积分记录',
name : '提现记录',
}, },
], ],
}; };


+ 1
- 1
config.js View File

@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI); Vue.use(uvUI);
// 当前环境 // 当前环境
const type = 'prod'
const type = 'local'
// 环境配置 // 环境配置


+ 68
- 3
pages_order/mine/runningWater.vue View File

@ -40,10 +40,39 @@
</view> </view>
<view class="tab-box"> <view class="tab-box">
<view class="tab-box1" v-if="agentFlow.records.length>0 && agentFlow.total>0">
<!-- <view class="tab-box1" v-if="agentFlow.records.length>0 && agentFlow.total>0">
<uv-cell center border :title="item.title" v-for="(item, index) in agentFlow.records" :key="item.id" <uv-cell center border :title="item.title" v-for="(item, index) in agentFlow.records" :key="item.id"
:value="x[item.type] + item.money" :label="item.createTime" /> :value="x[item.type] + item.money" :label="item.createTime" />
</view> -->
<view class="tab-box1" v-if="agentFlow.records.length>0 && agentFlow.total>0">
<uv-cell center border
:key="item.id"
:title="item.title" v-for="(item, index) in agentFlow.records"
:label="item.createTime">
<template #value>
<view class="info">
<view class="price">
{{ x[item.type] + (item.money) }}
</view>
<view class="uni-color-btn"
@click="requestMerchantTransfer(item)"
v-if="item.type == 2 && item.status == 1"
>
领取 <text v-if="item.money">{{ item.money }}</text>
</view>
<view class="status"
v-else-if="item.state_dictText">
{{ item.state_dictText }}<text v-if="item.money">到账 {{ item.money }}</text>
</view>
</view>
</template>
</uv-cell>
</view> </view>
<view style="padding: 100rpx 0;" v-else> <view style="padding: 100rpx 0;" v-else>
<uv-empty mode="history" textSize="28rpx" iconSize="100rpx" /> <uv-empty mode="history" textSize="28rpx" iconSize="100rpx" />
</view> </view>
@ -74,7 +103,7 @@
year: '', year: '',
month: '' month: ''
}, },
title: ['余额记录', '提现记录', '积分记录'],
title: ['收入记录', '支出记录'],
agentFlow: { agentFlow: {
total: 1, total: 1,
records: [] records: []
@ -175,7 +204,34 @@
this.queryParams.month = ''; this.queryParams.month = '';
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.getAgentFlow(); this.getAgentFlow();
}
},
requestMerchantTransfer(item) {
if (!wx.canIUse('requestMerchantTransfer')) {
wx.showModal({
content: '你的微信版本过低,请更新至最新版本。',
showCancel: false,
});
return
}
wx.requestMerchantTransfer({
mchId: '1673516176',//
appId: wx.getAccountInfoSync().miniProgram.appId,
package: item.packageInfo,
success: (res) => {
// res.err_msgok
console.log('success:', res);
this.getAgentFlow()
this.$api('requestMerchantTransfer', {
id : item.id,
})
},
fail: (res) => {
console.log('fail:', res);
this.getAgentFlow()
},
});
},
} }
} }
</script> </script>
@ -287,5 +343,14 @@
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
} }
.uni-color-btn{
background: $uni-color;
color: #fff;
text-align: center;
margin: 0;
border-radius: 10rpx;
padding: 6px;
font-size: 22rpx;
}
} }
</style> </style>

Loading…
Cancel
Save