-
Notifications
You must be signed in to change notification settings - Fork 6
dctsxycdxcx #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jqliingu
wants to merge
1
commit into
iBeiKeDevHomework:master
Choose a base branch
from
jqliingu:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
dctsxycdxcx #3
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,14 @@ | ||
| { | ||
| "pages":[ | ||
| "pages/index/index", | ||
| "pages/logs/logs" | ||
| ], | ||
| "window":{ | ||
| "backgroundTextStyle":"light", | ||
| "navigationBarBackgroundColor": "#fff", | ||
| "navigationBarTitleText": "Weixin", | ||
| "navigationBarTextStyle":"black" | ||
| }, | ||
| "style": "v2", | ||
| "sitemapLocation": "sitemap.json" | ||
| } |
This file contains hidden or 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,10 @@ | ||
| /**app.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 hidden or 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,77 @@ | ||
| //index.js | ||
| //获取应用实例 | ||
| const rpn = require("../../utils/rpn.js"); | ||
| const app = getApp() | ||
|
|
||
| Page({ | ||
| data: { | ||
| ztNum:[ | ||
| 'C','⇦','%','÷', | ||
| '7','8','9','×', | ||
| '4','5','6','-', | ||
| '1','2','3','+', | ||
| ' ','0','.','=' | ||
| ], | ||
| screenData:0 | ||
| }, | ||
| click:function(e){ | ||
| var index = e.currentTarget.dataset.index; | ||
|
|
||
| var screenData = this.data.screenData; | ||
| if(index == 0){ | ||
| this.setData({ | ||
| screenData:'0' | ||
| }) | ||
| } | ||
|
|
||
| if(index == 1){ | ||
| var screenData = screenData + ''; | ||
| var screenData = screenData.substr(0,screenData.length -1); | ||
| var screenData = screenData?screenData:'0'; | ||
| this.setData({ | ||
| screenData:screenData | ||
| }) | ||
| } | ||
|
|
||
| if(index == 2){ | ||
| var screenData = screenData / 100; | ||
| this.setData({ | ||
| screenData:screenData | ||
| }) | ||
| } | ||
|
|
||
| if((index % 4 == 3 && index != 19) || index == 18){ | ||
| var arr = ['.','+','-','×','÷']; | ||
| var screenData = screenData + ''; | ||
| if(arr.indexOf(screenData.substr(-1,1)) == '-1' && screenData!= '0'){ | ||
| var screenData = screenData + e.currentTarget.dataset.text; | ||
| this.setData({ | ||
| screenData:screenData | ||
| }) | ||
| } | ||
| } | ||
| if(index >= 4 && index <18 && index %4 !=3 && index !=16){ | ||
| if(screenData == 0){ | ||
| var screenData = e.currentTarget.dataset.text; | ||
| } | ||
| else{ | ||
| var screenData = screenData + e.currentTarget.dataset.text; | ||
| } | ||
| this.setData({ | ||
| screenData:screenData | ||
| }) | ||
| } | ||
| if(index == 19){ | ||
| var result = rpn.calCommonExp(screenData); | ||
| this.setData({ | ||
| screenData:result | ||
| }) | ||
| } | ||
|
|
||
| } | ||
| }) | ||
| /*写个小作文: | ||
| 整个小程序就是各种杂七杂八到处偷师学艺搞出来的,其实还有很多不行的地方。 | ||
| 比如说:数字太多它不会自动跳行,我也找不到解决方法了。 | ||
| 看了一下其他朋友的小程序 我沉默了。“我怎么不一开始就这样写!!我现在只能跪着走完这条路了 TAT ” | ||
| */ | ||
This file contains hidden or 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,3 @@ | ||
| { | ||
| "usingComponents": {} | ||
| } |
This file contains hidden or 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,10 @@ | ||
| <!--index.wxml--> | ||
| <view class="screen"> | ||
| {{screenData}} | ||
| </view> | ||
| <view class="zt"> | ||
| <block wx:for="{{ztNum}}" wx:key="zt"> | ||
| <view class='ztit {{(index < 4 || index % 4 == 3 ) ? "gray" : "white"}}' bindtap="click" data-index="{{index}}" data-text='{{item}}'>{{item}} | ||
| </view> | ||
| </block> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这样很方便,知道用for很不错 |
||
| </view> | ||
This file contains hidden or 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,36 @@ | ||
| /**index.wxss**/ | ||
| .screen{ | ||
| width:95%; | ||
| margin:0 auto; | ||
| height:240px; | ||
| line-height:350px; | ||
| text-align:right; | ||
| font-size: 380%; | ||
| } | ||
| .zt{ | ||
| font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif; | ||
| font-size: 200%; | ||
| width:95%; | ||
| margin:0 auto; | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| justify-content: space-around; | ||
| } | ||
| .zt .ztit{ | ||
| width:170rpx; | ||
| height:170rpx; | ||
| line-height:170rpx; | ||
| margin-bottom:15rpx; | ||
| /*background:orange;*/ | ||
| text-align: center; | ||
| border-radius: 50%; | ||
| } | ||
| .gray{ | ||
| color:white; | ||
| background:orange; | ||
|
|
||
| } | ||
| .white{ | ||
| color:rgb(46, 45, 45); | ||
| background: rgb(184, 183, 183); | ||
| } |
This file contains hidden or 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,15 @@ | ||
| //logs.js | ||
| const util = require('../../utils/util.js') | ||
|
|
||
| Page({ | ||
| data: { | ||
| logs: [] | ||
| }, | ||
| onLoad: function () { | ||
| this.setData({ | ||
| logs: (wx.getStorageSync('logs') || []).map(log => { | ||
| return util.formatTime(new Date(log)) | ||
| }) | ||
| }) | ||
| } | ||
| }) |
This file contains hidden or 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,4 @@ | ||
| { | ||
| "navigationBarTitleText": "查看启动日志", | ||
| "usingComponents": {} | ||
| } |
This file contains hidden or 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 @@ | ||
| <!--logs.wxml--> | ||
| <view class="container log-list"> | ||
| <block wx:for="{{logs}}" wx:for-item="log"> | ||
| <text class="log-item">{{index + 1}}. {{log}}</text> | ||
| </block> | ||
| </view> |
This file contains hidden or 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,8 @@ | ||
| .log-list { | ||
| display: flex; | ||
| flex-direction: column; | ||
| padding: 40rpx; | ||
| } | ||
| .log-item { | ||
| margin: 10rpx; | ||
| } |
This file contains hidden or 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,72 @@ | ||
| { | ||
| "description": "项目配置文件", | ||
| "packOptions": { | ||
| "ignore": [] | ||
| }, | ||
| "setting": { | ||
| "urlCheck": true, | ||
| "es6": true, | ||
| "enhance": false, | ||
| "postcss": true, | ||
| "preloadBackgroundData": false, | ||
| "minified": true, | ||
| "newFeature": false, | ||
| "coverView": true, | ||
| "nodeModules": false, | ||
| "autoAudits": false, | ||
| "showShadowRootInWxmlPanel": true, | ||
| "scopeDataCheck": false, | ||
| "uglifyFileName": false, | ||
| "checkInvalidKey": true, | ||
| "checkSiteMap": true, | ||
| "uploadWithSourceMap": true, | ||
| "compileHotReLoad": false, | ||
| "useMultiFrameRuntime": false, | ||
| "useApiHook": true, | ||
| "babelSetting": { | ||
| "ignore": [], | ||
| "disablePlugins": [], | ||
| "outputPath": "" | ||
| }, | ||
| "enableEngineNative": false, | ||
| "bundle": false, | ||
| "useIsolateContext": true, | ||
| "useCompilerModule": true, | ||
| "userConfirmedUseCompilerModuleSwitch": false, | ||
| "userConfirmedBundleSwitch": false, | ||
| "packNpmManually": false, | ||
| "packNpmRelationList": [], | ||
| "minifyWXSS": true | ||
| }, | ||
| "compileType": "miniprogram", | ||
| "libVersion": "2.14.1", | ||
| "appid": "wx6410544054da3d2a", | ||
| "projectname": "miniprogram-1", | ||
| "debugOptions": { | ||
| "hidedInDevtools": [] | ||
| }, | ||
| "scripts": {}, | ||
| "isGameTourist": false, | ||
| "simulatorType": "wechat", | ||
| "simulatorPluginLibVersion": {}, | ||
| "condition": { | ||
| "search": { | ||
| "list": [] | ||
| }, | ||
| "conversation": { | ||
| "list": [] | ||
| }, | ||
| "game": { | ||
| "list": [] | ||
| }, | ||
| "plugin": { | ||
| "list": [] | ||
| }, | ||
| "gamePlugin": { | ||
| "list": [] | ||
| }, | ||
| "miniprogram": { | ||
| "list": [] | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,7 @@ | ||
| { | ||
| "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", | ||
| "rules": [{ | ||
| "action": "allow", | ||
| "page": "*" | ||
| }] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
贼偷懒你