You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

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