aaa
This commit is contained in:
parent
18421bc31b
commit
984d221e2e
|
@ -72,8 +72,15 @@
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
scanType: ['qrCode'],
|
scanType: ['qrCode'],
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log('扫描结果:', res);
|
function getQueryParam(url, paramName) {
|
||||||
this.deviceNo = res.result;
|
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 => {
|
fail: err => {
|
||||||
console.error('扫描失败:', err);
|
console.error('扫描失败:', err);
|
||||||
|
|
|
@ -167,11 +167,19 @@
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
scanType: ['qrCode'],
|
scanType: ['qrCode'],
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log('扫描结果:', res);
|
// console.log('扫描结果:', res);
|
||||||
this.$u.get(`/app/device/${res.result}/bySn`).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}/bySn`).then((res) =>{
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.qrResult = 'CTKG-' + res.data.mac
|
this.qrResult = 'CTKG-' + res.data.mac
|
||||||
|
// console.log(this.qrResult);
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url:'/page_fenbao/device/lianjie?mac=' + this.qrResult + '&storeId=' + this.storeId
|
// url:'/page_fenbao/device/lianjie?mac=' + this.qrResult + '&storeId=' + this.storeId
|
||||||
// })
|
// })
|
||||||
|
|
|
@ -88,9 +88,17 @@
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
scanType: ['qrCode'],
|
scanType: ['qrCode'],
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log('扫描结果:', res);
|
// console.log('扫描结果:', res);
|
||||||
let id = res.result
|
// 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){
|
if(res.code == 200){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/page_components/fuwu/index?id=' + id
|
url: '/page_components/fuwu/index?id=' + id
|
||||||
|
@ -295,13 +303,14 @@
|
||||||
width: 150rpx;
|
width: 150rpx;
|
||||||
height: 134rpx;
|
height: 134rpx;
|
||||||
// background-color: #D9D8FF;
|
// background-color: #D9D8FF;
|
||||||
border-radius: 10rpx;
|
border-radius: 20rpx;
|
||||||
// margin-right: 28rpx;
|
// margin-right: 28rpx;
|
||||||
image{
|
image{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
mode: "aspectFill";
|
mode: "aspectFill";
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cen{
|
.cen{
|
||||||
|
|
|
@ -102,8 +102,15 @@
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
scanType: ['qrCode'],
|
scanType: ['qrCode'],
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log('扫描结果:', res);
|
function getQueryParam(url, paramName) {
|
||||||
this.qrResult = res.result; // 将扫描结果存储在数据中
|
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 => {
|
fail: err => {
|
||||||
console.error('扫描失败:', err);
|
console.error('扫描失败:', err);
|
||||||
|
|
|
@ -483,6 +483,8 @@
|
||||||
scanType: ['qrCode'],
|
scanType: ['qrCode'],
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log('扫描结果:', res);
|
console.log('扫描结果:', res);
|
||||||
|
|
||||||
|
|
||||||
this.qrResult = res.result;
|
this.qrResult = res.result;
|
||||||
// this.$u.get(`/app/device/${this.qrResult}/withSuitList`).then((res) =>{
|
// this.$u.get(`/app/device/${this.qrResult}/withSuitList`).then((res) =>{
|
||||||
// if(res.code == 200){
|
// if(res.code == 200){
|
||||||
|
|
|
@ -128,9 +128,15 @@
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
scanType: ['qrCode'],
|
scanType: ['qrCode'],
|
||||||
success: res => {
|
success: res => {
|
||||||
// console.log('扫描结果:', res);
|
function getQueryParam(url, paramName) {
|
||||||
let id = res.result
|
let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
|
||||||
this.$u.get(`/app/device/${res.result}/withSuitList`).then((res) => {
|
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) {
|
if (res.code == 200) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/page_components/fuwu/index?id=' + id
|
url: '/page_components/fuwu/index?id=' + id
|
||||||
|
|
Loading…
Reference in New Issue
Block a user