From 888f941ae16c850c0f1a844ec9436058840920bd Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期五, 24 四月 2026 09:19:02 +0800
Subject: [PATCH] 推送
---
pages/case/transferinfo.vue | 1454 ++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 909 insertions(+), 545 deletions(-)
diff --git a/pages/case/transferinfo.vue b/pages/case/transferinfo.vue
index d9751f4..1ada6e7 100644
--- a/pages/case/transferinfo.vue
+++ b/pages/case/transferinfo.vue
@@ -3,217 +3,269 @@
<!-- 琛ㄥ崟鍐呭 -->
<scroll-view scroll-y class="form-scroll" :show-scrollbar="false">
<view class="form-content">
+ <!-- 妗堜緥淇℃伅鍗$墖 -->
+ <view class="form-section" v-if="transportData.reportId">
+ <view class="section-header">
+ <view class="section-icon">馃搵</view>
+ <text class="section-title">鍏宠仈妗堜緥淇℃伅</text>
+ </view>
+
+ <view class="case-info">
+ <view class="info-row">
+ <text class="info-label">妗堜緥缂栧彿:</text>
+ <text class="info-value">{{ transportData.caseNo }}</text>
+ </view>
+ <view class="info-row">
+ <text class="info-label">鎮h�呭鍚�:</text>
+ <text class="info-value">{{ transportData.patName }}</text>
+ </view>
+ <view class="info-row">
+ <text class="info-label">鎬у埆/骞撮緞:</text>
+ <text class="info-value"
+ >{{ getGenderText(transportData.sex) }} /
+ {{ transportData.age }}宀�</text
+ >
+ </view>
+ <view class="info-row">
+ <text class="info-label">鐤剧梾璇婃柇:</text>
+ <text class="info-value">{{ transportData.diagnosisname }}</text>
+ </view>
+ <view class="info-row">
+ <text class="info-label">娌荤枟鍖婚櫌:</text>
+ <text class="info-value">{{
+ transportData.treatmentHospitalName
+ }}</text>
+ </view>
+ </view>
+ </view>
+
<!-- 鍩虹淇℃伅鍗$墖 -->
<view class="form-section">
<view class="section-header">
- <view class="section-icon">馃搵</view>
- <text class="section-title">鍩虹淇℃伅</text>
- </view>
-
- <view class="form-grid">
- <view class="form-item">
- <text class="item-label required">妗堜緥閫夋嫨</text>
- <u-input
- v-model="form.caseInfo.donorName"
- placeholder="閫夋嫨妗堜緥"
- readonly
- border="none"
- @click="showCasePicker = true"
- :customStyle="inputStyle(!form.caseInfo.caseId)"
- >
- <template #suffix>
- <u-icon name="arrow-down" color="#86868b"></u-icon>
- </template>
- </u-input>
- </view>
-
- <view class="form-item">
- <text class="item-label required">鎹愮尞鍖婚櫌</text>
- <u-input
- v-model="form.hospital"
- placeholder="璇疯緭鍏ユ崘鐚尰闄�"
- border="none"
- :customStyle="inputStyle(!form.hospital)"
- />
- </view>
-
- <view class="form-item">
- <text class="item-label">绉戝</text>
- <u-input
- v-model="form.department"
- placeholder="璇疯緭鍏ョ瀹�"
- border="none"
- />
+ <view class="section-icon">馃搫</view>
+ <text class="section-title">杞繍鍗曚俊鎭�</text>
+ <!-- 鐘舵�佹爣绛� -->
+ <view
+ class="status-tag"
+ :class="getTransportStatusClass(transportData.transitStatus)"
+ >
+ {{ getTransportStatusText(transportData.transitStatus) }}
</view>
</view>
- </view>
- <!-- 杞繍淇℃伅鍗$墖 -->
- <view class="form-section">
- <view class="section-header">
- <view class="section-icon">馃殤</view>
- <text class="section-title">杞繍淇℃伅</text>
- </view>
-
<view class="form-grid">
+ <!-- <view class="form-item">
+ <text class="item-label">杞繍鍗曞彿</text>
+ <u-input
+ v-model="transportData.reportId"
+ placeholder="鑷姩鐢熸垚"
+ disabled
+ :disabledColor="disabledColor"
+ border="none"
+ />
+ </view> -->
+
+ <view class="form-item">
+ <text class="item-label required">鍑哄彂鍦扮偣</text>
+ <u-input
+ v-model="transportData.transportStartPlace"
+ placeholder="璇疯緭鍏ュ嚭鍙戝湴鐐�"
+ border="none"
+ :readonly="!isEdit"
+ :customStyle="inputStyle(!transportData.transportStartPlace)"
+ />
+ </view>
+
<view class="form-item">
<text class="item-label required">鍑哄彂鏃堕棿</text>
<u-input
- v-model="form.departureTime"
+ v-model="transportData.transportStartTime"
placeholder="璇烽�夋嫨鍑哄彂鏃堕棿"
readonly
border="none"
- @click="showTimePicker = true"
- :customStyle="inputStyle(!form.departureTime)"
+ :disabled="!isEdit"
+ @click="isEdit && (showTimePicker = true)"
+ :customStyle="inputStyle(!transportData.transportStartTime)"
>
- <template #suffix>
+ <template #suffix v-if="isEdit">
<u-icon name="arrow-down" color="#86868b"></u-icon>
</template>
</u-input>
</view>
-
- <view class="form-item full-width">
- <text class="item-label">鍑哄彂鍦扮偣</text>
- <u-textarea
- v-model="form.departureLocation"
- placeholder="璇疯緭鍏ュ嚭鍙戝湴鐐硅缁嗗湴鍧�"
- count
- maxlength="200"
- height="120"
+
+ <view class="form-item">
+ <text class="item-label">杞繍鐘舵��</text>
+ <u-select
+ v-model="statusSelectVisible"
+ :list="statusOptions"
+ :default-value="[statusIndex]"
+ :confirm-text="'纭畾'"
+ :cancel-text="'鍙栨秷'"
+ @confirm="onStatusConfirm"
+ :disabled="!isEdit"
+ >
+ <template #default>
+ <view class="picker-trigger">
+ <text>{{
+ getTransportStatusText(transportData.transitStatus)
+ }}</text>
+ <u-icon
+ v-if="isEdit"
+ name="arrow-down"
+ size="16"
+ color="#999"
+ ></u-icon>
+ </view>
+ </template>
+ </u-select>
+ </view>
+
+ <view class="form-item">
+ <text class="item-label required">璐熻矗鍗忚皟鍛�</text>
+ <u-input
+ v-model="transportData.contactPerson"
+ placeholder="璇疯緭鍏ュ崗璋冨憳濮撳悕"
+ border="none"
+ :readonly="!isEdit"
+ :customStyle="inputStyle(!transportData.contactPerson)"
/>
</view>
-
- <view class="form-item">
- <text class="item-label">鎶佃揪鍖婚櫌</text>
+
+ <view class="form-item" v-if="transportData.createTime">
+ <text class="item-label">鍒涘缓鏃堕棿</text>
<u-input
- v-model="form.destinationHospital"
- placeholder="璇疯緭鍏ユ姷杈惧尰闄�"
+ v-model="transportData.createTime"
+ placeholder="鑷姩鐢熸垚"
+ disabled
+ :disabledColor="disabledColor"
+ border="none"
+ />
+ </view>
+
+ <view class="form-item" v-if="transportData.createBy">
+ <text class="item-label">鍒涘缓浜�</text>
+ <u-input
+ v-model="transportData.createBy"
+ placeholder="鑷姩鑾峰彇"
+ disabled
+ :disabledColor="disabledColor"
border="none"
/>
</view>
</view>
</view>
- <!-- 鍥㈤槦鎴愬憳鍗$墖 -->
+ <!-- 鍖绘姢浜哄憳淇℃伅 -->
<view class="form-section">
<view class="section-header">
<view class="section-icon">馃懃</view>
- <text class="section-title">鍥㈤槦鎴愬憳</text>
+ <text class="section-title">鍖绘姢浜哄憳淇℃伅</text>
</view>
-
+
<view class="form-grid">
- <view class="form-item">
- <text class="item-label">鍗忚皟鍛�</text>
- <u-input
- v-model="form.coordinator.name"
- placeholder="閫夋嫨鍗忚皟鍛�"
- readonly
- border="none"
- @click="showCoordinatorPicker = true"
- >
- <template #suffix>
- <u-icon name="arrow-down" color="#86868b"></u-icon>
- </template>
- </u-input>
- </view>
-
<view class="form-item">
<text class="item-label">鎬ヨ瘖绉戝尰鐢�</text>
<u-input
- v-model="form.emergencyDoctor.name"
- placeholder="閫夋嫨鎬ヨ瘖绉戝尰鐢�"
- readonly
+ v-model="transportData.doctor"
+ placeholder="璇疯緭鍏ユ�ヨ瘖绉戝尰鐢�"
border="none"
- @click="showDoctorPicker = true"
- >
- <template #suffix>
- <u-icon name="arrow-down" color="#86868b"></u-icon>
- </template>
- </u-input>
+ :readonly="!isEdit"
+ />
</view>
-
+
+ <view class="form-item">
+ <text class="item-label">鍖荤敓鐢佃瘽</text>
+ <u-input
+ v-model="transportData.doctorPhone"
+ placeholder="璇疯緭鍏ュ尰鐢熸墜鏈哄彿"
+ type="number"
+ border="none"
+ :readonly="!isEdit"
+ />
+ </view>
+
<view class="form-item">
<text class="item-label">鎶ゅ+</text>
<u-input
- v-model="form.nurse.name"
- placeholder="閫夋嫨鎶ゅ+"
- readonly
+ v-model="transportData.nurse"
+ placeholder="璇疯緭鍏ユ姢澹鍚�"
border="none"
- @click="showNursePicker = true"
- >
- <template #suffix>
- <u-icon name="arrow-down" color="#86868b"></u-icon>
- </template>
- </u-input>
+ :readonly="!isEdit"
+ />
</view>
-
+
<view class="form-item">
- <text class="item-label">鍙告満</text>
+ <text class="item-label">鎶ゅ+鐢佃瘽</text>
<u-input
- v-model="form.driver.name"
- placeholder="閫夋嫨鍙告満"
- readonly
+ v-model="transportData.nursePhone"
+ placeholder="璇疯緭鍏ユ姢澹墜鏈哄彿"
+ type="number"
border="none"
- @click="showDriverPicker = true"
- >
- <template #suffix>
- <u-icon name="arrow-down" color="#86868b"></u-icon>
- </template>
- </u-input>
+ :readonly="!isEdit"
+ />
</view>
-
+
+ <view class="form-item">
+ <text class="item-label">椹鹃┒鍛�</text>
+ <u-input
+ v-model="transportData.driver"
+ placeholder="璇疯緭鍏ラ┚椹跺憳濮撳悕"
+ border="none"
+ :readonly="!isEdit"
+ />
+ </view>
+
+ <view class="form-item">
+ <text class="item-label">椹鹃┒鍛樼數璇�</text>
+ <u-input
+ v-model="transportData.driverPhone"
+ placeholder="璇疯緭鍏ラ┚椹跺憳鎵嬫満鍙�"
+ type="number"
+ border="none"
+ :readonly="!isEdit"
+ />
+ </view>
+
<view class="form-item">
<text class="item-label">ICU璇勪及鍖荤敓</text>
<u-input
- v-model="form.icuDoctor.name"
- placeholder="閫夋嫨ICU璇勪及鍖荤敓"
- readonly
+ v-model="transportData.icuDoctor"
+ placeholder="璇疯緭鍏CU璇勪及鍖荤敓"
border="none"
- @click="showIcuDoctorPicker = true"
- >
- <template #suffix>
- <u-icon name="arrow-down" color="#86868b"></u-icon>
- </template>
- </u-input>
+ :readonly="!isEdit"
+ />
</view>
- </view>
- </view>
- <!-- 鑱旂郴鏂瑰紡鍗$墖 -->
- <view class="form-section">
- <view class="section-header">
- <view class="section-icon">馃摓</view>
- <text class="section-title">鑱旂郴鏂瑰紡</text>
- </view>
-
- <view class="form-grid">
- <view class="form-item" v-for="(contact, index) in form.contacts" :key="index">
- <text class="item-label">{{ contact.role }}</text>
+ <view class="form-item">
+ <text class="item-label">ICU鍖荤敓鐢佃瘽</text>
<u-input
- v-model="contact.phone"
- placeholder="璇疯緭鍏ヨ仈绯荤數璇�"
- border="none"
+ v-model="transportData.icuDoctorPhone"
+ placeholder="璇疯緭鍏CU鍖荤敓鎵嬫満鍙�"
type="number"
+ border="none"
+ :readonly="!isEdit"
/>
</view>
</view>
</view>
- <!-- 澶囨敞淇℃伅鍗$墖 -->
+ <!-- 澶囨敞淇℃伅 -->
<view class="form-section">
<view class="section-header">
<view class="section-icon">馃摑</view>
<text class="section-title">澶囨敞淇℃伅</text>
</view>
-
+
<view class="form-grid">
<view class="form-item full-width">
<u-textarea
- v-model="form.remarks"
- placeholder="璇疯緭鍏ョ壒娈婅姹傛垨澶囨敞淇℃伅"
- count
+ v-model="transportData.remark"
+ placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�"
+ border="none"
+ :readonly="!isEdit"
+ :count="isEdit"
maxlength="500"
- height="200"
+ height="150"
/>
</view>
</view>
@@ -221,23 +273,56 @@
<!-- 鎿嶄綔鎸夐挳 -->
<view class="action-buttons">
- <u-button class="btn secondary" @click="handleCancel">鍙栨秷</u-button>
- <u-button class="btn primary" @click="handleSaveDraft">淇濆瓨鑽夌</u-button>
- <u-button class="btn success" @click="handleSubmit" :disabled="!isFormValid">鎻愪氦鐢宠</u-button>
+ <!-- 鏌ョ湅妯″紡 -->
+ <template v-if="!isEdit">
+ <u-button class="btn secondary" @click="goBack">杩斿洖</u-button>
+ <u-button v-if="canEdit" class="btn primary" @click="handleEdit">
+ 缂栬緫
+ </u-button>
+ <u-button
+ v-if="canStartTransport"
+ class="btn warning"
+ @click="handleStartTransport"
+ >
+ 寮�濮嬭浆杩�
+ </u-button>
+ <u-button
+ v-if="canCompleteTransport"
+ class="btn success"
+ @click="handleCompleteTransport"
+ >
+ 瀹屾垚杞繍
+ </u-button>
+ <!-- <u-button v-if="canDelete" class="btn error" @click="handleDelete">
+ 鍒犻櫎
+ </u-button> -->
+ </template>
+
+ <!-- 缂栬緫妯″紡 -->
+ <template v-else>
+ <u-button class="btn secondary" @click="cancelEdit">鍙栨秷</u-button>
+ <u-button
+ class="btn success"
+ @click="handleSave"
+ :disabled="!isFormValid"
+ :loading="saving"
+ >
+ 淇濆瓨
+ </u-button>
+ </template>
</view>
</view>
</scroll-view>
-
- <!-- 閫夋嫨鍣ㄧ粍浠� -->
- <u-picker
- :show="showCasePicker"
- :columns="[caseOptions]"
- keyName="label"
- @confirm="onCaseConfirm"
- @cancel="showCasePicker = false"
- title="閫夋嫨妗堜緥"
- ></u-picker>
-
+ <attachment-upload
+ ref="attachment"
+ :files="attachments"
+ :readonly="isReadonly"
+ :maxCount="5"
+ @update:files="handleFilesUpdate"
+ @upload-base="handleBaseUpload"
+ @preview="handlePreview"
+ />
+ <!-- 鏃堕棿閫夋嫨鍣� -->
<u-datetime-picker
:show="showTimePicker"
v-model="departureTimeValue"
@@ -247,385 +332,496 @@
title="閫夋嫨鍑哄彂鏃堕棿"
></u-datetime-picker>
- <u-picker
- :show="showCoordinatorPicker"
- :columns="[coordinatorOptions]"
- keyName="label"
- @confirm="onCoordinatorConfirm"
- @cancel="showCoordinatorPicker = false"
- title="閫夋嫨鍗忚皟鍛�"
- ></u-picker>
-
- <u-picker
- :show="showDoctorPicker"
- :columns="[doctorOptions]"
- keyName="label"
- @confirm="onDoctorConfirm"
- @cancel="showDoctorPicker = false"
- title="閫夋嫨鎬ヨ瘖绉戝尰鐢�"
- ></u-picker>
-
- <u-picker
- :show="showNursePicker"
- :columns="[nurseOptions]"
- keyName="label"
- @confirm="onNurseConfirm"
- @cancel="showNursePicker = false"
- title="閫夋嫨鎶ゅ+"
- ></u-picker>
-
- <u-picker
- :show="showDriverPicker"
- :columns="[driverOptions]"
- keyName="label"
- @confirm="onDriverConfirm"
- @cancel="showDriverPicker = false"
- title="閫夋嫨鍙告満"
- ></u-picker>
-
- <u-picker
- :show="showIcuDoctorPicker"
- :columns="[icuDoctorOptions]"
- keyName="label"
- @confirm="onIcuDoctorConfirm"
- @cancel="showIcuDoctorPicker = false"
- title="閫夋嫨ICU璇勪及鍖荤敓"
- ></u-picker>
-
<!-- 鍔犺浇鐘舵�� -->
- <u-loading-icon :show="loading" text="鎻愪氦涓�..."></u-loading-icon>
+ <u-loading-icon :show="loading" :text="loadingText"></u-loading-icon>
</view>
</template>
<script setup>
-import { ref, reactive, computed, onMounted } from 'vue'
-import { onLoad } from '@dcloudio/uni-app'
+import { ref, computed, onMounted } from "vue";
+import attachmentUpload from "@/components/attachment";
+import { useUserStore } from "@/stores/user";
-// 琛ㄥ崟鏁版嵁
-const form = reactive({
- caseInfo: {
- caseId: '',
- donorName: '',
- gender: '',
- age: '',
- diagnosis: ''
- },
- hospital: '',
- department: '',
- departureTime: '',
- departureLocation: '',
- destinationHospital: '',
- coordinator: { id: '', name: '' },
- emergencyDoctor: { id: '', name: '' },
- nurse: { id: '', name: '' },
- driver: { id: '', name: '' },
- icuDoctor: { id: '', name: '' },
- contacts: [
- { role: '鍗忚皟鍛樼數璇�', phone: '' },
- { role: '鎬ヨ瘖鍖荤敓鐢佃瘽', phone: '' },
- { role: '鎶ゅ+鐢佃瘽', phone: '' },
- { role: '鍙告満鐢佃瘽', phone: '' },
- { role: 'ICU鍖荤敓鐢佃瘽', phone: '' }
- ],
- remarks: ''
-})
+import { onLoad } from "@dcloudio/uni-app";
-// 閫夋嫨鍣ㄧ姸鎬�
-const showCasePicker = ref(false)
-const showTimePicker = ref(false)
-const showCoordinatorPicker = ref(false)
-const showDoctorPicker = ref(false)
-const showNursePicker = ref(false)
-const showDriverPicker = ref(false)
-const showIcuDoctorPicker = ref(false)
-const departureTimeValue = ref(0)
+// 瀛楀吀鏁版嵁
+const dict = ref({});
-// 閫夐」鏁版嵁
-const caseOptions = ref([
- {
- label: '寮犱笁 - 鑴戝浼ゅ鑷磋剳姝讳骸 - 闈掑矝闀滄箹鍖婚櫌',
- value: 'DON20241216001',
- data: {
- donorName: '寮犱笁',
- gender: '鐢�',
- age: '38',
- diagnosis: '鑴戝浼ゅ鑷磋剳姝讳骸',
- hospital: '闈掑矝闀滄箹鍖婚櫌'
- }
- },
- {
- label: '鏉庡洓 - 鑴戞姝� - 闈掑矝澶у闄勫睘鍖婚櫌',
- value: 'DON20241216002',
- data: {
- donorName: '鏉庡洓',
- gender: '濂�',
- age: '45',
- diagnosis: '鑴戞姝�',
- hospital: '闈掑矝澶у闄勫睘鍖婚櫌'
- }
- }
-])
+// 鏁版嵁
+const transportData = ref({
+ annexfilesList: [], // 闄勪欢鏂囦欢鍦板潃闆嗗悎
+});
+const loading = ref(false);
+const saving = ref(false);
+const isEdit = ref(false);
+const transportId = ref(null);
+const showTimePicker = ref(false);
+const departureTimeValue = ref(0);
+const statusSelectVisible = ref(false);
+const isReadonly = ref(false);
+const attachments = ref([]);
-const coordinatorOptions = ref([
- { label: '寮犲尰鐢�', value: '1' },
- { label: '鏉庡尰鐢�', value: '2' },
- { label: '鐜嬪尰鐢�', value: '3' }
-])
-const doctorOptions = ref([
- { label: '璧靛尰鐢�', value: '1' },
- { label: '閽卞尰鐢�', value: '2' },
- { label: '瀛欏尰鐢�', value: '3' }
-])
+// 瀛楀吀閫夐」
+const statusOptions = ref([
+ { label: "寰呰浆杩�", value: 1 },
+ { label: "杞繍涓�", value: 2 },
+ { label: "杞繍瀹屾垚", value: 3 },
+ { label: "杞繍鍙栨秷", value: 4 },
+ { label: "鏆傚瓨", value: 5 },
+]);
-const nurseOptions = ref([
- { label: '鍛ㄦ姢澹�', value: '1' },
- { label: '鍚存姢澹�', value: '2' },
- { label: '閮戞姢澹�', value: '3' }
-])
-
-const driverOptions = ref([
- { label: '鍒樺笀鍌�', value: '1' },
- { label: '闄堝笀鍌�', value: '2' },
- { label: '鏉ㄥ笀鍌�', value: '3' }
-])
-
-const icuDoctorOptions = ref([
- { label: '鏈卞尰鐢�', value: '1' },
- { label: '绉﹀尰鐢�', value: '2' },
- { label: '灏ゅ尰鐢�', value: '3' }
-])
-
-// 鐘舵�佺鐞�
-const loading = ref(false)
-const isEdit = ref(false)
-const transportId = ref('')
-const disabledColor = ref('#f5f5f7')
+// 鏍峰紡
+const disabledColor = ref("#f5f5f7");
// 璁$畻灞炴��
+const loadingText = computed(() => {
+ return loading.value ? "鍔犺浇涓�..." : saving.value ? "淇濆瓨涓�..." : "";
+});
+
const isFormValid = computed(() => {
- return form.caseInfo.caseId && form.hospital && form.departureTime
-})
+ return (
+ transportData.value.transportStartPlace &&
+ transportData.value.transportStartTime &&
+ transportData.value.contactPerson
+ );
+});
-// 鏍峰紡鏂规硶
-const inputStyle = (isError) => {
- return isError ?
- 'border: 2rpx solid #ff4757 !important; border-radius: 12rpx !important;' :
- 'border: 2rpx solid #e5e5e7 !important; border-radius: 12rpx !important;'
-}
+// 鏉冮檺鍒ゆ柇
+const canEdit = computed(() => {
+ if (loading.value) return false;
+ return (
+ transportData.value.transitStatus === 1 || // 寰呰浆杩�
+ transportData.value.transitStatus === 5
+ ); // 鏆傚瓨
+});
-// 鏂规硶瀹氫箟
-const onCaseConfirm = (e) => {
- if (e.value && e.value[0]) {
- const selectedCase = e.value[0]
- form.caseInfo.caseId = selectedCase.value
- form.caseInfo.donorName = selectedCase.data.donorName
- form.caseInfo.gender = selectedCase.data.gender
- form.caseInfo.age = selectedCase.data.age
- form.caseInfo.diagnosis = selectedCase.data.diagnosis
- form.hospital = selectedCase.data.hospital
+const canStartTransport = computed(() => {
+ if (loading.value) return false;
+ return transportData.value.transitStatus === 1; // 寰呰浆杩�
+});
+
+const canCompleteTransport = computed(() => {
+ if (loading.value) return false;
+ return transportData.value.transitStatus === 2; // 杞繍涓�
+});
+
+const canDelete = computed(() => {
+ if (loading.value) return false;
+ return true; // 鏍规嵁瀹為檯鏉冮檺鎺у埗
+});
+
+// 璁$畻绱㈠紩
+const statusIndex = computed(() => {
+ if (!transportData.value.transitStatus) return 0;
+ return statusOptions.value.findIndex(
+ (item) => item.value === transportData.value.transitStatus,
+ );
+});
+
+onLoad(async (options) => {
+ if (options.id) {
+ transportId.value = options.id;
+ await loadTransportData(options.id);
+ } else if (options.caseId) {
+ // 鏂板妯″紡
+ isEdit.value = true;
+ await initNewTransport(options.caseId, options.caseNo);
}
- showCasePicker.value = false
-}
+});
-const onTimeConfirm = (e) => {
- const date = new Date(e.value)
- form.departureTime = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`
- showTimePicker.value = false
-}
-
-const onCoordinatorConfirm = (e) => {
- if (e.value && e.value[0]) {
- form.coordinator.name = e.value[0].label
- form.coordinator.id = e.value[0].value
- // 鑷姩濉厖鍗忚皟鍛樼數璇�
- const contact = form.contacts.find(item => item.role === '鍗忚皟鍛樼數璇�')
- if (contact) {
- contact.phone = '13800138000' // 妯℃嫙鏁版嵁
- }
- }
- showCoordinatorPicker.value = false
-}
-
-const onDoctorConfirm = (e) => {
- if (e.value && e.value[0]) {
- form.emergencyDoctor.name = e.value[0].label
- form.emergencyDoctor.id = e.value[0].value
- // 鑷姩濉厖鎬ヨ瘖鍖荤敓鐢佃瘽
- const contact = form.contacts.find(item => item.role === '鎬ヨ瘖鍖荤敓鐢佃瘽')
- if (contact) {
- contact.phone = '13800138001' // 妯℃嫙鏁版嵁
- }
- }
- showDoctorPicker.value = false
-}
-
-const onNurseConfirm = (e) => {
- if (e.value && e.value[0]) {
- form.nurse.name = e.value[0].label
- form.nurse.id = e.value[0].value
- // 鑷姩濉厖鎶ゅ+鐢佃瘽
- const contact = form.contacts.find(item => item.role === '鎶ゅ+鐢佃瘽')
- if (contact) {
- contact.phone = '13800138002' // 妯℃嫙鏁版嵁
- }
- }
- showNursePicker.value = false
-}
-
-const onDriverConfirm = (e) => {
- if (e.value && e.value[0]) {
- form.driver.name = e.value[0].label
- form.driver.id = e.value[0].value
- // 鑷姩濉厖鍙告満鐢佃瘽
- const contact = form.contacts.find(item => item.role === '鍙告満鐢佃瘽')
- if (contact) {
- contact.phone = '13800138003' // 妯℃嫙鏁版嵁
- }
- }
- showDriverPicker.value = false
-}
-
-const onIcuDoctorConfirm = (e) => {
- if (e.value && e.value[0]) {
- form.icuDoctor.name = e.value[0].label
- form.icuDoctor.id = e.value[0].value
- // 鑷姩濉厖ICU鍖荤敓鐢佃瘽
- const contact = form.contacts.find(item => item.role === 'ICU鍖荤敓鐢佃瘽')
- if (contact) {
- contact.phone = '13800138004' // 妯℃嫙鏁版嵁
- }
- }
- showIcuDoctorPicker.value = false
-}
-
-const handleCancel = () => {
- uni.navigateBack()
-}
-
-const validateForm = () => {
- if (!form.caseInfo.caseId) {
- uni.showToast({ title: '璇烽�夋嫨妗堜緥', icon: 'none' })
- return false
- }
- if (!form.hospital) {
- uni.showToast({ title: '璇疯緭鍏ユ崘鐚尰闄�', icon: 'none' })
- return false
- }
- if (!form.departureTime) {
- uni.showToast({ title: '璇烽�夋嫨鍑哄彂鏃堕棿', icon: 'none' })
- return false
- }
- return true
-}
-
-const handleSaveDraft = async () => {
- if (!validateForm()) return
-
- loading.value = true
+// 鍔犺浇杞繍鍗曟暟鎹�
+const loadTransportData = async (id) => {
+ loading.value = true;
try {
- await new Promise(resolve => setTimeout(resolve, 1000))
- await saveTransport('draft')
- uni.showToast({ title: '淇濆瓨鑽夌鎴愬姛', icon: 'success' })
- } catch (error) {
- console.error('淇濆瓨鑽夌澶辫触:', error)
- uni.showToast({ title: '淇濆瓨澶辫触锛岃閲嶈瘯', icon: 'none' })
- } finally {
- loading.value = false
- }
-}
+ const res = await uni.$uapi.get(`/project/transport/getInfo/${id}`);
-const handleSubmit = async () => {
- if (!validateForm()) return
-
+ if (res.data) {
+ transportData.value = res.data;
+
+ if (res.data.annexfilesList) {
+ attachments.value = res.data.annexfilesList;
+ attachments.value.forEach(item=>{
+ item.url=item.opath,
+ item.name=item.fileName
+ })
+ }
+ } else {
+ throw new Error(res.msg || "鏁版嵁鍔犺浇澶辫触");
+ }
+ } catch (error) {
+ console.error("鍔犺浇杞繍鍗曞け璐�:", error);
+ uni.showToast({
+ title: "鏁版嵁鍔犺浇澶辫触锛岃閲嶈瘯",
+ icon: "none",
+ });
+ } finally {
+ loading.value = false;
+ }
+};
+
+// 鍒濆鍖栨柊鐨勮浆杩愬崟
+const initNewTransport = async (caseId, caseNo) => {
+ try {
+ // 濡傛灉鏈夋渚婭D锛屽姞杞芥渚嬩俊鎭�
+ if (caseId) {
+ const res = await uni.$uapi.get(
+ `/project/donatebaseinforeport/getInfo/${caseId}`,
+ );
+ if (res.data) {
+ const caseData = res.data;
+ console.log(caseData);
+
+ transportData.value = {
+ ...transportData.value,
+ caseNo: caseData.caseNo || "",
+ patName: caseData.name || "",
+ sex: caseData.sex || "",
+ age: caseData.age || "",
+ reportId: caseData.id || null,
+ diagnosisname: caseData.diagnosisname || "",
+ treatmentHospitalName: caseData.treatmenthospitalname || "",
+ treatmentDeptName: caseData.treatmentdeptname || "",
+ // 鍙互璁剧疆涓�浜涢粯璁ゅ��
+ transportStartPlace: caseData.treatmenthospitalname || "",
+ contactPerson: caseData.coordinatorName || "",
+ };
+ console.log(transportData.value, "transportData.value");
+ }
+ } else {
+ transportData.value = {
+ transitStatus: 1,
+ createTime: new Date().toISOString().replace("T", " ").substring(0, 19),
+ };
+ }
+ } catch (error) {
+ console.error("鍒濆鍖栬浆杩愬崟澶辫触:", error);
+ }
+};
+
+// 鑾峰彇杞繍鐘舵�佹枃鏈�
+const getTransportStatusText = (status) => {
+ const map = {
+ 1: "寰呰浆杩�",
+ 2: "杞繍涓�",
+ 3: "杞繍瀹屾垚",
+ 4: "杞繍鍙栨秷",
+ 5: "鏆傚瓨",
+ };
+ return map[status] || "鏈煡";
+};
+
+// 鑾峰彇杞繍鐘舵�佹牱寮�
+const getTransportStatusClass = (status) => {
+ const map = {
+ 1: "pending",
+ 2: "transporting",
+ 3: "completed",
+ 4: "cancelled",
+ 5: "draft",
+ };
+ return map[status] || "draft";
+};
+
+// 鑾峰彇鎬у埆鏂囨湰
+const getGenderText = (gender) => {
+ if (!gender) return "鏈煡";
+ return gender === "1" ? "鐢�" : "濂�";
+};
+
+// 鏍煎紡鍖栨椂闂�
+const formatTime = (timeStr) => {
+ if (!timeStr) return "";
+ return timeStr.replace("T", " ").substring(0, 16);
+};
+
+// 杈撳叆妗嗘牱寮�
+const inputStyle = (isError) => {
+ return isError
+ ? "border: 2rpx solid #f56c6c !important; border-radius: 12rpx !important;"
+ : "border: 2rpx solid #e5e5e7 !important; border-radius: 12rpx !important;";
+};
+
+// 鏃堕棿纭
+const onTimeConfirm = (e) => {
+ const date = new Date(e.value);
+ // 娣诲姞绉掔殑閮ㄥ垎
+ transportData.value.transportStartTime = `${date.getFullYear()}-${(
+ date.getMonth() + 1
+ )
+ .toString()
+ .padStart(2, "0")}-${date.getDate().toString().padStart(2, "0")} ${date
+ .getHours()
+ .toString()
+ .padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}:${date
+ .getSeconds()
+ .toString()
+ .padStart(2, "0")}`; // 娣诲姞绉�
+
+ showTimePicker.value = false;
+};
+
+// 鐘舵�佺‘璁�
+const onStatusConfirm = (e) => {
+ if (e[0]) {
+ transportData.value.transitStatus = e[0].value;
+ }
+ statusSelectVisible.value = false;
+};
+
+// 棰勮鏂囦欢
+const previewFile = (file) => {
+ const fullUrl = file.path || file.fileUrl;
+ if (!fullUrl) {
+ uni.showToast({ title: "鏂囦欢璺緞涓嶅瓨鍦�", icon: "none" });
+ return;
+ }
+
+ if (file.fileName && file.fileName.match(/\.(jpg|jpeg|png|gif|bmp|webp)$/i)) {
+ uni.previewImage({
+ urls: [fullUrl],
+ current: 0,
+ });
+ } else if (file.fileName && file.fileName.match(/\.pdf$/i)) {
+ uni.downloadFile({
+ url: fullUrl,
+ success: (res) => {
+ uni.openDocument({
+ filePath: res.tempFilePath,
+ fileType: "pdf",
+ showMenu: true,
+ });
+ },
+ fail: (err) => {
+ console.error("鎵撳紑鏂囨。澶辫触:", err);
+ uni.showToast({ title: "鎵撳紑鏂囦欢澶辫触", icon: "none" });
+ },
+ });
+ } else {
+ uni.showToast({ title: "鏆備笉鏀寔姝ゆ枃浠剁被鍨嬮瑙�", icon: "none" });
+ }
+};
+
+// 杩斿洖
+const goBack = () => {
+ uni.navigateBack();
+};
+
+// 缂栬緫
+const handleEdit = () => {
+ isEdit.value = true;
+};
+
+// 鍙栨秷缂栬緫
+const cancelEdit = () => {
+ if (transportId.value) {
+ // 閲嶆柊鍔犺浇鏁版嵁
+ isEdit.value = false;
+ loadTransportData(transportId.value);
+ } else {
+ // 鏂板妯″紡锛岀洿鎺ヨ繑鍥�
+ uni.navigateBack();
+ }
+};
+
+// 淇濆瓨
+const handleSave = async () => {
+ if (!validateForm()) return;
+
+ saving.value = true;
+
+ try {
+ // const submitData = {
+ // ...transportData.value,
+
+ // };
+ const submitData = {
+ ...transportData.value,
+ annexfilesList: attachments.value.map((file) => ({
+ path: file.url,
+ fileName: file.name,
+ type: file.type,
+ })),
+ };
+ let res;
+ if (transportId.value) {
+ // 淇敼
+ res = await uni.$uapi.post("/project/transport/edit", submitData);
+ } else {
+ // 鏂板
+ submitData.createBy = "绉诲姩绔敤鎴�";
+ res = await uni.$uapi.post("/project/transport/add", submitData);
+ }
+
+ if (res.code === 200) {
+ uni.showToast({
+ title: transportId.value ? "淇敼鎴愬姛" : "鏂板鎴愬姛",
+ icon: "success",
+ });
+
+ if (transportId.value) {
+ // 閲嶆柊鍔犺浇鏁版嵁
+ isEdit.value = false;
+ await loadTransportData(transportId.value);
+ } else {
+ // 鏂板鎴愬姛鍚庤繑鍥炲垪琛�
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 1500);
+ }
+ } else {
+ throw new Error(res.msg || "鎿嶄綔澶辫触");
+ }
+ } catch (error) {
+ console.error("淇濆瓨澶辫触:", error);
+ uni.showToast({
+ title: error.message || (transportId.value ? "淇敼澶辫触" : "鏂板澶辫触"),
+ icon: "none",
+ });
+ } finally {
+ saving.value = false;
+ }
+};
+
+// 琛ㄥ崟楠岃瘉
+const validateForm = () => {
+ if (!transportData.value.transportStartPlace) {
+ uni.showToast({ title: "璇疯緭鍏ュ嚭鍙戝湴鐐�", icon: "none" });
+ return false;
+ }
+
+ if (!transportData.value.transportStartTime) {
+ uni.showToast({ title: "璇烽�夋嫨鍑哄彂鏃堕棿", icon: "none" });
+ return false;
+ }
+
+ if (!transportData.value.contactPerson) {
+ uni.showToast({ title: "璇疯緭鍏ヨ礋璐e崗璋冨憳", icon: "none" });
+ return false;
+ }
+
+ return true;
+};
+
+// 寮�濮嬭浆杩�
+const handleStartTransport = () => {
uni.showModal({
- title: '纭鎻愪氦',
- content: '纭畾瑕佹彁浜よ浆杩愬崟鐢宠鍚楋紵',
+ title: "寮�濮嬭浆杩�",
+ content: "纭畾瑕佸紑濮嬭浆杩愬悧锛�",
success: async (res) => {
if (res.confirm) {
- loading.value = true
- try {
- await new Promise(resolve => setTimeout(resolve, 1500))
- await saveTransport('pending')
- uni.showToast({ title: '鎻愪氦鎴愬姛', icon: 'success' })
- setTimeout(() => {
- uni.navigateBack()
- }, 1500)
- } catch (error) {
- console.error('鎻愪氦澶辫触:', error)
- uni.showToast({ title: '鎻愪氦澶辫触锛岃閲嶈瘯', icon: 'none' })
- } finally {
- loading.value = false
- }
+ await updateTransportStatus(2, "寮�濮嬭浆杩�");
}
- }
- })
-}
-
-const saveTransport = async (status) => {
- const submitData = {
- ...form,
- status: status,
- id: isEdit.value ? transportId.value : generateTransportId(),
- createTime: new Date().toISOString()
- }
-
- console.log('淇濆瓨杞繍鍗�:', submitData)
- // 瀹為檯椤圭洰涓皟鐢ˋPI鎺ュ彛
-}
-
-const generateTransportId = () => {
- const date = new Date()
- return `T${date.getFullYear()}${(date.getMonth() + 1).toString().padStart(2, '0')}${date.getDate().toString().padStart(2, '0')}${Math.random().toString().slice(-3)}`
-}
-
-const loadTransportData = (id) => {
- // 妯℃嫙鍔犺浇缂栬緫鏁版嵁
- const mockData = {
- caseInfo: {
- caseId: 'DON20241216001',
- donorName: '寮犱笁',
- gender: '鐢�',
- age: '38',
- diagnosis: '鑴戝浼ゅ鑷磋剳姝讳骸'
},
- hospital: '闈掑矝闀滄箹鍖婚櫌',
- department: '绁炵粡澶栫',
- departureTime: '2024-12-17 14:30:00',
- departureLocation: '闈掑矝甯傜珛鍖婚櫌鎬ヨ瘖绉�',
- destinationHospital: '闈掑矝闀滄箹鍖婚櫌',
- coordinator: { id: '1', name: '寮犲尰鐢�' },
- emergencyDoctor: { id: '2', name: '鐜嬪尰鐢�' },
- nurse: { id: '3', name: '鏉庢姢澹�' },
- driver: { id: '4', name: '鍒樺笀鍌�' },
- icuDoctor: { id: '5', name: '璧靛尰鐢�' },
- contacts: [
- { role: '鍗忚皟鍛樼數璇�', phone: '13800138000' },
- { role: '鎬ヨ瘖鍖荤敓鐢佃瘽', phone: '13800138001' },
- { role: '鎶ゅ+鐢佃瘽', phone: '13800138002' },
- { role: '鍙告満鐢佃瘽', phone: '13800138003' },
- { role: 'ICU鍖荤敓鐢佃瘽', phone: '13800138004' }
- ],
- remarks: '闇�瑕佸噯澶囧懠鍚告満绛夋�ユ晳璁惧'
- }
-
- Object.assign(form, mockData)
-}
+ });
+};
-// 鐢熷懡鍛ㄦ湡
-onLoad((options) => {
- if (options.id) {
- isEdit.value = true
- transportId.value = options.id
- loadTransportData(options.id)
+// 瀹屾垚杞繍
+const handleCompleteTransport = () => {
+ uni.showModal({
+ title: "瀹屾垚杞繍",
+ content: "纭畾瑕佸畬鎴愯浆杩愬悧锛�",
+ success: async (res) => {
+ if (res.confirm) {
+ await updateTransportStatus(3, "瀹屾垚杞繍");
+ }
+ },
+ });
+};
+
+// 鏇存柊杞繍鐘舵��
+const updateTransportStatus = async (newStatus, actionName) => {
+ try {
+ const updateData = {
+ id: transportId.value,
+ transitStatus: newStatus,
+ ...transportData.value,
+ annexfilesList: attachments.value.map((file) => ({
+ path: file.url,
+ fileName: file.name,
+ type: file.type,
+ })),
+ };
+
+ const res = await uni.$uapi.post("/project/transport/edit", updateData);
+
+ if (res.code === 200) {
+ uni.showToast({ title: `${actionName}鎴愬姛`, icon: "success" });
+ await loadTransportData(transportId.value);
+ } else {
+ throw new Error(res.msg || `${actionName}澶辫触`);
+ }
+ } catch (error) {
+ console.error(`${actionName}澶辫触:`, error);
+ uni.showToast({ title: `${actionName}澶辫触`, icon: "none" });
}
-})
+};
+
+// 澶勭悊鍩虹闄勪欢涓婁紶
+const handleBaseUpload = (file) => {
+ console.log("鍩虹闄勪欢涓婁紶鎴愬姛:", file);
+ attachments.value.push(file);
+
+};
+
+// 澶勭悊鍏朵粬闄勪欢涓婁紶
+const handleFilesUpdate = (files) => {
+ console.log(files,'files');
+
+ attachments.value = files.map((file) => ({
+ ...file,
+ // 纭繚鍙瓨鍌ㄥ崐璺緞
+ // url: file.url.startsWith("http")
+ // ? file.url.replace(baseUrlHt, "")
+ // : file.url,
+ }));
+ console.log(attachments.value);
+
+};
+
+// 棰勮鏂囦欢 - 淇敼涓轰娇鐢ㄥ畬鏁碪RL
+const handlePreview = (file) => {
+ const fullUrl = file.url.startsWith("http")
+ ? file.url
+ : baseUrlHt + (file.url.startsWith("/") ? "" : "/") + file.url;
+
+ if (file.type.includes("image")) {
+ uni.previewImage({
+ urls: attachments.value
+ .filter((f) => f.type.includes("image"))
+ .map((f) =>
+ f.url.startsWith("http")
+ ? f.url
+ : baseUrlHt + (f.url.startsWith("/") ? "" : "/") + f.url,
+ ),
+ current: fullUrl,
+ });
+ } else if (file.type.includes("pdf")) {
+ uni.downloadFile({
+ url: fullUrl,
+ success: (res) => {
+ uni.openDocument({
+ filePath: res.tempFilePath,
+ fileType: "pdf",
+ showMenu: true,
+ });
+ },
+ fail: (err) => {
+ console.error("鎵撳紑鏂囨。澶辫触:", err);
+ uni.showToast({ title: "鎵撳紑鏂囦欢澶辫触", icon: "none" });
+ },
+ });
+ } else {
+ uni.showToast({ title: "鏆備笉鏀寔姝ゆ枃浠剁被鍨嬮瑙�", icon: "none" });
+ }
+};
</script>
<style lang="scss" scoped>
.transport-edit-container {
min-height: 100vh;
background: linear-gradient(135deg, #f8fdff 0%, #e8f7f6 100%);
+ padding-bottom: 120rpx; /* 涓烘搷浣滄爮鐣欏嚭绌洪棿 */
}
.form-scroll {
@@ -642,25 +838,84 @@
padding: 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
+
+ .section-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 30rpx;
+ padding-bottom: 20rpx;
+ border-bottom: 2rpx solid #f0f0f0;
+ }
+
+ .section-icon {
+ font-size: 32rpx;
+ margin-right: 16rpx;
+ }
+
+ .section-title {
+ font-size: 32rpx;
+ font-weight: 600;
+ color: #1d1d1f;
+ flex: 1;
+ }
+
+ .status-tag {
+ padding: 6rpx 16rpx;
+ border-radius: 8rpx;
+ font-size: 24rpx;
+ font-weight: 500;
+
+ &.pending {
+ background: rgba(240, 173, 78, 0.1);
+ color: #f0ad4e;
+ }
+
+ &.transporting {
+ background: rgba(0, 122, 255, 0.1);
+ color: #007aff;
+ }
+
+ &.completed {
+ background: rgba(76, 217, 100, 0.1);
+ color: #4cd964;
+ }
+
+ &.cancelled {
+ background: rgba(220, 223, 230, 0.1);
+ color: #dcdfe6;
+ }
+
+ &.draft {
+ background: rgba(144, 147, 153, 0.1);
+ color: #909399;
+ }
+ }
}
-.section-header {
- display: flex;
-// align-items: center;
- margin-bottom: 30rpx;
- padding-bottom: 20rpx;
- border-bottom: 2rpx solid #f0f0f0;
-}
+.case-info {
+ .info-row {
+ display: flex;
+ margin-bottom: 16rpx;
-.section-icon {
- font-size: 32rpx;
- margin-right: 16rpx;
-}
+ &:last-child {
+ margin-bottom: 0;
+ }
-.section-title {
- font-size: 32rpx;
- font-weight: 600;
- color: #1d1d1f;
+ .info-label {
+ font-size: 28rpx;
+ color: #606266;
+ min-width: 140rpx;
+ margin-right: 10rpx;
+ }
+
+ .info-value {
+ font-size: 28rpx;
+ color: #303133;
+ flex: 1;
+ font-weight: 500;
+ }
+ }
}
.form-grid {
@@ -672,22 +927,38 @@
.form-item {
display: flex;
flex-direction: column;
-
+
&.full-width {
grid-column: 1 / -1;
}
-}
-.item-label {
- font-size: 28rpx;
- color: #1d1d1f;
- font-weight: 500;
- margin-bottom: 12rpx;
-
- &.required::after {
- content: '*';
- color: #ff4757;
- margin-left: 4rpx;
+ .item-label {
+ font-size: 28rpx;
+ color: #1d1d1f;
+ font-weight: 500;
+ margin-bottom: 12rpx;
+
+ &.required::after {
+ content: "*";
+ color: #f56c6c;
+ margin-left: 4rpx;
+ }
+ }
+
+ .picker-trigger {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ height: 88rpx;
+ padding: 0 20rpx;
+ background: #f5f5f5;
+ border-radius: 8rpx;
+ border: 1rpx solid #dcdfe6;
+
+ text {
+ font-size: 28rpx;
+ color: #303133;
+ }
}
}
@@ -704,39 +975,132 @@
border-radius: 12rpx !important;
padding: 20rpx 24rpx !important;
background: #fff !important;
+ min-height: 150rpx;
+}
+
+// 闄勪欢鍒楄〃
+.attachment-list {
+ .attachment-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 20rpx 0;
+ border-bottom: 1rpx solid #f0f0f0;
+
+ &:last-child {
+ border-bottom: none;
+ }
+
+ &:active {
+ background: #f5f5f5;
+ }
+
+ .file-info {
+ display: flex;
+ align-items: center;
+ flex: 1;
+
+ .file-icon {
+ margin-right: 16rpx;
+ }
+
+ .file-details {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+
+ .file-name {
+ font-size: 28rpx;
+ color: #303133;
+ margin-bottom: 4rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ max-width: 500rpx;
+ }
+
+ .file-time {
+ font-size: 24rpx;
+ color: #909399;
+ }
+ }
+ }
+ }
}
.action-buttons {
display: flex;
gap: 20rpx;
margin-top: 40rpx;
+ background: #fff;
+ padding: 20rpx 0;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ padding: 20rpx 30rpx;
+ padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
+ box-shadow: 0 -2rpx 20rpx rgba(0, 0, 0, 0.08);
+ z-index: 9;
}
.btn {
flex: 1;
height: 80rpx;
- border-radius: 16rpx;
- font-size: 32rpx;
- font-weight: 500;
-
+ border-radius: 20rpx;
+ font-size: 28rpx;
+ font-weight: 600;
+ border: none;
+ transition: all 0.3s ease;
+
&.secondary {
- background: #f5f5f7 !important;
- color: #1d1d1f !important;
+ background: #f5f5f7;
+ color: #1d1d1f;
+
+ &:active {
+ background: #e5e5e7;
+ }
}
-
+
&.primary {
- background: #2979ff !important;
- color: #fff !important;
+ background: linear-gradient(90deg, #0071e3 0%, #2997ff 100%);
+ color: #fff;
+
+ &:active {
+ transform: scale(0.98);
+ }
}
-
+
+ &.warning {
+ background: linear-gradient(90deg, #f0ad4e 0%, #f8b62d 100%);
+ color: #fff;
+
+ &:active {
+ transform: scale(0.98);
+ }
+ }
+
&.success {
- background: linear-gradient(135deg, #0f95b0, #89C4C1) !important;
- color: #fff !important;
-
+ background: linear-gradient(90deg, #34c759 0%, #4cd964 100%);
+ color: #fff;
+
&:disabled {
- background: #c0c0c0 !important;
+ background: #c0c4cc;
opacity: 0.6;
+ }
+
+ &:active:not(:disabled) {
+ transform: scale(0.98);
+ }
+ }
+
+ &.error {
+ background: linear-gradient(90deg, #ff3b30 0%, #ff5a5a 100%);
+ color: #fff;
+
+ &:active {
+ transform: scale(0.98);
}
}
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.3