提交 d0cf9173 authored 作者: 刘旭's avatar 刘旭

更新代码

上级 9f0dc82d
import request from "@/utils/request" import request from "@/utils/request";
/** /**
* @brief 查询我的课程 * @brief 查询我的课程
...@@ -11,7 +11,7 @@ export const getTeachCourse = (data?: any) => ...@@ -11,7 +11,7 @@ export const getTeachCourse = (data?: any) =>
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.TeachCoursDetail,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc", "/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.TeachCoursDetail,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST", "POST",
data data
) );
/** /**
* @brief 查询我的课程 * @brief 查询我的课程
...@@ -24,7 +24,7 @@ export const getCourseList = (data?: any) => ...@@ -24,7 +24,7 @@ export const getCourseList = (data?: any) =>
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.TeachAndCourse,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc", "/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.TeachAndCourse,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST", "POST",
data data
) );
/** /**
* @brief 查询讲师介绍和课程介绍 * @brief 查询讲师介绍和课程介绍
...@@ -37,7 +37,7 @@ export const getTeachDetail = (data?: any) => ...@@ -37,7 +37,7 @@ export const getTeachDetail = (data?: any) =>
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.TeachDetail,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc", "/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.TeachDetail,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST", "POST",
data data
) );
/** /**
* @brief 签到签退 * @brief 签到签退
...@@ -49,7 +49,7 @@ export const signInAndOut = (data?: any) => ...@@ -49,7 +49,7 @@ export const signInAndOut = (data?: any) =>
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiEditService.ClockId,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc", "/LQKJ.K3.PeiXunSystem.WebApi.WebApiEditService.ClockId,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST", "POST",
data data
) );
/** /**
* @brief 查看附件 * @brief 查看附件
...@@ -61,7 +61,7 @@ export const getFileList = (data?: any) => ...@@ -61,7 +61,7 @@ export const getFileList = (data?: any) =>
"/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 查看附件 * @brief 查看附件
* @param data * @param data
...@@ -72,4 +72,15 @@ export const getStateList = (data?: any) => ...@@ -72,4 +72,15 @@ export const getStateList = (data?: any) =>
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.StateList,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc", "/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.StateList,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST", "POST",
data data
) );
/**
* @brief 开放签退
* @param data
* @return
*/
export const teacOpenQT = (FCOURSEID: string) =>
request(
"/LQKJ.K3.PeiXunSystem.WebApi.WebApiService.TeacOpenQT,LQKJ.K3.PeiXunSystem.WebApi.common.kdsvc",
"POST",
{ FCOURSEID }
);
{ {
"name" : "wms测试", "name": "wms测试",
"appid" : "__UNI__6D85B85", "appid": "__UNI__6D85B85",
"description" : "", "description": "",
"versionName" : "1.0.1", "versionName": "1.0.1",
"versionCode" : "100", "versionCode": "100",
"transformPx" : false, "transformPx": false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus": {
"usingComponents" : true, "usingComponents": true,
"nvueStyleCompiler" : "uni-app", "nvueStyleCompiler": "uni-app",
"compilerVersion" : 3, "compilerVersion": 3,
"splashscreen" : { "splashscreen": {
"alwaysShowBeforeRender" : true, "alwaysShowBeforeRender": true,
"waiting" : true, "waiting": true,
"autoclose" : true, "autoclose": true,
"delay" : 0 "delay": 0
},
"compatible" : {
"ignoreVersion" : true
},
/* 模块配置 */
"modules" : {
"Bluetooth" : {},
"Barcode" : {},
"Geolocation" : {},
"Webview-x5" : {}
},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_PRIVILEGED\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
],
"minSdkVersion" : 21
},
/* ios打包配置 */
"ios" : {
"dSYMs" : false
},
/* SDK配置 */
"sdkConfigs" : {
"ad" : {},
"geolocation" : {
"system" : {
"__platform__" : [ "android" ]
}
}
}
}
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx3c4c615b24d3b72b",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
}, },
"mp-baidu" : { "compatible": {
"usingComponents" : true "ignoreVersion": true
}, },
"mp-toutiao" : { /* 模块配置 */
"usingComponents" : true "modules": {
"Bluetooth": {},
"Barcode": {},
"Geolocation": {},
"Webview-x5": {}
}, },
"uniStatistics" : { /* 应用发布信息 */
"enable" : false, "distribute": {
"version" : "2" /* android打包配置 */
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_PRIVILEGED\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
],
"minSdkVersion": 21
},
/* ios打包配置 */
"ios": {
"dSYMs": false
},
/* SDK配置 */
"sdkConfigs": {
"ad": {},
"geolocation": {
"system": {
"__platform__": ["android"]
}
}
}
}
},
/* 快应用特有相关 */
"quickapp": {},
/* 小程序特有相关 */
"mp-weixin": {
"appid": "wx3c4c615b24d3b72b",
"setting": {
"urlCheck": false
}, },
"vueVersion" : "3", "usingComponents": true
"h5" : { },
"template" : "index.html", "mp-alipay": {
"sdkConfigs" : { "usingComponents": true
"maps" : { },
"qqmap" : { "mp-baidu": {
"key" : "3M5BZ-SFCRJ-AHSF7-XRA5Q-Y6NIJ-DXBH4" "usingComponents": true
} },
} "mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false,
"version": "2"
},
"vueVersion": "3",
"h5": {
"template": "index.html",
"sdkConfigs": {
"maps": {
"qqmap": {
"key": "3M5BZ-SFCRJ-AHSF7-XRA5Q-Y6NIJ-DXBH4"
} }
}
} }
}
} }
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<addressBookItem <addressBookItem
:addressBookItem="item" :addressBookItem="item"
buttonTitle="" buttonTitle=""
@tapButton="tapButton" @tapButton="callPhone"
/> />
</block> </block>
<view style="padding: 20rpx"> <view style="padding: 20rpx">
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
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";
import { callPhone } from "@/utils/util";
const globalStore = useGlobalStore(); const globalStore = useGlobalStore();
const listQuery = reactive({ const listQuery = reactive({
...@@ -69,10 +70,6 @@ const clear = () => { ...@@ -69,10 +70,6 @@ const clear = () => {
init(); init();
}; };
const tapButton = (phone: string) => {
location.href = "tel:" + phone;
};
const init = async () => { const init = async () => {
status.value = "loading"; status.value = "loading";
const { data: res } = await getClassBook(listQuery); const { data: res } = await getClassBook(listQuery);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { baseUrl } from "@/utils/request"; import { baseUrl } from "@/utils/request";
import { callPhone } from "@/utils/util";
const props = defineProps({ const props = defineProps({
addressBookItem: { addressBookItem: {
...@@ -50,7 +51,7 @@ const props = defineProps({ ...@@ -50,7 +51,7 @@ const props = defineProps({
const emits = defineEmits(["tapButton"]); const emits = defineEmits(["tapButton"]);
const tapButton = () => { const tapButton = () => {
console.log(props.buttonTitle); // console.log(props.buttonTitle);
if (props.buttonTitle) { if (props.buttonTitle) {
emits( emits(
"tapButton", "tapButton",
...@@ -58,7 +59,7 @@ const tapButton = () => { ...@@ -58,7 +59,7 @@ const tapButton = () => {
props.addressBookItem.studentId props.addressBookItem.studentId
); );
} else { } else {
location.href = "tel:" + props.addressBookItem.Phone; callPhone(props.addressBookItem.Phone);
// emits("tapButton", props.addressBookItem.Phone); // emits("tapButton", props.addressBookItem.Phone);
} }
}; };
......
...@@ -17,9 +17,7 @@ ...@@ -17,9 +17,7 @@
</view> </view>
<view class="item" style="margin: 32rpx 0 24rpx"> <view class="item" style="margin: 32rpx 0 24rpx">
<u-icon size="32" name="account" /> <u-icon size="32" name="account" />
<text v-for="(item, i) in arrangeItem.Teachs" :key="i"> &nbsp;{{ arrangeItem.teachName }}&nbsp;
&nbsp;{{ item.teachName }}&nbsp;
</text>
</view> </view>
<view class="item"> <view class="item">
<u-icon size="32" name="map" /> <u-icon size="32" name="map" />
...@@ -31,7 +29,7 @@ ...@@ -31,7 +29,7 @@
<u-badge <u-badge
type="error" type="error"
size="mini" size="mini"
:count="6" :count="arrangeItem.FileCount"
:offset="[-4, -4]" :offset="[-4, -4]"
></u-badge> ></u-badge>
<u-icon <u-icon
...@@ -42,13 +40,9 @@ ...@@ -42,13 +40,9 @@
@tap="openInfo" @tap="openInfo"
></u-icon> ></u-icon>
</view> </view>
<view class="desc">课程资料{{ arrangeItem.FileCount }}</view> <view class="desc">课程资料</view>
</view> </view>
<view <view :class="arrangeStatus.type" class="body-right">
:type="arrangeStatus.type"
:class="arrangeStatus.type"
class="body-right"
>
{{ arrangeStatus.detail }} {{ arrangeStatus.detail }}
</view> </view>
</view> </view>
...@@ -154,8 +148,8 @@ const openInfo = () => { ...@@ -154,8 +148,8 @@ const openInfo = () => {
right: -29rpx; right: -29rpx;
text-align: center; text-align: center;
font-size: 24rpx; font-size: 24rpx;
color: #2979ff; color: #05a8ff;
background: #e4e4e4; background: #ddf3ff;
border-radius: 24rpx 0rpx 24rpx 0rpx; border-radius: 24rpx 0rpx 24rpx 0rpx;
padding: 4rpx 16rpx; padding: 4rpx 16rpx;
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<view class="class-progress item"> <view class="class-progress item">
<text>课程进度:</text> <text>课程进度:</text>
<u-line-progress <u-line-progress
active-color="#5363ff" active-color="#04a7ff"
:percent="percent ? percent : 0" :percent="percent ? percent : 0"
:show-percent="false" :show-percent="false"
:height="20" :height="20"
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
v-for="(item, index) in classItem.Management" v-for="(item, index) in classItem.Management"
:key="index" :key="index"
class="btn" class="btn"
@tap="contact(item.teacPhone)" @tap="callPhone(item.teachPhone)"
> >
<u-image src="../../../static/img/phone.png" /> <u-image src="../../../static/img/phone.png" />
<view>{{ item.teachName }}</view> <view>{{ item.teachName }}</view>
...@@ -56,21 +56,9 @@ ...@@ -56,21 +56,9 @@
</template> </template>
<template #foot> <template #foot>
<view class="class-footer"> <view class="class-footer">
<!-- @tap="toAddressBook" --> <view class="info-button" @tap="classQrCode"> 班级二维码 </view>
<u-button size="mini" shape="circle" @tap="toEvaluate" <view class="info-button" @tap="toEvaluate"> 班级通讯录 </view>
>班级通讯录</u-button <view class="button" @tap="toCourseArrange"> 课程安排 </view>
>
<u-button size="mini" shape="circle" @tap="classQrCode"
>班级二维码</u-button
>
<u-button
size="mini"
shape="circle"
hover-class="background-color: #04a7ff; color: #ffffff"
style="background-color: #04a7ff; color: #ffffff"
@tap="toCourseArrange"
>课程安排</u-button
>
</view> </view>
</template> </template>
</u-card> </u-card>
...@@ -85,6 +73,7 @@ ...@@ -85,6 +73,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { callPhone } from "@/utils/util";
import saveQrCode from "./saveQrCode.vue"; import saveQrCode from "./saveQrCode.vue";
const props = defineProps({ const props = defineProps({
...@@ -228,10 +217,24 @@ const contact = (tel: string) => { ...@@ -228,10 +217,24 @@ const contact = (tel: string) => {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
font-size: 28rpx;
font-weight: 400;
.u-btn { .button {
height: 56rpx; padding: 8rpx 24rpx;
margin: 0 16rpx 0 0; background: #04a7ff;
border-radius: 88rpx;
font-size: 28rpx;
font-weight: 400;
color: #ffffff;
}
.info-button {
padding: 8rpx 24rpx;
border-radius: 112rpx;
border: 2rpx solid rgba(0, 0, 0, 0.1);
color: rgba(34, 34, 34, 0.9);
margin-right: 16rpx;
} }
} }
} }
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<view class="title">班级二维码</view> <view class="title">班级二维码</view>
<view class="image"> <view class="image">
<u-image width="100%" height="100%" :src="baseUrl + '/' + Url" /> <u-image width="100%" height="100%" :src="baseUrl + '/' + Url" />
<view class="refresh" @tap="updateImage"> <!-- <view class="refresh" @tap="updateImage">
<u-icon name="reload" color="#000000" size="32"></u-icon> <u-icon name="reload" color="#000000" size="32"></u-icon>
</view> </view> -->
</view> </view>
<view class="detail" <view class="detail"
><text ><text
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="course-arrange-progress"> <view class="course-arrange-progress">
<text>课程进行:</text> <text>课程进行:</text>
<u-line-progress <u-line-progress
active-color="#5363ff" active-color="#04a7ff"
:percent="percent ? percent : 0" :percent="percent ? percent : 0"
:show-percent="false" :show-percent="false"
:height="20" :height="20"
......
...@@ -107,9 +107,9 @@ ...@@ -107,9 +107,9 @@
<script setup lang="ts"> <script setup lang="ts">
// import headers from "@/components/header/index.vue" // import headers from "@/components/header/index.vue"
import { remarkDetail } from "@/api/class" import { remarkDetail } from "@/api/class";
const disabled = ref(false) const disabled = ref(false);
const evaluateData = reactive({ const evaluateData = reactive({
parmeters: { parmeters: {
IsDeleteEntry: "false", IsDeleteEntry: "false",
...@@ -137,29 +137,29 @@ const evaluateData = reactive({ ...@@ -137,29 +137,29 @@ const evaluateData = reactive({
FClassService: 0, //班主任服务 FClassService: 0, //班主任服务
}, },
}, },
}) });
onLoad(async (options: any) => { onLoad(async (options: any) => {
evaluateData.parmeters.Model.FClass.FNUMBER = options.classNumber evaluateData.parmeters.Model.FClass.FNUMBER = options.classNumber;
let data = { let data = {
classId: options.classId, classId: options.classId,
studentId: options.studentId, studentId: options.studentId,
courseId: "", courseId: "",
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
} };
const { data: res } = await remarkDetail(data) const { data: res } = await remarkDetail(data);
if (res.code == 200) { if (res.code == 200) {
evaluateData.parmeters.Model.FClassService = res.data[0].FCLASSSERVICE evaluateData.parmeters.Model.FClassService = res.data[0].FCLASSSERVICE;
evaluateData.parmeters.Model.FContent = res.data[0].FCONTENT evaluateData.parmeters.Model.FContent = res.data[0].FCONTENT;
evaluateData.parmeters.Model.FLecturer = res.data[0].LECTURER evaluateData.parmeters.Model.FLecturer = res.data[0].LECTURER;
evaluateData.parmeters.Model.FPostService = res.data[0].FPOSTSERVICE evaluateData.parmeters.Model.FPostService = res.data[0].FPOSTSERVICE;
evaluateData.parmeters.Model.FHighlights = res.data[0].FHIGHLIGHTS evaluateData.parmeters.Model.FHighlights = res.data[0].FHIGHLIGHTS;
evaluateData.parmeters.Model.FSupplement = res.data[0].FSUPPLEMENT evaluateData.parmeters.Model.FSupplement = res.data[0].FSUPPLEMENT;
evaluateData.parmeters.Model.FOpinion = res.data[0].FOPINION evaluateData.parmeters.Model.FOpinion = res.data[0].FOPINION;
disabled.value = true disabled.value = true;
} }
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -185,14 +185,14 @@ onLoad(async (options: any) => { ...@@ -185,14 +185,14 @@ onLoad(async (options: any) => {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 20rpx; margin-bottom: 20rpx;
text-align: justify;
text-align-last: justify;
/*兼容ie*/
text-justify: distribute-all-lines;
h4 { h4 {
width: 140rpx; width: 140rpx;
margin-right: 20rpx; margin-right: 20rpx;
text-align: justify;
text-align-last: justify;
/*兼容ie*/
text-justify: distribute-all-lines;
} }
} }
......
...@@ -9,17 +9,16 @@ ...@@ -9,17 +9,16 @@
@confirm="search" @confirm="search"
@clear="clear" @clear="clear"
/> />
<!-- <view class="tag"> <view class="tag">
<u-tag <text
v-for="(item, i) in tagList" v-for="(item, i) in tagList"
:key="i" :key="i"
:text="item.name" class="tag-item"
shape="circle" :class="item.type === 'primary' ? 'tag-active' : ''"
mode="plain"
:type="item.type"
@click="changeTagType(i)" @click="changeTagType(i)"
/> >{{ item.name }}
</view> --> </text>
</view>
<view v-if="detailList.length"> <view v-if="detailList.length">
<text class="fund">为您找到{{ listQuery.total }}位同学</text> <text class="fund">为您找到{{ listQuery.total }}位同学</text>
...@@ -30,9 +29,13 @@ ...@@ -30,9 +29,13 @@
<u-loadmore :status="status" icon-type="flower" /> <u-loadmore :status="status" icon-type="flower" />
</view> </view>
</view> </view>
<view v-else class="empty"> <u-empty
<u-empty text="暂无数据" mode="list" /> v-else
</view> text="暂无数据~"
icon-size="506"
:margin-top="220"
src="../../static/img/noData.png"
></u-empty>
</div> </div>
</template> </template>
...@@ -56,6 +59,7 @@ const listQuery = reactive({ ...@@ -56,6 +59,7 @@ const listQuery = reactive({
pageSize: 10, pageSize: 10,
total: 0, total: 0,
Name: "", Name: "",
KqType: 0, // 0 全部,1 正常,2 缺勤,3 请假,4 补签
}); });
const status = ref("loadmore"); const status = ref("loadmore");
...@@ -72,20 +76,28 @@ onReachBottom(() => { ...@@ -72,20 +76,28 @@ onReachBottom(() => {
}); });
const changeTagType = (index: number) => { const changeTagType = (index: number) => {
if (index === listQuery.KqType) return;
listQuery.KqType = index;
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";
}); });
detailList.value = [];
listQuery.pageIndex = 1;
listQuery.pageSize = 10;
init();
}; };
const search = (val: any) => { const search = (val: any) => {
listQuery.Name = val.value; listQuery.Name = val.value;
detailList.value = [];
listQuery.pageIndex = 1;
listQuery.pageSize = 10;
init(); init();
}; };
const clear = () => { const clear = () => {
listQuery.Name = ""; listQuery.Name = "";
init();
}; };
const init = async () => { const init = async () => {
...@@ -115,10 +127,21 @@ onLoad((options: any) => { ...@@ -115,10 +127,21 @@ onLoad((options: any) => {
padding: 30rpx; padding: 30rpx;
.tag { .tag {
margin-bottom: 30rpx; margin-bottom: 48rpx;
.tag-item {
margin-right: 24rpx;
border-radius: 24rpx;
font-size: 24rpx;
background: #ffffff;
padding: 8rpx 24rpx;
font-weight: 400;
color: #aeaeae;
}
.u-tag { .tag-active {
margin-right: 20rpx; background: #ddf3ff;
color: #05a8ff;
} }
} }
} }
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { baseUrl } from "@/utils/request"; import { baseUrl } from "@/utils/request";
import { callPhone } from "@/utils/util";
const props = defineProps({ const props = defineProps({
addressBookItem: { addressBookItem: {
...@@ -50,7 +51,7 @@ const props = defineProps({ ...@@ -50,7 +51,7 @@ const props = defineProps({
const emits = defineEmits(["tapButton"]); const emits = defineEmits(["tapButton"]);
const tapButton = () => { const tapButton = () => {
if (!props.buttonTitle) location.href = "tel:" + props.addressBookItem.Phone; if (!props.buttonTitle) callPhone(props.addressBookItem.Phone);
// emits("tapButton", props.addressBookItem.Phone) // emits("tapButton", props.addressBookItem.Phone)
else else
emits( emits(
......
...@@ -64,7 +64,9 @@ ...@@ -64,7 +64,9 @@
</view> </view>
<view class="desc">课程资料</view> <view class="desc">课程资料</view>
</view> </view>
<view v-show="!current" class="body-btn">开放签退</view> <view v-show="!current" class="body-btn" @tap="tapSignOut"
>开放签退</view
>
<view v-show="current == 2" class="body-btn" @tap="toEvaluate" <view v-show="current == 2" class="body-btn" @tap="toEvaluate"
>查看评价</view >查看评价</view
> >
...@@ -159,9 +161,11 @@ ...@@ -159,9 +161,11 @@
/> />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useCourseStore } from "@/store/modules/courseStore";
import { toast, zconfirm } from "@/utils/util";
import { teacOpenQT } from "@/api/course";
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 courseStore = useCourseStore();
const props = defineProps({ const props = defineProps({
...@@ -175,7 +179,7 @@ const props = defineProps({ ...@@ -175,7 +179,7 @@ const props = defineProps({
}, },
}); });
const emits = defineEmits(["openInfo"]); const emits = defineEmits(["init"]);
const infoRef = ref(); const infoRef = ref();
const collapseShow = ref(false); const collapseShow = ref(false);
...@@ -231,6 +235,18 @@ const toEvaluate = () => { ...@@ -231,6 +235,18 @@ const toEvaluate = () => {
}); });
}; };
const tapSignOut = () => {
zconfirm("确定开放签退?", async (result: boolean) => {
if (result) {
const { data: res } = await teacOpenQT(props.courseItem.courseId);
if (res.code == 200) {
emits("init");
toast("开放签退成功");
}
}
});
};
const openInfo = () => { const openInfo = () => {
infoState.show = true; infoState.show = true;
infoRef.value.init(); infoRef.value.init();
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
:show-foot=" :show-foot="
state?.status == '缺勤' || state?.status == '未签退' ? true : false state?.status == '缺勤' || state?.status == '未签退' ? true : false
" "
:border="false"
margin="0" margin="0"
> >
<template #body> <template #body>
...@@ -14,7 +15,7 @@ ...@@ -14,7 +15,7 @@
width="92rpx" width="92rpx"
height="92rpx" height="92rpx"
shape="circle" shape="circle"
:src="baseUrl + '/' + detailItem.proPhoto" :src="baseUrl + '/' + detailItem.ImagePath"
></u-image> ></u-image>
<view <view
style=" style="
...@@ -45,7 +46,7 @@ ...@@ -45,7 +46,7 @@
<text <text
v-show="state.SingInText != ' ' && state.SingInText" v-show="state.SingInText != ' ' && state.SingInText"
class="reason" class="reason"
>(请假原因:{{ state.SingInText }}不舒服有qqq)</text >(请假原因:{{ state.SingInText }})</text
> >
</view> </view>
<view class="line-item"> <view class="line-item">
...@@ -81,11 +82,11 @@ ...@@ -81,11 +82,11 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import fillPopup from "./fillPopup.vue";
import { signInAndOut } from "@/api/course"; import { signInAndOut } from "@/api/course";
import dayjs from "dayjs";
import { toast } from "@/utils/util"; import { toast } from "@/utils/util";
import { baseUrl } from "@/utils/request"; import { baseUrl } from "@/utils/request";
import fillPopup from "./fillPopup.vue";
import dayjs from "dayjs";
const props = defineProps({ const props = defineProps({
detailItem: { detailItem: {
...@@ -112,6 +113,7 @@ const tagList = [ ...@@ -112,6 +113,7 @@ const tagList = [
{ color: "#5363FF", status: "签退请假" }, { color: "#5363FF", status: "签退请假" },
{ color: "#19be6b", status: "已补签" }, { color: "#19be6b", status: "已补签" },
{ color: "#19be6b", status: "签退补签" }, { color: "#19be6b", status: "签退补签" },
// { color: "#5363FF", status: "未签到" },
] as any; ] as any;
const state: any = computed(() => { const state: any = computed(() => {
...@@ -129,9 +131,11 @@ const state: any = computed(() => { ...@@ -129,9 +131,11 @@ const state: any = computed(() => {
"QD-QT": tagList[0], "QD-QT": tagList[0],
"QD-": tagList[2], "QD-": tagList[2],
"QDQJ-": tagList[3], "QDQJ-": tagList[3],
// "QDQJ-QT": tagList[3],
"QD-QTQJ": tagList[4], "QD-QTQJ": tagList[4],
"QDBQ-": tagList[5], "QDBQ-": tagList[5],
"QD-QTBQ": tagList[6], "QD-QTBQ": tagList[6],
// "-QT": tagList[7],
} as any; } as any;
const key = `${SingIn || ""}-${SingOut || ""}`; const key = `${SingIn || ""}-${SingOut || ""}`;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
<view v-if="infoList.length"> <view v-if="infoList.length">
<view v-for="(item, i) in infoList" :key="i" class="item"> <view v-for="(item, i) in infoList" :key="i" class="item">
<view> <view>
<!-- <u-icon name="order" size="50"></u-icon> -->
<u-image <u-image
src="../../../static/img/PDF.png" src="../../../static/img/PDF.png"
width="35" width="35"
......
...@@ -173,10 +173,6 @@ const submit = () => { ...@@ -173,10 +173,6 @@ const submit = () => {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 20rpx; margin-bottom: 20rpx;
text-align: justify;
text-align-last: justify;
/*兼容ie*/
text-justify: distribute-all-lines;
h4 { h4 {
width: 140rpx; width: 140rpx;
...@@ -184,6 +180,10 @@ const submit = () => { ...@@ -184,6 +180,10 @@ const submit = () => {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: rgba(34, 34, 34, 0.9); color: rgba(34, 34, 34, 0.9);
text-align: justify;
text-align-last: justify;
/*兼容ie*/
text-justify: distribute-all-lines;
} }
} }
} }
......
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
<text class="fund">为您找到{{ listQuery.total }}个课程</text> <text class="fund">为您找到{{ listQuery.total }}个课程</text>
<block v-for="(item, index) in courseList" :key="index"> <block v-for="(item, index) in courseList" :key="index">
<courseItem :courseItem="item" :current="tabsState.current" /> <courseItem
:courseItem="item"
:current="tabsState.current"
@init="init"
/>
</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" />
......
...@@ -18,7 +18,7 @@ import { zconfirm } from "@/utils/util"; ...@@ -18,7 +18,7 @@ import { zconfirm } from "@/utils/util";
const pdfState = reactive({ const pdfState = reactive({
title: "", title: "",
pdfUrl: "", pdfUrl: "",
viewerUrl: "/static/pdf/web/viewer.html", viewerUrl: "../../static/pdf/web/viewer.html",
url: "", url: "",
}); });
......
...@@ -210,7 +210,7 @@ page { ...@@ -210,7 +210,7 @@ page {
// height: 238rpx; // height: 238rpx;
margin: 0 32rpx; margin: 0 32rpx;
padding: 48rpx; padding: 48rpx;
background: #ffffff; background: transparent;
box-shadow: 0rpx 8rpx 60rpx 0rpx rgba(0, 0, 0, 0.05); box-shadow: 0rpx 8rpx 60rpx 0rpx rgba(0, 0, 0, 0.05);
border-radius: 24rpx; border-radius: 24rpx;
display: flex; display: flex;
...@@ -233,7 +233,4 @@ page { ...@@ -233,7 +233,4 @@ page {
} }
} }
} }
.bg-footer {
// z-index: -99;
}
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="lecturer-container"> <view class="lecturer-container">
<!-- 搜索 --> <!-- 搜索 -->
<uni-search-bar <uni-search-bar
placeholder="班级名称" placeholder="关键词"
bgColor="#ffffff" bgColor="#ffffff"
clearButton="auto" clearButton="auto"
cancelButton="none" cancelButton="none"
...@@ -44,11 +44,14 @@ const status = ref("loadmore"); ...@@ -44,11 +44,14 @@ const status = ref("loadmore");
const search = (val: any) => { const search = (val: any) => {
listQuery.KeyWords = val.value; listQuery.KeyWords = val.value;
lecturerList.value = [];
init();
}; };
const clear = () => { const clear = () => {
listQuery.KeyWords = ""; listQuery.KeyWords = "";
}; };
const initLecturerItem = () => {}; const initLecturerItem = () => {};
// 上拉加载数据 // 上拉加载数据
......
...@@ -103,6 +103,7 @@ onReady(() => { ...@@ -103,6 +103,7 @@ onReady(() => {
}); });
onMounted(() => { onMounted(() => {
if (globalStore.Phone) return uni.reLaunch({ url: "/pages/home/index" });
window.onresize = () => { window.onresize = () => {
return (() => { return (() => {
showHeight.value = document.body.clientHeight; showHeight.value = document.body.clientHeight;
......
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
shape="square" shape="square"
@change="change" @change="change"
> >
<u-radio name="50">50</u-radio>
<u-radio name="100">100</u-radio>
<u-radio name="200">200</u-radio> <u-radio name="200">200</u-radio>
<u-radio name="500">500</u-radio>
<u-radio name="1000">1000</u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item <u-form-item
......
...@@ -16,15 +16,23 @@ ...@@ -16,15 +16,23 @@
> >
</view> </view>
<view class="item"> <view class="item">
<text <text v-show="current"
>应用范围:{{ >应用范围:{{
positionItem.type positionItem.type === "1"
? positionItem.type == "1" ? "同步班级所有课程的考勤定位"
? "同步班级所有课程的考勤定位" : "仅当前课程考勤定位"
: "仅当前课程考勤定位"
: "未设置"
}} }}
</text> </text>
<text v-show="!current">应用范围:未设置</text>
</view>
<view class="item">
<text
>距离范围:{{
positionItem.Scope && positionItem.Scope !== " "
? positionItem.Scope + "米"
: "未设置"
}}</text
>
</view> </view>
</template> </template>
<template #foot> <template #foot>
......
...@@ -86,12 +86,11 @@ const tabsChange = (index: number) => { ...@@ -86,12 +86,11 @@ const tabsChange = (index: number) => {
const search = (val: any) => { const search = (val: any) => {
listQuery.Name = val.value; listQuery.Name = val.value;
init(); tabsChange(tabsState.current);
}; };
const clear = () => { const clear = () => {
listQuery.Name = ""; listQuery.Name = "";
init();
}; };
// 上拉加载数据 // 上拉加载数据
......
...@@ -30,6 +30,8 @@ const addrDetail = ref(); ...@@ -30,6 +30,8 @@ const addrDetail = ref();
const positionRef = ref(); const positionRef = ref();
const submit = () => { const submit = () => {
console.log(addrDetail.value, "addrDetail.value");
if (!addrDetail.value) return toast("请选择地址"); if (!addrDetail.value) return toast("请选择地址");
const Longitude = const Longitude =
addrDetail.value.latlng.lat + "," + addrDetail.value.latlng.lng; addrDetail.value.latlng.lat + "," + addrDetail.value.latlng.lng;
...@@ -40,7 +42,7 @@ const submit = () => { ...@@ -40,7 +42,7 @@ const submit = () => {
show.value = true; show.value = true;
setTimeout(() => { setTimeout(() => {
positionRef.value.init(); positionRef.value.init();
// console.log("location", addrDetail.value); console.log("location", addrDetail.value);
}, 100); }, 100);
// uni.navigateTo({ // uni.navigateTo({
// url: "/pages/setPositioning/setAttendance", // url: "/pages/setPositioning/setAttendance",
...@@ -80,16 +82,21 @@ onMounted(() => { ...@@ -80,16 +82,21 @@ onMounted(() => {
uni.getLocation({ uni.getLocation({
type: "gcj02", type: "gcj02",
success(res: any) { success(res: any) {
// console.log(res); console.log(res, "gcj02");
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`;
setTimeout(() => { setTimeout(() => {
flag.value = true; flag.value = true;
}, 300); }, 300);
}, },
fail: function (res: any) {
console.log(res);
},
}); });
} }
window.addEventListener("message", setPosition, false); setTimeout(() => {
window.addEventListener("message", setPosition, false);
}, 100);
}); });
onBackPress(() => { onBackPress(() => {
...@@ -108,6 +115,7 @@ onBackPress(() => { ...@@ -108,6 +115,7 @@ onBackPress(() => {
position: absolute; position: absolute;
top: 46%; top: 46%;
right: -2%; right: -2%;
z-index: 9;
.u-btn { .u-btn {
padding: 12rpx; padding: 12rpx;
height: 58rpx; height: 58rpx;
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
<text>现场教学点:{{ teachPointsItem.FTEACHINGPOINTS }}</text> <text>现场教学点:{{ teachPointsItem.FTEACHINGPOINTS }}</text>
</view> </view>
<view class="item"> <view class="item">
<text>属地:{{ teachPointsItem.FTEACHINGPOINTS }}</text> <text>属地:{{ teachPointsItem.FTERRITORIALITY }}</text>
</view> </view>
<view class="item"> <view class="item">
<text>讲解员:{{ teachPointsItem.FTEACHINGPOINTS }}</text> <text>讲解员:{{ teachPointsItem.FINTERPRETER }}</text>
</view> </view>
<view class="item"> <view class="item">
<text>联系人:{{ teachPointsItem.FCONTACTS }}</text> <text>联系人:{{ teachPointsItem.FCONTACTS }}</text>
...@@ -23,21 +23,21 @@ ...@@ -23,21 +23,21 @@
size="32" size="32"
color="#05A8FF" color="#05A8FF"
style="margin-left: 32rpx" style="margin-left: 32rpx"
@tap="tapButton(teachPointsItem.FPHONE)" @tap="callPhone(teachPointsItem.FPHONE)"
></u-icon> ></u-icon>
</view> </view>
<view class="item"> <view class="item">
<text>票价/门票:{{ teachPointsItem.FTEACHINGPOINTS }}</text> <text>票价/门票:{{ teachPointsItem.FAMOUNT }}</text>
</view> </view>
<view class="item"> <view class="item">
<text>预约方式:{{ teachPointsItem.FTEACHINGPOINTS }}</text> <text>预约方式:{{ teachPointsItem.FAMOUNT }}</text>
</view> </view>
<view class="item"> <view class="item">
<text>备注:{{ teachPointsItem.FTEACHINGPOINTS }}</text> <text>备注:{{ teachPointsItem.FREMARKS }}</text>
</view> </view>
</view> </view>
<u-image <u-image
src="" :src="baseUrl + '/' + teachPointsItem.ImagePath"
width="220rpx" width="220rpx"
height="296rpx" height="296rpx"
border-radius="8" border-radius="8"
...@@ -47,11 +47,7 @@ ...@@ -47,11 +47,7 @@
</template> </template>
<template #foot> <template #foot>
<view class="foot"> <view class="foot">
<text <text>{{ teachPointsItem.FINTRODUCE }} </text>
>深圳市南山区西丽街道办公室位于圳地处中国华南地区、广东南部、珠江口东岸,东临大亚湾和大鹏湾,西濒珠江口和伶仃洋;南隔深圳河与香港相连,
北部与东莞、惠州两城市接深圳市南山区西丽街道办公室位于圳地处中国华南地区、广东南部、珠江口东岸,东临大亚湾和大鹏湾,西濒珠江口和伶仃洋;
南隔深圳河与香港相连,北部与东莞、惠州两城市接
</text>
</view> </view>
</template> </template>
</u-card> </u-card>
...@@ -59,16 +55,15 @@ ...@@ -59,16 +55,15 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { baseUrl } from "@/utils/request";
import { callPhone } from "@/utils/util";
defineProps({ defineProps({
teachPointsItem: { teachPointsItem: {
type: Array, type: Array,
default: () => [], default: () => [],
} as any, } as any,
}); });
const tapButton = (phone: string) => {
location.href = "tel:" + phone;
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<template> <template>
<view class="teach-container"> <view class="teach-container">
<!-- 搜索 -->
<view class="search">
<view class="search-btn">属地</view>
<u-input
v-model="listQuery.territoriality"
placeholder=""
border
border-color="#F8F8F8"
/>
<uni-search-bar
placeholder="关键词"
bgColor="#ffffff"
clearButton="auto"
cancelButton="none"
@confirm="search"
/>
</view>
<view v-if="teachPointsList.length"> <view v-if="teachPointsList.length">
<!-- 搜索 -->
<view class="search">
<view class="search-btn">属地</view>
<u-input
v-model="listQuery.territoriality"
placeholder=""
border
border-color="#F8F8F8"
/>
<uni-search-bar
placeholder="关键词"
bgColor="#ffffff"
clearButton="auto"
cancelButton="none"
@confirm="search"
/>
</view>
<!-- <text class="fund">为您找到{{ listQuery.total }}个现场教学点</text> --> <!-- <text class="fund">为您找到{{ listQuery.total }}个现场教学点</text> -->
<block v-for="(item, index) in teachPointsList" :key="index"> <block v-for="(item, index) in teachPointsList" :key="index">
<teachPointsItem :teachPointsItem="item" /> <teachPointsItem :teachPointsItem="item" />
</block> </block>
...@@ -27,9 +26,13 @@ ...@@ -27,9 +26,13 @@
<u-loadmore :status="status" icon-type="flower" /> <u-loadmore :status="status" icon-type="flower" />
</view> </view>
</view> </view>
<view v-else class="empty"> <u-empty
<u-empty text="暂无数据" mode="list" /> v-else
</view> text="暂无数据~"
icon-size="506"
:margin-top="220"
src="../../static/img/noData.png"
></u-empty>
</view> </view>
</template> </template>
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
position: fixed; position: fixed;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 29.68%; height: 482rpx;
z-index: -99; z-index: -99;
} }
......
## 1.2.4(2023-05-09)
- 修复 i18n 国际化不正确的 Bug
## 1.2.3(2022-05-24)
- 新增 readonly 属性,组件只读
## 1.2.2(2022-05-06)
- 修复 vue3 input 事件不生效的bug
## 1.2.1(2022-05-06)
- 修复 多余代码导致的bug
## 1.2.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-search-bar](https://uniapp.dcloud.io/component/uniui/uni-search-bar)
## 1.1.2(2021-08-30)
- 修复 value 属性与 modelValue 属性不兼容的Bug
## 1.1.1(2021-08-24)
- 新增 支持国际化
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.0.9(2021-05-12)
- 新增 项目示例地址
## 1.0.8(2021-04-21)
- 优化 添加依赖 uni-icons, 导入后自动下载依赖
## 1.0.7(2021-04-15)
- uni-ui 新增 uni-search-bar 的 focus 事件
## 1.0.6(2021-02-05)
- 优化 组件引用关系,通过uni_modules引用组件
## 1.0.5(2021-02-05)
- 调整为uni_modules目录规范
- 新增 支持双向绑定
- 更改 input 事件的返回值,e={value:Number} --> e=value
- 新增 支持图标插槽
- 新增 支持 clear、blur 事件
- 新增 支持 focus 属性
- 去掉组件背景色
{
"uni-search-bar.cancel": "cancel",
"uni-search-bar.placeholder": "Search enter content"
}
\ No newline at end of file
import en from './en.json' import en from './en.json'
import es from './es.json'
import fr from './fr.json'
import zhHans from './zh-Hans.json' import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json' import zhHant from './zh-Hant.json'
export default { export default {
en, en,
es,
fr,
'zh-Hans': zhHans, 'zh-Hans': zhHans,
'zh-Hant': zhHant 'zh-Hant': zhHant
} }
{
"uni-search-bar.cancel": "取消",
"uni-search-bar.placeholder": "请输入搜索内容"
}
{
"uni-search-bar.cancel": "取消",
"uni-search-bar.placeholder": "請輸入搜索內容"
}
<template>
<view class="uni-searchbar">
<view
:style="{ borderRadius: radius + 'px', backgroundColor: bgColor }"
class="uni-searchbar__box"
@click="searchClick"
>
<view class="uni-searchbar__box-icon-search">
<slot name="searchIcon">
<uni-icons color="#c0c4cc" size="18" type="search" />
</slot>
</view>
<input
v-if="show || searchVal"
:focus="showSync"
:disabled="readonly"
:placeholder="placeholderText"
:maxlength="maxlength"
class="uni-searchbar__box-search-input"
confirm-type="search"
type="text"
v-model="searchVal"
@confirm="confirm"
@blur="blur"
@focus="emitFocus"
/>
<text v-else class="uni-searchbar__text-placeholder">{{
placeholder
}}</text>
<view
v-if="
show &&
(clearButton === 'always' ||
(clearButton === 'auto' && searchVal !== '')) &&
!readonly
"
class="uni-searchbar__box-icon-clear"
@click="clear"
>
<slot name="clearIcon">
<uni-icons color="#c0c4cc" size="20" type="clear" />
</slot>
</view>
</view>
<text
@click="cancel"
class="uni-searchbar__cancel"
v-if="cancelButton === 'always' || (show && cancelButton === 'auto')"
>{{ cancelTextI18n }}</text
>
</view>
</template>
<script>
import { initVueI18n } from "@dcloudio/uni-i18n";
import messages from "./i18n/index.js";
const { t } = initVueI18n(messages);
/**
* SearchBar 搜索栏
* @description 搜索栏组件,通常用于搜索商品、文章等
* @tutorial https://ext.dcloud.net.cn/plugin?id=866
* @property {Number} radius 搜索栏圆角
* @property {Number} maxlength 输入最大长度
* @property {String} placeholder 搜索栏Placeholder
* @property {String} clearButton = [always|auto|none] 是否显示清除按钮
* @value always 一直显示
* @value auto 输入框不为空时显示
* @value none 一直不显示
* @property {String} cancelButton = [always|auto|none] 是否显示取消按钮
* @value always 一直显示
* @value auto 输入框不为空时显示
* @value none 一直不显示
* @property {String} cancelText 取消按钮的文字
* @property {String} bgColor 输入框背景颜色
* @property {Boolean} focus 是否自动聚焦
* @property {Boolean} readonly 组件只读,不能有任何操作,只做展示
* @event {Function} confirm uniSearchBar 的输入框 confirm 事件,返回参数为uniSearchBar的value,e={value:Number}
* @event {Function} input uniSearchBar 的 value 改变时触发事件,返回参数为uniSearchBar的value,e=value
* @event {Function} cancel 点击取消按钮时触发事件,返回参数为uniSearchBar的value,e={value:Number}
* @event {Function} clear 点击清除按钮时触发事件,返回参数为uniSearchBar的value,e={value:Number}
* @event {Function} blur input失去焦点时触发事件,返回参数为uniSearchBar的value,e={value:Number}
*/
export default {
name: "UniSearchBar",
emits: [
"input",
"update:modelValue",
"clear",
"cancel",
"confirm",
"blur",
"focus",
],
props: {
placeholder: {
type: String,
default: "",
},
radius: {
type: [Number, String],
default: 5,
},
clearButton: {
type: String,
default: "auto",
},
cancelButton: {
type: String,
default: "auto",
},
cancelText: {
type: String,
default: "",
},
bgColor: {
type: String,
default: "#F8F8F8",
},
maxlength: {
type: [Number, String],
default: 100,
},
value: {
type: [Number, String],
default: "",
},
modelValue: {
type: [Number, String],
default: "",
},
focus: {
type: Boolean,
default: false,
},
readonly: {
type: Boolean,
default: false,
},
},
data() {
return {
show: false,
showSync: false,
searchVal: "",
};
},
computed: {
cancelTextI18n() {
return this.cancelText || t("uni-search-bar.cancel");
},
placeholderText() {
return this.placeholder || t("uni-search-bar.placeholder");
},
},
watch: {
// #ifndef VUE3
value: {
immediate: true,
handler(newVal) {
this.searchVal = newVal;
if (newVal) {
this.show = true;
}
},
},
// #endif
// #ifdef VUE3
modelValue: {
immediate: true,
handler(newVal) {
this.searchVal = newVal;
if (newVal) {
this.show = true;
}
},
},
// #endif
focus: {
immediate: true,
handler(newVal) {
if (newVal) {
if (this.readonly) return;
this.show = true;
this.$nextTick(() => {
this.showSync = true;
});
}
},
},
searchVal(newVal, oldVal) {
this.$emit("input", newVal);
// #ifdef VUE3
this.$emit("update:modelValue", newVal);
// #endif
},
},
methods: {
searchClick() {
if (this.readonly) return;
if (this.show) {
return;
}
this.show = true;
this.$nextTick(() => {
this.showSync = true;
});
},
clear() {
this.$emit("clear", {
value: this.searchVal,
});
this.searchVal = "";
},
cancel() {
if (this.readonly) return;
this.$emit("cancel", {
value: this.searchVal,
});
this.searchVal = "";
this.show = false;
this.showSync = false;
// #ifndef APP-PLUS
uni.hideKeyboard();
// #endif
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
},
confirm() {
// #ifndef APP-PLUS
uni.hideKeyboard();
// #endif
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
this.$emit("confirm", {
value: this.searchVal,
});
},
blur() {
// #ifndef APP-PLUS
uni.hideKeyboard();
// #endif
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
this.$emit("blur", {
value: this.searchVal,
});
},
emitFocus(e) {
this.$emit("focus", e.detail);
},
},
};
</script>
<style lang="scss">
$uni-searchbar-height: 36px;
.uni-searchbar {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
position: relative;
padding: 10px;
// background-color: #fff;
}
.uni-searchbar__box {
/* #ifndef APP-NVUE */
display: flex;
box-sizing: border-box;
/* #endif */
overflow: hidden;
position: relative;
flex: 1;
justify-content: center;
flex-direction: row;
align-items: center;
height: $uni-searchbar-height;
padding: 8px 8px 5px 0px;
}
.uni-searchbar__box-icon-search {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
// width: 32px;
padding: 0 8px;
justify-content: center;
align-items: center;
color: #b3b3b3;
}
.uni-searchbar__box-search-input {
flex: 1;
font-size: 14px;
color: #333;
}
.uni-searchbar__box-icon-clear {
align-items: center;
line-height: 24px;
padding-left: 8px;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.uni-searchbar__text-placeholder {
font-size: 14px;
color: #b3b3b3;
margin-left: 5px;
}
.uni-searchbar__cancel {
padding-left: 10px;
line-height: $uni-searchbar-height;
font-size: 14px;
color: #333333;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
</style>
{ {
"id": "uni-table", "id": "uni-search-bar",
"displayName": "uni-table 表格", "displayName": "uni-search-bar 搜索栏",
"version": "1.2.3", "version": "1.2.4",
"description": "表格组件,多用于展示多条结构类似的数据,如", "description": "搜索栏组件,通常用于搜索商品、文章等",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
"uniui", "uniui",
"table", "搜索框",
"表格" "搜索栏"
], ],
"repository": "https://github.com/dcloudio/uni-ui", "repository": "https://github.com/dcloudio/uni-ui",
"engines": { "engines": {
...@@ -37,7 +37,10 @@ ...@@ -37,7 +37,10 @@
"type": "component-vue" "type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": ["uni-scss","uni-datetime-picker"], "dependencies": [
"uni-scss",
"uni-icons"
],
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
...@@ -47,7 +50,7 @@ ...@@ -47,7 +50,7 @@
"client": { "client": {
"App": { "App": {
"app-vue": "y", "app-vue": "y",
"app-nvue": "n" "app-nvue": "y"
}, },
"H5-mobile": { "H5-mobile": {
"Safari": "y", "Safari": "y",
...@@ -66,12 +69,12 @@ ...@@ -66,12 +69,12 @@
"微信": "y", "微信": "y",
"阿里": "y", "阿里": "y",
"百度": "y", "百度": "y",
"字节跳动": "n", "字节跳动": "y",
"QQ": "y" "QQ": "y"
}, },
"快应用": { "快应用": {
"华为": "n", "华为": "u",
"联盟": "n" "联盟": "u"
}, },
"Vue": { "Vue": {
"vue2": "y", "vue2": "y",
......
## SearchBar 搜索栏
> **组件名:uni-search-bar**
> 代码块: `uSearchBar`
搜索栏组件
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-search-bar)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
## 1.2.3(2023-03-28)
- 修复 在vue3模式下可能会出现错误的问题
## 1.2.2(2022-11-29)
- 优化 主题样式
## 1.2.1(2022-06-06)
- 修复 微信小程序存在无使用组件的问题
## 1.2.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-table](https://uniapp.dcloud.io/component/uniui/uni-table)
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.0.7(2021-07-08)
- 新增 uni-th 支持 date 日期筛选范围
## 1.0.6(2021-07-05)
- 新增 uni-th 支持 range 筛选范围
## 1.0.5(2021-06-28)
- 新增 uni-th 筛选功能
## 1.0.4(2021-05-12)
- 新增 示例地址
- 修复 示例项目缺少组件的Bug
## 1.0.3(2021-04-16)
- 新增 sortable 属性,是否开启单列排序
- 优化 表格多选逻辑
## 1.0.2(2021-03-22)
- uni-tr 添加 disabled 属性,用于 type=selection 时,设置某行是否可由全选按钮控制
## 1.0.1(2021-02-05)
- 调整为uni_modules目录规范
<template>
<!-- #ifdef H5 -->
<tbody>
<slot></slot>
</tbody>
<!-- #endif -->
<!-- #ifndef H5 -->
<view><slot></slot></view>
<!-- #endif -->
</template>
<script>
export default {
name: 'uniBody',
options: {
virtualHost: true
},
data() {
return {
}
},
created() {},
methods: {}
}
</script>
<style>
</style>
<template>
<!-- #ifdef H5 -->
<td class="uni-table-td" :rowspan="rowspan" :colspan="colspan" :class="{'table--border':border}" :style="{width:width + 'px','text-align':align}">
<slot></slot>
</td>
<!-- #endif -->
<!-- #ifndef H5 -->
<!-- :class="{'table--border':border}" -->
<view class="uni-table-td" :class="{'table--border':border}" :style="{width:width + 'px','text-align':align}">
<slot></slot>
</view>
<!-- #endif -->
</template>
<script>
/**
* Td 单元格
* @description 表格中的标准单元格组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=3270
* @property {Number} align = [left|center|right] 单元格对齐方式
*/
export default {
name: 'uniTd',
options: {
virtualHost: true
},
props: {
width: {
type: [String, Number],
default: ''
},
align: {
type: String,
default: 'left'
},
rowspan: {
type: [Number,String],
default: 1
},
colspan: {
type: [Number,String],
default: 1
}
},
data() {
return {
border: false
};
},
created() {
this.root = this.getTable()
this.border = this.root.border
},
methods: {
/**
* 获取父元素实例
*/
getTable() {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== 'uniTable') {
parent = parent.$parent;
if (!parent) return false;
parentName = parent.$options.name;
}
return parent;
},
}
}
</script>
<style lang="scss">
$border-color:#EBEEF5;
.uni-table-td {
display: table-cell;
padding: 8px 10px;
font-size: 14px;
border-bottom: 1px $border-color solid;
font-weight: 400;
color: #606266;
line-height: 23px;
box-sizing: border-box;
}
.table--border {
border-right: 1px $border-color solid;
}
</style>
<template>
<!-- #ifdef H5 -->
<th :rowspan="rowspan" :colspan="colspan" class="uni-table-th" :class="{ 'table--border': border }" :style="{ width: customWidth + 'px', 'text-align': align }">
<view class="uni-table-th-row">
<view class="uni-table-th-content" :style="{ 'justify-content': contentAlign }" @click="sort">
<slot></slot>
<view v-if="sortable" class="arrow-box">
<text class="arrow up" :class="{ active: ascending }" @click.stop="ascendingFn"></text>
<text class="arrow down" :class="{ active: descending }" @click.stop="descendingFn"></text>
</view>
</view>
<dropdown v-if="filterType || filterData.length" :filterDefaultValue="filterDefaultValue" :filterData="filterData" :filterType="filterType" @change="ondropdown"></dropdown>
</view>
</th>
<!-- #endif -->
<!-- #ifndef H5 -->
<view class="uni-table-th" :class="{ 'table--border': border }" :style="{ width: customWidth + 'px', 'text-align': align }"><slot></slot></view>
<!-- #endif -->
</template>
<script>
// #ifdef H5
import dropdown from './filter-dropdown.vue'
// #endif
/**
* Th 表头
* @description 表格内的表头单元格组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=3270
* @property {Number | String} width 单元格宽度(支持纯数字、携带单位px或rpx)
* @property {Boolean} sortable 是否启用排序
* @property {Number} align = [left|center|right] 单元格对齐方式
* @value left 单元格文字左侧对齐
* @value center 单元格文字居中
* @value right 单元格文字右侧对齐
* @property {Array} filterData 筛选数据
* @property {String} filterType [search|select] 筛选类型
* @value search 关键字搜素
* @value select 条件选择
* @event {Function} sort-change 排序触发事件
*/
export default {
name: 'uniTh',
options: {
virtualHost: true
},
components: {
// #ifdef H5
dropdown
// #endif
},
emits:['sort-change','filter-change'],
props: {
width: {
type: [String, Number],
default: ''
},
align: {
type: String,
default: 'left'
},
rowspan: {
type: [Number, String],
default: 1
},
colspan: {
type: [Number, String],
default: 1
},
sortable: {
type: Boolean,
default: false
},
filterType: {
type: String,
default: ""
},
filterData: {
type: Array,
default () {
return []
}
},
filterDefaultValue: {
type: [Array,String],
default () {
return ""
}
}
},
data() {
return {
border: false,
ascending: false,
descending: false
}
},
computed: {
// 根据props中的width属性 自动匹配当前th的宽度(px)
customWidth(){
if(typeof this.width === 'number'){
return this.width
} else if(typeof this.width === 'string') {
let regexHaveUnitPx = new RegExp(/^[1-9][0-9]*px$/g)
let regexHaveUnitRpx = new RegExp(/^[1-9][0-9]*rpx$/g)
let regexHaveNotUnit = new RegExp(/^[1-9][0-9]*$/g)
if (this.width.match(regexHaveUnitPx) !== null) { // 携带了 px
return this.width.replace('px', '')
} else if (this.width.match(regexHaveUnitRpx) !== null) { // 携带了 rpx
let numberRpx = Number(this.width.replace('rpx', ''))
let widthCoe = uni.getSystemInfoSync().screenWidth / 750
return Math.round(numberRpx * widthCoe)
} else if (this.width.match(regexHaveNotUnit) !== null) { // 未携带 rpx或px 的纯数字 String
return this.width
} else { // 不符合格式
return ''
}
} else {
return ''
}
},
contentAlign() {
let align = 'left'
switch (this.align) {
case 'left':
align = 'flex-start'
break
case 'center':
align = 'center'
break
case 'right':
align = 'flex-end'
break
}
return align
}
},
created() {
this.root = this.getTable('uniTable')
this.rootTr = this.getTable('uniTr')
this.rootTr.minWidthUpdate(this.customWidth ? this.customWidth : 140)
this.border = this.root.border
this.root.thChildren.push(this)
},
methods: {
sort() {
if (!this.sortable) return
this.clearOther()
if (!this.ascending && !this.descending) {
this.ascending = true
this.$emit('sort-change', { order: 'ascending' })
return
}
if (this.ascending && !this.descending) {
this.ascending = false
this.descending = true
this.$emit('sort-change', { order: 'descending' })
return
}
if (!this.ascending && this.descending) {
this.ascending = false
this.descending = false
this.$emit('sort-change', { order: null })
}
},
ascendingFn() {
this.clearOther()
this.ascending = !this.ascending
this.descending = false
this.$emit('sort-change', { order: this.ascending ? 'ascending' : null })
},
descendingFn() {
this.clearOther()
this.descending = !this.descending
this.ascending = false
this.$emit('sort-change', { order: this.descending ? 'descending' : null })
},
clearOther() {
this.root.thChildren.map(item => {
if (item !== this) {
item.ascending = false
item.descending = false
}
return item
})
},
ondropdown(e) {
this.$emit("filter-change", e)
},
/**
* 获取父元素实例
*/
getTable(name) {
let parent = this.$parent
let parentName = parent.$options.name
while (parentName !== name) {
parent = parent.$parent
if (!parent) return false
parentName = parent.$options.name
}
return parent
}
}
}
</script>
<style lang="scss">
$border-color: #ebeef5;
$uni-primary: #007aff !default;
.uni-table-th {
padding: 12px 10px;
/* #ifndef APP-NVUE */
display: table-cell;
box-sizing: border-box;
/* #endif */
font-size: 14px;
font-weight: bold;
color: #909399;
border-bottom: 1px $border-color solid;
}
.uni-table-th-row {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
}
.table--border {
border-right: 1px $border-color solid;
}
.uni-table-th-content {
display: flex;
align-items: center;
flex: 1;
}
.arrow-box {
}
.arrow {
display: block;
position: relative;
width: 10px;
height: 8px;
// border: 1px red solid;
left: 5px;
overflow: hidden;
cursor: pointer;
}
.down {
top: 3px;
::after {
content: '';
width: 8px;
height: 8px;
position: absolute;
left: 2px;
top: -5px;
transform: rotate(45deg);
background-color: #ccc;
}
&.active {
::after {
background-color: $uni-primary;
}
}
}
.up {
::after {
content: '';
width: 8px;
height: 8px;
position: absolute;
left: 2px;
top: 5px;
transform: rotate(45deg);
background-color: #ccc;
}
&.active {
::after {
background-color: $uni-primary;
}
}
}
</style>
<template>
<!-- #ifdef H5 -->
<thead class="uni-table-thead">
<tr class="uni-table-tr">
<th :rowspan="rowspan" colspan="1" class="checkbox" :class="{ 'tr-table--border': border }">
<table-checkbox :indeterminate="indeterminate" :checked="checked" @checkboxSelected="checkboxSelected"></table-checkbox>
</th>
</tr>
<slot></slot>
</thead>
<!-- #endif -->
<!-- #ifndef H5 -->
<view class="uni-table-thead"><slot></slot></view>
<!-- #endif -->
</template>
<script>
import tableCheckbox from '../uni-tr/table-checkbox.vue'
export default {
name: 'uniThead',
components: {
tableCheckbox
},
options: {
virtualHost: true
},
data() {
return {
border: false,
selection: false,
rowspan: 1,
indeterminate: false,
checked: false
}
},
created() {
this.root = this.getTable()
// #ifdef H5
this.root.theadChildren = this
// #endif
this.border = this.root.border
this.selection = this.root.type
},
methods: {
init(self) {
this.rowspan++
},
checkboxSelected(e) {
this.indeterminate = false
const backIndexData = this.root.backIndexData
const data = this.root.trChildren.filter(v => !v.disabled && v.keyValue)
if (backIndexData.length === data.length) {
this.checked = false
this.root.clearSelection()
} else {
this.checked = true
this.root.selectionAll()
}
},
/**
* 获取父元素实例
*/
getTable(name = 'uniTable') {
let parent = this.$parent
let parentName = parent.$options.name
while (parentName !== name) {
parent = parent.$parent
if (!parent) return false
parentName = parent.$options.name
}
return parent
}
}
}
</script>
<style lang="scss">
$border-color: #ebeef5;
.uni-table-thead {
display: table-header-group;
}
.uni-table-tr {
/* #ifndef APP-NVUE */
display: table-row;
transition: all 0.3s;
box-sizing: border-box;
/* #endif */
border: 1px red solid;
background-color: #fafafa;
}
.checkbox {
padding: 0 8px;
width: 26px;
padding-left: 12px;
/* #ifndef APP-NVUE */
display: table-cell;
vertical-align: middle;
/* #endif */
color: #333;
font-weight: 500;
border-bottom: 1px $border-color solid;
font-size: 14px;
// text-align: center;
}
.tr-table--border {
border-right: 1px $border-color solid;
}
/* #ifndef APP-NVUE */
.uni-table-tr {
::v-deep .uni-table-th {
&.table--border:last-child {
// border-right: none;
}
}
::v-deep .uni-table-td {
&.table--border:last-child {
// border-right: none;
}
}
}
/* #endif */
</style>
<template>
<view class="uni-table-checkbox" @click="selected">
<view v-if="!indeterminate" class="checkbox__inner" :class="{'is-checked':isChecked,'is-disable':isDisabled}">
<view class="checkbox__inner-icon"></view>
</view>
<view v-else class="checkbox__inner checkbox--indeterminate">
<view class="checkbox__inner-icon"></view>
</view>
</view>
</template>
<script>
export default {
name: 'TableCheckbox',
emits:['checkboxSelected'],
props: {
indeterminate: {
type: Boolean,
default: false
},
checked: {
type: [Boolean,String],
default: false
},
disabled: {
type: Boolean,
default: false
},
index: {
type: Number,
default: -1
},
cellData: {
type: Object,
default () {
return {}
}
}
},
watch:{
checked(newVal){
if(typeof this.checked === 'boolean'){
this.isChecked = newVal
}else{
this.isChecked = true
}
},
indeterminate(newVal){
this.isIndeterminate = newVal
}
},
data() {
return {
isChecked: false,
isDisabled: false,
isIndeterminate:false
}
},
created() {
if(typeof this.checked === 'boolean'){
this.isChecked = this.checked
}
this.isDisabled = this.disabled
},
methods: {
selected() {
if (this.isDisabled) return
this.isIndeterminate = false
this.isChecked = !this.isChecked
this.$emit('checkboxSelected', {
checked: this.isChecked,
data: this.cellData
})
}
}
}
</script>
<style lang="scss">
$uni-primary: #007aff !default;
$border-color: #DCDFE6;
$disable:0.4;
.uni-table-checkbox {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
position: relative;
margin: 5px 0;
cursor: pointer;
// 多选样式
.checkbox__inner {
/* #ifndef APP-NVUE */
flex-shrink: 0;
box-sizing: border-box;
/* #endif */
position: relative;
width: 16px;
height: 16px;
border: 1px solid $border-color;
border-radius: 2px;
background-color: #fff;
z-index: 1;
.checkbox__inner-icon {
position: absolute;
/* #ifdef APP-NVUE */
top: 2px;
/* #endif */
/* #ifndef APP-NVUE */
top: 2px;
/* #endif */
left: 5px;
height: 7px;
width: 3px;
border: 1px solid #fff;
border-left: 0;
border-top: 0;
opacity: 0;
transform-origin: center;
transform: rotate(45deg);
box-sizing: content-box;
}
&.checkbox--indeterminate {
border-color: $uni-primary;
background-color: $uni-primary;
.checkbox__inner-icon {
position: absolute;
opacity: 1;
transform: rotate(0deg);
height: 2px;
top: 0;
bottom: 0;
margin: auto;
left: 0px;
right: 0px;
bottom: 0;
width: auto;
border: none;
border-radius: 2px;
transform: scale(0.5);
background-color: #fff;
}
}
&:hover{
border-color: $uni-primary;
}
// 禁用
&.is-disable {
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
background-color: #F2F6FC;
border-color: $border-color;
}
// 选中
&.is-checked {
border-color: $uni-primary;
background-color: $uni-primary;
.checkbox__inner-icon {
opacity: 1;
transform: rotate(45deg);
}
// 选中禁用
&.is-disable {
opacity: $disable;
}
}
}
}
</style>
<template>
<!-- #ifdef H5 -->
<tr class="uni-table-tr">
<th v-if="selection === 'selection' && ishead" class="checkbox" :class="{ 'tr-table--border': border }">
<table-checkbox :checked="checked" :indeterminate="indeterminate" :disabled="disabled" @checkboxSelected="checkboxSelected"></table-checkbox>
</th>
<slot></slot>
<!-- <uni-th class="th-fixed">123</uni-th> -->
</tr>
<!-- #endif -->
<!-- #ifndef H5 -->
<view class="uni-table-tr">
<view v-if="selection === 'selection' " class="checkbox" :class="{ 'tr-table--border': border }">
<table-checkbox :checked="checked" :indeterminate="indeterminate" :disabled="disabled" @checkboxSelected="checkboxSelected"></table-checkbox>
</view>
<slot></slot>
</view>
<!-- #endif -->
</template>
<script>
import tableCheckbox from './table-checkbox.vue'
/**
* Tr 表格行组件
* @description 表格行组件 仅包含 th,td 组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=
*/
export default {
name: 'uniTr',
components: { tableCheckbox },
props: {
disabled: {
type: Boolean,
default: false
},
keyValue: {
type: [String, Number],
default: ''
}
},
options: {
virtualHost: true
},
data() {
return {
value: false,
border: false,
selection: false,
widthThArr: [],
ishead: true,
checked: false,
indeterminate:false
}
},
created() {
this.root = this.getTable()
this.head = this.getTable('uniThead')
if (this.head) {
this.ishead = false
this.head.init(this)
}
this.border = this.root.border
this.selection = this.root.type
this.root.trChildren.push(this)
const rowData = this.root.data.find(v => v[this.root.rowKey] === this.keyValue)
if(rowData){
this.rowData = rowData
}
this.root.isNodata()
},
mounted() {
if (this.widthThArr.length > 0) {
const selectionWidth = this.selection === 'selection' ? 50 : 0
this.root.minWidth = this.widthThArr.reduce((a, b) => Number(a) + Number(b)) + selectionWidth
}
},
// #ifndef VUE3
destroyed() {
const index = this.root.trChildren.findIndex(i => i === this)
this.root.trChildren.splice(index, 1)
this.root.isNodata()
},
// #endif
// #ifdef VUE3
unmounted() {
const index = this.root.trChildren.findIndex(i => i === this)
this.root.trChildren.splice(index, 1)
this.root.isNodata()
},
// #endif
methods: {
minWidthUpdate(width) {
this.widthThArr.push(width)
},
// 选中
checkboxSelected(e) {
let rootData = this.root.data.find(v => v[this.root.rowKey] === this.keyValue)
this.checked = e.checked
this.root.check(rootData||this, e.checked,rootData? this.keyValue:null)
},
change(e) {
this.root.trChildren.forEach(item => {
if (item === this) {
this.root.check(this, e.detail.value.length > 0 ? true : false)
}
})
},
/**
* 获取父元素实例
*/
getTable(name = 'uniTable') {
let parent = this.$parent
let parentName = parent.$options.name
while (parentName !== name) {
parent = parent.$parent
if (!parent) return false
parentName = parent.$options.name
}
return parent
}
}
}
</script>
<style lang="scss">
$border-color: #ebeef5;
.uni-table-tr {
/* #ifndef APP-NVUE */
display: table-row;
transition: all 0.3s;
box-sizing: border-box;
/* #endif */
}
.checkbox {
padding: 0 8px;
width: 26px;
padding-left: 12px;
/* #ifndef APP-NVUE */
display: table-cell;
vertical-align: middle;
/* #endif */
color: #333;
font-weight: 500;
border-bottom: 1px $border-color solid;
font-size: 14px;
// text-align: center;
}
.tr-table--border {
border-right: 1px $border-color solid;
}
/* #ifndef APP-NVUE */
.uni-table-tr {
::v-deep .uni-table-th {
&.table--border:last-child {
// border-right: none;
}
}
::v-deep .uni-table-td {
&.table--border:last-child {
// border-right: none;
}
}
}
/* #endif */
</style>
{
"filter-dropdown.reset": "Reset",
"filter-dropdown.search": "Search",
"filter-dropdown.submit": "Submit",
"filter-dropdown.filter": "Filter",
"filter-dropdown.gt": "Greater or equal to",
"filter-dropdown.lt": "Less than or equal to",
"filter-dropdown.date": "Date"
}
{
"filter-dropdown.reset": "Reiniciar",
"filter-dropdown.search": "Búsqueda",
"filter-dropdown.submit": "Entregar",
"filter-dropdown.filter": "Filtrar",
"filter-dropdown.gt": "Mayor o igual a",
"filter-dropdown.lt": "Menos que o igual a",
"filter-dropdown.date": "Fecha"
}
{
"filter-dropdown.reset": "Réinitialiser",
"filter-dropdown.search": "Chercher",
"filter-dropdown.submit": "Soumettre",
"filter-dropdown.filter": "Filtre",
"filter-dropdown.gt": "Supérieur ou égal à",
"filter-dropdown.lt": "Inférieur ou égal à",
"filter-dropdown.date": "Date"
}
{
"filter-dropdown.reset": "重置",
"filter-dropdown.search": "搜索",
"filter-dropdown.submit": "确定",
"filter-dropdown.filter": "筛选",
"filter-dropdown.gt": "大于等于",
"filter-dropdown.lt": "小于等于",
"filter-dropdown.date": "日期范围"
}
{
"filter-dropdown.reset": "重置",
"filter-dropdown.search": "搜索",
"filter-dropdown.submit": "確定",
"filter-dropdown.filter": "篩選",
"filter-dropdown.gt": "大於等於",
"filter-dropdown.lt": "小於等於",
"filter-dropdown.date": "日期範圍"
}
## Table 表单
> 组件名:``uni-table``,代码块: `uTable`。
用于展示多条结构类似的数据
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-table)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
...@@ -143,3 +143,9 @@ export const hidePhoneNumber = (phoneNumber: string) => { ...@@ -143,3 +143,9 @@ export const hidePhoneNumber = (phoneNumber: string) => {
return phoneNumber; return phoneNumber;
} }
}; };
export const callPhone = (phone: string) => {
console.log(phone);
if (!phone) return toast("电话号码为空");
location.href = "tel:" + phone;
};
...@@ -63,6 +63,7 @@ export default defineConfig({ ...@@ -63,6 +63,7 @@ export default defineConfig({
"/k3cloud": { "/k3cloud": {
// target: "https://weixin.lingqingkeji.com:86/", // target: "https://weixin.lingqingkeji.com:86/",
target: "http://192.168.1.168", target: "http://192.168.1.168",
// target: "http://192.168.1.61",
secure: false, secure: false,
}, },
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论