reshui.vue 39 KB

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