任务提交
This commit is contained in:
parent
b004356582
commit
6c73c78473
@ -1,67 +1,79 @@
|
|||||||
// 参数接口
|
// 参数接口
|
||||||
|
|
||||||
// 响应接口
|
// 响应接口
|
||||||
import { get, post } from "@/utils/request";
|
import {get, post} from "@/utils/request";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取服务器时间
|
* 获取服务器时间
|
||||||
*/
|
*/
|
||||||
export const xqgwFindAllApi = async () => {
|
export const xqgwFindAllApi = async () => {
|
||||||
return await get("/api/xqgw/findAll");
|
return await get("/api/xqgw/findAll");
|
||||||
};
|
};
|
||||||
export const xqxjFindAllApi = async () => {
|
export const xqxjFindAllApi = async () => {
|
||||||
return await get("/api/xqxj/findAll");
|
return await get("/api/xqxj/findAll");
|
||||||
};
|
};
|
||||||
export const findAllNjBjTreeApi = async () => {
|
export const findAllNjBjTreeApi = async () => {
|
||||||
return await get("/api/nj/findAllNjBjTree");
|
return await get("/api/nj/findAllNjBjTree");
|
||||||
};
|
};
|
||||||
export const kmFindAllApi = async () => {
|
export const kmFindAllApi = async () => {
|
||||||
return await get("/api/km/findAll");
|
return await get("/api/km/findAll");
|
||||||
};
|
};
|
||||||
export const findAllXxXqNjTree = async () => {
|
export const findAllXxXqNjTree = async () => {
|
||||||
return await get("/api/nj/findAllXxXqNjTree");
|
return await get("/api/nj/findAllXxXqNjTree");
|
||||||
};
|
};
|
||||||
export const findAllNjBjTree = async () => {
|
export const findAllNjBjTree = async () => {
|
||||||
return await get("/api/nj/findAllNjBjTree");
|
return await get("/api/nj/findAllNjBjTree");
|
||||||
};
|
};
|
||||||
export const jsConfirmJsDataApi = async (params: any) => {
|
export const jsConfirmJsDataApi = async (params: any) => {
|
||||||
return await post("/api/js/confirmJsData", params);
|
return await post("/api/js/confirmJsData", params);
|
||||||
};
|
};
|
||||||
export const jsdFindPageTaskApi = async (params: any) => {
|
export const jsdFindPageTaskApi = async (params: any) => {
|
||||||
return await get("/api/jsd/findPageTask", params);
|
return await get("/api/jsd/findPageTask", params);
|
||||||
};
|
};
|
||||||
|
export const rwflFindRwlxsByRwId = async (params: any) => {
|
||||||
|
return await get("/api/rwlx/findRwlxsByRwId", params);
|
||||||
|
}
|
||||||
|
export const rwzxSaveApi = async (params: any) => {
|
||||||
|
return await post("/api/rwzx/save", params);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export const rwFindInfoByRwId = async (params: any) => {
|
||||||
|
return await get("/api/rw/findInfoByRwId", params);
|
||||||
|
}
|
||||||
|
|
||||||
export const fractionRuleApi = async () => {
|
export const fractionRuleApi = async () => {
|
||||||
return await get(
|
return await get(
|
||||||
"/api/fractionRule/findAllByItemId?itemId=CDFDED2A704F46E2A4D7E8816968BD23"
|
"/api/fractionRule/findAllByItemId?itemId=CDFDED2A704F46E2A4D7E8816968BD23"
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export const fractionRuleApi1 = async () => {
|
export const fractionRuleApi1 = async () => {
|
||||||
return await get(
|
return await get(
|
||||||
"/api/fractionRule/findAllByItemId?itemId=B96A0FA22C414F71A3E1CDCA7E206B10"
|
"/api/fractionRule/findAllByItemId?itemId=B96A0FA22C414F71A3E1CDCA7E206B10"
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 查询教师信息
|
// 查询教师信息
|
||||||
export const jsdfindJsByPhoneApi = async (params: any) => {
|
export const jsdfindJsByPhoneApi = async (params: any) => {
|
||||||
return await get("/api/js/findJsByPhone", params);
|
return await get("/api/js/findJsByPhone", params);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选课列表
|
// 选课列表
|
||||||
export const jsdXkListApi = async (params: any) => {
|
export const jsdXkListApi = async (params: any) => {
|
||||||
return await get("/mobile/js/xk/list", params);
|
return await get("/mobile/js/xk/list", params);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选课列表
|
// 选课列表
|
||||||
export const jsdXkkcSaveApi = async (params: any) => {
|
export const jsdXkkcSaveApi = async (params: any) => {
|
||||||
return await post("/api/xkkc/save", params);
|
return await post("/api/xkkc/save", params);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选课学生列表
|
// 选课学生列表
|
||||||
export const jsdXkXsListApi = async (params: any) => {
|
export const jsdXkXsListApi = async (params: any) => {
|
||||||
return await get("/mobile/js/xkxs/list", params);
|
return await get("/mobile/js/xkxs/list", params);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 提交点名信息
|
// 提交点名信息
|
||||||
export const jsdXkdmListApi = async (params: any) => {
|
export const jsdXkdmListApi = async (params: any) => {
|
||||||
return await post("/mobile/js/xkdm/add", params);
|
return await post("/mobile/js/xkdm/add", params);
|
||||||
};
|
};
|
||||||
@ -87,6 +87,7 @@ export function useForm(options: FormOptions): UseForm {
|
|||||||
function algorithm(schemaItem: FormsSchema) {
|
function algorithm(schemaItem: FormsSchema) {
|
||||||
let upSchemaList: FormsSchema = options.schema.filter(item => item.field === schemaItem.field)[0]
|
let upSchemaList: FormsSchema = options.schema.filter(item => item.field === schemaItem.field)[0]
|
||||||
for (const key in schemaItem) {
|
for (const key in schemaItem) {
|
||||||
|
//console.log(11,key,schemaItem[key],typeof schemaItem[key])
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (typeof schemaItem[key] === 'object') {
|
if (typeof schemaItem[key] === 'object') {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|||||||
@ -2,32 +2,37 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="message-detail-page">
|
<view class="message-detail-page">
|
||||||
<view v-if="isLoading" class="loading-indicator">加载中...</view>
|
<view v-if="isLoading" class="loading-indicator">加载中...</view>
|
||||||
<view v-else-if="messageDetail" class="detail-content">
|
<view v-else class="detail-content">
|
||||||
<view class="detail-header">
|
<view class="detail-header">
|
||||||
<view class="title-tag-row">
|
<view class="title-tag-row">
|
||||||
<text class="detail-title">{{ messageDetail.title }}</text>
|
<text class="detail-title">{{ rw.rwmc }}</text>
|
||||||
<view class="tag" :class="messageDetail.tagType">{{ messageDetail.tagText }}</view>
|
<view class="tag" :class="messageDetail.tagType">{{ messageDetail.tagText }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail-meta">
|
<view class="detail-meta">
|
||||||
<text>{{ messageDetail.date }}</text>
|
<text>{{ rw.rwkstime }}</text>
|
||||||
<text>{{ messageDetail.timeAgo }}</text>
|
<!-- <text>{{ messageDetail.timeAgo }}</text>-->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail-body">
|
<view class="detail-body">
|
||||||
<text class="detail-desc">{{ messageDetail.desc }}</text>
|
<BasicForm :schema="schema" v-model="formData">
|
||||||
<!-- Add more detailed content here as needed -->
|
|
||||||
|
</BasicForm>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail-footer">
|
<view class="detail-footer">
|
||||||
<button type="primary" class="action-button">处理</button>
|
<button type="primary" class="action-button" @click="saveRwZx">处理</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="empty-state">消息详情未找到</view>
|
<!-- <view v-else class="empty-state">消息详情未找到</view>-->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import {ref} from 'vue';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import {onLoad} from '@dcloudio/uni-app';
|
||||||
|
import {rwFindInfoByRwId, rwflFindRwlxsByRwId, rwzxSaveApi} from "@/api/base/server";
|
||||||
|
import {useForm} from "@/components/BasicForm/hooks/useForm";
|
||||||
|
import {navigateBack, showToast} from "@/utils/uniapp";
|
||||||
|
import {useUserStore} from "@/store/modules/user";
|
||||||
|
|
||||||
interface MessageDetail {
|
interface MessageDetail {
|
||||||
id: string; // Assuming an ID is passed or can be derived
|
id: string; // Assuming an ID is passed or can be derived
|
||||||
@ -40,54 +45,106 @@ interface MessageDetail {
|
|||||||
// Add other fields as necessary
|
// Add other fields as necessary
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formData = ref({})
|
||||||
const messageId = ref<string>('');
|
const messageId = ref<string>('');
|
||||||
const messageDetail = ref<MessageDetail | null>(null);
|
const messageDetail = ref<MessageDetail | null>({
|
||||||
|
id: 'todo1',
|
||||||
|
title: '教务通知 (待办)',
|
||||||
|
desc: '学校召开期初教学准备会议暨首次教学工作例会. 会议强调了新学期的教学重点和要求,请各位老师认真准备。',
|
||||||
|
date: '2025-02-17',
|
||||||
|
timeAgo: '8 mins 前',
|
||||||
|
tagText: '通知',
|
||||||
|
tagType: 'notice',
|
||||||
|
likes: 6,
|
||||||
|
comments: 12
|
||||||
|
});
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
|
const rwflx: any = ref([])
|
||||||
|
const rw = ref({})
|
||||||
|
const schema = reactive<FormsSchema[]>([])
|
||||||
|
const {getUser} = useUserStore()
|
||||||
|
|
||||||
onLoad((options) => {
|
async function saveRwZx() {
|
||||||
// Assume the identifier is passed as 'id' query parameter
|
console.log(222, formData.value)
|
||||||
// If you pass the whole object, you can parse it here
|
const result = [];
|
||||||
|
for (let i = 0; i < rwflx.value.length; i++) {
|
||||||
|
console.log(44, rwflx.value[i].id, formData.value[rwflx.value[i].id])
|
||||||
|
if (rwflx.value[i].rwbs && (!formData.value[rwflx.value[i].id] || formData.value[rwflx.value[i].id] == "")) {
|
||||||
|
showToast("请填写必填项!")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result.push({
|
||||||
|
rwlxId: rwflx.value[i].id,
|
||||||
|
rwzxqdtx: formData.value[rwflx.value[i].id],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
await rwzxSaveApi({
|
||||||
|
mobile: getUser.mobile,
|
||||||
|
rwId: rw.value.id,
|
||||||
|
rwzxqdDtos: result
|
||||||
|
})
|
||||||
|
showToast("操作成功!");
|
||||||
|
navigateBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
onLoad(async (options) => {
|
||||||
if (options && options.id) {
|
if (options && options.id) {
|
||||||
messageId.value = decodeURIComponent(options.id); // Decode if necessary
|
const {result} = await rwFindInfoByRwId({
|
||||||
fetchMessageDetail();
|
rwId: options.id
|
||||||
|
});
|
||||||
|
rwflx.value = result.rwlxes;
|
||||||
|
rw.value = result;
|
||||||
|
for (let i = 0; i < rwflx.value.length; i++) {
|
||||||
|
if (rwflx.value[i].rwfl == "sctp" || rwflx.value[i].rwfl == "scsp" || rwflx.value[i].rwfl == "scwd") {
|
||||||
|
schema.push({
|
||||||
|
field: `${rwflx.value[i].id}`,
|
||||||
|
label: `${rwflx.value[i].rwbt}`,
|
||||||
|
component: "BasicUpload",
|
||||||
|
required: rwflx.value[i].rwbs,
|
||||||
|
componentProps: {}
|
||||||
|
})
|
||||||
|
} else if (rwflx.value[i].rwfl == "text") {
|
||||||
|
schema.push({
|
||||||
|
field: `${rwflx.value[i].id}`,
|
||||||
|
label: `${rwflx.value[i].rwbt}`,
|
||||||
|
component: "BasicInput",
|
||||||
|
required: rwflx.value[i].rwbs,
|
||||||
|
itemProps: {
|
||||||
|
labelPosition: "top",
|
||||||
|
},
|
||||||
|
componentProps: {
|
||||||
|
type: "textarea",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} else if (rwflx.value[i].rwfl == "dxsx" || rwflx.value[i].rwfl == "dxxz") {
|
||||||
|
let options = rwflx.value[i].remark.split(";");
|
||||||
|
let range = [];
|
||||||
|
for (let i = 0; i < options.length; i++) {
|
||||||
|
range.push({
|
||||||
|
name: options[i]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
schema.push({
|
||||||
|
field: `${rwflx.value[i].id}`,
|
||||||
|
label: `${rwflx.value[i].rwbt}`,
|
||||||
|
component: "BasicPicker",
|
||||||
|
required: rwflx.value[i].rwbs,
|
||||||
|
itemProps: {
|
||||||
|
labelPosition: "top",
|
||||||
|
},
|
||||||
|
componentProps: {
|
||||||
|
range: range,
|
||||||
|
rangeKey: "name",
|
||||||
|
savaKey: "name",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error('Message ID/Data is missing!');
|
console.error('Message ID/Data is missing!');
|
||||||
uni.showToast({ title: '加载失败,缺少信息', icon: 'none' });
|
uni.showToast({title: '加载失败,缺少信息', icon: 'none'});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 模拟获取消息详情数据
|
|
||||||
const fetchMessageDetail = async () => {
|
|
||||||
console.log(`Fetching details for message ID: ${messageId.value}`);
|
|
||||||
isLoading.value = true;
|
|
||||||
await new Promise(resolve => setTimeout(resolve, 300));
|
|
||||||
|
|
||||||
// --- Replace with actual API call using messageId.value ---
|
|
||||||
|
|
||||||
// Find the mock data based on the passed identifier (using title as ID for now)
|
|
||||||
const mockTodoList = [
|
|
||||||
{ id: 'todo1', title: '教务通知 (待办)', desc: '学校召开期初教学准备会议暨首次教学工作例会. 会议强调了新学期的教学重点和要求,请各位老师认真准备。', date: '2025-02-17', timeAgo: '8 mins 前', tagText: '通知', tagType: 'notice', likes: 6, comments: 12 },
|
|
||||||
{ id: 'todo2', title: '教学日志 (待办)', desc: '请于2025年3月15日前上传教学日志,确保内容详实、准确。日志系统入口已在办公平台开放。', date: '2025-02-17', timeAgo: '8 mins 前', tagText: '任务', tagType: 'task', likes: 6, comments: 12 },
|
|
||||||
// Add mock data for '已办' if needed, or handle different types
|
|
||||||
{ id: 'done1', title: '审批完成 (已办)', desc: '您的请假申请已审批通过。', date: '2025-02-16', timeAgo: '1 天前', tagText: '审批', tagType: 'approval', likes: 0, comments: 0 },
|
|
||||||
];
|
|
||||||
|
|
||||||
// Find based on ID (or title if ID is not directly available)
|
|
||||||
messageDetail.value = mockTodoList.find(item => item.id === messageId.value || item.title === messageId.value) || null;
|
|
||||||
|
|
||||||
isLoading.value = false;
|
|
||||||
|
|
||||||
if (!messageDetail.value) {
|
|
||||||
console.error(`Details not found for message ID: ${messageId.value}`);
|
|
||||||
uni.showToast({ title: '未找到消息详情', icon: 'none' });
|
|
||||||
} else {
|
|
||||||
// Set navigation bar title dynamically
|
|
||||||
uni.setNavigationBarTitle({
|
|
||||||
title: messageDetail.value.tagText || '消息详情'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@ -119,10 +176,10 @@ const fetchMessageDetail = async () => {
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
|
||||||
.title-tag-row {
|
.title-tag-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: flex-start; // Align items to the top
|
align-items: flex-start; // Align items to the top
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.detail-title {
|
.detail-title {
|
||||||
@ -143,16 +200,28 @@ const fetchMessageDetail = async () => {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
flex-shrink: 0; // Prevent tag from shrinking
|
flex-shrink: 0; // Prevent tag from shrinking
|
||||||
|
|
||||||
&.notice { background-color: #447ade; }
|
&.notice {
|
||||||
&.task { background-color: #19be6b; }
|
background-color: #447ade;
|
||||||
&.approval { background-color: #ff9f0a; }
|
}
|
||||||
&.submit { background-color: #8e8e93; }
|
|
||||||
|
&.task {
|
||||||
|
background-color: #19be6b;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.approval {
|
||||||
|
background-color: #ff9f0a;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.submit {
|
||||||
|
background-color: #8e8e93;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.detail-meta {
|
.detail-meta {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #999;
|
color: #999;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
@ -161,6 +230,7 @@ const fetchMessageDetail = async () => {
|
|||||||
|
|
||||||
.detail-body {
|
.detail-body {
|
||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
|
|
||||||
.detail-desc {
|
.detail-desc {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
color: #555;
|
color: #555;
|
||||||
@ -176,16 +246,16 @@ const fetchMessageDetail = async () => {
|
|||||||
|
|
||||||
// Style for the action button
|
// Style for the action button
|
||||||
.action-button {
|
.action-button {
|
||||||
width: 100%; // Make button full width
|
width: 100%; // Make button full width
|
||||||
height: 44px; // Standard button height
|
height: 44px; // Standard button height
|
||||||
line-height: 44px; // Match height for vertical centering
|
line-height: 44px; // Match height for vertical centering
|
||||||
font-size: 16px; // Slightly larger font
|
font-size: 16px; // Slightly larger font
|
||||||
font-weight: 500; // Medium weight
|
font-weight: 500; // Medium weight
|
||||||
border-radius: 8px; // Consistent border radius
|
border-radius: 8px; // Consistent border radius
|
||||||
margin-top: 20px; // Add space above the button
|
margin-top: 20px; // Add space above the button
|
||||||
// Ensure primary color is applied correctly (uni-app default should work)
|
// Ensure primary color is applied correctly (uni-app default should work)
|
||||||
// background-color: #447ade;
|
// background-color: #447ade;
|
||||||
// color: #ffffff;
|
// color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@ -113,12 +113,21 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const goToDetail = (data: any) => {
|
const goToDetail = (data: any) => {
|
||||||
|
if (currentTab.value != 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// if(true){
|
||||||
|
// const encodedTitle = encodeURIComponent("教学日志 (待办)");
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: `/pages/base/message/detail?id=${encodedTitle}`
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
// Ensure data and data.id exist before navigating
|
// Ensure data and data.id exist before navigating
|
||||||
if (data && data.id) {
|
if (data && data.id) {
|
||||||
// Encode the ID in case it contains special characters
|
// Encode the ID in case it contains special characters
|
||||||
const encodedId = encodeURIComponent(data.id);
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/base/message/detail?id=${encodedId}`
|
url: `/pages/base/message/detail?id=${data.id}`
|
||||||
});
|
});
|
||||||
} else if (data && data.rwmc) {
|
} else if (data && data.rwmc) {
|
||||||
// Fallback: use title if id is missing (less reliable)
|
// Fallback: use title if id is missing (less reliable)
|
||||||
|
|||||||
@ -2,34 +2,34 @@
|
|||||||
<view class="register-container p-30">
|
<view class="register-container p-30">
|
||||||
<!-- 顶部 Logo -->
|
<!-- 顶部 Logo -->
|
||||||
<image
|
<image
|
||||||
class="logo"
|
class="logo"
|
||||||
src="@/static/system/login/logo.png"
|
src="@/static/system/login/logo.png"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
></image>
|
></image>
|
||||||
|
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<view class="form-card">
|
<view class="form-card">
|
||||||
<!-- 头像和标题 -->
|
<!-- 头像和标题 -->
|
||||||
<view
|
<view
|
||||||
class="wi-180 he-240 mx-auto r-md mb-20"
|
class="wi-180 he-240 mx-auto r-md mb-20"
|
||||||
style="border: 1px solid #cccccc"
|
style="border: 1px solid #cccccc"
|
||||||
>
|
>
|
||||||
<CustomUpload @select="afterRead" :sourceType="['camera']">
|
<CustomUpload @select="afterRead" :sourceType="['camera']">
|
||||||
<view class="wh-full flex-col-center">
|
<view class="wh-full flex-col-center">
|
||||||
<svg
|
<svg
|
||||||
t="1729656215869"
|
t="1729656215869"
|
||||||
class="icon"
|
class="icon"
|
||||||
viewBox="0 0 1024 1024"
|
viewBox="0 0 1024 1024"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
p-id="5302"
|
p-id="5302"
|
||||||
width="32"
|
width="32"
|
||||||
height="32"
|
height="32"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
d="M851.552 890.88 172.448 890.88c-74.592 0-135.296-60.672-135.296-135.296L37.152 370.752c0-74.624 60.672-135.328 135.296-135.328l132.16 0L302.912 195.904c0-34.624 28.192-62.816 62.816-62.816l302.016 0c29.408 0 53.312 23.904 53.312 53.312l0 49.024 130.464 0c74.592 0 135.296 60.672 135.296 135.328l0 384.832C986.816 830.208 926.144 890.88 851.552 890.88zM172.448 283.456c-48.128 0-87.296 39.168-87.296 87.328l0 384.832c0 48.128 39.168 87.296 87.296 87.296l679.104 0c48.128 0 87.296-39.168 87.296-87.296L938.848 370.752c0-48.16-39.168-87.328-87.296-87.328L716.8 283.424c-24.096 0-43.712-19.616-43.712-43.712L673.088 186.4c0-2.944-2.368-5.312-5.312-5.312l-302.016 0c-8.16 0-14.816 6.656-14.816 14.816L350.944 237.12c0 25.536-20.768 46.304-46.304 46.304L172.448 283.424zM512 755.84c-107.04 0-194.08-87.072-194.08-194.08S404.992 367.68 512 367.68s194.08 87.072 194.08 194.08S619.04 755.84 512 755.84zM512 415.68c-80.576 0-146.08 65.536-146.08 146.08S431.456 707.84 512 707.84s146.08-65.536 146.08-146.08S592.576 415.68 512 415.68zM816.8 438.016c-25.568 0-46.336-20.768-46.336-46.336s20.768-46.336 46.336-46.336 46.336 20.768 46.336 46.336S842.368 438.016 816.8 438.016zM816.8 390.016l-1.664 1.664c0 0.896 0.736 1.664 1.664 1.664L816.8 390.016z"
|
d="M851.552 890.88 172.448 890.88c-74.592 0-135.296-60.672-135.296-135.296L37.152 370.752c0-74.624 60.672-135.328 135.296-135.328l132.16 0L302.912 195.904c0-34.624 28.192-62.816 62.816-62.816l302.016 0c29.408 0 53.312 23.904 53.312 53.312l0 49.024 130.464 0c74.592 0 135.296 60.672 135.296 135.328l0 384.832C986.816 830.208 926.144 890.88 851.552 890.88zM172.448 283.456c-48.128 0-87.296 39.168-87.296 87.328l0 384.832c0 48.128 39.168 87.296 87.296 87.296l679.104 0c48.128 0 87.296-39.168 87.296-87.296L938.848 370.752c0-48.16-39.168-87.328-87.296-87.328L716.8 283.424c-24.096 0-43.712-19.616-43.712-43.712L673.088 186.4c0-2.944-2.368-5.312-5.312-5.312l-302.016 0c-8.16 0-14.816 6.656-14.816 14.816L350.944 237.12c0 25.536-20.768 46.304-46.304 46.304L172.448 283.424zM512 755.84c-107.04 0-194.08-87.072-194.08-194.08S404.992 367.68 512 367.68s194.08 87.072 194.08 194.08S619.04 755.84 512 755.84zM512 415.68c-80.576 0-146.08 65.536-146.08 146.08S431.456 707.84 512 707.84s146.08-65.536 146.08-146.08S592.576 415.68 512 415.68zM816.8 438.016c-25.568 0-46.336-20.768-46.336-46.336s20.768-46.336 46.336-46.336 46.336 20.768 46.336 46.336S842.368 438.016 816.8 438.016zM816.8 390.016l-1.664 1.664c0 0.896 0.736 1.664 1.664 1.664L816.8 390.016z"
|
||||||
fill="#cdcdcd"
|
fill="#cdcdcd"
|
||||||
p-id="5303"
|
p-id="5303"
|
||||||
></path>
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
</view>
|
</view>
|
||||||
@ -40,37 +40,46 @@
|
|||||||
<!-- 输入框 -->
|
<!-- 输入框 -->
|
||||||
<view class="input-group">
|
<view class="input-group">
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<text class="label"><text class="required">*</text>姓名:</text>
|
<text class="label">
|
||||||
|
<text class="required">*</text>
|
||||||
|
姓名:
|
||||||
|
</text>
|
||||||
<input
|
<input
|
||||||
class="input-field"
|
class="input-field"
|
||||||
type="text"
|
type="text"
|
||||||
v-model="formData.loginName"
|
v-model="formData.loginName"
|
||||||
placeholder="请输入姓名"
|
placeholder="请输入姓名"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<text class="label"><text class="required">*</text>手机号码:</text>
|
<text class="label">
|
||||||
|
<text class="required">*</text>
|
||||||
|
手机号码:
|
||||||
|
</text>
|
||||||
<input
|
<input
|
||||||
class="input-field"
|
class="input-field"
|
||||||
type="number"
|
type="number"
|
||||||
v-model="formData.phone"
|
v-model="formData.phone"
|
||||||
placeholder="请输入手机号码"
|
placeholder="请输入手机号码"
|
||||||
maxlength="11"
|
maxlength="11"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="input-item verification-code-item">
|
<view class="input-item verification-code-item">
|
||||||
<text class="label"><text class="required">*</text>验证码:</text>
|
<text class="label">
|
||||||
|
<text class="required">*</text>
|
||||||
|
验证码:
|
||||||
|
</text>
|
||||||
<input
|
<input
|
||||||
class="input-field verification-code-input"
|
class="input-field verification-code-input"
|
||||||
type="number"
|
type="number"
|
||||||
v-model="formData.code"
|
v-model="formData.code"
|
||||||
placeholder="请输入验证码"
|
placeholder="请输入验证码"
|
||||||
maxlength="6"
|
maxlength="6"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
class="get-code-btn"
|
class="get-code-btn"
|
||||||
:disabled="isCountingDown"
|
:disabled="isCountingDown"
|
||||||
@click="handleGetCode"
|
@click="handleGetCode"
|
||||||
>
|
>
|
||||||
{{ countdownText }}
|
{{ countdownText }}
|
||||||
</button>
|
</button>
|
||||||
@ -84,19 +93,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, computed } from "vue";
|
import {ref, reactive, computed} from "vue";
|
||||||
import CustomUpload from "/src/components/BasicUpload/CustomUpload.vue";
|
import CustomUpload from "/src/components/BasicUpload/CustomUpload.vue";
|
||||||
import { onUnmounted } from "vue";
|
import {onUnmounted} from "vue";
|
||||||
import { hideLoading, isTabBar, showLoading } from "@/utils/uniapp";
|
import {hideLoading, isTabBar, showLoading} from "@/utils/uniapp";
|
||||||
import { attachmentUpload } from "@/api/system/upload";
|
import {attachmentUpload} from "@/api/system/upload";
|
||||||
import { useDataStore } from "@/store/modules/data";
|
import {useDataStore} from "@/store/modules/data";
|
||||||
import {
|
import {
|
||||||
findJsByPhoneApi,
|
findJsByPhoneApi,
|
||||||
sendCodeApi,
|
sendCodeApi,
|
||||||
updateUserApi,
|
updateUserApi,
|
||||||
} from "@/api/system/login";
|
} from "@/api/system/login";
|
||||||
import { useUserStore } from "@/store/modules/user";
|
import {useUserStore} from "@/store/modules/user";
|
||||||
const { getGlobal } = useDataStore();
|
|
||||||
|
const {getGlobal} = useDataStore();
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
loginName: "",
|
loginName: "",
|
||||||
phone: "",
|
phone: "",
|
||||||
@ -118,7 +128,7 @@ const handleGetCode = async () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!formData.phone) {
|
if (!formData.phone) {
|
||||||
uni.showToast({ title: "请输入手机号码", icon: "none" });
|
uni.showToast({title: "请输入手机号码", icon: "none"});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,9 +137,9 @@ const handleGetCode = async () => {
|
|||||||
phone: formData.phone,
|
phone: formData.phone,
|
||||||
});
|
});
|
||||||
if (result.resultCode == 1) {
|
if (result.resultCode == 1) {
|
||||||
uni.showToast({ title: "验证码发送成功", icon: "success" });
|
uni.showToast({title: "验证码发送成功", icon: "success"});
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: "验证码发送失败", icon: "none" });
|
uni.showToast({title: "验证码发送失败", icon: "none"});
|
||||||
}
|
}
|
||||||
isCountingDown.value = true;
|
isCountingDown.value = true;
|
||||||
countdown.value = 60; // 重置倒计时
|
countdown.value = 60; // 重置倒计时
|
||||||
@ -156,17 +166,17 @@ function toHome(data: any) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const { afterLoginAction } = useUserStore();
|
const {afterLoginAction} = useUserStore();
|
||||||
const { setFile } = useDataStore();
|
const {setFile} = useDataStore();
|
||||||
|
|
||||||
const handleVerify = async () => {
|
const handleVerify = async () => {
|
||||||
if (
|
if (
|
||||||
!formData.loginName ||
|
!formData.loginName ||
|
||||||
!formData.phone ||
|
!formData.phone ||
|
||||||
!formData.code ||
|
!formData.code
|
||||||
!formData.avatarUrl
|
// || !formData.avatarUrl
|
||||||
) {
|
) {
|
||||||
uni.showToast({ title: "请填写完整的验证信息", icon: "none" });
|
uni.showToast({title: "请填写完整的验证信息", icon: "none"});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const result = await updateUserApi({
|
const result = await updateUserApi({
|
||||||
@ -180,7 +190,7 @@ const handleVerify = async () => {
|
|||||||
if (result.resultCode == 1) {
|
if (result.resultCode == 1) {
|
||||||
if (result.result) {
|
if (result.result) {
|
||||||
afterLoginAction(result.result);
|
afterLoginAction(result.result);
|
||||||
uni.showToast({ title: "验证成功", icon: "success" });
|
uni.showToast({title: "验证成功", icon: "success"});
|
||||||
if (getGlobal.type == 1) {
|
if (getGlobal.type == 1) {
|
||||||
toHome(getGlobal);
|
toHome(getGlobal);
|
||||||
} else {
|
} else {
|
||||||
@ -205,16 +215,16 @@ const handleVerify = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: result.message || "验证失败", icon: "none" });
|
uni.showToast({title: result.message || "验证失败", icon: "none"});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: result.message || "验证失败", icon: "none" });
|
uni.showToast({title: result.message || "验证失败", icon: "none"});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function afterRead(event: any) {
|
async function afterRead(event: any) {
|
||||||
showLoading({ title: "上传中" });
|
showLoading({title: "上传中"});
|
||||||
const { result } = await attachmentUpload(event.tempFilePaths[0]);
|
const {result} = await attachmentUpload(event.tempFilePaths[0]);
|
||||||
hideLoading();
|
hideLoading();
|
||||||
formData.avatarUrl = result[0].filePath;
|
formData.avatarUrl = result[0].filePath;
|
||||||
}
|
}
|
||||||
@ -346,6 +356,7 @@ onUnmounted(() => {
|
|||||||
color: #cccccc;
|
color: #cccccc;
|
||||||
border-color: #cccccc;
|
border-color: #cccccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 移除按钮默认的边框伪元素
|
// 移除按钮默认的边框伪元素
|
||||||
.get-code-btn::after {
|
.get-code-btn::after {
|
||||||
border: none;
|
border: none;
|
||||||
@ -363,6 +374,7 @@ onUnmounted(() => {
|
|||||||
border: none; // 移除默认边框
|
border: none; // 移除默认边框
|
||||||
box-shadow: 0 2px 5px rgba(255, 100, 100, 0.3); // 添加阴影
|
box-shadow: 0 2px 5px rgba(255, 100, 100, 0.3); // 添加阴影
|
||||||
}
|
}
|
||||||
|
|
||||||
// 移除按钮默认的边框伪元素
|
// 移除按钮默认的边框伪元素
|
||||||
.verify-btn::after {
|
.verify-btn::after {
|
||||||
border: none;
|
border: none;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user