123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- import behavior from '~/mixins/video'
- Component({
- behaviors: [behavior],
- properties: {
- worksList: {
- type: Array,
- value: [],
- observer(newVal) {
- this.setData({
- worksListCopy: newVal
- })
- }
- },
- videoType: {
- type: String,
- // value 为public时是默认公共样式,为my时为“我的”样式,展示下载删除是否公开,pk为pk的样式文案,collection为收藏时的样式,excellent优秀作品展播
- value: 'public'
- },
- // 是否在tabbar页面使用
- tabBarPadding: {
- type: Boolean,
- value: false
- }
- },
- data: {
- worksListCopy: {}
- },
- methods: {
- setListFans({
- detail
- }) {
- let worksListCopy = JSON.parse(JSON.stringify(this.data.worksListCopy))
- worksListCopy.forEach(item => {
- if (item.user.uid == detail) {
- item.isFans = true
- }
- })
- this.setData({
- worksListCopy
- })
- },
- addCommentNum({
- detail
- }) {
- let worksListCopy = JSON.parse(JSON.stringify(this.data.worksListCopy))
- worksListCopy.forEach(item => {
- if (item.userRead.id == detail) {
- item.userRead.commentAmount = ++item.userRead.commentAmount
- }
- })
- this.setData({
- worksListCopy
- })
- }
- },
- })
|