Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
X
xzf_uniapp-wechat-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李智书
xzf_uniapp-wechat-web
Commits
f4152181
Commit
f4152181
authored
Nov 09, 2022
by
李智书
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.小智信箱投递;
parent
0d13b69e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
213 additions
and
0 deletions
+213
-0
src/pages.json
src/pages.json
+9
-0
src/pages/socialmailbox/socialmailbox.vue
src/pages/socialmailbox/socialmailbox.vue
+204
-0
No files found.
src/pages.json
View file @
f4152181
...
...
@@ -451,6 +451,15 @@
}
}
,{
"path"
:
"pages/socialmailbox/socialmailbox"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"匿名投递故事"
}
}
],
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
...
...
src/pages/socialmailbox/socialmailbox.vue
0 → 100644
View file @
f4152181
<
template
>
<view
class=
"content"
:style=
"'background-image: url('+ImgUrl2+'background.png);'"
>
<view
class=
"textareabox"
>
<textarea
v-model=
"SubmitInfo.messageContent"
maxlength=
"500"
:placeholder=
"placeholder"
placeholder-class=
"textareaplace"
/>
</view>
<view
class=
"textareabox2"
>
<view
class=
"title"
>
<image
:src=
"ImgUrl2+'remarks.png'"
mode=
"aspectFit"
></image>
<text>
您可在此备注部分信息
</text>
</view>
<textarea
v-model=
"SubmitInfo.remark"
:placeholder=
"placeholder2"
placeholder-class=
"textareaplace"
/>
</view>
<view
@
tap=
"saveOrUpdateMessage"
class=
"envelope"
:style=
"'background-image: url('+ImgUrl2+'envelope.png);'"
>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
ImgUrl2
:
this
.
$ImgUrl
+
'
social_front/
'
,
ImgUrl
:
this
.
$ImgUrl
,
placeholder
:
"
写下您想对孩子说的话,或者分享您与孩子之间发生的真实故事。无论对错,您的故事将被认真倾听和尊重,请避免广告、迷信等违规或不适内容。
"
,
placeholder2
:
"
如:父亲/母亲等、孩子就读学校、您的所在地
"
,
// 提交信息
SubmitInfo
:
{
"
bindPhone
"
:
""
,
//微信绑定电话
"
classId
"
:
0
,
//班级id
"
className
"
:
""
,
//班级名称
"
gradeId
"
:
0
,
//年级id
"
gradeName
"
:
""
,
//年级名称
"
messageContent
"
:
""
,
//投稿内容
"
openId
"
:
""
,
//微信openid
"
remark
"
:
""
,
//投稿备注
"
sourceType
"
:
3
,
//数据来源:0未知、1公众号、2小程序、3H5页面
"
studentId
"
:
0
,
//学生id
"
studentName
"
:
""
,
//学生名
"
wechatName
"
:
""
// 微信名
}
}
},
onLoad
()
{
},
methods
:
{
// 投递信箱
async
saveOrUpdateMessage
()
{
try
{
if
(
!
this
.
SubmitInfo
.
messageContent
)
{
uni
.
showModal
({
title
:
"
温馨提示
"
,
showCancel
:
false
,
content
:
"
请写下您对孩子说的话...
"
,
})
return
}
uni
.
showLoading
({
title
:
"
请稍后
"
,
// #ifndef MP-ALIPAY
mask
:
true
,
// #endif
})
await
new
Promise
((
res
,
rej
)
=>
{
setTimeout
(()
=>
{
res
()
},
300
);
})
let
url
=
`https://dev-az-cloud-api.xiaopay.net`
if
(
window
.
location
.
hostname
.
includes
(
'
uat.xiaopay.net
'
))
{
url
=
`https://test-az-cloud-api.xiaopay.net`
}
if
(
window
.
location
.
hostname
.
includes
(
'
pay.xiaopay.net
'
))
{
url
=
`https://az-cloud-api.xiaopay.net`
}
let
[
err
,
respes
]
=
await
uni
.
request
({
url
:
url
+
'
/cloud-gateway/social-web/openApi/bmailboxinfo/saveOrUpdateMessage
'
,
method
:
"
POST
"
,
dataType
:
"
json
"
,
data
:
this
.
SubmitInfo
})
if
(
err
)
{
uni
.
showToast
({
icon
:
"
none
"
,
title
:
err
.
errMsg
})
return
}
uni
.
hideLoading
()
if
(
respes
.
data
.
code
!=
"
10000
"
)
{
uni
.
showToast
({
icon
:
"
none
"
,
title
:
respes
.
data
.
message
})
return
}
uni
.
showModal
({
title
:
"
温馨提示
"
,
showCancel
:
false
,
content
:
"
投递成功!
"
,
success
:
()
=>
{
this
.
SubmitInfo
=
{
"
bindPhone
"
:
""
,
//微信绑定电话
"
classId
"
:
0
,
//班级id
"
className
"
:
""
,
//班级名称
"
gradeId
"
:
0
,
//年级id
"
gradeName
"
:
""
,
//年级名称
"
messageContent
"
:
""
,
//投稿内容
"
openId
"
:
""
,
//微信openid
"
remark
"
:
""
,
//投稿备注
"
sourceType
"
:
0
,
//数据来源:0未知、1公众号、2小程序、3H5页面
"
studentId
"
:
0
,
//学生id
"
studentName
"
:
""
,
//学生名
"
wechatName
"
:
""
// 微信名
}
}
})
}
catch
(
error
)
{
uni
.
showToast
({
icon
:
"
error
"
,
title
:
error
.
message
})
}
}
}
}
</
script
>
<
style
scoped
>
.content
{
width
:
100%
;
height
:
100vh
;
background-repeat
:
no-repeat
;
background-size
:
100%
100%
;
}
.envelope
{
width
:
100%
;
height
:
330
rpx
;
background-repeat
:
no-repeat
;
background-size
:
100%
100%
;
position
:
fixed
;
bottom
:
10
rpx
;
}
.textareabox
{
width
:
613
rpx
;
font-size
:
32
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
margin
:
0
auto
;
padding-top
:
248
rpx
;
height
:
840
rpx
;
}
.textareabox2
{
width
:
613
rpx
;
font-size
:
32
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
margin
:
0
auto
;
margin-top
:
53
rpx
;
}
.textareabox2
.title
{
display
:
flex
;
align-items
:
center
;
}
.textareabox2
image
{
width
:
28
rpx
;
height
:
28
rpx
;
position
:
relative
;
}
.textareabox2
text
{
display
:
inline-block
;
margin-left
:
13
rpx
;
font-size
:
32
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
rgba
(
0
,
0
,
0
,
0.15
);
}
.textareabox2
textarea
{
line-height
:
60
rpx
;
width
:
100%
;
}
.textareabox
textarea
{
line-height
:
60
rpx
;
height
:
100%
;
width
:
100%
;
}
.textareaplace
{
color
:
rgba
(
0
,
0
,
0
,
0.15
);
line-height
:
60
rpx
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment