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

资源目录 app-plus 改为 app

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