| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- <template>
- <el-dialog class="buy-dev-wrapper" :visible.sync="showDialog" :before-close="handleClose">
- <div slot="title" class="dialog-title">
- <img src="~@/assets/img/vip/vip_buy_icon@2x.png" alt="vip_icon" />
- <span>购买开发者会员</span>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button class="buy-btn" type="primary" @click="handleClickBuy">
- <!-- vip_type: 1 - 企业;2 - 开发者 -->
- {{vipDetail.user_info && vipDetail.user_info.vip_type == 2 ? "续费" : "开通"}}
- </el-button>
- </div>
- <div class="buy-dev-box">
- <div class="buy-dev-content">
- <!-- 4.27 todo: 包年、包季与后端联调 -->
- <div
- class="buy-dev-item"
- :class="{'active': number == '12+'}"
- v-if="item['can_buy_yearly'] === '0'"
- @click="clickNumber('12+')">
- <div class="name">连续包年</div>
- <div class="price">¥{{ Number(item['yearly_real_price']).toFixed(2) }}</div>
- <div class="price-per-month">¥{{ (Number(item['yearly_real_price']) / 12).toFixed(2) }}/月</div>
- </div>
- <div
- class="buy-dev-item"
- :class="{'active': number == '3+'}"
- v-if="item['can_buy_yearly'] === '0'"
- @click="clickNumber('3+')">
- <div class="name">连续包季</div>
- <div class="price">¥{{ Number(item['yearly_real_price']).toFixed(2) }}</div>
- <div class="price-per-month">¥{{ (Number(item['yearly_real_price']) / 12).toFixed(2) }}/月</div>
- </div>
- <div
- class="buy-dev-item"
- :class="{'active': number == '12'}"
- v-if="item['can_buy_yearly'] === '0'"
- @click="clickNumber('12')">
- <div class="name">12个月</div>
- <div class="price">¥{{ Number(item['yearly_real_price']).toFixed(2) }}</div>
- <div class="price-per-month">¥{{ (Number(item['yearly_real_price']) / 12).toFixed(2) }}/月</div>
- </div>
- <div
- class="buy-dev-item"
- :class="{'active': number == '6'}"
- v-if="item['can_buy_half_yearly'] === '1'"
- @click="clickNumber('6')">
- <div class="name">6个月</div>
- <div class="price">¥{{ Number(item['half_yearly_real_price']).toFixed(2) }}</div>
- <div class="price-per-month">¥{{ (Number(item['half_yearly_real_price']) / 12).toFixed(2) }}/月</div>
- </div>
- <div
- class="buy-dev-item"
- :class="{'active': number == '3'}"
- v-if="item['can_buy_quarterly'] === '0'"
- @click="clickNumber('3')">
- <div class="name">3个月</div>
- <div class="price">¥{{ Number(item['quarterly_real_price']).toFixed(2) }}</div>
- <div class="price-per-month">¥{{ (Number(item['quarterly_real_price']) / 12).toFixed(2) }}/月</div>
- </div>
- </div>
- <!-- 选择连续包年时展示 -->
- <div v-if="number == '12+'" class="buy-dev-tips">
- <span>到期按{{ Number(item['yearly_real_price']).toFixed(2) }}元每年自动续约,可随时取消</span>
- <el-tooltip placement="bottom-end">
- <div slot="content" class="">
- <p>自动续费说明</p>
- <p>1. 会员权益到期前一天,为您自动续费;</p>
- <p>2. 扣款前消息通知,完全透明;</p>
- <p>3. 可随时取消服务,取消后不再自动续费。</p>
- </div>
- <img src="~@/assets/img/vip/tips_icon@2x.png" class="tips-img" >
- </el-tooltip>
- </div>
- <!-- 选择连续包季时展示 -->
- <div v-if="number == '3+'" class="buy-dev-tips">
- <span>到期按{{ Number(item['yearly_real_price']).toFixed(2) }}元每季自动续约,可随时取消</span>
- <el-tooltip placement="bottom-end">
- <div slot="content" class="">
- <p>自动续费说明</p>
- <p>1. 会员权益到期前一天,为您自动续费;</p>
- <p>2. 扣款前消息通知,完全透明;</p>
- <p>3. 可随时取消服务,取消后不再自动续费。</p>
- </div>
- <img src="~@/assets/img/vip/tips_icon@2x.png" class="tips-img" >
- </el-tooltip>
- </div>
- </div>
- </el-dialog>
- </template>
- <script>
- export default {
- name: 'BuyDevDialog',
- props: {
- showDialog: {
- type: Boolean,
- default: false
- },
- // 购买开发者会员的配置信息
- item: Object,
- handleClose: Function,
- vipDetail: Object
- },
- data () {
- return {
- number: '12+'
- }
- },
- methods: {
- /**
- * 切换选择会员时间
- */
- clickNumber (number) {
- this.number = number;
- },
- /**
- * 点击开通/续费时
- */
- handleClickBuy () {
- if (this.number == '12+') {
- this.$message('连续包年')
- } else if (this.number == '3+') {
- this.$message('连续包季')
- } else {
- const item = this.item;
- location.href = `/vip/pay?product_id=${item.id}&number=${this.number}&next=/type/vip/`;
- }
- // else if (this.number == '12') {
- // this.$message('购买12个月')
- // } else if (this.number == '6') {
- // this.$message('购买6个月')
- // } else if (this.number == '3') {
- // this.$message('购买3个月')
- // }
- }
- }
- }
- </script>
- <style lang="scss">
- .buy-dev-wrapper {
- .el-dialog {
- width: 669px;
- }
- .el-dialog__headerbtn {
- top: 32px;
- right: 30px;
- }
- .el-dialog__header {
- padding: 30px 30px 10px;
- }
- .el-dialog__footer {
- padding: 0 30px 30px;
- }
- }
- </style>
- <style lang="scss" scoped>
- .buy-dev-box {
- width: 594px;
- margin: 0 auto;
- display: flex;
- flex-direction: column;
- .buy-dev-content {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- .buy-dev-item {
- width: 190px;
- height: 120px;
- margin: 0 12px 14px 0;
- background: #ffffff;
- border: 1px solid rgba(0,0,0,0.05);
- border-radius: 7px;
- box-shadow: 0px 3px 12px 0px rgba(8,27,50,0.05);
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- &:nth-of-type(3n) {
- margin-right: 0;
- }
- &.active {
- border: 2px solid #308eff;
- }
- .name {
- font-size: 18px;
- font-family: PingFangSC, PingFangSC-Semibold;
- font-weight: 600;
- text-align: center;
- color: #308eff;
- line-height: 25px;
- }
- .price {
- margin-top: 10px;
- font-size: 16px;
- font-family: PingFangSC, PingFangSC-Semibold;
- font-weight: 600;
- text-align: center;
- color: #222222;
- line-height: 22px;
- }
- .price-per-month {
- font-size: 12px;
- font-family: PingFangSC, PingFangSC-Regular;
- font-weight: 400;
- text-align: center;
- color: #999999;
- line-height: 17px;
- }
- }
- }
- .buy-dev-tips {
- font-size: 14px;
- font-family: PingFangSC, PingFangSC-Regular;
- font-weight: 400;
- color: #999999;
- line-height: 20px;
- display: flex;
- align-items: center;
- .tips-img {
- margin-left: 2px;
- width: 14px;
- height: 14px;
- cursor: pointer;
- }
- }
- }
- .dialog-title {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- img {
- width: 31px;
- height: 25px;
- margin-right: 8px;
- }
- span {
- font-size: 23px;
- font-family: PingFangSC, PingFangSC-Semibold;
- font-weight: 600;
- color: #222222;
- }
- }
- .dialog-footer {
- width: 100%;
- display: flex;
- justify-content: center;
- .buy-btn {
- width: 290px;
- height: 48px;
- background: #e1a83f;
- border: none;
- border-radius: 10px;
- font-size: 16px;
- font-family: PingFangSC, PingFangSC-Semibold;
- font-weight: 600;
- text-align: center;
- color: #222222;
- line-height: 22px;
- }
- }
- </style>
|