提交 739cc8c3 authored 作者: 刘旭's avatar 刘旭

更新代码

上级 cbdb5c70
......@@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" href="" type="png/x-icon" />
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<link rel="stylesheet" href="./src/static/iconfont/iconfont.css" />
<script>
var coverSupport =
......
......@@ -6,9 +6,9 @@ import request from "@/utils/request"
* @param type //0:上课中,1:已结束,2:未开始
* @return
*/
export const getCourse = (data?: any) =>
export const getTeachCourse = (data?: any) =>
request(
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.CourseDetail,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.TeachCoursDetail,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST",
data
)
......@@ -56,9 +56,20 @@ export const signInAndOut = (data?: any) =>
* @param data
* @return
*/
export const geFileList = (data?: any) =>
export const getFileList = (data?: any) =>
request(
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.FilePDF,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST",
data
)
/**
* @brief 查看附件
* @param data
* @return
*/
export const getStateList = (data?: any) =>
request(
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.StateList,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST",
data
)
......@@ -27,3 +27,15 @@ export const uploadImage = (data: any) => {
data
)
}
/**
* @brief 手机密码登录
* @param data
* @return
*/
export const teachLogin = (data: any) =>
request(
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.TeachLogin,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST",
data
)
import request from "@/utils/request"
/**
* @brief 查询教学地点
* @param data
* @return
*/
export const getTeachPointsList = (data: any) =>
request(
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.StudentArea,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST",
data
)
......@@ -10,22 +10,19 @@
{
"path": "pages/login/index",
"style": {
"navigationBarTitleText": "登录",
"navigationStyle": "custom"
"navigationBarTitleText": "西部人力培训中心"
}
},
{
"path": "pages/home/index",
"style": {
"navigationBarTitleText": "主页",
"navigationStyle": "custom"
"navigationBarTitleText": "西部人力培训中心"
}
},
{
"path": "pages/class/index",
"style": {
"navigationBarTitleText": "我的班级",
"navigationStyle": "custom",
"onReachBottomDistance": 50
}
},
......@@ -33,7 +30,6 @@
"path": "pages/class/addressBook",
"style": {
"navigationBarTitleText": "班级通讯录",
"navigationStyle": "custom",
"onReachBottomDistance": 50
}
},
......@@ -41,7 +37,6 @@
"path": "pages/class/classEvaluate",
"style": {
"navigationBarTitleText": "我的班级",
"navigationStyle": "custom",
"onReachBottomDistance": 50
}
},
......@@ -49,7 +44,6 @@
"path": "pages/class/evaluate",
"style": {
"navigationBarTitleText": "培训评价",
"navigationStyle": "custom",
"onReachBottomDistance": 50
}
},
......@@ -57,57 +51,57 @@
"path": "pages/course/index",
"style": {
"navigationBarTitleText": "我的课程",
"navigationStyle": "custom",
"onReachBottomDistance": 50
}
},
{
"path": "pages/course/seeMore",
"style": {
"navigationBarTitleText": "查看更多",
"navigationStyle": "custom"
"navigationBarTitleText": "查看更多"
}
},
{
"path": "pages/course/attendanceDetails",
"style": {
"navigationBarTitleText": "考勤详情",
"navigationStyle": "custom"
"onReachBottomDistance": 50
}
},
{
"path": "pages/setPositioning/index",
"style": {
"navigationBarTitleText": "设置考勤定位",
"navigationStyle": "custom"
"navigationBarTitleText": "设置考勤定位"
}
},
{
"path": "pages/setPositioning/map",
"style": {
"navigationBarTitleText": "考勤地点设置",
"navigationStyle": "custom"
"navigationBarTitleText": "考勤地点设置"
}
},
{
"path": "pages/setPositioning/setAttendance",
"style": {
"navigationBarTitleText": "考勤地点设置",
"navigationStyle": "custom"
"navigationBarTitleText": "考勤地点设置"
}
},
{
"path": "pages/class/courseArrange",
"style": {
"navigationBarTitleText": "课程安排",
"navigationStyle": "custom"
"navigationBarTitleText": "课程安排"
}
},
{
"path": "pages/course/pdfView",
"style": {
"navigationBarTitleText": "预览pdf",
"navigationStyle": "custom"
"navigationBarTitleText": "预览pdf"
}
},
{
"path": "pages/teachPoints/index",
"style": {
"navigationBarTitleText": "现场教学点",
"onReachBottomDistance": 50
}
}
],
......
<template>
<headers title="班级通讯录" />
<view v-if="addressBookList.length" class="address-book-item-container">
<!-- <headers title="班级通讯录" /> -->
<view class="address-book-item-container">
<uni-search-bar
placeholder="姓名/单位/电话"
bgColor="#ffffff"
clearButton="auto"
cancelButton="none"
@confirm="search"
@clear="clear"
/>
<text style="margin-bottom: 20rpx; display: block">为你找到10个的同学</text>
<view v-if="addressBookList.length">
<text style="margin-bottom: 20rpx; display: block"
>为你找到{{ listQuery.total }}个的同学</text
>
<block v-for="(item, i) in addressBookList" :key="i">
<addressBookItem
......@@ -24,10 +28,11 @@
<view v-else class="empty">
<u-empty text="暂无数据" mode="list"></u-empty>
</view>
</view>
</template>
<script setup lang="ts">
import headers from "@/components/header/index.vue"
// import headers from "@/components/header/index.vue"
import addressBookItem from "./components/addressBookItem.vue"
import { getClassBook } from "@/api/class"
import { useGlobalStore } from "@/store/useStore"
......@@ -39,6 +44,8 @@ const listQuery = reactive({
pageIndex: 1,
pageSize: 10,
total: 0,
type: 2,
Name: "",
})
const status = ref("loadmore")
const addressBookList = ref([] as any)
......@@ -48,8 +55,16 @@ onLoad((options: any) => {
init()
})
const search = (val: string) => {
console.log("我的同学" + val)
const search = (val: any) => {
addressBookList.value = []
listQuery.Name = val.value
init()
}
const clear = () => {
addressBookList.value = []
listQuery.Name = ""
init()
}
const tapButton = (phone: string) => {
......
<template>
<headers title="我的班级" />
<view v-if="addressBookList.length" class="address-book-item-container">
<!-- <headers title="我的班级" /> -->
<u-tabs
:list="tabsState.list"
:is-scroll="false"
v-model="tabsState.current"
bg-color="#f5f5f5"
@change="tabsChange"
/>
<uni-search-bar
placeholder="姓名/单位/电话"
bgColor="#ffffff"
clearButton="auto"
cancelButton="none"
@confirm="search"
@clear="clear"
/>
<text style="margin-bottom: 20rpx; display: block">为你找到10个的同学</text>
<view v-if="addressBookList.length" class="address-book-item-container">
<text style="margin-bottom: 20rpx; display: block"
>为你找到{{ listQuery.total }}个的同学</text
>
<block v-for="(item, i) in addressBookList" :key="i">
<addressBookItem
:addressBookItem="item"
buttonTitle="查看评价"
:buttonTitle="tabsState.current ? '' : '查看评价'"
@tapButton="tapButton"
/>
</block>
......@@ -27,18 +36,33 @@
</template>
<script setup lang="ts">
import headers from "@/components/header/index.vue"
// import headers from "@/components/header/index.vue"
import addressBookItem from "./components/addressBookItem.vue"
import { getClassBook } from "@/api/class"
import { useGlobalStore } from "@/store/useStore"
const globalStore = useGlobalStore()
const listQuery = reactive({
Phone: globalStore.Phone,
classId: "",
pageIndex: 1,
pageSize: 10,
total: 0,
type: 0,
Name: "",
})
const tabsState = reactive({
list: [
{
name: "已评价",
},
{
name: "未评价",
},
],
current: 0,
})
const status = ref("loadmore")
const addressBookList = ref([] as any)
......@@ -48,8 +72,24 @@ onLoad((options: any) => {
init()
})
const search = (val: string) => {
console.log("我的同学" + val)
const search = (val: any) => {
listQuery.Name = val.value
tabsChange(tabsState.current)
}
const clear = () => {
listQuery.Name = ""
tabsChange(tabsState.current)
}
const tabsChange = (index: number) => {
addressBookList.value = []
listQuery.pageIndex = 1
listQuery.pageSize = 10
if (index) {
listQuery.type = 1
} else listQuery.type = 0
init()
}
const tapButton = (classId: string, studentId: string) => {
......@@ -66,7 +106,6 @@ const init = async () => {
else status.value = "nomore"
addressBookList.value = res.data
listQuery.total = res.total
console.log(res.data)
}
}
// 上拉加载数据
......
......@@ -4,14 +4,17 @@
<template #body>
<view class="address-book-content">
<view class="left">
<u-image width="160rpx" height="160rpx" :src="src"></u-image>
<u-image
width="160rpx"
height="160rpx"
:src="baseUrl + '/' + addressBookItem.proPhoto"
></u-image>
<view class="content">
<h4>{{ addressBookItem.stuName }}</h4>
<text class="tel">{{ addressBookItem.Phone }}</text>
<text>单位: {{ addressBookItem.stuUnit }}</text>
</view>
</view>
<u-button
v-show="buttonTitle"
size="mini"
......@@ -27,6 +30,7 @@
<script setup lang="ts">
import { src } from "@/utils/example"
import { baseUrl } from "@/utils/request"
const props = defineProps({
addressBookItem: {
......
<template>
<view class='arrange-item-container'>
<h3>{{ arrangeList.date }}</h3>
<view class="arrange-item-container">
<h3>
&nbsp;{{ dayjs(arrangeItem.startDate).format("YYYY-MM-DD") }}&nbsp;&nbsp;
{{
dateFormat(arrangeItem.startDate) +
"~" +
dateFormat(arrangeItem.endDate)
}}
</h3>
<u-card :show-head="false" margin="0">
<template #body>
<view class="arrange-header">
<h3>{{ arrangeList.title }}</h3>
<u-button size="mini" plain :type="arrangeStatus.type">{{ arrangeStatus.detail }}</u-button>
<h3>{{ arrangeItem.courseName }}</h3>
<u-button size="mini" plain :type="arrangeStatus.type">{{
arrangeStatus.detail
}}</u-button>
</view>
<view class="item">
<u-icon name="account" />
<text>{{ arrangeList.classTeacher }}</text>
<text>&nbsp;{{ arrangeItem.teachName }}</text>
</view>
<view class="item">
<u-icon name="map" />
<text>{{ arrangeList.address }}</text>
<text>&nbsp;{{ arrangeItem.classArea }}&nbsp;</text>
</view>
</template>
<template #foot>
<view class="arrange-footer">
<view class="arrange-footer" @tap="openInfo">
<u-icon name="order" />
<text>课程安排</text>
<text>课件资料</text>
</view>
</template>
</u-card>
</view>
<infoPopup
ref="infoRef"
v-model:show="show"
:courseNumber="props.arrangeItem.courseNumber"
/>
</template>
<script setup lang='ts'>
<script setup lang="ts">
import infoPopup from "@/pages/course/components/infoPopup.vue"
import dayjs from "dayjs"
const props = defineProps({
arrangeList: {
arrangeItem: {
type: Array,
default: () => []
} as any
default: () => [],
} as any,
})
const arrangeDetail = ['未开始', '上课中', '已下课']
const show = ref(false)
const infoRef = ref()
const arrangeDetail = ["上课中", "未开始", "已下课"]
const arrangeStatus = computed(() => {
const statusObj = {
type: '',
detail: ''
};
type: "",
detail: "",
}
switch (props.arrangeList.type) {
switch (props.arrangeItem.courseType) {
case 0:
statusObj.type = 'warning';
break;
statusObj.type = "warning"
break
case 1:
statusObj.type = 'primary';
break;
statusObj.type = "primary"
break
case 2:
statusObj.type = 'info';
break;
statusObj.type = "info"
break
}
statusObj.detail = arrangeDetail[props.arrangeList.type]
return statusObj;
});
statusObj.detail = arrangeDetail[props.arrangeItem.courseType]
return statusObj
})
const dateFormat = (dateStr: string) => {
// 创建一个日期对象,传入特定日期和时间
const date = new Date(dateStr)
// 获取小时和分钟
const hours = ("0" + date.getHours()).slice(-2)
const minutes = ("0" + date.getMinutes()).slice(-2)
// 构建时间字符串
const time = hours + ":" + minutes
return time
}
const openInfo = () => {
show.value = true
infoRef.value.init()
}
</script>
<style lang="scss" scoped>
......
......@@ -52,7 +52,12 @@
</u-card>
</view>
<saveQrCode v-model="show" />
<saveQrCode
v-model="show"
:classId="classItem.classId"
:Url="classItem.Url"
@init="emits('init')"
/>
</template>
<script setup lang="ts">
......@@ -69,6 +74,8 @@ const props = defineProps({
},
})
const emits = defineEmits(["init"])
const show = ref(false)
const percent = computed(
......
......@@ -12,7 +12,7 @@
<u-image
width="100%"
height="500rpx"
:src="qrCodeUrl"
:src="baseUrl + '/' + Url"
ref="canvasRef"
/>
</view>
......@@ -21,22 +21,26 @@
<u-button type="primary" size="medium" @tap="updateImage"
>更新二维码</u-button
>
<u-button type="success" size="medium" @tap="saveImage(qrCodeUrl)"
<!-- <u-button type="success" size="medium" @tap="saveImage"
>保存二维码</u-button
>
> -->
</view>
</u-popup>
</template>
<script setup lang="ts">
import { qrCodeUrl } from "@/utils/example"
import { baseUrl } from "@/utils/request"
import { toast } from "@/utils/util"
import html2canvas from "html2canvas"
const props = defineProps({
show: Boolean,
classId: Number,
Url: String,
})
const emits = defineEmits(["init", "update:modelValue"])
const canvasRef = ref()
const updateImage = () => {
......@@ -45,24 +49,45 @@ const updateImage = () => {
success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths
uni.uploadFile({
url: "https://www.example.com/upload", //仅为示例,非真实的接口地址
url:
baseUrl +
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiEditService.ClassImage,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
filePath: tempFilePaths[0],
name: "file",
name: "image",
formData: {
user: "test",
classId: props.classId,
},
success: (uploadFileRes) => {
console.log(uploadFileRes.data)
success: ({ data }: any) => {
const res = JSON.parse(data)
if (res.code == 200) {
emits("update:modelValue", false)
emits("init")
toast("更新成功")
}
},
})
},
})
}
const saveImage = (url: string) => {
// savePic(url)
downloadImage(url)
const saveImage = () => {
downloadImage(baseUrl + "/" + props.Url)
// downloadFile(baseUrl + "/" + props.Url, "image.jpg")
}
function downloadFile(fileURL: string, fileName: string) {
fetch(fileURL)
.then((response) => response.blob())
.then((blob) => {
const downloadUrl = URL.createObjectURL(blob)
const link = document.createElement("a")
link.href = downloadUrl
link.download = fileName
link.click()
URL.revokeObjectURL(downloadUrl)
})
}
function downloadImage(url: string) {
const link = document.createElement("a")
link.href = url
......@@ -100,10 +125,10 @@ function downloadImage(url: string) {
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
padding: 20rpx;
display: flex;
// display: flex;
.u-btn {
width: 45%;
width: 100%;
}
}
</style>
<template>
<headers title="课程安排" />
<view v-if="arrangeList.length" class="course-arrange-container">
<!-- <headers title="课程安排" /> -->
<view class="course-arrange-container">
<view class="progress">
<text>课程进度:</text>
<u-line-progress
......@@ -9,6 +9,7 @@
:height="25"
/>
</view>
<view v-if="arrangeList.length">
<u-time-line>
<u-time-line-item v-for="(item, index) in arrangeList" :key="index">
<template #node>
......@@ -28,23 +29,20 @@
<view v-else class="empty">
<u-empty text="暂无课程安排" mode="list" />
</view>
</view>
</template>
<script setup lang="ts">
import headers from "@/components/header/index.vue"
// import headers from "@/components/header/index.vue"
import arrangeItem from "./components/arrangeItem.vue"
import { getCourse } from "@/api/course"
import { useGlobalStore } from "@/store/useStore"
import { getTeachCourse } from "@/api/course"
const arrangeList = ref([] as any)
const globalStore = useGlobalStore()
const percent = ref()
const listQuery = reactive({
Phone: globalStore.Phone,
pageIndex: 1,
pageSize: 999,
pageSize: 10,
total: 0,
type: 2,
classId: "",
})
......@@ -68,7 +66,7 @@ onReachBottom(() => {
const init = async () => {
status.value = "loading"
const { data: res } = await getCourse(listQuery)
const { data: res } = await getTeachCourse(listQuery)
if (res.code == 200) {
if (res.total > 10) status.value = "loadmore"
else status.value = "nomore"
......@@ -114,4 +112,7 @@ const init = async () => {
box-shadow: 0 0 10px rgba(0, 0, 0.6, 0.412);
}
}
:deep(uni-modal) {
z-index: 99999 !important;
}
</style>
<template>
<headers title="培训评价" />
<!-- <headers title="培训评价" /> -->
<view class="evaluate-container">
<u-card :show-head="false" :show-foot="false" margin="0" border-radius="20">
<template #body>
......@@ -106,7 +106,7 @@
</template>
<script setup lang="ts">
import headers from "@/components/header/index.vue"
// import headers from "@/components/header/index.vue"
import { remarkOn, remarkDetail } from "@/api/class"
import { toast, zconfirm } from "@/utils/util"
......
<template>
<headers title="我的班级" />
<!-- <headers title="我的班级" /> -->
<view class="class-container">
<u-tabs
:list="tabsState.list"
......@@ -8,9 +8,6 @@
bg-color="#f5f5f5"
@change="tabsChange"
/>
<!-- 内容 -->
<view v-if="classList.length">
<!-- 搜索 -->
<uni-search-bar
placeholder="班级名称"
......@@ -18,13 +15,20 @@
clearButton="auto"
cancelButton="none"
@confirm="search"
@clear="clear"
/>
<!-- 内容 -->
<view v-if="classList.length">
<text style="margin-bottom: 20rpx; display: block"
>为你找到10个的班级</text
>为你找到{{ listQuery.total }}个的班级</text
>
<block v-for="(item, index) in classList" :key="index">
<classItem :classItem="item" :current="tabsState.current" />
<classItem
:classItem="item"
:current="tabsState.current"
@init="tabsChange"
/>
</block>
<view v-if="tabsState.current" style="padding: 20rpx">
<u-loadmore :status="status" icon-type="flower" />
......@@ -37,7 +41,7 @@
</template>
<script setup lang="ts">
import headers from "@/components/header/index.vue"
// import headers from "@/components/header/index.vue"
import classItem from "./components/classItem.vue"
import { getClassList } from "@/api/class"
import { useGlobalStore } from "@/store/useStore"
......@@ -63,23 +67,25 @@ const classList = ref([] as any)
const listQuery = reactive({
Phone: globalStore.Phone,
type: 0,
studentId: globalStore.studentId,
type: 1,
pageIndex: 1,
pageSize: 10,
total: 0,
Name: "",
})
const status = ref("loadmore")
const tabsChange = (index: number) => {
classList.value = []
listQuery.pageIndex = 1
listQuery.pageSize = 10
switch (index) {
case 0:
listQuery.type = 0
listQuery.type = 1
break
case 1:
listQuery.type = 1
listQuery.type = 0
break
default:
listQuery.type = 2
......@@ -88,8 +94,14 @@ const tabsChange = (index: number) => {
init()
}
const search = (val: string) => {
console.log("我的班级" + val)
const search = (val: any) => {
listQuery.Name = val.value
tabsChange(tabsState.current)
}
const clear = () => {
listQuery.Name = ""
tabsChange(tabsState.current)
}
// 上拉加载数据
......
<template>
<headers title='考勤详情' />
<div class='deatils-container'>
<!-- 内容 -->
<!-- 搜索 -->
<uni-search-bar placeholder="课程名称/班级名称" bgColor="#ffffff" clearButton="auto" cancelButton="none"
@confirm="search" />
<view class="tag">
<u-tag v-for="(item, i) in tagList" :key="i" :text="item.name" shape="circle" mode="plain" :type="item.type"
@click="changeTagType(i)" />
</view>
<text style="margin-bottom: 20rpx; display: block;">为你找到10个的班级</text>
<!-- <headers title='考勤详情' /> -->
<div class="deatils-container">
<uni-search-bar
placeholder="课程名称/班级名称"
bgColor="#ffffff"
clearButton="auto"
cancelButton="none"
@confirm="search"
@clear="clear"
/>
<!-- <view class="tag">
<u-tag
v-for="(item, i) in tagList"
:key="i"
:text="item.name"
shape="circle"
mode="plain"
:type="item.type"
@click="changeTagType(i)"
/>
</view> -->
<view v-if="detailList.length">
<text style="margin-bottom: 20rpx; display: block"
>为你找到{{ listQuery.total }}个的班级</text
>
<block v-for="(item, index) in 2" :key="index">
<detailsItem :courseList="item" />
<block v-for="(item, index) in detailList" :key="index">
<detailsItem :detailItem="item" @init="refresh" />
</block>
<!-- <view v-else class="empty">
<view style="padding: 20rpx">
<u-loadmore :status="status" icon-type="flower" />
</view>
</view>
<view v-else class="empty">
<u-empty text="暂无数据" mode="list" />
</view> -->
</view>
</div>
</template>
<script setup lang='ts'>
import headers from '@/components/header/index.vue'
import detailsItem from './components/detailsItem.vue';
<script setup lang="ts">
import { getStateList } from "@/api/course"
import detailsItem from "./components/detailsItem.vue"
const tagList = ref([
{ type: 'primary', name: '全部' },
{ type: 'info', name: '正常' },
{ type: 'info', name: '缺勤' },
{ type: 'info', name: '请假' },
{ type: 'info', name: '补签' }
{ type: "primary", name: "全部" },
{ type: "info", name: "正常" },
{ type: "info", name: "缺勤" },
{ type: "info", name: "请假" },
{ type: "info", name: "补签" },
])
const detailList = ref([] as any)
const listQuery = reactive({
courseId: "",
pageIndex: 1,
pageSize: 10,
total: 0,
Name: "",
})
const status = ref("loadmore")
// 上拉加载数据
onReachBottom(() => {
// 判断是否还有下一页数据
if (listQuery.pageIndex * listQuery.pageSize >= listQuery.total)
return (status.value = "nomore")
// // 判断是否正在请求其它数据,如果是,则不发起额外的请求
if (status.value === "loading") return
listQuery.pageIndex += 1
init()
})
const changeTagType = (index: number) => {
tagList.value.map((item: any, i: number) => {
if (index === i) item.type = 'primary'
else item.type = 'info'
if (index === i) item.type = "primary"
else item.type = "info"
})
}
const search = (val: string) => {
console.log('我的课程' + val);
const search = (val: any) => {
listQuery.Name = val.value
init()
}
const clear = () => {
listQuery.Name = ""
init()
}
const init = async () => {
status.value = "loading"
const { data: res } = await getStateList(listQuery)
if (res.code == 200) {
if (res.total > 10) status.value = "loadmore"
else status.value = "nomore"
detailList.value = [...detailList.value, ...res.data]
listQuery.total = res.total
}
}
const refresh = () => {
detailList.value = []
init()
}
onLoad((options: any) => {
listQuery.courseId = options.courseId
init()
})
</script>
<style lang="scss" scoped>
.deatils-container {
padding: 0 30rpx 30rpx;
padding-top: 20rpx;
padding: 30rpx;
.tag {
margin-bottom: 30rpx;
.u-tag {
margin-right: 20rpx;
}
}
}
......
......@@ -11,13 +11,13 @@
</view>
<view class="item">
<u-icon name="account" />
<block v-for="(item, i) in courseItem.Teachs">
<block v-for="(item, i) in courseItem.Management">
<text>&nbsp;{{ item.teachName }}&nbsp;</text>
</block>
</view>
<view class="item">
<u-icon name="map" />
<text>{{ courseItem.classArea }}</text>
<text>&nbsp;{{ courseItem.classArea }}</text>
</view>
<view class="item">
<u-icon name="clock" />
......@@ -73,12 +73,7 @@
</u-col>
<u-col span="5">
<view class=""
>缺勤:<text
>&nbsp;{{
courseItem.States[0]?.Value.lack
? courseItem.States[0]?.Value.lack
: 0
}}</text
>缺勤:<text>&nbsp;{{ lackCount }}</text
></view
>
</u-col>
......@@ -117,12 +112,18 @@
</template>
</u-card>
</view>
<infoPopup v-model:show="infoState.show" />
<infoPopup
ref="infoRef"
v-model:show="infoState.show"
:courseNumber="props.courseItem.courseNumber"
/>
</template>
<script setup lang="ts">
import infoPopup from "./infoPopup.vue"
import dayjs from "dayjs"
import { useCourseStore } from "@/store/modules/courseStore"
const courseStore = useCourseStore()
const props = defineProps({
courseItem: {
type: Array,
......@@ -135,6 +136,8 @@ const props = defineProps({
})
const emits = defineEmits(["openInfo"])
const infoRef = ref()
const dateFormat = (dateStr: string) => {
// 创建一个日期对象,传入特定日期和时间
const date = new Date(dateStr)
......@@ -151,19 +154,34 @@ const infoState = reactive({
show: false,
})
const lackCount = computed(() => {
const reallyNum = Number(props.courseItem.reallyNum || 0)
const {
leave = 0,
repair = 0,
normal = 0,
} = props.courseItem.States[0]?.Value || {}
return reallyNum - leave - repair - normal
})
const toSeeMore = () => {
courseStore.setTeachs(props.courseItem.Management)
setTimeout(() => {
uni.navigateTo({
url: "/pages/course/seeMore",
})
}, 300)
}
const toAttendanceDetails = () => {
uni.navigateTo({
url: "/pages/course/attendanceDetails",
url:
"/pages/course/attendanceDetails?courseId=" + props.courseItem.courseId,
})
}
const openInfo = () => {
infoState.show = true
infoRef.value.init()
}
</script>
......
<template>
<view class='details-item-container'>
<view class="details-item-container">
<u-card :show-head="false" :show-foot="false" margin="0">
<template #body>
<view class="details-item-header">
<h4>刘芳芳</h4>
<text>正常出勤</text>
<h4>{{ detailItem.stuName }}</h4>
<text :style="{ color: state.color }">{{ state.status }}</text>
</view>
<view style="margin-bottom: 20rpx;">
<text>15611111111</text>
<u-icon name="phone" style="margin-left: 10rpx;" />
<view style="margin-bottom: 20rpx">
<text>{{ detailItem.Phone }}</text>
<u-icon name="phone" style="margin-left: 10rpx" />
</view>
<u-time-line>
<u-time-line-item>
......@@ -16,8 +16,14 @@
<view class="line-content">
<text>上课签到:</text>
<view class="content">
<text>已签到</text>
<text style="color: #c0c4cc">(补签原因: 个人原因)</text>
<text>{{
singInStatus(detailItem.State[0]?.Value[0].SingIn)
}}</text>
<text
v-show="state.SingInText != ' ' && state.SingInText"
style="color: #c0c4cc"
>(请假原因: {{ state.SingInText }})</text
>
</view>
</view>
</template>
......@@ -25,26 +31,213 @@
<u-time-line-item>
<template #content>
<view class="line-content">
<text>上课签到</text>
<text>下课签退</text>
<view class="content">
<text>已签到</text>
<text style="color: #c0c4cc">(补签原因: 个人原因)</text>
<text>{{
singOutStatus(detailItem.State[0]?.Value[0].SingOut)
}}</text>
<text
v-show="state.SingOutText != ' ' && state.SingOutText"
style="color: #c0c4cc"
>(请假原因: {{ state.SingOutText }})</text
>
</view>
</view>
</template>
</u-time-line-item>
</u-time-line>
<view class="footer">
<u-button type="primary" size="mini" plain>请假</u-button>
<u-button type="primary" size="mini">补签</u-button>
<view
class="footer"
v-show="state?.status == '缺勤' || state?.status == '未签退'"
>
<u-button type="primary" size="mini" plain @tap="leave"
>请假</u-button
>
<u-button type="primary" size="mini" @tap="repair">补签</u-button>
</view>
</template>
</u-card>
</view>
<fillPopup
ref="fillRef"
v-model="fillState.show"
:name="detailItem.stuName"
:label="fillState.label"
@submit="submit"
/>
</template>
<script setup lang='ts'>
<script setup lang="ts">
import fillPopup from "./fillPopup.vue"
import { signInAndOut } from "@/api/course"
import dayjs from "dayjs"
import { toast } from "@/utils/util"
const props = defineProps({
detailItem: {
type: Array,
default: () => [],
} as any,
})
const emits = defineEmits(["init"])
const fillState = reactive({
show: false,
title: "",
label: "",
radioList: [] as any,
})
const fillRef = ref()
const tagList = [
{ color: "#19be6b", status: "正常出勤" },
{ color: "#ff9900", status: "缺勤" },
{ color: "#ff9900", status: "未签退" },
{ color: "#303133", status: "签到请假" },
{ color: "#303133", status: "签退请假" },
{ color: "#19be6b", status: "已补签" },
{ color: "#19be6b", status: "签退补签" },
] as any
// 正常出勤: QD + QT
// 缺勤:'' + ''
// 未签退:QD + ''
// 签到请假:QDQJ + ''
// 签退请假: QD + QTQJ
// 已补签:QDBJ + ''
// 签退补签: '' + QDBJ
const state1: any = computed(() => {
let data
const { SingIn, SingOut, SingInText, SingOutText } =
props.detailItem.State[0].Value[0]
if (SingIn == "QD" && SingOut == "QT") data = tagList[0]
if (!SingOut && !SingOut) data = tagList[1]
if (SingIn == "QD" && !SingOut) data = tagList[2]
if (SingIn == "QDQJ" && !SingOut) data = tagList[3]
if (SingIn == "QD" && SingOut == "QTQJ") data = tagList[4]
if (SingIn == "QDBQ" && !SingOut) data = tagList[5]
if (SingIn == "QD" && SingOut == "QDBJ") data = tagList[6]
data = { ...data, ...{ SingInText }, ...{ SingOutText } }
console.log(data)
return data
})
const state: any = computed(() => {
let data = tagList[1] // 默认值
const { SingIn, SingOut, SingInText, SingOutText } =
props.detailItem.State[0].Value[0]
const conditions = {
"QD-QT": tagList[0],
QD: tagList[2],
QDQJ: tagList[3],
"QD-QTQJ": tagList[4],
QDBQ: tagList[5],
"QD-QDBJ": tagList[6],
} as any
const key = `${SingIn || ""}-${SingOut || ""}`
if (conditions.hasOwnProperty(key)) {
data = conditions[key]
}
data = { ...data, SingInText, SingOutText }
return data
})
const singInStatus = (status: string) => {
let str = ""
if (status) {
switch (status) {
case "QDBQ":
str = "已补签"
break
case "QD":
str = "已签到"
break
case "QDQJ":
str = "签到请假"
break
}
} else {
str = "未签到"
}
return str
}
const singOutStatus = (status: string) => {
let str = ""
if (status) {
switch (status) {
case "QTBQ":
str = "已补签"
break
case "QT":
str = "已签退"
break
case "QTQJ":
str = "签退请假"
break
}
} else {
str = "未签退"
}
return str
}
const leave = () => {
fillState.label = "请假"
fillRef.value.init("签到请假")
fillState.show = true
}
const repair = () => {
fillState.label = "补签"
fillRef.value.init("签到补签")
fillState.show = true
}
const submit = async (reason: string) => {
let obj = {
parmeters: {
IsDeleteEntry: "false",
Model: {
FCourseId: {
FNUMBER: props.detailItem.courseNum,
},
FClassId: {
FNUMBER: props.detailItem.classNumber,
},
FStudentId: {
FNUMBER: props.detailItem.studentNum,
},
FDate: dayjs().format("YYYY-MM-DD"),
FLocation: "",
FLocationDetails: "",
FCockinType: "",
FReason: reason,
},
},
}
console.log(state.value, fillState)
if (state.value.status == "缺勤") {
// 请假
if (fillState.label === "请假") obj.parmeters.Model.FCockinType = "QDQJ"
// 补签
else obj.parmeters.Model.FCockinType = "QDBQ"
}
if (state.value.status == "未签退") {
// 请假
if (fillState.label === "请假") obj.parmeters.Model.FCockinType = "QTQJ"
else obj.parmeters.Model.FCockinType = "QTBQ"
}
const { data: res } = await signInAndOut(obj)
if (res.code == 200) {
fillState.show = false
emits("init")
toast("填报成功")
}
}
</script>
<style lang="scss" scoped>
......
<template>
<u-popup
v-model="props.show"
mode="center"
border-radius="15"
width="90%"
@close="close"
>
<view class="u_card">
<u-card :title="'学员' + label">
<template #body>
<view>学员姓名:{{ name }}</view>
<u-form :model="formData" label-position="top">
<!-- <u-form-item label="" prop="radio">
<u-radio-group v-model="formData.radio">
<u-radio
v-for="(item, index) in radioList"
:key="index"
:name="item.name"
shape="square"
>
{{ item.name }}
</u-radio>
</u-radio-group>
</u-form-item> -->
<u-form-item :label="label + '原因:'" :border-bottom="false"
><u-input
v-model="formData.reason"
type="textarea"
border
maxlength="30"
height="120"
:placeholder="'请输入' + props.label + '原因'"
/></u-form-item>
</u-form>
</template>
<template #foot>
<u-button size="medium" @tap="emits('update:modelValue', false)"
>取消</u-button
>
<u-button size="medium" type="primary" @tap="submit"
>确认{{ props.label }}</u-button
>
</template>
</u-card>
</view>
</u-popup>
</template>
<script setup lang="ts">
import { toast } from "@/utils/util"
const props = defineProps({
show: Boolean,
name: String,
label: String,
radio: String,
})
const emits = defineEmits(["update:modelValue", "submit"])
const formData = reactive({
radio: "",
reason: "",
})
const submit = () => {
if (!formData.reason) return toast("请输入" + props.label)
emits("submit", formData.reason)
}
const close = () => {
formData.reason = ""
}
const init = (radio: string) => {
formData.radio = radio
}
defineExpose({
init,
})
</script>
<style lang="scss" scoped>
.u_card {
padding: 20rpx 0;
}
:deep(.u-card__foot) {
display: flex;
justify-content: space-between;
}
</style>
......@@ -35,7 +35,7 @@
<script setup lang="ts">
import { zconfirm } from "@/utils/util"
import { geFileList } from "@/api/course"
import { getFileList } from "@/api/course"
import { baseUrl } from "@/utils/request"
const props = defineProps({
......@@ -80,7 +80,7 @@ const handeClose = () => {
}
const init = async () => {
const { data: res } = await geFileList({ courseNumber: props.courseNumber })
const { data: res } = await getFileList({ courseNumber: props.courseNumber })
if (res.code == 200) {
console.log(res)
infoList.value = res.data
......
export const inClass = [{
title: '党支部书记班',
date: '2022-04-01 09:00~12:00', // 课程时间
address: '深圳市南山区西丽街道办公室', // 课程地点
teacher: '王少龙', // 老师
class: '党支部培训班',
signInInfo: {
signInStatus: 0, // // 0 点击签到, 1 点击签退, 2 签到成功, 3 xx分钟后签到, 4 未签到, 5 签退成功, 6 未签退
classTime: '09:00', // 上课时间
endClassTime: '12:00', // 下课时间
classTeacher: ['郭敬明', '王少龙'] // 班主任
} // 签到信息
}]
export const notStarted = [{
title: '党支部书记班',
date: '2022-04-01 09:00~12:00', // 课程时间
address: '深圳市南山区西丽街道办公室', // 课程地点
teacher: '王少龙', // 班主任
class: '党支部培训班',
},
{
title: '党支部书记班',
date: '2022-04-01 09:00~12:00', // 课程时间
address: '深圳市南山区西丽街道办公室', // 课程地点
teacher: '王少龙', // 班主任
class: '党支部培训班',
},
{
title: '党支部书记班',
date: '2022-04-01 09:00~12:00', // 课程时间
address: '深圳市南山区西丽街道办公室', // 课程地点
teacher: '王少龙', // 班主任
class: '党支部培训班',
}]
\ No newline at end of file
<template>
<headers title="我的课程" />
<!-- <headers title="我的课程" /> -->
<view class="course-container">
<u-tabs
:list="tabsState.list"
......@@ -8,9 +8,6 @@
bg-color="#f5f5f5"
@change="tabsChange"
/>
<!-- 内容 -->
<view v-if="courseList.length">
<!-- 搜索 -->
<uni-search-bar
placeholder="班级名称"
......@@ -18,10 +15,12 @@
clearButton="auto"
cancelButton="none"
@confirm="search"
@clear="clear"
/>
<!-- 内容 -->
<view v-if="courseList.length">
<text style="margin-bottom: 20rpx; display: block"
>为你找到10个的班级</text
>为你找到{{ listQuery.total }}个的班级</text
>
<block v-for="(item, index) in courseList" :key="index">
......@@ -38,7 +37,7 @@
</template>
<script setup lang="ts">
import headers from "@/components/header/index.vue"
// import headers from "@/components/header/index.vue"
import courseItem from "./components/courseItem.vue"
import { getCourseList } from "@/api/course"
import { useGlobalStore } from "@/store/useStore"
......@@ -68,12 +67,15 @@ const listQuery = reactive({
pageSize: 10,
total: 0,
type: 0,
Name: "",
})
const status = ref("loadmore")
const tabsChange = (index: number) => {
courseList.value = []
listQuery.pageIndex = 1
listQuery.pageSize = 10
switch (index) {
case 0:
listQuery.type = 0
......@@ -88,8 +90,14 @@ const tabsChange = (index: number) => {
init()
}
const search = (val: string) => {
console.log("我的班级" + val)
const search = (val: any) => {
listQuery.Name = val.value
tabsChange(tabsState.current)
}
const clear = () => {
listQuery.Name = ""
tabsChange(tabsState.current)
}
// 上拉加载数据
......@@ -111,7 +119,6 @@ const init = async () => {
else status.value = "nomore"
courseList.value = [...courseList.value, ...res.data]
listQuery.total = res.total
console.log(courseList.value)
}
}
......@@ -132,4 +139,7 @@ init()
margin-right: 20rpx;
}
}
:deep(uni-modal) {
z-index: 99999 !important;
}
</style>
<template>
<headers :title="pdfState.title" />
<!-- <headers :title="pdfState.title" /> -->
<view class="pdf-container">
<web-view class="webview" :src="pdfState.pdfUrl"></web-view>
</view>
</template>
<script setup lang="ts">
import headers from "@/components/header/index.vue"
// import headers from "@/components/header/index.vue"
const pdfState = reactive({
title: "",
......@@ -19,6 +19,12 @@ onLoad((options: any) => {
pdfState.pdfUrl =
pdfState.viewerUrl + "?file=" + encodeURIComponent(options.url)
})
onReady(() => {
uni.setNavigationBarTitle({
title: pdfState.title,
})
})
</script>
<style lang="scss" scoped>
......
<template>
<headers title='查看更多' />
<view class='see-more-container'>
<view class="see-more-container">
<block v-for="(item, index) in Teachs">
<u-card :show-head="false" :show-foot="false" margin="0">
<template #body>
<u-section title="讲师介绍" font-size="34" :arrow="false" :right="false" line-color="#2979ff" />
<u-section
title="讲师介绍"
font-size="34"
:arrow="false"
:right="false"
line-color="#2979ff"
/>
<view class="info">
<u-image width="100rpx" height="100rpx" border-radius="10" :src="src" />
<u-image
width="100rpx"
height="100rpx"
border-radius="10"
:src="src"
/>
<view class="info-text">
<text>王少龙</text>
<text>教授</text>
<text>{{ item.teachName }}</text>
<text>{{ item.teachTle }}</text>
</view>
</view>
<view class="detail">
Lorem ipsum dolor sit amet, consecteturadipiscing elit. Aenean euismod bibendumlaoreet. Proin
gravida dolor sit amet lacusaccumsan et viverra justo commodo. Proinsodales pulvinar sic tempor.
Sociis natoquepenatibus et magnis dis parturient montes,nascetur ridiculus mus. Nam fermentum,
nullaluctus pharetra vulputate, felis tellus mollis orci,sed rhoncus pronin sapien nunc accuan
eget.
{{ item.teachMsg }}
</view>
</template>
</u-card>
<u-card :show-head="false" :show-foot="false" margin="0">
<template #body>
<u-section title="课程介绍" font-size="34" :arrow="false" :right="false" line-color="#2979ff" />
<u-section
title="课程介绍"
font-size="34"
:arrow="false"
:right="false"
line-color="#2979ff"
/>
<view class="detail">
Lorem ipsum dolor sit amet, consecteturadipiscing elit. Aenean euismod bibendumlaoreet. Proin
gravida dolor sit amet lacusaccumsan et viverra justo commodo. Proinsodales pulvinar sic tempor.
Sociis natoquepenatibus et magnis dis parturient montes,nascetur ridiculus mus. Nam fermentum,
nullaluctus pharetra vulputate, felis tellus mollis orci,sed rhoncus pronin sapien nunc accuan
eget.
{{ item.courseMsg }}
</view>
</template>
</u-card>
</block>
</view>
</template>
<script setup lang='ts'>
import headers from '@/components/header/index.vue'
import { src } from '@/utils/example';
<script setup lang="ts">
import { useCourseStore } from "@/store/modules/courseStore"
import { src } from "@/utils/example"
const courseStore = useCourseStore()
const Teachs = computed(() => courseStore.getTeachs)
</script>
<style lang="scss" scoped>
......@@ -66,10 +80,10 @@ import { src } from '@/utils/example';
}
.detail {
text-indent: 2.5em;
text-indent: 1em;
margin-top: 30rpx;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 32rpx;
font-size: 28rpx;
line-height: 1.25;
}
}
......
<template>
<headers title='西部人力培训中心' backIconName="close" />
<!-- <headers title='西部人力培训中心' backIconName="close" /> -->
<view class="home-container">
<!-- 用户信息部分 -->
<view class="user-info">
<u-image width="260rpx" height="260rpx" :src="src" border-radius="30" />
<text class="name">小美</text>
<u-image
width="260rpx"
height="260rpx"
:src="baseUrl + '/' + globalStore.infoData.Image"
border-radius="30"
/>
<text class="name">{{ globalStore.infoData.Name }}</text>
<view class="info">
<text>宝安研发部</text>
<u-line color="#eee" direction="col" length="30rpx" :hair-line="false" margin="0 20rpx" />
<text>开发人员</text>
<text>{{
globalStore.infoData.Type == "BZR" ? "班主任" : "讲师"
}}</text>
</view>
</view>
......@@ -17,7 +22,7 @@
<view class="content">
<u-grid :col="3">
<u-grid-item @tap="toClass">
<u-badge count="2" :offset="[20, 20]"></u-badge>
<!-- <u-badge count="2" :offset="[20, 20]"></u-badge> -->
<u-icon name="man-add-fill" :size="53"></u-icon>
<view class="grid-text">管理班级</view>
</u-grid-item>
......@@ -26,34 +31,46 @@
<view class="grid-text">我的课程</view>
</u-grid-item>
<u-grid-item @tap="toSetPositioning">
<u-badge count="3" :offset="[20, 20]"></u-badge>
<!-- <u-badge count="3" :offset="[20, 20]"></u-badge> -->
<u-icon name="list-dot" :size="53"></u-icon>
<view class="grid-text">设置考勤定位</view>
</u-grid-item>
<u-grid-item @tap="toTeachPoints">
<u-icon name="search" :size="53"></u-icon>
<view class="grid-text">现场教学点</view>
</u-grid-item>
</u-grid>
</view>
</view>
</view>
</template>
<script setup lang='ts'>
import headers from '@/components/header/index.vue'
import { src } from '@/utils/example'
<script setup lang="ts">
// import headers from '@/components/header/index.vue'
import { useGlobalStore } from "@/store/useStore"
import { baseUrl } from "@/utils/request"
const globalStore = useGlobalStore()
const toClass = () => {
uni.navigateTo({
url: '/pages/class/index'
url: "/pages/class/index",
})
}
const toCourse = () => {
uni.navigateTo({
url: '/pages/course/index'
url: "/pages/course/index",
})
}
const toSetPositioning = () => {
uni.navigateTo({
url: '/pages/setPositioning/index'
url: "/pages/setPositioning/index",
})
}
const toTeachPoints = () => {
uni.navigateTo({
url: "/pages/teachPoints/index",
})
}
</script>
......
<template>
<u-form
:model="loginForm"
ref="loginFormRef"
:rules="loginFormRules"
style="margin-top: 40rpx"
label-posi
>
<u-form-item
:leftIconStyle="{ color: '#888', fontSize: '32rpx' }"
left-icon="account"
label-width="150"
label-position="left"
label="用户名"
prop="username"
>
<u-input
placeholder="请输入用户名"
v-model="loginForm.username"
type="text"
/>
</u-form-item>
<!-- <u-form-item label="密码" :leftIconStyle="{ color: '#888', fontSize: '32rpx' }" left-icon="lock"
label-width="150rpx" prop="password">
<u-input type="password" v-model="loginForm.password" placeholder="请输入密码" />
</u-form-item> -->
</u-form>
<button @tap="tapLogin" class="getCaptcha">登录</button>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted } from "vue"
import { Login } from "../interface"
import { useGlobalStore } from "@/store/useStore"
const globalStore = useGlobalStore()
const loginFormRef = ref()
const loginForm = reactive<Login.LoginForm>({
username: "999666",
password: "123456",
})
const loginFormRules = reactive({
username: [{ required: true, message: "请输入用户名", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
})
let tapLogin = () => {
globalStore.setPhone(loginForm.username)
uni.navigateTo({
url: "/pages/home/index",
})
}
onMounted(() => loginFormRef.value?.setRules(loginFormRules))
</script>
<style lang="scss" scoped>
.getCaptcha {
width: 500rpx;
background-color: rgb(253, 243, 208);
color: $u-tips-color;
border: none;
font-size: 30rpx;
margin-top: 20rpx;
&::after {
border: none;
}
}
:deep(.uicon-eye:before) {
font-size: 40rpx;
}
:deep(.uicon-eye-fill:before) {
font-size: 40rpx;
}
:deep(.u-input) {
justify-content: center;
align-items: center;
}
</style>
<template>
<headers title="西部人力培训中心" backIconName="close" />
<view style="box-sizing: border-box">
<view class="login-container">
<text class="login-text">欢迎登陆</text>
<loginForm />
<u-form :model="data.formData" ref="form" label-width="150">
<u-form-item label="手机号" prop="Phone"
><u-input v-model="data.formData.Phone" placeholder="请出输入手机号"
/></u-form-item>
<u-form-item label="密码" prop="Password"
><u-input
v-model="data.formData.Password"
type="password"
placeholder="请输入密码"
/></u-form-item>
</u-form>
<view class="footer">
<u-button @click="submit" size="medium" type="primary">登录</u-button>
</view>
</view>
<h4>{{ "用户code:" + code + "---" + Msg }}</h4>
</template>
<script setup lang="ts">
import headers from "@/components/header/index.vue"
import loginForm from "./components/loginForm.vue"
import { getUrlCode } from "@/utils/util"
import { getUserInfo } from "@/api/login"
const Msg = ref()
const code = ref()
onLoad(async () => {
code.value = getUrlCode().code
const url =
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx459ae5e7c5918bf3&redirect_uri=https%3A%2F%2Fweixin3.lingqingkeji.com&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect"
if (code.value) {
const res = await getUserInfo(code.value)
Msg.value = JSON.stringify(res)
alert(JSON.stringify(res))
// if (res.code == 200) {
// alert(JSON.stringify(res.data))
// }
}
// else location.href = url
import { useGlobalStore } from "@/store/useStore"
import { Login } from "./interface/index"
import { teachLogin } from "@/api/login"
import { toast } from "@/utils/util";
const globalStore = useGlobalStore()
const form = ref()
const uniA: any = uni
const data = reactive({
formData: {
Phone: "",
Password: "",
} as Login.LoginForm,
rules: {
Phone: [
{
required: true,
message: "请输入手机号",
trigger: ["change", "blur"],
},
// {
// // 自定义验证函数,见上说明
// validator: (rule: any, value: any, callback: any) => {
// return uniA.$u.test.mobile(value)
// },
// message: "手机号码不正确",
// // 触发器可以同时用blur和change
// trigger: ["change", "blur"],
// },
],
Password: [
{
required: true,
message: "请输入密码",
trigger: ["change", "blur"],
},
],
},
})
</script>
<style lang="scss" scoped>
:deep(uni-page-wrapper) {
background-color: #fff;
onReady(() => {
form.value.setRules(data.rules)
})
const submit = () => {
form.value.validate(async (valid: boolean) => {
if (valid) {
const { data: res } = await teachLogin(data.formData)
if (res.code == 200) {
globalStore.setPhone(data.formData.Phone)
globalStore.setInfoData(res.data[0])
uni.reLaunch({ url: "/pages/home/index" })
toast('登录成功')
}
} else {
console.log("验证失败")
}
})
}
</script>
:deep(uni-page) {
padding: 0 6rpx;
box-sizing: border-box;
<style lang="scss" scoped>
page {
background-image: url("https://img2.baidu.com/it/u=460732253,1892860896&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=888");
background-size: cover;
/* 背景图片自适应屏幕大小 */
/* 其他样式设置 */
}
.login-container {
box-sizing: border-box;
padding-top: 20%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
padding: 30rpx;
position: absolute;
top: 25%;
left: 5%;
width: 90vw;
background-color: #fff;
border-radius: 15rpx;
.login-text {
margin-top: 10%;
font-weight: 700;
font-size: 40rpx;
color: #1d2b5f;
.footer {
display: flex;
margin-top: 30rpx;
}
}
</style>
export namespace Login {
export interface LoginForm {
username: string,
password: string
Phone: string
Password: string
}
}
......@@ -11,14 +11,18 @@
<view class="item">
<text
>考勤定位:{{
positionItem.isSetPosition ? "已设置" : "未设置"
positionItem.StateType ? positionItem.hitArea : "未设置"
}}</text
>
</view>
<view class="item">
<text
>应用范围:{{
positionItem.range ? positionItem.range + "米" : "未设置"
positionItem.type
? positionItem.type
? "同步班级所有课程的考勤定位"
: "仅当前课程考勤定位"
: "未设置"
}}</text
>
</view>
......@@ -52,11 +56,9 @@ const props = defineProps({
const mapStore = useMapStore()
const openMap = () => {
mapStore.setMapData(props.positionItem)
uni.navigateTo({
url: "/pages/setPositioning/map",
success() {
mapStore.setMapData(props.positionItem)
}
})
}
</script>
......
<template>
<headers title="设置考勤定位" />
<!-- <headers title="设置考勤定位" /> -->
<div class="set-position-container">
<u-tabs
:list="tabsState.list"
......@@ -8,8 +8,6 @@
bg-color="#f5f5f5"
@change="tabsChange"
/>
<!-- 内容 -->
<view v-if="positionList.length">
<!-- 搜索 -->
<uni-search-bar
placeholder="课程名称/班级名称"
......@@ -17,10 +15,12 @@
clearButton="auto"
cancelButton="none"
@confirm="search"
@clear="clear"
/>
<!-- 内容 -->
<view v-if="positionList.length">
<text style="margin-bottom: 20rpx; display: block"
>为你找到10个的课程</text
>为你找到{{ listQuery.total }} 个的课程</text
>
<block v-for="(item, index) in positionList" :key="index">
......@@ -37,7 +37,7 @@
</template>
<script setup lang="ts">
import headers from "@/components/header/index.vue"
// import headers from "@/components/header/index.vue"
import setPositionItem from "./components/setPositionItem.vue"
import { getLocationList } from "@/api/position"
import { useGlobalStore } from "@/store/useStore"
......@@ -63,6 +63,7 @@ const listQuery = reactive({
pageSize: 10,
total: 0,
type: 0,
Name: "",
})
const status = ref("loadmore")
const tabsChange = (index: number) => {
......@@ -75,8 +76,14 @@ const tabsChange = (index: number) => {
init()
}
const search = (val: string) => {
console.log("我的课程" + val)
const search = (val: any) => {
listQuery.Name = val.value
init()
}
const clear = () => {
listQuery.Name = ""
init()
}
// 上拉加载数据
......@@ -98,11 +105,13 @@ const init = async () => {
else status.value = "nomore"
positionList.value = [...positionList.value, ...res.data]
listQuery.total = res.total
console.log(positionList.value)
// console.log(positionList.value)
}
}
init()
onShow(() => {
tabsChange(tabsState.current)
})
</script>
<style lang="scss" scoped>
......
<template>
<headers title="考勤地点设置" :is-button="false" @submit="submit" />
<!-- <headers title="考勤地点设置" :is-button="false" @submit="submit" /> -->
<view v-if="flag" class="map">
<iframe id="mapPage" width="100%" height="100%" frameborder="0" :src="src">
</iframe>
<view class="complete">
<u-button
type="primary"
size="mini"
@tap="submit"
style="margin-right: 30rpx"
>下一步</u-button
>
</view>
</view>
</template>
......@@ -49,14 +58,19 @@ const submit = () => {
})
},
})
// zconfirm("确定设置为该地址?", (result: boolean) => {
// if (result) {
// }
// })
setTimeout(function () {
console.log(mapStore.mapData, "mapStore.mapData")
}, 10)
}
onMounted(() => {
if (mapStore.mapData.StateType) {
state.coord = mapStore.mapData.Longitude
console.log(mapStore.mapData, state.coord , 'state.coord ')
src.value = `https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=${state.key}&referer=XBRLPX&coord=${state.coord}&zoom=18`
setTimeout(() => {
flag.value = true
}, 300)
} else {
uni.getLocation({
type: "gcj02",
......@@ -64,10 +78,9 @@ onMounted(() => {
console.log(res)
state.coord = res.latitude + "," + res.longitude
src.value = `https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=${state.key}&referer=XBRLPX&coord=${state.coord}&zoom=18`
// mapStore.setMapData({ ...mapStore.mapData, ...{ hitArea: "" } })
setTimeout(() => {
flag.value = true
}, 1000)
}, 300)
},
})
}
......@@ -82,8 +95,8 @@ onMounted(() => {
.complete {
position: absolute;
top: 5%;
right: 10rpx;
top: 5.5%;
right: -3%;
}
}
</style>
<template>
<headers title="考勤地点设置" />
<!-- <headers title="考勤地点设置" /> -->
<view class="set-attendance-container">
<h3>考勤地点设置</h3>
<u-form :model="data.formData" ref="formRef" label-position="top">
<u-form :model="data.parmeters" ref="formRef" label-position="top">
<u-form-item label="考勤地址名称" prop="F_LQKJ_HITAREA"
><u-input v-model="data.formData.F_LQKJ_HITAREA" clearable
><u-input v-model="data.parmeters.F_LQKJ_HITAREA" clearable
/></u-form-item>
<u-form-item label="有效范围" prop="F_LQKJ_SCOPE"
><u-input
type="select"
v-model="data.formData.F_LQKJ_SCOPE"
v-model="data.parmeters.F_LQKJ_SCOPE"
@tap="data.show = true"
/></u-form-item>
<u-form-item label="请设置定位的应用范围" prop="">
<u-radio-group v-model="data.formData.scope" shape="square">
<u-radio :name="0">仅当前课程考勤定位 </u-radio>
<u-radio :name="1">同步班级所有课程的考勤定位 </u-radio>
<u-radio-group v-model="data.parmeters.type" shape="square">
<u-radio name="0">仅当前课程考勤定位 </u-radio>
<u-radio name="1">同步班级所有课程的考勤定位 </u-radio>
</u-radio-group>
</u-form-item>
</u-form>
......@@ -34,7 +34,7 @@
</template>
<script setup lang="ts">
import headers from "@/components/header/index.vue"
// import headers from "@/components/header/index.vue"
import { setAddr } from "@/api/position"
import { toast } from "@/utils/util"
import { useMapStore } from "@/store/modules/mapStore"
......@@ -44,12 +44,13 @@ const mapStore = useMapStore()
const formRef = ref()
const data = reactive({
formData: {
parmeters: {
F_LQKJ_LONGITUDE: "",
F_LQKJ_SCOPE: "",
FCOURSEID: 0,
scope: 0,
type: 0,
F_LQKJ_HITAREA: "",
classId: "",
},
rules: {
F_LQKJ_HITAREA: [
......@@ -111,8 +112,7 @@ const back = () => {
const submit = () => {
formRef.value.validate(async (valid: any) => {
if (valid) {
console.log(data.formData)
const { data: res } = await setAddr(data.formData)
const { data: res } = await setAddr({ parmeters: data.parmeters })
if (res.code == 200) {
uni.navigateBack({ delta: 2 })
toast("设置成功")
......@@ -123,16 +123,18 @@ const submit = () => {
}
const onConfirm = (item: any) => {
data.formData.F_LQKJ_SCOPE = item[0].value
data.parmeters.F_LQKJ_SCOPE = item[0].value
}
onReady(() => {
formRef.value.setRules(data.rules)
setTimeout(() => {
data.formData.F_LQKJ_HITAREA = mapStore.mapData.hitArea
data.formData.F_LQKJ_LONGITUDE = mapStore.mapData.Longitude
data.formData.F_LQKJ_SCOPE = mapStore.mapData.Scope
data.formData.FCOURSEID = mapStore.mapData.courseId
data.parmeters.F_LQKJ_HITAREA = mapStore.mapData.hitArea
data.parmeters.F_LQKJ_LONGITUDE = mapStore.mapData.Longitude
data.parmeters.F_LQKJ_SCOPE = mapStore.mapData.Scope
data.parmeters.FCOURSEID = mapStore.mapData.courseId
data.parmeters.type = mapStore.mapData.type
data.parmeters.classId = mapStore.mapData.classId
console.log(mapStore.mapData)
}, 100)
})
......
<template>
<div class="teach-points-container">
<u-card :show-head="false" margin="0">
<template #body>
<view class="teach-points-header">
<h3>{{ teachPointsItem.FTERRITORIALITY }}</h3>
</view>
<view class="item">
<text>现场教学点:{{ teachPointsItem.FTEACHINGPOINTS }}</text>
</view>
<view class="item">
<text>联系人:{{ teachPointsItem.FCONTACTS }}</text>
</view>
<view class="item">
<text>联系电话:{{ teachPointsItem.FPHONE }}</text>
</view>
</template>
</u-card>
</div>
</template>
<script setup lang="ts">
defineProps({
teachPointsItem: {
type: Array,
default: () => [],
} as any,
})
</script>
<style lang="scss" scoped>
.teach-points-container {
margin-bottom: 20rpx;
.teach-points-header {
margin-bottom: 30rpx;
}
.item {
margin-bottom: 20rpx;
}
}
</style>
<template>
<view class="teach-container">
<view v-if="teachPointsList.length">
<!-- 搜索 -->
<uni-search-bar
placeholder="现场教学点"
bgColor="#ffffff"
clearButton="auto"
cancelButton="none"
@confirm="search"
/>
<text style="margin-bottom: 20rpx; display: block"
>为你找到{{ listQuery.total }}个的现场教学点</text
>
<block v-for="(item, index) in teachPointsList" :key="index">
<teachPointsItem :teachPointsItem="item" />
</block>
<view style="padding: 20rpx">
<u-loadmore :status="status" icon-type="flower" />
</view>
</view>
<view v-else class="empty">
<u-empty text="暂无数据" mode="list" />
</view>
</view>
</template>
<script setup lang="ts">
import teachPointsItem from "./components/teachPointsItem.vue"
import { getTeachPointsList } from "@/api/teachPoints"
const teachPointsList = ref([] as any)
const status = ref("loadmore")
const listQuery = reactive({
pageIndex: 1,
pageSize: 10,
total: 0,
Area: "",
})
const search = (val: any) => {
teachPointsList.value = []
listQuery.Area = val.value
init()
}
// 上拉加载数据
onReachBottom(() => {
// 判断是否还有下一页数据
if (listQuery.pageIndex * listQuery.pageSize >= listQuery.total)
return (status.value = "nomore")
// // 判断是否正在请求其它数据,如果是,则不发起额外的请求
if (status.value === "loading") return
listQuery.pageIndex += 1
init()
})
const init = async () => {
status.value = "loading"
const { data: res } = await getTeachPointsList(listQuery)
if (res.code == 200) {
if (res.total > 10) status.value = "loadmore"
else status.value = "nomore"
teachPointsList.value = [...teachPointsList.value, ...res.data]
listQuery.total = res.total
console.log(teachPointsList.value)
} else status.value = "nomore"
}
init()
</script>
<style lang="scss" scoped>
.teach-container {
padding: 0 30rpx 30rpx;
padding-top: 20rpx;
}
</style>
export const useCourseStore = defineStore({
id: "courseStore ",
state() {
return {
Teachs: [],
}
},
getters: {
getTeachs: (state: any) => state.Teachs,
},
actions: {
async setTeachs(Teachs: any) {
this.Teachs = Teachs
},
},
})
......@@ -7,9 +7,7 @@ export const useGlobalStore = defineStore({
state() {
return {
Phone: "",
studentNumber: "",
studentId: "",
openId: "",
infoData: {} as any,
}
},
getters: {},
......@@ -17,11 +15,8 @@ export const useGlobalStore = defineStore({
setPhone(Phone: string) {
this.Phone = Phone
},
setStudentNumber(studentNumber: string) {
this.studentNumber = studentNumber
},
setStudentId(studentId: string) {
this.studentId = studentId
setInfoData(infoData: string) {
this.infoData = infoData
},
},
persist: piniaPersistOption("globalStore"),
......
......@@ -2,7 +2,7 @@ import config from "./config"
// export const baseUrl = "/k3cloud"
// 部署到iis上用的
// export const baseUrl = "https://weixin.lingqingkeji.com:86/k3cloud"
// export const baseUrl = "https://weixin3.lingqingkeji.com/k3cloud"
export const baseUrl = "/XiBU"
// 封装公共申请办法
......
......@@ -109,17 +109,3 @@ export const jsonp = function (url: any, data: any) {
document.body.appendChild(scriptNode)
})
}
// 截取url中的code方法
export const getUrlCode = () => {
const url = location.search
const theRequest: any = new Object()
if (url.indexOf("?") != -1) {
const str = url.substr(1)
const strs = str.split("&")
for (let i: any = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = strs[i].split("=")[1]
}
}
return theRequest
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论