短视频样式细节优化

master
gongfuxiang 2026-02-27 09:24:32 +08:00
parent 1d1e552313
commit c39d60a344
1 changed files with 46 additions and 32 deletions

View File

@ -147,7 +147,7 @@
</view>
<view class="flex-row align-c gap-10 wh-auto ht-auto pr-16 box-border-box">
<input :value="comment_input_value" class="comment-input" type="text" confirm-type="send" :adjust-position="false" :placeholder="input_placeholder" @focus="add_comment" @input="comment_input_event" @confirm="send_comment" />
<component-upload :propMaxNum="1" :propPathType="editor_path_type" propSlot propSingleCall propIsAllInfo @call-back="chat_upload_images_event">
<component-upload :propMaxNum="1" :propPathType="editor_path_type" propSlot propSingleCall propIsAllInfo @call-back="upload_images_event">
<iconfont name="icon-layout-module-single-images" size="32rpx" color="#999"></iconfont>
</component-upload>
</view>
@ -212,7 +212,7 @@
</view>
<view class="flex-row align-c gap-10 wh-auto ht-auto pr-16 box-border-box">
<input :value="comment_input_value" :focus="is_add_comment" class="comment-input" type="text" confirm-type="done" :adjust-position="false" :auto-blur="true" :placeholder="input_placeholder" @input="comment_input_event" @blur="() => is_add_comment = false" @confirm="send_comment" />
<component-upload :propMaxNum="1" :propPathType="editor_path_type" propSlot propSingleCall propIsAllInfo @call-back="chat_upload_images_event">
<component-upload :propMaxNum="1" :propPathType="editor_path_type" propSlot propSingleCall propIsAllInfo @call-back="upload_images_event">
<iconfont name="icon-layout-module-single-images" size="48rpx" color="#999"></iconfont>
</component-upload>
</view>
@ -536,20 +536,12 @@
video_data_list: this.video_data_list,
current_index: is_last == 1 && is_next == 1 ? (new_index == this.video_data_list.length - 1 ? 2 : (new_index == this.video_data_list.length - 2 ? 1 : 0)) : this.current_index,
});
if (is_last == 1 && is_next == 1) {
//
this.update_display_data();
setTimeout(() => {
//#ifdef H5
//
const current_video = this.video_data_list.find(item => item.id == id);
if (current_video && current_video.title) {
document.title = current_video.title;
}
//#endif
//
this.update_share_info(this.display_video_list[this.current_index]);
@ -731,7 +723,8 @@
this.video_play_event(videoContext);
}
},
//
update_share_info(data) {
const info = {
title: data.title || '',
@ -744,8 +737,12 @@
share_info: info,
});
//
app.globalData.page_share_handle(info);
},
app.globalData.page_share_handle(info);
//
uni.setNavigationBarTitle({title: data.title});
},
//
video_play_event(videoContext, is_first_play = false) {
if (!videoContext) {
@ -790,7 +787,7 @@
//
return this.video_data_list[index];
},
//
update_display_data() {
let list = [];
@ -818,13 +815,15 @@
this.setData({
display_video_list: list
})
},
},
//
comment_input_event(e) {
this.comment_input_value = e.detail.value;
},
chat_upload_images_event(res) {
},
//
upload_images_event(res) {
if((res || null) != null) {
//
this.form_images_list.push({
@ -833,14 +832,16 @@
size: res.size,
});
}
},
},
//
upload_show_event(e) {
uni.previewImage({
current: this.form_images_list[e.currentTarget.dataset.index].url,
urls: this.form_images_list.map(item => item.url),
});
},
},
//
comment_input_img_close(e) {
const index = e?.currentTarget?.dataset?.index || 0;
@ -849,7 +850,9 @@
this.setData({
form_images_list: list,
});
},
},
// swiper-item
on_transition(e) {
const dy = e.detail.dy;
let status = 'direction';
@ -864,10 +867,13 @@
direction: status,
})
}
},
},
//
handle_play() {
this.setData({ paused: false, is_manual_pause: false });
},
},
//
handle_like(e) {
if (!app.globalData.is_single_page_check()) {
@ -991,10 +997,10 @@
}
}
},
//
send_comment() {
let comment_text = this.comment_input_value;
if (!comment_text.trim()) return;
// video_id id video_comments_id id id id
@ -1068,7 +1074,8 @@
}
}
});
},
},
//
open_sub_comment(id, is_level) {
const comment = this.active_comments.find(item => item.id == id);
@ -1108,14 +1115,17 @@
}
});
}
},
},
//
close_sub_comment(id) {
const comment = this.active_comments.find(item => item.id == id);
if (comment) {
comment.show_sub_comment = false;
}
},
},
//
handle_share() {
if ((this.$refs.share || null) != null) {
this.$refs.share.init({
@ -1123,7 +1133,8 @@
share_info: this.share_info,
});
}
},
},
//
get_video_data_detail(id) {
uni.request({
@ -1149,7 +1160,8 @@
}
}
});
},
},
//
set_givethumbs_num(id, comments_id) {
uni.request({
@ -1216,7 +1228,9 @@
}
}
});
},
},
//
handle_time_update(e) {
if (this.is_seeking) return;
let duration = this.current_video_duration;