Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
points-mall
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a0bbb270
authored
Aug 15, 2025
by
wangzhihui
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加账户
1 parent
5d8bd058
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
434 additions
and
49 deletions
app.json
packageIndex/pages/bankAccount/add/add.js
packageIndex/pages/bankAccount/add/add.json
packageIndex/pages/bankAccount/add/add.scss
packageIndex/pages/bankAccount/add/add.wxml
project.private.config.json
app.json
View file @
a0bbb27
...
@@ -97,7 +97,9 @@
...
@@ -97,7 +97,9 @@
"goods-action"
:
"/components/GoodsAction/GoodsAction"
,
"goods-action"
:
"/components/GoodsAction/GoodsAction"
,
"glsx-privacy"
:
"glsx-applet-component/GlsxPrivacy/index"
,
"glsx-privacy"
:
"glsx-applet-component/GlsxPrivacy/index"
,
"mp-icon"
:
"weui-miniprogram/icon/icon"
,
"mp-icon"
:
"weui-miniprogram/icon/icon"
,
"mp-dialog"
:
"weui-miniprogram/dialog/dialog"
"mp-dialog"
:
"weui-miniprogram/dialog/dialog"
,
"mp-cell"
:
"weui-miniprogram/cell/cell"
,
"mp-cells"
:
"weui-miniprogram/cells/cells"
},
},
"style"
:
"v2"
,
"style"
:
"v2"
,
"resolveAlias"
:
{
"resolveAlias"
:
{
...
...
packageIndex/pages/bankAccount/add/add.js
View file @
a0bbb27
// packageIndex/pages/bankAccount/add/add.js
// import WxValidate from '~/utils/WxValidate'
console
.
log
(
wx
.
p
.
WxValidate
,
'999'
)
const
{
methods
}
=
new
wx
.
p
.
WxValidate
()
// import MineApi from '~/api/mineApi/index'
Page
({
Page
({
/**
/**
* 页面的初始数据
* 页面的初始数据
*/
*/
data
:
{
data
:
{
form
:
[{
label
:
'姓名'
,
key
:
'bankUserName'
,
placeholder
:
'请输入银行卡预留的姓名'
,
maxlength
:
10
},
{
label
:
'手机号'
,
key
:
'bankPhone'
,
placeholder
:
'请输入银行卡预留的手机号'
,
maxlength
:
11
,
type
:
'number'
},
{
label
:
'身份证'
,
key
:
'idCardNo'
,
placeholder
:
'请输入银行卡预留的身份证号'
,
maxlength
:
18
,
type
:
'idcard'
},
{
label
:
'开户银行'
,
key
:
'bankName'
,
placeholder
:
'请选择您的开户银行'
,
fn
:
'click'
,
pickerData
:
[],
pickerKey
:
'bankName'
},
{
label
:
'银行账户'
,
key
:
'bankNumber'
,
placeholder
:
'请输入开户银行账户'
,
maxlength
:
19
,
type
:
'number'
},
{
label
:
'身份证人像面'
,
key
:
'bankEmblem'
,
icon
:
'emblem'
,
upload
:
true
,
},
{
label
:
'身份证国徽面'
,
key
:
'bankPortrait'
,
icon
:
'portrait'
,
upload
:
true
,
}
],
btnDisabled
:
true
,
formData
:
{
bankUserName
:
''
,
bankPhone
:
''
,
idCardNo
:
''
,
bankName
:
''
,
bankNumber
:
''
,
bankPortrait
:
''
,
bankEmblem
:
''
}
},
},
...
@@ -12,55 +75,180 @@ Page({
...
@@ -12,55 +75,180 @@ Page({
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
(
options
)
{
onLoad
(
options
)
{
if
(
options
&&
options
.
item
)
{
const
{
item
}
=
options
this
.
setData
({
formData
:
{
bankUserName
:
item
.
bankUserName
,
bankPhone
:
item
.
bankPhone
,
idCardNo
:
item
.
idCardNo
,
bankName
:
item
.
bankName
,
bankNumber
:
item
.
bankNumber
},
},
isEditBank
:
true
/**
})
* 生命周期函数--监听页面初次渲染完成
wx
.
setNavigationBarTitle
({
*/
title
:
'编辑账户'
onReady
()
{
})
this
.
check
()
}
// this.getBankList()
},
},
async
upload
(
e
)
{
/**
console
.
log
(
1111
)
* 生命周期函数--监听页面显示
const
{
*/
item
:
{
onShow
()
{
key
,
}
}
=
e
.
currentTarget
.
dataset
console
.
log
(
e
)
const
{
tempFiles
}
=
await
wx
.
chooseMedia
({
count
:
1
,
mediaType
:
[
'image'
]
}),
[
file
]
=
tempFiles
,
_this
=
this
wx
.
p
.
wxApi
.
showLoading
(
'上传中...'
)
console
.
log
(
tempFiles
,
'tempFiles'
)
let
fileUrl
=
file
.
tempFilePath
let
imgType
=
fileUrl
.
split
(
'.'
)[
1
]
let
type
=
imgType
==
'unknown'
?
'jpg'
:
imgType
try
{
wx
.
getFileSystemManager
().
readFile
({
filePath
:
fileUrl
,
//选择图片返回的相对路径
encoding
:
'base64'
,
//编码格式
success
(
_res
)
{
wx
.
p
.
wxApi
.
showLoading
(
'上传中...'
)
wx
.
p
.
api
.
common
.
uploadImg
({
file
:
`
${
type
}
@
${
_res
.
data
}
`
})
.
then
(
img
=>
{
console
.
log
(
img
)
wx
.
p
.
wxApi
.
hideLoading
()
_this
.
setData
({
[
`formData.
${
key
}
`
]:
img
})
})
}
})
}
catch
(
error
)
{
wx
.
p
.
wxApi
.
showToast
(
String
(
JSON
.
stringify
(
error
)))
}
},
},
async
getBankList
()
{
/**
// const {
* 生命周期函数--监听页面隐藏
// bankList
*/
// } = await wx.$util.getMockData(), {
onHide
()
{
// form
// } = this.data,
// index = form.findIndex(e => e.key == 'bankName')
// this.setData({
// [`form[${index}].pickerData`]: bankList
// })
},
},
bindInput
(
e
)
{
/**
console
.
log
(
e
)
* 生命周期函数--监听页面卸载
const
{
*/
item
:
{
onUnload
()
{
key
,
}
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
[
`formData.
${
key
}
`
]:
e
.
detail
.
value
})
this
.
check
()
},
},
bindPickerChange
(
e
)
{
/**
const
{
* 页面相关事件处理函数--监听用户下拉动作
value
*/
}
=
e
.
detail
,
{
onPullDownRefresh
()
{
item
:
{
key
,
pickerKey
,
pickerData
}
}
=
e
.
currentTarget
.
dataset
,
val
=
pickerData
[
value
][
pickerKey
]
this
.
setData
({
[
`formData.
${
key
}
`
]:
val
})
this
.
check
()
},
},
check
()
{
/**
const
{
* 页面上拉触底事件的处理函数
formData
*/
}
=
this
.
data
onReachBottom
()
{
let
btnDisabled
=
false
try
{
for
(
const
key
in
formData
)
{
if
(
!
formData
[
key
])
throw
true
}
}
catch
(
error
)
{
btnDisabled
=
error
}
this
.
setData
({
btnDisabled
})
},
},
dialogClose
()
{
/**
wx
.
$router
.
back
()
* 用户点击右上角分享
},
*/
dialogConfirm
()
{
onShareAppMessage
()
{
const
{
success
,
isEditBank
}
=
this
.
data
,
{
score
,
user
}
=
this
.
options
if
(
success
)
wx
.
$router
.
redirectTo
(
'/packageStoreAssistant/packageMine/pages/withdrawal/withdrawal'
,
{
score
,
user
,
isEditBank
})
else
this
.
setData
({
showModal
:
false
})
},
async
submit
()
{
const
{
formData
}
=
this
.
data
,
{
item
}
=
this
.
options
,
{
uuid
}
=
wx
.
$storage
.
get
(
'userInfo'
),
validateKeys
=
[
'bankPhone'
,
'idCardNo'
]
try
{
validateKeys
.
map
(
e
=>
{
if
(
e
==
'bankPhone'
&&
!
methods
.
tel
(
formData
[
e
]))
throw
'手机号'
if
(
e
==
'idCardNo'
&&
!
methods
.
idcard
(
formData
[
e
]))
throw
'身份证'
})
}
catch
(
error
)
{
return
wx
.
$api
.
showToast
(
`请输入正确的
${
error
}
`
)
}
if
(
item
&&
item
.
id
)
formData
.
id
=
item
.
id
formData
.
uuid
=
uuid
const
{
code
,
message
}
=
await
MineApi
.
insetorupdateStaffBank
(
formData
)
if
(
code
==
'0'
)
{
this
.
setData
({
showModal
:
true
,
success
:
true
,
dialogText
:
'您的银行账户添加成功!'
})
}
else
{
this
.
setData
({
showModal
:
true
,
success
:
false
,
dialogText
:
`原因:
${
message
}
`
})
// wx.$api.showToast(message)
}
}
}
})
})
\ No newline at end of file
\ No newline at end of file
packageIndex/pages/bankAccount/add/add.json
View file @
a0bbb27
{
{
"usingComponents"
:
{}
"navigationBarTitleText"
:
"添加账户"
,
"usingComponents"
:
{
}
}
}
\ No newline at end of file
\ No newline at end of file
packageIndex/pages/bankAccount/add/add.scss
View file @
a0bbb27
/* packageIndex/pages/bankAccount/add/add.wxss */
\ No newline at end of file
\ No newline at end of file
page
{
background
:
#F7F8FA
;
}
.tips
{
font-size
:
28rpx
;
color
:
#6E6E7A
;
height
:
88rpx
;
padding-left
:
48rpx
;
text
{
font-size
:
24rpx
;
color
:
#333333
;
}
}
.form
{
margin
:
0
32rpx
;
border-radius
:
16rpx
;
background-color
:
#fff
;
padding-bottom
:
34rpx
;
.item
{
height
:
112rpx
;
// padding:34rpx 0 35rpx;
border-bottom
:
2rpx
solid
#F0F0F0
;
&
:last-of-type
{
border-bottom
:
none
;
}
.input
{
width
:
450rpx
!
important
;
font-weight
:
400
;
font-size
:
28rpx
;
color
:
#292D33
;
}
.placeStyle
{
font-weight
:
400
;
font-size
:
28rpx
;
color
:
#BEC1C7
;
letter-spacing
:
0
;
text-align
:
right
;
}
}
.btn-hover
{
opacity
:
.75
;
}
}
.my-cells
{
.weui-cell__bd
{
width
:
168rpx
;
font-weight
:
500
;
font-size
:
28rpx
;
color
:
#1B233D
;
}
}
.button
{
background
:
#FB8A32
;
border-radius
:
20rpx
;
margin
:
96rpx
auto
40rpx
;
font-weight
:
600
;
font-size
:
32rpx
;
color
:
#FFFFFF
;
padding
:
22rpx
326rpx
;
line-height
:
44rpx
;
white-space
:
nowrap
;
&
[
disabled
]
:not
([
type
])
{
background
:
#CCCED1
!
important
;
border-color
:
#CCCED1
!
important
;
color
:
#fff
!
important
;
box-shadow
:
none
;
&
:
:
after
{
border-color
:
#CCCED1
!
important
;
}
}
&
:
:
after
{
border-color
:
#F13C3D
!
important
;
}
}
.id-card-wrap
{
height
:
276rpx
;
margin-left
:
32rpx
;
.label
{
width
:
168rpx
;
font-weight
:
500
;
font-size
:
28rpx
;
color
:
#333333
;
margin-bottom
:
12rpx
;
margin-top
:
32rpx
;
}
}
.upload-wrap
{
.upload
{
width
:
256rpx
;
height
:
192rpx
;
background
:
#F5F6F7
;
border-radius
:
12rpx
;
padding
:
32rpx
62rpx
64rpx
;
box-sizing
:
border-box
;
.bank-icon
{
width
:
132rpx
;
height
:
96rpx
;
}
.text
{
font-weight
:
400
;
font-size
:
22rpx
;
color
:
#9B9B9E
;
text-align
:
center
;
margin-top
:
12rpx
;
}
}
.bank-img
{
width
:
256rpx
;
height
:
192rpx
;
}
}
\ No newline at end of file
\ No newline at end of file
packageIndex/pages/bankAccount/add/add.wxml
View file @
a0bbb27
<!--packageIndex/pages/bankAccount/add/add.wxml-->
<!--packageIndex/pages/bankAccount/add/add.wxml-->
<text>packageIndex/pages/bankAccount/add/add.wxml</text>
<block>
<view class="tips flex">
账户信息<text>(首次申请兑换时需要您输入正确的银行账户信息)</text>
</view>
<view class="form">
<!-- <mp-cells ext-class="my-cells"> -->
<block wx:for="{{form}}" wx:key="index">
<view class=" flex {{item.upload?'id-card-wrap':'item'}}">
<block wx:if="{{item.pickerData}}">
<picker bindchange="bindPickerChange" range-key="{{item.pickerKey}}" range="{{item.pickerData}}" data-item="{{item}}">
<mp-cell value="{{item.label}}" ext-class="my-cells">
<view slot="footer" class="flex_sc">
<input value="{{ formData[item.key] }}" clearable label="{{item.label}}" placeholder="{{item.placeholder}}" class="input" is-link disabled="true" input-align="right" placeholder-class="placeStyle" />
<mp-icon class="icon-right" icon="arrow" size="{{13}}" color="#BEC1C7"></mp-icon>
</view>
</mp-cell>
<!-- <van-field value="{{ formData[item.key] }}" clearable label="{{item.label}}" placeholder="{{item.placeholder}}" border="{{false}}" label-class="label" input-class="input" is-link readonly input-align="right" /> -->
</picker>
</block>
<block wx:elif="{{item.upload}}">
<view class="upload-wrap" bind:tap="upload" data-item="{{item}}">
<view class="label">{{item.label}}</view>
<block wx:if="{{ !formData[item.key]}}">
<view class="upload">
<glsx-image src="/bankAccount/{{item.icon}}.png" class="bank-icon"></glsx-image>
<view class="text">上传照片</view>
</view>
</block>
<blcok wx:else>
<image webp src="{{formData[item.key]}}" class="bank-img"></image>
</blcok>
</view>
</block>
<block wx:else>
<mp-cell value="{{item.label}}" ext-class="my-cells">
<view slot="footer">
<input value="{{ formData[item.key] }}" placeholder="{{item.placeholder}}" placeholder-style="color: #CECECE;" class="input" input-align="right" maxlength="{{item.maxlength}}" type="{{item.type}}" bindinput="bindInput" data-item="{{item}}" placeholder-class="placeStyle" />
</view>
</mp-cell>
<!-- <van-field value="{{ formData[item.key] }}" clearable label="{{item.label}}" placeholder="{{item.placeholder}}" placeholder-style="color: #CECECE;" border="{{false}}" label-class="label" input-class="input" input-align="right" maxlength="{{item.maxlength}}" type="{{item.type}}" bindinput="bindInput" data-item="{{item}}" /> -->
</block>
</view>
</block>
<!-- </mp-cells> -->
</view>
<!-- disabled="{{btnDisabled}}" -->
<button class="button text-center" hover-class="btn-hover" loading="{{submitLoading}}" bindtap="submit">提交</button>
</block>
<!-- <dialog show="{{showModal}}" confirmText="{{success?'去兑换':'我知道了'}}" cancelText="我知道了" showCancelButton success="{{success}}" bindconfirm="dialogConfirm" bindcancel="dialogClose" text="{{dialogText}}"> -->
<!-- </dialog> -->
\ No newline at end of file
\ No newline at end of file
project.private.config.json
View file @
a0bbb27
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
},
},
{
{
"name"
:
"添加账户"
,
"name"
:
"添加账户"
,
"pathName"
:
"packageIndex/pages/bankAccount/
list/list
"
,
"pathName"
:
"packageIndex/pages/bankAccount/
add/add
"
,
"query"
:
""
,
"query"
:
""
,
"launchMode"
:
"default"
,
"launchMode"
:
"default"
,
"scene"
:
null
"scene"
:
null
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment