| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970 |
- <template>
- <view class="content">
- <view class="container">
- <view class="header">
- <view class="scan" @tap="scan()" hover-class="scan_hover">
- <!-- <text class="iconfont icon-saoma"></text> -->
- <image :src="require('./images/icon-saoma.png')" style="width: 118rpx;" mode="aspectFit"></image>
- <text>扫码连接</text>
- </view>
- <view class="qinshihao">
- <!-- <text class="iconfont icon-zhuye"></text> -->
- <image :src="require('./images/icon-zhuye.png')" style="width: 28rpx; margin-right: 8rpx;" mode="aspectFit"></image>
- <text class="dormtxt">{{dorm_number || '宿舍未知'}}</text>
- </view>
- </view>
- <view class="start_text">
- <view class="start_top">
- <view class="item_left">
- <text class="iconfont icon-shuibiao"></text>
- <text>开启设备</text>
- </view>
- <view>
- <switch :color="colorPrimary" :checked="isChecked" @change="switchChange" />
- </view>
- </view>
- <view class="start_mid">
- <view class="item_left">
- <text class="iconfont icon-qian"></text>
- <!-- <navigator url="/pagesWater/reshuiDetails/reshuiDetails" open-type="navigate"
- class="start_mid_txt">¥{{amount}}</navigator> -->
- <navigator url="" open-type="navigate" class="start_mid_txt">¥{{amount}}</navigator>
- </view>
- <view class="start_payamount" @tap="chongzhi_yemian()" hover-class="scan_hover">
- <text>点击充值</text>
- <image :src="require('./images/icon-dayuhao.png')" style="width: 26rpx; margin-left: 10rpx; padding-top: 3rpx; opacity: 0.6;"
- mode="aspectFit">
- </image>
- <!-- <text class="iconfont icon-dayuhao"></text> -->
- </view>
- </view>
- <view class="start_bot">
- <button class="kongzhonglianjie" @click="open">空中连接</button>
- <text class="start_bot_txt">当前结算消费:¥{{use_amount}}</text>
- </view>
- </view>
- <view v-if="showRoom" style="width: 100%; height: 100%; ">
- <view style="display: flex; flex-wrap: wrap;">
- <button v-for="item in rooms" :key="item.id" @tap="clickRoom(item.id)" class="btn_room">{{item.room}}</button>
- </view>
- </view>
- <view class="start_up_process">
- <uni-steps :options="list1" :active-color="colorPrimary" :active="active" />
- </view>
- <!-- <view class="ad">
- <image src="../../static/images/ad_reshui.jpg" mode="aspectFill" class="ad_img" @tap="ad_redirect">
- </image>
- </view> -->
- <view class="title">
- 消费记录
- </view>
- <view class="record-item">
- <view class="uni-list-cell-db">
- <picker mode="date" :value="date" fields="month" :start="startDate" :end="endDate" @change="bindDateChange">
- <view class="uni-input">
- <text>{{date}}</text>
- <!-- <text class="iconfont icon-arrow-down"></text> -->
- <image :src="require('./images/icon-arrow-down.png')" style="width: 26rpx;" mode="aspectFit">
- </image>
- </view>
- </picker>
- </view>
- <view class="item-list" v-for="(item, i) in xiaofei_items" :key="i">
- <text class="item-list-txt"><text class="iconfont icon-shijian"></text>{{item.begin_time}}</text>
- <text class="item-list-txt"><text class="iconfont icon-shuidi"></text>{{numFilter(item.use_size, 'l')}} t</text>
- <text class="item-list-txt">{{numFilter(item.use_amount, 'm')}}</text>
- </view>
- </view>
- </view>
- <instructions v-if="flag" @parent_cancel="cancel" @parent_noshow='noshow'></instructions>
- <view class="operation-manual">
- <button class="default-btn floating-button-manual" @tap="showPopup = true"></button>
- </view>
- <view class="call">
- <button class="default-btn floating-button-call" @tap="makeCall"></button>
- </view>
- <Popup :showPopup="showPopup" @close="showPopup = false">
- <scroll-view class="article" scroll-y>
- <view class="desc-title">{{ article.title }}</view>
- <view v-for="(section, index) in article.sections" :key="index" class="section">
- <view v-if="section.red == true" class="section-title-red">{{ section.title }}</view>
- <view v-else class="section-title">{{ section.title }}</view>
- <view class="section-content">{{ section.content }}</view>
- </view>
- <view class="desc-footer"></view>
- </scroll-view>
- </Popup>
- </view>
- </template>
- <script>
- import instructions from '../../components/instructions.vue'
- import Popup from '@/components/Popup.vue';
- export default {
- /**
- * 声明组件
- */
- components: {
- instructions,
- Popup
- },
- data() {
- return {
- colorPrimary: getApp().globalData.primaryColor,
- date: this.$getDate({
- format: true
- }),
- startDate: this.$getDate('start_date'),
- endDate: this.$getDate('end_date'),
- flag: false, // 控制说明弹窗
- showRoom: false,
- isUserClose: false, // 是否是用户自己关闭
- isChecked: false,
- isConnected: false, // 是否连接上
- isScan: false,
- active: -1,
- list1: [{
- title: '连接设备'
- }, {
- title: '连设备服务'
- }, {
- title: '数据通讯'
- }, {
- title: '启动'
- }],
- devices: [], // 保存设备
- rooms: [], // 保存水表id及对应的宿舍号
- device_code: '', // 设备编号
- deviceId: '',
- serviceId: '',
- characteristicIdForWrite: '',
- characteristicIdForNotity: '',
- deviceIsNotify: false,
- deviceIsWrite: false,
- byte35: '', // 70 个字符
- byte35_tmp: '', // 70 个字符 临时变量
- start_code: '',
- // start_code: '3459A8C660F1C284E41003E80000120000',
- xiaofei_items: [], // 消费记录
- use_amount: 0.0.toFixed(2), // 结算金额
- amount: 0.0.toFixed(2), // 余额
- dorm_number: '', // 宿舍号
- stu_number: '', // 学号
- user_name: '',
- // compus: '', // 校区
- ceshi: 'code',
- changeDate: false, // 是否是手动选择日期
- get_Bluetooth_Bevice: false, // 自动获取蓝牙设备,并列表
- timer: -1,
- test: this.$store.state.test,
- showPopup: false,
- article: {
- title: "蓝牙卡控操作说明",
- sections: [{
- title: "蓝牙卡控使用方式为:",
- content: " 用微信【扫一扫】功能,扫描热水表上的二维码。",
- red: false
- },
- {
- title: "如遇连接热水表问题,请先检查:",
- content: " 1.蓝牙本身无故障,且手机蓝牙和GPS定位要开启,并要授权。\n" +
- " 2.手机系统要求出厂自带的,系统版本低于安卓4.3或刷过机的,可能搜索不到热水表。\n" +
- " 3.之前已经连接过热水表需正常退出,否则再次连接可能搜索不到热水表,需关闭蓝牙5秒钟后再尝试。\n" +
- " 4.热水表有人在使用,热水表肯定连接不了。\n" +
- " 5.用微信分身,连接热水表会存在意想不到的问题。\n" +
- " 6.在连接热水表前,请断开如蓝牙耳机、蓝牙音像等其他蓝牙设备。",
- red: false
- },
- {
- title: "如以上检查没问题,部分手机请检查以下权限是否打开(以下路径不能保证绝对正确,不同手机品牌和版本号会有区别,可自行百度或联系客服):",
- content: "",
- red: true
- },
- {
- title: "华为手机:",
- content: " 设置→安全和隐私→定位服务→打开“访问我的位置信息”。\n" +
- " 设置→应用和通知→权限管理→微信→打开“您的位置”。",
- red: false
- },
- {
- title: "小米手机:",
- content: " 设置→更多设置→系统安全→位置信息→开启“位置服务”。\n" +
- " 设置→授权管理→应用授权管理→微信→开启“定位”。",
- red: false
- },
- {
- title: "苹果手机:",
- content: " 设置→隐私→打开“定位服务”。\n" +
- " 设置→微信→位置→使用应用期间。",
- red: false
- },
- {
- title: "OPPO手机:",
- content: " 设置→GPS定位→开启“允许访问我的位置信息。\n" +
- " 设置→权限隐私→按应用管理权限→微信→授权。",
- red: false
- },
- {
- title: "VIVO手机:",
- content: " 设置→定位服务→开启。\n" +
- " 设置→更多设置→权限管理→微信→定位手机选择“允许”。",
- red: false
- },
- {
- title: "三星手机:",
- content: " 设置→连接→打开定位服务。\n" +
- " 设置→应用程序→微信→权限→开启位置信息。",
- red: false
- },
- {
- title: "魅族手机:",
- content: " 设置→定位服务→开启:\n" +
- " 设置→应用管理→选择已安装→微信→权限管理→获取定位(允许)。",
- red: false
- },
- {
- title: "多卡号(一个人有2个以上微信身份卡号)扣款问题:",
- content: " 遇到多卡,扣款会从第1次绑定的卡中扣款,如想从指定的卡中扣款,请先删除微信小程序(微信界面下拉,长按本小程序并拖动删除),再用指定的卡进入即可。",
- red: true
- }
- ]
- }
- }
- },
- onLoad(options) {
- // console.log(options);
- // 系统正在维护...
- if (this.test == 'weihuzhong') {
- uni.redirectTo({
- url: '../../pages/index/index'
- })
- return;
- }
- // 向用户发起授权请求
- uni.authorize({
- scope: 'scope.userLocation',
- success(res) {
- uni.getLocation({
- success: (loc) => {
- // console.log(loc);
- uni.showToast({
- icon: 'success',
- title: '已获定位信息'
- })
- },
- fail: (err) => {
- uni.showToast({
- icon: 'none',
- title: '获取定位失败,请手动开启定位!'
- })
- }
- })
- },
- fail: (err) => {
- // console.log(err);
- uni.showToast({
- icon: 'none',
- title: '请手动设置定位授权!'
- })
- }
- })
- if (typeof(options) != 'undefined' && typeof(options) != '' && JSON.stringify(options) == '{}') {
- // 获取基本信息
- this.get_base_info(options, 'onLoad')
- } else if (typeof(options.from) != 'undefined' && options.from != 0) {
- // 获取基本信息
- this.get_base_info(options, 'onLoad')
- // 获取设备码
- this.device_code = decodeURIComponent(options.q).split('=')[1]
- }
- const value = uni.getStorageSync('instruction_noshow');
- if (!(value == true)) {
- this.flag = true
- }
- },
- onShow() {
- let _this = this;
- // 充值后更新金额
- this.amount = this.$store.state.reshui_amount
- // 刷新充值后的金额
- uni.$once('update_reshui_amount', (data) => {
- this.get_base_info('options', 'onShow');
- });
- if (this.timer > -1) {
- clearInterval(this.timer)
- }
- this.timer = setInterval(() => {
- uni.openBluetoothAdapter({
- success: (res) => { // 已打开
- uni.getBluetoothAdapterState({ // 蓝牙的匹配状态
- success: (res1) => {
- // console.log(res1);
- },
- fail: (error) => {
- // console.log(error)
- uni.showToast({
- title: '请开启手机蓝牙!',
- icon: 'none',
- duration: 2000
- });
- }
- });
- },
- fail: (err) => { // 未打开
- // console.log(err)
- if (err.errCode == 10001) {
- uni.showToast({
- title: '请开启手机蓝牙 或 授权蓝牙权限!',
- icon: 'none',
- duration: 2000
- });
- setTimeout(() => {
- _this.myInit();
- }, 100);
- } else {
- uni.showToast({
- icon: 'none',
- title: err.errMsg,
- duration: 2000
- });
- }
- }
- });
- }, 3000);
- },
- onHide() {
- clearInterval(this.timer)
- },
- onUnload() {
- clearInterval(this.timer)
- },
- methods: {
- /**
- * 拨号
- */
- makeCall() {
- uni.makePhoneCall({
- phoneNumber: '18312075670' // 替换为您想要拨打的电话号码
- });
- },
- /**
- * 单击连接热水表
- */
- clickRoom(e) {
- try {
- if (this.judgeBalance('clickRoom') === false) {
- return
- } else {
- this.device_code = 'K' + e
- for (var i = 0, len = this.devices.length; i < len; i++) {
- if (this.devices[i].dname == e) {
- this.deviceId = this.devices[i].did
- break
- }
- }
- // 开始连接匹配的蓝牙设备
- this.createBLEConnection();
- }
- } catch (e) {
- console.log('单击连接热水表:' + e.message);
- }
- },
- /**
- * 空中连接热水表
- */
- open() {
- if (this.judgeBalance('clickRoom') === false) {
- return
- } else {
- this.setInit()
- uni.showLoading({
- title: '水表搜索中…',
- mask: true,
- success: (res) => {
- // 获取蓝牙设备,并列表
- this.openBluetoothAdapter();
- this.showRoom = true
- }
- })
- setTimeout(function() {
- uni.hideLoading();
- }, 3000);
- }
- },
- /**
- * 跳转到广告ad页
- */
- ad_redirect() {
- // uni.navigateTo({
- // url: 'ad_reshui'
- // })
- },
- /**
- * 保留小数点数值后两位,尾数四舍五入
- * @param {Object} value
- */
- numFilter(value, param) {
- var v = parseFloat(value);
- if (param == 'l')
- return v.toFixed(2);
- else
- // 截取当前数据到小数点后两位
- return v.toFixed(2);
- },
- /**
- * 获取基本信息
- */
- get_base_info(options, param) {
- // console.log(options);
- try {
- // 获取学号
- this.stu_number = this.$store.state.userInfo.card_number
- if (this.stu_number == '' || typeof this.stu_number == 'undefined') {
- const userinfo = uni.getStorageSync('userinfo_storage_key')
- if (userinfo) {
- this.stu_number = userinfo.card_number
- } else {
- uni.navigateTo({
- url: '../../pages/index/index?from=' + options.from
- })
- uni.showToast({
- icon: 'none',
- title: '学号为空,请进行授权',
- duration: 3000
- });
- return;
- }
- }
- } catch (e) {
- console.log('获取基本信息:' + e.message);
- }
- if (param == 'onShow') {
- if (this.$store.state.payInfo.from == 'reshui_pay') {
- uni.showToast({
- title: this.$store.state.payInfo.resultMsg,
- icon: 'success',
- success: () => {
- this.$store.state.payInfo.resultMsg = ''
- this.$store.state.payInfo.from = ''
- }
- })
- }
- }
- // 获取code
- this.getCode(options, param);
- },
- /**
- * 获得code
- */
- getCode(options, param) {
- uni.login({
- success: (res) => {
- // console.log('getCode', res);
- if (res.code) {
- // 请求服务器,获得openid
- this.getOpenId(options, res.code, param)
- } else {
- uni.showToast({
- title: res.errMsg,
- icon: 'none'
- });
- }
- }
- })
- },
- /**
- * 请求服务器,获得openid
- */
- async getOpenId(options, param_code, param) {
- var _this = this;
- const res = await this.$myRequest({
- host: _this.ceshi,
- url: '/HotWaters/wpget_stu.action',
- method: 'POST',
- header: {
- 'content-type': 'application/x-www-form-urlencoded'
- },
- data: {
- code: param_code,
- card_number: _this.stu_number
- }
- })
- // console.log(res);
- if (res.data.mess == '返回成功') {
- // stu_number是否存在
- let cardNumber = res.data.info[0].card_number
- if (typeof cardNumber != 'undefined' && cardNumber != '' && JSON.stringify(cardNumber) != '{}') {
- // 学号 和 姓名
- _this.stu_number = res.data.info[0].stu_number
- _this.user_name = res.data.info[0].user_name
- // 剩余金额
- _this.amount = res.data.info[0].balance.toFixed(2)
- // if (_this.amount > 0)
- _this.$store.state.reshui_amount = _this.amount
- // 组合楼栋宿舍号
- _this.dorm_number = res.data.info[0].build + res.data.info[0].dom
- // 校区
- // _this.compus = res.data.info[0].campus
- if (param == 'onLoad' && typeof options.from != 'undefined' && options.from != 0) {
- // 初始化蓝牙
- _this.openBluetoothAdapter()
- }
- // 请求选定的月份消费记录
- _this.request_consumption_records()
- } else {
- uni.showToast({
- title: '未获取到学号!',
- icon: 'success'
- });
- uni.navigateTo({
- url: '../../pages/index/index?from=' + options.from
- })
- }
- } else if (res.data.mess == '未查询到用户信息') {
- // 数据库中 未查询到用户信息,就清除本地存储
- // uni.removeStorageSync('userinfo_storage_key');
- uni.showToast({
- title: '获取用户信息失败!'
- })
- if (options && typeof options.from != 'undefined' && typeof options.from != '') {
- uni.navigateTo({
- url: '../../pages/index/index?from=' + options.from
- })
- } else {
- uni.redirectTo({
- url: '../../pages/index/index?from=0'
- });
- }
- }
- },
- /**
- * 选择消费年月
- */
- bindDateChange(e) {
- this.date = e.detail.value
- this.changeDate = true
- // 请求选定的月份消费记录
- this.request_consumption_records()
- },
- /**
- * 使用说明组件取消
- */
- cancel(param) {
- this.flag = param
- },
- /**
- * 使用说明组件不再出现
- */
- noshow(param) {
- try {
- if (param) {
- uni.setStorageSync("instruction_noshow", true)
- } else {
- uni.removeStorageSync("instruction_noshow")
- }
- } catch (e) {
- console.log('使用说明组件不再出现:' + e.message);
- }
- },
- /**
- * 请求选定的月份消费记录
- */
- async request_consumption_records() {
- try {
- if (this.stu_number != '' && typeof(this.stu_number) != 'undefined') {
- const res = await this.$myRequest({
- host: this.ceshi,
- url: '/HotWaters/wpqueryConsume.action',
- method: 'POST',
- header: {
- 'content-type': 'application/x-www-form-urlencoded'
- },
- data: {
- stu_number: this.stu_number,
- begin_time: this.date
- }
- });
- // console.log(res);
- if (res.data.mess == '返回成功') {
- this.xiaofei_items = []
- console.log(res.data.data);
- // 消费记录
- let items = res.data.data
- for (var i = 0; i < items.length; i++) {
- this.xiaofei_items.push(items[i])
- }
- } else {
- if (this.changeDate) {
- uni.showToast({
- icon: 'success',
- title: res.data.mess,
- success: () => {
- this.changeDate = false
- }
- })
- if (res.data.mess == '本月无消费记录') {
- this.xiaofei_items = []
- }
- }
- }
- } else {
- uni.showToast({
- icon: 'success',
- title: '未获得学号'
- })
- }
- } catch (e) {
- console.log('请求选定的月份消费记录:' + e.message);
- }
- },
- /**
- * 控制进度条显示
- * @param {Object} active_value
- */
- process_control(active_value) {
- try {
- if (active_value <= this.list1.length - 1) {
- this.active = active_value
- }
- } catch (e) {
- console.log('控制进度条显示:' + e.message);
- }
- },
- /**
- * 开始或停止用水
- */
- switchChange(e) {
- let _this = this;
- this.isChecked = e.target.value
- if (this.isChecked) {
- if (this.deviceId && this.serviceId && this.devices.length != 0) {
- uni.showModal({
- title: '提示',
- content: '确定要启动设备?',
- success: (res) => {
- if (res.confirm) {
- this.isChecked = true;
- // 开始连接匹配的蓝牙设备
- setTimeout(async () => {
- // 请求获取设备启动码
- _this.request_device_start_code()
- }, 200);
- } else if (res.cancel) {
- setTimeout(() => {
- _this.isChecked = false;
- }, 100);
- }
- }
- })
- } else {
- setTimeout(() => {
- this.isChecked = false
- }, 200)
- uni.showToast({
- icon: 'none',
- title: '先【扫码连接】,后【开启设备】',
- duration: 1500
- })
- }
- } else {
- if (!(this.deviceId && this.serviceId)) {
- uni.showToast({
- icon: 'none',
- title: '与设备连接中断!请在设备上手动停止即可!',
- duration: 3000
- })
- setTimeout(() => {
- this.setInit()
- }, 300)
- return
- }
- uni.showModal({
- title: '提示',
- content: '确定要关闭设备?',
- success: (res) => {
- if (res.confirm) {
- if (this.deviceId && this.serviceId) {
- this.isChecked = false
- this.send('stop')
- } else {
- uni.showToast({
- icon: 'none',
- title: '与设备连接中断!请在设备上手动停止即可!',
- duration: 3000
- })
- setTimeout(() => {
- // this.isChecked = true;
- this.setInit()
- }, 300)
- }
- } else if (res.cancel) {
- setTimeout(() => {
- this.isChecked = true
- }, 300)
- }
- }
- })
- }
- },
- /**
- * 跳转到充值页面
- */
- chongzhi_yemian() {
- //在起始页面跳转到recharge.vue页面并传递参数
- uni.navigateTo({
- url: '../recharge/recharge'
- });
- },
- /**
- * 判断余额是否充足
- */
- judgeBalance(param) {
- var limit_amount = parseFloat(this.$store.state.amount)
- var amount = parseFloat(this.amount);
- // 启动最低金额限制
- if (amount < limit_amount) {
- uni.showModal({
- title: '提示',
- content: '当前余额不足¥' + limit_amount + '元',
- cancelText: '我知道了',
- confirmText: '我要充值',
- success: (res) => {
- if (res.confirm) {
- // 跳转充值页面
- this.chongzhi_yemian()
- // return false
- // } else if (res.cancel) {
- // return false
- }
- }
- })
- return false
- }
- // 已经启动扫描连接设备中
- if (this.isScan) {
- uni.showToast({
- icon: 'none',
- title: '正在扫描,请耐心等待',
- })
- return false
- }
- // 已经启动设备,不启动扫描
- if (this.isChecked) {
- let info_str = ''
- if (param == 'scan') {
- info_str = '设备已启动,无需重新扫码'
- } else {
- info_str = '设备已启动,无需重新启动'
- }
- uni.showToast({
- icon: 'none',
- title: info_str,
- })
- return false
- }
- // console.log(this.deviceId);
- // 设备已连接
- if (this.deviceId) {
- uni.showModal({
- title: '提示',
- content: '设备已经连接,需要重新连接吗?',
- success: res => {
- if (res.confirm) {
- // 关闭连接
- this.closeBLEConnection()
- if (param == 'scan') {
- // 扫描
- this.scan_qr()
- } else {
- // cancel
- }
- }
- }
- })
- return false
- }
- },
- /**
- * 111111111111111111111111111111
- * 扫码连接设备
- */
- scan() {
- if (this.judgeBalance('scan') == false) {
- return;
- }
- this.scan_qr();
- },
- /**
- * 启动摄像头,扫描二维码
- */
- scan_qr() {
- this.get_Bluetooth_Bevice = true
- uni.scanCode({
- onlyFromCamera: true,
- success: (res) => {
- this.isScan = true
- // console.log(res)
- // charSet: "utf-8"
- // codeVersion: 3
- // errMsg: "scanCode:ok"
- // rawData: "aHR0cDovL3Rvb2xzLjlrYnMuY29tLz93eG1pbmljb2RlPUtCNTgwMDAyNjUy"
- // result: "http://tools.9kbs.com/?wxminicode=KB580002652"
- // scanType: "QR_CODE"
- this.device_code = res.result.split('=')[1]
- this.isScan = false;
- if (this.device_code === '') {
- uni.showToast({
- icon: 'success',
- title: '获取设备码失败',
- duration: 3000
- });
- } else {
- // 初始化蓝牙
- this.openBluetoothAdapter()
- }
- }
- })
- },
- /**
- * 22222222222222222222222222222
- * 初始化蓝牙
- */
- openBluetoothAdapter() {
- let _this = this;
- uni.openBluetoothAdapter({
- success: (res) => { // 已打开
- uni.getBluetoothAdapterState({ // 蓝牙的匹配状态
- success: (res1) => {
- // console.log(res1, '“本机设备的蓝牙已打开”');
- // 本机设备的蓝牙已打开
- // 开始搜索蓝牙设备
- if (this.deviceId == '' && this.serviceId == '')
- this.startBluetoothDeviceDiscovery()
- },
- fail: (error) => {
- // console.log(error)
- uni.showModal({
- content: '请开启手机蓝牙!',
- showCancel: false
- });
- this.isScan = false;
- }
- });
- },
- fail: (err) => { // 未打开
- // console.log(err)
- this.isScan = false;
- if (err.errCode == 10001) {
- uni.showModal({
- content: '请授权手机蓝牙!',
- showCancel: false
- });
- } else {
- uni.showToast({
- icon: 'none',
- title: err.errMsg,
- duration: 2000
- })
- }
- }
- });
- },
- /**
- * 333333333333333333333333333
- * 开始搜索蓝牙设备
- */
- startBluetoothDeviceDiscovery() {
- uni.startBluetoothDevicesDiscovery({ // 开始搜寻附近的蓝牙外围设备
- // services: ['FEE7'], // 要搜索但蓝牙设备主 service 的 uuid 列表
- allowDuplicatesKey: true,
- success: (res) => {
- if (this.get_Bluetooth_Bevice == true)
- this.process_control(0)
- this.onBluetoothDeviceFound() // 监听搜索到新设备 同时进行
- setTimeout(() => {
- if (this.isScan) {
- uni.showModal({
- title: '温馨提示',
- content: '请确认已开启【蓝牙授权】或【定位授权】!',
- confirmText: '我已开启',
- cancelText: '取消',
- success: (res) => {
- // console.log(res);
- if (res.confirm) {
- } else if (res.cancel) {
- switch (uni.getSystemInfoSync().platform) {
- case 'android':
- // 打开设置
- break;
- case 'ios':
- // 打开设置
- break;
- default:
- // console.log('运行在开发者工具上')
- break;
- }
- }
- }
- })
- }
- }, 6000)
- },
- fail: err => {
- // console.log(err, '错误信息');
- uni.showToast({
- icon: 'none',
- title: err.errMsg,
- duration: 2000
- })
- this.isScan = false
- }
- })
- },
- stopBluetoothDevicesDiscovery() { //停止搜索
- uni.stopBluetoothDevicesDiscovery({
- success: (res) => {
- // console.log(res, '停止蓝牙搜索')
- // uni.showToast({
- // title: '停止蓝牙搜索',
- // duration: 2000
- // })
- if (this.get_Bluetooth_Bevice == true || this.device_code) {
- this.createBLEConnection()
- } else {
- this.get_room()
- setTimeout(() => {
- this.get_Bluetooth_Bevice = true
- }, 2000)
- }
- },
- fail: err => {
- // console.log('停止搜索蓝牙设备失败,错误码:' + err.errCode);
- this.isScan = false
- uni.showToast({
- title: err.errCode,
- duration: 2000
- })
- }
- })
- },
- /**
- * 444444444444444444444444444444444
- * 发现外围设备
- */
- onBluetoothDeviceFound() {
- uni.onBluetoothDeviceFound((res) => {
- let dname = ''
- res.devices.forEach(device => { // 筛选找到的蓝牙中对名称匹配
- try {
- // 过滤掉没有名字的设备
- if (!device.name && !device.localName) {
- return
- }
- // 把搜索到的设备存储起来,如有需要可以在页面上展示
- dname = device.name.substr(1)
- let d = {
- did: device.deviceId,
- dname: dname
- }
- if (dname.length == 10 && JSON.stringify(this.devices).indexOf(JSON.stringify(
- d)) === -1) {
- this.devices.push(d)
- }
- if (device.name == this.device_code) {
- this.process_control(0);
- //data里面建立一个deviceId、device_code,存储起来
- // this.device_code = device.name;
- this.deviceId = device.deviceId
- // 放此位置,苹果手机兼容
- this.stopBluetoothDevicesDiscovery()
- return
- }
- setTimeout(() => {
- this.stopBluetoothDevicesDiscovery()
- }, 2000)
- } catch (e) {
- // console.log('发现外围设备:' + e.message);
- }
- })
- });
- },
- // 获取水表对应的宿舍号
- async get_room() {
- try {
- if (this.devices.length > 0) {
- let devices_str = []
- for (var i = 0, len = this.devices.length; i < len; i++) {
- devices_str.push(this.devices[i].dname)
- }
- const res = await this.$myRequest({
- host: this.ceshi,
- url: '/HotWaters/waterqueryDom.action',
- method: 'POST',
- header: {
- 'content-type': 'application/x-www-form-urlencoded'
- },
- data: {
- user_id: devices_str.join(',')
- }
- });
- if (res.data.msg == '获取成功') {
- // 消费记录
- let items = res.data.data
- if (typeof items === 'undefined') {
- uni.showToast({
- title: '获取宿舍号为空',
- duration: 2000
- })
- return
- }
- for (var i = 0; i < items.length; i++) {
- let item = {
- id: items[i].user_id,
- room: items[i].dom
- }
- if (JSON.stringify(this.rooms).indexOf(JSON.stringify(item)) === -1) {
- this.rooms.push(item); // 进行动态的操作
- }
- }
- } else {
- if (this.changeDate) {
- uni.showToast({
- icon: 'success',
- title: res.data.mess,
- success: () => {
- this.changeDate = false
- }
- })
- if (res.data.mess == '本月无消费记录') {
- this.xiaofei_items = []
- }
- }
- }
- }
- } catch (e) {
- console.log('获取水表对应的宿舍号:' + e.message);
- }
- },
- /**
- * 555555555555555555555555555555555
- * 连接蓝牙设备
- */
- createBLEConnection() {
- //连接蓝牙
- uni.createBLEConnection({
- deviceId: this.deviceId,
- timeout: 6000,
- success: (res) => {
- // console.log(res)
- this.connect_BLE()
- },
- fail: (err) => {
- // console.log(err)
- this.isScan = false
- if (err.errMsg.indexOf('already connect') != -1) {
- this.connect_BLE()
- } else {
- uni.showToast({
- title: '水表蓝牙连接被占用!',
- icon: 'none',
- duration: 3000,
- success: (res1) => {
- this.setInit()
- }
- })
- }
- }
- })
- },
- connect_BLE() {
- if (this.isConnected === false) {
- this.isConnected = true
- // 获取蓝牙设备所有服务(service)
- this.getBLEDeviceServices()
- }
- },
- /**
- * 6666666666666666666666666666666666
- * 获取蓝牙的所有服务
- */
- getBLEDeviceServices() {
- uni.getBLEDeviceServices({
- deviceId: this.deviceId,
- success: (res) => {
- // console.log(res)
- // res1.services.forEach((item) => {
- // this.getBLEDeviceCharacteristics()
- // })
- this.serviceId = res.services[1].uuid
- this.process_control(1);
- this.getBLEDeviceCharacteristics()
- },
- fail: (err) => {
- // console.log(err)
- this.isScan = false
- uni.showToast({
- title: '获取服务失败',
- icon: 'none',
- duration: 3000
- });
- this.setInit();
- return;
- }
- });
- },
- /**
- * 777777777777777777777777777777777
- * 获取蓝牙特征
- */
- getBLEDeviceCharacteristics() {
- // 获取蓝牙设备某个服务中所有特征值(characteristic)
- uni.getBLEDeviceCharacteristics({
- deviceId: this.deviceId,
- // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
- serviceId: this.serviceId,
- success: (res) => {
- // console.log(res)
- this.characteristicIdForWrite = res.characteristics[0].uuid
- this.characteristicIdForNotity = res.characteristics[1].uuid
- this.deviceIsWrite = res.characteristics[0].properties.write
- this.deviceIsNotify = res.characteristics[1].properties.notify
- // console.log(this.characteristicIdForWrite, this.characteristicIdForNotity)
- // 确保对应服务id下的特征值id具备监听数据变化的特性
- if (res.characteristics[1].properties.notify) {
- this.notifyBLECharacteristicValueChange()
- }
- },
- fail: (err) => {
- this.isScan = false
- // console.error('获取蓝牙设备特征值失败(getBLEDeviceCharacteristics)', err)
- }
- });
- },
- /**
- * 888888888888888888888888888888888888
- * 启用 notify 功能
- */
- notifyBLECharacteristicValueChange() {
- uni.notifyBLECharacteristicValueChange({
- state: true, // 启用 notify 功能
- deviceId: this.deviceId,
- // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
- serviceId: this.serviceId,
- // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取
- characteristicId: this.characteristicIdForNotity,
- success: (res) => {
- this.process_control(2)
- uni.showToast({
- icon: 'none',
- title: '要启动水表,请手动点击【开启设备】右侧开关!',
- duration: 5000
- })
- // uni.showModal({
- // title: '提示',
- // content: '要启动水表,请手动点击【开启设备】右侧开关!',
- // showCancel: false,
- // confirmText: '好,知道'
- // })
- this.isScan = false
- // console.log('通知启用(notifyBLECharacteristicValueChange)',res);
- this.onBLECharacteristicValueChange()
- setTimeout(() => {
- // 发送 AAABAC,采集数据(会返回 35字节 的数据)
- this.send('')
- }, 800)
- // // 请求设备信息
- // this.request_device_info()
- // // 显示设备启动授权金额
- // this.display_device_startup_amount()
- },
- fail: (err) => {
- // console.log(err)
- this.isScan = false
- uni.showModal({
- content: err.errMsg,
- showCancel: false
- })
- // 初始化
- this.setInit()
- }
- })
- },
- /**
- * 999999999999999999999999999999999
- * 监听低功耗蓝牙设备的特征值变化
- */
- onBLECharacteristicValueChange() {
- uni.onBLECharacteristicValueChange((characteristic) => {
- let condition = this.ab2hex(characteristic.value)
- // console.log(condition)
- if (condition.length > 2) {
- this.byte35_tmp += condition
- if (this.byte35_tmp.length > 40) {
- this.byte35 = this.byte35_tmp
- this.byte35_tmp = ''
- if (this.byte35.startsWith('ad')) {
- // console.log(this.byte35, '结束用水成功')
- // 关闭蓝牙连接
- this.closeBLEConnection()
- // 请求结算
- this.request_pay()
- } else {
- // 发送 AAABAC,采集数据(会返回 35字节 的数据)
- // b58000265243eb3dd4bb3c5a2ab9042efcf0d2a30a000000000000000014392a0103bc
- // uni.showToast({
- // icon: 'success',
- // title: '采集数据成功!',
- // duration: 2000
- // })
- // console.log(this.byte35, '采集上一条消费数据')
- }
- }
- }
- switch (condition) {
- case 'bb':
- // uni.showToast({
- // title: '设备启动成功',
- // duration: 3000,
- // icon: 'none'
- // })
- this.isChecked = true
- break
- case 'bc':
- uni.showToast({
- title: '启动失败,设备检验启动代码不通过',
- duration: 3000,
- icon: 'none'
- })
- break
- case 'aa':
- uni.showToast({
- title: '设备正在使用',
- duration: 3000,
- icon: 'none'
- })
- break
- case 'ab':
- uni.showToast({
- title: '结束失败,设备对结束代码检验失败',
- duration: 3000,
- icon: 'none'
- })
- break
- default:
- break
- }
- })
- },
- /**
- * 关闭连接
- */
- closeBLEConnection() {
- if (this.deviceId) {
- uni.closeBLEConnection({
- deviceId: this.deviceId,
- success: () => {
- // 关闭蓝牙模块
- this.closeBluetoothAdapter()
- },
- fail: (err) => {
- // this.setInit()
- // uni.showToast({
- // icon: 'none',
- // title: err.errMsg,
- // duration: 3000,
- // success: (res1) => {
- // this.setInit()
- // }
- // })
- }
- });
- } else {
- // 关闭蓝牙模块
- this.closeBluetoothAdapter()
- }
- },
- closeBluetoothAdapter() {
- // 关闭蓝牙模块
- uni.closeBluetoothAdapter({
- success: () => {
- this.myInit();
- if (this.isUserClose == false) { // 设备端结束用水
- if (this.isChecked) {
- // console.log('设备端已结束用水,蓝牙断开成功')
- uni.showToast({
- icon: 'none',
- title: '设备端已结束用水,蓝牙断开成功',
- duration: 3000
- });
- } else {
- // console.log('用户重启扫描,蓝牙断开成功')
- uni.showToast({
- icon: 'none',
- title: '用户重启扫描,蓝牙断开成功',
- duration: 3000
- });
- }
- } else { // 手机移动端结束用水
- // console.log('APP端已结束用水,蓝牙断开成功')
- uni.showToast({
- icon: 'none',
- title: 'APP端已结束用水,蓝牙断开成功',
- duration: 3000
- });
- }
- }
- })
- },
- setInit() {
- this.closeBLEConnection();
- this.myInit();
- },
- myInit() {
- setTimeout(() => {
- this.isUserClose = false;
- this.isChecked = false;
- this.isConnected = false;
- this.isScan = false;
- this.active = -1;
- this.device_code = ''; // 设备编号
- this.devices = []; // 保存设备, 加了【空中连接】,不需要置为空。
- this.deviceId = ''; // 加了【空中连接】,不需要置为空。
- this.serviceId = '';
- this.characteristicIdForWrite = '';
- this.characteristicIdForNotity = '';
- this.deviceIsNotify = false;
- this.deviceIsWrite = false;
- this.byte35 = ''; // 70 个字符
- this.byte35_tmp = ''; // 70 个字符 临时变量
- this.get_Bluetooth_Bevice = false;
- this.rooms = []; // 宿舍号,蓝牙连接具有时效性,断开连接后清空
- this.start_code = '';
- }, 300);
- },
- /**
- * 10===========10==================10
- * 发送数据到设备
- */
- send(val) {
- let buffer
- let dataView
- let newArr
- if (val == 'start') { // 启动设备
- this.isUserClose = false
- // 发送 17字节 启动代码(会返回 35字节 的数据)
- // b58000265243eb3dd4bb3c5a2ab9042efcf0d2a30a000000000000000014392a0103bc
- newArr = this.str2StrArray(this.start_code)
- } else if (val == 'stop') { // 结束当前使用,设备成功返回:AD+35字节 消费结算代码
- this.isUserClose = true
- // 发送 AAABAD+17字节 启动代码(会返回 ad+35字节 的数据)
- // adb58000265243eb3dd4bb3c5a2ab9042efcf0d2a30a000000000000000014392a0104bc
- newArr = ['AA', 'AB', 'AD'].concat(this.str2StrArray(this.start_code))
- } else {
- // 发送 AAABAC 采集数据(会返回 35字节 的数据)
- // b58000265243eb3dd4bb3c5a2ab9042efcf0d2a30a000000000000000014392a0103bc
- newArr = ['AA', 'AB', 'AC']
- }
- buffer = new ArrayBuffer(newArr.length)
- dataView = new DataView(buffer)
- newArr.forEach((item, i) => {
- dataView.setUint8(i, this.sixteen_to_ten(item))
- })
- // 写特征值数据到设备
- if (this.deviceIsWrite) {
- // 写数据到设备
- this.writeBLECharacteristicValue(val, buffer)
- } else {
- uni.showToast({
- title: '设备不可写',
- duration: 3000
- })
- }
- },
- /**
- * 11====================11=====================11
- * 写数据到设备
- */
- writeBLECharacteristicValue(val, buffer) {
- uni.writeBLECharacteristicValue({
- deviceId: this.deviceId,
- // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
- serviceId: this.serviceId,
- // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取
- characteristicId: this.characteristicIdForWrite,
- // 这里的value是ArrayBuffer类型
- value: buffer,
- success: (res) => {
- // console.log(res)
- if (val == 'start') {
- setTimeout(() => {
- this.isChecked = true;
- this.isConnected = true;
- this.byte35 = '';
- }, 300)
- this.process_control(3)
- } else if (val == 'stop') {
- setTimeout(() => {
- this.isChecked = false;
- }, 300)
- }
- },
- fail: (err) => {
- // console.log(err)
- if (err.errCode !== 0) {
- setTimeout(() => {
- this.setInit()
- }, 300)
- if (this.isConnected) {
- uni.showToast({
- title: '设备连接已断开!请在水表上手动停止!',
- icon: 'none',
- duration: 5000
- })
- } else {
- uni.showToast({
- title: '设备连接失败!请重试扫描连接!',
- icon: 'none',
- duration: 5000
- })
- }
- }
- }
- })
- },
- /**
- * 请求获取设备启动码
- */
- async request_device_start_code() {
- if (this.byte35 != '' && this.stu_number != '') {
- const res = await this.$myRequest({
- host: this.ceshi,
- url: '/HotWaters/wpstart.action',
- data: {
- collect_code: this.byte35,
- stu_number: this.stu_number
- }
- })
- // console.log(res)
- let sc = res.data.start_code
- if (typeof(sc) != 'undefined' && sc != '') {
- this.start_code = sc
- setTimeout(() => {
- this.send('start')
- }, 100)
- // 刷新选定的月份消费记录
- this.request_consumption_records()
- } else {
- this.isChecked = false
- uni.showToast({
- icon: 'none',
- title: res.data.mess,
- duration: 3000,
- })
- }
- } else {
- if (typeof this.byte35 == 'undefined' || this.byte35 == '') {
- uni.showToast({
- icon: 'none',
- title: '获取字节码空!'
- });
- }
- if (typeof this.stu_number == 'undefined' || this.stu_number == '') {
- uni.showToast({
- icon: 'none',
- title: '学号为空!'
- });
- }
- // 初始化
- this.setInit()
- }
- },
- /**
- * 请求结算
- */
- async request_pay() {
- if (this.byte35 != '') {
- const res = await this.$myRequest({
- host: this.ceshi,
- url: '/HotWaters/wpconsume.action',
- data: {
- stu_number: this.stu_number,
- user_name: this.user_name,
- collect_code: this.byte35.substring(2)
- }
- })
- // console.log(res)
- if (res.data.mess == "支付成功") {
- uni.showToast({
- icon: 'success',
- title: '结算成功!',
- success: (res1) => {
- this.use_amount = res.data.use_amount.toFixed(2)
- this.amount = (this.amount - this.use_amount).toFixed(2)
- this.$store.state.reshui_amount = this.amount
- setTimeout(() => {
- // 刷新选定的月份消费记录
- this.request_consumption_records()
- }, 1000)
- }
- })
- } else {
- uni.showToast({
- icon: 'none',
- title: res.data.mess,
- duration: 3000
- })
- }
- } else {
- uni.showToast({
- icon: 'success',
- title: '结算字节码空!'
- });
- // 初始化
- this.setInit()
- }
- },
- /**
- * 返回字符处理
- */
- str2StrArray(start_code) {
- if (typeof(start_code) == 'undefined' || start_code == '') {
- uni.showToast({
- icon: 'none',
- title: '设备码获取失败'
- })
- this.setInit()
- return
- }
- if (start_code.length != 34) {
- // console.log('启动码长度错误')
- throw new Error("启动码长度错误");
- return
- }
- var resultArray = new Array()
- for (var i = 0; i < start_code.length; i += 2) {
- resultArray.push(start_code.substr(i, 2));
- }
- return resultArray;
- },
- /**
- * ArrayBuffer转16进度字符串
- */
- ab2hex(buffer) {
- const hexArr = Array.prototype.map.call(
- new Uint8Array(buffer),
- function(bit) {
- // console.log('====================' + bit + '==========================')
- return ('00' + bit.toString(16)).slice(-2)
- }
- )
- return hexArr.join('');
- },
- /**
- * 16进制转10进制
- */
- sixteen_to_ten(str) {
- return parseInt(str, 16);
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .content {
- width: 100%;
- height: 100%;
- .container {
- width: 100%;
- padding: 20rpx 40rpx;
- box-sizing: border-box;
- .header {
- display: flex;
- justify-content: center;
- position: relative;
- height: 200rpx;
- .scan {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- height: 200rpx;
- width: 30%;
- .iconfont {
- margin-bottom: 10rpx;
- font-size: 100rpx;
- color: $my-color-primary;
- }
- }
- .scan_hover {
- border-radius: 15rpx;
- background-color: $my-color-btn-background;
- }
- .qinshihao {
- display: flex;
- align-items: center;
- position: fixed;
- top: 20rpx;
- right: 30rpx;
- font-size: 28rpx;
- height: 38rpx;
- .icon-zhuye {
- margin-right: 10rpx;
- font-family: Microsoft YaHei-3970(82674968);
- color: $my-color-primary;
- }
- .compustxt {
- font-size: 18rpx;
- }
- }
- }
- .start_text {
- .start_top,
- .start_mid {
- display: flex;
- justify-content: space-between;
- height: 100rpx;
- align-items: center;
- border-bottom: 2rpx #ccc solid;
- .item_left {
- display: flex;
- align-items: center;
- }
- .start_mid_txt {
- padding: 16rpx;
- border-radius: 10rpx;
- font-size: 36rpx;
- font-weight: bold;
- color: #333;
- }
- .iconfont {
- font-size: 50rpx;
- color: $my-color-primary;
- margin-right: 20rpx;
- }
- .start_payamount {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- font-size: 38rpx;
- padding: 10rpx;
- font-family: Microsoft YaHei-3970(82674968);
- color: #B2B2B2;
- border-radius: 10rpx;
- .icon-dayuhao {
- margin: 0 0 0 20rpx;
- font-size: 38rpx;
- color: #B2B2B2;
- }
- }
- }
- .start_bot {
- display: flex;
- justify-content: space-between;
- height: 100rpx;
- align-items: center;
- .kongzhonglianjie {
- margin: 0;
- height: 60rpx;
- line-height: 60rpx;
- font-size: 28rpx;
- background-color: #1296DB;
- color: #FFFFFF;
- }
- .start_bot_txt {
- margin-left: 20rpx;
- color: #333;
- font-size: 28rpx;
- }
- }
- }
- .btn_room {
- font-size: 28rpx;
- background-color: #41c560;
- margin: 10rpx auto;
- }
- .start_up_process {
- padding: 20rpx 0;
- color: #007AFF;
- }
- .ad {
- margin: 0 -40rpx;
- padding: 10rpx;
- width: 730rpx;
- height: 424rpx;
- .ad_img {
- height: 100%;
- width: 100%;
- }
- }
- .title {
- height: 100rpx;
- margin: 0 -40rpx;
- padding: 0 40rpx;
- line-height: 100rpx;
- color: #808080;
- font-size: 32rpx;
- background: #f2f2f2;
- }
- .record-item {
- width: 100%;
- .uni-list-cell-db {
- height: 100rpx;
- line-height: 100rpx;
- font-weight: bold;
- .uni-input {
- display: flex;
- align-items: center;
- height: 58rpx;
- text:nth-child(1) {
- margin-right: 10rpx;
- }
- }
- }
- .item-list {
- height: 80rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-top: 2rpx #ccc solid;
- .icon-shijian {
- margin-right: 8rpx;
- }
- .icon-shuidi {
- margin-right: 3rpx;
- }
- .item-list-txt {
- font-size: 28rpx;
- &:nth-of-type(2) {
- color: #515151;
- }
- &:nth-of-type(3) {
- color: #f76200;
- font-size: 32rpx;
- }
- }
- }
- }
- }
- .call {
- position: fixed;
- right: 40rpx;
- bottom: 180rpx;
- }
- .default-btn {
- background-color: transparent;
- border: none;
- outline: none;
- }
- .floating-button-call {
- position: relative;
- font-size: 28rpx;
- width: 90rpx;
- height: 90rpx;
- border: 1px solid #ccc;
- border-radius: 50%;
- opacity: 0.5;
- background: url('../../static/images/kefu.png') center center no-repeat;
- background-size: 68rpx auto;
- }
- .operation-manual {
- position: fixed;
- right: 40rpx;
- bottom: 300rpx;
- }
- .floating-button-manual {
- position: relative;
- font-size: 28rpx;
- width: 90rpx;
- height: 90rpx;
- border: 1px solid #ccc;
- border-radius: 50%;
- opacity: 0.5;
- background: url('../../static/images/yhsc.png') center center no-repeat;
- background-size: 68rpx auto;
- }
- .article {
- padding: 20rpx;
- height: 100%;
- }
- .desc-title {
- height: 50rpx;
- line-height: 50rpx;
- font-size: 36rpx;
- font-weight: bold;
- margin-bottom: 50rpx;
- text-align: center;
- }
- .section {
- margin-bottom: 40rpx;
- }
- .section-title-red,
- .section-title {
- font-size: 30rpx;
- font-weight: bold;
- margin-bottom: 10rpx;
- }
- .section-title-red {
- color: #ca0000;
- }
- .section-content {
- font-size: 28rpx;
- line-height: 1.5;
- white-space: pre-wrap;
- }
- .desc-footer {
- height: 50rpx;
- line-height: 50rpx;
- }
- }
- </style>
|