index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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">
  60. <view @click="Indoor(0)">室内</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">
  68. <view @click="Indoor(1)">室内</view>
  69. <view @click="Courtyard(1)">庭院</view>
  70. <view @click="Overhead(1)">架空</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>
  82. </view>
  83. </template>
  84. <script>
  85. export default {
  86. data() {
  87. return {
  88. showPopup: false,
  89. current: 0,
  90. swiperDotIndex: 0,
  91. data: [{
  92. image: '/static/images/banner/banner01.jpg'
  93. },
  94. {
  95. image: '/static/images/banner/banner02.jpg'
  96. },
  97. {
  98. image: '/static/images/banner/banner03.jpg'
  99. }
  100. ]
  101. }
  102. },
  103. methods: {
  104. clickBannerItem(item) {
  105. console.info(item)
  106. },
  107. changeSwiper(e) {
  108. this.current = e.detail.current
  109. },
  110. changeGrid(e) {
  111. this.$modal.showToast('模块建设中~')
  112. },
  113. showMinYong() {
  114. this.showPopup = !this.showPopup;
  115. },
  116. //室内
  117. Indoor(e) {
  118. if (e == 0) {
  119. //旧改
  120. this.showTypeSheet(0);
  121. } else if (e == 1) {
  122. //新建
  123. this.showTypeSheet(1);
  124. }
  125. },
  126. //庭院
  127. Courtyard(e) {
  128. if (e === 0) {
  129. this.showTypeSheet(0);
  130. //旧改
  131. } else if (e == 1) {
  132. //新建
  133. this.showTypeSheet(1);
  134. }
  135. },
  136. //架空
  137. Overhead(e) {
  138. if (e == 0) {
  139. //旧改
  140. this.showTypeSheet(0);
  141. } else if (e == 1) {
  142. //新建
  143. this.showTypeSheet(1);
  144. }
  145. },
  146. //二次弹窗 选择类型
  147. showTypeSheet(e) {
  148. uni.showActionSheet({
  149. itemList: ['拆旧管', '立杠', '挂表', '表后管', '阀管'],
  150. success: (res) => {
  151. console.log('选择了第' + (res.tapIndex + 1) + '个选项');
  152. if (e == 0 && res.tapIndex == 0) {
  153. uni.navigateTo({
  154. url: '/pages/oldrenovation/indoor/tearOldPipe'
  155. })
  156. }
  157. if (e == 0 && res.tapIndex == 1) {
  158. uni.navigateTo({
  159. url: '/pages/oldrenovation/indoor/verticalBar'
  160. })
  161. }
  162. if (e == 0 && res.tapIndex == 2) {
  163. uni.navigateTo({
  164. url: '/pages/oldrenovation/indoor/putUpWatch'
  165. })
  166. }
  167. if (e == 0 && res.tapIndex == 3) {
  168. uni.navigateTo({
  169. url: '/pages/oldrenovation/indoor/watchAfterPipe'
  170. })
  171. }
  172. if (e == 0 && res.tapIndex == 4) {
  173. uni.navigateTo({
  174. url: '/pages/oldrenovation/indoor/valveTube'
  175. })
  176. }
  177. },
  178. fail: (err) => {
  179. console.log('弹窗取消');
  180. }
  181. });
  182. }
  183. }
  184. }
  185. </script>
  186. <style lang="scss">
  187. /* #ifndef APP-NVUE */
  188. page {
  189. display: flex;
  190. flex-direction: column;
  191. box-sizing: border-box;
  192. background-color: #fff;
  193. min-height: 100%;
  194. height: auto;
  195. }
  196. view {
  197. font-size: 14px;
  198. line-height: inherit;
  199. }
  200. /* #endif */
  201. .text {
  202. text-align: center;
  203. font-size: 26rpx;
  204. margin-top: 10rpx;
  205. }
  206. .grid-item-box {
  207. flex: 1;
  208. /* #ifndef APP-NVUE */
  209. display: flex;
  210. /* #endif */
  211. flex-direction: column;
  212. align-items: center;
  213. justify-content: center;
  214. padding: 15px 0;
  215. }
  216. .uni-margin-wrap {
  217. width: 690rpx;
  218. width: 100%;
  219. ;
  220. }
  221. .swiper {
  222. height: 300rpx;
  223. }
  224. .swiper-box {
  225. height: 150px;
  226. }
  227. .swiper-item {
  228. /* #ifndef APP-NVUE */
  229. display: flex;
  230. /* #endif */
  231. flex-direction: column;
  232. justify-content: center;
  233. align-items: center;
  234. color: #fff;
  235. height: 300rpx;
  236. line-height: 300rpx;
  237. }
  238. @media screen and (min-width: 500px) {
  239. .uni-swiper-dot-box {
  240. width: 400px;
  241. /* #ifndef APP-NVUE */
  242. margin: 0 auto;
  243. /* #endif */
  244. margin-top: 8px;
  245. }
  246. .image {
  247. width: 100%;
  248. }
  249. }
  250. // 弹窗效果
  251. .popup {
  252. position: fixed;
  253. bottom: 0;
  254. left: 0;
  255. width: 100%;
  256. background-color: #fff;
  257. // padding: 20rpx;
  258. box-sizing: border-box;
  259. z-index: 999;
  260. }
  261. // 遮罩层
  262. .mask {
  263. position: fixed;
  264. top: 0;
  265. left: 0;
  266. width: 100%;
  267. height: 100%;
  268. background-color: rgba(0, 0, 0, 0.5);
  269. z-index: 888;
  270. }
  271. // 弹窗内容
  272. .content {
  273. .line1 {
  274. background-color: #6ea8e7;
  275. text-align: center;
  276. padding: 20rpx;
  277. }
  278. .line2 {
  279. padding: 20rpx;
  280. // border-bottom: 1px solid black;
  281. view {
  282. margin-bottom: 10rpx;
  283. }
  284. }
  285. }
  286. // 按钮样式
  287. .btn-group {
  288. box-shadow: 0px -2px 6px rgba(0, 0, 0, 0.5);
  289. /* 示例阴影参数,根据需要进行调整 */
  290. .btn_position {
  291. display: flex;
  292. width: 100%;
  293. .cancel {
  294. width: 50%;
  295. text-align: center;
  296. padding: 20rpx 0;
  297. color: #519fe7;
  298. }
  299. .submit {
  300. width: 50%;
  301. background-color: #519fe7;
  302. text-align: center;
  303. padding: 20rpx 0;
  304. color: #fff;
  305. }
  306. }
  307. }
  308. </style>