whj 1 týždeň pred
rodič
commit
e030e0347f
66 zmenil súbory, kde vykonal 228 pridanie a 537 odobranie
  1. 13 13
      .cool/store/user.ts
  2. 1 1
      .vscode/settings.json
  3. 4 1
      api/user.ts
  4. 21 0
      components/back.uvue
  5. 1 1
      config/proxy.ts
  6. 0 22
      pages.json
  7. 12 4
      pages/index/home.uvue
  8. 0 105
      pages/user/components/login/phone copy.uvue
  9. 0 130
      pages/user/components/login/phone.uvue
  10. 83 0
      pages/user/components/phone.uvue
  11. 16 128
      pages/user/components/sms-btn.uvue
  12. 9 0
      pages/user/components/types.ts
  13. 0 0
      pages/user/components/wx.uvue
  14. 66 124
      pages/user/login.uvue
  15. 0 4
      pages/user/types/index.ts
  16. BIN
      static/demo/canvas/bg-content.png
  17. BIN
      static/demo/canvas/bg.png
  18. BIN
      static/demo/canvas/coupon.png
  19. BIN
      static/demo/canvas/gold-l.png
  20. BIN
      static/demo/canvas/gold-r.png
  21. BIN
      static/demo/canvas/invite-btn.png
  22. BIN
      static/demo/canvas/light.png
  23. BIN
      static/demo/canvas/rp-b.png
  24. BIN
      static/demo/canvas/rp-t.png
  25. BIN
      static/demo/canvas/text-dezk.png
  26. BIN
      static/demo/canvas/text-xrfl.png
  27. BIN
      static/demo/canvas/text-yqhy.png
  28. BIN
      static/demo/select-seat/screen.png
  29. 0 1
      static/demo/svg/category.svg
  30. 0 1
      static/demo/svg/points.svg
  31. 0 1
      static/demo/svg/shopping-cart.svg
  32. BIN
      static/demo/tabbar/home.png
  33. BIN
      static/demo/tabbar/home2.png
  34. BIN
      static/demo/tabbar/music.png
  35. BIN
      static/demo/tabbar/music2.png
  36. BIN
      static/demo/tabbar/my.png
  37. BIN
      static/demo/tabbar/my2.png
  38. BIN
      static/demo/tabbar/sleep.png
  39. BIN
      static/demo/tabbar/sleep2.png
  40. BIN
      static/empty/comm.png
  41. BIN
      static/home/1.jpg
  42. BIN
      static/home/12.png
  43. BIN
      static/home/21.png
  44. BIN
      static/home/8.png
  45. BIN
      static/home/back.png
  46. BIN
      static/home/亮黄闪电图标.png
  47. BIN
      static/home/冰块.png
  48. BIN
      static/home/卡通贴纸_透明图.png
  49. BIN
      static/home/去除图片中间的桌子.png
  50. BIN
      static/home/喇叭.png
  51. BIN
      static/home/宝箱_透明图.png
  52. BIN
      static/home/彩虹烧杯_透明图.png
  53. BIN
      static/home/灯泡.png
  54. BIN
      static/home/红哑铃图标.png
  55. BIN
      static/home/组 5.png
  56. BIN
      static/home/组 6.png
  57. BIN
      static/home/组 7.png
  58. BIN
      static/home/蓝黄机械齿轮.png
  59. BIN
      static/icon/tabbar/home.png
  60. BIN
      static/icon/tabbar/home2.png
  61. BIN
      static/icon/tabbar/my.png
  62. BIN
      static/icon/tabbar/my2.png
  63. BIN
      static/icon/tabbar/template.png
  64. BIN
      static/icon/tabbar/template2.png
  65. 1 1
      tailwind.config.ts
  66. 1 0
      vite.config.ts

+ 13 - 13
.cool/store/user.ts

@@ -43,19 +43,19 @@ export class User {
 	 * @returns Promise<void>
 	 */
 	async get() {
-		if (this.token != null) {
-			await request({
-				url: "/app/user/info/person"
-			})
-				.then((res) => {
-					if (res != null) {
-						this.set(res);
-					}
-				})
-				.catch(() => {
-					// this.logout();
-				});
-		}
+		// if (this.token != null) {
+		// 	await request({
+		// 		url: "/app/user/info/person"
+		// 	})
+		// 		.then((res) => {
+		// 			if (res != null) {
+		// 				this.set(res);
+		// 			}
+		// 		})
+		// 		.catch(() => {
+		// 			// this.logout();
+		// 		});
+		// }
 	}
 
 	/**

+ 1 - 1
.vscode/settings.json

@@ -24,6 +24,6 @@
 		"editor.defaultFormatter": "redhat.vscode-xml"
 	},
 	"[vue]": {
-		"editor.defaultFormatter": "esbenp.prettier-vscode"
+		"editor.defaultFormatter": "Vue.volar"
 	}
 }

+ 4 - 1
api/user.ts

@@ -1,4 +1,7 @@
 import { usePost, stringify } from "@/.cool";
 export function loginApi(params) {
-  return usePost<any, any>(`/oauth/token?${stringify(params)}`)
+  return usePost(`/oauth/token?${stringify(params)}`)
+}
+export function sendSmsCode(params) {
+  return usePost(`/verify/sms/code/send`, params)
 }

+ 21 - 0
components/back.uvue

@@ -0,0 +1,21 @@
+<script setup lang='ts'>
+import { router } from "@/.cool";
+
+</script>
+<template>
+  <view class="back" @click="router.back()">
+    <cl-image src="/static/home/back.png" height="22" width="30" mode="heightFix" />
+  </view>
+</template>
+<style lang="scss" scoped>
+.back {
+  @apply fixed top-5 left-0 w-[60px] h-[40px] z-10;
+  background: #D0F1FF;
+  border-radius: 0px 25px 23px 0px;
+  border: 1px solid #1D4BD9;
+  border-left: none;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+</style>

+ 1 - 1
config/proxy.ts

@@ -2,7 +2,7 @@ export const proxy = {
 	// 开发环境配置
 	dev: {
 		// 本地地址
-		target: "http://192.168.1.7:5001",
+		target: "http://192.168.110.161:5001",
 		changeOrigin: true,
 		rewrite: (path: string) => path.replace("/dev", "")
 	},

+ 0 - 22
pages.json

@@ -22,27 +22,5 @@
 		"navigationBarBackgroundColor": "@navBgColor",
 		"pageOrientation": "landscape"
 	},
-	"tabBar": {
-		"custom": true,
-		"color": "@tabColor",
-		"selectedColor": "@tabSelectedColor",
-		"backgroundColor": "@tabBgColor",
-		"borderStyle": "@tabBorderStyle",
-		"height": "60px",
-		"list": [
-			{
-				"pagePath": "pages/index/home",
-				"iconPath": "/static/icon/tabbar/home.png",
-				"selectedIconPath": "/static/icon/tabbar/home2.png",
-				"text": "首页"
-			},
-			{
-				"pagePath": "pages/user/login",
-				"iconPath": "/static/icon/tabbar/home.png",
-				"selectedIconPath": "/static/icon/tabbar/home2.png",
-				"text": "login"
-			}
-		]
-	},
 	"uniIdRouter": {}
 }

+ 12 - 4
pages/index/home.uvue

@@ -1,9 +1,17 @@
-<script lang="ts" setup>
-</script>
 <template>
 	<cl-page>
-		实打实打算
+		sdsds
+		<cl-button @tap="handleLogin">登录</cl-button>
 	</cl-page>
 </template>
 
-<style scoped></style>
+<script lang="ts" setup>
+import { ref } from 'vue'
+function handleLogin() {
+	uni.navigateTo({
+		url: '/pages/user/login'
+	})
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 0 - 105
pages/user/components/login/phone copy.uvue

@@ -1,105 +0,0 @@
-<template>
-	<view class="flex flex-col mb-5">
-		<cl-text :size="18" :pt="{ className: 'font-bold' }">{{ t("您好,欢迎登录!") }}</cl-text>
-		<cl-text :pt="{ className: 'mt-2' }" color="info">{{
-			t("首次登录将自动为您完成注册")
-		}}</cl-text>
-	</view>
-
-	<view class="flex flex-col">
-		<view class="mb-3 flex flex-row">
-			<cl-input v-model="loginModel.username" prefix-icon="device-fill" :placeholder="t('请输入手机号')" :border="false" :pt="{
-				className: parseClass([
-					'!h-[45px] flex-1 !rounded-xl !px-4',
-					[isDark, '!bg-surface-70', '!bg-white']
-				]),
-				prefixIcon: {
-					className: 'mr-1'
-				}
-			}"></cl-input>
-		</view>
-
-		<view class="relative flex flex-row items-center mb-5">
-			<cl-input v-model="loginModel.password" prefix-icon="device-fill" :placeholder="t('请输入手机号')" :border="false" :pt="{
-				className: parseClass([
-					'!h-[45px] flex-1 !rounded-xl !px-4',
-					[isDark, '!bg-surface-70', '!bg-white']
-				]),
-				prefixIcon: {
-					className: 'mr-1'
-				}
-			}"></cl-input>
-		</view>
-
-		<cl-button @tap="toLogin">
-		登录
-		</cl-button>
-	</view>
-</template>
-
-<script setup lang="ts">
-import { computed, inject,reactive, ref, type PropType } from "vue";
-import type { LoginForm } from "../../types";
-import SmsBtn from "../sms-btn.uvue";
-import { isDark, parseClass, request, useRefs, type Response, t, stringify } from "@/.cool";
-import { useUi } from "@/uni_modules/cool-ui";
-// import { loginApi } from "@/api/user";
-
-const props = defineProps({
-	form: {
-		type: Object as PropType<LoginForm>,
-		default: () => ({})
-	}
-});
-const loginModel = reactive({
-	username: 'superadmin',
-	password: '123456',
-	randomStr: 0,
-	grant_type: 'password',
-	scope: 'server',
-	loginType: 88
-})
-const emit = defineEmits(["success"]);
-
-const ui = useUi();
-const refs = useRefs();
-
-// 是否同意
-const isAgree = inject("isAgree") as () => boolean;
-
-// 是否显示验证码
-const showCode = ref(false);
-
-// 是否加载中
-const loading = ref(false);
-
-// 是否禁用
-const disabled = computed(() => {
-	return props.form.phone == "" || props.form.smsCode == "";
-});
-
-// 登录
-async function toLogin() {
-	if (!isAgree()) {
-		return;
-	}
-
-	// loading.value = true;
-
-	await request({
-		url: `/oauth/token?${stringify(loginModel)}`,
-		method: 'POST',
-		data: loginModel
-	})
-		.then((res) => {
-			emit("success", res);
-		})
-		.catch((err) => {
-			ui.showToast({
-				message: (err as Response).message!
-			});
-		});
-
-	loading.value = false;
-}
-</script>

+ 0 - 130
pages/user/components/login/phone.uvue

@@ -1,130 +0,0 @@
-<template>
-	<view class="flex flex-col mb-5">
-		<cl-text :size="18" :pt="{ className: 'font-bold' }">{{ t("您好,欢迎登录!") }}</cl-text>
-		<cl-text :pt="{ className: 'mt-2' }" color="info">{{
-			t("首次登录将自动为您完成注册")
-		}}</cl-text>
-	</view>
-
-	<view class="flex flex-col">
-		<view class="mb-3 flex flex-row">
-			<cl-input
-				v-model="loginModel.username"
-				prefix-icon="device-fill"
-				:placeholder="t('请输入手机号')"
-				:border="false"
-				:pt="{
-					className: parseClass([
-						'!h-[45px] flex-1 !rounded-xl !px-4',
-						[isDark, '!bg-surface-70', '!bg-white']
-					]),
-					prefixIcon: {
-						className: 'mr-1'
-					}
-				}"
-			></cl-input>
-		</view>
-
-		<view class="relative flex flex-row items-center mb-5">
-			<cl-input
-				v-model="loginModel.password"
-				:clearable="false"
-				type="number"
-				prefix-icon="shield-check-fill"
-				:border="false"
-				:pt="{
-					className: parseClass([
-						'!h-[45px] flex-1 !rounded-xl !px-4',
-						[isDark, '!bg-surface-70', '!bg-white']
-					]),
-					prefixIcon: {
-						className: 'mr-1'
-					}
-				}"
-			>
-			</cl-input>
-		</view>
-
-		<cl-button
-			:loading="loading"
-			:disabled="disabled"
-			@tap="toLogin"
-		>
-			{{ t("登录") }}
-		</cl-button>
-	</view>
-</template>
-
-<script setup lang="ts">
-import { computed, inject,reactive, ref, type PropType } from "vue";
-import type { LoginForm } from "../../types";
-import SmsBtn from "../sms-btn.uvue";
-import { isDark, parseClass, request, useRefs, type Response, t, stringify } from "@/.cool";
-import { useUi } from "@/uni_modules/cool-ui";
- type LoginModal = {
-	username: string;
-	password: string;
-	randomStr: number;
-	grant_type: string;
-	scope: string;
-	loginType: number;
-};
-
-const props = defineProps({
-	form: {
-		type: Object as PropType<LoginForm>,
-		default: () => ({})
-	}
-});
-const loginModel = reactive<LoginModal>({
-	username: 'gg',
-	password: '123456',
-	randomStr: 0,
-	grant_type: 'password',
-	scope: 'server',
-	loginType: 88
-})
-const emit = defineEmits(["success"]);
-
-const ui = useUi();
-const refs = useRefs();
-
-// 是否同意
-const isAgree = inject("isAgree") as () => boolean;
-
-// 是否显示验证码
-const showCode = ref(false);
-
-// 是否加载中
-const loading = ref(false);
-
-// 是否禁用
-const disabled = computed(() => {
-	return props.form.phone == "" || props.form.smsCode == "";
-});
-
-// 登录
-async function toLogin() {
-	if (!isAgree()) {
-		return;
-	}
-
-	const { phone, smsCode } = props.form;
-const loginData = JSON.parse(JSON.stringify(loginModel)) as UTSJSONObject;
-		await request({
-		url: `/oauth/token?${stringify(loginData)}`,
-		method: 'POST',
-		data: loginData
-	})
-		.then((res) => {
-			emit("success", res);
-		})
-		.catch((err) => {
-			ui.showToast({
-				message: (err as Response).message!
-			});
-		});
-
-	loading.value = false;
-}
-</script>

+ 83 - 0
pages/user/components/phone.uvue

@@ -0,0 +1,83 @@
+<template>
+	<view class="flex flex-col w-[40vw]">
+		<view class="mb-3 flex flex-row ">
+			<cl-input class="" :pt="{ className: '!h-[40px] !rounded-xxl !px-4 !w-[100%]' }" v-model="form.username"
+				placeholder="请输入手机号"></cl-input>
+		</view>
+
+		<view class="relative flex flex-row items-center mb-5">
+			<cl-input :pt="{ className: '!h-[40px] !rounded-xxl !px-4 !w-[100%]' }" v-model="form.code" :clearable="false"
+				type="number">
+			</cl-input>
+			<view class="absolute right-0">
+				<sms-btn :ref="refs.set('smsBtn')" :phone="form.username" @success="showCode = true"></sms-btn>
+			</view>
+		</view>
+
+
+	</view>
+</template>
+
+<script setup lang="ts">
+import { computed, inject, ref, type PropType } from "vue";
+import type { LoginForm } from "./types";
+import SmsBtn from "./sms-btn.uvue";
+import { isDark, parseClass, request, useRefs, type Response, t } from "@/.cool";
+import { useUi } from "@/uni_modules/cool-ui";
+
+const props = defineProps({
+	form: {
+		type: Object as PropType<LoginForm>,
+		default: () => ({})
+	}
+});
+
+const emit = defineEmits(["success"]);
+
+const ui = useUi();
+const refs = useRefs();
+
+// 是否同意
+const isAgree = inject("isAgree") as () => boolean;
+
+// 是否显示验证码
+const showCode = ref(false);
+
+// 是否加载中
+const loading = ref(false);
+
+// 是否禁用
+const disabled = computed(() => {
+	return props.form.phone == "" || props.form.smsCode == "";
+});
+
+// 登录
+async function toLogin() {
+	if (!isAgree()) {
+		return;
+	}
+
+	const { phone, smsCode } = props.form;
+
+	loading.value = true;
+
+	await request({
+		url: "/app/user/login/phone",
+		method: "POST",
+		data: {
+			phone,
+			smsCode
+		}
+	})
+		.then((res) => {
+			emit("success", res);
+		})
+		.catch((err) => {
+			ui.showToast({
+				message: (err as Response).message!
+			});
+		});
+
+	loading.value = false;
+}
+</script>

+ 16 - 128
pages/user/components/sms-btn.uvue

@@ -5,69 +5,19 @@
 		</cl-button>
 	</slot>
 
-	<cl-popup
-		v-model="captcha.visible"
-		ref="popupRef"
-		direction="center"
-		:title="t('获取短信验证码')"
-		:size="250"
-	>
-		<view class="p-3 pt-2 pb-4 w-full" v-if="captcha.visible">
-			<view class="flex flex-row items-center">
-				<cl-input
-					v-model="code"
-					:placeholder="t('验证码')"
-					:maxlength="4"
-					autofocus
-					:clearable="false"
-					:pt="{
-						className: 'flex-1 mr-2 !h-[35px]'
-					}"
-					@confirm="send"
-				></cl-input>
-
-				<view
-					class="dark:!bg-surface-800 bg-surface-100 rounded-lg h-[35px] w-[100px] flex flex-row justify-center items-center"
-					@tap="getCaptcha"
-				>
-					<cl-loading v-if="captcha.loading"></cl-loading>
-					<cl-svg
-						v-else
-						class="h-full w-full pointer-events-none"
-						color="none"
-						:src="captcha.img"
-					></cl-svg>
-				</view>
-			</view>
-
-			<cl-button
-				type="primary"
-				:disabled="code == ''"
-				:loading="captcha.sending"
-				:pt="{
-					className: '!h-[35px] mt-3'
-				}"
-				@tap="send"
-			>
-				{{ t("发送短信") }}
-			</cl-button>
-		</view>
-	</cl-popup>
 </template>
 
 <script lang="ts" setup>
 import { computed, reactive, ref } from "vue";
 import { useUi } from "@/uni_modules/cool-ui";
 import { request, type Response, isDark, t, $t, parse } from "@/.cool";
-
+import { sendSmsCode } from "@/api/user";
 const props = defineProps({
 	phone: String
 });
 
 const emit = defineEmits(["success"]);
 
-const popupRef = ref<ClPopupComponentPublicInstance | null>(null);
-
 const ui = useUi();
 
 type Captcha = {
@@ -105,12 +55,6 @@ function clear() {
 	captchaId.value = "";
 }
 
-// 关闭
-function close() {
-	captcha.visible = false;
-	captcha.img = "";
-	clear();
-}
 
 // 开始倒计时
 function startCountdown() {
@@ -133,81 +77,26 @@ function startCountdown() {
 	fn();
 }
 
-// 获取图片验证码
-async function getCaptcha() {
-	clear();
-	captcha.loading = true;
-
-	type Res = {
-		captchaId: string;
-		data: string;
-	};
 
+// 发送短信
+async function send() {
+	captcha.sending = true;
 	await request({
-		url: "/app/user/login/captcha",
+		url: "/verify/sms/code/send",
+		method: "POST",
 		data: {
-			color: isDark.value ? "#ffffff" : "#2c3142",
-			phone: props.phone,
-			width: 200,
-			height: 70
+			mobile: props.phone,
+			randomStr: 12,
+			messageType: 1
 		}
-	})
-		.then((res) => {
-			if (res != null) {
-				const data = parse<Res>(res)!;
-
-				captchaId.value = data.captchaId;
-				captcha.img = data.data;
-			}
-		})
-		.catch((err) => {
-			ui.showToast({
-				message: (err as Response).message!
-			});
-		});
-
-	setTimeout(() => {
-		captcha.loading = false;
-	}, 200);
-}
 
-// 发送短信
-async function send() {
-	if (code.value != "") {
-		captcha.sending = true;
-
-		await request({
-			url: "/app/user/login/smsCode",
-			method: "POST",
-			data: {
-				phone: props.phone,
-				code: code.value,
-				captchaId: captchaId.value
-			}
-		})
-			.then(() => {
-				ui.showToast({
-					message: t("短信已发送,请查收")
-				});
-				startCountdown();
-				close();
-				emit("success");
-			})
-
-			.catch((err) => {
-				ui.showToast({
-					message: (err as Response).message!
-				});
-
-				getCaptcha();
-			});
+	})
+	ui.showToast({
+		message: t("短信已发送,请查收")
+	});
+	startCountdown();
+	captcha.sending = false;
 
-		captcha.sending = false;
-	} else {
-		ui.showToast({
-			message: t("请填写验证码")
-		});
-	}
 }
 
 // 打开
@@ -215,7 +104,7 @@ function open() {
 	if (props.phone != "") {
 		if (/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(props.phone!)) {
 			captcha.visible = true;
-			getCaptcha();
+			send();
 		} else {
 			ui.showToast({
 				message: t("请填写正确的手机号格式")
@@ -227,7 +116,6 @@ function open() {
 defineExpose({
 	open,
 	send,
-	getCaptcha,
 	startCountdown
 });
 </script>

+ 9 - 0
pages/user/components/types.ts

@@ -0,0 +1,9 @@
+export type LoginForm = {
+	username: string;
+	password: string;
+	randomStr: number;
+	grant_type: string;
+	scope: string;
+	code: string;
+	loginType: number;
+};

+ 0 - 0
pages/user/components/login/wx.uvue → pages/user/components/wx.uvue


+ 66 - 124
pages/user/login.uvue

@@ -1,139 +1,81 @@
 <template>
 	<cl-page>
-		<cl-topbar safe-area-top background-color="transparent"></cl-topbar>
-
-		<view class="px-10">
-			<!-- Logo -->
-			<view class="flex flex-col items-center justify-center py-20">
-				<view class="p-3 bg-white rounded-2xl">
-					<cl-image
-						src="/static/logo.png"
-						mode="widthFix"
-						:width="60"
-						:height="60"
-					></cl-image>
-				</view>
-
-				<cl-text :size="18" :pt="{ className: 'font-bold mt-4' }">{{
-					config.name
-				}}</cl-text>
-			</view>
-
-			<!-- 手机号登录 -->
-			<login-phone :form="form" @success="toLogin"></login-phone>
-
-			<!-- 微信登录 -->
-			<login-wx :ref="refs.set('loginWx')"></login-wx>
-
-			<!-- 协议 -->
-			<view class="mt-6 flex flex-row flex-wrap items-center justify-center">
-				<cl-checkbox
-					v-model="agree"
-					active-icon="checkbox-circle-fill"
-					inactive-icon="checkbox-blank-circle-line"
-					:pt="{
-						icon: {
-							size: 18
-						}
-					}"
-				>
-				</cl-checkbox>
-				<cl-text color="info" :size="12">{{ t("已阅读并同意") }}</cl-text>
-				<cl-text
-					:size="12"
-					:pt="{
-						className: 'font-bold'
-					}"
-					@tap.stop="toDoc(t('用户协议'), 'userAgreement')"
-				>
-					《{{ t("用户协议") }}》
-				</cl-text>
-				<cl-text color="info" :size="12">、</cl-text>
-				<cl-text
-					:size="12"
-					:pt="{
-						className: 'font-bold'
-					}"
-					@tap.stop="toDoc(t('隐私政策'), 'privacyPolicy')"
-				>
-					《{{ t("隐私政策") }}》
-				</cl-text>
-			</view>
-
-			<!-- 第三方登录 -->
-			<view class="flex flex-row justify-center mt-10 px-10">
-				<view
-					class="login-item"
-					:class="{
-						'is-dark': isDark
-					}"
-					@tap="refs.callMethod('loginWx', 'login')"
-				>
-					<cl-icon name="wechat-fill" :size="18" color="#00b223"></cl-icon>
-				</view>
-
-				<view class="login-item" :class="{ 'is-dark': isDark }">
-					<cl-icon name="apple-fill" :size="18"></cl-icon>
-				</view>
+		<Back />
+		<img src="/static/home/1.jpg" alt="" class="w-full h-full object-cover">
+		<view class="title">
+			少儿物理启蒙
+		</view>
+		<view class="group">
+			<cl-image src="/static/home/8.png" width="150px" height="150px" mode="heightFix" />
+			<view class="w-[40vw]">
+				<cl-tabs v-model="val" :list="list" :form="formData"></cl-tabs>
+				<cl-form v-model="formData" :pt="{ className: 'mt-1' }">
+					<view v-if="val === 'quickly_login'">
+						<phone :form="formData" />
+					</view>
+					<view v-else>
+						密码登录
+					</view>
+					<cl-button :pt="{ className: '!h-[45px] !rounded-full w-[200px] mx-auto' }" :loading="loading" @tap="toLogin">
+						登录
+					</cl-button>
+				</cl-form>
 			</view>
 		</view>
 	</cl-page>
 </template>
 
-<script setup lang="ts">
-import { config } from "@/config";
-import { isDark, parse, router, useRefs, useStore, type Token, t } from "@/.cool";
-import { provide, reactive, ref } from "vue";
-import type { LoginForm } from "./types";
-import { useUi } from "@/uni_modules/cool-ui";
-import LoginPhone from "./components/login/phone.uvue";
-import LoginWx from "./components/login/wx.uvue";
+<script lang="ts" setup>
+import Back from '@/components/back.uvue'
+import type { LoginForm } from "./components/types";
+import phone from './components/phone.uvue';
+import { ref } from 'vue'
+import type { ClTabsItem } from "@/uni_modules/cool-ui";
+import type { user } from '@/.cool';
+const val = ref('quickly_login')
+const list: ClTabsItem[] = [
+	{
+		label: '验证码登录',
+		value: 'quickly_login'
+	},
+	{
+		label: '密码登录',
+		value: 'password'
+	},
+]
+const formData = ref<LoginForm>({
+	username: '17812345678',
+	password: '',
+	randomStr: 0,
+	grant_type: 'password',
+	scope: 'server',
+	loginType: 1,
+	code: ''
+})
+const loading = ref(false)
+function toLogin() {
+	// loading.value = true
+	console.log(formData.value);
 
-const { user } = useStore();
-const ui = useUi();
-const refs = useRefs();
-
-// 表单
-const form = reactive<LoginForm>({
-	phone: "18000000000",
-	smsCode: "6666"
-});
-
-// 是否同意
-const agree = ref(false);
-
-// 登录成功
-async function toLogin(res: any) {
-	user.setToken(parse<Token>(res)!);
-	user.get();
-	router.nextLogin();
-}
-
-// 跳转文档
-function toDoc(name: string, path: string) {}
-
-// 是否同意
-function isAgree() {
-	if (!agree.value) {
-		ui.showToast({
-			message: t("请先阅读并同意《用户协议》和《隐私政策》")
-		});
-
-		return false;
-	}
-
-	return true;
 }
-
-provide("isAgree", isAgree);
 </script>
 
 <style lang="scss" scoped>
-.login-item {
-	@apply mx-2 p-2 flex items-center justify-center rounded-full bg-white border border-solid border-surface-100;
+.title {
+	position: absolute;
+	top: 6%;
+	left: 50%;
+	transform: translateX(-50%);
+	//设置字间距
+	letter-spacing: 0.1em;
+	@apply text-white text-5xl font-bold;
+}
 
-	&.is-dark {
-		@apply border-surface-600 bg-surface-700;
-	}
+.group {
+	@apply absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white px-4 py-2 rounded-xl;
+	display: flex;
+	align-items: center;
+	flex-direction: row;
+	height: 60vh;
 }
 </style>

+ 0 - 4
pages/user/types/index.ts

@@ -1,4 +0,0 @@
-export type LoginForm = {
-	phone: string;
-	smsCode: string;
-};

BIN
static/demo/canvas/bg-content.png


BIN
static/demo/canvas/bg.png


BIN
static/demo/canvas/coupon.png


BIN
static/demo/canvas/gold-l.png


BIN
static/demo/canvas/gold-r.png


BIN
static/demo/canvas/invite-btn.png


BIN
static/demo/canvas/light.png


BIN
static/demo/canvas/rp-b.png


BIN
static/demo/canvas/rp-t.png


BIN
static/demo/canvas/text-dezk.png


BIN
static/demo/canvas/text-xrfl.png


BIN
static/demo/canvas/text-yqhy.png


BIN
static/demo/select-seat/screen.png


+ 0 - 1
static/demo/svg/category.svg

@@ -1 +0,0 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1756115471186" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7124" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M337.4 927.3H235.7c-76 0-137.7-61.8-137.7-137.7V688c0-76 61.8-137.7 137.7-137.7h101.6c76 0 137.7 61.8 137.7 137.7v101.6c0.1 75.9-61.7 137.7-137.6 137.7z m-101.7-287c-26.2 0-47.6 21.4-47.6 47.6v101.6c0 26.2 21.4 47.6 47.6 47.6h101.6c26.2 0 47.6-21.4 47.6-47.6V688c0-26.2-21.4-47.6-47.6-47.6H235.7zM769.9 927.3H668.3c-76 0-137.7-61.8-137.7-137.7V688c0-76 61.8-137.7 137.7-137.7h101.6c76 0 137.7 61.8 137.7 137.7v101.6c0 75.9-61.7 137.7-137.7 137.7z m-101.6-287c-26.2 0-47.6 21.4-47.6 47.6v101.6c0 26.2 21.4 47.6 47.6 47.6h101.6c26.2 0 47.6-21.4 47.6-47.6V688c0-26.2-21.4-47.6-47.6-47.6H668.3zM342.4 499.8H235.7C159.8 499.8 98 438 98 362.1V255.4c0-76 61.8-137.7 137.7-137.7h106.7c76 0 137.7 61.8 137.7 137.7v106.7c0 75.9-61.7 137.7-137.7 137.7z m-106.7-292c-26.2 0-47.6 21.4-47.6 47.6v106.7c0 26.2 21.4 47.6 47.6 47.6h106.7c26.2 0 47.6-21.4 47.6-47.6V255.4c0-26.2-21.4-47.6-47.6-47.6H235.7zM718.7 516c-35.3 0-70.5-13.4-97.4-40.3L549.6 404c-53.7-53.7-53.7-141.1 0-194.8l71.7-71.7c53.7-53.7 141.1-53.7 194.8 0l71.7 71.6c53.7 53.7 53.7 141.1 0 194.8l-71.7 71.7c-26.9 26.9-62.2 40.4-97.4 40.4z m0-328.6c-12.2 0-24.4 4.6-33.7 13.9L613.4 273c-9 9-13.9 20.9-13.9 33.7 0 12.7 5 24.7 13.9 33.7L685 412c18.6 18.6 48.8 18.6 67.3 0l71.7-71.7c9-9 13.9-20.9 13.9-33.7 0-12.7-5-24.7-13.9-33.7l-71.7-71.6c-9.2-9.3-21.4-13.9-33.6-13.9z" fill="#333333" p-id="7125"></path></svg>

+ 0 - 1
static/demo/svg/points.svg

@@ -1 +0,0 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1756115494148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7451" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M297 518.5c-3.3 0-6.6-0.4-9.9-1.1-132.8-30.1-218.6-110-218.6-203.6 0-120.9 144-215.5 327.9-215.5 135.9 0 255.4 52.6 304.5 134.1 12.7 21 5.9 48.3-15.1 61-21.1 12.7-48.3 5.9-61-15.1-32.3-53.6-126.3-91.1-228.4-91.1-140.9 0-239 66.8-239 126.7 0 48.9 61.4 97 149.3 116.9 23.9 5.4 38.9 29.2 33.5 53.2-4.5 20.5-22.9 34.5-43.2 34.5z" fill="#333333" p-id="7452"></path><path d="M297.1 719.3c-3.3 0-6.6-0.4-9.9-1.1-132.8-30.1-218.6-110-218.6-203.6V313.8c0-24.5 19.9-44.4 44.4-44.4s44.4 19.9 44.4 44.4v200.8c0 48.9 61.4 97 149.3 116.9 23.9 5.4 38.9 29.2 33.5 53.2-4.5 20.6-22.9 34.6-43.1 34.6z" fill="#333333" p-id="7453"></path><path d="M326.4 925.6c-2.2 0-4.5-0.2-6.8-0.5-147.8-22.7-251-109-251-209.7V514.6c0-24.5 19.9-44.4 44.4-44.4s44.4 19.9 44.4 44.4v200.8c0 54.1 75.5 106.5 175.6 121.9 24.3 3.7 40.9 26.4 37.2 50.7-3.3 21.9-22.2 37.6-43.8 37.6zM667.4 749.4c-162.6 0-290-87.5-290-199.1 0-111.7 127.4-199.1 290-199.1s290 87.5 290 199.1-127.4 199.1-290 199.1z m0-309.4c-118.5 0-201.1 58.1-201.1 110.3 0 52.1 82.6 110.2 201.1 110.2s201.1-58.1 201.1-110.2c0-52.2-82.6-110.3-201.1-110.3z" fill="#333333" p-id="7454"></path><path d="M667.4 930.9c-162.6 0-290-87.5-290-199.1V550.3c0-24.5 19.9-44.4 44.4-44.4s44.4 19.9 44.4 44.4v181.5c0 52.1 82.6 110.2 201.1 110.2s201.1-58.1 201.1-110.2V550.3c0-24.5 19.9-44.4 44.4-44.4s44.4 19.9 44.4 44.4v181.5c0.2 111.6-127.2 199.1-289.8 199.1z" fill="#333333" p-id="7455"></path></svg>

+ 0 - 1
static/demo/svg/shopping-cart.svg

@@ -1 +0,0 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1756115483803" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7288" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M772.2 654.3H425.6c-58.6 0-109.8-39.2-124.4-95.2l-90.5-346c-4.4-16.9-20.1-28.7-38.2-28.7h-65c-24.6 0-44.6-20-44.6-44.6s20-44.6 44.6-44.6h65c58.6 0 109.8 39.2 124.4 95.3l90.5 346c4.4 16.9 20.1 28.6 38.2 28.6h346.5c18.5 0 34.3-12.1 38.4-29.5l53.6-226.1c3.6-15-2.9-26.1-7-31.3-7.5-9.5-19-15-31.4-15H406.1c-24.6 0-44.6-20-44.6-44.6s20-44.6 44.6-44.6h419.7c39.8 0 76.7 17.8 101.3 48.8 24.1 30.5 32.8 69.5 23.9 107.2l-53.6 226.1c-13.8 57.9-65.3 98.2-125.2 98.2zM378.5 929.2c-69.4 0-125.8-56.5-125.8-125.9s56.4-125.9 125.8-125.9 125.9 56.5 125.9 125.9c-0.1 69.5-56.5 125.9-125.9 125.9z m0-162.6c-20.2 0-36.7 16.5-36.7 36.7 0 20.3 16.5 36.7 36.7 36.7 20.3 0 36.7-16.5 36.7-36.7 0-20.2-16.5-36.7-36.7-36.7zM769.8 929.2c-69.4 0-125.8-56.5-125.8-125.9s56.4-125.9 125.8-125.9 125.9 56.5 125.9 125.9c0 69.5-56.5 125.9-125.9 125.9z m0-162.6c-20.2 0-36.7 16.5-36.7 36.7 0 20.3 16.5 36.7 36.7 36.7 20.3 0 36.7-16.5 36.7-36.7 0.1-20.2-16.4-36.7-36.7-36.7z" fill="#333333" p-id="7289"></path><path d="M682.2 455.2H506c-24.6 0-44.6-20-44.6-44.6s20-44.6 44.6-44.6h176.2c24.6 0 44.6 20 44.6 44.6-0.1 24.7-20 44.6-44.6 44.6z" fill="#333333" p-id="7290"></path></svg>

BIN
static/demo/tabbar/home.png


BIN
static/demo/tabbar/home2.png


BIN
static/demo/tabbar/music.png


BIN
static/demo/tabbar/music2.png


BIN
static/demo/tabbar/my.png


BIN
static/demo/tabbar/my2.png


BIN
static/demo/tabbar/sleep.png


BIN
static/demo/tabbar/sleep2.png


BIN
static/empty/comm.png


BIN
static/home/1.jpg


BIN
static/home/12.png


BIN
static/home/21.png


BIN
static/home/8.png


BIN
static/home/back.png


BIN
static/home/亮黄闪电图标.png


BIN
static/home/冰块.png


BIN
static/home/卡通贴纸_透明图.png


BIN
static/home/去除图片中间的桌子.png


BIN
static/home/喇叭.png


BIN
static/home/宝箱_透明图.png


BIN
static/home/彩虹烧杯_透明图.png


BIN
static/home/灯泡.png


BIN
static/home/红哑铃图标.png


BIN
static/home/组 5.png


BIN
static/home/组 6.png


BIN
static/home/组 7.png


BIN
static/home/蓝黄机械齿轮.png


BIN
static/icon/tabbar/home.png


BIN
static/icon/tabbar/home2.png


BIN
static/icon/tabbar/my.png


BIN
static/icon/tabbar/my2.png


BIN
static/icon/tabbar/template.png


BIN
static/icon/tabbar/template2.png


+ 1 - 1
tailwind.config.ts

@@ -452,7 +452,7 @@ export default {
 	theme: {
 		extend: {
 			colors: {
-				...getPrimary("teal"),
+				...getPrimary("blue"),
 				...getSurface("zinc")
 			},
 			fontSize: {

+ 1 - 0
vite.config.ts

@@ -10,6 +10,7 @@ const resolve = (dir: string) => join(__dirname, dir);
 for (const i in proxy) {
 	proxy[`/${i}`] = proxy[i];
 }
+console.log(proxy);
 
 export default defineConfig({
 	plugins: [