This commit is contained in:
parent
8eb011d332
commit
e2c3fff951
jiuyi2
|
@ -1,90 +1,96 @@
|
|||
<script setup>
|
||||
/**
|
||||
* 视频左侧菜单弹窗
|
||||
*/
|
||||
import {
|
||||
onMounted,
|
||||
ref,
|
||||
reactive,
|
||||
getCurrentInstance,
|
||||
watch,
|
||||
defineExpose,
|
||||
} from 'vue';
|
||||
const {
|
||||
proxy
|
||||
} = getCurrentInstance()
|
||||
import videoApi from '@/api/video.js';
|
||||
// 顶部状态栏
|
||||
import statusBar from '@/components/header/statusBar.vue'
|
||||
// 工具库
|
||||
import util from '@/common/js/util.js'
|
||||
/**
|
||||
* 视频左侧菜单弹窗
|
||||
*/
|
||||
import {
|
||||
onMounted,
|
||||
ref,
|
||||
reactive,
|
||||
getCurrentInstance,
|
||||
watch,
|
||||
defineExpose,
|
||||
} from 'vue';
|
||||
const {
|
||||
proxy
|
||||
} = getCurrentInstance()
|
||||
import videoApi from '@/api/video.js';
|
||||
// 顶部状态栏
|
||||
import statusBar from '@/components/header/statusBar.vue'
|
||||
// 工具库
|
||||
import util from '@/common/js/util.js'
|
||||
|
||||
onMounted(() => {
|
||||
// open()
|
||||
onMounted(() => {
|
||||
// open()
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
function open() {
|
||||
proxy.$refs.leftMenu.open()
|
||||
}
|
||||
|
||||
// 关闭弹窗
|
||||
function close() {
|
||||
proxy.$refs.leftMenu.close()
|
||||
}
|
||||
|
||||
function getUserInfos(userRecommend) {
|
||||
videoApi.getUserInfo({
|
||||
query: {
|
||||
userRecommend: userRecommend,
|
||||
}
|
||||
}).then(rs => {
|
||||
console.log(rs)
|
||||
if (rs.data !== null) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/beInvited?header=' + rs.data.userPortrait + '&userId=' + rs.data.userId + '&userNickname=' +
|
||||
rs.data.userNickname
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
function open() {
|
||||
proxy.$refs.leftMenu.open()
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭弹窗
|
||||
function close() {
|
||||
proxy.$refs.leftMenu.close()
|
||||
}
|
||||
function scanQRCode() {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
console.log('扫描结果:' + res.result);
|
||||
|
||||
function getUserInfos(userRecommend) {
|
||||
videoApi.getUserInfo({
|
||||
query: {
|
||||
userRecommend: userRecommend,
|
||||
}
|
||||
}).then(rs => {
|
||||
console.log(rs)
|
||||
if (rs.data !== null) {
|
||||
if (res.result.type == 'ADDFRIEND') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/beInvited?header=' + rs.data.userPortrait + '&userId=' + rs.data.userId + '&userNickname=' +
|
||||
rs.data.userNickname
|
||||
url: `/pages/news/addFriend?account=${res.result.account}`
|
||||
});
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
getUserInfos(res.result)
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('扫描失败:' + err);
|
||||
uni.showToast({
|
||||
title: '扫描失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function scanQRCode() {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
console.log('扫描结果:' + res.result);
|
||||
|
||||
getUserInfos(res.result)
|
||||
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('扫描失败:' + err);
|
||||
uni.showToast({
|
||||
title: '扫描失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 实名跳转
|
||||
function link(url) {
|
||||
// 验证
|
||||
util.isAuth({
|
||||
success: rs => {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
//
|
||||
defineExpose({
|
||||
open,
|
||||
close,
|
||||
// 实名跳转
|
||||
function link(url) {
|
||||
// 验证
|
||||
util.isAuth({
|
||||
success: rs => {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
//
|
||||
defineExpose({
|
||||
open,
|
||||
close,
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -103,17 +109,20 @@
|
|||
<scroll-view scroll-y="true" class="scroll f1" :show-scrollbar="false">
|
||||
<view class="list">
|
||||
|
||||
<navigator url="/pages/index/wallet/wallet" class="item df fdr aic mtb15 ptb40 plr30 bfff br20" hover-class="none">
|
||||
<navigator url="/pages/index/wallet/wallet" class="item df fdr aic mtb15 ptb40 plr30 bfff br20"
|
||||
hover-class="none">
|
||||
<image class="wh80 mr25" src="/static/leftMenu1.png" mode="aspectFit" />
|
||||
<text class="text f1 c333 f28">我的钱包</text>
|
||||
</navigator>
|
||||
|
||||
<navigator url="/pages/index/integralMall" class="item df fdr aic mtb15 ptb40 plr30 bfff br20" hover-class="none">
|
||||
<navigator url="/pages/index/integralMall" class="item df fdr aic mtb15 ptb40 plr30 bfff br20"
|
||||
hover-class="none">
|
||||
<image class="wh80 mr25" src="/static/leftMenu2.png" mode="aspectFit" />
|
||||
<text class="text f1 c333 f28">卷轴积分</text>
|
||||
</navigator>
|
||||
|
||||
<navigator url="/pages/index/durian" class="item df fdr aic mtb15 ptb40 plr30 bfff br20" hover-class="none">
|
||||
<navigator url="/pages/index/durian" class="item df fdr aic mtb15 ptb40 plr30 bfff br20"
|
||||
hover-class="none">
|
||||
<image class="wh80 mr25" src="/static/leftMenu3.png" mode="aspectFit" />
|
||||
<text class="text f1 c333 f28">榴莲果树</text>
|
||||
</navigator>
|
||||
|
@ -123,7 +132,8 @@
|
|||
<text class="text f1 c333 f28">我的团队</text>
|
||||
</view>
|
||||
|
||||
<view @click="link('/pages/index/myQrCode')" class="item df fdr aic mtb15 ptb40 plr30 bfff br20">
|
||||
<view @click="link('/pages/index/myQrCode')"
|
||||
class="item df fdr aic mtb15 ptb40 plr30 bfff br20">
|
||||
<image class="wh80 mr25" src="/static/leftMenu6.png" mode="aspectFit" />
|
||||
<text class="text f1 c333 f28">邀请好友分享APP</text>
|
||||
</view>
|
||||
|
@ -151,9 +161,9 @@
|
|||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 左侧菜单弹窗
|
||||
.leftMenuAlt {
|
||||
width: 600rpx;
|
||||
background-color: #F4F4F4;
|
||||
}
|
||||
// 左侧菜单弹窗
|
||||
.leftMenuAlt {
|
||||
width: 600rpx;
|
||||
background-color: #F4F4F4;
|
||||
}
|
||||
</style>
|
|
@ -13,8 +13,6 @@ import {
|
|||
import {
|
||||
onLoad,
|
||||
} from '@dcloudio/uni-app'
|
||||
// 工具库
|
||||
import util from '@/common/js/util';
|
||||
// vuex
|
||||
const store = useStore()
|
||||
// 用户信息
|
||||
|
@ -39,18 +37,20 @@ function init() {
|
|||
mask: true
|
||||
})
|
||||
|
||||
let url = `${util.config.host}/#/pages/news/addFriend?account=${userinfo.value.account}`
|
||||
console.log(url);
|
||||
|
||||
//
|
||||
const content = {
|
||||
account: userinfo.value.account,
|
||||
type: 'ADDFRIEND'
|
||||
}
|
||||
|
||||
uQRCode.make({
|
||||
canvasId: 'qrcode',
|
||||
text: url,
|
||||
text: JSON.stringify(content),
|
||||
size: qrcodeSize.value,
|
||||
margin: 10,
|
||||
success: res => {
|
||||
qrUrl.value = res
|
||||
// console.log('qrcodeSrc ', qrUrl.value);
|
||||
console.log('qrcodeSrc ', qrUrl.value);
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading()
|
||||
|
|
Loading…
Reference in New Issue