buy-dialog.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <el-dialog class="wrapper-buy-dialog" :visible.sync="buyDialog" :before-close="handleClose">
  3. <div class="buy-dialog">
  4. <template v-if="type === 'dev'">
  5. <img src="~@/assets/img/vip/vip_icon.png" alt="vip_icon" />
  6. <h4>购买开发者会员</h4>
  7. </template>
  8. <template v-else-if="type==='com'">
  9. <img src="~@/assets/img/vip/vip_icon_com.png" alt="vip_icon_com" />
  10. <h4>购买初创版会员</h4>
  11. </template>
  12. <template v-else>
  13. <img src="~@/assets/img/vip/vip_icon_premium.png" alt="vip_icon_com" />
  14. <h4>购买企业版会员</h4>
  15. </template>
  16. <div class="wrapper-number">
  17. <div
  18. v-if="item['can_buy_quarterly'] === '1'"
  19. @click="clickNumber(3)"
  20. :class="{number: true, 'is-checked': number==3}"
  21. >
  22. <span>
  23. <strong>3</strong>个月
  24. </span>
  25. <span>¥{{item[pricePrefix + 'quarterly_real_price']}}</span>
  26. <span
  27. v-if="parseInt(item[pricePrefix + 'quarterly_origin_price']) > parseInt(item[pricePrefix + 'quarterly_real_price'])"
  28. class="del"
  29. >¥{{item[pricePrefix + 'quarterly_origin_price']}}</span>
  30. </div>
  31. <div
  32. v-if="item['can_buy_half_yearly'] === '1'"
  33. @click="clickNumber(6)"
  34. :class="{number: true, 'is-checked': number==6}"
  35. >
  36. <span>
  37. <strong>6</strong>个月
  38. </span>
  39. <span>¥{{item[pricePrefix + 'half_yearly_real_price']}}</span>
  40. <span
  41. v-if="parseInt(item[pricePrefix + 'half_yearly_origin_price']) > parseInt(item[pricePrefix + 'half_yearly_real_price'])"
  42. class="del"
  43. >¥{{item[pricePrefix + 'half_yearly_origin_price']}}</span>
  44. </div>
  45. <div
  46. v-if="item['can_buy_yearly'] === '1'"
  47. @click="clickNumber(12)"
  48. :class="{number: true, 'is-checked': number==12}"
  49. >
  50. <span>
  51. <strong>12</strong>个月
  52. </span>
  53. <span>¥{{item[pricePrefix + 'yearly_real_price']}}</span>
  54. <span
  55. v-if="parseInt(item[pricePrefix + 'yearly_origin_price']) > parseInt(item[pricePrefix + 'yearly_real_price'])"
  56. class="del"
  57. >¥{{item[pricePrefix + 'yearly_origin_price']}}</span>
  58. </div>
  59. </div>
  60. <span slot="footer" class="dialog-footer">
  61. <el-button
  62. class="buy-btn"
  63. type="primary"
  64. @click="gotoPay(number)"
  65. >{{vipDetail.user_info && vipDetail.user_info.vip_type >0 ? "续费" : "开通"}}</el-button>
  66. </span>
  67. </div>
  68. </el-dialog>
  69. </template>
  70. <script>
  71. export default {
  72. props: [
  73. "handleClose",
  74. "buyDialog",
  75. "gotoPay",
  76. "type",
  77. "item",
  78. "vipDetail",
  79. "pricePrefix"
  80. ],
  81. data() {
  82. return {
  83. number: 3
  84. };
  85. },
  86. computed: {},
  87. mounted() {},
  88. methods: {
  89. clickNumber(number) {
  90. this.number = number;
  91. }
  92. }
  93. };
  94. </script>
  95. <style lang="scss">
  96. .wrapper-buy-dialog .el-dialog {
  97. width: 669px;
  98. }
  99. .buy-dialog {
  100. display: flex;
  101. flex-direction: column;
  102. align-items: center;
  103. justify-content: center;
  104. margin-top: -15px;
  105. width: 650px;
  106. img {
  107. width: 44px;
  108. }
  109. h4 {
  110. margin-top: 11px;
  111. font-size: 23px;
  112. font-family: PingFangSC-Semibold;
  113. font-weight: 600;
  114. color: rgba(34, 34, 34, 1);
  115. line-height: 32px;
  116. }
  117. .wrapper-number {
  118. display: flex;
  119. justify-content: flex-start;
  120. margin: 35px 0;
  121. padding: 0 25px;
  122. width: 100%;
  123. .number {
  124. display: flex;
  125. flex-direction: column;
  126. align-items: center;
  127. padding-top: 20px;
  128. margin-right: 30px;
  129. width: 180px;
  130. height: 120px;
  131. border-radius: 2px;
  132. border: 1px solid rgba(221, 221, 221, 1);
  133. font-family: PingFangSC-Light;
  134. font-weight: 300;
  135. color: rgba(34, 34, 34, 1);
  136. cursor: pointer;
  137. strong {
  138. font-size: 54px;
  139. line-height: 50px;
  140. }
  141. span {
  142. line-height: 20px;
  143. }
  144. .del {
  145. color: #999;
  146. text-decoration: line-through;
  147. }
  148. }
  149. .is-checked {
  150. border: 2px solid rgba(225, 168, 63, 1);
  151. }
  152. }
  153. .buy-btn {
  154. width: 236px;
  155. height: 48px;
  156. background: rgba(34, 34, 34, 1);
  157. border-radius: 2px;
  158. font-size: 16px;
  159. font-family: PingFangSC-Semibold;
  160. font-weight: 600;
  161. color: rgba(232, 190, 79, 1);
  162. line-height: 22px;
  163. }
  164. }
  165. @media screen and (max-width: 960px) {
  166. .wrapper-buy-dialog .el-dialog {
  167. width: 309px;
  168. }
  169. .buy-dialog {
  170. width: 255px;
  171. .wrapper-number {
  172. flex-direction: column;
  173. padding: 0;
  174. .number {
  175. flex-direction: row;
  176. justify-content: space-between;
  177. margin-top: 12px;
  178. padding: 7px 10px;
  179. width: 255px;
  180. height: 65px;
  181. font-size: 12px;
  182. strong {
  183. line-height: 50px;
  184. font-size: 36px;
  185. }
  186. }
  187. span:nth-of-type(1) {
  188. order: 0;
  189. }
  190. span:nth-of-type(2) {
  191. order: 3;
  192. }
  193. span:nth-of-type(3) {
  194. order: 2;
  195. margin-left: 60px;
  196. }
  197. }
  198. }
  199. }
  200. </style>