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

更新代码

上级 cbdb5c70
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" href="" type="png/x-icon" /> <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" /> <link rel="stylesheet" href="./src/static/iconfont/iconfont.css" />
<script> <script>
var coverSupport = var coverSupport =
......
...@@ -6,9 +6,9 @@ import request from "@/utils/request" ...@@ -6,9 +6,9 @@ import request from "@/utils/request"
* @param type //0:上课中,1:已结束,2:未开始 * @param type //0:上课中,1:已结束,2:未开始
* @return * @return
*/ */
export const getCourse = (data?: any) => export const getTeachCourse = (data?: any) =>
request( 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", "POST",
data data
) )
...@@ -56,9 +56,20 @@ export const signInAndOut = (data?: any) => ...@@ -56,9 +56,20 @@ export const signInAndOut = (data?: any) =>
* @param data * @param data
* @return * @return
*/ */
export const geFileList = (data?: any) => export const getFileList = (data?: any) =>
request( request(
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.FilePDF,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc", "/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.FilePDF,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST", "POST",
data 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) => { ...@@ -27,3 +27,15 @@ export const uploadImage = (data: any) => {
data 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 @@ ...@@ -10,22 +10,19 @@
{ {
"path": "pages/login/index", "path": "pages/login/index",
"style": { "style": {
"navigationBarTitleText": "登录", "navigationBarTitleText": "西部人力培训中心"
"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/home/index", "path": "pages/home/index",
"style": { "style": {
"navigationBarTitleText": "主页", "navigationBarTitleText": "西部人力培训中心"
"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/class/index", "path": "pages/class/index",
"style": { "style": {
"navigationBarTitleText": "我的班级", "navigationBarTitleText": "我的班级",
"navigationStyle": "custom",
"onReachBottomDistance": 50 "onReachBottomDistance": 50
} }
}, },
...@@ -33,7 +30,6 @@ ...@@ -33,7 +30,6 @@
"path": "pages/class/addressBook", "path": "pages/class/addressBook",
"style": { "style": {
"navigationBarTitleText": "班级通讯录", "navigationBarTitleText": "班级通讯录",
"navigationStyle": "custom",
"onReachBottomDistance": 50 "onReachBottomDistance": 50
} }
}, },
...@@ -41,7 +37,6 @@ ...@@ -41,7 +37,6 @@
"path": "pages/class/classEvaluate", "path": "pages/class/classEvaluate",
"style": { "style": {
"navigationBarTitleText": "我的班级", "navigationBarTitleText": "我的班级",
"navigationStyle": "custom",
"onReachBottomDistance": 50 "onReachBottomDistance": 50
} }
}, },
...@@ -49,7 +44,6 @@ ...@@ -49,7 +44,6 @@
"path": "pages/class/evaluate", "path": "pages/class/evaluate",
"style": { "style": {
"navigationBarTitleText": "培训评价", "navigationBarTitleText": "培训评价",
"navigationStyle": "custom",
"onReachBottomDistance": 50 "onReachBottomDistance": 50
} }
}, },
...@@ -57,57 +51,57 @@ ...@@ -57,57 +51,57 @@
"path": "pages/course/index", "path": "pages/course/index",
"style": { "style": {
"navigationBarTitleText": "我的课程", "navigationBarTitleText": "我的课程",
"navigationStyle": "custom",
"onReachBottomDistance": 50 "onReachBottomDistance": 50
} }
}, },
{ {
"path": "pages/course/seeMore", "path": "pages/course/seeMore",
"style": { "style": {
"navigationBarTitleText": "查看更多", "navigationBarTitleText": "查看更多"
"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/course/attendanceDetails", "path": "pages/course/attendanceDetails",
"style": { "style": {
"navigationBarTitleText": "考勤详情", "navigationBarTitleText": "考勤详情",
"navigationStyle": "custom" "onReachBottomDistance": 50
} }
}, },
{ {
"path": "pages/setPositioning/index", "path": "pages/setPositioning/index",
"style": { "style": {
"navigationBarTitleText": "设置考勤定位", "navigationBarTitleText": "设置考勤定位"
"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/setPositioning/map", "path": "pages/setPositioning/map",
"style": { "style": {
"navigationBarTitleText": "考勤地点设置", "navigationBarTitleText": "考勤地点设置"
"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/setPositioning/setAttendance", "path": "pages/setPositioning/setAttendance",
"style": { "style": {
"navigationBarTitleText": "考勤地点设置", "navigationBarTitleText": "考勤地点设置"
"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/class/courseArrange", "path": "pages/class/courseArrange",
"style": { "style": {
"navigationBarTitleText": "课程安排", "navigationBarTitleText": "课程安排"
"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/course/pdfView", "path": "pages/course/pdfView",
"style": { "style": {
"navigationBarTitleText": "预览pdf", "navigationBarTitleText": "预览pdf"
"navigationStyle": "custom" }
},
{
"path": "pages/teachPoints/index",
"style": {
"navigationBarTitleText": "现场教学点",
"onReachBottomDistance": 50
} }
} }
], ],
......
<template> <template>
<headers title="班级通讯录" /> <!-- <headers title="班级通讯录" /> -->
<view v-if="addressBookList.length" class="address-book-item-container"> <view class="address-book-item-container">
<uni-search-bar <uni-search-bar
placeholder="姓名/单位/电话" placeholder="姓名/单位/电话"
bgColor="#ffffff" bgColor="#ffffff"
clearButton="auto" clearButton="auto"
cancelButton="none" cancelButton="none"
@confirm="search" @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"> <block v-for="(item, i) in addressBookList" :key="i">
<addressBookItem <addressBookItem
...@@ -24,10 +28,11 @@ ...@@ -24,10 +28,11 @@
<view v-else class="empty"> <view v-else class="empty">
<u-empty text="暂无数据" mode="list"></u-empty> <u-empty text="暂无数据" mode="list"></u-empty>
</view> </view>
</view>
</template> </template>
<script setup lang="ts"> <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 addressBookItem from "./components/addressBookItem.vue"
import { getClassBook } from "@/api/class" import { getClassBook } from "@/api/class"
import { useGlobalStore } from "@/store/useStore" import { useGlobalStore } from "@/store/useStore"
...@@ -39,6 +44,8 @@ const listQuery = reactive({ ...@@ -39,6 +44,8 @@ const listQuery = reactive({
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
type: 2,
Name: "",
}) })
const status = ref("loadmore") const status = ref("loadmore")
const addressBookList = ref([] as any) const addressBookList = ref([] as any)
...@@ -48,8 +55,16 @@ onLoad((options: any) => { ...@@ -48,8 +55,16 @@ onLoad((options: any) => {
init() init()
}) })
const search = (val: string) => { const search = (val: any) => {
console.log("我的同学" + val) addressBookList.value = []
listQuery.Name = val.value
init()
}
const clear = () => {
addressBookList.value = []
listQuery.Name = ""
init()
} }
const tapButton = (phone: string) => { const tapButton = (phone: string) => {
......
<template> <template>
<headers title="我的班级" /> <!-- <headers title="我的班级" /> -->
<view v-if="addressBookList.length" class="address-book-item-container"> <u-tabs
:list="tabsState.list"
:is-scroll="false"
v-model="tabsState.current"
bg-color="#f5f5f5"
@change="tabsChange"
/>
<uni-search-bar <uni-search-bar
placeholder="姓名/单位/电话" placeholder="姓名/单位/电话"
bgColor="#ffffff" bgColor="#ffffff"
clearButton="auto" clearButton="auto"
cancelButton="none" cancelButton="none"
@confirm="search" @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"> <block v-for="(item, i) in addressBookList" :key="i">
<addressBookItem <addressBookItem
:addressBookItem="item" :addressBookItem="item"
buttonTitle="查看评价" :buttonTitle="tabsState.current ? '' : '查看评价'"
@tapButton="tapButton" @tapButton="tapButton"
/> />
</block> </block>
...@@ -27,18 +36,33 @@ ...@@ -27,18 +36,33 @@
</template> </template>
<script setup lang="ts"> <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 addressBookItem from "./components/addressBookItem.vue"
import { getClassBook } from "@/api/class" import { getClassBook } from "@/api/class"
import { useGlobalStore } from "@/store/useStore" import { useGlobalStore } from "@/store/useStore"
const globalStore = useGlobalStore() const globalStore = useGlobalStore()
const listQuery = reactive({ const listQuery = reactive({
Phone: globalStore.Phone, Phone: globalStore.Phone,
classId: "", classId: "",
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
type: 0,
Name: "",
})
const tabsState = reactive({
list: [
{
name: "已评价",
},
{
name: "未评价",
},
],
current: 0,
}) })
const status = ref("loadmore") const status = ref("loadmore")
const addressBookList = ref([] as any) const addressBookList = ref([] as any)
...@@ -48,8 +72,24 @@ onLoad((options: any) => { ...@@ -48,8 +72,24 @@ onLoad((options: any) => {
init() init()
}) })
const search = (val: string) => { const search = (val: any) => {
console.log("我的同学" + val) 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) => { const tapButton = (classId: string, studentId: string) => {
...@@ -66,7 +106,6 @@ const init = async () => { ...@@ -66,7 +106,6 @@ const init = async () => {
else status.value = "nomore" else status.value = "nomore"
addressBookList.value = res.data addressBookList.value = res.data
listQuery.total = res.total listQuery.total = res.total
console.log(res.data)
} }
} }
// 上拉加载数据 // 上拉加载数据
......
...@@ -4,14 +4,17 @@ ...@@ -4,14 +4,17 @@
<template #body> <template #body>
<view class="address-book-content"> <view class="address-book-content">
<view class="left"> <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"> <view class="content">
<h4>{{ addressBookItem.stuName }}</h4> <h4>{{ addressBookItem.stuName }}</h4>
<text class="tel">{{ addressBookItem.Phone }}</text> <text class="tel">{{ addressBookItem.Phone }}</text>
<text>单位: {{ addressBookItem.stuUnit }}</text> <text>单位: {{ addressBookItem.stuUnit }}</text>
</view> </view>
</view> </view>
<u-button <u-button
v-show="buttonTitle" v-show="buttonTitle"
size="mini" size="mini"
...@@ -27,6 +30,7 @@ ...@@ -27,6 +30,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { src } from "@/utils/example" import { src } from "@/utils/example"
import { baseUrl } from "@/utils/request"
const props = defineProps({ const props = defineProps({
addressBookItem: { addressBookItem: {
......
<template> <template>
<view class='arrange-item-container'> <view class="arrange-item-container">
<h3>{{ arrangeList.date }}</h3> <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"> <u-card :show-head="false" margin="0">
<template #body> <template #body>
<view class="arrange-header"> <view class="arrange-header">
<h3>{{ arrangeList.title }}</h3> <h3>{{ arrangeItem.courseName }}</h3>
<u-button size="mini" plain :type="arrangeStatus.type">{{ arrangeStatus.detail }}</u-button> <u-button size="mini" plain :type="arrangeStatus.type">{{
arrangeStatus.detail
}}</u-button>
</view> </view>
<view class="item"> <view class="item">
<u-icon name="account" /> <u-icon name="account" />
<text>{{ arrangeList.classTeacher }}</text> <text>&nbsp;{{ arrangeItem.teachName }}</text>
</view> </view>
<view class="item"> <view class="item">
<u-icon name="map" /> <u-icon name="map" />
<text>{{ arrangeList.address }}</text> <text>&nbsp;{{ arrangeItem.classArea }}&nbsp;</text>
</view> </view>
</template> </template>
<template #foot> <template #foot>
<view class="arrange-footer"> <view class="arrange-footer" @tap="openInfo">
<u-icon name="order" /> <u-icon name="order" />
<text>课程安排</text> <text>课件资料</text>
</view> </view>
</template> </template>
</u-card> </u-card>
</view> </view>
<infoPopup
ref="infoRef"
v-model:show="show"
:courseNumber="props.arrangeItem.courseNumber"
/>
</template> </template>
<script setup lang='ts'> <script setup lang="ts">
import infoPopup from "@/pages/course/components/infoPopup.vue"
import dayjs from "dayjs"
const props = defineProps({ const props = defineProps({
arrangeList: { arrangeItem: {
type: Array, type: Array,
default: () => [] default: () => [],
} as any } as any,
}) })
const arrangeDetail = ['未开始', '上课中', '已下课'] const show = ref(false)
const infoRef = ref()
const arrangeDetail = ["上课中", "未开始", "已下课"]
const arrangeStatus = computed(() => { const arrangeStatus = computed(() => {
const statusObj = { const statusObj = {
type: '', type: "",
detail: '' detail: "",
}; }
switch (props.arrangeList.type) { switch (props.arrangeItem.courseType) {
case 0: case 0:
statusObj.type = 'warning'; statusObj.type = "warning"
break; break
case 1: case 1:
statusObj.type = 'primary'; statusObj.type = "primary"
break; break
case 2: case 2:
statusObj.type = 'info'; statusObj.type = "info"
break; break
} }
statusObj.detail = arrangeDetail[props.arrangeList.type] statusObj.detail = arrangeDetail[props.arrangeItem.courseType]
return statusObj; 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -52,7 +52,12 @@ ...@@ -52,7 +52,12 @@
</u-card> </u-card>
</view> </view>
<saveQrCode v-model="show" /> <saveQrCode
v-model="show"
:classId="classItem.classId"
:Url="classItem.Url"
@init="emits('init')"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
...@@ -69,6 +74,8 @@ const props = defineProps({ ...@@ -69,6 +74,8 @@ const props = defineProps({
}, },
}) })
const emits = defineEmits(["init"])
const show = ref(false) const show = ref(false)
const percent = computed( const percent = computed(
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<u-image <u-image
width="100%" width="100%"
height="500rpx" height="500rpx"
:src="qrCodeUrl" :src="baseUrl + '/' + Url"
ref="canvasRef" ref="canvasRef"
/> />
</view> </view>
...@@ -21,22 +21,26 @@ ...@@ -21,22 +21,26 @@
<u-button type="primary" size="medium" @tap="updateImage" <u-button type="primary" size="medium" @tap="updateImage"
>更新二维码</u-button >更新二维码</u-button
> >
<u-button type="success" size="medium" @tap="saveImage(qrCodeUrl)" <!-- <u-button type="success" size="medium" @tap="saveImage"
>保存二维码</u-button >保存二维码</u-button
> > -->
</view> </view>
</u-popup> </u-popup>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { qrCodeUrl } from "@/utils/example" import { qrCodeUrl } from "@/utils/example"
import { baseUrl } from "@/utils/request"
import { toast } from "@/utils/util" import { toast } from "@/utils/util"
import html2canvas from "html2canvas"
const props = defineProps({ const props = defineProps({
show: Boolean, show: Boolean,
classId: Number,
Url: String,
}) })
const emits = defineEmits(["init", "update:modelValue"])
const canvasRef = ref() const canvasRef = ref()
const updateImage = () => { const updateImage = () => {
...@@ -45,24 +49,45 @@ const updateImage = () => { ...@@ -45,24 +49,45 @@ const updateImage = () => {
success: (chooseImageRes) => { success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths const tempFilePaths = chooseImageRes.tempFilePaths
uni.uploadFile({ 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], filePath: tempFilePaths[0],
name: "file", name: "image",
formData: { formData: {
user: "test", classId: props.classId,
}, },
success: (uploadFileRes) => { success: ({ data }: any) => {
console.log(uploadFileRes.data) const res = JSON.parse(data)
if (res.code == 200) {
emits("update:modelValue", false)
emits("init")
toast("更新成功")
}
}, },
}) })
}, },
}) })
} }
const saveImage = (url: string) => { const saveImage = () => {
// savePic(url) downloadImage(baseUrl + "/" + props.Url)
downloadImage(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) { function downloadImage(url: string) {
const link = document.createElement("a") const link = document.createElement("a")
link.href = url link.href = url
...@@ -100,10 +125,10 @@ function downloadImage(url: string) { ...@@ -100,10 +125,10 @@ function downloadImage(url: string) {
border-top-left-radius: 10rpx; border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx; border-top-right-radius: 10rpx;
padding: 20rpx; padding: 20rpx;
display: flex; // display: flex;
.u-btn { .u-btn {
width: 45%; width: 100%;
} }
} }
</style> </style>
<template> <template>
<headers title="课程安排" /> <!-- <headers title="课程安排" /> -->
<view v-if="arrangeList.length" class="course-arrange-container"> <view class="course-arrange-container">
<view class="progress"> <view class="progress">
<text>课程进度:</text> <text>课程进度:</text>
<u-line-progress <u-line-progress
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
:height="25" :height="25"
/> />
</view> </view>
<view v-if="arrangeList.length">
<u-time-line> <u-time-line>
<u-time-line-item v-for="(item, index) in arrangeList" :key="index"> <u-time-line-item v-for="(item, index) in arrangeList" :key="index">
<template #node> <template #node>
...@@ -28,23 +29,20 @@ ...@@ -28,23 +29,20 @@
<view v-else class="empty"> <view v-else class="empty">
<u-empty text="暂无课程安排" mode="list" /> <u-empty text="暂无课程安排" mode="list" />
</view> </view>
</view>
</template> </template>
<script setup lang="ts"> <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 arrangeItem from "./components/arrangeItem.vue"
import { getCourse } from "@/api/course" import { getTeachCourse } from "@/api/course"
import { useGlobalStore } from "@/store/useStore"
const arrangeList = ref([] as any) const arrangeList = ref([] as any)
const globalStore = useGlobalStore()
const percent = ref() const percent = ref()
const listQuery = reactive({ const listQuery = reactive({
Phone: globalStore.Phone,
pageIndex: 1, pageIndex: 1,
pageSize: 999, pageSize: 10,
total: 0, total: 0,
type: 2,
classId: "", classId: "",
}) })
...@@ -68,7 +66,7 @@ onReachBottom(() => { ...@@ -68,7 +66,7 @@ onReachBottom(() => {
const init = async () => { const init = async () => {
status.value = "loading" status.value = "loading"
const { data: res } = await getCourse(listQuery) const { data: res } = await getTeachCourse(listQuery)
if (res.code == 200) { if (res.code == 200) {
if (res.total > 10) status.value = "loadmore" if (res.total > 10) status.value = "loadmore"
else status.value = "nomore" else status.value = "nomore"
...@@ -114,4 +112,7 @@ const init = async () => { ...@@ -114,4 +112,7 @@ const init = async () => {
box-shadow: 0 0 10px rgba(0, 0, 0.6, 0.412); box-shadow: 0 0 10px rgba(0, 0, 0.6, 0.412);
} }
} }
:deep(uni-modal) {
z-index: 99999 !important;
}
</style> </style>
<template> <template>
<headers title="培训评价" /> <!-- <headers title="培训评价" /> -->
<view class="evaluate-container"> <view class="evaluate-container">
<u-card :show-head="false" :show-foot="false" margin="0" border-radius="20"> <u-card :show-head="false" :show-foot="false" margin="0" border-radius="20">
<template #body> <template #body>
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
</template> </template>
<script setup lang="ts"> <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 { remarkOn, remarkDetail } from "@/api/class"
import { toast, zconfirm } from "@/utils/util" import { toast, zconfirm } from "@/utils/util"
......
<template> <template>
<headers title="我的班级" /> <!-- <headers title="我的班级" /> -->
<view class="class-container"> <view class="class-container">
<u-tabs <u-tabs
:list="tabsState.list" :list="tabsState.list"
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
bg-color="#f5f5f5" bg-color="#f5f5f5"
@change="tabsChange" @change="tabsChange"
/> />
<!-- 内容 -->
<view v-if="classList.length">
<!-- 搜索 --> <!-- 搜索 -->
<uni-search-bar <uni-search-bar
placeholder="班级名称" placeholder="班级名称"
...@@ -18,13 +15,20 @@ ...@@ -18,13 +15,20 @@
clearButton="auto" clearButton="auto"
cancelButton="none" cancelButton="none"
@confirm="search" @confirm="search"
@clear="clear"
/> />
<!-- 内容 -->
<view v-if="classList.length">
<text style="margin-bottom: 20rpx; display: block" <text style="margin-bottom: 20rpx; display: block"
>为你找到10个的班级</text >为你找到{{ listQuery.total }}个的班级</text
> >
<block v-for="(item, index) in classList" :key="index"> <block v-for="(item, index) in classList" :key="index">
<classItem :classItem="item" :current="tabsState.current" /> <classItem
:classItem="item"
:current="tabsState.current"
@init="tabsChange"
/>
</block> </block>
<view v-if="tabsState.current" style="padding: 20rpx"> <view v-if="tabsState.current" style="padding: 20rpx">
<u-loadmore :status="status" icon-type="flower" /> <u-loadmore :status="status" icon-type="flower" />
...@@ -37,7 +41,7 @@ ...@@ -37,7 +41,7 @@
</template> </template>
<script setup lang="ts"> <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 classItem from "./components/classItem.vue"
import { getClassList } from "@/api/class" import { getClassList } from "@/api/class"
import { useGlobalStore } from "@/store/useStore" import { useGlobalStore } from "@/store/useStore"
...@@ -63,23 +67,25 @@ const classList = ref([] as any) ...@@ -63,23 +67,25 @@ const classList = ref([] as any)
const listQuery = reactive({ const listQuery = reactive({
Phone: globalStore.Phone, Phone: globalStore.Phone,
type: 0, type: 1,
studentId: globalStore.studentId,
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
Name: "",
}) })
const status = ref("loadmore") const status = ref("loadmore")
const tabsChange = (index: number) => { const tabsChange = (index: number) => {
classList.value = [] classList.value = []
listQuery.pageIndex = 1
listQuery.pageSize = 10
switch (index) { switch (index) {
case 0: case 0:
listQuery.type = 0 listQuery.type = 1
break break
case 1: case 1:
listQuery.type = 1 listQuery.type = 0
break break
default: default:
listQuery.type = 2 listQuery.type = 2
...@@ -88,8 +94,14 @@ const tabsChange = (index: number) => { ...@@ -88,8 +94,14 @@ const tabsChange = (index: number) => {
init() init()
} }
const search = (val: string) => { const search = (val: any) => {
console.log("我的班级" + val) listQuery.Name = val.value
tabsChange(tabsState.current)
}
const clear = () => {
listQuery.Name = ""
tabsChange(tabsState.current)
} }
// 上拉加载数据 // 上拉加载数据
......
<template> <template>
<headers title='考勤详情' /> <!-- <headers title='考勤详情' /> -->
<div class='deatils-container'> <div class="deatils-container">
<!-- 内容 --> <uni-search-bar
<!-- 搜索 --> placeholder="课程名称/班级名称"
<uni-search-bar placeholder="课程名称/班级名称" bgColor="#ffffff" clearButton="auto" cancelButton="none" bgColor="#ffffff"
@confirm="search" /> clearButton="auto"
<view class="tag"> cancelButton="none"
<u-tag v-for="(item, i) in tagList" :key="i" :text="item.name" shape="circle" mode="plain" :type="item.type" @confirm="search"
@click="changeTagType(i)" /> @clear="clear"
</view> />
<text style="margin-bottom: 20rpx; display: block;">为你找到10个的班级</text> <!-- <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"> <block v-for="(item, index) in detailList" :key="index">
<detailsItem :courseList="item" /> <detailsItem :detailItem="item" @init="refresh" />
</block> </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" /> <u-empty text="暂无数据" mode="list" />
</view> --> </view>
</div> </div>
</template> </template>
<script setup lang='ts'> <script setup lang="ts">
import headers from '@/components/header/index.vue' import { getStateList } from "@/api/course"
import detailsItem from './components/detailsItem.vue'; import detailsItem from "./components/detailsItem.vue"
const tagList = ref([ const tagList = ref([
{ type: 'primary', name: '全部' }, { type: "primary", name: "全部" },
{ type: 'info', name: '正常' }, { type: "info", name: "正常" },
{ type: 'info', name: '缺勤' }, { type: "info", 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) => { const changeTagType = (index: number) => {
tagList.value.map((item: any, i: number) => { tagList.value.map((item: any, i: number) => {
if (index === i) item.type = 'primary' if (index === i) item.type = "primary"
else item.type = 'info' else item.type = "info"
}) })
} }
const search = (val: string) => { const search = (val: any) => {
console.log('我的课程' + val); 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.deatils-container { .deatils-container {
padding: 0 30rpx 30rpx; padding: 30rpx;
padding-top: 20rpx;
.tag { .tag {
margin-bottom: 30rpx; margin-bottom: 30rpx;
.u-tag { .u-tag {
margin-right: 20rpx; margin-right: 20rpx;
} }
} }
} }
......
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
</view> </view>
<view class="item"> <view class="item">
<u-icon name="account" /> <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> <text>&nbsp;{{ item.teachName }}&nbsp;</text>
</block> </block>
</view> </view>
<view class="item"> <view class="item">
<u-icon name="map" /> <u-icon name="map" />
<text>{{ courseItem.classArea }}</text> <text>&nbsp;{{ courseItem.classArea }}</text>
</view> </view>
<view class="item"> <view class="item">
<u-icon name="clock" /> <u-icon name="clock" />
...@@ -73,12 +73,7 @@ ...@@ -73,12 +73,7 @@
</u-col> </u-col>
<u-col span="5"> <u-col span="5">
<view class="" <view class=""
>缺勤:<text >缺勤:<text>&nbsp;{{ lackCount }}</text
>&nbsp;{{
courseItem.States[0]?.Value.lack
? courseItem.States[0]?.Value.lack
: 0
}}</text
></view ></view
> >
</u-col> </u-col>
...@@ -117,12 +112,18 @@ ...@@ -117,12 +112,18 @@
</template> </template>
</u-card> </u-card>
</view> </view>
<infoPopup v-model:show="infoState.show" /> <infoPopup
ref="infoRef"
v-model:show="infoState.show"
:courseNumber="props.courseItem.courseNumber"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import infoPopup from "./infoPopup.vue" import infoPopup from "./infoPopup.vue"
import dayjs from "dayjs" import dayjs from "dayjs"
import { useCourseStore } from "@/store/modules/courseStore"
const courseStore = useCourseStore()
const props = defineProps({ const props = defineProps({
courseItem: { courseItem: {
type: Array, type: Array,
...@@ -135,6 +136,8 @@ const props = defineProps({ ...@@ -135,6 +136,8 @@ const props = defineProps({
}) })
const emits = defineEmits(["openInfo"]) const emits = defineEmits(["openInfo"])
const infoRef = ref()
const dateFormat = (dateStr: string) => { const dateFormat = (dateStr: string) => {
// 创建一个日期对象,传入特定日期和时间 // 创建一个日期对象,传入特定日期和时间
const date = new Date(dateStr) const date = new Date(dateStr)
...@@ -151,19 +154,34 @@ const infoState = reactive({ ...@@ -151,19 +154,34 @@ const infoState = reactive({
show: false, 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 = () => { const toSeeMore = () => {
courseStore.setTeachs(props.courseItem.Management)
setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: "/pages/course/seeMore", url: "/pages/course/seeMore",
}) })
}, 300)
} }
const toAttendanceDetails = () => { const toAttendanceDetails = () => {
uni.navigateTo({ uni.navigateTo({
url: "/pages/course/attendanceDetails", url:
"/pages/course/attendanceDetails?courseId=" + props.courseItem.courseId,
}) })
} }
const openInfo = () => { const openInfo = () => {
infoState.show = true infoState.show = true
infoRef.value.init()
} }
</script> </script>
......
<template> <template>
<view class='details-item-container'> <view class="details-item-container">
<u-card :show-head="false" :show-foot="false" margin="0"> <u-card :show-head="false" :show-foot="false" margin="0">
<template #body> <template #body>
<view class="details-item-header"> <view class="details-item-header">
<h4>刘芳芳</h4> <h4>{{ detailItem.stuName }}</h4>
<text>正常出勤</text> <text :style="{ color: state.color }">{{ state.status }}</text>
</view> </view>
<view style="margin-bottom: 20rpx;"> <view style="margin-bottom: 20rpx">
<text>15611111111</text> <text>{{ detailItem.Phone }}</text>
<u-icon name="phone" style="margin-left: 10rpx;" /> <u-icon name="phone" style="margin-left: 10rpx" />
</view> </view>
<u-time-line> <u-time-line>
<u-time-line-item> <u-time-line-item>
...@@ -16,8 +16,14 @@ ...@@ -16,8 +16,14 @@
<view class="line-content"> <view class="line-content">
<text>上课签到:</text> <text>上课签到:</text>
<view class="content"> <view class="content">
<text>已签到</text> <text>{{
<text style="color: #c0c4cc">(补签原因: 个人原因)</text> singInStatus(detailItem.State[0]?.Value[0].SingIn)
}}</text>
<text
v-show="state.SingInText != ' ' && state.SingInText"
style="color: #c0c4cc"
>(请假原因: {{ state.SingInText }})</text
>
</view> </view>
</view> </view>
</template> </template>
...@@ -25,26 +31,213 @@ ...@@ -25,26 +31,213 @@
<u-time-line-item> <u-time-line-item>
<template #content> <template #content>
<view class="line-content"> <view class="line-content">
<text>上课签到</text> <text>下课签退</text>
<view class="content"> <view class="content">
<text>已签到</text> <text>{{
<text style="color: #c0c4cc">(补签原因: 个人原因)</text> singOutStatus(detailItem.State[0]?.Value[0].SingOut)
}}</text>
<text
v-show="state.SingOutText != ' ' && state.SingOutText"
style="color: #c0c4cc"
>(请假原因: {{ state.SingOutText }})</text
>
</view> </view>
</view> </view>
</template> </template>
</u-time-line-item> </u-time-line-item>
</u-time-line> </u-time-line>
<view class="footer"> <view
<u-button type="primary" size="mini" plain>请假</u-button> class="footer"
<u-button type="primary" size="mini">补签</u-button> 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> </view>
</template> </template>
</u-card> </u-card>
</view> </view>
<fillPopup
ref="fillRef"
v-model="fillState.show"
:name="detailItem.stuName"
:label="fillState.label"
@submit="submit"
/>
</template> </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> </script>
<style lang="scss" scoped> <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 @@ ...@@ -35,7 +35,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { zconfirm } from "@/utils/util" import { zconfirm } from "@/utils/util"
import { geFileList } from "@/api/course" import { getFileList } from "@/api/course"
import { baseUrl } from "@/utils/request" import { baseUrl } from "@/utils/request"
const props = defineProps({ const props = defineProps({
...@@ -80,7 +80,7 @@ const handeClose = () => { ...@@ -80,7 +80,7 @@ const handeClose = () => {
} }
const init = async () => { const init = async () => {
const { data: res } = await geFileList({ courseNumber: props.courseNumber }) const { data: res } = await getFileList({ courseNumber: props.courseNumber })
if (res.code == 200) { if (res.code == 200) {
console.log(res) console.log(res)
infoList.value = res.data 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> <template>
<headers title="我的课程" /> <!-- <headers title="我的课程" /> -->
<view class="course-container"> <view class="course-container">
<u-tabs <u-tabs
:list="tabsState.list" :list="tabsState.list"
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
bg-color="#f5f5f5" bg-color="#f5f5f5"
@change="tabsChange" @change="tabsChange"
/> />
<!-- 内容 -->
<view v-if="courseList.length">
<!-- 搜索 --> <!-- 搜索 -->
<uni-search-bar <uni-search-bar
placeholder="班级名称" placeholder="班级名称"
...@@ -18,10 +15,12 @@ ...@@ -18,10 +15,12 @@
clearButton="auto" clearButton="auto"
cancelButton="none" cancelButton="none"
@confirm="search" @confirm="search"
@clear="clear"
/> />
<!-- 内容 -->
<view v-if="courseList.length">
<text style="margin-bottom: 20rpx; display: block" <text style="margin-bottom: 20rpx; display: block"
>为你找到10个的班级</text >为你找到{{ listQuery.total }}个的班级</text
> >
<block v-for="(item, index) in courseList" :key="index"> <block v-for="(item, index) in courseList" :key="index">
...@@ -38,7 +37,7 @@ ...@@ -38,7 +37,7 @@
</template> </template>
<script setup lang="ts"> <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 courseItem from "./components/courseItem.vue"
import { getCourseList } from "@/api/course" import { getCourseList } from "@/api/course"
import { useGlobalStore } from "@/store/useStore" import { useGlobalStore } from "@/store/useStore"
...@@ -68,12 +67,15 @@ const listQuery = reactive({ ...@@ -68,12 +67,15 @@ const listQuery = reactive({
pageSize: 10, pageSize: 10,
total: 0, total: 0,
type: 0, type: 0,
Name: "",
}) })
const status = ref("loadmore") const status = ref("loadmore")
const tabsChange = (index: number) => { const tabsChange = (index: number) => {
courseList.value = [] courseList.value = []
listQuery.pageIndex = 1
listQuery.pageSize = 10
switch (index) { switch (index) {
case 0: case 0:
listQuery.type = 0 listQuery.type = 0
...@@ -88,8 +90,14 @@ const tabsChange = (index: number) => { ...@@ -88,8 +90,14 @@ const tabsChange = (index: number) => {
init() init()
} }
const search = (val: string) => { const search = (val: any) => {
console.log("我的班级" + val) listQuery.Name = val.value
tabsChange(tabsState.current)
}
const clear = () => {
listQuery.Name = ""
tabsChange(tabsState.current)
} }
// 上拉加载数据 // 上拉加载数据
...@@ -111,7 +119,6 @@ const init = async () => { ...@@ -111,7 +119,6 @@ const init = async () => {
else status.value = "nomore" else status.value = "nomore"
courseList.value = [...courseList.value, ...res.data] courseList.value = [...courseList.value, ...res.data]
listQuery.total = res.total listQuery.total = res.total
console.log(courseList.value)
} }
} }
...@@ -132,4 +139,7 @@ init() ...@@ -132,4 +139,7 @@ init()
margin-right: 20rpx; margin-right: 20rpx;
} }
} }
:deep(uni-modal) {
z-index: 99999 !important;
}
</style> </style>
<template> <template>
<headers :title="pdfState.title" /> <!-- <headers :title="pdfState.title" /> -->
<view class="pdf-container"> <view class="pdf-container">
<web-view class="webview" :src="pdfState.pdfUrl"></web-view> <web-view class="webview" :src="pdfState.pdfUrl"></web-view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import headers from "@/components/header/index.vue" // import headers from "@/components/header/index.vue"
const pdfState = reactive({ const pdfState = reactive({
title: "", title: "",
...@@ -19,6 +19,12 @@ onLoad((options: any) => { ...@@ -19,6 +19,12 @@ onLoad((options: any) => {
pdfState.pdfUrl = pdfState.pdfUrl =
pdfState.viewerUrl + "?file=" + encodeURIComponent(options.url) pdfState.viewerUrl + "?file=" + encodeURIComponent(options.url)
}) })
onReady(() => {
uni.setNavigationBarTitle({
title: pdfState.title,
})
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<template> <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"> <u-card :show-head="false" :show-foot="false" margin="0">
<template #body> <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"> <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"> <view class="info-text">
<text>王少龙</text> <text>{{ item.teachName }}</text>
<text>教授</text> <text>{{ item.teachTle }}</text>
</view> </view>
</view> </view>
<view class="detail"> <view class="detail">
Lorem ipsum dolor sit amet, consecteturadipiscing elit. Aenean euismod bibendumlaoreet. Proin {{ item.teachMsg }}
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.
</view> </view>
</template> </template>
</u-card> </u-card>
<u-card :show-head="false" :show-foot="false" margin="0"> <u-card :show-head="false" :show-foot="false" margin="0">
<template #body> <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"> <view class="detail">
Lorem ipsum dolor sit amet, consecteturadipiscing elit. Aenean euismod bibendumlaoreet. Proin {{ item.courseMsg }}
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.
</view> </view>
</template> </template>
</u-card> </u-card>
</block>
</view> </view>
</template> </template>
<script setup lang='ts'> <script setup lang="ts">
import headers from '@/components/header/index.vue' import { useCourseStore } from "@/store/modules/courseStore"
import { src } from '@/utils/example'; import { src } from "@/utils/example"
const courseStore = useCourseStore()
const Teachs = computed(() => courseStore.getTeachs)
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -66,10 +80,10 @@ import { src } from '@/utils/example'; ...@@ -66,10 +80,10 @@ import { src } from '@/utils/example';
} }
.detail { .detail {
text-indent: 2.5em; text-indent: 1em;
margin-top: 30rpx; margin-top: 30rpx;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 32rpx; font-size: 28rpx;
line-height: 1.25; line-height: 1.25;
} }
} }
......
<template> <template>
<headers title='西部人力培训中心' backIconName="close" /> <!-- <headers title='西部人力培训中心' backIconName="close" /> -->
<view class="home-container"> <view class="home-container">
<!-- 用户信息部分 --> <!-- 用户信息部分 -->
<view class="user-info"> <view class="user-info">
<u-image width="260rpx" height="260rpx" :src="src" border-radius="30" /> <u-image
<text class="name">小美</text> width="260rpx"
height="260rpx"
:src="baseUrl + '/' + globalStore.infoData.Image"
border-radius="30"
/>
<text class="name">{{ globalStore.infoData.Name }}</text>
<view class="info"> <view class="info">
<text>宝安研发部</text> <text>{{
<u-line color="#eee" direction="col" length="30rpx" :hair-line="false" margin="0 20rpx" /> globalStore.infoData.Type == "BZR" ? "班主任" : "讲师"
<text>开发人员</text> }}</text>
</view> </view>
</view> </view>
...@@ -17,7 +22,7 @@ ...@@ -17,7 +22,7 @@
<view class="content"> <view class="content">
<u-grid :col="3"> <u-grid :col="3">
<u-grid-item @tap="toClass"> <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> <u-icon name="man-add-fill" :size="53"></u-icon>
<view class="grid-text">管理班级</view> <view class="grid-text">管理班级</view>
</u-grid-item> </u-grid-item>
...@@ -26,34 +31,46 @@ ...@@ -26,34 +31,46 @@
<view class="grid-text">我的课程</view> <view class="grid-text">我的课程</view>
</u-grid-item> </u-grid-item>
<u-grid-item @tap="toSetPositioning"> <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> <u-icon name="list-dot" :size="53"></u-icon>
<view class="grid-text">设置考勤定位</view> <view class="grid-text">设置考勤定位</view>
</u-grid-item> </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> </u-grid>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script setup lang='ts'> <script setup lang="ts">
import headers from '@/components/header/index.vue' // import headers from '@/components/header/index.vue'
import { src } from '@/utils/example' import { useGlobalStore } from "@/store/useStore"
import { baseUrl } from "@/utils/request"
const globalStore = useGlobalStore()
const toClass = () => { const toClass = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/class/index' url: "/pages/class/index",
}) })
} }
const toCourse = () => { const toCourse = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/course/index' url: "/pages/course/index",
}) })
} }
const toSetPositioning = () => { const toSetPositioning = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/setPositioning/index' url: "/pages/setPositioning/index",
})
}
const toTeachPoints = () => {
uni.navigateTo({
url: "/pages/teachPoints/index",
}) })
} }
</script> </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> <template>
<headers title="西部人力培训中心" backIconName="close" />
<view style="box-sizing: border-box">
<view class="login-container"> <view class="login-container">
<text class="login-text">欢迎登陆</text> <u-form :model="data.formData" ref="form" label-width="150">
<loginForm /> <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>
</view> </view>
<h4>{{ "用户code:" + code + "---" + Msg }}</h4>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import headers from "@/components/header/index.vue" import { useGlobalStore } from "@/store/useStore"
import loginForm from "./components/loginForm.vue" import { Login } from "./interface/index"
import { getUrlCode } from "@/utils/util" import { teachLogin } from "@/api/login"
import { getUserInfo } from "@/api/login" import { toast } from "@/utils/util";
const Msg = ref() const globalStore = useGlobalStore()
const code = ref()
onLoad(async () => { const form = ref()
code.value = getUrlCode().code const uniA: any = uni
const url = const data = reactive({
"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" formData: {
if (code.value) { Phone: "",
const res = await getUserInfo(code.value) Password: "",
Msg.value = JSON.stringify(res) } as Login.LoginForm,
alert(JSON.stringify(res)) rules: {
// if (res.code == 200) { Phone: [
// alert(JSON.stringify(res.data)) {
// } required: true,
} message: "请输入手机号",
// else location.href = url 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> onReady(() => {
:deep(uni-page-wrapper) { form.value.setRules(data.rules)
background-color: #fff; })
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) { <style lang="scss" scoped>
padding: 0 6rpx; page {
box-sizing: border-box; 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 { .login-container {
box-sizing: border-box; padding: 30rpx;
padding-top: 20%; position: absolute;
display: flex; top: 25%;
justify-content: center; left: 5%;
align-items: center; width: 90vw;
flex-direction: column;
background-color: #fff; background-color: #fff;
border-radius: 15rpx;
.login-text { .footer {
margin-top: 10%; display: flex;
font-weight: 700; margin-top: 30rpx;
font-size: 40rpx;
color: #1d2b5f;
} }
} }
</style> </style>
export namespace Login { export namespace Login {
export interface LoginForm { export interface LoginForm {
username: string, Phone: string
password: string Password: string
} }
} }
...@@ -11,14 +11,18 @@ ...@@ -11,14 +11,18 @@
<view class="item"> <view class="item">
<text <text
>考勤定位:{{ >考勤定位:{{
positionItem.isSetPosition ? "已设置" : "未设置" positionItem.StateType ? positionItem.hitArea : "未设置"
}}</text }}</text
> >
</view> </view>
<view class="item"> <view class="item">
<text <text
>应用范围:{{ >应用范围:{{
positionItem.range ? positionItem.range + "米" : "未设置" positionItem.type
? positionItem.type
? "同步班级所有课程的考勤定位"
: "仅当前课程考勤定位"
: "未设置"
}}</text }}</text
> >
</view> </view>
...@@ -52,11 +56,9 @@ const props = defineProps({ ...@@ -52,11 +56,9 @@ const props = defineProps({
const mapStore = useMapStore() const mapStore = useMapStore()
const openMap = () => { const openMap = () => {
mapStore.setMapData(props.positionItem)
uni.navigateTo({ uni.navigateTo({
url: "/pages/setPositioning/map", url: "/pages/setPositioning/map",
success() {
mapStore.setMapData(props.positionItem)
}
}) })
} }
</script> </script>
......
<template> <template>
<headers title="设置考勤定位" /> <!-- <headers title="设置考勤定位" /> -->
<div class="set-position-container"> <div class="set-position-container">
<u-tabs <u-tabs
:list="tabsState.list" :list="tabsState.list"
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
bg-color="#f5f5f5" bg-color="#f5f5f5"
@change="tabsChange" @change="tabsChange"
/> />
<!-- 内容 -->
<view v-if="positionList.length">
<!-- 搜索 --> <!-- 搜索 -->
<uni-search-bar <uni-search-bar
placeholder="课程名称/班级名称" placeholder="课程名称/班级名称"
...@@ -17,10 +15,12 @@ ...@@ -17,10 +15,12 @@
clearButton="auto" clearButton="auto"
cancelButton="none" cancelButton="none"
@confirm="search" @confirm="search"
@clear="clear"
/> />
<!-- 内容 -->
<view v-if="positionList.length">
<text style="margin-bottom: 20rpx; display: block" <text style="margin-bottom: 20rpx; display: block"
>为你找到10个的课程</text >为你找到{{ listQuery.total }} 个的课程</text
> >
<block v-for="(item, index) in positionList" :key="index"> <block v-for="(item, index) in positionList" :key="index">
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</template> </template>
<script setup lang="ts"> <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 setPositionItem from "./components/setPositionItem.vue"
import { getLocationList } from "@/api/position" import { getLocationList } from "@/api/position"
import { useGlobalStore } from "@/store/useStore" import { useGlobalStore } from "@/store/useStore"
...@@ -63,6 +63,7 @@ const listQuery = reactive({ ...@@ -63,6 +63,7 @@ const listQuery = reactive({
pageSize: 10, pageSize: 10,
total: 0, total: 0,
type: 0, type: 0,
Name: "",
}) })
const status = ref("loadmore") const status = ref("loadmore")
const tabsChange = (index: number) => { const tabsChange = (index: number) => {
...@@ -75,8 +76,14 @@ const tabsChange = (index: number) => { ...@@ -75,8 +76,14 @@ const tabsChange = (index: number) => {
init() init()
} }
const search = (val: string) => { const search = (val: any) => {
console.log("我的课程" + val) listQuery.Name = val.value
init()
}
const clear = () => {
listQuery.Name = ""
init()
} }
// 上拉加载数据 // 上拉加载数据
...@@ -98,11 +105,13 @@ const init = async () => { ...@@ -98,11 +105,13 @@ const init = async () => {
else status.value = "nomore" else status.value = "nomore"
positionList.value = [...positionList.value, ...res.data] positionList.value = [...positionList.value, ...res.data]
listQuery.total = res.total listQuery.total = res.total
console.log(positionList.value) // console.log(positionList.value)
} }
} }
init() onShow(() => {
tabsChange(tabsState.current)
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<template> <template>
<headers title="考勤地点设置" :is-button="false" @submit="submit" /> <!-- <headers title="考勤地点设置" :is-button="false" @submit="submit" /> -->
<view v-if="flag" class="map"> <view v-if="flag" class="map">
<iframe id="mapPage" width="100%" height="100%" frameborder="0" :src="src"> <iframe id="mapPage" width="100%" height="100%" frameborder="0" :src="src">
</iframe> </iframe>
<view class="complete">
<u-button
type="primary"
size="mini"
@tap="submit"
style="margin-right: 30rpx"
>下一步</u-button
>
</view>
</view> </view>
</template> </template>
...@@ -49,14 +58,19 @@ const submit = () => { ...@@ -49,14 +58,19 @@ const submit = () => {
}) })
}, },
}) })
// zconfirm("确定设置为该地址?", (result: boolean) => { setTimeout(function () {
// if (result) { console.log(mapStore.mapData, "mapStore.mapData")
// } }, 10)
// })
} }
onMounted(() => { onMounted(() => {
if (mapStore.mapData.StateType) { 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 { } else {
uni.getLocation({ uni.getLocation({
type: "gcj02", type: "gcj02",
...@@ -64,10 +78,9 @@ onMounted(() => { ...@@ -64,10 +78,9 @@ onMounted(() => {
console.log(res) console.log(res)
state.coord = res.latitude + "," + res.longitude 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` 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(() => { setTimeout(() => {
flag.value = true flag.value = true
}, 1000) }, 300)
}, },
}) })
} }
...@@ -82,8 +95,8 @@ onMounted(() => { ...@@ -82,8 +95,8 @@ onMounted(() => {
.complete { .complete {
position: absolute; position: absolute;
top: 5%; top: 5.5%;
right: 10rpx; right: -3%;
} }
} }
</style> </style>
<template> <template>
<headers title="考勤地点设置" /> <!-- <headers title="考勤地点设置" /> -->
<view class="set-attendance-container"> <view class="set-attendance-container">
<h3>考勤地点设置</h3> <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-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>
<u-form-item label="有效范围" prop="F_LQKJ_SCOPE" <u-form-item label="有效范围" prop="F_LQKJ_SCOPE"
><u-input ><u-input
type="select" type="select"
v-model="data.formData.F_LQKJ_SCOPE" v-model="data.parmeters.F_LQKJ_SCOPE"
@tap="data.show = true" @tap="data.show = true"
/></u-form-item> /></u-form-item>
<u-form-item label="请设置定位的应用范围" prop=""> <u-form-item label="请设置定位的应用范围" prop="">
<u-radio-group v-model="data.formData.scope" shape="square"> <u-radio-group v-model="data.parmeters.type" shape="square">
<u-radio :name="0">仅当前课程考勤定位 </u-radio> <u-radio name="0">仅当前课程考勤定位 </u-radio>
<u-radio :name="1">同步班级所有课程的考勤定位 </u-radio> <u-radio name="1">同步班级所有课程的考勤定位 </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
</u-form> </u-form>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import headers from "@/components/header/index.vue" // import headers from "@/components/header/index.vue"
import { setAddr } from "@/api/position" import { setAddr } from "@/api/position"
import { toast } from "@/utils/util" import { toast } from "@/utils/util"
import { useMapStore } from "@/store/modules/mapStore" import { useMapStore } from "@/store/modules/mapStore"
...@@ -44,12 +44,13 @@ const mapStore = useMapStore() ...@@ -44,12 +44,13 @@ const mapStore = useMapStore()
const formRef = ref() const formRef = ref()
const data = reactive({ const data = reactive({
formData: { parmeters: {
F_LQKJ_LONGITUDE: "", F_LQKJ_LONGITUDE: "",
F_LQKJ_SCOPE: "", F_LQKJ_SCOPE: "",
FCOURSEID: 0, FCOURSEID: 0,
scope: 0, type: 0,
F_LQKJ_HITAREA: "", F_LQKJ_HITAREA: "",
classId: "",
}, },
rules: { rules: {
F_LQKJ_HITAREA: [ F_LQKJ_HITAREA: [
...@@ -111,8 +112,7 @@ const back = () => { ...@@ -111,8 +112,7 @@ const back = () => {
const submit = () => { const submit = () => {
formRef.value.validate(async (valid: any) => { formRef.value.validate(async (valid: any) => {
if (valid) { if (valid) {
console.log(data.formData) const { data: res } = await setAddr({ parmeters: data.parmeters })
const { data: res } = await setAddr(data.formData)
if (res.code == 200) { if (res.code == 200) {
uni.navigateBack({ delta: 2 }) uni.navigateBack({ delta: 2 })
toast("设置成功") toast("设置成功")
...@@ -123,16 +123,18 @@ const submit = () => { ...@@ -123,16 +123,18 @@ const submit = () => {
} }
const onConfirm = (item: any) => { const onConfirm = (item: any) => {
data.formData.F_LQKJ_SCOPE = item[0].value data.parmeters.F_LQKJ_SCOPE = item[0].value
} }
onReady(() => { onReady(() => {
formRef.value.setRules(data.rules) formRef.value.setRules(data.rules)
setTimeout(() => { setTimeout(() => {
data.formData.F_LQKJ_HITAREA = mapStore.mapData.hitArea data.parmeters.F_LQKJ_HITAREA = mapStore.mapData.hitArea
data.formData.F_LQKJ_LONGITUDE = mapStore.mapData.Longitude data.parmeters.F_LQKJ_LONGITUDE = mapStore.mapData.Longitude
data.formData.F_LQKJ_SCOPE = mapStore.mapData.Scope data.parmeters.F_LQKJ_SCOPE = mapStore.mapData.Scope
data.formData.FCOURSEID = mapStore.mapData.courseId data.parmeters.FCOURSEID = mapStore.mapData.courseId
data.parmeters.type = mapStore.mapData.type
data.parmeters.classId = mapStore.mapData.classId
console.log(mapStore.mapData) console.log(mapStore.mapData)
}, 100) }, 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({ ...@@ -7,9 +7,7 @@ export const useGlobalStore = defineStore({
state() { state() {
return { return {
Phone: "", Phone: "",
studentNumber: "", infoData: {} as any,
studentId: "",
openId: "",
} }
}, },
getters: {}, getters: {},
...@@ -17,11 +15,8 @@ export const useGlobalStore = defineStore({ ...@@ -17,11 +15,8 @@ export const useGlobalStore = defineStore({
setPhone(Phone: string) { setPhone(Phone: string) {
this.Phone = Phone this.Phone = Phone
}, },
setStudentNumber(studentNumber: string) { setInfoData(infoData: string) {
this.studentNumber = studentNumber this.infoData = infoData
},
setStudentId(studentId: string) {
this.studentId = studentId
}, },
}, },
persist: piniaPersistOption("globalStore"), persist: piniaPersistOption("globalStore"),
......
...@@ -2,7 +2,7 @@ import config from "./config" ...@@ -2,7 +2,7 @@ import config from "./config"
// export const baseUrl = "/k3cloud" // export const baseUrl = "/k3cloud"
// 部署到iis上用的 // 部署到iis上用的
// export const baseUrl = "https://weixin.lingqingkeji.com:86/k3cloud" // export const baseUrl = "https://weixin3.lingqingkeji.com/k3cloud"
export const baseUrl = "/XiBU" export const baseUrl = "/XiBU"
// 封装公共申请办法 // 封装公共申请办法
......
...@@ -109,17 +109,3 @@ export const jsonp = function (url: any, data: any) { ...@@ -109,17 +109,3 @@ export const jsonp = function (url: any, data: any) {
document.body.appendChild(scriptNode) 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论