Browse Source

图片详情、创作者详情跳转替换、部分样式调整

feature-1.0
gao1021514 4 years ago
parent
commit
ad383e03c1
  1. 2
      .gitignore
  2. 14
      pages/creator/creator.vue
  3. 4
      pages/creator/creatorDetail.vue
  4. 18
      pages/creator/imgDetail.vue
  5. 61
      pages/index/choiceness.vue
  6. 3
      pages/index/index.vue
  7. 2
      pages/userInfo/myCollection/myCollection.vue

2
.gitignore

@ -0,0 +1,2 @@
/node_modules/
/unpackage/

14
pages/creator/creator.vue

@ -63,7 +63,7 @@
duration: 1000,
indicatorDots: true,
pageNum: 1,
pageSize: 10
pageSize: 2
}
},
onLoad() {
@ -73,9 +73,19 @@
//
onPullDownRefresh(){
this.getBanner();
this.pageNum = 1
this.creatorImgList = []
this.getCreatorImgsPage();
uni.stopPullDownRefresh()
},
//
onReachBottom() {
if (this.creatorImgList.length > 1) {
this.pageNum += 1
this.getCreatorImgsPage()
}
},
methods: {
//
toCreatorDetail(item){
@ -131,7 +141,7 @@
pageSize: this.pageSize
})
if (res.data.code === 200) {
this.creatorImgList = res.data.rows
this.creatorImgList.push(...res.data.rows)
console.log('creatorImgList', this.creatorImgList)
} else {
uni.showModal({

4
pages/creator/creatorDetail.vue

@ -86,7 +86,7 @@
data: item.id,
success() {
console.log(111111)
uni.redirectTo({
uni.navigateTo({
url: './imgDetail'
})
}
@ -180,7 +180,7 @@
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
padding-bottom: 20px;
image {
margin-top: 40rpx;
margin-left: 40rpx;

18
pages/creator/imgDetail.vue

@ -65,8 +65,13 @@
}
return {
title: '自定义分享标题',
path: `/pages/creator/imgDetail?id=${this.userInfo.id}`
path: `/pages/creator/imgDetail?id=${this.userInfo.id}`,
bgImgUrl: `${this.detailMsg.imgUrl}`
}
uni.showToast({
title: '分享成功',
icon: 'none'
})
},
methods: {
//
@ -339,15 +344,16 @@
border-radius: 60px;
padding-top: 40rpx;
.share-box{
outline: none;
background: none;
border: none;
>button{
line-height: auto!important;
line-height: 0!important;
padding: 0;
outline: none;
background: none;
border: none;
}
>button ::after{
>button::after{
border: none;
}
}

61
pages/index/choiceness.vue

@ -3,7 +3,6 @@
<uni-search-bar class="uni-mt-10" placeholder="请输入喜欢的艺术家代号吧~" clearButton="auto" cancelButton="none"
@confirm="search" />
<view class="choiceness-list">
<view class="imgList1">
<!-- <view class="first-box" :style="'width:'+imgWidth" >
热门作品
</view> -->
@ -13,14 +12,14 @@
<image v-for="(item,index) in imgList" :key='index' class="img-box"
:style="'width:'+imgWidth+';height:'+imgHeight" :src="item.imgUrl" @click="targetDetail(item)"
mode=""></image>
</view>
</view>
</view>
</template>
<script>
import {
imgLists
imgLists,
creatorImgsDetails
} from '@/api/index.js'
export default {
data() {
@ -43,7 +42,7 @@
})
},
//
onPullDownRefresh(){
onPullDownRefresh() {
console.log(1111)
this.pageNum = 1
this.imgList = []
@ -59,6 +58,50 @@
}
},
methods: {
//
search(res) {
if (res.value) {
console.log('search', res.value)
this.goCreatorDetail(res.value)
} else {
uni.showToast({
title: '请输入艺术家代号',
icon: 'none',
})
}
},
//
async goCreatorDetail(scanCode) {
if (scanCode) {
const res = await creatorImgsDetails({
scanCode
})
console.log('creatorImgsDetails', res)
if (res.data.code === 200) {
uni.setStorage({
key: 'creatorDetail',
data: res.data.data,
success() {
uni.navigateTo({
url: '../creator/creatorDetail'
})
}
})
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
} else {
uni.showToast({
title: '搜索码不能为空',
icon: 'none'
})
}
},
//
async getImgList() {
const res = await imgLists({
@ -85,7 +128,7 @@
data: item.id,
success() {
console.log(111111)
uni.redirectTo({
uni.navigateTo({
url: '../creator/imgDetail'
})
}
@ -112,7 +155,6 @@
<style lang="less">
.choiceness {
padding-right: 40rpx;
padding-top: 40rpx;
.uni-searchbar {
@ -120,6 +162,7 @@
border-radius: 16rpx;
padding: 0;
margin-left: 40rpx;
margin-right: 40rpx;
.uni-searchbar__box {
padding: 0;
@ -129,12 +172,13 @@
.choiceness-list {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
.first-box {
border-radius: 16rpx;
font-size: 16px;
margin-top: 40rpx;
margin-left: 40rpx;
margin-left: 30rpx;
color: #fff;
line-height: 60rpx;
text-align: center;
@ -146,7 +190,6 @@
image {
margin-top: 40rpx;
margin-left: 40rpx;
border-radius: 16rpx;
}
}

3
pages/index/index.vue

@ -133,11 +133,12 @@
key: 'creatorDetail',
data: res.data.data,
success() {
uni.redirectTo({
uni.navigateTo({
url: '../creator/creatorDetail'
})
}
})
} else {
uni.showToast({
title: res.data.msg,

2
pages/userInfo/myCollection/myCollection.vue

@ -67,7 +67,7 @@
data: item.id,
success() {
console.log(111111)
uni.redirectTo({
uni.navigateTo({
url: '../creator/imgDetail'
})
}

Loading…
Cancel
Save