18 Commits

  1. 35
      src/pages.json
  2. 40
      src/pages/index/index.vue
  3. 2
      src/pages/login/login.vue
  4. 2
      src/pages/merchant_login/merchant_login.vue
  5. 12
      src/pages/web_view/web_view.vue
  6. BIN
      src/static/images/icon/index/tab_11.png
  7. BIN
      src/static/images/icon/index/tab_12.png
  8. 3
      src/store/index.js
  9. 2
      src/subpackage/order/pages/value_card/detail/detail.vue
  10. 1
      src/subpackage/party/components/popup-content/miniapp-change-category.vue
  11. 19
      src/subpackage/party/pages/index/index.vue
  12. 3
      src/subpackage/party/pages/index/web_view.vue
  13. 38
      src/subpackage/party/pages/login/regist.vue
  14. BIN
      src/subpackage/party/static/index/icon-copy.png
  15. 219
      src/subpackage/wallet/components/bf_withdraw.vue
  16. 132
      src/subpackage/wallet/components/filtrate_bar.vue
  17. 47
      src/subpackage/wallet/components/record_line.vue
  18. 22
      src/subpackage/wallet/components/wallet_mask.vue
  19. 63
      src/subpackage/wallet/components/wallet_modal.vue
  20. 68
      src/subpackage/wallet/components/wallet_modal_success.vue
  21. 31
      src/subpackage/wallet/components/wm_button.vue
  22. 13
      src/subpackage/wallet/js/api.js
  23. 1
      src/subpackage/wallet/js/bank.js
  24. 10
      src/subpackage/wallet/js/server.js
  25. 122
      src/subpackage/wallet/pages/baofu_withdraw/index.vue
  26. 246
      src/subpackage/wallet/pages/baofu_withdraw/modules/baofu_item.vue
  27. 324
      src/subpackage/wallet/pages/douyin_withdraw/apply.vue
  28. 114
      src/subpackage/wallet/pages/douyin_withdraw/index.vue
  29. 151
      src/subpackage/wallet/pages/douyin_withdraw/record.vue
  30. 110
      src/subpackage/wallet/pages/index/index.vue
  31. 139
      src/subpackage/wallet/pages/index/modules/wallet_info.vue
  32. BIN
      src/subpackage/wallet/static/images/arrow_b2.png
  33. BIN
      src/subpackage/wallet/static/images/arrow_c33.png
  34. BIN
      src/subpackage/wallet/static/images/close.png
  35. BIN
      src/subpackage/wallet/static/images/dy_logo.png
  36. BIN
      src/subpackage/wallet/static/images/filter.png
  37. BIN
      src/subpackage/wallet/static/images/question_mark.png
  38. BIN
      src/subpackage/wallet/static/images/success_tip.png
  39. 61
      src/utils/util.js

35
src/pages.json

@ -714,6 +714,41 @@
]
},
{
"root": "subpackage/wallet",
"pages": [
{
"path": "pages/index/index",
"style" : {
"navigationBarTitleText": "钱包&提现"
}
},
{
"path": "pages/douyin_withdraw/index",
"style" : {
"navigationBarTitleText": "抖音提现"
}
},
{
"path": "pages/douyin_withdraw/apply",
"style" : {
"navigationBarTitleText": "申请提现"
}
},
{
"path": "pages/douyin_withdraw/record",
"style" : {
"navigationBarTitleText": "提现记录"
}
},
{
"path": "pages/baofu_withdraw/index",
"style" : {
"navigationBarTitleText": "新宝付提现"
}
}
]
},
{
"root": "subpackage/party",
"pages": [
{

40
src/pages/index/index.vue

@ -36,7 +36,7 @@
</view>
</view>
<view class="ic-tabs" v-if="indexData&&indexData.permission">
<block v-for="e in tabList" :key="e.id">
<block v-for="(e, i) in tabList" :key="i">
<view class="it-item" @click="toPageInfo(e)" v-if="isPermissionShowTab(e)">
<view>
<image mode="aspectFit" :src="'/static/images/icon/index/tab_'+ e.id + '.png'"></image>
@ -138,18 +138,12 @@
path: '/subpackage/retail/pages/index/index',
serverKey: 1011 //
},
{
id: 8,
name: '课程管理',
path: '/subpackage/course/pages/index/index',
serverKey: 1013 // 1013
},
{//ICON
id: 11,
name: '系统工具',
path: '/subpackage/party/pages/index/index',
serverKey: 1015 // 1015
},
// {
// id: 8,
// name: '',
// path: '/subpackage/course/pages/index/index',
// serverKey: 1013 // 1013
// },
{
id: 9,
name: '储值卡管理',
@ -162,7 +156,19 @@
path: '/subpackage/blacklist/pages/abnormal_list/abnormal_list',
serverKey: 1015 // 1015
},
{
id: 11,
name: '钱包提现',
path: '/subpackage/wallet/pages/index/index',
serverKey: 1017 // 1017
},
{//ICON
id: 12,
name: '系统工具',
path: '/subpackage/party/pages/index/index',
serverKey: 1016 // 1016
},
];
const app = getApp();
@ -244,8 +250,10 @@
brandInfo: indexData&&indexData.brand ? indexData.brand : null,
});
}
if(tabInfo.id === 10)return util.routeTo(tabInfo.path + `?brand_id=${indexData.brand.id}`,'nT');
if(tabInfo.id === 11){
if(tabInfo.id === 10 || tabInfo.id === 11)return util.routeTo(tabInfo.path + `?brand_id=${indexData.brand.id}`,'nT');
if(tabInfo.id === 12){
// if(!indexData.brand.mini_wechat_appid)return util.showNone('appid')
let url = tabInfo.path + `?appid=${indexData.brand.mini_wechat_appid}`
console.log(222,url)

2
src/pages/login/login.vue

@ -189,7 +189,7 @@ export default {
}
},
toWebView(){
util.routeTo(`/pages/web_view/web_view`,'rL');
util.routeTo(`/pages/web_view/web_view?src=${encodeURIComponent("https://www.ouxuanzhineng.cn")}`,'rL');
}
},
}

2
src/pages/merchant_login/merchant_login.vue

@ -12,7 +12,7 @@ import util from '../../utils/util'
export default {
methods: {
toWebView(){
util.routeTo(`/pages/web_view/web_view`,'rL');
util.routeTo(`/pages/web_view/web_view?src=${encodeURIComponent("https://www.ouxuanzhineng.cn")}`,'rL');
}
}
}

12
src/pages/web_view/web_view.vue

@ -1,10 +1,16 @@
<template>
<web-view src="https://www.ouxuanzhineng.cn"></web-view>
<web-view :src="address"></web-view>
</template>
<script>
export default {
onLoad(){
data(){
return {
address: ''
}
},
onLoad(options){
console.log('web_view options', options);
this.address = decodeURIComponent(options?.src || 'https://www.ouxuanzhineng.cn');
}
}
</script>

BIN
src/static/images/icon/index/tab_11.png

Before

Width: 52  |  Height: 52  |  Size: 2.4 KiB

After

Width: 52  |  Height: 52  |  Size: 792 B

BIN
src/static/images/icon/index/tab_12.png

After

Width: 52  |  Height: 52  |  Size: 2.4 KiB

3
src/store/index.js

@ -40,9 +40,10 @@ export default new Vuex.Store({
'1009': '场地管理',
'1010': '设备管理',
'1011': '商品零售',
'1013': '课程管理',
// '1013': '课程管理',
'1014': '储值卡管理',
'1015': '进场人数异常',
'1017': '钱包提现'
},
// 场地占用提交页面信息
occupyInfo: {

2
src/subpackage/order/pages/value_card/detail/detail.vue

@ -109,7 +109,7 @@
<view class="vi-box">
<view class="vb-btn" @click="deductAmount--"></view>
<view class="vb-ipt">
<input v-model="deductAmount" type="number" />
<input v-model="deductAmount" type="digit" />
</view>
<view class="vb-btn" @click="deductAmount++"></view>
</view>

1
src/subpackage/party/components/popup-content/miniapp-change-category.vue

@ -366,6 +366,7 @@ export default {
let {exterList} = this
exterList[i].url = await this.getLocalImg();
console.log("clickUploadImg-local:", exterList[i].url)
exterList[i].mediaid = await this.getUploadImgMediaId(exterList[i].url);
console.log("clickUploadImg-mediaid:", exterList[i].mediaid)

19
src/subpackage/party/pages/index/index.vue

@ -14,6 +14,7 @@
<text class="b-t-white b-t-24 p-index-2">复制到电脑端打开</text>
<text class="b-t-white b-t-24 p-index-2 b-ellipsis-1">{{getManagerUrl.show}}</text>
<image class="pb-bg" src="../../static/index/p-bg-1.png"></image>
<image class="pb-icon-copy" src="../../static/index/icon-copy.png"></image>
</view>
</view>
@ -26,7 +27,7 @@
<view class="p-box b-flex-x b-flex-b">
<view class="b-flex-y b-flex-c" @click="toMiniApp">
<text class="b-t-white b-t-24 p-index-2">访问手机端</text>
<text class="b-t-white b-t-24 p-index-2">访问教练助手小程序</text>
<image class="pb-img-arrow-white b-mt-20 p-index-2" src="../../static/index/p-arrow-white.png"></image>
<image class="pb-bg" src="../../static/index/p-bg-1.png"></image>
</view>
@ -34,6 +35,7 @@
<text class="b-t-white b-t-24 p-index-2">复制到电脑端打开</text>
<text class="b-t-white b-t-24 p-index-2">{{getShouyingUrl.show}}</text>
<image class="pb-bg" src="../../static/index/p-bg-1.png"></image>
<image class="pb-icon-copy" src="../../static/index/icon-copy.png"></image>
</view>
</view>
<view class="p-tip">可在后台设置教练账户</view>
@ -244,6 +246,10 @@
data: url,
success: function () {
util.showNone('复制成功')
},
fail:function(e){
console.error("剪切板调用失败:",e)
util.showNone(e)
}
});
},
@ -292,7 +298,7 @@
font-size: 24rpx;
color: #9A9A9D;
margin-top: 25rpx;
padding-left: 60rpx;
padding-left: 30rpx;
width: 100%;
}
.p-box-title-2{
@ -304,6 +310,7 @@
.p-box{
width: 670rpx;
overflow: hidden;
position: relative;
>view{
width: 320rpx;
height: 176rpx;
@ -325,6 +332,14 @@
width: 47.76rpx;
height: 48.08rpx;
}
.pb-icon-copy{
width: 24rpx;
height: 24rpx;
z-index:5;
position:absolute;
top:18rpx;
right:18rpx;
}
}
}
}

3
src/subpackage/party/pages/index/web_view.vue

@ -7,14 +7,13 @@ import { API,ORIGIN } from '@/js/api';
export default {
data() {
return {
url: 'https://testadmin.ouxuanzhineng.cn/'
url: ''
}
},
onLoad(opt){
console.log('web_view',opt,ORIGIN)
this.url = opt.url
}
}

38
src/subpackage/party/pages/login/regist.vue

@ -448,6 +448,7 @@
let ocr_type = 'BizLicenseOCR'
console.log("clickUploadImg");
let img = await this.getLocalImg();
let img_info = await util.checkFileInfo(img)
console.log("getLocalImg:", img)
let img_url = await this.getUploadImgURL(img);
console.log("getUploadImgURL:", img_url)
@ -458,11 +459,13 @@
this.setOcrResult(ocr_type,ocr_res)
this.submitData.business_license = img_url
},
// IDCardOCR
async clickUploadIDCardImg() {
let ocr_type = 'IDCardOCR'
console.log("clickUploadIDCardImg");
let img = await this.getLocalImg();
let img_info = await util.checkFileInfo(img)
console.log("getLocalImg:", img)
let img_url = await this.getUploadImgURL(img);
console.log("getUploadImgURL:", img_url)
@ -476,6 +479,7 @@
async clickUploadIDCardBackImg() {
console.log("clickUploadIDCardBackImg");
let img = await this.getLocalImg();
let img_info = await util.checkFileInfo(img)
console.log("getLocalImg:", img)
let img_url = await this.getUploadImgURL(img);
console.log("getUploadImgURL:", img_url)
@ -553,8 +557,14 @@
this.submitData.mailing_address = res.Response.Address;
this.submitData.extension.legal_person_name = res.Response.Person;
this.submitData.agency_code = res.Response.RegNum;
const t = this.company_types.find(item => item.label === res.Response.Type);
this.submitData.extension.company_type = t.value;
// <<<<<<< HEAD
// const t = this.company_types.find(item => item.label === res.Response.Type);
// if(t&&t.value)this.submitData.extension.company_type = t.value; //
// =======
// const t = this.company_types.find(item => item.label === res.Response.Type);
// this.submitData.extension.company_type = t.value;
// >>>>>>> dev
if (res.Response.Capital) {
const num = res.Response.Capital.split('元')[0]
this.submitData.extension.registered_capital = this.chineseToNumber(num)
@ -574,7 +584,7 @@
this.submitData.extension.credit_end_date = `${year}-${month}-${day}`
}
}
if(res.Response.Type){
if(res.Response.Type){//,
let _index = ""
const t = this.company_types.find((item,index) => {
if(item.label === res.Response.Type){
@ -583,9 +593,25 @@
return item
}
});
this.submitData.extension.company_type = t.value
this.company_type_index = _index
this.company_type_show = this.company_types_arr[_index]
// <<<<<<< HEAD
// if(t&&t.value){
// this.submitData.extension.company_type = t.value
// this.company_type_index = _index
// this.company_type_show = this.company_types_arr[_index]
// }
// =======
// console.log("t", t)
if(t){
this.submitData.extension.company_type = t.value
this.company_type_index = _index
this.company_type_show = this.company_types_arr[_index]
util.showNone("信息已填充,请二次确认证件信息")
}else{
console.log("OCR对应的企业类型无法匹配:",this.company_types, res.Response.Type)
util.showNone("请手动选择[企业类型],并二次确认证件信息")
}
// >>>>>>> dev
}
} else {
this.submitData.extension.business_id_card = res.Response.IdNum

BIN
src/subpackage/party/static/index/icon-copy.png

After

Width: 48  |  Height: 52  |  Size: 724 B

219
src/subpackage/wallet/components/bf_withdraw.vue

@ -0,0 +1,219 @@
<template>
<wallet-modal title="提现" :show="isShow" @click:close="hide">
<view class="bf-withdraw">
<view class="bw-txt">{{ companyInfo.name || '' }}</view>
<view class="bw-txt">
可提现资金
<text class="bt-price">{{ accountInfo.availableBal || 0 }}</text>
</view>
<input type="digit" class="bw-ipt" v-model="extractNum" placeholder="请输入金额">
<view class="dwa-tip">
<view class="dt-tit">温馨提示</view>
<view class="dt-desc">1. 提现一般当天到账具体以银行到账时间为准</view>
<view class="dt-desc">2. 每提现一次(不限提现金额)收取0.5元手续费</view>
</view>
<view class="dwa-btn">
<wm-button green @click='confirmExtract'>确认提现</wm-button>
</view>
</view>
</wallet-modal>
</template>
<script>
import walletModal from './wallet_modal.vue';
import wmButton from './wm_button.vue';
import { WALLET_API } from '../js/api';
import servers from '../js/server';
import { showNone, showLoad, hideLoad, debounce } from '@/utils/util'
export default {
components: {
'wallet-modal': walletModal,
'wm-button': wmButton
},
data(){
return {
isShow: false,
accountInfo: {},
extractNum: '',
companyInfo: {
/**
* name, -> 公司名称
* account -> 账户账号
* type -> 1(个人)/ 2(企业)
* index -> 当前账户索引
*/
}
}
},
methods: {
confirmExtract: debounce(async function(){
let { companyInfo, accountInfo, extractNum } = this;
if(!this.checkExtractNum({ availableBal: accountInfo?.availableBal, extractNum }))return;
try{
showLoad();
let _operateInfo = await this.setPriceInfo({
contractNo: companyInfo?.account ?? '',
dealAmount: extractNum
})
hideLoad();
// showNone(_operateInfo?.transRemark || '');
this.hide();
this.$emit('click:extract', companyInfo.index);
}catch(err){
hideLoad();
let _errMsg = err?.message || err?.data?.transRemark || err?.data?.errorMsg || '提现失败!';
showNone(_errMsg);
console.warn('confirmExtract catch error: ', err);
}
}, 300, true),
/**
* @param {String} availableBal 可提现金额
* @param {String} extractNum 提现金额
* @returns {Boolean}
*/
checkExtractNum({ availableBal, extractNum }){
let _num = +extractNum || 0;
if(!extractNum){
showNone('请输入提现金额!');
return false;
}
if(_num <= 0){
showNone('提现金额必须大于0!');
return false;
}
if(_num > +availableBal){
showNone('提现金额不能大于可提现金额!');
return false;
}
return true;
},
/**
* @param {String} account 宝付V2账户
* @param {String} type '1'->个人 / '2'->企业
* @param {String} name 公司名
*/
async alert({ account, type, name, index }){
if(!account)return showNone('账户号不存在!');
this.companyInfo = { account, type, name, index };
try{
showLoad();
let _accountInfo = await this.getPriceInfo({
accType: type,
contractNo: account
})
hideLoad();
this.isShow = true;
}catch(err){
hideLoad();
let _errMsg = err?.message || err?.data?.errorMsg || '获取账户信息失败!';
showNone(_errMsg);
console.warn('alert catch error: ', err);
}
},
hide(){
this.isShow = false
},
//
getPriceInfo({ accType, contractNo }){
return this.baofuV2PriceOperate({
service: 'T-1001-013-06',
query: { accType, contractNo }
})
.then(res=>{
if(res?.data?.errorCode === 'SUCCESS'){
return this.accountInfo = res?.data || {};
}else{
return Promise.reject(res)
}
})
},
//
setPriceInfo({ contractNo, dealAmount }){
return this.baofuV2PriceOperate({
service: 'T-1001-013-14',
query: {
contractNo: contractNo,
feeMemberId: contractNo,
transSerialNo: `TX${new Date().getTime()}`, //
dealAmount: dealAmount
}
})
.then(res=>{
if(res?.data.state === 1){
return res?.data || {};
}else{
return Promise.reject(res)
}
})
},
/**
* @param {String} service 查询 -> T-1001-013-06 / 提现 -> T-1001-013-14
* @param {String} api 接口 默认 '/'
* @param {Object} query 操作参数
* @param {String} version 版本 默认 '4.0.0'
* @returns {Promise}
*
* */
baofuV2PriceOperate({ service = 'T-1001-013-06', api = '/', query, version = '4.0.0' }){
return servers.post({
url: WALLET_API.baofuV2Gateway,
data: {
service: service,
api: api,
data: {
...query,
version: version
}
},
isDefaultGet: false
})
.then(res=>{
let _data = res?.data;
if(_data.code === 0&&_data.data.retCode === 1){
return _data || {};
}else{
return Promise.reject(_data || {})
}
})
}
}
}
</script>
<style lang="scss">
.bf-withdraw{
padding: 56upx 50upx 0upx;
.bw-txt{
@include flcw(28upx, 48upx, #1A1A1A);
.bt-price{
color: $mColor;
}
}
.bw-ipt{
box-sizing: border-box;
width: 100%;
margin-top: 28upx;
height: 108upx;
border-radius: 10upx;
padding: 0 20upx;
font-size: 32upx;
color: #1A1A1A;
background: #F2F2F7;
}
.dwa-tip{
margin-top: 18upx;
.dt-tit{
@include flcw(24upx, 44upx, #9A9A9D);
}
.dt-desc{
@include flcw(24upx, 44upx, #1A1A1A);
}
}
.dwa-btn{
margin-top: 62upx;
@include ctf(center);
}
}
</style>

132
src/subpackage/wallet/components/filtrate_bar.vue

@ -0,0 +1,132 @@
<template>
<view class="time-selection">
<view class="ts-left">
<picker class="tl-class" mode="date" @change="startDateChange" :value="startDate">
<view class="tl-frame">
<input type="text" class="tf-time" disabled :value="startDate">
<image class="tf-icon" mode="aspect" src="/subpackage/wallet/static/images/arrow_c33.png"></image>
</view>
</picker>
<view class="tl-txt"></view>
<picker class="tl-class" mode="date" @change="endDateChange" :value="endDate">
<view class="tl-frame">
<input type="text" class="tf-time" disabled :value="endDate">
<image class="tf-icon" mode="aspect" src="/subpackage/wallet/static/images/arrow_c33.png"></image>
</view>
</picker>
</view>
<view class="ts-right" @click="filterBtn">
<text class="tr-txt">筛选</text>
<image class="tr-icon" mode="aspect" src="/subpackage/wallet/static/images/filter.png"></image>
</view>
</view>
</template>
<script>
import { formatDate, showNone } from '@/utils/util';
export default {
props: {
filterList: {
type: Array,
default: () => ['全部', '待处理', '已处理']
}
},
data(){
return {
startDate: '',
endDate: ''
}
},
created(){
this.initDate({});
},
methods: {
initDate({ startDate, endDate }){
let _date = new Date();
this.startDate = startDate ?? formatDate({ date: new Date(_date.setFullYear(_date.getFullYear() - 1))});
this.endDate = endDate ?? formatDate({});
},
getTimes(){
return { startDate: this.startDate, endDate: this.endDate };
},
startDateChange(e){
this.startDate = e.detail.value;
this.emitTimes();
},
endDateChange(e){
this.endDate = e.detail.value;
this.emitTimes();
},
emitTimes(){
let { startDate, endDate } = this;
if(!startDate || !endDate)return;
let _sdTimestamp = new Date(startDate.replace(/-/g, '/')).getTime();
let _edTimestamp = new Date(endDate.replace(/-/g, '/')).getTime();
if(_sdTimestamp > _edTimestamp){
showNone('开始时间不能大于结束时间');
return;
}
this.$emit('change:times', { startDate, endDate });
},
filterBtn(){
uni.showActionSheet({
itemList: this.filterList,
success: (res) => {
this.$emit('change:filter', res.tapIndex);
}
})
}
}
}
</script>
<style lang="scss">
.time-selection{
padding: 26upx 24upx;
background: #fff;
@include ctf(space-between);
.ts-left{
@include ctf;
.tl-class{
flex-shrink: 0;
}
.tl-frame{
flex-shrink: 0;
padding: 0 16upx;
height: 92upx;
width: 240upx;
border-radius: 10upx;
background: #F2F2F7;
@include ctf(space-between);
.tf-time{
flex-grow: 1;
box-sizing: border-box;
height: 100%;
@include flcw(28upx, 40upx, #1A1A1A);
}
.tf-icon{
margin-left: 4upx;
flex-shrink: 0;
width: 20upx;
height: 20upx;
}
}
.tl-txt{
margin: 0 18upx;
@include flcw(32upx, 44upx, #1A1A1A);
}
}
.ts-right{
@include ctf(flex-end);
.tr-txt{
margin-right: 12upx;
@include flcw(28upx, 40upx, #9C9C9F);
}
.tr-icon{
flex-shrink: 0;
width: 40upx;
height: 40upx;
}
}
}
</style>

47
src/subpackage/wallet/components/record_line.vue

@ -0,0 +1,47 @@
<template>
<veiw class="record-line">
<veiw class="rl-name">{{ name }}</veiw>
<view class="rl-value"><slot></slot></view>
<view class="rl-tag" v-if="tag">{{ tag }}</view>
</veiw>
</template>
<script>
export default {
props: {
name: {
type: String,
default: ''
},
tag: {
type: String,
default: ''
}
}
}
</script>
<style lang="scss">
.record-line{
display: flex;
justify-content: space-between;
align-items: baseline;
.rl-name{
flex-shrink: 0;
flex-grow: 0;
@include flcw(28upx, 56upx, #9A9A9D);
}
.rl-value{
flex-grow: 1;
@include flcw(28upx, 56upx, #1A1A1A);
@include tHide(2);
}
.rl-tag{
flex-shrink: 0;
flex-grow: 0;
margin-left: 10upx;
@include flcw(28upx, 56upx, #1A1A1A);
}
}
</style>

22
src/subpackage/wallet/components/wallet_mask.vue

@ -0,0 +1,22 @@
<template>
<view class="wallet-mask">
</view>
</template>
<script>
export default {
}
</script>
<style lang="scss">
.wallet-mask{
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba($color: #000000, $alpha: .5);
}
</style>

63
src/subpackage/wallet/components/wallet_modal.vue

@ -0,0 +1,63 @@
<template>
<view class="wallet-mask" v-show="show">
<view class="wm-content">
<image
class="wc-close"
@click="$emit('click:close')"
mode="aspect"
src="/subpackage/wallet/static/images/close.png"
></image>
<view class="wc-title">{{ title }}</view>
<slot></slot>
</view>
</view>
</template>
<script>
export default {
props: {
title: {
type: String,
default: '提示'
},
show: {
type: Boolean,
default: false
}
}
}
</script>
<style lang="scss">
.wallet-mask{
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba($color: #000000, $alpha: .5);
z-index: 10;
.wm-content{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
padding-top: 80upx;
padding-bottom: 80upx;
width: 620upx;
border-radius: 10upx;
background: #fff;
.wc-close{
position: absolute;
right: 30upx;
top: 30upx;
width: 34upx;
height: 34upx;
}
.wc-title{
text-align: center;
@include flcw(32upx, 44upx, #333333, 500);
}
}
}
</style>

68
src/subpackage/wallet/components/wallet_modal_success.vue

@ -0,0 +1,68 @@
<template>
<wallet-modal :show="isShow" @click:close="hide" :title="title">
<view class="wallet-modal-success">
<image class="wms-icon" mode="aspect" src="/subpackage/wallet/static/images/success_tip.png"></image>
<view class="wms-des"><slot name="tip">成功</slot></view>
<view class="wallet-modal-button">
<wallet-modal-button @click="btnClick">
<slot name="btn">{{ btnName }}</slot>
</wallet-modal-button>
</view>
</view>
</wallet-modal>
</template>
<script>
import walletModal from './wallet_modal.vue';
import wmButton from './wm_button.vue';
export default {
components: {
'wallet-modal': walletModal,
'wallet-modal-button': wmButton
},
props: {
title: {
default: '提示'
}
},
data(){
return {
isShow: false
}
},
methods: {
hide(){
this.isShow = false;
},
alert(){
this.isShow = true;
},
btnClick(){
this.hide();
this.$emit('click:button');
}
}
}
</script>
<style lang="scss">
.wallet-modal-success{
padding-top: 50upx;
.wms-icon{
margin: 0 auto;
display: block;
width: 100upx;
height: 100upx;
}
.wms-des{
padding: 0 60upx;
margin-top: 28upx;
text-align: center;
@include flcw($color: #1A1A1A);
}
.wallet-modal-button{
margin-top: 86upx;
@include ctf(center);
}
}
</style>

31
src/subpackage/wallet/components/wm_button.vue

@ -0,0 +1,31 @@
<template>
<view class="wallet-modal-button" :class="{ 'green': green }" @click="$emit('click')">
<slot>充值记录</slot>
</view>
</template>
<script>
export default {
props: {
green: {
type: Boolean,
default: false
}
}
}
</script>
<style lang="scss">
.wallet-modal-button{
width: 240upx;
height: 88upx;
border: 2upx solid $mColor;
border-radius: 10upx;
text-align: center;
@include flcw($color: $mColor, $height: 84upx);
&.green{
background: $mColor;
color: #fff;
}
}
</style>

13
src/subpackage/wallet/js/api.js

@ -0,0 +1,13 @@
import { ORIGIN } from '../../../js/api';
export const WALLET_API = {
walletBalance:`${ORIGIN}/admin/merchantwallet/balance`, // 获取商户钱包余额
withdrawalOfDouyinOrg_totalAmount:`${ORIGIN}/admin/financialReconciliation/withdrawalOfDouyinOrg/totalAmount`, // 可提现总额 抖音
withdrawalOfDouyinOrg_edit:`${ORIGIN}/admin/financialReconciliation/withdrawalOfDouyinOrg/edit`, // 申请提现-编辑 抖音
withdrawalOfDouyinOrg_list:`${ORIGIN}/admin/financialReconciliation/withdrawalOfDouyinOrg/list`, // 提现申请-列表 抖音
// 宝付
getPayAssureConfigs:`${ORIGIN}/admin/pay/assure/getPayAssureConfigs`, // 查看可选择的支付账户列表
baofuV2Gateway:`${ORIGIN}/admin/pay/assure/baofuV2/gateway`, // 宝付v2获取金额信息
}
export default WALLET_API;

1
src/subpackage/wallet/js/bank.js

@ -0,0 +1 @@
export default ['中国工商银行', '中国建设银行', '中国银行', '中国农业银行', '中国邮政储蓄银行', '招商银行', '交通银行', '上海浦东发展银行', '中信银行', '中国光大银行', '华夏银行', '中国民生银行', '广东发展银行', '兴业银行', '平安银行', '浙商银行', '恒丰银行', '渤海银行', '上海银行', '北京银行', '杭州银行', '常熟农商银行', '青岛银行', '徽商银行', '南京银行', '张家口银行', '天津滨海农村商业银行', '天津银行', '深圳农村商业银行', '宁夏银行', '石嘴山银行', '海南省农村信用社联合社', '海南银行', '陕西省农村信用社联合社', '长安银行', '青海农村信用社联合社', '青海银行', '宁波通商银行', '鄞州银行', '宁波东海银行', '宁波银行', '江南农村商业银行', '江苏省农村信用社联合社', '江苏长江商业银行', '江阴农商银行', '昆山农村商业银行', '苏州银行', '太仓农村商业银行', '无锡农村商业银行', '吴江农村商业银行', '张家港农商行', '重庆农村商业银行', '重庆三峡银行', '重庆银行', '大同银行', '晋城银行', '晋商银行', '晋中市商业银行', '长治市商业银行', '阳泉商业银行', '德州银行', '东营银行', '烟台银行', '济宁银行', '莱商银行', '临商银行', '齐鲁银行', '齐商银行', '日照银行', '枣庄银行', '泰安银行', '威海市商业银行', '潍坊银行', '江西银行', '江西省农村信用社联合社', '九江银行', '赣州银行', '上饶银行', '甘肃省农村信用社联合社', '甘肃银行', '兰州银行', '鄂尔多斯银行', '内蒙古农村信用社联合社', '内蒙古银行', '乌海银行', '汉口银行', '湖北省农村信用社联合社', '湖北银行', '武汉农村商业银行', '鞍山银行', '本溪商业银行', '朝阳银行', '丹东银行', '阜新银行', '葫芦岛银行', '锦州银行', '辽宁省农村信用社', '辽阳银行', '盘锦商行', '盛京银行', '铁岭银行', '营口沿海银行', '营口银行', '东莞农村商业银行', '东莞银行', '广东华兴银行', '广东南粤银行', '广东省农村信用社联合社', '广州农村商业银行', '广州银行', '顺德农商银行', '珠海华润银行', '长沙银行', '湖南三湘银行', '成都农商银行', '达州市商业银行', '长城华西银行', '乐山商业银行', '凉山商业银行', '泸州市商业银行', '绵阳市商业银行', '四川天府银行', '攀枝花市商业银行', '四川省农村信用社联合社', '遂宁银行', '雅安市商业银行', '宜宾市商业银行', '自贡银行', '广西北部湾银行', '广西壮族自治区农村信用社联合社', '柳州银行', '上海农村商业银行', '贵阳银行', '贵州省农村信用社联合社', '贵州银行', '台州银行', '温州银行', '浙江民泰商业银行', '浙江泰隆商业银行', '湖州银行', '嘉兴银行', '金华银行', '绍兴银行', '浙江稠州商业银行', '浙商银行', '哈尔滨银行', '黑龙江省农村信用社联合社', '龙江银行', '吉林省农村信用社联合社', '吉林银行', '大连银行', '大连农商行', '富滇银行', '曲靖市商业银行', '云南红塔银行', '云南省农村信用社联合社', '哈密市商业银行', '库尔勒市商业银行', '昆仑银行', '乌鲁木齐银行', '新疆汇和银行', '新疆农村信用社联合社', '新疆银行', '厦门国际银行', '厦门银行', '福建省海峡银行', '泉州银行', '保定银行', '沧州银行', '承德银行', '邯郸银行', '河北省农村信用社联合社', '河北银行', '衡水银行', '廊坊银行', '秦皇岛市商业银行', '唐山银行', '邢台银行', '河南省农村信用社联合社', '焦作中旅银行', '洛阳银行', '平顶山银行', '郑州银行', '中原银行', '玉山银行', '西藏银行', '华侨永亨银行', '辽宁辰州汇通村镇银行', '佛山农村商业银行', '东港农村商业银行', '浙江东阳农村商业银行', '东莞农村商业银行']

10
src/subpackage/wallet/js/server.js

@ -0,0 +1,10 @@
import { Server } from '../../../js/server';
class WalletServer extends Server {
constructor(props){
super(props)
}
}
export default new WalletServer();

122
src/subpackage/wallet/pages/baofu_withdraw/index.vue

@ -0,0 +1,122 @@
<template>
<view class="baofu-index">
<view class="bi-item" v-for="(e, i) in accountLs" :key="i">
<baofu-item
:name="e.label_name"
:account="e.baofu_v2_contract_no"
:tag="getBaoFuV2AccountTypeForChinese(e.baofu_v2_config)"
:personal="getBaoFuV2AccountTypeForChinese(e.baofu_v2_config) === '个人'"
@click:extract='extractBtn(i)'
:ref="'baofuItem'"
></baofu-item>
</view>
<bf-withdraw ref="bfWithdraw" @click:extract="modalExtractBtn"></bf-withdraw>
<wallet-modal-success
title="提现成功"
ref="walletModalSuccess"
>
<template v-slot:tip>提现一般当天到账具体以银行到账时间为准</template>
<template v-slot:btn>确定</template>
</wallet-modal-success>
</view>
</template>
<script>
import baofuItem from './modules/baofu_item.vue';
import bfWithdraw from '../../components/bf_withdraw.vue';
import wallet_modal_success from '../../components/wallet_modal_success.vue';
import { WALLET_API } from '../../js/api';
import servers from '../../js/server';
import { routeTo, showLoad, hideLoad } from '@/utils/util';
import { mapState} from 'vuex';
export default {
computed: {
...mapState([ 'brandInfo' ])
},
components: {
'baofu-item': baofuItem,
'bf-withdraw': bfWithdraw,
'wallet-modal-success': wallet_modal_success
},
data(){
return {
accountLs: []
}
},
onLoad(options){
this.brand_id = options.brand_id ?? '';
// this.getWalletBalance(options.brand_id);
console.log('brandInfo', this.brandInfo);
this.getPayAssureConfigs({
appid: this.brandInfo?.brand?.mini_wechat_appid ?? 'wxc141a743225e7885'
});
},
methods: {
modalExtractBtn(index){
this.$refs.walletModalSuccess.alert();
this.$refs?.baofuItem?.[index]?.refreshItem(false);
},
extractBtn(i){
let { accountLs } = this;
let _curItem = accountLs[i];
let _type = this.getBaoFuV2AccountTypeForChinese(_curItem.baofu_v2_config) === '个人' ? '1' : '2';
this.$refs.bfWithdraw.alert({
name: _curItem.label_name,
account: _curItem.baofu_v2_contract_no,
type: _type,
index: i
});
},
/**
* http://api.ouxuan.net:61080/project/11/interface/api/9979
* 查看可选择的支付账户列表
* @param {String} pay_way 暂时只有 WeChat
* @param {String} appid 品牌小程序appid
*
* */
getPayAssureConfigs({ pay_way = 'WeChat', appid }){
showLoad();
servers.get({
url: WALLET_API.getPayAssureConfigs,
failMsg: '获取账户列表失败',
data: {
pay_way,
appid
}
})
.then(res=>{
hideLoad();
let _ls = res ?? [];
this.accountLs = this.filterBaoFuV2Accounts(_ls);
})
},
/**
* 过滤宝付V2账户
* @param {Array} list 账户列表 -> /admin/pay/assure/getPayAssureConfigs
* @returns {Array} 宝付V2账户列表
* */
filterBaoFuV2Accounts(list){
return list.filter(e=>e.assure_account_type === 'BaoFuV2');
},
/**
* 获取宝付V2账户类型中文 -> 个人/企业
* @param {Object} baofuV2Config 宝付V2配置
* @returns {String} 个人/企业
* */
getBaoFuV2AccountTypeForChinese(baofuV2Config = null){
return baofuV2Config?.person ? '个人' : '企业';
}
}
}
</script>
<style lang="scss">
.baofu-index{
padding: 32upx;
.bi-item{
margin-top: 32upx;
}
}
</style>

246
src/subpackage/wallet/pages/baofu_withdraw/modules/baofu_item.vue

@ -0,0 +1,246 @@
<template>
<view class="baofu-item">
<view class="bi-bar" :class="{ 'bb-personal': personal }">
<view class="bb-name-bar">
<view class="bnb-left">
<view class="bl-txt">{{ name }}</view>
<view class="bl-tag" >{{ tag }}</view>
</view>
<!-- <view class="bnb-right">
<view class="br-txt">提现记录</view>
<image class="wb-icon" mode="aspect" src="/subpackage/wallet/static/images/arrow_b2.png"></image>
</view> -->
</view>
<view class="bb-account-num">账户号{{ account }}</view>
</view>
<view class="bi-info" v-if="statusMsg === 'success'">
<view class="bi-balance">
<view class="bb-money">
{{ accountInfo.availableBal || 0 }}
</view>
<view class="bb-btn" @click="$emit('click:extract')">提现</view>
</view>
<view class="bi-tip">
<view class="bt-txt" @click="showModalTip(0)">可提现资金()</view>
<image class="bt-icon" mode="aspect" src="/subpackage/wallet/static/images/question_mark.png" @click="showModalTip(0)"></image>
</view>
<view class="bi-mony-info">
<view class="bmi-item">
<view class="bi-num">{{ accountInfo.currBal || 0 }}</view>
<view class="bi-tip">
<view class="bt-txt" @click="showModalTip(1)">总资产()</view>
<image class="bt-icon" mode="aspect" src="/subpackage/wallet/static/images/question_mark.png" @click="showModalTip(1)"></image>
</view>
</view>
<view class="bmi-item">
<view class="bi-num">{{ accountInfo.pendingBal || 0 }}</view>
<view class="bi-tip">
<view class="bt-txt" @click="showModalTip(2)">在途资金()</view>
<image class="bt-icon" mode="aspect" src="/subpackage/wallet/static/images/question_mark.png" @click="showModalTip(2)"></image>
</view>
</view>
</view>
</view>
<view v-else class="bi-status-mes" @click="loadAgain">{{ statusMsg }}</view>
</view>
</template>
<script>
import { WALLET_API } from '../../../js/api';
import servers from '../../../js/server';
const failStatusMsg = '加载账户资金失败,点击重新加载!';
export default {
props: {
personal: {
type: Boolean,
default: false
},
name: {
type: String,
default: ''
},
tag: { // /
type: String,
default: ''
},
account: {
type: String,
default: ''
}
},
data(){
return {
statusMsg: '',
accountInfo: {},
}
},
created(){
this.refreshItem(true);
},
methods:{
showModalTip(type){
let tipArr = [
'该账户支持提现的资金',
'在途资金+可提现资金总和',
'用户支付后金额进入到商户在途户中,商户发起分账且达到T+1条件后资金才能从在途户结算到可提现资金',
]
uni.showModal({
title: '提示',
content: tipArr[type],
showCancel: false
})
},
refreshItem(loadStatus){
this.getBaofuV2PriceInfo({
type: this.tag,
contractNo: this.account,
loadStatus
});
},
loadAgain(){
let { statusMsg } = this;
if(statusMsg === failStatusMsg){
this.getBaofuV2PriceInfo({
type: this.tag,
contractNo: this.account
});
}
},
getBaofuV2PriceInfo({ type, contractNo, loadStatus = true }){
if(loadStatus)this.statusMsg = '加载中...';
servers.post({
url: WALLET_API.baofuV2Gateway,
data: {
service: 'T-1001-013-06',
api: '/',
data: {
accType: type === '个人' ? '1' : '2',
contractNo: contractNo,
version: '4.0.0'
}
},
isDefaultGet: false
})
.then(res=>{
let _data = res?.data;
if(_data.code === 0&&_data.data.errorCode === 'SUCCESS'){
if(loadStatus)this.statusMsg = 'success';
this.accountInfo = _data.data;
}else{
console.warn('getBaofuV2PriceInfo error: ', res);
this.statusMsg = failStatusMsg;
}
})
.catch(err=>{
console.log('getBaofuV2PriceInfo catch error: ', err);
if(loadStatus)this.statusMsg = failStatusMsg;
})
}
}
}
</script>
<style lang="scss">
.baofu-item{
border-radius: 30upx;
overflow: hidden;
background: #fff;
.bi-tip{
@include ctf;
.bt-txt{
@include flcw(24upx, 34upx, #9C9C9F);
}
.bt-icon{
margin-left: 6upx;
width: 28upx;
height: 28upx;
}
}
.bi-bar{
padding: 26upx 32upx 18upx;
padding-left: 32upx;
padding-right: 32upx;
background: $mColor;
&.bb-personal{
background: #585F69;
.bl-tag{
background: #68C43B !important;
}
}
.bb-account-num{
@include flcw(24upx, 44upx, #FFFFFF);
}
.bb-name-bar{
@include ctf(space-between);
.bnb-left{
flex-grow: 1;
@include ctf;
.bl-txt{
@include flcw(28upx, 44upx, #fff, 500);
@include tHide;
}
.bl-tag{
flex-shrink: 0;
margin-left: 6upx;
padding: 0upx 6upx;
border-radius: 6upx;
background: #32C5FF;
@include flcw(20upx, 28upx, #fff);
}
}
.bnb-right{
flex-shrink: 0;
margin-left: 10upx;
@include ctf(flex-end);
.br-txt{
@include flcw(20upx, 28upx, rgba($color: #fff, $alpha: .57));
}
.wb-icon{
flex-shrink: 0;
width: 20upx;
height: 20upx;
}
}
}
}
.bi-info{
padding: 40upx 32upx;
.bi-balance{
@include ctf(space-between);
.bb-money{
@include flcw(84upx, 96upx, #000000, 700);
@include tHide;
}
.bb-btn{
flex-shrink: 0;
margin-left: 10upx;
width: 160upx;
text-align: center;
border-radius: 10upx;
background: #FF873D;
@include flcw(28upx, 72upx, #FFFFFF, 500);
}
}
.bi-mony-info{
margin-top: 58upx;
@include ctf;
.bmi-item{
flex-shrink: 0;
flex-grow: 0;
width: 50%;
.bi-num{
@include flcw(44upx, 52upx, #000000, 700);
@include tHide;
}
}
}
}
.bi-status-mes{
padding: 40upx 32upx;
@include flcw(24upx, 34upx, #000000);
}
}
</style>

324
src/subpackage/wallet/pages/douyin_withdraw/apply.vue

@ -0,0 +1,324 @@
<template>
<view class="dy-withdraw-apply">
<view class="dwa-balance">
<text class="dwab-txt">可提现资金</text>
{{ balance.toFixed(2)||"0.00" }}
</view>
<view class="dwa-scroll">
<view class="dwa-opt-line" :key="i">
<view class="dol-name">*提现金额</view>
<input type="digit" class="dol-ipt" placeholder="请输入提现金额" v-model="info.amount">
</view>
<view class="dwa-opt-line" :key="i">
<view class="dol-name">*账户名称</view>
<input type="text" class="dol-ipt" placeholder="请输入账户名称" v-model="info.account_name_of_bank">
</view>
<view class="dwa-opt-line" :key="i">
<view class="dol-name">*银行卡号</view>
<input type="number" class="dol-ipt" placeholder="请输入银行卡号" v-model="info.account">
</view>
<view class="dwa-opt-line">
<view class="dol-name">*银行名称</view>
<picker class="dol-picker" :range="banks" @change="bankNameChange">
<view class="dp-frame">
<input type="text" disabled class="df-ipt" placeholder="请选择" v-model="info.bank_name">
<image class="df-icon" mode="aspect" src="/subpackage/wallet/static/images/arrow_c33.png"></image>
</view>
</picker>
</view>
<view class="dwa-opt-line" :key="i">
<view class="dol-name">*支行名称</view>
<input type="text" class="dol-ipt" placeholder="请输入支行名称" v-model="info.bank_address">
</view>
<view class="dwa-opt-line" :key="i">
<view class="dol-name">联系电话</view>
<input maxlength="11" type="number" class="dol-ipt" placeholder="请输入联系电话" v-model="info.mobile">
</view>
</view>
<view class="dwa-tip">
<view class="dt-tit">温馨提示</view>
<view class="dt-desc">1账户请预留一定的余额避免余额不足导致退款失败</view>
<view class="dt-desc">2提现申请成功提交后预计在3~7个工作日内进行处理</view>
</view>
<view class="dwa-btn">
<wm-button green @click="confirmExtract">确认提现</wm-button>
</view>
<wallet-modal-success
title="申请成功"
ref="walletModalSuccess"
@click:button="toDetailBtn"
>
<template v-slot:tip>平台已收到您的提现请求预计在3~7个工作日内进行处理请耐心等待</template>
<template v-slot:btn>提现记录</template>
</wallet-modal-success>
</view>
</template>
<script>
import walletModal from '../../components/wallet_modal.vue';
import wmButton from '../../components/wm_button.vue';
import wallet_modal_success from '../../components/wallet_modal_success.vue';
import banks from '../../js/bank';
import { WALLET_API } from '../../js/api';
import servers from '../../js/server';
import { routeTo, showModal, showNone, showLoad, hideLoad } from '@/utils/util';
export default {
components: {
'wallet-modal': walletModal,
'wm-button': wmButton,
'wallet-modal-success': wallet_modal_success
},
data(){
return {
balance: 0,
banks,
brand_id: '',
info: {
amount: '',
account_name_of_bank: '',
account: '',
bank_name: '',
bank_address: '',
mobile: ''
}
}
},
async onLoad(options){
let _bid = options.brand_id || '';
this.brand_id = _bid;
await this.getDouyinWalletBalance(_bid);
if(this.isEmptyInfo())this.getStorageAndSet();
},
methods: {
toDetailBtn(){
routeTo(`/subpackage/wallet/pages/douyin_withdraw/record?brand_id=${this.brand_id}`, 'nT');
},
bankNameChange(e){
let { value } = e.detail;
this.info.bank_name = this.banks[value];
},
getStorageAndSet(){
uni.getStorage({
key: 'dyRecentWithdrawApplyInfo',
success: res=>{
showModal({
content: '是否自动填充上次提现信息?',
showCancel: true,
success: mRes=>{
if(mRes.confirm){
this.info = res.data;
}
}
})
}
})
},
setInfoToStorage(){
uni.setStorage({
key: 'dyRecentWithdrawApplyInfo',
data: this.info
});
},
confirmExtract(){
if(!this.infoCheck())return;
this.setInfoToStorage();
showModal({
content: '是否确认提现?',
showCancel: true,
success: res=>{
if(res.confirm){
let _amount = this.info.amount || 0;
this.dyConfirmExtract({
...this.info,
amount: (+_amount) * 100
})
}
}
})
},
//
dyConfirmExtract(e){
this.douyinWalletExtract({
brand_id: this.brand_id,
...e,
})
},
isEmptyInfo(){
let _infoValues = Object.values(this.info);
return _infoValues.every(item=>item === '');
},
infoCheck(){
let { amount, account_name_of_bank, account, bank_name, bank_address, mobile } = this.info;
let _amount = +(amount ?? 0);
if(_amount <= 0){
showNone('提现金额不正确');
return false
}
if(_amount > this.balance){
showNone('提现金额不能大于可提现金额');
return false
}
if(account_name_of_bank === ''){
showNone('账户名称不能为空');
return false
}
if(account === ''){
showNone('银行卡号不能为空');
return false
}
if(bank_name === ''){
showNone('银行名称不能为空');
return false
}
if(bank_address === ''){
showNone('支行名称不能为空');
return false
}
return true
},
/**
* http://api.ouxuan.net:61080/project/11/interface/api/2195
* @param {String} brand_id 品牌id
* */
getDouyinWalletBalance(brand_id){
showLoad();
return servers.get({
url: WALLET_API.withdrawalOfDouyinOrg_totalAmount,
data: {
brand_id: brand_id
},
failMsg: '获取钱包余额失败'
})
.then(res=>{
hideLoad();
let _balance = +res.total_amount ?? 0;
return this.balance = _balance * 0.01;
})
.catch(hideLoad)
},
/**
* http://api.ouxuan.net:61080/project/11/interface/api/2209
* @param {String} brand_id 品牌id
* @param {Number} amount 提现金额
* @param {String} account 账户
* @param {String} account_name_of_bank 账户名
* @param {String} bank_name //
* @param {String} bank_address //
* @param {String} mobile 手机号
* @param {Number} status // 01
* */
douyinWalletExtract({
brand_id,
amount,
account,
account_name_of_bank,
bank_name,
bank_address,
mobile,
status = 0
}){
showLoad();
servers.post({
url: WALLET_API.withdrawalOfDouyinOrg_edit,
data: {
brand_id,
amount,
account,
account_name_of_bank,
bank_name,
bank_address,
mobile,
status,
},
failMsg: '申请提现失败'
})
.then(res=>{
hideLoad();
this.$refs.walletModalSuccess.alert();
setTimeout(_=>{
this.getDouyinWalletBalance(brand_id);
}, 1200);
})
.catch(hideLoad)
},
}
}
</script>
<style lang="scss">
page{
background: #fff;
}
.dy-withdraw-apply{
padding: 36upx 50upx 20upx;
.dwa-balance{
@include flcw(28upx, 48upx, $mColor);
@include tHide;
.dwab-txt{
color: #1A1A1A;
}
}
.dwa-scroll{
margin-top: 20upx;
}
.dwa-opt-line{
@include ctf(space-between);
&+.dwa-opt-line{
margin-top: 20upx;
}
.dol-name{
@include flcw(24upx, 34upx, #1A1A1A);
}
.dol-ipt{
box-sizing: border-box;
flex-grow: 0;
width: 492upx;
height: 108upx;
padding: 0 20upx;
border-radius: 10upx;
background: #F2F2F7;
@include flcw(24upx, 34upx, #1A1A1A);
}
.dol-picker{
flex-shrink: 0;
.dp-frame{
width: 492upx;
height: 108upx;
padding: 0 20upx;
border-radius: 10upx;
background: #F2F2F7;
@include ctf(space-between);
.df-ipt{
flex-grow: 1;
height: 100%;
@include flcw(24upx, 34upx, #1A1A1A);
}
.df-icon{
flex-shrink: 0;
width: 20upx;
height: 20upx;
}
}
}
}
.dwa-tip{
margin-top: 18upx;
.dt-tit{
@include flcw(24upx, 44upx, #9A9A9D);
}
.dt-desc{
@include flcw(24upx, 44upx, #1A1A1A);
}
}
.dwa-btn{
margin-top: 62upx;
@include ctf(center);
}
}
</style>

114
src/subpackage/wallet/pages/douyin_withdraw/index.vue

@ -0,0 +1,114 @@
<template>
<view class="douyin-withdraw">
<image class="dw-icon" mode="aspect" src="/subpackage/wallet/static/images/dy_logo.png"></image>
<view class="dw-tip">可提现资金</view>
<view class="dw-price">
<text class="dp-unit">¥</text>{{ balance.toFixed(2)||"0.00" }}
</view>
<view class="dw-btn" @click="applyBtn">申请提现</view>
<view class="dw-link">
<text class="dl-txt" @click="toDetailBtn">提现明细</text>
<image class="dl-icon" mode="aspect" src="/subpackage/wallet/static/images/arrow_b2.png"></image>
</view>
</view>
</template>
<script>
import { WALLET_API } from '../../js/api';
import servers from '../../js/server';
import { routeTo, showLoad, hideLoad } from '@/utils/util';
export default {
data(){
return {
brand_id: '',
balance: 0,
}
},
onLoad(options){
this.brand_id = options.brand_id || '';
},
onShow(){
this.getDouyinWalletBalance(this.brand_id);
},
methods: {
//
toDetailBtn(){
routeTo(`/subpackage/wallet/pages/douyin_withdraw/record?brand_id=${this.brand_id}`, 'nT');
},
//
applyBtn(){
routeTo(`/subpackage/wallet/pages/douyin_withdraw/apply?brand_id=${this.brand_id}`, 'nT');
},
/**
* http://api.ouxuan.net:61080/project/11/interface/api/2195
* @param {String} brand_id 品牌id
* */
getDouyinWalletBalance(brand_id){
showLoad();
servers.get({
url: WALLET_API.withdrawalOfDouyinOrg_totalAmount,
data: {
brand_id: brand_id
},
failMsg: '获取钱包余额失败'
})
.then(res=>{
hideLoad();
let _balance = +res.total_amount ?? 0;
this.balance = _balance * 0.01;
})
.catch(hideLoad)
},
}
}
</script>
<style lang="scss">
.douyin-withdraw{
padding-top: 88upx;
.dw-icon{
margin: 0 auto;
display: block;
width: 96upx;
height: 96upx;
background: #000;
border-radius: 24upx;
}
.dw-tip{
margin-top: 62upx;
text-align: center;
@include flcw(28upx, 40upx, #000000);
}
.dw-price{
padding: 0 20upx;
margin-top: 20upx;
text-align: center;
@include flcw(84upx, 96upx, #000000, 700);
@include tHide(1);
.dp-unit{
font-size: 64upx;
}
}
.dw-btn{
margin: 154upx auto 0;
width: 300upx;
border-radius: 10upx;
text-align: center;
background: #FF873D;
@include flcw(32upx, 112upx, #fff);
}
.dw-link{
margin-top: 88upx;
@include flcw(28upx, 40upx, #9A9A9D);
@include ctf(center);
.dl-icon{
flex-shrink: 0;
margin-left: 6upx;
width: 28upx;
height: 28upx;
}
}
}
</style>

151
src/subpackage/wallet/pages/douyin_withdraw/record.vue

@ -0,0 +1,151 @@
<template>
<view class="withdraw-record">
<filtrate-bar
:filter-list="['全部', '待处理', '已处理']"
ref="filtrateBar"
@change:times="timesChange"
@change:filter="filterBtn"
></filtrate-bar>
<view class="wr-list">
<view class="record-item" v-for="(e, i) in orderList" :key="i">
<record-line
name="提现金额"
:tag="getTagTxt(e.status)"
>{{ formatAmount(e.amount || 0) }}</record-line>
<record-line name="提现单号">{{ e.number || '-' }}</record-line>
<record-line name="申请时间">{{ e.request_time || '-' }}</record-line>
<record-line name="收款人名称">{{ e.account_name_of_bank || '-' }}</record-line>
<record-line name="收款人账号">{{ e.account || '-' }}</record-line>
<record-line name="处理时间">{{ e.updated_at || '-' }}</record-line>
<record-line name="备注">{{ e.remark || '-' }}</record-line>
</view>
</view>
</view>
</template>
<script>
import recordLine from '../../components/record_line.vue';
import filtrate_bar from '../../components/filtrate_bar.vue';
import { WALLET_API } from '../../js/api';
import servers from '../../js/server';
import { routeTo, showLoad, hideLoad, showNone } from '@/utils/util';
export default {
components: {
'record-line': recordLine,
'filtrate-bar': filtrate_bar
},
data(){
return {
orderList: [],
loadPage: 1,
brand_id: '',
start_time: '',
end_time: '',
status: '', // 0,1
}
},
onLoad(options){
let _bid = options.brand_id ?? '';
this.brand_id = _bid;
let { startDate, endDate } = this.$refs.filtrateBar.getTimes();
this.getDouyinWalletWithdrawRecord({
brand_id: _bid,
start_time: startDate,
end_time: endDate
});
},
onReachBottom(){
this.getDouyinWalletWithdrawRecord({
brand_id: this.brand_id,
page: this.loadPage + 1,
status: this.status,
start_time: this.start_time,
end_time: this.end_time
});
},
methods: {
formatAmount(num = 0){
let _num = Number(num) || 0;
return _num * 0.01;
},
getTagTxt(status = ''){
return status === 0 ? '待处理' :
status === 1 ? '已处理' : '';
},
filterBtn(idx){
this.loadPage = 1;
this.status = idx === 0 ? '' : idx - 1;
this.getDouyinWalletWithdrawRecord({
brand_id: this.brand_id,
status: this.status,
start_time: this.start_time,
end_time: this.end_time
});
},
timesChange(e){
let { startDate, endDate } = e;
this.loadPage = 1;
this.start_time = startDate;
this.end_time = endDate;
this.getDouyinWalletWithdrawRecord({
brand_id: this.brand_id,
status: this.status,
start_time: startDate,
end_time: endDate,
});
},
/**
* http://api.ouxuan.net:61080/project/11/interface/api/2202
* @param {String} brand_id 品牌id
* @param {Number} page 页码
* @param {Number} page_size 每页条数
* @param {status} status 传0展示未处理,传1展示处理不传展示全部
* @param {String} start_time 开始时间
* @param {String} end_time 结束时间
*
* */
getDouyinWalletWithdrawRecord({
brand_id, page = 1, page_size = 10,
status = '', start_time = '', end_time = ''
}){
showLoad();
let _query = { brand_id, page, page_size };
if(status !== '')_query.status = status;
if(start_time !== '')_query.start_time = start_time;
if(end_time !== '')_query.end_time = end_time;
servers.get({
url: WALLET_API.withdrawalOfDouyinOrg_list,
data: _query,
failMsg: '加载提现记录失败'
})
.then(res=>{
hideLoad();
let _ls = res?.list || [];
if(page === 1)return this.orderList = _ls;
if(!_ls.length)return showNone('没有更多了!');
this.orderList = [...this.orderList, ..._ls];
this.loadPage = page;
})
.catch(hideLoad)
},
}
}
</script>
<style lang="scss">
.withdraw-record{
}
.wr-list{
padding: 24upx 24upx 0;
.record-item{
padding: 26upx 20upx;
border-radius: 10upx;
background: #fff;
&+ .record-item{
margin-top: 24upx;
}
}
}
</style>

110
src/subpackage/wallet/pages/index/index.vue

@ -0,0 +1,110 @@
<template>
<view class="wallet-index">
<wallet-info
:balance="balance"
@click:douyin="dyBtnClick"
@click:baofu="bfBtnClick"
@click:admin="toWebView"
></wallet-info>
<view class="wi-tips">
<view class="wt-tit">温馨提示</view>
<view class="wt-content">
<text class="wc-txt">
如需要分账账户可以自己单独提现请访问 {{ oxAddress }}
<text class="wt-copy" @click="copyBtn">复制</text>
\r\n账户为宝付的商户号密码为申请时预留的手机号码
</text>
</view>
</view>
<wallet-modal v-if="false"></wallet-modal>
</view>
</template>
<script>
import walletInfo from './modules/wallet_info.vue'
import walletModalSuccess from '../../components/wallet_modal_success.vue'
import { WALLET_API } from '../../js/api';
import servers from '../../js/server';
import { routeTo, showLoad, hideLoad } from '@/utils/util';
export default {
components: {
'wallet-info': walletInfo,
'wallet-modal': walletModalSuccess,
},
data(){
return {
oxAddress: 'https://sps.ouxuanzhineng.cn',
brand_id: '',
balance: 0,
}
},
onLoad(options){
this.brand_id = options.brand_id ?? '';
this.getWalletBalance(options.brand_id);
console.log(uni.getAccountInfoSync().miniProgram)
},
methods: {
toWebView(){
routeTo(`/pages/web_view/web_view?src=${encodeURIComponent(this.getAdminAddress())}`,'nT');
},
getAdminAddress(){
let _appid = uni.getAccountInfoSync()?.miniProgram?.appId || '';
if(_appid === "wx7106e84614cf0060")return 'https://testadmin.ouxuanzhineng.cn'; //
return 'https://admin.ouxuanzhineng.cn'; //
},
copyBtn(){
uni.setClipboardData({
data: this.oxAddress,
})
},
getWalletBalance(brand_id){
showLoad();
servers.get({
url: WALLET_API.walletBalance,
data: {
brand_id: brand_id
},
failMsg: '获取钱包余额失败'
})
.then(res=>{
hideLoad();
this.balance = +res.balance ?? 0;
})
.catch(err=>{
hideLoad();
console.log(err);
})
},
dyBtnClick(){
routeTo(`/subpackage/wallet/pages/douyin_withdraw/index?brand_id=${this.brand_id ?? ''}`, 'nT');
},
bfBtnClick(){
routeTo(`/subpackage/wallet/pages/baofu_withdraw/index?brand_id=${this.brand_id ?? ''}`, 'nT');
}
}
}
</script>
<style lang="scss">
.wallet-index{
padding: 32upx;
.wi-tips{
margin-top: 24upx;
padding: 40upx;
border-radius: 30upx;
background: #fff;
.wt-tit{
@include flcw($color: #9A9A9D);
}
.wt-content{
margin-top: 20upx;
@include flcw($color: #1A1A1A, $height: 49upx);
.wt-copy{
padding: 0 12upx;
@include flcw($color: $mColor);
}
}
}
}
</style>

139
src/subpackage/wallet/pages/index/modules/wallet_info.vue

@ -0,0 +1,139 @@
<template>
<view class="wallet-info">
<view class="wi-bar" @click="$emit('click:admin')">
<view class="wb-txt">钱包查账可登录后台查阅</view>
<image class="wb-icon" mode="aspect" src="@/subpackage/wallet/static/images/arrow_b2.png"></image>
</view>
<view class="wi-account">
<veiw class="wa-top">
<view class="wt-name">欧轩内部钱包账户余额</view>
<!-- <view class="wt-record">
<text>充值记录</text>
<image class="wr-icon" mode="aspect" src="/subpackage/wallet/static/images/arrow_b2.png"></image>
</view> -->
</veiw>
<view class="wa-tip">(用于购买服务使用)</view>
<view class="wa-balance">
<view class="wb-money">
<text class="wm-unit">¥</text>
{{ balance }}
</view>
<!-- <view class="wb-btn">充值</view> -->
</view>
</view>
<view class="wi-btns">
<view class="wb-item" @click="$emit('click:baofu')">
<text class="wi-txt">宝付提现</text>
</view>
<view class="wb-item" @click="$emit('click:douyin')">
<image class="wi-icon" mode="aspect" src="@/subpackage/wallet/static/images/dy_logo.png"></image>
<text class="wi-txt">抖音提现</text>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
balance: {
type: Number,
default: 0
}
},
methods: {
}
}
</script>
<style lang="scss">
.wallet-info{
border-radius: 30upx;
overflow: hidden;
background: #fff;
.wi-bar{
padding-left: 40upx;
padding-right: 40upx;
height: 76upx;
background: #585F69;
@include ctf(space-between);
.wb-txt{
@include flcw(24upx, 34upx, #FFFFFF);
}
.wb-icon{
width: 20upx;
height: 20upx;
}
}
.wi-account{
padding: 36upx 40upx 50upx;
.wa-top{
@include ctf(space-between);
.wt-name{
@include flcw(32upx, 44upx, #1A1A1A, 500);
@include tHide;
}
.wt-record{
@include ctf(flex-end);
@include flcw(24upx, 34upx, #9C9C9F);
.wr-icon{
margin-left: 4upx;
width: 20upx;
height: 20upx;
}
}
}
.wa-tip{
margin-top: 8upx;
@include flcw(24upx, 34upx, #9C9C9F);
}
.wa-balance{
margin-top: 68upx;
@include ctf(space-between);
.wb-money{
@include flcw(84upx, 96upx, #000000, 700);
@include tHide;
.wm-unit{
font-size: 44upx;
}
}
.wb-btn{
flex-shrink: 0;
margin-left: 10upx;
width: 120upx;
text-align: center;
border-radius: 10upx;
background: #FF873D;
@include flcw(24upx, 56upx, #FFFFFF, 500);
}
}
}
.wi-btns{
border-top: 1px solid rgba($color: #000000, $alpha: .1);
padding: 32upx 40upx 40upx;
@include ctf(space-between);
.wb-item{
flex-grow: 0;
flex-shrink: 0;
height: 112upx;
width: 284upx;
border-radius: 26upx;
background-image: linear-gradient(180deg, #7ACFEE 0%, #44A1D7 100%);
@include ctf(center);
.wi-icon{
flex-shrink: 0;
margin-right: 4upx;
width: 44upx;
height: 44upx;
}
.wi-txt{
@include flcw(32upx, 44upx, #FFFFFF, 500);
}
&+.wb-item{
background-image: linear-gradient(180deg, #4A4A4A 0%, #000000 100%);
}
}
}
}
</style>

BIN
src/subpackage/wallet/static/images/arrow_b2.png

After

Width: 40  |  Height: 40  |  Size: 251 B

BIN
src/subpackage/wallet/static/images/arrow_c33.png

After

Width: 24  |  Height: 24  |  Size: 599 B

BIN
src/subpackage/wallet/static/images/close.png

After

Width: 34  |  Height: 34  |  Size: 233 B

BIN
src/subpackage/wallet/static/images/dy_logo.png

After

Width: 44  |  Height: 44  |  Size: 914 B

BIN
src/subpackage/wallet/static/images/filter.png

After

Width: 40  |  Height: 40  |  Size: 290 B

BIN
src/subpackage/wallet/static/images/question_mark.png

After

Width: 56  |  Height: 56  |  Size: 1023 B

BIN
src/subpackage/wallet/static/images/success_tip.png

After

Width: 100  |  Height: 102  |  Size: 974 B

61
src/utils/util.js

@ -50,7 +50,7 @@ export const routeTo = (url,type) => {
}
}
function showNone(txt,duration=1500){
export function showNone(txt,duration=1500){
uni.hideToast();
uni.hideLoading();
uni.showToast({
@ -61,16 +61,17 @@ function showNone(txt,duration=1500){
})
}
function showLoad(title='加载中', mask=true){
export function showLoad(title='加载中', mask=true){
uni.showLoading({
mask,
title,
})
}
function hideLoad(){
export function hideLoad(){
uni.hideLoading()
}
function showModal({
export function showModal({
title='提示',
content='',
showCancel=false,
@ -117,7 +118,8 @@ function showModalMsg(_content='加载中', _mshowCancel=true){
})
}
function debounce(func, wait, immediate) {
export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result;
const later = function() {
// 据上一次触发时间间隔
@ -398,6 +400,52 @@ function order_pay_type_txt(status = ''){
return _obj[status] || '-'
}
function checkFileInfo(url){//获取文件信息, 超过2M时提醒太大, 文件格式要求JPG、JPEG、PNG
let util = this
return new Promise((rs,rj)=>{
try{
let MAX_SIZE = 2048; //最大size限制
let type = url.split(".")[1]||""
// JPG、JPEG、PNG
let need_type = [,'jpeg','jpg','png','JPG','JPEG','PNG']
if(need_type.indexOf(type)>0){
console.log("文件格式符合预期:",type)
}else{
util.showNone(`当前文件格式${type}不符合预期,请重新上传`)
rj(false)
}
rs(true)
console.log(wx.env.USER_DATA_PATH,123,url)
const fs = wx.getFileSystemManager()
// const fd = fs.openSync({
const fd = fs.openSync({
// filePath: `${wx.env.USER_DATA_PATH}/hello.txt`,
filePath:url,
flag: 'a+'
})
const stats = fs.fstatSync({fd: fd})
let size = stats.size||0
size = size/1024
if(size>MAX_SIZE){
util.showNone(`上传图片最大为${MAX_SIZE/1024}M,当前为:${(size/1024).toFixed(2)}M`)
rj(false)
}
if(!size){
util.showNone("请上传正确的图片")
rj(false)
}
rs(stats)
}catch(e){
util.showNone(e);
rj(e)
}
})
}
export default {
formatTime,
formatNumber,
@ -430,5 +478,6 @@ export default {
isProfile,
$_once,
$_emit,
order_pay_type_txt
order_pay_type_txt,
checkFileInfo,
}
Loading…
Cancel
Save