index.vue 11 KB

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