|
@@ -162,7 +162,7 @@ import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from
|
|
import useStores from "@/store/modules/user.js";
|
|
import useStores from "@/store/modules/user.js";
|
|
import publicStore from "@/store/modules/public";
|
|
import publicStore from "@/store/modules/public";
|
|
|
|
|
|
-import { scan_push, getHomePageData, getFunctionalModuleStatistics, getAppRouters } from "@/api/index";
|
|
|
|
|
|
+import { scan_push, getHomePageData, getFunctionalModuleStatistics, getAppRouters, qrCodeSend } from "@/api/index";
|
|
|
|
|
|
const useStore = useStores();
|
|
const useStore = useStores();
|
|
const publicStores = publicStore(); //全局公共Store
|
|
const publicStores = publicStore(); //全局公共Store
|
|
@@ -225,7 +225,7 @@ async function init() {
|
|
window.location.href = BASE_URL + "Com/getPageAuthorization1";
|
|
window.location.href = BASE_URL + "Com/getPageAuthorization1";
|
|
}
|
|
}
|
|
|
|
|
|
-//扫码
|
|
|
|
|
|
+//微信扫码
|
|
function scanQRCode() {
|
|
function scanQRCode() {
|
|
// scanCode();
|
|
// scanCode();
|
|
jwx.configWeiXin((jweixin) => {
|
|
jwx.configWeiXin((jweixin) => {
|
|
@@ -245,11 +245,21 @@ function scanQRCode() {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//APP扫码
|
|
function scanCode() {
|
|
function scanCode() {
|
|
uni.scanCode({
|
|
uni.scanCode({
|
|
scanType: ["qrCode"],
|
|
scanType: ["qrCode"],
|
|
success: (res) => {
|
|
success: (res) => {
|
|
- console.log("扫码成功", res);
|
|
|
|
|
|
+ let list = JSON.parse(res.result);
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "扫码成功",
|
|
|
|
+ icon: "none",
|
|
|
|
+ });
|
|
|
|
+ qrCodeSend({
|
|
|
|
+ qrCode: list.uid,
|
|
|
|
+ tenantId: useStore.$state.tenantId,
|
|
|
|
+ userName: useStore.$state.userName,
|
|
|
|
+ }).then((res) => {});
|
|
},
|
|
},
|
|
fail: (err) => {
|
|
fail: (err) => {
|
|
console.log("扫码失败", err);
|
|
console.log("扫码失败", err);
|
|
@@ -274,7 +284,6 @@ async function getCodeResult(param = {}) {
|
|
|
|
|
|
//获取地理位置
|
|
//获取地理位置
|
|
function getLocation() {
|
|
function getLocation() {
|
|
-
|
|
|
|
jwx.configWeiXin((jweixin) => {
|
|
jwx.configWeiXin((jweixin) => {
|
|
// 微信公众号获取位置
|
|
// 微信公众号获取位置
|
|
jweixin.getLocation({
|
|
jweixin.getLocation({
|
|
@@ -439,7 +448,14 @@ async function getHandleData(param = {}) {
|
|
onNavigationBarButtonTap((e) => {
|
|
onNavigationBarButtonTap((e) => {
|
|
if (e.float == "right") {
|
|
if (e.float == "right") {
|
|
// alert("你点击了扫一扫");
|
|
// alert("你点击了扫一扫");
|
|
|
|
+
|
|
|
|
+ //#ifdef H5
|
|
scanQRCode();
|
|
scanQRCode();
|
|
|
|
+ //#endif
|
|
|
|
+
|
|
|
|
+ //#ifdef APP-PLUS
|
|
|
|
+ scanCode();
|
|
|
|
+ //#endif
|
|
} else {
|
|
} else {
|
|
// alert("你点击了获取位置");
|
|
// alert("你点击了获取位置");
|
|
// getLocation()
|
|
// getLocation()
|