index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. <template>
  2. <view class="work-container">
  3. <view style="work-banner">
  4. <image src="../../static/images/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="../../static/images/mygc.png" v-if="item.title == '民用工程'"></image>
  11. <image class="icon-item" src="../../static/images/gygc.png" v-if="item.title == '工业工程'"></image>
  12. <image class="icon-item" src="../../static/images/szgc.png" v-if="item.title == '市政工程'"></image>
  13. <image class="icon-item" src="../../static/images/wxzy.png" v-if="item.title == '危险作业工程'"></image>
  14. <image class="icon-item" src="../../static/images/dggc.png" v-if="item.title == '顶管工程'"></image>
  15. <image class="icon-item" src="../../static/images/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="../../static/images/sn.png" class="line2-btn-big"
  37. v-if="item.dictLabel == '室内工程'"></image>
  38. <image src="../../static/images/ty.png" class="line2-btn-big"
  39. v-if="item.dictLabel == '庭院工程'"></image>
  40. <image src="../../static/images/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="../../static/images/sn2.png" class="line2-btn-big"
  60. v-if="item.dictLabel == '室内工程'"></image>
  61. <image src="../../static/images/ty2.png" class="line2-btn-big"
  62. v-if="item.dictLabel == '庭院工程'"></image>
  63. <image src="../../static/images/jk2.png" class="line2-btn-big"
  64. v-if="item.dictLabel == '架空'"></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. uni.navigateTo({
  268. url: '/pages/oldrenovation/courtyard/courtyard?params=' + encodeURIComponent(JSON
  269. .stringify(
  270. obj))
  271. })
  272. } else if (this.enginClassification == 'overhead') { //架空
  273. uni.navigateTo({
  274. url: '/pages/oldrenovation/overhead/overhead?params=' + encodeURIComponent(JSON
  275. .stringify(
  276. obj))
  277. })
  278. }
  279. } else if (this.projectType == 'GongYe') {
  280. console.log("工业", item)
  281. let obj = {
  282. value: item.dictValue
  283. };
  284. this.handleHiddenShare();
  285. uni.navigateTo({
  286. url: '/pages/enginproject/enginproject?params=' + encodeURIComponent(JSON
  287. .stringify(
  288. obj))
  289. })
  290. } else if (this.projectType == 'JiJian') {
  291. console.log("基建", item)
  292. let obj = {
  293. value: item.dictValue
  294. };
  295. this.handleHiddenShare();
  296. uni.navigateTo({
  297. url: '/pages/infrastructure/infrastructure?params=' + encodeURIComponent(JSON
  298. .stringify(
  299. obj))
  300. })
  301. } else if (this.projectType == 'DingGuan') {
  302. console.log("顶管", item)
  303. let obj = {
  304. value: item.dictValue
  305. };
  306. this.handleHiddenShare();
  307. uni.navigateTo({
  308. url: '/pages/TopPipeWork/TopPipeWork?params=' + encodeURIComponent(JSON
  309. .stringify(
  310. obj))
  311. })
  312. }
  313. },
  314. showGongYe() {
  315. this.projectType = 'GongYe';
  316. //工业工程
  317. getDicts("engin_classification").then(response => {
  318. console.log("工业工程", response.data)
  319. this.typeList = response.data;
  320. console.log("工业工程", response.data)
  321. });
  322. this.handleShowSheet();
  323. },
  324. showTopPipe() {
  325. this.projectType = 'DingGuan';
  326. getDicts("pipe_jack").then(response => {
  327. console.log("顶管工程", response.data)
  328. this.typeList = response.data;
  329. });
  330. this.handleShowSheet();
  331. },
  332. showInfrastructureDialog() {
  333. this.projectType = 'JiJian';
  334. //基建工程
  335. getDicts("engineering_infrastructure").then(response => {
  336. console.log("基建工程", response.data)
  337. this.typeList = response.data;
  338. console.log("基建工程", response.data)
  339. });
  340. this.handleShowSheet();
  341. },
  342. showDangerous() {
  343. console.log("危险作业工程")
  344. uni.navigateTo({
  345. url: '/pages/dangerous/dangerous'
  346. })
  347. },
  348. }
  349. }
  350. </script>
  351. <style lang="scss">
  352. /* #ifndef APP-NVUE */
  353. page {
  354. display: flex;
  355. flex-direction: column;
  356. box-sizing: border-box;
  357. background-color: #fff;
  358. min-height: 100%;
  359. height: auto;
  360. }
  361. view {
  362. font-size: 14px;
  363. line-height: inherit;
  364. }
  365. .work-container {
  366. display: flex;
  367. flex-direction: column;
  368. }
  369. /* #endif */
  370. .text {
  371. text-align: center;
  372. font-size: 26rpx;
  373. margin-top: 10rpx;
  374. }
  375. .grid-item-box {
  376. flex: 1;
  377. /* #ifndef APP-NVUE */
  378. display: flex;
  379. /* #endif */
  380. flex-direction: column;
  381. align-items: center;
  382. justify-content: center;
  383. padding: 15px 0;
  384. }
  385. .uni-margin-wrap {
  386. width: 690rpx;
  387. width: 100%;
  388. ;
  389. }
  390. .swiper {
  391. height: 300rpx;
  392. }
  393. .swiper-box {
  394. height: 150px;
  395. }
  396. .swiper-item {
  397. /* #ifndef APP-NVUE */
  398. display: flex;
  399. /* #endif */
  400. flex-direction: column;
  401. justify-content: center;
  402. align-items: center;
  403. color: #fff;
  404. height: 300rpx;
  405. line-height: 300rpx;
  406. }
  407. @media screen and (min-width: 500px) {
  408. .uni-swiper-dot-box {
  409. width: 400px;
  410. /* #ifndef APP-NVUE */
  411. margin: 0 auto;
  412. /* #endif */
  413. margin-top: 8px;
  414. }
  415. .image {
  416. width: 100%;
  417. }
  418. }
  419. // 弹窗效果
  420. .popup {
  421. position: fixed;
  422. bottom: 0;
  423. left: 0;
  424. width: 100%;
  425. background-color: #fff;
  426. // padding: 20rpx;
  427. box-sizing: border-box;
  428. z-index: 999;
  429. border-top-left-radius: 40rpx;
  430. border-top-right-radius: 40rpx;
  431. }
  432. // 遮罩层
  433. .mask {
  434. position: fixed;
  435. top: 0;
  436. left: 0;
  437. width: 100%;
  438. height: 100%;
  439. background-color: rgba(0, 0, 0, 0.5);
  440. z-index: 888;
  441. }
  442. // 弹窗内容
  443. .content {
  444. .top40 {
  445. margin-top: 30rpx;
  446. }
  447. .line1 {
  448. text-align: center;
  449. display: flex;
  450. justify-content: start;
  451. align-items: center;
  452. padding: 20rpx;
  453. }
  454. .btn-grp {
  455. display: flex;
  456. .btn-grp-item {
  457. width: 33%;
  458. display: flex;
  459. flex-direction: column;
  460. align-items: center;
  461. .line2-btn-big {
  462. width: 128rpx;
  463. height: 128rpx;
  464. margin-bottom: 10rpx;
  465. }
  466. }
  467. }
  468. .line2 {
  469. padding: 20rpx;
  470. // border-bottom: 1px solid black;
  471. view {
  472. margin-bottom: 10rpx;
  473. }
  474. }
  475. }
  476. // 按钮样式
  477. .btn-group {
  478. box-shadow: 0px -2px 6px rgba(0, 0, 0, 0.5);
  479. /* 示例阴影参数,根据需要进行调整 */
  480. .btn_position {
  481. display: flex;
  482. width: 100%;
  483. .cancel {
  484. width: 50%;
  485. text-align: center;
  486. padding: 20rpx 0;
  487. color: #519fe7;
  488. }
  489. .submit {
  490. width: 50%;
  491. background-color: #519fe7;
  492. text-align: center;
  493. padding: 20rpx 0;
  494. color: #fff;
  495. }
  496. }
  497. }
  498. .share {
  499. width: 100%;
  500. height: 100%;
  501. }
  502. .share-box {
  503. width: 100%;
  504. height: 100%;
  505. position: fixed;
  506. top: 0rpx;
  507. left: 0rpx;
  508. bottom: 0rpx;
  509. right: 0rpx;
  510. background-color: rgba(0, 0, 0, 0.4);
  511. transition: .3s;
  512. z-index: 999;
  513. }
  514. // 进入分享动画
  515. .share-show {
  516. transition: all 0.3s ease;
  517. transform: translateY(0%) !important;
  518. }
  519. .scroll-Y {
  520. height: 350rpx;
  521. }
  522. // 离开分享动画
  523. .share-item {
  524. position: fixed;
  525. left: 0;
  526. bottom: 0;
  527. width: 100%;
  528. height: auto;
  529. background-color: #FFFFFF;
  530. transition: all 0.3s ease;
  531. transform: translateY(100%);
  532. z-index: 1999;
  533. border-top-left-radius: 40rpx;
  534. border-top-right-radius: 40rpx;
  535. .share-to {
  536. width: 100%;
  537. height: 3rem;
  538. display: flex;
  539. justify-content: center;
  540. align-items: center;
  541. &::after {
  542. content: '';
  543. width: 240rpx;
  544. height: 0rpx;
  545. border-top: 1px solid #E4E7ED;
  546. -webkit-transform: scaleY(0.5);
  547. transform: scaleY(0.5);
  548. margin-left: 30rpx;
  549. }
  550. &::before {
  551. content: '';
  552. width: 240rpx;
  553. height: 0rpx;
  554. border-top: 1px solid #E4E7ED;
  555. -webkit-transform: scaleY(0.5);
  556. transform: scaleY(0.5);
  557. margin-right: 30rpx;
  558. }
  559. }
  560. .content {
  561. width: 100%;
  562. height: 50%;
  563. display: flex;
  564. flex-wrap: wrap;
  565. .block {
  566. width: 100%;
  567. display: flex;
  568. flex-direction: column;
  569. justify-content: center;
  570. align-items: center;
  571. height: 80rpx;
  572. text {
  573. margin-top: 16rpx;
  574. font-size: 28rpx;
  575. color: #606266;
  576. }
  577. }
  578. }
  579. .cancel {
  580. width: 100%;
  581. height: 3rem;
  582. display: flex;
  583. justify-content: center;
  584. align-items: center;
  585. border-top: 1rpx solid #E4E7ED;
  586. }
  587. }
  588. /*********************九宫格********************* */
  589. .Grid {
  590. display: flex;
  591. flex-wrap: wrap;
  592. justify-content: space-between;
  593. align-content: space-between;
  594. // background: #f7f7f7;
  595. padding: 10rpx 0;
  596. .Grid-Item {
  597. width: 50%;
  598. // height: 100px;
  599. text-align: center;
  600. // border: 1rpx solid #ff0000;
  601. box-sizing: border-box;
  602. .icon-item {
  603. width: 220rpx;
  604. height: 220rpx;
  605. }
  606. .GSimg {
  607. width: 96rpx;
  608. height: 96rpx;
  609. margin-top: 42rpx;
  610. margin-left: 75rpx;
  611. .Image {
  612. width: 96rpx;
  613. height: 96rpx;
  614. }
  615. }
  616. .GStitle {
  617. width: 100%;
  618. color: #000;
  619. font-size: 24rpx;
  620. text-align: center;
  621. margin-top: -30rpx;
  622. margin-bottom: 30rpx;
  623. }
  624. }
  625. }
  626. .click-hover {
  627. background-color: #d0d0d0;
  628. }
  629. </style>