index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. <template>
  2. <view class="work-container">
  3. <!-- 轮播图 -->
  4. <uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
  5. <swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
  6. <swiper-item v-for="(item, index) in data" :key="index">
  7. <view class="swiper-item" @click="clickBannerItem(item)">
  8. <image :src="item.image" mode="aspectFill" :draggable="false" />
  9. </view>
  10. </swiper-item>
  11. </swiper>
  12. </uni-swiper-dot>
  13. <!-- 宫格组件 -->
  14. <!-- <uni-section title="系统管理" type="line"></uni-section> -->
  15. <view class="grid-body">
  16. <uni-grid :column="2" :showBorder="false">
  17. <uni-grid-item>
  18. <view class="grid-item-box" @click="showMinYong">
  19. <uni-icons type="person-filled" size="30"></uni-icons>
  20. <text class="text">民用工程</text>
  21. </view>
  22. </uni-grid-item>
  23. <uni-grid-item>
  24. <view class="grid-item-box" @click="showGongYe">
  25. <uni-icons type="staff-filled" size="30"></uni-icons>
  26. <text class="text">工业工程</text>
  27. </view>
  28. </uni-grid-item>
  29. <uni-grid-item>
  30. <view class="grid-item-box" @click="municipalProjectClick">
  31. <uni-icons type="color" size="30"></uni-icons>
  32. <text class="text">市政工程</text>
  33. </view>
  34. </uni-grid-item>
  35. <uni-grid-item>
  36. <view class="grid-item-box">
  37. <uni-icons type="settings-filled" size="30" @click="showDangerous"></uni-icons>
  38. <text class="text">危险作业工程</text>
  39. </view>
  40. </uni-grid-item>
  41. <uni-grid-item>
  42. <view class="grid-item-box">
  43. <uni-icons type="heart-filled" size="30"></uni-icons>
  44. <text class="text">预警工程</text>
  45. </view>
  46. </uni-grid-item>
  47. <uni-grid-item>
  48. <view class="grid-item-box">
  49. <uni-icons type="bars" size="30" @click="showInfrastructureDialog"></uni-icons>
  50. <text class="text">基建工程</text>
  51. </view>
  52. </uni-grid-item>
  53. </uni-grid>
  54. <view v-if="showPopup" class="popup">
  55. <view class="content">
  56. <view class="line1">
  57. <view>旧改工程</view>
  58. </view>
  59. <view class="line2" v-for="(item, index) in OldProjectList" :key="index">
  60. <view @click="OldProject(item.dictValue)">{{item.dictLabel}}</view>
  61. <!-- <view @click="Courtyard(0)">庭院</view>
  62. <view @click="Overhead(0)">架空</view> -->
  63. </view>
  64. <view class="line1">
  65. <view>新建工程</view>
  66. </view>
  67. <view class="line2" v-for="(item, index) in NewProjectList" :key="index">
  68. <view @click="NewProject(item.dictValue)">{{item.dictLabel}}</view>
  69. <!-- <view @click="Courtyard(0)">庭院</view>
  70. <view @click="Overhead(0)">架空</view> -->
  71. </view>
  72. </view>
  73. <view class="btn-group">
  74. <view class="btn_position">
  75. <view class="cancel" @click="showMinYong">取消</view>
  76. </view>
  77. </view>
  78. </view>
  79. <view v-if="showPopup" class="mask" @click="showMinYong"></view>
  80. </view>
  81. <view class="share">
  82. <view :class="{'share-box': shareState}" @click="handleHiddenShare">
  83. </view>
  84. <view class="share-item" :class="{'share-show': shareState}">
  85. <view class="share-to">
  86. <text>请选择</text>
  87. </view>
  88. <view class="content">
  89. <view class="block" v-for="(item, index) in typeList" :key="index" @click="showTypeSheet(item)">
  90. <!-- <image :src="item.image" mode="aspectFill"></image> -->
  91. <text>{{item.dictLabel}}</text>
  92. </view>
  93. </view>
  94. <view class="cancel" @click.stop="handleHiddenShare">
  95. <text>取消</text>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. </template>
  102. <script>
  103. import {
  104. getDicts
  105. } from "@/api/system/dict/data";
  106. export default {
  107. data() {
  108. return {
  109. showPopup: false,
  110. shareState: false,
  111. array: [],
  112. projectType: '', //工程类型
  113. OldProjectList: '', //旧改工程
  114. NewProjectList: '', //民用工程
  115. typeList: '', //二次弹窗数据
  116. enginType: '',
  117. enginClassification: '', // 旧改节点 数据字典
  118. enginClassValue: '', //二次节点 数据字典
  119. current: 0,
  120. swiperDotIndex: 0,
  121. data: [{
  122. image: '/static/images/banner/banner01.jpg'
  123. },
  124. {
  125. image: '/static/images/banner/banner02.jpg'
  126. },
  127. {
  128. image: '/static/images/banner/banner03.jpg'
  129. }
  130. ]
  131. }
  132. },
  133. methods: {
  134. // 显示二次弹窗
  135. handleShowSheet() {
  136. this.shareState = true;
  137. },
  138. // 隐藏二次弹窗
  139. handleHiddenShare() {
  140. this.shareState = false;
  141. },
  142. clickBannerItem(item) {
  143. console.info(item)
  144. },
  145. changeSwiper(e) {
  146. this.current = e.detail.current
  147. },
  148. changeGrid(e) {
  149. this.$modal.showToast('模块建设中~')
  150. },
  151. showMinYong() {
  152. this.projectType = 'MinYong';
  153. getDicts("old_renovation").then(response => {
  154. this.OldProjectList = response.data;
  155. });
  156. getDicts("new_built").then(response => {
  157. this.NewProjectList = response.data;
  158. });
  159. this.showPopup = !this.showPopup;
  160. },
  161. //市政工程-首页-点击事件
  162. municipalProjectClick(){
  163. uni.navigateTo({
  164. url: '/pages/municipal/municipal'
  165. });
  166. },
  167. NewProject(e) {
  168. this.enginType = 'new_built'; //写死
  169. this.enginClassification = e;
  170. this.typeList = ''; //置空
  171. console.log("新建", e)
  172. if (e == 'indoor_engin') {
  173. //新建室内
  174. getDicts("new_built_indoor_engin").then(response => {
  175. this.typeList = response.data;
  176. });
  177. } else if (e == 'courtyard') {
  178. //新建庭院
  179. getDicts("new_built_courtyard_engin").then(response => {
  180. console.log("庭院", response.data)
  181. this.typeList = response.data;
  182. });
  183. } else if (e == 'overhead') {
  184. //新建架空
  185. getDicts("new_built_courtyard_engin").then(response => {
  186. console.log("架空", response.data)
  187. this.typeList = response.data;
  188. });
  189. }
  190. this.handleShowSheet();
  191. },
  192. OldProject(e) {
  193. this.enginType = 'old_renovation'; //写死
  194. this.enginClassification = e;
  195. console.log("旧改", e)
  196. this.typeList = ''; //置空
  197. if (e == 'indoor_engin') {
  198. //旧改室内
  199. getDicts("old_renovation_indoor_engin").then(response => {
  200. this.typeList = response.data;
  201. });
  202. } else if (e == 'courtyard') {
  203. //旧改庭院
  204. getDicts("old_renovation_courtyard_engin").then(response => {
  205. console.log("庭院", response.data)
  206. this.typeList = response.data;
  207. });
  208. } else if (e == 'overhead') {
  209. //旧改架空
  210. getDicts("old_renovation_overhead").then(response => {
  211. console.log("架空", response.data)
  212. this.typeList = response.data;
  213. });
  214. }
  215. this.handleShowSheet();
  216. },
  217. //二次弹窗 选择类型
  218. showTypeSheet(item) {
  219. if (this.projectType == 'MinYong') {
  220. this.showPopup = !this.showPopup; //隐藏第一次弹窗
  221. this.enginClassValue = item.dictValue; //二次节点赋值
  222. const obj = {
  223. enginClassValue: this.enginClassValue, //(拆旧管等 字典值)
  224. enginType: this.enginType, //旧改 还是新建 写死
  225. enginClassification: this.enginClassification //室内 庭院 架空
  226. };
  227. console.log(obj)
  228. this.handleHiddenShare();
  229. // 室内
  230. if (this.enginClassification == 'indoor_engin') {
  231. uni.navigateTo({
  232. url: '/pages/oldrenovation/indoor/indoor?params=' + encodeURIComponent(JSON.stringify(
  233. obj))
  234. })
  235. }
  236. // 庭院
  237. else if (this.enginClassification == 'courtyard') {
  238. uni.navigateTo({
  239. url: '/pages/oldrenovation/courtyard/courtyard?params=' + encodeURIComponent(JSON
  240. .stringify(
  241. obj))
  242. })
  243. } else if (this.enginClassification == 'overhead') { //架空
  244. uni.navigateTo({
  245. url: '/pages/oldrenovation/overhead/overhead?params=' + encodeURIComponent(JSON
  246. .stringify(
  247. obj))
  248. })
  249. }
  250. } else if (this.projectType == 'GongYe') {
  251. console.log("工业", item)
  252. let obj = {
  253. value: item.dictValue
  254. };
  255. this.handleHiddenShare();
  256. uni.navigateTo({
  257. url: '/pages/enginproject/enginproject?params=' + encodeURIComponent(JSON
  258. .stringify(
  259. obj))
  260. })
  261. } else if (this.projectType == 'JiJian') {
  262. console.log("基建", item)
  263. let obj = {
  264. value: item.dictValue
  265. };
  266. this.handleHiddenShare();
  267. uni.navigateTo({
  268. url: '/pages/infrastructure/infrastructure?params=' + encodeURIComponent(JSON
  269. .stringify(
  270. obj))
  271. })
  272. }
  273. },
  274. showGongYe() {
  275. this.projectType = 'GongYe';
  276. //工业工程
  277. getDicts("engin_classification").then(response => {
  278. console.log("工业工程", response.data)
  279. this.typeList = response.data;
  280. console.log("工业工程", response.data)
  281. });
  282. this.handleShowSheet();
  283. },
  284. showInfrastructureDialog() {
  285. this.projectType = 'JiJian';
  286. //基建工程
  287. getDicts("engineering_infrastructure").then(response => {
  288. console.log("基建工程", response.data)
  289. this.typeList = response.data;
  290. console.log("基建工程", response.data)
  291. });
  292. this.handleShowSheet();
  293. },
  294. showDangerous(){
  295. console.log("危险作业工程")
  296. uni.navigateTo({
  297. url: '/pages/dangerous/dangerous'
  298. })
  299. },
  300. }
  301. }
  302. </script>
  303. <style lang="scss">
  304. /* #ifndef APP-NVUE */
  305. page {
  306. display: flex;
  307. flex-direction: column;
  308. box-sizing: border-box;
  309. background-color: #fff;
  310. min-height: 100%;
  311. height: auto;
  312. }
  313. view {
  314. font-size: 14px;
  315. line-height: inherit;
  316. }
  317. /* #endif */
  318. .text {
  319. text-align: center;
  320. font-size: 26rpx;
  321. margin-top: 10rpx;
  322. }
  323. .grid-item-box {
  324. flex: 1;
  325. /* #ifndef APP-NVUE */
  326. display: flex;
  327. /* #endif */
  328. flex-direction: column;
  329. align-items: center;
  330. justify-content: center;
  331. padding: 15px 0;
  332. }
  333. .uni-margin-wrap {
  334. width: 690rpx;
  335. width: 100%;
  336. ;
  337. }
  338. .swiper {
  339. height: 300rpx;
  340. }
  341. .swiper-box {
  342. height: 150px;
  343. }
  344. .swiper-item {
  345. /* #ifndef APP-NVUE */
  346. display: flex;
  347. /* #endif */
  348. flex-direction: column;
  349. justify-content: center;
  350. align-items: center;
  351. color: #fff;
  352. height: 300rpx;
  353. line-height: 300rpx;
  354. }
  355. @media screen and (min-width: 500px) {
  356. .uni-swiper-dot-box {
  357. width: 400px;
  358. /* #ifndef APP-NVUE */
  359. margin: 0 auto;
  360. /* #endif */
  361. margin-top: 8px;
  362. }
  363. .image {
  364. width: 100%;
  365. }
  366. }
  367. // 弹窗效果
  368. .popup {
  369. position: fixed;
  370. bottom: 0;
  371. left: 0;
  372. width: 100%;
  373. background-color: #fff;
  374. // padding: 20rpx;
  375. box-sizing: border-box;
  376. z-index: 999;
  377. }
  378. // 遮罩层
  379. .mask {
  380. position: fixed;
  381. top: 0;
  382. left: 0;
  383. width: 100%;
  384. height: 100%;
  385. background-color: rgba(0, 0, 0, 0.5);
  386. z-index: 888;
  387. }
  388. // 弹窗内容
  389. .content {
  390. .line1 {
  391. background-color: #6ea8e7;
  392. text-align: center;
  393. padding: 20rpx;
  394. }
  395. .line2 {
  396. padding: 20rpx;
  397. // border-bottom: 1px solid black;
  398. view {
  399. margin-bottom: 10rpx;
  400. }
  401. }
  402. }
  403. // 按钮样式
  404. .btn-group {
  405. box-shadow: 0px -2px 6px rgba(0, 0, 0, 0.5);
  406. /* 示例阴影参数,根据需要进行调整 */
  407. .btn_position {
  408. display: flex;
  409. width: 100%;
  410. .cancel {
  411. width: 50%;
  412. text-align: center;
  413. padding: 20rpx 0;
  414. color: #519fe7;
  415. }
  416. .submit {
  417. width: 50%;
  418. background-color: #519fe7;
  419. text-align: center;
  420. padding: 20rpx 0;
  421. color: #fff;
  422. }
  423. }
  424. }
  425. .share {
  426. width: 100%;
  427. height: 100%;
  428. }
  429. .share-box {
  430. width: 100%;
  431. height: 100%;
  432. position: fixed;
  433. top: 0rpx;
  434. left: 0rpx;
  435. bottom: 0rpx;
  436. right: 0rpx;
  437. background-color: rgba(0, 0, 0, 0.4);
  438. transition: .3s;
  439. z-index: 999;
  440. }
  441. // 进入分享动画
  442. .share-show {
  443. transition: all 0.3s ease;
  444. transform: translateY(0%) !important;
  445. }
  446. // 离开分享动画
  447. .share-item {
  448. position: fixed;
  449. left: 0;
  450. bottom: 0;
  451. width: 100%;
  452. height: auto;
  453. background-color: #FFFFFF;
  454. transition: all 0.3s ease;
  455. transform: translateY(100%);
  456. z-index: 1999;
  457. .share-to {
  458. width: 100%;
  459. height: 3rem;
  460. display: flex;
  461. justify-content: center;
  462. align-items: center;
  463. &::after {
  464. content: '';
  465. width: 240rpx;
  466. height: 0rpx;
  467. border-top: 1px solid #E4E7ED;
  468. -webkit-transform: scaleY(0.5);
  469. transform: scaleY(0.5);
  470. margin-left: 30rpx;
  471. }
  472. &::before {
  473. content: '';
  474. width: 240rpx;
  475. height: 0rpx;
  476. border-top: 1px solid #E4E7ED;
  477. -webkit-transform: scaleY(0.5);
  478. transform: scaleY(0.5);
  479. margin-right: 30rpx;
  480. }
  481. }
  482. .content {
  483. width: 100%;
  484. height: 50%;
  485. display: flex;
  486. flex-wrap: wrap;
  487. .block {
  488. width: 100%;
  489. display: flex;
  490. flex-direction: column;
  491. justify-content: center;
  492. align-items: center;
  493. height: 80rpx;
  494. text {
  495. margin-top: 16rpx;
  496. font-size: 28rpx;
  497. color: #606266;
  498. }
  499. }
  500. }
  501. .cancel {
  502. width: 100%;
  503. height: 3rem;
  504. display: flex;
  505. justify-content: center;
  506. align-items: center;
  507. border-top: 1rpx solid #E4E7ED;
  508. }
  509. }
  510. </style>