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