|
|
@@ -3,42 +3,42 @@
|
|
|
<section class="banners-box" @touchstart="touchStart" @touchend="touchEnd">
|
|
|
<section class="banners" :class="{'banners-com': currentCom}">
|
|
|
<section class="banner">
|
|
|
- <img src="~@/assets/img/vip/vip.png" class="card">
|
|
|
+ <img src="~@/assets/img/vip/vip.png" class="card" />
|
|
|
<section class="header">
|
|
|
<section style="position: relative;">
|
|
|
- <img :src="userInfo.icon_url" class="avator">
|
|
|
- <img v-if="vipNow && !isCom" src="~@/assets/img/vip/vip_icon.png" class="diamond">
|
|
|
+ <img :src="userInfo.icon_url" class="avator" />
|
|
|
+ <img v-if="vipNow && !isCom" src="~@/assets/img/vip/vip_icon.png" class="diamond" />
|
|
|
</section>
|
|
|
<section>
|
|
|
<span class="name">{{userInfo.nickname}}</span>
|
|
|
- <br>
|
|
|
+ <br />
|
|
|
<span v-if="isCom" class="date">暂未开通</span>
|
|
|
<span v-else class="date">{{endTimeCalc}}</span>
|
|
|
</section>
|
|
|
</section>
|
|
|
<section v-if="true || deviceType !== 'ios'">
|
|
|
- <button v-if="!vipNow" class="renewal-fee" @click="clickPay(dev)">开通</button>
|
|
|
+ <button v-if="!vipNow" class="renewal-fee" @click="clickPay('dev')">开通</button>
|
|
|
<button v-else-if="isCom" disabled class="renewal-fee disabled">开通</button>
|
|
|
- <button v-else class="renewal-fee" @click="clickPay(dev)">{{vipNow ? '续费' : '开通'}}</button>
|
|
|
+ <button v-else class="renewal-fee" @click="clickPay('dev')">{{vipNow ? '续费' : '开通'}}</button>
|
|
|
</section>
|
|
|
</section>
|
|
|
<section class="banner">
|
|
|
- <img src="~@/assets/img/vip/vip_com.png" class="card">
|
|
|
+ <img src="~@/assets/img/vip/vip_com.png" class="card" />
|
|
|
<section class="header">
|
|
|
<section style="position: relative;">
|
|
|
- <img :src="userInfo.icon_url" class="avator avator-com">
|
|
|
- <img v-if="vipNow && isCom" src="~@/assets/img/vip/vip_icon_com.png" class="diamond">
|
|
|
+ <img :src="userInfo.icon_url" class="avator avator-com" />
|
|
|
+ <img v-if="vipNow && isCom" src="~@/assets/img/vip/vip_icon_com.png" class="diamond" />
|
|
|
</section>
|
|
|
<section>
|
|
|
<span class="name">{{userInfo.nickname}}</span>
|
|
|
- <br>
|
|
|
+ <br />
|
|
|
<span v-if="isCom" class="date">{{endTimeCalc}}</span>
|
|
|
<span v-else class="date">暂未开通</span>
|
|
|
</section>
|
|
|
</section>
|
|
|
<section v-if="true || deviceType !== 'ios'">
|
|
|
- <button v-if="!vipNow" class="renewal-fee renewal-fee-com" @click="clickPay(com)">开通</button>
|
|
|
- <button v-else-if="isCom" class="renewal-fee renewal-fee-com" @click="clickPay(com)">
|
|
|
+ <button v-if="!vipNow" class="renewal-fee renewal-fee-com" @click="clickPay('com')">开通</button>
|
|
|
+ <button v-else-if="isCom" class="renewal-fee renewal-fee-com" @click="clickPay('com')">
|
|
|
{{vipNow ? '续费' :
|
|
|
'开通'}}
|
|
|
</button>
|
|
|
@@ -72,36 +72,36 @@
|
|
|
<li>
|
|
|
<span>· 整包项目-平台服务费(减免{{detail.project_reduction_rate}}%)</span>
|
|
|
<div v-show="currentCom" class="right">
|
|
|
- <img src="~@/assets/img/vip/tag_com.png" class="sale">
|
|
|
+ <img src="~@/assets/img/vip/tag_com.png" class="sale" />
|
|
|
<span class="discount">{{detail.project_discount}}折</span>
|
|
|
</div>
|
|
|
<div v-show="!currentCom" class="right">
|
|
|
- <img src="~@/assets/img/vip/tag.png" class="sale">
|
|
|
+ <img src="~@/assets/img/vip/tag.png" class="sale" />
|
|
|
<span class="discount">{{detail.project_discount}}折</span>
|
|
|
</div>
|
|
|
</li>
|
|
|
<li>
|
|
|
<span>· 云端工作-平台服务费(减免{{detail.job_reduction_rate}}%)</span>
|
|
|
<div v-show="currentCom" class="right">
|
|
|
- <img src="~@/assets/img/vip/tag_com.png" class="sale">
|
|
|
+ <img src="~@/assets/img/vip/tag_com.png" class="sale" />
|
|
|
<span class="discount">{{detail.job_discount}}折</span>
|
|
|
</div>
|
|
|
<div v-show="!currentCom" class="right">
|
|
|
- <img src="~@/assets/img/vip/tag.png" class="sale">
|
|
|
+ <img src="~@/assets/img/vip/tag.png" class="sale" />
|
|
|
<span class="discount">{{detail.job_discount}}折</span>
|
|
|
</div>
|
|
|
</li>
|
|
|
<li>
|
|
|
<span v-if="currentCom">· 每天50次程序员聊天次数</span>
|
|
|
<span v-else>· 认证的自由开发者可同时接两单</span>
|
|
|
- <img v-show="currentCom" src="~@/assets/img/vip/check_com.png" class="yes">
|
|
|
- <img v-show="!currentCom" src="~@/assets/img/vip/check.png" class="yes">
|
|
|
+ <img v-show="currentCom" src="~@/assets/img/vip/check_com.png" class="yes" />
|
|
|
+ <img v-show="!currentCom" src="~@/assets/img/vip/check.png" class="yes" />
|
|
|
</li>
|
|
|
<li>
|
|
|
<span v-if="currentCom">· 优先推荐对接优质的开发者</span>
|
|
|
<span v-else>· Ping接单意愿权重更高</span>
|
|
|
- <img v-show="currentCom" src="~@/assets/img/vip/check_com.png" class="yes">
|
|
|
- <img v-show="!currentCom" src="~@/assets/img/vip/check.png" class="yes">
|
|
|
+ <img v-show="currentCom" src="~@/assets/img/vip/check_com.png" class="yes" />
|
|
|
+ <img v-show="!currentCom" src="~@/assets/img/vip/check.png" class="yes" />
|
|
|
</li>
|
|
|
</ul>
|
|
|
</section>
|
|
|
@@ -113,94 +113,113 @@
|
|
|
<li class="li">3.如有任何问题,欢迎咨询在线客服,或拨打热线:0571-28120931 转1。</li>
|
|
|
</ul>
|
|
|
</section>
|
|
|
+ <buy-dialog
|
|
|
+ :handleClose="handleClose"
|
|
|
+ :buyDialog="buyDialog"
|
|
|
+ :gotoPay="gotoPay"
|
|
|
+ :type="type"
|
|
|
+ :item="item"
|
|
|
+ :vipDetail="vipDetail"
|
|
|
+ ></buy-dialog>
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-let touchX = 0
|
|
|
-import getDeviceType from '@/mixins/getDeviceType'
|
|
|
-import qs from 'qs';
|
|
|
+let touchX = 0;
|
|
|
+import getDeviceType from "@/mixins/getDeviceType";
|
|
|
+import qs from "qs";
|
|
|
+import buyDialog from "./buy-dialog";
|
|
|
|
|
|
export default {
|
|
|
- props: ['com', 'dev'],
|
|
|
+ props: ["com", "dev", "vipDetail", "isCom"],
|
|
|
data() {
|
|
|
return {
|
|
|
// 当前是企业页
|
|
|
currentCom: false,
|
|
|
// 会员详情
|
|
|
- vipDetail: {}
|
|
|
- }
|
|
|
+ // vipDetail: {},
|
|
|
+ buyDialog: false,
|
|
|
+ type: "com" // com: 企业会员, dev: 开发者会员
|
|
|
+ };
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ buyDialog
|
|
|
},
|
|
|
mixins: [getDeviceType],
|
|
|
computed: {
|
|
|
+ item: function() {
|
|
|
+ return this[this.type] || {};
|
|
|
+ },
|
|
|
endTimeCalc() {
|
|
|
- return this.vipNow ? '有效期至' + this.userInfo.vip_end_date : '暂未开通'
|
|
|
+ return this.vipNow ? "有效期至" + this.userInfo.vip_end_date : "暂未开通";
|
|
|
},
|
|
|
detail() {
|
|
|
- return (this.currentCom ? this.com : this.dev) || {}
|
|
|
+ return (this.currentCom ? this.com : this.dev) || {};
|
|
|
},
|
|
|
vipNow() {
|
|
|
- return this.vipDetail.is_vip || false
|
|
|
+ return this.vipDetail.is_vip || false;
|
|
|
},
|
|
|
vipInfo() {
|
|
|
- return this.vipDetail.vip_info || {}
|
|
|
+ return this.vipDetail.vip_info || {};
|
|
|
},
|
|
|
userInfo() {
|
|
|
- console.log(this.vipDetail)
|
|
|
- return this.vipDetail.user_info || {}
|
|
|
- },
|
|
|
- isCom() {
|
|
|
- if (this.$route.query.isCom) return true
|
|
|
- return this.vipDetail.vip_type_id !== '2'
|
|
|
- },
|
|
|
+ console.log(this.vipDetail);
|
|
|
+ return this.vipDetail.user_info || {};
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getVipDetail();
|
|
|
+ console.log("mobile", this.com, this.dev);
|
|
|
},
|
|
|
methods: {
|
|
|
- /**
|
|
|
- * 点击开通
|
|
|
- */
|
|
|
- async clickPay(item) {
|
|
|
+ clickPay(type) {
|
|
|
+ this.type = type;
|
|
|
+ this.buyDialog = true;
|
|
|
+ // location.href = `/vip/pay?product_id=${item.id}&number=3&next=/type/vip/`;
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ this.buyDialog = false;
|
|
|
+ },
|
|
|
+ async gotoPay(number) {
|
|
|
+ const item = this[this.type];
|
|
|
let query = {
|
|
|
product_type: 11,
|
|
|
- number: 3,
|
|
|
+ number: number,
|
|
|
product_id: item.id
|
|
|
- }
|
|
|
- if (this.deviceType === 'ios') {
|
|
|
+ };
|
|
|
+ if (this.deviceType === "ios") {
|
|
|
let cookie = this.getSign();
|
|
|
- let res = await this.$axios.$post('/api/vip/pay', {
|
|
|
+ let res = await this.$axios.$post("/api/vip/pay", {
|
|
|
product_type: 11,
|
|
|
- number: 3,
|
|
|
+ number: number,
|
|
|
product_id: item.id,
|
|
|
- channel: 'apple',
|
|
|
+ channel: "apple",
|
|
|
...cookie
|
|
|
});
|
|
|
if (res && res.data) {
|
|
|
query = Object.assign({}, query, res.data);
|
|
|
}
|
|
|
}
|
|
|
- location.href = 'proginn://pay?' + qs.stringify(query);
|
|
|
+ location.href = "proginn://pay?" + qs.stringify(query);
|
|
|
},
|
|
|
/**
|
|
|
* 手指右划
|
|
|
*/
|
|
|
swipeRight() {
|
|
|
- this.currentCom = false
|
|
|
+ this.currentCom = false;
|
|
|
},
|
|
|
/**
|
|
|
* 手指左划
|
|
|
*/
|
|
|
swipeLeft() {
|
|
|
- this.currentCom = true
|
|
|
+ this.currentCom = true;
|
|
|
},
|
|
|
touchStart(e) {
|
|
|
- touchX = e.touches[0].clientX
|
|
|
+ touchX = e.touches[0].clientX;
|
|
|
},
|
|
|
touchEnd(e) {
|
|
|
- var offsetX = e.changedTouches[0].clientX - touchX
|
|
|
- if (offsetX < -50) this.swipeLeft()
|
|
|
- else if (offsetX > 50) this.swipeRight()
|
|
|
+ var offsetX = e.changedTouches[0].clientX - touchX;
|
|
|
+ if (offsetX < -50) this.swipeLeft();
|
|
|
+ else if (offsetX > 50) this.swipeRight();
|
|
|
},
|
|
|
/**
|
|
|
* 点击会员计划
|
|
|
@@ -208,18 +227,9 @@ export default {
|
|
|
clickProject(index) {
|
|
|
const vip = this.vipDetail[index];
|
|
|
window.open(recommend.seo_uri);
|
|
|
- },
|
|
|
- /**
|
|
|
- * 获取会员详情
|
|
|
- */
|
|
|
- async getVipDetail() {
|
|
|
- let res = await this.$axios.$post('/api/vip/getVipUserDetail')
|
|
|
- // if (!res || !res.data) return
|
|
|
- this.vipDetail = res && res.data ? res.data : {};
|
|
|
- if (this.isCom) this.currentCom = true
|
|
|
}
|
|
|
- },
|
|
|
-}
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|