From 9478d2708b84d2170b6acddb95f50b23c490c892 Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Sun, 15 Sep 2024 18:02:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=8A=E5=9E=AB=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- page_user/fuwu.vue | 184 ++++++++++++-------------------------- page_user/mydetail.vue | 11 ++- page_user/mydingdan.vue | 8 +- page_user/orderdetail.vue | 5 +- pages/my.vue | 51 +++++++++-- pages/zhuce.vue | 57 +++++++++--- 6 files changed, 160 insertions(+), 156 deletions(-) diff --git a/page_user/fuwu.vue b/page_user/fuwu.vue index a706e96..63bf592 100644 --- a/page_user/fuwu.vue +++ b/page_user/fuwu.vue @@ -179,7 +179,8 @@ timer: null, titflag: false, kefulist: [], - scrollTop:0 + scrollTop:0, + billId:'' } }, onLoad(option) { @@ -289,7 +290,7 @@ }else{ this.picimg = true } - },500) + },100) } }, btnscrll() { @@ -356,7 +357,8 @@ } that.$u.post('/app/bill/recharge', data).then(res => { if (res.code == 200) { - that.orderno = res.data + that.orderno = res.data.billNo + that.billId = res.data.billId that.$u.get(`/app/pay/wx/${that.orderno}`).then((res) => { if (res.code == 200) { uni.requestPayment({ @@ -366,84 +368,42 @@ package: res.data.payParams.packageVal, signType: res.data.payParams.signType, paySign: res.data.payParams.paySign, - success: (res) => { + success: (res) => { if (that.timer) { clearInterval(this.timer); that.timer = null; } - // 111111111111111111111111 - that.$u.put( - `/app/bill/${that.orderno}/refreshPayResult` - ).then(res => { + that.$u.put(`/app/bill/${that.orderno}/refreshPayResult`).then(res => { // if(res.code == 200){ - that.$u.get( - '/app/bill/recharge/device/fail/list' - ).then(res => { + that.$u.get('/app/bill/recharge/device/fail/list').then(res => { if (res.code == 200) { - if (res.data - .length != 0) { - let dingobj = - res.data[0] - .billNo + if (res.data.length != 0) { + let dingobj = res.data[0].billNo uni.getNetworkType({ - success( - res - ) { - if (res - .networkType !== - 'none' - ) { + success(res) { + if (res.networkType !== 'none') { uni.getConnectedBluetoothDevices({ - success( - res - ) { - that.jzflag = - true + success(res) { + that.jzflag =true that.startLoading() - setTimeout - (() => { - xBlufi - .notifySendCustomData({ - customData: "11time@" + - that - .jine + setTimeout(() => { + xBlufi.notifySendCustomData({ + customData: "11time@" + that.jine }) - }, - 1500 - ) + },1500) }, - fail( - err - ) { - console - .error( - '获取已连接蓝牙设备信息失败:', - err - ) + fail(err) { + console.error('获取已连接蓝牙设备信息失败:',err) } }) - that.$u - .get( - `/app/bill/recharge/${dingobj}/bluetoothSuccess` - ) - .then( - res => { - if (res - .code == - 200 - ) { - that.zhifuflag = - true - console - .log( - '蓝牙离线充值成功11' - ) + that.$u.get(`/app/bill/recharge/${dingobj}/bluetoothSuccess`).then(res => { + if (res.code == 200) { + that.zhifuflag = true + console.log('蓝牙离线充值成功11') setTimeout (() => { - uni.reLaunch({ - url: '/pages/index/index?id=' + - that - .orderno + uni.navigateTo({ + url: '/page_user/mydetail?billId=' + that.billId }) }, 1000 @@ -451,72 +411,34 @@ } } ) - } else { - console - .log( - '手机未连接网络' - ) - // this.baiflag = false } } }) } else { uni.getNetworkType({ - success( - res - ) { - if (res - .networkType !== - 'none' - ) { + success(res) { + if (res.networkType !== 'none') { uni.getConnectedBluetoothDevices({ - success( - res - ) { - that.jzflag = - true + success(res) { + that.jzflag = true that.startLoading() - setTimeout - (() => { - xBlufi - .notifySendCustomData({ - customData: "11time@" + - that - .jine + setTimeout(() => { + xBlufi.notifySendCustomData({ + customData: "11time@" + that.jine }) - }, - 1500 - ) - }, - fail( - err - ) { - console - .error( - '获取已连接蓝牙设备信息失败:', - err - ) + },1500) + }, + fail(err) { + console.error('获取已连接蓝牙设备信息失败:',err) } }) - that.zhifuflag = - true - setTimeout - (() => { - uni.reLaunch({ - url: '/pages/index/index?id=' + - that - .orderno + that.zhifuflag = true + setTimeout(() => { + uni.navigateTo({ + url: '/page_user/mydetail?billId=' + that.billId }) - }, - 1000 - ) - } else { - console - .log( - '手机未连接网络' - ) - // this.baiflag = false - } + },1000) + } } }) } @@ -580,7 +502,8 @@ } that.$u.post('/app/bill/recharge', data).then(res => { if (res.code == 200) { - that.orderno = res.data + that.orderno = res.data.billNo + that.billId = res.data.billId let data = { billNo: that.orderno, channelId: 1 @@ -597,12 +520,10 @@ paySign: res.data.payParams.paySign, success: (res) => { that.zhifuflag = true - that.$u.put( - `/app/bill/${that.payNo}/refreshPayResult` - ).then(res => { + that.$u.put(`/app/bill/${that.payNo}/refreshPayResult`).then(res => { // 支付成功逻辑 - uni.reLaunch({ - url: '/pages/index/index' + uni.navigateTo({ + url: '/page_user/mydetail?billId=' + that.billId }) }) }, @@ -676,6 +597,11 @@ break; case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED: console.log("连接回调:" + JSON.stringify(options)); + uni.showToast({ + title: '连接成功', + icon: 'none', + duration: 2000 + }) if (options.result) { // console.log('125451245') { @@ -930,8 +856,8 @@ } .picdh { - width: 30rpx; - height: 25rpx; + width: 40rpx; + height: 35rpx; position: fixed; top: 53%; right: 76rpx; diff --git a/page_user/mydetail.vue b/page_user/mydetail.vue index d7827b4..51b1ac7 100644 --- a/page_user/mydetail.vue +++ b/page_user/mydetail.vue @@ -1,6 +1,6 @@ <template> <view class="page"> - <u-navbar title="订单详情" :border-bottom="false" :background="bgc" title-color='#3D3D3D' back-icon-color="#3D3D3D" + <u-navbar title="订单详情" :custom-back="btnback" :border-bottom="false" :background="bgc" title-color='#3D3D3D' back-icon-color="#3D3D3D" title-size='36' height='44'></u-navbar> <view class="shengyu"> @@ -205,7 +205,8 @@ isUsing: false, timer: null, timers: null, - pictrim:true + pictrim:true, + billidflag:'' } }, onShow() { @@ -230,6 +231,8 @@ onLoad(option) { if (option.billId) { this.billId = option.billId + } else if(option.idss){ + this.billidflag = 1 } else { this.billId = option.id } @@ -272,6 +275,10 @@ } }, methods: { + btnback(){ + uni.navigateBack() + }, + startTimers() { if (this.timers) { clearInterval(this.timers); // 防止重复设置定时器 diff --git a/page_user/mydingdan.vue b/page_user/mydingdan.vue index d381782..97f046f 100644 --- a/page_user/mydingdan.vue +++ b/page_user/mydingdan.vue @@ -13,7 +13,7 @@ style="background-color: #17b402;"></text> 进行中 </view> <view style="color: #8883F0;" v-if="item.isFinished == true && item.status != 3"> <text style="background-color: #8883F0;"></text> 已完成 </view> - <view v-if="item.status == 3" style="color: #e10328;"><text style="background-color: #e10328;"></text> 已退款</view> + <view v-if="item.status == 3" style="red"><text style="background-red"></text> 已退款</view> <view class="" v-if="item.isUsing == false && item.isFinished == false && item.status != 3"> <view v-if="item.status == 1" style="color: #004fd8;"><text style="background-color: #004fd8;"></text> 未支付</view> @@ -25,8 +25,8 @@ style="background-color: #5d5d5d;"></text> 系统超时取消</view> <view v-if="item.status == 6" style="color: #e6b000;"><text style="background-color: #e6b000;"></text> 支付中</view> - <view v-if="item.status == 7" style="color: #e10328;"><text - style="background-color: #e10328;"></text> 退款中</view> + <view v-if="item.status == 7" style="red"><text + style="background-red"></text> 退款中</view> <view v-if="item.status == 8" style="color: #004fd8;"><text style="background-color: #004fd8;"></text> 押金未支付</view> <view v-if="item.status == 9" style="color: #e6b000;"><text @@ -34,7 +34,7 @@ </view> </view> <view class="item_xx"> - <view class=""> + <view class=""> 订单号 </view> <view class=""> diff --git a/page_user/orderdetail.vue b/page_user/orderdetail.vue index cf9661b..cd5b7a2 100644 --- a/page_user/orderdetail.vue +++ b/page_user/orderdetail.vue @@ -53,7 +53,7 @@ </view> <view class="xiao" v-if="obj.status == 3"> <view>退款金额</view> - <view style="color: red;">¥{{obj.refundAmount == undefined ? '--' : obj.refundAmount}}</view> + <view style="color: #e10328;">¥{{obj.refundAmount == undefined ? '--' : obj.refundAmount}}</view> </view> <view class="xiao"> <view>结束时间</view> @@ -95,7 +95,7 @@ </view> <view class="xiao" v-for="(item,index) in obj.bonusList" :key="index"> <view class="one">{{item.arrivalName == undefined ? '--' : item.arrivalName}}(<text v-if="item.arrivalType == 1">平台</text><text v-if="item.arrivalType == 2">公司</text><text v-if="item.arrivalType == 3">合作伙伴</text><text v-if="item.arrivalType == 4">渠道商</text><text v-if="item.arrivalType == 5">创业者</text><text v-if="item.arrivalType == 6">经营场所</text>){{item.point}}%</view> - <view class="two">¥{{item.amount == undefined ? '--' : item.amount}} <text v-if="obj.status == 3" style="margin-left: 20rpx;color: red;">(已退¥{{item.refundAmount}})</text> </view> + <view class="two">¥{{item.amount == undefined ? '--' : item.amount}} <text v-if="obj.status == 3" style="margin-left: 20rpx;color: #e10328;">(已退¥{{item.refundAmount}})</text> </view> </view> </view> <view class="sb" v-if="userflag" @click="btntz" style="width:680rpx;height: 100rpx;display: flex;justify-content: space-between;background: #FFFFFF; @@ -219,7 +219,6 @@ }) } }, - } } </script> diff --git a/pages/my.vue b/pages/my.vue index 75fc7ec..67d61b2 100644 --- a/pages/my.vue +++ b/pages/my.vue @@ -1,7 +1,8 @@ <template> <view class="page"> - 333 - + <button @click="click" style="margin-top:500rpx ;">按钮</button> + <input type="text" v-model="name" placeholder="请输入您的姓名" /> + <input type="text" v-model="namemobel" placeholder="请输入您的身份证号" /> </view> </template> @@ -12,11 +13,43 @@ bgc: { backgroundColor: "#4C97E7", }, - - + name:'', + namemobel:'', + paw:'', + title:'提示', + } }, methods: { + click(){ + // 检查是否支持生物认证 + uni.checkIsSupportSoterAuthentication({ + success: (res) => { + // 调用人脸识别API + wx.startFacialRecognitionVerify({ + name: this.name, // 用户名称 + idCardNumber: this.namemobel, // 身份证号码 + success: (result) => { + if (result.errMsg === 'startFacialRecognitionVerify:ok') { + // 处理人脸识别成功的情况 + console.log('人脸识别成功'); + } + }, + fail: (error) => { + // 处理人脸识别失败的情况 + uni.showToast({ + title: '人脸识别失败', + icon: 'none', + duration: 2000 + }); + } + }); + }, + fail: (err) => { + console.log('支持生物认证失败', err); + } + }); + } } } @@ -26,6 +59,14 @@ page { background-color: #fff; } - + .title{ + width: 100%; + height: 100%; + background-color: #fff; + border-radius: 50rpx; + padding: 20rpx; + margin: auto; + + } </style> \ No newline at end of file diff --git a/pages/zhuce.vue b/pages/zhuce.vue index bd12172..4bcce86 100644 --- a/pages/zhuce.vue +++ b/pages/zhuce.vue @@ -10,7 +10,7 @@ <view class="cen"> <view class="name"> <view class=""> - 状态:<text v-if="item.flags == true" style="color: red;">已录入</text> <text v-else + 状态:<text v-if="item.flags == true" style="color: #e10328;">已录入</text> <text v-else style="color:seagreen;">未录入</text> </view> <view class="" style="display: flex;"> @@ -31,7 +31,7 @@ </view> </view> <view class="rt"> - <text style="margin-bottom: 10rpx;" :id="item.deviceId" @click="createBLEConnections(item)">开关</text> + <text style="margin-bottom: 10rpx;" :id="item.deviceId" @click="createBLEConnections(item)">{{item.lj}}</text> <text @click="scanQRCode(item)" style="margin-bottom: 10rpx;">扫码</text> <text :id="item.deviceId" @click="createBLEConnection(item)">录入</text> </view> @@ -301,6 +301,7 @@ ...device, flags, // 直接使用 flags 变量 sn: '', + lj:'连接' } }) } @@ -313,7 +314,9 @@ } else { //蓝牙停止搜索失败 this.mengcflag = false - uni.hideLoading() + setTimeout(()=>{ + uni.hideLoading() + },2000) console.log('蓝牙停止搜索失败'); } this.searching = false @@ -323,9 +326,6 @@ // 发送开关 createBLEConnections(e) { - uni.showLoading({ - title: '执行中...' - }) this.arrs = '' this.qrResult = e.name //拿到所点击的mac号 if (this.ver_data == null) { //判断是否有连接蓝牙 @@ -334,8 +334,29 @@ xBlufi.notifyStartDiscoverBle({ 'isStart': true }) + uni.showLoading({ + title: '连接准备中...' + }) // 停止蓝牙搜索 setTimeout(() => { + setTimeout(()=>{ + uni.showLoading({ + title: '连接中...' + }) + setTimeout(()=>{ + uni.hideLoading() + uni.showToast({ + title: '连接成功', + icon: 'success', + duration: 2000 + }) + this.devicesLists.forEach(item => { + if (item.name == this.qrResult) { + item.lj = '开关' + } + }) + },2000) + },500) xBlufi.notifyStartDiscoverBle({ 'isStart': false }) @@ -349,6 +370,9 @@ }) }, 1000) }else{ //有连接则发送命令 + uni.showLoading({ + title: '执行中...' + }) let that = this //改变this指向 uni.getNetworkType({ success(res) { @@ -370,6 +394,11 @@ wx.closeBLEConnection({ deviceId: that.deviceId, }) + that.devicesLists.forEach(item => { + if (item.name == that.qrResult) { + item.lj = '连接' + } + }) // console.log('guanbi'); },1000) },2000) @@ -478,9 +507,11 @@ uni.showLoading({ title: '请稍后...' }) + xBlufi.initXBlufi(1); + xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); xBlufi.notifyStartDiscoverBle({ 'isStart': true - }); + }) // 重新搜索清空蓝牙数组 this.bluthlist = [] this.devicesList = [] @@ -492,7 +523,7 @@ this.texts = '正在扫描蓝牙设备...' setTimeout(() => { this.statusflag = false - if (this.searching) { + // if (this.searching) { xBlufi.notifyStartDiscoverBle({ 'isStart': false }); @@ -503,11 +534,11 @@ } else { this.texts = '扫描到以下设备,请点击录入!' } - } else { - xBlufi.notifyStartDiscoverBle({ - 'isStart': true - }) - } + // } else { + // xBlufi.notifyStartDiscoverBle({ + // 'isStart': true + // }) + // } }, 2000) // } },