index.vue 14 KB

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