-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae8ae92
commit 87b7b17
Showing
9 changed files
with
138 additions
and
22 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
Binary file not shown.
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 |
---|---|---|
@@ -1,22 +1,67 @@ | ||
// pages/settings/feedback/feedback.js | ||
|
||
var wilddog = require('../../../utils/wilddog-weapp-all') | ||
var config = { | ||
syncURL: 'https://miemie.wilddogio.com', | ||
authDomain: 'miemie.wilddog.com' | ||
} | ||
var app = getApp() | ||
|
||
|
||
Page({ | ||
data:{}, | ||
onLoad:function(options){ | ||
data: { | ||
userInfo: {}, | ||
content: "", | ||
connect: "" | ||
}, | ||
onLoad: function (options) { | ||
|
||
const that = this; | ||
// 页面初始化 options为页面跳转所带来的参数 | ||
app.getUserInfo(function (userInfo) { | ||
that.setData({ | ||
userInfo: userInfo | ||
}) | ||
}) | ||
}, | ||
onReady:function(){ | ||
// 页面渲染完成 | ||
getContent: function (e) { | ||
this.setData({ | ||
content: e.detail.value | ||
}) | ||
}, | ||
onShow:function(){ | ||
// 页面显示 | ||
getConnection: function (e) { | ||
this.setData({ | ||
connect: e.detail.value | ||
}) | ||
}, | ||
onHide:function(){ | ||
// 页面隐藏 | ||
getNowFormatDate: function () { | ||
var date = new Date(); | ||
var seperator1 = "-"; | ||
var seperator2 = ":"; | ||
var month = date.getMonth() + 1; | ||
var strDate = date.getDate(); | ||
if (month >= 1 && month <= 9) { | ||
month = "0" + month; | ||
} | ||
if (strDate >= 0 && strDate <= 9) { | ||
strDate = "0" + strDate; | ||
} | ||
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate | ||
+ " " + date.getHours() + seperator2 + date.getMinutes() | ||
+ seperator2 + date.getSeconds(); | ||
return currentdate; | ||
}, | ||
onUnload:function(){ | ||
// 页面关闭 | ||
submitSuggestion: function () { | ||
wilddog.initializeApp(config) | ||
var ref = wilddog.sync().ref("/web/saving-data/feedback"); | ||
// child() 用来定位到某个节点。 | ||
|
||
var currentdate = this.getNowFormatDate() | ||
ref.child(currentdate).set({ | ||
"content": this.data.content, | ||
"connect": this.data.connect, | ||
"user": this.data.userInfo.nickName | ||
}); | ||
} | ||
|
||
}) |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
<!--pages/settings/feedback/feedback.wxml--> | ||
<text>pages/settings/feedback/feedback.wxml</text> | ||
<view class="container"> | ||
<text class="feedback-label">问题描述</text> | ||
|
||
<textarea class="feedback-text" placeholder="请详细你所遇到的问题" bindblur="getContent"/> | ||
<text class="connect-label">联系方式</text> | ||
<textarea class="connect-text" placeholder="请留下您的联系方式(QQ/微信/电话/等)" bindblur="getConnection"/> | ||
<button class="feedback-button" bindtap="submitSuggestion">提交</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 |
---|---|---|
@@ -1 +1,44 @@ | ||
/* pages/settings/feedback/feedback.wxss */ | ||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
height: 100%; | ||
justify-content: space-between; | ||
box-sizing: border-box; | ||
} | ||
|
||
.feedback-label { | ||
float: left; | ||
margin-top: 40rpx; | ||
font-size: 32rpx; | ||
} | ||
|
||
.feedback-text { | ||
margin-top: 40rpx; | ||
background-color: #fff; | ||
padding: 30rpx; | ||
font-size: 32rpx; | ||
width: 80%; | ||
border-radius: 10rpx; | ||
} | ||
|
||
.connect-label { | ||
margin-top: 60rpx; | ||
font-size: 32rpx; | ||
} | ||
|
||
.connect-text { | ||
margin-top: 40rpx; | ||
background-color: #fff; | ||
padding: 30rpx; | ||
font-size: 32rpx; | ||
width: 80%; | ||
height: 80rpx; | ||
border-radius: 10rpx; | ||
} | ||
|
||
.feedback-button { | ||
margin-top: 80rpx; | ||
width: 88%; | ||
font-size: 38rpx; | ||
} |
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
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
@font-face { | ||
font-family: Chalkboard; | ||
src: url('/assets/font/chalkboard.ttf'), | ||
} | ||
|
||
.container { | ||
display: flex; | ||
|
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,2 @@ | ||
exports.hotAppKey='hotapp81448114'; //小程序在hotapp平台注册的appKey | ||
exports.appVer='0.1.0'; //本地小程序的版本号,用来区分错误统计 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.