合并代码
This commit is contained in:
parent
77ceacf2a5
commit
151d93a6d1
|
@ -1,60 +1,54 @@
|
||||||
<script>
|
<script setup>
|
||||||
|
import {
|
||||||
|
onLaunch,
|
||||||
|
} from '@dcloudio/uni-app'
|
||||||
// 工具库
|
// 工具库
|
||||||
import util from '@/common/js/util';
|
import util from '@/common/js/util';
|
||||||
//
|
//
|
||||||
import api from '@/api/index.js'
|
import api from '@/api/index.js'
|
||||||
// vuex
|
// vuex
|
||||||
import store from '@/store/index.js'
|
import store from '@/store/index.js'
|
||||||
// import Mixins from '@/utils/Mixins.js'
|
|
||||||
|
|
||||||
export default {
|
onLaunch(() => {
|
||||||
// mixins: [Mixins],
|
// 获取用户信息
|
||||||
onLaunch() {
|
getUserinfo()
|
||||||
// 获取用户信息
|
// 获取系统配置
|
||||||
this.getUserinfo()
|
getConfig()
|
||||||
// 获取系统配置
|
})
|
||||||
this.getConfig()
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
// 获取用户信息
|
||||||
// 获取用户信息
|
function getUserinfo() {
|
||||||
getUserinfo() {
|
// 登录令牌
|
||||||
// 登录令牌
|
const token = uni.getStorageSync('token')
|
||||||
const token = uni.getStorageSync('token')
|
// 用户信息
|
||||||
// 用户信息
|
const userinfo = uni.getStorageSync('userinfo')
|
||||||
const userinfo = uni.getStorageSync('userinfo')
|
|
||||||
|
|
||||||
// 如果登录保活
|
// 如果登录保活
|
||||||
if (token) {
|
if (token) {
|
||||||
// 用户信息
|
// 用户信息
|
||||||
if (userinfo) store.commit('setState', {
|
if (userinfo) store.commit('setState', {
|
||||||
key: 'userinfo',
|
key: 'userinfo',
|
||||||
value: userinfo
|
value: userinfo
|
||||||
})
|
})
|
||||||
|
|
||||||
util.getUserinfo(() => {
|
// 腾讯im登录
|
||||||
// 腾讯im登录
|
util.loginTencent(userinfo)
|
||||||
util.loginTencent(userinfo)
|
util.getUserinfo()
|
||||||
// 储存登录账号
|
|
||||||
util.loginAccountManagement(userinfo)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 获取系统配置
|
|
||||||
getConfig() {
|
|
||||||
api.getConfig().then(rs => {
|
|
||||||
if(rs.code == 200) {
|
|
||||||
store.commit('setState', {
|
|
||||||
key: 'config',
|
|
||||||
value: rs.data
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取系统配置
|
||||||
|
function getConfig() {
|
||||||
|
api.getConfig().then(rs => {
|
||||||
|
if (rs.code == 200) {
|
||||||
|
store.commit('setState', {
|
||||||
|
key: 'config',
|
||||||
|
value: rs.data
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
@ -21,9 +21,9 @@ const config = {
|
||||||
// 腾讯im聊天
|
// 腾讯im聊天
|
||||||
TChat: {
|
TChat: {
|
||||||
// appid
|
// appid
|
||||||
SDKAppID: '1600057470',
|
SDKAppID: '1600067241',
|
||||||
// 验签
|
// 验签
|
||||||
secretKey: '7d016821bf27a846739e209534abe4c4bba131559b3318e19f8ccf9294e08b29',
|
secretKey: '955ac1c071050fe1ed0be74470409495cfb4faa5faf7c88ea58b585890433708',
|
||||||
//
|
//
|
||||||
userSig: '',
|
userSig: '',
|
||||||
},
|
},
|
||||||
|
|
|
@ -1431,11 +1431,6 @@ const util = {
|
||||||
util.getUserinfo((userinfo) => {
|
util.getUserinfo((userinfo) => {
|
||||||
// 登录
|
// 登录
|
||||||
uni.$emit('login')
|
uni.$emit('login')
|
||||||
// 腾讯im登录
|
|
||||||
util.loginTencent(userinfo)
|
|
||||||
// 储存登录账号
|
|
||||||
// util.loginAccountManagement(userinfo)
|
|
||||||
// return
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
|
@ -1447,20 +1442,6 @@ const util = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 登录账号管理
|
|
||||||
loginAccountManagement(userInfo) {
|
|
||||||
// 取出本地保存的账号信息
|
|
||||||
let userList = uni.getStorageSync('userInfoList') || []
|
|
||||||
// 判断账号是否已存在 存在则删除后重新添加 否则添加
|
|
||||||
const index = userList.findIndex(item => item.userId === userInfo.userId)
|
|
||||||
if (index !== -1) {
|
|
||||||
userList.splice(index, 1)
|
|
||||||
}
|
|
||||||
userList.push(userInfo)
|
|
||||||
// 缓存
|
|
||||||
uni.setStorageSync('userInfoList', userList)
|
|
||||||
},
|
|
||||||
|
|
||||||
// 登录腾讯聊天
|
// 登录腾讯聊天
|
||||||
loginTencent(userinfo) {
|
loginTencent(userinfo) {
|
||||||
api.login.getIMToken({}).then(rs => {
|
api.login.getIMToken({}).then(rs => {
|
||||||
|
@ -1487,7 +1468,6 @@ const util = {
|
||||||
console.log('im login success', rs)
|
console.log('im login success', rs)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
return
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1499,13 +1479,7 @@ const util = {
|
||||||
// 请求接口
|
// 请求接口
|
||||||
api.mine.getUserinfo().then(rs => {
|
api.mine.getUserinfo().then(rs => {
|
||||||
if (rs.code === 200) {
|
if (rs.code === 200) {
|
||||||
// 用户信息
|
reslove(rs.data)
|
||||||
const userinfo = rs.data
|
|
||||||
// 处理头像
|
|
||||||
// userinfo.userPortrait = util.format_url(userinfo.userPortrait, 'img')
|
|
||||||
// 处理背景图
|
|
||||||
// userinfo.background = util.format_url(userinfo.background, 'img')
|
|
||||||
reslove(userinfo)
|
|
||||||
// 提交
|
// 提交
|
||||||
store.commit('setState', {
|
store.commit('setState', {
|
||||||
key: 'userinfo',
|
key: 'userinfo',
|
||||||
|
|
|
@ -705,6 +705,12 @@
|
||||||
"navigationBarBackgroundColor": "#fff"
|
"navigationBarBackgroundColor": "#fff"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/news/myQr",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的二维码"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path" : "pages/mine/setting/secondPwd",
|
"path" : "pages/mine/setting/secondPwd",
|
||||||
"style" :
|
"style" :
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
<script setup>
|
||||||
|
// 我的二维码
|
||||||
|
import uQRCode from '@/common/js/uqrcode.js'
|
||||||
|
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
reactive,
|
||||||
|
computed,
|
||||||
|
} from 'vue'
|
||||||
|
import {
|
||||||
|
useStore,
|
||||||
|
} from 'vuex'
|
||||||
|
import {
|
||||||
|
onLoad,
|
||||||
|
} from '@dcloudio/uni-app'
|
||||||
|
// vuex
|
||||||
|
const store = useStore()
|
||||||
|
// 用户信息
|
||||||
|
const userinfo = computed(() => {
|
||||||
|
let result = store.state.userinfo
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
|
// 二维码大小
|
||||||
|
const qrcodeSize = ref(300)
|
||||||
|
// 二维码路径
|
||||||
|
const qrUrl = ref('')
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
init()
|
||||||
|
})
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
function init() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '二维码生成中',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
|
||||||
|
//
|
||||||
|
const content = {
|
||||||
|
key: 'user',
|
||||||
|
userId: userinfo.value.userId,
|
||||||
|
userNickname: userinfo.value.userNickname,
|
||||||
|
}
|
||||||
|
|
||||||
|
uQRCode.make({
|
||||||
|
canvasId: 'qrcode',
|
||||||
|
text: JSON.stringify(content),
|
||||||
|
size: qrcodeSize.value,
|
||||||
|
margin: 10,
|
||||||
|
success: res => {
|
||||||
|
qrUrl.value = res
|
||||||
|
console.log('qrcodeSrc ', qrUrl.value);
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<view class="app">
|
||||||
|
<!-- -->
|
||||||
|
<view class="container ver mtb30 mlr30 tac">
|
||||||
|
<!-- 二维码插件 width height设置宽高 -->
|
||||||
|
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}" />
|
||||||
|
|
||||||
|
<view class="user mtb30 df aic">
|
||||||
|
<view class="avatar">
|
||||||
|
<image class="wh80 cir" :src="userinfo.userPortrait" mode="aspectFill" />
|
||||||
|
</view>
|
||||||
|
<view class="nickname f1 ml20 c333 f32">{{userinfo.userNickname}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="hint mtb30 tac c999">扫一扫,添加我为好友</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
//
|
||||||
|
</style>
|
|
@ -3,6 +3,8 @@
|
||||||
* 新的朋友
|
* 新的朋友
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// 腾讯云聊天
|
||||||
|
import TencentCloudChat from '@tencentcloud/chat';
|
||||||
// 工具库
|
// 工具库
|
||||||
import util from '@/common/js/util';
|
import util from '@/common/js/util';
|
||||||
// api
|
// api
|
||||||
|
@ -14,11 +16,12 @@
|
||||||
ref,
|
ref,
|
||||||
reactive,
|
reactive,
|
||||||
computed,
|
computed,
|
||||||
|
getCurrentInstance,
|
||||||
|
nextTick
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import {
|
import {
|
||||||
onLoad,
|
onLoad,
|
||||||
onReachBottom,
|
onUnload,
|
||||||
onPullDownRefresh
|
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
// vuex
|
// vuex
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
@ -34,73 +37,82 @@
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
})
|
})
|
||||||
const keyword = ref('')
|
// 需要操作的好友对象
|
||||||
|
const friend = ref({})
|
||||||
|
//
|
||||||
|
const {
|
||||||
|
proxy
|
||||||
|
} = getCurrentInstance()
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getFriendList()
|
getFriendList()
|
||||||
|
addListener()
|
||||||
})
|
})
|
||||||
|
|
||||||
onPullDownRefresh(() => {
|
onUnload(() => {
|
||||||
getFriendList()
|
offListener()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 开启监听
|
||||||
|
function addListener() {
|
||||||
|
let fn = function(event) {
|
||||||
|
getFriendList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开启监听
|
||||||
|
uni.$chat.on(TencentCloudChat.EVENT.FRIEND_APPLICATION_LIST_UPDATED, fn)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 移除监听
|
||||||
|
function offListener() {
|
||||||
|
uni.$chat.off(TencentCloudChat.EVENT.FRIEND_APPLICATION_LIST_UPDATED, () => {})
|
||||||
|
}
|
||||||
|
|
||||||
// 同意好友申请
|
// 同意好友申请
|
||||||
function agreeFriend(item) {
|
function agreeFriend(item) {
|
||||||
api.video.agreeFriend({
|
friend.value = {
|
||||||
path: [userinfo.value.userId, item.userId],
|
...item
|
||||||
query: {
|
}
|
||||||
|
// 打开弹窗
|
||||||
|
proxy.$refs.friend.open()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
// 确定添加好友
|
||||||
|
function addFriendConfirm() {
|
||||||
|
// 同意好友申请
|
||||||
|
uni.$chat.acceptFriendApplication({
|
||||||
|
userID: friend.value.userID,
|
||||||
|
remark: friend.value.remark || '',
|
||||||
|
type: TencentCloudChat.TYPES.SNS_APPLICATION_AGREE_AND_ADD
|
||||||
}).then(rs => {
|
}).then(rs => {
|
||||||
if (rs.code === 200) {
|
// 打开弹窗
|
||||||
uni.showToast({
|
proxy.$refs.friend.close()
|
||||||
title: '同意成功',
|
|
||||||
icon: 'success',
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: rs.msg,
|
|
||||||
icon: 'error',
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).finally(() => {
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 拒绝好友申请
|
// 拒绝好友申请
|
||||||
function refuseFriend(item) {
|
function refuseFriend(item) {
|
||||||
api.video.refuseFriend({
|
util.alert({
|
||||||
path: [userinfo.value.userId, item.userId],
|
content: '确认拒绝好友?',
|
||||||
}).then(rs => {
|
}).then(rs => {
|
||||||
if (rs.code === 200) {
|
if (!rs.confirm) return
|
||||||
uni.showToast({
|
// 拒绝好友申请
|
||||||
title: '拒绝成功',
|
uni.$chat.refuseFriendApplication({
|
||||||
icon: 'success',
|
userID: item.userID,
|
||||||
duration: 1500
|
})
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: rs.msg,
|
|
||||||
icon: 'error',
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取朋友列表
|
// 获取添加朋友列表
|
||||||
function getFriendList() {
|
function getFriendList() {
|
||||||
uni.$chat.getFriendApplicationList().then(rs => {
|
uni.$chat.getFriendApplicationList().then(rs => {
|
||||||
if (rs.code === 0) {
|
if (rs.code === 0) {
|
||||||
console.log('rs', rs)
|
|
||||||
const result = rs.data
|
const result = rs.data
|
||||||
userList.data = result.friendApplicationList
|
userList.data = result.friendApplicationList.map(node => {
|
||||||
|
node.formatTime = util.formatTime('yyyy-MM-dd hh:mm', node.time)
|
||||||
|
return node
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
|
||||||
uni.stopPullDownRefresh()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,10 +123,22 @@
|
||||||
function handleUser(item) {
|
function handleUser(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: util.setUrl('/pages/index/videoHome', {
|
url: util.setUrl('/pages/index/videoHome', {
|
||||||
userId: item.userId,
|
userId: item.userID,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 填入对方昵称
|
||||||
|
function pushNickname() {
|
||||||
|
friend.value.remark = friend.value.nick
|
||||||
|
}
|
||||||
|
|
||||||
|
// 我的二维码
|
||||||
|
function myQr() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/news/myQr'
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -129,33 +153,66 @@
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="ptb20 plr25 c666 f28">最近添加</view>
|
<view class="rows ptb20 plr25 c666 f28">
|
||||||
|
<view class="">申请列表</view>
|
||||||
|
<view class="c999" @click="myQr">我的二维码</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="listArea plr30 bfff">
|
<view class="listArea plr30 bfff">
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<view class="item rows ptb30 c333 f32" v-for="(item,index) in userList.data" :key="index" @click="handleUser(item)">
|
<view class="item ptb30 c333 f32" v-for="(item,index) in userList.data" :key="index" @click="handleUser(item)">
|
||||||
<view class="avatar fs0">
|
<view class="rows">
|
||||||
<image class="wh100 cir" :src="item.avatar" mode="aspectFill" />
|
<view class="avatar fs0">
|
||||||
|
<image class="wh100 cir" :src="item.avatar" mode="aspectFill" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="content f1 mlr20">
|
||||||
|
<view class="name">{{item.nick}}</view>
|
||||||
|
<view class="time mt10 c999 f22">{{item.formatTime}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 发给我的好友申请 -->
|
||||||
|
<view class="btns rows fs0" v-if="item.type == TencentCloudChat.TYPES.SNS_APPLICATION_SENT_TO_ME">
|
||||||
|
<view class="btn black plr20" @click.stop="agreeFriend(item)">同意</view>
|
||||||
|
<view class="btn cancel plr20 ml20" @click.stop="refuseFriend(item)">拒绝</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 我发起的好友申请 -->
|
||||||
|
<view class="btns rows fs0" v-else-if="item.type == TencentCloudChat.TYPES.SNS_APPLICATION_SENT_BY_ME">
|
||||||
|
<view class="c999">等待对方同意</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="content f1 mlr20">
|
<view class="mt20 c999 f28">招呼语:{{item.wording}}</view>
|
||||||
<view class="name">{{item.name}}</view>
|
|
||||||
<view class="time c999 f22">{{item.createTime}}</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="btns rows fs0" v-if="item.friendState == 1">
|
|
||||||
<view class="btn black plr20" @click.stop="agreeFriend(item)">同意</view>
|
|
||||||
<view class="btn cancel plr20 ml20" @click.stop="refuseFriend(item)">拒绝</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="result fs0 c999" v-else-if="item.friendState == 2">已拒绝</view>
|
|
||||||
<view class="result fs0 c999" v-else-if="item.friendState == 3">已同意</view>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="mtb20 nomore" v-if="!userList.data[0]">暂无申请~</view>
|
||||||
|
|
||||||
<!-- 填充 -->
|
<!-- 填充 -->
|
||||||
<view class="fill" style="height: 60rpx;"></view>
|
<view class="fill" style="height: 60rpx;"></view>
|
||||||
|
|
||||||
|
<!-- 设置备注 -->
|
||||||
|
<uni-popup ref="friend" type="center">
|
||||||
|
<view class="friendAlt popMid plr20 bfff">
|
||||||
|
<view class="header rows ptb30 f32">
|
||||||
|
<view class="">给用户 {{friend.nick}} 设置备注</view>
|
||||||
|
<uni-icons type="closeempty" @click="$refs.friend.close()" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="main mlr30">
|
||||||
|
<view class="txtplus ptb20 plr20 br10">
|
||||||
|
<input type="text" v-model="friend.remark" placeholder="好友备注" />
|
||||||
|
</view>
|
||||||
|
<view class=" mt10 c666 f28" @click="pushNickname">
|
||||||
|
<text class="push">填入</text>
|
||||||
|
<text>对方昵称</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="btn lg bar black mtb30" @click="addFriendConfirm">确定</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -170,4 +227,18 @@
|
||||||
border-top: 1rpx solid #ddd;
|
border-top: 1rpx solid #ddd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 朋友弹窗
|
||||||
|
.friendAlt {
|
||||||
|
|
||||||
|
//
|
||||||
|
.txtplus {
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
.push {
|
||||||
|
color: #20D200;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -84,39 +84,28 @@
|
||||||
|
|
||||||
// 打开菜单
|
// 打开菜单
|
||||||
function showActionSheet() {
|
function showActionSheet() {
|
||||||
/* {
|
|
||||||
// 拒绝私信 拒绝添加好友
|
|
||||||
label: '公开设置',
|
|
||||||
} */
|
|
||||||
uni.showActionSheet({
|
uni.showActionSheet({
|
||||||
itemList: ['扫一扫', '添加好友', '发起群聊', '我的二维码', '设置'],
|
itemList: ['扫一扫', '添加好友', '发起群聊', '我的二维码'],
|
||||||
success: rs => {
|
success: rs => {
|
||||||
switch (rs.tapIndex) {
|
switch (rs.tapIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
uni.scanCode({
|
util.scan()
|
||||||
success: (res) => {
|
|
||||||
console.log('扫描结果:' + res.result);
|
|
||||||
getUserInfos(res.result)
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
console.error('扫描失败:' + err);
|
|
||||||
uni.showToast({
|
|
||||||
title: '扫描失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/news/addFriend'
|
// url: '/pages/news/addFriend'
|
||||||
// url: '/pages/news/newFriend'
|
url: '/pages/news/newFriend'
|
||||||
})
|
});
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/news/group-chat/index'
|
url: '/pages/news/group-chat/index'
|
||||||
})
|
});
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/news/myQr'
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import {
|
import {
|
||||||
defineConfig
|
defineConfig
|
||||||
} from 'vite';
|
} from 'vite';
|
||||||
|
@ -15,8 +14,8 @@ export default defineConfig({
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
"/user": {
|
"/user": {
|
||||||
// target: "http://192.168.1.241:8080",
|
target: "http://192.168.1.241:8080",
|
||||||
target: "http://7fee92ac.r22.cpolar.top",
|
// target: "http://7fee92ac.r22.cpolar.top",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
"/coreplay": {
|
"/coreplay": {
|
||||||
|
@ -28,8 +27,8 @@ export default defineConfig({
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
"/video": {
|
"/video": {
|
||||||
// target: "http://192.168.1.241:8080",
|
target: "http://192.168.1.241:8080",
|
||||||
target: "http://7fee92ac.r22.cpolar.top",
|
// target: "http://7fee92ac.r22.cpolar.top",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue