Browse Source

上传代码

master
前端-胡立永 10 months ago
parent
commit
0f2090552e
11 changed files with 134 additions and 43 deletions
  1. +1
    -0
      App.vue
  2. +10
    -0
      api/api.js
  3. +24
    -1
      components/base/tabbar.vue
  4. +21
    -9
      pages/index/index.vue
  5. +22
    -9
      pages/publish/actorDetail.vue
  6. +6
    -4
      pages/publish/actorRelease.vue
  7. +6
    -3
      pages/publish/publishPost.vue
  8. +6
    -4
      pages_mine/publish/addWorks.vue
  9. +6
    -2
      pages_mine/publish/competition.vue
  10. +13
    -4
      pages_mine/publish/worksDetail.vue
  11. +19
    -7
      store/store.js

+ 1
- 0
App.vue View File

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


+ 10
- 0
api/api.js View File

@ -259,11 +259,21 @@ const config = {
//小程序-登录相关接口 //小程序-登录相关接口
// 获取是否可播放视频接口
getIsVedio: {
url: '/api/login/getIsVedio',
method: 'GET',
},
// 获取隐私政策 // 获取隐私政策
getPrivacyPolicy: { getPrivacyPolicy: {
url: '/api/login/getPrivacyPolicy', url: '/api/login/getPrivacyPolicy',
method: 'GET', method: 'GET',
}, },
// 获取配置
getConfig: {
url: '/api/login/getConfig',
method: 'GET',
},
// 获取发布帖子发布需知 // 获取发布帖子发布需知
getPublishPostNotice: { getPublishPostNotice: {
url: '/api/login/getPublishPostNotice', url: '/api/login/getPublishPostNotice',


+ 24
- 1
components/base/tabbar.vue View File

@ -4,6 +4,7 @@
:class="{item : true, active : select == index}" :class="{item : true, active : select == index}"
v-for="(item, index) in list" v-for="(item, index) in list"
:key="index" :key="index"
v-if="isVedio || index != 1"
@click="toPath(item, index)"> @click="toPath(item, index)">
<view class="icon"> <view class="icon">
<image :src="select == index ? <image :src="select == index ?
@ -18,9 +19,14 @@
</template> </template>
<script> <script>
import { mapGetters, mapState } from 'vuex'
export default { export default {
name:"tabbar", name:"tabbar",
props : ['select'], props : ['select'],
computed : {
...mapGetters(['isVedio']),
...mapState(['configList']),
},
data() { data() {
return { return {
list : [ list : [
@ -40,9 +46,26 @@
"pagePath": "/pages/index/center", "pagePath": "/pages/index/center",
"title": "我的", "title": "我的",
} }
]
],
inter : null,
}; };
}, },
mounted() {
this.inter = setInterval(() => {
console.log('$forceUpdate', this.isVedio);
this.$forceUpdate()
}, 500)
setTimeout(() => {
clearInterval(this.inter)
this.inter = null
}, 20000)
},
beforeDestroy() {
if(this.inter){
clearInterval(this.inter)
}
},
methods : { methods : {
toPath(item, index){ toPath(item, index){
if(index == this.select){ if(index == this.select){


+ 21
- 9
pages/index/index.vue View File

@ -55,14 +55,16 @@
<swiper class="swiper-box" <swiper class="swiper-box"
:autoplay="true" :autoplay="true"
style="height: 360rpx;"
:duration="500"> :duration="500">
<swiper-item v-for="(item, index) in actorList" <swiper-item v-for="(item, index) in actorList"
style="background-color: #fff;"
style="background-color: #fff;height: 360rpx;"
@click="toActor(item)"
:key="index"> :key="index">
<view class="swiper-item"> <view class="swiper-item">
<image <image
class="logo" class="logo"
:src="item.logo"
:src="item.image"
mode="aspectFill" /> mode="aspectFill" />
<view class="swiper-item-content"> <view class="swiper-item-content">
<view class="left"> <view class="left">
@ -135,8 +137,6 @@
total : 0, total : 0,
} }
}, },
computed : {
},
// //
onReachBottom() { onReachBottom() {
console.log("======首页滑动到底部触发====") console.log("======首页滑动到底部触发====")
@ -213,7 +213,12 @@
item.masterpieceId item.masterpieceId
}) })
} }
}
},
toActor(item){
uni.navigateTo({
url: '/pages/publish/actorDetail?id=' + item.id
})
},
} }
} }
</script> </script>
@ -293,14 +298,22 @@
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
position: relative;
image{ image{
width: 100%; width: 100%;
height: 180rpx;
height: 360rpx;
} }
.swiper-item-content{ .swiper-item-content{
margin-top: 15rpx;
position: absolute;
bottom: 0;
left: 0;
z-index: 99;
display: flex; display: flex;
width: 80%;
background-color: #00000055;
color: #fff;
padding: 20rpx;
width: 100%;
box-sizing: border-box;
.left{ .left{
.title{ .title{
font-weight: 900; font-weight: 900;
@ -308,7 +321,6 @@
} }
.info-from{ .info-from{
font-size: 26rpx; font-size: 26rpx;
color: #777;
display: flex; display: flex;
} }
} }


+ 22
- 9
pages/publish/actorDetail.vue View File

@ -3,15 +3,14 @@
<navbar leftClick @leftClick="leftClick" /> <navbar leftClick @leftClick="leftClick" />
<view class="swipe"> <view class="swipe">
<!-- <uv-swiper
:list="item.details.image &&
item.details.image.split(',')"
<uv-swiper
:list="vedioList"
indicator indicator
height="420rpx"></uv-swiper> -->
height="420rpx"></uv-swiper>
<video :src="item.details.isImage[0]"
<!-- <video :src="item.details.isImage[0]"
style="width: 750rpx;height: 420rpx;" style="width: 750rpx;height: 420rpx;"
/>
/> -->
</view> </view>
<view class="box"> <view class="box">
@ -21,13 +20,13 @@
{{ item.details.name }} {{ item.details.name }}
</view> </view>
<view class="price"> <view class="price">
{{ item.details.money }}
{{ item.details.money }}/
</view> </view>
<view class="right"> <view class="right">
<view class="money30"> <view class="money30">
近30天收益{{ item.dayMoney }} 近30天收益{{ item.dayMoney }}
</view> </view>
<view class="phone">
<view class="phone" v-if="isVedio">
<view class="" <view class=""
v-if="item.details.phonePay != 'Y' || item.isPayPhone"> v-if="item.details.phonePay != 'Y' || item.isPayPhone">
联系方式{{ item.details.phone }} 联系方式{{ item.details.phone }}
@ -63,7 +62,8 @@
:detail="item.details"/> :detail="item.details"/>
</view> </view>
<view class="works">
<view class="works"
v-if="isVedio">
<view class="item" <view class="item"
v-for="(t, index) in item.details.isImage" v-for="(t, index) in item.details.isImage"
:key="index"> :key="index">
@ -98,6 +98,7 @@
<script> <script>
import contentControls from '@/components/content/contentControls.vue' import contentControls from '@/components/content/contentControls.vue'
import confirmationPopup from '@/components/toast/confirmationPopup.vue' import confirmationPopup from '@/components/toast/confirmationPopup.vue'
import { mapGetters } from 'vuex'
export default { export default {
components : { components : {
contentControls, contentControls,
@ -122,6 +123,14 @@
console.log(options) console.log(options)
this.id = options.id this.id = options.id
}, },
computed : {
...mapGetters(['isVedio']),
vedioList(){
return this.isVedio ?
this.item.details.isImage :
this.item.details.image
},
},
onShareAppMessage(res) { onShareAppMessage(res) {
return { return {
title: this.item.details.title, title: this.item.details.title,
@ -158,6 +167,10 @@
res.result.details.workName ? res.result.details.workName ?
res.result.details.workName.split(',') : [] res.result.details.workName.split(',') : []
res.result.details.image =
res.result.details.image ?
res.result.details.image.split(',') : []
this.item = res.result this.item = res.result
} }
}) })


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

@ -103,7 +103,7 @@
</view> </view>
</view> --> </view> -->
<view class="upTop">
<view class="upTop" v-if="isVedio">
<view class="title"> <view class="title">
<uv-icon name="pushpin-fill"></uv-icon> <uv-icon name="pushpin-fill"></uv-icon>
是否置顶 是否置顶
@ -145,7 +145,7 @@
</uv-radio-group> </uv-radio-group>
</view> </view>
<view class="form-item-content">
<view class="form-item-content" v-if="isVedio">
<view class="label"> <view class="label">
代表作 代表作
</view> </view>
@ -199,6 +199,7 @@
<script> <script>
import submit from '@/components/content/submit.vue' import submit from '@/components/content/submit.vue'
import confirmationPopup from '@/components/toast/confirmationPopup.vue' import confirmationPopup from '@/components/toast/confirmationPopup.vue'
import { mapGetters } from 'vuex'
import { import {
mapState mapState
} from 'vuex' } from 'vuex'
@ -242,7 +243,8 @@
} }
} }
return {} return {}
}
},
...mapGetters(['isVedio']),
}, },
onShow() { onShow() {
this.indexTopPayList() this.indexTopPayList()
@ -415,7 +417,7 @@
return return
} }
if(this.fileList.length == 0){
if(this.fileList.length == 0 && this.isVedio){
return uni.showToast({ return uni.showToast({
title: '请上传代表作', title: '请上传代表作',
icon : 'none' icon : 'none'


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

@ -8,7 +8,7 @@
<view class="images box"> <view class="images box">
<uv-upload <uv-upload
:fileList="fileList" :fileList="fileList"
:maxCount="5"
:maxCount="4"
multiple multiple
width="150rpx" width="150rpx"
height="150rpx" height="150rpx"
@ -30,7 +30,8 @@
placeholder="添加正文"></uv-textarea> placeholder="添加正文"></uv-textarea>
</view> </view>
<view class="upTop">
<view class="upTop"
v-if="isVedio">
<view class="title"> <view class="title">
<uv-icon name="pushpin-fill"></uv-icon> <uv-icon name="pushpin-fill"></uv-icon>
是否置顶 是否置顶
@ -123,6 +124,7 @@
<script> <script>
import submit from '@/components/content/submit.vue' import submit from '@/components/content/submit.vue'
import confirmationPopup from '@/components/toast/confirmationPopup.vue' import confirmationPopup from '@/components/toast/confirmationPopup.vue'
import { mapGetters } from 'vuex'
export default { export default {
components : { components : {
submit, submit,
@ -153,7 +155,8 @@
} }
} }
return {} return {}
}
},
...mapGetters(['isVedio']),
}, },
onLoad(args) { onLoad(args) {
this.id = args.id this.id = args.id


+ 6
- 4
pages_mine/publish/addWorks.vue View File

@ -90,12 +90,12 @@
</view> </view>
</view> --> </view> -->
<view class="form-item-content">
<view class="form-item-content" v-if="isVedio">
<view class="label"> <view class="label">
作品 作品
</view> </view>
<view class="upload"> <view class="upload">
<uv-upload :fileList="fileList" :maxCount="5" multiple accept="video" width="150rpx" height="150rpx"
<uv-upload :fileList="fileList" :maxCount="4" multiple accept="video" width="150rpx" height="150rpx"
@delete="deleteImage" @afterRead="afterRead" :previewFullImage="true"></uv-upload> @delete="deleteImage" @afterRead="afterRead" :previewFullImage="true"></uv-upload>
</view> </view>
</view> </view>
@ -134,6 +134,7 @@
<script> <script>
import submit from '@/components/content/submit.vue' import submit from '@/components/content/submit.vue'
import confirmationPopup from '@/components/toast/confirmationPopup.vue' import confirmationPopup from '@/components/toast/confirmationPopup.vue'
import { mapGetters } from 'vuex'
import { import {
mapState mapState
} from 'vuex' } from 'vuex'
@ -167,7 +168,8 @@
} }
} }
return {} return {}
}
},
...mapGetters(['isVedio']),
}, },
onLoad(options) { onLoad(options) {
// this.$route.query // this.$route.query
@ -278,7 +280,7 @@
}) })
} }
if(this.fileList.length == 0){
if(this.fileList.length == 0 && this.isVedio){
return uni.showToast({ return uni.showToast({
title: '请上传作品', title: '请上传作品',
icon : 'none' icon : 'none'


+ 6
- 2
pages_mine/publish/competition.vue View File

@ -47,7 +47,7 @@
<view class="item" <view class="item"
v-for="(item, index) in list" v-for="(item, index) in list"
@click="$utils.navigateTo('/pages_mine/publish/worksDetail?id=' + item.id)"
@click="toUrl(item)"
:key="index"> :key="index">
<view class="ranking"> <view class="ranking">
{{ index + 1 }} {{ index + 1 }}
@ -164,7 +164,11 @@
this.total = res.result.total this.total = res.result.total
} }
}) })
}
},
toUrl(item){
this.$utils.navigateTo
('/pages_mine/publish/worksDetail?id=' + item.id)
},
} }
} }
</script> </script>


+ 13
- 4
pages_mine/publish/worksDetail.vue View File

@ -4,8 +4,7 @@
<view class="swipe"> <view class="swipe">
<uv-swiper <uv-swiper
:list="item.image &&
item.image.split(',')"
:list="vedioList"
indicator indicator
height="420rpx"></uv-swiper> height="420rpx"></uv-swiper>
</view> </view>
@ -58,7 +57,8 @@
<uv-parse :content="item.context"></uv-parse> <uv-parse :content="item.context"></uv-parse>
</view> </view>
<view class="works">
<view class="works"
v-if="isVedio">
<view class="item" <view class="item"
v-for="(t, index) in item.vod && item.vod.split(',')" v-for="(t, index) in item.vod && item.vod.split(',')"
:key="index"> :key="index">
@ -74,6 +74,7 @@
<script> <script>
import contentControls from '@/components/content/contentControls.vue' import contentControls from '@/components/content/contentControls.vue'
import { mapGetters } from 'vuex'
export default { export default {
components : { components : {
contentControls contentControls
@ -86,6 +87,14 @@
id : 0, id : 0,
} }
}, },
computed : {
...mapGetters(['isVedio']),
vedioList(){
return this.isVedio ?
this.item.vod && this.item.vod.split(',') :
this.item.image && this.item.image.split(',')
},
},
onLoad(options) { onLoad(options) {
// this.$route.query // this.$route.query
console.log(options) console.log(options)
@ -110,7 +119,7 @@
}, },
getData(id){ getData(id){
this.$api('indexGetGetWorkDetail', { this.$api('indexGetGetWorkDetail', {
id
id : this.id
}, res => { }, res => {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
if(res.code == 200){ if(res.code == 200){


+ 19
- 7
store/store.js View File

@ -17,17 +17,24 @@ const store = new Vuex.Store({
card: '', card: '',
name: '', name: '',
}, },
// cartInfo : {},
}, },
getters: {},
getters: {
// 通过报错的方式阻止缓存,这里的报错千万不要修复
isVedio(state){
return state.configList.open.content == 'Y'
},
},
mutations: { mutations: {
// 初始化配置 // 初始化配置
initConfig(state){ initConfig(state){
// api('getConfig', res => {
// if(res.code == 200){
// state.configList = res.result
// }
// })
api('getConfig', res => {
if(res.code == 200){
// state.configList = res.result
res.result.forEach(n => {
state.configList[n.keyValue] = n
})
}
})
let config = ['getPrivacyPolicy', 'getUserAgreement', 'getPublishPostNotice'] let config = ['getPrivacyPolicy', 'getUserAgreement', 'getPublishPostNotice']
config.forEach(k => { config.forEach(k => {
api(k, res => { api(k, res => {
@ -37,6 +44,11 @@ const store = new Vuex.Store({
}) })
}) })
}, },
getIsVedio(state){
api('getIsVedio', res => {
state.configList.isVedio = res.result
})
},
login(state){ login(state){
uni.showLoading({ uni.showLoading({
title: '登录中...' title: '登录中...'


Loading…
Cancel
Save