소스 검색

feat: 角色选择页

chenjj 1 개월 전
부모
커밋
042fe228c6
6개의 변경된 파일109개의 추가작업 그리고 46개의 파일을 삭제
  1. 1 1
      config.js
  2. 106 43
      pages/UserSelection.vue
  3. 1 1
      pages/goodsDetails/goodsDetails.vue
  4. 1 1
      pages_classify/pages/orderItem/orderdetails.vue
  5. BIN
      static/img/admin.png
  6. BIN
      static/img/user.png

+ 1 - 1
config.js

@@ -3,7 +3,7 @@ const config = {
 	// baseUrl: 'https://vue.ruoyi.vip/prod-api',
 	//cloud后台网关地址
 	// baseUrl: 'http://192.168.10.3:8080',
-	baseUrl: 'http://192.168.100.132:9527',
+	baseUrl: 'http://192.168.100.86:9527',
 	// 应用信息
 	appInfo: {
 		// 应用名称

+ 106 - 43
pages/UserSelection.vue

@@ -1,75 +1,138 @@
 <template>
 	<view class="container">
-		<view class="Wrap">
+		<!-- <view class="Wrap">
 			<text class="Wraph1">欢迎使用</text>
 		</view>
 		<view>
 			<text>请选择您的身份开始使用</text>
 		</view>
-		<!-- 用户部分 -->
 		<view class="button-group">
 			<up-button type="success" shape="circle" class="button" @click="handleBtn(1)">用户</up-button>
 		</view>
 		<image src="../static/FRAME.png" style="background-color: red;"></image>
 		<image src="../static/img_v3_02le_9fee240d-00fc-4f42-9391-4801b614cb9g.png"
 			style="background-color: red; width: 80rpx; height: 60rpx;"></image>
-		<!-- 志愿者部分 -->
 		<view class="button-group">
 			<up-button type="success" shape="circle" class="button" @click="handleBtn(2)">志愿者</up-button>
+		</view> -->
+
+		<view class="select-title">欢迎使用</view>
+		<view class="select-text">请选择您的身份开始使用</view>
+		<view class="select-box">
+			<view v-for="item in list" :key="item.key" class="select-item" :style="{ background: item.bgcColor }" @click="handleBtn(item.key)">
+				<view class="select-img">
+					<img :src="item.icon" alt="" style="width: 48px;height: 48px;">
+				</view>
+				<view class="select-text-box">
+					<view class="select-lable">{{ item.label }}</view>
+					<view class="select-box-text">{{ item.text }}</view>
+				</view>
+			</view>
 		</view>
+
 	</view>
 </template>
 
 <script setup>
-	import {
-		userOrWorker
-	} from '@/api/login';
+import {
+	userOrWorker
+} from '@/api/login';
 
-	import store from "@/store"
+import store from "@/store"
 
-	const imagePath1 = '/static/志愿者.png';
-	const imagePath2 = '/static/用户.png';
+const list = [
+	{
+		label: '我是用户',
+		text: '寻找并预约服务',
+		icon: '/static/img/user.png',
+		key: 1,
+		bgcColor: 'linear-gradient(135deg, rgba(45, 58, 78, 1) 0%, rgba(61, 74, 94, 1) 100%), rgba(0, 0, 0, 0)'
+	},
+	{
+		label: '我是志愿者',
+		text: '提供专业服务',
+		icon: '/static/img/admin.png',
+		key: 2,
+		bgcColor: 'linear-gradient(135deg, rgba(16, 185, 129, 1) 0%, rgba(32, 201, 145, 1) 100%), rgba(0, 0, 0, 0)'
+	}
+]
 
-	function handleBtn(userType = 0) { // 默认值 0
-		const params = {
-			userType: userType // 使用传入的 userType
-		};
-		// 把 userType 存入本地存储
-		uni.setStorageSync('userType', userType);
+function handleBtn(userType = 0) { // 默认值 0
+	const params = {
+		userType: userType // 使用传入的 userType
+	};
+	// 把 userType 存入本地存储
+	uni.setStorageSync('userType', userType);
 
-		userOrWorker(params)
-			.then(res => {
-				// 重新拉取用户信息,储存本地
-				store.dispatch('GetInfo').then(() => {
-					uni.reLaunch({
-						url: '/pages/index'
-					});
-				})
+	userOrWorker(params)
+		.then(res => {
+			// 重新拉取用户信息,储存本地
+			store.dispatch('GetInfo').then(() => {
+				uni.reLaunch({
+					url: '/pages/index'
+				});
 			})
-			.catch(err => {
-				console.error('设置失败:', err);
-			});
-	}
+		})
+		.catch(err => {
+			console.error('设置失败:', err);
+		});
+}
 </script>
 
-<style scoped>
-	.Wrap {
-		left: 0rpx;
-		top: 0rpx;
-		width: 342rpx;
-		height: 80rpx;
-		opacity: 1;
-		background: rgba(0, 0, 0, 0);
-	}
-
-	.Wraph1 {
+<style scoped lang="scss">
+.container {
+	padding: 28px 24px;
+	display: flex;
+	flex-direction: column;
+	align-items: center;
 
-		font-size: 30rpx;
+	.select-title {
+		font-size: 30px;
 		font-weight: 400;
-		letter-spacing: 0rpx;
-		line-height: 36rpx;
+		line-height: 36px;
 		color: rgba(45, 58, 78, 1);
-		text-align: center;
-		vertical-align: middle;
+		margin-bottom: 14px;
+	}
+
+	.select-text {
+		font-size: 16px;
+		font-weight: 400;
+		line-height: 24px;
+		color: rgba(75, 85, 99, 1);
+		margin-bottom: 50px;
+	}
+
+	.select-box {
+		width: 100%;
+
+		.select-item {
+			padding: 24px;
+			display: flex;
+			align-items: center;
+			border-radius: 16px;
+			margin-bottom: 24px;
+			.select-img {
+				margin-right: 24px;
+
+			}
+
+			.select-text-box {
+				.select-lable {
+					font-size: 20px;
+					font-weight: 400;
+					line-height: 28px;
+					color: #fff;
+					margin-bottom: 8px;
+				}
+
+				.select-box-text {
+					font-size: 16px;
+					font-weight: 400;
+					line-height: 24px;
+					color: #fff;
+				}
+			}
+		}
 	}
+}
 </style>

+ 1 - 1
pages/goodsDetails/goodsDetails.vue

@@ -28,7 +28,7 @@
 			</up-card>
 			<up-card title="证书" :thumb="thumb" :head-style="{ height: '80rpx', padding: '20rpx',}">
 				<template #body>
-					<image src="../../static/zhiyuanzhe.jpg" mode="" style="width: 100%;"></image>
+					<image src="/static/zhiyuanzhe.jpg" mode="" style="width: 100%;"></image>
 				</template>
 			</up-card>
 			<!-- 固定底部按钮区 -->

+ 1 - 1
pages_classify/pages/orderItem/orderdetails.vue

@@ -41,7 +41,7 @@
 			</up-card>
 			<up-card title="证书" :head-style="{ height: '80rpx', padding: '20rpx',}">
 				<template #body>
-					<image src="../../static/zhiyuanzhe.jpg" mode="" style="width: 100%;"></image>
+					<image src="/static/zhiyuanzhe.jpg" mode="" style="width: 100%;"></image>
 				</template>
 			</up-card>
 		</view>

BIN
static/img/admin.png


BIN
static/img/user.png