sadjv3_user/my/wallet/index.vue

1380 lines
36 KiB
Vue
Raw Normal View History

2024-06-05 19:16:02 +08:00
<template>
2024-06-12 15:52:21 +08:00
<view class="content">
<!-- <view class="flex text-center text-lg bg" v-if="isAgency == 1 && tgCheck != '否'">
2024-06-05 19:16:02 +08:00
<view class="title_btn flex-sub bg" @click="cut(1)" :class="title_color==1?'bgCol2': ''">我的充值
</view>
<view class="title_btn flex-sub bg" @click="cut(2)" :class="title_color==2?'bgCol2': ''">我的收益
</view>
2024-06-12 15:52:21 +08:00
</view> -->
<view v-if="title_color==1" class="content-top">
2024-06-05 19:16:02 +08:00
<view class="bgimg">
2024-06-12 15:52:21 +08:00
<view class="bgimg-top">
<view class="bgimg-top-tou">
<u-avatar :src="avatar" size="106"></u-avatar>
2024-06-05 19:16:02 +08:00
</view>
2024-06-12 15:52:21 +08:00
<view class="bgimg-top-view">
<view class="bgimg-top-money">
<span>{{money}}</span>
<span>账户余额()</span>
</view>
2024-06-28 23:10:59 +08:00
<view class="mingxi" v-if="artificerIdMy==true" @click="goNav('/my/wallet/mymoneydetail')">钱包明细</view>
2024-06-05 19:16:02 +08:00
</view>
</view>
2024-06-12 15:52:21 +08:00
<view class="money-miao">只能用于平台消费支付充值后不可退款</view>
2024-06-05 19:16:02 +08:00
</view>
2024-06-12 15:52:21 +08:00
<view class="padding-lr padding-bottom">
2024-06-24 11:29:11 +08:00
<view class="chongzhi">
<span class="yu-e">余额充值</span>
2024-06-25 13:59:23 +08:00
<span v-if="artificerIdMy==true" @click="goNavtherapist('/pages/therapist/therapistDingdan')">为TA充值</span>
2024-06-05 19:16:02 +08:00
</view>
2024-07-01 13:55:22 +08:00
<view class="coupon-level" v-for="(item,index) in wallet" :key='index'@click="active(item)" :class="{active:item.isSelect}">
2024-07-01 11:50:18 +08:00
<view class="r-amount">
2024-07-01 13:55:22 +08:00
<span>¥{{item.price}}</span>
<span>¥{{item.sumMoney}}</span>
2024-07-01 11:50:18 +08:00
</view>
<view class="bo-amount">
<view class="amount-balance">
<view>
<span>赠送</span>
2024-07-01 13:55:22 +08:00
<span>{{item.money}}</span>
2024-07-01 11:50:18 +08:00
<span>余额</span>
</view>
</view>
<view class="amount-block">
2024-07-01 13:55:22 +08:00
<view class="amount-block-lin" v-for="(itemList,indexList) in item.detailList" :key='indexList'><span>{{itemList.coupon.money}}</span>{{itemList.giveNum}}</span></view>
2024-06-05 19:16:02 +08:00
</view>
</view>
</view>
</view>
2024-06-12 15:52:21 +08:00
<view class="padding-lr radius fuqian" style="margin-top: 20rpx;">
2024-06-05 19:16:02 +08:00
<view>
<view class="flex align-center justify-between" style="height: 100upx;padding: 20upx 0;"
v-for="(item,index) in openLists" :key='index'>
<view class="flex align-center">
<image :src="item.image" style="width: 50upx;height: 50upx;border-radius: 50upx;"></image>
<view style="font-size: 30upx;margin-left: 20upx;">{{item.text}}
</view>
</view>
2024-06-25 09:47:53 +08:00
2024-06-05 19:16:02 +08:00
<radio-group name="openWay" style="margin-left: 20upx;" @tap='selectWay(item)'>
<label class="tui-radio">
<radio color="#096f4b" :checked="openWay === item.id ? true : false" />
</label>
</radio-group>
</view>
</view>
</view>
2024-06-12 15:52:21 +08:00
<!-- <view class="bg radius padding" style="margin-top: 20rpx;margin-bottom: 20rpx;">
2024-06-05 19:16:02 +08:00
<view class="flex align-center justify-between" @click="goNav('/my/wallet/mymoneydetail')">
<view class="flex align-center">
<view>钱包明细</view>
</view>
<image src="../../static/img/you.png" style="width: 16rpx;height: 28rpx;"></image>
</view>
<view class="flex align-center justify-between margin-top-xl" @click="goNav('/my/wallet/zhifubao')"
v-if="isAgency == 1">
<view class="flex align-center">
<view>提现账号</view>
</view>
<image src="../../static/img/you.png" style="width: 16rpx;height: 28rpx;"></image>
</view>
<view class="flex align-center justify-between margin-top-xl" @click="goNav('/my/wallet/cashList')"
v-if="isAgency == 1">
<view class="flex align-center">
2024-06-12 15:52:21 +08:00
2024-06-05 19:16:02 +08:00
<view>提现记录</view>
</view>
<image src="../../static/img/you.png" style="width: 16rpx;height: 28rpx;"></image>
</view>
2024-06-12 15:52:21 +08:00
</view> -->
2024-06-24 11:29:11 +08:00
<!-- <view class="flex justify-around margin-top " v-if="jsczSel != '否'">
<view @click="goNav('/pages/therapist/therapistList?index=2')">为TA充值</view>
<view @click="goNav('/pages/therapist/therapistList?index=3')">我的理疗师</view>
</view> -->
2024-06-25 21:25:46 +08:00
<view
style="position: fixed;bottom: 0rpx;left: 0;right: 0;background: #FFFFFF;height: 110rpx;line-height: 110rpx;z-index: 999;">
<view class="btn" @click="pay"
style="background: linear-gradient(to right, #019c88, #31c194);color: #FFFFFF;margin: 16rpx 30upx;position: fixed;bottom: 0upx;width: 90%;border-radius: 50rpx;height: 78rpx;line-height: 78rpx;font-size: 32rpx;">
确定充值</view>
2024-06-05 19:16:02 +08:00
</view>
</view>
<view v-if="title_color==2 && isAgency == 1">
<view class="bg padding dhjsbg">
<view class="" style="font-size: 28rpx;color: #FFFFFF;margin-top: 6px;">可用余额()</view>
<view class="flex" style="font-size: 60rpx;color: #FFFFFF;margin-top: 6px;font-weight: bold;">
<!-- <view class="text-xxl"></view> -->
<view><text style="font-size: 32rpx;margin-right: 6px;">¥</text>{{money}}</view>
</view>
</view>
<view class="padding" style="margin-top: -60px;">
<view class="bg padding" style="border-radius: 20rpx;">
<view class="text-lg margin-bottom">提现金额</view>
<input type="number" placeholder="请输入提现金额" v-model="moneyNum">
<view style="width: 100%;height: 1rpx;background: #F2F2F2;margin-top: 15rpx;"></view>
<view class="text-grey margin-top-sm">{{placeholder}}</view>
<view class="margin-top-xs" style="color: red;font-size: 26rpx;" v-if="txMsg">*{{txMsg}}</view>
</view>
<view class="bg margin-top padding-lr" style="border-radius: 20rpx;">
<view>
<view v-for="(item,index) in openList" :key='index'>
<view class="align-center justify-between"
2024-06-25 21:25:46 +08:00
style="display: flex;height: 100upx;padding: 20upx 0; "
2024-06-05 19:16:02 +08:00
v-if="item.text === '微信' && wxTxSel != '否'">
<view class="flex align-center">
<image :src="item.image" style="width: 50upx;height: 50upx;border-radius: 50upx;">
</image>
<view style="font-size: 30upx;margin-left: 20upx;">{{item.text}}
</view>
</view>
<radio-group name="openWay" style="margin-left: 20upx;" @tap='selectWay(item)'>
<label class="tui-radio">
2024-06-25 21:25:46 +08:00
<radio color="#019c88" :checked="openWay === item.id ? true : false" />
2024-06-05 19:16:02 +08:00
</label>
</radio-group>
</view>
<view class="align-center justify-between"
style="display: flex;height: 100upx;padding: 20upx 0;"
v-if="item.text === '银联' && ylTxSel != '否'">
<view class="flex align-center">
<image src="../../static/images/yinlian.png"
style="width: 50upx;height: 50upx;border-radius: 50upx;"></image>
<view style="font-size: 30upx;margin-left: 20upx;">{{item.text}}
</view>
</view>
<radio-group name="openWay" style="margin-left: 20upx;" @tap='selectWay(item)'>
<label class="tui-radio" style="width: 30rpx;">
2024-06-25 21:25:46 +08:00
<radio color="#019c88" :checked="openWay === item.id ? true : false" />
2024-06-05 19:16:02 +08:00
</label>
</radio-group>
</view>
<view class="align-center justify-between"
style="display: flex;height: 100upx;padding: 20upx 0;" v-if="item.text === '支付宝'">
<view class="flex align-center">
<image :src="item.image" style="width: 50upx;height: 50upx;border-radius: 50upx;">
</image>
<view style="font-size: 30upx;margin-left: 20upx;">{{item.text}}
</view>
</view>
<radio-group name="openWay" style="margin-left: 20upx;" @tap='selectWay(item)'>
<label class="tui-radio">
2024-06-25 21:25:46 +08:00
<radio color="#019c88" :checked="openWay === item.id ? true : false" />
2024-06-05 19:16:02 +08:00
</label>
</radio-group>
</view>
</view>
</view>
</view>
<view class="bg radius margin-top padding" style="border-radius: 20rpx;">
<view class="flex align-center justify-between" @click="goNav('/my/wallet/mymoneydetail')">
<view class="flex align-center">
<!-- <image
src="https://admin.sjajk.com/file/uploadPath/2023/01/03/da75d52b95a64fc349d0353ab16cb719.png"
style="width: 44rpx;height: 44rpx;"></image> -->
<view>钱包明细</view>
</view>
<image src="../../static/img/you.png" style="width: 16rpx;height: 28rpx;"></image>
</view>
<view class="flex align-center justify-between margin-top-xl" @click="goNav('/my/wallet/zhifubao')">
<view class="flex align-center">
<!-- <image
src="https://admin.sjajk.com/file/uploadPath/2023/01/03/ba45c8489a14029c1782ac0a28fd8a49.png"
style="width: 48rpx;height: 34rpx;"></image> -->
<view>提现账号</view>
</view>
<image src="../../static/img/you.png" style="width: 16rpx;height: 28rpx;"></image>
</view>
<view class="flex align-center justify-between margin-top-xl" @click="goNav('/my/wallet/cashList')">
<view class="flex align-center">
<!-- <image
src="https://admin.sjajk.com/file/uploadPath/2023/01/03/e90eb8a74548dc3b11c3c856e24e6fbc.png"
style="width: 40rpx;height: 52rpx;"></image> -->
<view>提现记录</view>
</view>
<image src="../../static/img/you.png" style="width: 16rpx;height: 28rpx;"></image>
</view>
<view class="flex align-center justify-between margin-top-xl" @click="goNav('/my/wallet/yinhangka')"
v-if="isAgency == 1 && ylTxSel != '否'">
<view class="flex align-center">
<!-- <image
src="https://admin.sjajk.com/file/uploadPath/2023/01/03/ba45c8489a14029c1782ac0a28fd8a49.png"
style="width: 48rpx;height: 34rpx;"></image> -->
<view>银行卡账号</view>
</view>
<image src="../../static/img/you.png" style="width: 16rpx;height: 28rpx;"></image>
</view>
<!-- <view @click="TuiPrice()" v-if="renzheng ==2||renzheng ==5">退保证金</view> -->
</view>
</view>
<view
style="position: fixed;bottom: 0rpx;left: 0;right: 0;background: #FFFFFF;height: 110rpx;line-height: 110rpx;z-index: 999;">
<view class="btn" @click="cashMoney">立即提现</view>
</view>
</view>
2024-06-24 11:29:11 +08:00
<view>
<!-- 普通弹窗 -->
<uni-popup ref="popup" background-color="#fff" @change="change">
<view class="popup-content">
<view class="popup-head">
2024-06-25 09:47:53 +08:00
<span>为TA充值</span>
2024-06-24 11:29:11 +08:00
<span @click="closePopup(type)">x</span>
</view>
<view class="popup-mian">
<!-- <view class="popup-mian-textarea">
<view class="popup-mian-view">
<span>原服务项目价格:</span>
<span>198</span>
</view>
<view class="popup-mian-view">
<span>现服务项目价格:</span>
<span>298</span>
</view>
<view class="popup-mian-view">
<span>改价需支付差价:</span>
<span>100</span>
</view>
</view> -->
<view class="chong">
2024-06-25 09:47:53 +08:00
<checkbox-group @change="checkboxChange">
<view class="chong-list">
<view class="chong-list-left">
<label class="tui-radio">
<checkbox :checked="checkbox" activeBackgroundColor="#096f4b" color="#096f4b" :value="1"/>
</label>
<image src="../../static/jinggao.png" mode=""></image>
2024-06-24 11:29:11 +08:00
</view>
2024-06-25 09:47:53 +08:00
<view class="chong-list-right">
<view class="chong-title">
<span>王丽楠</span>
<image src="../../static/xinren.png" mode=""></image>
2024-06-24 11:29:11 +08:00
</view>
2024-06-25 09:47:53 +08:00
<view class="chong-bottom">
<view class="chong-bottom-ding">
<image src="../../static/orderDetail/dingwei.png" mode=""></image>
<span>0.8km</span>
</view>
<view class="chong-bottom-cheng">
<image class="therapist-bottom-img" src="../../static/dituzhaoren5.png">
<span>春城有约</span>
</view>
2024-06-24 11:29:11 +08:00
</view>
</view>
</view>
2024-06-25 09:47:53 +08:00
</checkbox-group>
2024-06-24 11:29:11 +08:00
</view>
<view class="popup-mian-btn">
<span @click="closePopup(type)">
取消
</span>
<span>
确定
</span>
</view>
</view>
</view>
</uni-popup>
</view>
2024-06-05 19:16:02 +08:00
</view>
</template>
<script>
export default {
data() {
return {
2024-06-25 09:47:53 +08:00
checkbox:false,
2024-06-24 11:29:11 +08:00
type:'center',
2024-06-05 19:16:02 +08:00
jsczSel: '否',
tgCheck: '否',
isAgency: 0,
tablist: [{
id: 1,
name: '我的充值'
}, {
id: 2,
name: '我的提现'
}],
title_color: 1,
money: 0,
avatar: '',
Profit: 0,
openLists: [{
image: '../static/zhifubao.png',
text: '支付宝',
id: 1
}, {
image: '../static/icon_weixin.png',
text: '微信',
id: 2
}],
openList: [{
image: '../static/zhifubao.png',
text: '支付宝',
id: 1
}, {
image: 'https://admin.sjajk.com/file/uploadPath/2023/02/22/88a1bd822b9632aaef8894021f7c9050.jpg',
text: '银联',
id: 2
}, {
image: '../static/icon_weixin.png',
text: '微信',
id: 3
}],
wxTxSel: '否',
ylTxSel: '否',
tabIndex: 0,
bankCard: '',
openWay: 2,
wallet: [],
moneyNum: null,
thisSelect: {},
charge: 0, //提现手续费
maxMoney: 0, //最高提现额度
minMoney: 0, //最低提现额度
ratio: '', //金元比例
placeholder: '',
renzheng: 0,
sp: 0,
2024-06-24 11:29:11 +08:00
txMsg: '',
2024-06-25 09:47:53 +08:00
nameTxt:'',
couponId:'',
2024-06-25 09:51:43 +08:00
artificerId:'',
2024-06-30 09:49:59 +08:00
artificerIdMy:false,
ordersId:''
2024-06-05 19:16:02 +08:00
}
},
onLoad(d) {
2024-06-25 13:59:23 +08:00
if(d.artificerId){
this.artificerId=d.artificerId;
}
if(d.text){
this.artificerIdMy=true
}else{
this.artificerIdMy=false
}
2024-06-05 19:16:02 +08:00
if (d.tabIndex) {
this.tabIndex = d.tabIndex;
this.title_color = 2;
} else {
this.tabIndex = 0;
}
2024-06-24 11:29:11 +08:00
2024-06-05 19:16:02 +08:00
this.wxTxSel = this.$queue.getData('wxTxSel');
this.ylTxSel = this.$queue.getData('ylTxSel');
this.jsczSel = this.$queue.getData('jsczSel');
this.txMsg = this.$queue.getData('txMsg');
this.avatar = uni.getStorageSync('avatar')
this.renzheng = uni.getStorageSync("renzheng")
2024-06-30 09:49:59 +08:00
this.nameTxt=d.text;
this.ordersId=d.ordersId
2024-06-05 19:16:02 +08:00
this.getMoneyList();
// #ifndef MP-WEIXIN
this.openLists = [{
image: '../../static/images/my/zhifubao.png',
text: '支付宝',
id: 1
}, {
image: '../../static/images/my/icon_weixin.png',
text: '微信',
id: 2
}];
this.openWay = 1;
// #endif
// #ifdef MP-WEIXIN
this.openLists = [{
image: '../../static/share/icon_weixin.png',
text: '微信',
id: 2
}];
this.openWay = 2;
// #endif
},
onShow() {
this.tgCheck = this.$queue.getData('tgCheck');
this.getMoney()
this.getCharge()
this.getMinMoney()
this.getMaxMoney()
this.getRatio()
this.getUserInfo()
},
methods: {
2024-06-25 09:47:53 +08:00
checkboxChange(e){//选择优惠卷
this.couponId=e.detail.value.join(",");
},
2024-06-05 19:16:02 +08:00
getMoneyList() {
this.$Request.get("/app/payClassify/selectPayClassifyList").then(res => {
if (res.code == 0) {
this.wallet = [];
res.data.forEach((d, index) => {
if (index == 0) {
d.isSelect = true;
this.thisSelect = d;
} else {
d.isSelect = false;
}
this.wallet.push(d);
});
}
});
},
2024-06-24 11:29:11 +08:00
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
closePopup(type){//改价 关闭弹出框
this.type = type
this.$refs.popup.close(type);
},
toggle(type) {//改价 弹出框
this.type = type
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
this.$refs.popup.open(type)
},
2024-06-05 19:16:02 +08:00
//退保证金
TuiPrice() {
let that = this
let zhiFuBao = uni.getStorageSync('zhiFuBao')
let zhiFuBaoName = uni.getStorageSync('zhiFuBaoName')
if (!zhiFuBao && !zhiFuBaoName) {
uni.navigateTo({
url: '/my/wallet/zhifubao'
})
} else {
let renzheng = uni.getStorageSync("renzheng")
console.log(renzheng)
if (renzheng == 2 || renzheng == 5) {
uni.showModal({
title: '提示',
content: '是否确定退还保证金?退还后将不能发布订单',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
that.$Request.post("/app/userCertification/exitMoney").then(res => {
console.log(res)
if (res.msg == '您还有未下架的订单,请先下架!') {
uni.showToast({
title: res.msg,
icon: 'none'
});
} else if (res.msg == '您还有未服务的订单,请先完成!') {
uni.showToast({
title: res.msg,
icon: 'none'
});
} else if (res.msg == 'success') {
uni.showToast({
title: '退还成功',
icon: 'none'
});
uni.switchTab({
url: '/pages/my/index'
})
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
}
},
getUserInfo() {
this.$Request.get("/app/user/selectUserById").then(res => {
if (res.code == 0) {
this.avatar = res.data.avatar ? res.data.avatar : '../../static/logo.png'
if (this.tabIndex == 1) {
this.isAgency = 1
} else {
this.isAgency = res.data.isAgency ? res.data.isAgency : 0
}
if (res.data.bankCard) {
this.bankCard = res.data.bankCard
}
uni.setStorageSync('avatar', res.data.avatar)
}
});
},
// 提现手续费
getCharge() {
this.$Request.get("/app/common/type/152").then(res => {
if (res.code == 0) {
this.charge = res.data.value
this.placeholder = '服务费:' + this.charge * 100 + '%' + ',最低提现:' +
this.minMoney * 1 + ',最高提现:' + this.maxMoney * 1
}
});
},
// 最低提现额度
getMinMoney() {
this.$Request.get("/app/common/type/112").then(res => {
if (res.code == 0) {
this.minMoney = res.data.value
this.placeholder = '服务费:' + this.charge * 100 + '%' + ',最低提现:' +
this.minMoney * 1 + ',最高提现:' + this.maxMoney * 1
}
});
},
// 最高提现额度
getMaxMoney() {
this.$Request.get("/app/common/type/153").then(res => {
if (res.code == 0) {
this.maxMoney = res.data.value
this.placeholder = '服务费:' + this.charge * 100 + '%' + ',最低提现:' +
this.minMoney * 1 + ',最高提现:' + this.maxMoney * 1
}
});
},
// 金元比例
getRatio() {
this.$Request.get("/app/common/type/154").then(res => {
if (res && res.code == 0 && res.data) {
this.ratio = res.data.value
this.placeholder = '服务费:' + this.charge * 100 + '%' + ',最低提现:' +
this.minMoney * 1 + ',最高提现:' + this.maxMoney * 1
this.wallet.forEach(re => {
re.num = re.price * res.data.value
})
}
});
},
cut(e) {
this.title_color = e
},
2024-06-25 09:47:53 +08:00
goNavtherapist(url){
uni.setStorage({
key: 'taocanDd',
data: '充值',
success: function () {
uni.navigateTo({
url: url
})
}
});
},
2024-06-05 19:16:02 +08:00
goNav(url) {
2024-06-25 09:47:53 +08:00
2024-06-05 19:16:02 +08:00
uni.navigateTo({
url
})
},
active(e) {
2024-07-01 13:55:22 +08:00
console.log("sadsadsadsadsad",e)
2024-06-05 19:16:02 +08:00
this.wallet.forEach(res => {
if (res.payClassifyId == e.payClassifyId) {
res.isSelect = true
this.thisSelect = e
} else {
res.isSelect = false
}
})
},
// 我的余额
getMoney() {
this.$Request.get("/app/userMoney/selectMyMoney").then(res => {
if (res.code == 0 && res.data) {
console.log(res.data.money)
this.money = res.data.money
}
});
},
selectWay: function(item) {
this.openWay = item.id;
},
pay() {
if (this.openWay == 2) {
// #ifdef APP-PLUS
// 微信APP支付 根据订单id获取支付信息
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 1,
2024-06-30 09:49:59 +08:00
userId: uni.getStorageSync('userId'),
2024-07-01 13:55:22 +08:00
}
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
2024-06-05 19:16:02 +08:00
}
this.$Request.post("/app/wxPay/payMoney", data).then(ret => {
console.log(ret)
this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data));
});
// #endif
// #ifdef MP-WEIXIN
// 微信小程序支付
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 3,
userId: uni.getStorageSync('userId')
}
2024-07-01 13:55:22 +08:00
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
2024-06-05 19:16:02 +08:00
this.$Request.post('/app/wxPay/payMoney', data).then(ret => {
uni.hideLoading()
uni.requestPayment({
provider: 'wxpay',
timeStamp: ret.data.timestamp,
nonceStr: ret.data.noncestr,
package: ret.data.package,
signType: ret.data.signType,
paySign: ret.data.sign,
success: function(suc) {
console.log('success:' + JSON.stringify(suc));
uni.showToast({
title: '支付成功',
icon: 'success'
})
2024-06-28 23:10:59 +08:00
this.getMoney()
2024-06-05 19:16:02 +08:00
setTimeout(d => {
uni.navigateBack(1)
}, 1000);
},
fail: function(err) {
console.log('fail:' + JSON.stringify(err));
uni.showToast({
title: '支付失败',
icon: 'none'
})
}
});
});
// #endif
// #ifdef H5
let ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') !== -1) {
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 2,
userId: uni.getStorageSync('userId')
}
2024-07-01 13:55:22 +08:00
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
2024-06-05 19:16:02 +08:00
this.$Request.post('/app/wxPay/payMoney', data).then(res => {
if (res.code == 0) {
this.callPay(res.data);
2024-06-28 23:10:59 +08:00
this.getMoney()
2024-06-05 19:16:02 +08:00
} else {
uni.showToast({
icon: 'none',
title: '支付失败!'
});
}
});
} else {
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 4,
userId: uni.getStorageSync('userId')
}
2024-07-01 13:55:22 +08:00
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
2024-06-05 19:16:02 +08:00
this.$Request.post('/app/wxPay/payMoney', data).then(res => {
if (res.code == 0) {
const urlArr = window.location.href;
const hostUrl = urlArr.split("/");
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
const url = '&redirect_url=' + callBack + 'my/wallet/index';
window.location = res.data.mweb_url + url
2024-06-28 23:10:59 +08:00
this.getMoney()
2024-06-05 19:16:02 +08:00
} else {
uni.showToast({
icon: 'none',
title: '支付失败!'
});
}
});
}
// #endif
} else {
// #ifdef H5
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 2,
2024-06-25 09:47:53 +08:00
userId: uni.getStorageSync('userId'),
2024-06-05 19:16:02 +08:00
}
2024-06-25 15:20:37 +08:00
if(this.artificerId){
data.artificerId=this.artificerId
2024-07-01 13:55:22 +08:00
}
if(this.ordersId){
data.ordersId=this.ordersId
2024-06-25 15:20:37 +08:00
}
2024-06-05 19:16:02 +08:00
this.$Request.post('/app/aliPay/payOrderMoney', data).then(
res => {
2024-06-25 09:47:53 +08:00
if (res.code == 0) {
uni.showToast({
title: '支付成功!'
});
2024-06-28 23:10:59 +08:00
this.getMoney()
2024-06-25 10:50:05 +08:00
// const div = document.createElement('div')
// div.innerHTML = res.data //此处form就是后台返回接收到的数据
// document.body.appendChild(div)
// document.forms[0].submit()
2024-06-25 09:47:53 +08:00
// setTimeout(d => {
// uni.navigateBack(1)
// }, 1000);
2024-06-05 19:16:02 +08:00
} else {
uni.showToast({
icon: 'none',
title: '支付失败!'
});
}
});
// #endif
// #ifdef APP-PLUS
// APP支付宝支付
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 1,
userId: uni.getStorageSync('userId')
}
2024-07-01 13:55:22 +08:00
if(this.artificerId){
data.artificerId=this.artificerId
}
if(this.ordersId){
data.ordersId=this.ordersId
}
2024-06-05 19:16:02 +08:00
this.$Request.post("/app/aliPay/payOrderMoney", data).then(ret => {
console.log(ret)
2024-06-28 23:10:59 +08:00
this.getMoney()
2024-06-05 19:16:02 +08:00
this.isCheckPay(ret.code, 'alipay', ret.data);
});
// #endif
}
},
callPay: function(response) {
if (typeof WeixinJSBridge === "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response));
document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response));
}
} else {
this.onBridgeReady(response);
}
},
onBridgeReady: function(response) {
let that = this;
if (!response.package) {
return;
}
console.log(response, '++++++++')
WeixinJSBridge.invoke(
'getBrandWCPayRequest', {
"appId": response.appid, //公众号名称,由商户传入
"timeStamp": response.timestamp, //时间戳自1970年以来的秒数
"nonceStr": response.noncestr, //随机串
"package": response.package,
"signType": response.signType, //微信签名方式:
"paySign": response.sign //微信签名
},
function(res) {
console.log(res, '/*-/*-/*-')
if (res.err_msg === "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok但并不保证它绝对可靠。
uni.showLoading({
title: '支付成功'
});
setTimeout(function() {
uni.hideLoading();
}, 1000);
} else {
uni.hideLoading();
}
WeixinJSBridge.log(response.err_msg);
}
);
},
isCheckPay(status, name, order) {
if (status == 0) {
this.setPayment(name, order);
} else {
uni.hideLoading();
uni.showToast({
title: '支付信息有误',
icon: 'none'
});
}
},
setPayment(name, order) {
console.log('*-*-*')
uni.requestPayment({
provider: name,
orderInfo: order, //微信、支付宝订单数据
success: function(res) {
console.log(res)
uni.hideLoading();
uni.showLoading({
title: '支付成功'
});
},
fail: function(err) {
console.log(err)
uni.hideLoading();
},
complete() {
uni.hideLoading();
}
});
},
// 提现
cashMoney() {
if (!this.moneyNum) {
uni.showToast({
icon: 'none',
title: '请输入提现金额'
})
return
}
if (this.moneyNum > this.money * 1) {
uni.showToast({
icon: 'none',
title: '您的余额不足'
})
return
}
if (this.moneyNum < this.minMoney * 1) {
uni.showToast({
icon: 'none',
title: '最低可提现10元'
})
return
}
// if (this.moneyNum*1+this.charge*this.moneyNum > this.money*1) {
// uni.showToast({
// icon: 'none',
// title: '您的手续费不足'
// })
// return
// }
let zhiFuBao = uni.getStorageSync('zhiFuBao')
let zhiFuBaoName = uni.getStorageSync('zhiFuBaoName')
// if (this.openWay == 2) {
if (!zhiFuBao && !zhiFuBaoName && this.openWay == 1) {
uni.navigateTo({
url: '/my/wallet/zhifubao'
})
return
}
if (!this.bankCard && this.openWay == 2) {
uni.navigateTo({
url: '/my/wallet/yinhangka'
})
return
}
let that = this
that.sp = (that.moneyNum * this.charge).toFixed(2)
uni.showModal({
title: '提示',
content: '本次提现' + that.moneyNum + '元,服务费' + this.sp + '元,是否确认提现?',
success: function(res) {
if (res.confirm) {
that.$Request.get("/app/cash/cashMoney", {
money: that.moneyNum,
userType: 1,
classify: that.openWay
}).then(res => {
if (res.code == 0) {
uni.showToast({
icon: 'none',
title: res.msg
})
2024-06-28 23:10:59 +08:00
this.getMoney()
2024-06-05 19:16:02 +08:00
that.moneyNum = null
} else {
uni.showToast({
icon: 'none',
title: res.msg
})
}
that.getMoney()
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
}
}
</script>
2024-06-12 15:52:21 +08:00
<style scoped>
2024-06-25 09:47:53 +08:00
/deep/uni-checkbox .uni-checkbox-input{
width: 26px;
height: 26px;
border-radius: 50%;
}
.checkbox-data{
padding: 0px 11px;
margin: 15px 0px;
}
2024-06-24 11:29:11 +08:00
.chong-list:last-child{
border: 0px !important;
}
.chong-bottom-cheng image{
width: 22.22rpx;
height: 22.22rpx;
margin-right: 5px;
}
.chong-bottom-cheng span{
font-weight: 500;
font-size: 23rpx;
color: #222222;
}
.chong-bottom-ding image{
width: 18.75rpx;
height: 21.53rpx;
margin-right: 5px;
}
.chong-bottom-ding span{
font-weight: bold;
font-size: 25rpx;
color: #848485;
}
.chong-bottom-ding,.chong-bottom-cheng{
display: flex;
flex-direction: row;
align-items: center;
}
.chong-bottom{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-top: 10px;
}
.chong-title image{
2024-06-25 21:25:46 +08:00
width: 66rpx;
height: 32.22rpx;
2024-06-24 11:29:11 +08:00
}
.chong-title span{
font-weight: 400;
font-size: 29rpx;
color: #333333;
margin-right: 5px;
}
.chong-title{
display: flex;
flex-direction: row;
align-items: center;
}
.chong-list-right{
width: 75%;
display: flex;
flex-direction: column;
}
.chong-list-left image{
width: 76rpx;
height: 76rpx;
}
/deep/uni-radio .uni-radio-input{
2024-06-25 21:25:46 +08:00
width: 31.86rpx;
height: 31.86rpx;
margin: -4px 0px 0px -8px;
2024-06-24 11:29:11 +08:00
}
.chong-list-radio{
width: 29.86rpx;
height: 29.86rpx;
2024-06-25 21:25:46 +08:00
border-radius: 50%;
2024-06-24 11:29:11 +08:00
}
.chong-list-left{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.chong-list{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 10px 0px;
border-bottom: 1px solid #DCDCDC;
}
.chong{
width: 100%;
display: flex;
flex-direction: column;
}
.img-span{
display: flex;
justify-content: center;
align-items: center;
width: 40px;
height: 16px;
line-height: 16px;
background: linear-gradient(-90deg, #FF6F48, #FF9E69);
border-top-left-radius: 15rpx;
border-bottom-right-radius: 15rpx;
font-weight: bold;
font-size: 18rpx;
color: #FFFFFF;
position: absolute;
bottom: 0;
right: 0;
margin: 0 6px 6px 0px;
}
.popup-mian-view span:nth-child(1){
color: #666666;
}
.popup-mian-view span:nth-child(2){
color: #333;
font-weight: bold;
}
.popup-mian-view span{
font-size: 29rpx;
}
.popup-mian-view{
width: 100%;
height: 35px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #DCDCDC;
}
.popup-mian-textarea{
width: 100%;
display: flex;
flex-direction: column;
}
.popup-mian-btn span:nth-child(1){
background: linear-gradient(90deg, #FE912E, #FF9970);
}
.popup-mian-btn span:nth-child(2){
background: linear-gradient(90deg, #019C88, #28BA92, #35C495);
}
.popup-mian-btn span{
width: 247rpx;
height: 77rpx;
line-height: 77rpx;
text-align: center;
font-weight: 400;
font-size: 32rpx;
color: #FFFEFE;
border-radius: 39rpx;
2024-06-25 21:25:46 +08:00
margin-left: 10px;
2024-06-24 11:29:11 +08:00
}
.popup-mian-btn{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-top: 10px;
}
.popup-mian{
display: flex;
flex-direction: column;
2024-06-25 21:25:46 +08:00
margin: 10px auto 0px auto;
2024-06-24 11:29:11 +08:00
}
.popup-head span:nth-child(2){
width: 50rpx;
height: 50rpx;
2024-06-25 21:25:46 +08:00
line-height: 21px;
2024-06-24 11:29:11 +08:00
text-align: center;
2024-06-25 21:25:46 +08:00
font-size: 25px;
color: #019c88;
2024-06-24 11:29:11 +08:00
border-radius: 50%;
2024-06-25 21:25:46 +08:00
border: 1px solid #019c88;
2024-06-24 11:29:11 +08:00
}
.popup-head span:nth-child(1){
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
.popup-head{
width: 100%;
height: 99.38rpx;
background-color: rgba(21, 171, 141, 0.09);
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
2024-06-25 21:25:46 +08:00
padding: 0 20px;
2024-06-24 11:29:11 +08:00
}
.popup-content{
width: 613rpx;
padding-bottom: 10px;
background: #FFFFFF;
2024-06-25 21:25:46 +08:00
border-radius: 40rpx;
2024-06-24 11:29:11 +08:00
display: flex;
flex-direction: column;
}
2024-06-12 15:52:21 +08:00
.coupon-bottom{
font-weight: 400;
font-size: 28rpx;
}
.coupon{
font-weight: bold;
font-size: 37rpx;
}
/deep/.fuqian{
background: #fff;
border-radius: 15px;
width: 95%;
margin: 0 auto;
}
2024-06-24 11:29:11 +08:00
.chongzhi span:nth-child(2){
2024-06-25 21:25:46 +08:00
color: #019c88;
2024-06-24 11:29:11 +08:00
background-color: #fff;
2024-06-25 21:25:46 +08:00
padding: 3px 8px;
2024-06-24 11:29:11 +08:00
font-weight: bold;
2024-06-25 21:25:46 +08:00
font-size: 24rpx;
border:1px solid #019c88;
2024-06-24 11:29:11 +08:00
border-radius: 30px;
}
.chongzhi{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
2024-06-12 15:52:21 +08:00
.yu-e{
font-weight: bold;
font-size: 35rpx;
color: #333333;
}
.money-miao{
width: 95%;
height: 49rpx;
2024-06-25 21:25:46 +08:00
line-height: 49rpx;
2024-06-12 15:52:21 +08:00
background-color: rgba(93, 191, 157, 0.28);
border-radius: 24rpx;
margin: 0 auto;
font-weight: 400;
font-size: 22rpx;
color: #CCF1E6;
padding-left: 10px;
}
.mingxi{
width: 140rpx;
height: 42rpx;
line-height: 42rpx;
text-align: center;
background: #F5F7FB;
border-radius: 21rpx;
font-weight: bold;
font-size: 22rpx;
color: #333333;
}
.bgimg-top-money span:nth-child(1){
font-weight: bold;
font-size: 43rpx;
color: #FFFFFF;
}
.bgimg-top-money span:nth-child(2){
font-weight: 400;
font-size: 25rpx;
color: #FFFFFF;
margin-top:4px;
}
.bgimg-top-money{
display: flex;
flex-direction: column;
}
.bgimg-top-view{
2024-06-25 21:25:46 +08:00
width: 80%;
2024-06-12 15:52:21 +08:00
display: flex;
flex-direction: row;
justify-content: space-between;
}
.bgimg-top{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.bgimg {
background: url(../../static/wallet/reduce.png);
background-size: cover;
width: 100%;
height: 263.19rpx;
position: relative;
margin: 0px auto 10px auto;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 15px;
}
.content-top{
width: 100%;
height: 100%;
}
.content{
width: 100%;
height: 100vh;
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), #f7f7f7), url('../../static/background-img.png');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}
2024-06-05 19:16:02 +08:00
page {
background-color: #F7F7F7;
}
.bg {
background-color: #FFFFFF;
}
.dhjsbg {
background: linear-gradient(to right, #223845, #00a85b);
padding-bottom: 140rpx;
}
2024-06-12 15:52:21 +08:00
2024-06-05 19:16:02 +08:00
.active {
/* border: 1px solid #096f4b !important; */
2024-06-12 15:52:21 +08:00
background: #ECFFF8 !important;
border: 1px solid #029D88;
border-radius: 21rpx;
color: #029D88 !important;
2024-06-05 19:16:02 +08:00
}
.title_btn {
height: 78upx;
line-height: 78upx;
color: #333333;
/* background: #f7f7f7; */
}
.btn {
background: linear-gradient(to right, #223845, #00a85b);
color: #FFFFFF;
margin: 16rpx 30upx;
position: fixed;
bottom: 0upx;
width: 90%;
border-radius: 50rpx;
height: 78rpx;
line-height: 78rpx;
font-size: 30rpx;
text-align: center;
}
.bgCol2 {
color: #096f4b;
font-weight: bold;
}
2024-06-25 21:25:46 +08:00
.bgimg-top-tou{
margin-left: 10px;
margin-top: 2px;
border:2px solid #fff;
border-radius: 50%;
}
.align-line{
border: solid 1px #000000;
;
}
2024-07-01 11:50:18 +08:00
.coupon-level{
margin: 10px 0;
background: #fff;
border-radius: 30rpx;
padding: 25rpx;
}
.r-amount{
padding: 10rpx 20rpx;
font-size:38rpx;
display: flex;
justify-content: space-between;
}
.r-amount span:nth-child(1){
color: #fb672b;
font-weight: bold;
}
.r-amount span:nth-child(2){
color: #019c88;
font-weight: bold;
}
.bo-amount{
margin-top: 15rpx;
}
.amount-balance{
2024-07-01 12:10:23 +08:00
padding: 15rpx;
2024-07-01 11:50:18 +08:00
background: linear-gradient(to right, #fff5eb, #fbe3d2);
border-radius:10rpx;
display: flex;
justify-content: space-between;
}
.amount-balance span:nth-child(1){
color:#666;
}
.amount-balance span:nth-child(2){
font-weight: bold;
font-size: 36rpx;
color:#333;
}
.amount-block{
display:flex;
justify-content: space-between;
2024-07-01 13:55:22 +08:00
flex-direction: row;
flex-wrap: wrap;
2024-07-01 11:50:18 +08:00
}
.amount-block-lin{
width: 32%;
2024-07-01 12:10:23 +08:00
background: url('../../static/coupon1.png');
background-size: 100%;
2024-07-01 11:50:18 +08:00
border-radius:10rpx;
margin-top:15rpx;
2024-07-01 12:10:23 +08:00
padding: 15rpx 26rpx;
2024-07-01 11:50:18 +08:00
display: flex;
justify-content: space-between;
align-items: baseline;
}
.amount-block-lin span:nth-child(1){
color: #333;
font-size: 36rpx;
font-weight: bold;
}
2024-06-05 19:16:02 +08:00
</style>