Compare commits

..

No commits in common. "ad2d48c4ca0588fd327ba95271e53a48a3fdf1e8" and "56db79cc2388189a1c0206f4ee47137f1fc432a8" have entirely different histories.

5 changed files with 28 additions and 194 deletions

View File

@ -13,8 +13,4 @@ export const GetAreaListApi = (data) =>
// 用户数据
export const GetUserDataApi = (data) =>
request.get("/api/AdminApp/GetUserData", data);
// Nfc重置
export const ResetNFCApi = (data) =>
request.post("/api/Region/ResetNFC", data);
request.get("/api/AdminApp/GetUserData", data);

View File

@ -29,7 +29,7 @@
<image class="card-img" style="width: 130rpx; height: 130rpx" src="/static/adminImg/card4.png"></image>
</view>
</view>
<view v-if="false" style="display: flex">
<view v-if="true" style="display: flex">
<u-button type="error" @click="testFn">调试录入卡片</u-button>
</view>
</view>

View File

@ -8,8 +8,8 @@
<view class="dialog-content">
<!-- 头部标题和标签 -->
<view class="dialog-header">
<text class="title">{{ currentRow.name }}</text>
<!-- <u-tag class="tag" text="室内" mode="light" /> -->
<text class="title">{{currentRow.name}}</text>
<u-tag class="tag" text="室内" mode="light" />
<!-- <u-tag
class="tag"
:text="areaType"
@ -25,9 +25,8 @@
</view>
<!-- 副标题 - 负责人 -->
<!-- <view class="dialog-subtitle"> 区域主负责人张三 </view> -->
<view>传入参数{{ showMsg }}</view>
<view>接口返回结果{{ resData }}</view>
<view class="dialog-subtitle"> 区域主负责人{{ "张三" }} </view>
<!-- 已存在卡片时显示图片 -->
<view class="dialog-image-container" v-if="isChange === true">
<!-- 替换为实际的图片路径 -->
@ -49,8 +48,7 @@
<view v-if="step === 1">1.请将标签卡贴靠设备NFC识别处</view>
<view v-if="step === 2">2.如果确定将该卡片写入该区域,请将标签卡贴靠设备xNFC识别处否则请退出</view>
<view v-if="step === 3">3.请再次将标签卡贴靠设备NFC识别处</view>
<!-- <view v-if="step === 3">{{ lookData }}</view> -->
<!-- <view v-if="step === 4">{{ lookData }}</view> -->
<view v-if="step === 4">{{lookData}}</view>
</view>
<!-- 底部按钮 -->
@ -62,7 +60,7 @@
</template>
<script>
import { ResetNFCApi } from '@/api/apiAdmin'
import { loginApi } from '@/api/apiList'
export default {
props: {
// /
@ -82,35 +80,17 @@ export default {
return {
isChange: false,
step: 0,
lookData: {},
resData: {},
showMsg: ''
lookData: {}
}
},
mounted() {
// window.nfcInitFn = this.nfcInitFn
window.nfcInitFn = this.nfcInitFn
},
onLoad() { },
onLoad() {},
methods: {
async nfcInitFn(data) {
nfcInitFn(data) {
if (!data) {
uni.showToast({ title: '未传入参数nfcInitFn', icon: 'none' })
return
}
this.showMsg = data
// uni.showModal({
// title: "",
// content: JSON.stringify(data) || '',
// success: function (res) {
// },
// });
if (data.step === 8) {
uni.showToast({ title: '刷卡失败', icon: 'none' })
return
}
if (this.isChange === true) {
uni.showToast({ title: '请点击更换绑定后刷卡', icon: 'none' })
return
return uni.showToast({ title: '未传入参数 initFn', icon: 'none' })
}
if (data.step === 1) {
this.step = 1
@ -120,53 +100,6 @@ export default {
}
if (data.step === 3) {
this.step = 3
this.lookData = data
const req = {
"AreaId": data.areaId,
"pwd": data.pwd,
"isAdd": !this.currentRow.state,
// "isAdd": true,
}
console.log(req, '重置nfc--req')
console.log(666);
// uni.showLoading({ title: '...' })
const res = await ResetNFCApi(req).catch(e => e)
if (!res.succeed) {
uni.showToast({ title: res.error || '绑定失败', icon: 'none' })
}
this.resData = res;
try {
if (isAndroid && AndroidJs) {
console.log("%c%s", "color:red", "安卓--调用方法");
const reqRow = {
name: "resetNFCRes",
data: res,
};
console.log(reqRow, 'reqRow--')
AndroidJs.func(JSON.stringify(reqRow)); //
} else {
console.log("%c%s", "color:red", "苹果--调用方法");
const reqRow = {
name: "back-iphone",
data: "",
};
window.webkit.messageHandlers.func.postMessage(JSON.stringify(reqRow)); // ios
}
} catch (e) {
console.log(e, "e-----判断安卓苹果类型出错");
}
return
// uni.hideLoading()
console.log(res, '重置nfc')
this.resData = res;
if (res.succeed) {
uni.showToast({ title: '绑定成功', icon: 'none' })
} else {
uni.showToast({ title: res.error || '绑定失败', icon: 'none' })
}
return
}
if (data.step === 4) {
this.lookData = data
@ -188,33 +121,6 @@ export default {
nfcChange() {
this.isChange = false
this.step = 1
console.log(this.currentRow, 'this.currentRow--')
//
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
try {
if (isAndroid && AndroidJs) {
console.log("%c%s", "color:red", "安卓--调用方法");
const reqRow = {
name: "area",
data: {
// state: this.currentRow.state,
state: true,
areaId: this.currentRow.id,
},
};
AndroidJs.func(JSON.stringify(reqRow)); //
} else {
console.log("%c%s", "color:red", "苹果--调用方法");
const reqRow = {
name: "back-iphone",
data: "",
};
window.webkit.messageHandlers.func.postMessage(JSON.stringify(reqRow)); // ios
}
} catch (e) {
console.log(e, "e-----判断安卓苹果类型出错");
}
// this.$emit('changeBinding')
// this.closeDialogInternal(); //
},
@ -230,18 +136,6 @@ export default {
this.$emit('close') // 使 :visible @close
}
}
},
watch: {
visible(newVal) {
if (newVal) {
console.log('打开');
window.nfcInitFn = this.nfcInitFn
} else {
console.log('关闭');
// nfcInitFn
window.nfcInitFn = null
}
}
}
}
</script>
@ -254,8 +148,7 @@ export default {
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 999;
/* 确保遮罩在底层 */
z-index: 999; /* 确保遮罩在底层 */
}
.dialog-container {
@ -263,11 +156,9 @@ export default {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 90%;
/* 或者根据需要设置固定宽度 */
width: 90%; /* 或者根据需要设置固定宽度 */
// max-width: 600rpx;
z-index: 1000;
/* 确保弹窗在遮罩上 */
z-index: 1000; /* 确保弹窗在遮罩上 */
}
.dialog-content {
@ -283,8 +174,7 @@ export default {
.dialog-header {
display: flex;
align-items: center;
justify-content: center;
/* 居中显示 */
justify-content: center; /* 居中显示 */
width: 100%;
margin-bottom: 16rpx;
@ -321,23 +211,18 @@ export default {
// border: 1px solid red;
height: auto;
margin-bottom: 30rpx;
.dialog-image {
width: 100%;
width: 200rpx;
/* 根据图片调整 */
height: auto;
/* 让图片自适应高度 */
width: 200rpx; /* 根据图片调整 */
height: auto; /* 让图片自适应高度 */
}
}
.change-binding {
font-size: 28rpx;
color: #4a90e2;
/* 蓝色链接颜色 */
color: #4a90e2; /* 蓝色链接颜色 */
// margin-bottom: 50rpx;
cursor: pointer;
/* 鼠标悬停显示手型 */
cursor: pointer; /* 鼠标悬停显示手型 */
}
.dialog-footer {
@ -348,14 +233,12 @@ export default {
width: 100%;
height: 88rpx;
line-height: 88rpx;
background-color: #4879e6;
/* 蓝色按钮背景 */
background-color: #4879e6; /* 蓝色按钮背景 */
color: #ffffff;
font-size: 32rpx;
border-radius: 0 0 24rpx 24rpx;
border: none;
text-align: center;
// H5
&::after {
border: none;
@ -365,4 +248,5 @@ export default {
/* 可以添加按钮按下的效果 */
// .confirm-button:active {
// background-color: #4879e6;
// }</style>
// }
</style>

View File

@ -12,12 +12,10 @@
</view>
</view>
<!-- tabs -->
<u-tabs class="tabs-box" bg-color="#F6F8FC" :list="tabsList" :is-scroll="true" :current="tabCurrent"
@change="tabChangeFn"></u-tabs>
<u-tabs class="tabs-box" bg-color="#F6F8FC" :list="tabsList" :is-scroll="true" :current="tabCurrent" @change="tabChangeFn"></u-tabs>
<!-- 搜索 -->
<view class="search-box">
<u-input class="search-input" v-model="keyword" :clearable="false" border placeholder="搜索名称"
@keyup.enter="searchFn"></u-input>
<u-input class="search-input" v-model="keyword" :clearable="false" border placeholder="搜索名称" @keyup.enter="searchFn"></u-input>
<u-icon name="search" class="search-icon" size="40" @click="searchFn"></u-icon>
<view class="select-box" @click="selectFn">
<view>
@ -28,8 +26,7 @@
</view>
<!-- tip -->
<view v-if="sonList.length" class="tip-box">{{ sonForm.countData }}个子区域其中{{ sonForm.countData -
sonForm.bindData }}个未绑定</view>
<view v-if="sonList.length" class="tip-box">{{sonForm.countData}}个子区域其中{{sonForm.countData - sonForm.bindData}}个未绑定</view>
<!-- 列表 -->
<view class="list-box">
<scroll-view :scroll-y="true" class="scroll-Y">
@ -45,8 +42,7 @@
<!-- 筛选的下拉 -->
<u-action-sheet :list="options" title="请选择" @click="changeFn" v-model:value="selectShow"></u-action-sheet>
<!-- 弹窗 -->
<bind-dialog ref="dialogRef" :visible="showDialog" @close="showDialog = false" :currentRow="currentRow"
@changeBinding="onChangeBinding" @confirm="onConfirm"></bind-dialog>
<bind-dialog ref="dialogRef" :visible="showDialog" @close="showDialog = false" :currentRow="currentRow" @changeBinding="onChangeBinding" @confirm="onConfirm"></bind-dialog>
<u-tabbar :list="vuex_tabbar"></u-tabbar>
</view>
@ -114,47 +110,10 @@ export default {
},
methods: {
dialogShowFn(row) {
//
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
console.log(row.state, 'row.state--')
//
if (row.state === false) {
try {
if (isAndroid && AndroidJs) {
console.log("%c%s", "color:red", "安卓--调用方法");
const reqRow = {
name: "area",
data: {
// state: row.state,
state: true,
areaId: row.id,
},
};
console.log(reqRow, 'reqRow--')
AndroidJs.func(JSON.stringify(reqRow)); //
} else {
console.log("%c%s", "color:red", "苹果--调用方法");
const reqRow = {
name: "back-iphone",
data: "",
};
window.webkit.messageHandlers.func.postMessage(JSON.stringify(reqRow)); // ios
}
} catch (e) {
console.log(e, "e-----判断安卓苹果类型出错");
}
}
console.log(JSON.parse(JSON.stringify(row)), 'row--')
this.currentRow = row
this.$refs.dialogRef.isChange = row.state //
this.$refs.dialogRef.resData = ''
this.$refs.dialogRef.showMsg = ''
this.$refs.dialogRef.step = 0 //
if (row.state === false) {
this.$refs.dialogRef.step = 1 //
}
this.showDialog = true
},
async getDataFn() {
@ -274,14 +233,12 @@ export default {
// border: 1px solid red;
// margin-top: 20rpx;
padding: 20rpx;
.search-icon {
position: absolute;
right: 210rpx;
top: 50%;
transform: translateY(-50%);
}
.search-input {
background-color: white;
border-radius: 50rpx;

View File

@ -18,7 +18,6 @@
</template>
<script>
import bcrypt from "bcryptjs";
import { jwtDecode } from "jwt-decode";
import { loginApi } from "@/api/apiList";
export default {
data() {
@ -75,8 +74,6 @@ export default {
}
let token = res.data;
uni.setStorageSync("token", "Bearer " + token);
console.log(jwtDecode(token), "解析的token信息");
// return
console.log(type, "type--");
if (type === "user") {
const normalTabBar = [