From fefb649f462ae6b19dd8f0f6bc6096619db9a82e Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 25 十月 2025 18:38:54 +0800
Subject: [PATCH] feat:消息体推送
---
app/pages/task/create.vue | 1051 +++++-----------------------------------------------------
1 files changed, 96 insertions(+), 955 deletions(-)
diff --git a/app/pages/task/create.vue b/app/pages/task/create.vue
index 0970acd..b757c79 100644
--- a/app/pages/task/create.vue
+++ b/app/pages/task/create.vue
@@ -1,19 +1,14 @@
<template>
<scroll-view class="create-task-container" scroll-y="true">
- <!-- 浠诲姟绫诲瀷閫夋嫨鐣岄潰 -->
- <view v-if="!selectedTaskCategory" class="task-category-container">
+ <view class="task-category-container">
<view class="header">
<view class="title">閫夋嫨浠诲姟绫诲瀷</view>
<view class="subtitle">璇烽�夋嫨鎮ㄨ鍒涘缓鐨勪换鍔$被鍨�</view>
</view>
-
+
<view class="category-list">
- <view
- class="category-item"
- v-for="(category, index) in taskCategories"
- :key="index"
- @click="selectTaskCategory(category)"
- >
+ <view class="category-item" v-for="(category, index) in taskCategories" :key="index"
+ @click="selectTaskCategory(category)">
<view class="icon">
<uni-icons :type="category.icon" size="30" :color="category.color"></uni-icons>
</view>
@@ -27,977 +22,123 @@
</view>
</view>
</view>
-
- <!-- 浠诲姟鍒涘缓琛ㄥ崟 -->
- <view v-else class="task-form-container">
- <view class="form-header">
- <view class="back-btn" @click="backToCategory">
- <uni-icons type="arrowleft" size="20"></uni-icons>
- </view>
- <view class="title">鍒涘缓{{ selectedTaskCategory.name }}浠诲姟</view>
- </view>
-
- <view class="form-section">
- <!-- 鏅�氫换鍔¤〃鍗� -->
- <view v-if="selectedTaskCategory.type === 'normal'">
- <view class="form-item">
- <view class="form-label">浠诲姟杞﹁締</view>
- <picker mode="selector" :range="vehicles" @change="onVehicleChange">
- <view class="form-input picker-input">
- {{ selectedVehicle || '璇烽�夋嫨浠诲姟杞﹁締' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </picker>
- </view>
-
- <view class="form-item">
- <view class="form-label">浠诲姟绫诲瀷</view>
- <input
- class="form-input"
- :value="selectedTaskCategory.name"
- disabled
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">浠诲姟鎻忚堪</view>
- <textarea
- class="form-textarea"
- placeholder="璇疯緭鍏ヤ换鍔℃弿杩�"
- v-model="taskForm.description"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">浠诲姟鍑哄彂鍦�</view>
- <view class="form-input picker-input" @click="selectStartLocation">
- {{ taskForm.startLocation || '璇烽�夋嫨浠诲姟鍑哄彂鍦�' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </view>
-
- <view class="form-item">
- <view class="form-label">浠诲姟鐩殑鍦�</view>
- <view class="form-input picker-input" @click="selectEndLocation">
- {{ taskForm.endLocation || '璇烽�夋嫨浠诲姟鐩殑鍦�' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </view>
-
- <view class="form-item">
- <view class="form-label">琛岄┒鍏噷鏁�</view>
- <input
- class="form-input"
- type="digit"
- placeholder="璇疯緭鍏ヨ椹跺叕閲屾暟"
- v-model="taskForm.distance"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">寮�濮嬫椂闂�</view>
- <!-- 浣跨敤uni-datetime-picker缁勪欢 -->
- <uni-datetime-picker
- v-model="taskForm.startTime"
- type="datetime"
- :placeholder="'璇烽�夋嫨寮�濮嬫椂闂�'"
- class="form-input"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">缁撴潫鏃堕棿</view>
- <!-- 浣跨敤uni-datetime-picker缁勪欢 -->
- <uni-datetime-picker
- v-model="taskForm.endTime"
- type="datetime"
- :placeholder="'璇烽�夋嫨缁撴潫鏃堕棿'"
- class="form-input"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">鎵ц浜�</view>
- <input
- class="form-input"
- :value="currentUser.name"
- disabled
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">澶囨敞</view>
- <textarea
- class="form-textarea"
- placeholder="璇疯緭鍏ュ娉ㄤ俊鎭紙鏈�澶�200瀛楋級"
- v-model="taskForm.remark"
- maxlength="200"
- />
- </view>
- </view>
-
- <!-- 鎬ユ晳杞繍浠诲姟琛ㄥ崟 -->
- <view v-else-if="selectedTaskCategory.type === 'emergency'">
- <view class="form-item">
- <view class="form-label">浠诲姟杞﹁締</view>
- <picker mode="selector" :range="vehicles" @change="onVehicleChange">
- <view class="form-input picker-input">
- {{ selectedVehicle || '璇烽�夋嫨浠诲姟杞﹁締' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </picker>
- </view>
-
- <view class="form-item">
- <view class="form-label">鎵ц浠诲姟浜哄憳</view>
- <view class="staff-list">
- <view class="staff-item">
- <text>{{ currentUser.name }} ({{ currentUser.position }})</text>
- <uni-icons type="checkmarkempty" size="20" color="#007AFF"></uni-icons>
- </view>
- <view
- class="staff-item"
- v-for="(staff, index) in additionalStaff"
- :key="index"
- @click="removeStaff(index)"
- >
- <text>{{ staff.name }} ({{ staff.position }})</text>
- <uni-icons type="closeempty" size="20" color="#ff4d4f"></uni-icons>
- </view>
- <view class="add-staff" @click="addStaff">
- <uni-icons type="plusempty" size="20" color="#007AFF"></uni-icons>
- <text>娣诲姞浜哄憳</text>
- </view>
- </view>
- </view>
-
- <view class="form-item">
- <view class="form-label">褰掑睘鏈烘瀯</view>
- <picker mode="selector" :range="organizations" @change="onOrganizationChange">
- <view class="form-input picker-input">
- {{ selectedOrganization || '璇烽�夋嫨褰掑睘鏈烘瀯' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </picker>
- </view>
-
- <view class="form-item">
- <view class="form-label">浠诲姟绫诲瀷</view>
- <picker mode="selector" :range="emergencyTaskTypes" @change="onEmergencyTaskTypeChange">
- <view class="form-input picker-input">
- {{ selectedEmergencyTaskType || '璇烽�夋嫨浠诲姟绫诲瀷' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </picker>
- </view>
-
- <view class="form-item">
- <view class="form-label">杞繍鏃堕棿</view>
- <!-- 浣跨敤uni-datetime-picker缁勪欢 -->
- <uni-datetime-picker
- v-model="taskForm.transferTime"
- type="datetime"
- :placeholder="'璇烽�夋嫨杞繍鏃堕棿'"
- class="form-input"
- />
- </view>
-
- <view class="form-section-title">鎮h�呬俊鎭�</view>
- <view class="form-item">
- <view class="form-label">鑱旂郴浜�</view>
- <input
- class="form-input"
- placeholder="璇疯緭鍏ヨ仈绯讳汉"
- v-model="taskForm.patient.contact"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">鑱旂郴鐢佃瘽</view>
- <input
- class="form-input"
- type="number"
- placeholder="璇疯緭鍏ヨ仈绯荤數璇�"
- v-model="taskForm.patient.phone"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">鎮h�呭鍚�</view>
- <input
- class="form-input"
- placeholder="璇疯緭鍏ユ偅鑰呭鍚�"
- v-model="taskForm.patient.name"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">鎬у埆</view>
- <view class="radio-group">
- <label class="radio-item">
- <radio value="male" :checked="taskForm.patient.gender === 'male'" @click="taskForm.patient.gender = 'male'" />
- <text>鐢�</text>
- </label>
- <label class="radio-item">
- <radio value="female" :checked="taskForm.patient.gender === 'female'" @click="taskForm.patient.gender = 'female'" />
- <text>濂�</text>
- </label>
- </view>
- </view>
-
- <view class="form-item">
- <view class="form-label">鎮h�呰韩浠借瘉</view>
- <input
- class="form-input"
- type="idcard"
- placeholder="璇疯緭鍏ユ偅鑰呰韩浠借瘉鍙�"
- v-model="taskForm.patient.idCard"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">鐥呮儏</view>
- <textarea
- class="form-textarea"
- placeholder="璇疯緭鍏ユ偅鑰呯梾鎯呮弿杩�"
- v-model="taskForm.patient.condition"
- />
- </view>
-
- <view class="form-section-title">杞嚭鍖婚櫌淇℃伅</view>
- <view class="form-item">
- <view class="form-label">鍖婚櫌鍚嶇О</view>
- <input
- class="form-input"
- placeholder="璇疯緭鍏ヨ浆鍑哄尰闄㈠悕绉�"
- v-model="taskForm.hospitalOut.name"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">绉戝</view>
- <input
- class="form-input"
- placeholder="璇疯緭鍏ョ瀹�"
- v-model="taskForm.hospitalOut.department"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">搴婂彿</view>
- <input
- class="form-input"
- placeholder="璇疯緭鍏ュ簥鍙�"
- v-model="taskForm.hospitalOut.bedNumber"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">杞嚭鍦板潃</view>
- <view class="form-input picker-input" @click="selectHospitalOutAddress">
- {{ taskForm.hospitalOut.address || '璇烽�夋嫨杞嚭鍦板潃' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </view>
-
- <view class="form-section-title">杞叆鍖婚櫌淇℃伅</view>
- <view class="form-item">
- <view class="form-label">鍖婚櫌鍚嶇О</view>
- <input
- class="form-input"
- placeholder="璇疯緭鍏ヨ浆鍏ュ尰闄㈠悕绉�"
- v-model="taskForm.hospitalIn.name"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">绉戝</view>
- <input
- class="form-input"
- placeholder="璇疯緭鍏ョ瀹�"
- v-model="taskForm.hospitalIn.department"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">搴婂彿</view>
- <input
- class="form-input"
- placeholder="璇疯緭鍏ュ簥鍙�"
- v-model="taskForm.hospitalIn.bedNumber"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">杞叆鍦板潃</view>
- <view class="form-input picker-input" @click="selectHospitalInAddress">
- {{ taskForm.hospitalIn.address || '璇烽�夋嫨杞叆鍦板潃' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </view>
-
- <view class="form-item">
- <view class="form-label">杞繍鍏噷鏁�</view>
- <input
- class="form-input"
- type="digit"
- placeholder="璇疯緭鍏ヨ浆杩愬叕閲屾暟"
- v-model="taskForm.transferDistance"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">鎴愪氦浠�</view>
- <input
- class="form-input"
- type="digit"
- placeholder="璇疯緭鍏ユ垚浜や环"
- v-model="taskForm.price"
- />
- </view>
- </view>
-
- <!-- 绂忕杞︿换鍔¤〃鍗� -->
- <view v-else-if="selectedTaskCategory.type === 'welfare'">
- <view class="form-item">
- <view class="form-label">浠诲姟杞﹁締</view>
- <picker mode="selector" :range="vehicles" @change="onVehicleChange">
- <view class="form-input picker-input">
- {{ selectedVehicle || '璇烽�夋嫨浠诲姟杞﹁締' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </picker>
- </view>
-
- <view class="form-item">
- <view class="form-label">鎵ц浠诲姟浜哄憳</view>
- <view class="staff-list">
- <view class="staff-item">
- <text>{{ currentUser.name }} ({{ currentUser.position }})</text>
- <uni-icons type="checkmarkempty" size="20" color="#007AFF"></uni-icons>
- </view>
- <view
- class="staff-item"
- v-for="(staff, index) in additionalStaff"
- :key="index"
- @click="removeStaff(index)"
- >
- <text>{{ staff.name }} ({{ staff.position }})</text>
- <uni-icons type="closeempty" size="20" color="#ff4d4f"></uni-icons>
- </view>
- <view class="add-staff" @click="addStaff">
- <uni-icons type="plusempty" size="20" color="#007AFF"></uni-icons>
- <text>娣诲姞浜哄憳</text>
- </view>
- </view>
- </view>
-
- <view class="form-item">
- <view class="form-label">褰掑睘鏈烘瀯</view>
- <picker mode="selector" :range="organizations" @change="onOrganizationChange">
- <view class="form-input picker-input">
- {{ selectedOrganization || '璇烽�夋嫨褰掑睘鏈烘瀯' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </picker>
- </view>
-
- <view class="form-item">
- <view class="form-label">鏈嶅姟鏃堕棿</view>
- <!-- 浣跨敤uni-datetime-picker缁勪欢 -->
- <uni-datetime-picker
- v-model="taskForm.serviceTime"
- type="datetime"
- :placeholder="'璇烽�夋嫨鏈嶅姟鏃堕棿'"
- class="form-input"
- />
- </view>
-
- <view class="form-section-title">涔樺淇℃伅</view>
- <view class="form-item">
- <view class="form-label">鑱旂郴浜�</view>
- <input
- class="form-input"
- placeholder="璇疯緭鍏ヨ仈绯讳汉"
- v-model="taskForm.passenger.contact"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">鑱旂郴鐢佃瘽</view>
- <input
- class="form-input"
- type="number"
- placeholder="璇疯緭鍏ヨ仈绯荤數璇�"
- v-model="taskForm.passenger.phone"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">鍑哄彂鍦板潃</view>
- <view class="form-input picker-input" @click="selectStartAddress">
- {{ taskForm.startAddress || '璇烽�夋嫨鍑哄彂鍦板潃' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </view>
-
- <view class="form-item">
- <view class="form-label">鐩殑鍦板潃</view>
- <view class="form-input picker-input" @click="selectEndAddress">
- {{ taskForm.endAddress || '璇烽�夋嫨鐩殑鍦板潃' }}
- <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
- </view>
- </view>
-
- <view class="form-item">
- <view class="form-label">鍏噷鏁�</view>
- <input
- class="form-input"
- type="digit"
- placeholder="璇疯緭鍏ュ叕閲屾暟"
- v-model="taskForm.distance"
- />
- </view>
-
- <view class="form-item">
- <view class="form-label">鎴愪氦浠�</view>
- <input
- class="form-input"
- type="digit"
- placeholder="璇疯緭鍏ユ垚浜や环"
- v-model="taskForm.price"
- />
- </view>
- </view>
-
- <view class="form-actions">
- <button class="submit-btn" @click="submitTask">淇濆瓨</button>
- </view>
- </view>
- </view>
-
- <!-- 鍦板浘閫夋嫨鍣ㄥ脊绐� -->
- <uni-popup ref="mapPopup" type="bottom" :mask-click="false">
- <view class="map-popup-container">
- <view class="popup-header">
- <view class="popup-title">閫夋嫨鍦板潃</view>
- <view class="close-btn" @click="closeMapSelector">
- <uni-icons type="closeempty" size="20" color="#999"></uni-icons>
- </view>
- </view>
- <map-selector
- :initial-address="getInitialAddress()"
- @addressSelected="onAddressSelected"
- ></map-selector>
- </view>
- </uni-popup>
</scroll-view>
</template>
<script>
- import { mapState } from 'vuex'
- import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
- import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue'
- import { getUserProfile } from "@/api/system/user"
- import MapSelector from '@/components/map-selector.vue'
-
- export default {
- components: {
- uniDatetimePicker,
- uniPopup,
- MapSelector
- },
- data() {
- return {
- selectedTaskCategory: null,
- selectedVehicle: '',
- selectedOrganization: '',
- selectedEmergencyTaskType: '',
- boundVehicle: '', // 鐢ㄦ埛缁戝畾鐨勮溅杈�
- // 鍦板浘閫夋嫨鐩稿叧
- showMapSelector: false,
- mapSelectorType: '', // 鏍囪瘑褰撳墠閫夋嫨鐨勬槸鍝釜鍦板潃瀛楁
- taskForm: {
- description: '',
- startLocation: '',
- endLocation: '',
- distance: '',
- startTime: '',
- endTime: '',
- remark: '',
- transferTime: '',
- patient: {
- contact: '',
- phone: '',
- name: '',
- gender: 'male',
- idCard: '',
- condition: ''
- },
- hospitalOut: {
- name: '',
- department: '',
- bedNumber: '',
- address: ''
- },
- hospitalIn: {
- name: '',
- department: '',
- bedNumber: '',
- address: ''
- },
- transferDistance: '',
- price: '',
- serviceTime: '',
- passenger: {
- contact: '',
- phone: ''
- },
- startAddress: '',
- endAddress: ''
+export default {
+ data() {
+ return {
+ taskCategories: [
+ {
+ type: 'emergency',
+ name: '鎬ユ晳杞繍',
+ icon: 'hospital',
+ color: '#E54D42',
+ description: '绱ф�ュ尰鐤楄浆杩愪换鍔�',
+ taskType: 'EMERGENCY_TRANSFER',
+ page: '/pages/task/create-emergency'
},
- taskCategories: [
- {
- type: 'normal',
- name: '缁翠慨淇濆吇',
- icon: 'repair',
- color: '#007AFF',
- description: '璁惧缁翠慨銆佷繚鍏荤瓑鏃ュ父浠诲姟'
- },
- {
- type: 'normal',
- name: '鍔犳补',
- icon: 'fuel',
- color: '#1AAD19',
- description: '杞﹁締鍔犳补绛変换鍔�'
- },
- {
- type: 'emergency',
- name: '鎬ユ晳杞繍',
- icon: 'hospital',
- color: '#E54D42',
- description: '绱ф�ュ尰鐤楄浆杩愪换鍔�'
- },
- {
- type: 'welfare',
- name: '绂忕杞�',
- icon: 'car',
- color: '#F37B1D',
- description: '鑰佸勾浜恒�佹畫鐤句汉绛夌壒娈婄兢浣撶敤杞︽湇鍔�'
- }
- ],
- vehicles: ['绮12345', '绮67890', '绮11111', '绮22222', '绮33333'],
- organizations: ['骞垮窞鍒嗗叕鍙�', '娣卞湷鍒嗗叕鍙�', '鐝犳捣鍒嗗叕鍙�', '浣涘北鍒嗗叕鍙�'],
- emergencyTaskTypes: ['鎬ユ晳杞繍', '鑸┖杞繍'],
- additionalStaff: []
- }
- },
- computed: {
- ...mapState({
- currentUser: state => ({
- name: state.user.name || '寮犱笁',
- position: '鍙告満'
- })
+ {
+ type: 'normal',
+ name: '缁翠慨淇濆吇',
+ icon: 'repair',
+ color: '#007AFF',
+ description: '璁惧缁翠慨銆佷繚鍏荤瓑鏃ュ父浠诲姟',
+ taskType: 'MAINTENANCE',
+ page: '/pages/task/create-normal'
+ },
+ {
+ type: 'normal',
+ name: '鍔犳补',
+ icon: 'fuel',
+ color: '#1AAD19',
+ description: '杞﹁締鍔犳补绛変换鍔�',
+ taskType: 'FUEL',
+ page: '/pages/task/create-normal'
+ },
+
+ {
+ type: 'welfare',
+ name: '绂忕杞�',
+ icon: 'car',
+ color: '#F37B1D',
+ description: '鑰佸勾浜恒�佹畫鐤句汉绛夌壒娈婄兢浣撶敤杞︽湇鍔�',
+ taskType: 'WELFARE',
+ page: '/pages/task/create-welfare'
+ }
+ ]
+ }
+ },
+ methods: {
+ selectTaskCategory(category) {
+ // 璺宠浆鍒板搴旂殑浠诲姟鍒涘缓椤甸潰
+ uni.navigateTo({
+ url: `${category.page}?categoryName=${category.name}&categoryType=${category.type}&taskType=${category.taskType}`
})
- },
- onLoad() {
- // 鑾峰彇鐢ㄦ埛缁戝畾鐨勮溅杈嗕俊鎭�
- this.getUserBoundVehicle()
- },
- methods: {
- // 鑾峰彇鐢ㄦ埛缁戝畾鐨勮溅杈嗕俊鎭�
- getUserBoundVehicle() {
- getUserProfile().then(response => {
- // 杩欓噷妯℃嫙浠庣敤鎴蜂俊鎭腑鑾峰彇缁戝畾杞﹁締锛屽疄闄呴」鐩腑搴旇浠巖esponse.data涓幏鍙�
- // 鍋囪鐢ㄦ埛淇℃伅涓湁boundVehicle瀛楁
- this.boundVehicle = '绮12345' // 妯℃嫙鍊硷紝瀹為檯搴斾粠response.data.boundVehicle鑾峰彇
-
- // 濡傛灉鏈夌粦瀹氳溅杈嗭紝鍒欓粯璁ら�変腑
- if (this.boundVehicle) {
- this.selectedVehicle = this.boundVehicle
- }
- }).catch(() => {
- // 鑾峰彇鐢ㄦ埛淇℃伅澶辫触鏃朵娇鐢ㄩ粯璁ゅ��
- this.boundVehicle = ''
- })
- },
-
- selectTaskCategory(category) {
- this.selectedTaskCategory = category
- // 褰撻�夋嫨浠诲姟绫诲瀷鏃讹紝濡傛灉鏄櫘閫氫换鍔′笖鐢ㄦ埛鏈夌粦瀹氳溅杈嗭紝鍒欓粯璁ら�変腑缁戝畾杞﹁締
- if (category.type === 'normal' && this.boundVehicle) {
- this.selectedVehicle = this.boundVehicle
- }
- },
-
- backToCategory() {
- this.selectedTaskCategory = null
- },
-
- onVehicleChange(e) {
- this.selectedVehicle = this.vehicles[e.detail.value]
- },
-
- onOrganizationChange(e) {
- this.selectedOrganization = this.organizations[e.detail.value]
- },
-
- onEmergencyTaskTypeChange(e) {
- this.selectedEmergencyTaskType = this.emergencyTaskTypes[e.detail.value]
- },
-
- // 鏄剧ず鍦板浘閫夋嫨鍣� - 浠诲姟鍑哄彂鍦�
- selectStartLocation() {
- this.mapSelectorType = 'startLocation'
- this.$refs.mapPopup.open()
- },
-
- // 鏄剧ず鍦板浘閫夋嫨鍣� - 浠诲姟鐩殑鍦�
- selectEndLocation() {
- this.mapSelectorType = 'endLocation'
- this.$refs.mapPopup.open()
- },
-
- // 鏄剧ず鍦板浘閫夋嫨鍣� - 杞嚭鍖婚櫌鍦板潃
- selectHospitalOutAddress() {
- this.mapSelectorType = 'hospitalOutAddress'
- this.$refs.mapPopup.open()
- },
-
- // 鏄剧ず鍦板浘閫夋嫨鍣� - 杞叆鍖婚櫌鍦板潃
- selectHospitalInAddress() {
- this.mapSelectorType = 'hospitalInAddress'
- this.$refs.mapPopup.open()
- },
-
- // 鏄剧ず鍦板浘閫夋嫨鍣� - 绂忕杞﹀嚭鍙戝湴鍧�
- selectStartAddress() {
- this.mapSelectorType = 'startAddress'
- this.$refs.mapPopup.open()
- },
-
- // 鏄剧ず鍦板浘閫夋嫨鍣� - 绂忕杞︾洰鐨勫湴鍧�
- selectEndAddress() {
- this.mapSelectorType = 'endAddress'
- this.$refs.mapPopup.open()
- },
-
- // 鑾峰彇鍒濆鍦板潃鐢ㄤ簬鍦板浘鎼滅储
- getInitialAddress() {
- switch (this.mapSelectorType) {
- case 'startLocation':
- return this.taskForm.startLocation
- case 'endLocation':
- return this.taskForm.endLocation
- case 'hospitalOutAddress':
- return this.taskForm.hospitalOut.address
- case 'hospitalInAddress':
- return this.taskForm.hospitalIn.address
- case 'startAddress':
- return this.taskForm.startAddress
- case 'endAddress':
- return this.taskForm.endAddress
- default:
- return ''
- }
- },
-
- // 鍦板浘閫夋嫨鍣ㄥ湴鍧�閫夋嫨鍥炶皟
- onAddressSelected(address) {
- // 鏍规嵁涓嶅悓鐨勫湴鍧�绫诲瀷璁剧疆瀵瑰簲鐨勮〃鍗曞瓧娈�
- switch (this.mapSelectorType) {
- case 'startLocation':
- this.taskForm.startLocation = address.title + ' - ' + address.address
- break
- case 'endLocation':
- this.taskForm.endLocation = address.title + ' - ' + address.address
- break
- case 'hospitalOutAddress':
- this.taskForm.hospitalOut.address = address.title + ' - ' + address.address
- break
- case 'hospitalInAddress':
- this.taskForm.hospitalIn.address = address.title + ' - ' + address.address
- break
- case 'startAddress':
- this.taskForm.startAddress = address.title + ' - ' + address.address
- break
- case 'endAddress':
- this.taskForm.endAddress = address.title + ' - ' + address.address
- break
- }
-
- // 鍏抽棴鍦板浘閫夋嫨鍣�
- this.closeMapSelector()
- },
-
- // 鍏抽棴鍦板浘閫夋嫨鍣�
- closeMapSelector() {
- this.$refs.mapPopup.close()
- this.mapSelectorType = ''
- },
-
- addStaff() {
- this.$modal.showToast('娣诲姞浜哄憳鍔熻兘寮�鍙戜腑')
- },
-
- removeStaff(index) {
- this.additionalStaff.splice(index, 1)
- },
-
- submitTask() {
- this.$modal.confirm('纭畾瑕佷繚瀛樹换鍔″悧锛�').then(() => {
- this.$modal.showToast('浠诲姟淇濆瓨鎴愬姛')
- // 杩欓噷鍙互璋冪敤API淇濆瓨浠诲姟
- // 淇濆瓨鎴愬姛鍚庤烦杞埌浠诲姟鍒楄〃
- this.$tab.navigateTo('/pages/task/index')
- }).catch(() => {
- // 鍙栨秷鎿嶄綔
- })
- }
}
}
+}
</script>
<style lang="scss">
- .create-task-container {
- padding: 20rpx;
- background-color: #f5f5f5;
- min-height: 100vh;
- // 闅愯棌婊氬姩鏉′絾淇濇寔婊氬姩鍔熻兘
- ::-webkit-scrollbar {
- display: none;
- width: 0 !important;
- height: 0 !important;
- background: transparent;
- }
-
- // Firefox婊氬姩鏉¢殣钘�
- * {
- scrollbar-width: none; /* Firefox */
- }
-
- // IE/Edge婊氬姩鏉¢殣钘�
- * {
- -ms-overflow-style: none; /* IE 10+ */
- }
-
- .task-category-container {
- .header {
- text-align: center;
- padding: 40rpx 0;
-
- .title {
- font-size: 40rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 20rpx;
- }
-
- .subtitle {
- font-size: 28rpx;
- color: #666;
- }
+.create-task-container {
+ padding: 20rpx;
+ background-color: #f5f5f5;
+ min-height: 100vh;
+
+ .task-category-container {
+ .header {
+ text-align: center;
+ padding: 40rpx 0;
+
+ .title {
+ font-size: 40rpx;
+ font-weight: bold;
+ color: #333;
+ margin-bottom: 20rpx;
}
-
- .category-list {
- .category-item {
- display: flex;
- align-items: center;
- background-color: white;
- border-radius: 15rpx;
- padding: 30rpx;
- margin-bottom: 20rpx;
- box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
-
- .icon {
- margin-right: 20rpx;
- }
-
- .info {
- flex: 1;
-
- .name {
- font-size: 32rpx;
- font-weight: bold;
- margin-bottom: 10rpx;
- }
-
- .desc {
- font-size: 26rpx;
- color: #666;
- }
- }
-
- .arrow {
- margin-left: 20rpx;
- }
- }
+
+ .subtitle {
+ font-size: 28rpx;
+ color: #666;
}
}
-
- .task-form-container {
- .form-header {
+
+ .category-list {
+ .category-item {
display: flex;
align-items: center;
- padding: 20rpx 0;
- margin-bottom: 30rpx;
-
- .back-btn {
- width: 60rpx;
- height: 60rpx;
- border-radius: 50%;
- background-color: #f0f0f0;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 20rpx;
- }
-
- .title {
- font-size: 36rpx;
- font-weight: bold;
- color: #333;
- }
- }
-
- .form-section {
background-color: white;
border-radius: 15rpx;
padding: 30rpx;
+ margin-bottom: 20rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
-
- .form-section-title {
- font-size: 32rpx;
- font-weight: bold;
- margin: 40rpx 0 20rpx 0;
- padding-bottom: 10rpx;
- border-bottom: 1rpx solid #f0f0f0;
+
+ .icon {
+ margin-right: 20rpx;
}
-
- .form-item {
- margin-bottom: 40rpx;
-
- &:last-child {
- margin-bottom: 0;
- }
-
- .form-label {
- font-size: 28rpx;
- margin-bottom: 15rpx;
- color: #333;
- }
-
- .form-input {
- height: 70rpx;
- padding: 0 20rpx;
- border: 1rpx solid #eee;
- border-radius: 10rpx;
- font-size: 28rpx;
-
- &.picker-input {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
-
- &[disabled] {
- background-color: #f5f5f5;
- color: #999;
- }
- }
-
- .form-textarea {
- width: 100%;
- min-height: 150rpx;
- padding: 20rpx;
- border: 1rpx solid #eee;
- border-radius: 10rpx;
- font-size: 28rpx;
- resize: none;
- }
-
- .radio-group {
- display: flex;
-
- .radio-item {
- display: flex;
- align-items: center;
- margin-right: 30rpx;
-
- radio {
- margin-right: 10rpx;
- }
- }
- }
-
- .staff-list {
- .staff-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 20rpx;
- background-color: #f9f9f9;
- border-radius: 10rpx;
- margin-bottom: 20rpx;
- }
-
- .add-staff {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 20rpx;
- border: 1rpx dashed #007AFF;
- border-radius: 10rpx;
- color: #007AFF;
- }
- }
- }
-
- .form-actions {
- margin-top: 50rpx;
- text-align: center;
-
- .submit-btn {
- width: 80%;
- height: 80rpx;
- background-color: #007AFF;
- color: white;
- border-radius: 10rpx;
+
+ .info {
+ flex: 1;
+
+ .name {
font-size: 32rpx;
+ font-weight: bold;
+ margin-bottom: 10rpx;
+ }
+
+ .desc {
+ font-size: 26rpx;
+ color: #666;
}
}
- }
- }
-
- // 鍦板浘閫夋嫨鍣ㄥ脊绐楁牱寮�
- .map-popup-container {
- height: 80vh;
- background-color: white;
- border-top-left-radius: 20rpx;
- border-top-right-radius: 20rpx;
- overflow: hidden;
-
- .popup-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 20rpx 30rpx;
- border-bottom: 1rpx solid #f0f0f0;
-
- .popup-title {
- font-size: 32rpx;
- font-weight: bold;
- color: #333;
- }
-
- .close-btn {
- width: 50rpx;
- height: 50rpx;
- display: flex;
- align-items: center;
- justify-content: center;
+
+ .arrow {
+ margin-left: 20rpx;
}
}
}
}
-</style>
\ No newline at end of file
+}
+</style>
--
Gitblit v1.9.1