Merge branch 'master' of git.zdool.com:xs/yyx/h5

This commit is contained in:
闫世杰 2023-08-03 11:54:53 +08:00
commit 67e778cd65
5 changed files with 372 additions and 202 deletions

View File

@ -655,4 +655,4 @@
"navigationBarBackgroundColor": "#FFFFFF", //
"backgroundColor": "#F8F8F8" //
}
}
}

View File

@ -8,12 +8,12 @@
<u-tabs :list="list1" @click="click" lineColor="#99241B"></u-tabs>
</view>
<view class="art_race_itm" v-for="(v,i) in dataList" :key="i" @click="goRaceDetail(v.id)">
<image style="width: 100%; height: 296rpx;" src="../../static/orderE.png" mode=""></image>
<image style="width: 100%; height: 296rpx;" :src="v.file" mode=""></image>
<view class="art_race_bot">
<text class="art_title">{{v.title}}</text>
<text class="art_title">{{v.name}}</text>
<view class="art_race_con u-line-2">{{v.content}}</view>
<view class="art_race_con">
截止时间{{v.time}}
截止时间{{v.endTime}}
</view>
</view>
</view>
@ -25,86 +25,87 @@
export default {
data() {
return {
load: false,
load: true,
list1: [{
name: '关注',
},
{
name: '推荐',
},
{
name: '电影'
},
{
name: '科技'
},
{
name: '音乐'
},
{
name: '美食'
},
{
name: '文化'
},
{
name: '财经'
},
{
name: '手工'
}
],
dataList: [{
id: '111',
title: '艺起战疫',
content: '寒冬虽冷,美术工作者们以画传心,心是热的;疫情虽紧,艺术家们以笔墨为歌,信心是充足的。在市委宣传部和市递正能量,吹响新时代的',
time: '2023-09-30 20:00'
},
{
id: '111',
title: '艺起战疫',
content: '寒冬虽冷,美术工作者们以画传心,心是热的;疫情虽紧,艺术家们以笔墨为歌,信心是充足的。在市委宣传部和市递正能量,吹响新时代的',
time: '2023-09-30 20:00'
},
{
id: '111',
title: '艺起战疫',
content: '寒冬虽冷,美术工作者们以画传心,心是热的;疫情虽紧,艺术家们以笔墨为歌,信心是充足的。在市委宣传部和市递正能量,吹响新时代的',
time: '2023-09-30 20:00'
},
{
id: '111',
title: '艺起战疫',
content: '寒冬虽冷,美术工作者们以画传心,心是热的;疫情虽紧,艺术家们以笔墨为歌,信心是充足的。在市委宣传部和市递正能量,吹响新时代的',
time: '2023-09-30 20:00'
}
],
name: '全部',
value: '',
}],
dataList: [],
pages: 1,
size: 20,
type: ''
};
},
onLoad() {
this.getType()
},
//
onPullDownRefresh() {
this.pages = 1
this.dataList = []
this.getData()
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
//
onReachBottom() {
this.pages++
this.load = true
this.getData();
},
methods: {
goRaceDetail(id) {
console.log(id);
uni.navigateTo({
url: "/pagesB/ArtRace/ArtRaceDetail?id=" + String(id),
})
},
click(item) {
console.log('item', item);
this.type = item.value
this.pages = 1
this.getData()
},
getType() {
let that = this
this.http.request('/competition/types', {}, "GET").then(res => {
if (res.code == 200) {
res.data.forEach(item => {
that.list1.push({
name: item.label,
value: item.value
})
})
this.getData()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
getData() {
let that = this
let par = {
pages: this.pages,
page: this.pages,
size: this.size,
type: this.type
}
this.http.request('/match/list', {}, "GET").then(res => {
this.http.request('/competition/list', par, "GET").then(res => {
if (res.code == 200) {
if (res.data.records.length > 0) {
res.data.records.forEach(function(item) {
if (item.file) {
let fileArr = item.file.split(',')
item.file = fileArr[0]
}
that.dataList.push(item)
})
} else {
this.pages--
}
this.load = false
}
}).catch(e => {

View File

@ -16,14 +16,7 @@
</u-swiper>
</view>
<view class="main">
<view class="mainTitle">{{data.title}}</view>
<view class="textList">
<view class="type">
<img class='textImg' src="../../static/detailIcon/icon10.png" alt="">
<view class="text1">比赛简介</view>
</view>
<view class="text2">{{data.demand}}</view>
</view>
<view class="mainTitle">{{data.name}}</view>
<view class="textList">
<view class="type">
<img class='textImg' src="../../static/detailIcon/icon10.png" alt="">
@ -53,30 +46,30 @@
<image class="icon" src="../../static/detailIcon/icon6.png" mode="scaleToFill"></image>
<text> 可接单人数:</text>
</view>
<view class="content"><text style=" color: #99241B;"> {{data.jdrs}}</text>/{{data.quantity}}
<view class="content"><text style=" color: #99241B;"> {{data.enrollment}}</text>/{{data.maxNum}}
</view>
</view>
<view class="item_li">
<view class="standard">
<image class="icon" src="../../static/detailIcon/icon7.png" mode="scaleToFill"></image>
<text>截止时间:</text>
<text>报名截止时间:</text>
</view>
<view class="content"> {{data.deadline}}</view>
<view class="content"> {{data.startTime}}</view>
</view>
<view class="item_li">
<view class="standard">
<image class="icon" src="../../static/detailIcon/icon4.png" mode="scaleToFill"></image>
<text>活动时间:</text>
<text>活动结束时间:</text>
</view>
<view class="content"> {{data.activityTime}} </view>
<view class="content"> {{data.endTime}} </view>
</view>
</view>
</view>
<!-- 红色按钮 -->
<view>
<view class="" v-if="data.hallState == 1">
<view class="orderBtn" v-if="data.isBaoming">
<view class="btnQ" @click="throwWork">取消报名</view>
<view class="" v-if="data.status == 0">
<view class="orderBtn" v-if="data.isApplication">
<view class="btnQ">您已报名</view>
</view>
<view class="orderBtn" v-else>
<view class="btn" @click="throwWork">报名</view>
@ -96,7 +89,7 @@
<text>参赛作品展示</text>
</view>
<view class="worksPart">
<view class="workItems" v-for="(v,i) in workList" :key="i">
<view class="workItems" v-if="workList.length > 0" v-for="(v,i) in workList" :key="i">
<view class="workImg">
<image :src="v.img" style="width: 100%; height: 100%;"></image>
</view>
@ -104,6 +97,10 @@
{{v.name}}
</view>
</view>
<view v-else>
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" >
</u-empty>
</view>
</view>
</view>
</view>
@ -115,47 +112,14 @@
export default {
data() {
return {
load: false,
id: '',
load: true,
statusHeight: 0,
titleHeight: 50,
currentNum: 0,
list: [
'../../static/blackArrow.png'
],
data: {
title: '标题',
demand: '简介',
content: 'FDA施工队发生噶v通过热巴v我提个阿萨出发',
deadline: '2023-02-02',
activityTime: '2023-02-02',
jdrs: '10',
quantity: '10',
typeName: '类型',
hallState: '1',
isBaoming: false
},
workList: [
{
name: '111',
img: '../../static/detailIcon/icon0.png'
},
{
name: '222',
img: '../../static/detailIcon/icon0.png'
},
{
name: '333',
img: '../../static/detailIcon/icon0.png'
},
{
name: '444',
img: '../../static/detailIcon/icon0.png'
},
{
name: '555',
img: '../../static/detailIcon/icon0.png'
}
]
list: [],
data: {},
workList: []
};
},
methods: {
@ -164,7 +128,30 @@
},
throwWork() {
uni.navigateTo({
url: "/pagesB/ArtRace/ThrowWork"
url: "/pagesB/ArtRace/ThrowWork?id=" + this.id
})
},
getDate() {
let par = {
id: this.id,
}
this.http.request('/competition/details', par, "GET").then(res => {
if (res.code == 200) {
if(res.data.file){
this.list = res.data.file.split(',')
}
// if(res.data.list || res.data.list.lenght > 0){
// }
this.data = res.data
this.workList = res.data.list
this.load = false
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
},
@ -184,9 +171,12 @@
// #endif
},
onLoad(opt) {
console.log(opt.id);
}
this.id = opt.id
},
onShow() {
this.load = true
this.getDate()
},
}
</script>

View File

@ -1,54 +1,56 @@
<template>
<view>
<u--form :model="model2" :rules="rules" ref="form2">
<u-form-item prop="userInfo.name" ref="item2" class="data_itm"></u-form-item>
</u--form>
<u--input style="padding: 32rpx;" placeholder="请输入作品名称" border="none" clearable></u--input>
<u--textarea style="padding: 32rpx; height: 200rpx;" v-model="value" placeholder="请输入作品说明" border="none"></u--textarea>
<view class="gap">
作品内容可上传图片/视频/音频等
<view class="">
<view class="form_line">
<view class="form_left">
名称
</view>
<view class="form_right">
<u--input placeholder="请输入名称" v-model="name" clearable border="none" inputAlign="right"
style="color: #251B1D;">
</u--input>
</view>
</view>
<u-upload class="upload" accept="media" width="172rpx" height="172rpx" :fileList="fileList3"
@afterRead="afterRead" @delete="deletePic" name="3" multiple :maxCount="2">
<view class="form_box">
<view class="form_left">
具体内容
</view>
</view>
<view class="text_box">
<u--textarea v-model="text2" placeholder="请输入具体内容" maxlength="-1"></u--textarea>
</view>
<view class="gap">
附件上传
</view>
<view class="gap" style="line-height: 30rpx;font-size: 28rpx;">
可上传图片(png/jpg/jpeg/bmp/gif/tif/tiff)
</view>
<u-upload class="upload" 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="throwMyWork">投稿</button>
</view>
<view class="zhanwei">
<view class="operation" @click="next">
发布
</view>
</view>
</template>
<script>
import http from '../../request/interface.js'
export default {
data() {
return {
value: '',
id: '',
name: '',
text2: '',
fileList3: [],
model2:{
workName:'',
workDesc:''
},
rules:{
}
};
ok: true,
}
},
onLoad(op){
this.id = op.id
},
methods: {
throwMyWork() {
uni.showToast({
title:"投稿作品"
})
/* uni.navigateTo({
url: "/pagesB/PublishWorks/PublishWorksNext"
}) */
},
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
@ -80,7 +82,7 @@
let token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://192.168.2.21:7001/upload', //
url: http.config.baseUrl + '/file/upload',
filePath: url,
name: 'file',
formData: {
@ -90,34 +92,126 @@
"X-Token": token
},
success: (res) => {
setTimeout(() => {
resolve(res.data.data)
}, 1000)
if (JSON.parse(res.data).code == 200) {
setTimeout(() => {
resolve(JSON.parse(res.data).data.path)
}, 1000)
} else {
uni.showToast({
title: JSON.parse(res.data).message,
icon: "none",
});
this.fileList3.pop()
}
}
});
})
},
next() {
this.ok = true
if(this.name == ''){
uni.showToast({
title: '请输入名称',
icon: "none",
});
this.ok = false
return
}
if(this.text2 == ''){
uni.showToast({
title: '请输入具体内容',
icon: "none",
});
this.ok = false
return
}
if(this.fileList3.length == 0){
uni.showToast({
title: '请上传附件',
icon: "none",
});
this.ok = false
return
}
if(this.ok){
let image = []
this.fileList3.forEach(function(item) {
image.push(item.url)
})
let data = image.join(',')
this.http.request('/competitionUser/addCompetition', {
competitionId: this.id,
introduce: this.text2,
name: this.name,
file: data
}, "POST").then(res => {
if (res.code == 200) {
uni.navigateBack()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
}
}
}
</script>
<style lang="scss">
image {
width: 100%;
height: 100%;
<style>
</style>
<style lang="scss" scoped>
/deep/ .uni-icons{
display: none;
}
/deep/ .uni-date-x{
text-align: right;
padding: 0;
}
.form_line {
width: 686rpx;
padding: 0 32rpx;
display: flex;
align-items: center;
font-size: 32rpx;
justify-content: space-between;
height: 104rpx;
border-bottom: 1rpx solid #dadbde;
.form_right {
width: 450rpx;
}
}
.form_box {
width: 686rpx;
padding: 0 32rpx;
display: flex;
align-items: center;
font-size: 32rpx;
justify-content: space-between;
height: 104rpx;
}
.text_box {
width: 686rpx;
padding: 0 32rpx;
}
.gap {
font-size: 24rpx;
color: #AFADB0;
height: 80rpx;
background: #F5F5F5;
border-radius: 0px 0px 0px 0px;
opacity: 1;
line-height: 80rpx;
padding: 0 32rpx;
padding: 10rpx 32rpx;
font-size: 32rpx;
}
::v-deep .u-upload__wrap {
padding: 32rpx;
}
.upload {
@ -125,39 +219,14 @@
}
.operation {
display: flex;
justify-content: space-between;
align-items: center;
padding: 32rpx 32rpx 48rpx;
position: fixed;
left: 0;
bottom: 0;
right: 0;
background-color: #FFFFFF;
box-shadow: 0px -4px 10px 1px rgba(192, 192, 192, 0.12);
.next {
width: calc(100% - 48rpx);
height: 80rpx;
line-height: 80rpx;
background-color: #99241B;
color: #fff;
font-size: 32rpx;
font-weight: 600;
border: none;
button {
&::after {
border: none;
}
}
}
}
.zhanwei {
height: 460rpx;
width: 654rpx;
height: 96rpx;
margin: 32rpx 48rpx 48rpx;
text-align: center;
line-height: 96rpx;
background-color: #99241B;
color: #fff;
font-size: 36rpx;
font-weight: 600;
}
</style>

View File

@ -0,0 +1,110 @@
<template>
<view class="">
<view class="">
<u-loading-page :loading="load"></u-loading-page>
</view>
<view class="layout" v-if="load == false">
<view class="shelves">
<u-empty v-if="writerList.length < 1" mode="data" icon="../../static/orderE.png" style="margin-top: 120px;">
</u-empty>
<view class="shelves-item" v-for="(item,index) in writerList" :key="index" @click="ToEnjoy(item.id)">
<image :src="item.images" class="shelves-img"></image>
<view class="name">{{item.userName}}</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
load: true,
writerList: [],
pages: 1,
size: 20,
};
},
onLoad() {
this.getworkList()
},
//
onPullDownRefresh() {
this.pages = 1
this.writerList = []
this.getArtist()
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
//
onReachBottom() {
this.pages++
this.getArtist();
},
methods: {
getworkList(){
let _this = this
this.http.request('/competitionUser/scoreList', {page:this.pages,size:this.size}, "GET").then(res => {
if (res.code == 200) {
if(res.data.records.length > 0){
res.data.records.forEach(function(item) {
// if (item.images) {
// // let img = JSON.parse(item.images)
// // item.images = img[0]
// }else{
// item.images = '../../static/txIcon.png'
// }
_this.writerList.push(item)
})
}else{
this.pages--
}
this.load = false
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
ToEnjoy(val){
uni.navigateTo({
url:"/pagesC/famousArts/famousArts?id=" + val
})
},
},
}
</script>
<style lang="scss">
.layout {
padding: 16rpx 32rpx;
.shelves {
width: 100%;
.shelves-item {
width: 311rpx;
margin-top: 32rpx;
margin-left: 16rpx;
margin-right: 16rpx;
float: left;
.shelves-img {
border-radius: 8px 8px 8px 8px;
width: 311rpx;
height: 380rpx;
}
.name {
font-weight: 800;
font-size: 16px;
margin-top: 12rpx;
}
}
}
}
</style>