Browse Source

首页及用户详情页跳转到图片详情页

feature-1.0
gao1021514 4 years ago
parent
commit
e0dfcadbbe
  1. 7
      api/creator.js
  2. 1
      api/index.js
  3. 7
      pages.json
  4. 91
      pages/creator/imgDetail.vue
  5. 18
      pages/creator/userDetail.vue
  6. 29
      pages/index/choiceness.vue
  7. 1
      unpackage/dist/dev/mp-toutiao/app.json
  8. 2
      unpackage/dist/dev/mp-toutiao/common/main.js
  9. 86
      unpackage/dist/dev/mp-toutiao/common/vendor.js
  10. 2
      unpackage/dist/dev/mp-toutiao/pages/creator/creator.js
  11. 224
      unpackage/dist/dev/mp-toutiao/pages/creator/imgDetail.js
  12. 5
      unpackage/dist/dev/mp-toutiao/pages/creator/imgDetail.json
  13. 1
      unpackage/dist/dev/mp-toutiao/pages/creator/imgDetail.ttml
  14. 29
      unpackage/dist/dev/mp-toutiao/pages/creator/imgDetail.ttss
  15. 39
      unpackage/dist/dev/mp-toutiao/pages/creator/userDetail.js
  16. 2
      unpackage/dist/dev/mp-toutiao/pages/creator/userDetail.ttml
  17. 21
      unpackage/dist/dev/mp-toutiao/pages/index/choiceness.js
  18. 2
      unpackage/dist/dev/mp-toutiao/pages/index/choiceness.ttml
  19. 4
      unpackage/dist/dev/mp-toutiao/pages/index/index.js
  20. 24
      unpackage/dist/dev/mp-toutiao/pages/userInfo/contactUs/contactUs.js
  21. 120
      unpackage/dist/dev/mp-toutiao/pages/userInfo/myCollection/myCollection.js
  22. 26
      unpackage/dist/dev/mp-toutiao/pages/userInfo/question/question.js
  23. 24
      unpackage/dist/dev/mp-toutiao/pages/userInfo/setting/setting.js
  24. 28
      unpackage/dist/dev/mp-toutiao/pages/userInfo/userInfo.js
  25. 7
      unpackage/dist/dev/mp-toutiao/project.config.json
  26. 2
      unpackage/dist/dev/mp-toutiao/static/img/分享 (1).svg
  27. 2
      unpackage/dist/dev/mp-toutiao/static/img/分享.svg
  28. 30
      unpackage/dist/dev/mp-toutiao/uni_modules/uni-badge/components/uni-badge/uni-badge.js
  29. 32
      unpackage/dist/dev/mp-toutiao/uni_modules/uni-icons/components/uni-icons/uni-icons.js
  30. 34
      unpackage/dist/dev/mp-toutiao/uni_modules/uni-list/components/uni-list-item/uni-list-item.js
  31. 30
      unpackage/dist/dev/mp-toutiao/uni_modules/uni-list/components/uni-list/uni-list.js
  32. 34
      unpackage/dist/dev/mp-toutiao/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.js
  33. 30
      unpackage/dist/dev/mp-toutiao/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js

7
api/creator.js

@ -18,3 +18,10 @@ export function getUserImgList() {
method: 'get'
})
}
//获取图片详情
export function detailsTiktokImg(data) {
return request({
url: `${serviceTitle}/img/mini/tiktok/detailsTiktokImg/${data}`,
method: 'get'
})
}

1
api/index.js

@ -26,3 +26,4 @@ export function tiktokUserDetails(data) {
data
})
}

7
pages.json

@ -27,6 +27,13 @@
"enablePullDownRefresh": true
}
},
{
"path": "pages/creator/imgDetail",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
},
{
"path": "pages/userInfo/userInfo",
"style": {

91
pages/creator/imgDetail.vue

@ -0,0 +1,91 @@
<template>
<view class="imgDetail">
<image class="main-img" :src="detailMsg.imgUrl" mode=""></image>
<view class="toolbar">
<view class="toolbar-box">
<text>热门</text>
</view>
<view class="toolbar-box">
<text>下载</text>
<text>下载{{detailMsg.downloadNum}}</text>
</view>
<view class="toolbar-box">
<text>喜欢</text>
<text>喜欢{{detailMsg.greatNum}}</text>
</view>
<view class="toolbar-box">
<text>收藏</text>
<text>收藏{{detailMsg.collectionNum}}</text>
</view>
<view class="toolbar-box">
<text>分享</text>
</view>
</view>
</view>
</template>
<script>
import {
detailsTiktokImg
} from '@/api/creator.js'
export default {
data() {
return {
detailMsg: {}
}
},
created() {
uni.getStorage({
key: 'detailId',
success: res => {
this.getImgDetail(res.data)
}
})
},
methods: {
async getImgDetail(id) {
const res = await detailsTiktokImg(id)
if (res.data.code === 200) {
this.detailMsg = res.data.data
console.log('图片详情', this.detailMsg)
} else {
uni.showToast({
title: '请输入艺术家代号',
icon: 'error'
})
}
}
}
}
</script>
<style lang="less">
.imgDetail {
height: 100vh;
width: 100vw;
overflow: hidden;
position: relative;
.main-img {
width: 100%;
height:100%;
}
.toolbar{
width: 60px;
height: 360px;
background-color: rgba(255,255,255,0.2);
position: absolute;
bottom: 76px;
right: 10px;
border-radius: 60px;
.toolbar-box{
height: 60px;
text{
display: block;
text-align: center;
line-height: 30px;
font-size: 12px;
}
}
}
}
</style>

18
pages/creator/userDetail.vue

@ -38,7 +38,7 @@
</view>
<view class="bottom">
<image :src="item.imgUrl" mode="" v-for="(item,index) in userMsg.imgList" :key="index"
:style="'width:'+imgWidth+';height:'+imgHeight"></image>
:style="'width:'+imgWidth+';height:'+imgHeight" @click="targetDetail(item)"></image>
</view>
</view>
</template>
@ -76,6 +76,22 @@
methods: {
onClickItem(e) {
console.log('点击', e)
},
//
targetDetail(item) {
console.log('跳转', item)
if (item.id) {
uni.setStorage({
key: 'detailId',
data: item.id,
success() {
console.log(111111)
uni.redirectTo({
url: './imgDetail'
})
}
})
}
}
}
}

29
pages/index/choiceness.vue

@ -7,12 +7,13 @@
<view class="first-box" :style="'width:'+imgWidth">
热门作品
</view>
<image v-for="(item,index) in imgList1" :key='index' class="img-box" :style="'width:'+imgWidth+';height:'+imgHeight"
:src="item.imgUrl" mode=""></image>
<image v-for="(item,index) in imgList1" :key='index' class="img-box"
:style="'width:'+imgWidth+';height:'+imgHeight" :src="item.imgUrl" @click="targetDetail(item)"
mode=""></image>
</view>
<view class="imgList2">
<image v-for="(item,index) in imgList2" :key='index' class="img-box" :style="'width:'+imgWidth+';height:'+imgHeight"
:src="item.imgUrl" mode=""></image>
<image v-for="(item,index) in imgList2" :key='index' class="img-box"
:style="'width:'+imgWidth+';height:'+imgHeight" :src="item.imgUrl" mode=""></image>
</view>
</view>
</view>
@ -36,7 +37,7 @@
success: res => {
console.log(res)
this.imgWidth = res.windowWidth - 60 + 'rpx'
this.imgHeight = (res.windowWidth - 60) * 2 - 30 +'rpx'
this.imgHeight = (res.windowWidth - 60) * 2 - 30 + 'rpx'
this.getImgList()
}
})
@ -59,6 +60,22 @@
icon: 'error'
})
}
},
//
targetDetail(item) {
console.log('跳转', item)
if (item.id) {
uni.setStorage({
key: 'detailId',
data: item.id,
success() {
console.log(111111)
uni.redirectTo({
url: '../creator/imgDetail'
})
}
})
}
}
},
// onUnload() {
@ -73,6 +90,7 @@
.choiceness {
padding-right: 40rpx;
padding-top: 40rpx;
.uni-searchbar {
border: 1px solid #11A8FD;
border-radius: 16rpx;
@ -86,6 +104,7 @@
.choiceness-list {
display: flex;
.first-box {
border-radius: 16rpx;
font-size: 16px;

1
unpackage/dist/dev/mp-toutiao/app.json

@ -4,6 +4,7 @@
"pages/index/choiceness",
"pages/creator/creator",
"pages/creator/userDetail",
"pages/creator/imgDetail",
"pages/userInfo/userInfo",
"pages/userInfo/myCollection/myCollection",
"pages/userInfo/question/question",

2
unpackage/dist/dev/mp-toutiao/common/main.js

File diff suppressed because one or more lines are too long

86
unpackage/dist/dev/mp-toutiao/common/vendor.js

File diff suppressed because one or more lines are too long

2
unpackage/dist/dev/mp-toutiao/pages/creator/creator.js

File diff suppressed because one or more lines are too long

224
unpackage/dist/dev/mp-toutiao/pages/creator/imgDetail.js

File diff suppressed because one or more lines are too long

5
unpackage/dist/dev/mp-toutiao/pages/creator/imgDetail.json

@ -0,0 +1,5 @@
{
"navigationBarTitleText": "",
"enablePullDownRefresh": true,
"usingComponents": {}
}

1
unpackage/dist/dev/mp-toutiao/pages/creator/imgDetail.ttml

@ -0,0 +1 @@
<view class="imgDetail"><image class="main-img" src="{{detailMsg.imgUrl}}" mode></image><view class="toolbar"><view class="toolbar-box"><text>热门</text></view><view class="toolbar-box"><text>下载</text><text>{{"下载"+detailMsg.downloadNum}}</text></view><view class="toolbar-box"><text>喜欢</text><text>{{"喜欢"+detailMsg.greatNum}}</text></view><view class="toolbar-box"><text>收藏</text><text>{{"收藏"+detailMsg.collectionNum}}</text></view><view class="toolbar-box"><text>分享</text></view></view></view>

29
unpackage/dist/dev/mp-toutiao/pages/creator/imgDetail.ttss

@ -0,0 +1,29 @@
.imgDetail {
height: 100vh;
width: 100vw;
overflow: hidden;
position: relative;
}
.imgDetail .main-img {
width: 100%;
height: 100%;
}
.imgDetail .toolbar {
width: 60px;
height: 360px;
background-color: rgba(255, 255, 255, 0.2);
position: absolute;
bottom: 76px;
right: 10px;
border-radius: 60px;
}
.imgDetail .toolbar .toolbar-box {
height: 60px;
}
.imgDetail .toolbar .toolbar-box text {
display: block;
text-align: center;
line-height: 30px;
font-size: 12px;
}

39
unpackage/dist/dev/mp-toutiao/pages/creator/userDetail.js

File diff suppressed because one or more lines are too long

2
unpackage/dist/dev/mp-toutiao/pages/creator/userDetail.ttml

@ -1 +1 @@
<view class="userDetail"><view class="avatar-box"><view class="avatar-top"><view class="avatar-left-box"><image src="{{userMsg.img}}" mode></image><text>{{userMsg.username}}</text></view><view class="avatar-right-box"><image src="../../static/img/share.svg" mode></image></view></view><view class="avatar-box-text">个性签名</view><view class="avatar-box-tag"><view class="avatar-box-tag-left"><view class="tag-left-box"><text>112</text><text>作品</text></view><view class="tag-left-box"><text>112</text><text>收藏</text></view><view class="tag-left-box"><text>112</text><text>喜欢</text></view></view><view class="avatar-box-tag-right"></view></view></view><view class="middle"><uni-segmented-control vue-id="b78c2d26-1" current="{{current}}" values="{{arrList}}" styleType="text" activeColor="#11A8FD" data-event-opts="{{[['^clickItem',[['onClickItem']]]]}}" bind:clickItem="__e" bind:__l="__l"></uni-segmented-control></view><view class="bottom"><block tt:for="{{userMsg.imgList}}" tt:for-item="item" tt:for-index="index" tt:key="index"><image style="{{('width:'+imgWidth+';height:'+imgHeight)}}" src="{{item.imgUrl}}" mode></image></block></view></view>
<view class="userDetail"><view class="avatar-box"><view class="avatar-top"><view class="avatar-left-box"><image src="{{userMsg.img}}" mode></image><text>{{userMsg.username}}</text></view><view class="avatar-right-box"><image src="../../static/img/share.svg" mode></image></view></view><view class="avatar-box-text">个性签名</view><view class="avatar-box-tag"><view class="avatar-box-tag-left"><view class="tag-left-box"><text>112</text><text>作品</text></view><view class="tag-left-box"><text>112</text><text>收藏</text></view><view class="tag-left-box"><text>112</text><text>喜欢</text></view></view><view class="avatar-box-tag-right"></view></view></view><view class="middle"><uni-segmented-control vue-id="b78c2d26-1" current="{{current}}" values="{{arrList}}" styleType="text" activeColor="#11A8FD" data-event-opts="{{[['^clickItem',[['onClickItem']]]]}}" bind:clickItem="__e" bind:__l="__l"></uni-segmented-control></view><view class="bottom"><block tt:for="{{userMsg.imgList}}" tt:for-item="item" tt:for-index="index" tt:key="index"><image style="{{('width:'+imgWidth+';height:'+imgHeight)}}" src="{{item.imgUrl}}" mode data-event-opts="{{[['tap',[['targetDetail',['$0'],[[['userMsg.imgList','',index]]]]]]]}}" bindtap="__e"></image></block></view></view>

21
unpackage/dist/dev/mp-toutiao/pages/index/choiceness.js

File diff suppressed because one or more lines are too long

2
unpackage/dist/dev/mp-toutiao/pages/index/choiceness.ttml

@ -1 +1 @@
<view class="choiceness"><uni-search-bar class="uni-mt-10" vue-id="d8b33852-1" placeholder="请输入喜欢的艺术家代号吧~" clearButton="auto" cancelButton="none" data-event-opts="{{[['^confirm',[['search']]]]}}" bind:confirm="__e" bind:__l="__l"></uni-search-bar><view class="choiceness-list"><view class="imgList1"><view class="first-box" style="{{('width:'+imgWidth)}}">热门作品</view><block tt:for="{{imgList1}}" tt:for-item="item" tt:for-index="index" tt:key="index"><image class="img-box" style="{{('width:'+imgWidth+';height:'+imgHeight)}}" src="{{item.imgUrl}}" mode></image></block></view><view class="imgList2"><block tt:for="{{imgList2}}" tt:for-item="item" tt:for-index="index" tt:key="index"><image class="img-box" style="{{('width:'+imgWidth+';height:'+imgHeight)}}" src="{{item.imgUrl}}" mode></image></block></view></view></view>
<view class="choiceness"><uni-search-bar class="uni-mt-10" vue-id="d8b33852-1" placeholder="请输入喜欢的艺术家代号吧~" clearButton="auto" cancelButton="none" data-event-opts="{{[['^confirm',[['search']]]]}}" bind:confirm="__e" bind:__l="__l"></uni-search-bar><view class="choiceness-list"><view class="imgList1"><view class="first-box" style="{{('width:'+imgWidth)}}">热门作品</view><block tt:for="{{imgList1}}" tt:for-item="item" tt:for-index="index" tt:key="index"><image class="img-box" style="{{('width:'+imgWidth+';height:'+imgHeight)}}" src="{{item.imgUrl}}" mode data-event-opts="{{[['tap',[['targetDetail',['$0'],[[['imgList1','',index]]]]]]]}}" bindtap="__e"></image></block></view><view class="imgList2"><block tt:for="{{imgList2}}" tt:for-item="item" tt:for-index="index" tt:key="index"><image class="img-box" style="{{('width:'+imgWidth+';height:'+imgHeight)}}" src="{{item.imgUrl}}" mode></image></block></view></view></view>

4
unpackage/dist/dev/mp-toutiao/pages/index/index.js

File diff suppressed because one or more lines are too long

24
unpackage/dist/dev/mp-toutiao/pages/userInfo/contactUs/contactUs.js

File diff suppressed because one or more lines are too long

120
unpackage/dist/dev/mp-toutiao/pages/userInfo/myCollection/myCollection.js

File diff suppressed because one or more lines are too long

26
unpackage/dist/dev/mp-toutiao/pages/userInfo/question/question.js

File diff suppressed because one or more lines are too long

24
unpackage/dist/dev/mp-toutiao/pages/userInfo/setting/setting.js

File diff suppressed because one or more lines are too long

28
unpackage/dist/dev/mp-toutiao/pages/userInfo/userInfo.js

File diff suppressed because one or more lines are too long

7
unpackage/dist/dev/mp-toutiao/project.config.json

@ -4,10 +4,5 @@
"es6": true
},
"appid": "ttc408b2b55b364f6601",
"projectname": "app",
"condition": {
"miniprogram": {
"current": -1
}
}
"projectname": "app"
}

2
unpackage/dist/dev/mp-toutiao/static/img/分享 (1).svg

@ -1,2 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1652699648832" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4781" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M833.493333 842.666667H201.173333A43.413333 43.413333 0 0 1 160 797.333333v-485.333333A43.413333 43.413333 0 0 1 201.173333 266.666667h91.84a10.666667 10.666667 0 0 1 0 21.333333h-91.84A22.293333 22.293333 0 0 0 181.333333 312v485.333333A22.293333 22.293333 0 0 0 201.173333 821.333333h632.32A22.293333 22.293333 0 0 0 853.333333 797.333333V508.48a10.666667 10.666667 0 0 1 21.333334 0v288.853333A43.413333 43.413333 0 0 1 833.493333 842.666667z" fill="#ffffff" p-id="4782"></path><path d="M330.666667 640a10.666667 10.666667 0 0 1-10.666667-10.666667 362.666667 362.666667 0 0 1 362.666667-362.666666h141.12L709.333333 201.28a10.666667 10.666667 0 1 1 10.666667-18.56l149.333333 85.333333A10.666667 10.666667 0 0 1 864 288H682.666667a341.333333 341.333333 0 0 0-341.333334 341.333333 10.666667 10.666667 0 0 1-10.666666 10.666667z" fill="#ffffff" p-id="4783"></path></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

2
unpackage/dist/dev/mp-toutiao/static/img/分享.svg

@ -1,2 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1652699253628" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4168" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M858.68639 1024H165.31169A165.50369 165.50369 0 0 1 0 858.68831V165.31361A165.50369 165.50369 0 0 1 165.31169 0.00192H511.99904a31.99994 31.99994 0 0 1 0 63.99988H165.31169C109.439795 64.0018 63.99988 109.441715 63.99988 165.31361v693.3107C63.99988 914.560205 109.439795 960.00012 165.31169 960.00012h693.3107C914.558285 960.00012 959.9982 914.560205 959.9982 858.68831V580.544831a31.99994 31.99994 0 0 1 63.99988 0v278.143479A165.50369 165.50369 0 0 1 858.68639 1024z" p-id="4169" fill="#11A8FD"></path><path d="M366.719312 742.528528a31.87194 31.87194 0 0 1-31.74394-28.543947c-0.895998-8.447984-20.479962-209.087608 123.775768-368.767308 102.079809-113.023788 258.303516-175.231671 464.959128-185.343653L831.99844 52.801821a31.99994 31.99994 0 1 1 48.639909-41.599922l135.679745 158.335703a31.99994 31.99994 0 0 1-24.319954 52.799901h-6.463988c-218.303591 0-379.391289 55.551896-478.783102 165.119691-125.183765 137.983741-108.351797 318.015404-108.159797 319.8074a32.06394 32.06394 0 0 1-28.479947 35.135934c-1.151998 0.128-2.239996 0.128-3.391994 0.128z" p-id="4170" fill="#11A8FD"></path><path d="M856.318394 403.265164a31.99994 31.99994 0 0 1-25.663951-51.199904l135.679745-180.927661a31.99994 31.99994 0 0 1 51.263904 38.399928l-135.679746 180.927661a31.99994 31.99994 0 0 1-25.599952 12.799976z" p-id="4171" fill="#11A8FD"></path></svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

30
unpackage/dist/dev/mp-toutiao/uni_modules/uni-badge/components/uni-badge/uni-badge.js

File diff suppressed because one or more lines are too long

32
unpackage/dist/dev/mp-toutiao/uni_modules/uni-icons/components/uni-icons/uni-icons.js

File diff suppressed because one or more lines are too long

34
unpackage/dist/dev/mp-toutiao/uni_modules/uni-list/components/uni-list-item/uni-list-item.js

File diff suppressed because one or more lines are too long

30
unpackage/dist/dev/mp-toutiao/uni_modules/uni-list/components/uni-list/uni-list.js

File diff suppressed because one or more lines are too long

34
unpackage/dist/dev/mp-toutiao/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.js

File diff suppressed because one or more lines are too long

30
unpackage/dist/dev/mp-toutiao/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save