This commit is contained in:
3321822538@qq.com 2024-05-25 11:34:26 +08:00
parent 18421bc31b
commit 984d221e2e
6 changed files with 53 additions and 14 deletions

View File

@ -72,8 +72,15 @@
onlyFromCamera: true,
scanType: ['qrCode'],
success: res => {
console.log('扫描结果:', res);
this.deviceNo = res.result;
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
let results = regex.exec(url);
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null;
}
let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue);
this.deviceNo = getQueryParam(decodedValue, 'deviceNo')
// this.deviceNo = res.result;
},
fail: err => {
console.error('扫描失败:', err);

View File

@ -167,11 +167,19 @@
onlyFromCamera: true,
scanType: ['qrCode'],
success: res => {
console.log('扫描结果:', res);
this.$u.get(`/app/device/${res.result}/bySn`).then((res) =>{
// console.log('', res);
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
let results = regex.exec(url);
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null;
}
let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue);
let id = getQueryParam(decodedValue, 'deviceNo')
this.$u.get(`/app/device/${id}/bySn`).then((res) =>{
if(res.code == 200){
this.qrResult = 'CTKG-' + res.data.mac
// console.log(this.qrResult);
// uni.navigateTo({
// url:'/page_fenbao/device/lianjie?mac=' + this.qrResult + '&storeId=' + this.storeId
// })

View File

@ -88,9 +88,17 @@
onlyFromCamera: true,
scanType: ['qrCode'],
success: res => {
console.log('扫描结果:', res);
let id = res.result
this.$u.get(`/app/device/${res.result}/withSuitList`).then((res) =>{
// console.log('', res);
// let id = res.result
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
let results = regex.exec(url);
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null;
}
let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue);
let id = getQueryParam(decodedValue, 'deviceNo')
this.$u.get(`/app/device/${id}/withSuitList`).then((res) =>{
if(res.code == 200){
uni.navigateTo({
url: '/page_components/fuwu/index?id=' + id
@ -295,13 +303,14 @@
width: 150rpx;
height: 134rpx;
// background-color: #D9D8FF;
border-radius: 10rpx;
border-radius: 20rpx;
// margin-right: 28rpx;
image{
width: 100%;
height: 100%;
mode: "aspectFill";
margin-top: 10rpx;
border-radius: 20rpx;
}
}
.cen{

View File

@ -102,8 +102,15 @@
onlyFromCamera: true,
scanType: ['qrCode'],
success: res => {
console.log('扫描结果:', res);
this.qrResult = res.result; //
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
let results = regex.exec(url);
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null;
}
let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue);
this.qrResult = getQueryParam(decodedValue, 'deviceNo')
// this.qrResult = res.result; //
},
fail: err => {
console.error('扫描失败:', err);

View File

@ -483,6 +483,8 @@
scanType: ['qrCode'],
success: res => {
console.log('扫描结果:', res);
this.qrResult = res.result;
// this.$u.get(`/app/device/${this.qrResult}/withSuitList`).then((res) =>{
// if(res.code == 200){

View File

@ -128,9 +128,15 @@
onlyFromCamera: true,
scanType: ['qrCode'],
success: res => {
// console.log('', res);
let id = res.result
this.$u.get(`/app/device/${res.result}/withSuitList`).then((res) => {
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
let results = regex.exec(url);
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null;
}
let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue);
let id = getQueryParam(decodedValue, 'deviceNo')
this.$u.get(`/app/device/${id}/withSuitList`).then((res) => {
if (res.code == 200) {
uni.navigateTo({
url: '/page_components/fuwu/index?id=' + id