提交 6727fbbd authored 作者: Administrator's avatar Administrator

更新代码

上级 47837365
......@@ -47,3 +47,6 @@ ADD dist/build/h5 /var/www/html/
EXPOSE 80
# nodejs版本 16.14.0
<template>
<view class="login-container">
<image src="/static/msjf-picture/msjf-06.png" mode="scaleToFill" class="title-iamge"></image>
<image
src="/static/msjf-picture/msjf-06.png"
mode="scaleToFill"
class="title-iamge"
></image>
<text class="login-text">欢迎登陆</text>
<text class="login-text1">茅山玖坊高端定制酒</text>
......@@ -9,40 +13,46 @@
<input-login :inputData="inputData1" @hangleInput="hangleInput" />
</view>
<image src="/static/msjf-picture/msjf-07.png" mode="" class="next-step" @click="clickNextStep"></image>
<image
src="/static/msjf-picture/msjf-07.png"
mode=""
class="next-step"
@click="clickNextStep"
></image>
<text class="footer-text">定制管理平台</text>
</view>
</template>
<script setup lang="ts">
import { reactive } from 'vue';
import { login } from '@/services/api';
import inputLogin from '@/components/inputLogin.vue';
import { reactive } from "vue";
import { login } from "@/services/api";
import inputLogin from "@/components/inputLogin.vue";
let inputData = reactive({
inputValue: '' as any,
iconfont: 'icon-a-ziyuan16',
placeholder: '手机号码',
type: 'text',
checkType: 'phone',
inputValue: "" as any,
iconfont: "icon-a-ziyuan16",
placeholder: "手机号码",
type: "text",
checkType: "phone",
check: false,
checkContent: '请输入有效手机号'
checkContent: "请输入有效手机号",
});
let inputData1 = reactive({
inputValue: '' as any,
iconfont: 'icon-mima',
placeholder: '密码',
type: 'password',
checkType: 'passWord',
inputValue: "" as any,
iconfont: "icon-mima",
placeholder: "密码",
type: "password",
checkType: "passWord",
check: false,
checkContent: '请输入密码'
checkContent: "请输入密码",
});
let hangleInput = (Value: any, type: string) => {
if (type === 'phone') {
let reg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
if (type === "phone") {
let reg =
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
if (!reg.test(Value) || !Value) inputData.check = true;
else inputData.check = false;
} else {
......@@ -59,7 +69,7 @@ let clickNextStep = () => {
} else if (!inputData.check || !inputData1.check) {
initLogin(inputData.inputValue, inputData1.inputValue);
} else {
console.log('检验不通过');
console.log("检验不通过");
}
};
......@@ -67,25 +77,25 @@ let initLogin = async (mobile: number, password: string) => {
let res: any = await login({ mobile, password });
if (res.data.errno == 0) {
uni.setStorage({
key: 'token',
key: "token",
data: res.data.data.token,
success() {
uni.navigateTo({
url: '../customized/order',
url: "../customized/order",
success() {
uni.setStorage({
key: 'mobile',
data: inputData.inputValue
key: "mobile",
data: inputData.inputValue,
});
}
},
});
}
},
});
} else {
uni.showToast({
title: '手机号或密码错误',
icon: 'none',
duration: 2000
title: "手机号或密码错误",
icon: "none",
duration: 2000,
});
}
};
......
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论