123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- <template>
- <app-layout>
- <view class="app-order-details">
- <app-write-off-code :hidden="hidden" :itemId="item.id" @hiden="hidden = false"></app-write-off-code>
- <view v-if="refundBoolean">
- <app-prompt-box @click="close" text="是否确认申请退款该订单"></app-prompt-box>
- </view>
- <view v-if="payBoolean">
- <app-prompt-box @click="goPay" text="是否确认支付该订单"></app-prompt-box>
- </view>
- <view v-if="cancelBoolean"></view>
- <view class="app-image-title dir-left-nowrap">
- <image class="app-image" :src="item.store.cover_url"></image>
- <view class="app-content dir-top-nowrap">
- <text class="app-content-title">{{item.store.name}}</text>
- <view class="app-prices dir-left-nowrap main-right cross-center">
- <text class="app-old-price">{{item.total_goods_original_price}}</text>
- <text class="app-new-price">{{item.total_pay_price}}</text>
- </view>
- </view>
- </view>
- <text class="app-title">门店信息</text>
- <view class="app-store">
- <app-store :address="item.store.address" :business_hours="item.store.business_hours" :storeNum="item.store_list.length" :goods_id="item.id" :store_id="item.store.id" :name="item.store.name" :sotreNum="item.store.length" :title="title" :borderStyle="borderStyle" :icon="icon"></app-store>
- </view>
- <text class="app-title">订单信息</text>
- <view class="app-order-information dir-top-nowrap main-left">
- <text>姓名: {{item.name}}</text>
- <text>手机号: {{item.mobile}}</text>
- <text>订单号: {{item.order_no}}</text>
- <text>下单时间: {{item.created_at}}</text>
- </view>
- <text class="app-title" v-if="item.order_form.length > 0">其他信息</text>
- <view class="app-other" v-if="item.order_form.length > 0">
- <block v-for="(it, index) in item.order_form" :key="index">
- <template v-if="it.key === 'img_upload'">
- <view class="app-in dir-top-nowrap">
- <text class="app-top">{{it.label}}</text>
- <image class="app-image" :src="it.value"></image>
- </view>
- </template>
- <template v-else>
- <view class="app-in dir-top-nowrap" v-if="it.value" :class="{'app-border': item.order_form.length-1 !== index}" >
- <text class="app-top" >{{it.label}}</text>
- <text class="app-bottom" >{{it.value}}</text>
- </view>
- </template>
- </block>
- </view>
- <view class="empty" v-if="item.cancel_status == 0 && item.is_sale == 0"></view>
- <view class="app-buttons dir-left-nowrap main-right cross-center" v-if="item.cancel_status == 0 && item.is_sale == 0">
- <view class="app-button" v-if="item.is_pay == 0">
- <app-form-id >
- <button class="app-button app-red" @click="payBoolean = true">去支付</button>
- </app-form-id>
- </view>
- <view class="app-button" v-if="item.is_pay == 0">
- <app-form-id >
- <button class="app-button app-white">申请取消</button>
- </app-form-id>
- </view>
- <view class="app-button" v-if="item.is_confirm == 1" @click="evaluation">
- <app-form-id>
- <button class="app-button app-red" >去评价</button>
- </app-form-id>
- </view>
- <view class="app-button" v-if="item.cancel_status != 2 && item.is_pay == 1 && item.is_confirm == 0">
- <app-form-id>
- <view class="app-button app-red" @click="useImmediately">立即使用</view>
- </app-form-id>
- </view>
- <!-- <view class="app-button" v-if="item.cancel_status != 2 && item.is_pay == 1 && item.is_confirm == 0">
- <app-form-id >
- <view class="app-button app-white" @click="refundBoolean = true">申请退款</view>
- </app-form-id>
- </view> -->
- <view class="app-button" v-if="item.cancel_status != 2 && item.is_pay == 1 && item.is_confirm == 0">
- <app-form-id >
- <view class="app-button app-white" @click="to">代付尾款</view>
- </app-form-id>
- </view>
- </view>
- </view>
- </app-layout>
- </template>
- <script>
- import appStore from '../components/app-store.vue';
- import appPromptBox from '../../../components/basic-component/app-prompt-box/app-prompt-box.vue';
- import appWriteOffCode from '../components/app-write-off-code.vue';
-
- let borderStyle = false;
- let icon = false;
- let title = false;
- export default {
- name: 'orderDetails',
- components: {
- 'app-store': appStore,
- 'app-prompt-box': appPromptBox,
- 'app-write-off-code': appWriteOffCode,
- },
- data() {
- return {
- item: null,
- file_path: '',
- hidden: false,
- refundBoolean: false,
- payBoolean: false,
- cancelBoolean: false,
- }
- },
- onLoad(options) {
- this.request(options);
- },
- methods: {
- request(options) {
- this.$request({
- url: this.$api.book.order_detail,
- data: {
- id: options.id,
- }
- }).then(response => {
- this.item = response.data.detail;
- })
- },
- useImmediately() {
- this.hidden = true;
- },
- close(boolean) {
- if (boolean) {
- this.$request({
- url: this.$api.order.cancel,
- data: {
- id: this.item.id
- }
- }).then(response => {
- if (response.code === 0) {
- this.refundBoolean = false;
- this.request({
- id: this.item.id
- });
- }
- });
- } else {
- this.refundBoolean = false;
- }
- },
- goPay(boolean) {
- this.payBoolean = false;
- if (boolean) {
- this.$request({
- url: this.$api.order.list_pay_data,
- data: {
- id: this.item.id
- }
- }).then(response => {
- if (response.code === 0) {
- this.$payment.pay(response.data.id).then(msg => {
- // 支付成功
- this.item.is_pay = 1;
- }).catch(msg => {
- // 支付失败
- });
- } else {
-
- }
- })
- } else {
- this.payBoolean = false;
- }
- },
- evaluation() {
- uni.navigateTo({
- url: `/pages/order/appraise/appraise?id=${this.item.id}`
- });
- },
- to(){
- uni.navigateTo({
- url:'/plugins/scan_code/index/index'
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .app-order-details {
- background-color: #f7f7f7;
- width: #{750rpx};
- padding: #{20rpx} #{24rpx};
-
- .app-title {
- display: inline-block;
- margin-top: #{32rpx};
- margin-bottom: #{24rpx};
- color: #999999;
- font-size: #{26rpx};
- }
- >view {
- width: #{750-48rpx};
- border-radius: #{16rpx};
- background-color: white;
- }
- .app-image-title {
- padding: #{24rpx};
- .app-image {
- width: #{208rpx};
- height: #{160rpx};
- }
- .app-content {
- width: #{750-48-48-24-208rpx};
- margin-left: #{24rpx};
- height: #{160rpx};
- .app-content-title {
- display: inline-block;
- margin-top: #{10rpx};
- font-size: #{28rpx};
- color: #353535;
- word-break: break-all;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- height: #{64rpx};
- width: 100%;
- }
- .app-prices {
- padding-top: #{50rpx};
- >text:before {
- content: '¥';
- }
- .app-old-price {
- color: #a4a4a4;
- font-size: #{24rpx};
- text-decoration:line-through;
- }
- .app-new-price {
- margin-left: #{24rpx};
- font-size: #{32rpx};
- color: #ff4544;
- }
- }
- }
- }
- .app-order-information {
- padding: #{28rpx} #{24rpx} #{12rpx} #{24rpx};
- >text {
- font-size: #{28rpx};
- color: #353535;
- margin-bottom: #{16rpx};
- }
- }
- .app-other {
- padding: 0 #{24rpx};
- .app-in {
- padding: #{28rpx} 0;
- font-size: #{28rpx};
- .app-top {
- margin-bottom: #{24rpx};
- color: #999999;
- }
- .app-bottom {
- color: #353535;
- }
- }
- .app-border {
- border-bottom: #{1rpx} solid #e2e2e2;
- }
- .app-image {
- width: #{150rpx};
- height: #{150rpx};
- border-radius: #{8rpx};
- }
- }
- .app-buttons {
- height: #{102rpx};
- width: #{750rpx};
- background-color: white;
- border-top: #{1rpx} solid #e2e2e2;
- position: fixed;
- left: 0;
- bottom: 0;
- >view {
- margin-right: #{15rpx};
- }
- .app-button {
- height: #{60rpx};
- line-height: #{60rpx};
- font-size: #{28rpx};
- border-radius: #{25rpx};
- display: inline-block;
- }
- .app-red {
- border: #{1rpx} solid #ff4544;
- background-color: #fff5f5;
- color: #ff4544;
- padding: 0 #{30rpx};
- }
- .app-white {
- background-color: white;
- border: #{1rpx} solid #d4d4d4;
- color: #565656;
- padding: 0 #{30rpx};
- }
- }
- }
- .empty {
- height: #{102rpx};
- width: #{750rpx};
- background-color: #f7f7f7 !important;
- }
- </style>
|