|
@@ -2,97 +2,112 @@
|
|
|
<section class="user-info-card">
|
|
|
<h4 class="user-info-title">
|
|
|
<span>
|
|
|
- <span class="user-info-title-fireworks"></span>
|
|
|
- <span class="user-info-title-text highlight-text"
|
|
|
- >欢迎您!<i class="user-nickname">{{ accountInfo.nickName }}</i></span>
|
|
|
+ <span class="user-info-title-fireworks" />
|
|
|
+ <span class="user-info-title-text highlight-text">欢迎您!<i class="user-nickname">{{ accountInfo.nickName }}</i></span>
|
|
|
</span>
|
|
|
- <span class="user-info-icon" v-if="accountInfo.vipType && (accountInfo.vipType === '超级订阅' || accountInfo.vipType.includes('大会员'))">
|
|
|
- <i :class="accountInfo.vipType === '超级订阅' ? 'vip-icon': 'bigmember-icon'"></i>
|
|
|
+ <span v-if="accountInfo.vipType && (accountInfo.vipType === '超级订阅' || accountInfo.vipType.includes('大会员'))" class="user-info-icon">
|
|
|
+ <i :class="accountInfo.vipType === '超级订阅' ? 'vip-icon' : 'bigmember-icon'" />
|
|
|
</span>
|
|
|
</h4>
|
|
|
<p class="user-info-line user-info-type">
|
|
|
<span class="user-info-line-label">账号类型:</span>
|
|
|
<span class="user-info-line-value">{{ accountInfo.vipType }}</span>
|
|
|
- <span class="u-i-line-tip" v-if="accountInfo.vipType === '注册用户'">您尚未开通会员</span>
|
|
|
+ <span v-if="accountInfo.vipType === '注册用户'" class="u-i-line-tip">您尚未开通会员</span>
|
|
|
</p>
|
|
|
<div
|
|
|
- class="user-info-line user-info-free bg-gold"
|
|
|
v-if="accountInfo.vipType === '注册用户'"
|
|
|
+ class="user-info-line user-info-free bg-gold"
|
|
|
>
|
|
|
<p>
|
|
|
<span>
|
|
|
- <i class="vip-icon"> </i>
|
|
|
+ <i class="vip-icon" />
|
|
|
<span>开通超级订阅</span>
|
|
|
</span>
|
|
|
- <span class="activity-span" v-if="attr.subVipActMsg">
|
|
|
- <i class="limit-time-icon"></i>
|
|
|
- <span>{{attr.subVipActMsg}}</span>
|
|
|
+ <span v-if="attr.subVipActMsg" class="activity-span">
|
|
|
+ <i class="limit-time-icon" />
|
|
|
+ <span>{{ attr.subVipActMsg }}</span>
|
|
|
</span>
|
|
|
</p>
|
|
|
<p class="handle-p">
|
|
|
<span>立享27+项专属权益</span>
|
|
|
<span
|
|
|
class="handle-btn"
|
|
|
- @click="buyVip('buy')">
|
|
|
+ @click="buyVip('buy')"
|
|
|
+ >
|
|
|
立即开通</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
<div
|
|
|
- class="user-info-line user-info-module"
|
|
|
v-else-if="accountInfo.vipType === '超级订阅'"
|
|
|
+ class="user-info-line user-info-module"
|
|
|
>
|
|
|
<div class="user-info-line-value value-box bg-gold">
|
|
|
<p>到期时间:{{ accountInfo.vipEntTime }}</p>
|
|
|
- <p class="handle-btn m-t-6"
|
|
|
- @click="renewVip()">
|
|
|
- 去续费<i class="iconfont icon-more"></i>
|
|
|
+ <p
|
|
|
+ class="handle-btn m-t-6"
|
|
|
+ @click="renewVip()"
|
|
|
+ >
|
|
|
+ 去续费<i class="iconfont icon-more" />
|
|
|
</p>
|
|
|
</div>
|
|
|
- <div class="gap"></div>
|
|
|
- <div class="user-info-line-value value-box bg-gold">
|
|
|
+ <div class="gap" />
|
|
|
+ <div class="user-info-line-value value-box bg-gold">
|
|
|
<p>购买区域:{{ attr.buyMsg }}</p>
|
|
|
- <p class="handle-btn m-t-6"
|
|
|
- @click="updateVip">
|
|
|
- {{ attr.upgrade ? '去升级' : '升级咨询'}}
|
|
|
- <i class="iconfont icon-more"></i>
|
|
|
+ <p
|
|
|
+ class="handle-btn m-t-6"
|
|
|
+ @click="updateVip"
|
|
|
+ >
|
|
|
+ {{ attr.upgrade ? '去升级' : '升级咨询' }}
|
|
|
+ <i class="iconfont icon-more" />
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div
|
|
|
- class="user-info-line user-info-module"
|
|
|
v-else-if="accountInfo.vipType === '省份订阅包'"
|
|
|
+ class="user-info-line user-info-module"
|
|
|
>
|
|
|
<div class="user-info-line-value value-box bg-blue">
|
|
|
<p>到期时间:{{ accountInfo.vipEntTime }}</p>
|
|
|
- <p class="handle-btn m-t-6"
|
|
|
- @click="openCustomer">
|
|
|
- 去续费<i class="iconfont icon-more"></i>
|
|
|
+ <p
|
|
|
+ class="handle-btn m-t-6"
|
|
|
+ @click="openCustomer"
|
|
|
+ >
|
|
|
+ 去续费<i class="iconfont icon-more" />
|
|
|
</p>
|
|
|
</div>
|
|
|
- <div class="gap"></div>
|
|
|
- <div class="user-info-line-value value-box" :class="attr.upgrade ? 'bg-blue' : 'bg-gold'">
|
|
|
+ <div class="gap" />
|
|
|
+ <div class="user-info-line-value value-box" :class="attr.upgrade ? 'bg-blue' : 'bg-gold'">
|
|
|
<p>购买区域:{{ attr.buyMsg }}</p>
|
|
|
- <p class="handle-btn m-t-6" @click="areaVipUpdate">
|
|
|
- {{attr.upgrade ? '去升级' : '开通超级订阅'}}
|
|
|
- <i class="iconfont icon-more"></i>
|
|
|
+ <p class="handle-btn m-t-6" @click="areaVipUpdate">
|
|
|
+ {{ attr.upgrade ? '去升级' : '开通超级订阅' }}
|
|
|
+ <i class="iconfont icon-more" />
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<!-- 大会员或者商机管理-->
|
|
|
- <div class="user-info-line user-info-module" v-else>
|
|
|
+ <!-- 大会员或者商机管理 -->
|
|
|
+ <div v-else class="user-info-line user-info-module">
|
|
|
<div class="user-info-line-value value-box bigmember bg-black">
|
|
|
<p>到期时间:{{ accountInfo.vipEntTime }}</p>
|
|
|
- <p class="handle-btn m-t-6"
|
|
|
- @click="renewConsult">续费咨询
|
|
|
- <i class="iconfont icon-more"></i>
|
|
|
+ <p
|
|
|
+ class="handle-btn m-t-6"
|
|
|
+ @click="renewConsult"
|
|
|
+ >
|
|
|
+ 续费咨询
|
|
|
+ <i class="iconfont icon-more" />
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 引导赠送好友超级订阅 -->
|
|
|
+ <div v-if="isShowGift" class="gift-tip">
|
|
|
+ <span>支持送好友超级订阅</span>
|
|
|
+ <span class="gift-link" @click="goGiftLink">送给朋友></span>
|
|
|
+ </div>
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { getUserAccountShow } from '@/api/modules/'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'UserAccount',
|
|
|
data() {
|
|
@@ -103,51 +118,86 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- attr () {
|
|
|
+ attr() {
|
|
|
return this.accountInfo.attr || {}
|
|
|
+ },
|
|
|
+ isShowGift() {
|
|
|
+ return this.accountInfo.vipType === '注册用户' || this.accountInfo.vipType === '超级订阅'
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getAccount()
|
|
|
},
|
|
|
methods: {
|
|
|
+ goGiftLink() {
|
|
|
+ const vipTypeBool = this.accountInfo.vipType === '注册用户'
|
|
|
+ if (vipTypeBool) {
|
|
|
+ // 弹窗提醒购买超级订阅后赠送好友
|
|
|
+ this.$emit('showGiftDialog', 'buy')
|
|
|
+ }
|
|
|
+ else if (this.accountInfo.vipType === '超级订阅') {
|
|
|
+ const isOneMonthPassed = this.isOneMonthPassed(this.accountInfo.vipEntTime)
|
|
|
+ if (isOneMonthPassed) {
|
|
|
+ // 弹窗提醒超级订阅不满一个月续费后赠送好友
|
|
|
+ this.$emit('showGiftDialog', 'renew')
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // 满足条件,可以直接赠送好友,打开送给朋友弹窗
|
|
|
+ this.$emit('showGiftDialog', 'gift')
|
|
|
+ // 赠送好友后,重新获取用户信息
|
|
|
+ this.getAccount()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ isOneMonthPassed(givenDateString) {
|
|
|
+ const givenDate = new Date(givenDateString).getTime()
|
|
|
+ let currentDate = new Date()
|
|
|
+ // 增加一个月
|
|
|
+ currentDate.setMonth(currentDate.getMonth() + 1)
|
|
|
+ currentDate = new Date(currentDate).getTime()
|
|
|
+ // 比较增加一个月后的当前日期和给定日期
|
|
|
+ return currentDate >= givenDate
|
|
|
+ },
|
|
|
async getAccount() {
|
|
|
const { data, error_code } = await getUserAccountShow()
|
|
|
- if(error_code === 0 && data) {
|
|
|
- const { nickname, list = []} = data
|
|
|
+ if (error_code === 0 && data) {
|
|
|
+ const { nickname, list = [] } = data
|
|
|
const info = list[0] || {}
|
|
|
this.accountInfo = {
|
|
|
nickName: nickname,
|
|
|
vipType: info.name,
|
|
|
- vipEntTime: info.endTime ? new Date(info.endTime * 1000 ).pattern('yyyy-MM-dd') : '',
|
|
|
+ vipEntTime: info.endTime ? new Date(info.endTime * 1000).pattern('yyyy-MM-dd') : '',
|
|
|
attr: info.attr || {}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- buyVip (type) {
|
|
|
- window.open('/swordfish/page_big_pc/free/svip/buy?type=' + type)
|
|
|
+ buyVip(type) {
|
|
|
+ window.open(`/swordfish/page_big_pc/free/svip/buy?type=${type}`)
|
|
|
},
|
|
|
// 超级订阅去续费,企业分配的需要跳转客服,自主购买的跳续费
|
|
|
- renewVip () {
|
|
|
- if(this.attr.renew) {
|
|
|
+ renewVip() {
|
|
|
+ if (this.attr.renew) {
|
|
|
this.buyVip('renew')
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
this.openCustomer()
|
|
|
}
|
|
|
},
|
|
|
// 升级超级订阅
|
|
|
- updateVip () {
|
|
|
- if(this.attr.upgrade) {
|
|
|
+ updateVip() {
|
|
|
+ if (this.attr.upgrade) {
|
|
|
this.buyVip('upgrade')
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
this.openCustomer()
|
|
|
}
|
|
|
},
|
|
|
// 省份订阅包升级
|
|
|
- areaVipUpdate () {
|
|
|
- if(this.attr.upgrade) {
|
|
|
+ areaVipUpdate() {
|
|
|
+ if (this.attr.upgrade) {
|
|
|
this.openCustomer()
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
this.buyVip('buy')
|
|
|
}
|
|
|
},
|
|
@@ -155,18 +205,18 @@ export default {
|
|
|
openCustomer() {
|
|
|
this.contactCustomer(this)
|
|
|
},
|
|
|
- jumpPage (link) {
|
|
|
- if(link) {
|
|
|
+ jumpPage(link) {
|
|
|
+ if (link) {
|
|
|
window.open(link)
|
|
|
}
|
|
|
},
|
|
|
- renewConsult () {
|
|
|
- if(this.accountInfo.vipType === '商机管理') {
|
|
|
+ renewConsult() {
|
|
|
+ if (this.accountInfo.vipType === '商机管理') {
|
|
|
this.openCustomer()
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
this.jumpPage(this.attr.pc)
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -308,6 +358,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .gift-tip {
|
|
|
+ margin-top: 8px;
|
|
|
+ line-height: 22px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #1D1D1D;
|
|
|
+ .gift-link {
|
|
|
+ margin-left: 7px;
|
|
|
+ color: #FF3A20;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
.bg-gold{
|
|
|
background: linear-gradient(90deg,#FFECCE 0%, #FCD7B2 100%);
|
|
|
}
|