小程序扫码登录
parent
15bdf66c26
commit
0c0aaede94
10
App.vue
10
App.vue
|
|
@ -2031,6 +2031,16 @@
|
|||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 是否为扫码登录
|
||||
var thirdpartylogin_arr = ['/thirdpartylogin-scan-index-', 'plugins/index/pluginsname/thirdpartylogin/pluginscontrol/scan/pluginsaction/index'];
|
||||
var thirdpartylogin_ret = self.web_url_value_mate(value, thirdpartylogin_arr);
|
||||
if(thirdpartylogin_ret.status == 1 && thirdpartylogin_ret.value != null) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/plugins/thirdpartylogin/index/index?id='+thirdpartylogin_ret.value,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 默认打开url
|
||||
self.open_web_view(value);
|
||||
|
|
|
|||
12
pages.json
12
pages.json
|
|
@ -1057,6 +1057,18 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/plugins/thirdpartylogin",
|
||||
"pages": [{
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"disableScroll": true,
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarTitleText": "授权登录"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
|
|
|||
|
|
@ -1,55 +1,55 @@
|
|||
page {
|
||||
page {
|
||||
background: #fff;
|
||||
|
||||
}
|
||||
/**
|
||||
* 基础
|
||||
*/
|
||||
|
||||
/**
|
||||
* 基础
|
||||
*/
|
||||
.content {
|
||||
padding-top: 8%;
|
||||
padding-top: 8%;
|
||||
}
|
||||
.content .icon {
|
||||
width: 150rpx;
|
||||
height: 150rpx !important;
|
||||
.content .icon {
|
||||
width: 150rpx;
|
||||
height: 150rpx !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单内容
|
||||
*/
|
||||
.form-content {
|
||||
padding: 2% 40rpx 0 40rpx;
|
||||
*/
|
||||
.form-content {
|
||||
padding: 2% 40rpx 0 40rpx;
|
||||
}
|
||||
.form-content .form-item,
|
||||
.form-content .code,
|
||||
.form-content .verify {
|
||||
border-bottom: solid 1px #f7f7f7;
|
||||
}
|
||||
}
|
||||
.form-content .form-item,
|
||||
.form-content .code input,
|
||||
.form-content .verify input {
|
||||
font-size: 28rpx;
|
||||
color: #4e4e4e;
|
||||
height: 40px;
|
||||
.form-content .verify input {
|
||||
font-size: 28rpx;
|
||||
color: #4e4e4e;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-radius: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
.form-content .code input,
|
||||
.form-content .verify input {
|
||||
width: 63%;
|
||||
}
|
||||
.form-content .code .verify-submit {
|
||||
width: 35%;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
.form-content .verify .verify-image {
|
||||
width: 35%;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
.form-content .code .verify-submit {
|
||||
width: 35%;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
.form-content .verify .verify-image {
|
||||
width: 35%;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
.opt-type-list text:not(:last-child) {
|
||||
margin-right: 50rpx;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.img-user {
|
||||
.scanpay-logo {
|
||||
width: 92rpx;
|
||||
height: 92rpx !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<view class="padding-main">
|
||||
<block v-if="(data.scanpay_info || null) !== null">
|
||||
<view class="flex-row align-c margin-top-main margin-bottom-xl">
|
||||
<image v-if="data.scanpay_info.logo" :src="data.scanpay_info.logo" mode="widthFix" class="circle img-user br margin-right-main" />
|
||||
<image v-if="data.scanpay_info.logo" :src="data.scanpay_info.logo" mode="widthFix" class="circle scanpay-logo br margin-right-main" />
|
||||
<div class="flex-1 flex-width flex-row align-c">
|
||||
<text class="text-size fw-b single-text">{{ data.scanpay_info.name }}</text>
|
||||
<text v-if="(data.scanpay_info.alias || null) !== null" class="cr-white badge tc margin-left-sm">{{ data.scanpay_info.alias }}</text>
|
||||
|
|
@ -175,14 +175,15 @@
|
|||
this.setData({
|
||||
params: params || {},
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
this.init();;
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
@ -430,4 +431,4 @@
|
|||
|
||||
<style scoped>
|
||||
@import './index.css';
|
||||
</style>
|
||||
</style>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
page {
|
||||
background: #fff;
|
||||
}
|
||||
.user-avatar {
|
||||
width: 180rpx;
|
||||
height: 180rpx !important;
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="(data || null) !== null && (user || null) !== null" class="tc padding-main padding-top-xxxl">
|
||||
<image :src="user.avatar" mode="widthFix" class="circle br user-avatar" />
|
||||
<view class="margin-top-xs">{{user.user_name_view}}</view>
|
||||
<block v-if="data.status == 1">
|
||||
<view class="margin-top-xxl">
|
||||
<view class="fw-b">授权登录{{application_title}}</view>
|
||||
<view class="cr-grey margin-top-sm">若非本人操作,请忽略申请</view>
|
||||
</view>
|
||||
<view class="margin-top-xxxl padding-top-xl">
|
||||
<button type="default" class="bg-main br-main cr-white round text-size" @tap="status_record(2)">确认登录</button>
|
||||
<button type="default" class="bg-yellow br-yellow cr-white round text-size margin-top-lg" @tap="exit_event">取消</button>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="margin-top-xxl">
|
||||
<iconfont name="icon-qiandao-dqxz" size="28rpx" class="cr-green circle"></iconfont>
|
||||
<text class="margin-left-xs">已登录成功</text>
|
||||
</view>
|
||||
<view class="margin-top-xxxl padding-top-xl">
|
||||
<button type="default" class="bg-yellow br-yellow cr-white round text-size margin-top-lg" @tap="exit_event">关闭</button>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 基础配置
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: {},
|
||||
application_title: app.globalData.get_application_title(),
|
||||
user : null,
|
||||
data: null
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
params['id'] = 200;
|
||||
this.setData({
|
||||
params: params || {},
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.init();
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
// 记录状态
|
||||
this.status_record(0);
|
||||
|
||||
// 用户信息
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login?event_callback=init',
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
user: user
|
||||
});
|
||||
// 记录状态
|
||||
this.status_record(1);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 状态记录
|
||||
status_record(status) {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
});
|
||||
// 请求数据
|
||||
var post_data = {
|
||||
...this.params,
|
||||
status: status
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('statusrecord', 'scan', 'thirdpartylogin'),
|
||||
method: 'POST',
|
||||
data: post_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data: res.data.data,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'status_record', status)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 退出小程序
|
||||
exit_event(e) {
|
||||
uni.exitMiniProgram();
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import './index.css';
|
||||
</style>
|
||||
Loading…
Reference in New Issue