-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client_mobile_miniapp): 新增用户反馈页面 ✨ (#16)
- Loading branch information
Showing
8 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
var api = require('../../utils/api.js') | ||
var { request } = require('../../utils/request.js') | ||
|
||
Page({ | ||
|
||
/** | ||
* 页面的初始数据 | ||
*/ | ||
data: { | ||
title: '', | ||
content: '', | ||
}, | ||
|
||
/** | ||
* 监听标题变化 | ||
*/ | ||
handleChangeTitle: function (e) { | ||
this.setData({ title: e.detail.value }) | ||
}, | ||
|
||
/** | ||
* 监听内容变化 | ||
*/ | ||
handleChangeContent: function (e) { | ||
this.setData({ content: e.detail.value }) | ||
}, | ||
|
||
/** | ||
* 提交 | ||
*/ | ||
handleSubmit: function () { | ||
var that = this | ||
var { title, content } = this.data | ||
var userId = wx.getStorageSync('user_id') || '-1' | ||
|
||
if (!title || !content) { | ||
return wx.showToast({ | ||
title: '标题和内容不能为空', | ||
}) | ||
} | ||
|
||
request({ | ||
url: api.SEND_FEEDBACK_EMAIL, | ||
method: 'POST', | ||
data: { title, content, userId } | ||
}).then(function (res) { | ||
that.setData({ title: '', content: '' }) | ||
wx.showToast({ | ||
title: '提交成功', | ||
}) | ||
wx.switchTab({ | ||
url: '../index/index', | ||
}) | ||
}) | ||
}, | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<view class="wrapper padTop"> | ||
<view class="header"></view> | ||
|
||
<view class="greeting">亲爱的用户您好,感谢您的反馈:</view> | ||
|
||
<input class="title" placeholder="哪个页面体验有瑕疵" bindinput="handleChangeTitle"></input> | ||
|
||
<textarea class="content" placeholder="描述具体内容" | ||
maxlength="300" bindinput="handleChangeContent"></textarea> | ||
|
||
<button class="btn" type="primary" bindtap="handleSubmit">提交</button> | ||
|
||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.greeting { | ||
margin: 40rpx; | ||
font-size: 34rpx; | ||
} | ||
|
||
.title { | ||
background: #fff; | ||
margin: 20rpx; | ||
padding: 20rpx; | ||
font-size: 34rpx; | ||
} | ||
|
||
.content { | ||
background: #fff; | ||
width: 90%; | ||
margin: 20rpx; | ||
padding: 20rpx; | ||
font-size: 38rpx; | ||
} | ||
|
||
.btn { | ||
margin-top: 40rpx; | ||
width: 90%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters