|
|
- <template>
- <view class="publishList">
- <view class="item" v-for="(item, index) in list" @click="gotoDetail(item)" :key="index">
- <image :src="item.image" style="width: 40%" mode="aspectFill"></image>
- <view class="text">
- <view class="title">
- {{ item.title || item.name }}
- </view>
- <view class="createBy">
- <view class=""
- :style="{color: colors[item.state]}">
- 状态:{{ state[item.state] }}
- </view>
- </view>
- <view class="isPay">
- <view class="">
- 是否付费:{{ item.isPay=='Y'?"是":"否" }}
- </view>
- <view class="">
- 是否置顶:{{ item.isTop=='Y'?"是":"否" }}
- </view>
- </view>
- <view class="createTime">
- 发布时间:{{ item.createTime }}
- </view>
- </view>
- </view>
- </view>
- </template>
-
- <script>
- export default {
- name: "releaseList",
- props: ['list'],
- data() {
- return {
- total: 0,
- queryParams: {
- pageNo: 1,
- pageSize: 5,
- },
- checkedIndex: 0,
- colors : ['#000', '#05b905', '#f00'],
- state : ['审核中', '审核通过', '审核不通过,请编辑后重新提交'],
- };
- },
- onShow() {
- // this.getData()
- },
- // onReachBottom() {
- // let allTotal = this.queryParams.pageNo * this.queryParams.pageSize
- // if (allTotal < this.total) {
- // //当前条数小于总条数 则增加请求数
- // console.log(this.queryParams.pageSize,'==son=')
- // this.queryParams.pageSize += 10
- // this.getData() //调用加载数据方法
- // }
- // },
- methods: {
- getData() {
- this.$api('infoGetMyReleasePage', {
- pageNo: this.queryParams.pageNo,
- pageSize: this.queryParams.pageSize,
- state: this.checkedIndex
-
- }, res => {
- if (res.code == 200) {
- this.list = res.result.records
- this.total = res.result.total
- }
- })
- },
- gotoDetail(item) {
-
- // 待审核
- if(item.state == 0){
- return uni.showToast({
- title: '审核中,请耐心等待',
- icon:'none'
- })
- }
-
- // 审核不通过,请编辑后重新提交
- if(item.state == 2){
- // 根据字段区分跳转到不同页面
- if (item.isCard == 'Y') {
- // 跳转到动态(贴子)发布页面
- uni.navigateTo({
- url: '/pages/publish/publishPost?id=' + item.id
- })
- } else if(item.phone) {
- // 跳转到演员(名片)发布页面
- uni.navigateTo({
- url: '/pages/publish/actorRelease?id=' + item.id
- })
- }else{
- // 跳转到作品发布页面
- uni.navigateTo({
- url: '/pages_mine/publish/addWorks?id=' + item.id
- })
- }
- return
- }
-
- // 根据字段区分跳转到不同页面
- if (item.isCard == 'Y') {
- // 跳转到动态(贴子)详情页面
- this.$utils.navigateTo('/publish/postDetail?id=' + item.id)
- } else if(item.phone) {
- // 跳转到演员(名片)详情页面
- this.$utils.navigateTo('/publish/actorDetail?id=' + item.id)
- }else{
- // 跳转到作品详情页面
- uni.navigateTo({
- url: '/pages_mine/publish/worksDetail?id=' + item.id
- })
- }
- }
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .publishList {
- width: 90%;
-
- .item {
- height: 200rpx;
- width: 100%;
- background-color: #fff;
- overflow: hidden;
- border-radius: 10rpx;
- color: #777;
- display: flex;
- font-size: 24rpx;
- margin: 30rpx 0;
-
- image {
- width: 50%;
- height: 100%;
- }
-
- .text {
- display: flex;
- flex-direction: column;
- padding: 16rpx;
- width: 60%;
-
- .title {
- font-size: 30rpx;
- font-weight: 600;
- color: #000;
- }
-
- .createBy {
- display: flex;
- margin-top: auto;
- margin-bottom: 10rpx;
- justify-content: space-between;
-
- &>view {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
-
- .isPay {
- display: flex;
- margin-top: auto;
- margin-bottom: 10rpx;
- color: #7395f4;
- justify-content: space-between;
-
- &>view {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 20rpx;
- }
- }
- }
- }
- }
- </style>
|