Browse Source

feature:1.0:提交

feature-1.0
Penny 3 years ago
parent
commit
31efd584fa
  1. 34
      api/index.js
  2. 4
      pages-userInfo/contact/contact.vue
  3. 241
      pages-userInfo/extends/extends.vue
  4. 81
      pages-userInfo/inviteLog/inviteLog.vue
  5. 4
      pages-userInfo/notice/notice.vue
  6. 2
      pages-userInfo/notice/noticeDetail.vue
  7. 22
      pages-userInfo/withdraw/withdraw.vue
  8. 16
      pages-userInfo/withdraw/withdrawDetail.vue
  9. 35
      pages.json
  10. 24
      pages/index/index.vue
  11. 695
      pages/index/material/imgDetail.vue
  12. 96
      pages/index/material/material.vue
  13. 293
      pages/index/upload/upload.vue
  14. 156
      pages/profit/profit.vue

34
api/index.js

@ -117,4 +117,38 @@ export function getYs(data) {
})
}
// 获取艺术家当日上传次数
export function queryUploadNum(data) {
return request({
url: `${serviceTitle}${prefix}/getUploadNum`,
method: 'post',
data
})
}
// 查询图片详情
export function getImgDetails(imgId) {
return request({
url: `${serviceTitle}${prefix}/detailsTiktokImg/${imgId}`,
method: 'get'
})
}
// 置顶图片
export function topImg(id) {
return request({
url: `${serviceTitle}${prefix}/topImg/${id}`,
method: 'get'
})
}
// 修改艺术家图片标签
export function modifySign(data) {
return request({
url: `${serviceTitle}${prefix}/modifySign`,
method: 'post',
data
})
}

4
pages-userInfo/contact/contact.vue

@ -14,7 +14,7 @@
flex: 1;
}
.img{
width: 100%;
height: 600px;
width: 750rpx;
height: 1200rpx;
}
</style>

241
pages-userInfo/extends/extends.vue

@ -1,180 +1,79 @@
<template>
<view class="container">
我是邀请更多页面
<view class="back">
<view class="back-top"></view>
<view class="uni-radius back-con uni-shadow-sm">
<view class="">
<view class="back-con-top"> 邀请码 </view>
<view class="inviteCode">
{{userInfo.inviteCode}}
</view>
</view>
<view class="border"></view>
<view class="">
<view class="back-con-top"> 邀请链接 </view>
<view class="inviteUrl">
http://AFJIASD?code={{userInfo.inviteCode}}
</view>
<button class="">点击复制</button>
</view>
</view>
</view>
</template>
<script>
// export default {
// data() {
// return {
// hotCreatorList: [],
// isTarget: true,
// showChoiceness:false
// }
// },
// //
// onPullDownRefresh() {
// this.showChoiceness = false
// uni.stopPullDownRefresh()
// },
// created() {
// const userInfo = uni.getStorageSync('userInfo')
// if (!userInfo) {
// console.log('havent userInfo')
// this.getUserInfo()
// } else {
// console.log('have userInfo')
// }
// },
// onPageScroll(e) {
// // scrollTopeasy-loadimage
// if (e.scrollTop > 160) {
// this.showChoiceness = true
// // uni.redirectTo({
// // url: '../index/choiceness'
// // })
// }
// },
// methods: {
// //
// search(res) {
// if (res.value) {
// console.log('search', res.value)
// this.goCreatorDetail(res.value)
// } else {
// uni.showToast({
// title: '',
// icon: 'none'
// })
// }
// },
// //
// getUserInfo() {
// wx.login({
// force: true,
// success: res => {
// wx.getUserInfo({
// withCredentials: true,
// success: userInfo => {
// const params = {
// code: res.code,
// encryptedData: userInfo.encryptedData,
// iv: userInfo.iv
// }
// //
// console.log('params',params);
// loginWx(params).then(res => {
// if (res.data.code === 200) {
// uni.setStorage({
// key: 'userInfo',
// data: res.data.data.userInfo,
// })
// } else {
// uni.showToast({
// title: res.data.msg,
// icon: 'none'
// })
// }
// }).catch(res => {})
// console.log(`getUserInfo `, userInfo);
// },
// fail(userInfo) {
// console.log(`getUserInfo `);
// },
// });
// },
// fail(res) {
// console.log(`login `);
// },
// });
// },
// //
// handleScroll() {
// let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
// console.log(scrollTop)
// },
// },
// }
</script>
<style lang="less">
.container {
.top {
width: 100vw;
image {
width: 100vw;
height: 400rpx;
}
.uni-searchbar {
border: 1px solid #11A8FD;
margin: 0 40rpx;
border-radius: 16rpx;
padding: 0;
.uni-searchbar__box {
padding: 0;
border-radius: 16rpx !important;
}
}
>text {
font-weight: bold;
font-size: 14px;
display: block;
text-align: center;
padding-top: 40rpx;
padding-bottom: 20rpx;
}
.user-list {
display: flex;
justify-content: flex-start;
align-items: center;
overflow-x: auto;
.user-list-box {
width: 140rpx;
padding: 20rpx;
text-align: center;
image {
width: 100rpx;
height: 100rpx;
border-radius: 100rpx;
}
text {
font-size: 24rpx;
color: #1E1E1E;
text-align: center;
}
}
}
}
.middle {
text-align: center;
height: calc(100vh - 248rpx);
padding-top: 40rpx;
text {
font-weight: bold;
font-size: 14px;
display: block;
}
image {
width: 40rpx;
height: 40rpx;
export default {
data() {
return {
userInfo: {},
}
},
created() {
const userInfoSync = uni.getStorageSync('userInfo')
this.userInfo = userInfoSync
}
}
</script>
<style lang="scss">
.back {
width: 100%;
height: 320px;
position: relative;
}
.back-con {
width: 95%;
left: 50%;
top: 42%;
transform: translate(-50%, -50%);
background-color: white;
position: relative;
height: 440rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.back2 {
width: 100%;
}
.back-top {
width: 100%;
position: absolute;
height: 240rpx;
background: #416bdc;
}
.back-con-top {
font-size: 40rpx;
font-weight: 600;
margin: 40rpx 0 30rpx 0;
display: flex;
justify-content: center;
}
.border {
width: 95%;
height: 2rpx;
margin-top: 19rpx;
background-color: rgb(165, 165, 165);
}
</style>

81
pages-userInfo/inviteLog/inviteLog.vue

@ -1,8 +1,8 @@
<template>
<view class="container">
<uni-list border-full v-for="(item,index) in inviteLogList" :key="index">
<uni-list-item :title="item.invitedScanCode" :note="item.createTime" :thumb="item.img" thumb-size="lg" />
</uni-list>
<uni-list border-full v-for="(item,index) in inviteLogList" :key="index">
<uni-list-item :title="item.invitedScanCode" :note="item.createTime" :thumb="item.img" thumb-size="lg" />
</uni-list>
<view class="ivOver" v-if="flag">-----已经到底啦-----</view>
</view>
</template>
@ -70,83 +70,12 @@
<style lang="scss">
.ivOver{
width: 100%;
height:50px;
line-height: 50px;
height:100rpx;
line-height: 100rpx;
text-align: center;
background: #fff;
font-size: 20rpx;
}
.container {
.top {
width: 100vw;
image {
width: 100vw;
height: 400rpx;
}
.uni-searchbar {
border: 1px solid #11A8FD;
margin: 0 40rpx;
border-radius: 16rpx;
padding: 0;
.uni-searchbar__box {
padding: 0;
border-radius: 16rpx !important;
}
}
>text {
font-weight: bold;
font-size: 14px;
display: block;
text-align: center;
padding-top: 40rpx;
padding-bottom: 20rpx;
}
.user-list {
display: flex;
justify-content: flex-start;
align-items: center;
overflow-x: auto;
.user-list-box {
width: 140rpx;
padding: 20rpx;
text-align: center;
image {
width: 100rpx;
height: 100rpx;
border-radius: 100rpx;
}
text {
font-size: 24rpx;
color: #1E1E1E;
text-align: center;
}
}
}
}
.middle {
text-align: center;
height: calc(100vh - 248rpx);
padding-top: 40rpx;
text {
font-weight: bold;
font-size: 14px;
display: block;
}
image {
width: 40rpx;
height: 40rpx;
}
}
}
</style>

4
pages-userInfo/notice/notice.vue

@ -76,8 +76,8 @@
<style lang="scss">
.ivOver{
width: 100%;
height:50px;
line-height: 50px;
height:100rpx;
line-height: 100rpx;
text-align: center;
background: #fff;
font-size: 20rpx;

2
pages-userInfo/notice/noticeDetail.vue

@ -57,6 +57,6 @@
<style>
.bottom{
margin-top:20px;
margin-top:40rpx;
}
</style>

22
pages-userInfo/withdraw/withdraw.vue

@ -123,19 +123,19 @@
<style lang="scss">
.uni-list-item__icon-img {
border-radius: 8px;
border-radius: 16rpx;
}
.ivOver{
width: 100%;
height:50px;
line-height: 50px;
height:100rpx;
line-height: 100rpx;
text-align: center;
background: #fff;
font-size: 20rpx;
}
.box {
display: flex;
padding-right: 8px;
padding-right: 16rpx;
flex: 1;
color: #3b4144;
flex-direction: column;
@ -144,17 +144,17 @@
}
.box-bot {
display: flex;
margin-top: 5px;
margin-top: 10rpx;
}
.box-bot view {
border-radius: 3px;
border: 1px solid #4d6aff;
padding: 2px 5px;
margin-right: 5px;
font-size: 12px;
border-radius: 6rpx;
border: 2rpx solid #4d6aff;
padding: 4rpx 10rpx;
margin-right: 10rpx;
font-size: 24rpx;
}
.uni-list-item__content-title {
font-size: 14px;
font-size: 28rpx;
color: #3b4144;
overflow: hidden;
}

16
pages-userInfo/withdraw/withdrawDetail.vue

@ -116,7 +116,7 @@
.back-top {
width: 100%;
position: absolute;
height: 120px;
height: 240rpx;
background: #416bdc;
}
.card {
@ -124,25 +124,25 @@
position: absolute;
}
.uni-group--card {
margin-top: 20px !important;
margin-top: 40rpx !important;
}
.title {
display: block;
width: 70px;
margin-right: 10px;
width: 140rpx;
margin-right: 20rpx;
font-weight: bold;
}
.box {
display: flex;
margin-bottom: 20px;
margin-bottom: 40rpx;
}
.card view:first-child {
margin-top: 10px;
margin-top: 20rpx;
}
.border {
width: 100%;
height: 1px;
height: 2rpx;
background: rgb(229, 229, 229);
margin-bottom: 20px;
margin-bottom: 40rpx;
}
</style>

35
pages.json

@ -17,7 +17,7 @@
{
"path": "pages/index/upload/upload",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "上传图片",
"enablePullDownRefresh": false
}
@ -29,6 +29,13 @@
}
}, {
"path": "pages/index/material/imgDetail",
"style": {
"navigationBarTitleText": "素材详情",
"enablePullDownRefresh": false
}
},{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
@ -45,7 +52,7 @@
}, {
"path": "pages/index/banner",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "banner",
"enablePullDownRefresh": false
}
@ -96,12 +103,12 @@
"subPackages": [{
"root": "pages-userInfo",
"pages": [{
"path": "about/about",
"style": {
"navigationBarTitleText": "常见问题",
"enablePullDownRefresh": false
}
},
"path": "about/about",
"style": {
"navigationBarTitleText": "常见问题",
"enablePullDownRefresh": false
}
},
{
"path": "contact/contact",
"style": {
@ -144,7 +151,7 @@
}
, {
, {
"path": "withdraw/withdrawDetail",
"style": {
"navigationBarTitleText": "提现详情",
@ -168,11 +175,11 @@
"borderStyle": "black",
"backgroundColor": "#F8F8F8",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/index-default.png",
"selectedIconPath": "static/index-select.png",
"text": "首页"
},
"pagePath": "pages/index/index",
"iconPath": "static/index-default.png",
"selectedIconPath": "static/index-select.png",
"text": "首页"
},
{
"pagePath": "pages/profit/profit",
"iconPath": "static/theme-default.png",

24
pages/index/index.vue

@ -4,7 +4,7 @@
<uni-swiper-dot class="uni-swiper-dot-box" @clickItem=clickItem :info="banner" :current="current" :mode="mode"
field="bannerName">
<swiper class="swiper-box" @change="changeSwiper" :current="swiperDotIndex" :autoplay="autoplay"
:interval="interval" :duration="duration">
:interval="interval" :duration="duration" circular>
<swiper-item v-for="(item, index) in banner" :key="index">
<view class="swiper-item" :class="'swiper-item' + index">
<!-- <text style="color: #fff; font-size: 32px;">{{index+1}}</text> -->
@ -206,7 +206,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10px 0;
padding: 10rpx 0;
}
.grid-item-box-row {
@ -218,11 +218,11 @@
flex-direction: row;
align-items: center;
justify-content: center;
padding: 10px 0;
padding: 10rpx 0;
}
.swiper-box {
height: 150px;
height: 260rpx;
}
.swiper-item {
@ -232,7 +232,7 @@
flex-direction: column;
justify-content: center;
align-items: center;
height: 200px;
height: 290rpx;
color: #fff;
}
@ -263,11 +263,11 @@
/* #endif */
@media screen and (min-width: 500px) {
@media screen and (min-width: 500rpx) {
.uni-swiper-dot-box {
width: 400px;
width: 400rpx;
margin: 0 auto;
margin-top: 8px;
margin-top: 8rpx;
}
.image {
@ -280,13 +280,13 @@
}
.iconImage{
width:3rem;
height:3rem;
width:90rpx;
height:90rpx;
}
.listIconImage{
width:2rem;
height:2rem;
width:60rpx;
height:60rpx;
}
</style>

695
pages/index/material/imgDetail.vue

@ -1,31 +1,24 @@
<template>
<view class="imgDetail">
<image class="main-img" :src="detailMsg.imgUrl" mode=""></image>
<view class="toolbar">
<view class="toolbar-box">
<image v-if="detailMsg.isHot ==='0'" src="../../static/hot-not.png" mode=""></image>
<image v-else src="../../static/hot-yes.png" mode=""></image>
</view>
<view class="toolbar-box" @click="download(detailMsg.imgUrl)">
<image v-if="isDownload" src="../../static/download-select.png" mode=""></image>
<image v-else src="../../static/download.png" mode=""></image>
<text>下载</text>
</view>
<view class="toolbar-box" @click="likeCollect('isLike')">
<image v-if="isLike" src="../../static/like-select.png" mode=""></image>
<image v-else src="../../static/like.png" mode=""></image>
<text>喜欢</text>
</view>
<view class="toolbar-box" @click="likeCollect('isCollect')">
<image v-if="isCollect" src="../../static/collect-select.png" mode=""></image>
<image v-else src="../../static/collect.png" mode=""></image>
<text>收藏</text>
</view>
<view class="toolbar-box share-box">
<button open-type="share">
<image src="../../static/share.png" mode=""></image>
<text>分享</text>
</button>
<image class="main-img" :src="detailMsg.imgUrl" :style="'width:'+imgWidth+';height:'+imgHeight+';margin-top:'+marginTop" mode=""></image>
<view class="toolbar" :style="'display:'+showOrmis">
<view class="toolbarLeft" @click=topImg>置顶</view>
<view class="border"></view>
<view class="toolbarMid" @click="onOrOffHandler">{{upOrDown}}</view>
<view class="border"></view>
<view class="toolbarRight" @click="changeSign">修改标签</view>
<view>
<uni-drawer ref="showRight" mode="right" :width="300">
<view class="close">
<uni-group mode="card">
<view class="segmented-control">
<view>标签列表(最多选择3个)</view>
<uni-data-checkbox mode="tag" multiple v-model="signListSelected" :localdata="signList" @change="selectedSign" max="3"></uni-data-checkbox>
</view>
</uni-group>
<button class="upLoadBtn" @click="modifySign">保存</button>
</view>
</uni-drawer>
</view>
</view>
</view>
@ -33,29 +26,25 @@
<script>
import {
detailsTiktokImg, //
judgeTiktokLike, //
judgeTiktokCollect, //
tiktokLike, //
tiktokUnLike, //
tiktokCollect, //
tiktokUnCollect, //
queryCreatorScanCodeById, //
insertOrUpdatePreAdProfit, ///广
insertOrUpdatePreInviteProfit, // /
checkUserCanDownload //
} from '@/api/creator.js'
getImgDetails,//
onlineOrOfflineImg ,//
topImg, //
getSignList,//
modifySign //
} from '@/api/index.js'
export default {
data() {
return {
detailMsg: {}, //
userInfo: {}, //
isDownload: false, //
isLike: false, // /
isCollect: false, // ,
scanCode: undefined, //
canDownload: false // false
imgWidth: 0, //
imgHeight: 0, // ,
marginTop: 0 ,//
showOrmis: 'none' ,//
upOrDown: '下',
showRight: false,
signListSelected:[],
signList:[],
}
},
created() {
@ -65,426 +54,260 @@
} else {
this.getImgDetail(detailId)
}
},
onShareAppMessage(res) {
if (res.from === 'button') { //
console.log(res)
}
return {
title: '来看看艺术家[' + this.scanCode + ']精心准备的图片吧~',
path: `/pages/creator/imgDetail?id=${this.userInfo.id}`,
bgImgUrl: `${this.detailMsg.imgUrl}`
}
uni.showToast({
title: '分享成功',
icon: 'none'
})
this.getSignList();
},
methods: {
//
async getImgDetail(id) {
const res = await detailsTiktokImg(id)
console.log('res', res)
if (res.data.code === 200) {
this.detailMsg = res.data.data
console.log('图片详情', res)
const result = await queryCreatorScanCodeById(this.detailMsg.creatorId)
if (result.data.code === 200) {
this.scanCode = result.data.data.scanCode
} else {
//
modifySign(){
let that = this;
//
const param = {
imgId: that.detailMsg.id,
typeId: that.detailMsg.typeId,
signList: that.signListSelected
}
modifySign(param).then(res=>{
if (res.data.code === 200) {
uni.showToast({
title: '该艺术家不存在!',
icon: 'none'
title:'修改标签成功!',
duration: 1000,
success() {
that.$refs.showRight.close();
that.signListSelected = [];
}
})
}else{
uni.showModal({
content: '修改标签失败!',
showCancel: false
});
}
uni.getStorage({
key: 'userInfo',
success: res => {
this.userInfo = res.data
console.log('userInfo', this.userInfo)
this.searchIsLike()
this.searchisCollect()
this.checkUserDownload()
}
})
} else {
uni.showToast({
title: '请输入艺术家代号',
icon: 'none'
})
}
});
},
//
async searchIsLike() {
const params = {
imgId: this.detailMsg.id,
userId: this.userInfo.id
}
console.log('params', this.detailMsg, params)
const res = await judgeTiktokLike(params)
//
async getSignList(){
const res = await getSignList({})
if (res.data.code === 200) {
this.isLike = res.data.data
for (let s of res.data.data) {
let signObject = {}
signObject.text = s.name
signObject.value = s.id
this.signList.push(signObject)
}
console.log('signList',this.signList)
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
uni.showModal({
content: '标签列表加载失败!',
showCancel: false
});
}
},
//
async searchisCollect() {
const params = {
imgId: this.detailMsg.id,
userId: this.userInfo.id
}
const res = await judgeTiktokCollect(params)
if (res.data.code === 200) {
this.isCollect = res.data.data
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
//
onOrOffHandler(){
if(this.detailMsg.status === '2'){
//
this.changeStatus(this.detailMsg.id,'3')
}else if(this.detailMsg.status === '3'){
//
this.changeStatus(this.detailMsg.id,'2')
}
},
// /
async likeCollect(val) {
const params = {
imgId: this.detailMsg.id,
userId: this.userInfo.id
}
if (val === 'isLike') {
this.isLike = !this.isLike
console.log('this.isLike', this.isLike)
if (this.isLike) {
//
console.log('点赞')
const res = await tiktokLike(params)
if (res.data.code === 200) {} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
} else {
//
console.log('取消点赞')
const res = await tiktokUnLike(params)
if (res.data.code === 200) {} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
}
} else if (val === 'isCollect') {
this.isCollect = !this.isCollect
if (this.isCollect) {
//
console.log('收藏')
const res = await tiktokCollect(params)
if (res.data.code === 200) {} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
} else {
//
console.log('取消收藏')
const res = await tiktokUnCollect(params)
if (res.data.code === 200) {} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
//
selectedSign(e){
let that = this;
that.signListSelected = e.detail.value;
//console.log('that.signListSelected'+that.signListSelected);
},
//
topImg(){
//console.log('',this.detailMsg)
topImg(this.detailMsg.id).then(res =>{
if(res.data.code === 200){
uni.showToast({
title:'置顶成功!',
duration: 1000
})
}else{
uni.showModal({
content: "置顶图片失败!",
showCancel: false,
});
}
}
});
},
//广
async insertPreAdProfit() {
const params = {
imgId: this.detailMsg.id,
creatorId: this.detailMsg.creatorId,
scanCode: this.scanCode,
userId: this.userInfo.id,
appType: '0',
platform: '0'
}
const res = await insertOrUpdatePreAdProfit(params);
if (res.data.code === 200) {
console.log("写入广告收益成功!")
this.adResult = res.data.code;
} else {
uni.showToast({
title: '图片下载失败!',
icon: 'none'
})
}
//
changeSign(){
console.log('修改标签');
//
this.$refs.showRight.open();
},
//
async insertPreInviteProfit() {
const params = {
imgId: this.detailMsg.id,
creatorId: this.detailMsg.creatorId,
scanCode: this.scanCode,
appType: '0',
platform: '0'
}
const res = await insertOrUpdatePreInviteProfit(params)
if (res.data.code === 200) {
console.log("写入邀请收益成功");
this.inviteResult = res.data.code;
} else {
uni.showToast({
title: '图片下载失败!',
icon: 'none'
})
}
//
changeStatus:function(id,status){
const param = {
id: id,
status: status
}
onlineOrOfflineImg(param).then(res =>{
if (res.data.code === 200) {
uni.showToast({
title: '修改成功!',
duration: 1000,
success() {
setTimeout(() => {
uni.redirectTo({
url: '/pages/index/material/material'
});
}, 1000)
}
});
}else{
uni.showModal({
content: "上下架图片失败!",
showCancel: false,
});
}
});
},
//
async checkUserDownload() {
const params = {
userId: this.userInfo.id,
appType: '0',
platform: '0'
}
const res = await checkUserCanDownload(params);
//
async getImgDetail(id) {
const res = await getImgDetails(id)
if (res.data.code === 200) {
console.log("当日下载结果为", res.data.data)
this.canDownload = res.data.data;
this.detailMsg = res.data.data
console.log('图片详情', this.detailMsg)
//
if(this.detailMsg.typeId === 1){
this.imgWidth = 750 + 'rpx';
this.imgHeight = 750 + 'rpx';
this.marginTop = 250 + 'rpx';
}else if(this.detailMsg.typeId === 2){
this.imgWidth = 750 + 'rpx';
this.imgHeight = 100 + '%';
this.marginTop = 0 + 'rpx';
}else if(this.detailMsg.typeId === 3){
this.imgWidth = 750 + 'rpx';
this.imgHeight = 100 + '%';
this.marginTop = 0 + 'rpx';
}else if(this.detailMsg.typeId === 4){
this.marginTop = 300 + 'rpx';
this.imgWidth = 750 + 'rpx';
this.imgHeight = 600 + 'rpx';
}else if(this.detailMsg.typeId === 5){
this.imgWidth = 750 + 'rpx';
this.imgHeight = 750 + 'rpx';
this.marginTop = 250 + 'rpx';
}else if(this.detailMsg.typeId === 6){
this.imgWidth = 750 + 'rpx';
this.imgHeight = 750 + 'rpx';
this.marginTop = 250 + 'rpx';
}
///
//
if(this.detailMsg.status === "0"){
this.showOrmis = 'none';
//
}else if(this.detailMsg.status === "1"){
this.showOrmis = 'none';
//
}else if(this.detailMsg.status === "2"){
this.showOrmis = 'flex';
this.upOrDown = '下'
//
}else{
this.showOrmis = 'flex';
this.upOrDown = '上'
}
} else {
uni.showToast({
title: '检查下载状态失败!',
icon: 'none'
})
}
},
//
download(url) {
let that = this;
if (this.canDownload != true) {
//
this.isDownload = true
uni.showLoading({
title: '正在保存图片...'
});
//
uni.getSetting({
success: (res) => {
//
if (!res.authSetting["scope.writePhotosAlbum"]) {
//
tt.authorize({
scope: "scope.album",
success: () => {
//
uni.downloadFile({
url,
success: (res) => {
console.log('下载路径', res)
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
//
filePath: res
.tempFilePath,
success: (res) => {
console.log(
'success',
res)
},
fail: (res) => {
console.log(
'fail',
res)
return uni
.showToast({
title: res
.errMsg,
icon: 'none'
});
},
complete: (res) => {
uni
.hideLoading();
if (res
.errMsg !==
"saveImageToPhotosAlbum:ok"
) {
return uni
.showToast({
title: "下载失败!",
icon: 'none'
});
} else {
return uni
.showToast({
title: "下载成功!",
icon: 'none',
success() {
that.insertPreAdProfit();
that.insertPreInviteProfit();
}
});
}
},
});
} else {
uni.showToast({
title: "下载失败!",
icon: 'none'
});
}
}
})
},
//
fail: () => {
uni.hideLoading();
uni.showModal({
title: "您已拒绝获取相册权限",
content: "是否进入权限管理,调整授权?",
success: (res) => {
if (res.confirm) {
//
uni.openSetting({
success: (
res) => {
console
.log(
res
.authSetting
);
},
});
} else if (res.cancel) {
return uni.showToast({
title: "已取消!",
icon: 'none'
});
}
},
});
},
});
} else {
//
uni.saveImageToPhotosAlbum({
filePath: url,
success: (res) => {
uni.hideLoading();
return uni.showToast({
title: "保存成功!",
icon: 'none'
});
},
fail: (res) => {
uni.hideLoading();
console.log(res.errMsg);
return uni.showToast({
title: res.errMsg,
icon: 'none'
});
},
//
complete: (res) => {
uni.hideLoading();
},
});
}
},
fail: (res) => {},
uni.showModal({
content: "获取图片详情数据失败!",
showCancel: false,
});
} else {
// canDownloadtrue
uni.showToast({
title: '当日下载次数已用完,请明日再来!',
icon: 'none'
})
}
},
//
share() {
uni.showToast({
title: '分享',
icon: 'none'
})
},
}
}
},
}
</script>
<style lang="less">
.imgDetail {
height: 100vh;
width: 100vw;
<style lang="scss">
.imgDetail{
height:100%;
width:750rpx;
overflow: hidden;
position: relative;
.main-img {
width: 100%;
height: 100%;
}
.toolbar {
width: 60px;
background-color: rgba(255, 255, 255, 0.2);
position: absolute;
bottom: 76px;
right: 10px;
border-radius: 60px;
padding-top: 40rpx;
.share-box {
>button {
line-height: 0 !important;
padding: 0;
outline: none;
background: none;
border: none;
background-color: black;
position: absolute;
z-index: 0;
.main-img {
position: absolute;
z-index: 1;
}
.toolbar{
height: 100rpx;
width: 700rpx;
position: absolute;
z-index: 2;
border-radius: 20rpx;
background-color: #B3B3B3;
margin-top: 1050rpx;
margin-left: 20rpx;
display: flex;
justify-content: space-around;
align-items: center;
opacity: 0.7;
.border {
width: 1rpx;
height: 30rpx;
background-color: black;
position: relative;
z-index: 2;
}
>button::after {
border: none;
.toolbarLeft{
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
width: 200rpx;
position: relative;
z-index: 2;
}
}
.toolbar-box {
height: 60px;
text-align: center;
margin-bottom: 40rpx;
text {
display: block;
text-align: center;
line-height: 60rpx;
font-size: 12px;
.toolbarMid{
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
width: 200rpx;
position: relative;
z-index: 2;
}
image {
width: 50rpx;
height: 50rpx;
margin: 0 auto;
.toolbarRight{
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
width: 200rpx;
position: relative;
z-index: 2;
}
}
.toolbar-box:first-child {
line-height: 40rpx;
height: 40rpx;
}
}
}
.upLoadBtn{
width: 100%;
height: 60rpx;
background-color: royalblue;
color: #ffffff;
font-size: 30rpx;
line-height: 62rpx;
border-radius: 17rpx;
margin-top:100rpx;
}
</style>

96
pages/index/material/material.vue

@ -45,13 +45,8 @@
const userInfoSync = uni.getStorageSync("userInfo");
this.userInfo = userInfoSync;
this.queryListType();
uni.getSystemInfo({
success: res => {
console.log(res)
this.imgWidth = res.windowWidth - 130 + 'rpx'
this.imgHeight = res.windowWidth - 130 + 'rpx'
}
})
this.imgWidth = 750/3-20 + 'rpx'
this.imgHeight = 750/3-20 + 'rpx'
},
//
onPullDownRefresh(){
@ -75,7 +70,7 @@
methods: {
//
targetDetail(item) {
console.log('跳转', item)
//console.log('', item)
if (item.id) {
uni.setStorage({
key: 'detailId',
@ -83,7 +78,13 @@
success() {
console.log(111111)
uni.navigateTo({
url: '../material/imgDetail'
url: '/pages/index/material/imgDetail',
success:function(){
console.log('跳转成功!')
},
fail:function(){
console.log('跳转失败!')
}
})
}
})
@ -95,7 +96,7 @@
that.flag = false;
that.creatorImgList = [];
that.status = e1.currentIndex;
console.log('status',that.status)
//console.log('status',that.status)
uni.showLoading({
title: "加载中",
mask: true,
@ -105,7 +106,7 @@
creatorId: that.userInfo.id,
typeId: that.typeId,
pageSize: that.pageSize,
pageNum: 1,
pageNum: that.pageNum,
status: that.status
};
listTiktokImgIn(param).then(res => {
@ -113,7 +114,7 @@
console.log('that.status',that.status);
if(res.data.code === 200){
that.creatorImgList.push(...res.data.rows)
console.log('调用成功1!', that.creatorImgList);
//console.log('1!', that.creatorImgList);
}else {
uni.showModal({
content: "艺术家图片列表数据加载失败!",
@ -132,7 +133,7 @@
that.flag = false;
that.creatorImgList = [];
that.typeId = that.typeIdList[e2.currentIndex];
console.log('typeId',that.typeId)
//console.log('typeId',that.typeId)
uni.showLoading({
title: "加载中",
mask: true,
@ -142,7 +143,7 @@
creatorId: that.userInfo.id,
typeId: that.typeId,
pageSize: that.pageSize,
pageNum: 1,
pageNum: that.pageNum,
status: that.status
};
listTiktokImgIn(param).then(res => {
@ -150,7 +151,27 @@
console.log('that.status',that.status);
if(res.data.code === 200){
that.creatorImgList.push(...res.data.rows)
console.log('调用成功2!', that.creatorImgList);
console.log(that.creatorImgList)
//console.log('2!', that.creatorImgList);
if(that.typeId === 1){
that.imgWidth = 750/3-20 + 'rpx'
that.imgHeight = 750/3-20 + 'rpx'
}else if(that.typeId === 2){
that.imgWidth = 750/3-30 + 'rpx'
that.imgHeight = 750/3+60 + 'rpx'
}else if(that.typeId === 3){
that.imgWidth = 750/3-30 + 'rpx'
that.imgHeight = 750/3+60 + 'rpx'
}else if(that.typeId === 4){
that.imgWidth = 750/3+100 + 'rpx'
that.imgHeight = 750/3 + 'rpx'
}else if(that.typeId === 5){
that.imgWidth = 750/3-20 + 'rpx'
that.imgHeight = 750/3-20 + 'rpx'
}else if(that.typeId === 6){
that.imgWidth = 750/3-20 + 'rpx'
that.imgHeight = 750/3-20 + 'rpx'
}
}else {
uni.showModal({
content: "艺术家图片列表数据加载失败!",
@ -161,31 +182,7 @@
},
complete() {
uni.hideLoading();
uni.getSystemInfo({
success: res => {
console.log(res)
if(that.typeId === 1){
that.imgWidth = res.windowWidth - 130 + 'rpx'
that.imgHeight = res.windowWidth - 130 + 'rpx'
}else if(that.typeId === 2){
that.imgWidth = res.windowWidth - 130 + 'rpx'
that.imgHeight = res.windowWidth + 20 + 'rpx'
}else if(that.typeId === 3){
that.imgWidth = res.windowWidth - 130 + 'rpx'
that.imgHeight = res.windowWidth + 20 + 'rpx'
}else if(that.typeId === 4){
that.imgWidth = res.windowWidth - 60 + 'rpx'
that.imgHeight = res.windowWidth - 130 + 'rpx'
}else if(that.typeId === 5){
that.imgWidth = res.windowWidth - 130 + 'rpx'
that.imgHeight = res.windowWidth - 130 + 'rpx'
}else if(that.typeId === 6){
that.imgWidth = res.windowWidth - 130 + 'rpx'
that.imgHeight = res.windowWidth - 130 + 'rpx'
}
}
})
},
});
},
@ -238,30 +235,35 @@
}
</script>
<style lang="less">
<style lang="scss">
.choiceness {
padding-top: 20rpx;
//width: 750rpx;
.choiceness-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-first;
justify-content: flex-start;
flex-direction: row;
width: 750rpx;
//border: 1rpx solid blue;
image {
.img-box {
margin-top: 10rpx;
margin-left: 10rpx;
margin-right: 5rpx;
margin-left: 16rpx;
//margin-right: 10rpx;
//margin:8rpx;
border-radius: 10rpx;
//border: 1rpx solid red;
}
}
}
.ivOver{
width: 100%;
height:50px;
line-height: 50px;
height:50rpx;
line-height: 50rpx;
text-align: center;
background: #fff;
font-size: 20rpx;

293
pages/index/upload/upload.vue

@ -1,25 +1,306 @@
<template>
<view>
我是上传界面
<uni-section title="选择图片分类上传" type="circle" padding>
<view class="segmented-control">
<uni-segmented-control :current="typeCurrent" :values="typeList" :styleType="styleType"
:active-color="activeColor" @clickItem="onClickType" />
</view>
<uni-group mode="card">
<view class="example-body">
<uni-file-picker limit="9" title="最多选择9张图片"
file-extname="png,jpg,gif,jpeg" mode="grid"
file-mediatype="image" @success="successHandler"
@fail="failHandler" @delete="deleteHandler" autoUpload="false"
@select="selectHandler" :disabled="checkUpload"></uni-file-picker>
</view>
</uni-group>
<view class="uploadNum">今日还可上传次数<span class="uploadText">{{getUploadNum}}</span>,已上传次数<span class="uploadText">{{uploadedNum}}</span></view>
</uni-section>
<uni-section title="选择图片标签" subTitle="最多选择3个" type="circle" padding>
<uni-group mode="card">
<view class="segmented-control">
<view>标签列表</view>
<uni-data-checkbox mode="tag" multiple v-model="signListSelected" :localdata="signList" @change="selectedSign" max="3"></uni-data-checkbox>
</view>
</uni-group>
</uni-section>
<button class="upLoadBtn" size="default" :loading="loadingFlag" @click="saveImg" :disabled="checkUpload">点击上传</button>
</view>
</template>
<script>
import {
getSignList
getSignList,listType,insertTiktokImg,queryUploadNum
} from '@/api/index.js'
import {
deleteFile,uploadBatch
} from '@/api/common.js'
export default {
data() {
return {
styleType: 'button',
activeColor: '#007aff',
typeCurrent: 0,
typeId: 1,
signList:[],
signObject:{},
typeList:[],
typeIdList:[],
loadingFlag: false,
imgList:[],
signListSelected:[],
userInfo:{},
uploadedNum: 0
}
},
created() {
this.getSignList();
this.getTypeList();
const userInfoSync = uni.getStorageSync("userInfo");
this.userInfo = userInfoSync;
this.queryUploadNum();
},
computed:{
//
getUploadNum(){
return 50 - this.uploadedNum
},
//
checkUpload(){
return this.uploadedNum >= 50? true:false;
}
},
methods: {
}
//
async getSignList(){
const res = await getSignList({})
if (res.data.code === 200) {
for (let s of res.data.data) {
let signObject = {}
signObject.text = s.name
signObject.value = s.id
this.signList.push(signObject)
}
console.log('signList',this.signList)
} else {
uni.showModal({
content: '标签列表加载失败!',
showCancel: false
});
}
},
//
async getTypeList(){
const res = await listType({})
if(res.data.code === 200){
for (let s of res.data.data) {
this.typeList.push(s.typeName);
this.typeIdList.push(s.id);
}
console.log('分类列表',this.typeList)
console.log('分类id列表',this.typeIdList)
}else{
uni.showModal({
content: '分类列表加载失败!',
showCancel: false
});
}
},
//
async queryUploadNum(){
const checkParam = {
creatorId: this.userInfo.id
}
const res = await queryUploadNum(checkParam);
console.log(res)
if(res.data.code === 200){
this.uploadedNum = res.data.data;
}else{
uni.showModal({
content: '获取艺术家上传次数失败!',
showCancel: false
});
}
},
//
onClickType(e2){
let that = this;
that.flag = false;
that.typeId = that.typeIdList[e2.currentIndex];
//console.log('typeId',that.typeId)
uni.showLoading({
title: "加载中",
mask: true,
complete() {
uni.hideLoading();
},
});
},
//
selectedSign(e){
let that = this;
that.signListSelected = e.detail.value;
//console.log('that.signListSelected'+that.signListSelected);
},
//
successHandler(e){
console.log('文件上传成功!'+e)
},
//
selectHandler(e){
console.log('选择了',e)
let that = this;
//
if(that.uploadedNum >=50){
uni.showModal({
content: "当日已达上传图片上限,请明日再来!",
showCancel: false
});
return;
}
that.uploadHandler(e.tempFilePaths)
},
//
failHandler(e){
console.log('文件上传失败!'+e)
},
//
deleteHandler(e){
console.log('文件删除',e.tempFile.url)
//
const param = {
url: e.tempFile.url
};
deleteFile(param).then(res =>{
if(res.data.code != 200){
uni.showModal({
content: "删除失败!",
showCancel: false
});
}
})
},
//
uploadHandler:function(e){
let that = this;
uni.showLoading({
title: "上传中"
});
console.log('上传文件:',e)
const tempFilePaths = e;
for (var i = 0; i < tempFilePaths.length; i++) {
//const tempFile = e.tempFiles[i];
uni.uploadFile({
url: 'http://48uu7a.natappfree.cc/file/upload',
name: 'file',
//url: 'http://localhost:7010/file/uploadBatch',
//name: 'files',
header:{
"Content-Type": "multipart/form-data"
},
filePath: tempFilePaths[i],
success:(uploadFileRes) => {
uni.hideLoading();
console.log('uploadFileRes',uploadFileRes);
const back = JSON.parse(uploadFileRes.data);
console.log("back",back)
if (back.code == 200) {
that.imgList.push(back.data);
}
//console.log('imgList',that.imgList);
},
fail:() => {
uni.hideLoading();
uni.showModal({
content: "上传失败,请联系客服!"
});
},
complete: function() {
uni.hideLoading();
}
});
}
},
//
saveImg(){
let that = this;
//
if(that.imgList.length === 0){
uni.showModal({
content: "请选择图片上传!",
showCancel: false,
});
return;
}
//
if(that.uploadedNum >=50){
uni.showModal({
content: "当日已达上传图片上限,请明日再来!",
showCancel: false
});
return;
}else{
const param = {
creatorId: that.userInfo.id,
imgUrl: that.imgList,
signList: that.signListSelected,
status: 0,
typeId: that.typeId
}
insertTiktokImg(param).then(res =>{
console.log('res',res)
if(res.data.code === 200){
uni.showToast({
title: '上传成功!',
duration: 2000,
success:function(){
setTimeout(function () {
//
that.imgList = []
that.signListSelected = []
that.typeId = 1
uni.reLaunch({
url: '../index'
});
}, 2000);
}
});
}else {
uni.showModal({
content: "艺术家图片上传失败!",
showCancel: false,
});
}
});
}
}
},
}
</script>
<style>
<style lang="scss">
.upLoadBtn{
width: 750rpx;
height: 60rpx;
background-color: royalblue;
color: #ffffff;
font-size: 30rpx;
line-height: 62rpx;
border-radius: 17rpx;
margin-top:100rpx;
}
.uploadNum{
font-size: 25rpx;
.uploadText{
color:red;
}
}
</style>

156
pages/profit/profit.vue

@ -52,15 +52,6 @@
</view>
</view>
</view>
<!-- <uni-section class="back-bot" title="昨日收益" type="line">
<uni-group mode="card">
<view>广告收益:{{profitInfo.yesterdayAdProfit}}</view>
<view>邀请收益:{{profitInfo.yesterdayInviteProfit}}</view>
<view>总收益:{{profitInfo.totalProfit}}</view>
<view>上月收益:{{profitInfo.lastMonthProfit}}</view>
<view>当月收益:{{profitInfo.thisMonthProfit}}</view>
</uni-group>
</uni-section> -->
</view>
<view class="back2">
<view class="uni-radius back-con2 uni-shadow-sm">
@ -130,25 +121,6 @@
</template>
</uni-list-item>
</uni-list>
<!-- <view class="adver">
<view class="adver-top">
<view class="circular"></view>
<view class="adver-top-text"> 订单: </view>
</view>
<view class="adver-mid"> 会员订单及时入账T+7即可提现 </view>
</view>
<uni-list>
<uni-list-item title="会员" link>
<template v-slot:footer>
<view class="blue"> ¥ 0</view>
</template>
</uni-list-item>
<uni-list-item title="邀请" link>
<template v-slot:footer>
<view class="blue"> ¥ 0 </view>
</template>
</uni-list-item>
</uni-list> -->
</view>
<!-- 已转入钱包 -->
<view v-show="active == 4">
@ -170,137 +142,11 @@
</template>
</uni-list-item>
</uni-list>
<!-- <view class="adver">
<view class="adver-top">
<view class="circular"></view>
<view class="adver-top-text"> 订单: </view>
</view>
</view>
<uni-list>
<uni-list-item title="会员" link>
<template v-slot:footer>
<view class="blue"> ¥ 0 </view>
</template>
</uni-list-item>
<uni-list-item title="邀请" link>
<template v-slot:footer>
<view class="blue"> ¥ 0 </view>
</template>
</uni-list-item>
</uni-list> -->
</view>
<!-- <view class="back-con-mid">
<view class="back-con-mid-left">
广告收益
<view class="top-text">
¥ {{ profitInfo.yesterdayAdProfit }}
</view>
</view>
<view class="border"></view>
<view class="back-con-mid-right">
邀请收益
<view class="top-text">
¥ {{ profitInfo.yesterdayInviteProfit }}
</view>
</view>
</view> -->
</view>
</view>
<!-- <uni-section class="back-bot" title="昨日收益" type="line">
<uni-group mode="card">
<view>广告收益:{{profitInfo.yesterdayAdProfit}}</view>
<view>邀请收益:{{profitInfo.yesterdayInviteProfit}}</view>
<view>总收益:{{profitInfo.totalProfit}}</view>
<view>上月收益:{{profitInfo.lastMonthProfit}}</view>
<view>当月收益:{{profitInfo.thisMonthProfit}}</view>
</uni-group>
</uni-section> -->
</view>
</view>
<!-- <view class="middle">
<uni-section title="收益明细" type="line">
<uni-group mode="card">
<uni-segmented-control
:current="current"
:values="items"
:style-type="styleType"
:active-color="activeColor"
@clickItem="onClickItem"
/>
<view class="content">
<view v-if="current === 0">
<uni-collapse>
<uni-collapse-item title="广告" :show-animation="true">
<view
class="content"
v-for="(
item, index
) in downloadAndInviteCountInfo.creatorProfitDownloadCount"
:key="index"
>
<text class="text" @click="linkTo(0, 0)"
>日期:{{ item.createTime }}---</text
>
<text class="text">次数:{{ item.downloadNum }}</text>
</view>
</uni-collapse-item>
<uni-collapse-item title="邀请" :show-animation="true">
<view
class="content"
v-for="(
item, index
) in downloadAndInviteCountInfo.creatorProfitInviteCount"
:key="index"
>
<text class="text" @click="linkTo(1, 0)"
>日期:{{ item.createTime }}---</text
>
<text class="text">次数:{{ item.inviteDownloadNum }}</text>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
<view v-if="current === 1">
<uni-collapse>
<uni-collapse-item title="广告" :show-animation="true">
<view class="content">
<text class="text" @click="linkTo(0, 1)"
>额度:{{ inProfitInfo.profit }}</text
>
</view>
</uni-collapse-item>
<uni-collapse-item title="邀请" :show-animation="true">
<view class="content">
<text class="text" @click="linkTo(1, 1)"
>额度:{{ inProfitInfo.inviteProfit }}</text
>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
<view v-if="current === 2">
<uni-collapse>
<uni-collapse-item title="广告" :show-animation="true">
<view class="content">
<text class="text" @click="linkTo(0, 2)"
>额度:{{ endProfitInfo.profit }}</text
>
</view>
</uni-collapse-item>
<uni-collapse-item title="邀请" :show-animation="true">
<view class="content">
<text class="text" @click="linkTo(1, 2)"
>额度:{{ endProfitInfo.inviteProfit }}</text
>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
</view>
</uni-group>
</uni-section>
</view> -->
</view>
</template>
@ -576,7 +422,7 @@ export default {
.back-con-bot {
width: 100%;
height: 80px;
height: 150rpx;
display: flex;
justify-content: space-between;
align-items: center;

Loading…
Cancel
Save