guide.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="container">
  3. <view class="list-box">
  4. <view class="list-item-box" v-for="item in list" :key="item.id" @click="onGuideClick(item)">
  5. <view class="main-box">
  6. <view class="icon-box">
  7. <view class="iconfont icon-banshizhiyin"></view>
  8. <!-- <cover-image class="icon"
  9. :src="`${FILE_URL}/notice/icon-1.jpg`"></cover-image> -->
  10. </view>
  11. <view class="content-box">
  12. <view class="title">
  13. {{item.title}}
  14. </view>
  15. <view class="text">
  16. {{item.desc}}
  17. </view>
  18. </view>
  19. <view class="other-box">
  20. <view class="date">
  21. {{item.date}}
  22. </view>
  23. </view>
  24. </view>
  25. <view class="line-box"></view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script setup>
  31. import {
  32. ref
  33. } from 'vue'
  34. import {
  35. onLoad
  36. } from '@dcloudio/uni-app'
  37. import { getGuideList } from '@/api/notice.js'
  38. import configService from '@/utils/baseurl.js'
  39. const FILE_URL = configService.FILE_URL;
  40. const uToast = ref()
  41. const searchInputStyle = {
  42. backgroundColor: '#E5E5E5'
  43. }
  44. const searchForm = ref({
  45. keyword: ''
  46. })
  47. const list = ref([{
  48. "id": "1",
  49. "title": "申请加入协会指南",
  50. "desc": "想要加入我们的协会吗?请填写申请表并提交至办公室,审核后会通知您结果。",
  51. "date": "2023-10-01"
  52. },
  53. {
  54. "id": "2",
  55. "title": "报销流程说明",
  56. "desc": "如需进行费用报销,请准备相关发票,填写报销申请表并交由财务部门审批。",
  57. "date": "2023-09-15"
  58. },
  59. {
  60. "id": "3",
  61. "title": "会议室预约流程",
  62. "desc": "欲预约会议室,请访问协会官网填写预约表格,确认后将收到预约确认邮件。",
  63. "date": "2023-10-05"
  64. },
  65. {
  66. "id": "4",
  67. "title": "活动报名流程",
  68. "desc": "参加活动需要提前报名,可以通过协会公众号扫码填写报名表,截止日期为活动前两天。",
  69. "date": "2023-10-10"
  70. },
  71. {
  72. "id": "5",
  73. "title": "投诉建议提交指引",
  74. "desc": "若有意见或建议,请下载投诉建议表,填写完毕后发送至协会邮箱,我们将及时处理并反馈您的意见。",
  75. "date": "2023-10-12"
  76. }
  77. ])
  78. function init() {
  79. getGuideList().then(res=>{
  80. if(res?.data){
  81. list.value = res.data
  82. }
  83. })
  84. }
  85. onLoad(()=>{
  86. init();
  87. })
  88. function onGuideClick(guide) {
  89. uni.navigateTo({
  90. url: `/pages/guide/guideDetail/guideDetail?id=${guide.id}&title=${guide.title}`
  91. })
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. .container {
  96. height: 100vh;
  97. width: 100vw;
  98. background-color: #FFFFFF;
  99. padding: 0 20rpx env(safe-area-inset-bottom, 0);
  100. .search-box {
  101. margin-bottom: 20rpx;
  102. ::v-deep(.u-search) {
  103. background-color: #e5e5e5;
  104. border-radius: 50rpx;
  105. .u-action {
  106. width: 18%;
  107. background-color: $uni-color-primary;
  108. border-radius: 50rpx;
  109. color: $uni-text-color-inverse;
  110. margin-right: 8rpx;
  111. font-size: 28rpx;
  112. line-height: 50rpx;
  113. letter-spacing: 3rpx;
  114. text-align: center;
  115. }
  116. }
  117. }
  118. .list-box {
  119. padding: 0 20rpx;
  120. .list-item-box {
  121. .main-box {
  122. display: flex;
  123. justify-content: space-between;
  124. align-items: center;
  125. padding: 30rpx 0;
  126. &:active {
  127. background-color: $uni-bg-color-hover;
  128. }
  129. .icon-box {
  130. width: 15%;
  131. display: flex;
  132. justify-content: center;
  133. align-items: center;
  134. .icon {
  135. width: 70rpx;
  136. height: 70rpx;
  137. }
  138. .iconfont{
  139. font-size: 60rpx;
  140. color: #0069f6;
  141. }
  142. }
  143. .content-box {
  144. width: 67%;
  145. display: flex;
  146. flex-direction: column;
  147. justify-content: space-around;
  148. gap: 10rpx;
  149. .title {
  150. height: calc(70% - 5rpx);
  151. font-size: $uni-title-font-size-2;
  152. font-weight: bold;
  153. }
  154. .text {
  155. height: calc(30% - 5rpx);
  156. font-size: $uni-font-size-3;
  157. color: $uni-text-color-grey;
  158. @include text-overflow();
  159. }
  160. }
  161. .other-box {
  162. width: 18%;
  163. display: flex;
  164. flex-direction: column;
  165. justify-content: space-around;
  166. align-items: center;
  167. gap: 10rpx;
  168. .date {
  169. font-size: $uni-font-size-3;
  170. color: $uni-text-color-grey;
  171. }
  172. .tag {
  173. font-size: $uni-font-size-3;
  174. width: 42rpx;
  175. background-color: $uni-color-error;
  176. color: $uni-text-color-inverse;
  177. border-radius: 20rpx;
  178. text-align: center;
  179. }
  180. }
  181. }
  182. .line-box {
  183. height: 1rpx;
  184. width: 80%;
  185. background-color: #E5E5E5;
  186. margin: 0 auto;
  187. }
  188. }
  189. }
  190. }
  191. </style>