index.vue 14 KB

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