forked from hzuapps/wechat-miniprogram-hzc-2017
-
Notifications
You must be signed in to change notification settings - Fork 0
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
ST
authored and
ST
committed
Nov 1, 2017
1 parent
a4ed37a
commit ea26c71
Showing
41 changed files
with
693 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//app.js | ||
App({ | ||
onLaunch: function () { | ||
// 展示本地存储能力 | ||
var logs = wx.getStorageSync('logs') || [] | ||
logs.unshift(Date.now()) | ||
wx.setStorageSync('logs', logs) | ||
|
||
// 登录 | ||
wx.login({ | ||
success: res => { | ||
// 发送 res.code 到后台换取 openId, sessionKey, unionId | ||
} | ||
}) | ||
// 获取用户信息 | ||
wx.getSetting({ | ||
success: res => { | ||
if (res.authSetting['scope.userInfo']) { | ||
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 | ||
wx.getUserInfo({ | ||
success: res => { | ||
// 可以将 res 发送给后台解码出 unionId | ||
this.globalData.userInfo = res.userInfo | ||
|
||
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 | ||
// 所以此处加入 callback 以防止这种情况 | ||
if (this.userInfoReadyCallback) { | ||
this.userInfoReadyCallback(res) | ||
} | ||
} | ||
}) | ||
} | ||
} | ||
}) | ||
}, | ||
globalData: { | ||
userInfo: null | ||
} | ||
}) |
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,42 @@ | ||
{ | ||
"pages": [ | ||
"pages/comp/scroll", | ||
"pages/index/index", | ||
"pages/logs/logs", | ||
"pages/comp/view", | ||
"pages/example/list/list", | ||
"pages/example/article/article", | ||
"pages/form/form", | ||
"pages/example/arti1/arti1" | ||
|
||
|
||
], | ||
"window": { | ||
"backgroundTextStyle": "light", | ||
"navigationBarBackgroundColor": "#BBDEF8", | ||
"navigationBarTitleText": "水果世界", | ||
"navigationBarTextStyle": "white" | ||
}, | ||
"tabBar": { | ||
"list": [ | ||
{ | ||
"pagePath": "pages/index/index", | ||
"iconPath": "images/1.png", | ||
"selectedIconPath": "images/11.png", | ||
"text": "首页" | ||
}, | ||
{ | ||
"pagePath": "pages/comp/scroll", | ||
"iconPath": "images/2.png", | ||
"selectedIconPath": "images/22.png", | ||
"text": "发现" | ||
}, | ||
{ | ||
"pagePath": "pages/form/form", | ||
"iconPath": "images/3.png", | ||
"selectedIconPath": "images/33.png", | ||
"text": "设置" | ||
} | ||
] | ||
} | ||
} |
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,11 @@ | ||
/**app.wxss**/ | ||
@import 'style/weui.wxss'; | ||
.container { | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 200rpx 0; | ||
box-sizing: border-box; | ||
} |
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 @@ | ||
Page({}); |
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,32 @@ | ||
<view class="page"> | ||
<view class="page__hd"> | ||
|
||
</view> | ||
<view class="page__bd"> | ||
<view class="weui-article"> | ||
|
||
<view class="weui-article__section"> | ||
|
||
<view class="weui-article__section"> | ||
<view class="weui-article__h3">水果简介</view> | ||
<view class="weui-article__p"> | ||
水果是可以直接进食的果实,指多汁且有甜味的植物果实,不但含有丰富的营养且能够帮助消化。水果是对部分可以食用的植物果实和种子的统称。水果有降血压、减缓衰老、减肥瘦身、皮肤保养、明目、抗癌、降低胆固醇、补充维生素等保健作用。。 | ||
</view> | ||
<view class="weui-article__p"> | ||
<image class="weui-article__img" src="../images/8.jpg" mode="aspectFit" style="height: 180px" /> | ||
<image class="weui-article__img" src="../images/6.jpg" mode="aspectFit" style="height: 180px" /> | ||
</view> | ||
</view> | ||
<view class="weui-article__section"> | ||
|
||
<view class="weui-article__p"> | ||
水果 是对部分可以食用的植物果实或其他器官的统称。 | ||
《隋遗录》:“有郎将自 瓜州宣事回,进合欢水果一器。”清百一居士 《壶天录》卷下:“巷有 王姓名 永者……初卖水果,继为茶社担水。”峻青《秋色赋》:“胶东,这个不愧为水果之乡的半岛上,今年的水果特别丰收。软骨和膜构成。 眼睑多可动,两眼之间隔以薄层垂直的眶间隔,眶後骨与鳞骨形成的骨杆上有一个顳孔。上腭能相对于颅的其他部分而运动,有方骨,口可大张便于吞食猎物。 | ||
|
||
多数蜥蜴具四足,後肢肌肉有力,能迅速奔跑及迅速改变跑动方向,Cnemidophorus属时速达24公里(15哩)。有几科蜥蜴身体延长,四肢缩短,乃至无肢体。壁虎、 鬣蜥属(Uta)及Acanthodactylus属的趾上多缘饰以增加其表面积并防止陷入沙中,壁虎能在垂直的玻璃板上爬行。避役每足5趾,藉皮肤构成的蹼分为内外两组,在後肢外侧3趾、内侧2趾各成一组,前肢反之,适雄体具成对的交接器官──半阴茎。 王蜥能跑过短距离的水面。 | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
</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,6 @@ | ||
page{ | ||
background-color: #FFFFFF; | ||
} | ||
image{ | ||
margin: 4px 0; | ||
} |
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,66 @@ | ||
// pages/example/arti1/article.js | ||
Page({ | ||
|
||
/** | ||
* 页面的初始数据 | ||
*/ | ||
data: { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面加载 | ||
*/ | ||
onLoad: function (options) { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面初次渲染完成 | ||
*/ | ||
onReady: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面显示 | ||
*/ | ||
onShow: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面隐藏 | ||
*/ | ||
onHide: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面卸载 | ||
*/ | ||
onUnload: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 页面相关事件处理函数--监听用户下拉动作 | ||
*/ | ||
onPullDownRefresh: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 页面上拉触底事件的处理函数 | ||
*/ | ||
onReachBottom: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 用户点击右上角分享 | ||
*/ | ||
onShareAppMessage: function () { | ||
|
||
} | ||
}) |
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,2 @@ | ||
<!--pages/example/arti1/article.wxml--> | ||
<text>{{page}}.wxml</text> |
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 @@ | ||
/* pages/example/arti1/article.wxss */ |
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 @@ | ||
Page({}); |
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,30 @@ | ||
<view class="page"> | ||
<view class="page__hd"> | ||
|
||
</view> | ||
<view class="page__bd"> | ||
<view class="weui-article"> | ||
|
||
<view class="weui-article__section"> | ||
|
||
<view class="weui-article__section"> | ||
<view class="weui-article__h3">水果简介</view> | ||
<view class="weui-article__p"> | ||
水果是可以直接进食的果实,指多汁且有甜味的植物果实,不但含有丰富的营养且能够帮助消化。水果是对部分可以食用的植物果实和种子的统称。水果有降血压、减缓衰老、减肥瘦身、皮肤保养、明目、抗癌、降低胆固醇、补充维生素等保健作用。 | ||
</view> | ||
<view class="weui-article__p"> | ||
<image class="weui-article__img" src="../images/7.jpg" mode="aspectFit" style="height: 180px" /> | ||
<image class="weui-article__img" src="../images/6.jpg" mode="aspectFit" style="height: 180px" /> | ||
</view> | ||
</view> | ||
<view class="weui-article__section"> | ||
|
||
<view class="weui-article__p"> | ||
水果 是对部分可以食用的植物果实或其他器官的统称。 | ||
《隋遗录》:“有郎将自 瓜州宣事回,进合欢水果一器。”清百一居士 《壶天录》卷下:“巷有 王姓名 永者……初卖水果,继为茶社担水。”峻青《秋色赋》:“胶东,这个不愧为水果之乡的半岛上,今年的水果特别丰收。 | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
</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,6 @@ | ||
page{ | ||
background-color: #FFFFFF; | ||
} | ||
image{ | ||
margin: 4px 0; | ||
} |
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,112 @@ | ||
Page({ | ||
|
||
/** | ||
* 页面的初始数据 | ||
*/ | ||
data: { | ||
text: "Hello" | ||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面加载 | ||
*/ | ||
onLoad: function (options) { | ||
var that = this; | ||
/* | ||
wx.getStorage({ | ||
key: 'formData', | ||
success: function (res) { | ||
console.log(res.data) | ||
that.setData({ | ||
text: res.data.text, | ||
paragh: res.data.paragh | ||
}); | ||
} | ||
}) | ||
*/ | ||
wx.request({ | ||
url: 'https://infoaas.com/data/hzc.json', //仅为示例,并非真实的接口地址 | ||
data: {}, | ||
header: { | ||
'content-type': 'application/json' // 默认值 | ||
}, | ||
success: function (res) { | ||
console.log(res.data) | ||
that.setData({ | ||
text: res.data.name, | ||
paragh: "任课老师是:" + res.data.teacher + " 2017" | ||
}); | ||
} | ||
}) | ||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面初次渲染完成 | ||
*/ | ||
onReady: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面显示 | ||
*/ | ||
onShow: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面隐藏 | ||
*/ | ||
onHide: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面卸载 | ||
*/ | ||
onUnload: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 页面相关事件处理函数--监听用户下拉动作 | ||
*/ | ||
onPullDownRefresh: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 页面上拉触底事件的处理函数 | ||
*/ | ||
onReachBottom: function () { | ||
|
||
}, | ||
|
||
/** | ||
* 用户点击右上角分享 | ||
*/ | ||
onShareAppMessage: function () { | ||
|
||
}, | ||
|
||
doSubmit: function (e) { | ||
console.dir(e) | ||
var that = this; | ||
var text = e.detail.value.text; | ||
var paragh = e.detail.value.paragh; | ||
|
||
wx.setStorage({ | ||
key: "formData", | ||
data: { | ||
text: text, | ||
paragh: paragh | ||
} | ||
}) | ||
|
||
wx.showToast({ | ||
title: '成功', | ||
icon: 'success', | ||
duration: 2000 | ||
}) | ||
} | ||
}) |
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 @@ | ||
{} |
Oops, something went wrong.