视频搜索
This commit is contained in:
parent
1e8c025c37
commit
a8684b1956
jiuyi2
|
@ -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: {
|
||||||
|
|
|
@ -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,
|
|
||||||
}
|
}
|
||||||
}).then(rs => {
|
api.video.videoSearch({ query: obj }).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>
|
||||||
|
|
|
@ -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()],
|
||||||
|
|
Loading…
Reference in New Issue