123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365 |
- <template>
- <view>
- <u-navbar title="关联子女"></u-navbar>
- <view class="content-2">
- <view class="search">
- <u-search v-model="queryName" placeholder="搜索学员姓名" action-text="查询" @custom="queryStudent"></u-search>
- </view>
- <view class="student-card" v-for="(item,index) in studentList" :key="index">
- <view class="details">
- <view class="photo">
- <u-avatar class="avatar" mode="square"
- :src="item.student.headPhoto != null ? item.student.headPhoto : '../../assets/img/head.png'" size="112">
- </u-avatar>
- </view>
- <view class="information">
- <view class="name">
- {{item.student.studentName}}
- </view>
- <view class="item">
- <view class="item-name">
- 报读课程
- </view>
- <view class="item-content">
- <li v-for="c in item.buyLogMapList">{{c.courseName}}</li>
- </view>
- </view>
- <view class="item">
- <view class="item-name">
- 班级名称
- </view>
- <view class="item-content">
- <li v-for="c in item.buyLogMapList">{{c.className}}</li>
- </view>
- </view>
- <view class="item">
- <view class="item-name">
- 教师
- </view>
- <view class="item-content">
- <li v-for="c in item.buyLogMapList">{{c.teacherName}}</li>
- </view>
- </view>
- </view>
- </view>
- <view class="check-more" @click="getUpdateStudent(item.student)">
- <view class="call-name">
- 关联子女
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import * as mineApi from '@/apis/youth/mine.js'
- import * as loginApi from '@/apis/login.js'
- export default {
- data() {
- return {
- queryName: '',
- studentList: [],
- form: {}
- }
- },
- onReady() {
- this.getParentsInfo();
- },
- methods: {
- getParentsInfo() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- loginApi.findByOpenId({
- openId: this.carhelp.getOpenId()
- }).then((response) => {
- uni.hideLoading();
- this.form = response.data.regUser;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- queryStudent() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- mineApi.findByStudentName({
- studentName: this.queryName
- }).then((res) => {
- uni.hideLoading();
- this.studentList = res.data.studentList;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- getUpdateStudent(student) {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- mineApi.updateStudent({
- studentId: student.studentId,
- studentName: student.studentName,
- gender: student.gender,
- birthday: student.birthday,
- headPhoto: student.headPhoto,
- firstContactName: this.form.nickName,
- firstContactPhone: this.form.phone
- }).then((response) => {
- uni.hideLoading();
- uni.showToast({
- title: '关联成功',
- icon: "none"
- })
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- li{
- list-style: none;
- }
-
- .check-more {
- display: flex;
- text-align: center;
- font-size: 16px;
- margin-top: 17px;
- border-top: 1px solid rgba(229, 231, 234, 1);
- line-height: 38px;
-
- .history {
- flex: 1;
- color: rgba(119, 119, 119, 1);
- border-right: 1px solid rgba(229, 231, 234, 1);
- }
-
- .call-name {
- flex: 1;
- color: rgba(13, 186, 199, 1);
-
- }
- }
-
- .u-tabs {
- position: fixed;
- top: 88rpx;
- left: 0;
- right: 0;
- z-index: 999;
- }
- .content-1 {
- margin-top: 80rpx;
- }
- .student-card {
- margin: 0rpx 32rpx 16rpx;
- padding: 2rpx 32rpx 16rpx 32rpx;
- background-color: #fff;
- border-radius: 12px;
- .title {
- display: flex;
- align-items: center;
- color: rgba(51, 51, 51, 1);
- font-weight: bold;
- img {
- vertical-align: middle;
- margin-right: 16rpx;
- }
- }
- .details {
- margin-top: 40rpx;
- display: flex;
- .photo {
- width: 160rpx;
- height: 120px;
- border-radius: 8px;
- margin-right: 32rpx;
- overflow: hidden;
- img {
- width: 100%;
- height: 100%;
- }
- }
- }
- .information {
- .name {
- color: rgba(51, 51, 51, 1);
- font-size: 36rpx;
- font-weight: bold;
- margin-bottom: 20rpx;
- }
- .item {
- display: flex;
- margin-bottom: 16rpx;
- justify-content: space-between;
- font-size: 28rpx;
- .item-name {
- width: 180rpx;
- color: rgba(119, 119, 119, 1);
- }
- .item-content {
- flex: 1;
- color: rgba(51, 51, 51, 1);
- margin-left: 16rpx;
- }
- }
- }
- }
- /deep/.u-tab-item {
- color: #101010 !important;
- }
- /deep/.u-cell_title {
- color: rgba(119, 119, 119, 1);
- }
- /deep/.u-cell__value {
- color: #333333;
- flex: 0.45;
- margin-left: auto;
- }
- .search {
- // background-color: #fff;
- padding: 16rpx 24rpx;
- margin-top: 80rpx;
- }
- /deep/.u-action {
- width: 17.1%;
- text-align: center;
- line-height: 56rpx;
- border-radius: 50px;
- background-color: rgba(13, 186, 199, 1);
- color: rgba(255, 255, 255, 1);
- }
- /deep/.u-content {
- height: 56rpx !important;
- background-color: #fff !important;
- }
- /deep/.u-input {
- background-color: #fff !important;
- }
- .student-details {
- padding: 24rpx 32rpx;
- background-color: #fff;
- display: flex;
- position: relative;
- border-bottom: 1px solid rgba(229, 231, 234, 1);
- ;
- .photo {
- width: 112rpx;
- height: 112rpx;
- border-radius: 4px;
- overflow: hidden;
- margin-right: 22rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .details {
- display: flex;
- align-items: center;
- .name-tel {
- .name {
- margin-right: 12px;
- color: rgba(51, 51, 51, 1);
- font-size: 18px;
- margin-bottom: 16rpx;
- }
- .tel {
- color: rgba(119, 119, 119, 1);
- // line-height: 24px;
- display: flex;
- align-items: center;
- }
- }
- }
- .more {
- color: #333333;
- position: absolute;
- bottom: 65rpx;
- right: 24rpx;
- }
- }
- @media screen and (max-width:320px) {
- .student-card {
- padding: 2rpx 12rpx 0rpx 12rpx;
- margin: 32rpx 16rpx;
- }
- .item-name {
- width: 244rpx !important;
- }
- }
- /deep/.uni-input-placeholder {
- font-size: 24rpx
- }
- .content-2 {
- margin-top: 90rpx;
- .search {
- position: fixed;
- left: 0rpx;
- right: 0rpx;
- top: 0rpx;
- z-index: 999;
- background-color: #F2F4F4;
- }
- }
- </style>
|