Browse Source

上传代码

master
前端-胡立永 10 months ago
parent
commit
c3ee2bfc63
17 changed files with 259 additions and 82 deletions
  1. +1
    -1
      App.vue
  2. +49
    -1
      api/api.js
  3. +3
    -4
      components/config/configPopup.vue
  4. +61
    -7
      components/content/contentControls.vue
  5. +5
    -3
      components/post/actorList.vue
  6. +1
    -1
      components/post/postList.vue
  7. +12
    -5
      pages/index/index.vue
  8. +13
    -4
      pages/publish/actorDetail.vue
  9. +2
    -2
      pages/publish/actorList.vue
  10. +6
    -6
      pages/publish/actorRelease.vue
  11. +5
    -7
      pages/publish/postDetail.vue
  12. +22
    -11
      pages/publish/postList.vue
  13. +30
    -3
      pages/publish/publishPost.vue
  14. +10
    -12
      pages_mine/publish/addWorks.vue
  15. +17
    -3
      pages_mine/publish/competition.vue
  16. +10
    -8
      pages_mine/publish/worksDetail.vue
  17. +12
    -4
      store/store.js

+ 1
- 1
App.vue View File

@ -3,7 +3,7 @@
onLaunch: function() {
},
onShow: function() {
// this.$store.commit('initConfig')
this.$store.commit('initConfig')
},
onHide: function() {
}


+ 49
- 1
api/api.js View File

@ -211,10 +211,49 @@ const config = {
auth: true,
showLoading : true,
},
// 踩type-作品0-演员1-动态2
infoDislike: {
url: '/api/info/dislike',
method: 'GET',
auth: true,
showLoading : true,
},
// 点赞type-作品0-演员1-动态2
infoLike: {
url: '/api/info/like',
method: 'GET',
auth: true,
showLoading : true,
},
// 举报type-作品0-演员1-动态2
infoReport: {
url: '/api/info/report',
method: 'GET',
auth: true,
showLoading : true,
},
// 发布作品
releaseWorks: {
url: '/api/info/releaseWorks',
method: 'POST',
auth: true,
showLoading : true,
},
//小程序-登录相关接口
// 获取隐私政策
getPrivacyPolicy: {
url: '/api/login/getPrivacyPolicy',
method: 'GET',
},
// 获取用户协议
getUserAgreement: {
url: '/api/login/getUserAgreement',
method: 'GET',
},
//绑定手机接口
loginBindPhone: {
url: '/api/login/bindPhone',
@ -253,6 +292,15 @@ const config = {
method: 'GET',
showLoading : true,
},
// 立即支付
payOrder: {
url: '/api/order/payOrder',
method: 'POST',
showLoading : true,
},
}
export function api(key, data, callback, loadingTitle) {


+ 3
- 4
components/config/configPopup.vue View File

@ -9,7 +9,7 @@
</template>
<script>
import { mapGetters } from 'vuex'
import { mapState } from 'vuex'
export default {
name: 'configPoup',
data() {
@ -18,14 +18,13 @@
}
},
onShow(){
console.log(this.getConfig);
},
methods: {
//
open(key){
console.log(key);
this.content = this.getConfig[key]
this.content = this.configList[key]
this.$refs.popup.open('bottom');
}
@ -33,7 +32,7 @@
},
computed : {
...mapGetters(['getConfig'])
...mapState(['configList'])
}
}
</script>


+ 61
- 7
components/content/contentControls.vue View File

@ -1,22 +1,22 @@
<template>
<view class="controls"
@click="$emit('bell')">
<view class="">
<view class="controls">
<view class="bell"
@click="bell">
<uv-icon size="35rpx" name="bell"></uv-icon>
举报
</view>
<view class=""
@click="$emit('thumb-up')">
@click="thumbUp">
<uv-icon size="35rpx" name="thumb-up"></uv-icon>
点赞
</view>
<view class=""
@click="$emit('share')">
@click="share">
<uv-icon size="35rpx" name="share"></uv-icon>
分享
</view>
<view class=""
@click="$emit('thumb-down')">
@click="thumbDown">
<uv-icon size="35rpx" name="thumb-down"></uv-icon>
</view>
@ -26,11 +26,65 @@
<script>
export default {
name:"contentControls",
props : {
type : {
default : 0
},
detail : {
default : {}
}
},
data() {
return {
};
}
},
methods : {
//
bell(){
this.$api('infoReport', {
type : this.type,
id : this.detail.id,
}, res => {
if(res.code == 200){
uni.showToast({
title: '举报成功'
})
}
})
},
//
thumbUp(){
this.$api('infoLike', {
type : this.type,
id : this.detail.id,
}, res => {
if(res.code == 200){
uni.showToast({
title: '点赞成功'
})
}
})
},
//
share(){
},
//
thumbDown(){
this.$api('infoDislike', {
type : this.type,
id : this.detail.id,
}, res => {
if(res.code == 200){
uni.showToast({
title: '踩成功'
})
}
})
},
},
}
</script>


+ 5
- 3
components/post/actorList.vue View File

@ -12,7 +12,8 @@
<view class="t">
{{ item.name }}
</view>
<view class="auth">
<view class="auth"
v-if="item.isState == 'Y'">
已认证
</view>
</view>
@ -24,13 +25,14 @@
发布人{{ item.createBy }}
</view> -->
<view class="">
{{ item.createTime }}
{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}
</view>
</view>
<view class="phone">
联系方式 <text>去查看</text>
</view>
<view class="price">
<view class="price"
v-if="item.money">
价格 <text>{{ item.money }}</text>
</view>
</view>


+ 1
- 1
components/post/postList.vue View File

@ -22,7 +22,7 @@
</view>
</view>
<view class="createTime">
{{ item.createTime }}
{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}
</view>
</view>
</view>


+ 12
- 5
pages/index/index.vue View File

@ -127,15 +127,21 @@
},
//
onReachBottom() {
console.log("======首页滑动到底部触发====")
if(this.queryParams.pageSize < this.total){
console.log("======首页滑动到底部触发====")
let total = this.queryParams.pageNo * this.queryParams.pageSize
if(total < this.total){
this.queryParams.pageSize += 10
this.indexGetTrendsPage()
this.indexGetTrendsPage(res => {
this.trends.push(...res.result.records)
})
}
},
onShow() {
this.getData()
this.indexGetTrendsPage()
this.queryParams.pageNo = 1
this.indexGetTrendsPage(res => {
this.trends = res.result.records
})
},
methods: {
getData(){
@ -150,10 +156,11 @@
}
})
},
indexGetTrendsPage(){
indexGetTrendsPage(fn){
this.$api('indexGetTrendsPage',
this.queryParams, res => {
if(res.code == 200){
// fn && fn(res)
this.trends = res.result.records
this.total = res.result.total
}


+ 13
- 4
pages/publish/actorDetail.vue View File

@ -24,7 +24,14 @@
近30天收益
</view>
<view class="phone">
联系方式<text>付费查看</text>
<view class=""
v-if="item.phonePay != 'Y'">
{{ item.phone }}
</view>
<view class=""
v-else>
联系方式<text>付费查看</text>
</view>
</view>
</view>
</view>
@ -34,13 +41,15 @@
发布人{{ item.userId }}
</view>
<view class="">
发布时间{{ item.createTime }}
发布时间{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}
</view>
</view>
<view class="controls">
<contentControls/>
<contentControls
:type="1"
:detail="item"/>
</view>
@ -96,7 +105,7 @@
id
}, res => {
if(res.code == 200){
this.item = res.result
this.item = res.result.details
}
})
},


+ 2
- 2
pages/publish/actorList.vue View File

@ -4,11 +4,11 @@
<navbar
leftClick
@leftClick="$utils.navigateBack"
title="认证演员"/>
title="演员"/>
<view class="title">
认证创作者
创作者
</view>
<view class="box">


+ 6
- 6
pages/publish/actorRelease.vue View File

@ -66,12 +66,12 @@
<uv-radio size="35rpx"
icon-size="35rpx"
label="本人发布"
labelSize="28rpx" name="1">
labelSize="28rpx" name="Y">
</uv-radio>
<uv-radio size="35rpx"
icon-size="35rpx"
label="经纪人发布"
labelSize="28rpx" name="0">
labelSize="28rpx" name="N">
</uv-radio>
</uv-radio-group>
</view>
@ -82,9 +82,9 @@
</view>
<view class="textarea">
<uv-radio-group v-model="form.phonePay">
<uv-radio size="35rpx" icon-size="35rpx" label="是" labelSize="28rpx" name="1">
<uv-radio size="35rpx" icon-size="35rpx" label="是" labelSize="28rpx" name="Y">
</uv-radio>
<uv-radio size="35rpx" icon-size="35rpx" label="否" labelSize="28rpx" name="0">
<uv-radio size="35rpx" icon-size="35rpx" label="否" labelSize="28rpx" name="N">
</uv-radio>
</uv-radio-group>
</view>
@ -186,8 +186,8 @@
money: '',
name : '',
phone : '',
isUser : '1',//
phonePay : '1',//
isUser : 'Y',//
phonePay : 'Y',//
photographerContent : '',//
},
fileList: [//


+ 5
- 7
pages/publish/postDetail.vue View File

@ -18,13 +18,15 @@
发布人{{ item.userId }}
</view>
<view class="">
发布时间{{ item.createTime }}
发布时间{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}
</view>
</view>
<view class="controls">
<contentControls />
<contentControls
:type="2"
:detail="item"/>
</view>
@ -49,10 +51,6 @@
item: {},
}
},
mounted() {
console.log("===")
this.getData(options.id)
},
onLoad(options) {
// this.$route.query
console.log(options)
@ -64,7 +62,7 @@
id
}, res => {
if (res.code == 200) {
this.item = res.result
this.item = res.result.details
}
})
},


+ 22
- 11
pages/publish/postList.vue View File

@ -17,8 +17,11 @@
size="40rpx"
name="search"></uv-icon>
</view>
<input type="text" placeholder="搜索相关..."/>
<view class="text">
<input type="text" placeholder="搜索相关..."
v-model="queryParams.title"
/>
<view class="text"
@click="indexGetTrendsPage">
搜索
</view>
</view>
@ -41,24 +44,32 @@
queryParams : {
pageNo : 1,
pageSize : 10,
}
title : '',
},
}
},
onShow() {
this.getData()
this.queryParams.pageNo = 1
this.indexGetTrendsPage(res => {
this.postList = res.result.records
})
},
onReachBottom(){
let allTotal = this.queryParams.pageNo * this.queryParams.pageSize
if(allTotal < this.total){
//
//
onReachBottom() {
let total = this.queryParams.pageNo * this.queryParams.pageSize
if(total < this.total){
this.queryParams.pageSize += 10
this.getData() //
this.indexGetTrendsPage(res => {
this.postList.push(...res.result.records)
})
}
},
methods: {
getData(){
this.$api('indexGetTrendsPage', this.queryParams, res => {
indexGetTrendsPage(fn){
this.$api('indexGetTrendsPage',
this.queryParams, res => {
if(res.code == 200){
// fn && fn(res)
this.postList = res.result.records
this.total = res.result.total
}


+ 30
- 3
pages/publish/publishPost.vue View File

@ -70,7 +70,7 @@
<confirmationPopup
ref="confirmationPopup"
title="提示"
@confirm="pay"
@confirm="paySuccess"
confirmText="确认支付">
<view class="confirmationPopup">
<image src="/static/image/publish/pay.png"
@ -162,7 +162,7 @@
}
})
},
pay(){
paySuccess(){
let data = {
...this.form,
@ -178,6 +178,33 @@
}
})
},
payOrder(){
let self = this
this.$api('payOrder', res => {
console.log();
if(res.code == 200){
uni.requestPayment({
provider: 'wxpay', //
timeStamp: res.result.timeStamp, //
nonceStr: res.result.nonceStr, //
package: res.result.packageValue,
signType: res.result.signType, //
paySign: res.result.paySign, //
success: function (res) {
console.log('支付成功',res);
self.paySuccess()
},
fail: function (err) {
console.log('支付失败',err);
uni.showToast({
icon:'none',
title:"支付失败"
})
}
});
}
})
},
submit(){
if(this.fileList.length == 0){
@ -199,7 +226,7 @@
this.$refs.confirmationPopup.open()
}else{
//
this.pay()
this.paySuccess()
}
},
preview(){},


+ 10
- 12
pages_mine/publish/addWorks.vue View File

@ -54,7 +54,7 @@
详情介绍
</view>
<view class="textarea">
<uv-textarea v-model="form.photographerContent" :maxlength="200" count placeholder="输入详情介绍"></uv-textarea>
<uv-textarea v-model="form.context" :maxlength="200" count placeholder="输入详情介绍"></uv-textarea>
</view>
</view>
<!-- <view class="form-item-content">
@ -146,7 +146,7 @@
return {
form: {
title : '',
photographerContent : '',//
context : '',//
},
fileList: [//
// {
@ -213,12 +213,11 @@
let data = {
...this.form,
isCard: 1,
isImage : this.fileList.map((item) => item.url).join(","),
vod : this.fileList.map((item) => item.url).join(","),
image : this.fileListImage.map((item) => item.url).join(","),
isTop : this.form.topId ? 'Y' : 'N',
}
this.$api('publishActor', data,
this.$api('releaseWorks', data,
res => {
if (res.code == 200) {
this.$refs.confirmationPopupUpload.open()
@ -236,16 +235,14 @@
if(this.fileList.length == 0){
return uni.showToast({
title: '请上传代表作',
title: '请上传作',
icon : 'none'
})
}
if (this.$utils.verificationAll(this.form, {
title: '请输入标题',
photographerContent: '请输入演员介绍',
phone: '请输入手机号',
money: '请输入价格',
context: '请输入介绍',
})) {
return
}
@ -260,9 +257,10 @@
},
confirm() {
// this.$refs.confirmationPopupUpload.close()
uni.navigateTo({
url: "/pages/index/index"
})
// uni.navigateTo({
// url: "/pages_mine/publish/competition"
// })
uni.navigateBack(-1)
},
}
}


+ 17
- 3
pages_mine/publish/competition.vue View File

@ -69,7 +69,7 @@
</view>
</view>
<view class="createTime">
发布时间{{ item.createTime }}
发布时间{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}
</view>
</view>
</view>
@ -78,9 +78,10 @@
<uv-icon
size="30rpx"
name="thumb-up"></uv-icon>
240
{{ item.num }}
</view>
<view :class="{btn : true, a : index == 3}">
<view :class="{btn : true, a : index == 3}"
@click.stop="thumbUp(item)">
投票
</view>
</view>
@ -121,6 +122,19 @@
}
},
methods: {
//
thumbUp(item){
this.$api('infoLike', {
type : 0,
id : item.id,
}, res => {
if(res.code == 200){
uni.showToast({
title: '点赞成功'
})
}
})
},
getList(){
this.$api('indexGetGetWorkPage', {
token : uni.getStorageSync('token'),


+ 10
- 8
pages_mine/publish/worksDetail.vue View File

@ -13,15 +13,15 @@
<view class="box">
<view class="topInfo">
<view class="title title1">
<!-- <view class="title title1">
当前排名<text>{{ item.money || 1 }}</text>
</view>
</view> -->
<view class="price">
<view class="">
{{ item.title }}
</view>
<view class="">
投票200
票数 {{ item.num }}
</view>
</view>
<!-- <view class="right">
@ -39,23 +39,25 @@
发布人{{ item.userId }}
</view>
<view class="">
发布时间{{ item.createTime }}
发布时间{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}
</view>
</view>
<view class="controls">
<contentControls/>
<contentControls
:type="0"
:detail="item"/>
</view>
<view class="content">
<uv-parse :content="item.photographerContent"></uv-parse>
<uv-parse :content="item.context"></uv-parse>
</view>
<view class="works">
<view class="item"
v-for="(t, index) in item.isImage && item.isImage.split(',')"
v-for="(t, index) in item.vod && item.vod.split(',')"
:key="index">
<view class="item-image">
<video :src="t" object-fit="fill"/>
@ -92,7 +94,7 @@
id
}, res => {
if(res.code == 200){
this.item = res.result
this.item = res.result.details
}
})
},


+ 12
- 4
store/store.js View File

@ -22,10 +22,18 @@ const store = new Vuex.Store({
mutations: {
// 初始化配置
initConfig(state){
api('getConfig', res => {
if(res.code == 200){
state.configList = res.result
}
// api('getConfig', res => {
// if(res.code == 200){
// state.configList = res.result
// }
// })
let config = ['getPrivacyPolicy', 'getUserAgreement']
config.forEach(k => {
api(k, res => {
if (res.code == 200) {
state.configList[k] = res.result
}
})
})
},
login(state){


Loading…
Cancel
Save