diff --git a/src/App.vue b/src/App.vue
index e12c05c4..1126b19a 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -328,7 +328,7 @@
const groupId = msg.groupId;
uni.navigateTo({
url: `/pages/chat/chat-group-video?groupId=${groupId}&isHost=false
- &inviterId=${inviterId}&userInfos=${userInfos}`,
+ &inviterId=${inviterId}&userInfos=${userInfos}`,
});
delayTime = 500;
}
@@ -388,7 +388,7 @@
return group;
},
exit() {
- console.log('exit');
+ console.log('1exit');
this.isExit = true;
wsApi.close(3099);
uni.removeStorageSync('loginInfo');
@@ -494,28 +494,25 @@
ShoproInit();
// app启动时更新用户位置
uni.getLocation({
+ geocode: true,
success: (res) => {
const params = {
- issueLat: String(res.latitude),
- issueLong: String(res.longitude),
+ lat: String(res.latitude),
+ lon: String(res.longitude),
+ province: res.address?.province ?? '',
+ city: res.address?.city ?? '',
+ district: res.address?.district ?? '',
+ address: res.address?.street ?? '',
};
RecentApi.updateUserLocation(params);
},
fail: (err) => {
- uni.showToast({ title: '位置信息获取失败', icon: 'none' });
+ uni.showToast({ title: '位置信息获取失败,请打开系统定位', icon: 'none' });
},
});
this.$mountStore();
this.closeSplashscreen(1000); // 延迟1s,避免用户看到页面跳转
- uni.setStorageSync('loginInfo', {
- accessToken:
- 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNzY0MTQ1MDQyLCJpbmZvIjoie1wibmlja05hbWVcIjpcInd3d1wiLFwidGVybWluYWxcIjoxLFwidXNlcklkXCI6MixcInVzZXJOYW1lXCI6XCJ3d3dcIn0ifQ.yO8o-DM4mied_C5PFzqentfiETV38jmVjFzLVljouz4',
- accessTokenExpiresIn: 1800,
- refreshToken:
- 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyIiwiZXhwIjoxNzY0NzQ4MDQyLCJpbmZvIjoie1wibmlja05hbWVcIjpcInd3d1wiLFwidGVybWluYWxcIjoxLFwidXNlcklkXCI6MixcInVzZXJOYW1lXCI6XCJ3d3dcIn0ifQ.O2Ge2P-n3JSjEqr7P5sH5jaSWZosopHycsuS-vk-WEU',
- refreshTokenExpiresIn: 604800,
- });
// 登录状态校验
let loginInfo = uni.getStorageSync('loginInfo');
this.refreshToken(loginInfo)
diff --git a/src/common/request.js b/src/common/request.js
index 38c41d86..390d96b2 100644
--- a/src/common/request.js
+++ b/src/common/request.js
@@ -22,6 +22,7 @@ const request = (options) => {
if (res.data.code == 200) {
return resolve(res.data.data);
} else if (res.data.code == 400) {
+ console.log('code 400');
getApp().$vm.exit();
} else if (res.data.code == 401) {
console.log('token失效,尝试重新获取');
diff --git a/src/components/file-upload/file-upload.vue b/src/components/file-upload/file-upload.vue
index c10852c8..3a5b4205 100644
--- a/src/components/file-upload/file-upload.vue
+++ b/src/components/file-upload/file-upload.vue
@@ -126,5 +126,3 @@
},
};
-
-
diff --git a/src/components/friend-item/friend-item.vue b/src/components/friend-item/friend-item.vue
index 47abad9a..d9583684 100644
--- a/src/components/friend-item/friend-item.vue
+++ b/src/components/friend-item/friend-item.vue
@@ -12,13 +12,13 @@
@@ -88,8 +88,8 @@
.online {
padding-right: 4rpx;
- width: 24rpx;
- height: 24rpx;
+ width: 48rpx;
+ height: 48rpx;
}
}
}
diff --git a/src/components/long-press-menu/long-press-menu.vue b/src/components/long-press-menu/long-press-menu.vue
index a86eca84..075c1885 100644
--- a/src/components/long-press-menu/long-press-menu.vue
+++ b/src/components/long-press-menu/long-press-menu.vue
@@ -119,7 +119,7 @@
position: fixed;
border-radius: 4px;
overflow: hidden;
- background-color: $im-bg-active;
+ background-color: $im-bg-active-lighter;
z-index: 1000;
box-shadow: $im-box-shadow-dark;
diff --git a/src/im-var.scss b/src/im-var.scss
index 7363fb59..6d337aaf 100644
--- a/src/im-var.scss
+++ b/src/im-var.scss
@@ -46,8 +46,8 @@ $im-box-shadow-light: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
$im-box-shadow-lighter: 0px 0px 6px rgba(0, 0, 0, 0.12);
$im-box-shadow-dark: 0px 1px 10px 2px
rgba(
- $color: #444,
- $alpha: 0.01,
+ $color: #666,
+ $alpha: 0.05,
);
// 背景
@@ -55,6 +55,7 @@ $im-bg: #222;
$im-bg-linear: linear-gradient(135deg, #222 0%, #333 100%);
$im-bg-active: #333;
$im-bg-active-light: #444;
+$im-bg-active-lighter: #555;
$im-bg-input: #333;
// 标题
diff --git a/src/pages/home/city.vue b/src/pages/home/city.vue
index 873fa2ec..dcb5be24 100644
--- a/src/pages/home/city.vue
+++ b/src/pages/home/city.vue
@@ -1,5 +1,5 @@
-
+
@@ -7,7 +7,7 @@
热门城市
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -48,6 +50,7 @@
import useCityIndex, { type cityItem } from '@/sheep/hooks/use-city-index';
// @ts-ignore
import sheep from '@/sheep';
+ import RecentApi from '@/sheep/api/member/recent';
const instance: any = getCurrentInstance()?.proxy;
const eventChannel = instance.getOpenerEventChannel();
@@ -61,6 +64,28 @@
const select = (v: cityItem) => {
sheep.$store('user').setUserCity(v);
+ uni.getLocation({
+ geocode: true,
+ success: (res) => {
+ const params = {
+ lat: String(res.latitude),
+ lon: String(res.longitude),
+ province: res.address?.province ?? '',
+ city: v?.t ?? '',
+ district: res.address?.district ?? '',
+ address: res.address?.street ?? '',
+ };
+ RecentApi.updateUserLocation(params);
+ },
+ fail: (err) => {
+ const params = {
+ lat: '0',
+ lon: '0',
+ city: v?.t ?? '',
+ };
+ RecentApi.updateUserLocation(params);
+ },
+ });
eventChannel.emit('changeCity');
back();
};
@@ -69,9 +94,3 @@
uni.navigateBack();
}
-
-
diff --git a/src/pages/home/home.vue b/src/pages/home/home.vue
index 65286876..e261ede1 100644
--- a/src/pages/home/home.vue
+++ b/src/pages/home/home.vue
@@ -2,7 +2,7 @@
-
+
{{ userCity?.t || '未选择' }}
@@ -19,6 +19,8 @@
:loadMoreStatus="loadMoreStatus"
@refresh="refreshList"
@loadMore="listLoadMore"
+ @scroll="(e) => (scrollTop = e.detail.scrollTop)"
+ :scroll-top="scrollTop"
>
sheep.$store('user').userCity);
const params = reactive({
- scene: 'DYNAMIC_RECOMMEND',
+ scene: '',
province: '',
- city: '',
+ city: userCity.value.t,
memberId: '',
});
const { listData, loadMoreStatus, refreshList, listLoadMore } = useScroll(
RecentApi.quickPage,
params,
);
+ const scrollTop = ref(0);
- const selectAddress = () => {
+ onLoad(async () => {
+ // 获取顶部导航栏tab菜单
+ const { data } = await RecentApi.getSquareTabMenu();
+ if (data && data.length > 0) {
+ segmentedItems.value = data;
+ params.scene = data[0]['search-action'];
+ refreshList();
+ }
+ });
+
+ const goSelectAddress = () => {
uni.navigateTo({
url: '/pages/home/city',
events: {
- changeCity: () => {
- refreshList();
+ changeCity: async () => {
+ scrollTop.value = 0;
+ params.city = userCity.value.t;
+ await refreshList();
},
},
});
@@ -95,8 +111,9 @@
});
};
- const segmentedChange = ({ currentIndex }: { currentIndex: number }) => {
- console.log(segmentedItems[currentIndex]);
- refreshList();
+ const segmentedChange = async (item: any) => {
+ params.scene = item['search-action'];
+ scrollTop.value = 0;
+ await refreshList();
};
diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue
index 39fc45e8..a5bfed04 100644
--- a/src/pages/login/login.vue
+++ b/src/pages/login/login.vue
@@ -7,46 +7,40 @@
• 高端社交圈 •
-
-
-
-
-
-
-
-
- 获取验证码
-
+
+
+
+
+
+
+
+ 获取验证码
-
- 登 录
-
-
-
+
+
+ 登 录 / 注 册
+
-
-
+
@@ -96,7 +89,6 @@
const phone = ref('');
const smsCode = ref('');
- const scene = ref('login');
const handleGetCode = async () => {
if (!phone.value) return uni.showToast({ title: '请填写手机号', icon: 'none' });
@@ -116,30 +108,24 @@
if (!phone.value) return uni.showToast({ title: '请填写手机号', icon: 'none' });
if (!smsCode.value) return uni.showToast({ title: '请填写验证码', icon: 'none' });
- const { code } = await AuthUtil.smsLogin({ mobile: phone.value, code: smsCode.value });
- if (code === 0) {
- uni.reLaunch({ url: '/pages/home/home' });
- }
- };
-
- // 注册
- const handleRegister = async () => {
- if (!phone.value) return uni.showToast({ title: '请填写手机号', icon: 'none' });
- if (!smsCode.value) return uni.showToast({ title: '请填写验证码', icon: 'none' });
-
const { code } = await AuthUtil.smsRegister({ mobile: phone.value, code: smsCode.value });
if (code === 0) {
uni.reLaunch({ url: '/pages/home/home' });
+ getApp().$vm.init();
+ return;
}
+ // 清理数据,防止缓存未失效
+ getApp().$vm.unloadStore();
};
- const goLogin = () => {
- smsCode.value = '';
- scene.value = 'login';
- };
+ // 注册
+ // const handleRegister = async () => {
+ // if (!phone.value) return uni.showToast({ title: '请填写手机号', icon: 'none' });
+ // if (!smsCode.value) return uni.showToast({ title: '请填写验证码', icon: 'none' });
- const goRegister = () => {
- smsCode.value = '';
- scene.value = 'register';
- };
+ // const { code } = await AuthUtil.smsRegister({ mobile: phone.value, code: smsCode.value });
+ // if (code === 0) {
+ // uni.reLaunch({ url: '/pages/home/home' });
+ // }
+ // };
diff --git a/src/pages/message/chat-box.vue b/src/pages/message/chat-box.vue
index cda17a93..9e6ac825 100644
--- a/src/pages/message/chat-box.vue
+++ b/src/pages/message/chat-box.vue
@@ -120,7 +120,7 @@
>
- 文件
+ 文件
-
+
@@ -29,7 +29,7 @@
还没有好友
添加好友,开始精彩的聊天之旅
-
+