messageItem.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <u-swipe-action>
  3. <u-swipe-action-item :options="options" @click="deleteMessage">
  4. <view class="message_box" @click="$navTo('/pages/myMessage/chat')">
  5. <view class="message">
  6. <view class="avatar" v-if="type === 'message'">
  7. <image
  8. class="w-88 h-88 radio-circle"
  9. src="/static/logo.png"
  10. mode="scaleToFill"
  11. />
  12. </view>
  13. <view class="right_content">
  14. <view class="w flex ai_top">
  15. <view class="ellipsis text-32 text-400 text-303030">
  16. {{
  17. type === "message"
  18. ? "用户名称用户名称用户名称用户名称用户名称用户名称"
  19. : "消息类型:接单 "
  20. }}
  21. </view>
  22. <view class="text-20 text-500 text-7E7E7E">2025/09/04 20:00</view>
  23. </view>
  24. <view
  25. class="w flex ai_center"
  26. :class="type === 'message' ? 'mgt-4' : 'mgt-8'"
  27. >
  28. <view class="ellipsis text-28 text-400 text-B9B9B9">
  29. 消息内容:
  30. {{
  31. type === "message"
  32. ? "不好意思,您在提交一次不好意思,您在提交一次"
  33. : "YHY "
  34. }}
  35. </view>
  36. <view v-if="type === 'message'" class="num">99+</view>
  37. <view v-else>
  38. <view class="task_type task_order"> 用户已接单 </view>
  39. <!-- <view class="task_type task_check"> 审核已通过 </view>
  40. <view class="task_type task_submit"> 用户已提交任务 </view>
  41. <view class="task_type task_end"> 距离悬赏任务结束时间还有10分钟 </view>
  42. <view class="task_type task_pass"> 订单审核已通过 </view>
  43. <view class="task_type task_not_pass"> 订单审核未通过 </view> -->
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </u-swipe-action-item>
  50. </u-swipe-action>
  51. </template>
  52. <script>
  53. export default {
  54. props: {
  55. type: {
  56. type: String,
  57. default: "message",
  58. },
  59. },
  60. data() {
  61. return {
  62. options: [
  63. {
  64. text: "删除",
  65. style: {
  66. backgroundColor: "#E02E24",
  67. width: "128rpx",
  68. marginTop: "1rpx",
  69. height: "126rpx",
  70. fontSize: "24rpx",
  71. },
  72. },
  73. ],
  74. };
  75. },
  76. onLoad() {},
  77. methods: {
  78. deleteMessage(e) {
  79. this.$emit('delete-msg',e)
  80. },
  81. },
  82. };
  83. </script>
  84. <style scoped lang="scss">
  85. .message_box {
  86. width: 100vw;
  87. padding: 0 48rpx;
  88. background-color: #ffffff;
  89. margin-bottom: 16rpx;
  90. .message {
  91. width: 100%;
  92. height: 126rpx;
  93. display: flex;
  94. align-items: center;
  95. justify-content: center;
  96. border-bottom: 2rpx solid #f2f2f7;
  97. .avatar {
  98. width: 88rpx;
  99. margin-right: 24rpx;
  100. }
  101. .right_content {
  102. height: 100%;
  103. flex: 1;
  104. display: flex;
  105. flex-direction: column;
  106. justify-content: center;
  107. .ellipsis {
  108. flex: 1;
  109. width: 0;
  110. overflow: hidden;
  111. white-space: nowrap;
  112. text-overflow: ellipsis;
  113. }
  114. .num {
  115. display: inline-flex;
  116. height: 40rpx;
  117. padding: 4rpx 16rpx;
  118. justify-content: center;
  119. align-items: center;
  120. border-radius: 64rpx;
  121. background: #e02e24;
  122. color: #ffffff;
  123. text-align: center;
  124. font-family: "Source Han Sans CN";
  125. font-size: 20rpx;
  126. font-weight: 500;
  127. }
  128. }
  129. }
  130. }
  131. .task_type {
  132. display: inline-flex;
  133. padding: 0 16rpx;
  134. justify-content: center;
  135. align-items: center;
  136. gap: 20rpx;
  137. border-radius: 16rpx 0 16rpx 16rpx;
  138. font-family: "MiSans VF";
  139. font-size: 24rpx;
  140. font-weight: 400;
  141. line-height: 40rpx;
  142. }
  143. // 用户已接单
  144. .task_order {
  145. color: #7174f7;
  146. background: #7174f71a;
  147. }
  148. //审核已通过
  149. .task_check {
  150. color: #fe6505;
  151. background: #fe65051a;
  152. }
  153. // 用户已提交任务
  154. .task_submit {
  155. color: #4597f7;
  156. background: #4597f71a;
  157. }
  158. //距离悬赏任务结束
  159. .task_end {
  160. color: #3f9466;
  161. background: #3f94661a;
  162. }
  163. // 订单审核已通过
  164. .task_pass {
  165. color: #fe6505;
  166. background: #fe65051a;
  167. }
  168. // 订单审核未通过
  169. .task_not_pass {
  170. color: #e02e24;
  171. background: #e02e241a;
  172. }
  173. </style>