index.vue 11 KB

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