From 81cebf4f1981000ccd70df04c22e80b85c3f55a6 Mon Sep 17 00:00:00 2001 From: liangfenghan <497695176@qq.com> Date: Wed, 1 Nov 2017 11:45:36 +0800 Subject: [PATCH] =?UTF-8?q?#84=20=E6=9C=9F=E6=9C=AB=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1517060338/app.js | 39 ++++++++++ 1517060338/app.json | 42 +++++++++++ 1517060338/app.wxss | 12 +++ 1517060338/pages/comp/scroll.js | 121 ++++++++++++++++++++++++++++++ 1517060338/pages/comp/scroll.wxml | 23 ++++++ 1517060338/pages/comp/scroll.wxss | 1 + 1517060338/pages/example/a/a.js | 1 + 1517060338/pages/example/a/a.json | 1 + 1517060338/pages/example/a/a.wxml | 95 +++++++++++++++++++++++ 1517060338/pages/example/a/a.wxss | 6 ++ 1517060338/pages/example/q/q.js | 1 + 1517060338/pages/example/q/q.json | 1 + 1517060338/pages/example/q/q.wxml | 55 ++++++++++++++ 1517060338/pages/example/q/q.wxss | 6 ++ 1517060338/pages/fm/fm.js | 66 ++++++++++++++++ 1517060338/pages/fm/fm.wxml | 3 + 1517060338/pages/form/form.js | 113 ++++++++++++++++++++++++++++ 1517060338/pages/form/form.wxml | 35 +++++++++ 1517060338/pages/form/form.wxss | 1 + 1517060338/pages/image/1.jpg | Bin 0 -> 65482 bytes 1517060338/pages/image/10.jpg | Bin 0 -> 93673 bytes 1517060338/pages/image/13.png | Bin 0 -> 17456 bytes 1517060338/pages/image/14.png | Bin 0 -> 18120 bytes 1517060338/pages/image/2.jpg | Bin 0 -> 72760 bytes 1517060338/pages/image/3.jpg | Bin 0 -> 95812 bytes 1517060338/pages/image/4.jpg | Bin 0 -> 62193 bytes 1517060338/pages/image/5.jpg | Bin 0 -> 77485 bytes 1517060338/pages/image/6.jpg | Bin 0 -> 76153 bytes 1517060338/pages/image/7.jpg | Bin 0 -> 68092 bytes 1517060338/pages/image/8.jpg | Bin 0 -> 61486 bytes 1517060338/pages/image/9.jpg | Bin 0 -> 67265 bytes 1517060338/pages/image/b1.jpg | Bin 0 -> 440449 bytes 1517060338/pages/image/q.jpg | Bin 0 -> 20760 bytes 1517060338/pages/image/q1.jpg | Bin 0 -> 18517 bytes 1517060338/pages/image/q2.jpg | Bin 0 -> 34872 bytes 1517060338/pages/image/q3.jpg | Bin 0 -> 23229 bytes 1517060338/pages/image/q4.jpg | Bin 0 -> 15638 bytes 1517060338/pages/image/q5.jpg | Bin 0 -> 25106 bytes 1517060338/pages/image/q6.jpg | Bin 0 -> 25625 bytes 1517060338/pages/image/q7.jpg | Bin 0 -> 31149 bytes 1517060338/pages/image/t0.jpg | Bin 0 -> 15855 bytes 1517060338/pages/image/t1.jpg | Bin 0 -> 20747 bytes 1517060338/pages/image/t2.jpg | Bin 0 -> 23970 bytes 1517060338/pages/image/t3.jpg | Bin 0 -> 26232 bytes 1517060338/pages/image/t4.jpg | Bin 0 -> 24552 bytes 1517060338/pages/image/t5.jpg | Bin 0 -> 22418 bytes 1517060338/pages/image/t6.jpg | Bin 0 -> 16513 bytes 1517060338/pages/image/t7.jpg | Bin 0 -> 15186 bytes 1517060338/pages/index/index.js | 54 +++++++++++++ 1517060338/pages/index/index.wxml | 33 ++++++++ 1517060338/pages/index/index.wxss | 9 +++ 51 files changed, 718 insertions(+) create mode 100644 1517060338/app.js create mode 100644 1517060338/app.json create mode 100644 1517060338/app.wxss create mode 100644 1517060338/pages/comp/scroll.js create mode 100644 1517060338/pages/comp/scroll.wxml create mode 100644 1517060338/pages/comp/scroll.wxss create mode 100644 1517060338/pages/example/a/a.js create mode 100644 1517060338/pages/example/a/a.json create mode 100644 1517060338/pages/example/a/a.wxml create mode 100644 1517060338/pages/example/a/a.wxss create mode 100644 1517060338/pages/example/q/q.js create mode 100644 1517060338/pages/example/q/q.json create mode 100644 1517060338/pages/example/q/q.wxml create mode 100644 1517060338/pages/example/q/q.wxss create mode 100644 1517060338/pages/fm/fm.js create mode 100644 1517060338/pages/fm/fm.wxml create mode 100644 1517060338/pages/form/form.js create mode 100644 1517060338/pages/form/form.wxml create mode 100644 1517060338/pages/form/form.wxss create mode 100644 1517060338/pages/image/1.jpg create mode 100644 1517060338/pages/image/10.jpg create mode 100644 1517060338/pages/image/13.png create mode 100644 1517060338/pages/image/14.png create mode 100644 1517060338/pages/image/2.jpg create mode 100644 1517060338/pages/image/3.jpg create mode 100644 1517060338/pages/image/4.jpg create mode 100644 1517060338/pages/image/5.jpg create mode 100644 1517060338/pages/image/6.jpg create mode 100644 1517060338/pages/image/7.jpg create mode 100644 1517060338/pages/image/8.jpg create mode 100644 1517060338/pages/image/9.jpg create mode 100644 1517060338/pages/image/b1.jpg create mode 100644 1517060338/pages/image/q.jpg create mode 100644 1517060338/pages/image/q1.jpg create mode 100644 1517060338/pages/image/q2.jpg create mode 100644 1517060338/pages/image/q3.jpg create mode 100644 1517060338/pages/image/q4.jpg create mode 100644 1517060338/pages/image/q5.jpg create mode 100644 1517060338/pages/image/q6.jpg create mode 100644 1517060338/pages/image/q7.jpg create mode 100644 1517060338/pages/image/t0.jpg create mode 100644 1517060338/pages/image/t1.jpg create mode 100644 1517060338/pages/image/t2.jpg create mode 100644 1517060338/pages/image/t3.jpg create mode 100644 1517060338/pages/image/t4.jpg create mode 100644 1517060338/pages/image/t5.jpg create mode 100644 1517060338/pages/image/t6.jpg create mode 100644 1517060338/pages/image/t7.jpg create mode 100644 1517060338/pages/index/index.js create mode 100644 1517060338/pages/index/index.wxml create mode 100644 1517060338/pages/index/index.wxss diff --git a/1517060338/app.js b/1517060338/app.js new file mode 100644 index 0000000..b545190 --- /dev/null +++ b/1517060338/app.js @@ -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 + } +}) \ No newline at end of file diff --git a/1517060338/app.json b/1517060338/app.json new file mode 100644 index 0000000..9c13ae4 --- /dev/null +++ b/1517060338/app.json @@ -0,0 +1,42 @@ +{ + "pages": [ + "pages/index/index", + "pages/comp/scroll", + "pages/form/form", + "pages/example/a/a", + "pages/example/qqweq/qqweq", + "pages/fm/fm" + + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#006cff", + "navigationBarTitleText": "郑昊", + "navigationBarTextStyle": "while" + }, + "tabBar": { + "color": "#ffffff", + "backgroundColor": "#006cff", + + "list": [ + { + "selectedIconPath": "pages/image/14.png", + "iconPath": "pages/image/13.png", + "pagePath": "pages/index/index", + "text": "首页" + }, + { + "pagePath": "pages/comp/scroll", + "selectedIconPath": "pages/image/14.png", + "iconPath": "pages/image/13.png", + "text": "角色介绍" + }, + { + "pagePath": "pages/form/form", + "selectedIconPath": "pages/image/14.png", + "iconPath": "pages/image/13.png", + "text": "提交" + } + ] + } +} \ No newline at end of file diff --git a/1517060338/app.wxss b/1517060338/app.wxss new file mode 100644 index 0000000..bf4f7ae --- /dev/null +++ b/1517060338/app.wxss @@ -0,0 +1,12 @@ +/**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; + +} diff --git a/1517060338/pages/comp/scroll.js b/1517060338/pages/comp/scroll.js new file mode 100644 index 0000000..fbd0e4d --- /dev/null +++ b/1517060338/pages/comp/scroll.js @@ -0,0 +1,121 @@ +// pages/comp/scroll.js +var base64 = require("../example/images/base64"); + +Page({ + + /** + * 页面的初始数据 + */ + data: { + isEnd: true, + messages: [{ + image:"/pages/image/t0.jpg", + name: "达拉斯", + last: "Dallas" + }, { + image: "/pages/image/t1.jpg", + name: "沃尔夫", + last: "Wolf" + }, { + image: "/pages/image/t2.jpg", + name: "钱恩斯", + last: "Chains" + }, { + image: "/pages/image/t3.jpg", + name: "休斯顿", + last: "Mage" + }, { + image: "/pages/image/t4.jpg", + name: "约翰·威克", + last: "John Wick" + }, { + image: "/pages/image/t5.jpg", + name: "霍斯顿", + last: "Hoxton" + }, { + image: "/pages/image/t6.jpg", + name: "克洛芙", + last: "Clover" + }, { + image: "/pages/image/t7.jpg", + name: "德拉甘", + last: "Dragan" + }] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + icon20: base64.icon20, + icon60: base64.icon60 + }); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + + onEnd: function () { + + var that = this; + var data = that.data; + that.setData({ + isEnd: true /*, + messages: data.messages.concat([{ + name: "Tom", + last: "Hello!" + }, { + name: "john", + last: "yes." + }]) */ + }); + + } +}) \ No newline at end of file diff --git a/1517060338/pages/comp/scroll.wxml b/1517060338/pages/comp/scroll.wxml new file mode 100644 index 0000000..a0f0f47 --- /dev/null +++ b/1517060338/pages/comp/scroll.wxml @@ -0,0 +1,23 @@ + + + + + + + + + + + + {{item.name}} + {{item.last}} + + + + + + + 正在加载…… + + + \ No newline at end of file diff --git a/1517060338/pages/comp/scroll.wxss b/1517060338/pages/comp/scroll.wxss new file mode 100644 index 0000000..67a27e0 --- /dev/null +++ b/1517060338/pages/comp/scroll.wxss @@ -0,0 +1 @@ +/* pages/comp/scroll.wxss */ diff --git a/1517060338/pages/example/a/a.js b/1517060338/pages/example/a/a.js new file mode 100644 index 0000000..f16cc1a --- /dev/null +++ b/1517060338/pages/example/a/a.js @@ -0,0 +1 @@ +Page({}); \ No newline at end of file diff --git a/1517060338/pages/example/a/a.json b/1517060338/pages/example/a/a.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/1517060338/pages/example/a/a.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/1517060338/pages/example/a/a.wxml b/1517060338/pages/example/a/a.wxml new file mode 100644 index 0000000..468e093 --- /dev/null +++ b/1517060338/pages/example/a/a.wxml @@ -0,0 +1,95 @@ + + + 合约提供者 + + + + + + 贝恩(Bain) + Crime.net的幕后主使。没有任何一个人,甚至就连四人组成员都没有见过贝恩的真容。他和线人通过精心安排的秘密渠道联系,以确保所有方面所承受的风险尽可能低。 + + + + + + + 弗拉德(Vlad) + 弗拉德是个乌克兰人在俄罗斯时曾经是一个可怕的暴徒,现在他离开地盘多年,在华盛顿做着敲诈和犯罪的买卖。 + + + + + + + 赫克特(Hector) + 赫克特是一位注重细节的前业务管理员,而现在是东海岸最大的毒品贩子,也是墨西哥锡那罗亚帮派的下任领袖。查明为出卖霍斯顿的叛徒,现已被击毙。 + + + + + + + “大象”(The Elephant) + 约翰·亨利·西蒙斯(John Henry Simmons),被媒体称为“大象”。一个肮脏的共和国会议员,通过各种神秘得到关系达到了权力的高峰。 + + + + + + + 盖奇(Gage) + 盖奇是一名参与过阿富汗战争的老兵,以推着轮椅完成各种暗杀而闻名。他是这片地区最大的军火商-----同时也是一名暗杀好手。必要时,它将成为你们的得力帮手。 + + + + + + + 牙医(The Dentist) + “牙医"其人,知之甚少。他把客户视为自己的病人。他态度坚决,计划周密,并且对PAYDAY帮很有兴趣。最重要的是,只有他有办法救出霍斯顿。 + + + + + + + 屠夫(The Butcher) + 屠夫是一名军火贩子,从事着各类军火的采购,贩卖和中转运输。由于盖奇正在“度长假”,她想借此时机与贝恩和PAYDAY帮建立长期稳定的合作关系。 + + + + + + + 洛克(Locke) + 生于南非,受教于林肯实验室(Lincoln Lab),受训于军情五处(MI5),现在受雇于“黑水”(Murkywater)集团。弗农·洛克(Vernon Locke)是特别网络行动组(Special Cyberwarfare Division)的领导,负责执行渗透Crime.net的任务。洛克成功完成目标,然而他将这是为一个机会,并与贝恩和PAYDAY帮接触。条件是什么?为他工作,否则他就让Crime.net永远消失。 + + + + + + + 吉米(Jimmy) + 不得不承认,一开始我对他持非常怀疑的态度,但吉米的能力却胜过任何一个人,是一个拥有Crime.Net能力的劫匪。 +他什么都做,不会拒绝任何一项合约行动,总把每天当成他人生的最后一天来过。他十分忠诚,我从未想过他能够证明自己是我们所需要的一位十分出色的新成员 + + + + + + + 欧陆集团(The Continental) + 欧陆集团是个神秘的机构,一座酒店同时为职业杀手以及其他步入黑暗之人的避风港。有时候欧陆集团会需要一些服务,特殊天赋的服务。这是PAYDAY帮牵扯进来的原因。 + + + + + + + + + + + + \ No newline at end of file diff --git a/1517060338/pages/example/a/a.wxss b/1517060338/pages/example/a/a.wxss new file mode 100644 index 0000000..fa064c6 --- /dev/null +++ b/1517060338/pages/example/a/a.wxss @@ -0,0 +1,6 @@ +page{ + background-color: #FFFFFF; +} +image{ + margin: 4px 0; +} \ No newline at end of file diff --git a/1517060338/pages/example/q/q.js b/1517060338/pages/example/q/q.js new file mode 100644 index 0000000..f16cc1a --- /dev/null +++ b/1517060338/pages/example/q/q.js @@ -0,0 +1 @@ +Page({}); \ No newline at end of file diff --git a/1517060338/pages/example/q/q.json b/1517060338/pages/example/q/q.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/1517060338/pages/example/q/q.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/1517060338/pages/example/q/q.wxml b/1517060338/pages/example/q/q.wxml new file mode 100644 index 0000000..29c5ad6 --- /dev/null +++ b/1517060338/pages/example/q/q.wxml @@ -0,0 +1,55 @@ + + + 武器 + + + + + + + 弹药包 + + + + + + 护甲包 + + + + + + 尸体袋 + + + + + + 医疗包 + + + + + + ECM + + + + + + 急救包 + + + + + + 自动炮台 + + + + + + + + + diff --git a/1517060338/pages/example/q/q.wxss b/1517060338/pages/example/q/q.wxss new file mode 100644 index 0000000..fa064c6 --- /dev/null +++ b/1517060338/pages/example/q/q.wxss @@ -0,0 +1,6 @@ +page{ + background-color: #FFFFFF; +} +image{ + margin: 4px 0; +} \ No newline at end of file diff --git a/1517060338/pages/fm/fm.js b/1517060338/pages/fm/fm.js new file mode 100644 index 0000000..19f9510 --- /dev/null +++ b/1517060338/pages/fm/fm.js @@ -0,0 +1,66 @@ +// pages/fm.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/1517060338/pages/fm/fm.wxml b/1517060338/pages/fm/fm.wxml new file mode 100644 index 0000000..e45d9f1 --- /dev/null +++ b/1517060338/pages/fm/fm.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/1517060338/pages/form/form.js b/1517060338/pages/form/form.js new file mode 100644 index 0000000..d483266 --- /dev/null +++ b/1517060338/pages/form/form.js @@ -0,0 +1,113 @@ +// pages/form/form.js +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 + }) + } +}) \ No newline at end of file diff --git a/1517060338/pages/form/form.wxml b/1517060338/pages/form/form.wxml new file mode 100644 index 0000000..8e7eff1 --- /dev/null +++ b/1517060338/pages/form/form.wxml @@ -0,0 +1,35 @@ + + + + 表单示例 + 输入文字并提交 + +
+ + {{text + ", " + paragh}} + + 文本框 + + + + + + + + + 文本域 + + + +