This commit is contained in:
lnn19986213 2022-05-10 09:34:51 +08:00
parent a25f8d4859
commit 64b84da4d2
29 changed files with 937 additions and 686 deletions

View File

@ -126,6 +126,14 @@
"enablePullDownRefresh": false
}
}
, {
"path": "pages/ArtWorks/webView",
"style": {
"navigationBarTitleText": "文件浏览",
"enablePullDownRefresh": false
}
}
//
, {

View File

@ -1,387 +1,373 @@
<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="请输入名家名称" @search='search'></u-search>
<u-tabs :scrollable="false" @click="clickTabs" :list="list1" :activeStyle="{
<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="请输入名家名称" @search='search'></u-search>
<u-tabs :scrollable="false" @click="clickTabs" :list="list1" :activeStyle="{
color: '#251B1D',
fontWeight: 'bold',
transform: 'scale(1.05)'
}"
:lineColor="`url(${lineBg}) 100% 100%`"
:inactiveStyle="{
color: '#AFADB0 ',
transform: 'scale(1)'
}" itemStyle=" height: 50px; ">
</u-tabs>
<view class="artworks">
<view class="art_item" v-for="(v, i) in workList" :key="i">
<view class="art_item_top">
<image :src="v.file" mode="" @click="toDetail(v.id)"></image>
<view class="like" @click="like(v.id, v.isGreat)">
<view :class="v.isGreat ? 'img_selected' : 'img'">
<!-- 红心 -->
</view>
<view class="select_num">
{{ v.likes }}
</view>
</view>
</view>
<view class=" art_item_bott" @click="toDetail(v.id)">
<view class="title">
{{ v.name }}
</view>
<view class="sub_title">
{{ v.type }}作品
</view>
<view class="img_box">
<view class=" puber">
<view class="avtor">
<image :src="v.user.images" mode=""></image>
</view>
<view class="autor">
{{ v.user.nickName }}
</view>
</view>
}" :lineColor="`url(${lineBg}) 100% 100%`" :inactiveStyle="{
color: '#AFADB0 ',
transform: 'scale(1)'
}" itemStyle="height: 50px;">
</u-tabs>
<view class="artworks">
<view class="art_item" v-for="(v, i) in workList" :key="i">
<view class="art_item_top">
<image :src="v.file" mode="" @click="toDetail(v.id)"></image>
<view class="like" @click="like(v.id, v.isGreat)">
<view :class="v.isGreat ? 'img_selected' : 'img'">
<!-- 红心 -->
</view>
<view class="select_num">
{{ v.likes }}
</view>
</view>
</view>
<view class=" art_item_bott" @click="toDetail(v.id)">
<view class="title">
{{ v.name }}
</view>
<view class="sub_title">
{{ v.type }}作品
</view>
<view class="img_box">
<view class=" puber">
<view class="avtor">
<image :src="v.user.images" mode=""></image>
</view>
<view class="autor">
{{ v.user.nickName }}
</view>
</view>
<view class="time">
{{ v.createdAt }}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="time">
{{ v.createdAt }}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
load: true,
artValue: '',
type: '',
list1: [{
name: '全部',
value: '',
}],
workList: [],
pages: 1,
size: 20, lineBg: '../../static/scrollLine.png',
};
},
//
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.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.getData()
}
}).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,
nickName: this.artValue,
workType: this.type
}, "GET").then(res => {
if (res.code == 200) {
_this.workList = res.data.records
_this.workList.forEach(function (item) {
if (item.user.images != undefined) {
let img = JSON.parse(item.user.images)
item.user.images = img[0]
}
//
if (item.type != undefined) {
_this.list1.forEach(function (ele) {
if (item.type == ele.value) {
item.type = ele.name
}
})
}
//
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.load = false
}
}).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,
nickName: this.artValue,
workType: this.type
}, "GET").then(res => {
if (res.data.records.length > 0) {
res.data.records.forEach(function (item) {
if (item.user.images != undefined) {
let img = JSON.parse(item.user.images)
item.user.images = img[0]
}
//
if (item.type != undefined) {
_this.list1.forEach(function (ele) {
if (item.type == ele.value) {
item.type = ele.name
}
})
}
//
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)
})
} else {
this.pages--
}
export default {
data() {
return {
load: true,
artValue: '',
type: '',
list1: [{
name: '全部',
value: '',
}],
workList: [],
pages: 1,
size: 20,
lineBg: '../../static/scrollLine.png',
};
},
//
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.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.getData()
}
}).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,
nickName: this.artValue,
workType: this.type
}, "GET").then(res => {
if (res.code == 200) {
_this.workList = res.data.records
_this.workList.forEach(function(item) {
if (item.user.images != undefined) {
let img = JSON.parse(item.user.images)
item.user.images = img[0]
}
//
if (item.type != undefined) {
_this.list1.forEach(function(ele) {
if (item.type == ele.value) {
item.type = ele.name
}
})
}
//
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' || gs == 'bmp' || gs == 'gif' || gs == 'tif' || gs == 'tiff') {
item.file = fileArr[0]
} else if (gs == 'pdf') {
item.file = '../../static/fileImg/pdfS.png'
}
}
})
_this.load = false
}
}).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,
nickName: this.artValue,
workType: this.type
}, "GET").then(res => {
if (res.data.records.length > 0) {
res.data.records.forEach(function(item) {
if (item.user.images != undefined) {
let img = JSON.parse(item.user.images)
item.user.images = img[0]
}
//
if (item.type != undefined) {
_this.list1.forEach(function(ele) {
if (item.type == ele.value) {
item.type = ele.name
}
})
}
//
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' || gs == 'bmp' || gs == 'gif' || gs == 'tif' || gs == 'tiff') {
item.file = fileArr[0]
} else if (gs == 'pdf') {
item.file = '../../static/fileImg/pdfS.png'
}
}
_this.workList.push(item)
})
} else {
this.pages--
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
like(val1, val2) {
if (val2) {
this.http.request('/worksGreat/delGreat?type=1&workId=' + val1, "POST").then(res => {
if (res.code == 200) {
this.pages = 1
this.getData()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
} else {
this.http.request('/worksGreat/addGreat?type=1&workId=' + val1, "POST").then(res => {
if (res.code == 200) {
this.pages = 1
this.getData()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
},
//
toDetail(val) {
uni.navigateTo({
url: "/pages/ArtWorks/artWorkDetail?id=" + val
})
},
//
clickTabs(item) {
this.type = item.value
this.pages = 1
this.getData()
},
search() {
this.pages = 1
this.getData()
}
}
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
like(val1, val2) {
if (val2) {
this.http.request('/worksGreat/delGreat?type=1&workId=' + val1, "POST").then(res => {
if (res.code == 200) {
this.pages = 1
this.getData()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
} else {
this.http.request('/worksGreat/addGreat?type=1&workId=' + val1, "POST").then(res => {
if (res.code == 200) {
this.pages = 1
this.getData()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
},
//
toDetail(val) {
uni.navigateTo({
url: "/pages/ArtWorks/artWorkDetail?id=" + val
})
},
//
clickTabs(item) {
this.type = item.value
this.pages = 1
this.getData()
},
search() {
this.pages = 1
this.getData()
}
}
}
</script>
<style lang="scss">
/deep/ .u-tabs__wrapper__nav__line {
height: 14px !important;
width: 30px !important;
background-color: transparent !important;
bottom: 2px !important;
}
/deep/ .u-tabs__wrapper__nav__line {
height: 14px !important;
width: 30px !important;
background-color: transparent !important;
bottom: 2px !important;
}
page {
width: calc(100% - 32px);
margin: 0 16px;
}
page {
width: calc(100% - 32px);
margin: 0 16px;
}
image {
width: 100%;
height: 100%;
}
image {
width: 100%;
height: 100%;
}
.art_item {
margin-top: 16px;
border: 1px solid transparent;
.art_item {
margin-top: 16px;
border: 1px solid transparent;
.art_item_top {
position: relative;
height: 192px;
overflow: hidden;
border-radius: 8px;
.art_item_top {
position: relative;
height: 192px;
overflow: hidden;
border-radius: 8px;
.like {
position: absolute;
top: calc(100% - 40px);
left: calc(100% - 70px);
width: 59px;
height: 32px;
background: rgba(38, 18, 18, 0.27);
z-index: 10;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
.like {
position: absolute;
top: calc(100% - 40px);
left: calc(100% - 70px);
width: 59px;
height: 32px;
background: rgba(38, 18, 18, 0.27);
z-index: 10;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
.img {
width: 16px;
height: 16px;
background: url(../../static/spaceHeart.png) center/100% no-repeat;
float: left;
}
.img {
width: 16px;
height: 16px;
background: url(../../static/spaceHeart.png) center/100% no-repeat;
float: left;
}
.img_selected {
width: 16px;
height: 16px;
background: url(../../static/redHerart.png) center/100% no-repeat;
float: left;
}
.img_selected {
width: 16px;
height: 16px;
background: url(../../static/redHerart.png) center/100% no-repeat;
float: left;
}
.select_num {
float: left;
margin-left: 10rpx;
color: #fff;
}
}
}
.select_num {
float: left;
margin-left: 10rpx;
color: #fff;
}
}
}
.select_num {
float: left;
margin-left: 10rpx;
color: #fff;
}
}
.select_num {
float: left;
margin-left: 10rpx;
color: #fff;
}
}
.art_item_bott {
.title {
margin-top: 12px;
font-size: 16px;
font-weight: 600;
color: #251B1D;
}
.art_item_bott {
.title {
margin-top: 12px;
font-size: 16px;
font-weight: 600;
color: #251B1D;
}
.sub_title {
font-size: 12px;
color: #AFADB0;
margin-top: 12px;
margin-bottom: 16px;
}
.sub_title {
font-size: 12px;
color: #AFADB0;
margin-top: 12px;
margin-bottom: 16px;
}
.img_box {
display: flex;
justify-content: space-between;
align-items: center;
.img_box {
display: flex;
justify-content: space-between;
align-items: center;
.puber {
display: flex;
align-items: center;
.puber {
display: flex;
align-items: center;
.avtor {
border-radius: 12px;
overflow: hidden;
width: 24px;
height: 24px;
margin-right: 4px;
}
.avtor {
border-radius: 12px;
overflow: hidden;
width: 24px;
height: 24px;
margin-right: 4px;
}
.autor {
color: #251B1D;
font-size: 12px;
}
}
.autor {
color: #251B1D;
font-size: 12px;
}
}
.time {
color: #AFADB0;
font-size: 12px;
}
}
}
.time {
color: #AFADB0;
font-size: 12px;
}
}
}
</style>

View File

@ -96,6 +96,7 @@
id: '',
iswx: 0,
detailData: {},
contractUrl: 'https://www.baidu.com/'
}
},
onLoad(op) {
@ -157,38 +158,19 @@
let fileArr = res.data.file.split(',')
fileArr.forEach(function(item) {
let gs = item.substr(item.lastIndexOf(".") + 1)
if (gs == 'jpg' || gs == 'jpeg' || gs == 'png') {
if (gs == 'jpg' || gs == 'jpeg' || gs == 'png' || gs == 'bmp' || gs == 'gif' || gs == 'tif' || gs == 'tiff') {
_this.list.push(item)
} else if (gs == 'doc' || gs == 'docx') {
_this.list2.push({
name: res.data.name + '.doc',
img: '../../static/fileImg/workB.png',
url: item,
})
} else if (gs == 'xls' || gs == 'xlsx') {
_this.list2.push({
name: res.data.name + '.xls',
img: '../../static/fileImg/workB.png',
url: item,
})
} else if (gs == 'pdf') {
_this.list2.push({
name: res.data.name + '.pdf',
img: '../../static/fileImg/pdfB.png',
name: res.data.name + '.' + gs,
img: '../../static/fileImg/pdfS.png',
url: item,
})
} else if (gs == 'txt') {
_this.list2.push({
name: res.data.name + '.txt',
img: '../../static/fileImg/pdfB.png',
url: item,
})
}
}
})
}
this.detailData = res.data
_this.load = false
console.log(this.list2)
}
}).catch(e => {
uni.showToast({
@ -251,45 +233,29 @@
},
//
downLoad(val) {
// uni.downloadFile({
// url: val, //
// success: (data) => {
// if (data.statusCode === 200) {
// //
// uni.saveFile({
// tempFilePath: data.tempFilePath, //
// success: function(res) {
// uni.showToast({
// icon: 'none',
// mask: true,
// title: '' + res.savedFilePath, //
// duration: 3000,
// });
// setTimeout(() => {
// //
// uni.openDocument({
// filePath: res.savedFilePath,
// success: function(res) {
// // console.log('');
// }
// });
// }, 3000)
// }
// });
// }
// },
// fail: (err) => {
// console.log(err);
// uni.showToast({
// icon: 'none',
// mask: true,
// title: '',
// });
// },
// });
console.log(val)
this.openPDF()
},
openPDF() {
switch (uni.getSystemInfoSync().platform) {
case "android":
console.log("安卓");
//
this.androidOpenPdf(this.contractUrl);
break;
case "ios":
console.log("IOS");
//web-view
uni.navigateTo({
url: "./webView/webView?contractUrl=" + this.contractUrl,
});
break;
default:
this.androidOpenPdf(this.contractUrl);
break;
}
}
}
}
</script>

View File

@ -0,0 +1,17 @@
<template>
<view id="web-info">
<web-view :src="src"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
src: '',
}
},
onLoad(option) {
this.src = option.contractUrl
}
}
</script>

View File

@ -53,7 +53,7 @@
<u--textarea style="padding: 32rpx;" v-model="detailValue" placeholder="请输入作品说明" border="none">
</u--textarea>
<view class="gap">
作品内容可上传图片/音频/word/pdf/txt等
作品内容可上传图片(png/jpg/jpeg/bmp/gif/tif/tiff)或pdf
</view>
<view class="gap" style="line-height: 30rpx;">
(若有图片请先上传图片)
@ -245,16 +245,25 @@
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + '/upload/upload',
url: http.config.baseUrl + '/file/upload',
filePath: url,
name: 'file',
formData: {
user: 'test'
},
success: (res) => {
setTimeout(() => {
resolve(JSON.parse(res.data).data.path)
}, 1000)
console.log(res)
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()
}
}
});
})

View File

@ -224,6 +224,22 @@
this.worksVo.price = this.price
this.worksVo.wpPath = this.wpPath
this.worksVo.code = this.code
this.http.request('/works/isValid?strLink='+this.wpPath, "POST").then(res => {
if (res.code == 200) {
uni.redirectTo({
url: "/pages/pageHome/pageHome"
})
this.pushWork()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
pushWork() {
this.http.request('/works/addWork', this.worksVo, "POST").then(res => {
if (res.code == 200) {
uni.redirectTo({
@ -236,10 +252,6 @@
icon: "none",
});
})
// uni.showToast({
// title: '',
// duration: 2000
// });
},
sexSelect(e) {
this.model1.userInfo.rights = e.name

View File

@ -1,17 +1,14 @@
<template>
<view class="layout">
<u-search height=42 margin="12px 0" searchIconColor="#251B1D" shape="square" :showAction="false"
v-model="artValue" placeholder="请输入搜索内容"></u-search>
<view class="shelves">
<view class="shelves-item">
<image src="../../static/icon12.jpg" mode="widthFix" class="shelves-img"></image>
<view class="name">作品名称</view>
</view>
<view class="" style="width:16px;"></view>
<view class="shelves-item">
<image src="../../static/icon12.jpg" mode="widthFix" class="shelves-img"></image>
<view class="name">作品名称</view>
<view class="">
<view class="">
<u-loading-page :loading="load"></u-loading-page>
</view>
<view class="layout" v-if="load == false">
<view class="shelves">
<view class="shelves-item" v-for="(item,index) in enjoyList" :key="index" @click="ToEnjoy(item.id)">
<image :src="item.file" mode="widthFix" class="shelves-img"></image>
<view class="name">{{item.name}}</view>
</view>
</view>
</view>
</view>
@ -22,7 +19,8 @@
export default {
data() {
return {
artValue: '',
load: true,
enjoyList: [],
};
},
onReady() {
@ -36,36 +34,69 @@
this.$refs.datetimePicker.setFormatter(this.formatter)
// #endif
},
methods: {
onShow() {
this.getEnjoy()
},
methods: {
getEnjoy(){
let _this = this
this.http.request('/indexImage/recommend', {}, "GET").then(res => {
if (res.code == 200) {
res.data.forEach(function(item){
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' || gs == 'bmp' || gs == 'gif' || gs == 'tif' || gs == 'tiff') {
item.file = fileArr[0]
}
else if (gs == 'pdf') {
item.file = '../../static/fileImg/pdfS.png'
}
}
})
this.enjoyList = res.data
this.load = false
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
ToEnjoy(val){
uni.navigateTo({
url: "/pages/ArtWorks/artWorkDetail?id=" + val
})
},
},
onLoad(option){
console.log(option.id);
}
}
</script>
<style lang="scss">
.layout {
padding: 8px 16px;
padding: 16rpx 32rpx;
.shelves {
display: flex;
box-sizing: border-box;
width: 100%;
.shelves-item {
width: 50%;
margin-top: 16px;
width: 311rpx;
margin-top: 32rpx;
margin-left: 16rpx;
margin-right: 16rpx;
float: left;
.shelves-img {
border-radius: 8px 8px 8px 8px;
width: 100%;
width: 311rpx;
height: 312rpx;
}
.name {
font-weight: 800;
font-size: 16px;
margin-top: 6px;
margin-top: 12rpx;
}
}
}

View File

@ -1,17 +1,14 @@
<template>
<view class="layout">
<u-search height=42 margin="12px 0" searchIconColor="#251B1D" shape="square" :showAction="false"
v-model="artValue" placeholder="请输入名家名称"></u-search>
<view class="shelves">
<view class="shelves-item">
<image src="../../static/icon12.jpg" mode="widthFix" class="shelves-img"></image>
<view class="name">作品名称</view>
</view>
<view class="" style="width:16px;"></view>
<view class="shelves-item">
<image src="../../static/icon12.jpg" mode="widthFix" class="shelves-img"></image>
<view class="name">作品名称</view>
<view class="">
<view class="">
<u-loading-page :loading="load"></u-loading-page>
</view>
<view class="layout" v-if="load == false">
<view class="shelves">
<view class="shelves-item" v-for="(item,index) in writerList" :key="index" @click="ToEnjoy(item.id)">
<image :src="item.images" mode="widthFix" class="shelves-img"></image>
<view class="name">{{item.userName}}</view>
</view>
</view>
</view>
</view>
@ -22,7 +19,8 @@
export default {
data() {
return {
artValue: '',
load: true,
writerList: [],
};
},
onReady() {
@ -36,36 +34,65 @@
this.$refs.datetimePicker.setFormatter(this.formatter)
// #endif
},
methods: {
onShow() {
this.getArtist()
},
methods: {
getArtist(){
let _this = this
this.http.request('/indexImage/artists', {}, "GET").then(res => {
if (res.code == 200) {
res.data.forEach(function(item) {
if (item.images != undefined) {
let img = JSON.parse(item.images)
item.images = img[0]
}
})
this.writerList = res.data
console.log(this.writerList)
this.load = false
// this.getEnjoy()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
ToEnjoy(val){
uni.navigateTo({
url:"/pages/famousArts/famousArts?id=" + val
})
},
},
onLoad(option){
console.log(option.id);
}
}
</script>
<style lang="scss">
.layout {
padding: 8px 16px;
padding: 16rpx 32rpx;
.shelves {
display: flex;
box-sizing: border-box;
width: 100%;
.shelves-item {
width: 50%;
margin-top: 16px;
width: 311rpx;
margin-top: 32rpx;
margin-left: 16rpx;
margin-right: 16rpx;
float: left;
.shelves-img {
border-radius: 8px 8px 8px 8px;
width: 100%;
width: 311rpx;
height: 312rpx;
}
.name {
font-weight: 800;
font-size: 16px;
margin-top: 6px;
margin-top: 12rpx;
}
}
}

View File

@ -2,7 +2,6 @@
<view class="famous_arts">
<view class="ding">
<view class="top">
<view class="left">
<view class="avator">
<image src="../../static/MoneyIco.png"></image>
@ -11,16 +10,13 @@
<view class="art_name">
吕茂盛
</view>
<view class="aer_Staff">
书法家
</view>
</view>
</view>
<view class="talk" @click="goTalk">
<!-- <view class="talk" @click="goTalk">
<image class="concat_ico" src="../../static/FamousArts/Talk.png" mode=""></image>
发起聊天
</view>
</view> -->
</view>
<!-- tabs -->
<u-tabs @click="clickTab" :scrollable="false" :list="list1"
@ -38,67 +34,106 @@
</view>
<view class="famous_bot" v-show="id=='1'">
<view class="famous_bot_itm" v-for="(v,i) in 5" :key="i">
<view class="famous_bot_itm" v-for="(v,i) in achievement" :key="i">
<view class="ico">
<image src="../../static/FamousArts/redStart.png"></image>
</view>
<view class="con">
中国书法作家协会
{{v}}
</view>
</view>
</view>
<view class="famous_bot" v-show="id=='2'">
<view class="famous_bot_itm" v-for="(v,i) in 5" :key="i">
<view class="famous_bot_itm" v-for="(v,i) in honor" :key="i">
<view class="ico" style="padding-right: 8rpx;">
<image style="width: 32rpx; height: 32rpx; vertical-align: bottom;"
src="../../static/FamousArts/goldCup.png"></image>
</view>
<view class="con" style="line-height: 50rpx;">
省文联主办的与党同心庆祝十八大全党党 外知识分子书画摄影作品展获优秀作品奖
{{v}}
</view>
</view>
</view>
<view class="famous_bot" style="" v-show="id=='3'">
<view class="famous_bot_itm" style="display: block;" v-for="(v,i) in 5" :key="i">
<view class="works">
<image src="../../static/maqian.png" mode=""></image>
<view class="famous_bot" v-show="id=='3'">
<view class="famous_bot_itm" style="display: block;" v-for="(v,i) in represe" :key="i">
<view class="works" v-for="(a,b) in v.value" :key="b">
<image :src="a" mode=""></image>
</view>
<view class="works_name">
司马迁书信
{{v.name}}
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
id: "3",
load: true,
id: "1",
userId: '',
list1: [{
name: '艺术成就',
id: '1'
}, {
name: '荣誉奖项',
id: '2'
}, {
name: '代表作',
id: '3'
name: '艺术成就',
id: '1'
}, {
name: '荣誉奖项',
id: '2'
}, {
name: '代表作',
id: '3'
}],
lineBg: '../../static/scrollLine.png',
userImg: '',
userName: '',
achievement:[],
honor:[],
represe:[],
lineBg: '../../static/scrollLine.png',
};
},
onLoad(option) {
this.userId = option.id
},
onShow() {
this.getArtist()
},
methods: {
getArtist(){
let _this = this
this.http.request('/indexImage/artistsDetails', {id:this.userId}, "GET").then(res => {
if (res.code == 200) {
console.log(res.data)
if (res.data.images != undefined) {
let img = JSON.parse(res.data.images)
_this.userImg = img[0]
}
//
if (res.data.artAtt != undefined) {
let art = JSON.parse(res.data.artAtt)
_this.achievement = art
}
//
if (res.data.greats != undefined) {
let great = JSON.parse(res.data.greats)
_this.honor = great
}
//
if (res.data.opus != undefined) {
let opu = JSON.parse(res.data.opus)
_this.represe = opu
}
this.load = false
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
clickTab(itm) {
this.id = itm.id
},
@ -108,9 +143,7 @@
})
}
},
onLoad(option) {
console.log(option.id);
}
}
</script>

View File

@ -1,110 +1,120 @@
<template>
<view class="layout">
<view class="status_bar" :style="{'height':statusHeight+'px'}"></view>
<view class="apptitle" :style="{'height':titleHeight+'px'}">
<image src="../../static/icon10.png" mode="" class="logo"></image>
<image src="../../static/icon11.png" mode="" class="appname"></image>
<view class="">
<view class="">
<u-loading-page :loading="load"></u-loading-page>
</view>
<view style="padding:12px 0;">
<u-search height=42 margin="12px 0" searchIconColor="#251B1D" shape="square" :showAction="false"
v-model="artValue" placeholder="请输入搜索内容"></u-search>
</view>
<u-swiper :list="list" indicator indicatorMode="line" circular></u-swiper>
<view class="menus">
<u-grid :border="false" col="4">
<u-grid-item v-for="(listItem,listIndex) in menus" @click="cliGridItem" :name="listItem.id"
:key="listIndex">
<image :src="listItem.imgUrl" mode="" class="menusImg"></image>
<text class="grid-text">{{listItem.title}}</text>
</u-grid-item>
</u-grid>
</view>
<view class="group">
<view class="groupTitle">
<view class="title">
每日一赏
<view class="layout" v-if="load == false">
<view class="status_bar" :style="{'height':statusHeight+'px'}"></view>
<view class="apptitle" :style="{'height':titleHeight+'px'}">
<image src="../../static/icon10.png" mode="" class="logo"></image>
<image src="../../static/icon11.png" mode="" class="appname"></image>
</view>
<view class="more" @click="navigateToFun('/pages/enjoy/enjoy')">
更多
<!-- 搜索 -->
<!-- <view style="padding:12px 0;">
<u-search height=42 margin="12px 0" searchIconColor="#251B1D" shape="square" :showAction="false"
v-model="artValue" placeholder="请输入搜索内容"></u-search>
</view> -->
<!-- 轮播图 -->
<u-swiper :list="list" indicator indicatorMode="line" circular></u-swiper>
<!-- 功能菜单 -->
<view class="menus">
<u-grid :border="false" col="4">
<u-grid-item v-for="(listItem,listIndex) in menus" @click="cliGridItem" :name="listItem.id"
:key="listIndex">
<image :src="listItem.imgUrl" mode="" class="menusImg"></image>
<text class="grid-text">{{listItem.title}}</text>
</u-grid-item>
</u-grid>
</view>
</view>
<view class="remark">
为您推荐最优秀的作品
</view>
<view class="scrollEle">
<u-scroll-list :indicator="false">
<view class="scroll-list">
<view class="scroll-list__goods-item" v-for="(item, index) in enjoyList" :key="index"
:class="[(index === 9) && 'scroll-list__goods-item--no-margin-right']" @click="ToEnjoy(index)">
<image class="scroll-list__goods-item__image" :src="item.thumb"></image>
<text class="scroll-list__goods-item__text">{{ item.labelName }}</text>
<!-- 每日一赏 -->
<view class="group">
<view class="groupTitle">
<view class="title">
每日一赏
</view>
<view class="more" @click="navigateToFun('/pages/enjoy/enjoy')">
更多
</view>
</view>
</u-scroll-list>
</view>
</view>
<view class="group">
<view class="groupTitle">
<view class="title">
文艺名家
<view class="remark">
为您推荐最优秀的作品
</view>
<view class="scrollEle">
<u-scroll-list :indicator="false">
<view class="scroll-list">
<view class="scroll-list__goods-item" v-for="(item, index) in enjoyList" :key="index"
:class="[(index === 9) && 'scroll-list__goods-item--no-margin-right']" @click="ToEnjoy(item.id)">
<image class="scroll-list__goods-item__image" :src="item.file"></image>
<text class="scroll-list__goods-item__text">{{ item.name }}</text>
</view>
</view>
</u-scroll-list>
</view>
</view>
<view class="more" @click="navigateToFun('/pages/famousArts/artistList')">
更多
</view>
</view>
<view class="remark">
象山县著名艺术家
</view>
<view class="scrollEle">
<u-scroll-list :indicator="false">
<view class="scroll-list">
<view class="scroll-list__goods-item" v-for="(item, index) in writerList" :key="index"
:class="[(index === 9) && 'scroll-list__goods-item--no-margin-right']" @click="famouserDetaol(index)" >
<image class="scroll-list__goods-item__image" :src="item.thumb"></image>
<text class="scroll-list__goods-item__text">{{ item.labelName }}</text>
<!-- 文艺名家 -->
<view class="group">
<view class="groupTitle">
<view class="title">
文艺名家
</view>
<view class="more" @click="navigateToFun('/pages/famousArts/artistList')">
更多
</view>
</view>
</u-scroll-list>
</view>
</view>
<view class="group">
<view class="groupTitle">
<view class="title">
热门活动
<view class="remark">
象山县著名艺术家
</view>
<view class="scrollEle">
<u-scroll-list :indicator="false">
<view class="scroll-list">
<view class="scroll-list__goods-item" v-for="(item, index) in writerList" :key="index"
:class="[(index === 9) && 'scroll-list__goods-item--no-margin-right']" @click="famouserDetaol(item.id)" >
<image class="scroll-list__goods-item__image" :src="item.images"></image>
<text class="scroll-list__goods-item__text">{{ item.userName }}</text>
</view>
</view>
</u-scroll-list>
</view>
</view>
<view class="more" @click="navigateToFun('/pages/ArtActivities/ArtActivities')">
更多
<!-- 热门活动 -->
<view class="group">
<view class="groupTitle">
<view class="title">
热门活动
</view>
<view class="more" @click="navigateToFun('/pages/ArtActivities/ArtActivities')">
更多
</view>
</view>
<view class="remark">
最精彩的文艺活动
</view>
<view class="scrollEle">
<u-swiper :list="list2" keyName="image" showTitle :autoplay="false" circular @click="goActDeat"></u-swiper>
</view>
</view>
<u-gap height="5" bgColor="#ffffff"></u-gap>
<tabbar tabbarId='1'></tabbar>
</view>
<view class="remark">
最精彩的文艺活动
</view>
<view class="scrollEle">
<u-swiper :list="list2" keyName="image" showTitle :autoplay="false" circular @click="goActDeat"></u-swiper>
</view>
</view>
<u-gap height="5" bgColor="#ffffff"></u-gap>
<tabbar tabbarId='1'></tabbar>
</view>
</template>
</template>
<script>
export default {
data() {
return {
load: true,
artValue: '',
statusHeight: 0,
titleHeight: 50,
list: [
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
],
list: [],
list2: [{
image: 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
title: '昨夜星辰昨夜风,画楼西畔桂堂东',
}, {
image: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
title: '身无彩凤双飞翼,心有灵犀一点通'
image: 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
title: '昨夜星辰昨夜风,画楼西畔桂堂东',
}, {
image: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
title: '身无彩凤双飞翼,心有灵犀一点通'
}],
menus: [{
id: 1,
@ -147,30 +157,8 @@
title: '更多功能'
},
],
enjoyList: [{
labelName: '策马崩腾',
thumb: '../../static/icon12.jpg'
}, {
labelName: '潇潇洒洒',
thumb: '../../static/icon12.jpg'
},
{
labelName: '小燕子',
thumb: '../../static/icon12.jpg'
}
],
writerList: [{
labelName: '张三',
thumb: '../../static/icon12.jpg'
}, {
labelName: '李四',
thumb: '../../static/icon12.jpg'
},
{
labelName: '小燕子',
thumb: '../../static/icon12.jpg'
}
],
enjoyList: [],
writerList: [],
};
},
onReady() {
@ -181,14 +169,90 @@
this.titleHeight = menuButtonInfo.height + (menuButtonInfo.top - systemMsg.statusBarHeight) * 2
// #endif
},
onShow() {
this.getSwpper()
},
methods: {
//
getSwpper(){
let _this = this
this.http.request('/indexImage/list', {}, "GET").then(res => {
if (res.code == 200) {
res.data.forEach(function(item) {
_this.list.push(item.imagePath)
})
// this.load = false
this.getEnjoy()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
getEnjoy(){
let _this = this
this.http.request('/indexImage/recommend', {}, "GET").then(res => {
if (res.code == 200) {
res.data.forEach(function(item){
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' || gs == 'bmp' || gs == 'gif' || gs == 'tif' || gs == 'tiff') {
item.file = fileArr[0]
} else if (gs == 'pdf') {
item.file = '../../static/fileImg/pdfS.png'
}
}
})
if(res.data.length > 5){
this.enjoyList = res.data.slice(0,5)
}else{
this.enjoyList = res.data
}
this.getArtist()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
getArtist(){
let _this = this
this.http.request('/indexImage/artists', {}, "GET").then(res => {
if (res.code == 200) {
res.data.forEach(function(item) {
if (item.images != undefined) {
let img = JSON.parse(item.images)
item.images = img[0]
}
})
if(res.data.length > 5){
this.writerList = res.data.slice(0,5)
}else{
this.writerList = res.data
}
this.load = false
// this.getEnjoy()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
navigateToFun(url){
uni.navigateTo({
url
});
},
cliGridItem(name) {
switch (name) {
case 1:
uni.navigateTo({
@ -232,15 +296,14 @@
break;
}
}
,famouserDetaol(id){
,famouserDetaol(val){
uni.navigateTo({
url:"/pages/famousArts/famousArts?id="+String(id)
url:"/pages/famousArts/famousArts?id=" + val
})
}
,ToEnjoy(id){
,ToEnjoy(val){
uni.navigateTo({
url:"/pages/enjoy/enjoy?id="+String(id)
url: "/pages/ArtWorks/artWorkDetail?id=" + val
})
},
goActDeat(index){

View File

@ -1,86 +1,86 @@
<template>
<view>
<view class="status_bar" :style="{'height':statusHeight+'px'}"></view>
<view class="apptitle" :style="{'height':titleHeight+'px'}">
<text style="font-size: 32rpx;font-weight: 700;" :style="{'line-height':titleHeight+'px'}">文艺商城</text>
<view class="">
<view class="">
<u-loading-page :loading="load"></u-loading-page>
</view>
<view class="search_box">
<u-search height=42 margin="12px 0" searchIconColor="#251B1D" shape="square" :showAction="false"
v-model="artValue" placeholder="请输入名家名称"></u-search>
<view class="car_box">
<image src="../../static/shop/car.png" mode=""></image>
<view v-if="load == false">
<view class="status_bar" :style="{'height':statusHeight+'px'}"></view>
<view class="apptitle" :style="{'height':titleHeight+'px'}">
<text style="font-size: 32rpx;font-weight: 700;" :style="{'line-height':titleHeight+'px'}">文艺商城</text>
</view>
</view>
<u-tabs :scrollable="false" :list="list1" :activeStyle="{
color: '#251B1D',
fontWeight: 'bold',
transform: 'scale(1.05)'
}"
:lineColor="`url(${lineBg}) 100% 100%`"
:inactiveStyle="{
color: '#AFADB0 ',
transform: 'scale(1)'
}" itemStyle=" height: 50px; ">
<view slot="right" class="filter_icon" style="width: 40rpx; height: 40rpx; flex-shrink: 0;"
@click="Clickfilter">
<image src="../../static/shop/filter.png" mode=""></image>
</view>
</u-tabs>
<view class="artworks">
<view class="art_item" v-for="(v,i) in isLoveList" :key="i" @click="goOrderDet(i)">
<view class="art_item_top">
<image src="../../static/shop/picture.png" mode=""></image>
<view class="search_box">
<u-search height=42 margin="12px 0" searchIconColor="#251B1D" shape="square" :showAction="false"
v-model="artValue" placeholder="请输入名家名称" @search='search'></u-search>
<view class="car_box">
<image src="../../static/shop/car.png" mode=""></image>
</view>
</view>
<u-tabs :scrollable="false" :list="list1" :activeStyle="{
color: '#251B1D',
fontWeight: 'bold',
transform: 'scale(1.05)'
}" :lineColor="`url(${lineBg}) 100% 100%`" :inactiveStyle="{
color: '#AFADB0 ',
transform: 'scale(1)'
}" itemStyle=" height: 50px; ">
<view slot="right" class="filter_icon" style="width: 40rpx; height: 40rpx; flex-shrink: 0;"
@click="Clickfilter">
<image src="../../static/shop/filter.png" mode=""></image>
</view>
</u-tabs>
<view class="artworks">
<view class="art_item" v-for="(v,i) in workList" :key="i" @click="goOrderDet(i)">
<view class="art_item_top">
<image src="../../static/shop/picture.png" mode=""></image>
<view class=" art_item_bott">
<view class="title">
摄影作品自由生活向美而生作品
</view>
<view class="img_box">
<view class=" puber">
<view class=" art_item_bott">
<view class="title">
摄影作品自由生活向美而生作品
</view>
<view class="txt">
<text class="txt1">100</text> <text>积分</text>
<view class="img_box">
<view class=" puber">
<view class="txt">
<text class="txt1">100</text> <text>积分</text>
</view>
</view>
<view class="time">
12人已购
</view>
</view>
<view class="time">
12人已购
</view>
</view>
</view>
</view>
<tabbar tabbarId='4'></tabbar>
</view>
<tabbar tabbarId='4'></tabbar>
</view>
</template>
<script>
export default {
data() {
return {
load: true,
statusHeight: 0,
titleHeight: 50,
isLoveList: [true, false, true, false],
workList: [],
artValue: '',
type: '',
list1: [{
name: '全部',
}, {
name: '书法',
}, {
name: '绘画'
}, {
name: '雕刻'
}, {
name: '摄影'
}, {
name: '其他'
}], lineBg: '../../static/scrollLine.png',
value: '',
}],
pages: 1,
size: 20,
lineBg: '../../static/scrollLine.png',
};
},
onReady() {
@ -91,14 +91,113 @@
this.titleHeight = menuButtonInfo.height + (menuButtonInfo.top - systemMsg.statusBarHeight) * 2
// #endif
},
//
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.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.getData()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
getData() {
let _this = this
this.http.request('/goods/list', {
page: this.pages,
size: this.size,
name: this.artValue,
type: this.type
}, "GET").then(res => {
if (res.code == 200) {
console.log(res.data)
_this.load = false
this.workList = res.data.records
// res.data.forEach(function(item) {
// _this.list1.push({
// name: item.label,
// value: item.value
// })
// })
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
getMoreData() {
let _this = this
this.http.request('/goods/list', {
page: this.pages,
size: this.size,
name: this.artValue,
type: this.type
}, "GET").then(res => {
if (res.code == 200) {
res.data.records.forEach(function(item) {
_this.workList.push(item)
})
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
clickTabs(item) {
this.type = item.value
this.pages = 1
this.getData()
},
search() {
this.pages = 1
this.getData()
},
Clickfilter() {
console.log("触发筛选");
},
goOrderDet(id){
uni.navigateTo({
url:`/pages/OrderDetail/OrderDetail?id=${id}`
})
goOrderDet(id) {
uni.navigateTo({
url: `/pages/OrderDetail/OrderDetail?id=${id}`
})
}
}
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
src/static/fileImg/xlsS.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
src/static/fileImg/xlsS.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
src/static/fileImg/xlsS.tif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB