home.vue 23 KB

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