This commit is contained in:
Teng 2025-04-01 17:27:15 +08:00
parent ebd68ea309
commit 3a74d3e405
50 changed files with 6129 additions and 5791 deletions

View File

@ -96,7 +96,8 @@
.drawer-img {
width: 25rpx;
height: 25rpx;
margin-left: 15rpx;
margin-left: 10rpx;
transform: rotate(180deg);
}
}
}

View File

@ -407,6 +407,7 @@
</view>
</view>
<Drawer ref="drawer">
<!-- 转单执行 -->
<transferExecution />
</Drawer>
</view>

View File

@ -1,30 +1,10 @@
<template>
<view class="draw-all">
<!-- <video v-if="showVideo" :src="videoSrc" controls class="video-popup"></video> -->
<view class="draw-title">
<view class="draw-title-gun"></view>
<view class="draw-title-font">转单执行</view>
</view>
<view class="draw-contain">
<view class="container-father">
<view class="draw-contain-white-sha"></view>
<view class="container">
<div class="line" :style="{width: lineWidth}"></div>
<div class="line-gray"></div>
<template v-for="(item, index) in circles" :key="index">
<div :class="circlesNumber>=index? `outer-circle-target`:`outer-circle`"
@click="circlesNumber=index">
<div :class="circlesNumber>=index? `inner-circle-target`:`inner-circle`">
<span>{{ item.label }}</span>
</div>
</div>
</template>
</view>
<view class="draw-contain-gray"></view>
<view class="draw-contain-white"></view>
</view>
<view class="downitems-father">
<view class="downitems-left">
<view class="downitems-left-mar">
@ -46,7 +26,7 @@
<image class="downitems-father-img" src="/static/index/helpdo/three.png" />
<view class="downitems-father-font-small">准备清水一次性面巾香皂清洁后涂身体保湿乳</view>
</view>
<view class="downitems-kuai">
<view class="downitems-kuai" @click="showVideo=true">
<image class="downitems-kuai-img" src="/static/index/helpdo/video.png" />
</view>
<view class="downitems-says">
@ -127,11 +107,18 @@
</view>
</view>
</view>
<!-- 弹窗遮罩层点击背景可关闭弹窗 -->
<view v-show="showVideo" class="modal" @click="closeVideo">
<view class="modal-content" @click.stop>
<!-- 视频组件可替换 src 地址 -->
<video id="myVideo" src="@/static/index/ceshi.mp4" controls style="width:100%;height:100%;"></video>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, computed, nextTick, defineProps, defineEmits } from 'vue';
import { ref, onMounted, onBeforeUnmount, computed, nextTick, defineProps, defineEmits, watch } from 'vue';
const circles = [
{ label: '指令' },
{ label: '转单' },
@ -140,11 +127,18 @@
const handleBlur = (event : any) => {
// console.log('', event.detail.value);
}
const showVideo = ref(false);
const videoRef = ref(null)
const clickitemNumber = ref(-1);
const postItems = ref(0);
const videoContext = uni.createVideoContext('myVideo');
const clickitem = (index : number) => {
clickitemNumber.value = index
}
const closeVideo = () => {
videoContext.pause();
showVideo.value = false;
}
//
const lineWidth = computed(() => {
switch (circlesNumber.value) {
@ -206,150 +200,11 @@
.draw-contain-jindu {
width: 100%;
height: 250rpx;
// background-color: red;
display: flex;
justify-content: center;
align-items: center;
}
}
.container {
display: flex;
align-items: center;
justify-content: space-between;
width: 1000rpx;
height: 200rpx;
margin: 0 auto;
position: relative;
}
.outer-circle-target {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
background: rgba(2, 136, 217, 0.2);
display: flex;
align-items: center;
justify-content: center;
position: relative;
z-index: 2;
}
.outer-circle {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
// background: rgba(2, 136, 217, 0.2);
display: flex;
align-items: center;
justify-content: center;
position: relative;
z-index: 2;
}
.inner-circle-target {
width: 95rpx;
height: 95rpx;
border-radius: 50%;
background: #0288D9;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 4rpx rgba(0, 0, 0, 0.2);
position: absolute;
z-index: 3;
}
.inner-circle {
width: 95rpx;
height: 95rpx;
border-radius: 50%;
background: #dfecfa;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 4rpx rgba(0, 0, 0, 0.2);
position: absolute;
z-index: 3;
}
.inner-circle-target span {
color: #fff;
font-size: 30rpx;
font-family: Arial, sans-serif;
z-index: 4;
}
.inner-circle span {
// color: #fff;
font-size: 30rpx;
font-family: Arial, sans-serif;
z-index: 4;
}
.line {
width: calc(100% - 120rpx);
height: 15rpx;
background: linear-gradient(to right, #0288D1, #0288D1);
position: absolute;
top: 50%;
left: 60rpx;
z-index: 1;
border-radius: 5rpx;
box-shadow:
inset 0 2rpx 4rpx rgba(255, 255, 255, 0.8),
/* 内部高光 */
inset 0 -2rpx 4rpx rgba(0, 0, 0, 0.4),
/* 内部阴影 */
0 0 8rpx rgba(2, 136, 209, 0.8);
/* 外部发光 */
filter: brightness(1.2);
z-index: 1;
transition: width 0.5s ease;
/* 设置宽度变化的过渡效果 */
}
.line-gray {
width: calc(100% - 120rpx);
height: 15rpx;
background: #c9dbee;
position: absolute;
top: 50%;
left: 60rpx;
z-index: 0;
border-radius: 5rpx;
/* 外部发光 */
filter: brightness(1.2);
}
.container-father {
width: 100%;
height: 200rpx;
// background-color: rgba(187, 203, 236, 0.6);
.draw-contain-white-sha {
width: 100%;
height: 1rpx;
background-color: #fff;
box-shadow: 0 4rpx 4rpx rgba(0, 0, 0, 0.2);
}
}
.draw-contain-gray {
width: 100%;
height: 3rpx;
background-color: #d0e0ef;
}
.draw-contain-white {
width: 100%;
height: 1rpx;
background-color: #fff;
}
}
.downitems-father {
@ -668,4 +523,37 @@
}
}
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
/* 弹窗遮罩层 */
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
/* 半透明背景 */
display: flex;
align-items: center;
/* 垂直居中 */
justify-content: center;
/* 水平居中 */
}
/* 弹窗内容宽高占屏幕70% */
.modal-content {
width: 80vw;
height: 80vh;
background: #fff;
border-radius: 8px;
overflow: hidden;
}
</style>

View File

@ -1,13 +1,43 @@
// 引入 request 文件
import request from '@/utils/request.js'
import request from '@/request/index.js'
// 以下 api 为博主项目示例,实际与项目相匹配
// 分页查询学习列表
export const pageStudyInfo = (params) => {
return request({
url: '/study/studyInfo/page',
method: 'get',
data: params
})
// 查询服务类型
export const getServiceTree = () => {
return request({
url: '/nuIpadApi/nuConfigServiceCategory/getServiceTree',
method: 'get',
})
}
// 查询表格
export const getNclist = () => {
return request({
url: '/nuIpadApi/nuBizNuCustomerServer/getNclist?nuId=1&customerId=1',
method: 'get',
})
}
// 新增表格
export const addNuCustomerServer = (params) => {
return request({
url: '/nuIpadApi/nuBizNuCustomerServer/addNuCustomerServer',
method: 'post',
data: params,
})
}
// 移动表格
export const editNuCustomerServer = (params) => {
return request({
url: '/nuIpadApi/nuBizNuCustomerServer/editNuCustomerServer',
method: 'post',
data: params,
})
}
export const deleteNuCustomerServer = (params) => {
return request({
url: `/nuIpadApi/nuBizNuCustomerServer/deleteNuCustomerServer?id=${params.id}`,
method: 'delete',
// data: params, // 如果后端需要从请求体中接收参数
// 如果后端需要通过 query 参数传递数据,可以使用 params: params
})
}

File diff suppressed because it is too large Load Diff

View File

@ -56,7 +56,7 @@
"sdkConfigs" : {
"share" : {
"weixin" : {
"appid" : "",
"appid" : "wxda748470da82886e",
"UniversalLinks" : ""
}
}

View File

@ -1,6 +1,7 @@
{
"pages": [
//pageshttps://uniapp.dcloud.io/collocation/pages
//
{
"path": "pages/index/index",
"style": {
@ -8,6 +9,23 @@
}
},
//
{
"path": "pages/Nursing/index",
"style": {
"navigationStyle": "custom"
}
},
//
{
"path": "pages/Warehousing/index",
"style": {
"navigationStyle": "custom"
}
},
//
{
"path": "pages/login/login",
"style": {
@ -15,6 +33,7 @@
}
},
//
{
"path": "pages/timeMatrix/index",
"style": {

464
pages/Nursing/index.vue Normal file
View File

@ -0,0 +1,464 @@
<template>
<view :class="darkFans?`darkbackgroundContainer`:`backgroundContainer`" @touchmove="getxy" @touchend="cleanall">
<view class="move-font" v-show="savename && clientX" :style="{ top: `${clientY}rpx`, left: `${clientX}rpx` }">
{{savename}}
</view>
<view v-if="saveruler.cycleType"
:class="saveruler.cycleType=='日常' ? `title-time-border-yellow`:`title-time-border-pouple`"
:style="{ top: `${clientY}rpx`, left: `${clientX}rpx` }" style="font-size: 30rpx;overflow: hidden;">
<view class="title-time" v-show="saveruler.startTime" style="margin-top: 5rpx;">
<view class="title-time-time" style="font-size: 30rpx;">
{{saveruler.startTime + `-` + saveruler.endTime}}
</view>
<image class="title-time-button"
:src="saveruler.cycleType=='日常'?`/static/index/yellowbian.png`:`/static/index/puoplebian.png`" />
<view class="title-time-font">
{{saveruler.cycleType}}
</view>
</view>
<view style="margin-top: 20rpx;font-weight: 700;">
{{splitString(saveruler.directiveName)[0]}}
</view>
<view class="down-icons" :style="saveruler.cycleType!='日常'?{backgroundColor:`rgb(212,203,255)`}:{}"
v-show="splitString(saveruler.directiveName)[1]">
<view class="" v-for="(item,index) in splitString(saveruler.directiveName).slice(1)" :key="index">
<view class="icon" :style="saveruler.cycleType!='日常'?{backgroundColor:`rgb(123,97,255)`}:{}">
{{splitString(saveruler.directiveName)[1]}}
</view>
</view>
</view>
</view>
<view class="left-container">
<view class="left-head">
<image class="left-head-img" src="/static/index/oldman.png" />
<text :class="darkFans?`left-head-font-dark`:`left-head-font`">
王金凤
</text>
</view>
<view class="left-img-container">
<view v-for="(item,index) in iconList" :key="index" class="blue-circle-pos">
<view class="blue-circle" v-show="index === menuIndex">
<image class="blue-circle-size" :src="`/static/index/ray.png`" />
</view>
<image class="left-img" :src="index === menuIndex ? item.targetUrl : item.url"
@click="changeMenu(index)" />
</view>
</view>
</view>
<!-- 主页 -->
<rightItemsfirst :isshow="menuIndexshow" :darkFans="darkFans" v-show="!menuIndex" @darkchange="darkchange" />
<!-- 超凶表格 -->
<rightItemssecond ref="ruler" :liang="indexNumber" :isshow="menuIndexshowsecond" :canmove="canmove"
:darkFans="darkFans" v-show="menuIndex==1" @darkchange="darkchange" @savename="openname"
@saveruler="openruler" @changefangkuang="changefangkuang" @cleanname="closename" />
</view>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import type { Link } from "./index";
import rightItemsfirst from "../../component/rightItemsindex/index.vue"
import rightItemssecond from "../../component/rightItemssecond/index.vue"
import { onShow } from '@dcloudio/uni-app';
//
const iconList = ref<Link[]>([
{ url: '/static/index/lefticon/index.png', targetUrl: '/static/index/lefticontarget/blueindex.png' },
{ url: '/static/index/lefticon/nurse.png', targetUrl: '/static/index/lefticontarget/bluenurse.png' },
{ url: '/static/index/lefticon/doctor.png', targetUrl: '/static/index/lefticontarget/bluedoctor.png' },
{ url: '/static/index/lefticon/give.png', targetUrl: '/static/index/lefticontarget/givedark.png' },
{ url: '/static/index/lefticon/wifi.png', targetUrl: '/static/index/lefticontarget/bluewifi.png' },
{ url: '/static/index/lefticon/back.png', targetUrl: '/static/index/lefticontarget/blueback.png' }
]);
//
const menuIndex = ref<number>(0);
const menuIndexshow = ref<boolean>(false);
const menuIndexshowsecond = ref<boolean>(false);
//
const darkFans = ref<boolean>(false);
//
const roomTar = ref<number[]>([]);
//
const firstcurrentIndex = ref<number>(0);
const firstcurrentIndexup = ref<number>(0);
const secondcurrentIndexup = ref<number>(0);
const secondcurrentIndex = ref<number>(0);
const thirdcurrentIndex = ref<number>(0);
//
const darkchange = (res : boolean) => {
darkFans.value = res
}
//
const changeMenu = (index : number) => {
if (index === 3) {
menuIndexshow.value = false;
menuIndexshowsecond.value = false;
uni.navigateTo({
url: `/pages/somethingmove/index?darkFans=${darkFans.value}`,
animationType: 'slide-in-right',
animationDuration: 400// 设置动画时长为300毫秒, // 动画持续时间单位为毫秒
});
return
}
else if (index === 5) {
uni.navigateBack()
return
}
menuIndex.value = index;
menuIndexshow.value = false
menuIndexshowsecond.value = false
setTimeout(() => {
switch (index) {
case 0:
menuIndexshow.value = true
break;
case 1:
menuIndexshowsecond.value = true
break;
default:
}
}, 50)
};
const clientX = ref(0);
const clientY = ref(0);
const savename = ref("")
const canmove = ref(true)
const indexNumber = ref({
index0: 999,
index1: 999,
})
//
const canTrigger = ref(true);
//xy
const getxyrel = (event) => {
const touch = event.touches[0];
clientX.value = 2 * (Math.floor(touch.clientX) - 100);
clientY.value = 2 * (Math.floor(touch.clientY) - 55);
//
const translateX = Math.floor(touch.clientX) - 50;
const translateY = Math.floor(touch.clientY) - 25;
const clickedItem = fangkuaiValue.value.find(item => {
return translateX >= Math.floor(item.left) && translateX <= Math.floor(item.right) &&
translateY >= Math.floor(item.top) && translateY <= Math.floor(item.bottom);
});
if (clickedItem) {
const { index0, index1 } = clickedItem.dataset;
indexNumber.value.index0 = index0
indexNumber.value.index1 = index1
if (clientX.value > 2050 && canTrigger.value) {
ruler.value?.nextItems();
canTrigger.value = false;
setTimeout(() => {
canTrigger.value = true;
}, 1000);
}
} else {
indexNumber.value.index0 = 999
indexNumber.value.index1 = 999
}
}
//
const getxy = throttle(getxyrel, 10);
const fangkuaiValue = ref([])
//
const openname = (res : string, fangkuai : any) => {
savename.value = res;
canmove.value = false;
fangkuaiValue.value = fangkuai
}
const changefangkuang = (fangkuang : any) => {
fangkuaiValue.value = fangkuang
console.log("!!!!", fangkuaiValue.value)
}
//
const saveruler = ref({
directiveName: "",
cycleType: "",
positioningLong: "0",
typeName: "",
startTime: "",
id: "",
endTime: "",
tagName: null
})
const openruler = (res : any, fangkuai : any) => {
saveruler.value = res
canmove.value = false;
fangkuaiValue.value = fangkuai
}
//bug
const closename = () => {
savename.value = "";
canmove.value = true;
// fangkuaiValue.value = []
}
const ruler = ref(null)
//
const cleanall = () => {
clientX.value = 9999;
clientY.value = 9999;
canmove.value = true;
indexNumber.value = {
index0: 999,
index1: 999,
};
if (savename.value) {
ruler.value?.rulerEnd(savename.value);
} else if (saveruler.value.typeName) {
ruler.value?.rulerMoveEnd(saveruler.value);
}
savename.value = "";
saveruler.value = {
directiveName: "",
cycleType: "",
positioningLong: "0",
typeName: "",
startTime: "",
id: "",
endTime: "",
tagName: null
};
}
//
function throttle(fn, delay) {
let lastExecutionTime = 0;
return function (...args) {
const now = Date.now();
if (now - lastExecutionTime >= delay) {
lastExecutionTime = now;
fn.apply(this, args);
}
};
}
function splitString(str) {
// 使
let result = [];
let remainingStr = str;
//
let regex = /([^(]*)[(]([^)]+)[)]/;
while (regex.test(remainingStr)) {
let match = remainingStr.match(regex);
if (match) {
//
if (match[1].trim()) {
result.push(match[1].trim());
}
//
if (match[2].trim()) {
result.push(match[2].trim());
}
//
remainingStr = remainingStr.replace(match[0], '').trim();
}
}
//
if (remainingStr.trim()) {
result.push(remainingStr.trim());
}
return result;
}
//
onShow(() => {
//
setTimeout(() => {
changeMenu(menuIndex.value)
}, 50)
});
</script>
<style lang="less" scoped>
.backgroundContainer {
display: flex;
position: relative;
width: 100%;
height: 100vh;
background-image: url('/static/index/lightbgcnew.png');
background-size: cover;
background-position: center center;
overflow: hidden;
z-index: 12;
}
//
.darkbackgroundContainer {
display: flex;
position: relative;
width: 100%;
height: 100vh;
background-image: url('/static/index/background.png');
background-size: cover;
background-position: center center;
overflow: hidden;
z-index: 11;
}
.move-font {
position: absolute;
// font-size: 45rpx;
// font-weight: 700;
z-index: 10;
pointer-events: none;
// color: #016AD1;
background-color: rgb(201, 232, 255);
border-radius: 20rpx;
border: 2rpx solid #fff;
width: 220rpx;
height: 100rpx;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
font-size: 40rpx;
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.1);
}
.left-container {
width: 235rpx;
height: 100%;
.blue-circle-pos {
position: relative;
.blue-circle {
position: absolute;
top: -50rpx;
left: -68rpx;
.blue-circle-size {
width: 170rpx;
height: 250rpx;
}
}
}
.left-head {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.left-head-img {
width: 150rpx;
height: 150rpx;
margin-top: 60rpx;
}
.left-head-font {
font-weight: 700;
font-size: 40rpx;
}
.left-head-font-dark {
font-weight: 700;
font-size: 40rpx;
background: linear-gradient(to right, #EBF4FF, #ADC4E0);
-webkit-background-clip: text;
color: transparent;
}
}
.left-img-container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
// margin-top: 30rpx;
.left-img {
width: 93rpx;
height: 93rpx;
margin: 50rpx 0;
z-index: 100;
}
}
}
.title-time-border-yellow {
width: 255rpx;
height: 189rpx;
margin: 10rpx;
border: 1rpx solid #dae8fa;
background: linear-gradient(to bottom, #fff1db, #ffe2b2);
// width: calc(100% - 20rpx);
// height: calc(100% - 20rpx);
border-radius: 20rpx;
display: flex;
align-items: center;
flex-direction: column;
position: absolute;
z-index: 10;
}
.title-time-border-pouple {
width: 255rpx;
height: 189rpx;
margin: 10rpx;
border: 1rpx solid #dae8fa;
background: linear-gradient(to bottom, #f1eeff, #e3deff);
// width: calc(100% - 20rpx);
// height: calc(100% - 20rpx);
border-radius: 20rpx;
display: flex;
align-items: center;
flex-direction: column;
position: absolute;
z-index: 10;
}
.title-time {
display: flex;
width: 100%;
position: relative;
.title-time-time {
font-size: 32rpx;
margin-left: 27rpx;
margin-top: 12rpx;
}
.title-time-button {
position: absolute;
top: -5rpx;
right: 0rpx;
width: 70rpx;
height: 70rpx;
}
.title-time-font {
position: absolute;
top: 7rpx;
right: 5rpx;
font-size: 23rpx;
color: #fff;
}
}
.down-icons {
margin-top: 20rpx;
width: 100%;
height: 50rpx;
background-color: rgb(255, 216, 126);
display: flex;
justify-content: center;
align-items: center;
.icon {
margin: 0 5rpx;
font-size: 20rpx;
padding: 5rpx 10rpx;
background-color: rgb(255, 138, 0);
color: #fff;
border-radius: 5rpx;
}
}
</style>

View File

View File

@ -0,0 +1,6 @@
export type Link = {
url : string;
targetUrl : string;
name:string;
pao:number;
};

247
pages/Warehousing/index.vue Normal file
View File

@ -0,0 +1,247 @@
<template>
<view :class="darkFans?`darkbackgroundContainer`:`backgroundContainer`">
<view class="index-title">
<view class="index-title-left">
<image class="index-title-left-img" src="/static/index/customer.png" />
<view class="index-title-left-font">
王金福
</view>
<view class="index-title-left-wel">
欢迎
</view>
<view class="index-title-left-weight">
张春凤
</view>
<view class="">
登录护理单元操作台
</view>
</view>
<view class="index-title-right">
<view class="index-title-right-circle">
<image class="index-title-right-circle-img" src="/static/index/Warehousing/house.png" />
</view>
<view class="index-title-right-font">
生活用品库
</view>
</view>
</view>
<view class="index-content">
<view class="index-content-leftMenus">
<view v-for="(item,index) in iconList" :key="index" class="blue-circle-pos">
<view class="blue-circle" v-show="index === menuIndex">
<image class="blue-circle-size" :src="`/static/index/ray.png`" />
</view>
<view class="red-pao" v-if="item.pao" @click="changeMenu(index)">
{{ item.pao > 99 ? `99+` : item.pao}}
</view>
<image class="left-img" :src="index === menuIndex ? item.targetUrl : item.url"
@click="changeMenu(index)" />
<view :class="index === menuIndex ? `left-img-font-target` :`left-img-font`" @click="changeMenu(index)">
{{item.name}}
</view>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, computed, nextTick } from 'vue';
import type { Link } from "./index";
import { onLoad } from '@dcloudio/uni-app';
//
const darkFans = ref(false);
const menuIndex = ref(0);
//
const iconList = ref<Link[]>([
{ url: '/static/index/lefticon/index.png', targetUrl: '/static/index/lefticontarget/blueindex.png', name: '首页',pao:0 },
{ url: '/static/index/Warehousing/dingdan.png', targetUrl: '/static/index/Warehousing/dingdanblue.png', name: '订单',pao:0 },
{ url: '/static/index/Warehousing/yujing.png', targetUrl: '/static/index/Warehousing/yujingblue.png', name: '预警',pao:200 },
{ url: '/static/index/Warehousing/chuku.png', targetUrl: '/static/index/Warehousing/chukublue.png', name: '出库',pao:5 },
{ url: '/static/index/Warehousing/pandian.png', targetUrl: '/static/index/Warehousing/pandianblue.png', name: '盘点',pao:0 },
{ url: '/static/index/Warehousing/jiankong.png', targetUrl: '/static/index/Warehousing/jiankongblue.png', name: '监控',pao:0 },
{ url: '/static/index/lefticon/back.png', targetUrl: '/static/index/lefticontarget/blueback.png', name: '返回',pao:0 }
]);
//
const changeMenu = (index : number) => {
// if (index === 3) {
// uni.navigateTo({
// url: `/pages/somethingmove/index?darkFans=${darkFans.value}`,
// animationType: 'slide-in-right',
// animationDuration: 400// 300, //
// });
// return
// }
if (index === 6) {
uni.navigateBack()
return
}
menuIndex.value = index;
setTimeout(() => {
switch (index) {
case 0:
break;
case 1:
break;
default:
}
}, 50)
};
//
onLoad(() => {
});
</script>
<style scoped lang="less">
.backgroundContainer {
display: flex;
flex-direction: column;
position: relative;
width: 100%;
height: 100vh;
background-image: url('/static/index/lightbgcnew.png');
background-size: cover;
background-position: center center;
overflow: hidden;
}
//
.darkbackgroundContainer {
display: flex;
flex-direction: column;
position: relative;
width: 100%;
height: 100vh;
background-image: url('/static/index/background.png');
background-size: cover;
background-position: center center;
overflow: hidden;
}
.index-title {
display: flex;
width: calc(100% - 110rpx);
height: 130rpx;
justify-content: space-between;
// background-color: #fff;
margin: 20rpx 50rpx 0 60rpx;
.index-title-left {
display: flex;
height: 100%;
align-items: center;
margin-top: 20rpx;
.index-title-left-img {
width: 75rpx;
height: 75rpx;
}
.index-title-left-font {
margin-left: 20rpx;
}
.index-title-left-wel {
margin-left: 40rpx;
}
.index-title-left-weight {
font-weight: 700;
margin: 0 10rpx;
}
}
.index-title-right {
display: flex;
height: 100%;
align-items: center;
margin-top: 20rpx;
.index-title-right-circle {
// margin-top: 20rpx;
width: 60rpx;
height: 60rpx;
border-radius: 50%;
background-color: rgb(205, 224, 248);
display: flex;
justify-content: center;
align-items: center;
.index-title-right-circle-img {
width: 35rpx;
height: 35rpx;
}
}
.index-title-right-font {
// margin-top: 20rpx;
margin-left: 20rpx;
font-weight: 700;
}
}
}
.index-content {
width: 100%;
height: calc(100vh - 150rpx);
.index-content-leftMenus {
height: 100%;
width: 180rpx;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.left-img {
width: 93rpx;
height: 93rpx;
// margin: 50rpx 0;
z-index: 100;
}
.left-img-font {
margin-top: 10rpx;
color: #fff;
}
.left-img-font-target {
margin-top: 10rpx;
color: #0174D3;
}
.blue-circle-pos {
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 200rpx;
.blue-circle {
position: absolute;
top: -50rpx;
left: -68rpx;
.blue-circle-size {
width: 170rpx;
height: 250rpx;
}
}
}
}
}
.red-pao{
position: absolute;
top: 30rpx;
// right: 0;
left: 60rpx;
padding: 3rpx 10rpx;
background-color: #FF4C4E;
color: #fff;
font-size: 20rpx;
border-radius: 20rpx;
z-index: 101;
}
</style>

View File

@ -1,259 +1,49 @@
<template>
<view :class="darkFans?`darkbackgroundContainer`:`backgroundContainer`" @touchmove="getxy" @touchend="cleanall">
<view class="move-font" v-show="savename && clientX" :style="{ top: `${clientY}rpx`, left: `${clientX}rpx` }">
{{savename}}
</view>
<view v-if="saveruler.type"
:class="saveruler.type=='日常' ? `title-time-border-yellow`:`title-time-border-pouple`"
:style="{ top: `${clientY}rpx`, left: `${clientX}rpx` }" style="font-size: 30rpx;overflow: hidden;">
<view class="title-time" v-show="saveruler.time" style="margin-top: 5rpx;">
<view class="title-time-time" style="font-size: 30rpx;">
{{saveruler.time}}
</view>
<image class="title-time-button"
:src="saveruler.type=='日常'?`/static/index/yellowbian.png`:`/static/index/puoplebian.png`" />
<view class="title-time-font">
{{saveruler.type}}
</view>
</view>
<view style="margin-top: 20rpx;font-weight: 700;">
{{splitString(saveruler.value)[0]}}
</view>
<view class="down-icons" :style="saveruler.type!='日常'?{backgroundColor:`rgb(212,203,255)`}:{}"
v-show="splitString(saveruler.value)[1]">
<view class="" v-for="(item,index) in splitString(saveruler.value).slice(1)" :key="index">
<view class="icon" :style="saveruler.type!='日常'?{backgroundColor:`rgb(123,97,255)`}:{}">
{{splitString(saveruler.value)[1]}}
</view>
</view>
<view class="backgroundContainer">
<view v-for="(item,index) in menuArray" :key="index">
<view class="menuCard" @click="jumpTo(item.url)">
{{item.name}}
</view>
</view>
<view class="left-container">
<view class="left-head">
<image class="left-head-img" src="/static/index/oldman.png" />
<text :class="darkFans?`left-head-font-dark`:`left-head-font`">
王金凤
</text>
</view>
<view class="left-img-container">
<view v-for="(item,index) in iconList" :key="index" class="blue-circle-pos">
<view class="blue-circle" v-show="index === menuIndex">
<image class="blue-circle-size" :src="`/static/index/ray.png`" />
</view>
<image class="left-img" :src="index === menuIndex ? item.targetUrl : item.url"
@click="changeMenu(index)" />
</view>
</view>
</view>
<!-- 主页 -->
<rightItemsfirst :isshow="menuIndexshow" :darkFans="darkFans" v-show="!menuIndex" @darkchange="darkchange" />
<!-- 超凶表格 -->
<rightItemssecond ref="ruler" :liang="indexNumber" :isshow="menuIndexshowsecond" :canmove="canmove"
:darkFans="darkFans" v-show="menuIndex==1" @darkchange="darkchange" @savename="openname"
@saveruler="openruler" @changefangkuang="changefangkuang" @cleanname="closename" />
</view>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import type { Link } from "./index";
import rightItemsfirst from "../../component/rightItemsindex/index.vue"
import rightItemssecond from "../../component/rightItemssecond/index.vue"
import { onShow } from '@dcloudio/uni-app';
//
const iconList = ref<Link[]>([
{ url: '/static/index/lefticon/index.png', targetUrl: '/static/index/lefticontarget/blueindex.png' },
{ url: '/static/index/lefticon/nurse.png', targetUrl: '/static/index/lefticontarget/bluenurse.png' },
{ url: '/static/index/lefticon/doctor.png', targetUrl: '/static/index/lefticontarget/bluedoctor.png' },
{ url: '/static/index/lefticon/give.png', targetUrl: '/static/index/lefticontarget/givedark.png' },
{ url: '/static/index/lefticon/wifi.png', targetUrl: '/static/index/lefticontarget/bluewifi.png' },
{ url: '/static/index/lefticon/back.png', targetUrl: '/static/index/lefticontarget/blueback.png' }
]);
//
const menuIndex = ref<number>(0);
const menuIndexshow = ref<boolean>(false);
const menuIndexshowsecond = ref<boolean>(false);
import { ref, onMounted, onBeforeUnmount, computed, nextTick } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
//
const darkFans = ref<boolean>(false);
//
const roomTar = ref<number[]>([]);
//
const firstcurrentIndex = ref<number>(0);
const firstcurrentIndexup = ref<number>(0);
const secondcurrentIndexup = ref<number>(0);
const secondcurrentIndex = ref<number>(0);
const thirdcurrentIndex = ref<number>(0);
//
const darkchange = (res : boolean) => {
darkFans.value = res
}
//
const changeMenu = (index : number) => {
if (index === 3) {
menuIndexshow.value = false;
menuIndexshowsecond.value = false;
uni.navigateTo({
url: `/pages/somethingmove/index?darkFans=${darkFans.value}`,
animationType: 'slide-in-right',
animationDuration: 400// 设置动画时长为300毫秒, // 动画持续时间单位为毫秒
});
return
}
menuIndex.value = index;
menuIndexshow.value = false
menuIndexshowsecond.value = false
setTimeout(() => {
switch (index) {
case 0:
menuIndexshow.value = true
break;
case 1:
menuIndexshowsecond.value = true
break;
default:
}
}, 50)
};
const clientX = ref(0);
const clientY = ref(0);
const savename = ref("")
const canmove = ref(true)
const indexNumber = ref({
index0: 999,
index1: 999,
})
//
const canTrigger = ref(true);
//xy
const getxyrel = (event) => {
const touch = event.touches[0];
clientX.value = 2 * (Math.floor(touch.clientX) - 100);
clientY.value = 2 * (Math.floor(touch.clientY) - 55);
//
const translateX = Math.floor(touch.clientX) - 50;
const translateY = Math.floor(touch.clientY) - 25;
const darkFans = ref(false);
const clickedItem = fangkuaiValue.value.find(item => {
return translateX >= Math.floor(item.left) && translateX <= Math.floor(item.right) &&
translateY >= Math.floor(item.top) && translateY <= Math.floor(item.bottom);
type darkFanstype = {
darkFans : boolean
}
const menuArray = [
{
name: "养护中心",
url: "/pages/Nursing/index"
},
{
name: "仓储中心",
url: "/pages/Warehousing/index"
},
]
const jumpTo = (url:string) =>{
uni.navigateTo({
url: url
});
if (clickedItem) {
const { index0, index1 } = clickedItem.dataset;
indexNumber.value.index0 = index0
indexNumber.value.index1 = index1
if (clientX.value > 2050 && canTrigger.value) {
ruler.value?.nextItems();
canTrigger.value = false;
setTimeout(() => {
canTrigger.value = true;
}, 1000);
}
} else {
indexNumber.value.index0 = 999
indexNumber.value.index1 = 999
}
}
//
const getxy = throttle(getxyrel, 10);
const fangkuaiValue = ref([])
//
const openname = (res : string, fangkuai : any) => {
savename.value = res;
canmove.value = false;
fangkuaiValue.value = fangkuai
}
const changefangkuang = (fangkuang : any) => {
fangkuaiValue.value = fangkuang
console.log("!!!!", fangkuaiValue.value)
}
//
const saveruler = ref({})
const openruler = (res : string, fangkuai : any) => {
saveruler.value = res
canmove.value = false;
fangkuaiValue.value = fangkuai
}
//bug
const closename = () => {
savename.value = "";
canmove.value = true;
// fangkuaiValue.value = []
}
const ruler = ref(null)
//
const cleanall = () => {
clientX.value = 9999;
clientY.value = 9999;
canmove.value = true;
indexNumber.value = {
index0: 999,
index1: 999,
};
if (savename.value) {
ruler.value?.rulerEnd(savename.value);
} else if (saveruler.value.type) {
ruler.value?.rulerMoveEnd(saveruler.value);
}
savename.value = "";
saveruler.value = {};
}
//
function throttle(fn, delay) {
let lastExecutionTime = 0;
return function (...args) {
const now = Date.now();
if (now - lastExecutionTime >= delay) {
lastExecutionTime = now;
fn.apply(this, args);
}
};
}
function splitString(str) {
// 使
let result = [];
let remainingStr = str;
//
let regex = /([^(]*)[(]([^)]+)[)]/;
while (regex.test(remainingStr)) {
let match = remainingStr.match(regex);
if (match) {
//
if (match[1].trim()) {
result.push(match[1].trim());
}
//
if (match[2].trim()) {
result.push(match[2].trim());
}
//
remainingStr = remainingStr.replace(match[0], '').trim();
}
}
//
if (remainingStr.trim()) {
result.push(remainingStr.trim());
}
return result;
}
//
onShow(() => {
//
setTimeout(() => {
changeMenu(menuIndex.value)
}, 50)
onLoad((options : darkFanstype) => {
// uni.navigateBack()options`false`,`false`true
// uni.navigateBack()
});
// const goback = () =>{
// uni.navigateBack()
// }
</script>
<style lang="less" scoped>
<style scoped lang="less">
.backgroundContainer {
display: flex;
position: relative;
@ -263,179 +53,30 @@
background-size: cover;
background-position: center center;
overflow: hidden;
z-index: 12;
justify-content: center;
align-items: center;
}
//
.darkbackgroundContainer {
display: flex;
position: relative;
width: 100%;
height: 100vh;
background-image: url('/static/index/background.png');
background-size: cover;
background-position: center center;
overflow: hidden;
z-index: 11;
}
.move-font {
position: absolute;
// font-size: 45rpx;
// font-weight: 700;
z-index: 10;
pointer-events: none;
// color: #016AD1;
background-color: rgb(201, 232, 255);
border-radius: 20rpx;
border: 2rpx solid #fff;
width: 220rpx;
height: 100rpx;
.menuCard{
width: 600rpx;
margin: 0 100rpx;
height: 400rpx;
background: linear-gradient(to bottom, #04BCED, #0160CE);
color: #fff;
font-size: 50rpx;
border-radius: 10%;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
font-size: 40rpx;
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.1);
}
.left-container {
width: 235rpx;
height: 100%;
.blue-circle-pos {
position: relative;
.blue-circle {
position: absolute;
top: -50rpx;
left: -68rpx;
.blue-circle-size {
width: 170rpx;
height: 250rpx;
}
}
}
.left-head {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.left-head-img {
width: 150rpx;
height: 150rpx;
margin-top: 60rpx;
}
.left-head-font {
font-weight: 700;
font-size: 40rpx;
}
.left-head-font-dark {
font-weight: 700;
font-size: 40rpx;
background: linear-gradient(to right, #EBF4FF, #ADC4E0);
-webkit-background-clip: text;
color: transparent;
}
}
.left-img-container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
// margin-top: 30rpx;
.left-img {
width: 93rpx;
height: 93rpx;
margin: 50rpx 0;
z-index: 100;
}
}
}
.title-time-border-yellow {
width: 255rpx;
height: 189rpx;
margin: 10rpx;
border: 1rpx solid #dae8fa;
background: linear-gradient(to bottom, #fff1db, #ffe2b2);
// width: calc(100% - 20rpx);
// height: calc(100% - 20rpx);
border-radius: 20rpx;
display: flex;
align-items: center;
flex-direction: column;
position: absolute;
z-index: 10;
}
.title-time-border-pouple {
width: 255rpx;
height: 189rpx;
margin: 10rpx;
border: 1rpx solid #dae8fa;
background: linear-gradient(to bottom, #f1eeff, #e3deff);
// width: calc(100% - 20rpx);
// height: calc(100% - 20rpx);
border-radius: 20rpx;
display: flex;
align-items: center;
flex-direction: column;
position: absolute;
z-index: 10;
}
.title-time {
display: flex;
width: 100%;
position: relative;
.title-time-time {
font-size: 32rpx;
margin-left: 27rpx;
margin-top: 12rpx;
}
.title-time-button {
position: absolute;
top: -5rpx;
right: 0rpx;
width: 70rpx;
height: 70rpx;
}
.title-time-font {
position: absolute;
top: 7rpx;
right: 5rpx;
font-size: 23rpx;
color: #fff;
}
}
.down-icons {
margin-top: 20rpx;
width: 100%;
height: 50rpx;
background-color: rgb(255, 216, 126);
display: flex;
justify-content: center;
align-items: center;
.icon {
margin: 0 5rpx;
font-size: 20rpx;
padding: 5rpx 10rpx;
background-color: rgb(255, 138, 0);
color: #fff;
border-radius: 5rpx;
}
}
// //
// .darkbackgroundContainer {
// display: flex;
// position: relative;
// width: 100%;
// height: 100vh;
// background-image: url('/static/index/background.png');
// background-size: cover;
// background-position: center center;
// overflow: hidden;
// }
</style>

View File

@ -1,4 +1,3 @@
<template>
<view :class="darkFans?`darkbackgroundContainer`:`backgroundContainer`" @click="goback">
1111111

View File

@ -1,5 +1,5 @@
// 全局请求封装
const base_url = 'http://localhost:996'
const base_url = 'http://192.168.2.199:8081/nursing-unit_001'
// 请求超出时间
const timeout = 5000
@ -15,11 +15,12 @@ export default (params) => {
'Tenant-Id': uni.getStorageSync('tenantId') || 'xxx', // avue配置相关
...params.header
}
if (method == "post") {
header = {
'Content-Type': 'multipart/form-data' // 自定义,跟后台约定好传什么格式的
};
}
// console.log("???",base_url + url)
// if (method == "delete") {
// header = {
// 'Content-Type': 'multipart/form-data' // 自定义,跟后台约定好传什么格式的
// };
// }
return new Promise((resolve, reject) => {
uni.request({
url: base_url + url,

BIN
static/index/NU.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
static/index/ceshi.mp4 Normal file

Binary file not shown.

View File

@ -2,7 +2,7 @@
;(function(){
let u=void 0,isReady=false,onReadyCallbacks=[],isServiceReady=false,onServiceReadyCallbacks=[];
const __uniConfig = {"pages":[],"globalStyle":{"backgroundColor":"#F8F8F8","bounce":"none","navigationBar":{"backgroundColor":"#F8F8F8","titleText":"uni-app x","type":"default","titleColor":"#000000"},"isNVue":false},"nvue":{"compiler":"uni-app","styleCompiler":"uni-app","flex-direction":"column"},"renderer":"auto","appname":"养老App","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":true},"compilerVersion":"4.57","entryPagePath":"pages/index/index","entryPageQuery":"","realEntryPagePath":"","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"locales":{},"darkmode":false,"themeConfig":{}};
const __uniRoutes = [{"path":"pages/index/index","meta":{"isQuit":true,"isEntry":true,"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/login/login","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/timeMatrix/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute));
const __uniRoutes = [{"path":"pages/index/index","meta":{"isQuit":true,"isEntry":true,"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/Nursing/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/Warehousing/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/login/login","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/timeMatrix/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute));
__uniConfig.styles=[];//styles
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});

File diff suppressed because it is too large Load Diff

View File

@ -73,7 +73,7 @@
"plugins": {
"share": {
"weixin": {
"appid": "",
"appid": "wxda748470da82886e",
"UniversalLinks": ""
}
},

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,125 @@
.backgroundContainer[data-v-82a72f7e] {
display: flex;
flex-direction: column;
position: relative;
width: 100%;
height: 100vh;
background-image: url('../../static/index/lightbgcnew.png');
background-size: cover;
background-position: center center;
overflow: hidden;
}
.darkbackgroundContainer[data-v-82a72f7e] {
display: flex;
flex-direction: column;
position: relative;
width: 100%;
height: 100vh;
background-image: url('../../static/index/background.png');
background-size: cover;
background-position: center center;
overflow: hidden;
}
.index-title[data-v-82a72f7e] {
display: flex;
width: calc(100% - 3.4375rem);
height: 4.0625rem;
justify-content: space-between;
margin: 0.625rem 1.5625rem 0 1.875rem;
}
.index-title .index-title-left[data-v-82a72f7e] {
display: flex;
height: 100%;
align-items: center;
margin-top: 0.625rem;
}
.index-title .index-title-left .index-title-left-img[data-v-82a72f7e] {
width: 2.34375rem;
height: 2.34375rem;
}
.index-title .index-title-left .index-title-left-font[data-v-82a72f7e] {
margin-left: 0.625rem;
}
.index-title .index-title-left .index-title-left-wel[data-v-82a72f7e] {
margin-left: 1.25rem;
}
.index-title .index-title-left .index-title-left-weight[data-v-82a72f7e] {
font-weight: 700;
margin: 0 0.3125rem;
}
.index-title .index-title-right[data-v-82a72f7e] {
display: flex;
height: 100%;
align-items: center;
margin-top: 0.625rem;
}
.index-title .index-title-right .index-title-right-circle[data-v-82a72f7e] {
width: 1.875rem;
height: 1.875rem;
border-radius: 50%;
background-color: #cde0f8;
display: flex;
justify-content: center;
align-items: center;
}
.index-title .index-title-right .index-title-right-circle .index-title-right-circle-img[data-v-82a72f7e] {
width: 1.09375rem;
height: 1.09375rem;
}
.index-title .index-title-right .index-title-right-font[data-v-82a72f7e] {
margin-left: 0.625rem;
font-weight: 700;
}
.index-content[data-v-82a72f7e] {
width: 100%;
height: calc(100vh - 4.6875rem);
}
.index-content .index-content-leftMenus[data-v-82a72f7e] {
height: 100%;
width: 5.625rem;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.index-content .index-content-leftMenus .left-img[data-v-82a72f7e] {
width: 2.90625rem;
height: 2.90625rem;
z-index: 100;
}
.index-content .index-content-leftMenus .left-img-font[data-v-82a72f7e] {
margin-top: 0.3125rem;
color: #fff;
}
.index-content .index-content-leftMenus .left-img-font-target[data-v-82a72f7e] {
margin-top: 0.3125rem;
color: #0174D3;
}
.index-content .index-content-leftMenus .blue-circle-pos[data-v-82a72f7e] {
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 6.25rem;
}
.index-content .index-content-leftMenus .blue-circle-pos .blue-circle[data-v-82a72f7e] {
position: absolute;
top: -1.5625rem;
left: -2.125rem;
}
.index-content .index-content-leftMenus .blue-circle-pos .blue-circle .blue-circle-size[data-v-82a72f7e] {
width: 5.3125rem;
height: 7.8125rem;
}
.red-pao[data-v-82a72f7e] {
position: absolute;
top: 0.9375rem;
left: 1.875rem;
padding: 0.09375rem 0.3125rem;
background-color: #FF4C4E;
color: #fff;
font-size: 0.625rem;
border-radius: 0.625rem;
z-index: 101;
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

View File

@ -1,88 +0,0 @@
// 全局请求封装
const base_url = 'http://localhost:996'
// 需要修改token和根据实际修改请求头
export default (params) => {
let url = params.url;
let method = params.method || "get";
let data = params.data || {};
let header = {}
if (method == "post") {
header = {
'Content-Type': 'application/json'
};
}
// 获取本地token
if (uni.getStorageSync("token")) {
header['Authorization'] = 'Bearer ' + uni.getStorageSync("token");
}
return new Promise((resolve, reject) => {
uni.request({
url: base_url + url,
method: method,
header: header,
data: data,
success(response) {
const res = response
// 根据返回的状态码做出对应的操作
//获取成功
// console.log(res.statusCode);
if (res.statusCode == 200) {
resolve(res.data);
} else {
uni.clearStorageSync()
switch (res.statusCode) {
case 401:
uni.showModal({
title: "提示",
content: "请登录",
showCancel: false,
success(res) {
setTimeout(() => {
uni.navigateTo({
url: "/pages/login/index",
})
}, 1000);
},
});
break;
case 404:
uni.showToast({
title: '请求地址不存在...',
duration: 2000,
})
break;
default:
uni.showToast({
title: '请重试...',
duration: 2000,
})
break;
}
}
},
fail(err) {
console.log(err)
if (err.errMsg.indexOf('request:fail') !== -1) {
wx.showToast({
title: '网络异常',
icon: "error",
duration: 2000
})
} else {
wx.showToast({
title: '未知异常',
duration: 2000
})
}
reject(err);
},
complete() {
// 不管成功还是失败都会执行
uni.hideLoading();
uni.hideToast();
}
});
}).catch((e) => {});
};

View File

@ -1,11 +0,0 @@
export function getToken() {
return uni.getStorageSync('token') || null;
}
export function setToken(token) {
uni.setStorageSync('token', token);
}
export function removeToken() {
uni.removeStorageSync('token');
}