Browse Source

对接历史记录接口

lihuilin/feature-20251024095243-我的
Ethereal 4 weeks ago
parent
commit
ee3e1bab59
  1. 16
      api/deepMate/deepMate.js
  2. 7
      pages.json
  3. 2
      pages/deepMate/deepMate.vue
  4. 63
      pages/deepMate/scroll/scroll.vue
  5. 7
      utils/http.js

16
api/deepMate/deepMate.js

@ -20,7 +20,7 @@ export const getData = () => {
export const postIntent = (data) => {
return http({
method: 'POST',
url: '/testApi/api/deepMate/dmFirst',
url: '/api/deepMate/dmFirst',
data
})
}
@ -34,7 +34,7 @@ export const postIntent = (data) => {
export const postStock = (data) => {
return http({
method: 'POST',
url: '/testApi/api/coze/decodingSecond',
url: '/api/coze/decodingSecond',
data
})
}
@ -47,14 +47,22 @@ export const postStock = (data) => {
export const postHistory = (data) => {
return http({
method: 'POST',
url: '/history',
url: '/api/deepMate/dmList',
data
})
}
/**
*
* 历史记录详情
*/
export const postHistoryDetail = (data) => {
return http({
method: 'POST',
url: '/api/deepMate/clickRecord',
data
})
}

7
pages.json

@ -148,13 +148,6 @@
"navigationStyle": "custom",
"titleNView": false
}
},
{
"path" : "pages/deepMate/scroll/scroll",
"style" :
{
"navigationBarTitleText" : ""
}
}
],
"globalStyle": {

2
pages/deepMate/deepMate.vue

@ -203,7 +203,7 @@
const { safeAreaInsets } = uni.getSystemInfoSync();
import { ref, computed, onMounted, onUnmounted, watch, nextTick } from "vue";
import footerBar from "../../components/footerBar-cn";
import footerBar from "../../components/footerBar";
import marked from "marked"; // marked
import { onPageScroll } from "@dcloudio/uni-app";
import { postStock, postIntent } from "../../api/deepMate/deepMate";

63
pages/deepMate/scroll/scroll.vue

@ -1,63 +0,0 @@
<template>
<view class="container">
<scroll-view
class="scroll-view"
scroll-y="true"
@scrolltolower="onScrollToLower"
>
<button @click="scrollTo">点击滚动</button>
<view v-for="(item, index) in list" :key="index">
{{ item }}
</view>
</scroll-view>
<button @click="addItem">添加内容</button>
</view>
</template>
<script>
export default {
data() {
return {
list: Array.from({ length: 20 }, (_, i) => `Item ${i + 1}`),
};
},
methods: {
onScrollToLower() {
console.log("滚动到底部了");
//
},
addItem() {
this.list.push(`Item ${this.list.length + 1}`);
this.$nextTick(() => {
this.$refs.scrollView.scrollTo({
top: 99999,
duration: 300,
});
});
},
scrollTo() {
uni.pageScrollTo({
scrollTop: 100,
duration: 300,
});
},
},
};
</script>
<style>
.container {
height: 100%;
}
.scroll-view {
height: 80%;
}
button {
width: 100%;
height: 50px;
line-height: 50px;
text-align: center;
background-color: #007aff;
color: white;
}
</style>

7
utils/http.js

@ -1,6 +1,6 @@
import { useUserStore } from "../stores/modules/userInfo/"
const baseURL = "https://hwjb.homilychart.com"
const baseURL = "https://hwjb.homilychart.com/testApi"
const httpInterceptor = {
@ -33,12 +33,13 @@ const httpInterceptor = {
// 标准头与文档头同时设置,确保兼容
'content-type': 'application/json',
'version': '1',
'client': client
'client': client,
'token': '790750702588f1ea79f24dc56ccd5d8a'
}
//4 添加token
const memberStore = useUserStore()
// const token = memberStore.userInfo?.token
const token = '6d818cda701590750245ce69393f2c32'
const token = '790750702588f1ea79f24dc56ccd5d8a'
if (token) {
options.header.Authorization = token
}

Loading…
Cancel
Save