提交 1e6b0974 编写于 作者: DCloud_JSON's avatar DCloud_JSON

更新 uni-agree

上级 58bb0869
<script>
import initApp from '@/common/appInit.js';
import checkIsAgree from '@/uni_modules/uni-agree/utils/uni-agree.js';
export default {
globalData: {
searchText: '',
......@@ -8,6 +9,7 @@
onLaunch: function() {
console.log('App Launch')
initApp();
checkIsAgree();
//#ifdef APP-NVUE || H5
//预加载设置页面
......
......@@ -24,12 +24,21 @@
"OAuth" : {},
"Fingerprint" : {},
"Share" : {},
"Push" : {}
"Push" : {},
"Payment" : {}
},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissionExternalStorage" : {
"request" : "none",
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
},
"permissionPhoneState" : {
"request" : "none",
"prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。"
},
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
......@@ -73,6 +82,13 @@
"geolocation" : {},
"push" : {
"unipush" : {}
},
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wxffdd8fa6ec4ef2a0",
"UniversalLinks" : ""
}
}
}
},
......
......@@ -7,9 +7,10 @@
//#endif
"enablePullDownRefresh": true
}
},
{
"path": "pages/networkErr/networkErr",
},
// #ifdef APP-PLUS
{
"path": "pages/networkErr/networkErr",
"style": {
"navigationStyle": "custom",
"backgroundColor": "transparent",
......@@ -18,17 +19,18 @@
"background": "transparent",
"popGesture": "none"
}
}
},
{
"path": "pages/list/news-list",
"style": {
//#ifndef MP
"navigationStyle": "custom",
//#endif
"enablePullDownRefresh": true
}
},
}
},
// #endif
{
"path": "pages/list/news-list",
"style": {
//#ifndef MP
"navigationStyle": "custom",
//#endif
"enablePullDownRefresh": true
}
},
{
"path": "pages/grid/grid",
"style": {
......@@ -142,19 +144,10 @@
}
}
}, {
"path": "uni_modules/uni-agree/pages/uni-agree/uni-agree",
"style": {
"disableScroll": true,
"app-plus": {
"backgroundColorTop": "transparent",
"background": "transparent",
"titleNView": false,
"scrollIndicator": false,
"popGesture": "none",
"animationType": "fade-in",
"animationDuration": 200
}
"path": "uni_modules/uni-agree/pages/uni-agree/uni-agree",
"style": {
"navigationStyle": "custom",
"app-plus":{"popGesture": "none"}
}
}, {
"path": "pages/ucenter/settings/settings",
......
......@@ -7,7 +7,6 @@
<script>
import newsList from './news-list.vue';
import checkIsAgree from '@/uni_modules/uni-agree/utils/uni-agree.js';
export default {
components:{
newsList
......@@ -19,7 +18,6 @@
};
},
onLoad() {
checkIsAgree();
},
onShow(options) {
this.searchText = getApp().globalData.searchText;
......
<template>
<view class="uni-popup-dialog">
<view class="uni-dialog-title">
<text class="uni-dialog-title-text" :class="['uni-popup__'+dialogType]">{{title}}</text>
</view>
<view class="uni-dialog-content">
<login-ikonw class="login-iknow" :link="link" :text="content"></login-ikonw>
</view>
<view class="uni-dialog-button-group">
<view class="uni-dialog-button" @click="close">
<text class="uni-dialog-button-text">不同意</text>
</view>
<view class="uni-dialog-button uni-border-left" @click="onOk">
<text class="uni-dialog-button-text uni-button-color">同意</text>
</view>
</view>
</view>
</template>
<script>
export default {
name: "uniPopupAgree",
props: {
/**
* 对话框主题 success/warning/info/error 默认 success
*/
type: {
type: String,
default: 'error'
},
/**
* 对话框标题
*/
title: {
type: String,
default: '使用须知'
},
/**
* 对话框内容
*/
content: {
type: String,
default: 'DCloud(以下简称我们)尊重并保护所有使用服务用户的个人权益。为了给您提供更准确、更有个性化的服务,我们会按照本隐私政策和服务协议的规定使用和披露您的个人信息。但我们将以高度的勤勉、审慎义务对待这些信息。除本隐私政策和服务协议另有规定外,在未征得您事先许可的情况下,我们不会将这些信息对外披露或向第三方提供。'
},
},
data() {
return {
dialogType: 'error',
val: "",
link: [{
text: '服务协议',
to: '/pages/ucenter/agree-list/service/service'
}, {
text: '隐私政策',
to: '/pages/ucenter/agree-list/privacy/privacy'
}],
}
},
watch: {
type(val) {
this.dialogType = val
}
},
created() {
this.dialogType = this.type
},
methods: {
/**
* 点击确认按钮
*/
onOk() {
this.$emit('confirm');
},
/**
* 点击取消按钮
*/
close() {
this.$emit('cancel');
}
}
}
</script>
<style lang="scss" scoped>
.uni-popup-dialog {
width: 300px;
border-radius: 5px;
background-color: #fff;
}
.uni-dialog-title {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: center;
padding-top: 15px;
padding-bottom: 5px;
}
.uni-dialog-title-text {
font-size: 16px;
font-weight: 500;
}
.uni-dialog-content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px 15px 15px 15px;
}
.uni-dialog-content-text {
font-size: 14px;
color: #6e6e6e;
}
.uni-dialog-button-group {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
border-top-color: #f5f5f5;
border-top-style: solid;
border-top-width: 1px;
}
.uni-dialog-button {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
justify-content: center;
align-items: center;
height: 45px;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.uni-border-left {
border-left-color: #f0f0f0;
border-left-style: solid;
border-left-width: 1px;
}
.uni-dialog-button-text {
font-size: 14px;
}
.uni-button-color {
color: $uni-color-primary;
}
.uni-dialog-input {
flex: 1;
font-size: 14px;
}
.uni-popup__success {
color: $uni-color-success;
}
.uni-popup__warn {
color: $uni-color-warning;
}
.uni-popup__error {
color: $uni-color-error;
}
.uni-popup__info {
color: #909399;
}
.uni-popup-dialog__close {
/* #ifndef APP-NVUE */
display: block;
cursor: pointer;
/* #endif */
position: absolute;
top: 9px;
right: 17px;
}
.uni-popup-dialog__close-icon {
/* #ifndef APP-NVUE */
display: inline-block;
/* #endif */
width: 13px;
height: 1px;
background: #909399;
transform: rotate(45deg);
}
.uni-popup-dialog__close-icon::after {
/* #ifndef APP-NVUE */
content: '';
display: block;
/* #endif */
width: 13px;
height: 1px;
background: #909399;
transform: rotate(-90deg);
}
</style>
<template>
<view class="page">
<view>
<text class="title">个人信息保护指引</text>
</view>
<view class="text-item">
<text class="tl">1.在浏览使用时,我们会收集、使用设备标识信息用于推荐。</text>
</view>
<view class="text-item">
<text class="tl">2.我们可能会申请位置权限,用于演示 uni-app 的地图、定位能力。</text>
</view>
<view class="text-item">
<text class="tl">3.你可以查看完整版</text>
</view>
<view class="text-item flex-r">
<text class="tl hl" @click="openprotocol">《用户协议》</text>
<text class="tl"> 和 </text>
<text class="tl hl" @click="openPrivacyPolicy">《隐私政策》</text>
</view>
<view class="text-item">
<text class="tl">以便了解我们收集、使用、共享、存储信息的情况,以及对信息的保护措施。</text>
</view>
<view class="text-item">
<text class="service">如果你同意请点击下面的按钮以接受我们的服务</text>
</view>
<view class="text-item confirm">
<button class="btn-privacy" type="primary" @click="agree">同意</button>
<button class="btn-privacy btn-disagree" v-if="isAndroid" @click="disagree">暂不使用</button>
</view>
<view class="exit-area">
</view>
</view>
</template>
<script>
export default {
data() {
return {
isAndroid: false
}
},
onLoad() {
this.isAndroid = (uni.getSystemInfoSync().platform === 'android');
this._canBack = false;
},
onBackPress() {
return !this._canBack;
},
methods: {
openprotocol(e) {
uni.navigateTo({
url: "/pages/component/web-view/web-view?url=https://ask.dcloud.net.cn/protocol.html"
})
},
openPrivacyPolicy(e) {
uni.navigateTo({
url: "/pages/component/web-view/web-view?url=/hybrid/html/privacy-policy.html"
})
},
agree(e) {
var saveStatus = uni.setStorageSync("userprotocol", 1);
this._canBack = true;
setTimeout(() => {
uni.navigateBack({
animationDuration: 0
});
}, 100)
},
disagree() {
plus.runtime.quit();
}
}
}
</script>
<style>
.page {
padding: 80px 30px;
}
.title {
font-size: 18px;
line-height: 30px;
margin-bottom: 20px;
}
.flex-r {
flex-direction: row;
flex-wrap: wrap;
}
.text-item {
margin-bottom: 5px;
}
.tl {
font-size: 14px;
line-height: 20px;
}
.hl {
color: #007AFF;
}
.service {
font-size: 16px;
line-height: 20px;
margin-top: 20px;
}
.confirm {
margin-top: 50px;
flex-direction: row;
}
.btn-privacy {
flex: 1;
}
.btn-disagree {
margin-left: 20px;
}
</style>
\ No newline at end of file
<template>
<view class="wrap">
<uni-popup-agree @cancel="cancel" @confirm="confirm"></uni-popup-agree>
</view>
</template>
<script>
import uniPopupAgree from '../../components/uni-popup-agree/uni-popup-agree'
export default {
components: {
uniPopupAgree
},
methods: {
confirm() {
uni.setStorageSync('iKnowAgree', true);
uni.navigateBack();
},
cancel() {
plus.runtime.quit();
}
}
}
</script>
<style>
/* #ifndef APP-NVUE */
page {
display: flex;
flex-direction: column;
background: transparent;
}
/* #endif */
.wrap {
flex: 1;
flex-direction: column;
align-items: center;
justify-content: center;
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color:rgba(0,0,0,.65);
}
</style>
export default function checkIsAgree(){
export default function(){
if (uni.getSystemInfoSync().platform == "android") {
let iKnowAgree = uni.getStorageSync('iKnowAgree') || false;
if(!iKnowAgree){
uni.navigateTo({
url:'/uni_modules/uni-agree/pages/uni-agree/uni-agree'
url:'uni_modules/uni-agree/pages/uni-agree/uni-agree',
animationType:"none"
})
}
}
......
......@@ -32,16 +32,16 @@ const validator = {
"defaultValue": 0,
"label": "性别"
},
"mobile": {
"rules": [{
"format": "string"
},
{
"pattern": "^\\+?[0-9-]{3,20}$"
}
],
"label": "手机号码"
},
// "mobile": {
// "rules": [{
// "format": "string"
// },
// {
// "pattern": "^\\+?[0-9-]{3,20}$"
// }
// ],
// "label": "手机号码"
// },
"nickname": {
"rules": [{
......
......@@ -11,7 +11,7 @@
<uni-forms-item name="gender" label="性别" required>
<uni-data-checkbox v-model="formData.gender" :localdata="formOptions.gender_localdata" />
</uni-forms-item>
<uni-forms-item name="mobile" label="手机号码" required>
<uni-forms-item name="mobile" label="手机号码" v-if="formData.mobile">
<uni-easyinput placeholder="手机号码" :disabled="true" v-model="formData.mobile" trim="both" />
</uni-forms-item>
<uni-forms-item name="nickname" label="昵称" required>
......@@ -68,7 +68,7 @@
]
},
rules: {
...getValidator(["avatar", "gender", "mobile", "nickname"])
...getValidator(["avatar", "gender", "nickname"])
}
}
},
......
const helpPage = '/pages/ucenter/help/help'; // 帮助页面
import {mapMutations} from 'vuex';
import loginSuccess from './loginSuccess.js';
let mixin = {
// // 监听帮助按钮
// onNavigationBarButtonTap(event) {
......@@ -81,24 +82,27 @@ let mixin = {
setUserInfo: 'user/login'
}),
loginSuccess(result){
uni.showToast({
title: '登陆成功',
icon: 'none'
});
uni.setStorageSync('uni_id_uid', result.uid)
uni.setStorageSync('uni_id_token', result.token)
uni.setStorageSync('uni_id_token_expired', result.tokenExpired)
loginSuccess(result)
delete result.userInfo.token
this.setUserInfo(result.userInfo)
// uni.showToast({
// title: '登陆成功',
// icon: 'none'
// });
// uni.setStorageSync('uni_id_uid', result.uid)
// uni.setStorageSync('uni_id_token', result.token)
// uni.setStorageSync('uni_id_token_expired', result.tokenExpired)
// delete result.userInfo.token
// this.setUserInfo(result.userInfo)
var delta = 0//判断需要返回几层
let pages = getCurrentPages();
pages.forEach((page,index)=>{
if(pages[pages.length-index-1].route.split('/')[1] == 'uni-login-page'){
delta ++
}
})
uni.navigateBack({delta})
// var delta = 0//判断需要返回几层
// let pages = getCurrentPages();
// pages.forEach((page,index)=>{
// if(pages[pages.length-index-1].route.split('/')[1] == 'uni-login-page'){
// delta ++
// }
// })
// uni.navigateBack({delta})
}
}
}
......
export default function(result){
uni.showToast({
title: '登陆成功',
icon: 'none'
});
console.log('登陆成功',result);
uni.setStorageSync('uni_id_uid', result.uid)
uni.setStorageSync('uni_id_token', result.token)
uni.setStorageSync('uni_id_token_expired', result.tokenExpired)
//delete result.userInfo.token
// this.setUserInfo(result.userInfo)
var delta = 0//判断需要返回几层
let pages = getCurrentPages();
console.log(pages);
pages.forEach((page,index)=>{
if(pages[pages.length-index-1].route.split('/')[1] == 'uni-login-page'){
delta ++
}
})
uni.navigateBack({delta})
}
\ No newline at end of file
......@@ -9,6 +9,7 @@
<script>
import {mapGetters,mapMutations} from 'vuex';
//前一个窗口的页面地址。控制点击切换快捷登陆方式是创建还是返回
import loginSuccess from 'uni_modules/uni-login-page/common/loginSuccess.js';
export default {
data() {
return {
......@@ -185,7 +186,9 @@
uni.closeAuthView()
}
uni.hideLoading()
this.loginSuccess(result)
loginSuccess(result)
delete result.userInfo.token
this.setUserInfo(result.userInfo)
}
},{showLoading:true})
},
......
......@@ -41,7 +41,7 @@
<script>
var univerify_first,currentWebview;//是否一键登陆优先
import baseappConfig from '@/baseapp.config.js';
import mixin from '../../common/loginPage.mixin.js';
import mixin from '../../common/loginPage.mixin.js';
var currentPage;
export default {
mixins:[mixin],
......
......@@ -17,7 +17,7 @@
<uni-easyinput placeholder="再次输入密码" type="password" v-model="formData.pwd2" trim="both" />
</uni-forms-item>
<view class="uni-button-group">
<button type="primary" class="uni-button" @click="submit">注册</button>
<button type="primary" class="uni-button" @click="submit">注册并登陆</button>
</view>
</uni-forms>
</view>
......@@ -34,8 +34,8 @@ import mixin from '../../common/loginPage.mixin.js';
"username": "",
"gender": 0,
"nickname": "",
'password':'123456',
'pwd2':'123456'
'password':'',
'pwd2':''
},
formOptions: {
"gender_localdata": [{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册