Browse Source

no message

seamwang 1 year ago
parent
commit
5b00e0734f
100 changed files with 814 additions and 598 deletions
  1. 0 231
      dist/build/mp-weixin/common/main.wxss
  2. 0 1
      dist/build/mp-weixin/components/shop-cart.wxml
  3. 0 1
      dist/build/mp-weixin/components/shop-cart.wxss
  4. 0 1
      dist/build/mp-weixin/components/swiper-tab.wxml
  5. 0 1
      dist/build/mp-weixin/components/swiper-tab.wxss
  6. 0 1
      dist/build/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-calendar/uni-calendar-item.wxml
  7. 0 1
      dist/build/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-calendar/uni-calendar-item.wxss
  8. 0 1
      dist/build/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-calendar/uni-calendar.wxml
  9. 0 1
      dist/build/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-calendar/uni-calendar.wxss
  10. 0 1
      dist/build/mp-weixin/pages/agreement/index.js
  11. 0 1
      dist/build/mp-weixin/pages/agreement/index.wxml
  12. 0 1
      dist/build/mp-weixin/pages/class/bindPhone.js
  13. 0 1
      dist/build/mp-weixin/pages/class/bindPhone.wxml
  14. 0 1
      dist/build/mp-weixin/pages/class/bindPhone.wxss
  15. 0 1
      dist/build/mp-weixin/pages/class/detail.js
  16. 0 1
      dist/build/mp-weixin/pages/class/detail.wxml
  17. 0 1
      dist/build/mp-weixin/pages/class/detail.wxss
  18. 0 1
      dist/build/mp-weixin/pages/class/gift.js
  19. 0 1
      dist/build/mp-weixin/pages/class/gift.wxml
  20. 0 1
      dist/build/mp-weixin/pages/class/gift.wxss
  21. 0 1
      dist/build/mp-weixin/pages/class/shoppingCart.js
  22. 0 1
      dist/build/mp-weixin/pages/class/shoppingCart.wxml
  23. 0 1
      dist/build/mp-weixin/pages/class/shoppingCart.wxss
  24. 0 1
      dist/build/mp-weixin/pages/index/components/card.wxml
  25. 0 1
      dist/build/mp-weixin/pages/index/components/card.wxss
  26. 0 1
      dist/build/mp-weixin/pages/index/components/course.wxml
  27. 0 1
      dist/build/mp-weixin/pages/index/components/course.wxss
  28. 0 1
      dist/build/mp-weixin/pages/index/index.js
  29. 0 1
      dist/build/mp-weixin/pages/index/index.wxml
  30. 0 1
      dist/build/mp-weixin/pages/login/index.js
  31. 0 1
      dist/build/mp-weixin/pages/login/index.wxml
  32. 0 1
      dist/build/mp-weixin/pages/login/index.wxss
  33. 0 1
      dist/build/mp-weixin/pages/mine/changePhone.js
  34. 0 1
      dist/build/mp-weixin/pages/mine/changePhone.wxml
  35. 0 1
      dist/build/mp-weixin/pages/mine/changePhone.wxss
  36. 0 1
      dist/build/mp-weixin/pages/mine/institution.js
  37. 0 1
      dist/build/mp-weixin/pages/mine/institution.wxml
  38. 0 1
      dist/build/mp-weixin/pages/mine/institution.wxss
  39. 0 1
      dist/build/mp-weixin/pages/mine/message.js
  40. 0 1
      dist/build/mp-weixin/pages/mine/message.wxml
  41. 0 1
      dist/build/mp-weixin/pages/mine/message.wxss
  42. 0 1
      dist/build/mp-weixin/pages/mine/mine.js
  43. 0 1
      dist/build/mp-weixin/pages/mine/mine.wxml
  44. 0 1
      dist/build/mp-weixin/pages/mine/onlineService.js
  45. 0 1
      dist/build/mp-weixin/pages/mine/onlineService.wxml
  46. 0 1
      dist/build/mp-weixin/pages/mine/onlineService.wxss
  47. 0 1
      dist/build/mp-weixin/pages/mine/parents.js
  48. 0 1
      dist/build/mp-weixin/pages/mine/parents.wxml
  49. 0 1
      dist/build/mp-weixin/pages/mine/parents.wxss
  50. 0 1
      dist/build/mp-weixin/pages/mine/setting.js
  51. 0 1
      dist/build/mp-weixin/pages/mine/setting.wxml
  52. 0 1
      dist/build/mp-weixin/pages/mine/setting.wxss
  53. 0 1
      dist/build/mp-weixin/pages/mine/teachers.js
  54. 0 1
      dist/build/mp-weixin/pages/mine/teachers.wxml
  55. 0 1
      dist/build/mp-weixin/pages/mine/teachers.wxss
  56. 0 1
      dist/build/mp-weixin/pages/myStudents/myStudents.js
  57. 0 1
      dist/build/mp-weixin/pages/myStudents/myStudents.wxml
  58. 0 1
      dist/build/mp-weixin/pages/myStudents/myStudents.wxss
  59. 0 1
      dist/build/mp-weixin/pages/order/index.js
  60. 0 1
      dist/build/mp-weixin/pages/order/index.wxml
  61. 0 1
      dist/build/mp-weixin/pages/order/index.wxss
  62. 0 1
      dist/build/mp-weixin/pages/studentcenter/absent.js
  63. 0 1
      dist/build/mp-weixin/pages/studentcenter/absent.wxml
  64. 0 1
      dist/build/mp-weixin/pages/studentcenter/absent.wxss
  65. 0 1
      dist/build/mp-weixin/pages/studentcenter/classVideo.js
  66. 0 1
      dist/build/mp-weixin/pages/studentcenter/classVideo.wxml
  67. 0 1
      dist/build/mp-weixin/pages/studentcenter/classVideo.wxss
  68. 0 1
      dist/build/mp-weixin/pages/studentcenter/evaluate.js
  69. 0 1
      dist/build/mp-weixin/pages/studentcenter/evaluate.wxml
  70. 0 1
      dist/build/mp-weixin/pages/studentcenter/evaluate.wxss
  71. 0 1
      dist/build/mp-weixin/pages/studentcenter/index.js
  72. 0 1
      dist/build/mp-weixin/pages/studentcenter/index.wxml
  73. 0 1
      dist/build/mp-weixin/pages/studentcenter/operation.js
  74. 0 1
      dist/build/mp-weixin/pages/studentcenter/operation.wxml
  75. 0 1
      dist/build/mp-weixin/pages/studentcenter/operation.wxss
  76. 0 1
      dist/build/mp-weixin/pages/studentcenter/signIn.js
  77. 0 1
      dist/build/mp-weixin/pages/studentcenter/signIn.wxml
  78. 0 1
      dist/build/mp-weixin/pages/studentcenter/signIn.wxss
  79. 0 1
      dist/build/mp-weixin/pages/studentcenter/works.js
  80. 0 1
      dist/build/mp-weixin/pages/studentcenter/works.wxml
  81. 0 1
      dist/build/mp-weixin/pages/studentcenter/works.wxss
  82. 0 54
      dist/build/mp-weixin/project.config.json
  83. 4 0
      src/api/course.js
  84. 44 43
      src/common/commonMethods.js
  85. 11 0
      src/common/css/common.css
  86. 2 0
      src/common/urlMap.js
  87. 105 0
      src/components/star-rating.vue
  88. 8 0
      src/pages.json
  89. 59 65
      src/pages/class/detail.vue
  90. 82 23
      src/pages/class/gift.vue
  91. 16 11
      src/pages/index/components/card.vue
  92. 91 69
      src/pages/index/index.vue
  93. 56 0
      src/pages/mine/courseFiles.vue
  94. 166 0
      src/pages/mine/fileDetail.vue
  95. 7 7
      src/pages/mine/message.vue
  96. 7 0
      src/pages/mine/mine.vue
  97. 156 15
      src/pages/studentcenter/works.vue
  98. BIN
      src/static/imgs/intelligent-bg.png
  99. BIN
      src/static/imgs/star-rating/delivery_icon_star_active.png
  100. 0 0
      src/static/imgs/star-rating/delivery_icon_star_disable.png

File diff suppressed because it is too large
+ 0 - 231
dist/build/mp-weixin/common/main.wxss


+ 0 - 1
dist/build/mp-weixin/components/shop-cart.wxml

@@ -1 +0,0 @@
1
-<view data-event-opts="{{[['tap',[['goCart',['$event']]]]]}}" class="shop data-v-46995986" bindtap="__e"><block wx:if="{{$root.g0}}"><view class="cu-tag badge data-v-46995986"></view></block><text class="cuIcon-cart text-student cart data-v-46995986"></text></view>

File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/components/shop-cart.wxss


+ 0 - 1
dist/build/mp-weixin/components/swiper-tab.wxml

@@ -1 +0,0 @@
1
-<view class="swipeTab data-v-aa709134"><block wx:for="{{menuList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['changeTab',[index]]]]]}}" class="{{['swipeTab-item data-v-aa709134',(currentIndex===index)?'tabTrue':'']}}" bindtap="__e">{{''+item+''}}</view></block></view>

File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/components/swiper-tab.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-calendar/uni-calendar-item.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-calendar/uni-calendar-item.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-calendar/uni-calendar.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-calendar/uni-calendar.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/agreement/index.js


+ 0 - 1
dist/build/mp-weixin/pages/agreement/index.wxml

@@ -1 +0,0 @@
1
-<view class="data-v-691f7141"><cu-custom vue-id="1856aa3c-1" isBack="{{true}}" title="{{title}}" class="data-v-691f7141" bind:__l="__l"></cu-custom><rich-text space="emsp" nodes="{{text[type]}}" class="data-v-691f7141"></rich-text></view>

File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/bindPhone.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/bindPhone.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/bindPhone.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/detail.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/detail.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/detail.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/gift.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/gift.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/gift.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/shoppingCart.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/shoppingCart.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/class/shoppingCart.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/index/components/card.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/index/components/card.wxss


+ 0 - 1
dist/build/mp-weixin/pages/index/components/course.wxml

@@ -1 +0,0 @@
1
-<view class="course data-v-afc04ca0" style="{{('background:'+course.background)}}"><view class="{{['course-tag data-v-afc04ca0',(!course.applying)?'un-catering':'']}}">{{course.applying?'报名中':'未开启'}}</view><image class="course-back data-v-afc04ca0" mode="widthFix" src="{{course.back}}"></image><view class="course-ch text-xl data-v-afc04ca0">{{course.ch}}</view><view class="course-en text-lg data-v-afc04ca0">{{course.en}}</view></view>

File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/index/components/course.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/index/index.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/index/index.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/login/index.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/login/index.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/login/index.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/changePhone.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/changePhone.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/changePhone.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/institution.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/institution.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/institution.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/message.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/message.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/message.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/mine.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/mine.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/onlineService.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/onlineService.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/onlineService.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/parents.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/parents.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/parents.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/setting.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/setting.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/setting.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/teachers.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/teachers.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/mine/teachers.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/myStudents/myStudents.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/myStudents/myStudents.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/myStudents/myStudents.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/order/index.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/order/index.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/order/index.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/absent.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/absent.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/absent.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/classVideo.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/classVideo.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/classVideo.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/evaluate.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/evaluate.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/evaluate.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/index.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/index.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/operation.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/operation.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/operation.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/signIn.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/signIn.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/signIn.wxss


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/works.js


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/works.wxml


File diff suppressed because it is too large
+ 0 - 1
dist/build/mp-weixin/pages/studentcenter/works.wxss


+ 0 - 54
dist/build/mp-weixin/project.config.json

@@ -1,54 +0,0 @@
1
-{
2
-  "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
3
-  "packOptions": {
4
-    "ignore": [],
5
-    "include": []
6
-  },
7
-  "setting": {
8
-    "urlCheck": false,
9
-    "es6": true,
10
-    "enhance": true,
11
-    "postcss": true,
12
-    "preloadBackgroundData": false,
13
-    "minified": true,
14
-    "newFeature": false,
15
-    "coverView": true,
16
-    "nodeModules": false,
17
-    "autoAudits": false,
18
-    "showShadowRootInWxmlPanel": true,
19
-    "scopeDataCheck": false,
20
-    "uglifyFileName": false,
21
-    "checkInvalidKey": true,
22
-    "checkSiteMap": true,
23
-    "uploadWithSourceMap": true,
24
-    "compileHotReLoad": false,
25
-    "lazyloadPlaceholderEnable": false,
26
-    "useMultiFrameRuntime": true,
27
-    "useApiHook": true,
28
-    "useApiHostProcess": true,
29
-    "babelSetting": {
30
-      "ignore": [],
31
-      "disablePlugins": [],
32
-      "outputPath": ""
33
-    },
34
-    "enableEngineNative": false,
35
-    "useIsolateContext": true,
36
-    "userConfirmedBundleSwitch": false,
37
-    "packNpmManually": false,
38
-    "packNpmRelationList": [],
39
-    "minifyWXSS": true,
40
-    "disableUseStrict": false,
41
-    "minifyWXML": true,
42
-    "showES6CompileOption": false,
43
-    "useCompilerPlugins": false
44
-  },
45
-  "compileType": "miniprogram",
46
-  "libVersion": "2.24.5",
47
-  "appid": "wx971694d9384c1dfd",
48
-  "projectname": "parentNew",
49
-  "editorSetting": {
50
-    "tabIndent": "insertSpaces",
51
-    "tabSize": 2
52
-  },
53
-  "condition": {}
54
-}

+ 4 - 0
src/api/course.js

@@ -116,3 +116,7 @@ export function _leaveType (params) {
116 116
 export function _askLeave (params) {
117 117
 	return fetch('/parents/schedule/student_leave', params)
118 118
 }
119
+//获取学生课程档案
120
+export function _getStudentFiles (params) {
121
+	return fetch('/parents/courseFiles/get_list', params)
122
+}

+ 44 - 43
src/common/commonMethods.js

@@ -2,55 +2,56 @@
2 2
 import urlMap from '@/common/urlMap'
3 3
 
4 4
 const encodeParam = function (params) {
5
-  let url = ''
6
-  for (const k in params) {
7
-    const value = params[k] !== undefined ? params[k] : ''
8
-    url += '&' + k + '=' + encodeURIComponent(value)
9
-  }
10
-  return url ? url.substring(1) : ''
5
+	let url = ''
6
+	for (const k in params) {
7
+		const value = params[k] !== undefined ? params[k] : ''
8
+		url += '&' + k + '=' + encodeURIComponent(value)
9
+	}
10
+	return url ? url.substring(1) : ''
11 11
 }
12 12
 
13 13
 const routerToFail = function (err) {
14
-  console.log(err, '跳转新页面失败')
14
+	console.log(err, '跳转新页面失败')
15 15
 }
16 16
 
17 17
 const commonMethods = {
18
-  /**
19
-   * 保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面
20
-   * 页面跳转路径有层级限制,不能无限制跳转新页面
21
-   * @param {*} type 路径唯一类型
22
-   * @param {*} params 路径参数
23
-   * @returns {*} null
24
-   */
25
-  globalNavigateTo: function (type, params) {
26
-    if (urlMap.has(type)) {
27
-      let url = urlMap.get(type)
28
-      if (params) {
29
-        url += (url.indexOf('?') < 0 && params ? '?' : '&') + encodeParam(params)
30
-      }
31
-      uni.navigateTo({ url, fail: routerToFail })
32
-    }
33
-  },
34
-  // 关闭当前页面,跳转到应用内的某个页面
35
-  globalRedirectTo: function (type, params) {
36
-    if (urlMap.has(type)) {
37
-      let url = urlMap.get(type)
38
-      if (params) {
39
-        url += (url.indexOf('?') < 0 && params ? '?' : '&') + encodeParam(params)
40
-      }
41
-      uni.redirectTo({ url, fail: routerToFail })
42
-    }
43
-  },
44
-  // 关闭所有页面,打开应用内的某个页面
45
-  globalReLaunch: function (type, params) {
46
-    if (urlMap.has(type)) {
47
-      let url = urlMap.get(type)
48
-      if (params) {
49
-        url += (url.indexOf('?') < 0 && params ? '?' : '&') + encodeParam(params)
50
-      }
51
-      uni.reLaunch({ url, fail: routerToFail })
52
-    }
53
-  }
18
+	encodeParam,
19
+	/**
20
+	 * 保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面
21
+	 * 页面跳转路径有层级限制,不能无限制跳转新页面
22
+	 * @param {*} type 路径唯一类型
23
+	 * @param {*} params 路径参数
24
+	 * @returns {*} null
25
+	 */
26
+	globalNavigateTo: function (type, params) {
27
+		if (urlMap.has(type)) {
28
+			let url = urlMap.get(type)
29
+			if (params) {
30
+				url += (url.indexOf('?') < 0 && params ? '?' : '&') + encodeParam(params)
31
+			}
32
+			uni.navigateTo({ url, fail: routerToFail })
33
+		}
34
+	},
35
+	// 关闭当前页面,跳转到应用内的某个页面
36
+	globalRedirectTo: function (type, params) {
37
+		if (urlMap.has(type)) {
38
+			let url = urlMap.get(type)
39
+			if (params) {
40
+				url += (url.indexOf('?') < 0 && params ? '?' : '&') + encodeParam(params)
41
+			}
42
+			uni.redirectTo({ url, fail: routerToFail })
43
+		}
44
+	},
45
+	// 关闭所有页面,打开应用内的某个页面
46
+	globalReLaunch: function (type, params) {
47
+		if (urlMap.has(type)) {
48
+			let url = urlMap.get(type)
49
+			if (params) {
50
+				url += (url.indexOf('?') < 0 && params ? '?' : '&') + encodeParam(params)
51
+			}
52
+			uni.reLaunch({ url, fail: routerToFail })
53
+		}
54
+	}
54 55
 }
55 56
 
56 57
 export default commonMethods

+ 11 - 0
src/common/css/common.css

@@ -122,6 +122,13 @@ input{
122 122
 .bg-student{
123 123
 	background-color:#5fd0e4;
124 124
 }
125
+.bg-teacher{
126
+	background-color:#37CAA0;
127
+}
128
+.bg-light-green{
129
+	color:#fff;
130
+	background-color:#09e294;
131
+}
125 132
 .bg-normal{
126 133
 	background-color: #4DB8E4;
127 134
 }
@@ -172,6 +179,10 @@ input{
172 179
 	width:128rpx;
173 180
 	height:128rpx;
174 181
 }
182
+.avatar.xl{
183
+	width:180rpx;
184
+	height:180rpx;
185
+}
175 186
 .avatar.md{
176 187
 	width:96rpx;
177 188
 	height:96rpx;

+ 2 - 0
src/common/urlMap.js

@@ -25,5 +25,7 @@ urlMap.set('classCart', '/pages/class/shoppingCart')
25 25
 urlMap.set('bindPhone', '/pages/class/bindPhone')
26 26
 urlMap.set('order', '/pages/order/index')
27 27
 urlMap.set('agreement', '/pages/agreement/index')
28
+urlMap.set('courseFiles', '/pages/mine/courseFiles')
29
+urlMap.set('fileDetail', '/pages/mine/fileDetail')
28 30
 
29 31
 export default urlMap

+ 105 - 0
src/components/star-rating.vue

@@ -0,0 +1,105 @@
1
+<template>
2
+  <view class="star-rating">
3
+    <view class="star-rating-box" @touchstart="fun" @touchmove.stop.prevent="fun">
4
+      <image v-for="(item, i) in max" :key="i" class="icon-start" :src="(i + 1) | getSrc(score)" mode=""></image>
5
+    </view>
6
+    <text class="star-rating-title">{{ title }}</text>
7
+  </view>
8
+</template>
9
+
10
+<script>
11
+export default {
12
+  name: 'star-rating',
13
+  data() {
14
+    return {
15
+      iconStartSrcList: [
16
+        '/static/imgs/star-rating/delivery_icon_star_empty.png',
17
+        '/static/imgs/star-rating/delivery_icon_star_disable.png',
18
+        '/static/imgs/star-rating/delivery_icon_star_active.png'
19
+      ],
20
+      title: '',
21
+      width: 0
22
+    }
23
+  },
24
+  props: {
25
+    max: {
26
+      type: Number,
27
+      default: 5
28
+    },
29
+    name: {
30
+      type: String,
31
+      default: ''
32
+    },
33
+    score: {
34
+      type: Number,
35
+      default: 0
36
+    }
37
+  },
38
+  methods: {
39
+    fun(e) {
40
+      let score = Math.ceil(((e.changedTouches[0].pageX - e.currentTarget.offsetLeft) / this.width) * 5)
41
+      if (score >= 5) score = 5
42
+      if (score <= 0) score = 0
43
+      this.$emit('changeScore', {
44
+        name: this.name,
45
+        score
46
+      })
47
+    },
48
+    getDescBox() {
49
+      uni
50
+        .createSelectorQuery()
51
+        .in(this)
52
+        .select('.star-rating-box')
53
+        .boundingClientRect(result => {
54
+          if (result) {
55
+            this.width = result.width
56
+          } else {
57
+            this.getDescBox()
58
+          }
59
+        })
60
+        .exec()
61
+    }
62
+  },
63
+  mounted() {
64
+    this.$nextTick(() => {
65
+      this.getDescBox()
66
+    })
67
+  },
68
+  filters: {
69
+    getSrc: function (i, score) {
70
+      if (score == 0) return '/static/imgs/star-rating/delivery_icon_star_empty.png'
71
+      if (score < i) return '/static/imgs/star-rating/delivery_icon_star_disable.png'
72
+      if (score >= i) return '/static/imgs/star-rating/delivery_icon_star_active.png'
73
+    }
74
+  },
75
+  watch: {
76
+    score(val) {
77
+      if (val == 0) this.title = ''
78
+      if (val == 1) this.title = '非常差'
79
+      if (val == 2) this.title = '差'
80
+      if (val == 3) this.title = '一般'
81
+      if (val == 4) this.title = '满意'
82
+      if (val == 5) this.title = '非常满意'
83
+    }
84
+  }
85
+}
86
+</script>
87
+
88
+<style lang="scss">
89
+.star-rating {
90
+  display: flex;
91
+  align-items: center;
92
+
93
+  .icon-start {
94
+    width: 30rpx;
95
+    height: 30rpx;
96
+    margin: 0 6rpx;
97
+  }
98
+
99
+  .star-rating-title {
100
+    padding-left: 30rpx;
101
+    color: #999;
102
+    font-size: 24rpx;
103
+  }
104
+}
105
+</style>

+ 8 - 0
src/pages.json

@@ -95,6 +95,14 @@
95 95
     {
96 96
       "path": "pages/agreement/index",
97 97
       "style": {}
98
+    },
99
+    {
100
+      "path": "pages/mine/courseFiles",
101
+      "style": {}
102
+    },
103
+    {
104
+      "path": "pages/mine/fileDetail",
105
+      "style": {}
98 106
     }
99 107
   ],
100 108
   "globalStyle": {

+ 59 - 65
src/pages/class/detail.vue

@@ -1,22 +1,20 @@
1 1
 <template>
2 2
   <view class="page">
3 3
     <cu-custom :isBack="true"></cu-custom>
4
-    <view class="header" :style="[{top:topHeader + 'px'}]">
4
+    <view class="header" :style="[{ top: topHeader + 'px' }]">
5 5
       <view class="header-title">
6 6
         <view class="header-title-main">
7
-          <view class="margin-bottom-xs">{{tabList[cate_type].title}}</view>
7
+          <view class="margin-bottom-xs">{{ tabList[cate_type].title }}</view>
8 8
           <view class="point"></view>
9 9
         </view>
10 10
       </view>
11 11
       <swiper-tab :menuList="tabList[cate_type].list" @changeTab="changeTab"></swiper-tab>
12 12
     </view>
13
-    <scroll-view v-if="currentIndex===0" :scroll-y="true" :style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]"
14
-      class="scroll-main">
13
+    <scroll-view v-if="currentIndex === 0" :scroll-y="true" :style="[{ height: 'calc(100vh - 70px - ' + topHeader + 'px)' }]" class="scroll-main">
15 14
       <view class="content">
16 15
         <view class="course-img">
17
-          <swiper class="swiper" :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay"
18
-            :interval="swiper.interval" :duration="swiper.duration">
19
-            <swiper-item v-for="(item,index) in detail.image" :key="index">
16
+          <swiper class="swiper" :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay" :interval="swiper.interval" :duration="swiper.duration">
17
+            <swiper-item v-for="(item, index) in detail.image" :key="index">
20 18
               <view class="swiper-item">
21 19
                 <image :src="item" mode="widthFix"></image>
22 20
               </view>
@@ -25,66 +23,67 @@
25 23
         </view>
26 24
         <!-- 详情 -->
27 25
         <view class="detail">
28
-          <view class="detail-title">{{detail.name}}</view>
26
+          <view class="detail-title">{{ detail.name }}</view>
29 27
           <view class="detail-item">
30 28
             <view class="detail-item-point"></view>
31 29
             <view class="detail-label">周期</view>
32
-            <view class="detail-text">{{detail.period}}<text class="text-gray">({{detail.time[0]}})</text></view>
30
+            <view class="detail-text"
31
+              >{{ detail.period }}<text class="text-gray">({{ detail.time[0] }})</text></view
32
+            >
33 33
           </view>
34 34
           <view class="detail-item">
35 35
             <view class="detail-item-point"></view>
36 36
             <view class="detail-label">适用年级</view>
37
-            <view class="detail-text">{{detail.grade}}年级通用</view>
37
+            <view class="detail-text">{{ detail.grade }}年级通用</view>
38 38
           </view>
39 39
           <view class="detail-item">
40 40
             <view class="detail-item-point"></view>
41 41
             <view class="detail-label">课时</view>
42
-            <view class="detail-text">{{detail.class_total}}课时</view>
42
+            <view class="detail-text">{{ detail.class_total }}课时</view>
43 43
           </view>
44 44
           <view class="detail-item">
45 45
             <view class="detail-item-point"></view>
46 46
             <view class="detail-label">单课时价</view>
47
-            <view class="detail-text">¥{{detail.single_money}}</view>
47
+            <view class="detail-text">¥{{ detail.single_money }}</view>
48 48
           </view>
49 49
           <view class="detail-item">
50 50
             <view class="detail-item-point"></view>
51 51
             <view class="detail-label">补贴</view>
52
-            <view class="detail-text">¥{{detail.subsidy}}/节课</view>
52
+            <view class="detail-text">¥{{ detail.subsidy }}/节课</view>
53 53
           </view>
54 54
           <view class="detail-item">
55 55
             <view class="detail-item-point"></view>
56 56
             <view class="detail-label">培养目标</view>
57
-            <view class="detail-text">{{detail.tenet}}</view>
57
+            <view class="detail-text">{{ detail.tenet }}</view>
58 58
           </view>
59 59
         </view>
60 60
       </view>
61 61
       <!-- 老师介绍 -->
62
-      <view class="teacher flex margin-top-sm shadow" v-if="cate_type===0">
62
+      <view class="teacher flex margin-top-sm shadow" v-if="cate_type === 0">
63 63
         <image mode="scaleToFill" :src="defaultTeacher" class="avatar lg"></image>
64 64
         <view class="flex-sub margin-left">
65
-          <view class="teacher-title">{{detail.teachers.username||''}}老师授课</view>
66
-          <view class="teacher-item">毕业于{{detail.teachers.agency_name||''}}</view>
67
-          <view class="teacher-item">所属机构:{{detail.teachers.orz||''}}</view>
65
+          <view class="teacher-title">{{ detail.teachers.username || '' }}老师授课</view>
66
+          <view class="teacher-item">毕业于{{ detail.teachers.agency_name || '' }}</view>
67
+          <view class="teacher-item">所属机构:{{ detail.teachers.orz || '' }}</view>
68 68
           <view class="teacher-exp flex">
69
-            <view class="exp-item">{{detail.teachers.honor||''}}</view>
70
-            <view class="exp-item">{{detail.teachers.introduce||''}}</view>
69
+            <view class="exp-item">{{ detail.teachers.honor || '' }}</view>
70
+            <view class="exp-item">{{ detail.teachers.introduce || '' }}</view>
71 71
           </view>
72 72
         </view>
73 73
       </view>
74 74
       <!-- 道具选择 -->
75
-      <view class="shop margin-top-sm shadow" v-if="detail.prop&&detail.prop.length>0">
75
+      <view class="shop margin-top-sm shadow" v-if="detail.prop && detail.prop.length > 0">
76 76
         <view class="shop-title">请选择课程所需要的道具</view>
77 77
         <radio-group @change="radioChange" class="margin-top-xs">
78 78
           <label v-for="radio in radios" :key="radio.value" class="tool-choose margin-right-sm">
79
-            <radio :value="radio.value" class="cyan" :checked="radio.checked" style="transform:scale(0.7)" />
80
-            {{radio.name}}
79
+            <radio :value="radio.value" class="cyan" :checked="radio.checked" style="transform: scale(0.7);" />
80
+            {{ radio.name }}
81 81
           </label>
82 82
         </radio-group>
83
-        <checkbox-group @change="checkboxChange" v-if="needTool==='1'" class="checkbox-group margin-top-xs">
83
+        <checkbox-group @change="checkboxChange" v-if="needTool === '1'" class="checkbox-group margin-top-xs">
84 84
           <label v-for="prop in detail.prop" :key="prop.id">
85 85
             <view class="tool-choose-item">
86
-              <checkbox :value="prop.id" class="cyan" style="transform:scale(0.7)"
87
-                :checked="goods.props.includes(prop.id)" />{{prop.name}}<text>¥{{prop.money}}</text>
86
+              <checkbox :value="prop.id" class="cyan" style="transform: scale(0.7);" :checked="goods.props.includes(prop.id)" />{{ prop.name }}<text>¥{{ prop.money }}</text>
88 87
             </view>
89 88
           </label>
90 89
         </checkbox-group>
@@ -95,18 +94,17 @@
95 94
       </view>
96 95
     </scroll-view>
97 96
     <!-- 评价页 -->
98
-    <scroll-view :style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]" class="scroll-main"
99
-      v-if="currentIndex===1">
97
+    <scroll-view :style="[{ height: 'calc(100vh - 70px - ' + topHeader + 'px)' }]" class="scroll-main" v-if="currentIndex === 1">
100 98
       <view class="cu-list menu-avatar comment">
101
-        <view class="cu-item" v-for="(comment,index) in comments" :key="index">
99
+        <view class="cu-item" v-for="(comment, index) in comments" :key="index">
102 100
           <image mode="scaleToFill" :src="comment.img" class="avatar md left"></image>
103 101
           <view class="content">
104
-            <view class="text-grey">{{comment.name}}</view>
102
+            <view class="text-grey">{{ comment.name }}</view>
105 103
             <view class="text-gray text-content text-df">
106
-              {{comment.content}}
104
+              {{ comment.content }}
107 105
             </view>
108 106
             <view class="margin-top-sm flex justify-between">
109
-              <view class="text-gray text-df">{{comment.date}}</view>
107
+              <view class="text-gray text-df">{{ comment.date }}</view>
110 108
               <!-- <view>
111 109
 									<text class="cuIcon-appreciatefill text-red"></text>
112 110
 									<text class="cuIcon-messagefill text-gray margin-left-sm"></text>
@@ -117,44 +115,40 @@
117 115
       </view>
118 116
     </scroll-view>
119 117
     <!-- 视频页 -->
120
-    <scroll-view :style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]" class="scroll-main"
121
-      v-if="currentIndex===2">
118
+    <scroll-view :style="[{ height: 'calc(100vh - 70px - ' + topHeader + 'px)' }]" class="scroll-main" v-if="currentIndex === 2">
122 119
       <view class="list">
123
-        <view class="cu-card case" v-for="(video,index) in detail.video" :key="index">
120
+        <view class="cu-card case" v-for="(video, index) in detail.video" :key="index">
124 121
           <view class="cu-item shadow">
125 122
             <view class="image">
126
-              <video :src="video" style="width:100%;"></video>
123
+              <video :src="video" style="width: 100%;"></video>
127 124
             </view>
128 125
           </view>
129 126
         </view>
130 127
       </view>
131 128
     </scroll-view>
132 129
     <!-- 大纲页 -->
133
-    <scroll-view :scroll-y="true" :style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]" class="scroll-main"
134
-      v-if="currentIndex===3">
130
+    <scroll-view :scroll-y="true" :style="[{ height: 'calc(100vh - 70px - ' + topHeader + 'px)' }]" class="scroll-main" v-if="currentIndex === 3">
135 131
       <view class="cu-bar bg-white">
136 132
         <view class="action border-title">
137 133
           <text class="cuIcon-title text-student"></text>
138
-          <text class="text-xl text-bold">{{tabList[cate_type].list[currentIndex]}}</text>
134
+          <text class="text-xl text-bold">{{ tabList[cate_type].list[currentIndex] }}</text>
139 135
         </view>
140 136
       </view>
141 137
       <view class="bg-white padding-lr">
142
-        <view class="text-content text-lg" v-for="(outline,index) in detail.out_line" :key="index">
143
-          {{outline.course_content}}
138
+        <view class="text-content text-lg" v-for="(outline, index) in detail.out_line" :key="index">
139
+          {{ outline.course_content }}
144 140
         </view>
145 141
       </view>
146 142
     </scroll-view>
147 143
     <view class="static flex shadow">
148 144
       <view class="static-price">
149 145
         <text class="satic-label text-lg">小计:</text>
150
-        <text class="text-price text-red text-lg">{{goods.sum_money}}</text>
146
+        <text class="text-price text-red text-lg">{{ goods.sum_money }}</text>
151 147
       </view>
152
-      <view class="static-choose text-ellipsis" v-if="goods.choose.length>0">(已选:{{goods.choose.join(',')}})</view>
148
+      <view class="static-choose text-ellipsis" v-if="goods.choose.length > 0">(已选:{{ goods.choose.join(',') }})</view>
153 149
       <view class="static-order flex align-center">
154
-        <shop-cart :class_attend_id="attend_id" :disableBtn="disableBtn" @changeDisableBtn="changeDisableBtn">
155
-        </shop-cart>
156
-        <button class="cu-btn round bg-student text-white margin-left-xs"
157
-          :class="{'disabled':carts.includes(attend_id)||!detail.enable}" @tap="addCart">报课</button>
150
+        <shop-cart :class_attend_id="attend_id" :disableBtn="disableBtn" @changeDisableBtn="changeDisableBtn"> </shop-cart>
151
+        <button class="cu-btn round bg-student text-white margin-left-xs" :class="{ disabled: carts.includes(attend_id) || !detail.enable }" @tap="addCart">报课</button>
158 152
       </view>
159 153
     </view>
160 154
   </view>
@@ -168,9 +162,10 @@ import NP from 'number-precision'
168 162
 import { mapGetters } from 'vuex'
169 163
 export default {
170 164
   components: {
171
-    swiperTab, shopCart
165
+    swiperTab,
166
+    shopCart
172 167
   },
173
-  data () {
168
+  data() {
174 169
     return {
175 170
       topHeader: this.globalCustomBarHeight,
176 171
       swiper: {
@@ -192,10 +187,11 @@ export default {
192 187
         { value: '1', name: '需要道具', checked: true },
193 188
         { value: '2', name: '不需要道具', checked: false }
194 189
       ],
195
-      goods: { // 动态选中值
190
+      goods: {
191
+        // 动态选中值
196 192
         props: [], // 选中值
197 193
         choose: [], // 选中名称
198
-        sum_money: 0// 金额总计
194
+        sum_money: 0 // 金额总计
199 195
       }, // 选中课程
200 196
       tabList: [
201 197
         {
@@ -244,12 +240,10 @@ export default {
244 240
     }
245 241
   },
246 242
   computed: {
247
-    ...mapGetters([
248
-      'carts'
249
-    ])
243
+    ...mapGetters(['carts'])
250 244
   },
251 245
   // 配置分享
252
-  onShareAppMessage (res) {
246
+  onShareAppMessage(res) {
253 247
     if (res.from === 'button') {
254 248
       // 来自页面内分享按钮
255 249
       console.log(res.target)
@@ -259,10 +253,10 @@ export default {
259 253
       path: `/pages/class/detail?attend_id=${this.attend_id}`
260 254
     }
261 255
   },
262
-  onShow () {
256
+  onShow() {
263 257
     this.disableBtn = false
264 258
   },
265
-  onLoad (option) {
259
+  onLoad(option) {
266 260
     this.attend_id = Number(decodeURIComponent(option.attend_id))
267 261
     if (this.attend_id === 0) {
268 262
       uni.navigateBack()
@@ -271,7 +265,7 @@ export default {
271 265
     this.get_comments()
272 266
   },
273 267
   methods: {
274
-    get_detail () {
268
+    get_detail() {
275 269
       _detail({ class_attend_id: this.attend_id }).then(res => {
276 270
         this.detail = res.data
277 271
         this.money = res.data.sum_money
@@ -283,10 +277,10 @@ export default {
283 277
         }
284 278
       })
285 279
     },
286
-    changeDisableBtn () {
280
+    changeDisableBtn() {
287 281
       this.disableBtn = true
288 282
     },
289
-    addCart () {
283
+    addCart() {
290 284
       if (this.disableBtn) return false
291 285
       this.disableBtn = true
292 286
       if (!this.detail.enable) {
@@ -303,20 +297,20 @@ export default {
303 297
         }
304 298
       })
305 299
     },
306
-    setDefaultGoods (props) {
300
+    setDefaultGoods(props) {
307 301
       this.goods.props[0] = props[0].id
308 302
       this.goods.sum_money = NP.plus(this.money, props[0].money)
309 303
       this.goods.choose[0] = props[0].name
310 304
     },
311
-    get_comments () {
305
+    get_comments() {
312 306
       _comments({ class_attend_id: this.attend_id }).then(res => {
313 307
         this.comemnts = res.data
314 308
       })
315 309
     },
316
-    changeTab (index) {
310
+    changeTab(index) {
317 311
       this.currentIndex = index
318 312
     },
319
-    radioChange (e) {
313
+    radioChange(e) {
320 314
       const value = e.detail.value
321 315
       this.needTool = value
322 316
       if (value === '1') {
@@ -327,7 +321,7 @@ export default {
327 321
         this.goods.choose = []
328 322
       }
329 323
     },
330
-    checkboxChange (e) {
324
+    checkboxChange(e) {
331 325
       const values = e.detail.value
332 326
       const choose = []
333 327
       const props = []

+ 82 - 23
src/pages/class/gift.vue

@@ -1,38 +1,58 @@
1 1
 <template>
2
-  <view class="page">
2
+  <view class="page" style="background-color: #fff;">
3 3
     <cu-custom :isBack="true" title="智能报课"></cu-custom>
4
-    <view class="steps padding-tb">
5
-      <view class="text-center"><text class="text-red">点击切换下一步</text></view>
4
+    <view class="steps solid-bottom flex justify-between">
5
+      <!-- <view class="text-center"><text class="text-red">点击切换下一步</text></view>
6 6
       <view class="cu-steps">
7 7
         <view class="cu-item" :class="index > cur ? '' : 'text-student'" v-for="(item, index) in numList" :key="index" @tap="changeStep(index)">
8 8
           <text class="num" :data-index="index + 1"></text> {{ item.name }}
9 9
         </view>
10
-      </view>
10
+      </view> -->
11
+      <view v-for="(item, index) in stepList" :key="index" class="step flex-sub text-center" :class="{ cur: cur === index }" @tap="changeStep(index)">{{ item.name }}</view>
11 12
     </view>
12
-    <view class="main bg-white" :style="[{ height: 'calc(100vh - 110px - ' + topHeader + 'px)' }]">
13
+    <view class="main" :style="[{ height: 'calc(100vh - 40px - ' + topHeader + 'px)' }]">
13 14
       <swiper @change="swipeChange" :current="cur" class="swipe">
14 15
         <swiper-item @touchmove.stop>
15 16
           <view class="btn-check-group padding">
16 17
             <checkbox-group @change="checkboxChange" class="flex justify-between" style="flex-wrap: wrap;" id="week">
17
-              <label class="btn-check-label margin" :class="{ 'bg-cyan': params.week.includes(item.key + '') }" v-for="item in days" :key="item.key">
18
+              <label class="btn-check-label margin" :class="{ 'bg-light-green': params.week.includes(item.key + '') }" v-for="item in days" :key="item.key">
18 19
                 <checkbox :value="item.key" />
19 20
                 {{ item.value }}
20 21
               </label>
21 22
             </checkbox-group>
22 23
           </view>
24
+          <view class="flex next-step padding-lr" style="width: 100%;">
25
+            <button class="cu-btn round lg bg-light-green flex-sub" @tap="changeStep(1)">下一步</button>
26
+          </view>
23 27
         </swiper-item>
24 28
         <swiper-item @touchmove.stop>
25 29
           <view class="btn-check-group padding">
26
-            <checkbox-group @change="checkboxChange" class="flex justify-between" style="flex-wrap: wrap;" id="hobby">
27
-              <label class="btn-check-label margin" :class="{ 'bg-cyan': params.hobby.includes(item.id + '') }" v-for="item in interests" :key="item.id">
28
-                <checkbox :value="item.id" />
29
-                {{ item.name }}
30
-              </label>
31
-            </checkbox-group>
32 30
             <view class="margin">
33
-              <input v-model="params.hobbyOther" placeholder="输入其它兴趣内容(选填)" class="margin-top input-border" />
31
+              <input v-model="params.hobbyOther" placeholder="输入兴趣内容  如:画画" class="margin-top input-border" />
32
+            </view>
33
+            <view class="interests">
34
+              <img src="/static/imgs/intelligent-bg.png" mode="widthFix" alt="" />
35
+              <checkbox-group @change="checkboxChange" id="hobby">
36
+                <view v-for="(item, index) in interests" :key="item.id" :style="[{ top: index * 80 + 'rpx', left: (index % 2) * 320 + index * 40 + 'rpx' }]" class="interest">
37
+                  <label
38
+                    class="btn-check-label margin"
39
+                    :style="{
40
+                      color: params.hobby.includes(item.id + '') ? '#fff' : '#000',
41
+                      backgroundColor: params.hobby.includes(item.id + '') ? colors[index % 4] : '#f0f0f0'
42
+                    }"
43
+                  >
44
+                    <checkbox :value="item.id" />
45
+                    {{ item.name }}
46
+                  </label>
47
+                  <text class="cuIcon-title" :style="[{ color: colors[index % 4] }]"></text>
48
+                </view>
49
+              </checkbox-group>
34 50
             </view>
35 51
           </view>
52
+          <view class="flex next-step padding-lr" style="width: 100%;">
53
+            <button class="cu-btn round lg bg-light-green flex-sub margin-right-sm" @tap="changeStep(0)">上一步</button>
54
+            <button class="cu-btn round lg bg-light-green flex-sub" @tap="changeStep(2)">下一步</button>
55
+          </view>
36 56
         </swiper-item>
37 57
         <swiper-item>
38 58
           <view v-if="attends.length === 0" class="padding text-center text-lg">
@@ -40,7 +60,7 @@
40 60
           </view>
41 61
           <view v-else>
42 62
             <view class="VerticalBox">
43
-              <scroll-view class="VerticalNav nav" scroll-y scroll-with-animation :scroll-top="verticalNavTop" :style="'height:calc(100vh - 70px - 90px - ' + topHeader + 'px)'">
63
+              <scroll-view class="VerticalNav nav" scroll-y scroll-with-animation :scroll-top="verticalNavTop" :style="'height:calc(100vh - 70px - 40px - ' + topHeader + 'px)'">
44 64
                 <view class="cu-item" :class="index == tabCur ? 'text-green cur' : ''" v-for="(item, index) in attends" :key="index" @tap="TabSelect" :data-id="index">
45 65
                   {{ weekList[index] }}
46 66
                 </view>
@@ -49,7 +69,7 @@
49 69
                 class="VerticalMain padding-sm"
50 70
                 scroll-y
51 71
                 scroll-with-animation
52
-                :style="'height:calc(100vh - 70px - 90px - ' + topHeader + 'px)'"
72
+                :style="'height:calc(100vh - 70px - 40px - ' + topHeader + 'px)'"
53 73
                 :scroll-into-view="'main-' + mainCur"
54 74
                 @scroll="VerticalMain"
55 75
               >
@@ -88,9 +108,17 @@
88 108
               </scroll-view>
89 109
             </view>
90 110
             <view class="static shadow">
91
-              <view class="static-order flex">
92
-                <shop-cart :class_attend_id="attend_id" @changeDisableBtn="changeDisableBtn"></shop-cart>
93
-                <button class="cu-btn round bg-student text-white margin-left-xs" @tap="addCart">报课</button>
111
+              <view class="flex justify-between" style="width: 100%;">
112
+                <view>
113
+                  <button class="cu-btn round line-grey" @tap="changeStep(1)">
114
+                    <text class="cuIcon-back lg margin-right-sm"></text>
115
+                    重选
116
+                  </button>
117
+                </view>
118
+                <view class="static-order flex">
119
+                  <shop-cart :class_attend_id="attend_id" @changeDisableBtn="changeDisableBtn"></shop-cart>
120
+                  <button class="cu-btn round bg-student text-white margin-left-xs" @tap="addCart">报课</button>
121
+                </view>
94 122
               </view>
95 123
             </view>
96 124
           </view>
@@ -111,7 +139,7 @@ export default {
111 139
   data() {
112 140
     return {
113 141
       topHeader: this.globalCustomBarHeight,
114
-      numList: [
142
+      stepList: [
115 143
         {
116 144
           name: '选周期'
117 145
         },
@@ -136,6 +164,7 @@ export default {
136 164
       tabCur: 0,
137 165
       mainCur: 0,
138 166
       verticalNavTop: 0,
167
+      colors: ['#0CAAF4', '#082FCC', '#FDC534', '#09E294'],
139 168
       checked: [], // 选中
140 169
       checked_props: [], // 选中工具
141 170
       attend_id: 0, // 添加成功课程
@@ -178,7 +207,10 @@ export default {
178 207
         this.attends = res.data
179 208
         this.checked = [] //初始化选项
180 209
         Object.keys(this.attends).forEach(item => {
181
-          this.$set(this.checked_props, item, { prop: [] })
210
+          const class_attend_id = this.attends[item].list[0].class_attend_id
211
+          const prop = this.attends[item].list[0].prop.length > 0 ? [this.attends[item].list[0].prop[0].id + ''] : []
212
+          this.$set(this.checked, item, class_attend_id)
213
+          this.$set(this.checked_props, item, { class_attend_id: class_attend_id, prop: prop })
182 214
         })
183 215
         this.weekList = this.attends.map(item => item.week)
184 216
       })
@@ -224,6 +256,7 @@ export default {
224 256
       this.checked[this.mainCur] = value
225 257
       this.$set(this.checked, this.mainCur, value)
226 258
       this.$set(this.checked_props, this.mainCur, { class_attend_id: value, prop: [] })
259
+      console.log(this.checked_props)
227 260
     },
228 261
     propChange(e) {
229 262
       const parentId = e.target.dataset.id
@@ -278,6 +311,32 @@ export default {
278 311
     height: 100%;
279 312
   }
280 313
 }
314
+.step {
315
+  position: relative;
316
+  padding: 10px 0;
317
+  &.cur {
318
+    color: #09e294;
319
+    &:before {
320
+      content: '';
321
+      position: absolute;
322
+      bottom: 0;
323
+      background-color: #09e294;
324
+      width: 30px;
325
+      height: 2px;
326
+      transform: translateX(25%);
327
+    }
328
+  }
329
+}
330
+.interests {
331
+  position: relative;
332
+  .interest {
333
+    position: absolute;
334
+  }
335
+}
336
+.next-step {
337
+  position: fixed;
338
+  bottom: 60px;
339
+}
281 340
 .btn-check-group {
282 341
   checkbox {
283 342
     display: none;
@@ -289,8 +348,8 @@ export default {
289 348
     display: inline-block;
290 349
     margin-right: 10rpx;
291 350
     position: relative;
292
-    padding: 10rpx 30rpx;
293
-    line-height: 30px;
351
+    padding: 10rpx 40rpx;
352
+    // line-height: 30px;
294 353
     border-radius: 100rpx;
295 354
     flex-wrap: nowrap;
296 355
     border: 1px solid #eee;
@@ -319,7 +378,7 @@ export default {
319 378
   height: 70px;
320 379
   align-items: center;
321 380
   padding: 0 0.8rem;
322
-  justify-content: flex-end;
381
+  // justify-content: flex-end;
323 382
 }
324 383
 .fixed {
325 384
   position: fixed;

+ 16 - 11
src/pages/index/components/card.vue

@@ -1,16 +1,20 @@
1 1
 <template>
2 2
   <view class="card flex" @tap="goDetail(item)">
3
-    <view class=card-left>
4
-      <img mode="aspectFill" :src="item.image" alt="">
3
+    <view class="card-left">
4
+      <img mode="aspectFill" :src="item.image" alt="" />
5 5
     </view>
6 6
     <view class="card-right flex-sub">
7
-      <view class="card-title flex justify-between"><text>{{item.attend_name}}</text><text
8
-          class="text-student text-light">¥{{item.money}}</text></view>
9
-      <view class="text-gray text-sm"><text>{{item.day}}</text></view>
10
-      <view class="text-gray text-sm">{{item.grade_desc}}</view>
7
+      <view class="card-title flex justify-between"
8
+        ><text>{{ item.attend_name }}</text
9
+        ><text class="text-student text-light">¥{{ item.money }}</text></view
10
+      >
11
+      <view class="text-gray text-sm"
12
+        ><text>{{ item.day }}</text></view
13
+      >
14
+      <view class="text-gray text-sm">{{ item.grade_desc }}</view>
11 15
       <view class="margin-top-sm">
12
-        <button class="cu-btn round  bg-student text-white button-hover" v-if="item.enable">报课</button>
13
-        <button class="cu-btn round  bg-grey button-hover text-white disabled" v-else>停止</button>
16
+        <button class="cu-btn round bg-student text-white button-hover" v-if="item.enable">报课</button>
17
+        <button class="cu-btn round bg-grey button-hover text-white disabled" v-else>停止</button>
14 18
       </view>
15 19
     </view>
16 20
   </view>
@@ -21,18 +25,19 @@ export default {
21 25
   props: {
22 26
     item: {
23 27
       type: Object,
24
-      default () {
28
+      default() {
25 29
         return {}
26 30
       }
27 31
     }
28 32
   },
29
-  data () {
33
+  data() {
30 34
     return {
31 35
       key: 1212
32 36
     }
33 37
   },
34 38
   methods: {
35
-    goDetail (item) {
39
+    goDetail(item) {
40
+      console.log(111)
36 41
       if (!item.enable) {
37 42
         uni.showToast({ title: '课程已停止!', icon: 'none' })
38 43
         return false

+ 91 - 69
src/pages/index/index.vue

@@ -1,8 +1,7 @@
1
-
2 1
 <template>
3 2
   <view class="page">
4 3
     <cu-custom :isBack="false"></cu-custom>
5
-    <view class="header" :style="[{top:topHeader + 'px'}]">
4
+    <view class="header" :style="[{ top: topHeader + 'px' }]">
6 5
       <view class="header-box flex justify-end">
7 6
         <view class="header-title">
8 7
           <view class="header-title-main">
@@ -12,49 +11,50 @@
12 11
         </view>
13 12
         <view class="header-search flex-sub">
14 13
           <view class="flex justify-between">
15
-            <input type="text" v-model="params.course_name" class="header-search-input flex-sub" placeholder="搜索课程"
16
-              @confirm="search">
14
+            <input type="text" v-model="params.course_name" class="header-search-input flex-sub" placeholder="搜索课程" @confirm="search" />
17 15
             <text class="cuIcon-search text-gray header-search-icon" @tap="search"></text>
18 16
           </view>
19 17
         </view>
20 18
       </view>
21 19
     </view>
22
-    <scroll-view :scroll-y="true" :refresher-enabled="true" class="scroll-main" :refresher-triggered="triggered"
23
-      :style="[{height:'calc(100vh - 102px - '+ topHeader+'px)'}]" @refresherrefresh="onRefresh"
24
-      @scrolltolower="loadMore">
20
+    <scroll-view
21
+      :scroll-y="true"
22
+      :refresher-enabled="true"
23
+      class="scroll-main"
24
+      :refresher-triggered="triggered"
25
+      :style="[{ height: 'calc(100vh - 102px - ' + topHeader + 'px)' }]"
26
+      @refresherrefresh="onRefresh"
27
+      @scrolltolower="loadMore"
28
+    >
25 29
       <view class="main">
26 30
         <view class="main-title">活动和餐饮</view>
27 31
         <view class="flex justify-around course">
28
-          <course v-for="(item,index) in courses" :key="index" @tap="goCourse(item.type)" :course="item"
29
-            class="course-item flex-sub margin-xs"></course>
32
+          <course v-for="(item, index) in courses" :key="index" @tap="goCourse(item.type)" :course="item" class="course-item flex-sub margin-xs"></course>
30 33
         </view>
31 34
         <view class="main-title margin-top-xs">一键报班</view>
32 35
         <view class="apply-class flex">
33
-          <image mode="widthFix" @tap="goGift" src="/static/imgs/index/baoban.png"
34
-            class="flex-sub apply-class-img margin-xs" />
36
+          <image mode="widthFix" @tap="goGift" src="/static/imgs/index/baoban.png" class="flex-sub apply-class-img margin-xs" />
35 37
         </view>
36 38
         <view class="recommend margin-top-xs">
37 39
           <view class="recommend-title">推荐课程</view>
38 40
           <view class="recommend-filter margin-top-xs flex">
39
-            <view class="filter-item text-center flex-sub" @tap="sort('home')" :class="{'text-sort':sortCur==='home'}">
40
-              综合</view>
41
-            <view class="filter-item text-center flex-sub" @tap="sort('sales')"
42
-              :class="{'text-sort':sortCur==='sales'}">销量
43
-              <image mode="widthFix" class="sort-icon"
44
-                :src="sortCur==='sales'?(sortItem.sales===0?sortIcons.up:sortIcons.down):sortIcons.no"></image>
41
+            <view class="filter-item text-center flex-sub" @tap="sort('home')" :class="{ 'text-sort': sortCur === 'home' }"> 综合</view>
42
+            <view class="filter-item text-center flex-sub" @tap="sort('sales')" :class="{ 'text-sort': sortCur === 'sales' }"
43
+              >销量
44
+              <image mode="widthFix" class="sort-icon" :src="sortCur === 'sales' ? (sortItem.sales === 0 ? sortIcons.up : sortIcons.down) : sortIcons.no"></image>
45 45
             </view>
46
-            <view class="filter-item text-center flex-sub" @tap="sort('money')"
47
-              :class="{'text-sort':sortCur==='money'}">价格
48
-              <image mode="widthFix" class="sort-icon"
49
-                :src="sortCur==='money'?(sortItem.money===0?sortIcons.up:sortIcons.down):sortIcons.no"></image>
46
+            <view class="filter-item text-center flex-sub" @tap="sort('money')" :class="{ 'text-sort': sortCur === 'money' }"
47
+              >价格
48
+              <image mode="widthFix" class="sort-icon" :src="sortCur === 'money' ? (sortItem.money === 0 ? sortIcons.up : sortIcons.down) : sortIcons.no"></image>
50 49
             </view>
51
-            <view class="filter-item text-center flex-sub">{{grade_now}}</view>
52
-            <view class="filter-item text-right flex-sub" @tap="showModal" data-target="FilterModal">筛选
50
+            <view class="filter-item text-center flex-sub">{{ grade_now }}</view>
51
+            <view class="filter-item text-right flex-sub" @tap="showModal" data-target="FilterModal"
52
+              >筛选
53 53
               <text class="cuIcon-filter text-gray"></text>
54 54
             </view>
55 55
           </view>
56 56
           <view class="list">
57
-            <view class="cu-card" v-for="(item,index) in list" :key="index">
57
+            <view class="cu-card" v-for="(item, index) in list" :key="index">
58 58
               <view class="cu-item">
59 59
                 <card :item="item"></card>
60 60
               </view>
@@ -63,9 +63,8 @@
63 63
         </view>
64 64
       </view>
65 65
     </scroll-view>
66
-    <view class="cu-modal drawer-modal justify-end" :class="modalName=='FilterModal'?'show':''" @tap="hideModal">
67
-      <view class="cu-dialog basis-lg" @tap.stop=""
68
-        :style="[{top:topHeader+'px',height:'calc(100vh - ' + topHeader + 'px)'}]">
66
+    <view class="cu-modal drawer-modal justify-end" :class="modalName == 'FilterModal' ? 'show' : ''" @tap="hideModal">
67
+      <view class="cu-dialog basis-lg" @tap.stop="" :style="[{ top: topHeader + 'px', height: 'calc(100vh - ' + topHeader + 'px)' }]">
69 68
         <view class="filter-title">机构筛选</view>
70 69
         <view class="btn-check-group padding-lr">
71 70
           <!-- <checkbox-group @change="checkboxChange" class="flex" style="flex-wrap: wrap;" id="agency">
@@ -76,22 +75,30 @@
76 75
 							</label>
77 76
 						</checkbox-group> -->
78 77
           <radio-group class="flex" style="flex-wrap: wrap;" id="agency">
79
-            <label class="btn-check-label margin-top-sm padding-lr-xs text-sm text-ellipsis"
80
-              :class="{'bg-cyan':params.agency.includes(item.id)}" v-for="item in filters.agency" :key="item.id"
81
-              @tap="radioChange('agency',item.id)">
78
+            <label
79
+              class="btn-check-label margin-top-sm padding-lr-xs text-sm text-ellipsis"
80
+              :class="{ 'bg-cyan': params.agency.includes(item.id) }"
81
+              v-for="item in filters.agency"
82
+              :key="item.id"
83
+              @tap="radioChange('agency', item.id)"
84
+            >
82 85
               <radio :value="item.id" />
83
-              {{item.name}}
86
+              {{ item.name }}
84 87
             </label>
85 88
           </radio-group>
86 89
         </view>
87 90
         <view class="filter-title">分类筛选</view>
88 91
         <view class="btn-check-group padding-lr">
89 92
           <radio-group class="flex" style="flex-wrap: wrap;" id="category">
90
-            <label class="btn-check-label margin-top-sm padding-lr-xs text-sm text-ellipsis"
91
-              :class="{'bg-cyan':params.category.includes(item.id)}" v-for="item in filters.category" :key="item.id"
92
-              @tap="radioChange('category',item.id)">
93
+            <label
94
+              class="btn-check-label margin-top-sm padding-lr-xs text-sm text-ellipsis"
95
+              :class="{ 'bg-cyan': params.category.includes(item.id) }"
96
+              v-for="item in filters.category"
97
+              :key="item.id"
98
+              @tap="radioChange('category', item.id)"
99
+            >
93 100
               <radio :value="item.id" />
94
-              {{item.name}}
101
+              {{ item.name }}
95 102
             </label>
96 103
           </radio-group>
97 104
         </view>
@@ -105,22 +112,30 @@
105 112
 							</label>
106 113
 						</checkbox-group> -->
107 114
           <radio-group class="flex" style="flex-wrap: wrap;" id="day">
108
-            <label class="btn-check-label margin-top-sm padding-lr-xs text-sm"
109
-              :class="{'bg-cyan':params.day.includes(index+'')}" v-for="(item,index) in filters.week" :key="index"
110
-              @tap="radioChange('day',index)">
115
+            <label
116
+              class="btn-check-label margin-top-sm padding-lr-xs text-sm"
117
+              :class="{ 'bg-cyan': params.day.includes(index + '') }"
118
+              v-for="(item, index) in filters.week"
119
+              :key="index"
120
+              @tap="radioChange('day', index)"
121
+            >
111 122
               <radio :value="index" />
112
-              {{item}}
123
+              {{ item }}
113 124
             </label>
114 125
           </radio-group>
115 126
         </view>
116 127
         <view class="filter-title">价格区间(元)</view>
117 128
         <view class="btn-check-group padding-lr">
118 129
           <radio-group class="flex" style="flex-wrap: wrap;" id="price">
119
-            <label class="btn-check-label margin-top-sm padding-lr-xs text-sm"
120
-              :class="{'bg-cyan':params.price===item.name}" v-for="item in filters.price_list" :key="item.id"
121
-              @tap="radioChange('price',item.name)">
130
+            <label
131
+              class="btn-check-label margin-top-sm padding-lr-xs text-sm"
132
+              :class="{ 'bg-cyan': params.price === item.name }"
133
+              v-for="item in filters.price_list"
134
+              :key="item.id"
135
+              @tap="radioChange('price', item.name)"
136
+            >
122 137
               <radio :value="item.name" />
123
-              {{item.name}}
138
+              {{ item.name }}
124 139
             </label>
125 140
           </radio-group>
126 141
         </view>
@@ -142,9 +157,10 @@ import { deepClone } from '@/common/utils'
142 157
 import { mapGetters } from 'vuex'
143 158
 export default {
144 159
   components: {
145
-    course, card
160
+    course,
161
+    card
146 162
   },
147
-  data () {
163
+  data() {
148 164
     return {
149 165
       topHeader: this.globalCustomBarHeight,
150 166
       modalName: '',
@@ -162,7 +178,8 @@ export default {
162 178
         sales: 0,
163 179
         money: 0
164 180
       },
165
-      courses: [// 排序情况
181
+      courses: [
182
+        // 排序情况
166 183
         {
167 184
           applying: true,
168 185
           back: '/static/imgs/index/zmk.png',
@@ -197,9 +214,10 @@ export default {
197 214
         category: [],
198 215
         price: '',
199 216
         sort: '',
200
-        list_type: 0// 0 课程,1 餐饮,2活动
217
+        list_type: 0 // 0 课程,1 餐饮,2活动
201 218
       },
202
-      init: { // 初始化
219
+      init: {
220
+        // 初始化
203 221
         page_num: 1,
204 222
         course_name: '',
205 223
         agency: [],
@@ -207,7 +225,7 @@ export default {
207 225
         category: [],
208 226
         price: '',
209 227
         sort: '',
210
-        list_type: 0// 0 课程,1 餐饮,2活动
228
+        list_type: 0 // 0 课程,1 餐饮,2活动
211 229
       },
212 230
       list: [],
213 231
       noMore: false, // 还有没
@@ -215,11 +233,9 @@ export default {
215 233
     }
216 234
   },
217 235
   computed: {
218
-    ...mapGetters([
219
-      'kid', 'token'
220
-    ])
236
+    ...mapGetters(['kid', 'token'])
221 237
   },
222
-  onShow () {
238
+  onShow() {
223 239
     // 登录后才进入后续操作
224 240
     this.checkLogin().then(res => {
225 241
       if (res) {
@@ -227,14 +243,15 @@ export default {
227 243
           return this.globalNavigateTo('myStudents')
228 244
         }
229 245
         this.params = Object.assign({}, this.init)
230
-        this.get_list(true)// true初始化加载过滤项
246
+        this.get_list(true) // true初始化加载过滤项
231 247
       }
232 248
     })
233 249
   },
234 250
   methods: {
235
-    checkLogin () {
251
+    checkLogin() {
236 252
       return new Promise((resolve, reject) => {
237
-        if (this.token) { // 跳转至登录页
253
+        if (this.token) {
254
+          // 跳转至登录页
238 255
           resolve(true)
239 256
         } else {
240 257
           uni.showModal({
@@ -250,11 +267,12 @@ export default {
250 267
         }
251 268
       })
252 269
     },
253
-    goCourse (type) {
270
+    goCourse(type) {
254 271
       this.params.list_type = type
255 272
       this.search()
256 273
     },
257
-    loadFilter () { // 加载筛选项
274
+    loadFilter() {
275
+      // 加载筛选项
258 276
       const params = {}
259 277
       _filter(params).then(res => {
260 278
         this.filters = res.data
@@ -262,13 +280,13 @@ export default {
262 280
         this.courses[2].applying = this.filters.is_catering
263 281
       })
264 282
     },
265
-    showModal (e) {
283
+    showModal(e) {
266 284
       this.modalName = e.currentTarget.dataset.target
267 285
     },
268
-    hideModal (e) {
286
+    hideModal(e) {
269 287
       this.modalName = null
270 288
     },
271
-    radioChange (type, v) {
289
+    radioChange(type, v) {
272 290
       switch (type) {
273 291
         case 'agency':
274 292
           this.params.agency = this.params.agency[0] === v ? [] : [v]
@@ -286,7 +304,7 @@ export default {
286 304
           console.log('error')
287 305
       }
288 306
     },
289
-    checkboxChange (e) {
307
+    checkboxChange(e) {
290 308
       const type = e.target.id
291 309
       const values = e.detail.value
292 310
       switch (type) {
@@ -303,16 +321,19 @@ export default {
303 321
           console.log('error')
304 322
       }
305 323
     },
306
-    search () { // 搜索课程
324
+    search() {
325
+      // 搜索课程
307 326
       this.params.page_num = 1
308 327
       this.get_list()
309 328
     },
310
-    check_course () { // 筛选课程
329
+    check_course() {
330
+      // 筛选课程
311 331
       this.params.page_num = 1
312 332
       this.get_list()
313 333
       this.hideModal()
314 334
     },
315
-    onRefresh () { // 下拉刷新
335
+    onRefresh() {
336
+      // 下拉刷新
316 337
       this.triggered = true
317 338
       this.params.page_num = 1
318 339
       this.params.list_type = 0
@@ -321,7 +342,7 @@ export default {
321 342
         this.triggered = false
322 343
       }, 1000)
323 344
     },
324
-    loadMore () {
345
+    loadMore() {
325 346
       if (this.noMore) {
326 347
         uni.showToast({ title: '暂无更多课程数据', icon: 'none' })
327 348
         return false
@@ -329,7 +350,8 @@ export default {
329 350
       this.params.page_num++
330 351
       this.get_list()
331 352
     },
332
-    sort (type) { // 排序搜索
353
+    sort(type) {
354
+      // 排序搜索
333 355
       const sorts = {
334 356
         home: 0,
335 357
         sales: 0,
@@ -347,7 +369,7 @@ export default {
347 369
       this.params.page_num = 1
348 370
       this.get_list()
349 371
     },
350
-    get_list (init = false) {
372
+    get_list(init = false) {
351 373
       let params = deepClone(this.params)
352 374
       params = filterParams(params)
353 375
       if (params.day.length > 0) {
@@ -380,7 +402,7 @@ export default {
380 402
         if (init) this.loadFilter()
381 403
       })
382 404
     },
383
-    goGift () {
405
+    goGift() {
384 406
       this.globalNavigateTo('classGift', { package_id: 0 })
385 407
     }
386 408
   }

+ 56 - 0
src/pages/mine/courseFiles.vue

@@ -0,0 +1,56 @@
1
+<template>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="课程档案"></cu-custom>
4
+    <view class="cu-list box-shadow menu">
5
+      <view class="cu-item arrow margin-top-xs" v-for="file in list" :key="file.id" @tap="goto('fileDetail', file)">
6
+        <view class="content margin-left-sm">
7
+          <view>{{ file.course_name }}</view>
8
+          <star-rating name="serviceNum" :score="file.level" :max="file.max_level"></star-rating>
9
+        </view>
10
+      </view>
11
+    </view>
12
+  </view>
13
+</template>
14
+
15
+<script>
16
+import { _getStudentFiles } from '@/api/course'
17
+import starRating from '@/components/star-rating.vue'
18
+export default {
19
+  components: {
20
+    starRating
21
+  },
22
+  data() {
23
+    return {
24
+      key: '课程档案',
25
+      params: {
26
+        page: 1
27
+      },
28
+      list: [],
29
+      ability: []
30
+    }
31
+  },
32
+  onLoad() {
33
+    this.get_list()
34
+  },
35
+  methods: {
36
+    get_list() {
37
+      _getStudentFiles(this.params).then(res => {
38
+        this.list = res.data.list
39
+        this.ability = res.data.ability
40
+      })
41
+    },
42
+    goto(page, file) {
43
+      const ability = this.ability.filter(item => {
44
+        if (file.ability_total[item.id]) {
45
+          this.$set(item, 'score', file.ability_total[item.id])
46
+          return true
47
+        }
48
+      })
49
+      this.$set(file, 'ability', ability)
50
+      this.globalNavigateTo(page, { file: JSON.stringify(file) })
51
+    }
52
+  }
53
+}
54
+</script>
55
+
56
+<style lang="scss" scoped></style>

+ 166 - 0
src/pages/mine/fileDetail.vue

@@ -0,0 +1,166 @@
1
+<template>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" :title="key"></cu-custom>
4
+    <view class="card margin-sm padding-sm bg-white shadow">
5
+      <view class="text-center">
6
+        <image mode="scaleToFill" :src="student_avatar" class="avatar xl student-avatar"></image>
7
+      </view>
8
+      <view class="part">
9
+        <view class="title text-student">考核总评</view>
10
+        <view class="content margin-top">
11
+          <canvas
12
+            canvas-id="ability"
13
+            id="ability"
14
+            class="charts"
15
+            @touchstart="touchStart"
16
+            @touchmove="touchMove"
17
+            @touchend="touchEnd"
18
+            @error="error"
19
+            :style="{
20
+              width: cWidth * pixelRatio + 'px',
21
+              height: cHeight * pixelRatio + 'px',
22
+              transform: 'scale(' + 1 / pixelRatio + ')',
23
+              'margin-left': (-cWidth * (pixelRatio - 1)) / 2 + 'px',
24
+              'margin-top': (-cHeight * (pixelRatio - 1)) / 2 + 'px'
25
+            }"
26
+          ></canvas>
27
+        </view>
28
+      </view>
29
+      <view class="part">
30
+        <view class="title text-student">学期总评</view>
31
+        <view class="content margin-top">{{ file.term_summary }}</view>
32
+      </view>
33
+      <view class="part">
34
+        <view class="title text-student">下期预告</view>
35
+        <view class="content margin-top">{{ file.next_forecast }}</view>
36
+      </view>
37
+    </view>
38
+  </view>
39
+</template>
40
+
41
+<script>
42
+import UCharts from '@/components/u-charts/u-charts.js'
43
+var canvases = {}
44
+export default {
45
+  data() {
46
+    return {
47
+      key: '学生总评',
48
+      file: {},
49
+      pixelRatio: 1,
50
+      cWidth: '',
51
+      cHeight: '',
52
+      student_avatar: 'http://parent.kehoubaike.com/static/img/7f4e775d2e04234d1e1994b13146f6b.e5c47f3.png'
53
+    }
54
+  },
55
+  // 配置分享
56
+  onShareAppMessage(res) {
57
+    if (res.from === 'button') {
58
+      // 来自页面内分享按钮
59
+      console.log(res.target)
60
+    }
61
+    return {
62
+      title: '结业报告',
63
+      path: `/pages/mine/fileDetail?shareFile=${JSON.stringify(this.file)}`
64
+    }
65
+  },
66
+  onLoad(options) {
67
+    //跳转参数
68
+    if (options.file) {
69
+      this.file = JSON.parse(decodeURIComponent(options.file))
70
+    }
71
+    //分享页参数
72
+    if (options.shareFile) {
73
+      this.file = JSON.parse(options.shareFile)
74
+    }
75
+    this.cWidth = uni.upx2px(800) - 60
76
+    this.cHeight = uni.upx2px(400) // 图表配置
77
+    this.init()
78
+  },
79
+  methods: {
80
+    init() {
81
+      const ability = {
82
+        categories: this.file.ability.map(item => item.name),
83
+        series: [
84
+          {
85
+            name: '评分',
86
+            data: this.file.ability.map(item => item.score)
87
+          }
88
+        ]
89
+      }
90
+      this.showRadar('ability', ability)
91
+    },
92
+    showRadar(canvasId, chartData) {
93
+      canvases[canvasId] = new UCharts({
94
+        canvasId: canvasId,
95
+        type: 'radar',
96
+        legend: { show: true },
97
+        fontSize: 11,
98
+        width: 300,
99
+        height: this.cHeight * this.pixelRatio,
100
+        pixelRatio: this.pixelRatio,
101
+        animation: true,
102
+        categories: chartData.categories,
103
+        series: chartData.series
104
+      })
105
+    },
106
+    touchStart(e) {
107
+      const canvasId = e.target.id
108
+      canvases[canvasId].showToolTip(e, {
109
+        format: function (item, category) {
110
+          return category ? category + ' ' + item.name + ':' + item.data : item.name + ':' + item.data
111
+        }
112
+      })
113
+      // canvases[canvasId].scrollStart(e)
114
+    },
115
+    touchMove(e) {
116
+      // const canvasId = e.target.id
117
+      // canvases[canvasId].scroll(e)
118
+    },
119
+    touchEnd(e) {
120
+      // const canvasId = e.target.id
121
+      // canvases[canvasId].scrollEnd(e)
122
+    }
123
+  }
124
+}
125
+</script>
126
+
127
+<style lang="scss" scoped>
128
+.page {
129
+  background-color: #f3fffa;
130
+  min-height: 100vh;
131
+}
132
+.card {
133
+  margin-top: 90rpx;
134
+  border-radius: 10px;
135
+}
136
+.title {
137
+  position: relative;
138
+  text-align: center;
139
+  &:before {
140
+    position: absolute;
141
+    top: 50%;
142
+    transform: translateY(-50%);
143
+    left: 0;
144
+    content: '';
145
+    width: 32%;
146
+    height: 2px;
147
+    border-bottom: 1px solid #5fd0e4;
148
+  }
149
+  &:after {
150
+    position: absolute;
151
+    top: 50%;
152
+    transform: translateY(-50%);
153
+    right: 0;
154
+    content: '';
155
+    width: 32%;
156
+    height: 2px;
157
+    border-bottom: 1px solid #5fd0e4;
158
+  }
159
+}
160
+.content {
161
+  min-height: 120px;
162
+}
163
+.student-avatar {
164
+  transform: translateY(-50%);
165
+}
166
+</style>

+ 7 - 7
src/pages/mine/message.vue

@@ -3,14 +3,14 @@
3 3
     <cu-custom :isBack="true" title="消息中心"></cu-custom>
4 4
     <view class="cu-list box-shadow menu">
5 5
       <view class="cu-item arrow margin-top-xs" v-for="message in list" :key="message.id">
6
-        <text class="cuIcon-notice lg text-gray" style="font-size:18px;"></text>
6
+        <text class="cuIcon-notice lg text-gray" style="font-size: 18px;"></text>
7 7
         <view class="content margin-left-sm">
8 8
           <view>系统通知</view>
9
-          <text class="text-black">{{message.title}}</text>
9
+          <text class="text-black">{{ message.title }}</text>
10 10
         </view>
11 11
       </view>
12 12
       <view class="cu-item arrow margin-top-xs" @tap="report">
13
-        <text class="cuIcon-notice lg text-gray" style="font-size:18px;"></text>
13
+        <text class="cuIcon-notice lg text-gray" style="font-size: 18px;"></text>
14 14
         <view class="content margin-left-sm">
15 15
           <text class="text-black">学生综合素质报告</text>
16 16
         </view>
@@ -22,19 +22,19 @@
22 22
 <script>
23 23
 import { _getNotice } from '@/api/auth'
24 24
 export default {
25
-  data () {
25
+  data() {
26 26
     return {
27 27
       list: []
28 28
     }
29 29
   },
30
-  onLoad () {
30
+  onLoad() {
31 31
     this.get_list()
32 32
   },
33 33
   methods: {
34
-    report () {
34
+    report() {
35 35
       uni.showToast({ title: '学期末才能领取对应的学生综合素质报告,敬请期待!', icon: 'none', duration: 2000 })
36 36
     },
37
-    get_list () {
37
+    get_list() {
38 38
       _getNotice().then(res => {
39 39
         this.list = res.data.notice_data
40 40
       })

+ 7 - 0
src/pages/mine/mine.vue

@@ -63,6 +63,13 @@
63 63
           </view>
64 64
           <view class="action"></view>
65 65
         </view>
66
+        <view class="cu-item arrow" @tap="goto('courseFiles')">
67
+          <text class="cuIcon-file lg text-gray" style="font-size: 18px;"></text>
68
+          <view class="content margin-left-sm">
69
+            <text class="text-black">课程档案</text>
70
+          </view>
71
+          <view class="action"></view>
72
+        </view>
66 73
         <view class="cu-item arrow" @tap="goto('onlineService')">
67 74
           <text class="iconfont text-gray" style="font-size: 18px;">&#xe726;</text>
68 75
           <view class="content margin-left-sm">

+ 156 - 15
src/pages/studentcenter/works.vue

@@ -3,7 +3,7 @@
3 3
     <cu-custom :isBack="true" title="课堂作品"></cu-custom>
4 4
     <scroll-view scroll-y="true" :style="[{ height: 'calc(100vh - ' + topHeader + 'px)' }]">
5 5
       <view class="content">
6
-        <view class="course-img">
6
+        <view class="course-img padding-sm">
7 7
           <swiper class="swiper" :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay" :interval="swiper.interval" :duration="swiper.duration">
8 8
             <swiper-item v-for="(item, index) in detail.course_data.image" :key="index">
9 9
               <view class="swiper-item">
@@ -12,34 +12,90 @@
12 12
             </swiper-item>
13 13
           </swiper>
14 14
         </view>
15
-        <view>
16
-          <view class="title margin-top-sm">课堂作品</view>
17
-          <view class="list">
18
-            <view class="cu-card case" v-for="(item, index) in detail.student_comment_data.data" :key="index">
19
-              <view class="cu-item shadow">
20
-                <view class="image">
21
-                  <view v-for="(img, i) in item.images" :key="i">
22
-                    <image :src="img" v-if="checkTypes(img, 'imgs')" mode="aspectFit" style="width: 100%;"></image>
23
-                    <video :src="img" v-if="checkTypes(img, 'video')" style="width: 100%;"></video>
24
-                  </view>
25
-                  <view class="margin-bottom-xs">老师点评:{{ detail.teach_review_data.data[0].msg }}</view>
15
+        <!-- 课堂作品 -->
16
+        <view class="cu-card" v-if="detail.student_comment_data.data">
17
+          <view class="cu-item">
18
+            <view class="card-head bg-student text-center text-white text-lg padding-sm">课堂作品 </view>
19
+            <view class="card-main padding-sm">
20
+              <view class="cu-card case" v-for="(item, index) in detail.student_comment_data.data" :key="index">
21
+                <view v-for="(img, i) in item.images" :key="i">
22
+                  <image class="upload-item solid" :src="img" mode="aspectFit" v-if="checkTypes(img, 'imgs')" @tap="viewImage" :data-url="img"></image>
23
+                  <video
24
+                    class="upload-item solid"
25
+                    :src="img"
26
+                    v-if="checkTypes(img, 'video')"
27
+                    :autoplay="true"
28
+                    :controls="false"
29
+                    :show-fullscreen-btn="false"
30
+                    @tap="viewVideo"
31
+                    :data-url="img"
32
+                    data-target="videoModal"
33
+                  ></video>
26 34
                 </view>
27 35
               </view>
28 36
             </view>
29 37
           </view>
30 38
         </view>
39
+        <!-- 能力分析 -->
40
+        <view class="cu-card" v-if="detail.student_comment_data.ability">
41
+          <view class="cu-item">
42
+            <view class="card-head bg-student text-center text-white text-lg padding-sm">能力分析 </view>
43
+            <view class="card-main padding-sm">
44
+              <canvas
45
+                canvas-id="ability"
46
+                id="ability"
47
+                class="charts"
48
+                @touchstart="touchStart"
49
+                @touchmove="touchMove"
50
+                @touchend="touchEnd"
51
+                @error="error"
52
+                :style="{
53
+                  width: cWidth * pixelRatio + 'px',
54
+                  height: cHeight * pixelRatio + 'px',
55
+                  transform: 'scale(' + 1 / pixelRatio + ')',
56
+                  'margin-left': (-cWidth * (pixelRatio - 1)) / 2 + 'px',
57
+                  'margin-top': (-cHeight * (pixelRatio - 1)) / 2 + 'px'
58
+                }"
59
+              ></canvas>
60
+            </view>
61
+          </view>
62
+        </view>
63
+        <!-- 课堂评价 -->
64
+        <view class="cu-card" v-if="detail.teach_review_data.data">
65
+          <view class="cu-item">
66
+            <view class="card-head bg-student text-center text-white text-lg padding-sm">课堂评价 </view>
67
+            <view class="card-main padding-sm" style="min-height: 100px;">
68
+              <view class="margin-bottom-xs">老师点评:{{ detail.teach_review_data.data[0].msg }}</view>
69
+            </view>
70
+          </view>
71
+        </view>
31 72
       </view>
32 73
     </scroll-view>
74
+    <!-- 视频预览 -->
75
+    <view class="cu-modal" :class="modalName == 'videoModal' ? 'show' : ''" @tap="hideModal">
76
+      <view class="cu-dialog" @tap.stop="">
77
+        <video class="bg-img" :src="videoUrl" :autoplay="true" :controls="true" :show-fullscreen-btn="false" style="height: 200px;"></video>
78
+      </view>
79
+    </view>
33 80
   </view>
34 81
 </template>
35 82
 
36 83
 <script>
37 84
 import { checkTypes } from '@/common/utils/index'
85
+import UCharts from '@/components/u-charts/u-charts.js'
86
+var canvases = {}
38 87
 export default {
39 88
   data() {
40 89
     return {
41 90
       topHeader: this.globalCustomBarHeight,
42
-      detail: {},
91
+      modalName: null,
92
+      pixelRatio: 1,
93
+      isShare: false,
94
+      cWidth: '',
95
+      cHeight: '',
96
+      detail: {
97
+        student_comment_data: {}
98
+      },
43 99
       swiper: {
44 100
         indicatorDots: true,
45 101
         autoplay: true,
@@ -48,13 +104,92 @@ export default {
48 104
       }
49 105
     }
50 106
   },
51
-  onLoad() {
107
+  // 配置分享
108
+  onShareAppMessage(res) {
109
+    if (res.from === 'button') {
110
+      // 来自页面内分享按钮
111
+      console.log(res.target)
112
+    }
113
+    return {
114
+      title: '课程作品',
115
+      path: `/pages/studentcenter/works?detail=${JSON.stringify(this.detail)}`
116
+    }
117
+  },
118
+  onLoad(options) {
119
+    if (options.detail) {
120
+      this.detail = JSON.parse(options.detail)
121
+      this.ifShare = true
122
+    }
123
+    this.cWidth = uni.upx2px(800) - 60
124
+    this.cHeight = uni.upx2px(400) // 图表配置
52 125
     this.init()
53 126
   },
54 127
   methods: {
55 128
     checkTypes,
56 129
     init() {
57
-      this.detail = JSON.parse(uni.getStorageSync('daily_class'))
130
+      //分享的页面直接读取分享数据,跳过
131
+      if (!this.ifShare) {
132
+        this.detail = JSON.parse(uni.getStorageSync('daily_class'))
133
+        //匹配能力对应分数
134
+        if (!this.detail.student_comment_data.ability) return false
135
+        this.detail.student_comment_data.ability.map(item => {
136
+          this.$set(item, 'score', this.detail.student_comment_data.ability_score[item.id])
137
+        })
138
+      }
139
+      const ability = {
140
+        categories: this.detail.student_comment_data.ability.map(item => item.name),
141
+        series: [
142
+          {
143
+            name: '评分',
144
+            data: this.detail.student_comment_data.ability.map(item => item.score)
145
+          }
146
+        ]
147
+      }
148
+      this.showRadar('ability', ability)
149
+    },
150
+    viewImage(e) {
151
+      uni.previewImage({
152
+        urls: [e.currentTarget.dataset.url],
153
+        current: e.currentTarget.dataset.url
154
+      })
155
+    },
156
+    viewVideo(e) {
157
+      this.modalName = e.currentTarget.dataset.target
158
+      this.videoUrl = e.currentTarget.dataset.url
159
+    },
160
+    hideModal(e) {
161
+      this.modalName = null
162
+    },
163
+    showRadar(canvasId, chartData) {
164
+      canvases[canvasId] = new UCharts({
165
+        canvasId: canvasId,
166
+        type: 'radar',
167
+        legend: { show: true },
168
+        fontSize: 11,
169
+        width: 300,
170
+        height: this.cHeight * this.pixelRatio,
171
+        pixelRatio: this.pixelRatio,
172
+        animation: true,
173
+        categories: chartData.categories,
174
+        series: chartData.series
175
+      })
176
+    },
177
+    touchStart(e) {
178
+      const canvasId = e.target.id
179
+      canvases[canvasId].showToolTip(e, {
180
+        format: function (item, category) {
181
+          return category ? category + ' ' + item.name + ':' + item.data : item.name + ':' + item.data
182
+        }
183
+      })
184
+      // canvases[canvasId].scrollStart(e)
185
+    },
186
+    touchMove(e) {
187
+      // const canvasId = e.target.id
188
+      // canvases[canvasId].scroll(e)
189
+    },
190
+    touchEnd(e) {
191
+      // const canvasId = e.target.id
192
+      // canvases[canvasId].scrollEnd(e)
58 193
     }
59 194
   }
60 195
 }
@@ -63,5 +198,11 @@ export default {
63 198
 <style lang="scss" scoped>
64 199
 .page {
65 200
   height: 100vh;
201
+  background-color: #f3fffa;
202
+}
203
+.upload-item {
204
+  margin-right: 20rpx;
205
+  width: 200rpx;
206
+  height: 200rpx;
66 207
 }
67 208
 </style>

BIN
src/static/imgs/intelligent-bg.png


BIN
src/static/imgs/star-rating/delivery_icon_star_active.png


+ 0 - 0
src/static/imgs/star-rating/delivery_icon_star_disable.png


Some files were not shown because too many files changed in this diff