index.vue 14 KB

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