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

213

上级 a5944d62
......@@ -30,4 +30,14 @@
box-sizing: border-box;
/* #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>
......@@ -17,7 +17,8 @@
},
"modules" : {
"OAuth" : {},
"Share" : {}
"Share" : {},
"Fingerprint" : {}
},
"distribute" : {
"android" : {
......@@ -34,6 +35,7 @@
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<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.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
......
......@@ -22,15 +22,24 @@
"style": {
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationStyle": "custom",
"backgroundColor": "transparent",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "帮助",
"type": "none",
"fontSize": "16px",
"width": "60px"
}]
}
"animationType": "fade-in",
"background": "transparent",
"popGesture": "none",
"titleNView":false
// "navigationBarTitleText": "",
// "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>
<view class="center">
<view class="logo" @click="goLogin" :hover-class="!login ? 'logo-hover' : ''">
<image class="logo-img" :src="login ? (userInfo.avatar || avatarUrl) :avatarUrl"></image>
<view class="logo-title">
<text class="uer-name">Hi,{{login ? userInfo.username : '您未登录'}}</text>
<text class="go-login-navigat-arrow navigat-arrow" v-if="!login">&#xe65e;</text>
</view>
</view>
<uni-list class="center-list">
<template v-for="(sublist , index) in ucenterList">
<uni-list-item :title="item.title" :rightText="item.rightText" :to="item.to"
v-for="(item, subIndex) in sublist" :key="(index + '_' + subIndex)" @click="ucenterListClick(item)" :clickable="true"></uni-list-item>
<!-- #ifdef APP-NVUE -->
<cell class="center-list-cell"></cell>
<!-- #endif -->
<!-- #ifndef APP-PLUS -->
<view class="center-list-cell"></view>
<!-- #endif -->
</template>
</uni-list>
</view>
</template>
<script>
import {
mapGetters,
mapMutations
} from 'vuex';
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
export default {
data() {
return {
avatarUrl: '/static/logo.png',
ucenterList: [
[{
title: '阅读过的文章'
}, {
title: '我的积分'
}],
[{
title: '政策与协议',
to:'/pages/agree-list/agree-list'
}, {
title: '关于',
to: '/pages/about/about'
},
//#ifdef APP-PLUS
{
title: '检查更新',
rightText: `V${getApp().appVersion.finall.version}_${getApp().appVersion.finall.versionCode}`,
event:'checkVersion'
}
//#endif
],
[
{
title: '反馈',
to:'/pages/uni-feedback/uni-feedback'
},{
title: '设置',
to: '/pages/settings/settings'
}
]
]
}
},
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]();
}
<template>
<view class="center">
<view class="logo" @click="goLogin" :hover-class="!login ? 'logo-hover' : ''">
<image class="logo-img" :src="login ? (userInfo.avatar || avatarUrl) :avatarUrl"></image>
<view class="logo-title">
<text class="uer-name">Hi,{{login ? userInfo.username : '您未登录'}}</text>
<text class="go-login-navigat-arrow navigat-arrow" v-if="!login">&#xe65e;</text>
</view>
</view>
<uni-grid class="grid" :column="5" :showBorder="false" :square="true">
<uni-grid-item class="item" v-for="({text,icon},index) in gridList" @click.native="tapGrid(index)">
<uni-icons class="icon" color="#5d5e64" :type="icon" size="28"></uni-icons>
<text class="text">{{text}}</text>
</uni-grid-item>
</uni-grid>
<uni-list class="center-list" v-for="(sublist , index) in ucenterList">
<uni-list-item v-for="item in sublist"
:title="item.title"
link :rightText="item.rightText"
:clickable="true"
:to="item.to"
@click="ucenterListClick(item)"
></uni-list-item>
</uni-list>
</view>
</template>
<script>
import {
mapGetters,
mapMutations
} from 'vuex';
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
export default {
data() {
return {
avatarUrl: '/static/logo.png',
gridList: [{
"text": "文字1",
"icon": "chat"
},
{
"text": "文字2",
"icon": "cloud-upload"
},
{
"text": "文字3",
"icon": "contact"
},
{
"text": "文字4",
"icon": "download"
},
{
"text": "文字5",
"icon": "paperplane"
}
],
ucenterList: [
[{
title: '阅读过的文章',
to: '/pages/agree-list/agree-list'
}, {
title: '我的积分',
to: '/pages/agree-list/agree-list'
}],
[{
title: '政策与协议',
to: '/pages/agree-list/agree-list'
}, {
title: '关于',
to: '/pages/about/about'
},
//#ifdef APP-PLUS
// {
// title: '检查更新',
// rightText: `V${getApp().appVersion.finall.version}_${getApp().appVersion.finall.versionCode}`,
// event:'checkVersion'
// }
//#endif
],
[{
title: '反馈',
to: '/pages/uni-feedback/uni-feedback'
}, {
title: '设置',
to: '/pages/settings/settings'
}]
]
}
},
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(){
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'
})
}
}
}
}
</script>
<style>
/* #ifndef APP-PLUS-NVUE */
@font-face {
font-family: texticons;
font-weight: normal;
font-style: normal;
src: url('~@/static/text-icon.ttf') format('truetype');
}
page {
background-color: #f8f8f8;
}
/* #endif*/
/* 解决头条小程序字体图标不显示问题,因为头条运行时自动插入了span标签,且有全局字体 */
/* #ifdef MP-TOUTIAO */
text :not(view) {
font-family: texticons;
}
/* #endif */
.center {
flex: 1;
flex-direction: column;
background-color: #f8f8f8;
}
.logo {
width: 750upx;
height: 240upx;
padding: 20upx;
background-color: #2F85FC;
flex-direction: row;
align-items: center;
}
.logo-hover {
opacity: 0.8;
}
.logo-img {
width: 150upx;
height: 150upx;
border-radius: 150upx;
}
.logo-title {
height: 150upx;
flex: 1;
align-items: center;
justify-content: space-between;
flex-direction: row;
margin-left: 20upx;
}
.uer-name {
height: 60upx;
line-height: 60upx;
font-size: 38upx;
color: #FFFFFF;
}
.go-login-navigat-arrow {
font-size: 38upx;
color: #FFFFFF;
}
.navigat-arrow {
height: 90upx;
width: 40upx;
line-height: 90upx;
font-size: 34upx;
color: #555;
text-align: right;
font-family: texticons;
}
tapGrid(index){
uni.showToast({
title: '你点击了,第'+index+'',
icon: 'none'
});
}
}
}
</script>
<style>
/* #ifndef APP-PLUS-NVUE */
@font-face {
font-family: texticons;
font-weight: normal;
font-style: normal;
src: url('~@/static/text-icon.ttf') format('truetype');
}
page {
background-color: #f8f8f8;
}
/* #endif*/
/* 解决头条小程序字体图标不显示问题,因为头条运行时自动插入了span标签,且有全局字体 */
/* #ifdef MP-TOUTIAO */
text :not(view) {
font-family: texticons;
}
/* #endif */
.center {
flex: 1;
flex-direction: column;
background-color: #f8f8f8;
}
.logo {
width: 750upx;
height: 240upx;
padding: 20upx;
background-color: #2F85FC;
flex-direction: row;
align-items: center;
}
.logo-hover {
opacity: 0.8;
}
.logo-img {
width: 150upx;
height: 150upx;
border-radius: 150upx;
}
.logo-title {
height: 150upx;
flex: 1;
align-items: center;
justify-content: space-between;
flex-direction: row;
margin-left: 20upx;
}
.uer-name {
height: 60upx;
line-height: 60upx;
font-size: 38upx;
color: #FFFFFF;
}
.go-login-navigat-arrow {
font-size: 38upx;
color: #FFFFFF;
}
.navigat-arrow {
height: 90upx;
width: 40upx;
line-height: 90upx;
font-size: 34upx;
color: #555;
text-align: right;
font-family: texticons;
}
.center-list {
background-color: #f9f9f9;
}
.center-list-cell {
margin-bottom: 30rpx;
background-color: #f9f9f9;
}
.center-list-cell {
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>
<template>
<view class="flex flex-column flex-1 w-750 bg-white">
<view class="flex-1 flex flex-column justify-start align-center">
<view class="flex flex-column flex-1 w-750 bg-white" :class="{'hidden':!isShow}">
<view v-if="isShow" class="flex-1 flex flex-column justify-start align-center">
<view class="w-630 flex flex-column">
<!-- 顶部文字 -->
<text class="font-32 font-blod pt-5">登陆后即可展示自己</text>
......@@ -33,14 +33,15 @@
</view>
<!-- 登录按钮弹窗 -->
<login-action-sheet ref="loginActionSheet"></login-action-sheet>
<uni-quick-login></uni-quick-login>
<uni-quick-login @univerifyEnd="isShow = 1"></uni-quick-login>
</view>
</template>
<script>
export default {
data() {
return {
return {
isShow:false,
link: [{
text: '用户协议',
to: '/baidu.com'
......@@ -84,7 +85,10 @@
}
</script>
<style>
<style>
.hidden,page{
background-color: transparent;
}
@import url("../../common/myStyle.css");
.lgnin-iknow {
......
<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)">
<image class="logo" :src="logo" mode="widthFix"></image>
<text class="login-title">{{text}}</text>
......@@ -10,7 +10,8 @@
<script>
export default {
data() {
return {
return {
isShow:false,
config: {
"weixin": {
"text": "微信登陆",
......@@ -39,7 +40,7 @@
},
providerList: [],
univerifyStyle: {
"fullScreen": false, // 是否全屏显示,true表示全屏模式,false表示非全屏模式,默认值为false。
"fullScreen": true, // 是否全屏显示,true表示全屏模式,false表示非全屏模式,默认值为false。
"backgroundColor": "#ffffff", // 授权页面背景颜色,默认值:#ffffff
}
}
......@@ -77,6 +78,8 @@
console.log(err);
if(err.errCode===30002){
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.
先完成此消息的编辑!
想要评论请 注册