Audit.vue 5.3 KB

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