index.vue 13 KB

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