); | ); | ||||
break; | break; | ||||
case "JT": | case "JT": | ||||
console.info("连接的是=====123" + prefixName, device); | |||||
jtApi.connectDevice( | jtApi.connectDevice( | ||||
device, | device, | ||||
function (res) { | function (res) { | ||||
}; | }; | ||||
function oks() { | function oks() { | ||||
//routeType 1.激活(订单来) 2.圈存 (/pages/recharge/recharge来)3.信息重写 4.信息读取 5从哪里来回哪里去监听bluetoothLink | |||||
//routeType 1.激活(订单来) 2.圈存 (/pages/recharge/recharge来)3.ping码解锁 4.信息读取 5从哪里来回哪里去监听bluetoothLink | |||||
if (routeType.value == "1") { | if (routeType.value == "1") { | ||||
uni.navigateTo({ | uni.navigateTo({ | ||||
url: "/subpackage/after-sale/activation/activate", | url: "/subpackage/after-sale/activation/activate", | ||||
url: `/pages/recharge/recharge-weixin?connectSuccess=${state.connectSuccess}`, | url: `/pages/recharge/recharge-weixin?connectSuccess=${state.connectSuccess}`, | ||||
}); | }); | ||||
} else if (routeType.value == "3") { | } else if (routeType.value == "3") { | ||||
uni.navigateTo({ | |||||
url: "/subpackage/after-sale/pin-code-deblocking/pin-code-confirm?state=true&id=" + state.id, | |||||
}); | |||||
} else if (routeType.value == "4") { | } else if (routeType.value == "4") { | ||||
uni.navigateTo({ | uni.navigateTo({ | ||||
url: "/subpackage/after-sale/deviceInfo/deviceInfo", | url: "/subpackage/after-sale/deviceInfo/deviceInfo", | ||||
}); | }); | ||||
} else if (routeType.value == "5") { | |||||
} else if (routeType.value == "5") { | |||||
// uni.$emit('bluetoothLink', { status: true }) | // uni.$emit('bluetoothLink', { status: true }) | ||||
// uni.navigateBack({ | // uni.navigateBack({ | ||||
// delta: 1 | // delta: 1 |
wechatPayConfigId, | wechatPayConfigId, | ||||
wechatSecret, | wechatSecret, | ||||
aliPayConfigId, | aliPayConfigId, | ||||
aliPayConfigIdTwo, | |||||
obtainUserId, | obtainUserId, | ||||
getOpenidApi | getOpenidApi | ||||
} from "@/utils/network/api.js"; | } from "@/utils/network/api.js"; | ||||
const optionsUser = { | const optionsUser = { | ||||
type: 2, | type: 2, | ||||
data: { | data: { | ||||
payConfigId: aliPayConfigId, | |||||
payConfigId: aliPayConfigIdTwo, | |||||
code: res.authCode | code: res.authCode | ||||
}, | }, | ||||
method: "POST", | method: "POST", | ||||
wxOpenId: data.openId, | wxOpenId: data.openId, | ||||
cardId: state.cardId, | cardId: state.cardId, | ||||
orderNum: state.orderNum, | orderNum: state.orderNum, | ||||
payConfigId: "6a9a54123456578934edfre132b1234", | |||||
payConfigId: aliPayConfigIdTwo, | |||||
body: "储值卡充值", | body: "储值卡充值", | ||||
}, | }, | ||||
method: "POST", | method: "POST", | ||||
checkOrder(); | checkOrder(); | ||||
}, | }, | ||||
fail: res => { | fail: res => { | ||||
confirm(res, () => { }, "支付失败", false); | |||||
confirm(res, () => {}, "支付失败", false); | |||||
}, | }, | ||||
}); | }); | ||||
cardEnableTime: "", | cardEnableTime: "", | ||||
obuEnableTime: "", | obuEnableTime: "", | ||||
}); | }); | ||||
let ordId = ''; | |||||
onLoad((option) => { | onLoad((option) => { | ||||
//请求订单详情 | //请求订单详情 | ||||
queryOrderDetail(option.id); | queryOrderDetail(option.id); | ||||
ordId = option.id; | |||||
if (option.state) { | |||||
tools.showLoadingAlert("正在执行指令"); | |||||
state.disabled = true; | |||||
getPinCodeUnlock() | |||||
} | |||||
}); | }); | ||||
onShow((option) => { | |||||
uni.$on('bluetoothLink', res => { | |||||
console.log(res); | |||||
if (res.status) { | |||||
tools.showLoadingAlert("正在执行指令"); | |||||
state.disabled = true; | |||||
getPinCodeUnlock() | |||||
} | |||||
}) | |||||
}) | |||||
onUnload(() => { | onUnload(() => { | ||||
//移除监听 | //移除监听 | ||||
uni.$off('bluetoothLink') | uni.$off('bluetoothLink') | ||||
//去连接蓝牙 | //去连接蓝牙 | ||||
const toPage = () => { | const toPage = () => { | ||||
// getPinCodeUnlock() | // getPinCodeUnlock() | ||||
navTo("/pages/bluetooth/bluetooth?routeType=5"); //去连接蓝牙 | |||||
navTo("/pages/bluetooth/bluetooth?routeType=3&id=" + ordId); //去连接蓝牙 | |||||
}; | }; | ||||
//返回列表 | //返回列表 |