视频搜索
This commit is contained in:
parent
1e8c025c37
commit
a8684b1956
|
@ -6,9 +6,9 @@ const config = {
|
|||
// host: 'h5api',
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
// host: 'http://91f.xyz:8080',
|
||||
host: 'http://91f.xyz:8080',
|
||||
// host: 'https://1a880cd5.r24.cpolar.top/',
|
||||
host: 'http://6mkwby.natappfree.cc',
|
||||
// host: 'http://6mkwby.natappfree.cc',
|
||||
// #endif
|
||||
// 支付方式配置
|
||||
payType: {
|
||||
|
|
|
@ -94,17 +94,6 @@ onPullDownRefresh(() => {
|
|||
|
||||
// 获取用户搜索记录
|
||||
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');
|
||||
if (searchList) {
|
||||
searchList = Array.from(new Set(searchList))
|
||||
|
@ -163,6 +152,7 @@ function handleSearch() {
|
|||
searchList = searchList == '' ? [] : searchList;
|
||||
searchList.push(keyword.value)
|
||||
searchList = Array.from(new Set(searchList))
|
||||
searchList = searchList.reverse()
|
||||
|
||||
uni.setStorageSync("searchLog", searchList)
|
||||
}
|
||||
|
@ -230,18 +220,18 @@ function getMoreFriendList() {
|
|||
|
||||
// 获取朋友列表
|
||||
function getFriendList() {
|
||||
api.video.searchFriendByName({
|
||||
path: [keyword.value],
|
||||
query: {
|
||||
pageNum: userList.pageNum,
|
||||
pageSize: userList.pageSize,
|
||||
}
|
||||
}).then(rs => {
|
||||
let obj = {
|
||||
content: keyword.value,
|
||||
type: +tabIndex.value + 1,
|
||||
userId: userinfo.value.id,
|
||||
}
|
||||
api.video.videoSearch({ query: obj }).then(rs => {
|
||||
if (rs.code == 200) {
|
||||
if (userList.pageNum) userList.data.length = 0
|
||||
// 追加朋友列表
|
||||
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
|
||||
}))
|
||||
// 视频列表
|
||||
|
@ -288,7 +278,7 @@ function deleteSearch() {
|
|||
content: '确认删除历史记录吗?',
|
||||
}).then(rs => {
|
||||
uni.removeStorageSync('searchLog')
|
||||
searchLog.value = []
|
||||
searchLog = searchLog.splice(0, searchLog.length)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
@ -474,10 +464,11 @@ function deleteSearch() {
|
|||
</view>
|
||||
|
||||
<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>
|
||||
</view>
|
||||
<view v-if="userList.data.length == 0" class="mtb20 nomore">暂无更多</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
@ -3,9 +3,9 @@ import {
|
|||
} from 'vite';
|
||||
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 = 'http://6mkwby.natappfree.cc'
|
||||
// let target = 'http://6mkwby.natappfree.cc'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [uni()],
|
||||
|
|
Loading…
Reference in New Issue