订单详情页面

<template>
    <view class="info" >
    <view class="goods_list">
        <view class="goods_item" v-for="item in goods" :key="item.order_id">
            <view class="left_image">  <!-- 左侧图片 -->
                <image :src="item.super_goods_pic" mode="heightFix"></image>
            </view>
            <view class="right_text">
                <view class="goods_name">{{item.super_goods_name}}</view>
            
                <view class="goods_info">总价:{{item.total_price}}元</view>
                <view class="goods_info">数目:{{item.num}}</view>
                
                <view class="goods_info">时间:{{item.createtime}}</view>
                
            </view>    
        </view>     
    </view>    
    
        <view class="gds_item" >
            <view class="left_image">  <!-- 左侧图片 -->
                
            </view>
            <view class="rht_text">
                <view class="gds_name">收货信息</view>
            
                <view class="gds_info">用户姓名:{{user.user_name}}</view>
                <view class="gds_info">收货地址:{{user.user_address}}</view>
                
                <view class="gds_info">联系电话:{{user.user_phone_number}}</view>
                
            </view>    
        </view>
        
        <!-- <view class="bottom">
            <view><button class="bt" @click="addcart()" >再次购买</button></view>
            <view class="boxx">
                
            </view>
            <view><button class="bt" @click="navitocart()" >前往购物车</button></view>
        </view> -->
    </view>
</template>

<script>
    export default{
        data(){
            return{
                value:0,
                orderInfo: {
                    'order_id':0,
                },
                goods:[],
                data:{
                    'user_id':'1',
                    
                    'super_goods_id':'0',
                    'super_union_id':'1',
                    'number':1,
                    
                },
                user:[],
            }
        },
        methods:{
            async addcart(){
                
                this.data.super_goods_id=this.goods.super_goods_id;
                console.log(JSON.stringify(this.data))
                const res = await this.$myRequest({
                url: '/cart/addIntoCart',
                method: 'POST',
                data :JSON.stringify(this.data),
                })
                console.log(res);
                
            },
            navitocart(){
                uni.navigateTo({
                    url:''//跳转购物车
                });
            },
            
            async getOutInfo(){//这里和主页一样,从后台拿数据动态加载到界面上
            this.orderInfo.order_id=parseInt(this.orderInfo.order_id)
                console.log(JSON.stringify(this.orderInfo))
                const res = await this.$myRequest({
                url: '/order/getDetailsByOrderId',
                method: 'POST',
                data :JSON.stringify(this.orderInfo),
                })
                console.log(res)
                this.goods=res.data.description
                this.user=res.data.user_info    
                    },
                
            },
        
        onLoad(e){
            console.log(e)
            this.orderInfo.order_id=e.order_id;
            this.getOutInfo();
        }
    }
</script>

<style lang="scss">
    .info {
        .goods_list {
            .goods_item {
                background: white;
                display: flex;
                border-bottom: 8rpx solid #eee;
                .left_image {
                    image {
                        // padding: 12rpx;  
                        height:300rpx;
                        max-width:300rpx;
                        
                    }
                }
                
                .right_text {
                    
                     padding: 10rpx;
                    
                    word-wrap: break-word; // 允许换行
                    .goods_name {
                        font-size: 40rpx;
                        line-height: 60rpx;
                    }
                    
                    .goods_info {
                        font-size: 35rpx;
                        line-height: 70rpx;
                        color: #555555;
                    }
                    .number{
                        // height: 60rpx;
                        // width: 60rpx;
                        display: flex;
                        flex-direction: row;
                        align-items: flex-end;
                        }
                }
            }
            .gds_item {
                background: white;
                display: flex;
                border-bottom: 8rpx solid #eee;
                .left_image {
                    image {
                        // padding: 12rpx;  
                        height:300rpx;
                        max-width:300rpx;
                        
                    }
                }
                
                .rht_text {
                    height: 60rpx;
                    
                     padding: 20rpx;
                    
                    word-wrap: break-word; // 允许换行
                    .gds_name {
                        font-size: 40rpx;
                        line-height: 60rpx;
                    }
                    
                    .gds_info {
                        font-size: 35rpx;
                        line-height: 70rpx;
                        color: #555555;
                    }
                    
                }
            }
        }
        
        // .bt{
        //     width: 100%;
        //                     height: 80rpx;
        //                     color: white;
        //                     background: #007AFF;
        //                     border-radius: 50px;
        //                     justify-content: center;
        //                     align-items: center;
        // }
    }
</style>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值