home.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997
  1. <template>
  2. <view class="container">
  3. <!-- 头部选择房间区域 -->
  4. <view class="select-item" @click="navigateToSelect">
  5. <view class="picker-item-logol">
  6. <image class="picker-item-logo-left" src="../../static/room.png"></image>
  7. </view>
  8. <view class="picker-item-label">已选房间</view>
  9. <view class="picker-item-content" v-if="roomSelect == '请选择宿舍'">{{ roomSelect }}</view>
  10. <view class="picker-item-content2" v-else>{{ roomSelect }}</view>
  11. <view class="picker-item-logor">
  12. <image class="picker-item-logo-right" src="../../static/right.png"></image>
  13. </view>
  14. </view>
  15. <!-- 账单显示区域 -->
  16. <view class="bill">
  17. <!-- 筛选框区域 -->
  18. <view class="choose">
  19. <view class="time" v-if="isShow">
  20. <uni-data-select :clear="false" :placeholder="time_value + ''" :localdata="time_range" @change="changeTime"></uni-data-select>
  21. </view>
  22. <view class="type" v-if="isShow">
  23. <uni-data-select :clear="false" placeholder="全部" :localdata="type_range" @change="changeType"></uni-data-select>
  24. </view>
  25. </view>
  26. <!-- 没有账单时展示的内容 -->
  27. <view class="null" v-if="!list.length">
  28. <img src="../../static/null.png" />
  29. <span>暂无账单</span>
  30. </view>
  31. <!-- 有账单时展示的内容 -->
  32. <view class="has" v-else>
  33. <!-- 账单列表区域 -->
  34. <view class="has_bill">
  35. <view class="item" v-for="item in list" :key="item.id">
  36. <view class="item_header">
  37. {{ item.payMonth + item.paymentItem }}
  38. </view>
  39. <view class="item_box">
  40. <view class="item_box_1">上月表数:{{ item.lastElectry }}</view>
  41. <view class="item_box_2">本月表数:{{ item.nowElectry }}</view>
  42. </view>
  43. <view class="item_box">
  44. <view class="item_box_1">用量:{{ item.nowTonnage }}吨</view>
  45. <view class="item_box_2">补助吨数:{{ item.subsidiesTonnage }}吨</view>
  46. </view>
  47. <view class="item_box" v-if="item.payItemType == '2'">
  48. <view class="item_box_1">支付人:{{ item.payerName }}</view>
  49. </view>
  50. <view class="item_notes">备注:{{ item.orderNotice }}</view>
  51. <view class="item_box">
  52. <view class="item_box_1 font">
  53. {{ item.payCreateTime }}
  54. </view>
  55. <view class="item_box_2">实付款:{{ item.realPayAmount }}</view>
  56. </view>
  57. <view class="item_button">
  58. <button
  59. class="feedback right"
  60. type="primary"
  61. size="mini"
  62. v-if="item.payItemType == '0' && item.payerCardNumber == local_cardNumber"
  63. @click="handleUnlock(item)"
  64. >
  65. 解除锁定
  66. </button>
  67. <button class="feedback right" type="primary" plain size="mini" @click="handleFeedback(item)">订单反馈</button>
  68. <button class="feedback" type="warn" size="mini" disabled v-if="item.payItemType == '2'">已支付</button>
  69. <button class="feedback" type="primary" size="mini" @click="navigateToPay(item)" v-else>
  70. {{ item.payItemType == '0' && item.payerCardNumber == local_cardNumber ? '继续支付' : '支付' }}
  71. </button>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <!-- 电话区域按钮 -->
  78. <view class="phone">
  79. <view class="phone_box">
  80. 咨询电话:
  81. <span @click="handlePhone">0791-82124516</span>
  82. </view>
  83. </view>
  84. <!-- 悬浮按钮区域 -->
  85. <view v-if="roomSelect != '请选择宿舍'" class="suspend_button" @click="goBill" @touchstart="down" @touchmove.prevent.stop="move" @touchend="end">订单查询</view>
  86. <!-- 订单反馈弹窗区域 -->
  87. <uni-popup ref="popup_feedback" background-color="#fff" :is-mask-click="false">
  88. <view class="popup_view">
  89. <view class="title">{{ popTitle }}</view>
  90. <view class="forms">
  91. <uni-forms ref="valiForm" :rules="rules" :modelValue="valiFormData">
  92. <uni-forms-item label="姓名:" required name="feedbackPersonName">
  93. <uni-easyinput v-model="valiFormData.feedbackPersonName" placeholder="请输入姓名" />
  94. </uni-forms-item>
  95. <uni-forms-item label="联系电话:" required name="feedbackPersonPhone">
  96. <uni-easyinput maxlength="11" v-model="valiFormData.feedbackPersonPhone" type="number" placeholder="请输入联系人手机号码" />
  97. </uni-forms-item>
  98. <uni-forms-item label="宿舍号:" required name="feedbackRoom">
  99. <uni-easyinput v-model="valiFormData.feedbackRoom" placeholder="请输入宿舍号" />
  100. </uni-forms-item>
  101. <uni-forms-item label="反馈信息:" required name="feedbackInfo">
  102. <uni-easyinput type="textarea" v-model="valiFormData.feedbackInfo" placeholder="请输入反馈信息" />
  103. </uni-forms-item>
  104. <uni-forms-item label="上传图片:" name="feedbackImg">
  105. <uni-file-picker
  106. limit="3"
  107. title="最多上传3张图片"
  108. v-model="valiFormData.feedbackImg"
  109. fileMediatype="image"
  110. :image-styles="imageStyles"
  111. mode="grid"
  112. @select="select"
  113. @delete="handleDelete"
  114. ></uni-file-picker>
  115. </uni-forms-item>
  116. </uni-forms>
  117. <view class="form_button">
  118. <button type="primary" size="mini" @click="popSubmit('valiForm')">提交</button>
  119. <button type="primary" plain size="mini" @click="close">取消</button>
  120. </view>
  121. </view>
  122. </view>
  123. </uni-popup>
  124. </view>
  125. </template>
  126. <script>
  127. // 引入照片压缩js文件
  128. import * as TranslateImage from '../../util/imageZip.js'
  129. // 引入加密函数
  130. import { rsaEncrypt } from '@/util/rsa'
  131. export default {
  132. data() {
  133. return {
  134. // 图片上传组件的样式
  135. imageStyles: {
  136. width: 75,
  137. height: 75,
  138. border: {
  139. color: '#ccc',
  140. width: 1,
  141. style: 'dashed',
  142. radius: '5px'
  143. }
  144. },
  145. // 选择的宿舍绑定数据
  146. roomSelect: '请选择宿舍',
  147. // 悬浮按钮移动标识
  148. flags: false,
  149. maxW: 0,
  150. maxH: 0,
  151. position: {
  152. x: 0,
  153. y: 0
  154. },
  155. nx: 0,
  156. ny: 0,
  157. // 账单数据
  158. list: [],
  159. // 时间筛选框选中值绑定数据
  160. time_value: '',
  161. // 时间筛选框列表绑定数据
  162. time_range: [],
  163. // 支付状态 12是全部 1是未支付 2是已支付
  164. pay_type: 12,
  165. // 支付状态筛选框列表绑定数据
  166. type_range: [
  167. {
  168. value: 1,
  169. text: '全部'
  170. },
  171. {
  172. value: 2,
  173. text: '未支付'
  174. },
  175. {
  176. value: 3,
  177. text: '已支付'
  178. }
  179. ],
  180. // 订单反馈弹窗 表格的验证规则
  181. rules: {
  182. feedbackPersonName: {
  183. rules: [
  184. {
  185. required: true,
  186. errorMessage: '请输入姓名'
  187. },
  188. {
  189. minLength: 2,
  190. maxLength: 8,
  191. errorMessage: '请输入正确的姓名'
  192. }
  193. ]
  194. },
  195. feedbackPersonPhone: {
  196. rules: [
  197. {
  198. required: true,
  199. errorMessage: '请输入联系人手机号码'
  200. },
  201. {
  202. pattern: /^[1]([3-9])[0-9]{9}$/,
  203. errorMessage: '请输入正确的手机号码'
  204. }
  205. ]
  206. },
  207. feedbackRoom: {
  208. rules: [
  209. {
  210. required: true,
  211. errorMessage: '请输入宿舍号'
  212. }
  213. ]
  214. },
  215. feedbackInfo: {
  216. rules: [
  217. {
  218. required: true,
  219. errorMessage: '请输入反馈信息'
  220. }
  221. ]
  222. }
  223. },
  224. // 订单反馈弹窗 表格绑定数据
  225. valiFormData: {
  226. feedbackPersonName: '',
  227. feedbackPersonPhone: '',
  228. feedbackRoom: '',
  229. feedbackInfo: '',
  230. feedbackImg: []
  231. },
  232. // 弹窗标题
  233. popTitle: '',
  234. // 订单号
  235. orderNo: '',
  236. // 金额
  237. amount: '',
  238. // 微信支付参数
  239. form: {
  240. appId: '',
  241. timeStamp: '',
  242. nonceStr: '',
  243. signType: '',
  244. paySign: '',
  245. package: ''
  246. },
  247. //农商行地址
  248. notifyUrl: 'https://chtech.ncjti.edu.cn/jiaofei/jiaofei-api/tuitionpayment/pay/jxnxs/notify/',
  249. // 反馈提交图片参数
  250. imgs: [],
  251. payId: ''
  252. }
  253. },
  254. onLoad() {
  255. // 判断是否存在card_number,不存在则重新授权
  256. this.getAuthorization()
  257. // 如果之前已经选择过宿舍,则从缓存中读取
  258. if (localStorage.room) {
  259. this.roomSelect = localStorage.room
  260. this.getData()
  261. this.getTimeList()
  262. }
  263. },
  264. methods: {
  265. getAuthorization() {
  266. let card_number = localStorage.getItem('card_number')
  267. let studentName = localStorage.getItem('studentName')
  268. let openId = localStorage.getItem('openId')
  269. if (!card_number || !studentName || !openId) {
  270. uni.showModal({
  271. title: '提示',
  272. content: '请先领取校园卡或授权后再进行相关操作',
  273. showCancel: false,
  274. success: () => {
  275. uni.reLaunch({
  276. url: '/pages/index/index'
  277. })
  278. }
  279. })
  280. }
  281. },
  282. // 获取账单列表数据
  283. async getData() {
  284. // 对密码进行加密
  285. let rsaRoom = rsaEncrypt(localStorage.room)
  286. // console.log(rsaRoom);
  287. // 获取当前年份
  288. if (!this.time_value) {
  289. let date = new Date()
  290. this.time_value = date.getFullYear()
  291. }
  292. let res = await this.$myRequest({
  293. url: '/payableinfowater/queryWaterInfo',
  294. method: 'post',
  295. data: {
  296. dorm: rsaRoom,
  297. year: this.time_value,
  298. payStatu: this.pay_type
  299. }
  300. })
  301. // console.log(res);
  302. if (res.success) {
  303. this.list = res.data
  304. }
  305. },
  306. // 获取时间筛选框时间数组
  307. async getTimeList() {
  308. let res = await this.$myRequest({
  309. url: '/payableinfowater/queryAllYear',
  310. data: {
  311. dorm: localStorage.room
  312. }
  313. })
  314. // console.log(res);
  315. if (res.success) {
  316. this.time_range = res.data
  317. }
  318. },
  319. // 选择图片回调
  320. select(e) {
  321. e.tempFiles.forEach((item) => {
  322. TranslateImage.translate(item.path, (res) => {
  323. // 判断图片大小是否过大
  324. if (Number(res.size) > 1000000) {
  325. uni.showModal({
  326. content: `图片过大,请重新上传`,
  327. showCancel: false,
  328. success() {}
  329. })
  330. return
  331. }
  332. uni.showLoading({
  333. title: '上传中'
  334. })
  335. // 上传图片
  336. uni.uploadFile({
  337. url: `https://chtech.ncjti.edu.cn/jiaofei/jiaofei-api/tuitionpayment/feedbackmsg/uploadImage`,
  338. filePath: res.url,
  339. name: 'images',
  340. success: (uploadFileRes) => {
  341. // 收集提交请求所需要的图片参数数据
  342. this.imgs.push(JSON.parse(uploadFileRes.data).data)
  343. // 处理前端页面预览图片的数据
  344. const path = item.path
  345. this.valiFormData.feedbackImg.push({
  346. url: path,
  347. name: ''
  348. })
  349. uni.hideLoading()
  350. },
  351. fail: () => {
  352. uni.hideLoading()
  353. }
  354. })
  355. })
  356. })
  357. },
  358. // 删除图片回调
  359. handleDelete(e) {
  360. const num = this.valiFormData.feedbackImg.findIndex((v) => v.path === e.tempFilePath)
  361. this.valiFormData.feedbackImg.splice(num, 1)
  362. this.imgs.splice(num, 1)
  363. },
  364. // 订单反馈按钮弹窗
  365. async handleFeedback(item) {
  366. this.popTitle = item.title
  367. this.valiFormData.feedbackPersonName = ''
  368. this.valiFormData.feedbackPersonPhone = ''
  369. this.valiFormData.feedbackRoom = ''
  370. this.valiFormData.feedbackInfo = ''
  371. this.valiFormData.feedbackImg = []
  372. this.imgs = []
  373. let res = await this.$myRequest({
  374. url: '/wechat/getUserNameTele',
  375. data: {
  376. cardNumber: localStorage.card_number
  377. }
  378. })
  379. // console.log(res);
  380. if (res.success) {
  381. this.valiFormData.feedbackPersonName = res.data.name
  382. this.valiFormData.feedbackPersonPhone = res.data.telephone
  383. this.valiFormData.feedbackRoom = localStorage.room
  384. }
  385. this.$refs.popup_feedback.open()
  386. },
  387. // 订单反馈弹窗提交按钮回调
  388. popSubmit(ref) {
  389. this.$refs[ref]
  390. .validate()
  391. .then(async (res) => {
  392. // 如果上传了图片,处理图片参数字段
  393. if (res.feedbackImg.length) {
  394. res.image = this.imgs.join(';')
  395. }
  396. res.feedbackItemName = '水费缴纳'
  397. // 整理参数
  398. let { feedbackImg, ...data } = res
  399. let result = await this.$myRequest({
  400. url: '/feedbackmsg/save',
  401. method: 'post',
  402. data
  403. })
  404. if (result.success) {
  405. uni.showToast({
  406. title: '提交成功'
  407. })
  408. }
  409. this.$refs.popup_feedback.close()
  410. })
  411. .catch((err) => {
  412. console.log('err', err)
  413. })
  414. },
  415. // 订单反馈弹窗取消按钮回调
  416. close() {
  417. this.$refs.popup_feedback.close()
  418. },
  419. // 时间筛选框数据改变回调
  420. changeTime(e) {
  421. if (e != '') {
  422. this.time_range.forEach((element) => {
  423. if (element.value == e) {
  424. this.time_value = element.text
  425. }
  426. })
  427. this.getData()
  428. }
  429. },
  430. // 支付状态筛选框数据改变回调
  431. changeType(e) {
  432. // console.log(e);
  433. if (e == 1 || e == 2 || e == 3) {
  434. if (e == 1) {
  435. this.pay_type = 12
  436. } else if (e == 2) {
  437. this.pay_type = 1
  438. } else if (e == 3) {
  439. this.pay_type = 2
  440. }
  441. this.getData()
  442. }
  443. },
  444. // 跳转到选择宿舍页面
  445. navigateToSelect() {
  446. uni.navigateTo({
  447. url: '/pages/select/select'
  448. })
  449. },
  450. // 支付回调
  451. navigateToPay(item) {
  452. // console.log(item);
  453. this.payId = item.id
  454. this.amount = item.realPayAmount
  455. this.getQuery(item)
  456. },
  457. // 处理参数
  458. async getQuery(item) {
  459. // console.log(item);
  460. let res = await this.$myRequest({
  461. url: `/payorder/${item.payForIdentify}/receiveOrder`,
  462. method: 'post',
  463. data: {
  464. id: item.id,
  465. studentNo: '',
  466. itemName: item.paymentItem,
  467. payYear: item.payMonth,
  468. payDetail: item.payAmountDetail,
  469. dorm: item.dorm,
  470. payOrderLoan: '',
  471. orderNotice: item.orderNotice,
  472. // payItemType: 1,
  473. payCount: '1',
  474. notPaySize: 0,
  475. nowRealPayAmount: item.realPayAmount,
  476. payerCardNumber: localStorage.card_number,
  477. payerName: localStorage.studentName
  478. }
  479. })
  480. // console.log(res);
  481. if (res.success) {
  482. this.createPayorder(item)
  483. }
  484. },
  485. // 创建订单
  486. async createPayorder(item) {
  487. let res = await this.$myRequest({
  488. url: `/payorder/${item.payForIdentify}/create`,
  489. method: 'post',
  490. data: {
  491. id: item.id,
  492. studentNo: '',
  493. itemName: item.paymentItem,
  494. payYear: item.payMonth,
  495. payDetail: item.payAmountDetail,
  496. dorm: item.dorm,
  497. payOrderLoan: 0,
  498. orderNotice: item.orderNotice,
  499. payCount: '1',
  500. notPaySize: 0,
  501. nowRealPayAmount: item.realPayAmount,
  502. payerCardNumber: localStorage.card_number,
  503. payerName: localStorage.studentName
  504. }
  505. })
  506. // console.log(res);
  507. if (res.success) {
  508. this.orderNo = res.data[0].orderNo
  509. if (res.data[0].payMethod == '1') {
  510. // console.log("建行");
  511. this.getjhPay()
  512. } else {
  513. // console.log("农商");
  514. this.getnsPay()
  515. }
  516. }
  517. },
  518. // 建行支付请求
  519. async getjhPay() {
  520. let res = await this.$myRequest({
  521. url: '/pay/ccb/getJsApiParam',
  522. data: {
  523. orderNo: this.orderNo,
  524. openId: localStorage.openId,
  525. secondOrderNo: '',
  526. payment: '2'
  527. }
  528. })
  529. // console.log(res);
  530. if (res.success) {
  531. this.form = {
  532. ...res.data
  533. }
  534. this.updateStatu()
  535. }
  536. },
  537. // 更改支付状态
  538. async updateStatu() {
  539. let res = await this.$myRequest({
  540. url: '/payableinfowater/updateWaterStatu',
  541. data: {
  542. payStatu: '0',
  543. payInfoId: this.payId,
  544. cardNumber: localStorage.card_number,
  545. orderNo: this.orderNo
  546. }
  547. })
  548. // console.log(res);
  549. if (res.success) {
  550. //调起微信支付
  551. this.wxPay()
  552. }
  553. },
  554. // 微信支付回调
  555. wxPay() {
  556. let that = this
  557. function onBridgeReady() {
  558. WeixinJSBridge.invoke('getBrandWCPayRequest', that.form, function (res) {
  559. if (res.errMsg == 'get_brand_wcpay_request:ok') {
  560. // 使用以上方式判断前端返回,微信团队郑重提示:
  561. //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
  562. } else {
  563. uni.showToast({
  564. title: '支付失败',
  565. icon: 'error'
  566. })
  567. setTimeout(() => {
  568. uni.request({
  569. url: 'https://chtech.ncjti.edu.cn/jiaofei/jiaofei-api/tuitionpayment/payableinfowater/unlock',
  570. data: {
  571. payInfoId: that.payId
  572. },
  573. success: (res) => {
  574. if (res.data.success) {
  575. that.getData()
  576. that.getTimeList()
  577. }
  578. }
  579. })
  580. }, 1500)
  581. }
  582. })
  583. }
  584. // 兼容处理
  585. if (typeof WeixinJSBridge == 'undefined') {
  586. if (document.addEventListener) {
  587. document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false)
  588. } else if (document.attachEvent) {
  589. document.attachEvent('WeixinJSBridgeReady', onBridgeReady)
  590. document.attachEvent('onWeixinJSBridgeReady', onBridgeReady)
  591. }
  592. } else {
  593. onBridgeReady()
  594. }
  595. },
  596. // 农商支付请求
  597. getnsPay() {
  598. let O = '6fc31630a4d3de99f5e41debbd35b9f0'
  599. let out_no = this.orderNo
  600. let amount = this.amount
  601. let appoint_notify = this.notifyUrl
  602. let mainUrl = `https://q.jxnxs.com/newpay?O=${O}&out_no=${out_no}&amount=${amount}&appoint_notify=${appoint_notify}`
  603. window.location.href = mainUrl
  604. },
  605. // 解除锁定按钮回调
  606. async handleUnlock(item) {
  607. this.payId = item.id
  608. let res = await this.$myRequest({
  609. url: '/payableinfowater/unlock',
  610. data: {
  611. payInfoId: this.payId
  612. }
  613. })
  614. // console.log(res);
  615. if (res.success) {
  616. this.getData()
  617. this.getTimeList()
  618. }
  619. },
  620. // 订单查询悬浮按钮回调
  621. goBill() {
  622. uni.navigateTo({
  623. url: '/pages/bill/bill'
  624. })
  625. },
  626. // 实现移动端拖拽
  627. down(event) {
  628. let suspend_button = document.querySelector('.suspend_button')
  629. this.flags = true
  630. let touch
  631. if (event.touches) {
  632. touch = event.touches[0]
  633. } else {
  634. touch = event
  635. }
  636. this.maxW = document.body.clientWidth - suspend_button.offsetWidth
  637. this.maxH = document.body.clientHeight - suspend_button.offsetHeight
  638. this.position.x = touch.clientX - suspend_button.offsetLeft
  639. this.position.y = touch.clientY - suspend_button.offsetTop
  640. },
  641. move(event) {
  642. let suspend_button = document.querySelector('.suspend_button')
  643. if (this.flags) {
  644. let touch
  645. if (event.touches) {
  646. touch = event.touches[0]
  647. } else {
  648. touch = event
  649. }
  650. this.nx = touch.clientX - this.position.x
  651. this.ny = touch.clientY - this.position.y
  652. if (this.nx < 0) {
  653. this.nx = 0
  654. } else if (this.nx > this.maxW) {
  655. this.nx = this.maxW
  656. }
  657. if (this.ny < 0) {
  658. this.ny = 0
  659. } else if (this.ny >= this.maxH) {
  660. this.ny = this.maxH
  661. }
  662. suspend_button.style.left = this.nx + 'px'
  663. suspend_button.style.top = this.ny + 'px'
  664. }
  665. },
  666. end() {
  667. this.flags = false
  668. },
  669. // 拨打电话回调
  670. handlePhone() {
  671. uni.makePhoneCall({
  672. phoneNumber: '82293462'
  673. })
  674. },
  675. // 下拉刷新
  676. onPullDownRefresh() {
  677. if (localStorage.room) {
  678. this.roomSelect = localStorage.room
  679. this.getData()
  680. this.getTimeList()
  681. }
  682. setTimeout(() => {
  683. uni.stopPullDownRefresh()
  684. }, 1500)
  685. }
  686. },
  687. computed: {
  688. // 计算出缓存中是否存在宿舍号
  689. isShow() {
  690. if (localStorage.room) {
  691. return true
  692. } else {
  693. return false
  694. }
  695. },
  696. local_cardNumber() {
  697. return localStorage.card_number
  698. }
  699. }
  700. }
  701. </script>
  702. <style lang="scss" scoped>
  703. .container {
  704. overflow: auto;
  705. min-height: 100vh;
  706. background-image: url(../../static/bg.png);
  707. background-size: 100% 100%;
  708. .select-item {
  709. margin: 19rpx 0;
  710. display: flex;
  711. background-color: #ffffff;
  712. height: 139rpx;
  713. .picker-item-logol {
  714. width: 88rpx;
  715. display: flex;
  716. justify-content: flex-end;
  717. align-items: center;
  718. .picker-item-logo-left {
  719. width: 58rpx;
  720. height: 58rpx;
  721. }
  722. }
  723. .picker-item-label {
  724. font-size: 30rpx;
  725. width: 161rpx;
  726. height: 139rpx;
  727. line-height: 139rpx;
  728. text-align: center;
  729. }
  730. .picker-item-content {
  731. width: 360rpx;
  732. height: 139rpx;
  733. line-height: 139rpx;
  734. font-size: 36rpx;
  735. text-align: center;
  736. color: #999999;
  737. }
  738. .picker-item-content2 {
  739. width: 360rpx;
  740. height: 139rpx;
  741. line-height: 139rpx;
  742. font-size: 32rpx;
  743. text-align: center;
  744. color: black;
  745. overflow: hidden;
  746. text-overflow: ellipsis;
  747. white-space: nowrap;
  748. }
  749. .picker-item-logor {
  750. width: 91rpx;
  751. display: flex;
  752. justify-content: center;
  753. align-items: center;
  754. .picker-item-logo-right {
  755. width: 40rpx;
  756. height: 40rpx;
  757. }
  758. }
  759. }
  760. .bill {
  761. margin: 20rpx 0;
  762. min-height: 920rpx;
  763. .choose {
  764. display: flex;
  765. margin: 0 20rpx;
  766. .time {
  767. flex: 1;
  768. padding-right: 40rpx;
  769. }
  770. .type {
  771. flex: 1;
  772. }
  773. }
  774. .null {
  775. display: flex;
  776. flex-direction: column;
  777. align-items: center;
  778. margin: 0 auto;
  779. padding-top: 300rpx;
  780. width: 50%;
  781. height: 400rpx;
  782. img {
  783. height: 90%;
  784. }
  785. span {
  786. margin-top: 30rpx;
  787. }
  788. }
  789. .has {
  790. margin: 0 20rpx;
  791. .has_bill {
  792. margin-top: 20rpx;
  793. .item {
  794. margin-bottom: 20rpx;
  795. border-radius: 10rpx;
  796. background-color: #fff;
  797. .item_header {
  798. height: 96rpx;
  799. line-height: 96rpx;
  800. text-align: center;
  801. font-weight: bold;
  802. border-radius: 10rpx 10rpx 0 0;
  803. background-color: #e7eef5;
  804. }
  805. .item_box {
  806. display: flex;
  807. margin: 0 30rpx;
  808. height: 70rpx;
  809. line-height: 70rpx;
  810. font-weight: bold;
  811. .item_box_1 {
  812. flex: 1.5;
  813. }
  814. .item_box_2 {
  815. flex: 1;
  816. }
  817. .font {
  818. font-weight: normal;
  819. color: #999;
  820. }
  821. }
  822. .item_notes {
  823. margin: 0 30rpx;
  824. height: 60rpx;
  825. line-height: 60rpx;
  826. font-size: 26rpx;
  827. color: #999;
  828. }
  829. .item_button {
  830. display: flex;
  831. justify-content: flex-end;
  832. margin: 10rpx 50rpx;
  833. height: 74rpx;
  834. line-height: 74rpx;
  835. .feedback {
  836. margin: 0;
  837. padding: 0;
  838. width: 140rpx;
  839. height: 65rpx;
  840. line-height: 65rpx;
  841. font-size: 26rpx;
  842. }
  843. .right {
  844. margin-right: 50rpx;
  845. }
  846. }
  847. }
  848. }
  849. }
  850. }
  851. .phone {
  852. display: flex;
  853. justify-content: center;
  854. align-items: center;
  855. margin: 20rpx 0;
  856. height: 70rpx;
  857. .phone_box {
  858. margin-bottom: 20rpx;
  859. span {
  860. color: #4993ea;
  861. }
  862. }
  863. }
  864. .suspend_button {
  865. position: fixed;
  866. left: 80rpx;
  867. bottom: 120rpx;
  868. width: 140rpx;
  869. height: 140rpx;
  870. line-height: 140rpx;
  871. text-align: center;
  872. border-radius: 70rpx;
  873. color: #fff;
  874. background-color: rgba(0, 0, 0, 0.4);
  875. }
  876. .popup_view {
  877. width: 650rpx;
  878. .title {
  879. height: 90rpx;
  880. line-height: 90rpx;
  881. font-size: 36rpx;
  882. font-weight: bold;
  883. text-align: center;
  884. background-color: #e7eef5;
  885. }
  886. .forms {
  887. margin: 40rpx;
  888. width: 550rpx;
  889. .form_button {
  890. display: flex;
  891. text-align: center;
  892. button {
  893. width: 200rpx;
  894. }
  895. }
  896. }
  897. }
  898. }
  899. ::v-deep .uni-select__input-placeholder {
  900. font-size: 28rpx;
  901. color: #3a3a3a;
  902. }
  903. ::v-deep .uniui-bottom::before {
  904. color: #fff;
  905. }
  906. ::v-deep .uni-forms-item__label {
  907. width: 160rpx !important;
  908. }
  909. </style>