微信小程序:关注公众号组件自定义样式

3 篇文章 0 订阅
1 篇文章 0 订阅

效果展示:

 

<template>
    <view>
<uni-popup ref="followPopup" background-color="#fff" borderRadius="20rpx" class="follow">
					<view class="followbox">
						<view class="follow_nav">关注微信公众号</view>
						<view class="follow_nav_name">关注<text style="color: #F78012;">***</text>微信公众号</view>
						<view class="follow_more">享受更多精彩内容</view>
						<view class="follow_botton">马上关注<official-account                     
                        class="official-account" id="official_account"></official-account></view>
						<view  class="follow_later" @tap="clonefollow">稍后</view>
					</view>
			</uni-popup>
    </view>
</template>
<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			clonefollow() {
				this.$refs.followPopup.close();
			}
		},
    onShow(){
        // 弹出逻辑自己按照需求来
        this.$refs.followPopup.open("center")
    }
	}
</script>
<style scoped lang="scss">
	.followbox{
		width: 578rpx;
		height: 477rpx;
		border-radius: 20rpx;
	}
	.follow_nav{
		font-size: 32rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #333333;
		text-align: center;
		margin-top: 30rpx;
	}
	.follow_nav_name{
		font-size: 40rpx;
		font-family: PingFangSC-Semibold, PingFang SC;
		font-weight: 600;
		color: #333333;
		text-align: center;
		margin-top: 50rpx;
	}
	.follow_more{
		font-size: 36rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #333333;
		margin-top: 15rpx;
		text-align: center;
	}
	.follow_botton {
		position: relative;
		width: 518rpx;
		height: 80rpx;
		line-height: 80rpx;
		background: linear-gradient(180deg, #F49314 0%, #F78012 100%);
		border-radius: 50px;
		padding: 0;
		overflow: hidden;
		text-align: center;
		font-size: 30rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		margin: 54rpx auto;
	}
	.follow_later{
		font-size: 26rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #999999;
		text-align: center;
	}
	.follow_botton .official-account {
		position: absolute;
		right: -14px;
		top: -40px;
		opacity: 0;
	}
</style>

本地测试需要修改场景在真机调试

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值