Audit.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <!-- 审核 -->
  3. <div class="product-details">
  4. <div class="message">
  5. <div>
  6. <el-image :src="data.picture_url" />
  7. </div>
  8. <div class="text">
  9. <p class="p1">
  10. {{ data.name }}
  11. </p>
  12. <p class="p3">
  13. {{ data.teacher_list.length > 0 ? data.teacher_list[0].teacher_name : '' }}
  14. </p>
  15. </div>
  16. <div class="price">
  17. <p>¥ {{ data.price }}</p>
  18. </div>
  19. </div>
  20. <div class="total">
  21. <p class="total-price">
  22. <span> 一件商品,总金额: </span>
  23. <span class="co-value">¥ {{ data.price }}</span>
  24. </p>
  25. <p class="discount">
  26. <span> 优惠折扣: </span>
  27. <span class="co-value">-¥ {{ discount_money }}</span>
  28. </p>
  29. <p class="payable">
  30. <span> 应付: </span>
  31. <span class="co-value">¥ {{ receivables_money }}</span>
  32. </p>
  33. </div>
  34. <div class="submitBtn">
  35. <div class="text">
  36. <img src="../../assets/course_details/auditimg.png" alt="">
  37. 参加本课程学习需提交申请,审核通过后完成付款即可参加学习。
  38. </div>
  39. <button @click="buy">提交申请</button>
  40. </div>
  41. <el-dialog
  42. top="calc(15vh + 140px)"
  43. width="500px"
  44. class="guide-dialog"
  45. :visible="visible"
  46. :modal="false"
  47. :show-close="false"
  48. >
  49. <div>
  50. 申请已经提交,请留意系统通知或在 <a class="jump" @click="goPersonal">个人中心-订单管理</a> 页面查询审核结果。
  51. </div>
  52. <div slot="footer">
  53. <el-button type="primary" @click="visible = false">确定</el-button>
  54. </div>
  55. </el-dialog>
  56. </div>
  57. </template>
  58. <script>
  59. import { ApplyJoinCourse } from '@/api/course';
  60. export default {
  61. props: {
  62. data: {
  63. default: () => {
  64. return {};
  65. },
  66. type: Object
  67. },
  68. goodsId: {
  69. default: '',
  70. type: String
  71. },
  72. goodsType: {
  73. default: '201',
  74. type: String
  75. }
  76. },
  77. data() {
  78. return {
  79. visible: false,
  80. discount_code: '', // 优惠码
  81. discount_money: 0.0, // 优惠金额
  82. receivables_money: this.data.price // 应收款
  83. };
  84. },
  85. // 方法集合
  86. methods: {
  87. // 提交申请
  88. buy() {
  89. ApplyJoinCourse({
  90. course_id: this.goodsId, // 课程 ID
  91. discount_code: this.discount_code // 优惠码 (目前暂时没有用到)
  92. }).then(() => {
  93. this.$message.success('申请加入课程成功');
  94. this.visible = true;
  95. });
  96. },
  97. goPersonal() {
  98. window.location.href = `/GCLS-Personal/#/EnterSys?SeleNavId=5`;
  99. }
  100. }
  101. };
  102. </script>
  103. <style lang="scss" scoped>
  104. .product-details {
  105. .message {
  106. display: flex;
  107. width: 656px;
  108. height: 152px;
  109. background: rgba(70, 70, 70, 3%);
  110. border-radius: 8px;
  111. .el-image {
  112. width: 120px;
  113. height: 120px;
  114. margin-top: 16px;
  115. margin-left: 16px;
  116. }
  117. .text {
  118. margin-left: 24px;
  119. .p1 {
  120. display: box;
  121. width: 360px;
  122. max-height: 48px;
  123. margin-top: 22px;
  124. overflow: hidden;
  125. font-size: 16px;
  126. line-height: 20px;
  127. color: #2c2c2c;
  128. text-overflow: ellipsis;
  129. word-break: break-all;
  130. -webkit-line-clamp: 2;
  131. // 多行文本的情况下,用省略号 “...” 隐藏超出范围的文本
  132. -webkit-box-orient: vertical;
  133. }
  134. .p2 {
  135. margin-top: 10px;
  136. span {
  137. width: 64px;
  138. height: 24px;
  139. padding: 2px 8px;
  140. font-size: 12px;
  141. font-weight: bold;
  142. line-height: 24px;
  143. color: $basic-color;
  144. text-align: center;
  145. background: #ffefd8;
  146. border-radius: 4px;
  147. }
  148. }
  149. .p3 {
  150. margin-top: 10px;
  151. }
  152. }
  153. .price {
  154. p {
  155. margin-top: 22px;
  156. margin-left: 67px;
  157. font-size: 16px;
  158. font-weight: bold;
  159. color: #ff4c00;
  160. text-align: right;
  161. }
  162. }
  163. }
  164. .promotionCode {
  165. display: flex;
  166. align-self: center;
  167. justify-content: flex-start;
  168. width: 100%;
  169. height: 58px;
  170. margin-top: 24px;
  171. line-height: 56px;
  172. border-top: 1px solid rgba(44, 44, 44, 15%);
  173. border-bottom: 1px solid rgba(44, 44, 44, 15%);
  174. .sp1 {
  175. font-size: 16px;
  176. color: #000;
  177. }
  178. input {
  179. box-sizing: border-box;
  180. flex: 1;
  181. height: 56px;
  182. padding: 0 24px;
  183. border: none;
  184. outline: none;
  185. }
  186. .sp2 {
  187. font-size: 16px;
  188. color: $basic-color;
  189. cursor: pointer;
  190. }
  191. }
  192. .total {
  193. width: 656px;
  194. padding-top: 24px;
  195. font-size: 16px;
  196. color: #000;
  197. text-align: right;
  198. .useCode {
  199. font-size: 12px;
  200. color: rgba(0, 0, 0, 50%);
  201. }
  202. > p {
  203. > span {
  204. display: inline-block;
  205. }
  206. .co-value {
  207. width: 160px;
  208. }
  209. }
  210. &-price > span {
  211. line-height: 24px;
  212. }
  213. .discount {
  214. margin: 16px 0 10px;
  215. }
  216. .payable {
  217. > span {
  218. line-height: 36px;
  219. }
  220. .co-value {
  221. font-size: 24px;
  222. color: #ff4c00;
  223. }
  224. }
  225. }
  226. .submitBtn {
  227. display: flex;
  228. align-items: center;
  229. justify-content: space-between;
  230. margin-top: 16px;
  231. .text {
  232. display: flex;
  233. align-items: center;
  234. width: 520px;
  235. height: 40px;
  236. color: #fff;
  237. background: #ff6c69;
  238. border-radius: 4px;
  239. img {
  240. width: 24px;
  241. margin-right: 10px;
  242. margin-left: 18px;
  243. }
  244. }
  245. button {
  246. width: 120px;
  247. height: 40px;
  248. line-height: 40px;
  249. color: #fff;
  250. cursor: pointer;
  251. background: $basic-color;
  252. border: none;
  253. border-radius: 4px;
  254. }
  255. }
  256. }
  257. </style>
  258. <style lang="scss">
  259. .product-details {
  260. .guide-dialog {
  261. .el-dialog__header {
  262. padding: 0;
  263. }
  264. .el-dialog__body {
  265. padding: 24px 32px 14px;
  266. font-size: 16px;
  267. font-weight: 500;
  268. line-height: 24px;
  269. .jump {
  270. color: $basic-color;
  271. }
  272. }
  273. }
  274. }
  275. </style>