relatedChildren.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <template>
  2. <view>
  3. <u-navbar title="关联子女"></u-navbar>
  4. <view class="content-2">
  5. <view class="search">
  6. <u-search v-model="queryName" placeholder="搜索学员姓名" action-text="查询" @custom="queryStudent"></u-search>
  7. </view>
  8. <view class="student-card" v-for="(item,index) in studentList" :key="index">
  9. <view class="details">
  10. <view class="photo">
  11. <u-avatar class="avatar" mode="square"
  12. :src="item.student.headPhoto != null ? item.student.headPhoto : '../../assets/img/head.png'" size="112">
  13. </u-avatar>
  14. </view>
  15. <view class="information">
  16. <view class="name">
  17. {{item.student.studentName}}
  18. </view>
  19. <view class="item">
  20. <view class="item-name">
  21. 报读课程
  22. </view>
  23. <view class="item-content">
  24. <li v-for="c in item.buyLogMapList">{{c.courseName}}</li>
  25. </view>
  26. </view>
  27. <view class="item">
  28. <view class="item-name">
  29. 班级名称
  30. </view>
  31. <view class="item-content">
  32. <li v-for="c in item.buyLogMapList">{{c.className}}</li>
  33. </view>
  34. </view>
  35. <view class="item">
  36. <view class="item-name">
  37. 教师
  38. </view>
  39. <view class="item-content">
  40. <li v-for="c in item.buyLogMapList">{{c.teacherName}}</li>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="check-more" @click="getUpdateStudent(item.student)">
  46. <view class="call-name">
  47. 关联子女
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import * as mineApi from '@/apis/youth/mine.js'
  56. import * as loginApi from '@/apis/login.js'
  57. export default {
  58. data() {
  59. return {
  60. queryName: '',
  61. studentList: [],
  62. form: {}
  63. }
  64. },
  65. onReady() {
  66. this.getParentsInfo();
  67. },
  68. methods: {
  69. getParentsInfo() {
  70. uni.showLoading({
  71. title: "加载中",
  72. mask: true,
  73. })
  74. loginApi.findByOpenId({
  75. openId: this.carhelp.getOpenId()
  76. }).then((response) => {
  77. uni.hideLoading();
  78. this.form = response.data.regUser;
  79. }).catch(error => {
  80. uni.showToast({
  81. title: error,
  82. icon: "none"
  83. })
  84. })
  85. },
  86. queryStudent() {
  87. uni.showLoading({
  88. title: "加载中",
  89. mask: true,
  90. })
  91. mineApi.findByStudentName({
  92. studentName: this.queryName
  93. }).then((res) => {
  94. uni.hideLoading();
  95. this.studentList = res.data.studentList;
  96. }).catch(error => {
  97. uni.showToast({
  98. title: error,
  99. icon: "none"
  100. })
  101. })
  102. },
  103. getUpdateStudent(student) {
  104. uni.showLoading({
  105. title: "加载中",
  106. mask: true,
  107. })
  108. mineApi.updateStudent({
  109. studentId: student.studentId,
  110. studentName: student.studentName,
  111. gender: student.gender,
  112. birthday: student.birthday,
  113. headPhoto: student.headPhoto,
  114. firstContactName: this.form.nickName,
  115. firstContactPhone: this.form.phone
  116. }).then((response) => {
  117. uni.hideLoading();
  118. uni.showToast({
  119. title: '关联成功',
  120. icon: "none"
  121. })
  122. }).catch(error => {
  123. uni.showToast({
  124. title: error,
  125. icon: "none"
  126. })
  127. })
  128. },
  129. }
  130. }
  131. </script>
  132. <style lang="scss" scoped>
  133. li{
  134. list-style: none;
  135. }
  136. .check-more {
  137. display: flex;
  138. text-align: center;
  139. font-size: 16px;
  140. margin-top: 17px;
  141. border-top: 1px solid rgba(229, 231, 234, 1);
  142. line-height: 38px;
  143. .history {
  144. flex: 1;
  145. color: rgba(119, 119, 119, 1);
  146. border-right: 1px solid rgba(229, 231, 234, 1);
  147. }
  148. .call-name {
  149. flex: 1;
  150. color: rgba(13, 186, 199, 1);
  151. }
  152. }
  153. .u-tabs {
  154. position: fixed;
  155. top: 88rpx;
  156. left: 0;
  157. right: 0;
  158. z-index: 999;
  159. }
  160. .content-1 {
  161. margin-top: 80rpx;
  162. }
  163. .student-card {
  164. margin: 0rpx 32rpx 16rpx;
  165. padding: 2rpx 32rpx 16rpx 32rpx;
  166. background-color: #fff;
  167. border-radius: 12px;
  168. .title {
  169. display: flex;
  170. align-items: center;
  171. color: rgba(51, 51, 51, 1);
  172. font-weight: bold;
  173. img {
  174. vertical-align: middle;
  175. margin-right: 16rpx;
  176. }
  177. }
  178. .details {
  179. margin-top: 40rpx;
  180. display: flex;
  181. .photo {
  182. width: 160rpx;
  183. height: 120px;
  184. border-radius: 8px;
  185. margin-right: 32rpx;
  186. overflow: hidden;
  187. img {
  188. width: 100%;
  189. height: 100%;
  190. }
  191. }
  192. }
  193. .information {
  194. .name {
  195. color: rgba(51, 51, 51, 1);
  196. font-size: 36rpx;
  197. font-weight: bold;
  198. margin-bottom: 20rpx;
  199. }
  200. .item {
  201. display: flex;
  202. margin-bottom: 16rpx;
  203. justify-content: space-between;
  204. font-size: 28rpx;
  205. .item-name {
  206. width: 180rpx;
  207. color: rgba(119, 119, 119, 1);
  208. }
  209. .item-content {
  210. flex: 1;
  211. color: rgba(51, 51, 51, 1);
  212. margin-left: 16rpx;
  213. }
  214. }
  215. }
  216. }
  217. /deep/.u-tab-item {
  218. color: #101010 !important;
  219. }
  220. /deep/.u-cell_title {
  221. color: rgba(119, 119, 119, 1);
  222. }
  223. /deep/.u-cell__value {
  224. color: #333333;
  225. flex: 0.45;
  226. margin-left: auto;
  227. }
  228. .search {
  229. // background-color: #fff;
  230. padding: 16rpx 24rpx;
  231. margin-top: 80rpx;
  232. }
  233. /deep/.u-action {
  234. width: 17.1%;
  235. text-align: center;
  236. line-height: 56rpx;
  237. border-radius: 50px;
  238. background-color: rgba(13, 186, 199, 1);
  239. color: rgba(255, 255, 255, 1);
  240. }
  241. /deep/.u-content {
  242. height: 56rpx !important;
  243. background-color: #fff !important;
  244. }
  245. /deep/.u-input {
  246. background-color: #fff !important;
  247. }
  248. .student-details {
  249. padding: 24rpx 32rpx;
  250. background-color: #fff;
  251. display: flex;
  252. position: relative;
  253. border-bottom: 1px solid rgba(229, 231, 234, 1);
  254. ;
  255. .photo {
  256. width: 112rpx;
  257. height: 112rpx;
  258. border-radius: 4px;
  259. overflow: hidden;
  260. margin-right: 22rpx;
  261. img {
  262. width: 100%;
  263. height: 100%;
  264. }
  265. }
  266. .details {
  267. display: flex;
  268. align-items: center;
  269. .name-tel {
  270. .name {
  271. margin-right: 12px;
  272. color: rgba(51, 51, 51, 1);
  273. font-size: 18px;
  274. margin-bottom: 16rpx;
  275. }
  276. .tel {
  277. color: rgba(119, 119, 119, 1);
  278. // line-height: 24px;
  279. display: flex;
  280. align-items: center;
  281. }
  282. }
  283. }
  284. .more {
  285. color: #333333;
  286. position: absolute;
  287. bottom: 65rpx;
  288. right: 24rpx;
  289. }
  290. }
  291. @media screen and (max-width:320px) {
  292. .student-card {
  293. padding: 2rpx 12rpx 0rpx 12rpx;
  294. margin: 32rpx 16rpx;
  295. }
  296. .item-name {
  297. width: 244rpx !important;
  298. }
  299. }
  300. /deep/.uni-input-placeholder {
  301. font-size: 24rpx
  302. }
  303. .content-2 {
  304. margin-top: 90rpx;
  305. .search {
  306. position: fixed;
  307. left: 0rpx;
  308. right: 0rpx;
  309. top: 0rpx;
  310. z-index: 999;
  311. background-color: #F2F4F4;
  312. }
  313. }
  314. </style>