doum
12 小时以前 1382e80f33270e77e06414ce8ad3f085fde6142a
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
<template>
    <view class="activity-list">
        <view class="search-area" style="">
            <view class="search-conainer">
                <uni-easyinput
                    :inputBorder="false"
                    style="margin: auto 0;"
                    prefixIcon="search"
                    v-model="searchValue"
                    placeholder="搜索昵称"
                    confirmType="search"
                    @confirm="confirm"
                ></uni-easyinput>
            </view>
        </view>
        <mescroll-body
            ref="mescrollRef"
            @init="mescrollInit"
            :top="orderTop"
            @down="downCallback"
            :up="upOption"
            @up="upCallback"
        >
            <view v-for="(item,index) in activities" :key="index">
                <!-- :image="item.firstImage"
                    :orderNum="item.orderId"
                    :orderCode="item.orderCode"
                    :status="item.orderState"
                    :orderTitle="item.categoryName + ' ' + item.brandName"
                    :detail="item.aboutData"
                    :price="item.firstQuotation"
                    :orderTime="item.createTime"
                    @upDataList="upDataList" -->
                <commentItem
                    
                ></commentItem>
            </view>
        </mescroll-body>
        <view class="bottom-add"></view>
        <!-- <view class="bottom-add" style="position: fixed; bottom: 0;">
            <view class="add-action" @click="select">新增活动</view>
        </view> -->
    </view>
</template>
 
<script>
    import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
    import commentItem from './commentItem.vue'
    export default {
        mixins: [MescrollMixin],
        components: { commentItem },
        data() {
            
            return {
                searchValue: '',
                orderTop: 80,
                upOption:{
                    noMoreSize: 2, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
                    empty:{
                        tip: '', // 提示
                        // icon: require('@/static/images/default_nodata.png')
                    },
                    
                    textNoMore: '- 没有更多了 -'
                },
                activities: [],
            };
        },
        methods: {
            confirm() {
                console.log(this.searchValue);
            },
            tabChange() {
                
            },
            deleteAction(item) {
                console.log(item);
            },
            editAction(item) {
                console.log(item);
                uni.navigateTo({
                    url: `/pages/merchant/merchatCenter/merchantActivity/merchantActivityOprae?title=编辑活动`
                })
            },
            /*下拉刷新的回调 */
            downCallback() {
                // console.log('downCallback');
                this.activities = []// 先置空列表,显示加载进度
                // console.log('下拉刷新');
                // 下拉刷新的回调,默认重置上拉加载列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
                this.mescroll.resetUpScroll()
            },
            upCallback(page) {                
                uni.showLoading({
                    title: '加载中'
                })
                setTimeout(() => {
                    this.activities.push(...[1,2,3,4,5,6,7,8,9,10])
                    this.mescroll.endSuccess(10, false);
                    uni.hideLoading()
                }, 1000)
                // orderList({
                //     current: page.num,
                //     size: page.size,
                //     status: this.tabs[this.tabIndex].type
                // })
                //     .then(res => {
                //         this.goods = [...this.goods, ...res.data.records]
                //         // console.log('res.data.total',res.data.total);
                //         // console.log('this.goods.length', this.goods.length);
                //         this.mescroll.endSuccess(res.data.total, this.goods.length != res.data.total);
                //     })
                //     .catch(err => {
                //         this.mescroll.err()
                //     })
                //     .finally(() => {
                //         uni.hideLoading()
                //     })
            },
            select() {
                uni.navigateTo({
                    url: '/pages/merchant/merchatCenter/merchantActivity/merchantActivityOprae'
                })
            },
            showActivity() {
                
            }
        }
    }
</script>
 
<style lang="scss">
.activity-list {
    background-color: #fff;
    height: 100%;
}
.search-area {
    position: fixed;
    background-color: #fff;
    width: 100%;
    z-index: 999;
    padding: 20rpx 32rpx 0;
    box-sizing: border-box;
    .search-conainer {
        border-radius: 44rpx;
        background: #F5F5F5;
        
    }
    
    // margin:;
    
}
.bottom-add {
    width: 100%;
    height: 72rpx;
    padding-top: 134rpx;
    padding-bottom: env(safe-area-inset-bottom);
    .add-action {
        height: 72rpx;
        background: linear-gradient(90deg, #D95A5A 0%, #D20A0B 100%);
        border-radius: 44rpx;
        font-size: 32rpx;
        font-weight: 500;
        color: #FFFFFF;
        line-height: 72rpx;
        text-align: center;
        margin: 0 56rpx;
    }
}
</style>