index.vue 14 KB

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