GuanLi.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" title="文物管理平台" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
  4. <view style="width: 90%; margin: auto">
  5. <u-swiper
  6. :list="swiperList"
  7. imgMode="aspectFill"
  8. bgColor="transparent"
  9. keyName="image"
  10. :height="160"
  11. :indicator="true"
  12. radius="5"
  13. :autoplay="true"
  14. :circular="true"
  15. indicatorStyle="bottom: 10px"
  16. indicatorMode="dot"
  17. indicatorActiveColor="#fff"
  18. indicatorInactiveColor="rgba(255, 255, 255, 0.35)"
  19. ></u-swiper>
  20. </view>
  21. <view class="" style="display: flex; justify-content: space-evenly; flex-wrap: wrap; width: 90%; margin: auto">
  22. <view class="zj_box" @click="menuBtn(index)" v-for="(item, index) in menuList" :key="item.index">
  23. <view>
  24. <image style="width: 130rpx; height: 120rpx" :src="item.image"></image>
  25. </view>
  26. <view style="font-size: 30rpx; font-weight: 600">{{ item.title }}</view>
  27. </view>
  28. <!-- 个人按钮 -->
  29. <view v-if="authority" class="zj_box" @click="$common.navigateTo('/index_fenbao/GuanLi/zhiYuanGeRen')">
  30. <view>
  31. <image style="width: 130rpx; height: 120rpx" src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/ht_menu5.png"></image>
  32. </view>
  33. <view style="font-size: 30rpx; font-weight: 600">个人记录</view>
  34. </view>
  35. </view>
  36. <view class="map_tit" style="margin-left: 90rpx">
  37. <image style="width: 211rpx; height: 52rpx" src="/static/img/right_img.png"></image>
  38. <view class="">统计数据</view>
  39. <image style="width: 211rpx; height: 52rpx" src="/static/img/left_img.png"></image>
  40. </view>
  41. <view class="tj_box">
  42. <view class="btm_box">
  43. <view style="font-size: 32rpx; font-weight: 600; margin-bottom: 20rpx">全市志愿者人数 (合计:{{ list.volunteerNum }})</view>
  44. <view class="" style="display: flex; flex-wrap: wrap; justify-content: space-between; text-align: initial">
  45. <view v-for="item in list.volunteerData" :key="item.index" style="">
  46. <view style="width: 160rpx; margin-left: 20rpx">{{ item.title }}:{{ item.num }}</view>
  47. </view>
  48. </view>
  49. </view>
  50. <!-- 活跃人数 -->
  51. <view class="btm_box">
  52. <view style="font-size: 32rpx; font-weight: 600; margin-bottom: 20rpx">活跃人数</view>
  53. <view class="" style="display: flex; flex-wrap: wrap; justify-content: space-between; text-align: initial">
  54. <view v-for="item in list.activeData" :key="item.index" style="">
  55. <view style="width: 160rpx; margin-left: 20rpx">{{ item.title }}:{{ item.num }}</view>
  56. </view>
  57. </view>
  58. </view>
  59. <!-- 文物 -->
  60. <view class="btm_box">
  61. <view style="font-size: 32rpx; font-weight: 600; margin-bottom: 20rpx">全市文物</view>
  62. <view class="" style="display: flex; flex-wrap: wrap; justify-content: space-between; text-align: initial">
  63. <view v-for="item in list.crData" :key="item.index" style="">
  64. <view style="width: 160rpx; margin-left: 20rpx">{{ item.title }}:{{ item.num }}</view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. let that;
  73. export default {
  74. data() {
  75. return {
  76. authority: false /* 管理页判断自己是否是志愿者 */,
  77. id: '' /* 区域管理id */,
  78. list: [] /* 数据统计 */,
  79. swiperList: [],
  80. menuList: [
  81. {
  82. image: 'https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/ht_menu6.png',
  83. title: '志愿者',
  84. path: '/user_fenbao/houTai/zhiYuanZhe'
  85. },
  86. {
  87. image: 'https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/ht_menu7.png',
  88. title: '巡查管理',
  89. path: '/user_fenbao/houTai/xunCha'
  90. }
  91. ]
  92. };
  93. },
  94. onLoad(o) {
  95. that = this;
  96. this.id = o.id;
  97. this.cityData();
  98. this.details();
  99. this.loadGlobalFont();
  100. this.getIndexBanner();
  101. },
  102. methods: {
  103. // 轮播
  104. getIndexBanner() {
  105. this.$api.getIndexBanner({ main_body_id: 1 }, function (res) {
  106. that.swiperList = res.data.filter((item) => {
  107. return item.title == '文物管家';
  108. });
  109. });
  110. },
  111. // 判断是否为志愿者
  112. details() {
  113. this.$api.details({ main_body_id: 1 }, function (res) {
  114. // console.log(res, '志愿者');
  115. if (res.data != false && res.data.id != undefined) {
  116. that.authority = true;
  117. } else {
  118. console.log(res, '非志愿者');
  119. }
  120. });
  121. },
  122. // 数据统计
  123. cityData() {
  124. this.$api.cityData({ main_body_id: 1 }, function (res) {
  125. that.list = res.data;
  126. });
  127. },
  128. menuBtn(i) {
  129. uni.navigateTo({
  130. url: this.menuList[i].path + '?id=' + this.id
  131. });
  132. },
  133. // 加载字体
  134. loadGlobalFont() {
  135. try {
  136. uni.loadFontFace({
  137. family: 'MyGlobalFont', // 自定义字体名
  138. source: 'url("https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/songTi.ttf")',
  139. success() {
  140. console.log('全局字体加载成功');
  141. }
  142. });
  143. } catch (error) {
  144. console.error('全局字体加载异常', error);
  145. }
  146. }
  147. }
  148. };
  149. </script>
  150. <style>
  151. .box {
  152. width: 100%;
  153. padding-bottom: 50rpx;
  154. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xbg_2.png');
  155. background-size: 100% 100%;
  156. /* background-attachment: fixed; */
  157. background-repeat: repeat-y;
  158. min-height: 100%;
  159. height: auto;
  160. }
  161. /deep/.u-swiper-indicator__wrapper__dot--active {
  162. width: 5px !important;
  163. }
  164. .zj_box {
  165. width: 150rpx;
  166. /* height: 292rpx; */
  167. text-align: center;
  168. margin-top: 40rpx;
  169. }
  170. .tiwen {
  171. width: 134rpx;
  172. height: 52rpx;
  173. text-align: center;
  174. line-height: 52rpx;
  175. font-size: 24rpx;
  176. color: #ffffff;
  177. margin-left: 32rpx;
  178. margin-top: 10rpx;
  179. background-color: #c46354;
  180. }
  181. .map_tit {
  182. display: flex;
  183. align-items: center;
  184. margin-left: 60rpx;
  185. margin-top: 40rpx;
  186. font-size: 40rpx;
  187. font-family: 'MyGlobalFont';
  188. font-weight: 900;
  189. line-height: 52rpx;
  190. color: #444444;
  191. }
  192. .tj_box {
  193. width: 90%;
  194. margin: auto;
  195. margin-top: 30rpx;
  196. /* background-color: #fceece; */
  197. }
  198. .top_box {
  199. display: flex;
  200. margin-left: 260rpx;
  201. justify-content: space-between;
  202. }
  203. .tit_box {
  204. width: 160rpx;
  205. height: 60rpx;
  206. line-height: 60rpx;
  207. text-align: center;
  208. background-image: url('/static/img/fj_bg.png');
  209. background-size: 100% 100%;
  210. }
  211. .btm_box {
  212. text-align: center;
  213. margin-top: 40rpx;
  214. }
  215. </style>