Procházet zdrojové kódy

搜索反馈页跳转播放增加搜索参数

蒋开心 před 2 týdny
rodič
revize
080279c33c

+ 9 - 2
components/feed-reel/vertical-reel.vue

@@ -521,6 +521,8 @@ export default {
 		entryCompId: { type: [String, Number], default: '' },
 		entryOrderType: { type: [String, Number], default: '' },
 		entryIsHotDian: { type: [String, Number], default: '' },
+		/** 搜索入口关键词 */
+		entrySearch: { type: [String, Number], default: '' },
 		/** 列表已全部加载后,滑到末尾可循环回第一条(用于 reel 详情页等有限列表) */
 		loopAtEnd: { type: Boolean, default: false }
 	},
@@ -748,10 +750,12 @@ export default {
 			const listType = this.entryListType
 			const userNo = this.entryUserNo
 			const compId = this.entryCompId
+			const search = this.entrySearch
 			if (compId != null && compId !== '') return true
 			if (findId != null && findId !== '') return true
 			if (labelId != null && labelId !== '') return true
 			if (listType != null && listType !== '' && userNo != null && userNo !== '') return true
+			if (search != null && String(search) !== '') return true
 			return false
 		},
 		tryEntryBootstrap(force = false) {
@@ -767,7 +771,8 @@ export default {
 				page: Number(this.entryPage) || 1,
 				compId: this.entryCompId,
 				orderType: this.entryOrderType,
-				isHotDian: this.entryIsHotDian
+				isHotDian: this.entryIsHotDian,
+				search: this.entrySearch
 			})
 		},
 		clipKey(clip, index) {
@@ -1653,7 +1658,8 @@ export default {
 			page = 1,
 			compId = '',
 			orderType = '',
-			isHotDian = ''
+			isHotDian = '',
+			search = ''
 		} = {}) {
 			const filters = {}
 			const hasComp = compId != null && String(compId) !== ''
@@ -1668,6 +1674,7 @@ export default {
 			}
 			if (!hasComp && orderType != null && orderType !== '') filters.order_type = orderType
 			if (!hasComp && isHotDian != null && isHotDian !== '') filters.is_hot_dian = isHotDian
+			if (!hasComp && search != null && String(search) !== '') filters.search = String(search)
 			const startPage = Number(page) || 1
 
 			// find_id 仅用于首屏定位,不写入 listFilters,避免分页一直带 find_id

+ 6 - 0
components/find/play.vue

@@ -15,6 +15,7 @@
 		:entry-comp-id="compID"
 		:entry-order-type="order_type"
 		:entry-is-hot-dian="is_hot_dian"
+		:entry-search="search"
 		@tabbar-change="$emit('tabbar-change', $event)"
 	/>
 </template>
@@ -59,6 +60,11 @@ export default {
 			type: [String, Number],
 			default: ''
 		},
+		/** 搜索入口:关键词,列表请求带 search */
+		search: {
+			type: [String, Number],
+			default: ''
+		},
 		isComment: {
 			type: [String, Boolean],
 			default: 'Y'

+ 4 - 0
features/dynamics/post-media.js

@@ -56,6 +56,10 @@ export function videoDetailUrl(id, opts = {}) {
 	if (isHotDian != null && isHotDian !== '') {
 		q.push(`is_hot_dian=${encodeURIComponent(String(isHotDian))}`)
 	}
+	const search = opts.search
+	if (search != null && String(search) !== '') {
+		q.push(`search=${encodeURIComponent(String(search))}`)
+	}
 	return `/pages/feed/reel?${q.join('&')}`
 }
 

+ 5 - 0
pages/feed/reel.nvue

@@ -14,6 +14,7 @@
 			:page="page"
 			:order_type="order_type"
 			:is_hot_dian="is_hot_dian"
+			:search="search"
 			:tab-active="pageVisible"
 		/>
 
@@ -45,6 +46,7 @@ export default {
 			compID: '',
 			order_type: '',
 			is_hot_dian: '',
+			search: '',
 			headTop: 0,
 			headHeight: 0,
 			windowWidth: 0,
@@ -74,6 +76,9 @@ export default {
 		this.compID = (option && option.compID) || ''
 		this.order_type = (option && option.order_type) || ''
 		this.is_hot_dian = (option && option.is_hot_dian) || ''
+		this.search = (option && option.search)
+			? decodeURIComponent(String(option.search))
+			: ''
 
 		const sys = uni.getSystemInfoSync()
 		this.headTop = sys.statusBarHeight || 0

+ 2 - 1
pages/search/result.vue

@@ -360,7 +360,8 @@ export default {
 				uni.navigateTo({
 					url: videoDetailUrl(item.id, {
 						type: 'work',
-						page: item.listPage || item.page || 1
+						page: item.listPage || item.page || 1,
+						search: this.keyword || undefined
 					})
 				})
 				return