index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. <template>
  2. <view class="work-container">
  3. <view style="work-banner">
  4. <image :src="loadImgSrc('work-banner.png')" style="width: 100%;height:43vh"></image>
  5. </view>
  6. <view class="grid-body">
  7. <view class="Grid">
  8. <view class="Grid-Item" v-for="item in List" :key="item.id" @click="navClick(item.id)"
  9. hover-class="click-hover" hover-start-time="50" hover-stay-time="50">
  10. <image class="icon-item" :src="loadImgSrc('mygc.png')" v-if="item.title == '民用工程'"></image>
  11. <image class="icon-item" :src="loadImgSrc('gygc.png')" v-if="item.title == '工业工程'"></image>
  12. <image class="icon-item" :src="loadImgSrc('szgc.png')" v-if="item.title == '市政工程'"></image>
  13. <image class="icon-item" :src="loadImgSrc('wxzy.png')" v-if="item.title == '危险作业工程'"></image>
  14. <image class="icon-item" :src="loadImgSrc('dggc.png')" v-if="item.title == '顶管工程'"></image>
  15. <image class="icon-item" :src="loadImgSrc('jjgc.png')" v-if="item.title == '基建工程'"></image>
  16. <view class="GStitle">{{ item.title }}
  17. </view>
  18. </view>
  19. </view>
  20. <view v-if="showPopup" class="popup">
  21. <view class="content">
  22. <view class="line1 top40">
  23. <view style="width: 61rpx;
  24. color: #CEB98D;
  25. height: 61rpx;
  26. display: flex;
  27. justify-content: center;
  28. align-items: center;
  29. border: 3px solid #CEB98D;
  30. border-radius: 50%; margin-right: 20rpx;">旧</view>
  31. <view>旧改工程</view>
  32. </view>
  33. <view class="line2 btn-grp">
  34. <view class="btn-grp-item" v-for="(item, index) in OldProjectList" :key="index"
  35. @click="OldProject(item.dictValue)">
  36. <image :src="loadImgSrc('sn.png')" class="line2-btn-big" v-if="item.dictLabel == '室内工程'">
  37. </image>
  38. <image :src="loadImgSrc('ty.png')" class="line2-btn-big" v-if="item.dictLabel == '庭院工程'">
  39. </image>
  40. <image :src="loadImgSrc('jk.png')" class="line2-btn-big" v-if="item.dictLabel == '架空'">
  41. </image>
  42. {{item.dictLabel}}
  43. </view>
  44. </view>
  45. <view class="line1">
  46. <view style="width: 61rpx;
  47. color: #85c9c2;
  48. height: 61rpx;
  49. display: flex;
  50. justify-content: center;
  51. align-items: center;
  52. border: 3px solid #85c9c2;
  53. border-radius: 50%; margin-right: 20rpx;">新</view>
  54. <view>新建工程</view>
  55. </view>
  56. <view class="line2 btn-grp">
  57. <view class="btn-grp-item" v-for="(item, index) in NewProjectList" :key="index"
  58. @click="NewProject(item.dictValue)">
  59. <image :src="loadImgSrc('sn2.png')" class="line2-btn-big" v-if="item.dictLabel == '室内工程'">
  60. </image>
  61. <image :src="loadImgSrc('ty2.png')" class="line2-btn-big" v-if="item.dictLabel == '庭院工程'">
  62. </image>
  63. <image :src="loadImgSrc('jk2.png')" class="line2-btn-big" v-if="item.dictLabel == '架空'">
  64. </image>
  65. {{item.dictLabel}}
  66. </view>
  67. </view>
  68. </view>
  69. <!-- <view class="btn-group">
  70. <view class="btn_position">
  71. <view class="cancel" @click="showMinYong">取消</view>
  72. </view>
  73. </view> -->
  74. </view>
  75. <view v-if="showPopup" class="mask" @click="showMinYong"></view>
  76. </view>
  77. <view class="share">
  78. <view :class="{'share-box': shareState}" @click="handleHiddenShare">
  79. </view>
  80. <view class="share-item" :class="{'share-show': shareState}">
  81. <view class="share-to">
  82. <text>请选择</text>
  83. </view>
  84. <scroll-view scroll-y="true" class="scroll-Y">
  85. <view class="content">
  86. <view class="block" v-for="(item, index) in typeList" :key="index" @click="showTypeSheet(item)">
  87. <!-- <image :src="item.image" mode="aspectFill"></image> -->
  88. <text>{{item.dictLabel}}</text>
  89. </view>
  90. </view>
  91. </scroll-view>
  92. <view class="cancel" @click.stop="handleHiddenShare">
  93. <text>取消</text>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. import {
  102. getDicts
  103. } from "@/api/system/dict/data";
  104. export default {
  105. data() {
  106. return {
  107. showPopup: false,
  108. shareState: false,
  109. array: [],
  110. projectType: '', //工程类型
  111. OldProjectList: '', //旧改工程
  112. NewProjectList: '', //民用工程
  113. typeList: '', //二次弹窗数据
  114. enginType: '',
  115. enginClassification: '', // 旧改节点 数据字典
  116. enginClassValue: '', //二次节点 数据字典
  117. current: 0,
  118. swiperDotIndex: 0,
  119. List: [{
  120. id: 1,
  121. img: '/static/logo.png',
  122. title: '民用工程'
  123. },
  124. {
  125. id: 2,
  126. img: '/static/logo.png',
  127. title: '工业工程'
  128. },
  129. {
  130. id: 3,
  131. img: '/static/logo.png',
  132. title: '市政工程'
  133. },
  134. {
  135. id: 4,
  136. img: '/static/logo.png',
  137. title: '危险作业工程'
  138. },
  139. {
  140. id: 5,
  141. img: '/static/logo.png',
  142. title: '顶管工程'
  143. },
  144. {
  145. id: 6,
  146. img: '/static/logo.png',
  147. title: '基建工程'
  148. },
  149. ]
  150. }
  151. },
  152. methods: {
  153. navClick(newId) {
  154. if (newId == 1) {
  155. this.showMinYong()
  156. } else if (newId == 2) {
  157. this.showGongYe();
  158. } else if (newId == 3) {
  159. this.municipalProjectClick();
  160. } else if (newId == 4) {
  161. this.showDangerous();
  162. } else if (newId == 5) {
  163. this.showTopPipe();
  164. } else if (newId == 6) {
  165. this.showInfrastructureDialog();
  166. }
  167. },
  168. // 显示二次弹窗
  169. handleShowSheet() {
  170. this.shareState = true;
  171. },
  172. // 隐藏二次弹窗
  173. handleHiddenShare() {
  174. this.shareState = false;
  175. },
  176. showMinYong() {
  177. this.projectType = 'MinYong';
  178. getDicts("old_renovation").then(response => {
  179. this.OldProjectList = response.data;
  180. });
  181. getDicts("new_built").then(response => {
  182. this.NewProjectList = response.data;
  183. });
  184. this.showPopup = !this.showPopup;
  185. },
  186. //市政工程-首页-点击事件
  187. municipalProjectClick() {
  188. let obj = {
  189. value: '市政工程'
  190. };
  191. uni.navigateTo({
  192. url: '/pages/municipal/municipal?params=' + encodeURIComponent(JSON
  193. .stringify(obj))
  194. });
  195. },
  196. NewProject(e) {
  197. this.enginType = 'new_built'; //写死
  198. this.enginClassification = e;
  199. this.typeList = ''; //置空
  200. console.log("新建", e)
  201. if (e == 'indoor_engin') {
  202. //新建室内
  203. getDicts("new_built_indoor_engin").then(response => {
  204. this.typeList = response.data;
  205. });
  206. } else if (e == 'courtyard') {
  207. //新建庭院
  208. getDicts("new_built_courtyard").then(response => {
  209. console.log("庭院", response.data)
  210. this.typeList = response.data;
  211. });
  212. } else if (e == 'overhead') {
  213. //新建架空
  214. getDicts("new_built_courtyard").then(response => {
  215. console.log("架空", response.data)
  216. this.typeList = response.data;
  217. });
  218. }
  219. this.handleShowSheet();
  220. },
  221. OldProject(e) {
  222. this.enginType = 'old_renovation'; //写死
  223. this.enginClassification = e;
  224. console.log("旧改", e)
  225. this.typeList = ''; //置空
  226. if (e == 'indoor_engin') {
  227. //旧改室内
  228. getDicts("old_renovation_indoor_engin").then(response => {
  229. this.typeList = response.data;
  230. });
  231. } else if (e == 'courtyard') {
  232. //旧改庭院
  233. getDicts("old_renovation_courtyard").then(response => {
  234. console.log("庭院", response.data)
  235. this.typeList = response.data;
  236. });
  237. } else if (e == 'overhead') {
  238. //旧改架空
  239. getDicts("old_renovation_overhead").then(response => {
  240. console.log("架空", response.data)
  241. this.typeList = response.data;
  242. });
  243. }
  244. this.handleShowSheet();
  245. },
  246. //二次弹窗 选择类型
  247. showTypeSheet(item) {
  248. if (this.projectType == 'MinYong') {
  249. //this.showPopup = !this.showPopup; //隐藏第一次弹窗
  250. this.enginClassValue = item.dictValue; //二次节点赋值
  251. const obj = {
  252. enginClassValue: this.enginClassValue, //(拆旧管等 字典值)
  253. enginType: this.enginType, //旧改 还是新建 写死
  254. enginClassification: this.enginClassification //室内 庭院 架空
  255. };
  256. console.log(obj)
  257. //this.handleHiddenShare();
  258. // 室内
  259. if (this.enginClassification == 'indoor_engin') {
  260. uni.navigateTo({
  261. url: '/pages/oldrenovation/indoor/indoor?params=' + encodeURIComponent(JSON.stringify(
  262. obj))
  263. })
  264. }
  265. // 庭院
  266. else if (this.enginClassification == 'courtyard') {
  267. console.log(this.enginClassValue)
  268. uni.navigateTo({
  269. url: '/pages/oldrenovation/courtyard/courtyard?params=' + encodeURIComponent(JSON
  270. .stringify(
  271. obj))
  272. })
  273. } else if (this.enginClassification == 'overhead') { //架空
  274. uni.navigateTo({
  275. url: '/pages/oldrenovation/overhead/overhead?params=' + encodeURIComponent(JSON
  276. .stringify(
  277. obj))
  278. })
  279. }
  280. } else if (this.projectType == 'GongYe') {
  281. console.log("工业", item)
  282. let obj = {
  283. value: item.dictValue
  284. };
  285. //this.handleHiddenShare();
  286. uni.navigateTo({
  287. url: '/pages/enginproject/enginproject?params=' + encodeURIComponent(JSON
  288. .stringify(
  289. obj))
  290. })
  291. } else if (this.projectType == 'JiJian') {
  292. console.log("基建", item)
  293. let obj = {
  294. value: item.dictValue
  295. };
  296. //this.handleHiddenShare();
  297. uni.navigateTo({
  298. url: '/pages/infrastructure/infrastructure?params=' + encodeURIComponent(JSON
  299. .stringify(
  300. obj))
  301. })
  302. } else if (this.projectType == 'DingGuan') {
  303. console.log("顶管", item)
  304. let obj = {
  305. value: item.dictValue
  306. };
  307. //this.handleHiddenShare();
  308. uni.navigateTo({
  309. url: '/pages/TopPipeWork/TopPipeWork?params=' + encodeURIComponent(JSON
  310. .stringify(
  311. obj))
  312. })
  313. }
  314. },
  315. showGongYe() {
  316. this.projectType = 'GongYe';
  317. //工业工程
  318. getDicts("engin_classification").then(response => {
  319. console.log("工业工程", response.data)
  320. this.typeList = response.data;
  321. console.log("工业工程", response.data)
  322. });
  323. this.handleShowSheet();
  324. },
  325. showTopPipe() {
  326. this.projectType = 'DingGuan';
  327. getDicts("pipe_jack").then(response => {
  328. console.log("顶管工程", response.data)
  329. this.typeList = response.data;
  330. });
  331. this.handleShowSheet();
  332. },
  333. showInfrastructureDialog() {
  334. this.projectType = 'JiJian';
  335. //基建工程
  336. getDicts("engineering_infrastructure").then(response => {
  337. console.log("基建工程", response.data)
  338. this.typeList = response.data;
  339. console.log("基建工程", response.data)
  340. });
  341. this.handleShowSheet();
  342. },
  343. showDangerous() {
  344. console.log("危险作业工程")
  345. uni.navigateTo({
  346. url: '/pages/dangerous/dangerous'
  347. })
  348. },
  349. }
  350. }
  351. </script>
  352. <style lang="scss">
  353. /* #ifndef APP-NVUE */
  354. page {
  355. display: flex;
  356. flex-direction: column;
  357. box-sizing: border-box;
  358. background-color: #fff;
  359. min-height: 100%;
  360. height: auto;
  361. }
  362. view {
  363. font-size: 14px;
  364. line-height: inherit;
  365. }
  366. .work-container {
  367. display: flex;
  368. flex-direction: column;
  369. }
  370. /* #endif */
  371. .text {
  372. text-align: center;
  373. font-size: 26rpx;
  374. margin-top: 10rpx;
  375. }
  376. .grid-item-box {
  377. flex: 1;
  378. /* #ifndef APP-NVUE */
  379. display: flex;
  380. /* #endif */
  381. flex-direction: column;
  382. align-items: center;
  383. justify-content: center;
  384. padding: 15px 0;
  385. }
  386. .uni-margin-wrap {
  387. width: 690rpx;
  388. width: 100%;
  389. ;
  390. }
  391. .swiper {
  392. height: 300rpx;
  393. }
  394. .swiper-box {
  395. height: 150px;
  396. }
  397. .swiper-item {
  398. /* #ifndef APP-NVUE */
  399. display: flex;
  400. /* #endif */
  401. flex-direction: column;
  402. justify-content: center;
  403. align-items: center;
  404. color: #fff;
  405. height: 300rpx;
  406. line-height: 300rpx;
  407. }
  408. @media screen and (min-width: 500px) {
  409. .uni-swiper-dot-box {
  410. width: 400px;
  411. /* #ifndef APP-NVUE */
  412. margin: 0 auto;
  413. /* #endif */
  414. margin-top: 8px;
  415. }
  416. .image {
  417. width: 100%;
  418. }
  419. }
  420. // 弹窗效果
  421. .popup {
  422. position: fixed;
  423. bottom: 0;
  424. left: 0;
  425. width: 100%;
  426. background-color: #fff;
  427. // padding: 20rpx;
  428. box-sizing: border-box;
  429. z-index: 999;
  430. border-top-left-radius: 40rpx;
  431. border-top-right-radius: 40rpx;
  432. }
  433. // 遮罩层
  434. .mask {
  435. position: fixed;
  436. top: 0;
  437. left: 0;
  438. width: 100%;
  439. height: 100%;
  440. background-color: rgba(0, 0, 0, 0.5);
  441. z-index: 888;
  442. }
  443. // 弹窗内容
  444. .content {
  445. .top40 {
  446. margin-top: 30rpx;
  447. }
  448. .line1 {
  449. text-align: center;
  450. display: flex;
  451. justify-content: start;
  452. align-items: center;
  453. padding: 20rpx;
  454. }
  455. .btn-grp {
  456. display: flex;
  457. .btn-grp-item {
  458. width: 33%;
  459. display: flex;
  460. flex-direction: column;
  461. align-items: center;
  462. .line2-btn-big {
  463. width: 128rpx;
  464. height: 128rpx;
  465. margin-bottom: 10rpx;
  466. }
  467. }
  468. }
  469. .line2 {
  470. padding: 20rpx;
  471. // border-bottom: 1px solid black;
  472. view {
  473. margin-bottom: 10rpx;
  474. }
  475. }
  476. }
  477. // 按钮样式
  478. .btn-group {
  479. box-shadow: 0px -2px 6px rgba(0, 0, 0, 0.5);
  480. /* 示例阴影参数,根据需要进行调整 */
  481. .btn_position {
  482. display: flex;
  483. width: 100%;
  484. .cancel {
  485. width: 50%;
  486. text-align: center;
  487. padding: 20rpx 0;
  488. color: #519fe7;
  489. }
  490. .submit {
  491. width: 50%;
  492. background-color: #519fe7;
  493. text-align: center;
  494. padding: 20rpx 0;
  495. color: #fff;
  496. }
  497. }
  498. }
  499. .share {
  500. width: 100%;
  501. height: 100%;
  502. }
  503. .share-box {
  504. width: 100%;
  505. height: 100%;
  506. position: fixed;
  507. top: 0rpx;
  508. left: 0rpx;
  509. bottom: 0rpx;
  510. right: 0rpx;
  511. background-color: rgba(0, 0, 0, 0.4);
  512. transition: .3s;
  513. z-index: 999;
  514. }
  515. // 进入分享动画
  516. .share-show {
  517. transition: all 0.3s ease;
  518. transform: translateY(0%) !important;
  519. }
  520. .scroll-Y {
  521. height: 350rpx;
  522. }
  523. // 离开分享动画
  524. .share-item {
  525. position: fixed;
  526. left: 0;
  527. bottom: 0;
  528. width: 100%;
  529. height: auto;
  530. background-color: #FFFFFF;
  531. transition: all 0.3s ease;
  532. transform: translateY(100%);
  533. z-index: 1999;
  534. border-top-left-radius: 40rpx;
  535. border-top-right-radius: 40rpx;
  536. .share-to {
  537. width: 100%;
  538. height: 3rem;
  539. display: flex;
  540. justify-content: center;
  541. align-items: center;
  542. &::after {
  543. content: '';
  544. width: 240rpx;
  545. height: 0rpx;
  546. border-top: 1px solid #E4E7ED;
  547. -webkit-transform: scaleY(0.5);
  548. transform: scaleY(0.5);
  549. margin-left: 30rpx;
  550. }
  551. &::before {
  552. content: '';
  553. width: 240rpx;
  554. height: 0rpx;
  555. border-top: 1px solid #E4E7ED;
  556. -webkit-transform: scaleY(0.5);
  557. transform: scaleY(0.5);
  558. margin-right: 30rpx;
  559. }
  560. }
  561. .content {
  562. width: 100%;
  563. height: 50%;
  564. display: flex;
  565. flex-wrap: wrap;
  566. .block {
  567. width: 100%;
  568. display: flex;
  569. flex-direction: column;
  570. justify-content: center;
  571. align-items: center;
  572. height: 80rpx;
  573. text {
  574. margin-top: 16rpx;
  575. font-size: 28rpx;
  576. color: #606266;
  577. }
  578. }
  579. }
  580. .cancel {
  581. width: 100%;
  582. height: 3rem;
  583. display: flex;
  584. justify-content: center;
  585. align-items: center;
  586. border-top: 1rpx solid #E4E7ED;
  587. }
  588. }
  589. /*********************九宫格********************* */
  590. .Grid {
  591. display: flex;
  592. flex-wrap: wrap;
  593. justify-content: space-between;
  594. align-content: space-between;
  595. // background: #f7f7f7;
  596. padding: 10rpx 0;
  597. .Grid-Item {
  598. width: 50%;
  599. // height: 100px;
  600. text-align: center;
  601. // border: 1rpx solid #ff0000;
  602. box-sizing: border-box;
  603. .icon-item {
  604. width: 220rpx;
  605. height: 220rpx;
  606. }
  607. .GSimg {
  608. width: 96rpx;
  609. height: 96rpx;
  610. margin-top: 42rpx;
  611. margin-left: 75rpx;
  612. .Image {
  613. width: 96rpx;
  614. height: 96rpx;
  615. }
  616. }
  617. .GStitle {
  618. width: 100%;
  619. color: #516d97;
  620. font-size: 28rpx;
  621. text-align: center;
  622. margin-top: -30rpx;
  623. margin-bottom: 30rpx;
  624. }
  625. }
  626. }
  627. .click-hover {
  628. background-color: #d0d0d0;
  629. }
  630. </style>