index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. <template>
  2. <view class="content">
  3. <top-title
  4. :titleValue="title"
  5. :pageScroll="scrollVal"
  6. :btnTop="btnPos"
  7. style="width: 100%"
  8. ></top-title>
  9. <view class="page-section-spacing" style="width: 100%; position: relative">
  10. <view class="content-box">
  11. <view class="content-font"> </view>
  12. <view class="call-font"> </view>
  13. </view>
  14. <swiper
  15. class="swiper"
  16. indicator-dots="false"
  17. autoplay="true"
  18. duration="500"
  19. style="height: 440rpx"
  20. >
  21. <swiper-item
  22. v-for="(item, index) in swiperList"
  23. :key="index"
  24. class="swiper-content"
  25. >
  26. <image :src="item.img" mode="aspectFill" style="width: 100%; height: 100%"></image>
  27. </swiper-item>
  28. </swiper>
  29. <image src="../../static/Intersect.svg" class="groove-img"></image>
  30. <view class="rowDot">
  31. <view v-for="(item, index) in swiperList" :key="index" class="dots">
  32. <view
  33. :class="['dot', index === swiperCurrent ? 'active' : '']"
  34. ></view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="page-nav-box">
  39. <view v-for="(item, index) in navList" :key="index" class="nav-content" @click="goOtherPage(item)">
  40. <image :src="item.url" mode="aspectFit" style="width: 38px; height: 38px"></image>
  41. <view>{{ item.content }}</view>
  42. </view>
  43. </view>
  44. <view class="notice-box" style="width:90%;">
  45. <view class="notice-title-box" style="margin: 0 auto;margin-bottom: 30rpx;">
  46. <view class="notice-font">缴费订单</view>
  47. <view class="notice-more-font">
  48. <view style="margin-right: 8rpx; font-size: 26rpx" @click="goPayList">更多</view>
  49. <image
  50. src="/static/right-arrow-blue.png"
  51. mode="aspectFill"
  52. style="width: 12rpx; height: 16rpx"
  53. ></image>
  54. </view>
  55. </view>
  56. <view
  57. class="notice-content-box"
  58. v-for="(item, index) in heatList"
  59. :key="index"
  60. style="justify-content: start; padding: 30rpx 0 30rpx 30rpx;border-radius: 0;"
  61. @click="goPayDeatil(item.code)" >
  62. <image
  63. src="/static/order-poster.svg"
  64. style="
  65. width: 112rpx;
  66. height: 112rpx;
  67. margin-right: 20rpx;
  68. border-radius: 10%;
  69. "
  70. ></image>
  71. <view class="notice-content" style="width: 75%">
  72. <view class="notice-content-font">{{
  73. item.name
  74. }}</view>
  75. <view class="display-flex-start" style="margin-top: 20rpx">
  76. <view class="notice-content-time color-a7adba">
  77. {{item.estate_name + item.building_name + item.unit + item.room}}
  78. </view>
  79. <view class="notice-content-time display-flex-start">
  80. <text class="color-a7adba">¥:</text>
  81. <text class="order-money">{{item.total_fee}}</text>
  82. </view>
  83. </view>
  84. <view class="display-between" style="margin-top: 20rpx">
  85. <view class="notice-content-time color-a7adba" style="visibility: hidden;">
  86. {{item.time}}
  87. </view>
  88. <view class="display-flex-start">
  89. <view class="notice-content-time" :style="{color:statusColor[item.status]}">{{statusObj[item.status]}}</view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. <view class="noLogin-box" v-if="owner_id == 0">
  95. <view>{{!isAuth ? '未登录': '未关联'}}</view>
  96. <view>{{!isAuth ? '请先完成授权登录': '请先完成关联住房'}}</view>
  97. <view class="withHouseBtn" @click="goHouse" v-show="isAuth">关联住房</view>
  98. <button type='primary' class="withHouseBtn" v-show="!isAuth" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权登录</button>
  99. </view>
  100. </view>
  101. <foot-tabs :selectedIndex="0" :isShow="footFlag"></foot-tabs>
  102. </view>
  103. </template>
  104. <script>
  105. import md5 from "@/common/md5.js";
  106. import topTitle from "@/components/top-title/top-title.vue";
  107. import footTabs from "@/components/foot-tabs/footTabs.vue";
  108. export default {
  109. components: {
  110. "foot-tabs": footTabs,
  111. "top-title": topTitle,
  112. },
  113. data() {
  114. return {
  115. title: "",
  116. isAuth: true,
  117. scrollVal: Number,
  118. footFlag: true,
  119. btnPos:uni.getMenuButtonBoundingClientRect().top + 6,
  120. shareImgUrl:'',
  121. swiperList: [
  122. {
  123. img: "/static/cainuan.jpeg",
  124. },
  125. /*
  126. {
  127. img: "/static/poster-bg.png",
  128. },
  129. */
  130. ],
  131. swiperCurrent: 0,
  132. navList: [
  133. {
  134. url: "/static/navList/appeal.png",
  135. path: "/pages/heatingPage/list",
  136. content: "供暖缴费",
  137. },
  138. {
  139. url: "/static/navList/policy.png",
  140. path: "/pages/heatingPage/reportFix",
  141. content: "一键报修",
  142. },
  143. ],
  144. heatList: [],
  145. statusObj:getApp().globalData.statusObj,
  146. statusColor:getApp().globalData.statusColor,
  147. owner_id : 0,
  148. };
  149. },
  150. onShow() {
  151. uni.hideTabBar({});
  152. this.isAuth = getApp().globalData.isAuth;
  153. this.getHeatList();
  154. },
  155. onLoad() {
  156. // uni.showLoading({
  157. // title: "加载中",
  158. // mask: true,
  159. // });
  160. //this.getSwiperList();
  161. },
  162. onShareAppMessage() {
  163. // url: "/pages/index/index";
  164. return {
  165. title: '缴费系统',
  166. path: '/pages/index/index',
  167. imageUrl:'/static/shareImg2.png',
  168. }
  169. },
  170. methods: {
  171. getPhoneNumber(e){
  172. let res = getApp().getPhoneNumber(e);
  173. if (res){
  174. this.goHouse();
  175. }
  176. },
  177. swiperChange(e) {
  178. this.swiperCurrent = e.detail.current;
  179. },
  180. goOtherPage(item){
  181. if(!this.isAuth){
  182. uni.showToast({
  183. title: "您还没有登录授权",
  184. duration: 2500,
  185. icon: "none",
  186. });
  187. return;
  188. }
  189. uni.navigateTo({
  190. url:item.path
  191. })
  192. },
  193. getSwiperList() {
  194. let that = this;
  195. let url = getApp().makeApiUrl("common","main_pics","list");
  196. uni.request({
  197. url: url,
  198. method: "POST",
  199. header: {
  200. "content-type": "application/x-www-form-urlencoded",
  201. },
  202. data: {
  203. order_by: "weight desc",
  204. s_status: 1,
  205. page: 1,
  206. page_size: 7,
  207. },
  208. success: (res) => {
  209. console.log(res);
  210. if (res.data.code === 200) {
  211. res.data.data.list.forEach((item) => {
  212. item.pic_path = getApp().globalData.shareUrl + item.pic_path;
  213. });
  214. that.swiperList = res.data.data.list;
  215. that.owner_id = res.data.data.owner_id;
  216. // this.shareImgUrl = res.data.data.list[0].pic_path
  217. }
  218. },
  219. fail: () => {
  220. console.log("连接失败");
  221. },
  222. });
  223. },
  224. getHeatList() {
  225. let url = getApp().makeApiUrl("user",'user','get_order_list');
  226. let postData = {
  227. // page: 1,
  228. // page_size: 2,
  229. openId:getApp().globalData.open_id ? getApp().globalData.open_id : uni.getStorageSync('openId')
  230. };
  231. uni.request({
  232. url: url,
  233. method: "POST",
  234. header: {
  235. "content-type": "application/x-www-form-urlencoded",
  236. },
  237. data: postData,
  238. success: (res) => {
  239. console.log(res);
  240. if (res.data.code === 200) {
  241. this.heatList = res.data.data.list;
  242. this.owner_id = res.data.data.owner_id;
  243. }
  244. },
  245. fail: () => {
  246. console.log("连接失败");
  247. },
  248. });
  249. },
  250. goPayDeatil(id) {
  251. uni.navigateTo({
  252. url: "/pages/heatingPage/pay?id=" + id,
  253. });
  254. },
  255. goHouse(){
  256. uni.navigateTo({
  257. url: "/pages/selfCenter/with_house",
  258. });
  259. },
  260. goAuth() {
  261. uni.navigateTo({
  262. url: "/pages/auth/index",
  263. });
  264. },
  265. goPayList() {
  266. if(!this.isAuth){
  267. uni.showToast({
  268. title: "您还没有登录授权",
  269. duration: 2500,
  270. icon: "none",
  271. });
  272. return;
  273. }
  274. uni.navigateTo({
  275. url: "/pages/heatingPage/list",
  276. });
  277. },
  278. },
  279. onPageScroll(e) {
  280. this.scrollVal = e.scrollTop;
  281. if (e.scrollTop < uni.getSystemInfoSync().windowHeight) {
  282. this.footFlag = true;
  283. }
  284. },
  285. onReachBottom(e) {
  286. this.footFlag = false;
  287. }
  288. };
  289. </script>
  290. <style>
  291. .unclick {
  292. background-color: #bfbfbf !important;
  293. }
  294. .content {
  295. display: flex;
  296. flex-direction: column;
  297. align-items: center;
  298. justify-content: center;
  299. position: relative;
  300. }
  301. .logo {
  302. height: 200rpx;
  303. width: 200rpx;
  304. margin-top: 200rpx;
  305. margin-left: auto;
  306. margin-right: auto;
  307. margin-bottom: 50rpx;
  308. }
  309. .text-area {
  310. display: flex;
  311. justify-content: center;
  312. }
  313. .title {
  314. font-size: 36rpx;
  315. color: #8f8f94;
  316. }
  317. .groove-img {
  318. width: 100%;
  319. height: 100rpx;
  320. bottom: -22rpx;
  321. position: absolute;
  322. }
  323. .rowDot {
  324. display: flex;
  325. position: absolute;
  326. top: 310rpx;
  327. left: 80rpx;
  328. }
  329. .dots {
  330. flex-direction: row;
  331. justify-content: center;
  332. align-items: center;
  333. align-content: center;
  334. }
  335. .dot {
  336. margin-right: 8rpx;
  337. width: 40rpx;
  338. height: 8rpx;
  339. opacity: 1;
  340. border-radius: 6rpx;
  341. background: #fff5f9;
  342. }
  343. .dot.active {
  344. background: #ff4e54;
  345. }
  346. /* .swiper-content { */
  347. /* border-radius: 0 0 10% 10%; */
  348. /* } */
  349. .page-nav-box {
  350. width: 88%;
  351. height: 180rpx;
  352. display: flex;
  353. flex-wrap: wrap;
  354. justify-content: space-around;
  355. align-items: center;
  356. padding: 20rpx 10rpx 30rpx 10rpx;
  357. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
  358. border-radius: 16rpx;
  359. position: absolute;
  360. top: 360rpx;
  361. background-color: #fff;
  362. }
  363. .nav-content {
  364. width: 25%;
  365. height: 130rpx;
  366. display: flex;
  367. flex-direction: column;
  368. align-items: center;
  369. margin-top: 20rpx;
  370. font-size: 28rpx;
  371. justify-content: space-around;
  372. letter-spacing: 0.02em;
  373. color: #0d1937;
  374. font-family: PingFang SC;
  375. font-style: normal;
  376. /* font-weight: 600; */
  377. }
  378. .notice-box {
  379. width: 90%;
  380. margin-top: 200rpx;
  381. margin-bottom: 20rpx;
  382. }
  383. .notice-title-box {
  384. width: 100%;
  385. display: flex;
  386. justify-content: space-between;
  387. align-items: center;
  388. margin-bottom: 40rpx;
  389. }
  390. .notice-font {
  391. font-family: PingFang SC;
  392. font-style: normal;
  393. font-weight: bold;
  394. font-size: 38rpx;
  395. letter-spacing: 0.02em;
  396. color: #0d1937;
  397. }
  398. .notice-more-font {
  399. font-size: 28rpx;
  400. color: #146afb;
  401. display: flex;
  402. align-items: center;
  403. }
  404. .notice-content-box {
  405. display: flex;
  406. padding: 30rpx 20rpx 30rpx 20rpx;
  407. background-color: #ffffff;
  408. box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  409. border-radius: 32rpx;
  410. margin-top: 20rpx;
  411. justify-content: space-between;
  412. }
  413. .maskModal {
  414. width: 100%;
  415. position: absolute;
  416. background-color: rgba(0, 0, 0, 0.4);
  417. border-radius: 32rpx;
  418. height: 100%;
  419. top: 0;
  420. right: 0;
  421. display: flex;
  422. align-items: center;
  423. justify-content: center;
  424. color: #fff;
  425. font-size: 32rpx;
  426. font-weight: bold;
  427. }
  428. .notice-content-font {
  429. font-size: 32rpx;
  430. color: #0d1937;
  431. /* font-weight: 600; */
  432. overflow: hidden;
  433. text-overflow: ellipsis;
  434. white-space: nowrap;
  435. }
  436. .notice-content-time {
  437. font-size: 26rpx;
  438. letter-spacing: 0.02em;
  439. color: #cfcfcf;
  440. }
  441. .park-box {
  442. border-radius: 32rpx;
  443. margin-right: 20rpx;
  444. position: relative;
  445. height: 500rpx;
  446. }
  447. .park-content-box {
  448. width: 394rpx;
  449. background-color: #ffffff;
  450. border-radius: 56rpx 0px 32rpx 32rpx;
  451. position: absolute;
  452. top: 210rpx;
  453. font-size: 30rpx;
  454. padding: 30rpx;
  455. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
  456. }
  457. .park-title {
  458. /* font-weight: 600; */
  459. line-height: 36rpx;
  460. letter-spacing: 0.02em;
  461. color: #0d1937;
  462. }
  463. .park-address {
  464. /* font-weight: 600; */
  465. font-size: 26rpx;
  466. letter-spacing: 0.02em;
  467. color: #cfcfcf;
  468. margin-top: 10rpx;
  469. }
  470. .park-title-img {
  471. width: 16rpx;
  472. height: 16rpx;
  473. margin-right: 4rpx;
  474. }
  475. .park-footer-box {
  476. margin-top: 30rpx;
  477. }
  478. .park-footer-img {
  479. width: 24rpx;
  480. height: 24rpx;
  481. margin-right: 6rpx;
  482. }
  483. .park-footer-font {
  484. color: #cfcfcf;
  485. font-size: 24rpx;
  486. margin-top: 10rpx;
  487. }
  488. .width-30 {
  489. width: 30%;
  490. }
  491. .attract-content {
  492. color: #697594;
  493. /* font-weight: 600; */
  494. font-size: 24rpx;
  495. margin-top: 8rpx;
  496. overflow: hidden;
  497. text-overflow: ellipsis;
  498. white-space: nowrap;
  499. }
  500. .online-box {
  501. width: 12rpx;
  502. height: 12rpx;
  503. border-radius: 50%;
  504. background-color: #589cff;
  505. margin-right: 5rpx;
  506. }
  507. .offline-box {
  508. width: 12rpx;
  509. height: 12rpx;
  510. border-radius: 50%;
  511. background-color: #ffcf86;
  512. margin-right: 5rpx;
  513. }
  514. .color-a7adba {
  515. color: #a7adba;
  516. }
  517. .content-box {
  518. position: absolute;
  519. width: 100%;
  520. top: 150rpx;
  521. display: flex;
  522. flex-direction: column;
  523. z-index: 999;
  524. justify-content: space-around;
  525. height: 80px;
  526. align-items: center;
  527. }
  528. .content-font {
  529. color: #fff;
  530. font-weight: bold;
  531. font-size: 40rpx;
  532. }
  533. .call-font {
  534. color: #fff;
  535. font-size: 32rpx;
  536. }
  537. .order-money {
  538. color: #d9001b;
  539. font-size: 36rpx;
  540. font-weight: 500;
  541. }
  542. .noLogin-box {
  543. width: 100%;
  544. display: flex;
  545. flex-direction: column;
  546. justify-content: space-between;
  547. align-items: center;
  548. margin-top: 160rpx;
  549. color: #a7adba;
  550. }
  551. .withHouseBtn {
  552. color: #589cff;
  553. cursor: pointer;
  554. margin-top: 40rpx;
  555. }
  556. </style>