Browse Source

上传代码

master
前端-胡立永 10 months ago
parent
commit
ba0d2e7e9f
12 changed files with 232 additions and 74 deletions
  1. +1
    -0
      App.vue
  2. +29
    -5
      components/content/contentControls.vue
  3. +1
    -1
      config.js
  4. +5
    -2
      pages/index/index.vue
  5. +28
    -18
      pages/publish/actorDetail.vue
  6. +6
    -3
      pages/publish/actorList.vue
  7. +31
    -4
      pages/publish/actorRelease.vue
  8. +15
    -4
      pages/publish/postDetail.vue
  9. +84
    -24
      pages/publish/publishPost.vue
  10. +14
    -9
      pages_mine/publish/competition.vue
  11. +11
    -1
      pages_mine/publish/worksDetail.vue
  12. +7
    -3
      utils/utils.js

+ 1
- 0
App.vue View File

@ -15,6 +15,7 @@
padding: 0;
margin: 0;
box-sizing: border-box;
font-size: 30rpx;
}
/*每个页面公共css */
body{


+ 29
- 5
components/content/contentControls.vue View File

@ -7,7 +7,11 @@
</view>
<view class=""
@click="thumbUp">
<uv-icon size="35rpx" name="thumb-up"></uv-icon>
<uv-icon size="35rpx"
color="#f40"
name="thumb-up"
v-if="up"></uv-icon>
<uv-icon v-else size="35rpx" name="thumb-up"></uv-icon>
点赞
</view>
<view class=""
@ -16,8 +20,15 @@
分享
</view>
<view class=""
v-if="!isWork"
@click="thumbDown">
<uv-icon size="35rpx" name="thumb-down"></uv-icon>
<uv-icon
v-if="down"
color="#f40"
size="35rpx" name="thumb-down"></uv-icon>
<uv-icon
v-else
size="35rpx" name="thumb-down"></uv-icon>
</view>
</view>
@ -32,6 +43,16 @@
},
detail : {
default : {}
},
up : {
default : false,
},
down : {
default : false,
},
isWork : {
default : false,
}
},
data() {
@ -47,8 +68,9 @@
id : this.detail.id,
}, res => {
if(res.code == 200){
this.$emit('loadData')
uni.showToast({
title: '举报成功'
title: res.message
})
}
})
@ -60,8 +82,9 @@
id : this.detail.id,
}, res => {
if(res.code == 200){
this.$emit('loadData')
uni.showToast({
title: '点赞成功'
title: res.message
})
}
})
@ -77,8 +100,9 @@
id : this.detail.id,
}, res => {
if(res.code == 200){
this.$emit('loadData')
uni.showToast({
title: '踩成功'
title: res.message
})
}


+ 1
- 1
config.js View File

@ -5,7 +5,7 @@ import utils from './utils/utils.js'
// 当前环境
const type = 'prod'
const type = 'dev'
// 环境配置


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

@ -47,7 +47,10 @@
<swiper class="swiper-box"
:autoplay="true"
:duration="500">
<swiper-item v-for="(item, index) in actorList" :key="index">
<swiper-item v-for="(item, index) in actorList"
style="background-color: #fff;border-radius: 20rpx;
padding: 20rpx;"
:key="index">
<view class="swiper-item">
<image
class="logo"
@ -60,7 +63,7 @@
</view>
<view class="info-from">
<text>{{ item.userId }}</text>
<text style="margin-left: 30rpx;">{{ item.createTime }}</text>
<text style="margin-left: 30rpx;">{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}</text>
</view>
</view>
<view class="right">


+ 28
- 18
pages/publish/actorDetail.vue View File

@ -4,29 +4,29 @@
<view class="swipe">
<uv-swiper
:list="item.image &&
item.image.split(',')"
:list="item.details.image &&
item.details.image.split(',')"
indicator
height="320rpx"></uv-swiper>
height="auto"></uv-swiper>
</view>
<view class="box">
<view class="topInfo">
<view class="title">
{{ item.name }}
{{ item.details.name }}
</view>
<view class="price">
{{ item.money }}
{{ item.details.money }}
</view>
<view class="right">
<view class="money30">
近30天收益
近30天收益{{ item.dayMoney }}
</view>
<view class="phone">
<view class=""
v-if="item.phonePay != 'Y'">
{{ item.phone }}
v-if="item.details.phonePay != 'Y'">
{{ item.details.phone }}
</view>
<view class=""
v-else>
@ -38,10 +38,10 @@
<view class="createBy">
<view class="">
发布人{{ item.userId }}
发布人{{ item.details.userId }}
</view>
<view class="">
发布时间{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}
发布时间{{ $dayjs(item.details.createTime).format('YYYY-MM-DD') }}
</view>
</view>
@ -49,17 +49,20 @@
<view class="controls">
<contentControls
:type="1"
:detail="item"/>
:up="item.isThumbs_up"
:down="item.isThumbs_down"
@loadData="getData"
:detail="item.details"/>
</view>
<view class="content">
<uv-parse :content="item.photographerContent"></uv-parse>
<uv-parse :content="item.details.photographerContent"></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.details.isImage && item.details.isImage.split(',')"
:key="index">
<view class="item-image">
<video :src="t" object-fit="fill"/>
@ -79,18 +82,25 @@
},
data() {
return {
item: {},
item: {
details : {}
},
list : [],
queryParams: {
pageNo: 1,
pageSize: 10
},
total : 0,
id : 0,
}
},
onLoad(options) {
// this.$route.query
this.getData(options.id)
console.log(options)
this.id = options.id
},
onShow() {
this.getData()
},
//
onReachBottom() {
@ -100,12 +110,12 @@
leftClick(){
uni.navigateBack(-1)
},
getData(id){
getData(){
this.$api('indexGetActorDetail', {
id
id : this.id
}, res => {
if(res.code == 200){
this.item = res.result.details
this.item = res.result
}
})
},


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

@ -18,8 +18,10 @@
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="getData">
搜索
</view>
</view>
@ -41,7 +43,8 @@
total : 0,
queryParams: {
pageNo: 1,
pageSize: 10
pageSize: 10,
title : '',
},
}
},


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

@ -251,6 +251,8 @@
})
},
pay() {
let self = this
let data = {
...this.form,
@ -261,11 +263,36 @@
}
this.$api('publishActor', data,
res => {
if (res.code == 200) {
this.$refs.confirmationPopupUpload.open()
res => {
if (res.code == 200) {
// this.$refs.confirmationPopupUpload.open()
if(self.form.topId){
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.$refs.confirmationPopupUpload.open()
// self.$refs.confirmationPopup.close()
},
fail: function (err) {
console.log('支付失败',err);
self.$refs.confirmationPopup.close()
uni.showToast({
icon:'none',
title:"支付失败"
})
}
});
}else{
self.$refs.confirmationPopupUpload.open()
}
})
}
})
},
submit() {


+ 15
- 4
pages/publish/postDetail.vue View File

@ -4,7 +4,7 @@
<view class="swipe">
<uv-swiper :list="item.image &&
item.image.split(',')" indicator height="320rpx"></uv-swiper>
item.image.split(',')" indicator height="820rpx"></uv-swiper>
</view>
<view class="box">
@ -26,6 +26,9 @@
<view class="controls">
<contentControls
:type="2"
:up="isThumbs_up"
:down="isThumbs_down"
@loadData="getData"
:detail="item"/>
</view>
@ -49,20 +52,28 @@
list: [
],
item: {},
isThumbs_up: {},//
isThumbs_down: {},//
id : 0,
}
},
onLoad(options) {
// this.$route.query
console.log(options)
this.getData(options.id)
this.id = options.id
},
onShow() {
this.getData()
},
methods: {
getData(id) {
getData() {
this.$api('indexGetTrendsDetail', {
id
id : this.id
}, res => {
if (res.code == 200) {
this.item = res.result.details
this.isThumbs_up = res.result.isThumbs_up//
this.isThumbs_down = res.result.isThumbs_down//
}
})
},


+ 84
- 24
pages/publish/publishPost.vue View File

@ -37,6 +37,20 @@
</view>
<uv-radio-group v-model="form.topId">
<view class="list">
<view class="item">
<view class="left">
不需要置顶
</view>
<view class="right">
<uv-radio
size="35rpx"
icon-size="35rpx"
:name="0">
</uv-radio>
</view>
</view>
<view class="item"
v-for="(item, index) in upTopList"
:key="index">
@ -70,7 +84,7 @@
<confirmationPopup
ref="confirmationPopup"
title="提示"
@confirm="paySuccess"
@confirm="payOrder"
confirmText="确认支付">
<view class="confirmationPopup">
<image src="/static/image/publish/pay.png"
@ -85,7 +99,7 @@
<confirmationPopup
ref="confirmationPopupUpload"
title="提示"
@confirm="$utils.navigateTo('/index/index')"
@confirm="$utils.redirectTo('/index/index')"
confirmText="确认">
<view class="confirmationPopup">
<image src="/static/image/publish/upload.png"
@ -118,7 +132,7 @@
form : {
// image : [],
content : '',
// topId : '',
topId : 0,
title : '',
},
fileList: [
@ -162,6 +176,8 @@
}
})
},
//
paySuccess(){
let data = {
@ -178,33 +194,77 @@
}
})
},
//
payOrder(){
let self = this
this.$api('payOrder', res => {
console.log();
let data = {
...this.form,
isCard : 1,
image : this.fileList.map((item) => item.url).join(","),
isTop : this.form.topId ? 'Y' : 'N',
}
this.$api('infoReleaseTrends', data,
res => {
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:"支付失败"
})
}
});
if(self.form.topId){
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.$refs.confirmationPopupUpload.open()
// self.$refs.confirmationPopup.close()
},
fail: function (err) {
console.log('支付失败',err);
self.$refs.confirmationPopup.close()
uni.showToast({
icon:'none',
title:"支付失败"
})
}
});
}else{
self.$refs.confirmationPopupUpload.open()
}
}
})
// 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){


+ 14
- 9
pages_mine/publish/competition.vue View File

@ -80,7 +80,7 @@
name="thumb-up"></uv-icon>
{{ item.num }}
</view>
<view :class="{btn : true, a : index == 3}"
<view :class="{btn : true, a : item.thumbsUp}"
@click.stop="thumbUp(item)">
投票
</view>
@ -112,13 +112,18 @@
},
onLoad() {
// this.$route.query
this.getList()
this.getList(res => {
this.list = res.result.records
})
},
//
onReachBottom() {
if(this.queryParams.pageSize < this.total){
this.queryParams.pageSize += 10
this.getList()
let total = this.queryParams.pageNo * this.queryParams.pageSize
if(total < this.total){
this.queryParams.pageNo += 1
this.getList(res => {
this.list.push(...res.result.records)
})
}
},
methods: {
@ -130,18 +135,18 @@
}, res => {
if(res.code == 200){
uni.showToast({
title: '点赞成功'
title: res.message
})
item.thumbsUp = !item.thumbsUp
}
})
},
getList(){
getList(fn){
this.$api('indexGetGetWorkPage', {
token : uni.getStorageSync('token'),
...this.queryParams
}, res => {
if(res.code == 200){
this.list = res.result.records
fn && fn(res)
this.total = res.result.total
}
})


+ 11
- 1
pages_mine/publish/worksDetail.vue View File

@ -47,6 +47,9 @@
<view class="controls">
<contentControls
:type="0"
isWork
:up="isThumbs_up"
@loadData="getData"
:detail="item"/>
</view>
@ -79,11 +82,17 @@
return {
item: {},
total : 0,
isThumbs_up: {},//
id : 0,
}
},
onLoad(options) {
// this.$route.query
this.getData(options.id)
console.log(options)
this.id = options.id
},
onShow() {
this.getData()
},
methods: {
leftClick(){
@ -95,6 +104,7 @@
}, res => {
if(res.code == 200){
this.item = res.result.details
this.isThumbs_up = res.result.isThumbs_up//
}
})
},


+ 7
- 3
utils/utils.js View File

@ -55,9 +55,9 @@ function verificationAll(data, msg){
return true
}
for (let key in data) {
if (!data[key] || data[key] === "") {
if (!data[key] && Msgs[key]) {
uni.showToast({
title: (Msgs[key] || Msgs.default),
title: Msgs[key],
icon: "none"
})
return true
@ -129,6 +129,9 @@ function params(url){
export function navigateTo(...args){
uni.navigateTo(params(...args))
}
export function redirectTo(...args){
uni.redirectTo(params(...args))
}
export function navigateBack(num = -1){
uni.navigateBack(num)
@ -144,5 +147,6 @@ export default {
getHrefParams,
deepMergeObject,
navigateTo,
navigateBack
navigateBack,
redirectTo
}

Loading…
Cancel
Save