裂变星小程序-25.03.04
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

145 lines
3.3 KiB

<template>
<view class="page">
<navbar leftClick @leftClick="$utils.navigateBack" />
<view class="content">
<image class="avatar" :src="detail.avatarUrl"></image>
<text class="nick-name">{{ detail.nickName }}</text>
<template v-if="isLocked">
<button class="btn" type="success" @click="openPopup">添加</button>
</template>
<template v-else>
<image class="qr" :src="detail.qrCode" :show-menu-by-longpress="true"></image>
</template>
</view>
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-user.png"></popupUnlock>
</view>
</template>
<script>
import popupUnlock from '../components/popupUnlock.vue'
export default {
components: {
popupUnlock,
},
data() {
return {
detail: {
id: null,
avatarUrl: null,
nickName: null,
imageUrl: null,
times: 10,
qrCode: null,
description: null,
},
isLocked: true,
}
},
onLoad(option) {
console.log('--option', option)
const { id } = option
this.fetchSharingDetail(id)
},
onShareAppMessage(res) {
const {
description,
imageUrl,
} = this.detail
// todo: check
let o = {
title : description,
imageUrl: imageUrl,
// path: `/pages_order/sharing/personal?id=${this.detail.id}`
query: `id=${this.detail.id}`,
}
// todo: check callback? settimeout?
// todo: get times and check is unlocked
this.isLocked = false
return o
},
methods: {
async fetchSharingDetail(id) {
// todo: init data by id
this.detail = {
id: '001',
avatarUrl: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
nickName: '裂变星官方指导客服',
imageUrl: 'http://gips3.baidu.com/it/u=70459541,3412285454&fm=3028&app=3028&f=JPEG&fmt=auto?w=960&h=1280',
times: 10,
qrCode: '../static/temp-qrcode.png',
// title: '裂变星轻松获客',
description: '如此好用的赚钱项目,赶快加入吧!',
auditStatus: 2,
createTime: '2025年2月1日',
state: -1,
}
},
openPopup() {
this.$refs.popupUnlock.open();
},
},
}
</script>
<style scoped lang="scss">
.page {
position: relative;
height: 100vh;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
}
.avatar {
width: 180rpx;
height: 180rpx;
margin-top: 127rpx;
}
.nick-name {
color: #1B1B1B;
font-size: 32rpx;
margin-top: 30rpx;
}
.btn, .qr {
position: absolute;
}
.btn {
width: calc(100% - 60rpx*2);
height: auto;
left: 60rpx;
bottom: 292rpx;
background-color: #07C160;
border: none;
color: #FFFFFF;
font-size: 28rpx;
line-height: 1;
border-radius: 45rpx;
padding: 25rpx 0;
box-sizing: border-box;
}
.qr {
width: 350rpx;
height: 350rpx;
bottom: 269rpx;
}
</style>