This commit is contained in:
lnn19986213 2022-11-11 17:30:53 +08:00
parent 8cbea1c18b
commit 6fffe34bf8
28 changed files with 646 additions and 376 deletions

View File

@ -85,6 +85,7 @@
}
},
uploadFilePromise(url) {
let token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://192.168.2.21:7001/upload', //
@ -93,6 +94,9 @@
formData: {
user: 'test'
},
header: {
"X-Token": token
},
success: (res) => {
setTimeout(() => {
resolve(res.data.data)

View File

@ -4,9 +4,9 @@
<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"
<u-search height=42 margin="0 0 12px 0" searchIconColor="#251B1D" shape="square" :showAction="false"
v-model="artValue" placeholder="请输入名家名称" @search='search'></u-search>
<u-tabs @click="clickTabs" :list="list1" :activeStyle="{
<!-- <u-tabs @click="clickTabs" :list="list1" :activeStyle="{
color: '#251B1D',
fontWeight: 'bold',
transform: 'scale(1.05)'
@ -14,49 +14,73 @@
color: '#AFADB0 ',
transform: 'scale(1)'
}" itemStyle="height: 50px;">
</u-tabs>
<view class="artworks">
<u-empty v-if="workList.length < 1" mode="data" icon="../../static/orderE.png" text='暂无数据' marginTop="120">
</u-empty>
<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>
</u-tabs> -->
<view class="goodPart">
<scroll-view class="gpLeft" scroll-y="true">
<view :class="fil == '1'?'gplItem_C':'gplItem'" @click="Clickfilter" style="display: flex;">
<image src="../../static/shop/hot.png" style="height: 32rpx; width: 32rpx; margin: 6rpx 6rpx 0 24rpx;"></image>热门
</view>
<view class=" art_item_bott">
<view class="title" @click="toDetail(v.id)">
{{ v.name }}
<view v-for="(item,index) in list1" :key="index" @click="chooseOneType(item.value,index)" :class="typeO == index?'gplItem_C':'gplItem'">
{{item.name}}
</view>
</scroll-view>
<view class="gpRight">
<scroll-view class="gprTop" scroll-x="true">
<view class="gprtItem_C" v-if="fil == 1">
热销商品
</view>
<view class="sub_title">
{{ v.type }}作品
<view class="tag" v-for="(a,b) in v.workTag" :key="b">
{{a}}
</view>
<view class="gprtItem_C" v-else-if="typeO == 0">
全部商品
</view>
<view class="img_box">
<view class=" puber" @click="toUser(v.user.id,v.user.images,v.user.userName,v.isFollow)">
<view class="avtor">
<image :src="v.user.images" mode=""></image>
</view>
<view class="autor">
{{ v.user.userName }}
<view v-for="(item,index) in list2" :key="index" @click="chooseTwoType(item.value,index)" :class="typeT == index?'gprtItem_C':'gprtItem'">
{{item.name}}
</view>
</scroll-view>
<scroll-view class="artworks" scroll-y="true" @scrolltolower="lower">
<u-empty v-if="workList.length < 1" mode="data" icon="../../static/orderE.png" text='暂无数据' marginTop="120">
</u-empty>
<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="time">
{{ v.createdAt }}
<view class=" art_item_bott">
<view class="title" @click="toDetail(v.id)">
{{ v.name }}
</view>
<view class="sub_title">
{{ v.typeName }}-{{ v.typesName }}作品
<view class="tag" v-for="(a,b) in v.workTag" :key="b">
{{a}}
</view>
</view>
<view class="img_box">
<view class=" puber" @click="toUser(v.user.id,v.user.images,v.user.userName,v.isFollow)">
<view class="avtor">
<image :src="v.user.images" mode=""></image>
</view>
<view class="autor">
{{ v.user.userName }}
</view>
</view>
<view class="time">
{{ v.createdAt }}
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
@ -69,13 +93,18 @@
load: true,
artValue: '',
type: '',
types: '',
list1: [{
name: '全部',
value: '',
}],
list2: [],
workList: [],
pages: 1,
size: 20,
fil: 0,
typeO: 0,
typeT: 9999,
lineBg: '../../static/scrollLine.png',
};
},
@ -88,10 +117,10 @@
}, 1000);
},
//
onReachBottom() {
this.pages++
this.getMoreData();
},
// onReachBottom() {
// this.pages++
// this.getMoreData();
// },
onShow() {
this.list1 = [{
name: '全部',
@ -101,15 +130,15 @@
this.getType()
},
methods: {
//
//
getType() {
let _this = this
this.http.request('/works/select?code=work_type', {}, "GET").then(res => {
this.http.request('/workType/list', {}, "GET").then(res => {
if (res.code == 200) {
res.data.forEach(function(item) {
_this.list1.push({
name: item.label,
value: item.value
name: item.title,
value: item.id
})
})
this.getData()
@ -121,6 +150,25 @@
});
})
},
//
getTypeE() {
let _this = this
this.http.request('/workType/'+ this.type, {}, "GET").then(res => {
if (res.code == 200) {
res.data.forEach(function(item) {
_this.list2.push({
name: item.title,
value: item.id
})
})
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
getData() {
let _this = this
@ -128,28 +176,18 @@
page: this.pages,
size: this.size,
nickName: this.artValue,
workType: this.type
workType: this.type,
workTypes: this.types,
}, "GET").then(res => {
if (res.code == 200) {
_this.workList = res.data.records
_this.workList.forEach(function(item) {
console.log(0)
if (item.user.images) {
// let img = JSON.parse(item.user.images)
// item.user.images = img[0]
}else{
item.images = '../../static/txIcon.png'
}
console.log(1)
//
if (item.type) {
_this.list1.forEach(function(ele) {
if (item.type == ele.value) {
item.type = ele.name
}
})
}
console.log(2)
//
if (item.file) {
let fileArr = item.file.split(',')
@ -160,7 +198,6 @@
item.file = '../../static/fileImg/pdfS.png'
}
}
console.log(3)
})
_this.load = false
}
@ -178,7 +215,8 @@
page: this.pages,
size: this.size,
nickName: this.artValue,
workType: this.type
workType: this.type,
workTypes: this.types,
}, "GET").then(res => {
if (res.data.records.length > 0) {
res.data.records.forEach(function(item) {
@ -186,14 +224,6 @@
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(',')
@ -251,9 +281,24 @@
url: "/pages/ArtWorks/artWorkDetail?id=" + val
})
},
//
clickTabs(item) {
this.type = item.value
//
chooseOneType(item,index) {
this.type = item
this.typeO = index
this.fil = 0
this.typeT = 9999
this.types = ''
this.list2 = []
this.orderBy = ''
this.pages = 1
this.getTypeE()
this.getData()
},
//
chooseTwoType(val,val2) {
this.types = val
this.typeT = val2
this.orderBy = ''
this.pages = 1
this.getData()
},
@ -265,6 +310,51 @@
uni.navigateTo({
url: "/pages/my/myWorks?id=" + val1 + '&userName=' + val3 + '&userImg=' + val2 + '&isFollow=' + val4
})
},
Clickfilter(){
let _this = this
if (this.fil == 0) {
this.fil = 1
this.typeO = 99999
this.orderBy = 'count'
this.type = ''
this.types = ''
this.list2 = []
this.http.request('/works/hot', {}, "GET").then(res => {
if (res.code == 200) {
_this.workList = res.data
_this.workList.forEach(function(item) {
if (item.user.images) {
// let img = JSON.parse(item.user.images)
// item.user.images = img[0]
}else{
item.images = '../../static/txIcon.png'
}
//
if (item.file) {
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'
}
}
})
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
},
lower(){
if(this.fil == 0){
this.pages++
this.getMoreData();
}
}
}
}
@ -278,122 +368,180 @@
bottom: 2px !important;
}
page {
width: calc(100% - 32px);
margin: 0 16px;
}
// page {
// width: calc(100% - 32px);
// margin: 0 16px;
// }
image {
width: 100%;
height: 100%;
}
.art_item {
margin-top: 16px;
border: 1px solid transparent;
.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;
.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;
}
.select_num {
float: left;
margin-left: 10rpx;
color: #fff;
}
}
}
.select_num {
.goodPart {
width: 750rpx;
background: #F8F8F8;
height: calc(100vh - 100px);
overflow: hidden;
.gpLeft {
width: 168rpx;
height: 100%;
float: left;
margin-left: 10rpx;
color: #fff;
}
}
.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;
.tag{
// width: 80rpx;
.gplItem {
width: 168rpx;
padding: 20rpx 0;
font-size: 30rpx;
text-align: center;
border: 1rpx solid #AFADB0;
border-radius: 20px;
float: right;
margin: 0 10rpx;
padding: 4rpx 10rpx;
}
.gplItem_C {
width: 162rpx;
padding: 20rpx 0;
font-size: 32rpx;
font-weight: 700;
text-align: center;
background: #E8E8E8;
border-radius: 0 50px 50px 0;
border-left: 6rpx solid #99241B ;
}
}
.img_box {
display: flex;
justify-content: space-between;
align-items: center;
.puber {
display: flex;
align-items: center;
.avtor {
border-radius: 12px;
overflow: hidden;
width: 24px;
height: 24px;
margin-right: 4px;
.gpRight {
width: 546rpx;
height: 100%;
float: left;
.gprTop {
width: 100%;
height: 32px;
padding: 10px 0;
overflow: hidden;
.gprtItem {
height: 64rpx;
line-height: 64rpx;
padding: 0 30rpx;
margin: 0 10rpx;
float: left;
}
.autor {
color: #251B1D;
font-size: 12px;
.gprtItem_C {
height: 64rpx;
line-height: 64rpx;
padding: 0 30rpx;
margin: 0 10rpx;
float: left;
background: url(../../static/shop/bg2.png) no-repeat;
background-size:100% 100%;
}
}
.time {
color: #AFADB0;
font-size: 12px;
.artworks {
background-color: #ffffff;
height: calc(100% - 52px);
margin-left: 16rpx;
.art_item {
margin-top: 16px;
border: 1px solid transparent;
.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;
.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;
}
.select_num {
float: left;
margin-left: 10rpx;
color: #fff;
}
}
}
.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;
.tag{
// width: 80rpx;
text-align: center;
border: 1rpx solid #AFADB0;
border-radius: 20px;
float: right;
margin: 0 10rpx;
padding: 4rpx 10rpx;
}
}
.img_box {
display: flex;
justify-content: space-between;
align-items: center;
.puber {
display: flex;
align-items: center;
.avtor {
border-radius: 12px;
overflow: hidden;
width: 24px;
height: 24px;
margin-right: 4px;
}
.autor {
color: #251B1D;
font-size: 12px;
}
}
.time {
color: #AFADB0;
font-size: 12px;
}
}
}
}
}
}
}
</style>

View File

@ -699,11 +699,15 @@
// console.log("this.Edvalue", this.Edvalue );
},
uploadFilePromise(url) {
let token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + '/upload/upload',
filePath: url,
name: 'file',
header: {
"X-Token": token
},
success: (res) => {
setTimeout(() => {
resolve(JSON.parse(res.data).data.path)

View File

@ -6,7 +6,8 @@
<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 placeholder="请输入作品名称" v-model="name" clearable border="none"
style="color: #251B1D;margin-left: 32rpx;">
</u--input>
</view>
<!-- 作品类型 -->
@ -17,17 +18,31 @@
<u-icon slot="suffix" name="arrow-right" style="margin-right: 10px;"></u-icon>
</u--input>
</view>
<u-popup :show="showType" @close="close" 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 :show="showType" @close="close" closeOnClickOverlay :round="5" customStyle="padding: 16px;">
<scroll-view style='height: 500rpx;' scroll-y="true">
<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-radio-group>
</scroll-view>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="secondType()">确认</u-button>
</u-popup>
<u-popup :show="showTypeT" @close="closeT" closeOnClickOverlay :round="5" customStyle="padding: 16px;">
<scroll-view style='height: 500rpx;' scroll-y="true">
<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-radio-group>
</scroll-view>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="showType=false">确认</u-button>
</u-popup>
<!-- 作品标签 -->
<view class="rightBox" @click="showTab=true">
@ -37,25 +52,23 @@
<u-icon slot="suffix" name="arrow-right" style="margin-right: 10px;"></u-icon>
</u--input>
</view>
<u-popup :show="showTab" @close="close" closeOnClickOverlay :round="5"
customStyle="padding: 16px;">
<u-popup :show="showTab" @close="close" closeOnClickOverlay :round="5" customStyle="padding: 16px;">
<view style="display: flex; padding: 20rpx 0; color: #3c9cff;" @click="addNewTab">
添加标签<u-icon name="plus-circle" color="#3c9cff"></u-icon>
</view>
<scroll-view style='height: 500rpx;' scroll-y="true">
<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-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-checkbox-group>
</scroll-view>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="showTab=false">确认</u-button>
</u-popup>
<u-popup :show="addTab" @close="closeAdd" closeOnClickOverlay :round="5"
customStyle="padding: 16px;">
<u-popup :show="addTab" @close="closeAdd" closeOnClickOverlay :round="5" customStyle="padding: 16px;">
<view style="display: flex; padding: 20rpx 0; font-size: 36rpx;">
添加标签
</view>
@ -65,7 +78,8 @@
type="default" @click="upDataTab">确认添加</u-button>
</u-popup>
<u--textarea style="padding: 32rpx;" v-model="detailValue" placeholder="请输入作品说明" border="none" maxlength="-1">
<u--textarea style="padding: 32rpx;" v-model="detailValue" placeholder="请输入作品说明" border="none"
maxlength="-1">
</u--textarea>
<view class="gap">
作品内容可上传图片(png/jpg/jpeg/bmp/gif/tif/tiff)或pdf
@ -102,12 +116,13 @@
fileList3: [],
iswx: null,
showType: false,
showTypeT: false,
showTab: false,
addTab: false,
v1: "",
v2: "",
tabs:[],
imgs:[],
tabs: [],
imgs: [],
radiovalue1: '',
radiolist1: [],
radiovalue2: [],
@ -172,35 +187,35 @@
},
next() {
let _this = this
if(this.name == ''){
if (this.name == '') {
uni.showToast({
title: '作品名称不能为空',
icon: "none",
});
return
}
if(this.v1 == ''){
if (this.v1 == '') {
uni.showToast({
title: '作品类型不能为空',
icon: "none",
});
return
}
if(this.v2 == ''){
if (this.v2 == '') {
uni.showToast({
title: '作品标签不能为空',
icon: "none",
});
return
}
if(this.detailValue == ''){
if (this.detailValue == '') {
uni.showToast({
title: '作品说明不能为空',
icon: "none",
});
return
}
if(this.fileList3.length == 0){
if (this.fileList3.length == 0) {
uni.showToast({
title: '作品内容不能为空',
icon: "none",
@ -209,15 +224,15 @@
}
this.worksVo.name = this.name
this.worksVo.introduce = this.detailValue
this.radiolist1.forEach((item) =>{
if(_this.v1 == item.label){
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){
this.radiolist2.forEach((item) => {
this.tabs.forEach((ele) => {
if (ele == item.tagName) {
tabList.push(item.id)
}
})
@ -229,7 +244,8 @@
})
this.worksVo.file = imgList.join(',')
uni.navigateTo({
url: "/pages/PublishWorks/PublishWorksNext?worksVo=" + encodeURIComponent(JSON.stringify(this.worksVo))
url: "/pages/PublishWorks/PublishWorksNext?worksVo=" + encodeURIComponent(JSON.stringify(this
.worksVo))
})
},
//
@ -260,6 +276,7 @@
}
},
uploadFilePromise(url) {
let token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + '/file/upload',
@ -268,13 +285,16 @@
formData: {
user: 'test'
},
header: {
"X-Token": token
},
success: (res) => {
console.log(res)
if(JSON.parse(res.data).code == 200){
if (JSON.parse(res.data).code == 200) {
setTimeout(() => {
resolve(JSON.parse(res.data).data.path)
}, 1000)
}else{
} else {
uni.showToast({
title: JSON.parse(res.data).message,
icon: "none",
@ -297,11 +317,11 @@
this.tabs = form
this.v2 = data.join(',')
},
addNewTab(){
addNewTab() {
this.showTab = false
this.addTab = true
},
closeAdd(){
closeAdd() {
this.addTab = false
this.getTab()
this.showTab = true
@ -313,14 +333,14 @@
this.http.request('/works/addTag', data, "POST").then(res => {
if (res.code == 200) {
uni.showToast({
title: '添加成功',
icon: "none",
title: '添加成功',
icon: "none",
});
setTimeout(() => {
this.newTab = ''
this.closeAdd()
}, 1200)
}
}).catch(e => {
uni.showToast({
@ -329,6 +349,10 @@
});
})
},
secondType(){
this.showType = false
this.showTypeT = true
}
}
}
</script>

View File

@ -746,17 +746,17 @@
},
uploadFilePromise(url) {
let token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + '/upload/upload',
filePath: url,
name: 'file',
header: {
"X-Token": token
},
success: (res) => {
setTimeout(() => {
resolve(JSON.parse(res.data).data.path)
}, 1000)
}

View File

@ -114,14 +114,14 @@
<image src="../../static/rightArrow.png" mode=""></image>
</view>
</view>
<view class="content_bott_itm" @click="toAddress()">
<!-- <view class="content_bott_itm" @click="toAddress()">
<view class="content_bott_wods">
收货地址
</view>
<view class="content_bott_arrow">
<image src="../../static/rightArrow.png" mode=""></image>
</view>
</view>
</view> -->
<view class="content_bott_itm" @click="myNews()">

View File

@ -265,6 +265,7 @@
}
},
uploadFilePromise(url) {
let token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + '/file/upload',
@ -273,6 +274,9 @@
formData: {
user: 'test'
},
header: {
"X-Token": token
},
success: (res) => {
console.log(res)
if(JSON.parse(res.data).code == 200){

View File

@ -65,6 +65,7 @@
}
},
uploadFilePromise(url) {
let token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + '/file/upload',
@ -73,6 +74,9 @@
formData: {
user: 'test'
},
header: {
"X-Token": token
},
success: (res) => {
if (JSON.parse(res.data).code == 200) {
setTimeout(() => {

View File

@ -78,10 +78,10 @@
<!-- 底部点赞收藏 -->
<view class="detailBottom">
<view class="bottom_box">
<u-button type="primary" icon="edit-pen" text="编辑作品" @click="editWork()"></u-button>
<u-button type="primary" icon="edit-pen-fill" :plain="true" text="编辑作品" @click="editWork()"></u-button>
</view>
<view class="bottom_box">
<u-button type="error" icon="trash" text="删除作品" @click="delWork()"></u-button>
<u-button type="error" icon="trash-fill" :plain="true" text="删除作品" @click="delWork()"></u-button>
</view>
</view>
</view>

View File

@ -284,6 +284,7 @@
}
},
uploadFilePromise(url) {
let token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + '/file/upload',
@ -292,6 +293,9 @@
formData: {
user: 'test'
},
header: {
"X-Token": token
},
success: (res) => {
if (JSON.parse(res.data).code == 200) {
setTimeout(() => {

View File

@ -16,47 +16,55 @@
</view>
</view>
<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; ">
<view slot="right" :class="fil == 0?'filter_icon':'filter_icon_red'"
@click="Clickfilter">
<!-- <image src="../../static/shop/filter.png" mode=""></image> -->
<text>销量</text>
</view>
</u-tabs>
<view class="artworks">
<u-empty v-if="workList.length < 1" icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
<view class="art_item" v-for="(v,i) in workList" :key="i" @click="goOrderDet(v.id)">
<view class="art_item_top">
<image :src="v.domainInfo.file" mode=""></image>
<view class="goodPart">
<scroll-view class="gpLeft" scroll-y="true">
<view :class="fil == '1'?'gplItem_C':'gplItem'" @click="Clickfilter" style="display: flex;">
<image src="../../static/shop/hot.png" style="height: 32rpx; width: 32rpx; margin: 6rpx 6rpx 0 24rpx;"></image>热销
</view>
<view class=" art_item_bott">
<view class="title">
{{v.domainInfo.name}}
<view v-for="(item,index) in list1" :key="index" @click="chooseOneType(item.value,index)" :class="typeO == index?'gplItem_C':'gplItem'">
{{item.name}}
</view>
</scroll-view>
<view class="gpRight">
<scroll-view class="gprTop" scroll-x="true">
<view class="gprtItem_C" v-if="fil == 1">
热销商品
</view>
<view class="img_box">
<view class=" puber">
<view class="txt" v-if="v.moneyPrice > 0">
<text class="txt1">{{v.moneyPrice}}</text> <text></text>
</view>
<view class="txt" v-else>
<text class="txt1">{{v.pointPrice}}</text> <text>积分</text>
</view>
<view class="gprtItem_C" v-else-if="typeO == 0">
全部商品
</view>
<view v-for="(item,index) in list2" :key="index" @click="chooseTwoType(item.value,index)" :class="typeT == index?'gprtItem_C':'gprtItem'">
{{item.name}}
</view>
</scroll-view>
<scroll-view class="artworks" scroll-y="true" @scrolltolower="lower">
<u-empty v-if="workList.length < 1" icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
<view class="art_item" v-for="(v,i) in workList" :key="i" @click="goOrderDet(v.id)">
<view class="art_item_top">
<image :src="v.domainInfo.file" mode=""></image>
</view>
<view class="time">
{{v.sellCount}}人已购
<view class=" art_item_bott">
<view class="title">
{{v.domainInfo.name}}
</view>
<view class="img_box">
<view class=" puber">
<view class="txt" v-if="v.moneyPrice > 0">
<text class="txt1">{{v.moneyPrice}}</text> <text></text>
</view>
<view class="txt" v-else>
<text class="txt1">{{v.pointPrice}}</text> <text>积分</text>
</view>
</view>
<view class="time">
{{v.sellCount}}人已购
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<tabbar tabbarId='4'></tabbar>
@ -75,13 +83,17 @@
workList: [],
artValue: '',
type: '',
types: '',
list1: [{
name: '全部',
value: '',
}],
list2: [],
pages: 1,
size: 20,
fil: 0,
typeO: 0,
typeT: 9999,
orderBy: '',
lineBg: '../../static/scrollLine.png',
};
@ -103,28 +115,28 @@
}, 1000);
},
//
onReachBottom() {
this.pages++
this.getMoreData();
},
// onReachBottom() {
// this.pages++
// this.getMoreData();
// },
onShow() {
this.list1 = [{
name: '全部',
type: '',
}],
this.pages = 1
this.pages = 1
this.getType()
},
methods: {
//
//
getType() {
let _this = this
this.http.request('/works/select?code=work_type', {}, "GET").then(res => {
this.http.request('/workType/list', {}, "GET").then(res => {
if (res.code == 200) {
res.data.forEach(function(item) {
_this.list1.push({
name: item.label,
value: item.value
name: item.title,
value: item.id
})
})
this.getData()
@ -136,6 +148,25 @@
});
})
},
//
getTypeE() {
let _this = this
this.http.request('/workType/'+ this.type, {}, "GET").then(res => {
if (res.code == 200) {
res.data.forEach(function(item) {
_this.list2.push({
name: item.title,
value: item.id
})
})
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
//
getData() {
let _this = this
@ -144,17 +175,16 @@
size: this.size,
name: this.artValue,
type: this.type,
types: this.types,
orderBy: this.orderBy
}, "GET").then(res => {
if (res.code == 200) {
res.data.records.forEach(function(item) {
console.log(1)
if (item.domainInfo.file) {
let fileArr = item.domainInfo.file.split(',')
let gs = fileArr[0].substr(fileArr[0].lastIndexOf(".") + 1)
console.log(2)
if (gs == 'jpg' || gs == 'jpeg' || gs == 'png' || gs == 'bmp' || gs == 'gif' || gs == 'tif' || gs == 'tiff') {
console.log(3)
if (gs == 'jpg' || gs == 'jpeg' || gs == 'png' || gs == 'bmp' || gs ==
'gif' || gs == 'tif' || gs == 'tiff') {
item.domainInfo.file = fileArr[0]
} else if (gs == 'pdf') {
item.domainInfo.file = '../../static/fileImg/pdfS.png'
@ -179,6 +209,7 @@
size: this.size,
name: this.artValue,
type: this.type,
types: this.types,
orderBy: this.orderBy
}, "GET").then(res => {
if (res.code == 200) {
@ -186,7 +217,8 @@
if (item.domainInfo.file != undefined) {
let fileArr = item.domainInfo.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') {
if (gs == 'jpg' || gs == 'jpeg' || gs == 'png' || gs == 'bmp' || gs ==
'gif' || gs == 'tif' || gs == 'tiff') {
item.domainInfo.file = fileArr[0]
} else if (gs == 'pdf') {
item.domainInfo.file = '../../static/fileImg/pdfS.png'
@ -194,7 +226,7 @@
}
_this.workList.push(item)
})
if(res.data.records.length == 0){
if (res.data.records.length == 0) {
this.pages--
}
}
@ -205,9 +237,24 @@
});
})
},
//
clickTabs(item) {
this.type = item.value
//
chooseOneType(item,index) {
this.type = item
this.typeO = index
this.fil = 0
this.typeT = 9999
this.types = ''
this.list2 = []
this.orderBy = ''
this.pages = 1
this.getTypeE()
this.getData()
},
//
chooseTwoType(val,val2) {
this.types = val
this.typeT = val2
this.orderBy = ''
this.pages = 1
this.getData()
},
@ -216,17 +263,16 @@
this.getData()
},
Clickfilter() {
if(this.fil == 0){
if (this.fil == 0) {
this.fil = 1
this.typeO = 99999
this.orderBy = 'count'
this.type = ''
this.types = ''
this.list2 = []
this.pages = 1
this.getData()
}else if(this.fil == 1){
this.fil = 0
this.orderBy = ''
this.pages = 1
this.getData()
}
}
},
goOrderDet(id) {
uni.navigateTo({
@ -237,13 +283,24 @@
uni.navigateTo({
url: '/pages/ShoppingCart/ShoppingCart'
})
},
lower(){
this.pages++
this.getMoreData();
}
}
}
</script>
<style lang="scss">
.apptitle {
width: calc(100% - 32px);
margin: 0 16px;
}
.search_box {
width: calc(100% - 32px);
margin: 0 16px;
display: flex;
align-items: center;
@ -254,114 +311,127 @@
}
}
/deep/ .u-tabs__wrapper__nav__item__text {
font-size: 24rpx;
white-space: nowrap;
}
/deep/ .u-tabs__wrapper__nav__line {
height: 14px !important;
width: 40px !important;
// background-image: url(../../static/scrollLine.png);
background-color: transparent !important;
bottom: 2px !important;
}
page {
width: calc(100% - 32px);
margin: 0 16px;
}
image {
width: 100%;
height: 100%;
}
.filter_icon{
width: 80rpx;
height: 40rpx;
text-align: center;
background-color: #F4F5F7;
border: 1rpx solid #AFADB0;
border-radius: 20px;
flex-shrink: 0;
}
.filter_icon_red{
width: 80rpx;
height: 40rpx;
text-align: center;
color: #99241B;
background-color: #F4F5F7;
border: 1rpx solid #99241B;
border-radius: 20px;
flex-shrink: 0;
}
.artworks {
margin-bottom: 60px;
.goodPart {
width: 750rpx;
background: #F8F8F8;
height: calc(100vh - 168px);
overflow: hidden;
.art_item {
margin-top: 16px;
border: 1px solid transparent;
width: calc(50% - 16px);
display: inline-block;
margin-left: 8px;
.gpLeft {
width: 168rpx;
height: 100%;
float: left;
.art_item_top {
position: relative;
height: 320rpx;
overflow: hidden;
border-radius: 8px 8px 0px 0px;
.gplItem {
width: 168rpx;
padding: 20rpx 0;
font-size: 30rpx;
text-align: center;
}
.gplItem_C {
width: 162rpx;
padding: 20rpx 0;
font-size: 32rpx;
font-weight: 700;
text-align: center;
background: #E8E8E8;
border-radius: 0 50px 50px 0;
border-left: 6rpx solid #99241B ;
}
}
.art_item_bott {
padding: 12px;
.gpRight {
width: 546rpx;
height: 100%;
float: left;
.title {
// margin-top: 12px;
font-size: 12px;
font-weight: 600;
color: #32333B;
.gprTop {
width: 100%;
height: 32px;
padding: 10px 0;
overflow: hidden;
.gprtItem {
height: 64rpx;
line-height: 64rpx;
padding: 0 30rpx;
margin: 0 10rpx;
float: left;
}
.img_box {
display: flex;
justify-content: space-between;
align-items: center;
.gprtItem_C {
height: 64rpx;
line-height: 64rpx;
padding: 0 30rpx;
margin: 0 10rpx;
float: left;
background: url(../../static/shop/bg2.png) no-repeat;
background-size:100% 100%;
}
}
.artworks {
background-color: #ffffff;
height: calc(100% - 52px);
margin-left: 16rpx;
.art_item {
margin-top: 16px;
.puber {
display: flex;
align-items: center;
.txt {
font-size: 10px;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #8E8F9E;
.txt1 {
color: #32333B;
font-size: 18px;
font-weight: 800;
font-family: DIN Alternate-Bold, DIN Alternate;
margin-right: 2px;
border: 1px solid transparent;
width: calc(50% - 16px);
display: inline-block;
margin-left: 8px;
.art_item_top {
position: relative;
height: 320rpx;
overflow: hidden;
border-radius: 8px 8px 0px 0px;
}
.art_item_bott {
padding: 12px;
.title {
// margin-top: 12px;
font-size: 12px;
font-weight: 600;
color: #32333B;
}
.img_box {
margin-top: 16px;
.puber {
display: flex;
align-items: center;
.txt {
font-size: 10px;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #8E8F9E;
.txt1 {
color: #32333B;
font-size: 18px;
font-weight: 800;
font-family: DIN Alternate-Bold, DIN Alternate;
margin-right: 2px;
}
}
}
.time {
color: #AFADB0;
font-size: 12px;
}
}
}
.time {
color: #AFADB0;
font-size: 12px;
}
}
}
}
}
</style>

View File

@ -98,6 +98,7 @@
}
},
uploadFilePromise(url) {
let token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + '/file/upload',
@ -106,6 +107,9 @@
formData: {
user: 'test'
},
header: {
"X-Token": token
},
success: (res) => {
if (JSON.parse(res.data).code == 200) {
setTimeout(() => {

View File

@ -263,6 +263,7 @@
}
},
uploadFilePromise(url) {
let token = uni.getStorageSync('token');
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + '/file/upload',
@ -271,6 +272,9 @@
formData: {
user: 'test'
},
header: {
"X-Token": token
},
success: (res) => {
if (JSON.parse(res.data).code == 200) {
setTimeout(() => {

View File

@ -6,9 +6,9 @@
export default {
config: {
// baseUrl: "http://192.168.0.57:8080/h5/api", //王锡
// baseUrl: "/pre", //俞燕红-跨域
baseUrl: "/pre", //俞燕红-跨域
// baseUrl: "https://yxx.ydool.net/h5/api", //
baseUrl: "/h5/api", //俞燕红 线上
// baseUrl: "/h5/api", //俞燕红 线上
header: {
'Content-Type': 'application/json;charset=UTF-8',
// 'Content-Type':'application/x-www-form-urlencoded'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 771 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

BIN
src/static/shop/bg2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 839 B

BIN
src/static/shop/hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB