Browse Source

add logic

dev
刘嘉炜 4 hours ago
parent
commit
ed80576a4e
  1. 7
      src/api/server.js
  2. 5
      src/subpackage/order/api/index.js
  3. 5
      src/subpackage/order/components/detail/contact.vue
  4. 78
      src/subpackage/order/pages/detail.vue

7
src/api/server.js

@ -44,7 +44,12 @@ server.interceptors.response.use(
errorModal: response?.config?.errorModal,
success: () => {
// 登录超时
if(response?.data?.code === 401&&response?.data?.message?.indexOf('用户') !== -1)loginHandle();
if(
// 用户异常
(response?.data?.code === 401&&response?.data?.message?.indexOf('用户') !== -1)
// 参数错误,[token]不允许为空
|| (response?.data?.code === 404&&response?.data?.message?.indexOf('token') !== -1)
)loginHandle();
// if(response?.data?.error === '704'&&response?.data?.smsg === 'ustoken不能为空')loginHandle();
}
})

5
src/subpackage/order/api/index.js

@ -0,0 +1,5 @@
import server from '@/api/server';
export const orderGet = params => server.post({ url: '/stadium/order/get', ...params }); // 预约订单详情

5
src/subpackage/order/components/detail/contact.vue

@ -1,6 +1,7 @@
<script setup>
import { onLoad } from '@dcloudio/uni-app';
import { reactive, ref } from "vue";
const emits = defineEmits([ 'click:phone', 'click:nav' ]);
onLoad(() => {
});
@ -22,8 +23,8 @@ onLoad(() => {
<view class="dc-line"></view>
<view class="dc-right">
<view class="dr-icons">
<view class="di-item">&#xe605;</view>
<view class="di-item">&#xe672;</view>
<view class="di-item" @click="emits('click:phone')">&#xe605;</view>
<view class="di-item" @click="emits('click:nav')">&#xe672;</view>
</view>
<view class="dr-txt">距离23m</view>
</view>

78
src/subpackage/order/pages/detail.vue

@ -6,24 +6,61 @@ import detailGoods from "../components/detail/goods.vue";
import detailVerify from "../components/detail/verify.vue";
import detailContact from "../components/detail/contact.vue";
import venueInfoAsync from "@/subpackage/groupon/components/venue_info.vue";
import { orderGet } from "../api";
const orderInfo = ref({});
// order_type 0 1/2
onLoad(() => {
orderGet({
data: {
brand_id: 63,
order_no: "CC20250717152050893843"
}
})
.then(res=>{
orderInfo.value = res?.data ?? {};
console.warn('CC20250717152050893843', res);
})
});
function previewImg(img){
uni.previewImage({ urls: [ img ] });
}
function phoneClick(){
}
function navClick(){
let _oInfo = orderInfo.value;
wx.openLocation({
latitude: +_oInfo.lat,
longitude: +_oInfo.lng,
name: _oInfo.stadium_name,
address: _oInfo.venue_addr
})
}
</script>
<template>
<view class="order-detail">
<view class="od-box od-header">
<view class="oh-stadium">
<image class="os-logo"></image>
<view class="os-name">MJ体育(天空篮球从云店)</view>
<image class="os-logo" mode="aspectFit" :src="orderInfo?.stadium_logo ?? ''"></image>
<view class="os-name">{{ orderInfo?.stadium_name ?? '-' }}</view>
<view class="os-status">已核销</view>
</view>
<view class="oh-line">订单编号123456789012</view>
<view class="oh-line">创建时间2019-06-06 12:00:06</view>
<view class="oh-line">订单编号{{ orderInfo?.order_no ?? '-' }}</view>
<view class="oh-line">创建时间{{ orderInfo?.success_time ?? '-' }}</view>
</view>
<view class="od-box">
<!-- 联系方式/地址 -->
<detail-contact
@click:phone="phoneClick"
@click:nav="navClick"
></detail-contact>
</view>
<view class="od-box od-venue-info">
<view class="od-box od-venue-info" v-if="orderInfo?.order_type === 0">
<!-- 场次信息 -->
<venue-info-async>
<template #title>
@ -31,7 +68,7 @@ onLoad(() => {
</template>
</venue-info-async>
</view>
<view class="od-box od-product">
<view class="od-box od-product" v-if="[1,2].includes(orderInfo?.order_type)">
<view class="od-title">产品信息</view>
<text-line label="预定项目:">羽毛球</text-line>
<text-line label="数量:">1</text-line>
@ -44,34 +81,36 @@ onLoad(() => {
<view class="od-box od-total">
<view class="ot-line">
<view class="ol-val">金额小计</view>
<view class="ol-val">300</view>
<view class="ol-val">{{ orderInfo?.amount ?? '0' }}</view>
</view>
<view class="ot-line">
<view class="ol-val">团购券抵扣</view>
<view class="ol-val">300</view>
<view class="ol-val">{{ orderInfo?.douyin_coupon_deduct_amount ?? '0' }}</view>
</view>
<view class="ot-amount"><text class="oa-txt">合计支付</text>0.00</view>
</view>
<view class="od-box">
<!-- 联系方式/地址 -->
<detail-contact></detail-contact>
<view class="ot-amount"><text class="oa-txt">合计支付</text>{{ orderInfo?.pay_amount ?? '0' }}</view>
</view>
<view class="od-box">
<!-- 验证信息 -->
<detail-verify></detail-verify>
</view>
<view class="od-box od-code">
<view class="od-box od-code" v-if="orderInfo.verify_qrcode">
<!-- 二维码 -->
<image class="oc-code-img"></image>
<image
mode="aspectFit"
class="oc-code-img"
:src="orderInfo.verify_qrcode"
@click="previewImg(orderInfo.verify_qrcode)"
></image>
<view class="oc-tip">点击二维码可放大查看</view>
</view>
<view class="od-box od-payment">
<!-- 支付信息 -->
<view class="od-title">支付信息</view>
<text-line label="支付方式:">抖音支付</text-line>
<text-line label="支付时间:">2019年6月18日 10:30:40</text-line>
<text-line label="交易号:">3532463457445848657</text-line>
<text-line label="支付方式:">{{ orderInfo?.pay_type_text ?? '-' }}</text-line>
<text-line label="支付时间:">{{ orderInfo?.pay_time ?? '-' }}</text-line>
<text-line label="交易号:">{{ orderInfo?.trace_no ?? '-' }}</text-line>
</view>
<view class="od-box">
<!-- 抖音商品信息 -->
@ -107,7 +146,6 @@ onLoad(() => {
margin-right: 10upx;
width: 34upx;
height: 34upx;
background: skyblue;
}
.os-name{
flex-grow: 1;

Loading…
Cancel
Save