bind_student_list.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <div class="apply_box">
  3. <div class="list_box">
  4. <div class="list_item" v-for="(item,index) in lkeiLIst" :key="index">
  5. <img :src="item.facePic" alt="" class="icon">
  6. <div class="list_rig" >
  7. <div class="list_r_name">
  8. <span>{{item.name}}</span>
  9. <!-- <img src="''" alt="" class="img_na"> -->
  10. <img :src=" item.sex == 0? '/static/icon_bdxs_ns.png' : item.sex == 1? '/static/icon_bdxs_nss.png' : '' " alt="" class="img_nv">
  11. </div>
  12. <div class="list_class">
  13. <span>{{item.schoolName}}</span>
  14. <span>{{item.gradeName}}</span>
  15. <span>{{item.className}}</span>
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="fot_box">
  21. <div class="fot_btn" @click="tj_btn" v-if="!shou ">添加绑定</div>
  22. <p>* 一个账号最多可绑定三名学生</p>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. export default{
  28. data() {
  29. return {
  30. phone:'',
  31. shou:false,
  32. lkeiLIst:[]
  33. }
  34. },
  35. components: {
  36. },
  37. computed:{
  38. },
  39. onShow(){
  40. this.bingeList()
  41. },
  42. onHide() {
  43. },
  44. onLoad(e) {
  45. // let phone =
  46. let token = uni.getStorageSync('phone')
  47. this.phone = uni.getStorageSync('phone')
  48. if(!token){
  49. uni.redirectTo({
  50. url: '/pages/load/roles'
  51. })
  52. return false
  53. }
  54. },
  55. methods:{
  56. bingeList(){
  57. const _this = this
  58. this.$http.get("applet/getChildren/" + this.phone).then(res => {
  59. console.log(res)
  60. if(res.code == 200){
  61. console.log(res.data.length)
  62. if(res.data.length == 0){
  63. uni.redirectTo({
  64. url: '/pages/parents/bind_student'
  65. })
  66. return false
  67. }else if(res.data.length == 3 || res.data.length > 3){
  68. this.shou = true
  69. console.log(45)
  70. }else if(res.data.length < 3){
  71. this.shou = false
  72. }
  73. console.log(this.shou)
  74. this.lkeiLIst = res.data
  75. console.log(this.lkeiLIst)
  76. // this.studenList = res.data
  77. // _this.children_name = this.studenList.name
  78. // // _this.telephone = this.studenList.phone
  79. // // _this.DocumentType = this.studenList.cardType
  80. // _this.Identification = this.studenList.cardId
  81. // _this.children_img = this.studenList.facePic
  82. // _this.scollid = this.studenList.deptId
  83. // _this.gender_index = this.studenList.sex
  84. // _this.schoolUserId = this.studenList.schoolUserId
  85. // _this.schoolId = this.studenList.schoolId
  86. // if(this.studenList.className == null){
  87. // this.select = this.studenList.deptId
  88. // this.case_index = 1
  89. // this.ieiuer = this.studenList.deptId
  90. // }else {
  91. // this.select = this.studenList.gradeName + this.studenList.className
  92. // this.scollid = this.studenList.classInfoId
  93. // }
  94. }else {
  95. uni.showToast({
  96. title: res.msg,
  97. duration: 1000,
  98. icon: 'none'
  99. });
  100. }
  101. console.log(this.studenList)
  102. })
  103. },
  104. tj_btn(){
  105. uni.navigateTo({
  106. url: '/pages/parents/bind_student'
  107. })
  108. }
  109. }
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. .apply_box{
  114. .list_box{
  115. .list_item{
  116. padding: 42upx 38upx;
  117. width: calc(100vw - 76upx);
  118. margin: 0 auto;
  119. box-sizing: border-box;
  120. border-bottom: 1upx solid #E5E5E5;
  121. display: flex;
  122. .icon{
  123. width: 125upx;
  124. height: 125upx;
  125. border-radius: 50%;
  126. margin-right: 42upx;
  127. }
  128. .list_rig{
  129. flex: 1;
  130. display: flex;
  131. flex-direction: column;
  132. justify-content: center;
  133. .list_r_name{
  134. display: flex;
  135. color: #333333;
  136. font-size: 32upx;
  137. margin-bottom: 30upx;
  138. align-items: center;
  139. span{
  140. margin-right: 13upx;
  141. font-weight: bold;
  142. }
  143. img{
  144. width: 28upx;
  145. height: 28upx;
  146. }
  147. }
  148. .list_class{
  149. font-size: 26upx;
  150. display: flex;
  151. color: #222222;
  152. span{
  153. margin-right: 21upx;
  154. }
  155. }
  156. }
  157. }
  158. }
  159. }
  160. .fot_box{
  161. margin-top: 256upx;
  162. // border-top: 1upx solid #F4F4F4;
  163. padding: 20upx 38upx 0;
  164. margin-bottom: 96upx;
  165. p{
  166. color: #AAAAAA;
  167. font-size: 22upx;
  168. text-align: center;
  169. padding: 17upx 0;
  170. }
  171. .fot_btn{
  172. height: 96upx;
  173. border-radius: 14upx;
  174. background: #1678FF;
  175. text-align: center;
  176. line-height: 96upx;
  177. color: #fff;
  178. font-size: 36upx;
  179. }
  180. }
  181. </style>