25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

342 satır
8.3 KiB

  1. <template>
  2. <view class="page">
  3. <view v-if="msg" class="card">
  4. <!-- 顶部:图标 + 标题 + 标签 -->
  5. <view class="header-row">
  6. <text class="header-icon">📢</text>
  7. <text class="header-title">{{ headerTitle }}</text>
  8. <view class="tag" :class="tagClass">
  9. {{ tagText }}
  10. </view>
  11. </view>
  12. <!-- 大标题 -->
  13. <view class="main-title">{{ mainTitle }}</view>
  14. <view class="time">{{ msg.create_time }}</view>
  15. <!-- 正文 -->
  16. <view class="body">
  17. <text class="greeting">尊敬的{{ msg.patient_name || '' }}:</text>
  18. <text class="body-text" v-if="msg.type === 1">{{ auditApprovedText }}</text>
  19. <text class="body-text" v-else-if="msg.type === 2">您于 {{ formatDate(msg.create_time) }} 提交的个人资料经审核未通过。</text>
  20. <text class="body-text" v-else-if="msg.type === 3">您的样品已经寄回,请注意查收。</text>
  21. <text class="body-text" v-else-if="msg.type === 4 && !msg.reason">您的送检信息修改申请已审核通过,请前往送检信息页面重新提交。</text>
  22. <text class="body-text" v-else-if="msg.type === 4">您的送检信息修改申请未通过。</text>
  23. <text class="body-text" v-if="msg.type === 2">请根据以下原因修改后重新提交。</text>
  24. </view>
  25. <view v-if="msg.type === 1" class="receiver-box">
  26. <view class="receiver-title">送检信息</view>
  27. <view class="receiver-tip">{{ sampleSendTip }}</view>
  28. <view class="receiver-row">
  29. <text class="receiver-label">收件地址</text>
  30. <text class="receiver-value">{{ sampleReceiverInfo.address || '—' }}</text>
  31. </view>
  32. <view class="receiver-row">
  33. <text class="receiver-label">收件人</text>
  34. <text class="receiver-value">{{ sampleReceiverInfo.receiver || '—' }}</text>
  35. </view>
  36. <view class="receiver-row">
  37. <text class="receiver-label">电话</text>
  38. <text class="receiver-value">{{ sampleReceiverInfo.phone || '—' }}</text>
  39. </view>
  40. </view>
  41. <!-- 驳回原因 -->
  42. <view v-if="(msg.type === 2 || msg.type === 4) && msg.reason" class="reason-box">
  43. <text class="reason-label">{{ msg.type === 4 ? '审核原因:' : '驳回原因:' }}</text>
  44. <text class="reason-text">{{ msg.reason }}</text>
  45. </view>
  46. <view v-if="msg.type === 3" class="return-box">
  47. <text class="return-label">回寄物流单号</text>
  48. <text class="return-no">{{ returnTrackingNo || '—' }}</text>
  49. </view>
  50. <!-- 操作按钮 -->
  51. <view v-if="msg.type === 1" class="btn-area">
  52. <u-button text="复制送检信息" @click="copySampleReceiverInfo" color="#0E63E3" size="large" />
  53. </view>
  54. <view v-if="msg.type === 2" class="btn-area">
  55. <u-button text="重新提交资料" @click="goMyInfo" color="#0E63E3" size="large" />
  56. </view>
  57. <view v-if="msg.type === 3" class="btn-area">
  58. <u-button text="复制单号" @click="copyReturnTrackingNo" color="#0E63E3" size="large" />
  59. </view>
  60. <view v-if="msg.type === 4" class="btn-area">
  61. <u-button text="查看送检信息" @click="goSampleInfo" color="#0E63E3" size="large" />
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script setup>
  67. import { computed, ref } from 'vue'
  68. import { onLoad } from '@dcloudio/uni-app'
  69. import { get } from '@/utils/request.js'
  70. const msg = ref(null)
  71. const auditApprovedText = '您提交的肠愈同行患者关爱项目资料已审核通过,请于7天内在小程序-个人中心-送检信息中提交相关信息。'
  72. const sampleSendTip = '样本请发顺丰到付,血液样本需要联系顺丰快递员加冰袋。'
  73. const sampleReceiverInfo = computed(() => (msg.value && msg.value.sample_receiver_info) || {})
  74. const returnTrackingNo = computed(() => (msg.value && msg.value.reason) || '')
  75. const tagText = computed(() => {
  76. if (!msg.value) return ''
  77. if (msg.value.type === 1) return '已通过'
  78. if (msg.value.type === 3) return '已寄回'
  79. if (msg.value.type === 4) return msg.value.reason ? '未通过' : '已通过'
  80. return '已驳回'
  81. })
  82. const headerTitle = computed(() => {
  83. if (!msg.value) return ''
  84. if (msg.value.type === 3) return '回寄信息'
  85. if (msg.value.type === 4) return '送检信息通知'
  86. return '审核通知'
  87. })
  88. const tagClass = computed(() => {
  89. if (!msg.value) return ''
  90. if (msg.value.type === 1) return 'tag-success'
  91. if (msg.value.type === 3) return 'tag-return'
  92. if (msg.value.type === 4) return msg.value.reason ? 'tag-fail' : 'tag-success'
  93. return 'tag-fail'
  94. })
  95. const mainTitle = computed(() => {
  96. if (!msg.value) return ''
  97. if (msg.value.type === 1) return '资料已审核通过'
  98. if (msg.value.type === 3) return '样品已经寄回'
  99. if (msg.value.type === 4) return msg.value.reason ? '送检修改申请未通过' : '送检修改申请已通过'
  100. return '您提交的资料未通过审核'
  101. })
  102. onLoad(async (options) => {
  103. if (!options.id) return
  104. try {
  105. const res = await get('/api/mp/messageDetail', { id: options.id })
  106. msg.value = res.data
  107. } catch (e) {
  108. if (e && e.msg) uni.showToast({ title: e.msg, icon: 'none' })
  109. }
  110. })
  111. const formatDate = (dateStr) => {
  112. if (!dateStr) return ''
  113. const d = new Date(dateStr)
  114. return `${d.getFullYear()}年${d.getMonth() + 1}月${d.getDate()}日`
  115. }
  116. const goMyInfo = () => {
  117. uni.navigateTo({ url: '/pages/myinfo/myinfo' })
  118. }
  119. const goSampleInfo = () => {
  120. uni.navigateTo({ url: '/pages/sample-info/sample-info' })
  121. }
  122. const copySampleReceiverInfo = () => {
  123. const info = sampleReceiverInfo.value
  124. const text = [
  125. `收件地址:${info.address || ''}`,
  126. `收件人:${info.receiver || ''}`,
  127. `电话:${info.phone || ''}`
  128. ].join('\n')
  129. uni.setClipboardData({
  130. data: text,
  131. success: () => uni.showToast({ title: '已复制', icon: 'success' })
  132. })
  133. }
  134. const copyReturnTrackingNo = () => {
  135. if (!returnTrackingNo.value) return uni.showToast({ title: '暂无单号', icon: 'none' })
  136. uni.setClipboardData({
  137. data: returnTrackingNo.value,
  138. success: () => uni.showToast({ title: '单号已复制', icon: 'success' })
  139. })
  140. }
  141. </script>
  142. <style lang="scss" scoped>
  143. .page {
  144. min-height: 100vh;
  145. background: #f4f4f5;
  146. padding: 24rpx;
  147. }
  148. .card {
  149. background: #fff;
  150. border-radius: 10rpx;
  151. padding: 36rpx 32rpx;
  152. border: 1rpx solid #ebeef5;
  153. }
  154. .header-row {
  155. display: flex;
  156. align-items: center;
  157. gap: 12rpx;
  158. margin-bottom: 28rpx;
  159. }
  160. .header-icon {
  161. font-size: 32rpx;
  162. }
  163. .header-title {
  164. font-size: 30rpx;
  165. font-weight: 600;
  166. color: #333;
  167. }
  168. .tag {
  169. font-size: 22rpx;
  170. padding: 4rpx 16rpx;
  171. border-radius: 6rpx;
  172. &.tag-success {
  173. background: #f6ffed;
  174. color: #52c41a;
  175. border: 1rpx solid #b7eb8f;
  176. }
  177. &.tag-fail {
  178. background: #fff2f0;
  179. color: #f5222d;
  180. border: 1rpx solid #ffa39e;
  181. }
  182. &.tag-return {
  183. background: #f0f5ff;
  184. color: #0e63e3;
  185. border: 1rpx solid #adc6ff;
  186. }
  187. }
  188. .main-title {
  189. font-size: 36rpx;
  190. font-weight: 700;
  191. color: #222;
  192. line-height: 1.4;
  193. }
  194. .time {
  195. font-size: 26rpx;
  196. color: #999;
  197. margin-top: 12rpx;
  198. margin-bottom: 36rpx;
  199. }
  200. .body {
  201. display: flex;
  202. flex-direction: column;
  203. gap: 20rpx;
  204. }
  205. .greeting {
  206. font-size: 30rpx;
  207. color: #333;
  208. }
  209. .body-text {
  210. font-size: 30rpx;
  211. color: #333;
  212. line-height: 1.7;
  213. }
  214. .reason-box {
  215. margin-top: 36rpx;
  216. background: #f0f5ff;
  217. border-left: 6rpx solid #0e63e3;
  218. border-radius: 8rpx;
  219. padding: 28rpx 24rpx;
  220. }
  221. .reason-label {
  222. font-size: 28rpx;
  223. font-weight: 600;
  224. color: #f5222d;
  225. display: block;
  226. margin-bottom: 12rpx;
  227. }
  228. .reason-text {
  229. font-size: 28rpx;
  230. color: #555;
  231. line-height: 1.7;
  232. }
  233. .return-box {
  234. margin-top: 36rpx;
  235. background: #f0f5ff;
  236. border-left: 6rpx solid #0e63e3;
  237. border-radius: 8rpx;
  238. padding: 28rpx 24rpx;
  239. }
  240. .return-label {
  241. font-size: 28rpx;
  242. font-weight: 600;
  243. color: #303133;
  244. display: block;
  245. margin-bottom: 12rpx;
  246. }
  247. .return-no {
  248. font-size: 34rpx;
  249. font-weight: 600;
  250. color: #0e63e3;
  251. line-height: 1.5;
  252. }
  253. .receiver-box {
  254. margin-top: 36rpx;
  255. background: #fafafa;
  256. border: 1rpx solid #ebeef5;
  257. border-radius: 8rpx;
  258. padding: 28rpx 24rpx;
  259. }
  260. .receiver-title {
  261. font-size: 30rpx;
  262. font-weight: 600;
  263. color: #333;
  264. margin-bottom: 20rpx;
  265. }
  266. .receiver-tip {
  267. font-size: 26rpx;
  268. color: #fa541c;
  269. line-height: 1.6;
  270. background: #fff7e6;
  271. border: 1rpx solid #ffd591;
  272. border-radius: 8rpx;
  273. padding: 16rpx 20rpx;
  274. margin-bottom: 20rpx;
  275. }
  276. .receiver-row {
  277. display: flex;
  278. gap: 20rpx;
  279. margin-bottom: 14rpx;
  280. &:last-child {
  281. margin-bottom: 0;
  282. }
  283. }
  284. .receiver-label {
  285. width: 120rpx;
  286. flex-shrink: 0;
  287. font-size: 26rpx;
  288. color: #909399;
  289. }
  290. .receiver-value {
  291. flex: 1;
  292. font-size: 26rpx;
  293. color: #303133;
  294. line-height: 1.6;
  295. }
  296. .btn-area {
  297. margin-top: 48rpx;
  298. }
  299. </style>