index.vue 14 KB

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