feat: 优化分销中心、购物车和订单详情页功能

- 在分销中心页面添加导航栏并优化UI显示
- 在购物车页面增加打包费计算和显示
- 在订单详情页优化订单状态显示和导航逻辑
This commit is contained in:
yindongqi 2025-04-13 21:23:15 +08:00
parent 58359af16d
commit a93999c041
9 changed files with 2824 additions and 2600 deletions

View File

@ -1,58 +1,67 @@
<template> <template>
<uv-navbar <uv-navbar :fixed="false" :title="title" left-arrow @leftClick="$onClickLeft" />
:fixed="false" <view class="cart-popup">
:title="title" <view class="top flex justify-between">
left-arrow <text>已点{{ getCartGoodsNumber }}</text>
@leftClick="$onClickLeft" <text @tap="handleCartClear">清空</text>
/> </view>
<view class="cart-popup"> <scroll-view class="cart-list" scroll-y>
<view class="top flex justify-between"> <view class="wrapper">
<text>已点{{ getCartGoodsNumber }}</text> <uv-empty mode="car" v-if="cart.length == 0"></uv-empty>
<text @tap="handleCartClear">清空</text> <view class="item" v-for="(item, index) in cart" :key="index">
</view> <view class="left">
<scroll-view class="cart-list" scroll-y> <view class="name">{{ item.name }}</view>
<view class="wrapper"> <view class="props">{{ item.valueStr }}</view>
<uv-empty mode="car" v-if="cart.length == 0"></uv-empty> </view>
<view class="item" v-for="(item, index) in cart" :key="index"> <view class="center">
<view class="left"> <text>{{ item.price }}</text>
<view class="name">{{ item.name }}</view> </view>
<view class="props">{{ item.valueStr }}</view> <view class="right">
<button type="default" plain size="mini" class="btn" hover-class="none"
@tap="handleCartItemReduce(index)">
<view class="iconfont iconsami-select" style="color: white;"></view>
</button>
<view class="number">{{ item.number }}</view>
<button type="primary" class="btn" size="min" hover-class="none"
@tap="handleCartItemAdd(index)">
<view class="iconfont iconadd-select"></view>
</button>
</view>
</view>
</view> </view>
<view class="center"> </scroll-view>
<text>{{ item.price }}</text> </view>
</view> <view class="fixed-bottom flex justify-between align-center bg-white ">
<view class="right"> <view class="mx-2 ont-weight-light">
<button type="default" plain size="mini" class="btn" hover-class="none" <view>商品总价: {{ (getCartGoodsPrice - getPackingFee).toFixed(2) }}</view>
@tap="handleCartItemReduce(index)"> <view>打包费: {{ getPackingFee.toFixed(2) }}</view>
<view class="iconfont iconsami-select" style="color: white;"></view> <view>应付: <text class="text-danger">{{ getCartGoodsPrice }}</text></view>
</button> </view>
<view class="number">{{ item.number }}</view> <view>
<button type="primary" class="btn" size="min" hover-class="none" <uv-button
@tap="handleCartItemAdd(index)"> style="background-color: #52ac41;"
<view class="iconfont iconadd-select"></view> type="warning"
</button> color="#52ac41"
</view> :customStyle="customStyle"
</view> size="large"
</view> text="去结算"
</scroll-view> @click="toPay">
</view> </uv-button>
<view class="fixed-bottom flex justify-between align-center bg-white "> </view>
<view class="mx-2 ont-weight-light">应付:<text class="text-danger">{{ getCartGoodsPrice }}</text></view> </view>
<view ><uv-button style="background-color: #52ac41;" type="warning" color="#52ac41" :customStyle="customStyle" size="large" text="去结算" @click="toPay"></uv-button></view> <uv-toast ref="uToast"></uv-toast>
</view>
<uv-toast ref="uToast"></uv-toast>
</template> </template>
<script setup> <script setup>
import { import {
ref, ref,
computed computed
} from 'vue' } from 'vue'
import { useMainStore } from '@/store/store' import { useMainStore } from '@/store/store'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { onLoad,onShow} from '@dcloudio/uni-app' import { onLoad, onShow } from '@dcloudio/uni-app'
const main = useMainStore() const main = useMainStore()
const { orderType,address, store,location,isLogin } = storeToRefs(main) const { orderType, address, store, location, isLogin } = storeToRefs(main)
const title = ref('购物车') const title = ref('购物车')
const cart = ref([]) const cart = ref([])
const uToast = ref() const uToast = ref()
@ -65,23 +74,33 @@ onShow(() => {
cart.value = uni.getStorageSync('cart') cart.value = uni.getStorageSync('cart')
}) })
const getCartGoodsNumber = computed(() => { // const getCartGoodsNumber = computed(() => { //
if(cart.value.length == 0) { if (cart.value.length == 0) {
return 0 return 0
} }
return cart.value.reduce((acc, cur) => acc + cur.number, 0) return cart.value.reduce((acc, cur) => acc + cur.number, 0)
}) })
const getCartGoodsPrice = computed(() =>{ // const getCartGoodsPrice = computed(() => {
if(cart.value.length == 0) { //+
if (cart.value.length == 0) {
return 0 return 0
} }
let price = cart.value.reduce((acc, cur) => acc + cur.number * cur.price, 0); let total = cart.value.reduce((acc, cur) => {
return parseFloat(price).toFixed(2); const itemPrice = cur.price * cur.number;
const boxPrice = (cur.boxFee || 0) * cur.number;
return acc + itemPrice + boxPrice;
}, 0);
return parseFloat(total).toFixed(2);
}) })
const customStyle = computed(() =>{
const getPackingFee = computed(() => {
// boxFee
return cart.value.reduce((acc, cur) => acc + cur.number * (cur.boxFee || 0), 0);
});
const customStyle = computed(() => {
return { return {
paddingLeft:'60rpx', paddingLeft: '60rpx',
paddingRight:'60rpx' paddingRight: '60rpx'
} }
}) })
const handleCartItemAdd = (index) => { const handleCartItemAdd = (index) => {
cart.value[index].number += 1 cart.value[index].number += 1
@ -114,8 +133,8 @@ const handleCartClear = () => { //清空购物车
} }
const toPay = () => { const toPay = () => {
if(cart.value.length == 0){ if (cart.value.length == 0) {
uToast.value.show({message:'请先去点餐哦',type: 'error'}); uToast.value.show({ message: '请先去点餐哦', type: 'error' });
return; return;
} }
@ -126,12 +145,12 @@ const toPay = () => {
return return
} else { } else {
if (store.value.status == 0) { if (store.value.status == 0) {
uToast.value.show({message:'不在店铺营业时间内',type: 'error'}); uToast.value.show({ message: '不在店铺营业时间内', type: 'error' });
return; return;
} }
// //
if (orderType.value == 'takeout' && store.value.distance < store.value.far) { if (orderType.value == 'takeout' && store.value.distance < store.value.far) {
uToast.value.show({message:'选中的地址不在配送范围',type: 'error'}); uToast.value.show({ message: '选中的地址不在配送范围', type: 'error' });
return; return;
} }
@ -151,97 +170,99 @@ const toPay = () => {
<style lang="scss" scoped> <style lang="scss" scoped>
.cart-popup { .cart-popup {
.top { .top {
background-color: $bg-color-primary; background-color: $bg-color-primary;
//color: $color-primary; //color: $color-primary;
color: #5A5B5C; color: #5A5B5C;
padding: 10rpx 30rpx; padding: 10rpx 30rpx;
font-size: 24rpx; font-size: 24rpx;
text-align: right; text-align: right;
} }
.cart-list {
background-color: #ffffff;
width: 100%;
overflow: hidden;
min-height: 1vh;
max-height: 60vh;
.wrapper { .cart-list {
height: 100%; background-color: #ffffff;
width: 100%;
overflow: hidden;
min-height: 1vh;
max-height: 60vh;
.wrapper {
height: 100%;
display: flex;
flex-direction: column;
padding: 0 30rpx;
margin-bottom: 156rpx;
.item {
display: flex; display: flex;
flex-direction: column; justify-content: space-between;
padding: 0 30rpx; align-items: center;
margin-bottom: 156rpx; padding: 30rpx 0;
position: relative;
.item { &::after {
content: ' ';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
background-color: $border-color;
height: 2rpx;
transform: scaleY(0.6);
}
.left {
flex: 1;
display: flex; display: flex;
justify-content: space-between; flex-direction: column;
align-items: center; overflow: hidden;
padding: 30rpx 0; margin-right: 30rpx;
position: relative;
&::after { .name {
content: ' '; font-size: $font-size-sm;
position: absolute; color: $text-color-base;
bottom: 0;
left: 0;
width: 100%;
background-color: $border-color;
height: 2rpx;
transform: scaleY(0.6);
} }
.left { .props {
flex: 1; color: $text-color-assist;
display: flex; font-size: 24rpx;
flex-direction: column;
overflow: hidden; overflow: hidden;
margin-right: 30rpx; text-overflow: ellipsis;
white-space: nowrap;
}
}
.name { .center {
font-size: $font-size-sm; margin-right: 120rpx;
color: $text-color-base; font-size: $font-size-base;
} }
.props {
color: $text-color-assist; .right {
font-size: 24rpx; display: flex;
overflow: hidden; align-items: center;
text-overflow: ellipsis; justify-content: space-between;
white-space: nowrap;
} .btn {
width: 46rpx;
height: 46rpx;
border-radius: 100%;
padding: 0;
text-align: center;
line-height: 46rpx;
background-color: #52ac41;
border-color: #ffffff;
} }
.center { .number {
margin-right: 120rpx;
font-size: $font-size-base; font-size: $font-size-base;
} width: 46rpx;
height: 46rpx;
.right { text-align: center;
display: flex; line-height: 46rpx;
align-items: center;
justify-content: space-between;
.btn {
width: 46rpx;
height: 46rpx;
border-radius: 100%;
padding: 0;
text-align: center;
line-height: 46rpx;
background-color: #52ac41;
border-color: #ffffff;
}
.number {
font-size: $font-size-base;
width: 46rpx;
height: 46rpx;
text-align: center;
line-height: 46rpx;
}
} }
} }
} }
} }
} }
}
</style> </style>

View File

@ -1,12 +1,13 @@
<template> <template>
<view class="page flex-col"> <uv-navbar :fixed="false" title="分销中心" left-arrow @leftClick="$onClickLeft" />
<view class="page flex-col" v-if="isDistributor">
<!-- 头部导航 --> <!-- 头部导航 -->
<view class="flex-col"> <view class="flex-col">
<view class="flex-row"> <!-- <view class="flex-row">
<view class="flex-row"> <view class="flex-row">
<text class="header-title">分销中心</text> <text class="header-title">分销中心</text>
</view> </view>
</view> </view> -->
<!-- 用户信息 --> <!-- 用户信息 -->
<view class="user-info"> <view class="user-info">
@ -17,17 +18,11 @@
</view> </view>
<view class="flex-row" style="align-items: center"> <view class="flex-row" style="align-items: center">
<text class="user-id">ID: {{ userId }}</text> <text class="user-id">ID: {{ userId }}</text>
<text class="invite-code" @tap="showInviteCodePopup" <text class="invite-code" @tap="showInviteCodePopup">邀请码</text>
>复查邀请码</text
>
</view> </view>
</view> </view>
<view class="share-btn" @tap="share"> <view class="share-btn" @tap="share">
<image <image class="share-icon" src="/static/images/share.png" mode="aspectFill"></image>
class="share-icon"
src="/static/images/share.png"
mode="aspectFill"
></image>
<text class="share-text">分享</text> <text class="share-text">分享</text>
</view> </view>
</view> </view>
@ -60,26 +55,15 @@
<!-- 佣金明细 --> <!-- 佣金明细 -->
<view class="details-list flex-col"> <view class="details-list flex-col">
<view class="details-title"> <view class="details-title">
<text>佣金明细</text> <text>佣金明细 </text>
<text style="margin-top: 6rpx; font-size: 22rpx; color: #999999" <text style="margin-top: 6rpx; font-size: 22rpx; color: #999999">佣金将于每月15日结算至您的银行卡账号中</text>
>佣金将于每月15日结算至您的银行卡账号中</text
>
</view> </view>
<!-- 佣金明细列表 --> <!-- 佣金明细列表 -->
<view v-if="commissionList.length > 0"> <view v-if="commissionList.length > 0">
<view <view v-for="(item, index) in commissionList" :key="index" class="detail-item" @tap="addCommission">
v-for="(item, index) in commissionList"
:key="index"
class="detail-item"
@tap="addCommission"
>
<view class="detail-left"> <view class="detail-left">
<image <image class="user-avatar" :src="item.avatar" mode="aspectFill"></image>
class="user-avatar"
:src="item.avatar"
mode="aspectFill"
></image>
<view class="detail-info"> <view class="detail-info">
<text class="detail-name">{{ item.name }}</text> <text class="detail-name">{{ item.name }}</text>
<text class="detail-date">下单日期: {{ item.date }}</text> <text class="detail-date">下单日期: {{ item.date }}</text>
@ -104,28 +88,14 @@
</view> </view>
<!-- 邀请码弹窗 --> <!-- 邀请码弹窗 -->
<view <view class="invite-popup-mask" v-if="showInvitePopup" @tap="closeInviteCodePopup">
class="invite-popup-mask"
v-if="showInvitePopup"
@tap="closeInviteCodePopup"
>
<view class="invite-popup-content" @tap.stop> <view class="invite-popup-content" @tap.stop>
<view class="invite-popup-box"> <view class="invite-popup-box">
<image <image class="invite-popup-avatar" :src="userAvatar" mode="aspectFill"></image>
class="invite-popup-avatar" <view class="invite-popup-id">分销员ID: {{ userId }}</view>
:src="userAvatar"
mode="aspectFill"
></image>
<view class="invite-popup-id">会员ID: {{ userId }}</view>
<view class="invite-popup-qrcode-container"> <view class="invite-popup-qrcode-container">
<uv-qrcode <uv-qrcode ref="qrcode" canvas-id="qrcode" :value="userId" :size="260" background-color="#FFFFFF"
ref="qrcode" foreground-color="#000000"></uv-qrcode>
canvas-id="qrcode"
:value="userId"
:size="260"
background-color="#FFFFFF"
foreground-color="#000000"
></uv-qrcode>
</view> </view>
</view> </view>
</view> </view>
@ -143,6 +113,9 @@ import { getDistributorInfo, getCommissionList } from "@/api/distributor";
const main = useMainStore(); const main = useMainStore();
const { isLogin } = storeToRefs(main); const { isLogin } = storeToRefs(main);
//
const isDistributor = ref(false);
// //
const userAvatar = ref("/static/images/avatar.png"); const userAvatar = ref("/static/images/avatar.png");
const userName = ref("爱喝汤的小力"); const userName = ref("爱喝汤的小力");
@ -197,6 +170,7 @@ const getCommissionData = async () => {
// getDistributorInfospreadUid // getDistributorInfospreadUid
let data = await getDistributorInfo({ id: spreadUid.value }); let data = await getDistributorInfo({ id: spreadUid.value });
if (data) { if (data) {
isDistributor.value = true;
userName.value = data.name || "爱喝汤的小力"; userName.value = data.name || "爱喝汤的小力";
userId.value = data.id || "1234567890"; userId.value = data.id || "1234567890";
totalCommission.value = data.totalCommission || "0.00"; totalCommission.value = data.totalCommission || "0.00";
@ -207,8 +181,9 @@ const getCommissionData = async () => {
// //
const getOrderCommissionList = async () => { const getOrderCommissionList = async () => {
let data = await getCommissionList({distributorId: userId.value, page: 1, limit: 10 }); let data = await getCommissionList({ distributorId: userId.value, page: 1, limit: 10 });
if (data) { if (data) {
commissionList.value = data.map(item => ({ commissionList.value = data.map(item => ({
avatar: item.avatar || '/static/images/avatar.png', avatar: item.avatar || '/static/images/avatar.png',
name: item.realName || '用户', name: item.realName || '用户',
@ -334,7 +309,7 @@ const closeInviteCodePopup = () => {
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.invite-popup-qrcode-container >>> .uqrcode { .invite-popup-qrcode-container>>>.uqrcode {
margin: 0 auto; margin: 0 auto;
} }
</style> </style>

View File

@ -1,7 +1,7 @@
<template> <template>
<uv-navbar <uv-navbar
:fixed="false" :fixed="false"
title="填写信息" title="申请成为分销员"
left-arrow left-arrow
@leftClick="$onClickLeft" @leftClick="$onClickLeft"
/> />
@ -20,24 +20,24 @@
<view class="form-container" style=" padding: 40rpx 20rpx; border-radius: 20rpx;"> <view class="form-container" style=" padding: 40rpx 20rpx; border-radius: 20rpx;">
<!-- 姓名 --> <!-- 姓名 -->
<view class="form-item" style=""> <view class="form-item" style="">
<text class="form-label">姓名</text> <text class="form-label">姓名<text style="color: red;"> *</text></text>
<input <input
class="form-input" class="form-input"
type="text" type="text"
v-model="formData.name" v-model="formData.name"
placeholder="请输入" placeholder="请输入姓名"
placeholder-class="placeholder" placeholder-class="placeholder"
/> />
</view> </view>
<!-- 电话 --> <!-- 电话 -->
<view class="form-item"> <view class="form-item">
<text class="form-label">电话</text> <text class="form-label">电话<text style="color: red;"> *</text></text>
<input <input
class="form-input" class="form-input"
type="number" type="number"
v-model="formData.phone" v-model="formData.phone"
placeholder="请输入" placeholder="请输入电话"
placeholder-class="placeholder" placeholder-class="placeholder"
maxlength="11" maxlength="11"
/> />
@ -50,43 +50,43 @@
class="form-input" class="form-input"
type="text" type="text"
v-model="formData.workUnit" v-model="formData.workUnit"
placeholder="请输入" placeholder="请输入工作单位"
placeholder-class="placeholder" placeholder-class="placeholder"
/> />
</view> </view>
<!-- 银行卡号 --> <!-- 银行卡号 -->
<view class="form-item"> <view class="form-item">
<text class="form-label">银行卡号</text> <text class="form-label">银行卡号<text style="color: red;"> *</text></text>
<input <input
class="form-input" class="form-input"
type="number" type="number"
v-model="formData.bankCardNumber" v-model="formData.bankCardNumber"
placeholder="请输入" placeholder="请输入银行卡号(结算佣金时需要)"
placeholder-class="placeholder" placeholder-class="placeholder"
/> />
</view> </view>
<!-- 收款人姓名 --> <!-- 收款人姓名 -->
<view class="form-item"> <view class="form-item">
<text class="form-label">收款人</text> <text class="form-label">开户名<text style="color: red;"> *</text></text>
<input <input
class="form-input" class="form-input"
type="text" type="text"
v-model="formData.recipientName" v-model="formData.recipientName"
placeholder="请输入" placeholder="请输入开户名(结算佣金时需要)"
placeholder-class="placeholder" placeholder-class="placeholder"
/> />
</view> </view>
<!-- 开户行 --> <!-- 开户行 -->
<view class="form-item"> <view class="form-item">
<text class="form-label">开户行</text> <text class="form-label">开户行<text style="color: red;"> *</text></text>
<input <input
class="form-input" class="form-input"
type="text" type="text"
v-model="formData.bankName" v-model="formData.bankName"
placeholder="请输入" placeholder="请输入开户行(结算佣金时需要)"
placeholder-class="placeholder" placeholder-class="placeholder"
/> />
</view> </view>

View File

@ -1,10 +1,5 @@
<template> <template>
<uv-navbar <uv-navbar :fixed="false" title="开票信息管理" left-arrow @leftClick="$onClickLeft" />
:fixed="false"
title="开票信息管理"
left-arrow
@leftClick="$onClickLeft"
/>
<view class="container"> <view class="container">
<view class="bg-white invoice-form"> <view class="bg-white invoice-form">
<!-- 发票类型选择 --> <!-- 发票类型选择 -->
@ -12,7 +7,7 @@
<text class="label">发票类型</text> <text class="label">发票类型</text>
<view class="radio-group"> <view class="radio-group">
<view class="radio-item" @click="invoiceType = 'company'"> <view class="radio-item" @click="invoiceType = 'company'">
<radio :checked="invoiceType === 'company'" color="#52ac41" /> <radio :checked="invoiceType === 'company'" color="#52ac41" />
<text>企业单位</text> <text>企业单位</text>
</view> </view>
<view class="radio-item" @click="invoiceType = 'personal'"> <view class="radio-item" @click="invoiceType = 'personal'">
@ -25,83 +20,48 @@
<!-- 企业单位表单 --> <!-- 企业单位表单 -->
<block v-if="invoiceType === 'company'"> <block v-if="invoiceType === 'company'">
<view class="form-item"> <view class="form-item">
<text class="label">发票抬头</text> <text class="label">发票抬头<text class="required"> *</text></text>
<input <input type="text" placeholder="请输入发票抬头(必填)" placeholderClass="placeholder" class="input-field"
type="text" v-model="companyForm.invoiceTitle" />
placeholder="请输入发票抬头(必填)"
placeholderClass="placeholder"
class="input-field"
v-model="companyForm.invoiceTitle"
/>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="label">税号</text> <text class="label">税号<text class="required"> *</text></text>
<input <input type="text" placeholder="请写纳税人识别号(必填)" placeholderClass="placeholder" class="input-field"
type="text" v-model="companyForm.taxNumber" />
placeholder="请写纳税人识别号(必填)"
placeholderClass="placeholder"
class="input-field"
v-model="companyForm.taxNumber"
/>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="label">单位地址</text> <text class="label">单位地址</text>
<input <input type="text" placeholder="公司地址(选填)" placeholderClass="placeholder" class="input-field"
type="text" v-model="companyForm.companyAddress" />
placeholder="公司地址(选填)"
placeholderClass="placeholder"
class="input-field"
v-model="companyForm.companyAddress"
/>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="label">电话号码</text> <text class="label">电话号码</text>
<input <input type="text" placeholder="公司电话(选填)" placeholderClass="placeholder" class="input-field"
type="text" v-model="companyForm.companyPhone" />
placeholder="公司电话(选填)"
placeholderClass="placeholder"
class="input-field"
v-model="companyForm.companyPhone"
/>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="label">开户银行</text> <text class="label">开户银行</text>
<input <input type="text" placeholder="开户银行(选填)" placeholderClass="placeholder" class="input-field"
type="text" v-model="companyForm.bankName" />
placeholder="开户银行(选填)"
placeholderClass="placeholder"
class="input-field"
v-model="companyForm.bankName"
/>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="label">银行账户</text> <text class="label">银行账户</text>
<input <input type="text" placeholder="银行账户(选填)" placeholderClass="placeholder" class="input-field"
type="text" v-model="companyForm.bankAccount" />
placeholder="银行账户(选填)"
placeholderClass="placeholder"
class="input-field"
v-model="companyForm.bankAccount"
/>
</view> </view>
</block> </block>
<!-- 个人/非企业单位表单 --> <!-- 个人/非企业单位表单 -->
<block v-else> <block v-else>
<view class="form-item"> <view class="form-item">
<text class="label">发票抬头<text class="required">*</text></text> <text class="label">发票抬头<text class="required"> *</text></text>
<input <input type="text" placeholder="请输入个人发票抬头(必填)" placeholderClass="placeholder" class="input-field"
type="text" v-model="personalForm.invoiceTitle" />
placeholder="请输入个人发票抬头(必填)"
placeholderClass="placeholder"
class="input-field"
v-model="personalForm.invoiceTitle"
/>
</view> </view>
<!-- <view class="form-item"> <!-- <view class="form-item">
@ -136,7 +96,7 @@ const invoiceType = ref('company')
// //
const companyForm = reactive({ const companyForm = reactive({
userId: '123', userId: '',
invoiceTitle: '', // invoiceTitle: '', //
taxNumber: '', // taxNumber: '', //
companyAddress: '', // companyAddress: '', //
@ -147,7 +107,7 @@ const companyForm = reactive({
// / // /
const personalForm = reactive({ const personalForm = reactive({
userId: '123', userId: '',
invoiceTitle: '', // invoiceTitle: '', //
// taxNumber: '' // // taxNumber: '' //
}) })
@ -327,10 +287,24 @@ const getUserInvoice = async (id) => {
} }
} }
onLoad(() => { onLoad((option) => {
// //
console.log('用户ID:', member.value.id) console.log('用户ID:', member.value.id)
// userId
if (option.userId) {
companyForm.userId = option.userId
personalForm.userId = option.userId
} else {
uni.showToast({
title: '未获取到用户ID请重新进入',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 3000)
}
// //
getUserInvoice(member.value.id) getUserInvoice(member.value.id)
}) })

View File

@ -1,418 +1,543 @@
<template> <template>
<uv-navbar <uv-navbar
:fixed="false" :fixed="false"
:title="title" :title="title"
left-arrow left-arrow
@leftClick="$onClickLeft" @leftClick="$onClickLeft"
/> />
<view class="container" style="padding:20rpx;"> <view class="container" style="padding: 20rpx">
<view style="padding-bottom: 100rpx;"> <view style="padding-bottom: 100rpx">
<view class="bg-white"> <view class="bg-white">
<view class="section"> <view class="section">
<!-- store info begin --> <!-- store info begin -->
<list-cell :hover="false"> <list-cell :hover="false">
<view class="w-100 d-flex align-items-center"> <view class="w-100 d-flex align-items-center">
<view class="d-flex flex-column w-60"> <view class="d-flex flex-column w-60">
<view class="w-100 font-size-lg text-color-base text-truncate">{{ order.shop.name }}</view> <view
</view> class="w-100 font-size-lg text-color-base text-truncate"
<view class="d-flex justify-content-end align-items-center w-40"> >{{ order.shop.name }}</view
<view class="iconfont-yshop icon-mobile" @click="makePhoneCall(order.shop)" style="font-size: 45rpx;margin-right: 40rpx;"></view> >
<view class="iconfont-yshop icon-location" @click="openLocation(order.shop)" style="font-size: 45rpx;"></view> </view>
</view> <view class="d-flex justify-content-end align-items-center w-40">
</view> <view
</list-cell> class="iconfont-yshop icon-mobile"
<!-- store info end --> @click="makePhoneCall(order.shop)"
<list-cell :hover="false" padding="50rpx 30rpx"> style="font-size: 45rpx; margin-right: 40rpx"
<view class="w-100 d-flex flex-column"> ></view>
<view v-if="order.paid == 0" class="d-flex align-items-center just-content-center mb-40"> <view
<view class="font-size-lg text-color-error">订单未支付</view> class="iconfont-yshop icon-location"
</view> @click="openLocation(order.shop)"
<view v-if="order.paid > 0" class="d-flex align-items-center just-content-center"> style="font-size: 45rpx"
<view class="sort-num">{{ order.numberId }}</view> ></view>
</view> </view>
<!-- steps begin --> </view>
<view v-if="order.paid > 0" class="d-flex just-content-center"> </list-cell>
<view class="steps d-flex flex-column w-80"> <!-- store info end -->
<view class="steps__img-column"> <list-cell :hover="false" padding="50rpx 30rpx">
<view class="steps__img-column-item"> <view class="w-100 d-flex flex-column">
<view class="iconfont-yshop icon-lamp"></view> <view
</view> v-if="order.paid == 0"
<view class="steps__img-column-item"> class="d-flex align-items-center just-content-center mb-40"
<view class="iconfont-yshop icon-daojishi" v-if="{active: order.paid == 1 && order.status == 0}"></view> >
<view class="iconfont-yshop icon-daojishi unactive" v-else></view> <view class="font-size-lg text-color-error">订单未支付</view>
</view> </view>
<view class="steps__img-column-item" v-if="order.orderType == 'takeout'"> <view
<view class="iconfont-yshop icon-takeout" v-if="order.status == 1"></view> v-if="order.paid > 0"
<view class="iconfont-yshop icon-takeout unactive" v-else></view> class="d-flex align-items-center just-content-center"
</view> >
<view class="steps__img-column-item" > <view class="sort-num">{{ order.numberId }}</view>
<view class="iconfont-yshop icon-doorbell" v-if="order.status >= 2"></view> </view>
<view class="iconfont-yshop icon-doorbell unactive" v-else></view> <!-- steps begin -->
</view> <view v-if="order.paid > 0" class="d-flex just-content-center">
</view> <view class="steps d-flex flex-column w-80">
<view class="steps__text-column"> <view class="steps__img-column">
<view class="steps__text-column-item active"> <view class="steps__img-column-item">
<view class="steps__column-item-line bg-transparent"></view> <view class="iconfont-yshop icon-lamp"></view>
<view class="steps__text-column-item-text">已下单</view> </view>
<view class="steps__column-item-line"></view> <view class="steps__img-column-item">
</view> <view
<view class="steps__text-column-item activ" :class="{active: order.paid == 1}"> class="iconfont-yshop icon-daojishi"
<view class="steps__column-item-line"></view> v-if="{ active: order.paid == 1 && order.status == 0 }"
<view class="steps__text-column-item-text">制作中</view> ></view>
<view class="steps__column-item-line"></view> <view
</view> class="iconfont-yshop icon-daojishi unactive"
<view class="steps__text-column-item" :class="{active: order.status == 1}" v-if="order.orderType == 'takeout'"> v-else
<view class="steps__column-item-line"></view> ></view>
<view class="steps__text-column-item-text">配送中</view> </view>
<view class="steps__column-item-line bg-transparent"></view> <view
</view> class="steps__img-column-item"
<view class="steps__text-column-item" :class="{active: order.status >= 2}"> v-if="order.orderType == 'takeout'"
<view class="steps__column-item-line"></view> >
<view class="steps__text-column-item-text"> <view
{{ order.orderType == 'takeout' ? '已送达' : '请取餐' }} class="iconfont-yshop icon-takeout"
</view> v-if="order.status == 1"
<view class="steps__column-item-line bg-transparent"></view> ></view>
</view> <view
</view> class="iconfont-yshop icon-takeout unactive"
</view> v-else
</view> ></view>
<!-- steps end --> </view>
<view v-if="order.status==0 && order.paid > 0" class="d-flex just-content-center align-items-center font-size-base text-color-assist mb-40"> <view class="steps__img-column-item">
您前面还有 <text class="text-color-primary mr-10 ml-10" style="color: #52ac41;">{{order.preNum}}</text> 单待制作 <view
</view> class="iconfont-yshop icon-doorbell"
<!-- goods begin --> v-if="order.status >= 2"
<view class="w-100 d-flex flex-column position-relative mt-30" style="margin-bottom: -40rpx;"> ></view>
<view class="w-100 d-flex align-items-center mb-40" v-for="(good, index) in order.products" :key="index"> <view
<view class="d-flex flex-column w-60 overflow-hidden"> class="iconfont-yshop icon-doorbell unactive"
<view class="font-size-lg text-color-base mb-10 text-truncate">{{ good.title }}</view> v-else
<view class="font-size-sm text-color-assist text-truncate">{{ good.spec }}</view> ></view>
</view> </view>
<view class="d-flex w-40 align-items-center justify-content-between pl-30"> </view>
<view class="font-size-base text-color-base">x{{ good.number }}</view> <view class="steps__text-column">
<view class="font-size-base text-color-base font-weight-bold">{{ good.price }}</view> <view class="steps__text-column-item active">
</view> <view
</view> class="steps__column-item-line bg-transparent"
</view> ></view>
<!-- goods end --> <view class="steps__text-column-item-text">已下单</view>
</view> <view class="steps__column-item-line"></view>
</list-cell> </view>
</view> <view
<view class="section"> class="steps__text-column-item activ"
<!-- goods begin --> :class="{ active: order.paid == 1 }"
<list-cell :hover="false" padding="30rpx 30rpx"> >
<view class="w-100 d-flex flex-column position-relative"> <view class="steps__column-item-line"></view>
<view class="w-100 d-flex align-items-center mb-40" v-for="(good, index) in order.cartInfo" :key="index"> <view class="steps__text-column-item-text">制作中</view>
<image :src="good.image" mode="aspectFill" class="image"></image> <view class="steps__column-item-line"></view>
<view class="d-flex flex-column w-60 overflow-hidden"> </view>
<view class="font-size-lg text-color-base mb-10 text-truncate">{{ good.title }}</view> <view
<view class="font-size-sm text-color-assist text-truncate">{{ good.spec }}</view> class="steps__text-column-item"
</view> :class="{ active: order.status == 1 }"
<view class="d-flex w-40 align-items-center justify-content-between pl-30"> v-if="order.orderType == 'takeout'"
<view class="font-size-base text-color-base">x{{ good.number }}</view> >
<view class="font-size-base text-color-base font-weight-bold">{{ good.price }}</view> <view class="steps__column-item-line"></view>
</view> <view class="steps__text-column-item-text">配送中</view>
</view> <view
</view> class="steps__column-item-line bg-transparent"
</list-cell> ></view>
<!-- goods end --> </view>
<!-- payment and amount begin --> <view
<list-cell :hover="false" padding="50rpx 30rpx"> class="steps__text-column-item"
<view class="w-100 d-flex flex-column"> :class="{ active: order.status >= 2 }"
<view class="pay-cell"> >
<view>支付方式</view> <view class="steps__column-item-line"></view>
<view class="font-weight-bold">{{ order.statusDto.payType }}</view> <view class="steps__text-column-item-text">
</view> {{ order.orderType == "takeout" ? "已送达" : "请取餐" }}
<view class="pay-cell"> </view>
<view>订单金额</view> <view
<view class="font-weight-bold">{{ order.totalPrice }}</view> class="steps__column-item-line bg-transparent"
</view> ></view>
<view class="pay-cell" v-if="order.orderType == 'takeout'"> </view>
<view>配送费</view> </view>
<view class="font-weight-bold">{{ order.payPostage }}</view> </view>
</view> </view>
<view class="pay-cell"> <!-- steps end -->
<view>优惠金额</view> <view
<view class="font-weight-bold">{{ order.couponPrice }}</view> v-if="order.status == 0 && order.paid > 0"
</view> class="d-flex just-content-center align-items-center font-size-base text-color-assist mb-40"
<view class="pay-cell"> >
<view>实付金额</view> 您前面还有
<view class="font-weight-bold">{{ order.payPrice }}</view> <text
</view> class="text-color-primary mr-10 ml-10"
</view> style="color: #52ac41"
</list-cell> >{{ order.preNum }}</text
<!-- payment and amount end --> >
</view> 单待制作
<view class="section"> </view>
<!-- order info begin --> <!-- goods begin -->
<list-cell :hover="false" padding="50rpx 30rpx"> <view
<view class="w-100 d-flex flex-column"> class="w-100 d-flex flex-column position-relative mt-30"
<view class="pay-cell"> style="margin-bottom: -40rpx"
<view>下单时间</view> >
<view class="font-weight-bold">{{ formatDateTime(order.createTime )}}</view> <view
</view> class="w-100 d-flex align-items-center mb-40"
<view class="pay-cell"> v-for="(good, index) in order.products"
<view>下单门店</view> :key="index"
<view class="font-weight-bold">{{ order.shop.name }}</view> >
</view> <view class="d-flex flex-column w-60 overflow-hidden">
<view class="pay-cell"> <view
<view>订单号</view> class="font-size-lg text-color-base mb-10 text-truncate"
<view class="font-weight-bold">{{ order.id }}</view> >{{ good.title }}</view
</view> >
</view> <view
</list-cell> class="font-size-sm text-color-assist text-truncate"
<!-- order info end --> >{{ good.spec }}</view
</view> >
<!-- order other info begin --> </view>
<list-cell :hover="false" padding="50rpx 30rpx 20rpx" last> <view
<view class="w-100 d-flex flex-column"> class="d-flex w-40 align-items-center justify-content-between pl-30"
<view class="pay-cell"> >
<view>享用方式</view> <view class="font-size-base text-color-base"
<view class="font-weight-bold">{{order.orderType == 'takein' ? '自取' : '外卖'}}</view> >x{{ good.number }}</view
</view> >
<view class="pay-cell"> <view
<view>取餐时间</view> class="font-size-base text-color-base font-weight-bold"
<view class="font-weight-bold">{{order.getTime ? formatDateTime(order.getTime) : '立即取餐'}}</view> >{{ good.price }}</view
</view> >
<view class="pay-cell"> </view>
<view>制作完成时间</view> </view>
<view class="font-weight-bold">{{ order.deliveryTime ? formatDateTime(order.deliveryTime) : '无' }}</view> </view>
</view> <!-- goods end -->
<view class="pay-cell"> </view>
<view>备注</view> </list-cell>
<view class="font-weight-bold">{{ order.remark ? order.remark : '无' }}</view> </view>
</view> <view class="section">
</view> <!-- goods begin -->
</list-cell> <list-cell :hover="false" padding="30rpx 30rpx">
<!-- order other info end --> <view class="w-100 d-flex flex-column position-relative">
</view> <view
<view class="fixed-bottom flex justify-end bg-white p-2" v-if="order.paid > 0 && order.refundStatus == 0"> class="w-100 d-flex align-items-center mb-40"
<view class="mr-1"><uv-button type="success" v-if="order.status < 2" :plain="true" size="small" text="确认收到餐" @click="receive(order)"></uv-button></view> v-for="(good, index) in order.cartInfo"
<!-- <view><uv-button type="warning" :plain="true" size="small" text="申请退款" @click="refund(order)"></uv-button></view> --> :key="index"
</view> >
</view> <image
</view> :src="good.image"
mode="aspectFill"
class="image"
></image>
<view class="d-flex flex-column w-60 overflow-hidden">
<view
class="font-size-lg text-color-base mb-10 text-truncate"
>{{ good.title }}</view
>
<view class="font-size-sm text-color-assist text-truncate">{{
good.spec
}}</view>
</view>
<view
class="d-flex w-40 align-items-center justify-content-between pl-30"
>
<view class="font-size-base text-color-base"
>x{{ good.number }}</view
>
<view class="font-size-base text-color-base font-weight-bold"
>{{ good.price }}</view
>
</view>
</view>
</view>
</list-cell>
<!-- goods end -->
<!-- payment and amount begin -->
<list-cell :hover="false" padding="50rpx 30rpx">
<view class="w-100 d-flex flex-column">
<view class="pay-cell">
<view>支付方式</view>
<view class="font-weight-bold">{{
order.statusDto.payType
}}</view>
</view>
<view class="pay-cell">
<view>订单金额</view>
<view class="font-weight-bold">{{ order.totalPrice }}</view>
</view>
<view class="pay-cell" v-if="order.orderType == 'takeout'">
<view>配送费</view>
<view class="font-weight-bold">{{ order.payPostage }}</view>
</view>
<view class="pay-cell">
<view>优惠金额</view>
<view class="font-weight-bold">{{ order.couponPrice }}</view>
</view>
<view class="pay-cell">
<view>实付金额</view>
<view class="font-weight-bold">{{ order.payPrice }}</view>
</view>
</view>
</list-cell>
<!-- payment and amount end -->
</view>
<view class="section">
<!-- order info begin -->
<list-cell :hover="false" padding="50rpx 30rpx">
<view class="w-100 d-flex flex-column">
<view class="pay-cell">
<view>下单时间</view>
<view class="font-weight-bold">{{
formatDateTime(order.createTime)
}}</view>
</view>
<view class="pay-cell">
<view>下单门店</view>
<view class="font-weight-bold">{{ order.shop.name }}</view>
</view>
<view class="pay-cell">
<view>订单号</view>
<view class="font-weight-bold">{{ order.id }}</view>
</view>
</view>
</list-cell>
<!-- order info end -->
</view>
<!-- order other info begin -->
<list-cell :hover="false" padding="50rpx 30rpx 20rpx" last>
<view class="w-100 d-flex flex-column">
<view class="pay-cell">
<view>享用方式</view>
<view class="font-weight-bold">{{
order.orderType == "takein" ? "自取" : "外卖"
}}</view>
</view>
<view class="pay-cell">
<view>取餐时间</view>
<view class="font-weight-bold">{{
order.getTime ? formatDateTime(order.getTime) : "立即取餐"
}}</view>
</view>
<view class="pay-cell">
<view>制作完成时间</view>
<view class="font-weight-bold">{{
order.deliveryTime ? formatDateTime(order.deliveryTime) : "无"
}}</view>
</view>
<view class="pay-cell">
<view>备注</view>
<view class="font-weight-bold">{{
order.remark ? order.remark : "无"
}}</view>
</view>
</view>
</list-cell>
<!-- order other info end -->
</view>
<view
class="fixed-bottom flex justify-end bg-white p-2"
v-if="order.paid > 0 && order.refundStatus == 0"
>
<view class="mr-1"
><uv-button
type="success"
v-if="order.status < 2"
:plain="true"
size="small"
text="确认收到餐"
@click="receive(order)"
></uv-button
></view>
<!-- <view><uv-button type="warning" :plain="true" size="small" text="申请退款" @click="refund(order)"></uv-button></view> -->
</view>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { ref } from "vue";
ref import { onLoad } from "@dcloudio/uni-app";
} from 'vue' import { formatDateTime } from "@/utils/util";
import { onLoad} from '@dcloudio/uni-app' import { orderDetail, orderReceive } from "@/api/order";
import { formatDateTime } from '@/utils/util' const title = ref("订单详情");
import {
orderDetail,
orderReceive,
} from '@/api/order'
const title = ref('订单详情')
const order = ref({ const order = ref({
shop:{name:''}, shop: { name: "" },
statusDto:{payType:''} statusDto: { payType: "" },
}) });
const numForMading = ref(5) const numForMading = ref(5);
onLoad((option) => { onLoad((option) => {
detail(option.id); detail(option.id);
}) });
const detail = async(id) => { const detail = async (id) => {
let data = await orderDetail(id); let data = await orderDetail(id);
if (data) { if (data) {
order.value = data; order.value = data;
} }
} };
const openLocation = () => { const openLocation = () => {
let shop = order.value.shop; let shop = order.value.shop;
uni.openLocation({ uni.openLocation({
address: shop.addressMap + shop.address + " " + shop.name, address: shop.addressMap + shop.address + " " + shop.name,
latitude: parseFloat(shop.lat), latitude: parseFloat(shop.lat),
longitude: parseFloat(shop.lng), longitude: parseFloat(shop.lng),
fail(res) { fail(res) {
console.log(res); console.log(res);
} },
}); });
} };
const makePhoneCall = () =>{ const makePhoneCall = () => {
let shop = order.value.shop; let shop = order.value.shop;
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: shop.mobile, phoneNumber: shop.mobile,
fail(res) { fail(res) {
console.log(res) console.log(res);
} },
}) });
} };
// //
const receive = async(order) => { const receive = async (order) => {
let data = await orderReceive({uni:order.orderId}); let data = await orderReceive({ uni: order.orderId });
if (data) { if (data) {
// await getOrders(true) // await getOrders(true)
uni.redirectTo({ uni.redirectTo({
url: '/pages/order/order' url: "/pages/components/pages/orders/detail?id=" + order.orderId,
}) });
} }
} };
//退 //退
const refund = (order) => { const refund = (order) => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/components/pages/orders/refund?orderId=' + order.orderId + '&payPrice=' + order.payPrice + '&totalPrice=' + order.totalPrice url:
}) "/pages/components/pages/orders/refund?orderId=" +
} order.orderId +
"&payPrice=" +
order.payPrice +
"&totalPrice=" +
order.totalPrice,
});
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.image { .image {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
margin-right: 30rpx; margin-right: 30rpx;
border-radius: 8rpx; border-radius: 8rpx;
}
.pay-cell {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: $font-size-base;
color: $text-color-base;
margin-bottom: 40rpx;
&:nth-last-child(1) {
margin-bottom: 0;
}
} }
.pay-cell {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: $font-size-base;
color: $text-color-base;
margin-bottom: 40rpx;
&:nth-last-child(1) {
margin-bottom: 0;
}
}
/* #ifdef H5 */ /* #ifdef H5 */
page { page {
min-height: 100%; min-height: 100%;
background-color: $bg-color; background-color: $bg-color;
} }
/* #endif */ /* #endif */
.order-box { .order-box {
padding: 20rpx; padding: 20rpx;
/* #ifdef H5 */ /* #ifdef H5 */
margin-bottom: 100rpx; margin-bottom: 100rpx;
/* #endif */ /* #endif */
} }
.drinks-img { .drinks-img {
width: 260rpx; width: 260rpx;
height: 260rpx; height: 260rpx;
} }
.tips { .tips {
margin: 60rpx 0 80rpx; margin: 60rpx 0 80rpx;
line-height: 48rpx; line-height: 48rpx;
} }
@mixin arch {
content: "";
position: absolute;
background-color: $bg-color;
width: 30rpx;
height: 30rpx;
bottom: -15rpx;
z-index: 10;
border-radius: 100%;
}
@mixin arch { .section {
content: ""; position: relative;
position: absolute;
background-color: $bg-color;
width: 30rpx;
height: 30rpx;
bottom: -15rpx;
z-index: 10;
border-radius: 100%;
}
.section { &::before {
position: relative; @include arch;
left: -15rpx;
}
&::before { &::after {
@include arch; @include arch;
left: -15rpx; right: -15rpx;
} }
}
&::after { .pay-cell {
@include arch; width: 100%;
right: -15rpx; display: flex;
} align-items: center;
} justify-content: space-between;
font-size: $font-size-base;
color: $text-color-base;
margin-bottom: 40rpx;
.pay-cell { &:nth-last-child(1) {
width: 100%; margin-bottom: 0;
display: flex; }
align-items: center; }
justify-content: space-between;
font-size: $font-size-base;
color: $text-color-base;
margin-bottom: 40rpx;
&:nth-last-child(1) { .sort-num {
margin-bottom: 0; font-size: 64rpx;
} font-weight: bold;
} color: $text-color-base;
line-height: 2;
}
.sort-num { .steps__img-column {
font-size: 64rpx; display: flex;
font-weight: bold; margin: 30rpx 0;
color: $text-color-base;
line-height: 2;
}
.steps__img-column { .steps__img-column-item {
display: flex; flex: 1;
margin: 30rpx 0; display: flex;
align-items: center;
justify-content: center;
.steps__img-column-item { image {
flex: 1; width: 80rpx;
display: flex; height: 80rpx;
align-items: center; }
justify-content: center; .unactive {
color: #919293;
}
}
}
image { .steps__text-column {
width: 80rpx; display: flex;
height: 80rpx; margin-bottom: 40rpx;
}
.unactive {
color: #919293;
}
}
}
.steps__text-column { .steps__text-column-item {
display: flex; flex: 1;
margin-bottom: 40rpx; display: inline-flex;
display: flex;
align-items: center;
justify-content: center;
font-size: $font-size-base;
color: $text-color-assist;
.steps__text-column-item { &.active {
flex: 1; color: $text-color-base;
display: inline-flex; font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
font-size: $font-size-base;
color: $text-color-assist;
&.active { .steps__column-item-line {
color: $text-color-base; background-color: $text-color-base;
font-weight: bold; }
}
.steps__column-item-line { .steps__column-item-line {
background-color: $text-color-base; flex: 1;
} height: 2rpx;
} background-color: #919293;
transform: scaleY(0.5);
}
.steps__column-item-line{ .steps__text-column-item-text {
flex: 1; margin: 0 8px;
height: 2rpx; }
background-color: #919293; }
transform: scaleY(0.5); }
} .icon-lamp,
.icon-daojishi,
.steps__text-column-item-text { .icon-takeout,
margin: 0 8px; .icon-doorbell {
} font-size: 60rpx;
} }
} .iconfont-yshop {
.icon-lamp, .icon-daojishi, .icon-takeout, .icon-doorbell{ color: #52ac41;
font-size: 60rpx; }
}
.iconfont-yshop {
color: #52ac41;
}
</style> </style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -239,7 +239,7 @@ const serv = (item) => {
return; return;
} }
if (item.pages === "/pages/components/pages/fenxiao/fenxiao") { if (item.pages === "/pages/components/pages/fenxiao/fenxiao") {
if (member.value.spreadUid === 0 || member.value.spreadUid === null || member.value.spreadUid === '0') { if (member.value.spreadUid === 0 || member.value.spreadUid === null || member.value.spreadUid === '0' || member.value.spreadUid === "") {
uni.navigateTo({ uni.navigateTo({
url: `/pages/components/pages/fenxiao/fenxiaorequestform?id=${member.value.id}`, url: `/pages/components/pages/fenxiao/fenxiaorequestform?id=${member.value.id}`,
}); });
@ -248,6 +248,10 @@ const serv = (item) => {
url: `${item.pages}?spreadUid=${member.value.spreadUid}`, url: `${item.pages}?spreadUid=${member.value.spreadUid}`,
}); });
} }
} else if(item.pages === "/pages/components/pages/invoice/invoice") {
uni.navigateTo({
url: `/pages/components/pages/invoice/invoice?userId=${member.value.id}`,
});
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: item.pages, url: item.pages,

View File

@ -128,14 +128,19 @@
import { ref, computed } from "vue"; import { ref, computed } from "vue";
import { useMainStore } from "@/store/store"; import { useMainStore } from "@/store/store";
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
import { onLoad, onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app"; import {
onLoad,
onPullDownRefresh,
onReachBottom,
onShow,
} from "@dcloudio/uni-app";
import { formatDateTime, kmUnit } from "@/utils/util"; import { formatDateTime, kmUnit } from "@/utils/util";
import { orderGetOrders, orderReceive } from "@/api/order"; import { orderGetOrders, orderReceive } from "@/api/order";
import { applyInvoice } from "@/api/order"; import { applyInvoice } from "@/api/order";
// payUnify // payUnify
import { payUnify } from '@/api/order'; import { payUnify } from "@/api/order";
import { isWeixin } from '@/utils/util'; import { isWeixin } from "@/utils/util";
const main = useMainStore(); const main = useMainStore();
const { isLogin } = storeToRefs(main); const { isLogin } = storeToRefs(main);
@ -181,10 +186,15 @@ onLoad(() => {
if (!isLogin.value) { if (!isLogin.value) {
uni.navigateTo({ url: "/pages/components/pages/login/login" }); uni.navigateTo({ url: "/pages/components/pages/login/login" });
} }
getOrders(false); onShow();
});
onShow(() => {
if (isLogin.value) {
getOrders(true); //
}
}); });
onPullDownRefresh(() => { onPullDownRefresh(() => {
getOrders(false); getOrders(true);
}); });
onReachBottom(() => { onReachBottom(() => {
getOrders(false); getOrders(false);