人脸管理
This commit is contained in:
1 parent
1886bc7cfb
commit
dbaf426930
8 files changed
+637
-391
No files matched your search
@@ -1,7 +1,8 @@
|
||||
# ******************** start 开发环境 start ********************
|
||||
|
||||
VITE_APP_DEV_SERVICE =http://localhost:48080/app-api
|
||||
# VITE_APP_DEV_SERVICE =http://123.156.230.15:8089/app-api
|
||||
# VITE_APP_DEV_SERVICE =http://123.156.228.134:48080/app-api
|
||||
VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/app-api
|
||||
|
||||
# ******************** end 开发环境 end ********************
|
||||
|
||||
|
||||
+267
-248
@@ -1,249 +1,268 @@
|
||||
{
|
||||
"easycom": {
|
||||
"autoscan": true,
|
||||
"custom": {
|
||||
"^base-(.*)": "@/sheep/components/base/base-$1/base-$1.vue",
|
||||
"^crud-(.*)": "@/sheep/components/crud/crud-$1/crud-$1.vue",
|
||||
"^tm-(.*)": "@/uni_modules/tm-ui/components/tm-$1/tm-$1.vue",
|
||||
"^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue"
|
||||
}
|
||||
},
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/tabbar/home",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabbar/order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabbar/my",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "pages/order",
|
||||
"pages": []
|
||||
},
|
||||
{
|
||||
"root": "pages/shop",
|
||||
"pages": []
|
||||
},
|
||||
{
|
||||
"root": "pages/apply",
|
||||
"pages": [
|
||||
{
|
||||
"path": "foreign-apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "foreign-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "foreign-items",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "stride-apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "stride-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "stride-items",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/boxes",
|
||||
"pages": [
|
||||
{
|
||||
"path": "apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "apply-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/merchant",
|
||||
"pages": [
|
||||
{
|
||||
"path": "detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "food",
|
||||
"style": {
|
||||
"navigationBarTitleText": "菜谱",
|
||||
"navigationBarBackgroundColor": "#1777FF",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "product-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/order",
|
||||
"pages": [
|
||||
{
|
||||
"path": "detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/refund",
|
||||
"pages": [
|
||||
{
|
||||
"path": "apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "history",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/test",
|
||||
"pages": [
|
||||
{
|
||||
"path": "login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/wallet",
|
||||
"pages": [
|
||||
{
|
||||
"path": "list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "recharge",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "浦江小程序",
|
||||
"navigationBarBackgroundColor": "#1777FF",
|
||||
"backgroundColor": "#ecf4f9",
|
||||
"navigationStyle": "custom"
|
||||
},
|
||||
"tabBar": {
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/tabbar/home",
|
||||
"text": "首页",
|
||||
"iconPath": "static/tabbar/home.png",
|
||||
"selectedIconPath": "static/tabbar/home-select.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/tabbar/order",
|
||||
"text": "订单",
|
||||
"iconPath": "static/tabbar/order.png",
|
||||
"selectedIconPath": "static/tabbar/order-select.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/tabbar/my",
|
||||
"text": "我的",
|
||||
"iconPath": "static/tabbar/my.png",
|
||||
"selectedIconPath": "static/tabbar/my-select.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
"easycom": {
|
||||
"autoscan": true,
|
||||
"custom": {
|
||||
"^base-(.*)": "@/sheep/components/base/base-$1/base-$1.vue",
|
||||
"^crud-(.*)": "@/sheep/components/crud/crud-$1/crud-$1.vue",
|
||||
"^tm-(.*)": "@/uni_modules/tm-ui/components/tm-$1/tm-$1.vue",
|
||||
"^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue"
|
||||
}
|
||||
},
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/tabbar/home",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabbar/order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabbar/my",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "pages/order",
|
||||
"pages": []
|
||||
},
|
||||
{
|
||||
"root": "pages/shop",
|
||||
"pages": []
|
||||
},
|
||||
{
|
||||
"root": "pages/apply",
|
||||
"pages": [
|
||||
{
|
||||
"path": "foreign-apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "foreign-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "foreign-items",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "stride-apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "stride-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "stride-items",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/boxes",
|
||||
"pages": [
|
||||
{
|
||||
"path": "apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "apply-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/merchant",
|
||||
"pages": [
|
||||
{
|
||||
"path": "detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "food",
|
||||
"style": {
|
||||
"navigationBarTitleText": "菜谱",
|
||||
"navigationBarBackgroundColor": "#1777FF",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "product-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/order",
|
||||
"pages": [
|
||||
{
|
||||
"path": "detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/refund",
|
||||
"pages": [
|
||||
{
|
||||
"path": "apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "history",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/test",
|
||||
"pages": [
|
||||
{
|
||||
"path": "login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/wallet",
|
||||
"pages": [
|
||||
{
|
||||
"path": "list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "recharge",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/humanFace",
|
||||
"pages": [
|
||||
{
|
||||
"path": "list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "浦江小程序",
|
||||
"navigationBarBackgroundColor": "#1777FF",
|
||||
"backgroundColor": "#ecf4f9",
|
||||
"navigationStyle": "custom"
|
||||
},
|
||||
"tabBar": {
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/tabbar/home",
|
||||
"text": "首页",
|
||||
"iconPath": "static/tabbar/home.png",
|
||||
"selectedIconPath": "static/tabbar/home-select.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/tabbar/order",
|
||||
"text": "订单",
|
||||
"iconPath": "static/tabbar/order.png",
|
||||
"selectedIconPath": "static/tabbar/order-select.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/tabbar/my",
|
||||
"text": "我的",
|
||||
"iconPath": "static/tabbar/my.png",
|
||||
"selectedIconPath": "static/tabbar/my-select.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { isEmpty } from "radash";
|
||||
|
||||
import { hooks, router } from "@@/index";
|
||||
import { applyApi } from "@@/api";
|
||||
|
||||
const state = reactive<any>({
|
||||
detailType: "add",
|
||||
detailId: null,
|
||||
detail: null,
|
||||
});
|
||||
const applyForm = reactive<any>({
|
||||
faceImg: "",
|
||||
});
|
||||
const applyFormRules = reactive<any>({
|
||||
count: [
|
||||
{ required: true, message: "请输入申请数量" },
|
||||
{ required: true, min: 1, message: "最少申请1张" },
|
||||
{ required: true, max: 20, message: "最多申请20张" },
|
||||
],
|
||||
});
|
||||
onLoad((options: any) => {
|
||||
const { type, id } = options;
|
||||
if (!isEmpty(type)) state.detailType = type;
|
||||
if (!isEmpty(id)) state.detailId = id;
|
||||
if (type === "view") {
|
||||
getDetail();
|
||||
}
|
||||
});
|
||||
onShow(() => {});
|
||||
|
||||
const getDetail = async () => {
|
||||
if (isEmpty(state.detailId)) return;
|
||||
const _pa = { id: state.detailId };
|
||||
const { data } = await applyApi.strideDetail(_pa);
|
||||
if (!isEmpty(data)) {
|
||||
state.detail = data;
|
||||
|
||||
applyForm.count = data.count;
|
||||
if (isEmpty(data.remark)) {
|
||||
applyForm.remark = "无";
|
||||
} else {
|
||||
applyForm.remark = data.remark;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const applyFormRef = ref<any>(null);
|
||||
const doSubmit = async () => {
|
||||
applyFormRef.value.submit();
|
||||
const { isPass } = applyFormRef.value.validate();
|
||||
if (!isPass) return;
|
||||
const range = applyForm.displayTimeRange;
|
||||
try {
|
||||
uni.showLoading({ title: "申请中...", mask: false });
|
||||
const _pa = {
|
||||
count: applyForm.count,
|
||||
remark: applyForm.remark,
|
||||
};
|
||||
const { data, code }: any = await applyApi.strideApply(_pa);
|
||||
if (code != 0) throw new Error();
|
||||
uni.hideLoading();
|
||||
uni.showToast({ title: "申请成功", icon: "none" });
|
||||
router.back();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
uni.hideLoading();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<crud-layout title="人脸上传" bg="/static/page/blue-bg.png">
|
||||
<view class="h-30rpx" />
|
||||
<view class="card p-x-30rpx p-y-40rpx">
|
||||
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
|
||||
<!-- <tm-form-item name="count" label="申请数量" :showBottom="false">
|
||||
<tm-input
|
||||
v-model="applyForm.count"
|
||||
type="number"
|
||||
:disabled="state.detailType == 'view'"
|
||||
:showClear="state.detailType != 'view'"
|
||||
placeholder="请输入申请数量.."
|
||||
/>
|
||||
</tm-form-item> -->
|
||||
<tm-form-item name="faceImg" label="人脸图片" :required="false" :showBottom="false">
|
||||
<tm-upload-photo v-model="applyForm.faceImg" />
|
||||
</tm-form-item>
|
||||
</tm-form>
|
||||
</view>
|
||||
<view
|
||||
v-if="state.detailType != 'view'"
|
||||
class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
|
||||
@tap="doSubmit"
|
||||
>
|
||||
提交
|
||||
</view>
|
||||
</crud-layout>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep() {
|
||||
.tmFormItemLabel {
|
||||
padding-bottom: 10rpx !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<crud-layout title="人脸管理" bg="/static/page/blue-bg.png">
|
||||
<z-paging
|
||||
ref="pageRef"
|
||||
height="100%"
|
||||
:fixed="false"
|
||||
v-model="pageHook.list"
|
||||
:default-page-size="10"
|
||||
safe-area-inset-bottom
|
||||
:loading-more-enabled="true"
|
||||
:show-scrollbar="false"
|
||||
@query="query"
|
||||
:auto-clean-list-when-reload="false"
|
||||
:auto-scroll-to-top-when-reload="false"
|
||||
@scroll="pageHook.scroll"
|
||||
>
|
||||
<view class="h-20rpx" />
|
||||
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="v.id" @tap="doCard(v)">
|
||||
<view class="flex items-center justify-between second-text-26">
|
||||
<img class="w-100rpx h-100rpx rounded-50rpx" :src="v.faceImg" />
|
||||
<text class="font-600">{{ v.username }}</text>
|
||||
<text class="botder_btn float-right">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<template #bottom>
|
||||
<view class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!" @tap="doAdd">添加</view>
|
||||
<view class="h-30rpx" />
|
||||
</template>
|
||||
</z-paging>
|
||||
</crud-layout>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
|
||||
import { hooks, router } from "@@/index";
|
||||
import { faceApi } from "@@/api";
|
||||
|
||||
const state = reactive<any>({
|
||||
// pa: {
|
||||
// status: data.tabs[0].id,
|
||||
// },
|
||||
});
|
||||
|
||||
const pageRef = ref<any>(null);
|
||||
const pageHook = hooks.usePage(pageRef, faceApi.page, null, "data.list");
|
||||
const query = (page: number, pagesize: number) => {
|
||||
pageHook.startPage(page, pagesize, false, state.pa);
|
||||
};
|
||||
|
||||
onLoad(() => {});
|
||||
onShow(() => {
|
||||
if (pageRef.value) {
|
||||
pageRef.value.reload(false);
|
||||
}
|
||||
});
|
||||
|
||||
const doTab = (e: any) => {
|
||||
// const target = data.tabs[e];
|
||||
// state.pa.status = target.id;
|
||||
// pageRef.value.reload(true);
|
||||
};
|
||||
|
||||
const doAdd = () => {
|
||||
router.jump("/pages/humanFace/apply");
|
||||
};
|
||||
|
||||
const doCard = (v: any) => {
|
||||
// if (v.status == 2) {
|
||||
// router.jump("/pages/apply/stride-items", { id: v.id });
|
||||
// } else {
|
||||
// router.jump("/pages/apply/stride-apply", { type: "view", id: v.id });
|
||||
// }
|
||||
};
|
||||
</script>
|
||||
+128
-129
@@ -3,162 +3,161 @@ import { ref, reactive } from "vue";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { isEmpty } from "radash";
|
||||
|
||||
import { hooks, router, constant } from "@@/index"
|
||||
import { merchantApi, userApi, walletApi } from "@@/api"
|
||||
import { hooks, router, constant } from "@@/index";
|
||||
import { merchantApi, userApi, walletApi } from "@@/api";
|
||||
|
||||
const data = {
|
||||
serviceList: [
|
||||
{ text: '钱包管理', icon: '/static/icon/service_3.png', router: '/pages/wallet/list' },
|
||||
{ text: '包厢预定', icon: '/static/icon/service_4.png', router: '/pages/boxes/apply-list' },
|
||||
// { text: '车牌管理', icon: '/static/icon/service_2.png', router: '/pages/user/diff-price' },
|
||||
{ text: '外来人员就餐', icon: '/static/icon/service_1.png', router: '/pages/apply/foreign-list' },
|
||||
{ text: '跨单位就餐', icon: '/static/icon/service_1.png', router: '/pages/apply/stride-list' },
|
||||
{ text: '测试登陆', icon: '/static/icon/login.png', router: '/pages/test/login' },
|
||||
]
|
||||
serviceList: [
|
||||
{ text: "钱包管理", icon: "/static/icon/service_3.png", router: "/pages/wallet/list" },
|
||||
{ text: "包厢预定", icon: "/static/icon/service_4.png", router: "/pages/boxes/apply-list" },
|
||||
// { text: '车牌管理', icon: '/static/icon/service_2.png', router: '/pages/user/diff-price' },
|
||||
{ text: "外来人员就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/foreign-list" },
|
||||
{ text: "跨单位就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/stride-list" },
|
||||
{ text: "人脸管理", icon: "/static/icon/login.png", router: "/pages/humanFace/list" },
|
||||
{ text: "测试登陆", icon: "/static/icon/login.png", router: "/pages/test/login" },
|
||||
],
|
||||
};
|
||||
|
||||
const state = reactive<any>({
|
||||
wallet: [],
|
||||
userInfo: {},
|
||||
})
|
||||
|
||||
wallet: [],
|
||||
userInfo: {},
|
||||
});
|
||||
|
||||
onLoad((options) => {
|
||||
(window as any).CP2.getAppInfo().then((res) => {
|
||||
console.log(res);
|
||||
if (res.code == 1) {
|
||||
//诗画
|
||||
console.log("诗画环境");
|
||||
(window as any).CP2.getUserInfo().then((res) => {
|
||||
let accountId = res.data.accountId;
|
||||
let sessionId = res.sessionId;
|
||||
doLogin(1, null, accountId, sessionId)
|
||||
});
|
||||
} else {
|
||||
//浙政钉或者h5
|
||||
const url = window.location.href;
|
||||
const params = new URL(url).searchParams;
|
||||
const token = params.get('uabaseToken'); // 获取 uabaseToken 参数值
|
||||
console.log('Token:', token);
|
||||
if (null != token) {
|
||||
//浙政钉
|
||||
doLogin(2, token, null, null)
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
(window as any).CP2.getAppInfo().then((res) => {
|
||||
console.log(res);
|
||||
if (res.code == 1) {
|
||||
//诗画
|
||||
console.log("诗画环境");
|
||||
(window as any).CP2.getUserInfo().then((res) => {
|
||||
let accountId = res.data.accountId;
|
||||
let sessionId = res.sessionId;
|
||||
doLogin(1, null, accountId, sessionId);
|
||||
});
|
||||
} else {
|
||||
//浙政钉或者h5
|
||||
const url = window.location.href;
|
||||
const params = new URL(url).searchParams;
|
||||
const token = params.get("uabaseToken"); // 获取 uabaseToken 参数值
|
||||
console.log("Token:", token);
|
||||
if (null != token) {
|
||||
//浙政钉
|
||||
doLogin(2, token, null, null);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
onShow(() => {
|
||||
getUserInfo()
|
||||
})
|
||||
getUserInfo();
|
||||
});
|
||||
|
||||
const getUserInfo = () => {
|
||||
const userInfoKey = constant.storageConstant.USERINFO
|
||||
const userStorage = uni.getStorageSync(userInfoKey)
|
||||
if (!isEmpty(userStorage)) {
|
||||
state.userInfo = userStorage
|
||||
}
|
||||
}
|
||||
const userInfoKey = constant.storageConstant.USERINFO;
|
||||
const userStorage = uni.getStorageSync(userInfoKey);
|
||||
if (!isEmpty(userStorage)) {
|
||||
state.userInfo = userStorage;
|
||||
}
|
||||
};
|
||||
|
||||
const doLogin = async (loginType, token, accountId, sessionId) => {
|
||||
const tokenKey = constant.storageConstant.TOKEN
|
||||
const userInfoKey = constant.storageConstant.USERINFO
|
||||
const tokenStorage = uni.getStorageSync(tokenKey)
|
||||
const userStorage = uni.getStorageSync(userInfoKey)
|
||||
if (isEmpty(tokenStorage) || isEmpty(userStorage)) {
|
||||
uni.showLoading({
|
||||
title: '登录中...',
|
||||
mask: true
|
||||
});
|
||||
let authData;
|
||||
if (loginType == 1) {
|
||||
// 诗画
|
||||
const params = {
|
||||
accountId: accountId,
|
||||
sessionId: sessionId
|
||||
}
|
||||
const response = await userApi.authsh(params);
|
||||
authData = response.data;
|
||||
} else if (loginType == 2) {
|
||||
//浙政钉
|
||||
const response = await userApi.auth(token);
|
||||
authData = response.data;
|
||||
} else {
|
||||
//后期手机号+验证码登录
|
||||
router.jump('/pages/test/login')
|
||||
uni.hideLoading()
|
||||
return
|
||||
}
|
||||
// const {data: authData} = await userApi.auth(token);
|
||||
uni.setStorageSync(tokenKey, authData)
|
||||
const { data: userData } = await userApi.userInfo();
|
||||
uni.setStorageSync(userInfoKey, userData)
|
||||
getUserInfo()
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '登录成功', icon: "none" });
|
||||
const tokenKey = constant.storageConstant.TOKEN;
|
||||
const userInfoKey = constant.storageConstant.USERINFO;
|
||||
const tokenStorage = uni.getStorageSync(tokenKey);
|
||||
const userStorage = uni.getStorageSync(userInfoKey);
|
||||
if (isEmpty(tokenStorage) || isEmpty(userStorage)) {
|
||||
uni.showLoading({
|
||||
title: "登录中...",
|
||||
mask: true,
|
||||
});
|
||||
let authData;
|
||||
if (loginType == 1) {
|
||||
// 诗画
|
||||
const params = {
|
||||
accountId: accountId,
|
||||
sessionId: sessionId,
|
||||
};
|
||||
const response = await userApi.authsh(params);
|
||||
authData = response.data;
|
||||
} else if (loginType == 2) {
|
||||
//浙政钉
|
||||
const response = await userApi.auth(token);
|
||||
authData = response.data;
|
||||
} else {
|
||||
//后期手机号+验证码登录
|
||||
router.jump("/pages/test/login");
|
||||
uni.hideLoading();
|
||||
return;
|
||||
}
|
||||
}
|
||||
// const {data: authData} = await userApi.auth(token);
|
||||
uni.setStorageSync(tokenKey, authData);
|
||||
const { data: userData } = await userApi.userInfo();
|
||||
uni.setStorageSync(userInfoKey, userData);
|
||||
getUserInfo();
|
||||
uni.hideLoading();
|
||||
uni.showToast({ title: "登录成功", icon: "none" });
|
||||
}
|
||||
};
|
||||
|
||||
const doLogout = async () => {
|
||||
uni.showLoading({
|
||||
title: '退出登录中...',
|
||||
mask: true
|
||||
});
|
||||
const tokenKey = constant.storageConstant.TOKEN
|
||||
const userInfoKey = constant.storageConstant.USERINFO
|
||||
uni.removeStorageSync(tokenKey)
|
||||
uni.removeStorageSync(userInfoKey)
|
||||
state.userInfo = {}
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '退出登录成功', icon: "none" });
|
||||
}
|
||||
uni.showLoading({
|
||||
title: "退出登录中...",
|
||||
mask: true,
|
||||
});
|
||||
const tokenKey = constant.storageConstant.TOKEN;
|
||||
const userInfoKey = constant.storageConstant.USERINFO;
|
||||
uni.removeStorageSync(tokenKey);
|
||||
uni.removeStorageSync(userInfoKey);
|
||||
state.userInfo = {};
|
||||
uni.hideLoading();
|
||||
uni.showToast({ title: "退出登录成功", icon: "none" });
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<crud-layout title="我的" bg="/static/page/blue-bg.png">
|
||||
<crud-layout title="我的" bg="/static/page/blue-bg.png">
|
||||
<view class="flex-row items-center">
|
||||
<image class="w-100rpx h-100rpx rounded-full" v-if="state.userInfo.avatar" :src="state.userInfo.avatar" mode="aspectFill" />
|
||||
<image class="w-100rpx h-100rpx rounded-full" v-else src="/static/icon/default-avatar.png" mode="aspectFill" />
|
||||
<view class="m-l-30rpx" v-if="state.userInfo.id">
|
||||
<view class="flex-row items-center">
|
||||
<image class="w-100rpx h-100rpx rounded-full" v-if="state.userInfo.avatar" :src="state.userInfo.avatar"
|
||||
mode="aspectFill" />
|
||||
<image class="w-100rpx h-100rpx rounded-full" v-else src="/static/icon/default-avatar.png"
|
||||
mode="aspectFill" />
|
||||
<view class="m-l-30rpx" v-if="state.userInfo.id">
|
||||
<view class="flex-row items-center">
|
||||
<text class="sub-text-30">{{ state.userInfo.nickname }}</text>
|
||||
<text class="iconfont icon-youjiantou color-#666666 m-l-20rpx"></text>
|
||||
</view>
|
||||
<text class="sub-text-26">ID {{ state.userInfo.id }}</text>
|
||||
</view>
|
||||
<view v-else class="flex-row items-center m-l-30rpx" @tap="doLogin">
|
||||
<text class="sub-text-32">请先登录</text>
|
||||
<text class="iconfont icon-youjiantou"></text>
|
||||
</view>
|
||||
<text class="sub-text-30">{{ state.userInfo.nickname }}</text>
|
||||
<text class="iconfont icon-youjiantou color-#666666 m-l-20rpx"></text>
|
||||
</view>
|
||||
<text class="sub-text-26">ID {{ state.userInfo.id }}</text>
|
||||
</view>
|
||||
<view v-else class="flex-row items-center m-l-30rpx" @tap="doLogin">
|
||||
<text class="sub-text-32">请先登录</text>
|
||||
<text class="iconfont icon-youjiantou"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="m-t-40rpx rounded-20rpx shadow-main p-30rpx p-b-40rpx bg-white!">
|
||||
<view class="service_item flex-row items-center justify-between" v-for="(v, i) in data.serviceList" :key="i"
|
||||
@tap="router.jump(v.router)">
|
||||
<view class="flex-row-center">
|
||||
<image class="w-40rpx h-40rpx" :src="v.icon" mode="aspectFill" />
|
||||
<text class="sub-text-28 m-l-20rpx">{{ v.text }}</text>
|
||||
</view>
|
||||
<view class="iconfont icon-youjiantou"></view>
|
||||
</view>
|
||||
<view class="m-t-40rpx rounded-20rpx shadow-main p-30rpx p-b-40rpx bg-white!">
|
||||
<view
|
||||
class="service_item flex-row items-center justify-between"
|
||||
v-for="(v, i) in data.serviceList"
|
||||
:key="i"
|
||||
@tap="router.jump(v.router)"
|
||||
>
|
||||
<view class="flex-row-center">
|
||||
<image class="w-40rpx h-40rpx" :src="v.icon" mode="aspectFill" />
|
||||
<text class="sub-text-28 m-l-20rpx">{{ v.text }}</text>
|
||||
</view>
|
||||
<view class="iconfont icon-youjiantou"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="flex-col-center m-t-40rpx m-x-30rpx">
|
||||
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff"
|
||||
@tap="doLogout">
|
||||
退出登录
|
||||
</view>
|
||||
</view>
|
||||
</crud-layout>
|
||||
<view class="flex-col-center m-t-40rpx m-x-30rpx">
|
||||
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff" @tap="doLogout">
|
||||
退出登录
|
||||
</view>
|
||||
</view>
|
||||
</crud-layout>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.service_item:not(:last-child) {
|
||||
padding-bottom: 40rpx;
|
||||
border-bottom: 1px solid #fafafa;
|
||||
margin-bottom: 40rpx;
|
||||
padding-bottom: 40rpx;
|
||||
border-bottom: 1px solid #fafafa;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,49 @@
|
||||
import request from "@/sheep/utils/request";
|
||||
|
||||
export default {
|
||||
page: (params: any) =>
|
||||
request({
|
||||
url: `/sys/user/face-page-join`,
|
||||
method: "GET",
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
// classify: (params: any) =>
|
||||
// request({
|
||||
// url: `/onlinefood/category/listFood`,
|
||||
// method: "GET",
|
||||
// params,
|
||||
// custom: {
|
||||
// showLoading: false,
|
||||
// },
|
||||
// }),
|
||||
// product: (params: any) =>
|
||||
// request({
|
||||
// url: `/onlinefood/category/list`,
|
||||
// method: "GET",
|
||||
// params,
|
||||
// custom: {
|
||||
// showLoading: false,
|
||||
// },
|
||||
// }),
|
||||
// getShopCar: (params: any) =>
|
||||
// request({
|
||||
// url: `/hardware/car/get`,
|
||||
// method: "GET",
|
||||
// params,
|
||||
// custom: {
|
||||
// showLoading: false,
|
||||
// },
|
||||
// }),
|
||||
// updateShopCar: (data: any) =>
|
||||
// request({
|
||||
// url: `/hardware/car/save-or-upload`,
|
||||
// method: "POST",
|
||||
// data,
|
||||
// custom: {
|
||||
// showLoading: false,
|
||||
// },
|
||||
// }),
|
||||
};
|
||||
@@ -19,3 +19,5 @@ export { default as refundApi } from "./refund";
|
||||
export { default as userApi } from "./user";
|
||||
|
||||
export { default as walletApi } from "./wallet";
|
||||
|
||||
export { default as faceApi } from "./face";
|
||||
@@ -73,16 +73,9 @@ http.interceptors.request.use(
|
||||
|
||||
http.interceptors.response.use(
|
||||
async (response) => {
|
||||
response.config &&
|
||||
response.config.custom &&
|
||||
response.config.custom.showLoading &&
|
||||
closeLoading();
|
||||
response.config && response.config.custom && response.config.custom.showLoading && closeLoading();
|
||||
if (response.data.code !== 0) {
|
||||
if (
|
||||
response.config &&
|
||||
response.config.custom &&
|
||||
response.config.custom.showError
|
||||
) {
|
||||
if (response.config && response.config.custom && response.config.custom.showError) {
|
||||
switch (response.data.code) {
|
||||
case 401:
|
||||
setTimeout(() => {
|
||||
@@ -118,10 +111,7 @@ http.interceptors.response.use(
|
||||
}
|
||||
const tokenKey = constant.storageConstant.TOKEN;
|
||||
const tokenStorage = uni.getStorageSync(tokenKey);
|
||||
if (
|
||||
!isEmpty(tokenStorage) &&
|
||||
response.config.url != "/sys/auth/refresh-token"
|
||||
) {
|
||||
if (!isEmpty(tokenStorage) && response.config.url != "/sys/auth/refresh-token") {
|
||||
const { refreshToken, expiresTime } = tokenStorage;
|
||||
const now = new Date().getTime();
|
||||
const remain = expiresTime - now;
|
||||
|
||||
Reference in new issue
Block a user