Commit 1bb1f71c authored by Facius's avatar Facius

feat: 适配华为

parent a692d7e0
Pipeline #6712 canceled with stages
......@@ -32,7 +32,7 @@
</view>
<slot v-else />
</view>
<view v-if="isShare" class="bottom-tip">
<view v-if="tipTop" class="bottom-tip">
<view class="tip-view">{{ bottomTip }}</view>
</view>
<view class="buttons-view">
......@@ -65,7 +65,7 @@
</view>
</view>
<view
v-if="bottomTip && !isShare"
v-if="bottomTip && !tipTop"
:class="['bottom-tip', { select: select }]"
:hover-class="isSelect ? 'u-hover-class' : ''"
@click="$u.throttle(handleSelect, 500)"
......@@ -117,7 +117,7 @@ export default {
type: String,
default: '',
},
// normal 普通; error 红色确认;select 底部有个勾选;share 分享领三天会员;renew 续费提示
// normal 普通; error 红色确认;select 底部有个勾选;share 分享领三天会员;renew 续费提示,huawei 华为必须免费体验
type: {
type: String,
default: 'normal',
......@@ -167,6 +167,12 @@ export default {
isRenew() {
return this.type == 'renew'
},
isHuaWei() {
return this.type == 'huawei'
},
tipTop() {
return this.isShare || this.isHuaWei
},
customCancel() {
return {
color: 'transparent',
......@@ -195,7 +201,7 @@ export default {
this.loading = this.loadingShow
this.changeVisibleValue(false)
this.$emit('confirm', this.select)
if (this.isShare || this.isRenew) {
if (this.isShare || this.isRenew || this.isHuaWei) {
// 去开通会员
uni.navigateTo({
url: 'pages/mine/pay/pay',
......@@ -211,7 +217,9 @@ export default {
if (this.isShare) {
// 分享领会员
this.$emit('share')
this.$emit('share',true)
} else if (this.isHuaWei){
this.$emit('share',false) // 华为直接领取,不用分享
} else {
this.$emit('cancel')
}
......
......@@ -99,6 +99,7 @@
<PopNormal
:visible.sync="visible"
:type="currentPop.type"
:content="currentPop.content"
:confirmText="currentPop.confirmText"
:cancelText="currentPop.cancelText"
@share="handleClickShare"
......@@ -196,7 +197,15 @@ export default {
},
popInfos() {
return [
{
this.isHuaWei ?
{
type: 'huawei',
content: '您还不是会员,每位用户可享受三天免费会员体验',
cancelText: '去体验',
confirmText: '直接购买',
bottomTip: '※ 体验会员,仅非会员用户领取,每个ID限领1次'
}:
{
type: 'share',
confirmText: '开通会员',
cancelText: '分享领体验',
......@@ -265,6 +274,9 @@ export default {
dateString() {
var string = this.date.replace(/-/g, '/');
return this.$u.timeFormat(new Date(string).getTime(), 'yyyy年mm月');
},
isHuaWei() {
return this.platform === "4" && this.systemInfo && this.systemInfo.deviceBrand === "huawei"
}
},
onLoad(options) {
......@@ -545,7 +557,7 @@ export default {
});
}
},
handleClickShare() {
handleClickShare(share = true) {
var block = () => {
if (this.userInfo.vip.code == 'NO') {
this.isVipShare = true;
......@@ -563,6 +575,7 @@ export default {
};
block();
// #ifdef APP-PLUS
if (!share) return
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment