index.vue 11 KB

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