合并代码
This commit is contained in:
parent
f8b2923b57
commit
28843fa3d3
|
@ -7,7 +7,7 @@ const team = {
|
|||
* 我的团队
|
||||
* @param {Object} param
|
||||
*/
|
||||
myTeam(param = {}) {
|
||||
myTeam(param) {
|
||||
return util.request({
|
||||
url: `/user/team/get`,
|
||||
query: param,
|
||||
|
@ -15,11 +15,16 @@ const team = {
|
|||
})
|
||||
},
|
||||
|
||||
lowTeam(param) {
|
||||
/**
|
||||
* 修改我的上级推荐人
|
||||
* @param {Object} param
|
||||
*/
|
||||
updateReferrer(param) {
|
||||
return util.request({
|
||||
url: `/home/lowTeam`,
|
||||
method: 'post',
|
||||
url: `/user/user/updateReferrer`,
|
||||
query: param.query,
|
||||
method: 'PUT',
|
||||
load: true,
|
||||
})
|
||||
},
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ const config = {
|
|||
// #endif
|
||||
// #ifndef H5
|
||||
host: 'http://91f.xyz:8080',
|
||||
// host: 'http://ybfhhn.natappfree.cc',
|
||||
// host: 'http://hnjcg2.natappfree.cc',
|
||||
// host: 'http://22vn9z.natappfree.cc',
|
||||
// host: 'https://63fdb472.r24.cpolar.top',
|
||||
// #endif
|
||||
// 支付方式配置
|
||||
payType: {
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// api
|
||||
import api from '@/api/index.js'
|
||||
import pinyin from 'js-pinyin'
|
||||
import {
|
||||
forEach
|
||||
} from 'lodash';
|
||||
const {
|
||||
proxy
|
||||
} = getCurrentInstance();
|
||||
|
@ -198,14 +201,15 @@
|
|||
function addlistener() {
|
||||
let onFriendListUpdated = (event) => {
|
||||
console.log('onFriendListUpdated', event.data);
|
||||
getFriendList()
|
||||
}
|
||||
|
||||
uni.$chat.on(TencentCloudChat.EVENT.MESSAGE_RECEIVED, onFriendListUpdated);
|
||||
uni.$chat.on(TencentCloudChat.EVENT.FRIEND_LIST_UPDATED, onFriendListUpdated);
|
||||
}
|
||||
|
||||
// 移除加好友监听
|
||||
function removelistener() {
|
||||
uni.$chat.off(TencentCloudChat.EVENT.MESSAGE_RECEIVED);
|
||||
uni.$chat.off(TencentCloudChat.EVENT.FRIEND_LIST_UPDATED);
|
||||
}
|
||||
|
||||
// 获取朋友列表
|
||||
|
@ -220,21 +224,12 @@
|
|||
return
|
||||
}
|
||||
|
||||
//
|
||||
api.news.getFriendList().then(rs => {
|
||||
if (rs.code == 200) {
|
||||
const result = rs.data
|
||||
userList.data.length = 0
|
||||
//
|
||||
userList.data.push(...result.map(item => {
|
||||
// 取拼音
|
||||
let char = pinyin.getCamelChars(item.remark || item.userNickname);
|
||||
return {
|
||||
key: char.charAt(0),
|
||||
letter: char.charAt(0),
|
||||
child: [item]
|
||||
}
|
||||
}))
|
||||
console.log('userList', userList.data)
|
||||
userList.data = handleUserList(result)
|
||||
return
|
||||
}
|
||||
util.alert({
|
||||
|
@ -244,6 +239,47 @@
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户列表排序
|
||||
* @param {Object} userList
|
||||
*/
|
||||
function handleUserList(userList) {
|
||||
// 筛选后的用户列表
|
||||
const userArr = []
|
||||
// 遍历用户列表
|
||||
for (let i = 0; i < userList.length; i++) {
|
||||
const user = userList[i]
|
||||
// 取拼音
|
||||
let char = pinyin.getCamelChars(user.remark || user.userNickname);
|
||||
// 假设姓名的第一个字符为姓氏
|
||||
const letter = char.charAt(0)
|
||||
// 下标
|
||||
let find_index = userArr.findIndex(item => {
|
||||
return item.key === letter
|
||||
})
|
||||
|
||||
// 未找到追加整过数组 找到追加到子数组
|
||||
if (find_index == -1) {
|
||||
userArr.push({
|
||||
letter: letter,
|
||||
key: letter,
|
||||
child: [user]
|
||||
})
|
||||
} else {
|
||||
userArr[find_index].child.push(user)
|
||||
}
|
||||
}
|
||||
|
||||
// 按照姓氏的字典序对二维数组进行排序
|
||||
// userArr.sort((a, b) => {
|
||||
// const surnameA = a.key;
|
||||
// const surnameB = b.key;
|
||||
// return surnameA.localeCompare(surnameB);
|
||||
// });
|
||||
return userArr;
|
||||
}
|
||||
|
||||
|
||||
// 获取
|
||||
function getLetterProperty() {
|
||||
const query = uni.createSelectorQuery().in(proxy);
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"name" : "九亿",
|
||||
"appid" : "__UNI__08B31BC",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.3",
|
||||
"versionCode" : 1003,
|
||||
"versionName" : "1.0.4",
|
||||
"versionCode" : 1004,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
|
|
|
@ -37,6 +37,10 @@
|
|||
const team = ref({})
|
||||
// 展示我的团队
|
||||
const showTeam = ref(false)
|
||||
// 是否显示修改
|
||||
const editTigger = ref(false)
|
||||
// 修改值
|
||||
const edit = ref('')
|
||||
|
||||
onLoad(() => {
|
||||
myQrcode()
|
||||
|
@ -68,6 +72,28 @@
|
|||
qrData.value = `data:image/png;base64, ${uni.arrayBufferToBase64(rs)}`
|
||||
})
|
||||
}
|
||||
|
||||
// 修改上级推荐人
|
||||
function updateReferrer() {
|
||||
api.team.updateReferrer({
|
||||
query: {
|
||||
invitationCode: edit.value,
|
||||
},
|
||||
}).then(rs => {
|
||||
if (rs.code == 200) {
|
||||
//
|
||||
edit.value = ''
|
||||
editTigger.value = false
|
||||
//
|
||||
myTeam()
|
||||
return
|
||||
}
|
||||
util.alert({
|
||||
content: rs.msg,
|
||||
showCancel: false,
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -89,7 +115,21 @@
|
|||
</view>
|
||||
|
||||
<view class="log mtb60 f28" v-if="team.referrerReferrerUser">
|
||||
<view class="title tac f32">我的推荐人</view>
|
||||
<view class="title rows">
|
||||
<view class="f1"></view>
|
||||
<view class="tac f32 mlr20">我的推荐人</view>
|
||||
<view class="f1 df aic">
|
||||
<uni-icons type="compose" @click="editTigger = !editTigger" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="editBox rows mtb10 ptb20 plr20" v-if="editTigger">
|
||||
<view class="f1">
|
||||
<input type="text" v-model="edit" placeholder="请输入需要修改的上级邀请码" />
|
||||
</view>
|
||||
<view class="btn sm colourful plr20" @click="updateReferrer">修改</view>
|
||||
</view>
|
||||
|
||||
<view class="list">
|
||||
<view class="item rows mtb20">
|
||||
<view class="f1">
|
||||
|
@ -171,6 +211,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
// 编辑盒子
|
||||
.editBox {
|
||||
background-color: #eee;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
// 团队
|
||||
.team {
|
||||
background-color: #FFFBF3;
|
||||
|
|
|
@ -61,10 +61,6 @@
|
|||
util.alert('请输入密码')
|
||||
return
|
||||
}
|
||||
if (!data.invitationCode) {
|
||||
util.alert('请输入推荐码')
|
||||
return
|
||||
}
|
||||
if (!read.value) {
|
||||
util.alert('请阅读并勾选服务协议》和《隐私政策》')
|
||||
return
|
||||
|
|
|
@ -51,10 +51,6 @@
|
|||
util.alert('请输入密码')
|
||||
return
|
||||
}
|
||||
if (!data.invitationCode) {
|
||||
util.alert('请输入推荐码')
|
||||
return
|
||||
}
|
||||
if (!read.value) {
|
||||
util.alert('请阅读并勾选服务协议》和《隐私政策》')
|
||||
return
|
||||
|
|
|
@ -48,11 +48,11 @@
|
|||
name: '视讯消息',
|
||||
load: false,
|
||||
},
|
||||
{
|
||||
key: 'video',
|
||||
name: '商城消息',
|
||||
load: false,
|
||||
},
|
||||
// {
|
||||
// key: 'video',
|
||||
// name: '商城消息',
|
||||
// load: false,
|
||||
// },
|
||||
])
|
||||
// 菜单下标
|
||||
const menuIndex = ref('')
|
||||
|
@ -202,7 +202,8 @@
|
|||
|
||||
<!-- 群组 -->
|
||||
<swiper-item>
|
||||
<groupList v-if="menuList[1].load" />
|
||||
<!-- <groupList v-if="menuList[1].load" /> -->
|
||||
<msgList v-if="menuList[1].load" />
|
||||
<view class="loading" v-else>正在加载</view>
|
||||
</swiper-item>
|
||||
|
||||
|
|
|
@ -92,6 +92,11 @@ node拓展
|
|||
md5加密
|
||||
npm install crypto-js --save-dev
|
||||
|
||||
---
|
||||
九亿后台
|
||||
网址:91f.xyz
|
||||
账号:admin
|
||||
密码:91f.xyz9191@9
|
||||
|
||||
|
||||
第三方
|
||||
|
|
|
@ -4,8 +4,8 @@ import {
|
|||
import uni from '@dcloudio/vite-plugin-uni';
|
||||
|
||||
let target = 'http://91f.xyz:8080'
|
||||
// let target = 'http://ybfhhn.natappfree.cc'
|
||||
// let target = 'http://hnjcg2.natappfree.cc'
|
||||
// let target = 'http://22vn9z.natappfree.cc'
|
||||
// let target = 'https://63fdb472.r24.cpolar.top'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [uni()],
|
||||
|
|
Loading…
Reference in New Issue