reshui.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623
  1. <template>
  2. <view class="content">
  3. <view class="container">
  4. <view class="header">
  5. <view class="scan" @tap="scan()" hover-class="scan_hover">
  6. <text class="iconfont icon-saoma"></text>
  7. <text>扫码连接</text>
  8. </view>
  9. <view class="qinshihao">
  10. <text class="iconfont icon-zhuye"></text>
  11. <text class="dormtxt">{{dorm_number || '宿舍未知'}}</text>
  12. </view>
  13. </view>
  14. <view class="start_text">
  15. <view class="start_top">
  16. <view class="item_left">
  17. <text class="iconfont icon-shuibiao"></text>
  18. <text>开启设备</text>
  19. </view>
  20. <view>
  21. <switch :color="colorPrimary" :checked="isChecked" @change="switchChange" />
  22. </view>
  23. </view>
  24. <view class="start_mid">
  25. <view class="item_left">
  26. <text class="iconfont icon-qian"></text>
  27. <text class="start_mid_txt">¥{{amount}}</text>
  28. </view>
  29. <view class="start_payamount" @tap="chongzhi_yemian()" hover-class="scan_hover">
  30. <text>点击充值</text>
  31. <text class="iconfont icon-dayuhao"></text>
  32. </view>
  33. </view>
  34. <view class="start_bot">
  35. <button class="kongzhonglianjie" @click="open">空中连接</button>
  36. <text class="start_bot_txt">当前结算消费:¥{{use_amount}}</text>
  37. </view>
  38. </view>
  39. <view v-if="showRoom" style="width: 100%; height: 100%; ">
  40. <view style="display: flex; flex-wrap: wrap;">
  41. <button v-for="item in rooms" :key="item.id" @tap="clickRoom(item.id)"
  42. class="btn_room">{{item.room}}</button>
  43. </view>
  44. </view>
  45. <view class="start_up_process">
  46. <uni-steps :options="list1" :active-color="colorPrimary" :active="active" />
  47. </view>
  48. <view class="ad">
  49. <image src="../../static/image/ad_reshui.png" mode="aspectFit" class="ad_img" @tap="ad_redirect">
  50. </image>
  51. </view>
  52. <view class="title">
  53. 消费记录
  54. </view>
  55. <view class="record-item">
  56. <view class="uni-list-cell-db">
  57. <picker mode="date" :value="date" fields="month" :start="startDate" :end="endDate"
  58. @change="bindDateChange">
  59. <view class="uni-input">
  60. <text>{{date}}</text>
  61. <text class="iconfont icon-arrow-down"></text>
  62. </view>
  63. </picker>
  64. </view>
  65. <view class="item-list" v-for="(item, i) in xiaofei_items" :key="i">
  66. <text class="item-list-txt"><text class="iconfont icon-shijian"></text>{{item.begin_time}}</text>
  67. <text class="item-list-txt"><text
  68. class="iconfont icon-shuidi"></text>{{numFilter(item.use_size)}}t</text>
  69. <text class="item-list-txt">{{numFilter(item.use_amount)}}</text>
  70. </view>
  71. </view>
  72. </view>
  73. <instructions v-if="flag" @parent_cancel="cancel" @parent_noshow='noshow'></instructions>
  74. </view>
  75. </template>
  76. <script>
  77. import instructions from '../../components/instructions.vue'
  78. export default {
  79. /**
  80. * 声明组件
  81. */
  82. components: {
  83. instructions
  84. },
  85. data() {
  86. return {
  87. colorPrimary: getApp().globalData.primaryColor,
  88. date: this.$getDate({
  89. format: true
  90. }),
  91. startDate: this.$getDate('start_date'),
  92. endDate: this.$getDate('end_date'),
  93. flag: false, // 控制说明弹窗
  94. showRoom: false,
  95. isUserClose: false, // 是否是用户自己关闭
  96. isChecked: false,
  97. isConnected: false, // 是否连接上
  98. isScan: false,
  99. active: -1,
  100. list1: [{
  101. title: '连接设备'
  102. }, {
  103. title: '连设备服务'
  104. }, {
  105. title: '数据通讯'
  106. }, {
  107. title: '启动'
  108. }],
  109. devices: [], // 保存设备
  110. rooms: [], // 保存水表id及对应的宿舍号
  111. device_code: '', // 设备编号
  112. deviceId: '',
  113. serviceId: '',
  114. characteristicIdForWrite: '',
  115. characteristicIdForNotity: '',
  116. deviceIsNotify: false,
  117. deviceIsWrite: false,
  118. byte35: '', // 70 个字符
  119. byte35_tmp: '', // 70 个字符 临时变量
  120. start_code: '',
  121. // start_code: '3459A8C660F1C284E41003E80000120000',
  122. xiaofei_items: [], // 消费记录
  123. use_amount: 0.0.toFixed(2), // 结算金额
  124. amount: 0.0.toFixed(2), // 余额
  125. dorm_number: '', // 宿舍号
  126. stu_number: '', // 学号
  127. user_name: '',
  128. // compus: '', // 校区
  129. ceshi: 'code',
  130. changeDate: false, // 是否是手动选择日期
  131. get_Bluetooth_Bevice: false // 自动获取蓝牙设备,并列表
  132. }
  133. },
  134. onLoad(options) {
  135. // console.log(options);
  136. uni.authorize({
  137. scope: 'scope.userLocation',
  138. success(res) {
  139. uni.getLocation({
  140. success: (loc) => {
  141. // console.log(loc);
  142. // uni.showToast({
  143. // icon: 'none',
  144. // title: '纬度:' + loc.latitude + '\n' + '经度:' + loc
  145. // .longitude,
  146. // duration: 2000
  147. // })
  148. uni.showToast({
  149. icon: 'success',
  150. title: '已获定位信息'
  151. })
  152. },
  153. fail: (err) => {
  154. uni.showToast({
  155. icon: 'none',
  156. title: '获取定位失败,请手动开启定位!'
  157. })
  158. }
  159. })
  160. },
  161. fail: (err) => {
  162. // console.log(err);
  163. uni.showToast({
  164. icon: 'none',
  165. title: '请手动设置定位授权!'
  166. })
  167. }
  168. })
  169. if (typeof(options) != 'undefined' && typeof(options) != '' && JSON.stringify(options) == '{}') {
  170. // 获取基本信息
  171. this.get_base_info(options, 'onLoad')
  172. } else if (typeof(options.from) != 'undefined' && options.from != 0) {
  173. // 获取基本信息
  174. this.get_base_info(options, 'onLoad')
  175. // 获取设备码
  176. this.device_code = decodeURIComponent(options.q).split('=')[1]
  177. }
  178. const value = uni.getStorageSync('instruction_noshow');
  179. if (!(value == true)) {
  180. this.flag = true
  181. }
  182. // 获取蓝牙设备,并列表
  183. this.openBluetoothAdapter();
  184. },
  185. onShow() {
  186. // 充值后更新金额
  187. this.amount = this.$store.state.reshui_amount
  188. if (this.stu_number && typeof(this.stu_number) != 'undefined') {
  189. // 获取基本信息
  190. this.get_base_info('options', 'onShow')
  191. }
  192. },
  193. methods: {
  194. /**
  195. * 单击连接热水表
  196. */
  197. clickRoom(e) {
  198. if (this.judgeBalance('clickRoom') == false) {
  199. return
  200. }
  201. this.device_code = 'K' + e
  202. for (var i = 0, len = this.devices.length; i < len; i++) {
  203. if (this.devices[i].dname == e) {
  204. this.deviceId = this.devices[i].did
  205. break
  206. }
  207. }
  208. // 开始连接匹配的蓝牙设备
  209. this.openBluetoothAdapter();
  210. },
  211. /**
  212. * 空中连接热水表
  213. */
  214. open() {
  215. this.showRoom = !this.showRoom
  216. },
  217. /**
  218. * 跳转到广告ad页
  219. */
  220. ad_redirect() {
  221. uni.navigateTo({
  222. url: 'ad_reshui'
  223. })
  224. },
  225. /**
  226. * 保留小数点数值后两位,尾数四舍五入
  227. * @param {Object} value
  228. */
  229. numFilter(value) {
  230. // 截取当前数据到小数点后两位
  231. let realVal = parseFloat(value).toFixed(2)
  232. return realVal
  233. },
  234. /**
  235. * 获取基本信息
  236. */
  237. get_base_info(options, param) {
  238. // console.log(options);
  239. try {
  240. // 获取学号
  241. this.stu_number = this.$store.state.userInfo.card_number
  242. if (this.stu_number == '' || typeof(this.stu_number) == 'undefined') {
  243. const userinfo = uni.getStorageSync('userinfo_storage_key')
  244. if (userinfo) {
  245. this.stu_number = userinfo.card_number
  246. } else {
  247. uni.navigateTo({
  248. url: '../index/index?from=' + options.from
  249. })
  250. uni.showToast({
  251. icon: 'none',
  252. title: '学号为空,请进行授权',
  253. duration: 3000
  254. });
  255. return
  256. }
  257. }
  258. } catch (e) {
  259. // console.log(e);
  260. }
  261. if (param == 'onShow') {
  262. if (this.$store.state.payInfo.from == 'reshui_pay') {
  263. uni.showToast({
  264. title: this.$store.state.payInfo.resultMsg,
  265. icon: 'success',
  266. success: () => {
  267. this.$store.state.payInfo.resultMsg = ''
  268. this.$store.state.payInfo.from = ''
  269. }
  270. })
  271. }
  272. }
  273. // 获取code
  274. this.getCode(options, param)
  275. },
  276. /**
  277. * 获得code
  278. */
  279. getCode(options, param) {
  280. uni.login({
  281. success: (res) => {
  282. // console.log('getCode', res);
  283. if (res.code) {
  284. // 请求服务器,获得openid
  285. this.getOpenId(options, res.code, param)
  286. } else {
  287. uni.showToast({
  288. title: res.errMsg,
  289. icon: 'none'
  290. });
  291. }
  292. }
  293. })
  294. },
  295. /**
  296. * 请求服务器,获得openid
  297. */
  298. async getOpenId(options, param_code, param) {
  299. const res = await this.$myRequest({
  300. host: this.ceshi,
  301. url: '/HotWaters/wpget_stu.action',
  302. method: 'POST',
  303. header: {
  304. 'content-type': 'application/x-www-form-urlencoded'
  305. },
  306. data: {
  307. code: param_code
  308. }
  309. })
  310. // console.log(res);
  311. if (res.data.mess == '返回成功') {
  312. // stu_number是否存在
  313. let cardNumber = res.data.info[0].card_number
  314. if (typeof(cardNumber) != 'undefined' && cardNumber != '' && JSON.stringify(cardNumber) != '{}') {
  315. // 学号 和 姓名
  316. this.stu_number = res.data.info[0].stu_number
  317. this.user_name = res.data.info[0].user_name
  318. // 剩余金额
  319. this.amount = res.data.info[0].balance.toFixed(2)
  320. // if (this.amount > 0)
  321. this.$store.state.reshui_amount = this.amount
  322. // 组合楼栋宿舍号
  323. this.dorm_number = res.data.info[0].build + res.data.info[0].dom
  324. // 校区
  325. // this.compus = res.data.info[0].campus
  326. if (param == 'onLoad' && typeof(options.from) != 'undefined' && options.from != 0) {
  327. // 初始化蓝牙
  328. this.openBluetoothAdapter()
  329. }
  330. // 请求选定的月份消费记录
  331. this.request_consumption_records()
  332. } else {
  333. uni.showToast({
  334. title: '未获取到学号!',
  335. icon: 'success'
  336. });
  337. uni.navigateTo({
  338. url: '../index/index?from=' + options.from
  339. })
  340. }
  341. } else if (res.data.mess == '未查询到用户信息') {
  342. // 数据库中 未查询到用户信息,就清除本地存储
  343. uni.removeStorageSync('userinfo_storage_key');
  344. uni.showToast({
  345. title: '获取用户信息失败!'
  346. })
  347. if (options && typeof(options.from) != 'undefined' && typeof(options.from) != '') {
  348. uni.navigateTo({
  349. url: '../index/index?from=' + options.from
  350. })
  351. } else {
  352. uni.redirectTo({
  353. url: '../index/index?from=0'
  354. });
  355. }
  356. }
  357. },
  358. /**
  359. * 选择消费年月
  360. */
  361. bindDateChange(e) {
  362. this.date = e.detail.value
  363. this.changeDate = true
  364. // 请求选定的月份消费记录
  365. this.request_consumption_records()
  366. },
  367. /**
  368. * 使用说明组件取消
  369. */
  370. cancel(param) {
  371. this.flag = param
  372. },
  373. /**
  374. * 使用说明组件不再出现
  375. */
  376. noshow(param) {
  377. try {
  378. if (param) {
  379. uni.setStorageSync("instruction_noshow", true)
  380. } else {
  381. uni.removeStorageSync("instruction_noshow")
  382. }
  383. } catch (e) {
  384. // console.log(e);
  385. }
  386. },
  387. /**
  388. * 请求选定的月份消费记录
  389. */
  390. async request_consumption_records() {
  391. if (this.stu_number != '' && typeof(this.stu_number) != 'undefined') {
  392. const res = await this.$myRequest({
  393. host: this.ceshi,
  394. url: '/HotWaters/wpqueryConsume.action',
  395. method: 'POST',
  396. header: {
  397. 'content-type': 'application/x-www-form-urlencoded'
  398. },
  399. data: {
  400. stu_number: this.stu_number,
  401. begin_time: this.date
  402. }
  403. });
  404. // console.log(res);
  405. if (res.data.mess == '返回成功') {
  406. this.xiaofei_items = []
  407. // 消费记录
  408. let items = res.data.data
  409. for (var i = 0; i < items.length; i++) {
  410. this.xiaofei_items.push(items[i])
  411. }
  412. } else {
  413. if (this.changeDate) {
  414. uni.showToast({
  415. icon: 'success',
  416. title: res.data.mess,
  417. success: () => {
  418. this.changeDate = false
  419. }
  420. })
  421. if (res.data.mess == '本月无消费记录') {
  422. this.xiaofei_items = []
  423. }
  424. }
  425. }
  426. } else {
  427. uni.showToast({
  428. icon: 'success',
  429. title: '未获得学号'
  430. })
  431. }
  432. },
  433. /**
  434. * 控制进度条显示
  435. * @param {Object} active_value
  436. */
  437. process_control(active_value) {
  438. if (active_value <= this.list1.length - 1) {
  439. this.active = active_value
  440. }
  441. },
  442. /**
  443. * 开始或停止用水
  444. */
  445. switchChange(e) {
  446. this.isChecked = e.target.value
  447. if (this.isChecked) {
  448. if (this.deviceId && this.serviceId && this.devices.length != 0) {
  449. uni.showModal({
  450. title: '提示',
  451. content: '确定要启动设备?',
  452. success: (res) => {
  453. if (res.confirm) {
  454. this.isChecked = true
  455. // 开始连接匹配的蓝牙设备
  456. setTimeout(async () => {
  457. // 请求获取设备启动码
  458. this.request_device_start_code()
  459. }, 300)
  460. } else if (res.cancel) {
  461. setTimeout(() => {
  462. this.isChecked = false
  463. }, 300)
  464. }
  465. }
  466. })
  467. } else {
  468. uni.showToast({
  469. icon: 'none',
  470. title: '先【扫码连接】,后【开启设备】',
  471. duration: 1500
  472. })
  473. setTimeout(() => {
  474. this.isChecked = false
  475. }, 300)
  476. }
  477. } else {
  478. uni.showModal({
  479. title: '提示',
  480. content: '确定要关闭设备?',
  481. success: (res) => {
  482. if (res.confirm) {
  483. this.isChecked = false
  484. if (this.deviceId && this.serviceId) {
  485. this.send('stop')
  486. } else {
  487. uni.showToast({
  488. icon: 'none',
  489. title: '与设备连接中断!请在设备上手动停止即可!',
  490. duration: 5000
  491. })
  492. setTimeout(() => {
  493. this.isChecked = true
  494. }, 300)
  495. }
  496. } else if (res.cancel) {
  497. setTimeout(() => {
  498. this.isChecked = true
  499. }, 300)
  500. }
  501. }
  502. })
  503. }
  504. },
  505. /**
  506. * 跳转到充值页面
  507. */
  508. chongzhi_yemian() {
  509. //在起始页面跳转到recharge.vue页面并传递参数
  510. uni.navigateTo({
  511. url: '../recharge/recharge'
  512. });
  513. },
  514. /**
  515. * 判断余额是否充足
  516. */
  517. judgeBalance(param) {
  518. var limit_amount = parseFloat(this.$store.state.amount)
  519. var amount = parseFloat(this.amount);
  520. // 启动最低金额限制
  521. if (amount < limit_amount) {
  522. uni.showModal({
  523. title: '提示',
  524. content: '当前余额不足¥' + limit_amount + '元',
  525. cancelText: '我知道了',
  526. confirmText: '我要充值',
  527. success: (res) => {
  528. if (res.confirm) {
  529. // 跳转充值页面
  530. this.chongzhi_yemian()
  531. // return false
  532. // } else if (res.cancel) {
  533. // return false
  534. }
  535. }
  536. })
  537. return false
  538. }
  539. // 已经启动扫描连接设备中
  540. if (this.isScan) {
  541. uni.showToast({
  542. icon: 'none',
  543. title: '正在扫描,请耐心等待',
  544. })
  545. return false
  546. }
  547. // 已经启动设备,不启动扫描
  548. if (this.isChecked) {
  549. let info_str = ''
  550. if (param == 'scan') {
  551. info_str = '设备已启动,无需重新扫码'
  552. } else {
  553. info_str = '设备已启动,无需重新启动'
  554. }
  555. uni.showToast({
  556. icon: 'none',
  557. title: info_str,
  558. })
  559. return false
  560. }
  561. // 设备已连接
  562. if (this.deviceId) {
  563. uni.showModal({
  564. title: '提示',
  565. content: '设备已经连接,需要重新连接吗?',
  566. success: res => {
  567. if (res.confirm) {
  568. this.closeBLEConnection()
  569. if (param == 'scan') {
  570. this.scan_qr()
  571. } else {
  572. uni.showToast({
  573. icon: 'none',
  574. title: '请选择宿舍号重新连接',
  575. duration: 3000
  576. })
  577. }
  578. }
  579. }
  580. })
  581. return false
  582. }
  583. },
  584. /**
  585. * 111111111111111111111111111111
  586. * 扫码连接设备
  587. */
  588. scan() {
  589. if (this.judgeBalance('scan') == false) {
  590. return
  591. }
  592. this.scan_qr()
  593. },
  594. /**
  595. * 启动摄像头,扫描二维码
  596. */
  597. scan_qr() {
  598. uni.scanCode({
  599. onlyFromCamera: true,
  600. success: (res) => {
  601. this.isScan = true
  602. // console.log(res)
  603. // charSet: "utf-8"
  604. // codeVersion: 3
  605. // errMsg: "scanCode:ok"
  606. // rawData: "aHR0cDovL3Rvb2xzLjlrYnMuY29tLz93eG1pbmljb2RlPUtCNTgwMDAyNjUy"
  607. // result: "http://tools.9kbs.com/?wxminicode=KB580002652"
  608. // scanType: "QR_CODE"
  609. this.device_code = res.result.split('=')[1]
  610. if (this.device_code === '') {
  611. uni.showToast({
  612. icon: 'success',
  613. title: '获取设备码失败',
  614. duration: 3000
  615. })
  616. this.isScan = false
  617. } else {
  618. // 初始化蓝牙
  619. this.openBluetoothAdapter()
  620. }
  621. }
  622. })
  623. },
  624. /**
  625. * 22222222222222222222222222222
  626. * 初始化蓝牙
  627. */
  628. openBluetoothAdapter() {
  629. uni.openBluetoothAdapter({
  630. success: (res) => { // 已打开
  631. uni.getBluetoothAdapterState({ // 蓝牙的匹配状态
  632. success: (res1) => {
  633. // console.log(res1, '“本机设备的蓝牙已打开”');
  634. // 本机设备的蓝牙已打开
  635. // 开始搜索蓝牙设备
  636. if (this.deviceId == '' && this.serviceId == '')
  637. this.startBluetoothDeviceDiscovery()
  638. },
  639. fail: (error) => {
  640. // console.log(error)
  641. uni.showToast({
  642. title: "请开启手机蓝牙",
  643. icon: "none",
  644. duration: 3000
  645. })
  646. this.isScan = false
  647. }
  648. });
  649. },
  650. fail: (err) => { // 未打开
  651. // console.log(err)
  652. this.isScan = false
  653. if (err.errCode == 10001) {
  654. uni.showModal({
  655. content: '请开启手机蓝牙!',
  656. showCancel: false,
  657. })
  658. } else {
  659. uni.showToast({
  660. icon: 'none',
  661. title: err.errMsg,
  662. duration: 2000
  663. })
  664. }
  665. }
  666. });
  667. },
  668. /**
  669. * 333333333333333333333333333
  670. * 开始搜索蓝牙设备
  671. */
  672. startBluetoothDeviceDiscovery() {
  673. uni.startBluetoothDevicesDiscovery({ // 开始搜寻附近的蓝牙外围设备
  674. // services: ['FEE7'], // 要搜索但蓝牙设备主 service 的 uuid 列表
  675. allowDuplicatesKey: true,
  676. success: (res) => {
  677. if (this.get_Bluetooth_Bevice == true)
  678. this.process_control(0)
  679. this.onBluetoothDeviceFound() // 监听搜索到新设备 同时进行
  680. setTimeout(() => {
  681. if (this.isScan) {
  682. uni.showModal({
  683. title: '温馨提示',
  684. content: '请确认已开启【蓝牙授权】或【定位授权】!',
  685. confirmText: '我已开启',
  686. cancelText: '取消',
  687. success: (res) => {
  688. if (res.confirm) {
  689. // console.log(res)
  690. } else if (res.cancel) {
  691. switch (uni.getSystemInfoSync().platform) {
  692. case 'android':
  693. // 打开设置
  694. break;
  695. case 'ios':
  696. // 打开设置
  697. break;
  698. default:
  699. // console.log('运行在开发者工具上')
  700. break;
  701. }
  702. }
  703. }
  704. })
  705. }
  706. }, 5000)
  707. },
  708. fail: err => {
  709. // console.log(err, '错误信息');
  710. uni.showToast({
  711. icon: 'none',
  712. title: err.errMsg,
  713. duration: 2000
  714. })
  715. this.isScan = false
  716. }
  717. })
  718. },
  719. stopBluetoothDevicesDiscovery() { //停止搜索
  720. uni.stopBluetoothDevicesDiscovery({
  721. success: (res) => {
  722. // console.log(res, '停止蓝牙搜索')
  723. // uni.showToast({
  724. // title: '停止蓝牙搜索',
  725. // duration: 2000
  726. // })
  727. if (this.get_Bluetooth_Bevice == true) {
  728. this.createBLEConnection()
  729. } else {
  730. this.get_Bluetooth_Bevice = true
  731. this.get_room()
  732. }
  733. },
  734. fail: err => {
  735. // console.log('停止搜索蓝牙设备失败,错误码:' + err.errCode);
  736. this.isScan = false
  737. uni.showToast({
  738. title: err.errCode,
  739. duration: 2000
  740. })
  741. }
  742. })
  743. },
  744. /**
  745. * 444444444444444444444444444444444
  746. * 发现外围设备
  747. */
  748. onBluetoothDeviceFound() {
  749. uni.onBluetoothDeviceFound((res) => {
  750. let dname = ''
  751. res.devices.forEach(device => { // 筛选找到的蓝牙中对名称匹配
  752. // 过滤掉没有名字的设备
  753. if (!device.name && !device.localName) {
  754. return
  755. }
  756. // 把搜索到的设备存储起来,如有需要可以在页面上展示
  757. dname = device.name.substr(1)
  758. let d = {
  759. did: device.deviceId,
  760. dname: dname
  761. }
  762. if (dname.length == 10 && JSON.stringify(this.devices).indexOf(JSON.stringify(
  763. d)) === -1) {
  764. this.devices.push(d)
  765. }
  766. if (device.name == this.device_code) {
  767. this.process_control(0);
  768. //data里面建立一个deviceId、device_code,存储起来
  769. // this.device_code = device.name;
  770. this.deviceId = device.deviceId
  771. // 放此位置,苹果手机兼容
  772. this.stopBluetoothDevicesDiscovery()
  773. return
  774. }
  775. setTimeout(() => {
  776. this.stopBluetoothDevicesDiscovery()
  777. }, 2000)
  778. })
  779. });
  780. },
  781. // 获取水表对应的宿舍号
  782. async get_room() {
  783. if (this.devices.length > 0) {
  784. let devices_str = []
  785. for (var i = 0, len = this.devices.length; i < len; i++) {
  786. devices_str.push(this.devices[i].dname)
  787. }
  788. const res = await this.$myRequest({
  789. host: this.ceshi,
  790. url: '/HotWaters/waterqueryDom.action',
  791. method: 'POST',
  792. header: {
  793. 'content-type': 'application/x-www-form-urlencoded'
  794. },
  795. data: {
  796. user_id: devices_str.join(',')
  797. }
  798. });
  799. if (res.data.msg == '获取成功') {
  800. this.rooms = []
  801. // 消费记录
  802. let items = res.data.data
  803. if (items == 'undefined') {
  804. return
  805. }
  806. for (var i = 0; i < items.length; i++) {
  807. let item = {
  808. id: items[i].user_id,
  809. room: items[i].dom
  810. }
  811. if (JSON.stringify(this.rooms).indexOf(JSON.stringify(item)) === -1) {
  812. this.rooms.push(item); // 进行动态的操作
  813. }
  814. }
  815. } else {
  816. if (this.changeDate) {
  817. uni.showToast({
  818. icon: 'success',
  819. title: res.data.mess,
  820. success: () => {
  821. this.changeDate = false
  822. }
  823. })
  824. if (res.data.mess == '本月无消费记录') {
  825. this.xiaofei_items = []
  826. }
  827. }
  828. }
  829. }
  830. },
  831. /**
  832. * 555555555555555555555555555555555
  833. * 连接蓝牙设备
  834. */
  835. createBLEConnection() {
  836. //连接蓝牙
  837. uni.createBLEConnection({
  838. deviceId: this.deviceId,
  839. timeout: 5000,
  840. success: (res) => {
  841. // console.log(res)
  842. this.connect_BLE()
  843. },
  844. fail: (err) => {
  845. // console.log(err)
  846. this.isScan = false
  847. if (err.errMsg.indexOf('already connect') != -1) {
  848. this.connect_BLE()
  849. } else {
  850. // uni.showToast({
  851. // title: '未知错误,请重连1次。',
  852. // icon: 'none',
  853. // duration: 3000,
  854. // success: (res1) => {
  855. // this.setInit()
  856. // }
  857. // })
  858. }
  859. }
  860. })
  861. },
  862. connect_BLE() {
  863. if (this.isConnected === false) {
  864. this.isConnected = true
  865. // 获取蓝牙设备所有服务(service)
  866. this.getBLEDeviceServices()
  867. }
  868. },
  869. /**
  870. * 6666666666666666666666666666666666
  871. * 获取蓝牙的所有服务
  872. */
  873. getBLEDeviceServices() {
  874. uni.getBLEDeviceServices({
  875. deviceId: this.deviceId,
  876. success: (res) => {
  877. // console.log(res)
  878. // res1.services.forEach((item) => {
  879. // this.getBLEDeviceCharacteristics()
  880. // })
  881. this.serviceId = res.services[1].uuid
  882. this.process_control(1);
  883. this.getBLEDeviceCharacteristics()
  884. },
  885. fail: (err) => {
  886. // console.log(err)
  887. this.isScan = false
  888. uni.showToast({
  889. title: '获取服务失败',
  890. icon: 'none',
  891. duration: 3000
  892. })
  893. return
  894. }
  895. });
  896. },
  897. /**
  898. * 777777777777777777777777777777777
  899. * 获取蓝牙特征
  900. */
  901. getBLEDeviceCharacteristics() {
  902. // 获取蓝牙设备某个服务中所有特征值(characteristic)
  903. uni.getBLEDeviceCharacteristics({
  904. deviceId: this.deviceId,
  905. // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
  906. serviceId: this.serviceId,
  907. success: (res) => {
  908. // console.log(res)
  909. this.characteristicIdForWrite = res.characteristics[0].uuid
  910. this.characteristicIdForNotity = res.characteristics[1].uuid
  911. this.deviceIsWrite = res.characteristics[0].properties.write
  912. this.deviceIsNotify = res.characteristics[1].properties.notify
  913. // console.log(this.characteristicIdForWrite, this.characteristicIdForNotity)
  914. // 确保对应服务id下的特征值id具备监听数据变化的特性
  915. if (res.characteristics[1].properties.notify) {
  916. this.notifyBLECharacteristicValueChange()
  917. }
  918. },
  919. fail: (err) => {
  920. this.isScan = false
  921. // console.error('获取蓝牙设备特征值失败(getBLEDeviceCharacteristics)', err)
  922. }
  923. });
  924. },
  925. /**
  926. * 888888888888888888888888888888888888
  927. * 启用 notify 功能
  928. */
  929. notifyBLECharacteristicValueChange() {
  930. uni.notifyBLECharacteristicValueChange({
  931. state: true, // 启用 notify 功能
  932. deviceId: this.deviceId,
  933. // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
  934. serviceId: this.serviceId,
  935. // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取
  936. characteristicId: this.characteristicIdForNotity,
  937. success: (res) => {
  938. this.process_control(2)
  939. uni.showToast({
  940. icon:'none',
  941. title:'需要启动请点【开启设备】开关',
  942. duration: 3000
  943. })
  944. this.isScan = false
  945. // console.log('通知启用(notifyBLECharacteristicValueChange)',res);
  946. this.onBLECharacteristicValueChange()
  947. setTimeout(() => {
  948. // 发送 AAABAC,采集数据(会返回 35字节 的数据)
  949. this.send('')
  950. }, 800)
  951. // // 请求设备信息
  952. // this.request_device_info()
  953. // // 显示设备启动授权金额
  954. // this.display_device_startup_amount()
  955. },
  956. fail: (err) => {
  957. // console.log(err)
  958. this.isScan = false
  959. uni.showModal({
  960. content: err.errMsg,
  961. showCancel: false
  962. })
  963. // 初始化
  964. this.setInit()
  965. }
  966. })
  967. },
  968. /**
  969. * 999999999999999999999999999999999
  970. * 监听低功耗蓝牙设备的特征值变化
  971. */
  972. onBLECharacteristicValueChange() {
  973. uni.onBLECharacteristicValueChange((characteristic) => {
  974. let condition = this.ab2hex(characteristic.value)
  975. // console.log(condition)
  976. if (condition.length > 2) {
  977. this.byte35_tmp += condition
  978. if (this.byte35_tmp.length > 40) {
  979. this.byte35 = this.byte35_tmp
  980. this.byte35_tmp = ''
  981. if (this.byte35.startsWith('ad')) {
  982. // console.log(this.byte35, '结束用水成功')
  983. // 关闭蓝牙连接
  984. this.closeBLEConnection()
  985. // 请求结算
  986. this.request_pay()
  987. } else {
  988. // 发送 AAABAC,采集数据(会返回 35字节 的数据)
  989. // b58000265243eb3dd4bb3c5a2ab9042efcf0d2a30a000000000000000014392a0103bc
  990. // uni.showToast({
  991. // icon: 'success',
  992. // title: '采集数据成功!',
  993. // duration: 2000
  994. // })
  995. // console.log(this.byte35, '采集上一条消费数据')
  996. }
  997. }
  998. }
  999. switch (condition) {
  1000. case 'bb':
  1001. // uni.showToast({
  1002. // title: '设备启动成功',
  1003. // duration: 3000,
  1004. // icon: 'none'
  1005. // })
  1006. this.isChecked = true
  1007. break
  1008. case 'bc':
  1009. uni.showToast({
  1010. title: '启动失败,设备检验启动代码不通过',
  1011. duration: 3000,
  1012. icon: 'none'
  1013. })
  1014. break
  1015. case 'aa':
  1016. uni.showToast({
  1017. title: '设备正在使用',
  1018. duration: 3000,
  1019. icon: 'none'
  1020. })
  1021. break
  1022. case 'ab':
  1023. uni.showToast({
  1024. title: '结束失败,设备对结束代码检验失败',
  1025. duration: 3000,
  1026. icon: 'none'
  1027. })
  1028. break
  1029. default:
  1030. break
  1031. }
  1032. })
  1033. },
  1034. /**
  1035. * 关闭连接
  1036. */
  1037. closeBLEConnection() {
  1038. uni.closeBLEConnection({
  1039. deviceId: this.deviceId,
  1040. success: () => {
  1041. // 关闭蓝牙模块
  1042. this.closeBluetoothAdapter()
  1043. },
  1044. fail: () => {
  1045. this.setInit()
  1046. // uni.showToast({
  1047. // icon: 'none',
  1048. // title: '蓝牙连接断开失败',
  1049. // duration: 3000,
  1050. // success: (res1) => {
  1051. // this.setInit()
  1052. // }
  1053. // })
  1054. }
  1055. })
  1056. },
  1057. closeBluetoothAdapter() {
  1058. // 关闭蓝牙模块
  1059. uni.closeBluetoothAdapter({
  1060. success: () => {
  1061. this.setInit()
  1062. if (this.isUserClose == false) { // 设备端结束用水
  1063. if (this.isChecked) {
  1064. // console.log('设备端已结束用水,蓝牙断开成功')
  1065. uni.showToast({
  1066. icon: 'none',
  1067. title: '设备端已结束用水,蓝牙断开成功',
  1068. duration: 3000
  1069. })
  1070. } else {
  1071. // console.log('用户重启扫描,蓝牙断开成功')
  1072. uni.showToast({
  1073. icon: 'none',
  1074. title: '用户重启扫描,蓝牙断开成功',
  1075. duration: 3000
  1076. })
  1077. }
  1078. } else { // 手机移动端结束用水
  1079. // console.log('APP端已结束用水,蓝牙断开成功')
  1080. uni.showToast({
  1081. icon: 'none',
  1082. title: 'APP端已结束用水,蓝牙断开成功',
  1083. duration: 3000
  1084. })
  1085. }
  1086. }
  1087. })
  1088. },
  1089. setInit() {
  1090. setTimeout(() => {
  1091. this.isUserClose = false
  1092. this.isChecked = false
  1093. this.isConnected = false
  1094. this.isScan = false
  1095. this.active = -1
  1096. this.devices = [] // 保存设备
  1097. this.device_code = '' // 设备编号
  1098. this.deviceId = ''
  1099. this.serviceId = ''
  1100. this.characteristicIdForWrite = ''
  1101. this.characteristicIdForNotity = ''
  1102. this.deviceIsNotify = false
  1103. this.deviceIsWrite = false
  1104. this.byte35 = '' // 70 个字符
  1105. this.byte35_tmp = '' // 70 个字符 临时变量
  1106. // this.start_code = ''
  1107. })
  1108. },
  1109. /**
  1110. * 10===========10==================10
  1111. * 发送数据到设备
  1112. */
  1113. send(val) {
  1114. let buffer
  1115. let dataView
  1116. let newArr
  1117. if (val == 'start') { // 启动设备
  1118. this.isUserClose = false
  1119. // 发送 17字节 启动代码(会返回 35字节 的数据)
  1120. // b58000265243eb3dd4bb3c5a2ab9042efcf0d2a30a000000000000000014392a0103bc
  1121. newArr = this.str2StrArray(this.start_code)
  1122. } else if (val == 'stop') { // 结束当前使用,设备成功返回:AD+35字节 消费结算代码
  1123. this.isUserClose = true
  1124. // 发送 AAABAD+17字节 启动代码(会返回 ad+35字节 的数据)
  1125. // adb58000265243eb3dd4bb3c5a2ab9042efcf0d2a30a000000000000000014392a0104bc
  1126. newArr = ['AA', 'AB', 'AD'].concat(this.str2StrArray(this.start_code))
  1127. } else {
  1128. // 发送 AAABAC 采集数据(会返回 35字节 的数据)
  1129. // b58000265243eb3dd4bb3c5a2ab9042efcf0d2a30a000000000000000014392a0103bc
  1130. newArr = ['AA', 'AB', 'AC']
  1131. }
  1132. buffer = new ArrayBuffer(newArr.length)
  1133. dataView = new DataView(buffer)
  1134. newArr.forEach((item, i) => {
  1135. dataView.setUint8(i, this.sixteen_to_ten(item))
  1136. })
  1137. // 写特征值数据到设备
  1138. if (this.deviceIsWrite) {
  1139. // 写数据到设备
  1140. this.writeBLECharacteristicValue(val, buffer)
  1141. } else {
  1142. uni.showToast({
  1143. title: '设备不可写',
  1144. duration: 3000
  1145. })
  1146. }
  1147. },
  1148. /**
  1149. * 11====================11=====================11
  1150. * 写数据到设备
  1151. */
  1152. writeBLECharacteristicValue(val, buffer) {
  1153. uni.writeBLECharacteristicValue({
  1154. deviceId: this.deviceId,
  1155. // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
  1156. serviceId: this.serviceId,
  1157. // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取
  1158. characteristicId: this.characteristicIdForWrite,
  1159. // 这里的value是ArrayBuffer类型
  1160. value: buffer,
  1161. success: (res) => {
  1162. // console.log(res)
  1163. if (val == 'start') {
  1164. setTimeout(() => {
  1165. this.isChecked = true
  1166. this.isConnected = true
  1167. }, 300)
  1168. this.process_control(3)
  1169. } else if (val == 'stop') {
  1170. setTimeout(() => {
  1171. this.isChecked = false
  1172. }, 300)
  1173. }
  1174. },
  1175. fail: (err) => {
  1176. // console.log(err)
  1177. if (err.errCode == 10006) {
  1178. setTimeout(() => {
  1179. this.setInit()
  1180. }, 300)
  1181. if (this.isConnected) {
  1182. uni.showToast({
  1183. title: '设备连接已断开!请在水表上手动停止!',
  1184. icon: 'none'
  1185. })
  1186. } else {
  1187. uni.showToast({
  1188. title: '设备连接失败!请重试扫描连接!',
  1189. icon: 'none'
  1190. })
  1191. }
  1192. }
  1193. }
  1194. })
  1195. },
  1196. /**
  1197. * 请求获取设备启动码
  1198. */
  1199. async request_device_start_code() {
  1200. if (this.byte35 != '' && this.stu_number != '') {
  1201. const res = await this.$myRequest({
  1202. host: this.ceshi,
  1203. url: '/HotWaters/wpstart.action',
  1204. data: {
  1205. collect_code: this.byte35,
  1206. stu_number: this.stu_number
  1207. }
  1208. })
  1209. // console.log(res)
  1210. let sc = res.data.start_code
  1211. if (typeof(sc) != 'undefined' && sc != '') {
  1212. this.start_code = sc
  1213. setTimeout(() => {
  1214. this.send('start')
  1215. }, 100)
  1216. // 刷新选定的月份消费记录
  1217. this.request_consumption_records()
  1218. } else {
  1219. this.isChecked = false
  1220. uni.showToast({
  1221. icon: 'none',
  1222. title: res.data.mess,
  1223. duration: 3000,
  1224. })
  1225. }
  1226. } else {
  1227. uni.showToast({
  1228. icon: 'none',
  1229. title: '字节码或学号为空!'
  1230. });
  1231. // 初始化
  1232. this.setInit()
  1233. }
  1234. },
  1235. /**
  1236. * 请求结算
  1237. */
  1238. async request_pay() {
  1239. if (this.byte35 != '') {
  1240. const res = await this.$myRequest({
  1241. host: this.ceshi,
  1242. url: '/HotWaters/wpconsume.action',
  1243. data: {
  1244. stu_number: this.stu_number,
  1245. user_name: this.user_name,
  1246. collect_code: this.byte35.substring(2)
  1247. }
  1248. })
  1249. // console.log(res)
  1250. if (res.data.mess == "支付成功") {
  1251. uni.showToast({
  1252. icon: 'success',
  1253. title: '结算成功!',
  1254. success: (res1) => {
  1255. this.use_amount = res.data.use_amount.toFixed(2)
  1256. this.amount = (this.amount - this.use_amount).toFixed(2)
  1257. this.$store.state.reshui_amount = this.amount
  1258. // 刷新选定的月份消费记录
  1259. this.request_consumption_records()
  1260. }
  1261. })
  1262. } else {
  1263. uni.showToast({
  1264. icon: 'none',
  1265. title: res.data.mess,
  1266. duration: 3000
  1267. })
  1268. }
  1269. } else {
  1270. uni.showToast({
  1271. icon: 'success',
  1272. title: '字节码为空!'
  1273. });
  1274. // 初始化
  1275. this.setInit()
  1276. }
  1277. },
  1278. /**
  1279. * 返回字符处理
  1280. */
  1281. str2StrArray(start_code) {
  1282. if (typeof(start_code) == 'undefined' || start_code == '') {
  1283. uni.showToast({
  1284. icon: 'none',
  1285. title: '设备码获取失败'
  1286. })
  1287. this.setInit()
  1288. return
  1289. }
  1290. if (start_code.length != 34) {
  1291. // console.log('启动码长度错误')
  1292. throw new Error("启动码长度错误");
  1293. return
  1294. }
  1295. var resultArray = new Array()
  1296. for (var i = 0; i < start_code.length; i += 2) {
  1297. resultArray.push(start_code.substr(i, 2));
  1298. }
  1299. return resultArray;
  1300. },
  1301. /**
  1302. * ArrayBuffer转16进度字符串
  1303. */
  1304. ab2hex(buffer) {
  1305. const hexArr = Array.prototype.map.call(
  1306. new Uint8Array(buffer),
  1307. function(bit) {
  1308. // console.log('====================' + bit + '==========================')
  1309. return ('00' + bit.toString(16)).slice(-2)
  1310. }
  1311. )
  1312. return hexArr.join('');
  1313. },
  1314. /**
  1315. * 16进制转10进制
  1316. */
  1317. sixteen_to_ten(str) {
  1318. return parseInt(str, 16);
  1319. }
  1320. }
  1321. }
  1322. </script>
  1323. <style scoped lang="scss">
  1324. .content {
  1325. width: 100%;
  1326. height: 100%;
  1327. .container {
  1328. width: 100%;
  1329. padding: 20rpx 40rpx;
  1330. box-sizing: border-box;
  1331. .header {
  1332. display: flex;
  1333. justify-content: center;
  1334. position: relative;
  1335. height: 200rpx;
  1336. .scan {
  1337. display: flex;
  1338. flex-direction: column;
  1339. justify-content: center;
  1340. align-items: center;
  1341. height: 200rpx;
  1342. width: 30%;
  1343. .iconfont {
  1344. margin-bottom: 10rpx;
  1345. font-size: 100rpx;
  1346. color: $my-color-primary;
  1347. }
  1348. }
  1349. .scan_hover {
  1350. border-radius: 15rpx;
  1351. background-color: $my-color-btn-background;
  1352. }
  1353. .qinshihao {
  1354. display: flex;
  1355. align-items: center;
  1356. position: fixed;
  1357. top: 20rpx;
  1358. right: 30rpx;
  1359. font-size: 28rpx;
  1360. .icon-zhuye {
  1361. margin-right: 10rpx;
  1362. font-family: Microsoft YaHei-3970(82674968);
  1363. color: $my-color-primary;
  1364. }
  1365. .compustxt {
  1366. font-size: 18rpx;
  1367. }
  1368. }
  1369. }
  1370. .start_text {
  1371. .start_top,
  1372. .start_mid {
  1373. display: flex;
  1374. justify-content: space-between;
  1375. height: 100rpx;
  1376. align-items: center;
  1377. border-bottom: 2rpx #ccc solid;
  1378. .item_left {
  1379. display: flex;
  1380. align-items: center;
  1381. }
  1382. .start_mid_txt {
  1383. color: #333;
  1384. font-size: 30rpx;
  1385. }
  1386. .iconfont {
  1387. font-size: 50rpx;
  1388. color: $my-color-primary;
  1389. margin-right: 20rpx;
  1390. }
  1391. .start_payamount {
  1392. display: flex;
  1393. justify-content: flex-end;
  1394. align-items: center;
  1395. font-size: 38rpx;
  1396. padding: 10rpx;
  1397. font-family: Microsoft YaHei-3970(82674968);
  1398. color: #B2B2B2;
  1399. border-radius: 10rpx;
  1400. .icon-dayuhao {
  1401. margin: 0 0 0 20rpx;
  1402. font-size: 38rpx;
  1403. color: #B2B2B2;
  1404. }
  1405. }
  1406. }
  1407. .start_bot {
  1408. display: flex;
  1409. justify-content: space-between;
  1410. height: 100rpx;
  1411. align-items: center;
  1412. .kongzhonglianjie {
  1413. margin: 0;
  1414. height: 60rpx;
  1415. line-height: 60rpx;
  1416. font-size: 28rpx;
  1417. background-color: #1296DB;
  1418. color: #FFFFFF;
  1419. }
  1420. .start_bot_txt {
  1421. margin-left: 20rpx;
  1422. color: #333;
  1423. font-size: 28rpx;
  1424. }
  1425. }
  1426. }
  1427. .btn_room {
  1428. font-size: 28rpx;
  1429. background-color: #41c560;
  1430. margin: 10rpx auto;
  1431. }
  1432. .start_up_process {
  1433. padding: 20rpx 0;
  1434. color: #007AFF;
  1435. }
  1436. .ad {
  1437. margin: 0 -40rpx;
  1438. width: 750rpx;
  1439. height: 216rpx;
  1440. .ad_img {
  1441. height: 100%;
  1442. width: 100%;
  1443. }
  1444. }
  1445. .title {
  1446. height: 100rpx;
  1447. margin: 0 -40rpx;
  1448. padding: 0 40rpx;
  1449. line-height: 100rpx;
  1450. color: #808080;
  1451. font-size: 32rpx;
  1452. background: #f2f2f2;
  1453. }
  1454. .record-item {
  1455. width: 100%;
  1456. .uni-list-cell-db {
  1457. height: 100rpx;
  1458. line-height: 100rpx;
  1459. font-weight: bold;
  1460. .uni-input {
  1461. display: flex;
  1462. align-items: center;
  1463. text:nth-child(1) {
  1464. margin-right: 10rpx;
  1465. }
  1466. }
  1467. }
  1468. .item-list {
  1469. height: 80rpx;
  1470. display: flex;
  1471. align-items: center;
  1472. justify-content: space-between;
  1473. border-top: 2rpx #ccc solid;
  1474. .icon-shijian {
  1475. margin-right: 8rpx;
  1476. }
  1477. .icon-shuidi {
  1478. margin-right: 3rpx;
  1479. }
  1480. .item-list-txt {
  1481. font-size: 28rpx;
  1482. &:nth-of-type(2) {
  1483. color: #515151;
  1484. }
  1485. &:nth-of-type(3) {
  1486. color: #f76200;
  1487. font-size: 32rpx;
  1488. }
  1489. }
  1490. }
  1491. }
  1492. }
  1493. }
  1494. </style>