index.vue 12 KB

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