xuqiang 4 vuotta sitten
vanhempi
commit
c4354aa09b

+ 14 - 0
project.private.config.json

@@ -25,6 +25,20 @@
                     "pathName": "/pages/mine",
                     "query": "",
                     "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "购物车",
+                    "pathName": "/pages/allorder",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "订单详情",
+                    "pathName": "/pages/orderdetails",
+                    "query": "",
+                    "scene": null
                 }
             ]
         }

+ 220 - 0
src/components/AllorderInfo.vue

@@ -0,0 +1,220 @@
+<template>
+    <div class="container">
+        <div class="box">
+            <div class="box1" @click="navigateTo('/pages/orderdetails')">
+                <div class="tit">
+                    <img src="../native/tabbar/info_icon_dizhi@3x.png" alt="" />
+                    <div class="tit1">益禾堂(一食堂)</div>
+                </div>
+                <div class="address">
+                    <img
+                        class="avatar"
+                        src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-10-17-31-24egsujwUw.jpg"
+                    />
+                    <div>
+                        <div class="text1">订单将在 4:22 后自动取消</div>
+                        <div class="text1">请尽快完成支付</div>
+                    </div>
+                    <img class="inter" src="../native/tabbar/线性图标/icon_inter@3x.png" alt="" />
+                </div>
+                <div class="btn">
+                    <div class="order">取消订单</div>
+                    <div class="pay">立即支付</div>
+                </div>
+                <div class="border"></div>
+
+                <div class="ImgBox">
+                    <div v-for="(item, index) in takeoutList" :key="index">
+                        <div>
+                            <img :src="item.imges" alt="" />
+                            <p>{{ item.name }}</p>
+                        </div>
+                    </div>
+                    <div class="list">
+                        <p>共{{ list.lists.length }}件</p>
+                        <img class="img" src="../native/tabbar/线性图标/icon_inter@3x.png" alt="" />
+                    </div>
+                </div>
+                <div class="time">
+                    <p>下单时间: {{ list.createdAt }}</p>
+                    <div>
+                        <div class="text1 text2">合计:¥{{ list.total }}</div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    data() {
+        return {
+            list: {
+                transactionId: '2019052035464',
+                createdAt: '2021-05-20 07:52:36',
+                remark: '加急',
+                packPrice: '2',
+                distributionPrice: '2',
+                total: '37',
+                lists: [
+                    {
+                        price: '11',
+                        name: '南瓜粥',
+                        num: '1',
+                        imges:
+                            'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-10-17-31-24egsujwUw.jpg'
+                    },
+                    {
+                        price: '22',
+                        name: '南瓜粥,八宝粥',
+                        num: '2',
+                        imges:
+                            'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-10-17-31-24egsujwUw.jpg'
+                    }
+                ]
+            }
+        };
+    },
+    computed: {
+        takeoutList() {
+            return [...this.takeout].filter((item, index) => {
+                return index < 3;
+            });
+        }
+    },
+    created() {
+        this.takeout = this.list.lists;
+    }
+};
+</script>
+<style lang="less" scoped>
+.container {
+    padding: 0 12px;
+    .box {
+        width: 351px;
+        background: #ffffff;
+        border-radius: 12px;
+        padding: 16px 0;
+        .box1 {
+            margin: 0 12px;
+            .tit {
+                .flex();
+                img {
+                    width: 18px;
+                    height: 18px;
+                }
+                .tit1 {
+                    font-size: 14px;
+                    font-weight: 400;
+                    color: #000000;
+                    margin-left: 5px;
+                    line-height: 24px;
+                }
+            }
+            .address {
+                .flex();
+                justify-content: space-between;
+                margin: 14px 0 17px;
+                .avatar {
+                    margin-right: 6px;
+                    width: 48px;
+                    height: 48px;
+                    border-radius: 8px !important;
+                }
+                .text1 {
+                    font-size: 14px;
+                    font-weight: 400;
+                    color: #000;
+                    line-height: 20px;
+                    margin-left: -72px;
+                }
+                .inter {
+                    width: 28px;
+                    height: 28px;
+                    margin-right: -10px;
+                }
+            }
+            .btn {
+                display: flex;
+                margin-left: 152px;
+                .order {
+                    width: 80px;
+                    height: 34px;
+                    border-radius: 8px;
+                    color: @prim;
+                    margin-right: 12px;
+                    line-height: 34px;
+                    font-size: 14px;
+                    text-align: center;
+                    border: 1px solid @prim;
+                }
+                .pay {
+                    width: 80px;
+                    height: 36px;
+                    line-height: 36px;
+                    font-size: 14px;
+                    text-align: center;
+                    color: #ffffff;
+                    background: @prim;
+                    border-radius: 8px;
+                }
+            }
+            .border {
+                height: 1px;
+                background: @bg;
+                margin: 20px 0 16px;
+            }
+            .ImgBox {
+                .flex();
+                margin-bottom: 18px;
+                img {
+                    width: 80px;
+                    height: 80px;
+                    border-radius: 8px;
+                    margin-right: 12px;
+                }
+                p {
+                    font-size: 14px;
+                    font-weight: bold;
+                    color: #1c1c1c;
+                    line-height: 24px;
+                }
+                .list {
+                    .flex();
+                    p {
+                        width: 43px;
+                        font-size: 14px;
+                        font-weight: 400;
+                        color: #c8c9cc;
+                        line-height: 24px;
+                    }
+                    .img {
+                        width: 28px;
+                        height: 28px;
+                        margin-left: -10px;
+                    }
+                }
+            }
+            .time {
+                .flex();
+                justify-content: space-between;
+                p {
+                    font-size: 14px;
+                    font-weight: 400;
+                    color: #c8c9cc;
+                    line-height: 24px;
+                }
+                .text1 {
+                    font-size: 14px;
+                    font-weight: bold;
+                    color: #c8c9cc;
+                    line-height: 24px;
+                }
+                &.text2 {
+                    color: #000;
+                }
+            }
+        }
+    }
+}
+</style>

+ 5 - 3
src/main.js

@@ -34,7 +34,9 @@ export default {
             'pages/setting',
             'pages/changeText',
             'pages/chooseAddress',
-            'pages/receiving'
+            'pages/receiving',
+            'pages/allorder',
+            'pages/orderdetails'
         ],
         tabBar: {
             color: '#333',
@@ -47,8 +49,8 @@ export default {
                     selectedIconPath: 'native/tabbar/tabbar_icon_01_pre@3x.png'
                 },
                 {
-                    pagePath: 'pages/news',
-                    text: '消息',
+                    pagePath: 'pages/allorder',
+                    text: '订单',
                     iconPath: 'native/tabbar/tabbar_icon_02@3x.png',
                     selectedIconPath: 'native/tabbar/tabbar_icon_02_pre@3x.png'
                 },

BIN
src/native/imgs/btn_01@4x.png


BIN
src/native/imgs/btn_02@3x.png


BIN
src/native/imgs/img_home_top@4x.png


+ 0 - 1
src/pages/Home.vue

@@ -101,7 +101,6 @@ export default {
             img {
                 width: 100%;
                 height: 100%;
-                border-radius: 8px;
             }
         }
     }

+ 118 - 0
src/pages/allorder.vue

@@ -0,0 +1,118 @@
+<config>
+{
+    "navigationBarTitleText": "购物车",
+    "navigationBarBackgroundColor": "#ffffff",
+}
+</config>
+<template>
+    <div class="container">
+        <div class="box-tab">
+            <div
+                class="tab-item"
+                :class="{ active: item === active }"
+                v-for="(item, index) in tabs"
+                :key="index"
+                @click="chageFn(item)"
+            >
+                {{ item }}
+            </div>
+        </div>
+        <!-- <div v-for="(item, index) in allList" :key="index + 2">
+            <allorder-info :all="item" @refreash="allFn"></allorder-info>
+        </div> -->
+        <allorder-info></allorder-info>
+        <van-empty
+            v-if="empty"
+            image="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/kong_png_womaidaode%403x.png"
+            description="暂无相关订单哦~"
+        >
+            <van-button round type="danger" class="bottom-button">
+                去逛逛
+            </van-button>
+        </van-empty>
+    </div>
+</template>
+<script>
+import AllorderInfo from '../components/AllorderInfo.vue';
+// import allPage from '../mixins/allPage';
+export default {
+    components: { AllorderInfo },
+    // mixins: [allPage],
+    data() {
+        return {
+            active: '全部',
+            tabs: ['全部', '待支付', '待评价', '退款'],
+            empty: false,
+            allList: []
+        };
+    },
+    methods: {
+        chageFn(item) {
+            this.active = item;
+            this.allFn();
+        },
+        allFn() {
+            this.allList = [];
+            // this.showLoading();
+            this.list = [];
+            this.empty = false;
+            // let userId = this.$store.state.userInfo.id;
+            // this.$http
+            //     .get('/orderInfo/showMyOrderInfos', {
+            //         orderStatus: this.allStatus(this.active),
+            //         userId
+            //     })
+            //     .then(res => {
+            //         this.hideLoading();
+            //         console.log(res);
+            //         this.allList = res;
+            //         if (res.length === 0) {
+            //             this.empty = true;
+            //         }
+            //     })
+            //     .catch(e => {
+            //         wx.hideLoading();
+            //         wx.showToast({
+            //             icon: 'none',
+            //             title: e.error
+            //         });
+            //     });
+        },
+        loginMethods() {
+            // this.allFn();
+        }
+    }
+};
+</script>
+<style lang="less" scoped>
+.container {
+    background: @bg;
+    padding-top: 40px;
+    min-height: 562px;
+    .box-tab {
+        background: #ffffff;
+        .flex();
+        justify-content: space-between;
+        position: fixed;
+        top: 0;
+        width: 77%;
+        padding: 18px 65px 10px 20px;
+        .tab-item {
+            font-size: 14px;
+            color: #ccc;
+            line-height: 24px;
+
+            &.active {
+                color: @prim;
+                border-bottom: 1px solid @prim;
+            }
+        }
+    }
+    /deep/ .van-button {
+        width: 290px;
+        height: 48px;
+        background: @prim;
+        border-radius: 12px;
+    }
+}
+</style>

+ 2 - 2
src/pages/changeText.vue

@@ -62,8 +62,8 @@ export default {
 
 <style lang="less" scoped>
 /deep/ .van-button {
-    --button-primary-background-color: #159eff;
-    --button-primary-border-color: #159eff;
+    --button-primary-background-color: @prim;
+    --button-primary-border-color: @prim;
 }
 .submit {
     margin: 81px 43px 100px;

+ 1 - 0
src/pages/chooseAddress.vue

@@ -62,6 +62,7 @@ export default {
             wx.navigateBack();
         },
         choose(info) {
+            console.log(info);
             if (this.pageType === 'order') {
                 let pages = getCurrentPages();
                 let prevPage = pages[pages.length - 2];

+ 1 - 1
src/pages/mine.vue

@@ -84,7 +84,7 @@ export default {
     margin-top: 10px;
 }
 .container {
-    background: #f5f7fa;
+    background: @bg;
     height: 730px;
     .mytest {
         position: absolute;

+ 395 - 0
src/pages/orderdetails.vue

@@ -0,0 +1,395 @@
+<config>
+{
+    "backgroundTextStyle":"light",
+    "navigationStyle": "custom",
+}
+</config>
+<template>
+    <div class="container">
+        <div class="top">
+            <img class="mytest" src="../native/imgs/img_home_top@4x.png" alt="" />
+            <div class="text1">待支付</div>
+            <div class="text2">请尽快支付,04分56秒 后未支付将自动取消订单</div>
+        </div>
+        <div class="store">
+            <div class="title">
+                <img src="../native/tabbar/info_icon_dizhi@3x.png" alt="" />
+                <div class="tit">益禾堂(一食堂)</div>
+            </div>
+            <div class="store1">联系卖家</div>
+        </div>
+        <div class="border"></div>
+        <div v-for="(item, index) in takeout" :key="index">
+            <div class="content">
+                <div class="ImgBox">
+                    <img :src="item.imges" alt="" />
+                    <div>
+                        <div class="name">{{ item.name }}</div>
+                        <div class="name1">共{{ item.num }}件</div>
+                    </div>
+                </div>
+                <div class="money">¥{{ item.price }}</div>
+            </div>
+        </div>
+        <div class="order">
+            <div class="text1">打包费</div>
+            <div class="text1">¥{{ list.packPrice }}</div>
+        </div>
+        <div class="order order2">
+            <div class="text1">配送费</div>
+            <div class="text1">¥{{ list.distributionPrice }}</div>
+        </div>
+        <div class="add">
+            <div class="text">合计:¥{{ list.total }}</div>
+        </div>
+        <div class="border2"></div>
+        <div class="address">
+            <div class="name">配送地址</div>
+            <div>
+                <div class="text1">南京**江宁校区-4号宿舍楼</div>
+                <div class="text1">奶盖 18789898888</div>
+            </div>
+        </div>
+        <div class="address">
+            <div class="name">期望时间</div>
+            <div>
+                <div class="text1">立即配送</div>
+            </div>
+        </div>
+        <div class="remark">
+            <div class="name">备注</div>
+            <div>
+                <div class="text1">{{ list.remark }}</div>
+            </div>
+        </div>
+        <div class="border2"></div>
+        <div class="box">
+            <div class="box-con">
+                <p>订单编号</p>
+                <div class="texe1">
+                    <span @click="orderCopy">复制</span>
+                    <div class="text2">{{ list.transactionId }}</div>
+                </div>
+            </div>
+        </div>
+        <div class="box">
+            <div class="box-con">
+                <p>下单时间</p>
+                <div class="texe1">
+                    <div class="text2">{{ list.createdAt }}</div>
+                </div>
+            </div>
+        </div>
+        <div class="btn">
+            <div class="box-btn">
+                <div class="text1">
+                    <img src="../native/imgs/btn_02@3x.png" alt="" />
+                    <span>取消订单</span>
+                </div>
+                <div class="text2">
+                    <img src="../native/imgs/btn_01@4x.png" alt="" />
+                    <span class="box-btn-sp">立即支付</span>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    data() {
+        return {
+            takeout: [],
+            list: {
+                transactionId: '2019052035464',
+                createdAt: '2021-05-20 07:52:36',
+                remark: '加急',
+                packPrice: '2',
+                distributionPrice: '2',
+                total: '37',
+                lists: [
+                    {
+                        price: '11',
+                        name: '南瓜粥',
+                        num: '1',
+                        imges:
+                            'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-10-17-31-24egsujwUw.jpg'
+                    },
+                    {
+                        price: '22',
+                        name: '南瓜粥,八宝粥',
+                        num: '2',
+                        imges:
+                            'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-10-17-31-24egsujwUw.jpg'
+                    }
+                ]
+            }
+        };
+    },
+    methods: {
+        orderCopy() {
+            wx.setClipboardData({
+                data: this.list.transactionId + '',
+                success(res) {
+                    wx.getClipboardData({
+                        success(res) {
+                            wx.showToast({
+                                title: '订单单号复制成功'
+                            });
+                        }
+                    });
+                }
+            });
+        }
+    },
+    created() {
+        this.takeout = this.list.lists;
+    }
+};
+</script>
+<style lang="less" scoped>
+.container {
+    margin: 0 16px;
+    padding-bottom: 140px;
+    .top {
+        margin-top: 100px;
+        .mytest {
+            position: absolute;
+            top: 0;
+            left: 0;
+            right: 0;
+            margin: auto;
+            width: 100%;
+            height: 190px;
+            z-index: -1;
+            img {
+                width: 100vw;
+                display: block;
+            }
+        }
+        .text1 {
+            font-size: 24px;
+            font-weight: bold;
+            color: #ffffff;
+            line-height: 34px;
+        }
+        .text2 {
+            font-size: 14px;
+            font-weight: 400;
+            color: #ffffff;
+            line-height: 24px;
+        }
+    }
+    .store {
+        .flex();
+        justify-content: space-between;
+        margin-top: 60px;
+        .title {
+            .flex();
+            img {
+                width: 18px;
+                height: 18px;
+            }
+            .tit {
+                font-size: 14px;
+                font-weight: 400;
+                color: #000000;
+                line-height: 24px;
+                padding-left: 6px;
+            }
+        }
+        .store1 {
+            font-size: 14px;
+            font-weight: 400;
+            color: @prim;
+            line-height: 24px;
+        }
+    }
+    .border {
+        border: 1px solid @bg;
+        margin: 10px 0 16px;
+    }
+    .content {
+        display: flex;
+        justify-content: space-between;
+        margin-bottom: 16px;
+        .ImgBox {
+            display: flex;
+            img {
+                width: 80px;
+                height: 80px;
+                border-radius: 8px;
+                margin-right: 18px;
+            }
+            .name {
+                font-size: 14px;
+                font-weight: bold;
+                color: #1c1c1c;
+                line-height: 24px;
+            }
+            .name1 {
+                font-size: 14px;
+                font-weight: 400;
+                color: #c8c9cc;
+                line-height: 24px;
+            }
+        }
+        .money {
+            font-size: 16px;
+            font-weight: bold;
+            color: #1c1c1c;
+            line-height: 26px;
+        }
+    }
+    .order {
+        margin-bottom: 4px;
+        .flex();
+        justify-content: space-between;
+        .text1 {
+            font-size: 13px;
+            font-weight: 400;
+            color: #939599;
+            line-height: 24px;
+        }
+        &.order2 {
+            margin-bottom: 14px;
+        }
+    }
+    .add {
+        text-align: right;
+        .text {
+            font-size: 14px;
+            font-weight: bold;
+            color: #939599;
+            line-height: 24px;
+        }
+    }
+    .border2 {
+        width: 375px;
+        height: 5px;
+        margin: 20px 0 15px;
+        background: @bg;
+    }
+    .address {
+        display: flex;
+        justify-content: space-between;
+        margin-bottom: 35px;
+        .name {
+            font-size: 14px;
+            font-weight: bold;
+            color: #000000;
+            line-height: 20px;
+        }
+        .text1 {
+            font-size: 16px;
+            font-weight: 400;
+            color: #000000;
+            line-height: 24px;
+        }
+    }
+    .remark {
+        .flex();
+        justify-content: space-between;
+        margin-bottom: 20px;
+        .name {
+            font-size: 14px;
+            font-weight: bold;
+            color: #000000;
+            line-height: 20px;
+        }
+        .text1 {
+            font-size: 13px;
+            font-weight: 400;
+            color: #c8c9cc;
+            line-height: 22px;
+        }
+    }
+    .box {
+        margin-bottom: 16px;
+        .box-con {
+            .flex();
+            justify-content: space-between;
+            .texe1 {
+                display: flex;
+                span {
+                    width: 38px;
+                    height: 18px;
+                    border-radius: 2px;
+                    border: 2px solid #c8c9cc;
+                    font-size: 12px;
+                    font-weight: 400;
+                    color: #c8c9cc;
+                    line-height: 18px;
+                    text-align: center;
+                    margin-right: 3px;
+                }
+            }
+            p {
+                height: 24px;
+                font-size: 13px;
+                font-weight: 400;
+                color: #939599;
+                line-height: 24px;
+            }
+            .text2 {
+                height: 22px;
+                font-size: 13px;
+                font-weight: 400;
+                color: #000000;
+                line-height: 22px;
+            }
+        }
+    }
+    .btn {
+        padding-bottom: 40px;
+        position: fixed;
+        bottom: 0;
+        width: 100%;
+        background: #ffffff;
+        .box-btn {
+            display: flex;
+            justify-content: space-between;
+            margin-right: 35px;
+            .text1 {
+                width: 163px;
+                font-size: 16px;
+                font-weight: 400;
+                color: @prim;
+                line-height: 48px;
+                z-index: 1;
+                img {
+                    padding-bottom: 40px;
+                    position: absolute;
+                    width: 163px;
+                    height: 48px;
+                    z-index: -1;
+                }
+                span {
+                    padding-left: 49px;
+                }
+            }
+            .text2 {
+                width: 163px;
+                font-size: 16px;
+                font-weight: 400;
+                color: @prim;
+                text-align: center;
+                line-height: 48px;
+                padding-right: 25px;
+                img {
+                    padding-bottom: 40px;
+                    position: absolute;
+                    width: 163px;
+                    height: 48px;
+                    z-index: -1;
+                }
+                span {
+                    padding-left: 49px;
+                }
+                .box-btn-sp {
+                    color: @ff;
+                }
+            }
+        }
+    }
+}
+</style>

+ 5 - 5
src/pages/receiving.vue

@@ -195,12 +195,12 @@ export default {
     }
 }
 /deep/ .van-button {
-    background: #159eff !important;
-    border-color: #159eff !important;
+    background: @prim !important;
+    border-color: @prim !important;
 }
 .container {
     .box-but {
-        background: #f5f7fa;
+        background: @bg;
         width: 100%;
         height: 500px;
         .box-img {
@@ -228,10 +228,10 @@ export default {
                 width: 290px;
                 height: 48px;
                 border-radius: 12px;
-                border: 1px solid #159eff;
+                border: 1px solid @prim;
                 font-size: 16px;
                 font-weight: 400;
-                color: #159eff;
+                color: @prim;
                 text-align: center;
                 line-height: 48px;
             }

BIN
src/store/banner-jpg-01@3x.png


+ 3 - 2
src/styles/common.less

@@ -1,6 +1,6 @@
-@prim: #ff6c00;
+@prim: #159EFF;
 @success: #07c160;
-@danger: #ff6c00;
+@danger: #159EFF;
 @warn: #ff976a;
 @text0: #181818;
 @text1: #323233;
@@ -12,6 +12,7 @@
 @border3: #dfe1e6;
 @border4: #f2f6fc;
 @bg: #f5f7fa;
+@ff: #ffffff;
 .flex1 {
     flex-grow: 1;
 }

+ 1 - 1
src/styles/vanIndex.less

@@ -1,4 +1,4 @@
-@prim: #ff6c00;
+@prim: #159EFF;
 
 .van-button {
     --button-primary-background-color: @prim;