index.vue 13 KB

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