代码合并

This commit is contained in:
2025-08-01 10:24:08 +08:00
7 changed files with 695 additions and 688 deletions

View File

@@ -5,6 +5,9 @@ export async function init() {
//热搜词 //热搜词
http.request({ http.request({
url: 'common/type/249', url: 'common/type/249',
data: {
type: 249
}
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
uni.setStorageSync('moreSearch', res.data.value) uni.setStorageSync('moreSearch', res.data.value)
@@ -18,8 +21,8 @@ export async function init() {
export const commonType = (num) => { export const commonType = (num) => {
return http.request({ return http.request({
url: `/common/type/${num}`, url: `/common/type/${num}`,
params:{ data:{
type:num type: num
} }
}) })
} }

View File

@@ -14,9 +14,13 @@ export const login = (data) => {
/** /**
* 发送验证码 * 发送验证码
*/ */
export const setSendMsg = (mobile,type) => { export const setSendMsg = (mobile, type) => {
return http.request({ return http.request({
url: '/Login/sendMsg/' + mobile + '/'+type url: '/Login/sendMsg/' + mobile + '/' + type,
data: {
phone: mobile,
event: type
}
}) })
} }

View File

@@ -17,7 +17,10 @@ export const selectByUserId = (data) => {
export const commonType = (type) => { export const commonType = (type) => {
return http.request({ return http.request({
url: `/common/type/${type}`, url: `/common/type/${type}`,
method: 'GET' method: 'GET',
data: {
type: type
}
}) })
} }

View File

@@ -17,6 +17,7 @@ export const selectNewApp = (data) => {
export const selectUserById = (data) => { export const selectUserById = (data) => {
return http.request({ return http.request({
url: '/user/selectUserById', url: '/user/selectUserById',
method: 'POST',
data: data data: data
}) })
} }

View File

@@ -56,7 +56,10 @@ export function insertHistory(data) {
export function getJinbiBili(data) { export function getJinbiBili(data) {
return http.request({ return http.request({
url: 'common/type/914', url: 'common/type/914',
data data: {
...data,
type: 914
}
}) })
} }
@@ -142,7 +145,7 @@ export function playStatus(data) {
} }
// 获取支付次数提示 // 获取支付次数提示
export function getPayTips(data){ export function getPayTips(data) {
return http.request({ return http.request({
url: 'course/getRedEnvelopeTips', url: 'course/getRedEnvelopeTips',
method: 'GET', method: 'GET',

View File

@@ -1,134 +1,145 @@
<template> <template>
<view class="container"> <view class="container">
<view class="bg" > <view class="bg">
<image src="../../static/default/i_bg.png" style="width: 100%;height:100%" mode="aspectFill"></image> <image src="../../static/default/i_bg.png" style="width: 100%; height: 100%" mode="aspectFill"></image>
</view> </view>
<view class="wrapper u-relative" style="padding-top: 48rpx;box-sizing: border-box;"> <view class="wrapper u-relative" style="padding-top: 48rpx; box-sizing: border-box">
<view class="nav" style="width: 100%;height: 96rpx;"></view> <view class="nav" style="width: 100%; height: 96rpx"></view>
<view class="input-content"> <view class="input-content">
<view style="font-size: 58rpx;font-weight: bold;color: #333;margin-bottom: 48rpx;">注册</view> <view style="font-size: 58rpx; font-weight: bold; color: #333; margin-bottom: 48rpx">注册</view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">手机号</view> <view class="title">手机号</view>
<view class="input" style="padding-left: 20rpx;"> <view class="input" style="padding-left: 20rpx">
<input class="input" type="number" :value="data.mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile" <input class="input" type="number" :value="data.mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile" @input="inputChange" />
@input="inputChange" />
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<text class="title">验证码</text> <text class="title">验证码</text>
<view class="input flex" style="padding-left: 20rpx;padding-right: 20rpx;"> <view class="input flex" style="padding-left: 20rpx; padding-right: 20rpx">
<input type="number" :value="data.code" placeholder="请输入验证码" maxlength="6" data-key="code" <input type="number" :value="data.code" placeholder="请输入验证码" maxlength="6" data-key="code" @input="inputChange" @confirm="toRegister" />
@input="inputChange" @confirm="toRegister" />
<button class="send-msg" @click="sendMsg" :disabled="data.sending">{{ data.sendTime }}</button> <button class="send-msg" @click="sendMsg" :disabled="data.sending">{{ data.sendTime }}</button>
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<text class="title">设置密码</text> <text class="title">设置密码</text>
<view class="input" style="padding-left: 20rpx;"> <view class="input" style="padding-left: 20rpx">
<input class="input" type="password" :value="data.password" placeholder="请设置新密码" placeholder-class="input-empty" <input
maxlength="20" minlength="6" data-key="password" @input="inputChange" @confirm="toRegister" /> class="input"
type="password"
:value="data.password"
placeholder="请设置新密码"
placeholder-class="input-empty"
maxlength="20"
minlength="6"
data-key="password"
@input="inputChange"
@confirm="toRegister"
/>
</view> </view>
</view> </view>
<button class="confirm-btn" @click="toRegister">注册</button> <button class="confirm-btn" @click="toRegister">注册</button>
<button class="confirm-btn" @click="toLogin">登录</button> <button class="confirm-btn" @click="toLogin">登录</button>
</view> </view>
<view class="footerView"> <view class="footerView">
<u-checkbox-group> <u-checkbox-group>
<u-checkbox v-model="data.checked" label-size='24upx' shape="circle" @change="radioChange"></u-checkbox> <u-checkbox v-model="data.checked" label-size="24upx" shape="circle" @change="radioChange"></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
<view>注册即同意</view> <view>注册即同意</view>
<!-- 协议地址 --> <!-- 协议地址 -->
<view @click="linkTo('/pages/me/privacy')" style="color: #37A6FF;">隐私政策</view> <view @click="linkTo('/pages/me/privacy')" style="color: #37a6ff">隐私政策</view>
<view @click="linkTo('/pages/me/agreement')" style="color: #37A6FF;">用户服务协议</view> <view @click="linkTo('/pages/me/agreement')" style="color: #37a6ff">用户服务协议</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { reactive } from 'vue'; import { reactive } from 'vue';
import { onLoad} from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app';
import {setSendMsg,register} from '@/api/login/login.js'; import { setSendMsg, register } from '@/api/login/login.js';
import {commonType} from '@/api/init.js'; import { commonType } from '@/api/init.js';
import { linkTo } from '@/utils/app.js'; import { linkTo } from '@/utils/app.js';
let data = reactive({ let data = reactive({
code: '', code: '',
mobile: '', mobile: '',
password: '', password: '',
sending: false, sending: false,
sendTime: '获取验证码', sendTime: '获取验证码',
count: 60, count: 60,
relation: "", relation: '',
invitation: '', invitation: '',
isregisterCode: '', isregisterCode: '',
qdCodeion: '', //渠道码 qdCodeion: '', //渠道码
checked: false, checked: false
}) });
onLoad(async ( options ) => { onLoad(async (options) => {
if (uni.getStorageSync('qdCodeion')) { data.qdCodeion = uni.getStorageSync('qdCodeion') } if (uni.getStorageSync('qdCodeion')) {
if (options.qdCode) { data.qdCodeion = options.qdCode } data.qdCodeion = uni.getStorageSync('qdCodeion');
if (options.invitation ) { data.invitation = options.invitation } }
if (options.qdCode) {
data.qdCodeion = options.qdCode;
}
if (options.invitation) {
data.invitation = options.invitation;
}
let res = await commonType(3) let res = await commonType(3);
data.isregisterCode = res.value data.isregisterCode = res.value;
}) });
/** /**
* 发送验证码 * 发送验证码
*/ */
async function sendMsg () { async function sendMsg() {
try {
if (!data.mobile) { if (!data.mobile) {
uni.showToast({ uni.showToast({
title: '请输入手机号', title: '请输入手机号',
icon: 'none', icon: 'none'
}) });
} else if (data.mobile.length !== 11) { } else if (data.mobile.length !== 11) {
uni.showToast({ uni.showToast({
title: '请输入正确的手机号', title: '请输入正确的手机号',
icon: 'none', icon: 'none'
}) });
} else { } else {
uni.showLoading({ uni.showLoading({
title: '正在发送验证码...' title: '正在发送验证码...'
}) });
let res = await setSendMsg(data.mobile,'login') let res = await setSendMsg(data.mobile, 'login');
uni.hideLoading();
uni.hideToast(); console.log(res);
if( res ){
data.sending = true; data.sending = true;
uni.showToast({ uni.showToast({
title: '验证码发送成功请注意查收', title: '验证码发送成功请注意查收',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
countDown(); countDown();
} else { }
uni.showModal({ } catch (error) {
showCancel: false, console.log(error);
title: '短信发送失败', uni.showToast({
content: '请一分钟后再获取验证码' title: error.message,
icon: 'none',
duration: 1000
}); });
} }
uni.hideLoading();
}
} /**
}
/**
* 验证码倒计时 * 验证码倒计时
*/ */
function countDown() { function countDown() {
console.log(data.count) console.log(data.count);
if (data.count === 1) { if (data.count === 1) {
data.count = 60; data.count = 60;
data.sending = false; data.sending = false;
@@ -139,130 +150,120 @@
data.sendTime = data.count - 1 + '秒后重新获取'; data.sendTime = data.count - 1 + '秒后重新获取';
setTimeout(countDown.bind(this), 1000); setTimeout(countDown.bind(this), 1000);
} }
} }
/** /**
* 获取注册值 * 获取注册值
* @param {Object} e * @param {Object} e
*/ */
function inputChange(e) { function inputChange(e) {
const key = e.currentTarget.dataset.key; const key = e.currentTarget.dataset.key;
data[key] = e.detail.value; data[key] = e.detail.value;
} }
/** /**
* 是否同意协议 * 是否同意协议
* @param {Object} e * @param {Object} e
*/ */
function radioChange(e) { function radioChange(e) {
data.checked = e data.checked = e;
} }
/** /**
* 登录 * 登录
*/ */
function toLogin() { function toLogin() {
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' url: '/pages/login/login'
}); });
} }
/**
/**
* 注册 * 注册
*/ */
async function toRegister() { async function toRegister() {
const { const { mobile, password, code, checked, invitation, isregisterCode, qdCodeion } = data;
mobile,
password,
code,
checked,
invitation,
isregisterCode,
qdCodeion
} = data;
if (!mobile) { if (!mobile) {
uni.showToast({ uni.showToast({
title: '请输入账号', title: '请输入账号',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!code) { if (!code) {
uni.showToast({ uni.showToast({
title: '请输入验证码', title: '请输入验证码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!password) { if (!password) {
uni.showToast({ uni.showToast({
title: '请设置密码', title: '请设置密码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (password.length < 6) { if (password.length < 6) {
uni.showToast({ uni.showToast({
title: '密码位数必须大于六位', title: '密码位数必须大于六位',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (invitation.length == 0 && isregisterCode == '是') { if (invitation.length == 0 && isregisterCode == '是') {
uni.showToast({ uni.showToast({
title: '请输入邀请码', title: '请输入邀请码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!checked) { if (!checked) {
uni.showToast({ uni.showToast({
title: '请先同意《隐私政策》和《用户协议》', title: '请先同意《隐私政策》和《用户协议》',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
data.logining = true; data.logining = true;
uni.showLoading({ uni.showLoading({
title: '注册中...' title: '注册中...'
}) });
let platform = '' let platform = '';
// #ifdef APP // #ifdef APP
platform = 'app' platform = 'app';
// #endif // #endif
// #ifdef H5 // #ifdef H5
platform = 'h5' platform = 'h5';
// #endif // #endif
let res = await register({ let res = await register({
password: password, password: password,
phone: mobile, phone: mobile,
msg: code, msg: code,
inviterCode: invitation, inviterCode: invitation,
platform: platform, platform: platform,
qdCode: qdCodeion, qdCode: qdCodeion
}) });
if (res.code === 0) { if (res.code === 0) {
uni.setStorageSync('token', res.token) uni.setStorageSync('token', res.token);
uni.setStorageSync('userInfo', res.user) uni.setStorageSync('userInfo', res.user);
uni.showToast({ uni.showToast({
title: '注册成功', title: '注册成功',
icon: 'none' icon: 'none'
}) });
setTimeout(function() { setTimeout(function () {
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}); });
}, 1000) }, 1000);
} else { } else {
uni.showModal({ uni.showModal({
showCancel: false, showCancel: false,
@@ -271,34 +272,32 @@
}); });
} }
uni.hideLoading(); uni.hideLoading();
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background: #ffffff; background: #ffffff;
} }
*{ * {
box-sizing: border-box; box-sizing: border-box;
} }
.bg{ .bg {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
top: 0; top: 0;
} }
.wrapper{ .wrapper {
position: relative; position: relative;
padding-top: 48rpx; padding-top: 48rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.flex{ .flex {
display: flex; display: flex;
} }
.footerView { .footerView {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@@ -306,68 +305,68 @@
font-size: 24rpx; font-size: 24rpx;
color: #333333; color: #333333;
margin-top: 50rpx; margin-top: 50rpx;
}
} .cuIcon::before {
.cuIcon::before{
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
margin-right: 12rpx; margin-right: 12rpx;
} }
.cuIcon-round::before { .cuIcon-round::before {
content: "\e6d7"; content: '\e6d7';
} }
.cuIcon-radiobox:before { .cuIcon-radiobox:before {
content: "\e75b"; content: '\e75b';
color: #37A6FF; color: #37a6ff;
} }
.send-msg { .send-msg {
flex-shrink: 0;
line-height: initial; line-height: initial;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #EC6F48; color: #ec6f48;
border: none; border: none;
background-color: transparent; background-color: transparent;
margin: 0; margin: 0;
padding: 0; padding: 0;
} white-space: nowrap;
.send-msg::after{ }
.send-msg::after {
border: none; border: none;
background-color: transparent; background-color: transparent;
} }
.container {
.container {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background: #ffffff; background: #ffffff;
box-sizing: border-box; box-sizing: border-box;
} }
.wrapper { .wrapper {
min-height: 100vh; min-height: 100vh;
position: relative; position: relative;
z-index: 90; z-index: 90;
} }
.input-content { .input-content {
padding: 0 56rpx; padding: 0 56rpx;
} }
.cu-form-group{ .cu-form-group {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
margin-bottom: 48rpx; margin-bottom: 48rpx;
background-color: transparent; background-color: transparent;
padding: 0; padding: 0;
.title{ .title {
margin-bottom: 32rpx; margin-bottom: 32rpx;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
} }
.input{ .input {
width: 100%; width: 100%;
// height: 84rpx; // height: 84rpx;
// line-height: 84rpx; // line-height: 84rpx;
@@ -377,28 +376,28 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
input{ input {
height: 84rpx!important; height: 84rpx !important;
}
v-deep .uni-input-input{
height: 84rpx!important;
} }
v-deep .uni-input-input {
height: 84rpx !important;
} }
} }
}
.confirm-btn { .confirm-btn {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
text-align: center; text-align: center;
line-height: 100rpx; line-height: 100rpx;
border-radius: 16rpx; border-radius: 16rpx;
margin-top: 40rpx; margin-top: 40rpx;
background: #EC6F48; background: #ec6f48;
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #ffffff;
&:after { &:after {
border: none; border: none;
} }
} }
</style> </style>

View File

@@ -1,30 +1,37 @@
<template> <template>
<view class="container"> <view class="container">
<view class="bg" > <view class="bg">
<image src="../../static/default/i_bg.png" style="width: 100%;height:100%" mode="aspectFill"></image> <image src="../../static/default/i_bg.png" style="width: 100%; height: 100%" mode="aspectFill"></image>
</view> </view>
<view class="wrapper u-relative" style="padding-top: 48rpx;box-sizing: border-box;"> <view class="wrapper u-relative" style="padding-top: 48rpx; box-sizing: border-box">
<view class="input-content"> <view class="input-content">
<view style="font-size: 58rpx;font-weight: bold;color: #333;margin-bottom: 48rpx;">注册</view> <view style="font-size: 58rpx; font-weight: bold; color: #333; margin-bottom: 48rpx">注册</view>
<view class="cu-form-group" > <view class="cu-form-group">
<view class="title">手机号</view> <view class="title">手机号</view>
<input class="input" type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile" <input class="input" type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile" @input="inputChange" />
@input="inputChange" />
</view> </view>
<view class="cu-form-group" > <view class="cu-form-group">
<text class="title">验证码</text> <text class="title">验证码</text>
<view class="input flex"> <view class="input flex">
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code" <input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code" @input="inputChange" @confirm="toLogin" />
@input="inputChange" @confirm="toLogin" />
<button class="send-msg" @click="sendMsg" :disabled="sending">{{ sendTime }}</button> <button class="send-msg" @click="sendMsg" :disabled="sending">{{ sendTime }}</button>
</view> </view>
</view> </view>
<view class="cu-form-group" > <view class="cu-form-group">
<text class="title">设置密码</text> <text class="title">设置密码</text>
<input class="input" type="password" :value="password" placeholder="请设置新密码" placeholder-class="input-empty" <input
maxlength="20" minlength="6" data-key="password" @input="inputChange" @confirm="toLogin" /> class="input"
type="password"
:value="password"
placeholder="请设置新密码"
placeholder-class="input-empty"
maxlength="20"
minlength="6"
data-key="password"
@input="inputChange"
@confirm="toLogin"
/>
</view> </view>
<!-- <view class="cu-form-group" <!-- <view class="cu-form-group"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px"> style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
@@ -39,102 +46,102 @@
</view> </view>
<view class="footerView"> <view class="footerView">
<u-checkbox-group> <u-checkbox-group>
<u-checkbox v-model="checked" label-size='24upx' shape="circle" @change="radioChange"></u-checkbox> <u-checkbox v-model="checked" label-size="24upx" shape="circle" @change="radioChange"></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
<view>同意</view> <view>同意</view>
<!-- 协议地址 --> <!-- 协议地址 -->
<navigator url="/me/setting/mimi" open-type="navigate" style="color: #37A6FF;">隐私政策</navigator> <navigator url="/me/setting/mimi" open-type="navigate" style="color: #37a6ff">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate" style="color: #37A6FF;">用户协议</navigator> <navigator url="/me/setting/xieyi" open-type="navigate" style="color: #37a6ff">用户协议</navigator>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { reactive } from 'vue'; import { reactive } from 'vue';
import { onLoad} from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app';
import http from '@/http/http.js'; import http from '@/http/http.js';
let data = reactive({ let data = reactive({
code: '', code: '',
mobile: '', mobile: '',
password: '', password: '',
sending: false, sending: false,
sendTime: '获取验证码', sendTime: '获取验证码',
count: 60, count: 60,
relation: "", relation: '',
invitation: '', invitation: '',
registerCode: '', registerCode: '',
qdCodeion: '', //渠道码 qdCodeion: '', //渠道码
checked: false, checked: false
}) });
onLoad(( options ) => { onLoad((options) => {
let relation = e.invitation let relation = e.invitation;
if (relation) { if (relation) {
this.relation = relation; this.relation = relation;
this.invitation = relation; this.invitation = relation;
} }
if (e.qdCode) { if (e.qdCode) {
this.qdCodeion = e.qdCode this.qdCodeion = e.qdCode;
} }
http.request({ http.request({
url:'app/common/type/3', url: 'app/common/type/3',
}).then(res => { data: {
type: 3
}
}).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.registerCode = res.data.value this.registerCode = res.data.value;
} }
}); });
}) });
/** /**
* 是否同意协议 * 是否同意协议
* @param {Object} e * @param {Object} e
*/ */
function radioChange(e) { function radioChange(e) {
this.checked = e this.checked = e;
} }
function showMa() { function showMa() {
//查询官方邀请码 //查询官方邀请码
this.$Request.getT('/common/type/88').then(res => { this.$Request.getT('/common/type/88', { type: 88 }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.invitation = res.data.value; this.invitation = res.data.value;
} }
}); });
} }
function sendMsg() { function sendMsg() {
const { const { mobile } = this;
mobile
} = this;
if (!mobile) { if (!mobile) {
uni.showToast({ uni.showToast({
title: '请输入手机号', title: '请输入手机号',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
} else if (mobile.length !== 11) { } else if (mobile.length !== 11) {
uni.showToast({ uni.showToast({
title: '请输入正确的手机号', title: '请输入正确的手机号',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
} else { } else {
uni.showLoading({ uni.showLoading({
title: '正在发送验证码...' title: '正在发送验证码...'
}) });
http.request({ http.request({
url:'app/Login/sendMsg/' + mobile + '/login', url: 'app/Login/sendMsg/' + mobile + '/login'
}).then(res => { }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.sending = true; this.sending = true;
uni.showToast({ uni.showToast({
title: '验证码发送成功请注意查收', title: '验证码发送成功请注意查收',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
this.countDown(); this.countDown();
} else { } else {
uni.showModal({ uni.showModal({
@@ -145,14 +152,11 @@
} }
uni.hideLoading(); uni.hideLoading();
}) });
} }
} }
function countDown() { function countDown() {
const { const { count } = this;
count
} = this;
if (count === 1) { if (count === 1) {
this.count = 60; this.count = 60;
this.sending = false; this.sending = false;
@@ -163,113 +167,104 @@
this.sendTime = count - 1 + '秒后重新获取'; this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000); setTimeout(this.countDown.bind(this), 1000);
} }
} }
function inputChange(e) { function inputChange(e) {
const key = e.currentTarget.dataset.key; const key = e.currentTarget.dataset.key;
this[key] = e.detail.value; this[key] = e.detail.value;
} }
function toLogin() { function toLogin() {
console.log("123"); console.log('123');
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' url: '/pages/login/login'
}); });
} }
function toRegister() { function toRegister() {
const { const { mobile, password, code, checked, invitation, registerCode, qdCodeion } = this;
mobile,
password,
code,
checked,
invitation,
registerCode,
qdCodeion
} = this;
if (!mobile) { if (!mobile) {
uni.showToast({ uni.showToast({
title: '请输入账号', title: '请输入账号',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!code) { if (!code) {
uni.showToast({ uni.showToast({
title: '请输入验证码', title: '请输入验证码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!password) { if (!password) {
uni.showToast({ uni.showToast({
title: '请设置密码', title: '请设置密码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (password.length < 6) { if (password.length < 6) {
uni.showToast({ uni.showToast({
title: '密码位数必须大于六位', title: '密码位数必须大于六位',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (invitation.length == 0 && registerCode == '是') { if (invitation.length == 0 && registerCode == '是') {
uni.showToast({ uni.showToast({
title: '请输入邀请码', title: '请输入邀请码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!checked) { if (!checked) {
uni.showToast({ uni.showToast({
title: '请先同意《隐私政策》和《用户协议》', title: '请先同意《隐私政策》和《用户协议》',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
this.logining = true; this.logining = true;
uni.showLoading({ uni.showLoading({
title: '注册中...' title: '注册中...'
}) });
let platform = '' let platform = '';
// #ifdef APP // #ifdef APP
platform = 'app' platform = 'app';
// #endif // #endif
// #ifdef H5 // #ifdef H5
platform = 'h5' platform = 'h5';
// #endif // #endif
http.request({ http.request({
url: 'app/Login/registerCode?password=' + password + '&phone=' + mobile + '&msg=' + code + url: 'app/Login/registerCode?password=' + password + '&phone=' + mobile + '&msg=' + code + '&inviterCode=' + invitation + '&platform=' + platform + '&qdCode=' + qdCodeion,
'&inviterCode=' + invitation + '&platform=' + platform + '&qdCode=' + qdCodeion,
method: 'post' method: 'post'
}).then(res => { }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
// this.$queue.remove('invitation'); // this.$queue.remove('invitation');
uni.setStorageSync('token', res.token) uni.setStorageSync('token', res.token);
uni.setStorageSync('userId', res.user.userId) uni.setStorageSync('userId', res.user.userId);
uni.setStorageSync('phone', res.user.phone) uni.setStorageSync('phone', res.user.phone);
uni.setStorageSync('invitationCode', res.user.invitationCode) uni.setStorageSync('invitationCode', res.user.invitationCode);
//设置渠道码 //设置渠道码
if (res.user.qdCode) { if (res.user.qdCode) {
uni.setStorageSync('qdCode', res.user.qdCode) uni.setStorageSync('qdCode', res.user.qdCode);
} }
uni.showToast({ uni.showToast({
title: '注册成功', title: '注册成功',
icon: 'none' icon: 'none'
}) });
setTimeout(function() { setTimeout(function () {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/appEq' url: '/pages/login/appEq'
}) });
}, 1000) }, 1000);
} else { } else {
uni.hideLoading(); uni.hideLoading();
uni.showModal({ uni.showModal({
@@ -279,32 +274,32 @@
}); });
} }
}); });
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background: #fff; background: #fff;
} }
*{ * {
box-sizing: border-box; box-sizing: border-box;
} }
.flex{ .flex {
display: flex; display: flex;
} }
.bg{ .bg {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
top: 0; top: 0;
} }
.wrapper{ .wrapper {
position: relative; position: relative;
padding-top: 48rpx; padding-top: 48rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.footerView { .footerView {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@@ -315,63 +310,63 @@
// left: 0; // left: 0;
// right: 0; // right: 0;
// bottom: 178rpx; // bottom: 178rpx;
.cuIcon::before{ .cuIcon::before {
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
margin-right: 12rpx; margin-right: 12rpx;
} }
.cuIcon-round::before { .cuIcon-round::before {
content: "\e6d7"; content: '\e6d7';
} }
.cuIcon-radiobox:before { .cuIcon-radiobox:before {
content: "\e75b"; content: '\e75b';
color: #37A6FF; color: #37a6ff;
}
} }
}
.send-msg { .send-msg {
line-height: initial; line-height: initial;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #EC6F48; color: #ec6f48;
border: none; border: none;
background-color: transparent!important; background-color: transparent !important;
} }
.send-msg::after{ .send-msg::after {
border: none; border: none;
background-color: transparent; background-color: transparent;
} }
.container { .container {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background: #fff; background: #fff;
} }
.wrapper { .wrapper {
position: relative; position: relative;
z-index: 90; z-index: 90;
min-height: 100vh; min-height: 100vh;
} }
.input-content { .input-content {
padding: 0 56rpx; padding: 0 56rpx;
.cu-form-group{ .cu-form-group {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
margin-bottom: 48rpx; margin-bottom: 48rpx;
background-color: transparent; background-color: transparent;
padding: 0; padding: 0;
.title{ .title {
margin-bottom: 32rpx; margin-bottom: 32rpx;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
} }
.input{ .input {
width: 100%; width: 100%;
height: 84rpx; height: 84rpx;
line-height: 84rpx; line-height: 84rpx;
@@ -380,22 +375,21 @@
padding: 22rpx 32rpx 22rpx 24rpx; padding: 22rpx 32rpx 22rpx 24rpx;
} }
} }
} }
.confirm-btn {
.confirm-btn {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
text-align: center; text-align: center;
line-height: 100rpx; line-height: 100rpx;
border-radius: 16rpx; border-radius: 16rpx;
margin-top: 40rpx; margin-top: 40rpx;
background: #EC6F48; background: #ec6f48;
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #ffffff;
&:after { &:after {
border: none; border: none;
} }
} }
</style> </style>