orderDetail.vue 8.02 KB
Newer Older
huahua committed
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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
<template>
	<view class="full-width full-height"  style="margin: auto;"	:style="{ width:$tool.isPc()?$base.isPcWidth + 'px':'100%'}">

     <myhead :worksid="0" :title="myheadtext" :color="'#000'" :titleShow="true" :backShow="true" :background="'#fff'"></myhead>

		<scroll-view class="scroll_content" v-if="orderData !=null " style="position: fixed; top: 60px;"   
		:style="{ width:$tool.isPc()?$base.isPcWidth + 'px':'100%'}">
			<!-- 头部状态开始 -->
			<view class="order_detail_top">
				<view style="display:flex; flex-direction: row; padding-left: 40upx; width: 100%; ">
					
					<view style=" margin-top: 20upx;  margin-bottom: 20upx; width: 100%; ">
						<view style="font-size: 32upx;font-weight: 580;color: #854AC2;">
							{{$i18n.messages[$i18n.locale][orderData.status.text]}}
						</view>
						<view style="font-size: 27upx; color: #333333; margin-top:120upx; font-weight: 550; 
						    width: calc(100% - 10upx);  display: flex; flex-direction: row; max-width: calc(100% - 20upx); ">
							{{ orderData.order_express != null ? orderData.order_express.address: ""}}
						</view>
						<view
							style="font-size: 25upx;font-family: PingFang;font-weight: 400;color: #333333;margin-top: 3upx;">
							{{orderData.order_express != null ? orderData.order_express.receivor: "" }}
							{{orderData.order_express != null ? orderData.order_express.phone: "" }}
						</view>
					</view>
				</view>
			</view>
			<!-- 头部状态结束 -->

			<!-- 中间图片价格开始 -->
			<view class="order_detail_image" v-if="orderData.order_queue != null">
				<view style="display: flex;width: calc(100% - 30upx); flex-direction: row; height: 220upx;  ">
					<view style="width:150upx;
					height:150upx;
					background: #fff;
					border-radius:10upx;
					margin-top: 10upx; 
					margin-left: 40upx;
					position:relative;
					align-items: center;
					justify-content: center;">
						<image :src="orderData.order_queue.works_image" style="height: 150upx; position: absolute; border-radius: 10upx; margin: auto;
						left: 0;top: 0; left: 0; right: 0; bottom: 0;  " mode="heightFix"></image>
					</view>
					<view
						style=" font-size: 28upx;color: #333333;margin-left: 30upx; width: 360upx;  margin-top: 15upx; ">
						{{orderData.order_goods.goods_name}}
					</view>
				</view>

				<view style="width: 100%;height: 1upx;background: #EEEEEE;"></view>
				<view
					style="display: flex; flex-direction: row; float: right;  justify-content: center; align-items: center;height: 110upx; margin-right: 32upx; ">
					<view style="font-size: 28upx;font-family: Source Han Sans CN;font-weight: 600;color: #333333;">
						{{$i18n.messages[$i18n.locale]['支付金额']}}
					</view>
					<view style="font-size: 36upx;font-family: Source Han Sans CN;font-weight: 600;color: #F56364; ">
						{{orderData.currency_symbol}}{{ (orderData.total_amount - orderData.discount_amount).toFixed(2) >= 0 ? (orderData.total_amount - orderData.discount_amount).toFixed(2) : 0 }}
					</view>
				</view>
			</view>

			<!-- 客服联系 -->
			<view class="order_detail_logistics" style=" height: 85upx; 
			line-height: 85upx; 
			text-align: center;">
				<view style="margin-top: 20upx;color: #854AC2; "> <!-- {{$i18n.messages[$i18n.locale]['联系']}} : --> {{phone}}
				</view>
			</view>

			<!--尾部订单明细图片价格开始 -->
			<view class="order_detail_logistics" v-if="orderData != null ">
				<view class="text"> {{$i18n.messages[$i18n.locale]['打印编号']}}{{orderData.order_queue.id}}</view>
				<view class="text"> {{$i18n.messages[$i18n.locale]['设备编号']}}{{orderData.order_queue.machine_id}}</view>
				<view class="text"> {{$i18n.messages[$i18n.locale]['订单编号']}}{{orderData.id}}</view>
				<view class="text"> {{$i18n.messages[$i18n.locale]['下单时间']}}{{orderData.create_time}}</view>
				<view class="text" v-if="orderData.promoter_id != 0 ">
					{{$i18n.messages[$i18n.locale]['推广编号']}}{{orderData.promoter_id}}
				</view>
				<view class="text"
					v-if="orderData.order_express != null && orderData.order_express.express_name != null">
					{{$i18n.messages[$i18n.locale]['物流公司']}}{{orderData.order_express.express_name}}
				</view>
				<view class="text" v-if="orderData.order_express != null && orderData.order_express.express_no != null">
					{{$i18n.messages[$i18n.locale]['快递单号']}}{{orderData.order_express.express_no}}
				</view>
				<view class="text" v-if="orderData.send_goods_time != null">
					{{$i18n.messages[$i18n.locale]['发货时间']}}{{ orderData.send_goods_time }}
				</view>
				<view class="text_logistics" @click="toSearchLogistics(orderData.order_express.express_url)"
					v-if="orderData.order_express != null && orderData.order_express.express_url != null">
					{{$i18n.messages[$i18n.locale]['物流详情']}}></view>
			</view>
			<!-- 尾部订单明细结束-->
			
		</scroll-view>

		<view class="button_save" @click="againOrder()" :style="{ width:$tool.isPc()?$base.isPcWidth - 60 + 'px':'calc(100% - 80upx)'}">
			{{$i18n.messages[$i18n.locale]['再来一单']}}
		</view>

	</view>
</template>

<script>
	import homeservice from '@/service/homeservice.js'
	import uniPopup from '../index/common/uni-popup/uni-popup.vue'
	import Enums from '@/util/Enums';
		import myhead from '../mine/head.vue';

	export default {
		components: {
			uniPopup,
			myhead
		},

		computed: {

		},

		data() {
			return {
				machine_id: null, //设备id
				order_id: null, //订单Id
				orderData: null, //订单数据
				phone: '18938664545',
				myheadtext:""
			};
		},

		methods: {

			//调转第三方物流链接
			toSearchLogistics(linkUrl) {
				if (linkUrl == null) {
					return
				}
				window.location.href = linkUrl
			},


			//再来一单
			againOrder() {
				const machine_id = uni.getStorageSync('machine_id');
				if (machine_id) {
					uni.reLaunch({
						url: '../index/detailsphone?machine_id=' + machine_id
					})
				}
			},

			//获取订单明细
			getOrderDetail() {
				let data = {
					s: "Order.detail",
					id: this.order_id,
				};
				homeservice.WorksListPhone(data).then(result => {
					this.orderData = result;
				}).catch(err => {

				});
			},
		},

		onReady() {
			
			
			this.myheadtext = this.$i18n.messages[this.$i18n.locale]['订单明细']
			// uni.setNavigationBarTitle({
			// 	title: this.$i18n.messages[this.$i18n.locale]['订单明细']
			// })
		},

		onLoad(options) {
			this.phone = uni.getStorageSync('phone');
			//console.log("this.phone="+this.phone)
			if (options.id) {
				this.order_id = options.id;
			}
			if (options.goods_id != 'null') {
				this.goods_id = options.goods_id
			}
			if (options.machine_id != 'null') { //设备进来的
				this.machine_id = options.machine_id
			}
			if (options.goodid != 'null') {
				this.works_id = options.goodid
			}
			this.getOrderDetail()
		},

		onShow() {},
		onUnload() {}

	};
</script>

<style lang="scss">
	page {
		background: #F5F5F5 !important;
	}

	.scroll_content {
		height: 100%;
		width: 100%;
		overflow: hidden;
		overflow-y: scroll;
		position: relative;

		.order_detail_top {
			width: calc(100% - 55upx);
			margin: 25upx;
			background: #FFFFFF;
			border-radius: 30upx
		}

		.order_detail_image {
			width: calc(100% - 55upx);
			height: 320upx;
			margin: 25upx;
			background: #FFFFFF;
			border-radius: 30upx;
			padding-top: 30upx;
		}

		.order_detail_logistics {
			width: calc(100% - 80upx);
			margin: 25upx;
			background: #FFFFFF;
			border-radius: 30upx;
			padding-top: 25upx;
			padding-left: 30upx;
			padding-bottom: 25upx;
			position: relative;

			.text {
				font-size: 28upx;
				color: #666666;
			}

			.text_logistics {
				position: absolute;
				right: 20upx;
				top: calc(50% - 20upx);
				font-size: 25upx;
				font-weight: 500;
				color: #333333;
			}
		}
	}

	.button_save {
		background: #F5F5F5;
		border: 1upx solid #854AC2;
		height: 65upx;
		position: fixed;
		bottom: 20upx;
		font-size: 40upx;
		font-weight: 500;
		text-align: center;
		left: 0;
		right: 0;
		margin: auto;
		border-radius: 60upx;
		line-height: 65upx;
		color: #854AC2;
	}
</style>