diff --git a/App.vue b/App.vue index 045a58a..a351c3f 100644 --- a/App.vue +++ b/App.vue @@ -15,6 +15,7 @@ padding: 0; margin: 0; box-sizing: border-box; + font-size: 30rpx; } /*每个页面公共css */ body{ diff --git a/components/content/contentControls.vue b/components/content/contentControls.vue index 495c15b..6d5f383 100644 --- a/components/content/contentControls.vue +++ b/components/content/contentControls.vue @@ -7,7 +7,11 @@ - + + 点赞 - + + @@ -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 }) } diff --git a/config.js b/config.js index 9a6313c..0c3a700 100644 --- a/config.js +++ b/config.js @@ -5,7 +5,7 @@ import utils from './utils/utils.js' // 当前环境 -const type = 'prod' +const type = 'dev' // 环境配置 diff --git a/pages/index/index.vue b/pages/index/index.vue index dc8d709..b7c3d60 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -47,7 +47,10 @@ - + {{ item.userId }} - {{ item.createTime }} + {{ $dayjs(item.createTime).format('YYYY-MM-DD') }} diff --git a/pages/publish/actorDetail.vue b/pages/publish/actorDetail.vue index 79279cf..3e553d9 100644 --- a/pages/publish/actorDetail.vue +++ b/pages/publish/actorDetail.vue @@ -4,29 +4,29 @@ + height="auto"> - {{ item.name }} + {{ item.details.name }} - ¥{{ item.money }} + ¥{{ item.details.money }} - 近30天收益 + 近30天收益:¥{{ item.dayMoney }} - {{ item.phone }} + v-if="item.details.phonePay != 'Y'"> + {{ item.details.phone }} @@ -38,10 +38,10 @@ - 发布人:{{ item.userId }} + 发布人:{{ item.details.userId }} - 发布时间:{{ $dayjs(item.createTime).format('YYYY-MM-DD') }} + 发布时间:{{ $dayjs(item.details.createTime).format('YYYY-MM-DD') }} @@ -49,17 +49,20 @@ + :up="item.isThumbs_up" + :down="item.isThumbs_down" + @loadData="getData" + :detail="item.details"/> - + - - + + 搜索 @@ -41,7 +43,8 @@ total : 0, queryParams: { pageNo: 1, - pageSize: 10 + pageSize: 10, + title : '', }, } }, diff --git a/pages/publish/actorRelease.vue b/pages/publish/actorRelease.vue index 8078796..d6a2062 100644 --- a/pages/publish/actorRelease.vue +++ b/pages/publish/actorRelease.vue @@ -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() { diff --git a/pages/publish/postDetail.vue b/pages/publish/postDetail.vue index 544b0c6..92fda0e 100644 --- a/pages/publish/postDetail.vue +++ b/pages/publish/postDetail.vue @@ -4,7 +4,7 @@ + item.image.split(',')" indicator height="820rpx"> @@ -26,6 +26,9 @@ @@ -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//是否踩 } }) }, diff --git a/pages/publish/publishPost.vue b/pages/publish/publishPost.vue index 6d1de40..a9dd6c6 100644 --- a/pages/publish/publishPost.vue +++ b/pages/publish/publishPost.vue @@ -37,6 +37,20 @@ + + + + 不需要置顶 + + + + + + + @@ -70,7 +84,7 @@ { - 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){ diff --git a/pages_mine/publish/competition.vue b/pages_mine/publish/competition.vue index e8067a1..3bb0707 100644 --- a/pages_mine/publish/competition.vue +++ b/pages_mine/publish/competition.vue @@ -80,7 +80,7 @@ name="thumb-up"> {{ item.num }} - 投票 @@ -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 } }) diff --git a/pages_mine/publish/worksDetail.vue b/pages_mine/publish/worksDetail.vue index 67bc4e7..0dc5013 100644 --- a/pages_mine/publish/worksDetail.vue +++ b/pages_mine/publish/worksDetail.vue @@ -47,6 +47,9 @@ @@ -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//是否点赞 } }) }, diff --git a/utils/utils.js b/utils/utils.js index 5e2d81e..d7697e6 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -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 } \ No newline at end of file