|
|
|
@ -7,7 +7,6 @@ |
|
|
|
<SYStackedCarousel |
|
|
|
height="536rpx" |
|
|
|
:images="list" |
|
|
|
:current="current" |
|
|
|
:autoplay="true" |
|
|
|
horizontalMargin="25" |
|
|
|
baseOpacity="0.5" |
|
|
|
@ -26,30 +25,30 @@ |
|
|
|
<view class="main"> |
|
|
|
<view class="flex header"> |
|
|
|
<view>图片直播</view> |
|
|
|
<view class="btn btn-mark" @click="onMark">标记有我</view> |
|
|
|
<!-- <view class="btn btn-mark" @click="onMark">标记有我</view> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="section" v-for="item in list" :key="item.id"> |
|
|
|
<view class="flex section-header"> |
|
|
|
<view class="flex title"> |
|
|
|
<view>{{ item.title }}</view> |
|
|
|
<view v-if="isManager" class="btn btn-add" @click="onAdd(item.id)">新增记录</view> |
|
|
|
<!-- <view v-if="isManager" class="btn btn-add" @click="onAdd(item.id)">新增记录</view> --> |
|
|
|
</view> |
|
|
|
<button class="flex btn btn-all" @click="showAll(item.id)"> |
|
|
|
<button class="flex btn btn-all" @click="showAll(item.id, item.activityId)"> |
|
|
|
<view>查看全部</view> |
|
|
|
<image class="icon" src="@/static/image/icon-arrow-right.png" mode="widthFix"></image> |
|
|
|
</button> |
|
|
|
</view> |
|
|
|
<view class="section-content record"> |
|
|
|
<view class="record-item" v-for="(image, imgIdx) in item.images" :key="imgIdx"> |
|
|
|
<image class="img" :src="image" mode="aspectFill"></image> |
|
|
|
<image class="img" :src="image" mode="aspectFill" @click="previewImage(item.images, imgIdx)"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<markPopup ref="markPopup"></markPopup> |
|
|
|
<formPopup ref="formPopup" @submitted="getData"></formPopup> |
|
|
|
<!-- <markPopup ref="markPopup"></markPopup> --> |
|
|
|
<!-- <formPopup ref="formPopup" @submitted="getData"></formPopup> --> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
|
@ -58,22 +57,22 @@ |
|
|
|
import mixinsList from '@/mixins/list.js' |
|
|
|
|
|
|
|
import SYStackedCarousel from '@/uni_modules/SY-StackedCarousel/components/SY-StackedCarousel/SY-StackedCarousel.vue' |
|
|
|
import markPopup from '@/pages_order/growing/activity/markPopup.vue' |
|
|
|
import formPopup from './formPopup.vue' |
|
|
|
// import markPopup from '@/pages_order/growing/activity/markPopup.vue' |
|
|
|
// import formPopup from './formPopup.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
mixins: [mixinsList], |
|
|
|
components: { |
|
|
|
SYStackedCarousel, |
|
|
|
markPopup, |
|
|
|
formPopup, |
|
|
|
// markPopup, |
|
|
|
// formPopup, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
current: 0, |
|
|
|
mixinsListApi: 'queryImageList', |
|
|
|
// todo: fetch |
|
|
|
isManager: true, |
|
|
|
// isManager: true, |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -87,12 +86,13 @@ |
|
|
|
methods: { |
|
|
|
getDataThen(records) { |
|
|
|
this.list = records.map(item => { |
|
|
|
const { id, image, activityId_dictText, createTime } = item |
|
|
|
const { id, image, activityId, activityId_dictText, createTime } = item |
|
|
|
|
|
|
|
const images = image?.split?.(',') || [] |
|
|
|
|
|
|
|
return { |
|
|
|
id, |
|
|
|
activityId, |
|
|
|
url: images?.[0], |
|
|
|
images, |
|
|
|
title: activityId_dictText, |
|
|
|
@ -104,17 +104,23 @@ |
|
|
|
this.current = index |
|
|
|
}, |
|
|
|
changeHandler(index) { |
|
|
|
console.log("当前触发change事件,返回索引: ", index); |
|
|
|
}, |
|
|
|
onMark() { |
|
|
|
this.$refs.markPopup.open(this.id) |
|
|
|
}, |
|
|
|
onAdd() { |
|
|
|
this.$refs.formPopup.open() |
|
|
|
this.current = index |
|
|
|
}, |
|
|
|
showAll(id) { |
|
|
|
// onMark() { |
|
|
|
// this.$refs.markPopup.open(this.id) |
|
|
|
// }, |
|
|
|
// onAdd() { |
|
|
|
// this.$refs.formPopup.open() |
|
|
|
// }, |
|
|
|
showAll(id, activityId) { |
|
|
|
this.$store.commit('setLiveInfo', this.list.find(item => item.id === id)) |
|
|
|
this.$utils.navigateTo(`/pages_order/live/index?id=${id}`) |
|
|
|
this.$utils.navigateTo(`/pages_order/live/index?imageId=${id}&activityId=${activityId}`) |
|
|
|
}, |
|
|
|
previewImage(arr, index) { |
|
|
|
uni.previewImage({ |
|
|
|
urls: arr, |
|
|
|
current: arr[index], // 当前显示图片的链接 |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
|