StudentInfo.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <div class="studyInfo">
  3. <header>
  4. <div class="left"><i></i><span>学员信息</span></div>
  5. <div class="goods_info">
  6. <span v-for="(item, i) in headList" :key="i">
  7. <strong style="color: red">「{{ i + 1 }}」</strong>
  8. {{ item.lebel }}
  9. <span v-if="item.key != 'num' && item.key != 'time'">{{
  10. userData[item.key]
  11. }}</span>
  12. <span v-else-if="item.key == 'num'"
  13. >完成{{ userData.stuAllNum + userData.recordNum }}节的内容学习</span
  14. >
  15. <span v-else-if="item.key == 'time'"
  16. >{{ $methodsTools.onlyForma(userData.studyStartTime, false) }} -
  17. {{ $methodsTools.onlyForma(userData.studyEndTime, false) }}</span
  18. >
  19. </span>
  20. </div>
  21. <el-button class="btn" type="primary" size="mini" @click="packUp">{{
  22. showBox ? "收起" : "展开"
  23. }}</el-button>
  24. </header>
  25. <div class="info_img" v-show="showBox">
  26. <ul>
  27. <li>学员编码:{{ userData.studentCode }}</li>
  28. <li>学员姓名:{{ userData.realName }}</li>
  29. <li>学员身份证号码:{{ userData.idCard }}</li>
  30. <li>绑定手机号码:{{ userData.telPhone }}</li>
  31. </ul>
  32. <div class="img_by">
  33. <div class="photoSty1">
  34. <img
  35. v-if="!userData.oneInchPhotos"
  36. src="@/assets/images/peopleImg.png"
  37. alt=""
  38. />
  39. <el-image
  40. v-else
  41. style="width: 100%; height: 100%"
  42. :src="$methodsTools.splitImgHost(userData.oneInchPhotos)"
  43. :preview-src-list="[
  44. $methodsTools.splitImgHost(userData.oneInchPhotos),
  45. ]"
  46. >
  47. </el-image>
  48. <div class="pos_bottom">一寸头像图</div>
  49. </div>
  50. <div class="photoSty2">
  51. <img
  52. v-if="!userData.idCardImg1"
  53. src="@/assets/images/idcardF.png"
  54. alt=""
  55. />
  56. <el-image
  57. v-else
  58. style="width: 100%; height: 100%"
  59. :src="$methodsTools.splitImgHost(userData.idCardImg1)"
  60. :preview-src-list="[
  61. $methodsTools.splitImgHost(userData.idCardImg1),
  62. ]"
  63. >
  64. </el-image>
  65. <div class="pos_bottom">身份证头像照</div>
  66. </div>
  67. <div class="photoSty2" style="margin-right: 0px">
  68. <img
  69. v-if="!userData.idCardImg2"
  70. src="@/assets/images/idcardZ.png"
  71. alt=""
  72. />
  73. <el-image
  74. v-else
  75. style="width: 100%; height: 100%"
  76. :src="$methodsTools.splitImgHost(userData.idCardImg2)"
  77. :preview-src-list="[
  78. $methodsTools.splitImgHost(userData.idCardImg2),
  79. ]"
  80. >
  81. </el-image>
  82. <div class="pos_bottom">身份证国徽照</div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </template>
  88. <script>
  89. export default {
  90. props: {
  91. userData: {
  92. type: Object,
  93. default: () => {
  94. return {};
  95. },
  96. },
  97. all: {
  98. type: Boolean,
  99. default: true,
  100. },
  101. },
  102. data() {
  103. return {
  104. showBox: true,
  105. };
  106. },
  107. methods: {
  108. packUp() {
  109. this.showBox = !this.showBox;
  110. this.$emit("change");
  111. },
  112. },
  113. computed: {
  114. headList() {
  115. const list = [
  116. { lebel: "所在班级:", key: "className" },
  117. { lebel: "学时:", key: "classHours" },
  118. { lebel: "", key: "num" },
  119. { lebel: "学习时间:", key: "time" },
  120. ];
  121. if (this.all) {
  122. list.unshift({ lebel: "所购商品:", key: "goodsName" });
  123. }
  124. return list;
  125. },
  126. },
  127. };
  128. </script>
  129. <style lang="scss" scoped>
  130. .studyInfo {
  131. background: #ffffff;
  132. box-shadow: 0px 0px 8px 0px rgba(217, 217, 217, 0.8);
  133. border-radius: 8px;
  134. padding: 8px 16px;
  135. overflow: hidden;
  136. & > header {
  137. display: flex;
  138. position: relative;
  139. flex-wrap: wrap;
  140. // height: 48px;
  141. line-height: 48px;
  142. & > .left {
  143. display: flex;
  144. align-items: center;
  145. white-space: nowrap;
  146. margin-right: 40px;
  147. i {
  148. display: inline-block;
  149. width: 2px;
  150. height: 18px;
  151. background: #0c5dfb;
  152. margin-right: 8px;
  153. }
  154. span {
  155. color: #666;
  156. font-weight: bold;
  157. }
  158. }
  159. & > .goods_info {
  160. display: flex;
  161. flex-wrap: wrap;
  162. span {
  163. font-size: 14px;
  164. padding-left: 20px;
  165. white-space: nowrap;
  166. }
  167. }
  168. .btn {
  169. position: absolute;
  170. right: 0;
  171. top: 10px;
  172. }
  173. }
  174. & > .info_img {
  175. display: flex;
  176. height: 210px;
  177. ul {
  178. width: 320px;
  179. li {
  180. margin-bottom: 12px;
  181. font-size: 14px;
  182. }
  183. }
  184. .img_by {
  185. flex: 1;
  186. display: flex;
  187. align-items: center;
  188. .pos_bottom {
  189. position: absolute;
  190. z-index: 1;
  191. bottom: 0px;
  192. width: 100%;
  193. height: 32px;
  194. background-color: rgba(53, 53, 53, 0.6);
  195. text-align: center;
  196. color: #fff;
  197. font-size: 16px;
  198. line-height: 32px;
  199. }
  200. & > .photoSty1 {
  201. width: 152px;
  202. height: 208px;
  203. position: relative;
  204. overflow: hidden;
  205. border-radius: 8px;
  206. background-color: #f5f5f5;
  207. margin-right: 75px;
  208. & > img {
  209. width: 106px;
  210. height: 150px;
  211. margin: 29px auto 0px;
  212. display: block;
  213. }
  214. }
  215. & > .photoSty2 {
  216. width: 328px;
  217. height: 208px;
  218. position: relative;
  219. overflow: hidden;
  220. border-radius: 8px;
  221. background-color: #f5f5f5;
  222. margin-right: 75px;
  223. & > img {
  224. width: 243px;
  225. height: 154px;
  226. margin: 27px auto 0px;
  227. display: block;
  228. }
  229. &:last-of-type {
  230. margin-right: 0px;
  231. }
  232. }
  233. }
  234. }
  235. }
  236. </style>>