index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <view class="content">
  3. <view class="one">
  4. <u-swiper :list="config.file" height="240px" indicator indicatorMode="line" circular></u-swiper>
  5. </view>
  6. <view class="two">
  7. <view class="two_1">
  8. 正在申办
  9. </view>
  10. <view class="two_2">
  11. <view class="list_1" v-if="total==0">暂无申办事项,请点击下方赋强公证按钮快速开始</view>
  12. <view class="list_2" v-else>列表</view>
  13. </view>
  14. </view>
  15. <view class="thr">
  16. <view class="list" v-for="(item, index) in menuList" :key="index" @click="toCommon(item.route)">
  17. <image class="image" mode="aspectFill" :src="item.file&&item.file.length>0?item.file[0].url:''"></image>
  18. <view class="left">
  19. <view class="name">{{item.title}}</view>
  20. <view class="other">{{item.brief}}</view>
  21. </view>
  22. <view class="right">
  23. <u-icon name="arrow-right" size="20"></u-icon>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script setup lang="ts">
  30. import { getCurrentInstance, ref } from 'vue';
  31. //该依赖已内置不需要单独安装
  32. import { onShow, onPullDownRefresh } from "@dcloudio/uni-app";
  33. // 请求接口
  34. const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
  35. const $config = getCurrentInstance()?.appContext.config.globalProperties.$config;
  36. // 基本信息
  37. const config = ref({ logo: [], file: [] });
  38. const list = ref([]);
  39. const total = ref(0);
  40. const menuList = ref([]);
  41. onShow(async () => {
  42. await searchConfig();
  43. await searchOther();
  44. await search();
  45. })
  46. // config信息
  47. const searchConfig = async () => {
  48. config.value = uni.getStorageSync('config');
  49. };
  50. // 其他查询信息
  51. const searchOther = async () => {
  52. const res = await $api('module', 'GET', { is_use: '0' });
  53. if (res.errcode === 0) {
  54. menuList.value = res.data
  55. } else {
  56. uni.showToast({
  57. title: res.errmsg || '',
  58. icon: 'error',
  59. });
  60. }
  61. };
  62. // 查询
  63. const search = async () => {
  64. const info = {
  65. skip: 0,
  66. limit: 2,
  67. status: '0'
  68. }
  69. // const res = await $api('car', 'GET', info);
  70. // if (res.errcode === 0) {
  71. // list.value = list.value.concat(res.data)
  72. // total.value = res.total
  73. // } else {
  74. // uni.showToast({
  75. // title: res.errmsg || '',
  76. // icon: 'error',
  77. // });
  78. // }
  79. };
  80. const toCommon = (url) => {
  81. uni.navigateTo({
  82. url
  83. })
  84. };
  85. // 查看详情
  86. const toView = (item) => {
  87. uni.navigateTo({
  88. url: `/pagesHome/notarization/index?id=${item.id || item._id}`
  89. })
  90. };
  91. </script>
  92. <style lang="scss" scoped>
  93. .content {
  94. display: flex;
  95. flex-direction: column;
  96. background-color: var(--f1Color);
  97. .two {
  98. margin: 2vw;
  99. padding: 3vw;
  100. border-radius: 2vw;
  101. background-color: var(--mainColor);
  102. .two_1 {
  103. padding: 2vw 0;
  104. border-bottom: 1px solid var(--f5Color);
  105. text-align: center;
  106. }
  107. .two_2 {
  108. .list_1 {
  109. text-align: center;
  110. padding: 2vw;
  111. font-size: var(--font14Size);
  112. color: var(--f85Color);
  113. }
  114. }
  115. }
  116. .thr {
  117. margin: 0 0 2vw 0;
  118. .list {
  119. display: flex;
  120. justify-content: space-between;
  121. align-items: center;
  122. background-color: var(--mainColor);
  123. margin: 2vw 2vw 0 2vw;
  124. padding: 3vw;
  125. border-radius: 2vw;
  126. .image {
  127. width: 18vw;
  128. height: 18vw;
  129. border-radius: 18vw;
  130. }
  131. .left {
  132. width: 60vw;
  133. .name {
  134. font-weight: bold;
  135. font-size: var(--font16Size);
  136. }
  137. .other {
  138. margin: 2vw 0 0 0;
  139. font-size: var(--font12Size);
  140. color: var(--f85Color);
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>