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

资源目录 app-plus 改为 app

上级 89745c0e
......@@ -72,47 +72,47 @@
{
"id": "apple",
"text": "苹果登录",
"logo": "/uni_modules/uni-id-pages-x/static/app-plus/uni-fab-login/apple.png",
"logo": "/uni_modules/uni-id-pages-x/static/app/uni-fab-login/apple.png",
},
{
"id": "univerify",
"text": "一键登录",
"logo": "/uni_modules/uni-id-pages-x/static/app-plus/uni-fab-login/univerify.png",
"logo": "/uni_modules/uni-id-pages-x/static/app/uni-fab-login/univerify.png",
},
{
"id": "taobao",
"text": "淘宝登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages-x/static/app-plus/uni-fab-login/taobao.png",
"logo": "/uni_modules/uni-id-pages-x/static/app/uni-fab-login/taobao.png",
},
{
"id": "facebook",
"text": "脸书登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages-x/static/app-plus/uni-fab-login/facebook.png",
"logo": "/uni_modules/uni-id-pages-x/static/app/uni-fab-login/facebook.png",
},
{
"id": "alipay",
"text": "支付宝登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages-x/static/app-plus/uni-fab-login/alipay.png",
"logo": "/uni_modules/uni-id-pages-x/static/app/uni-fab-login/alipay.png",
},
{
"id": "qq",
"text": "QQ登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages-x/static/app-plus/uni-fab-login/qq.png",
"logo": "/uni_modules/uni-id-pages-x/static/app/uni-fab-login/qq.png",
},
{
"id": "google",
"text": "谷歌登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages-x/static/app-plus/uni-fab-login/google.png",
"logo": "/uni_modules/uni-id-pages-x/static/app/uni-fab-login/google.png",
},
{
"id": "douyin",
"text": "抖音登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages-x/static/app-plus/uni-fab-login/douyin.png",
"logo": "/uni_modules/uni-id-pages-x/static/app/uni-fab-login/douyin.png",
},
{
"id": "sinaweibo",
"text": "新浪微博", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages-x/static/app-plus/uni-fab-login/sinaweibo.png",
"logo": "/uni_modules/uni-id-pages-x/static/app/uni-fab-login/sinaweibo.png",
}
// #endif
] as Services[]
......@@ -199,9 +199,6 @@
this.login_before(id)
}
},
toPage(path : string) {
// console.log(13, path);
},
login_before(type : string) {
// console.log(type);
// 提示空实现
......
<template>
<view class="page">
<!-- 顶部文字 -->
<!-- <text class="title">请选择登录方式{{loginType}}--isAgree:{{pendingAgreements}}</text> -->
<!-- 应用图标 -->
<image class="app-logo" :src="logo" mode="aspectFit"></image>
<!-- 苹果账号 微信账号 微信账号手机号 登录 -->
<view class="big-login-box" v-if="['apple','weixin', 'weixinMobile'].includes(loginType)">
<text class="tip">将根据第三方账号服务平台的授权范围获取你的信息</text>
<image v-if="loginType !== 'weixinMobile'" @click="login" :src="imgSrc" mode="widthFix" class="big-login-img">
</image>
<button v-else type="primary" open-type="getmobileNumber" @getmobilenumber="login"
class="uni-btn">微信授权手机号登录</button>
<!-- 同意隐私政策协议 -->
<uni-id-pages-x-agreements class="agreements-box" scope="login" />
</view>
<!-- 密码登录 -->
<uni-id-pages-x-loginByPwd v-if="loginType == 'username'" />
<!-- 手机号验证码登录 -->
<uni-id-pages-x-loginBySmsCode v-if="loginType == 'smsCode'" />
<!-- 固定定位的快捷登录按钮 -->
<uni-id-pages-x-fab-login :currentLoginType="loginType"
@changeLoginType="changeLoginType"></uni-id-pages-x-fab-login>
</view>
</template>
<script>
import { state } from '@/uni_modules/uni-id-pages-x/store.uts';
import config from '@/uni_modules/uni-id-pages-x/config.uts';
export default {
computed: {
//大快捷登录按钮图
imgSrc() : string {
return this.loginType == 'weixin' ? '/uni_modules/uni-id-pages-x/static/login/weixin.png' : '/uni_modules/uni-id-pages-x/static/app-plus/apple.png'
},
pendingAgreements() : boolean {
return state.pendingAgreements
}
},
data() {
return {
loginType: "username" as string,
logo: "/static/logo.png"
}
},
onLoad(param : Map<string, string>) {
const type = param.get("type")
// 如果传递了参数就按参数指定的登录方式,否则指定为 config 中配置的第一项
if (type != null) {
this.loginType = type
} else {
let loginTypes = config.getArray<string>("loginTypes");
this.loginType = loginTypes![0];
}
},
methods: {
login() {
},
changeLoginType(type : string) {
// if (["weixin", "apple", "univerify"].includes(type)) {
// }
this.loginType = type
}
}
}
</script>
<style lang="scss" scoped>
@import url("/uni_modules/uni-id-pages-x/common/common.scss");
.app-logo {
width: 150rpx;
height: 150rpx;
margin: 30px 300rpx;
}
.big-login-box .agreements-box {
justify-content: center;
}
.big-login-img {
margin: 10px 25rpx;
height: 60px;
width: 700rpx;
}
<template>
<view class="page">
<!-- 顶部文字 -->
<!-- <text class="title">请选择登录方式{{loginType}}--isAgree:{{pendingAgreements}}</text> -->
<!-- 应用图标 -->
<image class="app-logo" :src="logo" mode="aspectFit"></image>
<!-- 苹果账号 微信账号 微信账号手机号 登录 -->
<view class="big-login-box" v-if="['apple','weixin', 'weixinMobile'].includes(loginType)">
<text class="tip">将根据第三方账号服务平台的授权范围获取你的信息</text>
<image v-if="loginType !== 'weixinMobile'" @click="login" :src="imgSrc" mode="widthFix" class="big-login-img">
</image>
<button v-else type="primary" open-type="getmobileNumber" @getmobilenumber="login"
class="uni-btn">微信授权手机号登录</button>
<!-- 同意隐私政策协议 -->
<uni-id-pages-x-agreements class="agreements-box" scope="login" />
</view>
<!-- 密码登录 -->
<uni-id-pages-x-loginByPwd v-if="loginType == 'username'" />
<!-- 手机号验证码登录 -->
<uni-id-pages-x-loginBySmsCode v-if="loginType == 'smsCode'" />
<!-- 固定定位的快捷登录按钮 -->
<uni-id-pages-x-fab-login :currentLoginType="loginType"
@changeLoginType="changeLoginType"></uni-id-pages-x-fab-login>
</view>
</template>
<script>
import { state } from '@/uni_modules/uni-id-pages-x/store.uts';
import config from '@/uni_modules/uni-id-pages-x/config.uts';
export default {
computed: {
//大快捷登录按钮图
imgSrc() : string {
return this.loginType == 'weixin' ? '/uni_modules/uni-id-pages-x/static/login/weixin.png' : '/uni_modules/uni-id-pages-x/static/app/apple.png'
},
pendingAgreements() : boolean {
return state.pendingAgreements
}
},
data() {
return {
loginType: "username" as string,
logo: "/static/logo.png"
}
},
onLoad(param : Map<string, string>) {
const type = param.get("type")
// 如果传递了参数就按参数指定的登录方式,否则指定为 config 中配置的第一项
if (type != null) {
this.loginType = type
} else {
let loginTypes = config.getArray<string>("loginTypes");
this.loginType = loginTypes![0];
}
},
methods: {
login() {
},
changeLoginType(type : string) {
// if (["weixin", "apple", "univerify"].includes(type)) {
// }
this.loginType = type
}
}
}
</script>
<style lang="scss" scoped>
@import url("/uni_modules/uni-id-pages-x/common/common.scss");
.app-logo {
width: 150rpx;
height: 150rpx;
margin: 30px 300rpx;
}
.big-login-box .agreements-box {
justify-content: center;
}
.big-login-img {
margin: 10px 25rpx;
height: 60px;
width: 700rpx;
}
</style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册