APP登录
This commit is contained in:
parent
74c7cf99a6
commit
79969b5827
@ -79,13 +79,13 @@ export function loginAppuserName(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 使用租户域名(标识),获得租户编号
|
// 使用手机号查询所在的租户获得租户编号
|
||||||
export function getTenantIdByWebsite(website) {
|
export function getTenantIdByPhone(phone) {
|
||||||
return request({
|
return request({
|
||||||
url: '/admin-api/system/tenant/getListByWebsite',
|
url: '/app-api/system/user/getListByPhone',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
website
|
phone
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -14,13 +14,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="">工单处理</view>
|
<view class="">工单处理</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="box" :class="{active: aindex == 3}" @click="getgogo(3)">
|
<!-- <view class="box" :class="{active: aindex == 3}" @click="getgogo(3)">-->
|
||||||
<view class="imgs">
|
<!-- <view class="imgs">-->
|
||||||
<image mode="aspectFit" src="@/static/icons/tabbar/my.png" v-show="aindex != 3"></image>
|
<!-- <image mode="aspectFit" src="@/static/icons/tabbar/my.png" v-show="aindex != 3"></image>-->
|
||||||
<image mode="aspectFit" src="@/static/icons/tabbar/my-checked.png" v-show="aindex == 3"></image>
|
<!-- <image mode="aspectFit" src="@/static/icons/tabbar/my-checked.png" v-show="aindex == 3"></image>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="">我的</view>
|
<!-- <view class="">我的</view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// 应用全局配置
|
// 应用全局配置
|
||||||
module.exports = {
|
module.exports = {
|
||||||
baseUrl: 'https://www.nuoyunr.com',
|
// baseUrl: 'https://www.nuoyunr.com',
|
||||||
// baseUrl: 'http://192.168.1.4:48080',
|
baseUrl: 'http://192.168.1.17:48080',
|
||||||
// baseUrl: "http://localhost:48080",
|
// baseUrl: "http://localhost:48080",
|
||||||
imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
|
imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
|
||||||
baseImageUrl: 'https://www.nuoyunr.com/minio/',
|
baseImageUrl: 'https://www.nuoyunr.com/minio/',
|
||||||
|
@ -3,13 +3,14 @@
|
|||||||
<!--<VNavigationBar style="position: relative;z-index: 99;" leftTitle="true" backgroundColor="rgba(0,0,0,0)" title-color="#fff" title=" "></VNavigationBar>-->
|
<!--<VNavigationBar style="position: relative;z-index: 99;" leftTitle="true" backgroundColor="rgba(0,0,0,0)" title-color="#fff" title=" "></VNavigationBar>-->
|
||||||
<view class="bodyTopBg"></view>
|
<view class="bodyTopBg"></view>
|
||||||
<view class="body">
|
<view class="body">
|
||||||
<view class="userInfoBox">
|
<view class="userInfoBox" @click="showUserDetail">
|
||||||
<image style="width: 104rpx;height: 104rpx" :src="userInfo.avatarUrl || defaultAvatar" mode="aspectFill" @error="avatarErr"></image>
|
<image style="width: 104rpx;height: 104rpx;border-radius: 50%;" v-if="''==userInfo.avatar || null == userInfo.avatar" :src="defaultAvatar" mode="scaleToFill" @error="avatarErr"></image>
|
||||||
|
<image style="width: 104rpx;height: 104rpx;border-radius: 50%;" v-else :src="imgUrlPrex+userInfo.avatar" mode="scaleToFill" @error="avatarErr"></image>
|
||||||
<view class="userInfo">
|
<view class="userInfo">
|
||||||
<text class="userName">{{ userInfo.userName }}</text>
|
<text class="userName">{{ userInfo.nickname }}</text>
|
||||||
<text class="userType">{{ userInfo.userType }}</text>
|
<!-- <text class="userType">{{ userInfo.userType }}</text>-->
|
||||||
</view>
|
</view>
|
||||||
<image @click="showUserDetail" style="width: 48rpx;height: 48rpx" src="/static/icons/more.png" mode="aspectFita"></image>
|
<image style="width: 48rpx;height: 48rpx" src="/static/icons/more.png" mode="aspectFita"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="body-top-grid">
|
<view class="body-top-grid">
|
||||||
<view v-for="(item, index) in menuList" :key="index" class="body-top-item" @click="gotoPage(item)">
|
<view v-for="(item, index) in menuList" :key="index" class="body-top-item" @click="gotoPage(item)">
|
||||||
@ -43,6 +44,11 @@
|
|||||||
import tabBarVue from '@/components/tabBar/tabBar.vue'
|
import tabBarVue from '@/components/tabBar/tabBar.vue'
|
||||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||||
import OrderCard from "@/components/orderCard.vue";
|
import OrderCard from "@/components/orderCard.vue";
|
||||||
|
import config from '@/config'
|
||||||
|
import {
|
||||||
|
getToken,
|
||||||
|
getUserInfo
|
||||||
|
} from '@/utils/auth'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -52,10 +58,10 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
imgUrlPrex:config.baseImageUrl,
|
||||||
userInfo: {
|
userInfo: {
|
||||||
avatarUrl: undefined,
|
avatar: undefined,
|
||||||
userName: '曾廷',
|
nickname: '曾廷'
|
||||||
userType: '服务顾问'
|
|
||||||
},
|
},
|
||||||
menuList: [
|
menuList: [
|
||||||
{
|
{
|
||||||
@ -103,7 +109,15 @@ export default {
|
|||||||
defaultAvatar: require('@/static/icons/avatar.png')
|
defaultAvatar: require('@/static/icons/avatar.png')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onLoad() {
|
||||||
|
if(!getToken()){
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
//直接取缓存中的用户信息
|
||||||
|
this.userInfo = getUserInfo()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
gotoPage(menu) {
|
gotoPage(menu) {
|
||||||
@ -113,7 +127,7 @@ export default {
|
|||||||
},
|
},
|
||||||
avatarErr(err) {
|
avatarErr(err) {
|
||||||
console.log('err', err)
|
console.log('err', err)
|
||||||
this.userInfo.avatarUrl = this.defaultAvatar
|
this.userInfo.avatar = this.defaultAvatar
|
||||||
},
|
},
|
||||||
showUserDetail() {
|
showUserDetail() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
BIN
pages-home/static/yaoqingma.png
Normal file
BIN
pages-home/static/yaoqingma.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@ -17,7 +17,7 @@
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages-home/home/home'
|
url: '/pages/login/login'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -1,241 +1,203 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
|
<!-- #ifdef APP-PLUS || H5 -->
|
||||||
<view class="kuang">
|
<view class="top">
|
||||||
<view class="land">您好,</view>
|
<view class="touxiang">
|
||||||
<view class="land">欢迎登录智修小助手</view>
|
<image src="../../static/xinlogo.png" mode=""></image>
|
||||||
</view>
|
|
||||||
<view class="xiaoannoi">
|
|
||||||
<u-button v-if="privacyPolicyChecked == true" text="手机号快捷登录" class="dl" :customStyle="{color:'#ffffff'}"
|
|
||||||
color="#0D2E8D" open-type='getPhoneNumber'
|
|
||||||
@getphonenumber="getPhone"></u-button>
|
|
||||||
<u-button v-else text="手机号快捷登录" class="dl" :customStyle="{color:'#ffffff'}"
|
|
||||||
color="#0D2E8D" @click="shibai()" ></u-button>
|
|
||||||
</view>
|
|
||||||
<view class="dbottom">
|
|
||||||
|
|
||||||
<view class="axquan" v-if="privacyPolicyChecked == false" @click="privacyPolicyChecked = true"></view>
|
|
||||||
<view class="axquanl" v-if="privacyPolicyChecked == true" @click="privacyPolicyChecked = false">
|
|
||||||
<uni-icons type="checkmarkempty" color="#ffffff" size="14"></uni-icons>
|
|
||||||
</view>
|
</view>
|
||||||
<text>请您认真阅读</text>
|
<view class="twotap">
|
||||||
<text class="lan" @click="goPolicy()">《用户协议》</text>
|
<view :class="{'blck':activeid == index}" v-for="(item,index) in qh " :key="index"
|
||||||
|
@click="getxz(index)">{{item.text}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="inputs" v-if="activeid == 0 || activeid == 2 ">
|
||||||
|
<input type="text" v-model="tel" placeholder="请输入手机号">
|
||||||
|
</view>
|
||||||
|
<view class="inputs" v-if="activeid == 1">
|
||||||
|
<input type="text" v-model="tel" placeholder="请输入手机号">
|
||||||
|
</view>
|
||||||
|
<view class="inputs" style="justify-content: space-between; " v-if="activeid == 1">
|
||||||
|
<input type="text" v-model="yzm" placeholder="请输入验证码">
|
||||||
|
<button class="jsq" :disabled="isButtonDisabled" @click="sendVerificationCode">{{ buttonText }}</button>
|
||||||
|
</view>
|
||||||
|
<view class="inputs" v-if="activeid == 0 || activeid == 2 ">
|
||||||
|
<input type="password" v-model="wrod" placeholder="请输入密码">
|
||||||
|
</view>
|
||||||
|
<view class="wjworb" v-if="activeid == 0 || activeid == 2" @click="goforgot()">
|
||||||
|
<view class="">忘记密码</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="dl" @click="getlogin()">
|
||||||
|
<text>登 录</text>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
<view class="dbottom">
|
||||||
|
<view class="quanzi" v-if="qindex == false " @click="qindex =! qindex"></view>
|
||||||
|
<view class="lanquanzi" v-if="qindex == true" @click="qindex =! qindex"><u-icon name="checkbox-mark"
|
||||||
|
color="#ffffff" size="14"></u-icon></view>
|
||||||
|
<text>请仔细阅读</text>
|
||||||
|
<text class="lan">《用户协议》</text>
|
||||||
<text>和</text>
|
<text>和</text>
|
||||||
<text class="lan" @click="goPolicy()">《隐私政策》</text>
|
<text class="lan">《隐私政策》</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '../../utils/request';
|
import request from '@/utils/request';
|
||||||
import {setToken} from '@/utils/auth.js'
|
import {
|
||||||
export default{
|
loginApp
|
||||||
data(){
|
} from '@/api/login';
|
||||||
return{
|
import {
|
||||||
yd : false,
|
setToken,
|
||||||
shenfen:'jcyh',
|
setTenantId,
|
||||||
show:false,
|
setUserInfo
|
||||||
baseUrl:this.$baseUrl,
|
} from '@/utils/auth'
|
||||||
privacyPolicyChecked:false,
|
import {
|
||||||
|
login,
|
||||||
|
getInfo,
|
||||||
|
getTenantIdByPhone
|
||||||
|
} from '@/api/login'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
//系统标识
|
||||||
|
sysCode:"weixiu",
|
||||||
phoneNumber: "",
|
phoneNumber: "",
|
||||||
|
baseUrl: this.$baseUrl,
|
||||||
isButtonDisabled: false,
|
isButtonDisabled: false,
|
||||||
countdownTime: 60,
|
countdownTime: 60,
|
||||||
qh:[
|
qh: [{
|
||||||
{text:'密码登录'},
|
text: '密码登录'
|
||||||
{text:'验证码登录'}
|
},
|
||||||
|
{
|
||||||
|
text: '验证码登录'
|
||||||
|
},
|
||||||
],
|
],
|
||||||
columns: [
|
qindex: false,
|
||||||
['用户','代办' ]
|
tel: '',
|
||||||
],
|
yzm: '',
|
||||||
tel:'',
|
wrod: '',
|
||||||
yzm:'',
|
activeid: 0
|
||||||
wrod:'',
|
|
||||||
activeid:0
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
|
||||||
this.wxlogin()
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
buttonText() {
|
buttonText() {
|
||||||
if (this.isButtonDisabled) {
|
if (this.isButtonDisabled) {
|
||||||
return `${this.countdownTime}s 后重新发送`;
|
return `${this.countdownTime}s 后重新发送`;
|
||||||
} else {
|
} else {
|
||||||
return "获取验证码";
|
return "获取验证码";
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
async getsxshenfen(){
|
|
||||||
let data = {
|
|
||||||
roleCode : this.shenfen
|
|
||||||
}
|
|
||||||
let res = await request({
|
|
||||||
url:'/appInspection/userOwn/updateRole',
|
|
||||||
method:'post',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
if(res.code == 200){
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pages/detection/my'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getshenfen(text){
|
},
|
||||||
this.shenfen = text
|
mounted() {},
|
||||||
|
methods: {
|
||||||
},
|
|
||||||
open() {
|
|
||||||
// console.log('open');
|
|
||||||
},
|
|
||||||
|
|
||||||
close() {
|
|
||||||
// this.show = false
|
|
||||||
// uni.reLaunch({
|
|
||||||
// url: '/pages/detection/my'
|
|
||||||
// })
|
|
||||||
// // console.log('close');
|
|
||||||
},
|
|
||||||
goPolicy() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/login/PrivacyPolicy"
|
|
||||||
})
|
|
||||||
},
|
|
||||||
wxlogin() {
|
wxlogin() {
|
||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log(543, res);
|
|
||||||
if (res.code) {
|
if (res.code) {
|
||||||
uni.setStorageSync('c1', res.code);
|
uni.setStorageSync('c1', res.code);
|
||||||
|
console.log('wxlogin:', res.code);
|
||||||
} else {
|
} else {
|
||||||
console.log('登录失败!' + res.errMsg)
|
console.log('登录失败!' + res.errMsg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getAppinfo(){
|
//登录请求
|
||||||
let res = await request({
|
getlogin() {
|
||||||
url:'/getAppInfo',
|
if (this.qindex != true) {
|
||||||
method:'get',
|
uni.showToast({
|
||||||
})
|
icon: "none",
|
||||||
console.log('getappinfo',res);
|
title: "请阅读并勾选用户协议",
|
||||||
},
|
duration: 2000
|
||||||
//授权
|
})
|
||||||
authorize() {
|
return;
|
||||||
uni.showToast({
|
}
|
||||||
icon: "none",
|
if (this.tel == '') {
|
||||||
title: "请阅读并勾选用户协议",
|
uni.showToast({
|
||||||
duration: 2000
|
title: '手机号不能为空!',
|
||||||
})
|
icon: 'none'
|
||||||
},
|
})
|
||||||
shibai(){
|
return
|
||||||
uni.showToast({
|
}
|
||||||
icon: "none",
|
const loginFun = () => {
|
||||||
title: "请阅读并勾选用户协议",
|
let data;
|
||||||
duration: 2000
|
if (this.activeid == 1) {
|
||||||
})
|
//验证码
|
||||||
},
|
data = {
|
||||||
getPhone(e) {
|
phone: this.tel,
|
||||||
console.log('执行了');
|
code: this.yzm,
|
||||||
if (this.privacyPolicyChecked == false) {
|
type: 1,
|
||||||
uni.showToast({
|
sysCode:this.sysCode
|
||||||
icon: "none",
|
}
|
||||||
title: "请阅读并勾选用户协议",
|
} else {
|
||||||
duration: 2000
|
//密码登录
|
||||||
})
|
data = {
|
||||||
return;
|
username: this.tel,
|
||||||
}
|
password: this.wrod,
|
||||||
uni.checkSession({
|
type: 0,
|
||||||
success: () => {
|
sysCode:this.sysCode
|
||||||
uni.request({
|
}
|
||||||
url: this.baseUrl + "/userClient/repair/wxLogin",
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
code: uni.getStorageSync('c1'),
|
|
||||||
encryptedIv: e.detail.iv,
|
|
||||||
encryptedData: e.detail.encryptedData,
|
|
||||||
inviteId: uni.getStorageSync('inviteId') ? uni.getStorageSync('inviteId') : null
|
|
||||||
},
|
|
||||||
success: (rex) => {
|
|
||||||
if (rex.data.code == 0) {
|
|
||||||
//设置token
|
|
||||||
setToken(rex.data.data.token)
|
|
||||||
if (rex.data.data.ifNeedFill) {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/my/register'
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages-home/home/home'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '登录失败,请联系管理人员'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (res) => {
|
|
||||||
console.log("fail", res);
|
|
||||||
uni.showToast({
|
|
||||||
icon: "error",
|
|
||||||
title: "登录失败,请重新点击并授权!",
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'error',
|
|
||||||
duration: 2000,
|
|
||||||
title: "登录状态过期,重新登录"
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})
|
request({
|
||||||
},
|
url: '/app-api/company/staff/loginApp',
|
||||||
userinfo(){
|
method: 'post',
|
||||||
console.log('执行了');
|
data: data
|
||||||
request({
|
}).then((res) => {
|
||||||
url: '/getAppInfo',
|
console.log(res)
|
||||||
method: 'get',
|
if (res.code == 200) {
|
||||||
|
uni.showToast({
|
||||||
}).then((res)=>{
|
title: '登录成功',
|
||||||
let userJson = {}
|
icon: 'none'
|
||||||
userJson.userId = res.user.userId
|
})
|
||||||
console.log('身份信息',res,res.role.length);
|
setToken(res.data.loginResult.accessToken)
|
||||||
uni.setStorageSync('role',res.role)
|
setUserInfo(res.data.userinfo)
|
||||||
uni.setStorageSync('userinfo',res.user)
|
//跳转首页
|
||||||
if(!res.role||res.role.length==0){
|
uni.navigateTo({
|
||||||
this.show = true
|
url: '/pages-home/home/home'
|
||||||
}else{
|
})
|
||||||
uni.reLaunch({
|
}else{
|
||||||
url: '/pages/detection/my'
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//查所有可选租户
|
||||||
|
getTenantIdByPhone(this.tel).then(res => {
|
||||||
|
if (res.code === 200 && res.data && res.data.length > 0) {
|
||||||
|
uni.showActionSheet({
|
||||||
|
itemList: res.data.map(m => m.name),
|
||||||
|
success: ({
|
||||||
|
tapIndex
|
||||||
|
}) => {
|
||||||
|
setTenantId(res.data[tapIndex].id)
|
||||||
|
loginFun()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
//没有可选租户
|
||||||
|
uni.showToast({
|
||||||
|
title: '抱歉,您没有权限登录!',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getxz(index){
|
getxz(index) {
|
||||||
this.activeid = index
|
this.activeid = index
|
||||||
},
|
},
|
||||||
goregister(){
|
goregister() {
|
||||||
uni.redirectTo({
|
uni.navigateTo({
|
||||||
url:'/pages/login/register'
|
url: '/pages/login/register'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goforgot(){
|
goforgot() {
|
||||||
uni.redirectTo({
|
uni.navigateTo({
|
||||||
url:'/pages/login/forgot'
|
url: '/pages/login/forgot'
|
||||||
})
|
|
||||||
},
|
|
||||||
goselect(){
|
|
||||||
console.log('执行');
|
|
||||||
uni.redirectTo({
|
|
||||||
url:'/pages/index/index'
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 验证码方法
|
// 验证码方法
|
||||||
@ -249,151 +211,92 @@
|
|||||||
this.tel = '';
|
this.tel = '';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.isButtonDisabled) {
|
if (this.isButtonDisabled) {
|
||||||
return; // 如果按钮已禁用,则直接返回
|
return; // 如果按钮已禁用,则直接返回
|
||||||
}
|
}
|
||||||
const data = {
|
const data = {
|
||||||
phone:this.tel,
|
phone: this.tel,
|
||||||
}
|
sysCode:this.sysCode,
|
||||||
request({
|
}
|
||||||
url: '/loginSmsCode',
|
request({
|
||||||
method: 'post',
|
url: '/app-api/company/staff/loginSmsCode',
|
||||||
params: data
|
method: 'post',
|
||||||
}).then((res)=>{
|
params: data
|
||||||
console.log('验证码',res);
|
}).then((res) => {
|
||||||
if(res.code == 200){
|
console.log('验证码', res);
|
||||||
uni.showToast({
|
if (res.code == 200) {
|
||||||
title:'验证码已发送 请注意查收',
|
this.disableButton(); // 禁用按钮
|
||||||
icon:'none'
|
this.startCountdown(); // 启动倒计时
|
||||||
})
|
uni.showToast({
|
||||||
}else{
|
title: '验证码已发送 请注意查收',
|
||||||
uni.showToast({
|
icon: 'none'
|
||||||
title:'网络不佳请稍后再试',
|
|
||||||
icon:'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
this.disableButton(); // 禁用按钮
|
title: '网络不佳请稍后再试',
|
||||||
this.startCountdown(); // 启动倒计时
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
disableButton() {
|
disableButton() {
|
||||||
this.isButtonDisabled = true;
|
this.isButtonDisabled = true;
|
||||||
},
|
},
|
||||||
enableButton() {
|
enableButton() {
|
||||||
this.isButtonDisabled = false;
|
this.isButtonDisabled = false;
|
||||||
},
|
},
|
||||||
startCountdown() {
|
startCountdown() {
|
||||||
let countdown = setInterval(() => {
|
let countdown = setInterval(() => {
|
||||||
this.countdownTime--;
|
this.countdownTime--;
|
||||||
if (this.countdownTime === 0) {
|
if (this.countdownTime === 0) {
|
||||||
clearInterval(countdown);
|
clearInterval(countdown);
|
||||||
this.enableButton(); // 启用按钮
|
this.enableButton(); // 启用按钮
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.jsq{
|
.jsq {
|
||||||
border: none !important;
|
border: none !important;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #0078FF;
|
color: #0078FF;
|
||||||
}
|
}
|
||||||
.anniu{
|
|
||||||
width: 150px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 50px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
color: white;
|
|
||||||
background: #0D2E8D;
|
|
||||||
color: #FFFFFF;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
.cont-popup{
|
|
||||||
height: 250px;
|
|
||||||
width: 300px;
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 15px;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
.popup-title{
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #0D2E8D;
|
|
||||||
}
|
|
||||||
.dix{
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: 20px 0px;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.lqiu{
|
|
||||||
width: 15px;
|
|
||||||
height: 15px;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: 1px solid #0D2E8D;
|
|
||||||
background: #0D2E8D;
|
|
||||||
color: white;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.qiu{
|
|
||||||
width: 15px;
|
|
||||||
height: 15px;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: 1px solid #E8E8E8;
|
|
||||||
}
|
|
||||||
button {
|
button {
|
||||||
border: none !important;
|
border: none !important;
|
||||||
background: none !important;
|
background: none !important;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:focus {
|
button:focus {
|
||||||
color: #0078FF;
|
color: #0078FF;
|
||||||
outline: none;
|
outline: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
.content{
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding-top: 1px;
|
|
||||||
background-image: url('http://www.nuoyunr.com/lananRsc/jdc-bj.png');
|
|
||||||
|
|
||||||
background-size: cover;
|
.content {
|
||||||
width: 100%;
|
box-sizing: border-box;
|
||||||
height: calc(100vh);
|
|
||||||
}
|
}
|
||||||
.top{
|
|
||||||
|
.top {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0px 27px;
|
padding: 0px 27px;
|
||||||
padding-top: 100px;
|
padding-top: 100px;
|
||||||
|
background-image: url('../../static/loginbj.png');
|
||||||
|
|
||||||
// background-color:lightseagreen;
|
// background-color:lightseagreen;
|
||||||
|
// background-image: url('../../static/loginbj.png');
|
||||||
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
// height: 385px;
|
// height: 385px;
|
||||||
}
|
}
|
||||||
.touxiang{
|
|
||||||
|
.touxiang {
|
||||||
width: 88px;
|
width: 88px;
|
||||||
height: 88px;
|
height: 88px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
@ -401,16 +304,19 @@
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
image{
|
|
||||||
|
image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.twotap{
|
|
||||||
|
.twotap {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
view{
|
|
||||||
|
view {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-family: Microsoft YaHei;
|
font-family: Microsoft YaHei;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@ -418,19 +324,22 @@
|
|||||||
margin-right: 38.5px;
|
margin-right: 38.5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.blck{
|
|
||||||
|
.blck {
|
||||||
color: #333333 !important;
|
color: #333333 !important;
|
||||||
font-weight: bold !important;
|
font-weight: bold !important;
|
||||||
}
|
}
|
||||||
.inputs{
|
|
||||||
|
.inputs {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 16px 0px;
|
padding: 16px 0px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-bottom: 2px solid #E8E8E8 ;
|
border-bottom: 2px solid #E8E8E8;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
.wjworb{
|
|
||||||
|
.wjworb {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -440,28 +349,22 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
}
|
}
|
||||||
.dl{
|
|
||||||
|
.dl {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
background-color: #0D2E8D;
|
background: linear-gradient(-46deg, #0853C4 0%, #4282D8 80%);
|
||||||
border-radius: 50px;
|
border-radius: 5px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 300px;
|
margin-top: 22px;
|
||||||
}
|
}
|
||||||
.xiaoannoi{
|
|
||||||
width: 90%;
|
.hging {
|
||||||
height: 40px;
|
|
||||||
margin: 0 auto;
|
|
||||||
border-radius: 50px;
|
|
||||||
overflow: hidden;
|
|
||||||
margin-top: 300px;
|
|
||||||
}
|
|
||||||
.hging{
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@ -469,26 +372,30 @@
|
|||||||
color: #636363;
|
color: #636363;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
.wx{
|
|
||||||
|
.wx {
|
||||||
width: 38px;
|
width: 38px;
|
||||||
height: 38px;
|
height: 38px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin: 0px auto;
|
margin: 0px auto;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
image{
|
|
||||||
|
image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.hui{
|
|
||||||
|
.hui {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
}
|
}
|
||||||
.dbottom{
|
|
||||||
|
.dbottom {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
@ -497,38 +404,73 @@
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 25px;
|
bottom: 25px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quanzi {
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
border: 1px solid #666666;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lanquanzi {
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
border: 1px solid #0078FF;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 10px;
|
||||||
|
background: #0078FF;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lan {
|
||||||
|
color: #0078FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jiuzhong {
|
||||||
|
width: 90%;
|
||||||
|
margin: 10px auto;
|
||||||
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lan{
|
.dist {
|
||||||
color: #0D2E8D;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 0px 10px;
|
||||||
}
|
}
|
||||||
.land{
|
|
||||||
|
|
||||||
font-size: 25px;
|
.d-zi {
|
||||||
font-weight: bold;
|
font-size: 14px;
|
||||||
color: #0D2E8D;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
}
|
||||||
.kuang{
|
|
||||||
width: 90%;
|
.d-qian {
|
||||||
margin: 0 auto;
|
width: 14px;
|
||||||
margin-top: 100px;
|
height: 14px;
|
||||||
}
|
|
||||||
.axquan{
|
|
||||||
width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: 1px solid #AAAAAA;
|
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
overflow: hidden;
|
||||||
.axquanl{
|
|
||||||
width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 1px solid #AAAAAA;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border: 1px solid #666666;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d-qian-lan {
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
background-color: #0D2E8D;
|
overflow: hidden;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: #0078FF;
|
||||||
|
border: 1px solid #0078FF;
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -17,12 +17,20 @@
|
|||||||
<text class="formValue">{{ customInfo.name }}</text>
|
<text class="formValue">{{ customInfo.name }}</text>
|
||||||
<u-icon color="#999" name="arrow-right" size="12"></u-icon>
|
<u-icon color="#999" name="arrow-right" size="12"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view style="padding-bottom: 60rpx;border-bottom: 1px solid #ddd" class="formItem">
|
<view class="formItem">
|
||||||
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
|
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
|
||||||
<text class="formLabel">绑定电话</text>
|
<text class="formLabel">绑定电话</text>
|
||||||
<text class="formValue">{{ customInfo.phone }}</text>
|
<text class="formValue">{{ customInfo.phone }}</text>
|
||||||
<u-icon color="#999" name="arrow-right" size="12"></u-icon>
|
<u-icon color="#999" name="arrow-right" size="12"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="formItem">
|
||||||
|
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
|
||||||
|
<text class="formLabel">我的邀请码</text>
|
||||||
|
<text class="formValue"></text>
|
||||||
|
</view>
|
||||||
|
<view style="padding-bottom: 60rpx;border-bottom: 1px solid #ddd;" class="formItem">
|
||||||
|
<image style="width: 200px; height: 200px;margin: auto" class="formIcon" mode="scaleToFill" src="@/pages-home/static/yaoqingma.png"></image>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="btn">
|
<view class="btn">
|
||||||
退出登录
|
退出登录
|
||||||
|
@ -32,9 +32,13 @@ export function hasRole(roleCode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getUserInfo() {
|
export function getUserInfo() {
|
||||||
return uni.getStorageSync(UserInfo)
|
if(uni.getStorageSync(UserInfo)){
|
||||||
|
return JSON.parse(uni.getStorageSync(UserInfo))
|
||||||
|
}else{
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setUserInfo(userInfo) {
|
export function setUserInfo(dataObj) {
|
||||||
return uni.setStorageSync(UserInfo, userInfo)
|
return uni.setStorageSync(UserInfo, JSON.stringify(dataObj))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user