2025-08-16 16:03:42 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<view class="agents-page">
|
|
|
|
|
|
<!-- 头部区域 -->
|
|
|
|
|
|
<custom-nav-bar3 title=""></custom-nav-bar3>
|
|
|
|
|
|
<view class="header">
|
|
|
|
|
|
<image :src="commonEnum.INVITE" class="agent-background" mode="aspectFill"></image>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 主要内容区域 -->
|
|
|
|
|
|
<view class="main-content">
|
2025-08-16 17:09:51 +08:00
|
|
|
|
<view class="qrcode-container">
|
2025-08-20 16:59:06 +08:00
|
|
|
|
<uv-qrcode :options="qrcodeOptions" :value="qrcodeValue" size="500rpx"></uv-qrcode>
|
2025-08-16 17:18:47 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 按钮区域 -->
|
|
|
|
|
|
<view class="button-container">
|
|
|
|
|
|
<button class="action-button" @click="saveAndSharePoster">
|
|
|
|
|
|
<text class="button-text">保存分享海报</text>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
|
|
<button class="action-button" @click="sendToFriends">
|
|
|
|
|
|
<text class="button-text">保存分享海报</text>
|
|
|
|
|
|
<text class="button-sub-text">发给好友扫码</text>
|
|
|
|
|
|
</button>
|
2025-08-16 17:09:51 +08:00
|
|
|
|
</view>
|
2025-08-16 16:03:42 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import commonEnum from '../../enum/commonEnum'
|
2025-08-16 17:09:51 +08:00
|
|
|
|
import UvQrcode from '../../uni_modules/uv-qrcode/components/uv-qrcode/uv-qrcode.vue'
|
2025-08-20 17:11:21 +08:00
|
|
|
|
import { getLocalUserId } from '../../api/user/user.js'
|
2025-08-16 16:03:42 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'AgentsPage',
|
2025-08-16 17:09:51 +08:00
|
|
|
|
components: { UvQrcode },
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2025-08-20 17:11:21 +08:00
|
|
|
|
qrcodeValue: '',
|
2025-08-16 17:18:47 +08:00
|
|
|
|
qrcodeOptions: {
|
2025-08-16 17:09:51 +08:00
|
|
|
|
errorCorrectLevel: 'Q',
|
|
|
|
|
|
margin: 10,
|
|
|
|
|
|
areaColor: '#fff',
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-08-16 16:03:42 +08:00
|
|
|
|
computed: {
|
|
|
|
|
|
commonEnum() {
|
|
|
|
|
|
return commonEnum
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
onLoad() {
|
2025-08-20 17:11:21 +08:00
|
|
|
|
// 页面加载时获取本地存储的用户ID作为二维码内容
|
|
|
|
|
|
this.initQrcodeValue()
|
2025-08-16 16:03:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2025-08-20 17:11:21 +08:00
|
|
|
|
// 初始化二维码内容
|
|
|
|
|
|
initQrcodeValue() {
|
|
|
|
|
|
const userId = getLocalUserId()
|
|
|
|
|
|
if (userId) {
|
|
|
|
|
|
this.qrcodeValue = userId
|
|
|
|
|
|
console.log('使用用户ID作为二维码内容:', userId)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// 如果没有用户ID,使用默认值
|
|
|
|
|
|
this.qrcodeValue = '123456'
|
|
|
|
|
|
console.warn('未找到用户ID,使用默认二维码内容')
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
2025-08-16 17:18:47 +08:00
|
|
|
|
// 保存分享海报
|
|
|
|
|
|
saveAndSharePoster() {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: '保存分享海报功能',
|
|
|
|
|
|
icon: 'none',
|
|
|
|
|
|
})
|
|
|
|
|
|
// TODO: 实现保存分享海报功能
|
|
|
|
|
|
console.log('保存分享海报')
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 发送给好友扫码
|
|
|
|
|
|
sendToFriends() {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: '发送给好友扫码功能',
|
|
|
|
|
|
icon: 'none',
|
|
|
|
|
|
})
|
|
|
|
|
|
// TODO: 实现发送给好友扫码功能
|
|
|
|
|
|
console.log('发送给好友扫码')
|
|
|
|
|
|
},
|
2025-08-16 16:03:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.agents-page {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
background: #fbe4ba;
|
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 头部区域
|
|
|
|
|
|
.header {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
background: #fedfcd;
|
|
|
|
|
|
|
|
|
|
|
|
.agent-background {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
width: 750rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 主要内容区域
|
|
|
|
|
|
.main-content {
|
|
|
|
|
|
position: relative;
|
2025-08-16 17:09:51 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
2025-08-16 16:03:42 +08:00
|
|
|
|
top: -25rpx;
|
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
|
border-radius: 40rpx;
|
|
|
|
|
|
margin: 0 30rpx;
|
|
|
|
|
|
padding: 40rpx;
|
|
|
|
|
|
height: 1050rpx;
|
|
|
|
|
|
|
2025-08-16 17:09:51 +08:00
|
|
|
|
.qrcode-container {
|
|
|
|
|
|
padding: 40rpx;
|
|
|
|
|
|
background: white;
|
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
|
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
|
2025-08-20 16:59:06 +08:00
|
|
|
|
margin-bottom: 200rpx;
|
2025-08-16 17:09:51 +08:00
|
|
|
|
}
|
2025-08-16 17:18:47 +08:00
|
|
|
|
|
|
|
|
|
|
.button-container {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 30rpx;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.action-button {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
max-width: 280rpx;
|
|
|
|
|
|
height: 100rpx;
|
|
|
|
|
|
background: white;
|
|
|
|
|
|
border: 2rpx solid #ff6b35;
|
|
|
|
|
|
border-radius: 50rpx;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
|
box-shadow: 0 4rpx 12rpx rgba(255, 107, 53, 0.2);
|
|
|
|
|
|
|
|
|
|
|
|
.button-text {
|
|
|
|
|
|
color: #ff6b35;
|
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
line-height: 1.2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.button-sub-text {
|
|
|
|
|
|
color: #ff6b35;
|
|
|
|
|
|
font-size: 20rpx;
|
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
|
margin-top: 4rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-08-16 16:03:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|