index.vue 13 KB

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