Skip to content

Commit

Permalink
规时的第一个版本
Browse files Browse the repository at this point in the history
  • Loading branch information
yossi-lee committed Nov 9, 2019
1 parent ee9c02d commit f5ab8a6
Show file tree
Hide file tree
Showing 135 changed files with 3,377 additions and 0 deletions.
14 changes: 14 additions & 0 deletions GuiShi-pages/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/

# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes

# Node.js
node_modules/
Empty file added GuiShi-pages/README.md
Empty file.
15 changes: 15 additions & 0 deletions GuiShi-pages/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//app.js
App({
onLaunch: function () {
console.log('app onlaunch');
var myDate = new Date();
var currentDate = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
var currentTime = myDate.getHours() + ":" + myDate.getMinutes(); //获取当前分钟数(0-59)
console.log(currentDate);
console.log(currentTime);
this.globalData.currentDate = currentDate;
this.globalData.currentTime = currentTime;
},

globalData: {}
})
55 changes: 55 additions & 0 deletions GuiShi-pages/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"pages": [
"pages/login/login",
"pages/timeline/timeline",
"pages/logs/logs",
"pages/add/countdown/countdown",
"pages/add/mail/mail",
"pages/add/diary/diary",
"pages/mime/mime",
"pages/myPlan/myPlan",
"pages/myDiary/myDiary",
"pages/myLetter/myLetter",
"pages/myDiaryDetail/myDiaryDetail",
"pages/myLetterDetail/myLetterDetail",
"pages/plan/plan",
"pages/addPlan/addPlan"
],
"window": {
"navigationBarBackgroundColor": "#60C0FF",
"navigationBarTitleText": "规时",
"navigationBarTextStyle": "white",
"backgroundTextStyle": "light"
},
"tabBar": {
"color": "#333333",
"selectedColor": "#5B80AA",
"borderStyle": "black",
"list": [
{
"selectedIconPath": "image/icon/沙漏-click.png",
"iconPath": "image/icon/沙漏.png",
"pagePath": "pages/timeline/timeline",
"text": "倒计时"
},
{
"selectedIconPath": "image/icon/时间.png",
"iconPath": "image/icon/时间-click.png",
"pagePath": "pages/plan/plan",
"text": "日计划"
},
{
"selectedIconPath": "image/icon/我的-click.png",
"iconPath": "image/icon/我的.png",
"pagePath": "pages/mime/mime",
"text": "MINE"
}
]
},
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"sitemapLocation": "sitemap.json"
}
8 changes: 8 additions & 0 deletions GuiShi-pages/app.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**app.wxss**/
.container {
display: flex;
padding: 40rpx;
align-items: center;
flex-direction: column;
}

36 changes: 36 additions & 0 deletions GuiShi-pages/config/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// 服务器域名
const baseUrl = 'https://www.qianyucc.xyz/wxapp/';
// const baseUrl = 'https://localhost:8083/wxapp/';
// 用户登录
const loginUrl = baseUrl + 'api/user/login';
// 添加信息
const addUrl = baseUrl + 'api/add';
// 获取倒计时
const getCountDownUrl = baseUrl + 'api/getCountDown';
// 获取计划
const getPlanUrl = baseUrl + 'api/getPlan';
// 获取信件
const getLetterUrl = baseUrl + 'api/getLetter';
// 获取日记
const getDiaryUrl = baseUrl + 'api/getDiary';
// 删除数据
const deleteUrl = baseUrl + 'api/delete';
// 更新数据
const updateUrl = baseUrl + 'api/update';
// 获取完成和未完成的计划数量
const getPlanCountUrl = baseUrl + 'api/getPlanCount';
// 获取按照日期分组的计划
const getPlanGroupByDate = baseUrl + 'api/getPlanGroupByDate';

module.exports = {
loginUrl:loginUrl,
addUrl:addUrl,
getCountDownUrl:getCountDownUrl,
getPlanUrl:getPlanUrl,
getLetterUrl:getLetterUrl,
getDiaryUrl:getDiaryUrl,
deleteUrl:deleteUrl,
updateUrl:updateUrl,
getPlanCountUrl: getPlanCountUrl,
getPlanGroupByDate: getPlanGroupByDate
};
Binary file added GuiShi-pages/image/icon/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/diary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/leaf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/mail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/plan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/planplus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/plus2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/我的-click.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/我的.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/时间-click.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/时间.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/沙漏-click.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/icon/沙漏.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/image/delect.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/image/gundong1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/image/gundong2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/image/gundong3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/image/line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GuiShi-pages/image/image/tb1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions GuiShi-pages/libs/bmap-wx.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions GuiShi-pages/libs/bmap-wx.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 87 additions & 0 deletions GuiShi-pages/pages/add/countdown/countdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
const api = require('../../../config/config.js')

const app = getApp();

Page({
data: {
update:false,
event: '',
enddate: app.globalData.currentDate,
},

onLoad: function (options){
let countDown = {};
for (let key in options) {
countDown[key] = decodeURIComponent(options[key]);
}
console.log(countDown);
if (JSON.stringify(countDown) != "{}"){
this.setData({
update:true,
enddate: countDown.enddate,
input: countDown.event,
countDown:countDown
});
}
},

setevent:function(e){
console.log('事件发送选择改变,携带值为', e.detail.value)
this.setData({
event: e.detail.value
});
},

bindDateChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
enddate: e.detail.value
});

},

formSubmit: function (e) {
let that = this;
console.log('form发生了timelien-submit事件,携带数据为:', e.detail.value);
var event=e.detail.value.input;
var enddate=e.detail.value.data;
if(that.data.update){
wx.request({
url: api.updateUrl,
method: "POST",
data: {
type: "countDown",
id: that.data.countDown.id,
data: {
event: event,
endTime: enddate,
}
},
success: function (res) {
console.log(res.data);
}
});
} else {
wx.request({
url: api.addUrl,
method: "POST",
data: {
type: "countDown",
data: {
uid: app.globalData.userInfo.uid,
event: event,
endTime: enddate,
}
},
success: function (res) {
console.log(res.data);
}
});
}
wx.navigateBack({
delta: 1
})
},


})
6 changes: 6 additions & 0 deletions GuiShi-pages/pages/add/countdown/countdown.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"navigationBarBackgroundColor": "#7AA3CC",
"navigationBarTextStyle": "white",
"backgroundTextStyle": "light",
"navigationBarTitleText": "倒计时"
}
18 changes: 18 additions & 0 deletions GuiShi-pages/pages/add/countdown/countdown.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<view class='container'>
<form bindsubmit="formSubmit" >
<view class="workname">

<text>事件名称: </text>
<input value="{{ input }}" name="input" bindchange='setevent' placeholder=" 例如:六级考试..." />
</view>
<view class="workname">
<picker mode="date" name="data" value="{{enddate}}" start="2019-01-01" end="2030-09-01" bindchange="bindDateChange">
<text>截止日期:</text>
<text style='padding:80rpx;color:gray;padding-left:20rpx;'> {{enddate}}</text>
</picker>
</view>
<view style='padding:50rpx;'>
<button form-type="submit" class="submit">完成</button>
</view>
</form>
</view>
15 changes: 15 additions & 0 deletions GuiShi-pages/pages/add/countdown/countdown.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.container{
background: linear-gradient(rgb(122, 163, 204), white);
}
.workname{
padding-top: 80rpx;
padding-left: 80rpx;
text-align: center;
display: flex;
flex-direction: row;
}

.submit{
margin-top: 60rpx;
background-color:#7AA3CC;
}
77 changes: 77 additions & 0 deletions GuiShi-pages/pages/add/diary/diary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
var util = require('../../../utils/util.js')
var bmap = require('../../libs/bmap-wx.min.js')
const api = require('../../../config/config.js')

const app = getApp();


Page({

data: {
intput: '',
weatherData: '',
weekData: '',
dayData: '',
timedata: '',
},
formSubmit: function(e, ) {
console.log('form发生了submit事件,携带数据为:', e.detail.value),
console.log('timedata:', this.data.timedata),
console.log('时间,天气,记录:', this.data.weatherData)
wx.request({
url: api.addUrl,
method: "POST",
data: {
type: "diary",
data: {
uid: app.globalData.userInfo.uid,
time: this.data.timedata,
weather: this.data.weatherData.weatherDesc,
week: this.data.weekData,
content: e.detail.value.input,
}
},
success: function(res) {
console.log(res.data);
wx.showToast({
title: '添加成功!',
icon: 'success',
duration: 1500,
mask: true
});
},
});
wx.navigateBack({
delta: 1
})
},


onLoad: function() {
var data = util.formatData(new Date());
this.setData({
timedata: data,
});
var that = this;
var BMap = new bmap.BMapWX({
ak: 'HFTil24AyGBWDrCzbKsxOoKl2OmL2T4O'
});
var fail = function(data) {
console.log('fail!!!!')
console.log(data);
};
var success = function(data) {
console.log('success!!!');
var weatherData = data.currentWeather[0];
that.setData({
weatherData: weatherData,
weekData: weatherData.date.substring(0, 2),
dayData: weatherData.date.substring(3, 9),
});
}
BMap.weather({
fail: fail,
success: success
});
}
})
8 changes: 8 additions & 0 deletions GuiShi-pages/pages/add/diary/diary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{

"navigationBarBackgroundColor": "#489B81",
"navigationBarTextStyle": "white",
"backgroundTextStyle": "light",
"navigationBarTitleText": "日记"

}
17 changes: 17 additions & 0 deletions GuiShi-pages/pages/add/diary/diary.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<form bindsubmit="formSubmit">

<view class='container'>
<text class="weather">{{dayData}}</text>
<text class="weather">{{weekData}}</text>
<text class="weather">{{weatherData.temperature}}</text>
<text class="weather">{{weatherData.weatherDesc}}</text>
</view>

<view class="section">
<textarea maxlength='2000' name="input" placeholder="请输入日记内容......"></textarea>
</view>

<view style='padding:50rpx;'>
<button form-type="submit" class="submit">完成</button>
</view>
</form>
Loading

0 comments on commit f5ab8a6

Please sign in to comment.