zhiYuanGeRen.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" title="巡查守护" titleStyle="font-weight:bold;color:#000000" bgColor="rgba(255,255,255,0)" :placeholder="true"></u-navbar>
  4. <view style="width: 92%; margin: auto">
  5. <view>
  6. <u-swiper
  7. :list="swiperList"
  8. imgMode="aspectFill"
  9. :height="160"
  10. :indicator="true"
  11. radius="5"
  12. :autoplay="true"
  13. :circular="true"
  14. indicatorStyle="bottom: 10px"
  15. indicatorMode="dot"
  16. indicatorActiveColor="#fff"
  17. indicatorInactiveColor="rgba(255, 255, 255, 0.35)"
  18. ></u-swiper>
  19. </view>
  20. <!-- <view class="gy_box" @click="tougaoBtn">
  21. <view class="">管理</view>
  22. <uni-icons type="gear" size="22" color="#000000"></uni-icons>
  23. </view> -->
  24. <view class="top_box">
  25. <view class="time">{{ currentYear }}年</view>
  26. <view class="item_tit">巡查次数:{{ detailsList.patrolNum !== undefined ? detailsList.patrolNum : '' }}</view>
  27. <view class="item_tit">月度积分:{{ detailsList.monthScore !== undefined ? detailsList.monthScore : '' }}</view>
  28. <view class="item_tit">年度积分:{{ detailsList.yearScore !== undefined ? detailsList.yearScore : '' }}</view>
  29. <view class="item_tit">巡查完成率:{{ detailsList.completion_rate !== undefined ? detailsList.completion_rate : '' }}</view>
  30. </view>
  31. <view style="display: flex; justify-content: space-around">
  32. <view class="tab" @click="taskBtn">
  33. <view class="jb">任务</view>
  34. <view class="wb">{{ numberTasks }}</view>
  35. </view>
  36. <view class="tab" @click="HistoryBtn">
  37. <view class="jb">历史巡查</view>
  38. </view>
  39. <view class="tab" @click="tougaoBtn">
  40. <view class="jb">管理</view>
  41. </view>
  42. </view>
  43. <view class="ranking_menu">
  44. <view @click="rankingTab(index)" class="ranking_item" :class="{ active: Tab == index }" v-for="(item, index) in rankingList" :key="item.index">
  45. {{ item.title }}
  46. </view>
  47. </view>
  48. <scroll-view v-if="patrolList.length > 0" style="height: 600rpx" scroll-y="true" @scrolltolower="LoadMore">
  49. <view>
  50. <view class="tit_box" @click="checkBtn(item)" v-for="item in patrolList" :key="item.id">
  51. <view class="bk" style="width: 160rpx">{{ item.cr_title }}</view>
  52. <view class="bk" style="width: 240rpx">
  53. {{ item.progress == 3 ? item.submit_time : item.progress == 2 ? item.submit_time : item.progress == -1 ? item.submit_time : '' }}
  54. </view>
  55. <view class="bk">{{ item.type_text }}</view>
  56. <view class="ck">查看</view>
  57. </view>
  58. </view>
  59. </scroll-view>
  60. <view v-else>
  61. <u-empty text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
  62. </view>
  63. </view>
  64. <!-- 非管理员提示 -->
  65. <u-popup bgColor="#f2c8a2" :show="show" @close="close" mode="center" customStyle="width:600rpx;padding: 30rpx;" round="20rpx">
  66. <view style="text-align: center; font-size: 32rpx">您当前还不是管理员</view>
  67. <view style="margin-top: 20rpx"></view>
  68. <view class="bt_box">
  69. <view class="bt2" @click="show = false">确认</view>
  70. </view>
  71. </u-popup>
  72. <!-- 去报名弹层 -->
  73. <u-popup bgColor="#f2c8a2" :show="volhow" @close="close" mode="center" customStyle="width:600rpx;padding: 30rpx;" round="20rpx">
  74. <view style="text-align: center; font-size: 30rpx">您当前还不是志愿者</view>
  75. <view style="margin-top: 20rpx"></view>
  76. <view class="bt_box">
  77. <view class="bt1" @click="volhow = false">取消</view>
  78. <view @click="goSignUp" class="bt2">去报名</view>
  79. </view>
  80. </u-popup>
  81. </view>
  82. </template>
  83. <script>
  84. let that;
  85. export default {
  86. data() {
  87. return {
  88. currentYear: new Date().getFullYear(),
  89. volhow: false /* 非志愿者弹层 */,
  90. volunteerShow: false /* 是否是志愿者控制页面去报名弹层 */,
  91. isLoading: false,
  92. page: 1,
  93. show: false,
  94. Tab: 0,
  95. numberTasks: '' /* 任务数量 */,
  96. rankingList: [
  97. {
  98. title: '待巡查',
  99. id: '0'
  100. },
  101. {
  102. title: '待审核',
  103. id: 2
  104. },
  105. {
  106. title: '已通过',
  107. id: 3
  108. },
  109. {
  110. title: '驳回',
  111. id: -1
  112. },
  113. {
  114. title: '已过期',
  115. id: -2
  116. }
  117. ],
  118. detailsList: {},
  119. patrolList: [],
  120. 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']
  121. };
  122. },
  123. onLoad() {
  124. that = this;
  125. this.details();
  126. // this.getPatrolTask('0');
  127. },
  128. methods: {
  129. // 志愿者详情判断是否为志愿者
  130. details() {
  131. this.$api.details({ main_body_id: 1 }, function (res) {
  132. if (res.code == 1) {
  133. if (res.data != false && res.data.id != undefined) {
  134. that.detailsList = res.data;
  135. // console.log(that.volunteerDetails, '是志愿者');
  136. that.volhow = false;
  137. that.volunteerShow = true;
  138. // 任务列表
  139. that.getPatrolTask('0');
  140. } else {
  141. // 控制非志愿者弹层
  142. that.volhow = true;
  143. that.volunteerShow = false;
  144. // console.log(that.volunteerShow, '非志愿者点击11');
  145. // console.log(res, '非志愿者');
  146. }
  147. } else {
  148. console.log(res);
  149. }
  150. });
  151. },
  152. // 志愿者任务列表
  153. getPatrolTask(id) {
  154. this.isLoading = true;
  155. this.$api.getPatrolTask({ volunteer_id: that.detailsList.id, main_body_id: 1, progress: id ? id : 0, page: this.page, pageSize: 10 }, function (res) {
  156. if (res.code === 1) {
  157. that.isLoading = false;
  158. that.patrolList = [...that.patrolList, ...res.data];
  159. if (id == '0') {
  160. that.numberTasks = res.data.length;
  161. }
  162. console.log(that.patrolList, '任务');
  163. } else {
  164. }
  165. });
  166. },
  167. //
  168. rankingTab(i) {
  169. this.Tab = i;
  170. this.page = 1;
  171. that.patrolList = [];
  172. this.getPatrolTask(this.rankingList[i].id);
  173. },
  174. tougaoBtn() {
  175. this.$api.userManageRegionCrAuth({ main_body_id: 1 }, function (res) {
  176. if (res.data != false) {
  177. uni.navigateTo({
  178. url: '/index_fenbao/GuanLi/GuanLi'
  179. });
  180. } else {
  181. that.show = true;
  182. // console.log(res, '非管理员');
  183. }
  184. });
  185. },
  186. checkBtn(item) {
  187. if (item.progress == 0) {
  188. uni.navigateTo({
  189. url: '/shouhu_fenbao/xunCha/xunCha?id=' + item.id
  190. });
  191. } else {
  192. uni.navigateTo({
  193. url: '/user_fenbao/houTai/taskDEetailsPage?id=' + item.id
  194. });
  195. }
  196. },
  197. taskBtn() {
  198. uni.switchTab({
  199. url: '/pages/shouhu/shouhu'
  200. });
  201. },
  202. HistoryBtn() {
  203. if (this.volunteerShow) {
  204. uni.navigateTo({
  205. url: '/shouhu_fenbao/shouHu/woDe'
  206. });
  207. }
  208. },
  209. goSignUp() {
  210. uni.navigateTo({
  211. url: '/index_fenbao/fuWu/baoMing/renLing'
  212. });
  213. },
  214. LoadMore() {
  215. if (this.isLoading) {
  216. return;
  217. } else {
  218. this.page++;
  219. this.getPatrolTask();
  220. }
  221. },
  222. close() {
  223. this.show = false;
  224. this.volhow = false;
  225. }
  226. }
  227. };
  228. </script>
  229. <style>
  230. .box {
  231. width: 100%;
  232. padding-bottom: 50rpx;
  233. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xbg_2.png');
  234. background-size: 100% 100%;
  235. background-attachment: fixed;
  236. background-repeat: repeat-y;
  237. min-height: 100%;
  238. height: auto;
  239. }
  240. .bt1 {
  241. width: 244rpx;
  242. height: 78rpx;
  243. border: 1px solid #312520;
  244. border-radius: 39rpx;
  245. text-align: center;
  246. line-height: 78rpx;
  247. color: black;
  248. }
  249. /deep/.u-swiper-indicator__wrapper__dot--active {
  250. width: 5px !important;
  251. }
  252. .top_box {
  253. position: relative;
  254. height: 260rpx;
  255. display: flex;
  256. text-align: center;
  257. align-items: center;
  258. flex-wrap: wrap;
  259. padding: 30rpx;
  260. margin-top: 50rpx;
  261. margin-bottom: 40rpx;
  262. justify-content: space-around;
  263. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/zyz_bk.png');
  264. background-size: 100% 100%;
  265. }
  266. .bt2 {
  267. width: 244rpx;
  268. height: 78rpx;
  269. background: #ca5642;
  270. border-radius: 39rpx;
  271. text-align: center;
  272. line-height: 78rpx;
  273. color: #ffffff;
  274. }
  275. .item_tit {
  276. width: 302rpx;
  277. font-size: 30rpx;
  278. }
  279. .time {
  280. position: absolute;
  281. top: -16rpx;
  282. text-align: center;
  283. line-height: 50rpx;
  284. width: 140rpx;
  285. height: 45rpx;
  286. color: #934b36;
  287. background-image: url('/static/img/time_bg .png');
  288. background-size: 100% 100%;
  289. }
  290. .tab {
  291. position: relative;
  292. width: 195rpx;
  293. height: 65rpx;
  294. text-align: center;
  295. font-weight: 600;
  296. line-height: 65rpx;
  297. background-image: url('/static/img/gr_tab.png');
  298. background-size: 100% 100%;
  299. }
  300. .jb {
  301. background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
  302. -webkit-background-clip: text;
  303. -webkit-text-fill-color: transparent;
  304. }
  305. .fg {
  306. width: 8rpx;
  307. height: 40rpx;
  308. background-color: #e36f65;
  309. border-radius: 10rpx;
  310. margin-right: 10rpx;
  311. }
  312. .fg_tit {
  313. font-size: 30rpx;
  314. font-weight: 600;
  315. background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
  316. -webkit-background-clip: text;
  317. -webkit-text-fill-color: transparent;
  318. }
  319. .tit_box {
  320. display: flex;
  321. align-items: center;
  322. font-size: 30rpx;
  323. margin: auto;
  324. margin-top: 20rpx;
  325. justify-content: space-between;
  326. }
  327. .ck {
  328. width: 96rpx;
  329. height: 40rpx;
  330. text-align: center;
  331. border-radius: 10rpx;
  332. background-color: #eeae5a;
  333. }
  334. .wb {
  335. position: absolute;
  336. top: -10rpx;
  337. right: -10rpx;
  338. width: 35rpx;
  339. line-height: 38rpx;
  340. height: 35rpx;
  341. color: #ffffff;
  342. background: #de5448;
  343. border-radius: 50%;
  344. }
  345. .wb2 {
  346. position: absolute;
  347. width: 35rpx;
  348. height: 35rpx;
  349. color: #ffffff;
  350. top: -5px;
  351. right: -10rpx;
  352. line-height: 38rpx;
  353. background: #de5448;
  354. border-radius: 50%;
  355. }
  356. .gy_box {
  357. width: 120rpx;
  358. height: 120rpx;
  359. display: flex;
  360. align-items: center;
  361. position: absolute;
  362. top: 240rpx;
  363. right: -40rpx;
  364. padding-left: 10rpx;
  365. font-size: 30rpx;
  366. font-family: MiSans, MiSans;
  367. font-weight: 500;
  368. justify-content: space-evenly;
  369. line-height: 44rpx;
  370. z-index: 11;
  371. border-radius: 50%;
  372. background-color: #eeae5a;
  373. }
  374. .ranking_menu {
  375. width: 90%;
  376. margin: auto;
  377. margin-top: 50rpx;
  378. display: flex;
  379. justify-content: space-between;
  380. font-size: 28rpx;
  381. color: rgba(68, 68, 68, 0.6);
  382. text-align: center;
  383. line-height: 60rpx;
  384. }
  385. .ranking_item {
  386. width: 260rpx;
  387. height: 62rpx;
  388. }
  389. .active {
  390. background-image: url('/static/img/gr_tab.png');
  391. background-size: 100% 100%;
  392. }
  393. .bk {
  394. width: 180rpx;
  395. overflow-x: auto;
  396. white-space: nowrap;
  397. }
  398. .bt_box {
  399. display: flex;
  400. margin-top: 50rpx;
  401. justify-content: space-around;
  402. }
  403. .bt2 {
  404. width: 244rpx;
  405. height: 78rpx;
  406. background: #ca5642;
  407. border-radius: 39rpx;
  408. text-align: center;
  409. line-height: 78rpx;
  410. color: #ffffff;
  411. }
  412. </style>