index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <view class="home">
  3. <!-- 全新布局 -->
  4. <view class="con mb11">
  5. <!-- 点击查看全市人口信息 -->
  6. <view class="imagba">
  7. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration" indicator-color='#818181' indicator-active-color='#FFFFFF'>
  8. <swiper-item>
  9. <image :src="swiimg1" class="swiper-item"></image>
  10. </swiper-item>
  11. <swiper-item>
  12. <image :src="swiimg2" class="swiper-item"></image>
  13. </swiper-item>
  14. </swiper>
  15. <!-- <image class="imagb" :src="peobg"></image>
  16. <view class="imagbc">电脑端网址:https://qsdp.qs163.cn</view> -->
  17. </view>
  18. <!-- 人口数据 -->
  19. <view class="flexc flexjs">
  20. <view class="imagbox" @click="vacInfopro">
  21. <image class="nimage" :src="peobga" mode=""></image>
  22. <view class="imagboxa">
  23. <image class="imgl" :src="peolimga" mode=""></image>
  24. <view class="flex1">
  25. <text class="txt">常住人口统计</text>
  26. <view class="txt2" style="color: #248AB9;">
  27. {{getTimeNow ()}}
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 点击新增人口信息 -->
  33. <view class="imagbox" @click="addVacSituapeo()">
  34. <image class="nimage" :src="peobgb" mode=""></image>
  35. <view class=" imagboxa">
  36. <image class="imgl" :src="peolimgb" mode=""></image>
  37. <view class="">
  38. <text class="txt">新增人口信息</text>
  39. <view class="txt2" style="color:#EA8F04;">
  40. 添加人口详细信息
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="flexc flexjs">
  47. <!-- 点击查询人口信息情况 -->
  48. <view class="imagbox" @click="goRecordpeo">
  49. <image class="nimage" :src="peobgc" mode=""></image>
  50. <view class=" imagboxa">
  51. <image class="imgl" :src="peolimgc" mode=""></image>
  52. <view class="">
  53. <text class="txt">人口信息情况</text>
  54. <view class="txt2" style="color:#5950A3;">
  55. 查询/修改/删除信息
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <!-- 人员状态变更 -->
  61. <view class="imagbox" @click="goReturnState">
  62. <image class="nimage" :src="peobgd" mode=""></image>
  63. <view class=" imagboxa">
  64. <image class="imgl" :src="peolimgf" mode=""></image>
  65. <view class="">
  66. <text class="txt">人员状态变更</text>
  67. <view class="txt2" style="color: #D74219;">
  68. 更改人员状态信息
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="con mb11">
  76. <view class="nhtit">人员类别信息</view>
  77. <view class="ncbox">
  78. <view class="ncboxa">
  79. <view class="ncboxatit">当前地区</view>
  80. <view class="ncboxatxt">黄柏镇</view>
  81. </view>
  82. <view class="ncboxa" v-for="(ite,idx) in chartDatas.categories" :key="idx" @click="getDetail(ite,idx)">
  83. <view class="ncboxatit">{{ite}}(人)</view>
  84. <view class="ncboxatxt">{{chartDatas.series[0].data[idx]}}</view>
  85. </view>
  86. <!-- <view class="ncboxa">
  87. <view class="ncboxatit">低保户(人)</view>
  88. <view class="ncboxatxt">518</view>
  89. </view>
  90. <view class="ncboxa">
  91. <view class="ncboxatit">贫困户(人)</view>
  92. <view class="ncboxatxt">227</view>
  93. </view>
  94. <view class="ncboxa">
  95. <view class="ncboxatit">党员(人)</view>
  96. <view class="ncboxatxt">1,374</view>
  97. </view>
  98. <view class="ncboxa">
  99. <view class="ncboxatit">退伍军人(人)</view>
  100. <view class="ncboxatxt">305</view>
  101. </view> -->
  102. </view>
  103. </view>
  104. <view class="nctu">
  105. <!-- <view class="nhtit">人员类别比率</view> -->
  106. <view class="nhtit" style="padding: 0 32rpx;">人员类别</view>
  107. <!-- 折线图 -->
  108. <view style="width:100%;height: 300px;">
  109. <qiun-data-charts :canvas2d='true' type="column" :chartData="chartDatas" ontouch="true"></qiun-data-charts>
  110. <!-- :canvas2d='true' 不能“真机调试”开发者工具显示不正常,图表层级会变高,而正常预览或者发布上线则是正常状态-->
  111. <!-- <qiun-data-charts type="line" :chartData="chartData" ontouch="true"></qiun-data-charts> -->
  112. </view>
  113. </view>
  114. <u-toast ref="uToast" />
  115. <!-- 疫苗情况 -->
  116. <!-- <view class="imagbox" @click="goNuclein">
  117. <image class="nimage" :src="peobgd" mode=""></image>
  118. <view class=" imagboxa">
  119. <image class="imgl" :src="peolimgf" mode=""></image>
  120. <view class="">
  121. <text class="txt">人员核酸信息</text>
  122. <view class="txt2" style="color: #CB2F1A;">
  123. 查看已核酸人员的核酸详细信息
  124. </view>
  125. </view>
  126. </view>
  127. </view> -->
  128. <!-- 点击查询返乡人员信息 -->
  129. <!-- <view class="imagbox" @click="goReturnpeo">
  130. <image class="nimage" :src="peobgd" mode=""></image>
  131. <view class=" imagboxa">
  132. <image class="imgl :src="peolimgd" mode=""></image>
  133. <view class="">
  134. <text class="txt">返乡人员信息</text>
  135. <view class="txt2" style="color: #046922;">
  136. 查询/修改/删除返乡人员信息
  137. </view>
  138. </view>
  139. </view>
  140. </view> -->
  141. <!-- 底部 导航栏 currentPage 当前页面ID -->
  142. <tab-bar :currentPage="0"></tab-bar>
  143. </view>
  144. </template>
  145. <script>
  146. import tabBar from "@/components/tabbar/tabbar.vue"
  147. export default {
  148. components: {
  149. tabBar
  150. },
  151. data() {
  152. return {
  153. indicatorDots: true,
  154. autoplay: true,
  155. interval: 2000,
  156. duration: 500,
  157. swiimg1:require("@/static/image/swpicon.png"),
  158. swiimg2:require("@/static/image/swpicot.png"),
  159. upimg: require("@/static/image/upz.png"),
  160. downimg: require("@/static/image/downz.png"),
  161. peobg: require("@/static/image/peo_bg.png"),
  162. peobga: require("@/static/image/peo_bga.png"),
  163. peobgb: require("@/static/image/peo_bgb.png"),
  164. peobgc: require("@/static/image/peo_bgc.png"),
  165. peobgd: require("@/static/image/peo_bgd.png"),
  166. peolimga: require("@/static/image/peo_a.png"),
  167. peolimgb: require("@/static/image/peo_b.png"),
  168. peolimgc: require("@/static/image/peo_c.png"),
  169. peolimgd: require("@/static/image/peo_d.png"),
  170. peolimge: require("@/static/image/peo_e.png"),
  171. peolimgf: require("@/static/image/peo_f.png"),
  172. // 折现图
  173. chartData: {
  174. "categories": ['2016', '2017', '2018', '2019', '2020', '2021'],
  175. "series": [{
  176. name: '五保户',
  177. data: [35, 8, 25, 37, 4, 20],
  178. },
  179. {
  180. name: '低保户',
  181. data: [70, 40, 65, 100, 44, 68],
  182. },
  183. {
  184. name: '贫困户',
  185. data: [100, 80, 95, 150, 112, 132],
  186. },
  187. {
  188. name: '退伍军人',
  189. data: [10, 180, 95, 50, 12, 32],
  190. },
  191. {
  192. name: '党员',
  193. data: [90, 80, 25, 50, 32, 22],
  194. },
  195. ],
  196. "enableScroll": false
  197. },
  198. //柱状图
  199. chartDatas: {
  200. "categories": [],
  201. "series": [{
  202. name: '人员类别',
  203. data: [],
  204. },
  205. ],
  206. "enableScroll": false
  207. },
  208. keycategory:[],
  209. }
  210. },
  211. onLoad() {
  212. this.getKeyCateFn()
  213. },
  214. methods: {
  215. checkLogin() {
  216. var token = uni.getStorageSync('token')
  217. // var token = "df057579-73c8-4bdd-8312-f64db8efd699"
  218. if (token == undefined || token == '') {
  219. uni.reLaunch({
  220. url: '/pages/login/login'
  221. })
  222. return false
  223. }
  224. return true
  225. },
  226. getDetail(e,idx){
  227. if (!this.checkLogin()) {
  228. return
  229. }
  230. uni.navigateTo({
  231. url: "/home/pages/recordthree/recordpeople?detail=1&text="+e+'&value='+idx
  232. })
  233. },
  234. // 人员类别
  235. getKeyCateFn(){
  236. var that = this;
  237. this.$http.get('system/dict/data/type/key_category').then(res => {
  238. if (res.code == 200) {
  239. var newArr=res.data;
  240. var num=0;
  241. var x=[],y=[],a={"categories": [],
  242. "series": [{
  243. "name": "人员类别",
  244. "data": []
  245. }]};
  246. if(newArr.length){
  247. newArr.forEach((item,idx)=>{
  248. var t=item.dictLabel;
  249. x.push(item.dictLabel)
  250. // 6, 3, 5, 2, 1 '五保户', '低保户', '贫困户', '党员', '退伍军人'
  251. if(t=='五保户'){
  252. y[idx]=6;
  253. }else if(t=='低保户'){
  254. y[idx]=3;
  255. }else if(t=='贫困户'){
  256. y[idx]=5;
  257. }else if(t=='党员'){
  258. y[idx]=2;
  259. }else if(t=='退伍军人'){
  260. y[idx]=1;
  261. }else{
  262. }
  263. // if(num<Number(item.res)){
  264. // num=Number(item.res)
  265. // }
  266. })
  267. this.$nextTick(function(){
  268. a.categories=x;
  269. a.series[0].data=y;
  270. if(x.length>7){
  271. a.enableScroll=true;//是否滚动
  272. }else{
  273. a.enableScroll=false;//是否滚动
  274. }
  275. if(num>0&&num<1||num==1){
  276. a.tofix=true
  277. }
  278. that.chartDatas=JSON.parse(JSON.stringify(a))
  279. // this.setSplitNumber(y)
  280. })
  281. }else{
  282. that.chartDatas=JSON.parse(JSON.stringify(a))
  283. }
  284. }
  285. })
  286. },
  287. // 图标最小值
  288. setSplitNumber(arr){
  289. let splitNumber = 5;
  290. if(arr.length!=0){
  291. let max = Math.max.apply(null,arr);
  292. let min = Math.min.apply(null,arr);
  293. if((Number(max) - Number(min) >=5) || (Number(max) - Number(min) == 0)){
  294. splitNumber = 5;
  295. }else {
  296. splitNumber = Number(max) - Number(min);
  297. }
  298. }
  299. return splitNumber
  300. },
  301. // 常驻人口
  302. vacInfopro() {
  303. if (!this.checkLogin()) {
  304. return
  305. }
  306. uni.navigateTo({
  307. url: '/pages/home/resident'
  308. })
  309. },
  310. //新增人口信息
  311. addVacSituapeo() {
  312. if (!this.checkLogin()) {
  313. return
  314. }
  315. uni.navigateTo({
  316. url: "/add/pages/addvacfrom/addpeople"
  317. })
  318. },
  319. // 人口信息情况
  320. goRecordpeo() {
  321. if (!this.checkLogin()) {
  322. return
  323. }
  324. uni.navigateTo({
  325. url: "/home/pages/recordthree/recordpeople"
  326. })
  327. },
  328. //状态变更
  329. goReturnState() {
  330. if (!this.checkLogin()) {
  331. return
  332. }
  333. uni.navigateTo({
  334. url: "/home/pages/recordthree/recordstate"
  335. })
  336. },
  337. goNuclein() {
  338. if (!this.checkLogin()) {
  339. return
  340. }
  341. // uni.navigateTo({
  342. // url: "/home/pages/recordthree/recordnuclein"
  343. // })
  344. // uni.navigateTo({
  345. // url: "/add/pages/addvacfrom/nucleindetail?id=6"
  346. // })
  347. },
  348. //返乡
  349. goReturnpeo() {
  350. if (!this.checkLogin()) {
  351. return
  352. }
  353. uni.navigateTo({
  354. url: "/home/pages/recordthree/returnpeople"
  355. })
  356. },
  357. /* 获取当前时间 */
  358. getTimeNow() {
  359. // console.log(Date.now())
  360. let re = this.h_util.getDateTime('yyyy年MM月dd日hh时', new Date())
  361. // console.log(re)
  362. return re
  363. }
  364. }
  365. }
  366. </script>
  367. <style scoped lang="scss">
  368. .flexc{display: flex;align-items: center;width: 100%;}
  369. .flex1{flex: 1;}
  370. .flexjs{justify-content: space-between;flex-wrap: wrap;}
  371. .flex0{flex: 0 0 auto;}
  372. .mb11{margin-bottom: 22rpx;}
  373. .w100{width: 100%;}
  374. // 全部布局 start
  375. .home{min-height: 100vh;background: #f5f5f5;}
  376. .con {
  377. display: flex;
  378. flex-direction: column;
  379. padding: 30rpx 32rpx 10rpx;
  380. background: #ffffff;
  381. }
  382. .nctu{display: flex;
  383. flex-direction: column;
  384. padding: 30rpx 0rpx 10rpx;
  385. background: #ffffff;}
  386. .imagba{position:relative;width:684rpx;
  387. height:292upx;
  388. margin-bottom: 24rpx;
  389. .swiper{width: 100%;height: 100%;
  390. image{width: 100%;height: 100%;display: block;}
  391. }
  392. }
  393. .imagbc{position: absolute;font-size: 24rpx;color: #ffffff;left:44rpx;bottom: 16rpx;}
  394. .imagb{
  395. width:684rpx;
  396. height:292upx;
  397. }
  398. .imagbox{width: 336rpx;height: 126rpx;margin-bottom: 18rpx;position: relative;
  399. .nimage{width: 100%;height: 100%;display: block;}
  400. .imagboxa{position: absolute;left: 0;top: 0;bottom: 0;right: 0;box-sizing: border-box;padding: 12rpx;display: flex;align-items: center;
  401. .imgl{width: 58rpx;height: 58rpx;margin-right: 12rpx;flex: 0 0 auto;}
  402. .txt{font-size: 28rpx;color: #FFFFFF;font-weight: bold;margin-bottom: 12rpx;}
  403. .txt2{font-size: 24rpx;}
  404. }
  405. }
  406. .nhtit{font-size: 28rpx;color: #343434;font-weight: bold;margin-bottom: 38rpx;}
  407. .ncbox{display: flex;align-items: center;flex-wrap: wrap;
  408. .ncboxa{width: 216rpx;background: #ECF1FE;
  409. border-radius: 3px;padding:18rpx;box-sizing: border-box;text-align: center;min-height: 124rpx;margin-bottom: 18rpx;margin-right: 18rpx;
  410. &:nth-of-type(3n){margin-right: 0;}
  411. .ncboxatit{font-size: 22rpx;color: #939FBD;margin-bottom: 14rpx;}
  412. .ncboxatxt{font-size: 34rpx;color: #464E58;font-weight: bold;}
  413. }
  414. }
  415. </style>