feat: 添加刷新功能并优化UI样式
This commit is contained in:
parent
4d7bf1da84
commit
a6616427fd
|
|
@ -2,7 +2,30 @@
|
||||||
<u-popup v-model="showPopup" width="550rpx">
|
<u-popup v-model="showPopup" width="550rpx">
|
||||||
<view class="drawer-container">
|
<view class="drawer-container">
|
||||||
<view class="drawer-header">
|
<view class="drawer-header">
|
||||||
<text class="drawer-title" @click="handleCreateConversation">
|
<view class="header-top">
|
||||||
|
<view class="header-tabs">
|
||||||
|
<u-tabs
|
||||||
|
:list="tabList"
|
||||||
|
:is-scroll="false"
|
||||||
|
:current="currentTab"
|
||||||
|
@change="changeTab"
|
||||||
|
bg-color="transparent"
|
||||||
|
active-color="#4F6AFF"
|
||||||
|
inactive-color="#505866"
|
||||||
|
bar-width="80"
|
||||||
|
font-size="32"
|
||||||
|
:bold="true"
|
||||||
|
></u-tabs>
|
||||||
|
</view>
|
||||||
|
<view class="header-icon" @click="handleHistoryClick">
|
||||||
|
<u-icon name="clock" size="40" color="#333333"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view
|
||||||
|
class="drawer-title header-bottom"
|
||||||
|
@click="handleCreateConversation"
|
||||||
|
>
|
||||||
<u-icon
|
<u-icon
|
||||||
class="drawer-title-icon"
|
class="drawer-title-icon"
|
||||||
name="plus"
|
name="plus"
|
||||||
|
|
@ -10,7 +33,7 @@
|
||||||
color="#666666"
|
color="#666666"
|
||||||
></u-icon>
|
></u-icon>
|
||||||
新建对话
|
新建对话
|
||||||
</text>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view
|
<scroll-view
|
||||||
scroll-y
|
scroll-y
|
||||||
|
|
@ -94,6 +117,15 @@ export default {
|
||||||
currentActiveIndex: -1,
|
currentActiveIndex: -1,
|
||||||
activeItemId: "", // 存储当前激活项的ID
|
activeItemId: "", // 存储当前激活项的ID
|
||||||
scrollToView: "", // 用于scroll-into-view属性
|
scrollToView: "", // 用于scroll-into-view属性
|
||||||
|
tabList: [
|
||||||
|
{
|
||||||
|
name: "AI咨询",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "人工咨询",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
currentTab: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -120,6 +152,12 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 处理历史记录点击事件
|
||||||
|
handleHistoryClick() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/home/history/history",
|
||||||
|
});
|
||||||
|
},
|
||||||
// 处理设置点击事件
|
// 处理设置点击事件
|
||||||
handleSettingsClick() {
|
handleSettingsClick() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
@ -164,6 +202,9 @@ export default {
|
||||||
handleCreateConversation() {
|
handleCreateConversation() {
|
||||||
this.$emit("create-conversation");
|
this.$emit("create-conversation");
|
||||||
},
|
},
|
||||||
|
changeTab(index) {
|
||||||
|
this.currentTab = index;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -177,9 +218,24 @@ export default {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
|
||||||
.drawer-header {
|
.drawer-header {
|
||||||
padding: 0 32rpx;
|
.header-top {
|
||||||
height: 140rpx;
|
height: 80rpx;
|
||||||
line-height: 120rpx;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
.header-tabs {
|
||||||
|
width: 300rpx;
|
||||||
|
}
|
||||||
|
.header-icon {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.header-bottom {
|
||||||
|
padding: 16rpx 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.drawer-title {
|
.drawer-title {
|
||||||
font-family: DouyinSans;
|
font-family: DouyinSans;
|
||||||
|
|
@ -195,7 +251,7 @@ export default {
|
||||||
|
|
||||||
.chat-history-list {
|
.chat-history-list {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: calc(100vh - 360rpx);
|
height: calc(100vh - 420rpx);
|
||||||
padding-bottom: 20rpx;
|
padding-bottom: 20rpx;
|
||||||
|
|
||||||
.chat-day {
|
.chat-day {
|
||||||
|
|
@ -213,7 +269,7 @@ export default {
|
||||||
.chat-item {
|
.chat-item {
|
||||||
padding: 24rpx 30rpx;
|
padding: 24rpx 30rpx;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
margin-bottom: 4rpx;
|
// margin-bottom: 4rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,11 @@
|
||||||
<view class="qa-section">
|
<view class="qa-section">
|
||||||
<view class="qa-header">
|
<view class="qa-header">
|
||||||
<text class="qa-title">大家都在问</text>
|
<text class="qa-title">大家都在问</text>
|
||||||
<view class="more-link">
|
<view class="more-link" @click="handleRefresh">
|
||||||
|
<image
|
||||||
|
class="icon-refresh"
|
||||||
|
src="/static/common/images/icon-refresh.png"
|
||||||
|
></image>
|
||||||
<text class="more-text">换一批</text>
|
<text class="more-text">换一批</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -743,6 +747,21 @@ export default {
|
||||||
}, 300);
|
}, 300);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 点击刷新
|
||||||
|
handleRefresh() {
|
||||||
|
console.log("刷新问题");
|
||||||
|
|
||||||
|
this.$u.api.GetHotQuestions({}).then((res) => {
|
||||||
|
if (res.succeed) {
|
||||||
|
console.log("GetHotQuestions.....", res.data);
|
||||||
|
const res = {
|
||||||
|
enrollment: [], // 注册
|
||||||
|
orientation: [], // 定向
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -793,9 +812,15 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
.qa-section {
|
.qa-section {
|
||||||
background-color: #ffffff;
|
background-image: url("@/static/common/images/hot-question-bg1.png");
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-position: 0 0;
|
||||||
|
// background-attachment: fixed;
|
||||||
|
// background-color: #ffffff;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
|
padding-top: 0rpx;
|
||||||
margin-bottom: 32rpx;
|
margin-bottom: 32rpx;
|
||||||
|
|
||||||
.qa-header {
|
.qa-header {
|
||||||
|
|
@ -805,15 +830,27 @@ export default {
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
|
|
||||||
.qa-title {
|
.qa-title {
|
||||||
font-size: 32rpx;
|
font-family: DouyinSans;
|
||||||
font-weight: 500;
|
font-weight: bold;
|
||||||
color: #333;
|
font-size: 36rpx;
|
||||||
|
color: #5255e6;
|
||||||
|
line-height: 36px;
|
||||||
|
background: linear-gradient(-56deg, #4d50dd 0%, #3e6aff 100%);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.more-link {
|
.more-link {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.icon-refresh {
|
||||||
|
width: 36rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
}
|
||||||
.more-text {
|
.more-text {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #999;
|
color: #333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 129 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 172 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
|
|
@ -2,6 +2,8 @@
|
||||||
export {};
|
export {};
|
||||||
|
|
||||||
; declare global {
|
; declare global {
|
||||||
|
var __VLS_PROPS_FALLBACK: Record<string, unknown>;
|
||||||
|
|
||||||
const __VLS_directiveBindingRestFields: { instance: null, oldValue: null, modifiers: any, dir: any };
|
const __VLS_directiveBindingRestFields: { instance: null, oldValue: null, modifiers: any, dir: any };
|
||||||
const __VLS_unref: typeof import('vue').unref;
|
const __VLS_unref: typeof import('vue').unref;
|
||||||
const __VLS_placeholder: any;
|
const __VLS_placeholder: any;
|
||||||
|
|
@ -35,7 +37,7 @@ export {};
|
||||||
attrs?: any;
|
attrs?: any;
|
||||||
slots?: T extends { $slots: infer Slots } ? Slots : Record<string, any>;
|
slots?: T extends { $slots: infer Slots } ? Slots : Record<string, any>;
|
||||||
emit?: T extends { $emit: infer Emit } ? Emit : {};
|
emit?: T extends { $emit: infer Emit } ? Emit : {};
|
||||||
props?: (T extends { $props: infer Props } ? Props : {}) & Record<string, unknown>;
|
props?: typeof props;
|
||||||
expose?: (exposed: T) => void;
|
expose?: (exposed: T) => void;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue