| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 | <template>	<app-layout>		<view class="container">			<view class="header">				<view class="bg"></view>				<view class="info main-left cross-center">					<view class="head-img">						<u-image								width="150"								height="150"								:src="vuex_user_data.head_img"								shape="circle"></u-image>					</view>					<view class="share-box dir-top-wrap">						<view class="nickname">{{vuex_user_data.nickname}}</view>						<view class="recommend" v-if="userData.parent">推荐人:{{userData.parent.nickname}}</view>					</view>				</view>			</view>			<view class="item-group dir-left-wrap">				<view class="item-box dir-top-wrap cross-center main-center"					  v-for="(item,index) in shareTool"					  @click="handleItemClick(index)"				>					<u-button type="primary" open-type="share" v-if="item.share"							  :custom-style="{backgroundColor: 'transparent',borderColor: 'unset'}"							  hover-class="none"					>						<u-image								width="90"								height="90"								mode="aspectFit"								:src="item.icon"></u-image>					</u-button>					<view class="icon" v-else>						<u-image								width="90"								height="90"								mode="aspectFit"								:src="item.icon"></u-image>					</view>					<view class="title">{{item.title}}</view>				</view>			</view>		</view>		<view class="qrcode-modal" :class="{show:qrCodeModal.show}">			<view class="content">				<view class="qrcode-modal-content dir-top-wrap cross-center">					<view class="head-img">						<u-image								width="150"								height="150"								:src="userData.head_img"								shape="circle"></u-image>					</view>					<view class="nickname">{{userData.nickname}}</view>					<u-line class="u-line" border-style="dashed" length="90%"></u-line>					<view class="qrcode">						<u-image								width="320"								height="320"								:src="userData.share_qrcode"						></u-image>					</view>				</view>				<u-button shape="circle"						  @click="handleSave"						  hover-class="none"						  :custom-style="{					background:'linear-gradient(90deg, rgba(4,153,140,1) 0%, rgba(4,153,128,1) 100%, rgba(14,175,160,.5) 100%)',					boxShadow: '0 0 20rpx rgba(13,239,250,.3)',					borderColor:'none',					color: '#ffffff',					marginTop: '50rpx'}">确定</u-button>			</view>		</view>	</app-layout></template><script>	import appLayout from "@/components/app-layout"	export default {		components:{			appLayout,		},		data() {			return {				shareTool: [					{icon:'/static/images/price.png',title:'佣金',url:'/pages/price/index'},					{icon:'/static/images/withdraw.png',title:'佣金提现明细',url:'/pages/withdraw/index'},					{icon:'/static/images/list.png',title:'推广列表',url:'/pages/share/list'},					{icon:'/static/images/income.png',title:'收益列表',url:'/pages/income/index'},					{icon:'/static/images/share.png',title:'推广分享',method: this.handleShare,share: true},					{icon:'/static/images/qrcode.png',title:'推广二维码',url:'',method: this.handleQrCode},				],				qrCodeModal:{					show: false				},				userData: {}			}		},		methods: {			handleItemClick(index){				let item = this.shareTool[index];				if(typeof item.method === "function"){					item.method();				}else{					this.$jump({url:item.url,type:'to'});				}			},			handleQrCode(){				this.qrCodeModal.show = true			},			handleShare(){				this.$util.share(this.vuex_user_data);				// this.$u.toast('推广分享')			},			getUser(){				this.$u.api.userGet().then(data => {					this.userData = data;				})			},			handleSave(){				this.$util.saveImage(this.userData.share_qrcode).then(res => {					this.qrCodeModal.show = false				})			}		},		onLoad(){			this.getUser();		},		onShareAppMessage() {			return this.$util.shareMessage(this.vuex_user_data);		},	}</script><style lang="scss" scoped>	.container{		padding: 0;		.header{			position: relative;			padding: 0 30rpx;			.bg{				position: absolute;				background: url("@/static/images/share-bg.png") no-repeat top;				background-size: 100% 120%;				background-position: 0 -10rpx;				height: 240rpx;				left: 0;				top: 0;				width: 750rpx;				z-index: 0;			}			.info{				height: 240rpx;				position: relative;				color: #ffffff;				z-index: 1;			}			.share-box{				padding: 0 30rpx;				.nickname{					font-size: 36rpx;					padding: 6rpx 0;				}			}		}		.item-group{			margin: 30rpx 0;			.item-box{				width: 330rpx;				background: #ffffff;				border-radius: 16rpx;				margin-bottom: 30rpx;				margin-left: 30rpx;				height: 260rpx;				.title{					color: #455150;					font-size: 28rpx;					font-weight: bold;					padding: 16rpx 0;				}			}		}	}	.qrcode-modal{		position: fixed;		top: 0;		left: 0;		width: 750rpx;		height: 100vh;		background: rgba(0,0,0,.35);		z-index: 999;		display: none;		animation: show-modal linear .5s;		&.show{			display: block;		}		.content{			position: absolute;			width: 600rpx;			top: 50%;			left: 50%;			transform: translate(-50%,-50%);			.qrcode-modal-content{				position: relative;				width: 100%;				height: 50vh;				background: url("@/static/images/share-qrcode-bg.png") no-repeat center;				background-size: 100% 100%;				.head-img{					position: absolute;					top: -75rpx;				}				.nickname{					position: absolute;					color: #ffffff;					top: 15%;					font-size: 34rpx;				}				.u-line{					position: absolute;					top: 28.55%;				}				.qrcode{					position: absolute;					top: 35%;				}			}		}	}	@keyframes show-modal {		0%{opacity: 0;}		100%{opacity: 1;}	}</style>
 |