dingdong-mall/pages/order/order-detail.vue

206 lines
6.6 KiB
Vue
Raw Normal View History

2022-04-01 16:54:10 +08:00
<template>
<view>
<!-- 顶部操作条 -->
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">订单确认</block>
</cu-custom>
<!-- 服务地址 -->
2022-04-27 10:00:39 +08:00
<view v-if="defaultAddress" class="bg-white">
<view class="padding flex justify-between align-center" @click="showAddress2Choose">
<view>
<view class="flex justify-start align-center">
<view class="text-gray margin-right-xs" v-for="(areaObj, index) in defaultAddress.area">
{{areaObj.name}}
</view>
</view>
<view class="text-lg margin-tb-sm">{{defaultAddress.address}}</view>
<view class="text-gray">
<text class="margin-right">{{defaultAddress.person2Contact}}</text>
<text>{{defaultAddress.phone}}</text>
</view>
</view>
<view class="text-lg"><text class="text-bold text-gray cuIcon-right"></text></view>
</view>
<view class="cu-progress sm striped">
<view class="bg-orange" style="width: 100%;"></view>
</view>
</view>
<view v-else class="bg-white" @click="showAddress2Choose">
<view class="flex justify-between align-center padding-lg">
2022-04-01 16:54:10 +08:00
<view class="text-lg text-black">
<text class="cuIcon-locationfill text-blue light"></text>
选择服务地址
</view>
<view>选择<text class="text-sm text-bold text-gray cuIcon-right"></text></view>
</view>
2022-04-27 10:00:39 +08:00
<view class="cu-progress sm striped">
<view class="bg-orange" style="width: 100%;"></view>
</view>
2022-04-01 16:54:10 +08:00
</view>
<!-- 预约时间 -->
<view class="margin-lr-sm margin-top-sm bg-white padding">
<view class="flex justify-between align-center">
<text class="text-black">预约时间</text>
2022-04-27 10:00:39 +08:00
<uni-datetime-picker v-model="doorTime" @change="changeDoorTime">
<view v-if="doorTime" class="text-sm">{{doorTime}}<text class="text-bold cuIcon-right"></text>
</view>
<view v-else class="text-red text-sm">请选择上门时间<text class="text-bold cuIcon-right"></text></view>
</uni-datetime-picker>
2022-04-01 16:54:10 +08:00
</view>
<view class="text-sm text-gray margin-top-sm"><text
class="cuIcon-question">选择的为期望上门时间稍后工程师将与你确认具体上门时间</text></view>
</view>
<!-- 选购的商品列表 -->
2022-04-27 10:00:39 +08:00
<view class="margin-lr-sm margin-top-sm bg-white">
<view class="solid-top" v-for="(item, index0) in pickedProductList">
<view class="cu-bar">
<view class="action bar-first-action">
<text class="cuIcon-shopfill text-main-color"></text>
{{item.shopName}}
<view>
<view class="cuIcon-right"></view>
</view>
</view>
</view>
<view class="margin-top-sm padding-lr">
<product-picked :columnTitleArr="columnTitleArr" v-for="(product, index1) in item.product"
:product="product" :pickedList="product.pickedList">
</product-picked>
</view>
2022-04-23 23:13:29 +08:00
</view>
<!-- <view class="solid-bottom" v-for="(item, index) in pickedProductList">
2022-04-01 16:54:10 +08:00
<product-picked :columnTitleArr="columnTitleArr" :product="item.product" :pickedList="item.pickedList">
</product-picked>
2022-04-23 23:13:29 +08:00
</view> -->
2022-04-01 16:54:10 +08:00
</view>
<!-- 支付方式 -->
<view class="margin-lr-sm margin-top-sm bg-white padding">
<view class="flex justify-between align-center">
<text class="text-black">支付方式</text>
<radio-group @change="changePayWay">
<label class="radio">
2022-04-27 10:00:39 +08:00
<radio class="main-color" value="online" :checked="payWay=='online'" />
2022-04-01 16:54:10 +08:00
<text class="margin-left-xs">在线支付</text>
</label>
<label class="radio margin-left">
2022-04-27 10:00:39 +08:00
<radio class="main-color" value="offline" :checked="payWay=='offline'" />
2022-04-01 16:54:10 +08:00
<text class="margin-left-xs">上门到付</text>
</label>
</radio-group>
</view>
2022-04-27 10:00:39 +08:00
</view>
<!-- 发票信息 -->
<view class="margin-lr-sm margin-top-sm bg-white padding">
<view class="flex justify-between align-center">
<text class="text-black">发票信息</text>
<text class="text-sm text-bold cuIcon-right"></text>
</view>
</view>
<!-- 备注留言 -->
<view class="margin-lr-sm margin-top-sm bg-white padding">
<text class="text-black">备注留言</text>
<view class="margin-top uni-textarea">
<textarea class="solid" maxlength="-1" @input="inputComments" placeholder="请填写备注" />
</view>
</view>
<!-- 平台提醒 -->
<view class="margin-lr-sm margin-top-sm bg-white padding margin-bottom-with-bar">
<view class="text-sm text-orange"><text
class="cuIcon-roundcheck">为保障您的权益请在平台内交易师傅服务离开后发生损坏或退款以及售后质保平台可为您追责</text></view>
</view>
<!-- 底部操作栏 -->
<view class="cu-bar bg-white tabbar border shop fixed-bottom-bar">
<view class="action text-df left-grid">
<text class="margin-left-lg">共计</text>
<text class="margin-left-xs text-red text-price text-xl">{{formInfo.totalPrice}}</text>
</view>
<view class="bg-main-color submit">确定</view>
2022-04-01 16:54:10 +08:00
</view>
</view>
</template>
<script>
2022-04-23 23:13:29 +08:00
import productPicked from '@/components/goods-card/product-picked.vue';
2022-04-01 16:54:10 +08:00
export default {
components: {
productPicked
},
data() {
return {
columnTitleArr: ['购买型号', '购买数量'],
pickedProductList: [],
formInfo: {
2022-04-27 10:00:39 +08:00
payWay: 'online',
comments: '',
2022-04-01 16:54:10 +08:00
totalPrice: 0
2022-04-27 10:00:39 +08:00
},
defaultAddress: null,
doorTime: null
2022-04-01 16:54:10 +08:00
}
},
onLoad() {
this.loadData();
2022-04-27 10:00:39 +08:00
this.bindEvent();
},
onUnload() {
this.offBindEvent();
2022-04-01 16:54:10 +08:00
},
methods: {
async loadData() {
this.pickedProductList = await this.$api.data('pickedProductList');
2022-04-27 10:00:39 +08:00
this.defaultAddress = await this.$api.data('defaultAddress');
},
bindEvent() {
uni.$on(this.$globalFun.CHOOSE_ADDRESS, this.chooseAddress);
},
offBindEvent() {
uni.$off(this.$globalFun.CHOOSE_ADDRESS);
2022-04-01 16:54:10 +08:00
},
changePayWay(e) {
this.formInfo.payWay = e.detail.value;
},
2022-04-27 10:00:39 +08:00
inputComments(e) {
this.comments = e.detail.value
},
showAddress2Choose() {
uni.navigateTo({
url: '/pages/my/my-address?chooseMode=true'
})
},
chooseAddress(addressInfo) {
this.defaultAddress = addressInfo;
},
changeDoorTime(value) {
this.doorTime = value;
}
2022-04-01 16:54:10 +08:00
},
}
</script>
2022-04-27 10:00:39 +08:00
<style scoped>
.fixed-bottom-bar .text-df {
font-size: 28rpx !important;
}
.fixed-bottom-bar .left-grid {
width: 55% !important;
text-align: left;
}
.bar-first-action {
margin-left: unset !important;
padding-left: 40rpx;
font-size: 30rpx !important;
}
.cu-progress {
display: inherit;
}
.cu-progress.sm {
height: 12rpx;
2022-04-01 16:54:10 +08:00
}
2022-03-24 17:32:26 +08:00
</style>