Audit.vue 6.4 KB

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