1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<template>
<view class="content">
<view v-if="vlogList.length>0 && show===false" class="noEmpty">
<view style="height: 20rpx;"></view>
<u-search bg-color="#434957" color="#ffffff" placeholder="景区/关键词搜索" v-model="search" :clearabled="true"
@search="query" :show-action="false"></u-search>
<view class="body">
<view class="item" v-for="(item,index) in vlogList" :key="index" @click="navTo(item)">
<image :src="item.thumbImageUrl" mode="widthFix"></image>
<text>{{item.merchantName}}</text>
</view>
</view>
<navigator url="../vlogface/vlogface" class="btnn">
<view>点击获取我的Vlog</view>
</navigator>
</view>
<view v-else-if="vlogList.length===0 && show===false" class="empty">
<view class="row">
<text>空空如也...</text>
<image src="../static/vlog/icon/icon_thereisnovideo.png"></image>
</view>
<navigator url="../vlogface/vlogface" class="btnn">
<view>点击获取我的Vlog</view>
</navigator>
</view>
<view v-else></view>
</view>
</template>
<script>
export default {
data() {
return {
show: true, //跳转过渡页面
vlogList: [], //我的vlog集合
}
},
onReady() {},
onLoad() {
this.$request('distribution/vlog/getVlogCreateInfo', {//获取结果
userId: uni.getStorageSync('openid')
}).then(res=>{
setTimeout(()=>{
this.getMyVlogList()
},1000)
})
},
methods: {
navTo(item){
this.$u.route('/pages/vlog/vlogList/vlogList?merchantId='+item.merchantId)
},
getMyVlogList(){
this.$request('wechatUser/myPage/getVlogRecord', {
openid: uni.getStorageSync('openid'),
productType:0
}).then(res => {
this.show = false
if(res.code==='00'){
this.vlogList = res.data
if (this.vlogList.length > 0) { //如果有数据
uni.setNavigationBarColor({ //动态更改导航条颜色
frontColor: '#ffffff',
backgroundColor: '#192033',
animation: {
duration: 1,
timingFunc: 'easeIn'
}
})
uni.setBackgroundColor({
backgroundColor: '#192033'
})
} else { //数据为空
this.show = false
}
}else{
uni.showModal({
title: '提示',
content: res.message,
showCancel: false,
})
}
})
},
query(e) {
console.log(e)
},
}
}
</script>
<style lang="scss" scoped>
.content {
height: 100%;
width: 100%;
text-align: center;
.noEmpty {
color: #fff;
height: 100%;
width: 100%;
background-color: #192033;
padding: 0 20rpx;
.body {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 30rpx;
.item {
width: 49%;
// height: 250rpx;
margin-top: 20rpx;
image {
width: 100%;
height: 80%;
border-radius: 10rpx;
}
text {
font-weight: bold;
}
}
}
.btnn {
display: inline-block;
font-size: 28rpx;
border-radius: 40rpx;
background-color: #fff;
padding: 20rpx 40rpx;
margin: 30rpx 0;
font-weight: bold;
color: #333;
}
}
.empty {
height: 100%;
width: 100%;
background-color: #fff;
padding: 0 20rpx;
text-align: center;
padding-top: 30rpx;
.row {
height: 200rpx;
background: linear-gradient(90deg, #ECF5FF 0%, #CEE5FF 100%);
line-height: 200rpx;
border-radius: 10rpx;
margin-bottom: 300rpx;
text {
font-weight: bold;
font-size: 32rpx;
float: left;
margin-left: 120rpx;
}
image {
height: 180rpx;
width: 200rpx;
float: right;
margin-right: 50rpx;
}
}
.btnn {
display: inline-block;
font-size: 28rpx;
border-radius: 40rpx;
background-color: #FFE600;
padding: 20rpx 40rpx;
margin: 30rpx 0;
font-weight: bold;
}
}
}
</style>