新增余额提现,余额充值功能

master
lemon橪 2021-06-28 18:04:17 +08:00
parent 5612636b29
commit 8239aad928
11 changed files with 555 additions and 225 deletions

View File

@ -1,28 +1,55 @@
import storage from "@/utils/storage" import storage from "@/utils/storage";
import {http, Method} from '@/utils/request.js'; import { http, Method } from "@/utils/request.js";
/** /**
* 意见反馈 * 意见反馈
*/ */
export function feedBack(params) { export function feedBack(params) {
return http.request({ return http.request({
url: '/feedback', url: "/feedback",
method: Method.POST, method: Method.POST,
needToken: true, needToken: true,
params, params,
}); });
} }
// 提现
export function withdrawalApply(params) {
return http.request({
url: "/members/wallet/withdrawal",
method: Method.POST,
needToken: true,
params,
});
}
/**
* 支付结果查询
* @param orderType 交易类型,可用值:TRADE,ORDER,RECHARGE
* @param sn 订单编号
*/
export function payCallback(params) {
return http.request({
url: `/cashier/result`,
method: Method.GET,
params,
});
}
// 在线充值
export function recharge(params) {
return http.request({
url: "/trade/recharge",
method: Method.POST,
params,
});
}
/** /**
* 分页获取预存款充值记录 * 分页获取预存款充值记录
* @param params * @param params
*/ */
export function getUserRecharge(params) { export function getUserRecharge(params) {
return http.request({ return http.request({
url: "/member/recharge", url: "/member/recharge",
method: Method.GET, method: Method.GET,
@ -35,7 +62,7 @@ import {http, Method} from '@/utils/request.js';
* 分页获取预存款充值记录 * 分页获取预存款充值记录
* @param params * @param params
*/ */
export function getWalletLog(params) { export function getWalletLog(params) {
return http.request({ return http.request({
url: "/wallet/log", url: "/wallet/log",
method: Method.GET, method: Method.GET,
@ -44,16 +71,13 @@ import {http, Method} from '@/utils/request.js';
}); });
} }
/** /**
* 获取优惠券列表 * 获取优惠券列表
* @param params * @param params
*/ */
export function getCoupons(params) { export function getCoupons(params) {
return http.request({ return http.request({
url: '/promotion/coupon/getCoupons', url: "/promotion/coupon/getCoupons",
method: Method.GET, method: Method.GET,
needToken: true, needToken: true,
params, params,
@ -79,14 +103,13 @@ export function receiveCoupons(couponId) {
*/ */
export function getPointsData(params) { export function getPointsData(params) {
return http.request({ return http.request({
url: 'member/memberPointsHistory/getByPage', url: "member/memberPointsHistory/getByPage",
method: Method.GET, method: Method.GET,
needToken: true, needToken: true,
params, params,
}); });
} }
/** /**
* 获取我的评论列表 * 获取我的评论列表
* @param params * @param params
@ -94,7 +117,7 @@ export function getPointsData(params) {
*/ */
export function getComments(params) { export function getComments(params) {
return http.request({ return http.request({
url: '/memberEvaluation', url: "/memberEvaluation",
method: Method.GET, method: Method.GET,
needToken: true, needToken: true,
params, params,
@ -108,26 +131,23 @@ export function getComments(params) {
*/ */
export function getFootprintNum(params) { export function getFootprintNum(params) {
return http.request({ return http.request({
url: '/footprint/getFootprintNum', url: "/footprint/getFootprintNum",
method: Method.GET, method: Method.GET,
needToken: true, needToken: true,
params, params,
}); });
} }
/** /**
* 订单评论 * 订单评论
* @param params * @param params
*/ */
export function commentsMemberOrder(params) { export function commentsMemberOrder(params) {
return http.request({ return http.request({
url: '/memberEvaluation', url: "/memberEvaluation",
method: Method.POST, method: Method.POST,
needToken: true, needToken: true,
header:{'content-type':"application/x-www-form-urlencoded"}, header: { "content-type": "application/x-www-form-urlencoded" },
data: params, data: params,
}); });
} }
@ -138,10 +158,10 @@ export function commentsMemberOrder(params) {
*/ */
export function AppendCommentsOrder(params) { export function AppendCommentsOrder(params) {
return http.request({ return http.request({
url: 'members/comments/additional', url: "members/comments/additional",
method: Method.POST, method: Method.POST,
needToken: true, needToken: true,
header:{'content-type':"application/x-www-form-urlencoded"}, header: { "content-type": "application/x-www-form-urlencoded" },
data: params, data: params,
}); });
} }
@ -152,16 +172,16 @@ export function AppendCommentsOrder(params) {
* @param goods_id * @param goods_id
* @param ask_content * @param ask_content
*/ */
export function consultating(goods_id, ask_content,anonymous) { export function consultating(goods_id, ask_content, anonymous) {
return http.request({ return http.request({
url: 'members/asks', url: "members/asks",
method: Method.POST, method: Method.POST,
header:{'content-type':"application/x-www-form-urlencoded"}, header: { "content-type": "application/x-www-form-urlencoded" },
needToken: true, needToken: true,
data: { data: {
goods_id, goods_id,
ask_content, ask_content,
anonymous anonymous,
}, },
}); });
} }
@ -171,7 +191,7 @@ export function consultating(goods_id, ask_content,anonymous) {
* @param params * @param params
* @returns {AxiosPromise} * @returns {AxiosPromise}
*/ */
export function getGoodsCollection(params,type) { export function getGoodsCollection(params, type) {
return http.request({ return http.request({
url: `/member/collection/${type}`, url: `/member/collection/${type}`,
method: Method.GET, method: Method.GET,
@ -182,23 +202,18 @@ export function getGoodsCollection(params,type) {
}); });
} }
/** /**
* 收藏商品 * 收藏商品
* @returns {AxiosPromise} * @returns {AxiosPromise}
*/ */
export function collectionGoods(id,type) { export function collectionGoods(id, type) {
return http.request({ return http.request({
url: `/member/collection/add/${type}/${id}`, url: `/member/collection/add/${type}/${id}`,
method: Method.POST, method: Method.POST,
needToken: true, needToken: true,
}); });
} }
/** /**
* 删除商品收藏 * 删除商品收藏
* @param ids 收藏ID集合或单个商品ID * @param ids 收藏ID集合或单个商品ID
@ -206,7 +221,7 @@ export function collectionGoods(id,type) {
*/ */
export function deleteGoodsCollection(ids) { export function deleteGoodsCollection(ids) {
if (Array.isArray(ids)) { if (Array.isArray(ids)) {
ids = ids.join(','); ids = ids.join(",");
} }
return http.request({ return http.request({
url: `/member/collection/delete/GOODS/${ids}`, url: `/member/collection/delete/GOODS/${ids}`,
@ -219,7 +234,7 @@ export function deleteGoodsCollection(ids) {
* 获取商品是否被收藏 * 获取商品是否被收藏
* @param good_id * @param good_id
*/ */
export function getGoodsIsCollect(good_id,type) { export function getGoodsIsCollect(good_id, type) {
return http.request({ return http.request({
url: `/member/collection/isCollection/${type}/${good_id}`, url: `/member/collection/isCollection/${type}/${good_id}`,
method: Method.GET, method: Method.GET,
@ -228,7 +243,6 @@ export function getGoodsIsCollect(good_id,type) {
}); });
} }
/** /**
* 收藏店铺 * 收藏店铺
* @param store_id 店铺ID * @param store_id 店铺ID
@ -236,10 +250,10 @@ export function getGoodsIsCollect(good_id,type) {
*/ */
export function collectionStore(store_id) { export function collectionStore(store_id) {
return http.request({ return http.request({
url: 'members/collection/store', url: "members/collection/store",
header:{'content-type':"application/x-www-form-urlencoded"}, header: { "content-type": "application/x-www-form-urlencoded" },
method: Method.POST, method: Method.POST,
data: {store_id}, data: { store_id },
}); });
} }
@ -255,14 +269,13 @@ export function deleteStoreCollection(store_id) {
}); });
} }
/** /**
* 获取当前登录的用户信息 * 获取当前登录的用户信息
* @returns {AxiosPromise} * @returns {AxiosPromise}
*/ */
export function getUserInfo() { export function getUserInfo() {
return http.request({ return http.request({
url: '/members', url: "/members",
method: Method.GET, method: Method.GET,
needToken: true, needToken: true,
}); });
@ -274,7 +287,7 @@ export function deleteStoreCollection(store_id) {
*/ */
export function getUserWallet() { export function getUserWallet() {
return http.request({ return http.request({
url: '/members/wallet', url: "/members/wallet",
method: Method.GET, method: Method.GET,
needToken: true, needToken: true,
}); });
@ -287,30 +300,27 @@ export function getUserWallet() {
*/ */
export function saveUserInfo(params) { export function saveUserInfo(params) {
return http.request({ return http.request({
url: '/members/editOwn', url: "/members/editOwn",
method: Method.PUT, method: Method.PUT,
header:{'content-type':"application/x-www-form-urlencoded"}, header: { "content-type": "application/x-www-form-urlencoded" },
needToken: true, needToken: true,
data: params, data: params,
}); });
} }
/** /**
* 添加发票 * 添加发票
* @param params * @param params
*/ */
export function addReceipt(params) { export function addReceipt(params) {
return http.request({ return http.request({
url: '/trade/receipt', url: "/trade/receipt",
method: Method.POST, method: Method.POST,
needToken: true, needToken: true,
params, params,
}); });
} }
/** /**
* 获取商品评论列表 * 获取商品评论列表
* @param goodsId * @param goodsId
@ -337,7 +347,6 @@ export function getGoodsCommentsCount(goodsId) {
}); });
} }
/** /**
* 获取未读消息数量信息 * 获取未读消息数量信息
*/ */
@ -345,8 +354,8 @@ export function getNoReadMessageNum() {
return http.request({ return http.request({
url: `members/member-nocice-logs/number`, url: `members/member-nocice-logs/number`,
method: Method.GET, method: Method.GET,
needToken: true needToken: true,
}) });
} }
/** /**
@ -359,7 +368,7 @@ export function myTrackList(params) {
url: `/footprint`, url: `/footprint`,
method: Method.GET, method: Method.GET,
needToken: true, needToken: true,
params params,
}); });
} }
@ -371,8 +380,8 @@ export function deleteHistoryListId(ids) {
return http.request({ return http.request({
url: `/footprint/delByIds/${ids}`, url: `/footprint/delByIds/${ids}`,
method: Method.DELETE, method: Method.DELETE,
needToken: true needToken: true,
}) });
} }
/** /**
@ -384,8 +393,8 @@ export function getMemberCoupons(data) {
url: `/promotion/coupon/getCoupons`, url: `/promotion/coupon/getCoupons`,
method: Method.GET, method: Method.GET,
needToken: true, needToken: true,
params:data params: data,
}) });
} }
/** /**
@ -396,8 +405,8 @@ export function getCouponsNum() {
return http.request({ return http.request({
url: `/promotion/coupon/getCouponsNum`, url: `/promotion/coupon/getCouponsNum`,
method: Method.GET, method: Method.GET,
needToken: true needToken: true,
}) });
} }
/** /**
@ -407,6 +416,6 @@ export function getCouponsNum() {
export function getMemberPointSum() { export function getMemberPointSum() {
return http.request({ return http.request({
url: `member/memberPointsHistory/getMemberPointsHistoryVO`, url: `member/memberPointsHistory/getMemberPointsHistoryVO`,
method: Method.GET method: Method.GET,
}) });
} }

View File

@ -168,7 +168,28 @@
{ {
"path": "deposit/index", "path": "deposit/index",
"style": { "style": {
"navigationBarTitleText": "预存款列表" "navigationStyle": "custom"
}
},
{
"path": "deposit/operation",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "deposit/recharge",
"style": {
"navigationBarTitleText": "充值金额"
}
},
{
"path": "deposit/withdrawal",
"style": {
"navigationBarTitleText": "提现金额"
} }
}, },

View File

@ -45,7 +45,7 @@
</template> </template>
<script> <script>
import * as API_Trade from "@/api/trade"; import * as API_Trade from "@/api/trade";
import {payCallback} from '@/api/members'
export default { export default {
data() { data() {
return { return {
@ -71,6 +71,7 @@
walletValue: 0.0, walletValue: 0.0,
// //
autoCancel: 0, autoCancel: 0,
}; };
}, },
onLoad(val) { onLoad(val) {
@ -91,12 +92,23 @@
// h5appJSAPI // h5appJSAPI
this.paymentClient = this.isWeiXin() ? "JSAPI" : "H5"; this.paymentClient = this.isWeiXin() ? "JSAPI" : "H5";
//#endif //#endif
//
}, },
onBackPress(e) { onBackPress(e) {
if (e.from == "backbutton") { if (e.from == "backbutton") {
if(this.routerVal.recharge_sn){
uni.switchTab({
url: '/pages/tabbar/user/my'
});
}
else{
uni.redirectTo({ uni.redirectTo({
url: "/pages/order/myOrder?status=0", url: "/pages/order/myOrder?status=0",
}); });
}
return true; // return true; //
} }
}, },
@ -104,16 +116,28 @@
this.cashierData(); this.cashierData();
}, },
methods: { methods: {
navigateTo(url) {
/**
* 支付成功后跳转
*/
callback(paymentMethod){
uni.navigateTo({ uni.navigateTo({
url, url: "/pages/cart/payment/success?paymentMethod=" +
paymentMethod +
"&payPrice=" +
this.cashierParams.price+
"&orderType="+this.orderType
}); });
}, },
//
/**
* 获取收银详情
*/
cashierData() { cashierData() {
let parms = {}; let parms = {};
if (this.routerVal.recharge_sn) { if (this.routerVal.recharge_sn) {
//
this.sn = this.routerVal.recharge_sn; this.sn = this.routerVal.recharge_sn;
this.orderType = "RECHARGE"; this.orderType = "RECHARGE";
} else if (this.routerVal.trade_sn) { } else if (this.routerVal.trade_sn) {
@ -136,8 +160,18 @@
}); });
// #endif // #endif
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN
this.payList = res.data.result.support; if(this.routerVal.recharge_sn){
this.payList = res.data.result.support.filter((item) => {
return item != "WALLET";
})
}
else{
this.payList = res.data.result.support;
}
// #endif // #endif
this.walletValue = res.data.result.walletValue; this.walletValue = res.data.result.walletValue;
this.autoCancel = this.autoCancel =
@ -154,6 +188,7 @@
// //
async pay(payment) { async pay(payment) {
// //
const sn = this.sn; const sn = this.sn;
// | // |
@ -188,7 +223,6 @@
let payForm = signXml.data.result; let payForm = signXml.data.result;
console.log(payForm)
let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay"; let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay";
uni.requestPayment({ uni.requestPayment({
provider: paymentType, provider: paymentType,
@ -199,12 +233,10 @@
icon: "none", icon: "none",
title: "支付成功!", title: "支付成功!",
}); });
uni.navigateTo({
url: "/pages/payment/success?paymentType=" + this.callback(paymentMethod)
paymentType +
"&payPrice=" +
this.cashierParams.price,
});
}, },
fail: (e) => { fail: (e) => {
console.log(e); console.log(e);
@ -253,12 +285,8 @@
icon: "none", icon: "none",
title: "支付成功!", title: "支付成功!",
}); });
uni.navigateTo({ this.callback(paymentMethod)
url: "/pages/cart/payment/success?paymentMethod=" +
paymentMethod +
"&payPrice=" +
this.cashierParams.price,
});
} else { } else {
uni.showModal({ uni.showModal({
content: "支付失败,如果您已支付,请勿反复支付", content: "支付失败,如果您已支付,请勿反复支付",
@ -276,12 +304,7 @@
icon: "none", icon: "none",
}); });
if (response.success) { if (response.success) {
uni.navigateTo({ this.callback(paymentMethod)
url: "/pages/cart/payment/success?paymentMethod=" +
paymentMethod +
"&payPrice=" +
this.cashierParams.price,
});
} }
} }
} }
@ -317,12 +340,8 @@
icon: "none", icon: "none",
title: "支付成功!", title: "支付成功!",
}); });
uni.navigateTo({ this.callback(paymentMethod)
url: "/pages/cart/payment/success?paymentMethod=" +
paymentType +
"&payPrice=" +
this.cashierParams.price,
});
}, },
fail: (e) => { fail: (e) => {
console.log(e); console.log(e);
@ -338,12 +357,8 @@
icon: "none", icon: "none",
title: "支付成功!", title: "支付成功!",
}); });
uni.navigateTo({ this.callback(paymentMethod)
url: "/pages/cart/payment/success?paymentMethod=" +
paymentMethod +
"&payPrice=" +
this.cashierParams.price,
});
} }
} }
); );

View File

@ -2,10 +2,10 @@
<div class="wrapper"> <div class="wrapper">
<div class="pay-wrapper"> <div class="pay-wrapper">
<div class="pay-money"> <div class="pay-money">
{{ payPrice | unitPrice }} {{ Number(payPrice) | unitPrice }}
</div> </div>
<div class="pay-btns"> <div class="pay-btns">
<div v-show="!from" @click="navigateTo('/pages/order/myOrder?status=0')"></div> <div v-show="!from" @click="checkOrder">{{this.orderType == "RECHARGE" ? '' : ''}}</div>
<div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div> <div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
</div> </div>
@ -88,11 +88,26 @@ export default {
onLoad(options) { onLoad(options) {
this.paymentMethod = options.paymentMethod || ""; this.paymentMethod = options.paymentMethod || "";
this.from = options.from || ""; this.from = options.from || "";
this.payPrice = parseInt(options.payPrice) || 0; this.payPrice = options.payPrice || 0;
this.orderType = options.orderType;
// //
this.initGoods(); this.initGoods();
}, },
methods: { methods: {
checkOrder() {
/**
* 查看订单
* 1.充值跳转到明细里面
* 2.支付跳转到订单详情
*/
if (this.orderType == "RECHARGE") {
uni.reLaunch({
url: `/pages/mine/deposit/operation`
})
} else {
this.navigateTo("/pages/order/myOrder?status=0");
}
},
changeStatus(val) { changeStatus(val) {
if (val) { if (val) {
this.sendMessage(); this.sendMessage();

View File

@ -1,14 +1,17 @@
<template> <template>
<view class="wap"> <view class="wap">
<u-navbar back-text="" title="预存款列表">
</u-navbar>
<view class="wrapper-show-money"> <view class="wrapper-show-money">
<view class="money-view"> <view class="money-view">
<h3>预存款金额 </h3> <h3>预存款金额 </h3>
<view class="money">{{walletNum | unitPrice }}</view> <view class="money">{{walletNum | unitPrice }}</view>
</view> </view>
</view> </view>
<view class="wrapper-tabs"> <view class="wrapper-tabs">
<swiper class="swiper-box" @change="changeSwiper" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"> <swiper class="swiper-box" :current="swiperCurrent">
<swiper-item class="swiper-item" v-for="index in list.length" :key="index"> <swiper-item class="swiper-item" v-for="index in list.length" :key="index">
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore"> <scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
<view v-if="datas.length!=0" class="view-item" v-for="(logItem, logIndex) in datas" :key="logIndex"> <view v-if="datas.length!=0" class="view-item" v-for="(logItem, logIndex) in datas" :key="logIndex">
@ -37,12 +40,11 @@
<script> <script>
import { getUserRecharge, getWalletLog } from "@/api/members"; import { getUserRecharge, getWalletLog } from "@/api/members";
import storage from "@/utils/storage.js";
import { getUserWallet } from "@/api/members"; import { getUserWallet } from "@/api/members";
export default { export default {
data() { data() {
return { return {
walletNum:0, walletNum: 0,
status: "loadmore", status: "loadmore",
current: 0, current: 0,
swiperCurrent: 0, swiperCurrent: 0,
@ -77,6 +79,7 @@ export default {
this.walletNum = result.data.result.memberWallet; this.walletNum = result.data.result.memberWallet;
}, },
methods: { methods: {
/**分页获取预存款充值记录 */ /**分页获取预存款充值记录 */
getRecharge() { getRecharge() {
this.status = "loading"; this.status = "loading";
@ -105,10 +108,7 @@ export default {
}); });
}, },
// swiper
changeSwiper() {
this.groupBuy = [];
},
changed(index) { changed(index) {
this.datas = []; this.datas = [];
this.swiperCurrent = index; this.swiperCurrent = index;
@ -121,19 +121,6 @@ export default {
} }
}, },
// swiper-itemtabs
transition({ detail: { dx } }) {
this.$refs.tabs.setDx(dx);
},
// swiperswiperdx
// swipertabsswiper
animationfinish(e) {
// this.groupBuy = []
let current = e.detail.current;
this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
loadMore() { loadMore() {
this.params.pageNumber++; this.params.pageNumber++;
this.getWallet(); this.getWallet();
@ -144,93 +131,96 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.green { .green {
color: $aider-color-green !important; color: $aider-color-green !important;
} }
.view-item { .view-item {
padding: 32rpx; padding: 32rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.view-item-change { .view-item-change {
text-align: right; text-align: right;
> .-money { > .-money {
font-size: 36rpx; font-size: 36rpx;
color: $main-color; color: $main-color;
font-weight: bold;
}
> .-time {
font-size: 22rpx;
color: #999;
}
}
.view-item-detail {
line-height: 1.75;
> .-title {
font-size: 28rpx;
}
> .-number {
font-size: 22rpx;
color: #999;
}
}
.submit-btn {
line-height: 90rpx;
text-align: center;
color: #fff;
background: $main-color;
margin: 0 auto;
height: 90rpx;
}
.operation {
font-size: 32rpx;
margin-right: 24rpx;
color: rgb(96, 98, 102);
}
.money {
font-size: 40rpx;
font-weight: bold; font-weight: bold;
} }
> .-time {
font-size: 22rpx; .money-view {
color: #999; height: 100%;
width: 100%;
padding: 0 32rpx;
display: flex;
align-items: flex-end;
justify-content: center;
flex-direction: column;
color: #fff;
background-image: linear-gradient(
25deg,
$main-color,
$light-color,
$aider-light-color
);
} }
}
.view-item-detail { .swiper-item,
line-height: 1.75; .scroll-v {
> .-title { height: 100%;
font-size: 28rpx;
} }
> .-number {
font-size: 22rpx; .swiper-box {
color: #999; /* #ifndef H5 */
height: calc(100vh - 200rpx);
/* #endif */
/* #ifdef H5 */
height: calc(100vh - 288rpx);
/* #endif */
} }
}
.submit-btn {
line-height: 90rpx;
text-align: center;
color: #fff; .wap {
background: $main-color; width: 100%;
height: calc(100vh - 44px);
}
margin: 0 auto; .wrapper-show-money {
height: 90rpx; height: 200rpx;
} // background-image: url('/static/img/main-bg.jpg');
.wap { }
}
.money {
font-size: 40rpx;
font-weight: bold;
}
.money-view {
height: 100%;
width: 100%;
padding: 0 32rpx;
display: flex;
align-items: flex-end;
justify-content: center;
flex-direction: column;
color: #fff;
background-image: linear-gradient(
25deg,
$main-color,
$light-color,
$aider-light-color
);
}
.swiper-item,
.scroll-v {
height: 100%;
}
.swiper-box {
/* #ifndef H5 */
height: calc(100vh - 200rpx);
/* #endif */
/* #ifdef H5 */
height: calc(100vh - 288rpx);
/* #endif */
}
.wap {
width: 100%;
height: calc(100vh - 44px);
}
.wrapper-show-money {
height: 200rpx;
// background-image: url('/static/img/main-bg.jpg');
}
</style> </style>

View File

@ -0,0 +1,110 @@
<template>
<div class="wrapper">
<u-navbar :custom-back="back" title="余额"></u-navbar>
<div class="box">
<div class="deposit">预存款金额</div>
<div class="money">{{walletNum | unitPrice }}</div>
<div class="operation-btns">
<div class="operation-btn light" @click="navgition('/pages/mine/deposit/withdrawal')"></div>
<div class="operation-btn" @click="navgition('/pages/mine/deposit/recharge')"></div>
</div>
</div>
<div class="box list" @click="navgition('/pages/mine/deposit/index')">
<div class="list-left">预存款明细</div>
<div class="list-right">
<u-icon name="arrow-right"></u-icon>
</div>
</div>
</div>
</template>
<script>
import { getUserWallet } from "@/api/members";
export default {
data() {
return {
walletNum: 0,
};
},
async mounted() {
let result = await getUserWallet(); //
this.walletNum = result.data.result.memberWallet;
},
methods: {
back() {
uni.switchTab({
url: "/pages/tabbar/user/my",
});
},
/**
* 跳转
*/
navgition(url) {
uni.navigateTo({
url,
});
},
},
};
</script>
<style lang="scss" scoped>
.list {
display: flex;
justify-content: center;
align-items: center;
}
.list-left {
flex: 8;
}
.list-right {
flex: 2;
text-align: right;
}
.wrapper {
width: 94%;
margin: 0 3%;
}
.box {
margin: 20rpx 0;
background: #fff;
border-radius: 20rpx;
padding: 40rpx;
}
.operation-btns {
display: flex;
justify-content: center;
align-items: center;
}
.money {
text-align: center;
color: #333;
font-size: 50rpx;
margin: 20rpx 0 40rpx 0;
letter-spacing: 2rpx;
}
.deposit {
margin-top: 50rpx;
text-align: center;
color: #999;
font-size: 28rpx;
letter-spacing: 2rpx;
}
.operation-btn {
background: #ee6d41;
color: #fff;
height: 90rpx;
width: 240rpx;
margin: 0 20rpx;
border-radius: 10rpx;
text-align: center;
line-height: 90rpx;
font-size: 32rpx;
}
.light {
background: #fdf2ee;
color: #ee6d41;
}
</style>

View File

@ -0,0 +1,50 @@
<template>
<view>
<view class="-list">
<view class="title">充值金额</view>
<view class="content">
<view class="price">
<span> </span>
<u-input v-model="price" placeholder="" type="number" />
</view>
</view>
</view>
<view class="submit" :class="{'light':flag}" @click="handlerRecharge"></view>
</view>
</template>
<script>
import { recharge } from "@/api/members";
export default {
data() {
return {
price: 0,
flag: true,
};
},
watch: {
price(val) {
val <= 0 ? (this.flag = true) : (this.flag = false);
},
},
mounted() {},
methods: {
//
async handlerRecharge() {
if (this.price > 0) {
let res = await recharge({ price: this.price });
if (res.data.success) {
uni.navigateTo({
url: `/pages/cart/payment/payOrder?orderType=RECHARGE&recharge_sn=${res.data.result.rechargeSn}`,
});
}
}
},
},
};
</script>
<style lang="scss" scoped>
@import './style.scss';
</style>

View File

@ -0,0 +1,46 @@
/deep/ .u-input__input,
.u-input {
font-size: 80rpx !important;
height: 102rpx !important;
}
/deep/ .u-input__input {
height: 100%;
font-size: 80rpx;
}
.content {
display: flex;
> .price {
width: 60%;
margin: 20rpx 0;
font-size: 80rpx;
display: flex;
}
> .all {
justify-content: center;
width: 40%;
display: flex;
flex-direction: column;
align-items: flex-end;
}
}
.-list {
margin: 20rpx 0;
background: #fff;
padding: 16rpx 32rpx;
}
.title {
font-size: 35rpx;
}
.light {
opacity: 0.6;
}
.submit {
margin: 80rpx auto;
width: 94%;
background: $light-color;
height: 90rpx;
color: #fff;
border-radius: 10rpx;
text-align: center;
line-height: 90rpx;
}

View File

@ -0,0 +1,70 @@
<template>
<view>
<view class="-list">
<view class="title">提现金额</view>
<view class="content">
<view class="price">
<span> </span>
<u-input v-model="price" placeholder="" type="number" />
</view>
<view class="all">
<view @click="handleAll" :style="{ color: $mainColor }">全部</view>
<view style="font-size: 24rpx; color: #999">可提现金额<span>{{ walletNum | unitPrice }}</span></view>
</view>
</view>
</view>
<view class="submit" @click="cashd"></view>
</view>
</template>
<script>
import { getUserWallet,withdrawalApply } from "@/api/members";
export default {
data() {
return {
price: 0,
walletNum: 0,
};
},
async mounted() {
let result = await getUserWallet(); //
this.walletNum = result.data.result.memberWallet;
},
methods: {
cashd() {
this.price = this.price + "";
if (this.$u.test.amount(parseInt(this.price))) {
withdrawalApply({ price: this.price }).then((res) => {
if (res.data.success) {
uni.showToast({
title: "提现成功!",
duration: 2000,
icon: "none",
});
setTimeout(() => {
uni.navigateBack({
delta: 1,
});
}, 1000);
}
});
} else {
uni.showToast({
title: "请输入正确金额",
duration: 2000,
icon: "none",
});
}
},
handleAll() {
this.price = this.walletNum;
},
},
};
</script>
<style lang="scss" scoped>
@import "./style.scss";
</style>

View File

@ -90,19 +90,23 @@ export default {
uni.showLoading({ uni.showLoading({
title: "正在获取验证码", title: "正在获取验证码",
}); });
sendMobile(this.codeForm.mobile).then((res) => { sendMobile(this.codeForm.mobile)
uni.hideLoading(); .then((res) => {
// this.start() uni.hideLoading();
if (res.data.success) { // this.start()
if (res.data.success) {
this.$refs.uCode.start();
} else {
uni.showToast({
title: res.data.message,
duration: 2000,
icon: "none",
});
}
})
.catch((e) => {
this.$refs.uCode.start(); this.$refs.uCode.start();
} else { });
uni.showToast({
title: res.data.message,
duration: 2000,
icon: "none",
});
}
});
} else { } else {
this.$u.toast("请倒计时结束后再发送"); this.$u.toast("请倒计时结束后再发送");
} }

View File

@ -20,7 +20,7 @@
<!-- 积分优惠券关注 --> <!-- 积分优惠券关注 -->
<div class="pointBox"> <div class="pointBox">
<u-row text-align="center" gutter="16" class="point"> <u-row text-align="center" gutter="16" class="point">
<u-col text-align="center" span="4" @click="navigateTo('/pages/mine/deposit/index')"> <u-col text-align="center" span="4" @click="navigateTo('/pages/mine/deposit/operation')">
<view>预存款</view> <view>预存款</view>
<view class="money">{{ walletNum | unitPrice}}</view> <view class="money">{{ walletNum | unitPrice}}</view>
</u-col> </u-col>