freelancer.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <section class="freelancer">
  3. <section class="freelancer-top">
  4. <h1>{{detail.name}}认证</h1>
  5. <section class="info" v-html="detail.description"/>
  6. <section class="cer-price-info">
  7. <span class="price">
  8. ¥{{detail.real_price}}
  9. <sub class="sub">/次</sub>
  10. </span>
  11. <span class="origin-price">原价¥{{detail.origin_price}}</span>
  12. <span
  13. class="vip-tag"
  14. v-if="detail.is_vip_discount"
  15. @click="clickVipPrice"
  16. >开通会员低至¥{{detail.vip_price}}</span>
  17. </section>
  18. <section class="cert-status">
  19. <button class="cer-ctrl death" v-if="isDeath">{{detail.btn_name}}</button>
  20. <button class="cer-ctrl" @click="clickBtn" v-else>{{detail.btn_name}}</button>
  21. <span
  22. class="userful-time"
  23. v-if="detail.end_date && detail.is_cert_validate && detail.cert_no"
  24. >有效期至{{detail.end_date}} <a :href="`/cert/id?no=${detail.cert_no}`">查看证书</a></span>
  25. </section>
  26. </section>
  27. <pre class="pre">
  28. <span style="color: #333;">说明:</span>
  29. 1、认证申请基本条件:已成为平台签约开发者,无纠纷降权记录;
  30. 2、认证申请将在3到5个工作日内完成审核;
  31. 3、认证申请为付费服务,若因申请者不达标而认证不通过,费用不予退回,3个月内可以免费申请3次;
  32. 4、认证通过后,资质有效期为一年,到期后需要重新提交认证;
  33. 5、认证通过后,如果违反平台相关规则,平台有权取消认证资质;
  34. 6、如有疑问,请联系在线客服,或拨打客服热线 0571-28120931
  35. </pre>
  36. </section>
  37. </template>
  38. <script>
  39. import http from '@/plugins/http'
  40. export default {
  41. async asyncData(ctx) {
  42. let id = ctx.query.id
  43. , { data } = await http.post(`${ctx.isDev ? '' : http.host}/api/cert/getDetail`, { id })
  44. return {
  45. detail: data,
  46. }
  47. },
  48. data() {
  49. return {}
  50. },
  51. head() {
  52. return {
  53. title: `${this.detail.name}认证- 程序员客栈`,
  54. meta: [
  55. // { hid: 'description', name: 'description', content: 'My custom description' }
  56. ]
  57. }
  58. },
  59. computed: {
  60. isDeath() {
  61. return this.detail.status === '1' || !this.detail.can_click
  62. },
  63. isLogin() {
  64. return this.detail.user_info
  65. }
  66. },
  67. mounted() {
  68. console.log(this.detail)
  69. },
  70. methods: {
  71. clickVipPrice() {
  72. window.open('/type/vip/')
  73. },
  74. clickBtn() {
  75. if(this.isLogin) {
  76. if(!this.detail.is_free_apply) location.href = `https://dev.test.proginn.com/pay?product_type=12&product_id=${this.detail.id}&next=/cert`
  77. else {
  78. this.$post('/api/cert/apply', {user_cert_id: this.detail.user_cert_id})
  79. }
  80. } else {
  81. location.href = `/user/notlogin?next=/cert`///freelancer?id=${this.detail.id}`
  82. }
  83. },
  84. }
  85. }
  86. </script>
  87. <style>
  88. .freelancer {
  89. width: 1000px;
  90. border-radius: 4px;
  91. margin: 20px 0 0;
  92. padding: 8px;
  93. }
  94. .freelancer-top {
  95. background: white;
  96. padding: 20px;
  97. }
  98. h1 {
  99. font-size: 28px;
  100. font-weight: 500;
  101. color: rgba(29, 42, 58, 1);
  102. text-align: center;
  103. margin: 16px 12px 0;
  104. padding: 0 0 25px;
  105. border-bottom: 2px solid rgb(243, 243, 243);
  106. }
  107. .info {
  108. margin: 36px 0;
  109. padding-bottom: 30px;
  110. border-bottom: 1px solid #d8d8d8;
  111. }
  112. .cer-price-info {
  113. display: flex;
  114. align-items: center;
  115. margin: 20px 0;
  116. }
  117. .price {
  118. font-size: 24px;
  119. font-family: PingFangSC-Semibold;
  120. font-weight: 600;
  121. color: rgba(34, 34, 34, 1);
  122. }
  123. .sub {
  124. margin: 0 0 0 -6px;
  125. }
  126. p {
  127. line-height: 28px;
  128. }
  129. .origin-price {
  130. font-size: 12px;
  131. font-family: PingFangSC-Regular;
  132. color: rgba(153, 153, 153, 1);
  133. line-height: 17px;
  134. text-decoration: line-through;
  135. margin: 0 10px;
  136. }
  137. a {
  138. text-decoration: underline;
  139. }
  140. .vip-tag {
  141. display: inline-flex;
  142. justify-content: center;
  143. align-items: center;
  144. width: 122px;
  145. height: 22px;
  146. font-size: 12px;
  147. font-family: PingFangSC-Semibold;
  148. font-weight: 600;
  149. color: #ddaf5a;
  150. background: url(~@/assets/img/cert/vip-tag.png) 0 0 / 100% 100% no-repeat;
  151. cursor: pointer;
  152. }
  153. .cer-ctrl {
  154. margin: 10px 0 0;
  155. width: 154px;
  156. height: 40px;
  157. background: #0093fd;
  158. font-size: 14px;
  159. font-family: PingFangSC-Medium;
  160. font-weight: 500;
  161. color: white;
  162. }
  163. .cer-ctrl.death {
  164. background: grey;
  165. cursor: not-allowed;
  166. }
  167. .userful-time {
  168. font-size: 13px;
  169. font-family: PingFangSC-Regular;
  170. color: rgba(153, 153, 153, 1);
  171. }
  172. .pre {
  173. line-height: 20px;
  174. color: #999;
  175. font-size: 12px;
  176. margin-top: 15px;
  177. }
  178. </style>