StudentInfo.vue 7.1 KB

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