Browse Source

临时提交

master
王泽彦 8 months ago
parent
commit
980e5a7cb1
  1. 118
      niucloud/app/api/controller/apiController/StaticResource.php
  2. 30
      niucloud/app/api/route/static_resource.php
  3. 112
      niucloud/app/listener/personnel/Student.php
  4. 9
      niucloud/app/service/api/apiService/ResourceSharingService.php
  5. 3
      niucloud/app/service/api/pay/PayService.php
  6. BIN
      niucloud/public/static/resource/uniapp/icon-img/boy.png
  7. 0
      niucloud/public/static/resource/uniapp/icon-img/delete.png
  8. 0
      niucloud/public/static/resource/uniapp/icon-img/ding_wei.png
  9. 0
      niucloud/public/static/resource/uniapp/icon-img/empty.png
  10. BIN
      niucloud/public/static/resource/uniapp/icon-img/girl.png
  11. 0
      niucloud/public/static/resource/uniapp/icon-img/guoqi.png
  12. BIN
      niucloud/public/static/resource/uniapp/icon-img/home-active.png
  13. BIN
      niucloud/public/static/resource/uniapp/icon-img/home.png
  14. 0
      niucloud/public/static/resource/uniapp/icon-img/kkry.png
  15. 0
      niucloud/public/static/resource/uniapp/icon-img/liu.png
  16. 0
      niucloud/public/static/resource/uniapp/icon-img/loading_white.png
  17. 0
      niucloud/public/static/resource/uniapp/icon-img/notice.png
  18. BIN
      niucloud/public/static/resource/uniapp/icon-img/profile-active.png
  19. BIN
      niucloud/public/static/resource/uniapp/icon-img/profile.png
  20. 0
      niucloud/public/static/resource/uniapp/icon-img/tou.png
  21. 0
      niucloud/public/static/resource/uniapp/icon-img/uploadImg.png
  22. 0
      niucloud/public/static/resource/uniapp/icon-img/used.png
  23. 0
      niucloud/public/static/resource/uniapp/icon-img/warn.png
  24. 0
      niucloud/public/static/resource/uniapp/icon-img/weixin.png
  25. BIN
      niucloud/public/static/resource/uniapp/rate/none.png
  26. 3
      uniapp/App.vue
  27. 7
      uniapp/common/util.js
  28. 2
      uniapp/components/schedule/ScheduleDetail.vue
  29. 14
      uniapp/components/student-info-card/student-info-card.vue
  30. 2
      uniapp/pages.json
  31. 6
      uniapp/pages/coach/home/index.vue
  32. 2
      uniapp/pages/coach/my/due_soon.vue
  33. 4
      uniapp/pages/coach/schedule/sign_in.vue
  34. 4
      uniapp/pages/coach/student/student_list.vue
  35. 2
      uniapp/pages/common/home/index.vue
  36. 2
      uniapp/pages/common/my_attendance.vue
  37. 2
      uniapp/pages/common/profile/index.vue
  38. 5
      uniapp/pages/market/clue/class_arrangement.vue
  39. 2423
      uniapp/pages/market/clue/clue_info.less
  40. 1408
      uniapp/pages/market/clue/clue_info.scss
  41. 30
      uniapp/pages/market/clue/clue_info.vue
  42. 7
      uniapp/pages/market/clue/index.vue
  43. 2
      uniapp/pages/market/index/index.vue
  44. 14
      uniapp/pages/parent/user-info/index.vue
  45. 1094
      uniapp/pages/student/index/index.vue
  46. BIN
      uniapp/static/icon-img/home-active.png
  47. BIN
      uniapp/static/icon-img/home.png
  48. BIN
      uniapp/static/icon-img/profile-active.png
  49. BIN
      uniapp/static/icon-img/profile.png
  50. 124
      uniapp/utils/staticResource.js

118
niucloud/app/api/controller/apiController/StaticResource.php

@ -0,0 +1,118 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\api\controller\apiController;
use app\Request;
use core\base\BaseApiService;
/**
* 静态资源访问接口
* Class StaticResource
* @package app\api\controller\apiController
*/
class StaticResource extends BaseApiService
{
/**
* 获取静态资源URL
*/
public function getResourceUrl(Request $request)
{
$resource_path = $request->param('path', ''); // 资源路径,如:icon-img/home.png
if (empty($resource_path)) {
return fail('资源路径不能为空');
}
// 基础URL配置 - 从配置文件或环境变量读取
$baseUrl = $request->domain() ?: 'http://localhost:20080';
// 构建完整的静态资源URL
$resourceUrl = $baseUrl . '/static/resource/uniapp/' . $resource_path;
return success([
'resource_url' => $resourceUrl,
'base_url' => $baseUrl . '/static/resource/uniapp/',
'path' => $resource_path
]);
}
/**
* 批量获取静态资源URL
*/
public function getBatchResourceUrls(Request $request)
{
$paths = $request->param('paths', []); // 资源路径数组
if (empty($paths) || !is_array($paths)) {
return fail('资源路径数组不能为空');
}
// 基础URL配置
$baseUrl = $request->domain() ?: 'http://localhost:20080';
$baseResourceUrl = $baseUrl . '/static/resource/uniapp/';
$results = [];
foreach ($paths as $path) {
$results[$path] = $baseResourceUrl . $path;
}
return success([
'base_url' => $baseResourceUrl,
'resources' => $results
]);
}
/**
* 获取所有可用的图标资源
*/
public function getIconList(Request $request)
{
$baseUrl = $request->domain() ?: 'http://localhost:20080';
$baseResourceUrl = $baseUrl . '/static/resource/uniapp/';
// 定义所有可用的图标
$icons = [
'delete.png',
'ding_wei.png',
'empty.png',
'guoqi.png',
'home-active.png',
'home.png',
'kkry.png',
'liu.png',
'loading_white.png',
'notice.png',
'profile-active.png',
'profile.png',
'tou.png',
'uploadImg.png',
'used.png',
'warn.png',
'weixin.png'
];
$iconUrls = [];
foreach ($icons as $icon) {
$iconUrls['icon-img/' . $icon] = $baseResourceUrl . 'icon-img/' . $icon;
}
// 添加评分图标
$iconUrls['rate/none.png'] = $baseResourceUrl . 'rate/none.png';
return success([
'base_url' => $baseResourceUrl,
'icons' => $iconUrls,
'count' => count($iconUrls)
]);
}
}

30
niucloud/app/api/route/static_resource.php

@ -0,0 +1,30 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
use app\api\controller\apiController\StaticResource;
use think\facade\Route;
/**
* 静态资源路由
*/
Route::group(function () {
// 获取单个静态资源URL
Route::get('resource/url', 'apiController.StaticResource/getResourceUrl');
// 批量获取静态资源URL
Route::post('resource/batch-urls', 'apiController.StaticResource/getBatchResourceUrls');
// 获取所有图标列表
Route::get('resource/icons', 'apiController.StaticResource/getIconList');
})->middleware([
app\api\middleware\ApiPersonnelCheckToken::class
]);

112
niucloud/app/listener/personnel/Student.php

@ -59,64 +59,15 @@ class Student
}
public function studentAdd($order_info){
$student = new \app\model\student\Student();
$order = new OrderTable();
$cust = new CustomerResources();
$class_resources_rel = new ClassResourcesRel();
$course = new Course();
$studentCourses = new StudentCourses();
$order_count = $order->where(['resource_id' => $order_info['resource_id']])->count();
$cust_info = $cust->where(['id' => $order_info['resource_id']])->find();
//创建学员关系逻辑
if($order_count <= 1){
$sex_arr = ['male' => 1, 'female' => 2, 'other' => 0];
//首次支付创建学员
$student_id = $student->insertGetId([
'name' => $cust_info['name'],
'gender' => $sex_arr[$cust_info['gender']],
'age' => $cust_info['age'],
'campus_id' => $cust_info['campus'],
'class_id' => $order_info['class_id'],
'status' => 1,
'user_id' => $order_info['resource_id']
]);
}else{
$student_id = $student->where(['user_id' => $order_info['resource_id'],'class_id' => $order_info['class_id']])->value('id');
}
//学员课程逻辑
$course_info = $course->where(['id' => $order_info['course_id']])->find();
$studentCourses->insert([
'student_id' => $student_id,
'course_id' => $order_info['course_id'],
'total_hours' => $course_info['session_count'],
'gift_hours' => $course_info['gift_session_count'],
'start_date' => date("Y-m-d"),
'end_date' => date("Y-m-d", strtotime("+30 days")),
'single_session_count' => $course_info['single_session_count'],
'resource_id'=> $order_info['resource_id']
]);
//班级资源关系逻辑
$is_rel = $class_resources_rel->where(
['resource_id' => $order_info['resource_id'],'class_id' => $order_info['class_id']]
)->find();
if($is_rel){
$class_resources_rel->where(['id' => $is_rel['id']])->update(['status' => 2]);
}else{
$class_resources_rel->insert([
'class_id' => $order_info['class_id'],
'resource_id' => $order_info['resource_id'],
'campus_id' => $cust_info['campus'],
'source_type' => 'student',
'join_time' => time(),
'status' => 1,
'create_time' => date("Y-m-d H:i:s"),
'update_time' => date("Y-m-d H:i:s")
]);
}
$cust_info = $cust->where(['id' => $order_info['resource_id']])->find();
// 1. 检查课程关联的合同
$contract = new Contract();
$contract_info = $contract
->alias("a")
@ -125,13 +76,60 @@ class Student
->field("a.id,a.contract_template")
->find();
// 2. 建立合同签订关系(同时设置personnel_id和student_id)
if ($contract_info) {
$contract_sign = new ContractSign();
$contract_sign->insert([
'contract_id' => $contract_info['id'],
'personnel_id' => $order_info['resource_id'], // 客户资源ID
'student_id' => $order_info['student_id'], // 学员ID
'sign_file' => $contract_info['contract_template'],
'type' => 2
]);
}
// 3. 获取课程信息
$course_info = $course->where(['id' => $order_info['course_id']])->find();
// 4. 查询学员是否有有效的课程安排
$existing_course = $studentCourses
->where([
'student_id' => $order_info['student_id'],
'status' => 1 // 假设1表示正常状态
])
// 有效课程条件:总课时+赠送课时 - 已用总课时 - 已用赠送课时 > 0 且 结束时间 > 当前时间
->where('(total_hours + gift_hours - use_total_hours - use_gift_hours) > 0')
->where('end_date > ?', [date('Y-m-d')])
->order('id', 'desc') // 按ID降序,取最新的一个
->find();
// 5. 计算开始时间和结束时间
if ($existing_course) {
// 如果有有效课程,开始时间 = 最新课程的结束时间 + 1天,结束时间 = 开始时间 + duration天
$start_date = date("Y-m-d", strtotime($existing_course['end_date'] . " +1 day"));
$end_date = date("Y-m-d", strtotime($start_date . " +" . $course_info['duration'] . " days"));
} else {
// 如果没有有效课程,开始时间 = 当前时间,结束时间 = 当前时间 + duration天
$start_date = date("Y-m-d");
$end_date = date("Y-m-d", strtotime("+" . $course_info['duration'] . " days"));
}
// 6. 插入学员课程记录
$student_course_id = $studentCourses->insertGetId([
'student_id' => $order_info['student_id'],
'course_id' => $order_info['course_id'],
'total_hours' => $course_info['session_count'],
'gift_hours' => $course_info['gift_session_count'],
'start_date' => $start_date,
'end_date' => $end_date,
'single_session_count' => $course_info['single_session_count'],
'resource_id' => $order_info['resource_id'],
'status' => 1 // 设置为正常状态
]);
$contract_sign = new ContractSign();
$contract_sign->insert([
'contract_id' => $contract_info['id'],
'personnel_id' => $order_info['resource_id'],
'sign_file' => $contract_info['contract_template'],
'type' => 2
// 7. 更新订单表的course_plan_id
$order->where(['id' => $order_info['id']])->update([
'course_plan_id' => $student_course_id
]);
}

9
niucloud/app/service/api/apiService/ResourceSharingService.php

@ -250,11 +250,14 @@ class ResourceSharingService extends BaseApiService
}
// 过滤已分配的资源(只显示可再分配的资源)
// 注意:这里需要用子查询包装OR条件,避免与其他WHERE条件冲突
$model = $model->when($where['shared_by'] > 0, function ($query) use ($where) {
$query->where('shared_by', $where['shared_by'])->whereOr('user_id', $where['shared_by']);
$query->where(function ($subQuery) use ($where) {
$subQuery->where('shared_by', $where['shared_by'])->whereOr('user_id', $where['shared_by']);
});
}, function ($query) {
$query->where(function ($query) {
$query->where('shared_by', 0)->whereOr('shared_by', null);
$query->where(function ($subQuery) {
$subQuery->where('shared_by', 0)->whereOr('shared_by', null);
});
});

3
niucloud/app/service/api/pay/PayService.php

@ -178,7 +178,8 @@ class PayService extends BaseApiService
);
$info = json_decode($decrypted, true);
$order->where(['payment_id' => $info['out_trade_no']])->update(['order_status' => 'paid','payment_time' => date("Y-m-d H:i:s")]);
$order->where(['payment_id' => $info['out_trade_no']])
->update(['order_status' => 'paid','payment_time' => date("Y-m-d H:i:s")]);
$payModel = new Pay();
$payModel->where(['trade_id' => $order_id])->update([

BIN
niucloud/public/static/resource/uniapp/icon-img/boy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

0
uniapp/static/icon-img/delete.png → niucloud/public/static/resource/uniapp/icon-img/delete.png

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

0
uniapp/static/icon-img/ding_wei.png → niucloud/public/static/resource/uniapp/icon-img/ding_wei.png

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
uniapp/static/icon-img/empty.png → niucloud/public/static/resource/uniapp/icon-img/empty.png

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
niucloud/public/static/resource/uniapp/icon-img/girl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

0
uniapp/static/icon-img/guoqi.png → niucloud/public/static/resource/uniapp/icon-img/guoqi.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
niucloud/public/static/resource/uniapp/icon-img/home-active.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
niucloud/public/static/resource/uniapp/icon-img/home.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

0
uniapp/static/icon-img/kkry.png → niucloud/public/static/resource/uniapp/icon-img/kkry.png

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

0
uniapp/static/icon-img/liu.png → niucloud/public/static/resource/uniapp/icon-img/liu.png

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

0
uniapp/static/icon-img/loading_white.png → niucloud/public/static/resource/uniapp/icon-img/loading_white.png

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

0
uniapp/static/icon-img/notice.png → niucloud/public/static/resource/uniapp/icon-img/notice.png

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
niucloud/public/static/resource/uniapp/icon-img/profile-active.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
niucloud/public/static/resource/uniapp/icon-img/profile.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

0
uniapp/static/icon-img/tou.png → niucloud/public/static/resource/uniapp/icon-img/tou.png

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

0
uniapp/static/icon-img/uploadImg.png → niucloud/public/static/resource/uniapp/icon-img/uploadImg.png

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

0
uniapp/static/icon-img/used.png → niucloud/public/static/resource/uniapp/icon-img/used.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
uniapp/static/icon-img/warn.png → niucloud/public/static/resource/uniapp/icon-img/warn.png

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

0
uniapp/static/icon-img/weixin.png → niucloud/public/static/resource/uniapp/icon-img/weixin.png

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
niucloud/public/static/resource/uniapp/rate/none.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

3
uniapp/App.vue

@ -42,6 +42,7 @@
</script>
<style lang="scss">
@import '~@/static/styles/app.scss';
// 使
@import '@/static/styles/app.scss';
@import "@/uni.scss";
</style>

7
uniapp/common/util.js

@ -117,6 +117,13 @@ function img(img_path, params) {
arr.push(suffix);
img_path = arr.join(".");
}
// 处理静态资源路径的迁移
if (img_path.startsWith('/static/')) {
// 将旧的 /static/ 路径转换为新的后端静态资源路径
img_path = img_path.replace('/static/', 'static/resource/uniapp/');
}
if (img_path.indexOf("http://") == -1 && img_path.indexOf("https://") == -1) {
path = img_domian + "/" + img_path;
} else {

2
uniapp/components/schedule/ScheduleDetail.vue

@ -181,7 +181,7 @@
<view class="attendance-modal" v-if="selectedStudent">
<view class="student-info">
<view class="student-avatar-large">
<image :src="selectedStudent.avatar || '/static/icon-img/avatar.png'" mode="aspectFill"></image>
<image :src="selectedStudent.avatar || $util.img('/static/icon-img/avatar.png')" mode="aspectFill"></image>
</view>
<view class="student-name-large">{{ selectedStudent.name }}</view>
<view class="current-status">当前状态{{ selectedStudent.status_text }}</view>

14
uniapp/components/student-info-card/student-info-card.vue

@ -23,13 +23,10 @@
</view>
</view>
</view>
<view class="action-toggle" @click="toggleActions">
<text class="toggle-icon">{{ student.actionsExpanded ? '▲' : '▼' }}</text>
</view>
</view>
<!-- 学生详细信息 -->
<view class="student-info" v-if="showDetails">
<view class="student-info">
<view class="info-row">
<text class="info-label">生日</text>
<text class="info-value">{{ student.birthday || '' }}</text>
@ -54,15 +51,6 @@
<text class="info-label">课程到访情况</text>
<text class="info-value">{{ student.course_visit_status || '' }}</text>
</view>
<!-- 保留原有紧急联系人等字段有值才显示 -->
<view class="info-row" v-if="student.emergency_contact">
<text class="info-label">紧急联系人</text>
<text class="info-value">{{ student.emergency_contact }}</text>
</view>
<view class="info-row" v-if="student.contact_phone">
<text class="info-label">联系电话</text>
<text class="info-value">{{ student.contact_phone }}</text>
</view>
</view>
<!-- 操作按钮区域 -->

2
uniapp/pages.json

@ -612,7 +612,7 @@
},
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#3cc51f",
"selectedColor": "#29d3b4",
"borderStyle": "black",
"backgroundColor": "#1a1a1a",
"list": [

6
uniapp/pages/coach/home/index.vue

@ -64,7 +64,7 @@
</view>
<!-- 没有数据时的占位区域 -->
<view class="empty-placeholder" v-else>
<image src="/static/icon-img/empty.png" mode="aspectFit"></image>
<image :src="$util.img('/static/icon-img/empty.png')" mode="aspectFit"></image>
<text>暂无课程数据</text>
</view>
</view>
@ -104,7 +104,7 @@
</view>
<!-- 没有数据时的占位区域 -->
<view class="empty-placeholder" v-else>
<image src="/static/icon-img/empty.png" mode="aspectFit"></image>
<image :src="$util.img('/static/icon-img/empty.png')" mode="aspectFit"></image>
<text>暂无作业数据</text>
</view>
</view>
@ -132,7 +132,7 @@
</view>
<!-- 没有数据时的占位区域 -->
<view class="empty-placeholder" v-else>
<image src="/static/icon-img/empty.png" mode="aspectFit"></image>
<image :src="$util.img('/static/icon-img/empty.png')" mode="aspectFit"></image>
<text>暂无服务数据</text>
</view>
</view>

2
uniapp/pages/coach/my/due_soon.vue

@ -14,7 +14,7 @@
<view class="li" v-for="(item, index) in studentList" :key="index">
<view class="left">
<view class="box_1">
<image :src="item.avatar || '/static/icon-img/avatar.png'" mode="aspectFill" class="pic"></image>
<image :src="item.avatar || $util.img('/static/icon-img/avatar.png')" mode="aspectFill" class="pic"></image>
<view class="tag_box">
即将到期
</view>

4
uniapp/pages/coach/schedule/sign_in.vue

@ -35,7 +35,7 @@
</view>
<view class="empty-list" v-if="studentList.length === 0">
<image src="/static/icon-img/empty.png" mode="aspectFit" class="empty-img"></image>
<image :src="$util.img('/static/icon-img/empty.png')" mode="aspectFit" class="empty-img"></image>
<text class="empty-text">暂无学员数据</text>
</view>
@ -43,7 +43,7 @@
<view class="student-item" v-for="(student, index) in studentList" :key="index"
@click="toggleStudentStatus(index)">
<view class="student-avatar">
<image :src="student.avatar || '/static/icon-img/avatar.png'" mode="aspectFill"></image>
<image :src="student.avatar || $util.img('/static/icon-img/avatar.png')" mode="aspectFill"></image>
<view :class="['status-badge',student.statusClass]"></view>
</view>

4
uniapp/pages/coach/student/student_list.vue

@ -6,14 +6,14 @@
</view>
<view class="content">
<view v-if="studentList.length === 0" class="empty-box">
<image src="/static/icon-img/empty.png" mode="aspectFit" class="empty-img"></image>
<image :src="$util.img('/static/icon-img/empty.png')" mode="aspectFit" class="empty-img"></image>
<text class="empty-text">暂无学员数据</text>
</view>
<view v-else class="student-list">
<view v-for="(item, index) in studentList" :key="index" class="student-item" @click="goToDetail(item)">
<view class="student-card">
<view class="student-avatar">
<image :src="item.avatar || '/static/icon-img/avatar.png'" mode="aspectFill" class="avatar-img"></image>
<image :src="item.avatar || $util.img('/static/icon-img/avatar.png')" mode="aspectFill" class="avatar-img"></image>
</view>
<view class="student-info">
<view class="student-name">{{item.name}}</view>

2
uniapp/pages/common/home/index.vue

@ -11,7 +11,7 @@
<!-- 用户信息区域 -->
<view class="user-info-section">
<view class="user-avatar">
<image :src="userInfo.avatar || '/static/icon-img/tou.png'" mode="aspectFill"></image>
<image :src="userInfo.avatar || $util.img('/static/icon-img/tou.png')" mode="aspectFill"></image>
</view>
<view class="user-details">
<text class="user-name">{{ userInfo.name || '员工姓名' }}</text>

2
uniapp/pages/common/my_attendance.vue

@ -898,7 +898,7 @@ export default {
longitude: Number(item.longitude),
// name: item.campus_address,
iconPath: '/static/icon-img/ding_wei.png',
iconPath: this.$util.img('/static/icon-img/ding_wei.png'),
width: 30,
height: 30
}

2
uniapp/pages/common/profile/index.vue

@ -11,7 +11,7 @@
<!-- 用户头像和基本信息 -->
<view class="profile-header">
<view class="avatar-section">
<image :src="userInfo.avatar || '/static/icon-img/tou.png'" mode="aspectFill"></image>
<image :src="userInfo.avatar || $util.img('/static/icon-img/tou.png')" mode="aspectFill"></image>
</view>
<view class="user-info">
<text class="user-name">{{ userInfo.name || '员工姓名' }}</text>

5
uniapp/pages/market/clue/class_arrangement.vue

@ -96,9 +96,9 @@
<view class="row">教室{{ course.venue.venue_name }}</view>
<view class="row">课程{{ course.course.course_name }}</view>
<view class="row">人数{{ course.available_capacity }}</view>
<view class="row">安排情况{{ course.student.length }}/{{course.max_students ? course.max_students : '不限'}}</view>
</view>
<view class="card-footer">
<view class="sign-info"></view>
<button class="detail-btn" @click="viewDetail(course)">详情</button>
</view>
</view>
@ -405,7 +405,8 @@
border-radius: 8rpx;
padding: 6rpx 24rpx;
font-size: 24rpx;
margin-left: 10rpx;
width: 100%;
margin-top: 40rpx;
}
}
}

2423
uniapp/pages/market/clue/clue_info.less

File diff suppressed because it is too large

1408
uniapp/pages/market/clue/clue_info.scss

File diff suppressed because it is too large

30
uniapp/pages/market/clue/clue_info.vue

@ -49,26 +49,26 @@
:show-details="true"
@action="handleStudentAction"
/>
<!-- 操作按钮区域 - 每个学生卡片都有自己的按钮 -->
<view class="action-buttons-section">
<view
class="action-item"
v-for="action in actionButtons"
:key="action.key"
@click="handleStudentActionClick(action, student)"
>
<view class="action-icon">
<text>{{ action.icon }}</text>
</view>
<text class="action-text">{{ action.text }}</text>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
<!-- 操作按钮区域 - 移到Swiper外部独立滑动 -->
<view class="action-buttons-section" v-if="currentStudent">
<view
class="action-item"
v-for="action in actionButtons"
:key="action.key"
@click="handleStudentActionClick(action, currentStudent)"
>
<view class="action-icon">
<text>{{ action.icon }}</text>
</view>
<text class="action-text">{{ action.text }}</text>
</view>
</view>
<!-- 空状态 -->
<view v-if="studentList.length === 0" class="empty-state">
<text class="empty-icon">👤</text>

7
uniapp/pages/market/clue/index.vue

@ -343,19 +343,12 @@
</fui-drawer>
<view style="height: 170rpx;"></view>
<AQTabber />
</view>
</template>
<script>
import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
import marketApi from '@/api/market.js';
export default {
components: {
AQTabber,
},
data() {
return {
loading: false, //

2
uniapp/pages/market/index/index.vue

@ -6,7 +6,7 @@
<picker mode="date" fields="month" :value="currentDate" @change="onDateChange">
<view class="date-picker">
<text>{{currentDate}}</text>
<image class="drop-image" src="/static/images/drop.png" mode="aspectFit"></image>
<image class="drop-image" :src="$util.img('/static/images/drop.png')" mode="aspectFit"></image>
</view>
</picker>
</view>

14
uniapp/pages/parent/user-info/index.vue

@ -80,49 +80,49 @@
<view class="grid_container">
<view class="grid_item" @click="viewChildDetail">
<view class="grid_icon">
<image src="/static/icon-img/tou.png" class="icon_image"></image>
<image :src="$util.img('/static/icon-img/tou.png')" class="icon_image"></image>
</view>
<view class="grid_text">孩子详情</view>
</view>
<view class="grid_item" @click="viewCourses">
<view class="grid_icon">
<image src="/static/icon-img/kkry.png" class="icon_image"></image>
<image :src="$util.img('/static/icon-img/kkry.png')" class="icon_image"></image>
</view>
<view class="grid_text">课程管理</view>
</view>
<view class="grid_item" @click="viewMaterials">
<view class="grid_icon">
<image src="/static/icon-img/liu.png" class="icon_image"></image>
<image :src="$util.img('/static/icon-img/liu.png')" class="icon_image"></image>
</view>
<view class="grid_text">教学资料</view>
</view>
<view class="grid_item" @click="viewServices">
<view class="grid_icon">
<image src="/static/icon-img/notice.png" class="icon_image"></image>
<image :src="$util.img('/static/icon-img/notice.png')" class="icon_image"></image>
</view>
<view class="grid_text">服务管理</view>
</view>
<view class="grid_item" @click="viewOrders">
<view class="grid_icon">
<image src="/static/icon-img/used.png" class="icon_image"></image>
<image :src="$util.img('/static/icon-img/used.png')" class="icon_image"></image>
</view>
<view class="grid_text">订单管理</view>
</view>
<view class="grid_item" @click="viewMessages">
<view class="grid_icon">
<image src="/static/icon-img/notice.png" class="icon_image"></image>
<image :src="$util.img('/static/icon-img/notice.png')" class="icon_image"></image>
</view>
<view class="grid_text">消息管理</view>
</view>
<view class="grid_item" @click="viewContracts">
<view class="grid_icon">
<image src="/static/icon-img/warn.png" class="icon_image"></image>
<image :src="$util.img('/static/icon-img/warn.png')" class="icon_image"></image>
</view>
<view class="grid_text">合同管理</view>
</view>

1094
uniapp/pages/student/index/index.vue

File diff suppressed because it is too large

BIN
uniapp/static/icon-img/home-active.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
uniapp/static/icon-img/home.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
uniapp/static/icon-img/profile-active.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
uniapp/static/icon-img/profile.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

124
uniapp/utils/staticResource.js

@ -0,0 +1,124 @@
/**
* 静态资源URL工具类
* 用于获取后端提供的静态资源URL
*/
// 配置基础URL
const config = {
// 后端API基础URL,从环境变量或配置文件读取
baseUrl: process.env.NODE_ENV === 'development' ? 'http://localhost:20080' : 'https://your-domain.com',
// 静态资源基础路径
staticBasePath: '/static/resource/uniapp/'
}
/**
* 获取静态资源的完整URL
* @param {string} resourcePath - 资源相对路径'icon-img/home.png'
* @returns {string} 完整的资源URL
*/
export function getStaticResourceUrl(resourcePath) {
if (!resourcePath) {
console.warn('staticResource: resourcePath is empty')
return ''
}
// 移除开头的 '/' 或 'static/'
const cleanPath = resourcePath.replace(/^(\/|static\/)?/, '')
return config.baseUrl + config.staticBasePath + cleanPath
}
/**
* 批量获取静态资源URL
* @param {Array<string>} resourcePaths - 资源路径数组
* @returns {Object} 路径到URL的映射对象
*/
export function getBatchStaticResourceUrls(resourcePaths) {
if (!Array.isArray(resourcePaths)) {
console.warn('staticResource: resourcePaths must be an array')
return {}
}
const results = {}
resourcePaths.forEach(path => {
results[path] = getStaticResourceUrl(path)
})
return results
}
/**
* 获取图标资源URL的便捷方法
* @param {string} iconName - 图标文件名'home.png'
* @returns {string} 图标URL
*/
export function getIconUrl(iconName) {
return getStaticResourceUrl(`icon-img/${iconName}`)
}
/**
* 获取评分图标URL
* @param {string} rateName - 评分图标名'none.png'
* @returns {string} 评分图标URL
*/
export function getRateIconUrl(rateName) {
return getStaticResourceUrl(`rate/${rateName}`)
}
/**
* 预定义的常用图标URL
*/
export const COMMON_ICONS = {
// 导航图标
HOME: () => getIconUrl('home.png'),
HOME_ACTIVE: () => getIconUrl('home-active.png'),
PROFILE: () => getIconUrl('profile.png'),
PROFILE_ACTIVE: () => getIconUrl('profile-active.png'),
// 功能图标
EMPTY: () => getIconUrl('empty.png'),
DELETE: () => getIconUrl('delete.png'),
LOCATION: () => getIconUrl('ding_wei.png'),
NOTICE: () => getIconUrl('notice.png'),
WARNING: () => getIconUrl('warn.png'),
LOADING: () => getIconUrl('loading_white.png'),
// 用户相关
AVATAR: () => getIconUrl('tou.png'),
UPLOAD: () => getIconUrl('uploadImg.png'),
// 其他
EXPIRED: () => getIconUrl('guoqi.png'),
USED: () => getIconUrl('used.png'),
WECHAT: () => getIconUrl('weixin.png'),
// 评分
RATE_NONE: () => getRateIconUrl('none.png')
}
/**
* 更新配置
* @param {Object} newConfig - 新的配置对象
*/
export function updateConfig(newConfig) {
Object.assign(config, newConfig)
}
/**
* 获取当前配置
* @returns {Object} 当前配置
*/
export function getConfig() {
return { ...config }
}
// 默认导出主要函数
export default {
getStaticResourceUrl,
getBatchStaticResourceUrls,
getIconUrl,
getRateIconUrl,
COMMON_ICONS,
updateConfig,
getConfig
}
Loading…
Cancel
Save