Skip to content

Commit

Permalink
Merge pull request dcloudio#27 from zhetengbiji/master
Browse files Browse the repository at this point in the history
增加登录模板
  • Loading branch information
hulinNeil committed Aug 23, 2018
2 parents 7f0a223 + f613b43 commit ba48ecd
Show file tree
Hide file tree
Showing 19 changed files with 723 additions and 0 deletions.
106 changes: 106 additions & 0 deletions examples/login-template/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<script>
export default {
onLaunch: function () {
console.log('App Launch');
},
onShow: function () {
console.log('App Show');
},
onHide: function () {
console.log('App Hide');
}
}
</script>

<style>
/*每个页面公共css */
/* uni-app默认全局使用flex布局。因为flex布局有利于跨更多平台,尤其是采用原生渲染的平台。如不了解flex布局,请参考http://www.w3.org/TR/css3-flexbox/。如不使用flex布局,请删除或注释掉本行。*/
page {
min-height: 100%;
display: flex;
}
.content {
display: flex;
flex: 1;
flex-direction: column;
background-color: #efeff4;
padding: 20px;
}
.input-group {
background-color: #ffffff;
margin-top: 40px;
position: relative;
}
.input-group::before {
position: absolute;
right: 0;
top: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
background-color: #c8c7cc;
}
.input-group::after {
position: absolute;
right: 0;
bottom: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
background-color: #c8c7cc;
}
.input-row {
display: flex;
flex-direction: row;
position: relative;
}
.input-row .title {
width: 20%;
height: 50px;
min-height: 50px;
padding: 15px 0;
padding-left: 30px;
line-height: 50px;
}
.input-row input {
width: 80%;
height: 50px;
min-height: 50px;
padding: 15px 0;
padding-right: 30px;
line-height: 50px;
}
.input-row.border::after {
position: absolute;
right: 0;
bottom: 0;
left: 15px;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
background-color: #c8c7cc;
}
.btn-row {
margin-top: 50px;
padding: 20px;
}
button.primary {
background-color: #0faeff;
}
</style>
14 changes: 14 additions & 0 deletions examples/login-template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# UNI-APP 登录模板

## 运行方式
将项目拖入[HbuildX](http://www.dcloud.io/hbuilderx.html),直接运行即可

## 特点
* 兼容微信小程序和APP
* 适用于强制登录和非强制登录应用场景
* 使用vuex管理登录状态
* 包含账户密码登录和第三方登录方式

## 注意事项
* 只能首页包含tab,如需强制登录,可以在首页检测登录状态并跳转登录页面
* 页面初始化完毕后马上跳转页面可能会失败,暂时可以延迟执行
16 changes: 16 additions & 0 deletions examples/login-template/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Vue from 'vue'
import App from './App'

import store from './store'

Vue.config.productionTip = false

Vue.prototype.$store = store

App.mpType = 'app'

const app = new Vue({
store,
...App
})
app.$mount()
29 changes: 29 additions & 0 deletions examples/login-template/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name" : "login-template",
"appid" : "__UNI__5430F3F",
"description": "登录模板",
"versionName": "1.0.0",
"versionCode": "100",
"app-plus": { /* 5+App特有相关 */
"modules": { /* 模块配置 */

},
"distribute": { /* 应用发布信息 */
"android": { /* android打包配置 */
"permissions": ["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.CALL_PHONE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]
},
"ios": { /* ios打包配置 */

},
"sdkConfigs": { /* SDK配置 */

}
}
},
"quickapp": { /* 快应用特有相关 */

},
"mp-weixin": { /* 小程序特有相关 */
"appid": ""
}
}
51 changes: 51 additions & 0 deletions examples/login-template/pages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"pages": [ //pages数组中第一项表示应用启动页,
{
"path": "pages/main/main",
"style": {
"navigationBarTitleText": "登录模板"
}
}, {
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录"
}
}, {
"path": "pages/reg/reg",
"style": {
"navigationBarTitleText": "注册"
}
}, {
"path": "pages/pwd/pwd",
"style": {
"navigationBarTitleText": "找回密码"
}
}, {
"path": "pages/user/user",
"style": {
"navigationBarTitleText": "我的"
}
}
],
"tabBar": {
"color": "#7a7e83",
"selectedColor": "#0faeff",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/main/main",
"text": "首页",
"iconPath": "static/img/home.png",
"selectedIconPath": "static/img/homeHL.png"
}, {
"pagePath": "pages/user/user",
"text": "我的",
"iconPath": "static/img/user.png",
"selectedIconPath": "static/img/userHL.png"
}]
},
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#0faeff",
"backgroundColor": "#fbf9fe"
}
}
Loading

0 comments on commit ba48ecd

Please sign in to comment.