移动系统liao
2024-05-09 5d6cb15ac86d9174393cb9d1538d69b567e2c26c
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
<template>
    <view>
        <u-toast ref="uToast" /><u-no-network></u-no-network>
        <u-navbar title="提货单列表" safeAreaInsetTop fixed placeholder>
            <view class="coreshop-navbar-left-slot" slot="left">
                <u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
                <u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
                <u-icon name="home" size="22" @click="goHome"></u-icon>
            </view>
            <view slot="right">
            </view>
        </u-navbar>
        <view v-if="ladingList.length>0">
            <view class="orderList" :class="item.status?' grayscale':''" v-for="(item, orderIndex) in ladingList" :key="orderIndex">
                <view class="coreshop-flex coreshop-justify-between">
                    <view class="coreshop-flex coreshop-align-center">
                        <u-icon name="tags" :size="20" color="rgb(94,94,94)"></u-icon>
                        <view class="coreshop-margin-left-5 coreshop-margin-right-5 coreshop-font-15 coreshop-font-weight-bold">提货码:{{item.id}}</view>
                        <view>
                            <u-tag text="复制" type="success" size="mini" @click="doCopyData(item.id)" />
                        </view>
                    </view>
                    <view>{{item.statusName}}</view>
                </view>
                <view class="item" v-for="(v, k) in item.orderItems" :key="k">
                    <view class="left">
                        <u--image :showLoading="true" :src="v.imageUrl" width="80px" height="80px" mode="aspectFill"></u--image>
                    </view>
                    <view class="content">
                        <view class="title u-line-2">{{v.name}}</view>
                        <view class="type u-line-2">{{v.addon}}</view>
                        <view class="success coreshop-font-12 coreshop-margin-top-10  coreshop-margin-bottom-10 coreshop-text-yellow">订单号:{{v.orderId}}</view>
                    </view>
                    <view class="right">
                        <view class="price">¥{{ v.price }}</view>
                        <view class="number">x{{ v.nums }}</view>
                    </view>
                </view>
                <view class="bottom coreshop-margin-0">
                    <view class="more">
                        下单时间:{{ $u.timeFormat(item.createTime, 'mm-dd hh:MM:ss') }}
                    </view>
                    <view class='logistics coreshop-btn' v-if="item.status == true" @click="ladingDel(item.id)">删除</view>
                    <view class='evaluate coreshop-btn' v-if="item.status == false" @click="ladingWrite(item.id)">提货单核销</view>
                </view>
            </view>
            <!-- 更多 -->
            <u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" margin-top="20" margin-bottom="20" />
        </view>
        <!-- 无数据时默认显示 -->
        <view class="coreshop-emptybox" v-else>
            <u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/data.png'" icon-size="150" text="暂无已核销提货单记录" mode="list"></u-empty>
        </view>
 
    </view>
</template>
 
<script>
 
    export default {
 
        data() {
            return {
                page: 1,
                limit: 10,
                ladingList: [],
                status: 'loadmore',
                iconType: 'flower',
                loadText: {
                    loadmore: '轻轻上拉',
                    loading: '努力加载中',
                    nomore: '实在没有了'
                },
                storeId: 0,
            }
        },
        onLoad(option) {
            this.storeId = option.storeId;
            this.getLadingList();
        },
        methods: {
            //获取提货单列表
            getLadingList() {
                let _this = this
                let data = {
                    page: _this.page,
                    limit: _this.limit,
                    id: _this.storeId
                }
                _this.status = 'loading';
                this.$u.api.storeLadingList(data).then(res => {
                    if (res.status) {
                        _this.ladingList = [..._this.ladingList, ...res.data]
                        // 判断数据是否加载完毕
                        if (_this.page < res.otherData.totalPages) {
                            _this.page++
                            _this.status = 'loadmore'
                        } else {
                            _this.status = 'nomore'
                        }
                    } else {
                        // 接口請求出錯
                        _this.$u.toast(res.msg)
                        _this.status = 'loadmore'
                    }
                });
            },
            //提货单核销
            ladingWrite(id) {
                this.$u.route('/pages/member/merchant/takeDelivery/index?id=' + id);
            },
            //删除
            ladingDel(id) {
                let _this = this
                this.$common.modelShow('提示', '删除提货单后将无法找回!', res => {
                    let data = {
                        'id': id
                    }
                    _this.$u.api.ladingDel(data).then(res => {
                        _this.$refs.uToast.show({
                            message: res.msg, type: 'success', complete: function () {
                                _this.page = 1;
                                _this.ladingList = [];
                                _this.getLadingList();
                            }
                        })
                    });
                });
            }
        },
        // 页面滚动到底部触发事件
        onReachBottom() {
            let _this = this
            if (_this.status === 'loadmore') {
                _this.getLadingList()
            }
        }
    }
</script>
 
<style lang="scss" scoped>
</style>