reshui.vue 39 KB

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