From 53901aec4ff16a04384f68e97045840a4068c00d Mon Sep 17 00:00:00 2001
From: "3321822538@qq.com" <3321822538@qq.com>
Date: Mon, 27 May 2024 16:06:08 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
page_fenbao/statulist/merchant/index.vue | 9 +-
.../statulist/myorder/detailxq/index.vue | 17 +-
.../statulist/myshop/shebeilist/index.vue | 2 +-
.../statulist/myshop/shopdetail/index.vue | 538 +++++++++---------
page_fenbao/statulist/nearby/index.vue | 113 +++-
.../statulist/question/xiangqing/index.vue | 4 +-
page_user/mapditu/index.vue | 126 +++-
pages.json | 18 +
pages/index/index.vue | 6 +-
pages/shouye/index.vue | 246 +++++---
pages/tj.vue | 10 +-
11 files changed, 732 insertions(+), 357 deletions(-)
diff --git a/page_fenbao/statulist/merchant/index.vue b/page_fenbao/statulist/merchant/index.vue
index 2265b62..7c92df1 100644
--- a/page_fenbao/statulist/merchant/index.vue
+++ b/page_fenbao/statulist/merchant/index.vue
@@ -96,9 +96,10 @@
/deep/ .u-title{
padding-bottom: 41rpx;
}
- /deep/ .u-icon__icon{
+ /deep/ .uicon-nav-back{
padding-bottom: 41rpx;
}
+
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}
@@ -158,7 +159,7 @@
}
textarea{
font-size: 30rpx;
- color: #9F9F9F;
+ color: #333;
padding-right: 20rpx;
}
}
@@ -179,7 +180,7 @@
}
input{
font-size: 30rpx;
- color: #9F9F9F;
+ color: #333;
}
}
.name{
@@ -199,7 +200,7 @@
}
input{
font-size: 30rpx;
- color: #9F9F9F;
+ color: #333;
}
}
}
diff --git a/page_fenbao/statulist/myorder/detailxq/index.vue b/page_fenbao/statulist/myorder/detailxq/index.vue
index 473fc0d..ba94569 100644
--- a/page_fenbao/statulist/myorder/detailxq/index.vue
+++ b/page_fenbao/statulist/myorder/detailxq/index.vue
@@ -49,7 +49,7 @@
-
+
@@ -78,6 +78,21 @@
}
})
},
+ btnad(){
+ this.$u.get("/app/ad").then((res) => {
+ if (res.code == 200) {
+ if(res.data.urlType == 1){
+ uni.navigateTo({
+ url:'/page_fenbao/webview?url=' + res.data.url
+ })
+ }else{
+ uni.navigateTo({
+ url: res.data.url
+ })
+ }
+ }
+ })
+ },
getad(){
this.$u.get("/app/ad").then((res) => {
if (res.code == 200) {
diff --git a/page_fenbao/statulist/myshop/shebeilist/index.vue b/page_fenbao/statulist/myshop/shebeilist/index.vue
index 4ec158a..0e6c19b 100644
--- a/page_fenbao/statulist/myshop/shebeilist/index.vue
+++ b/page_fenbao/statulist/myshop/shebeilist/index.vue
@@ -195,7 +195,7 @@
image {
width: 180rpx;
- height: 230rpx;
+ height: 200rpx;
border-radius: 20rpx;
}
}
diff --git a/page_fenbao/statulist/myshop/shopdetail/index.vue b/page_fenbao/statulist/myshop/shopdetail/index.vue
index b1c86ea..63206fb 100644
--- a/page_fenbao/statulist/myshop/shopdetail/index.vue
+++ b/page_fenbao/statulist/myshop/shopdetail/index.vue
@@ -1,11 +1,11 @@
-
-
-
- {{listobj.name}}
-
+
+
+
+ {{listobj.name}}
+
基本信息
@@ -14,7 +14,8 @@
绑定设备: {{listobj.deviceCount}}
- 营业时间: {{listobj.businessTimeStart}}~{{listobj.businessTimeEnd}}
+ 营业时间: {{listobj.businessTimeStart}}~{{listobj.businessTimeEnd}}
详细地址: {{listobj.address}}
@@ -24,15 +25,19 @@
-
-
-
-
+
+
+
+
-
-
+
+
-
+
@@ -41,34 +46,34 @@
export default {
data() {
return {
- list: [{
- value: '1',
- label: '扫码添加'
- },
- {
- value: '2',
- label: '搜索附近设备添加'
- }
- ],
+ list: [{
+ value: '1',
+ label: '扫码添加'
+ },
+ {
+ value: '2',
+ label: '搜索附近设备添加'
+ }
+ ],
show: false,
- storeId:'',
- listobj:{},
- deviceId:'',
- name:'',
- mac:''
+ storeId: '',
+ listobj: {},
+ deviceId: '',
+ name: '',
+ mac: ''
}
},
onLoad(option) {
this.storeId = option.id
this.getdetail()
-
+
// xBlufi.initXBlufi(1);
// console.log("xBlufi", xBlufi.XMQTT_SYSTEM);
// xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
// xBlufi.notifyStartDiscoverBle({
// 'isStart': true
// });
-
+
// // 停止蓝牙搜索
// setTimeout(() => {
// xBlufi.notifyStartDiscoverBle({
@@ -80,7 +85,7 @@
// name: this.name
// });
// }, 3000)
-
+
},
onUnload: function() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
@@ -88,7 +93,7 @@
'isStart': false
});
},
- onHide(){
+ onHide() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': false
@@ -101,31 +106,31 @@
});
},
methods: {
- getdetail(){
+ getdetail() {
this.$u.get("/app/store/mch/" + this.storeId).then(res => {
if (res.code == 200) {
this.listobj = res.data
}
})
},
-
-
- btnpag(num){
- if(num == 1){
+
+
+ btnpag(num) {
+ if (num == 1) {
uni.navigateTo({
- url:'/page_fenbao/statulist/myshop/shebeilist/index?storeId=' + this.storeId
+ url: '/page_fenbao/statulist/myshop/shebeilist/index?storeId=' + this.storeId
})
- }else if(num == 2){
+ } else if (num == 2) {
uni.navigateTo({
- url:'/page_fenbao/statulist/myshop/editshop/index?obj=' + JSON.stringify(this.listobj)
+ url: '/page_fenbao/statulist/myshop/editshop/index?obj=' + JSON.stringify(this.listobj)
})
- }else if(num == 3){
+ } else if (num == 3) {
let vm = this
- uni.showModal({
- title: '提示',
- content: '你确定要注销这个店铺吗?',
- success: function (res) {
- if (res.confirm) {
+ uni.showModal({
+ title: '提示',
+ content: '你确定要注销这个店铺吗?',
+ success: function(res) {
+ if (res.confirm) {
vm.$u.delete("/app/store/" + vm.storeId).then(res => {
if (res.code == 200) {
uni.showToast({
@@ -133,10 +138,10 @@
icon: 'success',
duration: 1000
})
- setTimeout(()=>{
+ setTimeout(() => {
uni.navigateBack()
- },1500)
- }else if(res.code == 500){
+ }, 1500)
+ } else if (res.code == 500) {
uni.showToast({
title: res.msg,
icon: 'success',
@@ -144,30 +149,30 @@
})
}
})
- } else if (res.cancel) {
- console.log('用户点击了取消');
- }
- }
+ } else if (res.cancel) {
+ console.log('用户点击了取消');
+ }
+ }
});
}
},
-
- confirm(e) {
- let type = e[0].value
- if (type == '1') {
- this.scanQRCode()
- } else if (type == '2') {
- uni.navigateTo({
- url: '/page_fenbao/device/index?storeId=' + this.storeId
- })
- }
- },
- scanQRCode() {
- uni.scanCode({
- onlyFromCamera: true,
- scanType: ['qrCode'],
- success: res => {
- // console.log('扫描结果:', res);
+
+ confirm(e) {
+ let type = e[0].value
+ if (type == '1') {
+ this.scanQRCode()
+ } else if (type == '2') {
+ uni.navigateTo({
+ url: '/page_fenbao/device/index?storeId=' + this.storeId
+ })
+ }
+ },
+ scanQRCode() {
+ uni.scanCode({
+ onlyFromCamera: true,
+ scanType: ['qrCode'],
+ success: res => {
+ // console.log('扫描结果:', res);
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
let results = regex.exec(url);
@@ -176,9 +181,9 @@
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
+ 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
@@ -188,200 +193,214 @@
xBlufi.notifyStartDiscoverBle({
'isStart': true
});
-
-
- // 停止蓝牙搜索
- setTimeout(() => {
- xBlufi.notifyStartDiscoverBle({
- 'isStart': false
- });
- xBlufi.notifyConnectBle({
- isStart: true,
- deviceId: this.deviceId,
- name: this.name
- });
- }, 2000)
- uni.showLoading({ title: '连接中...' });
-
-
+
+
+ // 停止蓝牙搜索
+ setTimeout(() => {
+ xBlufi.notifyStartDiscoverBle({
+ 'isStart': false
+ });
+ xBlufi.notifyConnectBle({
+ isStart: true,
+ deviceId: this.deviceId,
+ name: this.name
+ });
+ }, 2000)
+ uni.showLoading({
+ title: '连接中...'
+ });
+
+
}
})
- },
- fail: err => {
- console.error('扫描失败:', err);
- uni.showToast({
- title: '扫描失败',
- icon: 'none'
- });
- }
- });
- },
-
- funListenDeviceMsgEvent: function(options) {
- switch (options.type) {
- case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
- if (options.result) {
- let devicesarr = options.data
- console.log(devicesarr,'devicesarrdevicesarr');
- devicesarr.forEach(device => {
- const mac = device.name.substring(5);
- if (device.name == this.qrResult) {
- this.deviceId = device.deviceId
- this.name = device.name
+ },
+ fail: err => {
+ console.error('扫描失败:', err);
+ uni.showToast({
+ title: '扫描失败',
+ icon: 'none'
+ });
+ }
+ });
+ },
+
+ funListenDeviceMsgEvent: function(options) {
+ switch (options.type) {
+ case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
+ if (options.result) {
+ let devicesarr = options.data
+ console.log(devicesarr, 'devicesarrdevicesarr');
+ devicesarr.forEach(device => {
+ const mac = device.name.substring(5);
+ if (device.name == this.qrResult) {
+ this.deviceId = device.deviceId
+ this.name = device.name
this.mac = device.name.substring(5)
- this.devicesList = uniqueDevicesList;
- }
-
- });
- }
- break;
-
- case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
- console.log("连接回调:" + JSON.stringify(options));
- if (options.result) {
- uni.hideLoading();
- // uni.showToast({
- // title: '连接成功',
- // icon: 'none'
- // });
- {
- console.log("连接回调options.data.deviceId:" + options.data.deviceId,
- "连接回调options.data.name:" + options.data.name);
- let name = ''
- let index = this.name.indexOf('-');
- if (index !== -1) {
- name = this.name.slice(index + 1);
- }
- let data = {
- storeId:this.storeId,
- mac:this.mac
- }
- this.$u.put('/app/device/bind', data).then((res) => {
- if (res.code == 200) {
- uni.showToast({
- title: '绑定成功',
- icon: 'none',
- duration: 2000
- });
+ this.devicesList = uniqueDevicesList;
+ }
+
+ });
+ } else {
+ uni.showToast({
+ title: '没有发现设备',
+ icon: 'none'
+ });
+ }
+ break;
+
+ case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
+ console.log("连接回调:" + JSON.stringify(options));
+ if (options.result) {
+ uni.hideLoading();
+ // uni.showToast({
+ // title: '连接成功',
+ // icon: 'none'
+ // });
+ {
+ console.log("连接回调options.data.deviceId:" + options.data.deviceId,
+ "连接回调options.data.name:" + options.data.name);
+ let name = ''
+ let index = this.name.indexOf('-');
+ if (index !== -1) {
+ name = this.name.slice(index + 1);
+ }
+ let data = {
+ storeId: this.storeId,
+ mac: this.mac
+ }
+ this.$u.put('/app/device/bind', data).then((res) => {
+ if (res.code == 200) {
+ uni.showToast({
+ title: '绑定成功',
+ icon: 'none',
+ duration: 2000
+ });
uni.hideLoading();
- uni.removeStorageSync('mac');
- let vm = this
- uni.showModal({
- title: '提示',
- content: '你已绑定成功,需前去配网吗?',
- success: function (res) {
- if (res.confirm) {
- let systemInfo = uni.getSystemInfoSync();
- if (systemInfo.platform === 'android') {
- // 当前设备是 Android
- uni.navigateTo({
- url: '/page_components/wifilist/index?deviceId=' + options
- .data.deviceId + '&name=' + options.data.name
- })
- } else if (systemInfo.platform === 'ios') {
- // 当前设备是 iOS
- uni.navigateTo({
- url: '/page_fenbao/device/wifivideo?deviceId=' + options
- .data.deviceId + '&name=' + options.data.name
- })
- }
- } else if (res.cancel) {
- console.log('用户点击了取消');
- }
- }
- })
-
- }else if(res.code == 500){
+ uni.removeStorageSync('mac');
+ let vm = this
+ uni.showModal({
+ title: '提示',
+ content: '你已绑定成功,需前去配网吗?',
+ success: function(res) {
+ if (res.confirm) {
+ let systemInfo = uni.getSystemInfoSync();
+ if (systemInfo.platform === 'android') {
+ // 当前设备是 Android
+ uni.navigateTo({
+ url: '/page_components/wifilist/index?deviceId=' +
+ options
+ .data.deviceId + '&name=' +
+ options.data.name
+ })
+ } else if (systemInfo.platform === 'ios') {
+ // 当前设备是 iOS
+ uni.navigateTo({
+ url: '/page_fenbao/device/wifivideo?deviceId=' +
+ options
+ .data.deviceId + '&name=' +
+ options.data.name
+ })
+ }
+ } else if (res.cancel) {
+ console.log('用户点击了取消');
+ }
+ }
+ })
+
+ } else if (res.code == 500) {
uni.showToast({
title: '该设备已被绑定',
icon: 'none',
duration: 2000
});
} else {
- uni.showToast({
- title: '连接失败',
- icon: 'none',
- duration: 2000
- });
- // uni.navigateBack()
- }
- })
- }
- }
-
- break;
-
- case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
- if (!options.result) {
- console.log("蓝牙未开启", options);
- uni.showToast({
- title: '蓝牙未开启',
- icon: 'none',
- duration: 3000
- });
- } else {
- // this.searching = true
- //蓝牙搜索开始
- // _this.setData({
- // searching: true
- // });
- }
-
- break;
-
- case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
- if (options.result) {
- let uniqueDevicesList = Array.from(new Set(this.devicesList));
-
- // 将去重后的数组重新赋值给 this.devicesList
- this.devicesList = uniqueDevicesList;
- let list = []
- filteredDevices.forEach(device => {
- // 从设备名称中提取 MAC 地址(假设 MAC 地址是设备名称的后6个字符)
- let macFromName = device.name.substring(device.name.length - 12);
- // console.log(macFromName);
- // 与 this.mac 进行比较
- this.$u.get(`/app/device/${macFromName}/isBind`).then((res) => {
- if (res.data == false) {
- list.push(device)
- } else {
-
- }
- })
-
- });
- setTimeout(() => {
- this.devicesList = list
- }, 200)
-
- console.log('蓝牙停止搜索ok');
- } else {
- //蓝牙停止搜索失败
- console.log('蓝牙停止搜索失败');
- }
- this.searching = false
- // _this.setData({
- // searching: false
- // });
-
- break;
- }
- },
-
+ uni.showToast({
+ title: '连接失败',
+ icon: 'none',
+ duration: 2000
+ });
+ // uni.navigateBack()
+ }
+ })
+ }
+ }
+
+ break;
+
+ case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
+ if (!options.result) {
+ console.log("蓝牙未开启", options);
+ uni.showToast({
+ title: '蓝牙未开启',
+ icon: 'none',
+ duration: 3000
+ });
+ } else {
+ // this.searching = true
+ //蓝牙搜索开始
+ // _this.setData({
+ // searching: true
+ // });
+ }
+
+ break;
+
+ case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
+ if (options.result) {
+ let uniqueDevicesList = Array.from(new Set(this.devicesList));
+
+ // 将去重后的数组重新赋值给 this.devicesList
+ this.devicesList = uniqueDevicesList;
+ let list = []
+ filteredDevices.forEach(device => {
+ // 从设备名称中提取 MAC 地址(假设 MAC 地址是设备名称的后6个字符)
+ let macFromName = device.name.substring(device.name.length - 12);
+ // console.log(macFromName);
+ // 与 this.mac 进行比较
+ this.$u.get(`/app/device/${macFromName}/isBind`).then((res) => {
+ if (res.data == false) {
+ list.push(device)
+ } else {
+
+ }
+ })
+
+ });
+ setTimeout(() => {
+ this.devicesList = list
+ }, 200)
+
+ console.log('蓝牙停止搜索ok');
+ } else {
+ //蓝牙停止搜索失败
+ console.log('蓝牙停止搜索失败');
+ }
+ this.searching = false
+ // _this.setData({
+ // searching: false
+ // });
+
+ break;
+ }
+ },
+
}
}