marketingList.vue
3.37 KB
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
<template>
<!-- 营销推广活动 -->
<view class="page">
<!-- 搜索 -->
<view class="head-search">
<u-search bg-color="#fff" placeholder="请输入关键词" v-model="query.keyword" :show-action="false" @search="search"></u-search>
<u-button type="success" @click="search">搜索</u-button>
</view>
<view class="screen-list">
<view class="list" @click="sortshow = true">
<text>默认排序</text>
<image :src="$imgUrl('/down.png')"></image>
<u-select v-model="sortshow" :list="sortTypeOptions" @confirm="(v) => {queryChange('sortType', v)}"></u-select>
</view>
<view class="list" @click="statusshow = true">
<text>进行中</text>
<image :src="$imgUrl('/down.png')"></image>
<u-select v-model="statusshow" :list="statusOptions" @confirm="(v) => {queryChange('status', v)}"></u-select>
</view>
</view>
<!-- 订单列表 -->
<view class="goods-data">
<u-row :gutter="16" class="goods-list">
<u-col span="6" v-for="(item,index) in list" :key="index" @click="toDetail">
<view class="demo-layout good-item">
<image :src="$imgUrl('/img/2.jpg')" style="width: 315rpx; height: 315rpx; border-radius: 10rpx;"></image>
<view class="info">
<view class="title">这里有标题这里有标题这里有标题</view>
<view class="name">锦江绿道官方活动</view>
<u-tag text="进行中" type="success" mode="dark" />
</view>
</view>
</u-col>
<u-loadmore :status="status" @loadmore='loading' style="width: 100%; text-align: center;"/>
</u-row>
</view>
</view>
</template>
<script>
export default {
data() {
return {
status: 'loadmore',
list: 3,
total: 1,
query: {
keyword: '', // 搜索项
sortType: '', // 排序方式
status: '', // 活动状态
pageNum: 0,
pageSize: 10,
},
sortshow: false,
sortTypeOptions: [
{ label: '默认排序', value: 1 },
{ label: '正序', value: 2 },
{ label: '倒序', value: 3 },
],
statusshow: false,
statusOptions: [
{ label: '进行中', value: 1 },
{ label: '已结束', value: 2 },
{ label: '未开始', value: 3 },
],
};
},
onLoad() {
this.status = 'nomore';
},
onPullDownRefresh(e) {
let that = this
that.status = 'loading';
this.page = 0;
setTimeout(() => {
that.list = 1;
that.status = that.list >= that.total ? 'nomore' : 'loadmore';
uni.stopPullDownRefresh();
}, 1000);
},
onReachBottom(e) {
this.loading();
},
methods: {
toMyAdd() {
// 跳转我的活动申请
uni.navigateTo({
url: '/pages/mycreated/mycreated'
})
},
search() {
// 搜索
// this.loading();
},
queryChange(key, val) {
this.query[`${key}`] = val[0].value;
this.search();
},
loading() {
let that = this
if(that.status == 'nomore') return;
that.status = 'loading';
that.page = ++that.page;
setTimeout(() => {
that.list += 10;
that.status = that.list >= that.total ? 'nomore' : 'loadmore';
}, 300)
},
toDetail() {
uni.navigateTo({
url: '/pages/marketing/marketingDetail/marketingDetail'
})
},
join(){
uni.navigateTo({
url: '/pages/mycreated/mycreated?id=1'
})
},
toAdd() {
uni.navigateTo({
url: '/pages/activityAdd/activityAdd'
})
}
}
}
</script>
<style scoped lang="scss">
@import 'marketingList.scss';
</style>