|
@@ -36,6 +36,7 @@ export default defineComponent({
|
|
|
const state = reactive({
|
|
|
isClick: false,
|
|
|
list: [] as any,
|
|
|
+ videoWidth: '100%',
|
|
|
listState: {
|
|
|
reshLoading: false,
|
|
|
dataShow: true, // 判断是否有数据
|
|
@@ -98,10 +99,16 @@ export default defineComponent({
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- onMounted(() => {
|
|
|
- getList()
|
|
|
- })
|
|
|
const swipeRef = ref([] as any)
|
|
|
+ onMounted(async () => {
|
|
|
+ await getList()
|
|
|
+
|
|
|
+ nextTick(() => {
|
|
|
+ // 为了处理在安卓手机上面关闭全屏之后样式会有问题
|
|
|
+ const width = document.querySelector('.van-step__title')?.clientWidth
|
|
|
+ state.videoWidth = width ? width + 'px' : '100%'
|
|
|
+ })
|
|
|
+ })
|
|
|
return () => (
|
|
|
// <OFullRefresh
|
|
|
// v-model:modelValue={state.listState.refreshing}
|
|
@@ -142,10 +149,13 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</div>
|
|
|
<p class={[styles.content, 'van-multi-ellipsis--l2']}>{item.content}</p>
|
|
|
-
|
|
|
- <Swipe ref={(el: any) => (swipeRef.value[index] = el)} class={styles.storySwipe}>
|
|
|
+ <Swipe
|
|
|
+ ref={(el: any) => (swipeRef.value[index] = el)}
|
|
|
+ class={styles.storySwipe}
|
|
|
+ touchable={item.type === 'VIDEO' ? false : true}
|
|
|
+ >
|
|
|
{item.attachments &&
|
|
|
- item.attachments.map((child: any) => (
|
|
|
+ item.attachments.map((child: any, index: number) => (
|
|
|
<SwipeItem>
|
|
|
{item.type === 'IMAGE' && (
|
|
|
<div
|
|
@@ -164,6 +174,7 @@ export default defineComponent({
|
|
|
<OVideo
|
|
|
src={child.url}
|
|
|
height={'100%'}
|
|
|
+ style={{ width: state.videoWidth }}
|
|
|
poster={child.coverImage}
|
|
|
class={styles.swipeImg}
|
|
|
ref={(el: any) => (videoRef.value[index] = el)}
|