-
Notifications
You must be signed in to change notification settings - Fork 163
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
Showing
19 changed files
with
255 additions
and
193 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,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
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 @@ | ||
dist/* |
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,41 @@ | ||
module.exports = { | ||
root: true, | ||
parser: 'babel-eslint', | ||
parserOptions: { | ||
sourceType: 'module' | ||
}, | ||
env: { | ||
browser: true | ||
}, | ||
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style | ||
extends: 'standard', | ||
// required to lint *.wpy files | ||
plugins: [ | ||
'html' | ||
], | ||
settings: { | ||
'html/html-extensions': ['.html', '.wpy'] | ||
}, | ||
'globals': { | ||
'wx': true | ||
}, | ||
// add your custom rules here | ||
'rules': { | ||
// allow paren-less arrow functions | ||
'arrow-parens': 0, | ||
// allow async-await | ||
'generator-star-spacing': 0, | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
'comma-dangle': ["error", "only-multiline"], | ||
'padded-blocks': 0, | ||
'one-var': 0, | ||
'no-return-assign': 0, | ||
'indent': ['error', 4], | ||
// allow debugger during development | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, | ||
'space-before-function-paren': 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
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,51 +1,51 @@ | ||
<style type="sass"> | ||
page, .body{ | ||
height: 100%; | ||
font-family: "\5FAE\8F6F\96C5\9ED1", arial; | ||
} | ||
</style> | ||
<script> | ||
import wepy from 'wepy'; | ||
import "wepy-async-function"; | ||
export default class extends wepy.app { | ||
config = { | ||
"pages":[ | ||
"pages/index", | ||
"pages/chat" | ||
], | ||
"window":{ | ||
"backgroundTextStyle": "light", | ||
"navigationBarBackgroundColor": "#3b3a40", | ||
"navigationBarTitleText": "WeChat", | ||
"navigationBarTextStyle": "black" | ||
} | ||
}; | ||
constructor () { | ||
super(); | ||
this.use('promisify'); | ||
this.use('requestfix'); | ||
} | ||
globalData = { | ||
userInfo: null | ||
}; | ||
onLaunch() { | ||
} | ||
async getUserInfo() { | ||
if (this.globalData.userInfo) { | ||
return this.globalData.userInfo; | ||
} | ||
let x = await wx.login(); | ||
let res = await wx.getUserInfo(); | ||
this.globalData.userInfo = res.userInfo; | ||
return res.userInfo; | ||
} | ||
} | ||
</script> | ||
<style type='sass'> | ||
page, .body{ | ||
height: 100%; | ||
font-family: '\5FAE\8F6F\96C5\9ED1', arial; | ||
} | ||
</style> | ||
|
||
<script> | ||
|
||
import wepy from 'wepy'; | ||
import 'wepy-async-function'; | ||
|
||
export default class extends wepy.app { | ||
|
||
config = { | ||
'pages': [ | ||
'pages/index', | ||
'pages/chat' | ||
], | ||
'window': { | ||
'backgroundTextStyle': 'light', | ||
'navigationBarBackgroundColor': '#3b3a40', | ||
'navigationBarTitleText': 'WeChat', | ||
'navigationBarTextStyle': 'black' | ||
} | ||
}; | ||
|
||
constructor () { | ||
super(); | ||
this.use('promisify'); | ||
this.use('requestfix'); | ||
} | ||
|
||
globalData = { | ||
userInfo: null | ||
}; | ||
|
||
onLaunch() { | ||
} | ||
|
||
async getUserInfo() { | ||
if (this.globalData.userInfo) { | ||
return this.globalData.userInfo; | ||
} | ||
await wx.login(); | ||
let res = await wx.getUserInfo(); | ||
this.globalData.userInfo = res.userInfo; | ||
return res.userInfo; | ||
} | ||
} | ||
</script> |
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
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
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 |
---|---|---|
|
@@ -50,7 +50,7 @@ | |
} | ||
|
||
components = { | ||
item: Item, | ||
item: Item | ||
}; | ||
|
||
} | ||
|
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 |
---|---|---|
|
@@ -105,4 +105,4 @@ | |
onLoad () { | ||
} | ||
} | ||
</script> | ||
</script> |
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
Oops, something went wrong.