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