Commit 1bb1f71c authored by Facius's avatar Facius

feat: 适配华为

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