This commit is contained in:
lnn19986213 2022-05-06 09:01:30 +08:00
parent c776e7eb50
commit 9cd72c6ef2
9 changed files with 709 additions and 229 deletions

View File

@ -112,7 +112,8 @@
"path": "pages/ArtWorks/ArtWorks",
"style": {
"navigationBarTitleText": "文艺作品",
"enablePullDownRefresh": false
"enablePullDownRefresh": true,
"onReachBottomDistance": 20
}
}

View File

@ -1,8 +1,12 @@
<template>
<view>
<view class="">
<u-loading-page :loading="load"></u-loading-page>
</view>
<view v-if="load == false">
<u-search height=42 margin="12px 0" searchIconColor="#251B1D" shape="square" :showAction="false"
v-model="artValue" placeholder="请输入名家名称"></u-search>
<u-tabs :scrollable="false" :list="list1" :activeStyle="{
<u-tabs :scrollable="false" @click="clickTabs" :list="list1" :activeStyle="{
color: '#251B1D',
fontWeight: 'bold',
transform: 'scale(1.05)'
@ -49,32 +53,142 @@
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
load: true,
isLoveList: [true, false, true, false],
artValue: '',
list1: [{
name: '全部',
}, {
name: '书法',
}, {
name: '绘画'
}, {
name: '雕刻'
}, {
name: '摄影'
}, {
name: '其他'
}]
type: '',
}],
workList: [],
pages: 1,
size: 20,
};
},
//
onPullDownRefresh() {
this.pages = 1
this.getData()
setTimeout(function () {
uni.stopPullDownRefresh();
}, 1000);
},
//
onReachBottom(){
this.pages++
this.getMoreData();
},
onShow() {
this.list1=[{
name: '全部',
type: '',
}],
this.pages = 1
this.getData()
this.getType()
},
methods: {
//
getType() {
let _this = this
this.http.request('/works/select?code=work_type', {}, "GET").then(res => {
if (res.code == 200) {
res.data.forEach(function(item){
_this.list1.push({
name: item.label,
value: item.value
})
})
_this.load = false
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
getData(){
let _this = this
this.http.request('/works/list', {page:this.pages,size:this.size}, "GET").then(res => {
if (res.code == 200) {
_this.load = false
_this.workList = res.data.records
_this.workList.forEach(function(item){
if(item.images != undefined){
let img = JSON.parse(item.images)
item.images = img[0]
}
//
if(item.file != undefined){
let fileArr = item.file.split(',')
let gs = fileArr[0].substr(fileArr[0].lastIndexOf(".") + 1)
if(gs == 'jpg' || gs == 'jpeg' || gs == 'png'){
item.file = fileArr[0]
}else if(gs == 'doc' || gs == 'docx'){
item.file = '../../static/fileImg/workB'
}else if(gs == 'xls' || gs == 'xlsx'){
item.file = '../../static/fileImg/workB'
}else if(gs == 'pdf'){
item.file = '../../static/fileImg/pdfB'
}else if(gs == 'txt'){
item.file = '../../static/fileImg/pdfB'
}
}
})
console.log(_this.workList)
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
getMoreData(){
const _this = this
this.http.request('/works/list',{page:this.pages,size:this.size},"GET").then(res => {
res.data.records.forEach(function(item){
if(item.images != undefined){
let img = JSON.parse(item.images)
item.images = img[0]
}
//
if(item.file != undefined){
let fileArr = item.file.split(',')
let gs = fileArr[0].substr(fileArr[0].lastIndexOf(".") + 1)
if(gs == 'jpg' || gs == 'jpeg' || gs == 'png'){
item.file = fileArr[0]
}else if(gs == 'doc' || gs == 'docx'){
item.file = '../../static/fileImg/workB'
}else if(gs == 'xls' || gs == 'xlsx'){
item.file = '../../static/fileImg/workB'
}else if(gs == 'pdf'){
item.file = '../../static/fileImg/pdfB'
}else if(gs == 'txt'){
item.file = '../../static/fileImg/pdfB'
}
}
_this.workList.push(item)
})
}).catch(e => {
uni.showToast({
title:e.data.message,
icon:"none",
});
})
},
like(i) {
this.$set(this.isLoveList, i, !this.isLoveList[i])
},
toDetail(val){
@ -82,6 +196,9 @@
uni.navigateTo({
url:"/pages/ArtWorks/artWorkDetail"
})
},
clickTabs(item){
console.log('item', item);
}
}
}

View File

@ -1,50 +1,218 @@
<template>
<view>
<!-- 发布作品 -->
<u--input style="padding: 32rpx;" placeholder="请输入作品名称" border="bottom" clearable></u--input>
<u--input style="padding: 32rpx;" placeholder="请选择作品类型" border="bottom" clearable>
<u-icon slot="suffix" name="arrow-right"></u-icon>
</u--input>
<u--textarea style="padding: 32rpx;" v-model="value" placeholder="请输入作品说明" border="none"></u--textarea>
<view class="gap">
作品内容可上传图片/视频/音频等
<view class="">
<view class="">
<u-loading-page :loading="load"></u-loading-page>
</view>
<view v-if="load == false">
<!-- 发布作品 -->
<view class="rightBox">
<u--input placeholder="请输入作品名称" v-model="name" clearable border="none" style="color: #251B1D;margin-left: 32rpx;">
</u--input>
</view>
<!-- 作品类型 -->
<view class="rightBox" @click="showType=true">
<text class="right_titl" style="color: #c0c4cc; font-size: 15px;margin-left: 32rpx;">请选择作品类型</text>
<u--input fontSize="30rpx" border="none" readonly v-model="v1" disabledColor="#ffffff"
inputAlign="right">
<u-icon slot="suffix" name="arrow-right" style="margin-right: 10px;"></u-icon>
</u--input>
</view>
<u-popup :show="showType" @close="close" @open="open" closeOnClickOverlay :round="5"
customStyle="padding: 16px;">
<u-radio-group @change="selectForm1" v-model="radiovalue1" :borderBottom="true" placement="column"
iconPlacement="right">
<u-radio :customStyle="{marginBottom: '16px' }" v-for="(item, index) in radiolist1" :key="index"
:label="item.label" labelSize="28rpx" labelColor="#231F1C" :name="item.label"
activeColor="#99241B ">
</u-radio>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="showType=false">确认</u-button>
</u-radio-group>
</u-popup>
<!-- 作品标签 -->
<view class="rightBox" @click="showTab=true">
<text class="right_titl" style="color: #c0c4cc; font-size: 15px;margin-left: 32rpx;">请选择作品标签</text>
<u--input fontSize="30rpx" border="none" readonly v-model="v2" disabledColor="#ffffff"
inputAlign="right">
<u-icon slot="suffix" name="arrow-right" style="margin-right: 10px;"></u-icon>
</u--input>
</view>
<u-popup :show="showTab" @close="close" @open="open" closeOnClickOverlay :round="5"
customStyle="padding: 16px;">
<u-checkbox-group @change="selectForm2" v-model="radiovalue2" :borderBottom="true" placement="column"
iconPlacement="right">
<u-checkbox :customStyle="{marginBottom: '16px' }" v-for="(item, index) in radiolist2" :key="index"
:label="item.tagName" labelSize="28rpx" labelColor="#231F1C" :name="item.tagName"
activeColor="#99241B ">
</u-checkbox>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="showTab=false">确认</u-button>
</u-checkbox-group>
</u-popup>
<u-upload class="upload" accept="media" width="172rpx" height="172rpx" :fileList="fileList3"
@afterRead="afterRead" @delete="deletePic" name="3" multiple :maxCount="2">
<u--textarea style="padding: 32rpx;" v-model="detailValue" placeholder="请输入作品说明" border="none">
</u--textarea>
<view class="gap">
作品内容可上传图片/音频/word/pdf/txt等
</view>
<view class="gap" style="line-height: 30rpx;">
(若有图片请先上传图片)
</view>
<!-- H5下的上传 -->
<u-upload v-if="iswx == 1" class="upload" accept="file" width="172rpx" height="172rpx" :fileList="fileList3"
@afterRead="afterRead" @delete="deletePic" name="3" multiple>
<image style="width: 172rpx;height: 172rpx;" src="../../static/improveData/jia.png"></image>
</u-upload>
<!-- 微信小程序下的上传 -->
<u-upload v-else-if="iswx == 0" class="upload" accept="all" width="172rpx" height="172rpx"
:fileList="fileList3" @afterRead="afterRead" @delete="deletePic" name="3" multiple>
<image style="width: 172rpx;height: 172rpx;" src="../../static/improveData/jia.png"></image>
</u-upload>
<view class="operation">
<button type="default" class="next" @click="next">下一步</button>
</view>
<view class="zhanwei">
</view>
</view>
</template>
<script>
import http from '../../request/interface.js'
export default {
data() {
return {
value: '',
load: true,
detailValue: '',
name: '',
fileList3: [],
iswx: null,
showType: false,
showTab: false,
v1: "",
v2: "",
tabs:[],
imgs:[],
radiovalue1: '',
radiolist1: [],
radiovalue2: [],
radiolist2: [],
worksVo: {
buy: "",
code: "",
file: "",
introduce: "",
name: "",
price: 0,
type: "",
usePermission: "",
wpPath: "",
}
};
},
onShow() {
this.getType()
this.getTab()
},
onReady() {
// this.load = false
// #ifdef MP-WEIXIN
this.iswx = 0
// #endif
// #ifndef MP-WEIXIN
//
this.iswx = 1
// #endif
},
methods: {
getType() {
let _this = this
this.http.request('/works/select?code=work_type', {}, "GET").then(res => {
if (res.code == 200) {
_this.radiolist1 = res.data
_this.load = false
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
getTab() {
let _this = this
this.http.request('/works/tag', {}, "GET").then(res => {
if (res.code == 200) {
_this.radiolist2 = res.data
_this.load = false
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
next() {
let _this = this
if(this.name == ''){
uni.showToast({
title: '作品名称不能为空',
icon: "none",
});
return
}
if(this.v1 == ''){
uni.showToast({
title: '作品类型不能为空',
icon: "none",
});
return
}
if(this.v2 == ''){
uni.showToast({
title: '作品标签不能为空',
icon: "none",
});
return
}
if(this.detailValue == ''){
uni.showToast({
title: '作品说明不能为空',
icon: "none",
});
return
}
if(this.fileList3.length == 0){
uni.showToast({
title: '作品内容不能为空',
icon: "none",
});
return
}
this.worksVo.name = this.name
this.worksVo.introduce = this.detailValue
this.radiolist1.forEach((item) =>{
if(_this.v1 == item.label){
_this.worksVo.type = item.value
}
})
let tabList = []
this.radiolist2.forEach((item) =>{
this.tabs.forEach((ele) =>{
if(ele == item.tagName){
tabList.push(item.id)
}
})
})
this.worksVo.workTag = tabList.join(',')
let imgList = []
this.fileList3.forEach((item) => {
imgList.push(item.url)
})
this.worksVo.file = imgList.join(',')
uni.navigateTo({
url: "/pages/PublishWorks/PublishWorksNext"
url: "/pages/PublishWorks/PublishWorksNext?worksVo=" + encodeURIComponent(JSON.stringify(this.worksVo))
})
},
//
@ -77,7 +245,7 @@
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://192.168.2.21:7001/upload', //
url: http.config.baseUrl + '/upload/upload',
filePath: url,
name: 'file',
formData: {
@ -85,11 +253,23 @@
},
success: (res) => {
setTimeout(() => {
resolve(res.data.data)
resolve(JSON.parse(res.data).data.path)
}, 1000)
}
});
})
},
selectForm1(form) {
this.v1 = form
},
close() {
this.showType = false
this.showTab = false
},
selectForm2(form) {
let data = form
this.tabs = form
this.v2 = data.join(',')
}
}
}
@ -101,19 +281,26 @@
height: 100%;
}
.gap {
font-size: 24rpx;
color: #AFADB0;
height: 80rpx;
height: 50rpx;
background: #F5F5F5;
border-radius: 0px 0px 0px 0px;
opacity: 1;
line-height: 80rpx;
line-height: 50rpx;
padding: 0 32rpx;
}
.rightBox {
display: flex;
align-items: center;
justify-content: space-between;
height: 104rpx;
border: 1px solid transparent;
border-bottom: 1rpx solid #dadbde;
}
.upload {
padding: 32rpx;
}

View File

@ -1,116 +1,266 @@
<template>
<view>
<view class="">
<u-loading-page :loading="load"></u-loading-page>
</view>
<view v-if="load == false">
<view class="bg">
<image src="../../static/puplishBG.png" mode=""></image>
</view>
<view class="rightBox" @click="showBuy=true">
<text class="right_titl" style="color: #251B1D; font-weight: 600;margin-left: 32rpx;">作品使用权限</text>
<u--input fontSize="28rpx" border="none" readonly v-model="v2" disabledColor="#ffffff"
placeholder="请选择作品使用权限" inputAlign="right">
<u-icon slot="suffix" name="arrow-right"></u-icon>
</u--input>
</view>
<view class="rightBox" @click="showSex=true">
<text class="right_titl" style="color: #251B1D; font-weight: 600;margin-left: 32rpx;"> 作品使用权限</text>
<view class="rightBox" @click="showSex=true" v-if="v2=='可购买'">
<text class="right_titl" style="color: #251B1D; font-weight: 600;margin-left: 32rpx;">支付方式</text>
<u--input fontSize="28rpx" border="none" readonly v-model="v1" disabledColor="#ffffff"
placeholder="请选择作品使用权限" inputAlign="right">
<u-icon slot="suffix" name="arrow-right"></u-icon>
</u--input>
</view>
<view class="sub_ti_box" v-if="v1=='付费购买'" >
<view class="sub_ti_box" v-if="v1=='付费购买'">
<text class="right_titl">使用费用</text>
<u--input placeholder="请输入使用费用" inputAlign="right" border="none" type="number" value=""></u--input> <text
<u--input placeholder="请输入使用费用" inputAlign="right" border="none" type="number" v-model="price"></u--input> <text
style="margin-left: 16rpx;"></text>
</view>
<view class="sub_ti_box" v-if="v1=='积分购买'" >
<text class="right_titl">使用积分</text>
<u--input placeholder="请输入使用积分" inputAlign="right" type="number" border="none" value=""></u--input> <text style="margin-left: 16rpx;"></text>
<view class="sub_ti_box" v-if="v1=='付费购买'">
<text class="right_titl">网盘地址</text>
<u--input placeholder="请输入网盘地址" inputAlign="right" border="none" v-model="wpPath"></u--input> <text
style="margin-left: 16rpx;"></text>
</view>
<view class="sub_ti_box" v-if="v1=='付费购买'">
<text class="right_titl">提取码</text>
<u--input placeholder="请输入提取码" inputAlign="right" border="none" v-model="code"></u--input> <text
style="margin-left: 16rpx;"></text>
</view>
<view class="sub_ti_box" v-if="v1=='积分购买'">
<text class="right_titl">使用积分</text>
<u--input placeholder="请输入使用积分" inputAlign="right" type="number" border="none" v-model="price"></u--input> <text
style="margin-left: 16rpx;">积分</text>
</view>
<view class="sub_ti_box" v-if="v1=='积分购买'">
<text class="right_titl">网盘地址</text>
<u--input placeholder="请输入网盘地址" inputAlign="right" border="none" v-model="wpPath"></u--input> <text
style="margin-left: 16rpx;"></text>
</view>
<view class="sub_ti_box" v-if="v1=='积分购买'">
<text class="right_titl">提取码</text>
<u--input placeholder="请输入提取码" inputAlign="right" border="none" v-model="code"></u--input> <text
style="margin-left: 16rpx;"></text>
</view>
<u-popup :show="showBuy" @close="close" @open="open" closeOnClickOverlay :round="5"
customStyle="padding: 16px;">
<u-radio-group @change="selectFormB" v-model="radiovalue1" :borderBottom="true" placement="column"
iconPlacement="right">
<u-radio :customStyle="{marginBottom: '16px' }" v-for="(item, index) in radiolist1" :key="index"
:label="item.label" labelSize="28rpx" labelColor="#231F1C" :name="item.label" activeColor="#99241B ">
</u-radio>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="showBuy=false">确认</u-button>
</u-radio-group>
</u-popup>
<u-popup :show="showSex" @close="close" @open="open" closeOnClickOverlay :round="5"
customStyle="padding: 16px;">
<u-radio-group @change="selectForm" v-model="radiovalue7" :borderBottom="true" placement="column"
iconPlacement="right">
<u-radio :customStyle="{marginBottom: '16px' }" v-for="(item, index) in radiolist7" :key="index"
:label="item.name" labelSize="28rpx" labelColor="#231F1C" :name="item.name" activeColor="#99241B ">
:label="item.label" labelSize="28rpx" labelColor="#231F1C" :name="item.label" activeColor="#99241B ">
</u-radio>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="showSex=false">确认</u-button>
</u-radio-group>
</u-popup>
<view class="operation">
<button type="default" class="collection" @click="goPre">上一步</button>
<button type="default" class="apply" @click="cfmPub()">确认发布</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
load:true,
showBuy: false,
showSex: false,
v1: "",
v2: "",
price:'',
wpPath:'',
code:'',
radiovalue1: '',
radiolist1: [],
radiovalue7: '',
radiolist7: [{
name: '免费使用',
disabled: false
},
{
name: '付费购买',
disabled: false
},
{
name: '积分购买',
disabled: false
},
{
name: '面议',
disabled: false
}
],
radiolist7: [],
radio: '',
switchVal: false
switchVal: false,
worksVo: {},
};
},
onLoad(op) {
this.worksVo = JSON.parse(decodeURIComponent(op.worksVo));
},
onShow() {
this.getQx()
this.getFs()
},
methods: {
goPre() {
uni.navigateTo({
url: "/pages/PublishWorks/PublishWorks"
getQx() {
let _this = this
this.http.request('/works/select?code=use_permission', {}, "GET").then(res => {
if (res.code == 200) {
_this.radiolist1 = res.data
_this.load = false
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
cfmPub() {
getFs() {
let _this = this
this.http.request('/works/select?code=purchase_method', {}, "GET").then(res => {
if (res.code == 200) {
_this.radiolist7 = res.data
_this.load = false
}
}).catch(e => {
uni.showToast({
title: '确认发布',
duration: 2000
title: e.data.message,
icon: "none",
});
})
},
goPre() {
uni.navigateBack()
// uni.navigateTo({
// url: "/pages/PublishWorks/PublishWorks"
// })
},
cfmPub() {
let _this = this
if(this.v2 == ''){
uni.showToast({
title: '使用权限不能为空',
icon: "none",
});
return
}
if(this.v2 == '可购买' && this.v1 == ''){
uni.showToast({
title: '支付方式不能为空',
icon: "none",
});
return
}
if(this.v2 == '可购买' && this.v1 == '付费购买' && this.price == ''){
uni.showToast({
title: '价格不能为空',
icon: "none",
});
return
}
if(this.v2 == '可购买' && this.v1 == '付费购买' && this.wpPath == ''){
uni.showToast({
title: '网盘地址不能为空',
icon: "none",
});
return
}
if(this.v2 == '可购买' && this.v1 == '付费购买' && this.code == ''){
uni.showToast({
title: '提取码不能为空,若不需要提取码请填‘无’',
icon: "none",
});
return
}
if(this.v2 == '可购买' && this.v1 == '积分购买' && this.price == ''){
uni.showToast({
title: '价格不能为空',
icon: "none",
});
return
}
if(this.v2 == '可购买' && this.v1 == '积分购买' && this.wpPath == ''){
uni.showToast({
title: '网盘地址不能为空',
icon: "none",
});
return
}
if(this.v2 == '可购买' && this.v1 == '积分购买' && this.code == ''){
uni.showToast({
title: '提取码不能为空,若不需要提取码请填‘无’',
icon: "none",
});
return
}
this.radiolist1.forEach((item) =>{
if(_this.v2 == item.label){
_this.worksVo.usePermission = item.value
}
})
this.radiolist7.forEach((item) =>{
if(_this.v1 == item.label){
_this.worksVo.buy = item.value
}
})
this.worksVo.price = this.price
this.worksVo.wpPath = this.wpPath
this.worksVo.code = this.code
console.log(this.worksVo)
this.http.request('/works/addWork', this.worksVo, "POST").then(res => {
if (res.code == 200) {
uni.redirectTo({
url: "/pages/pageHome/pageHome"
})
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
// uni.showToast({
// title: '',
// duration: 2000
// });
},
sexSelect(e) {
this.model1.userInfo.rights = e.name
} ,
selectForm(form) {
this.v1 = form
},
close(){
this.showSex=false
selectForm(form) {
this.v1 = form
this.price = ''
this.wpPath = ''
this.code = ''
},
selectFormB(form) {
this.v2 = form
this.v1 = ''
this.price = ''
this.wpPath = ''
this.code = ''
},
close() {
this.showSex = false
this.showBuy = false
}
}
}
@ -135,10 +285,14 @@
margin-top: 16rpx;
}
.sub_ti_box{
display: flex; align-items: center; margin: 0 32rpx;
.sub_ti_box {
display: flex;
align-items: center;
margin: 0 32rpx;
padding: 32rpx 0;
.right_titl{
.right_titl {
font-weight: 600;
color: $black;
}

View File

@ -572,9 +572,7 @@
console.log(option.id);
this.pageTypeId = option.id
},
onReady() {
this.$refs.form1.setRules(this.rules);
this.http.request('/association/list', {}, "GET").then((res) => {

View File

@ -1,5 +1,10 @@
<template>
<view>
<view class="">
<view class="">
<u-loading-page :loading="load"></u-loading-page>
</view>
<view v-if="load == false">
<view class="navbar" v-show="opCalue>0" :style="{'opacity':opCalue}">
<view class="status_bar" :style="{'height':statusHeight+'px'}"></view>
<view class="apptitle" :style="{'height':titleHeight+'px'}">
@ -57,15 +62,16 @@
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
load: true,
statusHeight: 0,
titleHeight: 50,
opCalue:0,
@ -83,7 +89,24 @@
num: 4
};
},
onShow() {
this.getData()
},
methods:{
getData(){
let _this = this
this.http.request('/silhouette/list', {}, "GET").then(res => {
if (res.code == 200) {
console.log(res.data)
_this.load = false
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
back(){
uni.navigateBack()
},

View File

@ -7,7 +7,7 @@ export default {
config: {
// baseUrl: "http://192.168.0.57:8090/h5/api", //王锡
// baseUrl: "http://192.168.124.110:8088/api", //周源
baseUrl: "http://192.168.0.11:8080/h5/api", //俞燕红
baseUrl: "http://192.168.0.29:8080/h5/api", //俞燕红
// baseUrl: "https://wlsq.ydool.com.cn/api", //线上
header: {
'Content-Type': 'application/json;charset=UTF-8',

BIN
src/static/fileImg/pdfB.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB