视频搜索

This commit is contained in:
lr 2025-02-23 18:07:34 +08:00
parent 1e8c025c37
commit a8684b1956
3 changed files with 16 additions and 25 deletions

View File

@ -6,9 +6,9 @@ const config = {
// host: 'h5api', // host: 'h5api',
// #endif // #endif
// #ifndef H5 // #ifndef H5
// host: 'http://91f.xyz:8080', host: 'http://91f.xyz:8080',
// host: 'https://1a880cd5.r24.cpolar.top/', // host: 'https://1a880cd5.r24.cpolar.top/',
host: 'http://6mkwby.natappfree.cc', // host: 'http://6mkwby.natappfree.cc',
// #endif // #endif
// 支付方式配置 // 支付方式配置
payType: { payType: {

View File

@ -94,17 +94,6 @@ onPullDownRefresh(() => {
// //
function getSearchLog() { function getSearchLog() {
// api.video.videoSearchLog().then(rs => {
// if (rs.code == 200) {
// searchLog.push(...rs.data)
// return
// }
// util.alert({
// content: rs.msg,
// showCancel: false,
// })
// })
let searchList = uni.getStorageSync('searchLog'); let searchList = uni.getStorageSync('searchLog');
if (searchList) { if (searchList) {
searchList = Array.from(new Set(searchList)) searchList = Array.from(new Set(searchList))
@ -163,6 +152,7 @@ function handleSearch() {
searchList = searchList == '' ? [] : searchList; searchList = searchList == '' ? [] : searchList;
searchList.push(keyword.value) searchList.push(keyword.value)
searchList = Array.from(new Set(searchList)) searchList = Array.from(new Set(searchList))
searchList = searchList.reverse()
uni.setStorageSync("searchLog", searchList) uni.setStorageSync("searchLog", searchList)
} }
@ -230,18 +220,18 @@ function getMoreFriendList() {
// //
function getFriendList() { function getFriendList() {
api.video.searchFriendByName({ let obj = {
path: [keyword.value], content: keyword.value,
query: { type: +tabIndex.value + 1,
pageNum: userList.pageNum, userId: userinfo.value.id,
pageSize: userList.pageSize, }
} api.video.videoSearch({ query: obj }).then(rs => {
}).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
if (userList.pageNum) userList.data.length = 0 if (userList.pageNum) userList.data.length = 0
// //
userList.data.push(...rs.rows.map(item => { userList.data.push(...rs.rows.map(item => {
item.format_userPortrait = util.format_url(item.userPortrait, 'img') item.userId = item.id
item.format_userPortrait = util.format_url(item.avatar, 'img')
return item return item
})) }))
// //
@ -288,7 +278,7 @@ function deleteSearch() {
content: '确认删除历史记录吗?', content: '确认删除历史记录吗?',
}).then(rs => { }).then(rs => {
uni.removeStorageSync('searchLog') uni.removeStorageSync('searchLog')
searchLog.value = [] searchLog = searchLog.splice(0, searchLog.length)
}) })
} }
</script> </script>
@ -474,10 +464,11 @@ function deleteSearch() {
</view> </view>
<view class="button fs0"> <view class="button fs0">
<view class="btn cancel w150" v-if="item.isAttention">取消关注</view> <view class="btn cancel w150" v-if="item.isAttention == 0">取消关注</view>
<view class="btn focus w150" v-else>关注</view> <view class="btn focus w150" v-else>关注</view>
</view> </view>
</view> </view>
<view v-if="userList.data.length == 0" class="mtb20 nomore">暂无更多</view>
</view> </view>
</view> </view>
</template> </template>

View File

@ -3,9 +3,9 @@ import {
} from 'vite'; } from 'vite';
import uni from '@dcloudio/vite-plugin-uni'; import uni from '@dcloudio/vite-plugin-uni';
// let target = 'http://91f.xyz:8080' let target = 'http://91f.xyz:8080'
// let target = 'https://1a880cd5.r24.cpolar.top/' // let target = 'https://1a880cd5.r24.cpolar.top/'
let target = 'http://6mkwby.natappfree.cc' // let target = 'http://6mkwby.natappfree.cc'
export default defineConfig({ export default defineConfig({
plugins: [uni()], plugins: [uni()],