123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522 |
- <template>
- <view class="orderDetail">
- <!-- 标题栏 -->
- <view class="nav">
- <view class="orderStatus" v-if="status == 2 && is_virtual == 0">待发货</view>
- <view class="orderStatus" v-if="status == 3 && is_virtual == 0 && express_type == 1">待收货</view>
- <view class="orderStatus" v-if="status == 3 && is_virtual == 1">待核销</view>
- <view class="orderStatus" v-if="status == 3 && is_virtual == 0 && express_type == 2">待核销</view>
- <view class="orderStatus" v-if="status == 4 && is_virtual == 0 && express_type == 1 ">已完成</view>
- <view class="orderStatus" v-if="status == 4 && is_virtual == 1">已核销</view>
- <view class="orderStatus" v-if="status == 4 && is_virtual == 0 && express_type == 2 ">已核销</view>
- <view class="nav-write" v-if="status == 4 && is_virtual == 1">
- <text>核销时间:</text>
- <text>{{goodsDet.complete_time}}</text>
- </view>
- <view class="nav-write" v-if="status == 4 && is_virtual == 0 && express_type == 2">
- <text>核销时间:</text>
- <text>{{goodsDet.complete_time}}</text>
- </view>
- </view>
- <view class="midBox">
- <!-- 物流信息 -->
- <view class="logistics" v-if="goodsDet.express_type == 1 && status == 3 ? true : goodsDet.express_type == 1 && status == 4 ? true : false ">
- <view class="logisticsTitle">物流信息</view>
- <view class="logisticsMsg"><text>快递公司</text><text
- style="margin-left: 26rpx;">{{goodsDet.express_company}}</text></view>
- <view class="logisticsMsg"><text>快递单号</text><text
- style="margin-left: 26rpx;">{{goodsDet.express_no}}</text>
- </view>
- <view class="copy" @click="copyOrder(goodsDet.express_no)">复制</view>
- </view>
- <!-- 配送信息 -->
- <view class="delivery">
- <view class="deliveryTitle">
- <text>配送信息</text>
- </view>
- <view class="deliveryMsg">
- <image class="bgimg" src="http://t9.9026.com/imgs/ordermap.png"></image>
- <!-- 联系信息 -->
- <view class="deliveryicon">
- <image src="/static/icon/phone.png"></image>
- <text>联系信息</text>
- </view>
- <view class="deliverytext">
- <text>{{goodsDet.receiver}}</text>
- <text style="margin-left: 24rpx;">{{goodsDet.phone}}</text>
- </view>
- <!-- 发货方式 -->
- <view class="deliveryicon">
- <image src="/static/icon/delivery.png"></image>
- <text>发货方式</text>
- </view>
- <view class="deliverytext">
- <text v-if="goodsDet.express_type ==1">快递发货</text>
- <text v-if="goodsDet.express_type ==2">到店自提/线下核销</text>
- </view>
- <!-- 收货地址 -->
- <view class="deliveryicon" v-if="goodsDet.express_type ==1">
- <image src="/static/icon/position.png"></image>
- <text>收货地址</text>
- </view>
- <view class="deliverytext" style="margin-bottom: 24rpx;" v-if="goodsDet.express_type ==1">
- <text>{{goodsDet.area_text}} {{goodsDet.address}} </text>
- </view>
- <!-- 门店地址 -->
- <view class="deliveryicon" v-if="goodsDet.express_type ==2">
- <image src="/static/icon/position.png"></image>
- <text>{{hotelDet.name}}</text>
- </view>
- <view class="deliverytext" v-if="goodsDet.express_type ==2" style="position:relative;">
- <text>{{hotelDet.address}}</text>
- <image src="/static/icon/navigation.png" @click="goLocaltion(hotelDet.name,hotelDet.address)"
- style="width: 50rpx;height: 48rpx; position: absolute; top: 0rpx;right: 30rpx;"></image>
- </view>
- <!-- 门店联系方式 -->
- <view class="deliveryicon" v-if="goodsDet.express_type =='2'">
- <image src="/static/icon/phone.png"></image>
- <text>门店联系方式</text>
- </view>
- <view class="deliverytext" style="margin-bottom: 24rpx;" v-if="goodsDet.express_type =='2'">
- <text>{{hotelDet.phone}}</text>
- </view>
- </view>
- </view>
- <!-- 订单信息 -->
- <view class="myorder">
- <view class="orderTitle">订单信息</view>
- <view class="orderMsg"><text>订单编号</text><text style="margin-left: 26rpx;">{{goodsDet.order_no}}</text>
- </view>
- <view class="orderMsg"><text>下单时间</text><text style="margin-left: 26rpx;">{{goodsDet.created_at}}</text>
- </view>
- <view class="copyorder" @click="copyOrder(goodsDet.order_no)">复制</view>
- </view>
- <view class="myorder" style="margin-top: 68rpx;" v-if="status == 4 && is_virtual == 1">
- <view class="orderTitle">核销信息</view>
- <view class="orderMsg"><text>核销员</text><text style="margin-left: 54rpx;">{{goodsDet.staff.user.nickname}}</text>
- </view>
- <view class="orderMsg"><text>核销时间</text><text style="margin-left: 26rpx;">{{goodsDet.complete_time}}</text>
- </view>
- </view>
- <view class="myorder" style="margin-top: 68rpx;" v-if="status == 4 && is_virtual == 0 && express_type == 2 ">
- <view class="orderTitle">核销信息</view>
- <view class="orderMsg"><text>核销员</text><text style="margin-left: 54rpx;">{{goodsDet.staff.user.nickname}}</text>
- </view>
- <view class="orderMsg"><text>核销时间</text><text style="margin-left: 26rpx;">{{goodsDet.complete_time}}</text>
- </view>
- </view>
- </view>
- <!-- 产品信息 -->
- <view class="shopMsg">
- <view class="title">
- <text>产品信息</text>
- </view>
- <view class="shopCard">
- <image v-if="goodsDet.product_type == 3 " :src="goodsDet.img_urls"></image>
- <image v-if="goodsDet.product_type != 3 " style="border-radius: 12rpx;" :src="productImg[0]"></image>
- <view style="margin-left: 24rpx;">
- <text class="name">{{goodsDet.product_name}}</text>
- <!-- <text class="tag" v-if="source_type == 3">{{goodsDet.integral}}积分</text> -->
- <text class="tag" v-if="source_type == 3">{{goodsDet.attr_text}} {{goodsDet.integral}}积分</text>
- </view>
- </view>
- <view class="shopNumber">
- <text>件数</text>
- <text>1件</text>
- </view>
- <view class="shopNumber" v-if="source_type == 3">
- <text>积分</text>
- <text>{{integral}}积分</text>
- </view>
- <view style="width: 694rpx;height: 4rpx;border: 2rpx dashed #F2F2F2;margin-top: 38rpx;"></view>
- <view class="shopNumber" v-if="source_type == 3">
- <text>合计</text>
- <text>{{integral}}积分</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- //产品图片
- productImg: '',
- //积分
- integral: '',
- //订单产品来源
- source_type: '',
- //订单号
- order_no: '',
- //门店详情
- hotelDet: '',
- //订单详情
- goodsDet: '',
- //订单id
- order_id: '',
- //订单状态
- status: '',
- //实物:0虚拟奖品:1
- is_virtual: '',
- express_type: '',
- }
- },
- onLoad(o) {
- if (o.id) {
- //订单id
- this.order_id = o.id
- this.orderDeatil()
- }
- if (o.order_no) {
- this.order_no = o.order_no
- this.getConfirmOrderDetail()
- }
- },
- methods: {
- //导航
- goLocaltion(name, address) {
- uni.openLocation({
- type: "gcj02",
- latitude: parseFloat(this.hotelDet.latitude), // 纬度,浮点数,范围为90 ~ -90
- longitude: parseFloat(this.hotelDet.longitude), // 经度,浮点数,范围为180 ~ -180。
- scale: 12, // 地图缩放级别,整形值,范围从1~28。默认为最大
- name: name, // 位置名
- address: address, // 地址详情说明
- })
- },
- //门店详情
- hotelDetail(id) {
- this.$api.hotel.getHotelDetail({
- hotel_id: id
- }).then(res => {
- this.hotelDet = res.data
- })
- },
- getConfirmOrderDetail() {
- this.$api.orders.confirmOrderDetail({
- order_no: this.order_no
- }).then(res => {
- this.is_virtual = res.data.is_virtual
- this.status = res.data.status
- this.express_type = res.data.express_type
- this.goodsDet = res.data
- console.log(this.goodsDet,'----->this.goodsDet');
- this.source_type = res.data.source_type
- this.integral = res.data.integral
- if(res.data.product_type == 3){
- this.productImg = res.data.img_urls
- }else{
- this.productImg = JSON.parse(res.data.img_urls)
- }
- if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
- this.hotelDetail(this.goodsDet.hotel_id)
- }
- })
- },
- //订单详情
- orderDeatil() {
- this.$api.orders.getOrderDetail({
- order_id: this.order_id
- }).then(res => {
- this.is_virtual = res.data.is_virtual
- this.status = res.data.status
- this.express_type = res.data.express_type
- this.goodsDet = res.data
- console.log(this.goodsDet,'------>this.goodsDet');
- this.source_type = res.data.source_type
- this.integral = res.data.integral
- if(res.data.product_type == 3){
- this.productImg = res.data.img_urls
- }else{
- this.productImg = JSON.parse(res.data.img_urls)
- }
- if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
- this.hotelDetail(this.goodsDet.hotel_id)
- }
- })
- },
- // 复制订单号
- copyOrder(num) {
- uni.setClipboardData({
- data: `${num}`,
- success: function() {
- uni.showToast({
- icon: 'none',
- title: '复制成功'
- })
- }
- });
- }
- },
- computed: {
- }
- }
- </script>
- <style lang="scss" scoped>
- $pageColor:#F9F9F9;
- $bgColor:#FFFFFF;
- // flex布局居中对齐
- @mixin flexlayout {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .orderDetail {
- height: 100%;
- background: $pageColor;
- }
- .nav {
- width: 100%;
- // height: 108rpx;
- background: $bgColor;
- border-radius: 0px 0px 16rpx 16rpx;
- padding: 32rpx 0 36rpx 28rpx;
- box-sizing: border-box;
- .orderStatus {
- font-size: 40rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: #FF6200;
- }
- }
- //核销时间
- .nav-write {
- background-color: #FFFFFF;
- color: #333333;
- font-size: 40rpx;
- margin-top: 32rpx;
- }
- .midBox {
- margin-top: 24rpx;
- width: 750rpx;
- background: $bgColor;
- border-radius: 16rpx;
- position: relative;
- padding: 40rpx 28rpx;
- box-sizing: border-box;
- .logistics {
- position: relative;
- .logisticsTitle {
- margin-bottom: 25rpx;
- font-size: 30rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: #080F18;
- }
- .logisticsMsg {
- margin-bottom: 25rpx;
- text {
- font-size: 28rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #666666;
- }
- }
- .copy {
- position: absolute;
- right: 30rpx;
- top: 68rpx;
- font-size: 28rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #FF6200;
- }
- }
- .myorder {
- position: relative;
- .orderTitle {
- margin-bottom: 25rpx;
- font-size: 30rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: #080F18;
- }
- .orderMsg {
- margin-bottom: 25rpx;
- text {
- font-size: 28rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #666666;
- }
- }
- .copyorder {
- position: absolute;
- right: 30rpx;
- bottom: 72rpx;
- font-size: 28rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #FF6200;
- }
- }
- .delivery {
- margin-bottom: 20rpx;
- .deliveryTitle {
- margin-bottom: 24rpx;
- text {
- font-size: 32rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: #080F18;
- }
- }
- .deliveryMsg {
- width: 694rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- padding-top: 24rpx;
- position: relative;
- .bgimg {
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0rpx;
- }
- .deliveryicon {
- margin-bottom: 15rpx;
- display: flex;
- align-items: center;
- z-index: 999;
- image {
- width: 26rpx;
- height: 26rpx;
- margin-right: 5rpx;
- }
- text {
- font-size: 28rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #333333;
- }
- }
- .deliverytext {
- margin-bottom: 20rpx;
- z-index: 999;
- text {
- font-size: 28rpx;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #080F18;
- }
- }
- }
- }
- }
- .shopMsg {
- margin-top: 24rpx;
- width: 750rpx;
- height: 534rpx;
- background: $bgColor;
- border-radius: 12rpx 12rpx 0px 0px;
- padding: 32rpx 30rpx;
- box-sizing: border-box;
- .title {
- margin-bottom: 24rpx;
- text {
- font-size: 32rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: #080F18;
- }
- }
- .shopCard {
- margin-top: 28rpx;
- width: 694rpx;
- height: 164rpx;
- background: #F4F5F6;
- border-radius: 10rpx;
- display: flex;
- align-items: center;
- image {
- width: 132rpx;
- height: 132rpx;
- margin-left: 16rpx;
- display: inline-block;
- border-radius: 10rpx;
- }
- .name {
- font-size: 28rpx;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #080F18;
- display: block;
- }
- .tag {
- font-size: 24rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #666666;
- }
- }
- .shopNumber {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 25rpx;
- text {
- font-size: 26rpx;
- font-family: PingFang-SC-Medium, PingFang-SC;
- font-weight: 500;
- color: #000000;
- }
- }
- }
- </style>
|