Browse Source

对接接口

master
chenkun 10 months ago
parent
commit
c20268d03d
5 changed files with 270 additions and 233 deletions
  1. +213
    -184
      pages/mine/promotionRecord.vue
  2. +18
    -7
      pages/mine/releaseRecord.vue
  3. +1
    -1
      pages/mine/sonPage/promotion/promotionRecordList.vue
  4. +24
    -19
      pages/mine/sonPage/release/releaseList.vue
  5. +14
    -22
      pages/publish/postDetail.vue

+ 213
- 184
pages/mine/promotionRecord.vue View File

@ -1,192 +1,221 @@
<template>
<view class="promotionRecord">
<!--顶部导航栏-->
<navbar
leftClick
@leftClick="$utils.navigateBack"
title="我的推广"/>
<!--主页面-->
<view class="frame">
<!--标题-->
<view class="title">
<span>推广记录</span>
</view>
<!--搜索条件-->
<view class="search">
<!--搜索框-->
<view style="width:40%;height:100%">
<uv-input placeholder="请输入内容" border="surround" clearable></uv-input>
</view>
<!--开始时间-->
<view class="dateTimeCls">
<view class="date" @click="startDateOpen">
<uv-datetime-picker ref="startDateRef" v-model="queryParams.startDate" mode="date"
@confirm="startDateChange">
</uv-datetime-picker>
</view>
<view class="image">
<image src="/static/image/promotionRecord/2.svg" style="width: 100%;height: 100%"></image>
</view>
</view>
<!--结束时间-->
<view class="dateTimeCls">
<view class="date" @click="endDateOpen">
{{ queryParams.endDate }}
<uv-datetime-picker ref="endDateRef" v-model="queryParams.endDate" mode="date"
@confirm="endDateChange">
</uv-datetime-picker>
</view>
<view class="image">
<image src="/static/image/promotionRecord/2.svg" style="width: 100%;height: 100%"></image>
</view>
</view>
</view>
<!--发布列表-->
<view style="" class="publishListClass">
<PromotionRecordList :list="promotionRecordList"/>
</view>
</view>
</view>
<view class="promotionRecord">
<!--顶部导航栏-->
<navbar leftClick @leftClick="$utils.navigateBack" title="我的推广" />
<!--主页面-->
<view class="frame">
<!--标题-->
<view class="title">
<span>推广记录</span>
</view>
<!--搜索条件-->
<view class="search">
<!--搜索框-->
<view style="width:40%;height:100%">
<uv-input v-model="queryParams.keyWord" placeholder="请输入内容" border="surround" clearable
@change="keyWordChange"
></uv-input>
</view>
<!--开始时间-->
<view class="dateTimeCls">
<view class="date" @click="startDateOpen">
{{ queryParams.startDate }}
<uv-datetime-picker ref="startDateRef" v-model="queryParams.startDate" mode="date"
@confirm="startDateChange">
</uv-datetime-picker>
</view>
<view class="image">
<image src="/static/image/promotionRecord/2.svg" style="width: 100%;height: 100%"></image>
</view>
</view>
<!--结束时间-->
<view class="dateTimeCls">
<view class="date" @click="endDateOpen">
{{ queryParams.endDate }}
<uv-datetime-picker ref="endDateRef" v-model="queryParams.endDate" mode="date"
@confirm="endDateChange">
</uv-datetime-picker>
</view>
<view class="image">
<image src="/static/image/promotionRecord/2.svg" style="width: 100%;height: 100%"></image>
</view>
</view>
</view>
<!--发布列表-->
<view style="" class="publishListClass">
<PromotionRecordList :list="promotionRecordList" />
</view>
</view>
</view>
</template>
<script>
import PromotionRecordList from "@/pages/mine/sonPage/promotion/promotionRecordList.vue";
import moment from "moment";
export default {
components: {PromotionRecordList},
data() {
return {
promotionRecordList: [
{
title: "推广记录",
createTime: '2024-08-22 09:00:00',
createBy: "24小时",
isPay: "¥100"
},
],
queryParams: {
pageNo: 1,
pageSize: 10,
startDate:moment(new Date()).format('YYYY-MM-DD'),
endDate: moment(new Date()).format('YYYY-MM-DD'),
import PromotionRecordList from "@/pages/mine/sonPage/promotion/promotionRecordList.vue";
import moment from "moment";
export default {
components: {
PromotionRecordList
},
data() {
return {
promotionRecordList: [],
queryParams: {
pageNo: 1,
pageSize: 10,
startDate: moment(new Date()).format('YYYY-MM-DD'),
endDate: moment(new Date()).format('YYYY-MM-DD'),
keyWord: '',
},
}
},
onReachBottom() {
console.log("=====")
let allTotal = this.queryParams.pageNo * this.queryParams.pageSize
if (allTotal < this.total) {
//
this.queryParams.pageSize += 10
this.getData() //
}
},
mounted() {
console.log("====")
this.getData()
},
methods: {
getData() {
console.log("==getData==")
this.$api('infoGetPromotionPage', {
pageNo: this.queryParams.pageNo,
pageSize: this.queryParams.pageSize,
startDate: this.queryParams.startDate,
endDate: this.queryParams.endDate,
keyWord: this.queryParams.keyWord
}, res => {
if (res.code == 200) {
this.promotionRecordList = res.result.records
this.total = res.result.total
}
})
},
keyWordChange(val) {
console.log("val",val)
this.queryParams.keyWord = val
this.getData()
},
}
},
methods: {
startDateChange(val) {
console.log(val.value, "======startDateChange=======")
this.queryParams.startDate = moment(new Date(val.value)).format('YYYY-MM-DD')
},
startDateOpen() {
this.$refs.startDateRef.open();
},
endDateChange(val) {
console.log(val.value, "=======endDateChange======")
var aaa = moment(new Date(val.value)).format('YYYY-MM-DD')
console.log(aaa, "aaa")
this.queryParams.endDate = val.value
},
endDateOpen() {
this.$refs.endDateRef.open();
},
startDateFormatter(type, value) {
if (type === 'year') {
return `${value}`
}
if (type === 'month') {
return `${value}`
}
if (type === 'day') {
return `${value}`
}
return value
},
endDateFormatter(type, value) {
console.log(type, value, "======endDateFormatter=======")
if (type === 'year') {
return `${value}`
}
if (type === 'month') {
return `${value}`
}
if (type === 'day') {
return `${value}`
}
return value
}
}
}
startDateChange(val) {
this.queryParams.startDate = moment(new Date(val.value)).format('YYYY-MM-DD')
this.getData()
},
startDateOpen() {
this.$refs.startDateRef.open();
},
endDateChange(val) {
var aaa = moment(new Date(val.value)).format('YYYY-MM-DD')
console.log(aaa,"aaaaaaaaaaaa")
this.queryParams.endDate = aaa
},
endDateOpen() {
this.$refs.endDateRef.open();
},
// startDateFormatter(type, value) {
// if (type === 'year') {
// return `${value}`
// }
// if (type === 'month') {
// return `${value}`
// }
// if (type === 'day') {
// return `${value}`
// }
// return value
// },
// endDateFormatter(type, value) {
// console.log(type, value, "======endDateFormatter=======")
// if (type === 'year') {
// return `${value}`
// }
// if (type === 'month') {
// return `${value}`
// }
// if (type === 'day') {
// return `${value}`
// }
// return value
// }
}
}
</script>
<style lang="scss" scoped>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.promotionRecord {
width: 100vw;
height: 100vh;
.frame {
width: 100%;
//height: calc(100vh - 220rpx);
padding: 28rpx 28rpx 0 28rpx;
.title {
font-size: 34rpx;
color: #333;
font-weight: 700
}
.search {
display: flex;
align-items: center;
gap: 10rpx;
width: 100%;
height: 80rpx;
margin-top: 20rpx;
.dateTimeCls {
display: flex;
align-items: center;
justify-content: space-between;
width: 25%;
height: 80%;
border: 1px solid #b0b2b3;
padding: 5rpx;
border-radius: 20rpx;
.date {
font-size: 25rpx;
display: flex;
align-items: center;
width: 80%;
height: 100%;
color: #b0b2b3;
}
.image {
width: 20%;
height: 100%;
}
}
}
.publishListClass {
margin-top: 10rpx;
height: 78vh;
overflow: auto;
width: 100%;
}
}
}
</style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.promotionRecord {
width: 100vw;
height: 100vh;
.frame {
width: 100%;
//height: calc(100vh - 220rpx);
padding: 28rpx 28rpx 0 28rpx;
.title {
font-size: 34rpx;
color: #333;
font-weight: 700
}
.search {
display: flex;
align-items: center;
gap: 10rpx;
width: 100%;
height: 80rpx;
margin-top: 20rpx;
.dateTimeCls {
display: flex;
align-items: center;
justify-content: space-between;
width: 25%;
height: 80%;
border: 1px solid #b0b2b3;
padding: 5rpx;
border-radius: 20rpx;
.date {
font-size: 25rpx;
display: flex;
align-items: center;
width: 80%;
height: 100%;
color: #b0b2b3;
}
.image {
width: 20%;
height: 100%;
}
}
}
.publishListClass {
margin-top: 10rpx;
height: 78vh;
overflow: auto;
width: 100%;
}
}
}
</style>

+ 18
- 7
pages/mine/releaseRecord.vue View File

@ -14,19 +14,19 @@
</view>
<!--标签栏-->
<view class="tabbar">
<view class="tabbarItemActive" @click="tabChange('all')">
<span :class="checkedIndex==0 ? 'active' : ''">全部</span>
<view class="" @click="tabChange('all')">
<span :class="checkedIndex==0 ? 'tabbarItemActive' : ''">全部</span>
</view>
<view class="tabbarItemNoActive" @click="tabChange('tiezi')">
<span :class="checkedIndex==1 ? 'active' : ''">贴子</span>
<span :class="checkedIndex==1 ? 'tabbarItemActive' : ''">贴子</span>
</view>
<view class="tabbarItemNoActive" @click="tabChange('mingpian')">
<span :class="checkedIndex==2 ? 'active' : ''">名片</span>
<span :class="checkedIndex==2 ? 'tabbarItemActive' : ''">名片</span>
</view>
</view>
<!--发布列表-->
<view style="" class="publishListClass">
<ReleaseList :list="recordsList"/>
<ReleaseList :list="recordsList" ref="releaseList"/>
</view>
</view>
</view>
@ -63,6 +63,15 @@ export default {
mounted() {
this.getData()
},
onReachBottom() {
console.log("=====")
let allTotal = this.queryParams.pageNo * this.queryParams.pageSize
if (allTotal < this.total) {
//
this.queryParams.pageSize += 10
this.getData() //
}
},
computed: {
...mapState(['userInfo']),
},
@ -74,11 +83,12 @@ export default {
},
methods: {
getData(type) {
this.$api('infoGetMyReleasePage', {
pageNo: this.queryParams.pageNo,
pageSize: this.queryParams.pageSize,
// type
state: this.checkedIndex
}, res => {
if (res.code == 200) {
this.recordsList = res.result.records
@ -89,7 +99,8 @@ export default {
//
tabChange(type) {
this.checkedIndex = type == 'all' ? 0 : (type == 'tiezi' ? 1 : 2)
this.checkedIndex = (type== 'all' ? 0 : (type == 'tiezi' ? 1 : 2))
// this.$refs.releaseList.checkedIndex = this.checkedIndex
this.queryParams.pageNo = 1
this.queryParams.pageSize = 10
this.getData()


+ 1
- 1
pages/mine/sonPage/promotion/promotionRecordList.vue View File

@ -19,7 +19,7 @@
<view>
<view class="isPay">
<view class="">
价格{{ item.isPay }}
价格{{ item.price }}
</view>
</view>
<view class="createTime">


+ 24
- 19
pages/mine/sonPage/release/releaseList.vue View File

@ -3,19 +3,19 @@
<view class="item" v-for="(item, index) in list"
@click="gotoDetail(item)"
:key="index">
<image :src="item.cover" style="width: 40%"></image>
<image :src="item.image" style="width: 40%"></image>
<view class="text">
<view class="title">
{{ item.title }}
</view>
<view class="createBy">
<view class="">
是否置顶{{ item.createBy }}
是否置顶{{ item.isTop }}
</view>
</view>
<view class="isPay">
<view class="">
是否付费{{ item.isPay }}
是否付费{{ item.isPay?"是":"否" }}
</view>
</view>
<view class="createTime">
@ -35,27 +35,30 @@ export default {
total: 0,
queryParams: {
pageNo: 1,
pageSize: 10,
}
pageSize: 5,
},
checkedIndex:0,
};
},
onShow() {
this.getData()
},
onReachBottom() {
let allTotal = this.queryParams.pageNo * this.queryParams.pageSize
if (allTotal < this.total) {
//
this.queryParams.pageSize += 10
this.getData() //
}
// 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,
// id
state: this.checkedIndex
}, res => {
if (res.code == 200) {
this.list = res.result.records
@ -65,11 +68,13 @@ export default {
},
gotoDetail(item) {
//
if (1==1){
//
if (item.isCard=='N'){
// ()
console.log("跳转到动态(贴子)详情页面")
this.$utils.navigateTo('/publish/postDetail?id=' + item.id)
}else{
//
// ()
console.log("跳转到演员(名片)详情页面")
this.$utils.navigateTo('/publish/actorDetail?id=' + item.id)
}
}
@ -101,7 +106,7 @@ export default {
display: flex;
flex-direction: column;
padding: 16rpx;
width: 50%;
width: 60%;
.title {
font-size: 30rpx;


+ 14
- 22
pages/publish/postDetail.vue View File

@ -1,13 +1,10 @@
<template>
<view class="postDetail">
<navbar leftClick @leftClick="$utils.navigateBack" />
<navbar leftClick @leftClick="$utils.navigateBack" title="动态详情" />
<view class="swipe">
<uv-swiper
:list="item.image &&
item.image.split(',')"
indicator
height="320rpx"></uv-swiper>
<uv-swiper :list="item.image &&
item.image.split(',')" indicator height="320rpx"></uv-swiper>
</view>
<view class="box">
@ -27,7 +24,7 @@
<view class="controls">
<contentControls/>
<contentControls />
</view>
@ -42,37 +39,31 @@
<script>
import contentControls from '@/components/content/contentControls.vue'
export default {
components : {
components: {
contentControls
},
data() {
return {
list: [{
url: '/static/image/index/123123.png'
},
{
url: '/static/image/index/a1.png'
},
list: [
],
item: {
title: "这是一条动态",
createTime: '2024-08-22 09:00:00',
createBy: "小飞",
content: '这是一条动态这是一条动态这是一条动态这是一条动态这是一条动态这是一条动态这是一条动态这是一条动态这是一条动态这是一条动态这是一条动态',
},
item: {},
}
},
mounted() {
console.log("===")
this.getData(options.id)
},
onLoad(options) {
// this.$route.query
console.log(options)
this.getData(options.id)
},
methods: {
getData(id){
getData(id) {
this.$api('indexGetTrendsDetail', {
id
}, res => {
if(res.code == 200){
if (res.code == 200) {
this.item = res.result
}
})
@ -85,6 +76,7 @@
.postDetail {
.box {
padding: 20rpx;
width: 100vw;
.title {
font-size: 30rpx;


Loading…
Cancel
Save