提交 233c20ab 编写于 作者: L linju

213

上级 a5944d62
...@@ -30,4 +30,14 @@ ...@@ -30,4 +30,14 @@
box-sizing: border-box; box-sizing: border-box;
/* #endif */ /* #endif */
} }
/* #ifndef APP-NVUE */
view,scroll-view,text,
image,switch,navigator,icons {
display: flex;
box-sizing: border-box;
}
scroll-view{
-webkit-overflow-scrolling: touch;
}
/* #endif */
</style> </style>
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
}, },
"modules" : { "modules" : {
"OAuth" : {}, "OAuth" : {},
"Share" : {} "Share" : {},
"Fingerprint" : {}
}, },
"distribute" : { "distribute" : {
"android" : { "android" : {
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.USE_FINGERPRINT\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
......
...@@ -22,15 +22,24 @@ ...@@ -22,15 +22,24 @@
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"navigationStyle": "custom",
"backgroundColor": "transparent",
"app-plus": { "app-plus": {
"titleNView": { "animationType": "fade-in",
"buttons": [{ "background": "transparent",
"text": "帮助", "popGesture": "none",
"type": "none", "titleNView":false
"fontSize": "16px", // "navigationBarTitleText": "",
"width": "60px" // "navigationBarBackgroundColor": "#FFFFFF",
}] // "app-plus": {
} // "titleNView": {
// "buttons": [{
// "text": "帮助",
// "type": "none",
// "fontSize": "16px",
// "width": "60px"
// }]
// }
} }
} }
}, { }, {
......
<template>
<view class="content">
<uni-list class="content">
<uni-list-item v-for="(item , index) in agreeList" :key="index" :title="item.title" :to="item.to"
:clickable="true" @click="itemClick(item)" :showSwitch="item.showSwitch"
:switchChecked="item.isChecked"
:link="item.link"></uni-list-item>
</uni-list>
<button class="bottom-back" @click="clickLogout"><text class="bottom-back-text">退出登录</text></button>
</view>
</template>
<script>
import {
isOn,
setting
} from '@/common/dc-push/push.js';
import {
mapMutations
} from 'vuex';
export default {
data() {
return {
agreeList: [{
title: '个人资料',
to: '',
link:true
},
{
title: '修改密码',
to: '',
link:true
}, {
title: '注销用户',
event: '',
link:true
}, {
title: '推送功能',
name: 'push',
event: 'openSetting',
isChecked: false,
showSwitch: true,
},
{
title: "录入指纹",
name: 'fingerprint',
link:true
}, {
title: '清理缓存',
event: '',
link:true
}
]
}
},
onShow() {
let pushIsOn = isOn();
this.agreeList.forEach(item => {
item.name == 'push' ? (item.isChecked = pushIsOn) : '';
})
},
methods: {
...mapMutations({
logout: 'user/logout'
}),
clickLogout() {
this.logout();
uni.navigateBack();
},
itemClick(item) {
if (!item.to && item.event) {
this[item.event]();
}
},
/**
* 打开设置页面
*/
openSetting() {
setting();
}
}
}
</script>
<style>
.content {
width: 750rpx;
display: flex;
flex-direction: column;
/* align-items: center; */
flex: 1;
}
.bottom-back {
width: 750rpx;
height: 120rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border: none;
border-width: 0;
border-radius: 0;
}
.bottom-back-text {
font-size: 40rpx;
color: #DD524D;
}
</style>
<template> <template>
<view class="center"> <view class="center">
<view class="logo" @click="goLogin" :hover-class="!login ? 'logo-hover' : ''"> <view class="logo" @click="goLogin" :hover-class="!login ? 'logo-hover' : ''">
<image class="logo-img" :src="login ? (userInfo.avatar || avatarUrl) :avatarUrl"></image> <image class="logo-img" :src="login ? (userInfo.avatar || avatarUrl) :avatarUrl"></image>
<view class="logo-title"> <view class="logo-title">
<text class="uer-name">Hi,{{login ? userInfo.username : '您未登录'}}</text> <text class="uer-name">Hi,{{login ? userInfo.username : '您未登录'}}</text>
<text class="go-login-navigat-arrow navigat-arrow" v-if="!login">&#xe65e;</text> <text class="go-login-navigat-arrow navigat-arrow" v-if="!login">&#xe65e;</text>
</view> </view>
</view> </view>
<uni-list class="center-list"> <uni-grid class="grid" :column="5" :showBorder="false" :square="true">
<template v-for="(sublist , index) in ucenterList"> <uni-grid-item class="item" v-for="({text,icon},index) in gridList" @click.native="tapGrid(index)">
<uni-list-item :title="item.title" :rightText="item.rightText" :to="item.to" <uni-icons class="icon" color="#5d5e64" :type="icon" size="28"></uni-icons>
v-for="(item, subIndex) in sublist" :key="(index + '_' + subIndex)" @click="ucenterListClick(item)" :clickable="true"></uni-list-item> <text class="text">{{text}}</text>
<!-- #ifdef APP-NVUE --> </uni-grid-item>
<cell class="center-list-cell"></cell> </uni-grid>
<!-- #endif --> <uni-list class="center-list" v-for="(sublist , index) in ucenterList">
<!-- #ifndef APP-PLUS --> <uni-list-item v-for="item in sublist"
<view class="center-list-cell"></view> :title="item.title"
<!-- #endif --> link :rightText="item.rightText"
</template> :clickable="true"
</uni-list> :to="item.to"
</view> @click="ucenterListClick(item)"
</template> ></uni-list-item>
</uni-list>
<script> </view>
import { </template>
mapGetters,
mapMutations <script>
} from 'vuex'; import {
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'; mapGetters,
export default { mapMutations
data() { } from 'vuex';
return { import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
avatarUrl: '/static/logo.png', export default {
ucenterList: [ data() {
[{ return {
title: '阅读过的文章' avatarUrl: '/static/logo.png',
}, { gridList: [{
title: '我的积分' "text": "文字1",
}], "icon": "chat"
[{ },
title: '政策与协议', {
to:'/pages/agree-list/agree-list' "text": "文字2",
}, { "icon": "cloud-upload"
title: '关于', },
to: '/pages/about/about' {
}, "text": "文字3",
//#ifdef APP-PLUS "icon": "contact"
{ },
title: '检查更新', {
rightText: `V${getApp().appVersion.finall.version}_${getApp().appVersion.finall.versionCode}`, "text": "文字4",
event:'checkVersion' "icon": "download"
} },
//#endif {
], "text": "文字5",
[ "icon": "paperplane"
{ }
title: '反馈', ],
to:'/pages/uni-feedback/uni-feedback' ucenterList: [
},{ [{
title: '设置', title: '阅读过的文章',
to: '/pages/settings/settings' to: '/pages/agree-list/agree-list'
} }, {
] title: '我的积分',
] to: '/pages/agree-list/agree-list'
} }],
}, [{
computed: { title: '政策与协议',
...mapGetters({ to: '/pages/agree-list/agree-list'
userInfo: 'user/info', }, {
login: 'user/hasLogin' title: '关于',
}) to: '/pages/about/about'
}, },
onReady() { //#ifdef APP-PLUS
// {
}, // title: '检查更新',
onShow(){ // rightText: `V${getApp().appVersion.finall.version}_${getApp().appVersion.finall.versionCode}`,
console.log(this.userInfo); // event:'checkVersion'
}, // }
methods: { //#endif
...mapMutations({ ],
logout:'user/logout' [{
}), title: '反馈',
/** to: '/pages/uni-feedback/uni-feedback'
* 个人中心项目列表点击事件 }, {
*/ title: '设置',
ucenterListClick(item){ to: '/pages/settings/settings'
if(!item.to && item.event){ }]
this[item.event](); ]
} }
},
computed: {
...mapGetters({
userInfo: 'user/info',
login: 'user/hasLogin'
})
},
onReady() {
},
onShow() {
console.log(this.userInfo);
},
methods: {
...mapMutations({
logout: 'user/logout'
}),
/**
* 个人中心项目列表点击事件
*/
ucenterListClick(item) {
if (!item.to && item.event) {
this[item.event]();
}
},
checkVersion() {
checkUpdate();
},
goLogin() {
if (!this.login) {
console.log('点击前往登录');
uni.navigateTo({
url: '/uni_modules/uni-login-page/pages/index/index'
});
} else {
console.log('点击编辑信息');
uni.navigateTo({
url: './edit/edit'
})
}
}, },
checkVersion(){ tapGrid(index){
checkUpdate(); uni.showToast({
}, title: '你点击了,第'+index+'',
goLogin() { icon: 'none'
if (!this.login) { });
console.log('点击前往登录'); }
uni.navigateTo({ }
url: '/uni_modules/uni-login-page/pages/index/index' }
}); </script>
}
else { <style>
console.log('点击编辑信息'); /* #ifndef APP-PLUS-NVUE */
uni.navigateTo({ @font-face {
url:'./edit/edit' font-family: texticons;
}) font-weight: normal;
} font-style: normal;
} src: url('~@/static/text-icon.ttf') format('truetype');
} }
}
</script> page {
background-color: #f8f8f8;
<style> }
/* #ifndef APP-PLUS-NVUE */
@font-face { /* #endif*/
font-family: texticons;
font-weight: normal; /* 解决头条小程序字体图标不显示问题,因为头条运行时自动插入了span标签,且有全局字体 */
font-style: normal; /* #ifdef MP-TOUTIAO */
src: url('~@/static/text-icon.ttf') format('truetype'); text :not(view) {
} font-family: texticons;
}
page {
background-color: #f8f8f8; /* #endif */
}
.center {
/* #endif*/ flex: 1;
flex-direction: column;
/* 解决头条小程序字体图标不显示问题,因为头条运行时自动插入了span标签,且有全局字体 */ background-color: #f8f8f8;
/* #ifdef MP-TOUTIAO */ }
text :not(view) {
font-family: texticons; .logo {
} width: 750upx;
height: 240upx;
/* #endif */ padding: 20upx;
background-color: #2F85FC;
.center { flex-direction: row;
flex: 1; align-items: center;
flex-direction: column; }
background-color: #f8f8f8;
} .logo-hover {
opacity: 0.8;
.logo { }
width: 750upx;
height: 240upx; .logo-img {
padding: 20upx; width: 150upx;
background-color: #2F85FC; height: 150upx;
flex-direction: row; border-radius: 150upx;
align-items: center; }
}
.logo-title {
.logo-hover { height: 150upx;
opacity: 0.8; flex: 1;
} align-items: center;
justify-content: space-between;
.logo-img { flex-direction: row;
width: 150upx; margin-left: 20upx;
height: 150upx; }
border-radius: 150upx;
} .uer-name {
height: 60upx;
.logo-title { line-height: 60upx;
height: 150upx; font-size: 38upx;
flex: 1; color: #FFFFFF;
align-items: center; }
justify-content: space-between;
flex-direction: row; .go-login-navigat-arrow {
margin-left: 20upx; font-size: 38upx;
} color: #FFFFFF;
}
.uer-name {
height: 60upx; .navigat-arrow {
line-height: 60upx; height: 90upx;
font-size: 38upx; width: 40upx;
color: #FFFFFF; line-height: 90upx;
} font-size: 34upx;
color: #555;
.go-login-navigat-arrow { text-align: right;
font-size: 38upx; font-family: texticons;
color: #FFFFFF; }
}
.navigat-arrow {
height: 90upx;
width: 40upx;
line-height: 90upx;
font-size: 34upx;
color: #555;
text-align: right;
font-family: texticons;
}
.center-list { .center-list {
background-color: #f9f9f9; margin-bottom: 30rpx;
} background-color: #f9f9f9;
}
.center-list-cell {
.center-list-cell {
width: 750rpx; width: 750rpx;
height: 40rpx; background-color: #007AFF;
} height: 40rpx;
}
.grid{
background-color: #FFFFFF;
margin:25rpx 0;
}
.uni-grid .text {
font-size: 26rpx;
color: #817f82;
}
.uni-grid .item /deep/ .uni-grid-item__box {
justify-content: center;
align-items: center;
}
</style> </style>
<template> <template>
<view class="flex flex-column flex-1 w-750 bg-white"> <view class="flex flex-column flex-1 w-750 bg-white" :class="{'hidden':!isShow}">
<view class="flex-1 flex flex-column justify-start align-center"> <view v-if="isShow" class="flex-1 flex flex-column justify-start align-center">
<view class="w-630 flex flex-column"> <view class="w-630 flex flex-column">
<!-- 顶部文字 --> <!-- 顶部文字 -->
<text class="font-32 font-blod pt-5">登陆后即可展示自己</text> <text class="font-32 font-blod pt-5">登陆后即可展示自己</text>
...@@ -33,14 +33,15 @@ ...@@ -33,14 +33,15 @@
</view> </view>
<!-- 登录按钮弹窗 --> <!-- 登录按钮弹窗 -->
<login-action-sheet ref="loginActionSheet"></login-action-sheet> <login-action-sheet ref="loginActionSheet"></login-action-sheet>
<uni-quick-login></uni-quick-login> <uni-quick-login @univerifyEnd="isShow = 1"></uni-quick-login>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
isShow:false,
link: [{ link: [{
text: '用户协议', text: '用户协议',
to: '/baidu.com' to: '/baidu.com'
...@@ -84,7 +85,10 @@ ...@@ -84,7 +85,10 @@
} }
</script> </script>
<style> <style>
.hidden,page{
background-color: transparent;
}
@import url("../../common/myStyle.css"); @import url("../../common/myStyle.css");
.lgnin-iknow { .lgnin-iknow {
......
<template> <template>
<view class="quick-login-box"> <view class="quick-login-box" v-if="isShow">
<view class="item" v-for="({text,logo,name},index) in providerList" :key="index" @click="login(name)"> <view class="item" v-for="({text,logo,name},index) in providerList" :key="index" @click="login(name)">
<image class="logo" :src="logo" mode="widthFix"></image> <image class="logo" :src="logo" mode="widthFix"></image>
<text class="login-title">{{text}}</text> <text class="login-title">{{text}}</text>
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<script> <script>
export default { export default {
data() { data() {
return { return {
isShow:false,
config: { config: {
"weixin": { "weixin": {
"text": "微信登陆", "text": "微信登陆",
...@@ -39,7 +40,7 @@ ...@@ -39,7 +40,7 @@
}, },
providerList: [], providerList: [],
univerifyStyle: { univerifyStyle: {
"fullScreen": false, // 是否全屏显示,true表示全屏模式,false表示非全屏模式,默认值为false。 "fullScreen": true, // 是否全屏显示,true表示全屏模式,false表示非全屏模式,默认值为false。
"backgroundColor": "#ffffff", // 授权页面背景颜色,默认值:#ffffff "backgroundColor": "#ffffff", // 授权页面背景颜色,默认值:#ffffff
} }
} }
...@@ -77,6 +78,8 @@ ...@@ -77,6 +78,8 @@
console.log(err); console.log(err);
if(err.errCode===30002){ if(err.errCode===30002){
console.log('你手动关闭了,一键登陆'); console.log('你手动关闭了,一键登陆');
this.isShow = 1
this.$emit('univerifyEnd')
} }
} }
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册