index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  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 v-show="isShow">{{!isAuth ? '未登录': '未关联'}}</view>
  96. <view v-show="isShow">{{!isAuth ? '请先完成授权登录': '请先完成关联住房'}}</view>
  97. <view class="withHouseBtn" @click="goHouse" v-show="isAuth && isShow">关联住房</view>
  98. <button type='primary' class="withHouseBtn" v-show="!isAuth && isShow" 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: false,
  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. isShow : false,
  149. };
  150. },
  151. onShow() {
  152. uni.hideTabBar({});
  153. let that = this;
  154. this.isAuth = getApp().globalData.isAuth;
  155. if (this.isAuth){
  156. that.getHeatList();
  157. }
  158. else{
  159. this.reset();
  160. setTimeout(function() {
  161. that.getUserInfo();
  162. }, 100);
  163. setTimeout(function() {
  164. that.getUserInfo();
  165. }, 500);
  166. setTimeout(function() {
  167. that.getUserInfo();
  168. }, 800);
  169. setTimeout(function() {
  170. that.getUserInfo();
  171. }, 1000);
  172. setTimeout(function() {
  173. that.getUserInfo();
  174. }, 1500);
  175. setTimeout(function() {
  176. that.getUserInfo();
  177. }, 2000);
  178. }
  179. },
  180. onLoad() {
  181. // uni.showLoading({
  182. // title: "加载中",
  183. // mask: true,
  184. // });
  185. //this.getSwiperList();
  186. //this.getUserInfo();
  187. //this.getUserInfo();
  188. this.isAuth = getApp().globalData.isAuth;
  189. if (this.isAuth){
  190. that.getHeatList();
  191. }
  192. },
  193. onShareAppMessage() {
  194. // url: "/pages/index/index";
  195. return {
  196. title: '缴费系统',
  197. path: '/pages/index/index',
  198. imageUrl:'/static/shareImg2.png',
  199. }
  200. },
  201. methods: {
  202. reset(){
  203. this.isAuth = false;
  204. this.owner_id = 0;
  205. this.isShow = false;
  206. this.heatList = [];
  207. },
  208. getUserInfo(){
  209. let openId = getApp().globalData.open_id ? getApp().globalData.open_id : uni.getStorageSync('openId');
  210. if (this.isShow || openId === ''){
  211. return;
  212. }
  213. let that = this;
  214. let url = getApp().makeApiUrl("user",'user','info_by_openid');
  215. uni.request({
  216. url:url,
  217. method: 'POST',
  218. header: {
  219. 'content-type': 'application/x-www-form-urlencoded'
  220. },
  221. data: {
  222. openId: openId
  223. },
  224. success: (res) => {
  225. console.log(res)
  226. if(res.data.code === 200){
  227. if (res.data.data.phone === ''){
  228. //必须有手机号才算登录成功,系统才可用。
  229. // console.log("res.data.data.phone="+res.data.data.phone);
  230. getApp().globalData.isAuth = false;
  231. that.isAuth = false;
  232. }
  233. else{
  234. getApp().globalData.isAuth = true;
  235. that.isAuth = true;
  236. if (res.data.data.owner_id > 0){
  237. that.owner_id = res.data.data.owner_id;
  238. }
  239. that.getHeatList();
  240. }
  241. that.isShow = true;
  242. // uni.hideLoading()
  243. }
  244. },
  245. fail: () => {
  246. console.log("连接失败");
  247. }
  248. });
  249. },
  250. getPhoneNumber(e){
  251. let res = getApp().getPhoneNumber(e);
  252. if (res){
  253. this.isShow = false;
  254. this.goHouse();
  255. }
  256. },
  257. swiperChange(e) {
  258. this.swiperCurrent = e.detail.current;
  259. },
  260. goOtherPage(item){
  261. if(!this.isAuth){
  262. uni.showToast({
  263. title: "您还没有登录授权",
  264. duration: 2500,
  265. icon: "none",
  266. });
  267. return;
  268. }
  269. uni.navigateTo({
  270. url:item.path
  271. })
  272. },
  273. getSwiperList() {
  274. let that = this;
  275. let url = getApp().makeApiUrl("common","main_pics","list");
  276. uni.request({
  277. url: url,
  278. method: "POST",
  279. header: {
  280. "content-type": "application/x-www-form-urlencoded",
  281. },
  282. data: {
  283. order_by: "weight desc",
  284. s_status: 1,
  285. page: 1,
  286. page_size: 7,
  287. },
  288. success: (res) => {
  289. console.log(res);
  290. if (res.data.code === 200) {
  291. res.data.data.list.forEach((item) => {
  292. item.pic_path = getApp().globalData.shareUrl + item.pic_path;
  293. });
  294. that.swiperList = res.data.data.list;
  295. that.owner_id = res.data.data.owner_id;
  296. // this.shareImgUrl = res.data.data.list[0].pic_path
  297. }
  298. },
  299. fail: () => {
  300. console.log("连接失败");
  301. },
  302. });
  303. },
  304. getHeatList() {
  305. let url = getApp().makeApiUrl("user",'user','get_order_list');
  306. let postData = {
  307. // page: 1,
  308. // page_size: 2,
  309. openId:getApp().globalData.open_id ? getApp().globalData.open_id : uni.getStorageSync('openId')
  310. };
  311. let that = this;
  312. uni.request({
  313. url: url,
  314. method: "POST",
  315. header: {
  316. "content-type": "application/x-www-form-urlencoded",
  317. },
  318. data: postData,
  319. success: (res) => {
  320. console.log(res);
  321. if (res.data.code === 200) {
  322. that.heatList = res.data.data.list;
  323. that.owner_id = res.data.data.owner_id;
  324. }
  325. },
  326. fail: () => {
  327. console.log("连接失败");
  328. },
  329. });
  330. },
  331. goPayDeatil(id) {
  332. uni.navigateTo({
  333. url: "/pages/heatingPage/pay?id=" + id,
  334. });
  335. },
  336. goHouse(){
  337. uni.navigateTo({
  338. url: "/pages/selfCenter/with_house",
  339. });
  340. },
  341. goAuth() {
  342. uni.navigateTo({
  343. url: "/pages/auth/index",
  344. });
  345. },
  346. goPayList() {
  347. if(!this.isAuth){
  348. uni.showToast({
  349. title: "您还没有登录授权",
  350. duration: 2500,
  351. icon: "none",
  352. });
  353. return;
  354. }
  355. uni.navigateTo({
  356. url: "/pages/heatingPage/list",
  357. });
  358. },
  359. },
  360. onPageScroll(e) {
  361. this.scrollVal = e.scrollTop;
  362. if (e.scrollTop < uni.getSystemInfoSync().windowHeight) {
  363. this.footFlag = true;
  364. }
  365. },
  366. onReachBottom(e) {
  367. this.footFlag = false;
  368. }
  369. };
  370. </script>
  371. <style>
  372. .unclick {
  373. background-color: #bfbfbf !important;
  374. }
  375. .content {
  376. display: flex;
  377. flex-direction: column;
  378. align-items: center;
  379. justify-content: center;
  380. position: relative;
  381. }
  382. .logo {
  383. height: 200rpx;
  384. width: 200rpx;
  385. margin-top: 200rpx;
  386. margin-left: auto;
  387. margin-right: auto;
  388. margin-bottom: 50rpx;
  389. }
  390. .text-area {
  391. display: flex;
  392. justify-content: center;
  393. }
  394. .title {
  395. font-size: 36rpx;
  396. color: #8f8f94;
  397. }
  398. .groove-img {
  399. width: 100%;
  400. height: 100rpx;
  401. bottom: -22rpx;
  402. position: absolute;
  403. }
  404. .rowDot {
  405. display: flex;
  406. position: absolute;
  407. top: 310rpx;
  408. left: 80rpx;
  409. }
  410. .dots {
  411. flex-direction: row;
  412. justify-content: center;
  413. align-items: center;
  414. align-content: center;
  415. }
  416. .dot {
  417. margin-right: 8rpx;
  418. width: 40rpx;
  419. height: 8rpx;
  420. opacity: 1;
  421. border-radius: 6rpx;
  422. background: #fff5f9;
  423. }
  424. .dot.active {
  425. background: #ff4e54;
  426. }
  427. /* .swiper-content { */
  428. /* border-radius: 0 0 10% 10%; */
  429. /* } */
  430. .page-nav-box {
  431. width: 88%;
  432. height: 180rpx;
  433. display: flex;
  434. flex-wrap: wrap;
  435. justify-content: space-around;
  436. align-items: center;
  437. padding: 20rpx 10rpx 30rpx 10rpx;
  438. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
  439. border-radius: 16rpx;
  440. position: absolute;
  441. top: 360rpx;
  442. background-color: #fff;
  443. }
  444. .nav-content {
  445. width: 25%;
  446. height: 130rpx;
  447. display: flex;
  448. flex-direction: column;
  449. align-items: center;
  450. margin-top: 20rpx;
  451. font-size: 28rpx;
  452. justify-content: space-around;
  453. letter-spacing: 0.02em;
  454. color: #0d1937;
  455. font-family: PingFang SC;
  456. font-style: normal;
  457. /* font-weight: 600; */
  458. }
  459. .notice-box {
  460. width: 90%;
  461. margin-top: 200rpx;
  462. margin-bottom: 20rpx;
  463. }
  464. .notice-title-box {
  465. width: 100%;
  466. display: flex;
  467. justify-content: space-between;
  468. align-items: center;
  469. margin-bottom: 40rpx;
  470. }
  471. .notice-font {
  472. font-family: PingFang SC;
  473. font-style: normal;
  474. font-weight: bold;
  475. font-size: 38rpx;
  476. letter-spacing: 0.02em;
  477. color: #0d1937;
  478. }
  479. .notice-more-font {
  480. font-size: 28rpx;
  481. color: #146afb;
  482. display: flex;
  483. align-items: center;
  484. }
  485. .notice-content-box {
  486. display: flex;
  487. padding: 30rpx 20rpx 30rpx 20rpx;
  488. background-color: #ffffff;
  489. box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  490. border-radius: 32rpx;
  491. margin-top: 20rpx;
  492. justify-content: space-between;
  493. }
  494. .maskModal {
  495. width: 100%;
  496. position: absolute;
  497. background-color: rgba(0, 0, 0, 0.4);
  498. border-radius: 32rpx;
  499. height: 100%;
  500. top: 0;
  501. right: 0;
  502. display: flex;
  503. align-items: center;
  504. justify-content: center;
  505. color: #fff;
  506. font-size: 32rpx;
  507. font-weight: bold;
  508. }
  509. .notice-content-font {
  510. font-size: 32rpx;
  511. color: #0d1937;
  512. /* font-weight: 600; */
  513. overflow: hidden;
  514. text-overflow: ellipsis;
  515. white-space: nowrap;
  516. }
  517. .notice-content-time {
  518. font-size: 26rpx;
  519. letter-spacing: 0.02em;
  520. color: #cfcfcf;
  521. }
  522. .park-box {
  523. border-radius: 32rpx;
  524. margin-right: 20rpx;
  525. position: relative;
  526. height: 500rpx;
  527. }
  528. .park-content-box {
  529. width: 394rpx;
  530. background-color: #ffffff;
  531. border-radius: 56rpx 0px 32rpx 32rpx;
  532. position: absolute;
  533. top: 210rpx;
  534. font-size: 30rpx;
  535. padding: 30rpx;
  536. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
  537. }
  538. .park-title {
  539. /* font-weight: 600; */
  540. line-height: 36rpx;
  541. letter-spacing: 0.02em;
  542. color: #0d1937;
  543. }
  544. .park-address {
  545. /* font-weight: 600; */
  546. font-size: 26rpx;
  547. letter-spacing: 0.02em;
  548. color: #cfcfcf;
  549. margin-top: 10rpx;
  550. }
  551. .park-title-img {
  552. width: 16rpx;
  553. height: 16rpx;
  554. margin-right: 4rpx;
  555. }
  556. .park-footer-box {
  557. margin-top: 30rpx;
  558. }
  559. .park-footer-img {
  560. width: 24rpx;
  561. height: 24rpx;
  562. margin-right: 6rpx;
  563. }
  564. .park-footer-font {
  565. color: #cfcfcf;
  566. font-size: 24rpx;
  567. margin-top: 10rpx;
  568. }
  569. .width-30 {
  570. width: 30%;
  571. }
  572. .attract-content {
  573. color: #697594;
  574. /* font-weight: 600; */
  575. font-size: 24rpx;
  576. margin-top: 8rpx;
  577. overflow: hidden;
  578. text-overflow: ellipsis;
  579. white-space: nowrap;
  580. }
  581. .online-box {
  582. width: 12rpx;
  583. height: 12rpx;
  584. border-radius: 50%;
  585. background-color: #589cff;
  586. margin-right: 5rpx;
  587. }
  588. .offline-box {
  589. width: 12rpx;
  590. height: 12rpx;
  591. border-radius: 50%;
  592. background-color: #ffcf86;
  593. margin-right: 5rpx;
  594. }
  595. .color-a7adba {
  596. color: #a7adba;
  597. }
  598. .content-box {
  599. position: absolute;
  600. width: 100%;
  601. top: 150rpx;
  602. display: flex;
  603. flex-direction: column;
  604. z-index: 999;
  605. justify-content: space-around;
  606. height: 80px;
  607. align-items: center;
  608. }
  609. .content-font {
  610. color: #fff;
  611. font-weight: bold;
  612. font-size: 40rpx;
  613. }
  614. .call-font {
  615. color: #fff;
  616. font-size: 32rpx;
  617. }
  618. .order-money {
  619. color: #d9001b;
  620. font-size: 36rpx;
  621. font-weight: 500;
  622. }
  623. .noLogin-box {
  624. width: 100%;
  625. display: flex;
  626. flex-direction: column;
  627. justify-content: space-between;
  628. align-items: center;
  629. margin-top: 160rpx;
  630. color: #a7adba;
  631. }
  632. .withHouseBtn {
  633. color: #589cff;
  634. cursor: pointer;
  635. margin-top: 40rpx;
  636. }
  637. </style>