wangguoyu 1 month ago
parent
commit
f906a51bec
4 changed files with 162 additions and 9 deletions
  1. 22 0
      api/jiazheng.js
  2. 5 0
      pages.json
  3. 15 9
      pages/admin/Jiazheng/index.vue
  4. 120 0
      pages/admin/Jiazheng/kechengBind.vue

+ 22 - 0
api/jiazheng.js

@@ -325,4 +325,26 @@ export function jiazhengUserDelete(data = {}) {
 		data,
 		timeout: 20000
 	})
+}
+export function kcSelectList(data = {}) {
+	return request({
+		url: '/app/user/jiazheng/kecheng/select/list',
+		headers: {
+			isToken: false
+		},
+		method: 'post',
+		data,
+		timeout: 20000
+	})
+}
+export function jiazhengKcList(data = {}) {
+	return request({
+		url: '/app/user/jiazheng/kecheng/list',
+		headers: {
+			isToken: false
+		},
+		method: 'post',
+		data,
+		timeout: 20000
+	})
 }

+ 5 - 0
pages.json

@@ -33,6 +33,11 @@
 			"style": {
 				"navigationStyle": "custom"
 			}
+		}, {
+			"path": "pages/admin/Jiazheng/kechengBind",
+			"style": {
+				"navigationStyle": "custom"
+			}
 		},{
 			"path": "pages/client/jiazheng/shareImage",
 			"style": {

+ 15 - 9
pages/admin/Jiazheng/index.vue

@@ -3,8 +3,7 @@
 		<view class="phone-navBar-box">
 			<view @click="goUpPage" class="nav-bar-icon"></view>
 			<text class="nav-bar-title">家政人员</text>
-			<uni-icons class="nav-bar-right-icon bar-ml10" type="search" size="20"
-				@click="toggle('top')"></uni-icons>
+			<uni-icons class="nav-bar-right-icon bar-ml10" type="search" size="20" @click="toggle('top')"></uni-icons>
 		</view>
 		<view class="jiazheng-search-box">
 			<view @click.stop="clickAlltype" class="select-item-box">
@@ -40,17 +39,19 @@
 				class="jz-scroll-view">
 				<uni-list class="admin-list-box">
 					<view class="jz-new-btn-box">
-						<button type="default" class="phone-green-btn"
-							@click="addJiazhengRenyuan">新增人员</button>
+						<button type="default" class="phone-green-btn" @click="addJiazhengRenyuan">新增人员</button>
 					</view>
-					
+
 					<uni-list-item v-for="item in data.list" class="jz-list-item-box">
 						<template v-slot:body>
 							<view class="card-head-row">
 								<view class="head-name">{{item.realName}}</view>
 								<button type="default" class="phone-green-btn bz-tel-btn"
 									@click.stop="telephone(item)">打电话</button>
+								<button type="default" class="phone-green-btn bz-tel-btn"
+									@click.stop="kechengBind(item)">课程绑定</button>
 								<share :id="item.id" ref="shareRef">分享</share>
+
 							</view>
 							<view @click="lookUserInfo(item)" class="card-body-row">
 								<view class="card-img-box">
@@ -68,7 +69,8 @@
 									</view>
 									<view class="content-lx-box">
 										<view class="content-lx-item" v-for="item2 in item.leixing" :key="item2">
-											{{item2}}</view>
+											{{item2}}
+										</view>
 									</view>
 									<!-- <view class="content-text-row">{{item.jiguan}}</view> -->
 								</view>
@@ -192,7 +194,7 @@
 	}
 
 	function juliClick() {
-		if(!data.weizhiFlag){
+		if (!data.weizhiFlag) {
 			uni.showToast({
 				title: `当前位置经纬度获取失败,请重新进入该页面!`,
 				icon: 'none',
@@ -297,10 +299,14 @@
 		}
 
 	}
-
+	function kechengBind(data){
+		uni.redirectTo({
+			url: `/pages/admin/Jiazheng/kechengBind?id=`+ data.id
+		})
+	}
 
 	function selectChangeSkill(item) {
-		if(item.length>0){
+		if (item.length > 0) {
 			data.leixing = item[0].name
 			console.log('selectChangeSkill', item);
 			data.page = 0;

+ 120 - 0
pages/admin/Jiazheng/kechengBind.vue

@@ -0,0 +1,120 @@
+<template>
+	<view class="admin-jiazheng-page">
+		<view class="icon-title-navBar-box">
+			<view @click="goUpPage" class="nav-bar-icon"></view>
+			<text class="nav-bar-title">家政人员</text>
+		</view>
+		<v-tabs v-model="current" :tabs="tabs" :scroll="false" @change="changeTab" field="name"
+			class="admin-tab-box"></v-tabs>
+		<uni-list v-if="current ==1" class="admin-list-box">
+			<uni-list-item v-for="item in list" class="jz-list-item-box">
+				<template v-slot:body>
+
+					<view @click="lookUserInfo(item)" class="card-body-row">
+						<view class="card-img-box">
+							<img :src="item.pic" v-if="item.pic">
+							<icon class="phone-default-userImg" v-else></icon>
+						</view>
+						<view class="body-content-row">
+							<view class="content-text-row">
+								<view> {{item.name}}</view>
+							</view>
+
+						</view>
+					</view>
+				</template>
+			</uni-list-item>
+		</uni-list>
+		<uni-list v-if="current ==2" class="admin-list-box">
+			<view class="jz-new-btn-box">
+				<button type="default" class="phone-green-btn" @click="addJiazhengRenyuan">新增人员</button>
+			</view>
+
+			<uni-list-item v-for="item in list" class="jz-list-item-box">
+				<template v-slot:body>
+
+					<view @click="lookUserInfo(item)" class="card-body-row">
+						<view class="card-img-box">
+							<img :src="item.pic" v-if="item.pic">
+							<icon class="phone-default-userImg" v-else></icon>
+						</view>
+						<view class="body-content-row">
+							<view class="content-text-row">
+								<view> {{item.name}}</view>
+							</view>
+
+						</view>
+					</view>
+				</template>
+			</uni-list-item>
+		</uni-list>
+	</view>
+</template>
+
+<script>
+	import {
+		ref
+	} from "vue";
+	import {
+		kcSelectList
+	} from "@/api/jiazheng.js";
+	import commonDialog from '@/components/dialog/commonDialog.vue';
+
+	export default {
+		data() {
+			return {
+				kcClassifyId: 0,
+				id: '',
+				current: 1,
+				list:[],
+				tabs: [{
+						id: 1,
+						name: '未绑定课程',
+
+					},
+					{
+						id: 2,
+						name: '已绑定课程',
+
+					},
+				],
+			}
+		},
+		components: {
+			commonDialog,
+		},
+		onLoad(options) {
+			this.id = options.id
+			this.getList()
+		},
+		methods: {
+			changeTab(data){
+				console.log('data',data);
+			},
+			goUpPage() {
+				if (this.pageInfo.from == 'banzheng') {
+					uni.redirectTo({
+						url: "/pages/admin/banzheng/list"
+					})
+				} else {
+					uni.redirectTo({
+						url: "/pages/admin/Jiazheng/index"
+					})
+				}
+			},
+			getList() {
+				let req = {
+					id: this.id,
+					"kcClassifyId": this.kcClassifyId,
+				}
+				kcSelectList(req).then(res => {
+					if (res.code == 0) {
+						this.list = res.data
+					} else {
+						return false
+					}
+				})
+			},
+		}
+	}
+</script>