first commit
This commit is contained in:
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<view class="home">
|
||||
<view class=""
|
||||
style=" margin-top: 200rpx; display: flex; flex-direction: column; justify-content: center; align-items: center;">
|
||||
<image :src="Service.GetIconImg('/static/index/logo/logo.png')" style="width: 150rpx; height: 150rpx; "
|
||||
mode=""></image>
|
||||
<view class="" style="font-size: 36rpx; font-weight: 800; margin-top: 20rpx;">
|
||||
菜农·商家端
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="margin: 30rpx 30rpx; margin-top: 150rpx;">
|
||||
|
||||
<view class="" style="font-size: 34rpx; font-weight: 600; ">
|
||||
欢迎登陆
|
||||
</view>
|
||||
|
||||
<view class="" style="font-size: 28rpx; margin-top: 20rpx; ">
|
||||
手机号登录,安全又便捷
|
||||
</view>
|
||||
|
||||
<view v-if="type" class="" >
|
||||
<view class="" style="margin-top: 30rpx;">
|
||||
<up-input v-model="login.phone" type="number" shape='circle'
|
||||
:customStyle="{'padding':'20rpx 30rpx','font-size':'32rpx'}" placeholder="请输入手机号"
|
||||
clearable='true' border="surround"></up-input>
|
||||
</view>
|
||||
|
||||
<view class="" style="margin-top: 30rpx;">
|
||||
<up-input v-model="login.password" type="password" shape='circle'
|
||||
:customStyle="{'padding':'20rpx 30rpx','font-size':'32rpx'}" placeholder="请输入密码"
|
||||
clearable='true' border="surround"></up-input>
|
||||
</view>
|
||||
|
||||
<view class="" style="margin-top: 30rpx;" v-if="!isLogin">
|
||||
<up-input v-model="qudPow" type="password" shape='circle'
|
||||
:customStyle="{'padding':'20rpx 30rpx','font-size':'32rpx'}" placeholder="确认密码"
|
||||
clearable='true' border="surround"></up-input>
|
||||
</view>
|
||||
|
||||
<!-- <view class=""
|
||||
style=" display: flex; align-items: center; justify-content: space-between; margin-top: 30rpx; border: 1rpx solid #dadbde; box-sizing: border-box; padding: 20rpx 30rpx; border-radius: 200rpx; ">
|
||||
<up-code-input v-model="login.code" mode="line" size='24'></up-code-input>
|
||||
<view class="wrap">
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
<up-code :seconds="seconds" @end="end" @start="start" ref="uCodeRef"
|
||||
@change="codeChange"></up-code>
|
||||
<view @click="getCode">{{tips}}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
</view>
|
||||
<!-- <view v-else class="">
|
||||
<view class="" style="margin-top: 30rpx;">
|
||||
<up-input v-model="login.phone" type="number" shape='circle'
|
||||
:customStyle="{'padding':'20rpx 30rpx','font-size':'32rpx'}" placeholder="请输入账号"
|
||||
clearable='true' border="surround"></up-input>
|
||||
</view>
|
||||
|
||||
<view class="" style="margin-top: 30rpx;">
|
||||
<up-input v-model="login.phone" type="number" shape='circle'
|
||||
:customStyle="{'padding':'20rpx 30rpx','font-size':'32rpx'}" placeholder="请输入密码"
|
||||
clearable='true' border="surround"></up-input>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="" style="margin-top: 40rpx; width: 100%; height: 80rpx; line-height: 80rpx; border-radius: 40rpx; background-color: #FFDE1D; color: #fff; font-size: 30rpx; text-align: center;" @click="loginshop()">
|
||||
登录
|
||||
</view>
|
||||
|
||||
<view class="" style="width: 90%; margin: 0 auto; margin-top: 20rpx; display: flex; justify-content: space-between; color: #999; font-size: 28rpx;">
|
||||
<view class="">
|
||||
忘记密码
|
||||
</view>
|
||||
<view class="" @click="isLogin = !isLogin">
|
||||
{{isLogin?'去注册':'已有账号去登录'}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- <view class="" @click="type=!type" style="text-align: center; color: #637aff; margin: 50rpx 0; ">
|
||||
{{ !type?'使用验证码登录':'使用密码登录' }}
|
||||
</view> -->
|
||||
|
||||
<view class="" style="display: flex; justify-content: center; align-items: center;color: black; margin-top: 50rpx; " @click="isuser= !isuser">
|
||||
<view class="" style="margin-right: 10rpx;">
|
||||
<up-icon :name="!isuser?'checkmark-circle':'checkmark-circle-fill'" :color="!isuser?'#999':'var(--nav-mian)'" size="20"></up-icon>
|
||||
</view>
|
||||
我同意
|
||||
<text style="color: #FF6B23;">《用户协议》</text>
|
||||
和
|
||||
<text style="color: #FF6B23;">《隐私政策》</text>
|
||||
</view>
|
||||
<view class="" style="text-align: center; margin-top: 20rpx;">
|
||||
<!-- 新用户?系统将自动为您注册 -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||
import { Service ,CNRiderLoginService } from "@/Service/CN/CNRiderLoginService"
|
||||
import { ref } from "vue";
|
||||
|
||||
let qudPow = ref<string>('')
|
||||
|
||||
let login = ref({
|
||||
phone: '',
|
||||
code: '',
|
||||
password:''
|
||||
})
|
||||
|
||||
const tips = ref('');
|
||||
const seconds = ref(60);
|
||||
const uCodeRef = ref(null);
|
||||
|
||||
let type = ref(true)
|
||||
|
||||
let isLogin = ref<boolean>(true)//登录注册状态
|
||||
|
||||
let isuser = ref<boolean>(false)//用户同意协议
|
||||
|
||||
|
||||
onLoad(() => {
|
||||
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
|
||||
|
||||
//登录
|
||||
const loginshop = () =>{
|
||||
if(login.value.phone==''){
|
||||
return Service.Msg('请输入手机号/账号!')
|
||||
}
|
||||
|
||||
if(login.value.password==''){
|
||||
return Service.Msg('请输入密码!')
|
||||
}
|
||||
|
||||
if(!isLogin.value && qudPow.value==''){
|
||||
return Service.Msg('请确认密码!')
|
||||
}
|
||||
|
||||
|
||||
if(!isLogin.value && login.value.password!=qudPow.value){
|
||||
return Service.Msg('两次密码不同!')
|
||||
}
|
||||
|
||||
|
||||
console.log(isuser.value)
|
||||
|
||||
if(!isuser.value){
|
||||
return Service.Msg('请勾选同意用户协议!')
|
||||
}
|
||||
|
||||
|
||||
|
||||
CNRiderLoginService.RiderLogin(login.value).then(res=>{
|
||||
if(res.code==0){
|
||||
Service.Msg('登录成功!')
|
||||
Service.SetUserToken(res.data.accToken)
|
||||
if(res.data.type==-1){
|
||||
Service.GoPage('/pages/shop/Apply')
|
||||
}else{
|
||||
Service.GoPageTab('/pages/index/index')
|
||||
}
|
||||
}else{
|
||||
Service.Msg(res.msg)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
const codeChange = (text) => {
|
||||
tips.value = text;
|
||||
};
|
||||
|
||||
|
||||
const getCode = () => {
|
||||
if (uCodeRef.value.canGetCode) {
|
||||
// 模拟向后端请求验证码
|
||||
uni.showLoading({
|
||||
title: '正在获取验证码',
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
// 这里此提示会被start()方法中的提示覆盖
|
||||
Service.Msg('验证码已发送')
|
||||
// 通知验证码组件内部开始倒计时
|
||||
uCodeRef.value.start();
|
||||
}, 2000);
|
||||
} else {
|
||||
Service.Msg('倒计时结束后再发送')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const end = () => {
|
||||
console.log('倒计时结束');
|
||||
};
|
||||
|
||||
const start = () => {
|
||||
console.log('倒计时开始');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.home {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: linear-gradient(to bottom, #FFDE1D, #fff 40%);
|
||||
overflow: hidden;
|
||||
}
|
||||
.chen{
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<view style="margin: 20rpx 100rpx;">
|
||||
<up-form labelPosition="left" labelWidth='90' :model="password" ref="form1">
|
||||
<up-form-item label="姓名" prop="userInfo.name" :borderBottom="true" ref="item1">
|
||||
<up-input clearable='true' placeholder="请输入联系人姓名"
|
||||
border="none"></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item label="手机号" prop="userInfo.name" :borderBottom="true" ref="item1">
|
||||
<up-input clearable='true' placeholder="请输入手机号"
|
||||
border="none"></up-input>
|
||||
</up-form-item>
|
||||
</up-form>
|
||||
<view class="" style="margin-top: 20rpx;">
|
||||
<button @click="save()" :disabled='!password.password || !password.code ' class="logout-btn">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||
import { ref } from "vue";
|
||||
import { Service } from "../../Service/Service";
|
||||
|
||||
|
||||
let password = ref({
|
||||
password: '',
|
||||
code: ''
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
|
||||
const save = () => {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
background-color: var(--nav-banbacor);
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
border-radius: 10rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.logout-btn:active {
|
||||
background-color: #f7f7f7;
|
||||
color: #000;
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 813 B |
Reference in New Issue
Block a user