4b268e3f by 华明祺

登录

1 parent 9e55c13c
<script>
import {
h5Login
getInfo
} from '@/common/login.js';
import * as api from '@/common/api.js';
import config from '@/config.js';
......@@ -13,16 +13,14 @@ export default {
firstload = true
this.globalData.baseUrl_api = config.baseUrl_api;
let userName = uni.getStorageSync('userName')
if (userName) {
this.globalData.isLogin = true;
} else {
this.globalData.isLogin = false;
}
let userName = uni.getStorageSync('userName')
if (userName) {
this.globalData.isLogin = true;
getInfo()
} else {
this.globalData.isLogin = false;
}
},
onShow: function() {
console.log('App Show');
......
import request from './request'
import request from './request'
import config from '@/config.js'
import aes from '@/common/aes.js'
function pcLogin(data) {
return request({
// url: '/login',
// url: '/login',
url: `${config.baseUrl_api}/loginZtx`,
method: 'post',
headers: {
isToken: false
},
method: 'post',
headers: {
isToken: false
},
params: data
}).then((res) => {
uni.setStorageSync('token', 'Bearer ' + res.data.token)
})
.then(getInfo)
uni.setStorageSync('token', 'Bearer ' + res.data.token)
})
.then(getInfo)
}
function bindIdcCode(idcCode) {
return request({
url: `${config.baseUrl_api}/bind?idcCode=${idcCode}`,
method: 'post'
})
}
function h5Login(userName) {
......@@ -36,6 +44,7 @@ function h5LoginAuto() {
uni.redirectTo({
url: '/pages/index/login'
})
return Promise.reject()
}
}
......@@ -71,7 +80,7 @@ function loginByPhone(phonenumber, code) {
code
}
return request({
url: '/userLoginByPhone',
url: `${config.baseUrl_api}/userLoginByPhoneForPc`,
method: 'post',
params: data
}).then((res) => {
......@@ -82,15 +91,13 @@ function loginByPhone(phonenumber, code) {
// 获取用户详细信息
function getInfo() {
return request({
url: `${config.baseUrl_api}/getInfo`,
url: `${config.baseUrl_api}/getInfoForPc`,
method: 'get'
}).then(res => {
const app = getApp()
const user = res.data.user
const personInfo = res.data.personInfo
uni.setStorageSync('userName', user.userName)
uni.setStorageSync('perId', aes.encrypt(personInfo.perId))
app.globalData.deptType = user.dept.deptType
const user = res.data.user
uni.setStorageSync('userName', user.userName)
uni.setStorageSync('perId', aes.encrypt(user.userId))
app.globalData.userInfo = user
})
}
......@@ -114,54 +121,65 @@ function getMyOwnMemberInfo() {
app.globalData.memberInfo = res.data.memberInfo
app.globalData.isExam = res.data?.dept?.isExam
})
}
//for match
}
// for match
function getWxUserPhone(phoneRes) {
const currUser = uni.getStorageSync('currUser');
// getNowOpenId()
const nowOpenId = uni.getStorageSync('nowOpenId');
return request({
url: `/system/wx/updateMobile?openId=${nowOpenId}`,
method: "POST",
params: {
appId: appId,
userId: currUser.id,
encryptedData: phoneRes.encryptedData,
errMsg: phoneRes.errMsg,
iv: phoneRes.iv,
rawData: phoneRes.rawData,
signature: phoneRes.signature
}
}).then((res) => {
let user = res.data;
// uni.setStorageSync('token', 'Bearer '+ user.token);
uni.setStorageSync('token', user.token);
uni.setStorageSync('currUser', user);
return user
})
}
const currUser = uni.getStorageSync('currUser')
// getNowOpenId()
const nowOpenId = uni.getStorageSync('nowOpenId')
return request({
url: `/system/wx/updateMobile?openId=${nowOpenId}`,
method: 'POST',
params: {
appId: appId,
userId: currUser.id,
encryptedData: phoneRes.encryptedData,
errMsg: phoneRes.errMsg,
iv: phoneRes.iv,
rawData: phoneRes.rawData,
signature: phoneRes.signature
}
}).then((res) => {
const user = res.data
// uni.setStorageSync('token', 'Bearer '+ user.token);
uni.setStorageSync('token', user.token)
uni.setStorageSync('currUser', user)
return user
})
}
function checkUserAuth(path) {
const app = getApp()
if (app.globalData.isLogin) {
return true
} else {
uni.navigateTo({
url: '/pages/index/binding?path=' + encodeURIComponent(path)
})
return false;
}
}
const app = getApp()
if (app.globalData.isLogin) {
if (app.globalData.userInfo.perId) {
return true
} else {
uni.navigateTo({
url: '/myCenter/personInfo/index?path=' + encodeURIComponent(path)
})
return false
}
} else {
uni.navigateTo({
url: '/pages/index/login?path=' + encodeURIComponent(path)
})
return false
}
}
export {
pcLogin,getInfo,
pcLogin,
getInfo,
getCodeImg,
getSmsCode,
h5Login,
h5LoginAuto,
loginByPhone,
groupMemberRegister,
getMyOwnMemberInfo,
logout,
getWxUserPhone,checkUserAuth
getMyOwnMemberInfo,
logout,
getWxUserPhone,
checkUserAuth,
bindIdcCode
}
......
......@@ -8,9 +8,9 @@
// const baseUrl_api = 'https://newsystem.taekwondo.org.cn/stage-api/'
// train
const baseUrl_api = 'http://192.168.1.11:8787'
const trainUrl_api = 'http://192.168.1.25:8686'
//match
const baseUrl_api = 'http://192.168.1.98:8787'
const trainUrl_api = 'http://192.168.1.98:8686'
// match
// const baseUrl_api = 'http://192.168.1.132:8081'
export default {
baseUrl_api,
......
<template>
<view class="box">
<view class="topBg">
<view class="userInfoBox">
<view class="headImg">
<image mode="aspectFill" :src="avatarUrl"></image>
</view>
<view class="nameBox">
{{ user.nickName }}
<view>{{ user.phonenumber }}</view>
</view>
</view>
</view>
<view class="rMainBox">
<uni-list :border="false" class="myList">
<!-- <uni-list-item :border="false" title="个人信息" showArrow :to="`./myInfo`">
<view class="box">
<view class="topBg">
<view class="userInfoBox">
<view class="headImg">
<image mode="aspectFill" :src="avatarUrl"></image>
</view>
<view class="nameBox">
{{ user.nickName }}
<view>{{ user.phonenumber }}</view>
</view>
</view>
</view>
<view class="rMainBox">
<uni-list :border="false" class="myList">
<!-- <uni-list-item :border="false" title="个人信息" showArrow :to="`./myInfo`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon03.png" mode="widthFix"></image>
......@@ -43,25 +43,25 @@
</template>
</uni-list-item> -->
<uni-list-item :border="false" title="我的培训" showArrow clickable @click="goPath('/myCenter/mytrain/mytrain')">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<uni-list-item :border="false" title="我的培训" showArrow clickable @click="goPath('/myCenter/mytrain/mytrain')">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<!-- <uni-list-item :border="false" title="我的赛事" showArrow :to="`./match`">
<!-- <uni-list-item :border="false" title="我的赛事" showArrow :to="`./match`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon04.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item> -->
</uni-list>
</view>
</uni-list>
</view>
</view>
</view>
</template>
<script setup>
......@@ -74,29 +74,29 @@ const user = ref({});
const app = getApp();
onShow(() => {
if (app.globalData.isLogin) {
init();
} else {
app.firstLoadCallback = () => {
init();
};
}
if (app.globalData.isLogin) {
init();
} else {
app.firstLoadCallback = () => {
init();
};
}
});
function init() {
console.log(app.globalData.isLogin)
if(app.globalData.userInfo){
const currUser = app.globalData.userInfo
user.value = currUser;
} else {
loginServer.getInfo().then(res=>{
const currUser = app.globalData.userInfo
user.value = currUser
})
}
console.log(app.globalData.isLogin)
if(app.globalData.userInfo){
const currUser = app.globalData.userInfo
user.value = currUser;
} else {
loginServer.getInfo().then(res=>{
const currUser = app.globalData.userInfo
user.value = currUser
})
}
}
function goBack() {
uni.navigateBack({});
uni.navigateBack({});
}
// function goQcode() {
// uni.scanCode({
......@@ -121,18 +121,18 @@ function goBack() {
// });
// }
function building() {
uni.showToast({
title: '暂未开放,敬请期待。',
icon: 'none',
duration: 2000
});
uni.showToast({
title: '暂未开放,敬请期待。',
icon: 'none',
duration: 2000
});
}
function goPath(path) {
if(path)
uni.navigateTo({
url: path
});
}
function goPath(path) {
if(path)
uni.navigateTo({
url: path
});
}
</script>
<style scoped lang="scss">
......
<template>
<view class="bg">
<view class="formbox" v-if="form.perId">
身份证号:{{form.idcCode}}
</view>
<view class="formbox" v-else>
<view>
<view class="round-input-item">
<uni-easyinput :styles="inputstyle" placeholder="身份证" v-model="form.idcCode" />
</view>
</view>
<view class="flex-item">
</view>
<view class="center-item">
<button @click="handleBind" class="btn-red">绑定个人会员</button>
</view>
</view>
</view>
</template>
<script setup>
import {
ref
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
import config from '@/config.js'
import {
bindIdcCode
} from '@/common/login.js'
const app=getApp()
const form = ref({})
let path = '/pages/myCenter/index';
onLoad((option) => {
if (option.path) {
path = decodeURIComponent(option.path)
}
form.value=app.globalData.userInfo
})
function handleBind() {
if (!form.value.idcCode) {
uni.showToast({
title: '身份证号不能为空',
icon: 'none'
})
return
}
bindIdcCode(form.value.idcCode)
.then((res) => {
uni.redirectTo({
url: path
})
})
}
</script>
<style scoped lang="scss">
.bg{background: linear-gradient(60deg,#ad1820 50%,#044a9f 50%);padding: 1px;height: 100vh;overflow: hidden;}
.formbox {
background: #fff;
width: 700rpx;
padding: 50rpx;box-sizing: border-box;
margin: auto;
border-radius: 20rpx;
}
.logoView {
/* margin: 20vh 0; */
}
.logo {
width: 420rpx;
height: 179rpx;
margin: 60rpx auto 60rpx;
display: block;
}
.h1 {
font-size: 36rpx;
color: #000000;
text-align: center;
}
.start {
margin: 0 auto 80rpx;
font-size: 30rpx;
color: #fff;
height: 80rpx;
width: 480rpx;
border-radius: 40rpx;
background: #44A92F;
}
.agreeArea {
text-align: center;
}
.agreeArea label {
font-size: 26rpx;
}
.agreeArea label text {
color: #00C176;
}
.tip {
margin: 30rpx 0 0;
font-size: 20rpx;
color: #181818;
}
.h3 {}
.round-input-item {
overflow: hidden;
background: RGBA(247, 247, 248, 1);
border-radius: 40rpx;
padding: 0 0 0 30rpx;
height: 80rpx;
margin-bottom: 30rpx;
display: flex;
align-items: center;
image {
width: 180rpx;
height: 80rpx;
&.icon {
width: 30rpx;
height: 30rpx;
margin-right: 16rpx;
}
}
input {
border-left: 1rpx solid RGBA(214, 216, 219, 1);
padding: 0 0 0 20rpx;
font-size: 30rpx;
}
input::-webkit-input-placeholder {
color: RGBA(158, 166, 174, 1);
font-size: 30rpx;
}
input::placeholder {
color: RGBA(158, 166, 174, 1);
font-size: 30rpx;
}
input::-moz-placeholder {
color: RGBA(158, 166, 174, 1);
font-size: 30rpx;
}
text {
font-size: 28rpx;
color: #014A9F; padding: 0 20rpx;
}
}
</style>
\ No newline at end of file
......@@ -33,7 +33,7 @@
}
},
{
"path": "pages/myCenter/myCenter",
"path": "pages/myCenter/index",
"style": {
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false
......@@ -209,6 +209,13 @@
"navigationBarTitleText": "个人中心",
"enablePullDownRefresh": false
}
},
{
"path": "personInfo/index",
"style": {
"navigationBarTitleText": "个人会员信息",
"enablePullDownRefresh": false
}
},
{
"path": "mytrain/mytrain",
......@@ -263,7 +270,7 @@
"pagePath": "pages/webView/auth",
"text": "认证查询"
}, {
"pagePath": "pages/myCenter/myCenter",
"pagePath": "pages/myCenter/index",
"text": "我的"
}]
}
......
<template>
<view class="bg">
<view class="logoView">
<image class="logo" :src="config.baseUrl_api+'/fs/static/login/logo@2x.png'"></image>
</view>
<!-- 获取手机号 -->
<!-- <button class="start" type="default" :disabled="!agree" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">微信账号快捷登录</button> -->
<view>
<!-- 密码登录 -->
<view class="formbox">
<view>
<view class="round-input-item">
<image class="icon" :src="config.baseUrl_api+'/fs/static/login/tag01@2x.png'"></image>
<uni-easyinput :styles="inputstyle" placeholder="会员号" v-model="form.username" />
</view>
<view class="round-input-item">
<image class="icon" :src="config.baseUrl_api+'/fs/static/login/tag02@2x.png'"></image>
<uni-easyinput :styles="inputstyle" placeholder="密码" v-model="form.password" type="password" />
</view>
<view class="round-input-item">
<image class="icon" :src="config.baseUrl_api+'/fs/static/login/tag03@2x.png'"></image>
<uni-easyinput :styles="inputstyle" placeholder="图形验证码" v-model="form.code" />
<image :src="codeUrl" @click="getCode" />
</view>
</view>
<view class="flex-item">
</view>
<view class="center-item">
<button @click="handleLogin" class="btn-red">绑定账号</button>
</view>
<view class="bg">
<view class="logoView">
<image class="logo" :src="config.baseUrl_api+'/fs/static/login/logo@2x.png'"></image>
</view>
<!-- 获取手机号 -->
<!-- <button class="start" type="default" :disabled="!agree" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">微信账号快捷登录</button> -->
<view>
<!-- 密码登录 -->
<view class="formbox">
<view>
<view class="round-input-item">
<image class="icon" :src="config.baseUrl_api+'/fs/static/login/tag01@2x.png'"></image>
<uni-easyinput :styles="inputstyle" placeholder="会员号" v-model="form.username" />
</view>
<view class="round-input-item">
<image class="icon" :src="config.baseUrl_api+'/fs/static/login/tag02@2x.png'"></image>
<uni-easyinput :styles="inputstyle" placeholder="密码" v-model="form.password" type="password" />
</view>
<view class="round-input-item">
<image class="icon" :src="config.baseUrl_api+'/fs/static/login/tag03@2x.png'"></image>
<uni-easyinput :styles="inputstyle" placeholder="图形验证码" v-model="form.code" />
<image :src="codeUrl" @click="getCode" />
</view>
</view>
<view class="flex-item">
</view>
<view class="center-item">
<button @click="handleLogin" class="btn-red">绑定账号</button>
</view>
<view class="tip">*会员号+证件号后四位+ )*%</view>
</view>
<view class="tip">*会员号+证件号后四位+ )*%</view>
</view>
</view>
</view>
<view class="agreeArea">
<!-- <checkbox-group @change='radioChange'>
<view class="agreeArea">
<!-- <checkbox-group @change='radioChange'>
<label>
<checkbox value="r1" :checked="agree" />请您确认同意<text @click="showAgreement">《隐私保护声明》</text>
</label>
</checkbox-group> -->
</view>
<!-- 隐私保护声明 -->
<uni-popup ref="popup" v-if="showAgree" background-color="#fff">
<view class="popup-content">
本应用严格遵守法律法规,为用户提供安全、可靠的服务。若您对于我们感兴趣,希望咨询、预约、申请使用我们的服务,我们需要收集、使用您的个人信息以便为您安排专人提供服务。本公司非常重视用户(以下或简称“您”)的隐私和个人信息安全,希望您仔细阅读《隐私保护声明》(以下简称“本声明”),详细了解我们对信息的收集、使用方式,以便您更好地了解我们的服务并做出适当的选择。
</view>
<!-- 隐私保护声明 -->
<uni-popup ref="popup" v-if="showAgree" background-color="#fff">
<view class="popup-content">
本应用严格遵守法律法规,为用户提供安全、可靠的服务。若您对于我们感兴趣,希望咨询、预约、申请使用我们的服务,我们需要收集、使用您的个人信息以便为您安排专人提供服务。本公司非常重视用户(以下或简称“您”)的隐私和个人信息安全,希望您仔细阅读《隐私保护声明》(以下简称“本声明”),详细了解我们对信息的收集、使用方式,以便您更好地了解我们的服务并做出适当的选择。
一、您提供的个人信息
1、在注册帐户时填写或上传的信息
一、您提供的个人信息
1、在注册帐户时填写或上传的信息
例如,您在参与问卷时所填写的姓名、所在地、行业、手机号码等。
例如,您在参与问卷时所填写的姓名、所在地、行业、手机号码等。
2、在奖励兑换时填写或上传的信息
2、在奖励兑换时填写或上传的信息
例如,您在奖励兑换时所填写的姓名、所在地、手机号码等。
例如,您在奖励兑换时所填写的姓名、所在地、手机号码等。
我们为您的信息提供相应的安全保障,以防止信息的丢失、不当使用、未经授权访问或披露。
我们为您的信息提供相应的安全保障,以防止信息的丢失、不当使用、未经授权访问或披露。
二、我们如何使用您的个人信息
根据您留下的信息,我们后续会自行或委托合作方与您取得联系,向您介绍我们的服务。
二、我们如何使用您的个人信息
根据您留下的信息,我们后续会自行或委托合作方与您取得联系,向您介绍我们的服务。
我们可能会向您发送推广信息,如您不希望继续接收推广可选择退订。
我们可能会向您发送推广信息,如您不希望继续接收推广可选择退订。
三、您享有的权利
1、我们保障您撤回个人信息使用的同意的权利;
三、您享有的权利
1、我们保障您撤回个人信息使用的同意的权利;
2、我们保障您复制、查阅本人个人信息的权利。
2、我们保障您复制、查阅本人个人信息的权利。
若您需要行使上述权利,您可通过本声明列明的联系方式与我们联系,在您请求撤回同意或者复制、查阅本人个人信息时,我们可能会要求您进行身份验证,以保障信息安全。
若您需要行使上述权利,您可通过本声明列明的联系方式与我们联系,在您请求撤回同意或者复制、查阅本人个人信息时,我们可能会要求您进行身份验证,以保障信息安全。
请您理解,由于技术所限或法律监管要求,我们可能无法完全满足您的要求。我们将尽快处理所涉问题,并在通过验证您的用户身份后的十五天内予以回复。
请您理解,由于技术所限或法律监管要求,我们可能无法完全满足您的要求。我们将尽快处理所涉问题,并在通过验证您的用户身份后的十五天内予以回复。
四、变更
我们可能适时修订本声明内容。
四、变更
我们可能适时修订本声明内容。
我们将在内容更新时,通过在页面显著位置提示、公告或直接与您联系等方式通知您,如果您继续使用本服务,即视为您已接受修改后的相关内容;如果您不接受修改后的相关内容,您可以联系我们或者通过信息退订等方式选择停止使用服务。
我们将在内容更新时,通过在页面显著位置提示、公告或直接与您联系等方式通知您,如果您继续使用本服务,即视为您已接受修改后的相关内容;如果您不接受修改后的相关内容,您可以联系我们或者通过信息退订等方式选择停止使用服务。
五、联系我们
如您对本声明或个人信息相关事宜有疑问,可以通过公众号与我们取得联系。
</view>
</uni-popup>
</view>
五、联系我们
如您对本声明或个人信息相关事宜有疑问,可以通过公众号与我们取得联系。
</view>
</uni-popup>
</view>
</template>
<script setup>
import {
ref
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
import config from '@/config.js'
import {
pcLogin,
getWxUserPhone,
getCodeImg,
getSmsCode,
loginByPhone
} from '@/common/login.js'
const popup = ref(null)
const agree = ref(true)
const loading = ref(false)
const showAgree = ref(false)
const form = ref({})
const codeUrl = ref('')
const inputstyle = ref({
borderColor: 'transparent',
fontSize: '30rpx'
})
import {
ref
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
import config from '@/config.js'
import {
pcLogin,
getWxUserPhone,
getCodeImg,
getSmsCode,
loginByPhone
} from '@/common/login.js'
const popup = ref(null)
const agree = ref(true)
const loading = ref(false)
const showAgree = ref(false)
const form = ref({})
const codeUrl = ref('')
const inputstyle = ref({
borderColor: 'transparent',
fontSize: '30rpx'
})
const app = getApp()
let path = '/pages/index/index';
onLoad((option) => {
if (option.path) {
path = decodeURIComponent(option.path)
}
getCode()
})
function radioChange() {
popup.value.open()
agree.value = true
}
function decryptPhoneNumber(res) {
// console.log(res)
loading.value = true
if (res.detail.errMsg.indexOf('ok') > -1) {
getWxUserPhone(res.detail).then((data) => {
// console.log(data)
uni.redirectTo({
url: path
})
}).finally(() => {
loading.value = false
});
} else {
loading.value = false
}
}
function subscribe() {
uni.requestSubscribeMessage({
tmplIds: ['pvrlpWl1MDJfOghILwUsQtfcg96LWdstVOFLrDxGcdM'],
success: (res) => {
console.log('success:', res)
}
})
}
function showAgreement() {
popup.value.open()
}
function getCode() {
getCodeImg().then((res) => {
codeUrl.value = 'data:image/gif;base64,' + res.data.img
form.value.uuid = res.data.uuid
})
}
function handleLogin() {
if (!form.value.username) {
uni.showToast({
title: '账号不能为空',
icon: 'none'
})
return
}
if (!form.value.password) {
uni.showToast({
title: '密码不能为空',
icon: 'none'
})
return
}
if (!form.value.code) {
uni.showToast({
title: '验证码不能为空',
icon: 'none'
})
return
}
pcLogin(form.value)
.then((res) => {
app.globalData.isLogin = true
uni.redirectTo({
url: path
})
})
}
let path = '/pages/index/index';
onLoad((option) => {
if (option.path) {
path = decodeURIComponent(option.path)
}
getCode()
})
function radioChange() {
popup.value.open()
agree.value = true
}
function decryptPhoneNumber(res) {
// console.log(res)
loading.value = true
if (res.detail.errMsg.indexOf('ok') > -1) {
getWxUserPhone(res.detail).then((data) => {
// console.log(data)
uni.redirectTo({
url: path
})
}).finally(() => {
loading.value = false
});
} else {
loading.value = false
}
}
function subscribe() {
uni.requestSubscribeMessage({
tmplIds: ['pvrlpWl1MDJfOghILwUsQtfcg96LWdstVOFLrDxGcdM'],
success: (res) => {
console.log('success:', res)
}
})
}
function showAgreement() {
popup.value.open()
}
function getCode() {
getCodeImg().then((res) => {
codeUrl.value = 'data:image/gif;base64,' + res.data.img
form.value.uuid = res.data.uuid
})
}
function handleLogin() {
if (!form.value.username) {
uni.showToast({
title: '账号不能为空',
icon: 'none'
})
return
}
if (!form.value.password) {
uni.showToast({
title: '密码不能为空',
icon: 'none'
})
return
}
if (!form.value.code) {
uni.showToast({
title: '验证码不能为空',
icon: 'none'
})
return
}
pcLogin(form.value)
.then((res) => {
app.globalData.isLogin = true
uni.redirectTo({
url: path
})
})
}
</script>
<style scoped lang="scss">
......
<template>
<view class="page">
<swiper>
<swiper-item>1</swiper-item>
<swiper-item>2</swiper-item>
<swiper-item>3</swiper-item>
</swiper>
<view class="girdBox">
<view @click="goPath('/training/trainList')">
<image />新闻资讯
</view>
<view @click="goPath('/match/index')">
<image />赛事报名
</view>
<view class="page">
<swiper>
<swiper-item>1</swiper-item>
<swiper-item>2</swiper-item>
<swiper-item>3</swiper-item>
</swiper>
<view class="girdBox">
<view @click="goPath('/training/trainList')">
<image />新闻资讯
</view>
<view @click="goPath('/match/index')">
<image />赛事报名
</view>
<view @click="goPath('/training/trainList')">
<image />培训报名
</view>
<view @click="goPath()">
<image />团体会员
</view>
<view @click="goPath()">
<image />地方协会
</view>
<view @click="goPath()">
<image />考点查询
</view>
<view @click="goPath('/webView/vipSystem')">
<image />会员系统
</view>
<view @click="goPath('/myCenter/index')">
<image />我的
</view>
<view @click="goPath('/training/trainList')">
<image />培训报名
</view>
<view @click="goPath()">
<image />团体会员
</view>
<view @click="goPath()">
<image />地方协会
</view>
<view @click="goPath()">
<image />考点查询
</view>
<view @click="goPath('/webView/vipSystem')">
<image />会员系统
</view>
<view @click="goTab('/pages/myCenter/index')">
<image />我的
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import * as api from '@/common/api.js';
import * as loginServer from '@/common/login.js';
import config from '@/config.js'
import {
onLoad,
onShow,
onReady,
onPullDownRefresh
} from '@dcloudio/uni-app';
import {
ref,
getCurrentInstance
} from 'vue';
const {
proxy
} = getCurrentInstance()
const app = getApp();
const svId = ref(null);
const messageList = ref([])
onShow(() => {
if (app.globalData.isLogin) {
init()
} else {
app.firstLoadCallback = () => {
init()
};
}
})
onLoad(option => {
});
function goPath(path) {
if(path)
uni.navigateTo({
url: path
});
}
import * as api from '@/common/api.js';
import * as loginServer from '@/common/login.js';
import config from '@/config.js'
import {
onLoad,
onShow,
onReady,
onPullDownRefresh
} from '@dcloudio/uni-app';
import {
ref,
getCurrentInstance
} from 'vue';
const {
proxy
} = getCurrentInstance()
const app = getApp();
const svId = ref(null);
const messageList = ref([])
onShow(() => {
if (app.globalData.isLogin) {
init()
} else {
app.firstLoadCallback = () => {
init()
};
}
})
onLoad(option => {
});
function goPath(path) {
if(path)
uni.navigateTo({
url: path
});
}
function goTab(path){
uni.switchTab({
url: path
})
}
function init() {
uni.showLoading({
title: '加载中'
});
uni.hideLoading();
function init() {
uni.showLoading({
title: '加载中'
});
uni.hideLoading();
}
}
function goItem(item) {
if (item.path) {
let path = item.path
uni.navigateTo({
url: item.path
});
function goItem(item) {
if (item.path) {
let path = item.path
uni.navigateTo({
url: item.path
});
} else {
uni.showToast({
title: `暂未开放`,
icon: 'none'
});
}
}
} else {
uni.showToast({
title: `暂未开放`,
icon: 'none'
});
}
}
</script>
<style scope lang="scss">
.page{width: 100vw;overflow: hidden;}
......
......@@ -5,10 +5,10 @@
<view class="retop">
<image class="logotop" :src="config.baseUrl_api+'/fs/static/login/logo@2x.png'"></image>
<view class="loginbox">
<view class="loginNav">
<!-- <view class="loginNav">
<view class="n1" :class="isActive==0?'active':''" @click="changeActive(0)">密码登录</view>
<view class="n2" :class="isActive==1?'active':''" @click="changeActive(1)">短信登录</view>
</view>
</view> -->
<!-- 密码登录 -->
<view class="formbox">
<form v-if="isActive==0">
......@@ -55,9 +55,9 @@
<view class="center-item">
<button @click="login" class="btn-red">登录</button>
</view>
<view class="center-item">
<!--<view class="center-item">
<text class="text-red" @click="goRegister">没有账号,去注册</text>
</view>
</view> -->
</view>
......@@ -84,16 +84,19 @@ import {
getSmsCode,
pcLogin,
loginByPhone
} from '@/common/login.js'
} from '@/common/login.js'
import {
onLoad
} from '@dcloudio/uni-app'
const isActive = ref(0)
const isActive = ref(1)
const agree = ref(false)
const isRember = ref(true)
const codeUrl = ref(null)
const inputstyle = ref({
borderColor: 'transparent',
fontSize: '30rpx'
})
const inputstyle = ref({
borderColor: 'transparent',
fontSize: '30rpx'
})
const form = ref({
username: null,
password: null,
......@@ -109,11 +112,15 @@ const form2 = ref({
const countDown = ref({
start: false,
second: 60
})
})
const app = getApp()
onMounted(() => {
const switchTab=['/pages/index/index','/pages/webView/auth','/pages/myCenter/index']
let path = '/pages/index/index';
onLoad((option) => {
if (option.path) {
path = decodeURIComponent(option.path)
}
getCode()
})
......@@ -151,8 +158,7 @@ function login() {
}
pcLogin(form.value)
.then((res) => {
.then((res) => {
app.globalData.isLogin = true
uni.redirectTo({
url: '/pages/index/index'
......@@ -177,10 +183,22 @@ function login() {
loginByPhone(form2.value.telNo,form2.value.code)
.then(() => {
app.globalData.isLogin = true
uni.redirectTo({
url: '/pages/index/index'
})
app.globalData.isLogin = true
if(!app.globalData.userInfo.perId){
uni.redirectTo({
url: '/myCenter/personInfo/index?path=' + encodeURIComponent(path)
})
}else{
if(switchTab.indexOf(path)>-1){
uni.switchTab({
url: path
})
}else{
uni.redirectTo({
url: path
})
}
}
})
}
}
......
<template>
<view class="box">
<view class="topBg">
<view class="userInfoBox">
<view class="headImg">
<image mode="aspectFill" :src="avatarUrl"></image>
</view>
<view class="nameBox">
{{ user.nickName }}
<view>{{ user.phonenumber }}</view>
</view>
</view>
</view>
<view class="rMainBox">
<uni-list :border="false" class="myList">
<!-- <uni-list-item :border="false" title="个人信息" showArrow :to="`./myInfo`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon03.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<uni-list-item :border="false" title="参赛队信息" showArrow :to="`./teamList`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon06.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<uni-list-item :border="false" title="会员充值" showArrow :to="`./mycard/renew`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon01.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<uni-list-item :border="false" title="场地订单" showArrow :to="`./bills`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon02.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item> -->
<uni-list-item :border="false" title="我的培训" showArrow clickable @click="goPath('/myCenter/mytrain/mytrain')">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<!-- <uni-list-item :border="false" title="我的赛事" showArrow :to="`./match`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon04.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item> -->
</uni-list>
</view>
</view>
</template>
<script setup>
import * as my from '@/myCenter/center_api.js';
import * as loginServer from '@/common/login.js';
import { ref } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const user = ref({});
const app = getApp();
onShow(() => {
if (app.globalData.isLogin) {
init();
} else {
app.firstLoadCallback = () => {
init();
};
}
});
function init() {
console.log(app.globalData.isLogin)
if(app.globalData.userInfo){
const currUser = app.globalData.userInfo
user.value = currUser;
} else {
loginServer.getInfo().then(res=>{
const currUser = app.globalData.userInfo
user.value = currUser
})
}
}
function goBack() {
uni.navigateBack({});
}
// function goQcode() {
// uni.scanCode({
// onlyFromCamera: true,
// success: function(res) {
// console.log('条码类型:' + res.scanType);
// console.log('条码内容:' + res.result);
// api.scanQrCode(res.result).then(res => {
// uni.showModal({
// title: '提示',
// content: res.msg,
// success: function(res) {
// if (res.confirm) {
// console.log('确定');
// } else if (res.cancel) {
// console.log('取消');
// }
// }
// });
// });
// }
// });
// }
function building() {
uni.showToast({
title: '暂未开放,敬请期待。',
icon: 'none',
duration: 2000
});
}
function goPath(path) {
if(path)
uni.navigateTo({
url: path
});
}
</script>
<style scoped lang="scss">
.box {
width: 100vw;
overflow: hidden;
}
.rMainBox {
box-sizing: border-box;
padding: 20rpx 25rpx 0;
margin: 25rpx;
}
.userInfoBox {
height: 200rpx;
}
.nameBox {
position: absolute;
left: 180rpx;
top: 70rpx;
font-size: 30rpx;
}
.nameBox view {
color: #7b7f83;
font-size: 26rpx;
margin-top: 10rpx;
}
.goback {
position: absolute;
color: #fff;
top: 100rpx;
left: 35rpx;
}
.forAdmin {
padding: 25rpx;
box-sizing: border-box;
}
.topBg {
}
.onlyCardBottom {
position: relative;
width: 660rpx;
margin: auto;
height: 90rpx;
.bbg {
height: 90rpx;
width: 660rpx;
}
.cardBottom {
width: 660rpx;
background: transparent;
height: 90rpx;
text {
font-size: 28rpx;
color: #925921;
}
.renewBtn {
background: #874f02;
color: #fff;
}
}
}
.headImg {
border-radius: 50%;
position: relative;
top: 50rpx;
overflow: hidden;
width: 100rpx;
height: 100rpx;
border: 4px solid #ffffff;
background: #c4f9cb;
left: 40rpx;
button {
display: block;
padding: 0;
}
image {
width: 100rpx;
height: 100rpx;
display: block;
}
}
.slot-image {
width: 50rpx;
position: relative;
top: -8rpx;
height: 50rpx;
margin-right: 30rpx;
}
.myList {
}
.funcBar {
display: flex;
background: #fff;
width: 700rpx;
height: 140rpx;
justify-content: space-around;
}
.funcBar view {
display: flex;
align-items: center;
font-size: 36rpx;
}
.funcBar image {
width: 80rpx;
height: 80rpx;
}
.topbgimg {
width: 100vw;
position: absolute;
z-index: -1;
}
.reportItembox {
overflow: hidden;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.reportItem {
background: #fff;
border-radius: 15rpx;
width: 340rpx;
margin-top: 25rpx;
.t {
border-bottom: 1px solid #e5e5e5;
height: 70rpx;
line-height: 70rpx;
color: #2b3133;
font-size: 30rpx;
padding-left: 36rpx;
}
.rbody {
display: flex;
padding: 36rpx;
box-sizing: border-box;
view {
font-size: 26rpx;
color: #888;
width: 40%;
}
text {
color: #00c176;
font-weight: bold;
font-size: 36rpx;
display: block;
margin-bottom: 20rpx;
}
}
}
.changephonepop {
width: 100%;
}
.changephonepop view {
width: 100%;
margin: 0 0 30rpx;
}
.changephonepop view input {
width: 100%;
background: #f4f4f4;
font-size: 30rpx;
height: 80rpx;
padding: 0 15rpx;
box-sizing: border-box;
line-height: 80rpx;
}
.changephonepop view.ffff {
display: flex;
}
.changephonepop view button {
font-size: 24rpx;
margin-left: 10rpx;
white-space: nowrap;
width: 260rpx;
line-height: 80rpx;
background: linear-gradient(90deg, #00c176, #3ed89b);
color: #fff;
padding: 0;
border: none;
}
</style>
<template>
<view class="box" v-if='isShow'>
<view class="topBg">
<view class="userInfoBox">
<view class="headImg">
<image mode="aspectFill" :src="avatarUrl"></image>
</view>
<view class="nameBox">
{{ user.nickName }}
<view>{{ user.phonenumber }}</view>
</view>
</view>
</view>
<view class="rMainBox">
<uni-list :border="false" class="myList">
<!-- <uni-list-item :border="false" title="个人信息" showArrow :to="`./myInfo`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon03.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<uni-list-item :border="false" title="参赛队信息" showArrow :to="`./teamList`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon06.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<uni-list-item :border="false" title="会员充值" showArrow :to="`./mycard/renew`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon01.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<uni-list-item :border="false" title="场地订单" showArrow :to="`./bills`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon02.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item> -->
<uni-list-item :border="false" title="个人会员" showArrow clickable
@click="goPath('/myCenter/personInfo/index')">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<uni-list-item :border="false" title="我的培训" showArrow clickable
@click="goPath('/myCenter/mytrain/mytrain')">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" mode="widthFix"></image>
</view>
</template>
</uni-list-item>
<!-- <uni-list-item :border="false" title="我的赛事" showArrow :to="`./match`">
<template v-slot:header>
<view class="slot-box">
<image class="slot-image" src="/static/user_icon04.png" mode="widthFix"></image>
</view>
</template>
</uni-list-item> -->
</uni-list>
</view>
</view>
</template>
<script setup>
import * as my from '@/myCenter/center_api.js';
import * as loginServer from '@/common/login.js';
import {
onMounted,
ref
} from 'vue';
import {
onLoad,
onShow
} from '@dcloudio/uni-app';
const user = ref({});
const app = getApp();
const isShow = ref(false)
onMounted(() => {
init()
})
function init() {
if (app.globalData.isLogin) {
isShow.value = true
if (app.globalData.userInfo) {
const currUser = app.globalData.userInfo
user.value = currUser;
} else {
loginServer.getInfo().then(res => {
const currUser = app.globalData.userInfo
user.value = currUser
})
}
} else {
uni.redirectTo({
url: '/pages/index/login?path=' + encodeURIComponent(getCurrentPages()[0].$page.fullPath)
})
}
}
function goBack() {
uni.navigateBack({});
}
// function goQcode() {
// uni.scanCode({
// onlyFromCamera: true,
// success: function(res) {
// console.log('条码类型:' + res.scanType);
// console.log('条码内容:' + res.result);
// api.scanQrCode(res.result).then(res => {
// uni.showModal({
// title: '提示',
// content: res.msg,
// success: function(res) {
// if (res.confirm) {
// console.log('确定');
// } else if (res.cancel) {
// console.log('取消');
// }
// }
// });
// });
// }
// });
// }
function building() {
uni.showToast({
title: '暂未开放,敬请期待。',
icon: 'none',
duration: 2000
});
}
function goPath(path) {
if (path)
uni.navigateTo({
url: path
});
}
</script>
<style scoped lang="scss">
.box {
width: 100vw;
overflow: hidden;
}
.rMainBox {
box-sizing: border-box;
padding: 20rpx 25rpx 0;
margin: 25rpx;
}
.userInfoBox {
height: 200rpx;
}
.nameBox {
position: absolute;
left: 180rpx;
top: 70rpx;
font-size: 30rpx;
}
.nameBox view {
color: #7b7f83;
font-size: 26rpx;
margin-top: 10rpx;
}
.goback {
position: absolute;
color: #fff;
top: 100rpx;
left: 35rpx;
}
.forAdmin {
padding: 25rpx;
box-sizing: border-box;
}
.topBg {}
.onlyCardBottom {
position: relative;
width: 660rpx;
margin: auto;
height: 90rpx;
.bbg {
height: 90rpx;
width: 660rpx;
}
.cardBottom {
width: 660rpx;
background: transparent;
height: 90rpx;
text {
font-size: 28rpx;
color: #925921;
}
.renewBtn {
background: #874f02;
color: #fff;
}
}
}
.headImg {
border-radius: 50%;
position: relative;
top: 50rpx;
overflow: hidden;
width: 100rpx;
height: 100rpx;
border: 4px solid #ffffff;
background: #c4f9cb;
left: 40rpx;
button {
display: block;
padding: 0;
}
image {
width: 100rpx;
height: 100rpx;
display: block;
}
}
.slot-image {
width: 50rpx;
position: relative;
top: -8rpx;
height: 50rpx;
margin-right: 30rpx;
}
.myList {}
.funcBar {
display: flex;
background: #fff;
width: 700rpx;
height: 140rpx;
justify-content: space-around;
}
.funcBar view {
display: flex;
align-items: center;
font-size: 36rpx;
}
.funcBar image {
width: 80rpx;
height: 80rpx;
}
.topbgimg {
width: 100vw;
position: absolute;
z-index: -1;
}
.reportItembox {
overflow: hidden;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.reportItem {
background: #fff;
border-radius: 15rpx;
width: 340rpx;
margin-top: 25rpx;
.t {
border-bottom: 1px solid #e5e5e5;
height: 70rpx;
line-height: 70rpx;
color: #2b3133;
font-size: 30rpx;
padding-left: 36rpx;
}
.rbody {
display: flex;
padding: 36rpx;
box-sizing: border-box;
view {
font-size: 26rpx;
color: #888;
width: 40%;
}
text {
color: #00c176;
font-weight: bold;
font-size: 36rpx;
display: block;
margin-bottom: 20rpx;
}
}
}
.changephonepop {
width: 100%;
}
.changephonepop view {
width: 100%;
margin: 0 0 30rpx;
}
.changephonepop view input {
width: 100%;
background: #f4f4f4;
font-size: 30rpx;
height: 80rpx;
padding: 0 15rpx;
box-sizing: border-box;
line-height: 80rpx;
}
.changephonepop view.ffff {
display: flex;
}
.changephonepop view button {
font-size: 24rpx;
margin-left: 10rpx;
white-space: nowrap;
width: 260rpx;
line-height: 80rpx;
background: linear-gradient(90deg, #00c176, #3ed89b);
color: #fff;
padding: 0;
border: none;
}
</style>
\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!