diff --git a/api/user.js b/api/user.js
index 54db8cb..07350e1 100644
--- a/api/user.js
+++ b/api/user.js
@@ -4,7 +4,7 @@ export default {
genderKV:{
MALE:'先生',FEMALE:'女士'
},
- login:(phone,password)=>request.post('/api/user/password-login',{phone,password,role:'deliveryman'}),
+ login:(phone,password)=>request.post('/api/user/password-login',{phone,password,role:'merchant'}),
info:()=>request.get('/api/user/info'),
@@ -13,4 +13,23 @@ export default {
incomeList:(data)=>request.get('/api/account/details',data),
modifyPassword:(phone,new_password,verify_code)=>request.post('/api/user/change-password',{phone,new_password,verify_code}),
+
+ summary:()=>request.get('/api/account/summary'),
+
+
+ bankCard:{
+ list:()=>request.get('/api/bank-cards'),
+ add:(data)=>request.post('/api/bank-cards',data),
+ delete:(card_id)=>request.delete(`/api/bank-cards/${card_id}`)
+ },
+
+ withdraw:{
+ add:(bank_card_id,amount)=>request.post('/api/withdraw',{bank_card_id,amount}),
+ list:(data)=>request.get('/api/withdraw/user',data),
+ statusKV:{
+ PENDING:"提现审核中",APPROVED:"平台受理成功",REJECTED:"审核未通过"
+ }
+ },
+ getRNAuth:()=>request.get('/api/user/auth',{},{noTips:true}),
+ setRNAuth:(data)=>request.post('/api/user/auth',data)
}
\ No newline at end of file
diff --git a/app.json b/app.json
index 36a80f2..46e37ba 100644
--- a/app.json
+++ b/app.json
@@ -9,7 +9,14 @@
"pages/user/income/list/index",
"pages/index/verification/index",
"pages/user/income/detail/index",
- "pages/browser/index"
+ "pages/browser/index",
+ "pages/user/info/index",
+ "pages/user/rnAuth/index",
+ "pages/user/bank/index/index",
+ "pages/user/bank/editor/index",
+ "pages/user/withdraw/index/index",
+ "pages/user/withdraw/list/index",
+ "pages/user/withdraw/success/index"
],
"window": {
"navigationBarTextStyle": "black",
diff --git a/assets/icon/card.png b/assets/icon/card.png
new file mode 100644
index 0000000..11bb7e6
Binary files /dev/null and b/assets/icon/card.png differ
diff --git a/assets/icon/delete.png b/assets/icon/delete.png
new file mode 100644
index 0000000..c6f726e
Binary files /dev/null and b/assets/icon/delete.png differ
diff --git a/assets/icon/plus.png b/assets/icon/plus.png
new file mode 100644
index 0000000..f7a60b5
Binary files /dev/null and b/assets/icon/plus.png differ
diff --git a/package-lock.json b/package-lock.json
index 95c95d9..d31470a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,12 +9,19 @@
"version": "0.0.1",
"license": "ISC",
"dependencies": {
+ "@beefast-wxmp/background-notice": "^0.0.1",
"@beefast-wxmp/list-view": "^0.0.1",
"@beefast-wxmp/modal-view": "^0.1.7",
- "@beefast-wxmp/nav-bar": "^0.0.1",
+ "@beefast-wxmp/nav-bar": "^0.0.3",
"@beefast-wxmp/swipe-button": "^0.0.3"
}
},
+ "node_modules/@beefast-wxmp/background-notice": {
+ "version": "0.0.1",
+ "resolved": "https://packages.aliyun.com/6486fc420ce788fc1c0798b3/npm/repo-glpby/@beefast-wxmp/background-notice/-/@beefast-wxmp/background-notice-0.0.1.tgz",
+ "integrity": "sha512-qD3+SdGIbTT8puIBBBu6btvWWG+7dU5gYZKzzaVDtDI4owzcPRdQNDWLZ5LSqd8CbXQJz6uSihU6E7tqm/Fbjw==",
+ "license": "ISC"
+ },
"node_modules/@beefast-wxmp/list-view": {
"version": "0.0.1",
"resolved": "https://packages.aliyun.com/6486fc420ce788fc1c0798b3/npm/repo-glpby/@beefast-wxmp/list-view/-/@beefast-wxmp/list-view-0.0.1.tgz",
@@ -28,9 +35,9 @@
"license": "ISC"
},
"node_modules/@beefast-wxmp/nav-bar": {
- "version": "0.0.1",
- "resolved": "https://packages.aliyun.com/6486fc420ce788fc1c0798b3/npm/repo-glpby/@beefast-wxmp/nav-bar/-/@beefast-wxmp/nav-bar-0.0.1.tgz",
- "integrity": "sha512-nXbwGu31795qoSnHi5pzOmUWY7cbN+WPbAaA7UsG45Iae1k5AWfh2i65HenjtsN+jkVb/OMLDUcMYnqqEUb6RQ==",
+ "version": "0.0.3",
+ "resolved": "https://packages.aliyun.com/6486fc420ce788fc1c0798b3/npm/repo-glpby/@beefast-wxmp/nav-bar/-/@beefast-wxmp/nav-bar-0.0.3.tgz",
+ "integrity": "sha512-h0CC32cTYguLhH+cap2LAUV7jeB6k6x6gWS3YUjkfYy6+v9XP3ohTAnuWsEDnWjJ+mJlARxdhwy8Phnl/Nuw2A==",
"license": "ISC"
},
"node_modules/@beefast-wxmp/swipe-button": {
diff --git a/package.json b/package.json
index d5a2cc4..7779e49 100644
--- a/package.json
+++ b/package.json
@@ -9,9 +9,10 @@
"author": "",
"license": "ISC",
"dependencies": {
+ "@beefast-wxmp/background-notice": "^0.0.1",
"@beefast-wxmp/list-view": "^0.0.1",
"@beefast-wxmp/modal-view": "^0.1.7",
- "@beefast-wxmp/nav-bar": "^0.0.1",
+ "@beefast-wxmp/nav-bar": "^0.0.3",
"@beefast-wxmp/swipe-button": "^0.0.3"
}
}
diff --git a/pages/index/index/index.js b/pages/index/index/index.js
index 44da0f3..768b540 100644
--- a/pages/index/index/index.js
+++ b/pages/index/index/index.js
@@ -8,7 +8,9 @@ Page({
* 页面的初始数据
*/
data: {
-
+ isShowVerify:false,
+ verifyData:{},
+ verifyCode:''
},
/**
@@ -26,14 +28,10 @@ Page({
if(res.scanType=='QR_CODE'){
orderApi.queryVerifyCode(res.result).then((data)=>{
if(data.order){
- wx.navigateTo({
- url: `/pages/index/verification/index?code=${res.result}`,
- success(){
- //传 code 供测试用,因为热更新下面的数据就没有了
- const pages = getCurrentPages();
- const currentPage = pages[pages.length-1];
- currentPage.setOrder(data);
- }
+ this.setData({
+ verifyData:data,
+ verifyCode:res.result,
+ isShowVerify:true
})
}
})
@@ -47,6 +45,16 @@ Page({
})
},
+ verify(){
+ orderApi.verify(this.data.verifyCode).then((data)=>{
+ this.setData({
+ isShowVerify:false
+ });
+ wx.showToast({
+ title: '核销成功'
+ });
+ })
+ },
/**
* 生命周期函数--监听页面初次渲染完成
*/
diff --git a/pages/index/index/index.json b/pages/index/index/index.json
index 965b8e8..0f42481 100644
--- a/pages/index/index/index.json
+++ b/pages/index/index/index.json
@@ -1,4 +1,6 @@
{
- "usingComponents": {},
+ "usingComponents": {
+ "modal-view":"/miniprogram_npm/@beefast-wxmp/modal-view"
+ },
"navigationStyle": "custom"
}
\ No newline at end of file
diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml
index 4ffeb47..44ec854 100644
--- a/pages/index/index/index.wxml
+++ b/pages/index/index/index.wxml
@@ -10,7 +10,7 @@
-
+
累计收益 (元)
88
@@ -30,4 +30,19 @@
88
-
\ No newline at end of file
+
+
+
+
+
+
+
+ {{verifyData.product.name}}
+ x {{verifyData.order.qty}}
+
+
+
+ 订单总价
+ {{verifyData.order.order_amount}}
+
+
\ No newline at end of file
diff --git a/pages/index/index/index.wxss b/pages/index/index/index.wxss
index e770b1d..d6a7057 100644
--- a/pages/index/index/index.wxss
+++ b/pages/index/index/index.wxss
@@ -72,4 +72,35 @@
margin-top:40rpx;
font-size: 44rpx;
font-weight: 500;
+}
+
+.verify-view .spliter{
+ margin:30rpx 0;
+}
+.verify-view .product{
+ display: flex;
+ gap: 24rpx;
+}
+.verify-view .product .avatar{
+ width:132rpx;height:132rpx;
+ border-radius: 12rpx;
+}
+.verify-view .product .info{
+ font-size: 32rpx;
+ height:132rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ padding:4rpx 0;
+ box-sizing: border-box;
+}
+.verify-view .product .qty{
+ color:#888;
+}
+
+.verify-view .amount{
+ margin-top:44rpx;
+ display:flex;
+ justify-content: space-between;
+ align-items: center;
}
\ No newline at end of file
diff --git a/pages/user/bank/editor/index.js b/pages/user/bank/editor/index.js
new file mode 100644
index 0000000..0ebc7ad
--- /dev/null
+++ b/pages/user/bank/editor/index.js
@@ -0,0 +1,93 @@
+import userApi from '../../../../api/user';
+const app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ name:'',
+ bankName:'',
+ cardNumber:'',//16-19
+ },
+ validator:{
+ name:{minLength:2,message:'持卡人姓名至少 2 个字',autoFocus:true,shake:true},
+ bankName:{required:true,message:'请输入开户银行',autoFocus:true,shake:true},
+ cardNumber:{minLength:16,maxLength:19,message:'银行卡号 16-19 位数字',autoFocus:true,shake:true}
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+
+ },
+
+ addCard(){
+ const valid = app.validateForm(this.validator,this);
+ if(valid.length==0){
+ userApi.bankCard.add({
+ name:this.data.name,
+ card_number:this.data.cardNumber,
+ bank_name:this.data.bankName
+ }).then(()=>{
+ wx.navigateBack({
+ success(){
+ wx.showToast({
+ icon:'success',
+ title: '添加成功',
+ })
+ }
+ });
+ })
+ }
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/user/bank/editor/index.json b/pages/user/bank/editor/index.json
new file mode 100644
index 0000000..419ed82
--- /dev/null
+++ b/pages/user/bank/editor/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "添加银行卡"
+}
\ No newline at end of file
diff --git a/pages/user/bank/editor/index.wxml b/pages/user/bank/editor/index.wxml
new file mode 100644
index 0000000..3376ea6
--- /dev/null
+++ b/pages/user/bank/editor/index.wxml
@@ -0,0 +1,29 @@
+
+
+ 持卡姓名
+
+
+ {{nameMessage}}
+
+
+
+ 开户银行
+
+
+ {{bankNameMessage}}
+
+
+
+ 银行卡号
+
+
+ {{cardNumberMessage}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/bank/editor/index.wxss b/pages/user/bank/editor/index.wxss
new file mode 100644
index 0000000..4522937
--- /dev/null
+++ b/pages/user/bank/editor/index.wxss
@@ -0,0 +1 @@
+/* pages/user/bank/editor/index.wxss */
\ No newline at end of file
diff --git a/pages/user/bank/index/index.js b/pages/user/bank/index/index.js
new file mode 100644
index 0000000..2c027cb
--- /dev/null
+++ b/pages/user/bank/index/index.js
@@ -0,0 +1,102 @@
+import userApi from '../../../../api/user';
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ cardList:[],
+ listLoading:false,
+ isShowConfirm:false
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ },
+ navToAdd(){
+ wx.navigateTo({
+ url: '/pages/user/bank/editor/index',
+ })
+ },
+ showConfirm(event){
+ const card = event.currentTarget.dataset.item;
+ this.currentCard = card;
+ this.setData({
+ isShowConfirm:true
+ });
+ },
+ deleteCard(){
+ userApi.cardList.delete(this.currentCard.id).then((data)=>{
+ wx.showToast({
+ icon:'success',
+ title: '删除成功',
+ })
+ this.getCardList();
+ });
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+ this.getCardList();
+ },
+ getCardList(){
+ if(this.data.listLoading)return;
+ this.setData({
+ listLoading:true
+ });
+ wx.showNavigationBarLoading();
+ userApi.bankCard.list().then((data)=>{
+ wx.hideNavigationBarLoading();
+ this.setData({
+ cardList:data,
+ listLoading:false
+ })
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/user/bank/index/index.json b/pages/user/bank/index/index.json
new file mode 100644
index 0000000..ddc175e
--- /dev/null
+++ b/pages/user/bank/index/index.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "modal-view":"/miniprogram_npm/@beefast-wxmp/modal-view"
+ },
+ "navigationBarTitleText": "银行卡管理"
+}
\ No newline at end of file
diff --git a/pages/user/bank/index/index.wxml b/pages/user/bank/index/index.wxml
new file mode 100644
index 0000000..7eb33c9
--- /dev/null
+++ b/pages/user/bank/index/index.wxml
@@ -0,0 +1,25 @@
+
+
+
+ 个人账户
+
+
+
+
+ {{item.bank_name}}
+
+
+
+
+ 持卡人
+ {{item.name}}
+
+
+ 银行卡号
+ {{item.card_number}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/bank/index/index.wxss b/pages/user/bank/index/index.wxss
new file mode 100644
index 0000000..a32cffd
--- /dev/null
+++ b/pages/user/bank/index/index.wxss
@@ -0,0 +1,72 @@
+.bank-card{
+ min-height: 100vh;
+ box-sizing: border-box;
+ background-color: #fff;
+ padding:60rpx 30rpx;
+}
+
+.page-title{
+ font-size: 40rpx;
+ display: flex;
+ align-items: flex-end;
+}
+.page-title .tag{
+ font-size: 24rpx;
+ background-color: rgba(255, 195, 0, 0.1);
+ padding:5rpx 8rpx;
+ color: #FFC300;
+ margin-left:22rpx;
+}
+.card{
+ background: linear-gradient(298deg, #FFC300 0%, #FFDE74 98%);
+ box-shadow: 0px 3px 6px 2px rgba(0, 0, 0, 0.1);
+ border-radius: 20rpx;
+ padding:30rpx 0 40rpx 30rpx;
+ margin-top:46rpx;
+}
+.card .head{
+ display: flex;
+ align-items: center;
+ padding-right:30rpx;
+}
+.card .head .icon-card{
+ width:44rpx;height:44rpx;
+}
+.card .head .name{
+ font-size: 33rpx;
+ flex: 1;
+ margin-left:18rpx;
+}
+.card .head .icon-delete{
+ width:32rpx;height:32rpx;
+ padding:4rpx;
+}
+.card .spliter{
+ margin:24rpx 0 0 0;
+}
+.card .info-item{
+ margin-top:40rpx;
+}
+.card .info-item .key{
+ color: #555555;
+ font-size: 24rpx;
+}
+.card .info-item .value{
+ font-size: 36rpx;
+ margin-top:24rpx;
+}
+.card .info-item .card-no{
+ font-weight: 500;
+}
+
+.add-card-btn{
+ margin-top:40rpx;
+ background-color: rgba(153, 153, 153, 0.15);
+}
+
+.list-empty{
+ padding:200rpx 0;
+}
+.list-empty .icon{
+ margin-top:0;
+}
\ No newline at end of file
diff --git a/pages/user/index/index.js b/pages/user/index/index.js
index 12be7b9..129b35e 100644
--- a/pages/user/index/index.js
+++ b/pages/user/index/index.js
@@ -7,7 +7,8 @@ Page({
*/
data: {
userInfo:{},
- appConfig:{}
+ appConfig:{},
+ isStartLoopOrder:false
},
/**
@@ -42,6 +43,39 @@ Page({
}
})
},
+
+ findNewOrder(){
+ console.log(123);
+ },
+
+ bgNoticeSuccess(){
+ this.setData({
+ bgNoticeLoadResult:{
+ error:false,
+ loading:false
+ }
+ })
+ },
+
+ bgNoticeError(){
+ wx.showToast({
+ icon:'error',
+ title: '资源加载失败',
+ })
+ this.setData({
+ bgNoticeLoadResult:{
+ error:true,
+ loading:false
+ }
+ })
+ },
+
+ stopBGNotice(){
+ this.setData({
+ isStartLoopOrder:false
+ })
+ },
+
/**
* 生命周期函数--监听页面初次渲染完成
*/
diff --git a/pages/user/index/index.json b/pages/user/index/index.json
index 965b8e8..4d2d18a 100644
--- a/pages/user/index/index.json
+++ b/pages/user/index/index.json
@@ -1,4 +1,6 @@
{
- "usingComponents": {},
+ "usingComponents": {
+ "background-notice":"/miniprogram_npm/@beefast-wxmp/background-notice"
+ },
"navigationStyle": "custom"
}
\ No newline at end of file
diff --git a/pages/user/index/index.wxml b/pages/user/index/index.wxml
index c43eefa..ae6df53 100644
--- a/pages/user/index/index.wxml
+++ b/pages/user/index/index.wxml
@@ -18,8 +18,12 @@
用户协议
-
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/info/index.js b/pages/user/info/index.js
new file mode 100644
index 0000000..8731cf0
--- /dev/null
+++ b/pages/user/info/index.js
@@ -0,0 +1,82 @@
+import userApi from '../../../api/user';
+const app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ summary:{},
+ refreshTrigger:false,
+ isAuth:false
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ },
+
+ refreshSummary(){
+ userApi.summary().then((data)=>{
+ this.setData({
+ summary:data,
+ refreshTrigger:false
+ })
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+ this.refreshSummary();
+ app.getUserInfo().then((data)=>{
+ this.setData({
+ isAuth:data.is_auth
+ })
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/user/info/index.json b/pages/user/info/index.json
new file mode 100644
index 0000000..d3ac607
--- /dev/null
+++ b/pages/user/info/index.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "nav-bar":"/miniprogram_npm/@beefast-wxmp/nav-bar"
+ },
+ "navigationStyle": "custom"
+}
\ No newline at end of file
diff --git a/pages/user/info/index.wxml b/pages/user/info/index.wxml
new file mode 100644
index 0000000..0b69d6c
--- /dev/null
+++ b/pages/user/info/index.wxml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+ 账户余额 (元)
+ {{summary.balance}}
+ 今日收益(元) {{summary.today_income}}
+
+
+
+
+
+
+
+
+ 交易明细
+
+
+
+
+
+ 提现记录
+
+
+
+
+
+
+ 实名认证
+
+
+
+
+
+
+
+ 银行卡管理
+
+
+
+
+
diff --git a/pages/user/info/index.wxss b/pages/user/info/index.wxss
new file mode 100644
index 0000000..50a5d9c
--- /dev/null
+++ b/pages/user/info/index.wxss
@@ -0,0 +1,28 @@
+.bg{
+ background-color: var(--main-color);
+ border-radius: 0 0 20rpx 20rpx;
+ padding-bottom:240rpx;
+}
+.scroll-view{
+ position: fixed;
+ top:15vh;left:0;
+ height:85vh;
+}
+.user-info{
+ text-align: center;
+ padding-top:60rpx;
+}
+.user-info ._money{
+ font-size: 80rpx;
+ margin-top:50rpx;
+ font-weight: 600;
+}
+.user-info .today{
+ font-size: 28rpx;
+ color: #555555;
+ margin-top:50rpx;
+}
+.user-info .button{
+ border-radius: 60rpx;
+ margin-top:70rpx;
+}
\ No newline at end of file
diff --git a/pages/user/rnAuth/index.js b/pages/user/rnAuth/index.js
new file mode 100644
index 0000000..34e37dd
--- /dev/null
+++ b/pages/user/rnAuth/index.js
@@ -0,0 +1,100 @@
+import userApi from '../../../api/user';
+const app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ name:'',
+ idCard:'',
+ already:false
+ },
+ validator:{
+ name:{minLength:2,message:'请输入真实的姓名',autoFocus:true,shake:true},
+ idCard:{length:18,message:'请输入正确的身份证号码',autoFocus:true,shake:true}
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ userApi.getRNAuth().then((data)=>{
+ if(data&&data.id_number){
+ this.setData({
+ name:data.name,
+ idCard:data.id_number,
+ already:true
+ })
+ }
+ });
+ },
+
+ save(){
+ app.resetUserInfoUpdateTag();
+ const valid = app.validateForm(this.validator,this);
+ if(valid.length==0){
+ userApi.setRNAuth({
+ name:this.data.name,
+ id_number:this.data.idCard
+ }).then((data)=>{
+ wx.navigateBack({
+ success(){
+ wx.showToast({
+ title: '保存成功',
+ })
+ }
+ })
+ })
+ }
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/user/rnAuth/index.json b/pages/user/rnAuth/index.json
new file mode 100644
index 0000000..93cb347
--- /dev/null
+++ b/pages/user/rnAuth/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "实名认证"
+}
\ No newline at end of file
diff --git a/pages/user/rnAuth/index.wxml b/pages/user/rnAuth/index.wxml
new file mode 100644
index 0000000..feadfe7
--- /dev/null
+++ b/pages/user/rnAuth/index.wxml
@@ -0,0 +1,38 @@
+
+
+
+ 真实姓名
+
+
+
+ {{nameMessage}}
+
+
+
+ 身份证号
+
+
+
+ {{idCardMessage}}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/rnAuth/index.wxss b/pages/user/rnAuth/index.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/pages/user/withdraw/index/index.js b/pages/user/withdraw/index/index.js
new file mode 100644
index 0000000..ec6d8bb
--- /dev/null
+++ b/pages/user/withdraw/index/index.js
@@ -0,0 +1,167 @@
+import userApi from '../../../../api/user';
+const app = getApp();
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ bankList:[],
+ amount:'',
+ amountMessage:'',
+ summary:{},
+ inputFocus:false,
+ bank:''
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ userApi.bankCard.list().then((data)=>{
+ data.map((item)=>{
+ item.endNumber = item.card_number.substr(item.card_number.length-4,item.card_number.length);
+ });
+ this.setData({
+ bank:data.length>0?data[0].id:'',
+ bankList:data
+ })
+ });
+
+ this.getSummary();
+ },
+ getSummary(){
+ userApi.summary().then((data)=>{
+ this.setData({
+ summary:data
+ })
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+ setAmountAll(){
+ this.setData({
+ amount:this.data.summary.balance
+ })
+ },
+ widthdraw(){
+ if(this.data.amount==''){
+ this.setData({
+ amountMessage:'请输入提现金额',
+ inputFocus:true
+ })
+ return;
+ }else{
+ this.setData({
+ amountMessage:''
+ })
+ }
+ if(this.data.bank){
+ userApi.withdraw.add(this.data.bank,this.data.amount).then((data)=>{
+ this.getSummary();
+ this.setData({
+ amount:''
+ })
+ const bank = this.data.bankList.find((item)=>item.id==data.bank_card_id);
+ console.log(bank,data.id);
+ const showText = `${bank.bank_name}(${bank.endNumber})`;
+ wx.navigateTo({
+ url: `/pages/withdraw/success/index?amount=${data.amount}&bank=${showText}`,
+ })
+ });
+ }else{
+ wx.showToast({
+ icon:'error',
+ title: this.data.bankList.length==0?'请添加银行卡':'请选择银行卡',
+ })
+ }
+ },
+ amountInput(event){
+ console.log(event.detail);
+ let amount = event.detail.value;
+ if(amount&&isNaN(parseFloat(amount))){
+ amount = 0;
+ }else{
+ let a = amount.split('.');
+ if(a.length>1&&a[1]==''){
+
+ }else{
+ if(a.length>1){
+ amount = parseFloat(amount).toFixed(1);
+ }else if(a.length==1&&a[0]!=''){
+ amount = `${parseInt(amount)}`;
+ }
+ if(amount>this.data.summary.balance){
+ amount = this.data.summary.balance;
+ }
+ }
+ }
+ this.setData({
+ amount:amount
+ });
+ },
+ amountBlur(){
+ const a = this.data.amount.split('.');
+ if(a[1]==''){
+ this.setData({
+ amount:parseInt(a)
+ })
+ }
+ },
+ navToAddCard(){
+ wx.navigateTo({
+ url: '/pages/user/bank/editor/index',
+ })
+ },
+ bankChange(event){
+ this.setData({
+ bank:event.detail.value
+ })
+ },
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/user/withdraw/index/index.json b/pages/user/withdraw/index/index.json
new file mode 100644
index 0000000..b7d6b8b
--- /dev/null
+++ b/pages/user/withdraw/index/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "账户提现"
+}
\ No newline at end of file
diff --git a/pages/user/withdraw/index/index.wxml b/pages/user/withdraw/index/index.wxml
new file mode 100644
index 0000000..2306eb5
--- /dev/null
+++ b/pages/user/withdraw/index/index.wxml
@@ -0,0 +1,37 @@
+
+
+ 提现金额
+ 24小时到账
+
+
+
+ {{amountMessage}}
+
+
+ 账户余额:{{summary.balance}}
+ 全部提现
+
+
+
+
+ 提现方式
+
+
+
+
+
+
+
+
+ 添加银行卡
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/withdraw/index/index.wxss b/pages/user/withdraw/index/index.wxss
new file mode 100644
index 0000000..a24ae67
--- /dev/null
+++ b/pages/user/withdraw/index/index.wxss
@@ -0,0 +1,93 @@
+.amount{
+ padding-bottom:0;
+}
+.amount .head{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.amount .head .key{
+ font-size: 32rpx;
+}
+.amount .head .value{
+ font-size: 26rpx;
+ color: #888888;
+}
+
+.amount .input-area{
+ display: flex;
+ align-items: center;
+ margin-top:60rpx;
+ position: relative;
+}
+.amount .input-area .error{
+ position: absolute;
+ bottom:-15rpx;left:55rpx;
+ color:red;
+ font-size: 24rpx;
+}
+.amount .input-area::before{
+ content: '¥';
+ font-size: 50rpx;
+ font-weight: 500;
+}
+.amount .input{
+ flex: 1;
+ font-size: 76rpx;
+ font-weight: 600;
+ height:114rpx;
+ margin-left:24rpx;
+}
+.amount .input-placeholder{
+ font-size: 56rpx;
+}
+.amount .bottom{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 26rpx;
+}
+.amount .bottom .value{
+ padding:32rpx 0 32rpx 32rpx;
+ color:var(--main-color);
+}
+
+.banks{
+}
+.banks .spliter{
+ margin-top:30rpx;
+}
+.banks .bank-list{
+ margin-top:20rpx;
+}
+.banks .item{
+ display: flex;
+ align-items: center;
+ padding:20rpx 0;
+ margin:0;
+}
+.banks .icon{
+ width:44rpx;height:44rpx;
+}
+.banks .icon.plus{
+ background-color: var(--main-color);
+ border-radius: 50%;
+ color:#fff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.banks .icon .plus{
+ width:28rpx;height:28rpx;
+}
+.banks .name{
+ font-size: 32rpx;
+ margin-left:30rpx;
+ flex:1;
+}
+.banks .checkbox{}
+
+.widthdraw-btn{
+ margin:40rpx 20rpx 0 20rpx!important;
+}
\ No newline at end of file
diff --git a/pages/user/withdraw/list/index.js b/pages/user/withdraw/list/index.js
new file mode 100644
index 0000000..46dfc63
--- /dev/null
+++ b/pages/user/withdraw/list/index.js
@@ -0,0 +1,111 @@
+import userApi from '../../../../api/user';
+
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ pager:{limit:10,loading:false,loadAll:false,pageIndex:0,refreshTrigger:false},
+ list:[],
+ statusKV:userApi.withdraw.statusKV
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.loadList();
+ },
+ refreshList(){
+ this.data.pager.pageIndex = 0;
+ this.data.pager.loadAll = false;
+ this.setData({
+ pager:this.data.pager
+ });
+ this.loadList();
+ },
+ loadList(){
+ if(this.data.pager.loading||this.data.pager.loadAll){
+ return;
+ }
+ this.setData({
+ "pager.loading":true
+ })
+
+ userApi.withdraw.list({
+ skip:this.data.pager.pageIndex*this.data.pager.limit,
+ limit:this.data.pager.limit
+ }).then((data)=>{
+ data.items.map((item)=>{
+ item.displayName = `${item.bank_name}(${item.bank_card_number.substr(item.bank_card_number.length-4,4)})`;
+ })
+
+ if(this.data.pager.pageIndex==0){
+ this.data.list = data.items;
+ }else{
+ this.data.list = this.data.list.concat(data.items);
+ }
+ this.data.pager.loading = false;
+ this.data.pager.pageIndex++;
+ this.data.pager.refreshTrigger = false;
+ if(data.items.length
+
+
+ {{item.displayName}}
+ {{item.amount}}
+
+
+ {{item.create_time}}
+ {{statusKV[item.status]}}
+
+
+
+
+ 暂无记录
+
+
\ No newline at end of file
diff --git a/pages/user/withdraw/list/index.wxss b/pages/user/withdraw/list/index.wxss
new file mode 100644
index 0000000..f26e25c
--- /dev/null
+++ b/pages/user/withdraw/list/index.wxss
@@ -0,0 +1,36 @@
+.withdraw-list{
+ margin-top:20rpx;
+ height: 100vh;
+}
+.withdraw-list .item{
+ padding:40rpx 30rpx;
+ background-color: #ffffff;
+ border-bottom: 1rpx solid rgba(153, 153, 153, 0.2);
+}
+
+.withdraw-list .item .title{
+ display: flex;
+}
+.withdraw-list .item .left{
+ flex:1;
+}
+.withdraw-list .item .sub-title{
+ display: flex;
+ margin-top:38rpx;
+ color: #999999;
+}
+
+.withdraw-list .item .money{
+ color:var(--main-font-color);
+ font-size: 36rpx;
+ font-weight: 500;
+}
+.withdraw-list .item .status{
+ font-size: 27rpx;
+}
+.withdraw-list .item .status.PENDING{
+ color:var(--main-color);
+}
+.withdraw-list .item .status.APPROVED{
+ color: #00A643;
+}
\ No newline at end of file
diff --git a/pages/user/withdraw/success/index.js b/pages/user/withdraw/success/index.js
new file mode 100644
index 0000000..2276805
--- /dev/null
+++ b/pages/user/withdraw/success/index.js
@@ -0,0 +1,74 @@
+// pages/withdraw/success/index.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ amount:'',
+ bank:''
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.setData({
+ amount:options.amount,
+ bank:options.bank
+ })
+ },
+ done(){
+ wx.navigateBack({
+ delta:2
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/user/withdraw/success/index.json b/pages/user/withdraw/success/index.json
new file mode 100644
index 0000000..b7d6b8b
--- /dev/null
+++ b/pages/user/withdraw/success/index.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "账户提现"
+}
\ No newline at end of file
diff --git a/pages/user/withdraw/success/index.wxml b/pages/user/withdraw/success/index.wxml
new file mode 100644
index 0000000..e0cf57b
--- /dev/null
+++ b/pages/user/withdraw/success/index.wxml
@@ -0,0 +1,22 @@
+
+
+ 提现申请成功
+ 24小时到账 (周末节假日顺延),以实际到账时间为准!
+
+
+
+
+ 提现类型
+ 账户提现
+
+
+ 提现金额
+ {{amount}}
+
+
+ 到账方式
+ {{bank}}
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/withdraw/success/index.wxss b/pages/user/withdraw/success/index.wxss
new file mode 100644
index 0000000..1e81843
--- /dev/null
+++ b/pages/user/withdraw/success/index.wxss
@@ -0,0 +1,27 @@
+.success-info{
+ text-align: center;
+ padding-top:70rpx
+}
+.success-info .icon{
+ width:90rpx;height:90rpx;
+}
+.success-info .title{
+ font-size: 44rpx;
+ margin-top:40rpx;
+ font-weight: 500;
+}
+.success-info .sub-title{
+ font-size: 24rpx;
+ color: #555555;
+ margin-top:40rpx;
+}
+.order-info .cell-hd{
+ color:#555555;
+}
+.order-info .cell-bd{
+ font-weight: 500;
+}
+
+.done-btn{
+ margin:40rpx 20rpx 0 20rpx!important;
+}