fuWu.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <template>
  2. <view class="box">
  3. <u-navbar
  4. :autoBack="true"
  5. leftIconColor="#303133"
  6. title="志愿者联盟"
  7. bgColor="rgba(255,255,255,0)"
  8. :placeholder="true"
  9. titleStyle="font-weight:bold;color:#000000"
  10. ></u-navbar>
  11. <view style="width: 90%; margin: auto">
  12. <u-swiper
  13. :list="swiperList"
  14. imgMode="aspectFill"
  15. :height="160"
  16. :indicator="true"
  17. radius="5"
  18. :autoplay="true"
  19. :circular="true"
  20. indicatorStyle="bottom: 10px"
  21. indicatorMode="dot"
  22. indicatorActiveColor="#fff"
  23. indicatorInactiveColor="rgba(255, 255, 255, 0.35)"
  24. ></u-swiper>
  25. </view>
  26. <view style="width: 660rpx; margin: auto; margin-top: 25rpx">
  27. <u-notice-bar speed="60" color="#f9ae3d" bgColor="#fefdfb" :text="notice.title" mode="link"></u-notice-bar>
  28. </view>
  29. <!-- 菜单 -->
  30. <view class="cd_box">
  31. <view class="cd_item" @click="menuBtn(index)" v-for="(item, index) in list" :key="item.index">
  32. <image style="width: 72rpx; height: 72rpx" :src="item.image"></image>
  33. <view>
  34. {{ item.title }}
  35. </view>
  36. </view>
  37. </view>
  38. <view class="tj">数据统计</view>
  39. <!-- 区域 -->
  40. <view class="ranking_menu">
  41. <scroll-view scroll-x style="display: flex; white-space: nowrap" class="">
  42. <view @click="regionTab(index)" v-for="(item, index) in regionList" :key="item.index" class="ranking_item" :class="{ active: Tab == index }">
  43. {{ item.title }}
  44. </view>
  45. </scroll-view>
  46. </view>
  47. <view class="gg_box">
  48. <view class="gg_item">
  49. <view>
  50. <view class="">志愿人数</view>
  51. <view style="font-size: 44rpx; color: #81acb0">{{ information.volunteerNum }}</view>
  52. </view>
  53. <view>
  54. <view>文物点</view>
  55. <view style="font-size: 44rpx; color: #81acb0">{{ information.crNum }}</view>
  56. </view>
  57. </view>
  58. <view class="">
  59. <view class="">总巡查次数</view>
  60. <view style="font-size: 44rpx; color: #81acb0">{{ information.patrolNum }}</view>
  61. </view>
  62. </view>
  63. <!-- <view class="tj">最新动态</view>
  64. <view class="gg_box">
  65. <view style="font-size: 32rpx">今日最新巡查</view>
  66. <view class="gg_item2" v-for="(item, index) in trendsList" :key="item.index">
  67. <view class="" style="display: flex; align-items: center">
  68. <image :src="item.image" style="margin-right: 30rpx; width: 112rpx; height: 112rpx"></image>
  69. <view class="">
  70. <view>{{ item.title }}</view>
  71. <view style="font-size: 24rpx; color: rgba(68, 68, 68, 0.4)">发生时间 {{ item.date }}</view>
  72. </view>
  73. </view>
  74. <view class="active2">正常</view>
  75. </view>
  76. </view> -->
  77. </view>
  78. </template>
  79. <script>
  80. let that;
  81. export default {
  82. data() {
  83. return {
  84. information: {},
  85. Tab: 11,
  86. notice: {},
  87. trendsList: [
  88. {
  89. date: '2024-3-15',
  90. title: '周文学宅',
  91. image: 'https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/zwxz.png'
  92. },
  93. {
  94. date: '2024-3-17',
  95. title: '仑后王清祥宅',
  96. image: 'https://huli-app.wenlvti.net/uploads/20230423/4268647ba8b76f65e4ef45cd59653cbd.jpg'
  97. }
  98. ],
  99. swiperList: ['https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/zyz_gr.png', 'https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/gj_zyjz.jpg'],
  100. regionList: [],
  101. list: [
  102. {
  103. title: '组织介绍',
  104. image: '/static/img/icon_1.png',
  105. page: '/index_fenbao/fuWu/zuZhi/zuZhi'
  106. },
  107. {
  108. title: '志愿报名',
  109. image: '/static/img/icon_3.png',
  110. page: '/index_fenbao/fuWu/baoMing/renLing'
  111. },
  112. {
  113. title: '文物地图',
  114. image: '/static/img/icon_8.png',
  115. page: '/index_fenbao/fuWu/diTu/diTu'
  116. },
  117. {
  118. title: '志愿排名',
  119. image: '/static/img/icon_4.png',
  120. page: '/index_fenbao/fuWu/paiMing/paiMing'
  121. },
  122. {
  123. title: '志愿风采',
  124. image: '/static/img/icon_6.png',
  125. page: '/index_fenbao/fuWu/fengCai/fengCai'
  126. },
  127. {
  128. title: '法律法规',
  129. image: '/static/img/icon_2.png',
  130. page: '/index_fenbao/fuWu/FaLv/FaLv'
  131. },
  132. {
  133. title: '知识库',
  134. image: '/static/img/icon_7.png',
  135. page: '/index_fenbao/fuWu/zuZhi/XueYuan'
  136. },
  137. {
  138. title: '志愿捐助',
  139. image: '/static/img/icon_5.png',
  140. page: '/index_fenbao/fuWu/jiJin/jiJin'
  141. }
  142. ]
  143. };
  144. },
  145. onLoad() {
  146. that = this;
  147. this.getNotice();
  148. this.getCategoryOnlyChildList();
  149. this.regionData();
  150. },
  151. methods: {
  152. // 公告
  153. getNotice() {
  154. this.$api.getNotice({ main_body_id: 1 }, function (res) {
  155. that.notice = res.data;
  156. });
  157. },
  158. getCategoryOnlyChildList() {
  159. this.$api.getCategoryOnlyChildList({ main_body_id: 1, pid: '5' }, function (res) {
  160. if (res.code == 1) {
  161. that.regionList = res.data;
  162. console.log(that.regionList, 454);
  163. } else {
  164. console.log(res);
  165. }
  166. });
  167. },
  168. /* 数据统计 */
  169. regionData(id) {
  170. this.$api.regionData({ main_body_id: 1, region_id: id || '11' }, function (res) {
  171. // console.log(res, '统计');
  172. that.information = res.data;
  173. });
  174. },
  175. menuBtn(i) {
  176. uni.navigateTo({
  177. url: that.list[i].page
  178. });
  179. },
  180. regionTab(i) {
  181. this.Tab = i;
  182. this.regionData(this.regionList[i].id);
  183. },
  184. // 加载字体
  185. loadGlobalFont() {
  186. try {
  187. uni.loadFontFace({
  188. family: 'MyGlobalFont', // 自定义字体名
  189. source: 'url("https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/songTi.ttf")',
  190. success() {
  191. console.log('全局字体加载成功');
  192. }
  193. });
  194. } catch (error) {
  195. console.error('全局字体加载异常', error);
  196. }
  197. }
  198. }
  199. };
  200. </script>
  201. <style>
  202. /deep/.u-swiper-indicator__wrapper__dot--active {
  203. width: 5px !important;
  204. }
  205. /deep/.u-notice-bar.data-v-24c07869 {
  206. border: 2rpx solid #ebc9a9;
  207. }
  208. /deep/.u-notice-bar.data-v-6862e5d8 {
  209. border: 2rpx solid #ebc9a9;
  210. }
  211. .box {
  212. width: 100%;
  213. min-height: 100%;
  214. height: auto;
  215. background-color: #fff9e9;
  216. padding-bottom: 50rpx;
  217. font-family: 'MyGlobalFont';
  218. }
  219. .active {
  220. background-image: url('/static/img/tab.png');
  221. background-size: 100% 100%;
  222. }
  223. .active2 {
  224. font-size: 32rpx;
  225. color: #81acb0;
  226. }
  227. .active3 {
  228. font-size: 32rpx;
  229. color: #ff542d;
  230. }
  231. .cd_box {
  232. width: 90%;
  233. margin: auto;
  234. display: flex;
  235. flex-flow: wrap;
  236. justify-content: space-between;
  237. }
  238. .cd_item {
  239. width: 150rpx;
  240. height: 120rpx;
  241. text-align: center;
  242. margin-top: 30rpx;
  243. }
  244. .ranking_item {
  245. display: inline-block;
  246. width: 200rpx;
  247. height: 62rpx;
  248. }
  249. .ranking_menu {
  250. width: 90%;
  251. margin: auto;
  252. margin-top: 40rpx;
  253. display: flex;
  254. justify-content: space-around;
  255. font-size: 28rpx;
  256. color: rgba(68, 68, 68, 0.6);
  257. text-align: center;
  258. line-height: 60rpx;
  259. }
  260. .tj {
  261. font-size: 40rpx;
  262. color: #444444;
  263. font-weight: 900;
  264. letter-spacing: 2px;
  265. margin: 40rpx 0 0 40rpx;
  266. }
  267. .gg_box {
  268. width: 670rpx;
  269. margin: auto;
  270. margin-top: 20rpx;
  271. padding: 20rpx;
  272. border: 2rpx solid #ebc9a9;
  273. line-height: 45rpx;
  274. }
  275. .gg_item {
  276. display: flex;
  277. align-items: center;
  278. justify-content: space-between;
  279. width: 500rpx;
  280. margin-bottom: 30rpx;
  281. }
  282. .gg_item2 {
  283. display: flex;
  284. align-items: center;
  285. justify-content: space-between;
  286. margin-top: 30rpx;
  287. }
  288. </style>