替换京东随机数据

This commit is contained in:
tangxinyue 2026-04-24 14:56:30 +08:00
parent 0962120ab4
commit 8c39d28ff0
33 changed files with 993 additions and 332 deletions

View File

@ -719,10 +719,11 @@ const getButtons = (shopType, status, item) => {
flex-wrap: wrap;
justify-content: flex-end;
position: relative;
z-index: 998;
.btn {
position: relative;
z-index: 999;
// z-index: 998;
height: 56rpx;
line-height: 56rpx;
padding: 0 24rpx;

View File

@ -27,7 +27,7 @@ export function createApp() {
const systemInfo = uni.getStorageSync('systemInfo') || {}
app.config.globalProperties.$system = systemInfo.platform == 'ios' ? 'iOS' : 'Android'
app.config.globalProperties.$systemInfo = systemInfo
uni.setStorageSync('version', '1.0.4.sp9')
uni.setStorageSync('version', '1.0.4.sp13')
app.config.globalProperties.$version = uni.getStorageSync('version')
app.use(globalMethods);
return {

View File

@ -80,6 +80,13 @@
"navigationBarTitleText": "外卖订单详情",
"navigationStyle": "custom"
}
},
{
"path": "taobao/list-index",
"style": {
"navigationBarTitleText": "淘宝购物外卖订单列表",
"navigationStyle": "custom"
}
}
]
},
@ -289,10 +296,9 @@
}
},
{
"path" : "certificate/graduate",
"style" :
{
"navigationBarTitleText" : "证书",
"path": "certificate/graduate",
"style": {
"navigationBarTitleText": "证书",
"navigationStyle": "custom"
}
}

View File

@ -27,8 +27,10 @@
<!-- 隐藏的text用于测量宽度 -->
<text class="text-measure">{{ billData.name }}</text>
<input class="text-input" type="text" v-model="billData.name" />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"></image>
<input class="text-input" type="text" :focus="data.focusState.name" v-model="billData.name"
@blur="data.focusState.name = false" />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png" @click="triggerFocus('name')">
</image>
</view>
<!-- 金额 -->
<view class="money-box flex-align-center">
@ -39,8 +41,10 @@
<text class="text-measure font-w500" style="font-size: 64rpx;">{{ billData.money }}</text>
<input class="text-input font-w500" style="font-size: 64rpx;" type="digit"
v-model="billData.money" />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"></image>
:focus="data.focusState.money" v-model="billData.money"
@blur="data.focusState.money = false" />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"
@click="triggerFocus('money')"></image>
</view>
</view>
@ -69,7 +73,8 @@
<input
v-if="(item.type == 'text' || item.type == 'digit' || item.type == 'number') && !(data.type == 1 && item.key == 'payMethod')"
:style="{ color: item.textColor ? item.textColor : '#1a1a1a' }" class="text-input"
:type="item.type" :focus="item.focus" v-model="item.value" @click.stop />
:type="item.type" :focus="item.focus" v-model="item.value" @click.stop
@blur="item.focus = false" />
</view>
<image v-if="item.type != 'link' && !(data.type == 1 && item.key == 'payMethod')"
class="edit-image" src="/static/image/bill/add-bill/edit.png"
@ -100,7 +105,7 @@
<view class="right-input-box flex-align-center">
<!-- <text class="right-text">{{ item.value.number }}</text> -->
<input class="right-text" :focus="item.focus" type="text" v-model="item.value.quantity"
@click.stop />
@blur="item.focus = false" @click.stop />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"
@click="onClickItemInfo(item, 'foucs')">
</image>
@ -114,9 +119,11 @@
<view class="info-item-input">
<!-- 隐藏的text用于测量宽度 -->
<text class="text-measure">{{ billData.balance }}</text>
<input class="text-input" type="digit" v-model="billData.balance" />
<input class="text-input" type="digit" :focus="data.focusState.balance"
v-model="billData.balance" @blur="data.focusState.balance = false" />
</view>
<image class="edit-image" src="/static/image/bill/add-bill/edit.png">
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"
@click="triggerFocus('balance')">
</image>
</view>
</view>
@ -175,6 +182,7 @@
<image class="edit-image" src="/static/image/bill/add-bill/edit.png">
</image>
</view>
</template>
</view>
@ -190,8 +198,12 @@
billData.merchantOption.serviceDetailInfo.text }}</text>
<input class="text-input" maxlength="20" style="font-size: 22rpx;" type="text"
v-model="billData.merchantOption.serviceDetailInfo.text" />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"></image>
:focus="data.focusState.serviceDetail"
v-model="billData.merchantOption.serviceDetailInfo.text"
@blur="data.focusState.serviceDetail = false" />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"
@click="triggerFocus('serviceDetail')">
</image>
</view>
</view>
<uni-data-select class="select" style="flex: none;width: 80px;"
@ -210,8 +222,11 @@
billData.merchantOption.recommendServiceInfo.text }}</text>
<input class="text-input" maxlength="20" style="font-size: 22rpx;" type="text"
v-model="billData.merchantOption.recommendServiceInfo.text" />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"></image>
:focus="data.focusState.recommendService"
v-model="billData.merchantOption.recommendServiceInfo.text"
@blur="data.focusState.recommendService = false" />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"
@click="triggerFocus('recommendService')"></image>
</view>
</view>
<text class="right-text">去看看</text>
@ -227,12 +242,34 @@
billData.merchantOption.serviceRecommendInfo.text }}</text>
<input class="text-input" maxlength="20" style="font-size: 22rpx;" type="text"
v-model="billData.merchantOption.serviceRecommendInfo.text" />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"></image>
:focus="data.focusState.serviceRecommend"
v-model="billData.merchantOption.serviceRecommendInfo.text"
@blur="data.focusState.serviceRecommend = false" />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"
@click="triggerFocus('serviceRecommend')"></image>
</view>
</view>
<image class="right-icon" src="/static/image/common/right-grey.png" />
</view>
<view class="bill-analysis-box"
v-if="option.key == 'isShowBillAnalysis' && billData.merchantOption.isShowBillAnalysis">
<view class="bill-analysis-text-box">
<view class="flex-1 over-hidden">
<view class="service-detail-info info-item-input">
<!-- 隐藏的text用于测量宽度 -->
<text class="text-measure" style="font-size: 22rpx;">{{
billData.merchantOption.billAnalysisInfo.text }}</text>
<input class="text-input" maxlength="20" style="font-size: 22rpx;" type="text"
:focus="data.focusState.billAnalysis"
v-model="billData.merchantOption.billAnalysisInfo.text"
@blur="data.focusState.billAnalysis = false" />
<image class="edit-image" src="/static/image/bill/add-bill/edit.png"
@click="triggerFocus('billAnalysis')"></image>
</view>
</view>
</view>
</view>
</view>
</template>
@ -310,6 +347,41 @@ const timepopup = ref(null)
//
const billManagementPopupRef = ref(null)
//
const nameInputRef = ref(null)
const moneyInputRef = ref(null)
const balanceInputRef = ref(null)
const serviceDetailInputRef = ref(null)
const recommendServiceInputRef = ref(null)
const serviceRecommendInputRef = ref(null)
const billAnalysisInputRef = ref(null)
/**
* 通用聚焦函数
* @param {Object} inputRef 目标输入框的 ref
*/
const onFocusShortcut = (inputRef) => {
if (!inputRef) return
nextTick(() => {
// uni-app input focus focus()
// ref
if (inputRef.value && typeof inputRef.value.focus === 'function') {
inputRef.value.focus()
}
})
}
/**
* 触发指定输入框聚焦响应式变量方式
* @param {String} key focusState 中的键名
*/
const triggerFocus = (key) => {
data.focusState[key] = false
nextTick(() => {
data.focusState[key] = true
})
}
const {
addBill,
getBillList,
@ -411,6 +483,13 @@ const switchOptions = [{
"isSwitch": true,
showTypeIds: [1, 2, 3],
key: 'isShowBarcode',
},
{
"id": 10,
"name": "账单分析",
"isSwitch": true,
showTypeIds: [1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13],
key: 'isShowBillAnalysis',
}
]
@ -484,6 +563,10 @@ const data = reactive({
note: {
isImage: false,
text: ''
},
isShowBillAnalysis: false,
billAnalysisInfo: {
text: '本笔登上月收入榜,看看分析吧'
}
}
},
@ -495,7 +578,17 @@ const data = reactive({
tagInputValue: "",
showTagInput: false,
// switch
switchOptions: switchOptions
switchOptions: switchOptions,
//
focusState: {
name: false,
money: false,
balance: false,
serviceDetail: false,
recommendService: false,
serviceRecommend: false,
billAnalysis: false
}
})
let {
@ -967,7 +1060,7 @@ const uploadImage = () => {
*/
const saveAndDisplayImage = (file) => {
// #ifdef H5
return Promise.resolve(file)
// return Promise.resolve(file)
// #endif
// #ifndef H5
@ -1496,4 +1589,20 @@ page {
}
.bill-analysis-box {
border-top: 0.5px solid #E4E4E4;
padding: 14rpx 22rpx;
.bill-analysis-text-box {
color: #B7971B;
font-size: 26rpx;
background-color: #FBF8F1;
height: 76rpx;
display: flex;
align-items: center;
border-radius: 16rpx;
padding: 0 24rpx;
}
}
</style>

View File

@ -172,8 +172,9 @@
<view class="bill-management">
<view class="title">账单管理</view>
<view class="top-box" style="background-color: #FBF8F1;">
<text style="font-size: 24rpx;color: #B7971B;">本笔登上月收入榜看看分析吧</text>
<view v-if="billData.merchantOption.isShowBillAnalysis" class="top-box" style="background-color: #FBF8F1;">
<text style="font-size: 24rpx;color: #B7971B;">{{
billData.merchantOption.billAnalysisInfo.text || '本笔登上月收入榜,看看分析吧' }}</text>
<uni-icons type="right" size="10" color="#B7971B"></uni-icons>
</view>
<view class="bill-classification bill-management-item">

View File

@ -284,7 +284,7 @@ const getBillDataList = () => {
const createTimeItem = item.itemInfoList.find(info => info.key == 'createTime')
const createTime = createTimeItem ? createTimeItem.value : new Date()
const date = new Date(createTime)
const date = dateUtil.parseSafe(createTime)
const year = date.getFullYear() + ''
const month = (date.getMonth() + 1) + ''
@ -342,7 +342,7 @@ const getBillDataList = () => {
//
groupList.forEach(group => {
group.list.sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp))
group.list.sort((a, b) => dateUtil.parseSafe(b.timestamp) - dateUtil.parseSafe(a.timestamp))
})
data.billList = groupList
@ -624,6 +624,13 @@ page {
overflow: hidden;
overflow-x: scroll;
&::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
.filter-item {
background-color: #ffffff;
color: var(--text-primary);

View File

@ -4,7 +4,7 @@
<view>
<image :src="data.banner" style="width: 100%;height: 244px;"></image>
</view>
<exchange />
<exchange v-if="data.tradeCoupon" />
<!-- <view style="margin-top:-90px;position: relative;">
<customTab :isHuise="shouldBeTrue(data.goods)" />
</view> -->
@ -463,7 +463,8 @@ const data = reactive({
isProcessingClick: false,
banner: '/static/image/recharge/banner1.png',
isCombo: false,
source: "uni_alipay_other"
source: "uni_alipay_other",
tradeCoupon: false
})
let {
@ -493,6 +494,7 @@ onLoad(async (option) => {
}
const config = uni.getStorageSync('config').config
const themeConfig = config?.['client.uniapp.theme']
data.tradeCoupon = config?.['client.trade_coupon'] === true ? true : false
if (themeConfig?.enable) {
if (themeConfig?.theme == '0214') {
data.banner = '/static/image/recharge/214/bannar.png'

View File

@ -16,10 +16,13 @@
</template>
<script setup>
import { ref, getCurrentInstance } from 'vue';
import { ref, reactive, getCurrentInstance } from 'vue';
import { onLoad } from '@dcloudio/uni-app'
const { proxy } = getCurrentInstance();
const data = reactive({
phone: ''
})
onLoad((options) => {
if (options.phone) {
@ -47,6 +50,7 @@ const menuList = ref([
bgColor: ["#FFF0DA", "#FFFFFF"],
btnBg: "#FF953C",
shadowColor: "#FF953C",
// url: "/pages/shopping/taobao/list-index"
url: ""
}, {
name: "快手",

View File

@ -9,6 +9,11 @@
</view>
</view>
<view v-if="!isEditMode" class="random-dice">
<image style="width: 2rem;height: 2rem;" src="/static/image/common/random-dice.png"
@click="clickRandomDate"></image>
</view>
<!-- 等待付款 -->
<template v-if="activeTab == 'dengdaifukuan'">
<view class="tip-box">
@ -313,8 +318,8 @@
</view>
</view>
</view>
<view v-else class="btn-box">
<view class="btn" :class="{ red: btn == '送朋友' }" v-for="btn in btnList">
<view class="btn-box">
<view class="btn" :class="{ red: btn == '送朋友' }" v-for="(btn, index) in btnList" :key="index">
<image v-if="btn == '送朋友'" class="icon" src="/static/image/shopping/jingdong/detail/gift.png">
</image>
{{ btn }}
@ -374,7 +379,7 @@
</view>
<view class="order-info ">
<view class="item flex-justify-between" v-for="item in order.orderInfo"
<view class="item flex-justify-between" v-for="(item, index) in order.orderInfo" :key="index"
@click="onClickItemInfo(item)">
<text class="label shrink-0">{{ item.label }}</text>
<view class="flex-1 flex-align-center"
@ -387,7 +392,7 @@
</view>
</view>
<view class="delivery-info">
<view class="item flex-justify-between" v-for="item in order.sendType"
<view class="item flex-justify-between" v-for="(item, index) in order.sendType" :key="index"
@click="onClickItemInfo(item)">
<text class="label shrink-0">{{ item.label }}</text>
<view class="flex-1 flex-align-center"
@ -472,7 +477,7 @@
import { onLoad } from "@dcloudio/uni-app";
import { ref, computed, watch, onMounted, nextTick } from "vue";
import NavBar from "@/components/nav-bar/nav-bar.vue";
import { shoppingType, shoppingClassfiy } from "../json/order.json";
import { shoppingType, shoppingClassfiy, shoppingProductList } from "../json/order.json";
import AutoWidthInput from "@/components/common/auto-width-input.vue";
import DateTimePicker from '@/components/dengrq-datetime-picker/dateTimePicker/index.vue';
import { stringUtil } from '@/utils/common.js';
@ -552,9 +557,9 @@ const order = ref(shoppingClassfiy[activeTab.value]);
//
if (order.value) {
order.value.consignee = order.value.consignee;
order.value.phone = order.value.phone;
order.value.fullAddress = order.value.fullAddress;
order.value.consignee = order.value.consignee || "";
order.value.phone = order.value.phone || "";
order.value.fullAddress = order.value.fullAddress || "";
}
//
@ -649,10 +654,54 @@ onLoad((options) => {
date.setHours(date.getHours() + Math.floor(Math.random() * 12));
order.value.trackingTime = formatTime(date);
}
//
clickRandomDate();
}
}
});
/**
* 随机选择商品 (避开当前商品)
*/
const clickRandomDate = () => {
if (!shoppingProductList || shoppingProductList.length === 0) return;
// ()
const currentTitle = order.value?.products?.[0]?.title || '';
//
let availableProducts = shoppingProductList.filter(p => {
const title = p.products?.[0]?.title || '';
return title !== currentTitle;
});
// fallback
if (availableProducts.length === 0) {
availableProducts = shoppingProductList;
}
//
const randomIndex = Math.floor(Math.random() * availableProducts.length);
const selected = JSON.parse(JSON.stringify(availableProducts[randomIndex]));
//
if (order.value) {
order.value.shopType = selected.shopType || order.value.shopType;
order.value.shopName = selected.shopName || order.value.shopName;
order.value.totalPrice = selected.totalPrice || order.value.totalPrice;
order.value.carriage = selected.carriage || order.value.carriage;
order.value.discount = selected.discount || order.value.discount;
if (selected.products && selected.products.length > 0) {
order.value.products[0] = {
...order.value.products[0],
...selected.products[0]
};
}
}
};
/**
* 选择图片并转换为本地持久化路径 (并清理旧图)
*/
@ -875,6 +924,14 @@ const switchTab = (item) => {
order.value.fullAddress = oldData.fullAddress || order.value.fullAddress;
order.value.shopName = oldData.shopName || order.value.shopName;
order.value.shopType = oldData.shopType || order.value.shopType;
order.value.carriage = oldData.carriage || order.value.carriage;
order.value.discount = oldData.discount || order.value.discount;
order.value.totalPrice = oldData.totalPrice || order.value.totalPrice;
//
if (order.value.products && order.value.products[0] && oldData.products && oldData.products[0]) {
order.value.products[0] = JSON.parse(JSON.stringify(oldData.products[0]));
}
// orderInfo
if (order.value.orderInfo && oldData.orderInfo) {
@ -1803,4 +1860,10 @@ watch([
background-color: #ffffff;
border-radius: 24rpx;
}
.random-dice {
display: flex;
justify-content: flex-end;
margin: 0 16rpx;
}
</style>

View File

@ -8,6 +8,12 @@
<text>{{ item.label }}</text>
</view>
</view>
<view v-if="!isEditMode" class="random-dice">
<image style="width: 2rem;height: 2rem;" src="/static/image/common/random-dice.png"
@click="clickRandomDate"></image>
</view>
<!-- 未支付 -->
<template v-if="activeTab == 'weizhifu'">
<view class="weizhifu card">
@ -375,7 +381,8 @@
</template>
<view class="order-info">
<view class="item flex-justify-between" v-for="item in order.orderInfo" @click="onClickItemInfo(item)">
<view class="item flex-justify-between" v-for="(item, index) in order.orderInfo" :key="index"
@click="onClickItemInfo(item)">
<text class="label shrink-0">{{ item.label }}</text>
<view class="flex-1 flex-align-center"
style="justify-content: flex-end;width: 300rpx;overflow-x: auto;margin-left: 20rpx;">
@ -470,7 +477,7 @@
import { onLoad } from "@dcloudio/uni-app";
import { ref, computed, watch, onMounted, nextTick, reactive, toRefs } from "vue";
import NavBar from "@/components/nav-bar/nav-bar.vue";
import { waimaiType, waimaiClassfiy } from "../json/order.json";
import { waimaiType, waimaiClassfiy, waimaiProductList } from "../json/order.json";
import AutoWidthInput from "@/components/common/auto-width-input.vue";
import DateTimePicker from '@/components/dengrq-datetime-picker/dateTimePicker/index.vue';
import { stringUtil } from "@/utils/common.js";
@ -525,6 +532,11 @@ const switchTab = (item) => {
//
initDefaultTimes();
// tab ()
if (!isEditMode.value) {
clickRandomDate();
}
}
}
@ -711,7 +723,6 @@ const chooseRecommendImg = () => {
});
};
const orderRef = ref(data.order);
//
const initDefaultTimes = () => {
@ -780,9 +791,44 @@ onLoad((options) => {
//
initDefaultTimes();
switchTab({ key: activeTab.value });
//
clickRandomDate();
}
});
/**
* 随机选择外卖商品 (避开当前商品)
*/
const clickRandomDate = () => {
if (!waimaiProductList || waimaiProductList.length === 0) return;
// ()
const currentShop = order.value?.shopName || '';
//
let available = waimaiProductList.filter(p => p.shopName !== currentShop);
//
if (available.length === 0) {
available = waimaiProductList;
}
//
const randomIndex = Math.floor(Math.random() * available.length);
const selected = JSON.parse(JSON.stringify(available[randomIndex]));
//
if (order.value) {
order.value.shopName = selected.shopName || order.value.shopName;
if (selected.products && selected.products.length > 0) {
//
order.value.products = selected.products;
}
// UI
order.value = { ...order.value };
}
};
const deliveryTimePopup = ref(null);
const timepopup = ref(null); //
const deliveryHours = Array.from({ length: 24 }, (_, i) => i.toString().padStart(2, '0'));
@ -1043,19 +1089,6 @@ const generateRandomOrder = () => {
return Math.floor(Math.random() * 9000000000) + 1000000000;
};
/**
* 生成默认期望时间
*/
const generateDefaultExpectedTime = () => {
const date = new Date();
date.setMinutes(date.getMinutes() + 30);
const h = date.getHours().toString().padStart(2, '0');
const min = date.getMinutes().toString().padStart(2, '0');
const date2 = new Date(date.getTime() + 15 * 60000);
const h2 = date2.getHours().toString().padStart(2, '0');
const min2 = date2.getMinutes().toString().padStart(2, '0');
return `${h}:${min}-${h2}:${min2}`;
};
/**
* 计算商品总价
@ -1891,4 +1924,10 @@ const onConfirm = () => {
background-color: #ffffff;
border-radius: 24rpx;
}
.random-dice {
display: flex;
justify-content: flex-end;
margin: 0 16rpx;
}
</style>

View File

@ -1,4 +1,5 @@
{
// "购物订单分类字段"
"shoppingClassfiy": {
"dengdaifukuan": {
"id": "",
@ -6,9 +7,9 @@
"shopName": "",
"status": "等待付款",
"statusDesc": "",
"consignee": "",
"phone": "",
"fullAddress": "",
"consignee": "张三",
"phone": "13812345678",
"fullAddress": "上海市浦东新区汤臣一品",
"totalPrice": "",
"carriage": "0.00",
"products": [
@ -81,9 +82,9 @@
"trackingDesc": "预计明天9:00-15:00送达",
"trackingDesc2": "快递运输 · 温馨提示您的订单预计x月xx日09:00- 15:00送达",
"trackingTime": "",
"consignee": "",
"phone": "",
"fullAddress": "",
"consignee": "张三",
"phone": "13812345678",
"fullAddress": "上海市浦东新区汤臣一品",
"totalPrice": "",
"carriage": "0.00",
"discount": "0.00",
@ -166,13 +167,16 @@
"status": "完成",
"statusColor": "gray",
"trackingTitle": "已签收",
"courier": "",
"courierImg": "",
"courier": "李四",
"courierImg": "/static/image/shopping/jingdong/detail/kuaidiyuan.png",
"trackingDesc": "您的订单已签收,可对快递员的服务进行评价或打赏哦~",
"trackingDesc2": "快递运输 · 温馨提示:您的订单已签收",
"trackingTime": "",
"carriage": "0.00",
"discount": "0.00",
"consignee": "张三",
"phone": "13812345678",
"fullAddress": "上海市浦东新区汤臣一品",
"products": [
{
"image": "",
@ -243,6 +247,9 @@
"statusColor": "gray",
"carriage": "0.00",
"discount": "0.00",
"consignee": "张三",
"phone": "13812345678",
"fullAddress": "上海市浦东新区汤臣一品",
"products": [
{
"image": "",
@ -297,7 +304,7 @@
{
"label": "收货地址",
"key": "address",
"value": "",
"value": "上海市浦东新区汤臣一品",
"type": "textarea"
}
],
@ -311,9 +318,9 @@
"statusColor": "gray",
"carriage": "0.00",
"discount": "0.00",
"consignee": "",
"phone": "",
"fullAddress": "",
"consignee": "张三",
"phone": "13812345678",
"fullAddress": "上海市浦东新区汤臣一品",
"products": [
{
"image": "",
@ -374,6 +381,7 @@
"hasMore": true
}
},
// "购物类型"
"shoppingType": [
{
"label": "等待付款",
@ -396,6 +404,7 @@
"key": "yiquxiao"
}
],
// "外卖订单分类字段"
"waimaiClassfiy": {
"weizhifu": {
"id": "",
@ -405,9 +414,9 @@
"status": "等待付款",
"statusDesc": "",
"deliveryTime": "11:17-11:32",
"address": "",
"phone": "",
"consignee": "",
"address": "上海市浦东新区汤臣一品",
"phone": "13562365984",
"consignee": "张三",
"discountCarriage": "",
"carriage": "",
"packagingFee": "",
@ -470,7 +479,9 @@
"deliveryImages": "",
"discountCarriage": "",
"discount": "0.00",
"carriage": "",
"address": "上海市浦东新区汤臣一品",
"phone": "13562365984",
"consignee": "张三",
"packagingFee": "",
"recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png",
"amountTo": "",
@ -543,6 +554,9 @@
"carriage": "",
"packagingFee": "",
"discount": "0.00",
"address": "上海市浦东新区汤臣一品",
"phone": "13562365984",
"consignee": "张三",
"amountTo": "",
"products": [
{
@ -610,6 +624,9 @@
"carriage": "",
"discount": "0.00",
"amountTo": "",
"address": "上海市浦东新区汤臣一品",
"phone": "13562365984",
"consignee": "张三",
"products": [
{
"image": "",
@ -679,6 +696,9 @@
"discount": "0.00",
"carriage": "",
"amountTo": "",
"address": "上海市浦东新区汤臣一品",
"phone": "13562365984",
"consignee": "张三",
"products": [
{
"image": "",
@ -721,6 +741,7 @@
]
}
},
// "外卖类型"
"waimaiType": [
{
"label": "未支付",
@ -742,5 +763,583 @@
"label": "取消",
"key": "yiquxiao"
}
],
// "购物随机产品列表"
"shoppingProductList": [
{
"shopType": "self",
"shopName": "京东数码自营旗舰店",
"totalPrice": "0",
"carriage": "0.00",
"discount": "0",
"products": [
{
"image": "/static/image/shopping/jingdong/product/shopping/xianka.png",
"name": "",
"title": "华硕 TUF 5090显卡",
"desc": "5090旗舰算力 水冷夜神OC",
"service": "不支持7天无理由退货",
"price": "39849.00",
"count": "1"
}
]
},
{
"shopType": "self",
"shopName": "Apple 产品京东自营旗舰店",
"totalPrice": "",
"carriage": "0.00",
"discount": "0",
"products": [
{
"image": "/static/image/shopping/jingdong/product/shopping/iphone.png",
"name": "Apple iPhone 17 Pro",
"title": "Apple/苹果 iPhone 17 Pro Max 1TB 星宇橙色",
"desc": "星宇橙色全网通5G",
"service": "免费上门退换 七天无理由退货",
"price": "12999.00",
"count": "1"
}
]
},
{
"shopType": "self",
"shopName": "路易威登京东官方旗舰店",
"totalPrice": "",
"carriage": "0.00",
"discount": "0.00",
"products": [
{
"image": "/static/image/shopping/jingdong/product/shopping/lv.png",
"name": "LV",
"title": "路易威登 经典老花手提包",
"desc": "经典老花;手提包",
"service": "次日达",
"price": "23979.25",
"count": "1"
}
]
},
{
"shopType": "jd",
"shopName": "索尼SONY数码京东官方旗舰店",
"totalPrice": "15499.00",
"carriage": "0.00",
"discount": "200.00",
"products": [
{
"image": "/static/image/shopping/jingdong/product/shopping/sony.png",
"name": "Sony",
"title": "索尼SONYAlpha 7 IV 全画幅微单数码相机",
"desc": "单机身不含镜头约3300万有效像素",
"service": "厂家发货",
"price": "15499.00",
"count": "1"
}
]
},
{
"shopType": "self",
"shopName": "京东超市-五粮液自营店",
"totalPrice": "2198.00",
"carriage": "0.00",
"discount": "100.00",
"products": [
{
"image": "/static/image/shopping/jingdong/product/shopping/wuliangye.png",
"name": "五粮液",
"title": "五粮液 普五 第八代 浓香型白酒 52度 500ml*2瓶",
"desc": "500ml*2礼盒装浓香型",
"service": "211限时达",
"price": "1099.00",
"count": "2"
}
]
},
{
"shopType": "jd",
"shopName": "戴森Dyson京东自营官方旗舰店",
"totalPrice": "3299.00",
"carriage": "0.00",
"discount": "0.00",
"products": [
{
"image": "/static/image/shopping/jingdong/product/shopping/dyson_v12.png",
"name": "戴森",
"title": "戴森(Dyson) V12 Detect Slim 无绳吸尘器",
"desc": "轻量版;激光探测;轻量吸尘器",
"service": "次日达",
"price": "3299.00",
"count": "1"
}
]
}
],
// "外卖随机产品列表"
"waimaiProductList": [
{
"shopName": "喜茶 (上海中区广场店)",
"products": [
{
"image": "/static/image/shopping/jingdong/product/waimai/xicha1.png",
"title": "多肉葡萄",
"desc": "标准冰/五分糖;一人份",
"price": "28.00",
"count": "1",
"discount": "2.00"
}
]
},
{
"shopName": "肯德基宅急送 (南京路店)",
"products": [
{
"image": "/static/image/shopping/jingdong/product/waimai/kfc.png",
"title": "劲脆鸡腿堡单人餐",
"desc": "汉堡+薯条+可乐;一人份",
"price": "38.50",
"count": "1",
"discount": "9.00"
}
]
},
{
"shopName": "Wagas 沃歌斯 (嘉里中心店)",
"products": [
{
"image": "/static/image/shopping/jingdong/product/waimai/shala.png",
"title": "沃歌斯冠军沙拉",
"desc": "含鸡肉/羽衣甘蓝;一人份",
"price": "68.00",
"count": "1",
"discount": "0.00"
}
]
},
{
"shopName": "海底捞外送 (火锅外卖)",
"products": [
{
"image": "/static/image/shopping/jingdong/product/waimai/haidilao.png",
"title": "捞派肥牛 (半份)",
"desc": "精选谷饲肥牛;一人份",
"price": "36.00",
"count": "1",
"discount": "0.00"
}
]
},
{
"shopName": "星巴克专星送 (国金中心店)",
"products": [
{
"image": "/static/image/shopping/jingdong/product/waimai/xingbake.png",
"title": "燕麦拿铁 (大杯)",
"desc": "不额外加糖/常温;一人份",
"price": "35.00",
"count": "1",
"discount": "7.00"
}
]
},
{
"shopName": "新荣记 (黑珍珠三钻·南京西路店)",
"products": [
{
"image": "/static/image/shopping/jingdong/product/waimai/huajiaoji.png",
"title": "至尊黄焖两头干鲍鱼花胶鸡套餐",
"desc": "精选20头干鲍、深海花胶、清远走地鸡单人尊享",
"price": "3888.00",
"count": "1",
"discount": "0.00"
}
]
}
],
// "初始化默认数据"
"defaultDataList": [
{
"id": "70085b84-5e10-4ece-a971-9242e19b47de",
"shopType": "self",
"shopName": "路易威登京东官方旗舰店",
"status": "正在出库",
"trackingTitle": "仓库处理中",
"trackingDesc": "预计明天9:00-15:00送达",
"trackingDesc2": "快递运输 · 温馨提示您的订单预计x月xx日09:00- 15:00送达",
"trackingTime": "2026-04-23 10:16:09",
"consignee": "张三",
"phone": "13812345678",
"fullAddress": "上海市浦东新区汤臣一品",
"totalPrice": "23979.25",
"carriage": "0.00",
"discount": "0.00",
"products": [
{
"image": "/static/image/shopping/jingdong/product/shopping/lv.png",
"name": "LV",
"title": "路易威登 经典老花手提包",
"desc": "经典老花;手提包",
"service": "次日达",
"price": "23979.25",
"count": "1"
}
],
"orderInfo": [
{
"label": "订单编号",
"key": "orderNumber",
"value": "300232448729868720",
"type": "number"
},
{
"label": "交易快照",
"key": "transactionSnapshot",
"value": "发生交易争执时,可作为判断依据"
},
{
"label": "支付方式",
"key": "paymentMethod",
"value": "在线支付"
},
{
"label": "支付时间",
"key": "paymentTime",
"value": "2026-04-23 09:50:09",
"type": "time"
},
{
"label": "下单时间",
"key": "orderTime",
"value": "2026-04-23 09:50:05",
"type": "time"
}
],
"sendType": [
{
"label": "配送方式",
"key": "sendType",
"value": "快递运输"
},
{
"label": "收货信息",
"key": "userInfo",
"value": "张三 13812345678"
},
{
"label": "收货地址",
"key": "address",
"value": "上海市浦东新区汤臣一品",
"type": "textarea"
},
{
"label": "期望配送时间",
"key": "expectedDeliveryTime",
"value": "2026-04-24 09:00-21:00",
"type": "timeRange"
},
{
"label": "收货方式",
"key": "shippingMethod",
"value": "送货上门"
}
],
"promoType": "plus",
"promoText": "告别凑单, 享免运优惠",
"activeTab": "zhengzaichuku"
},
{
"id": "dea9229f-9a2f-4a66-b50f-ee53f3b4f0af",
"shopType": "self",
"shopName": "京东超市-五粮液自营店",
"status": "完成",
"statusColor": "gray",
"trackingTitle": "已签收",
"courier": "小张",
"courierImg": "/static/image/shopping/jingdong/detail/kuaidiyuan.png",
"trackingDesc": "您的订单已签收,可对快递员的服务进行评价或打赏哦~",
"trackingDesc2": "快递运输 · 温馨提示:您的订单已签收",
"trackingTime": "2026-04-24 11:54:34",
"carriage": "0.00",
"discount": "100.00",
"consignee": "张三",
"phone": "13812345678",
"fullAddress": "上海市浦东新区汤臣一品",
"products": [
{
"image": "/static/image/shopping/jingdong/product/shopping/wuliangye.png",
"name": "五粮液",
"title": "五粮液 普五 第八代 浓香型白酒 52度 500ml*2瓶",
"desc": "500ml*2礼盒装浓香型",
"service": "211限时达",
"price": "1099.00",
"count": "2"
}
],
"orderInfo": [
{
"label": "订单编号",
"key": "orderNumber",
"value": "307668850019371894",
"type": "number"
},
{
"label": "交易快照",
"key": "transactionSnapshot",
"value": "发生交易争执时,可作为判断依据"
},
{
"label": "支付方式",
"key": "paymentMethod",
"value": "在线支付"
},
{
"label": "支付时间",
"key": "paymentTime",
"value": "2026-04-23 09:54:34",
"type": "time"
},
{
"label": "下单时间",
"key": "orderTime",
"value": "2026-04-23 09:51:15",
"type": "time"
}
],
"sendType": [
{
"label": "配送方式",
"key": "sendType",
"value": "快递运输"
},
{
"label": "期望配送时间",
"key": "expectedDeliveryTime",
"value": "2026-04-24 09:00-21:00",
"type": "timeRange"
},
{
"label": "收货方式",
"key": "shippingMethod",
"value": "送货上门"
}
],
"promoType": "plus",
"promoText": "告别凑单, 享免运优惠",
"hasMore": true,
"totalPrice": "999.00",
"activeTab": "yiqianshou"
},
{
"id": "3e0aede8-6a75-438c-b4cd-4dcff3f933fa",
"shopType": "self",
"shopName": "Apple 产品京东自营旗舰店",
"status": "完成",
"statusColor": "gray",
"carriage": "0.00",
"discount": "0",
"consignee": "张三",
"phone": "13812345678",
"fullAddress": "上海市浦东新区汤臣一品",
"products": [
{
"image": "/static/image/shopping/jingdong/product/shopping/iphone.png",
"name": "Apple iPhone 17 Pro",
"title": "Apple/苹果 iPhone 17 Pro Max 1TB 星宇橙色",
"desc": "星宇橙色全网通5G",
"service": "免费上门退换 七天无理由退货",
"price": "12999.00",
"count": "1"
}
],
"orderInfo": [
{
"label": "订单编号",
"key": "orderNumber",
"value": "307668850019371894",
"type": "number"
},
{
"label": "交易快照",
"key": "transactionSnapshot",
"value": "发生交易争执时,可作为判断依据"
},
{
"label": "支付方式",
"key": "paymentMethod",
"value": "在线支付"
},
{
"label": "支付时间",
"key": "paymentTime",
"value": "2026-04-22 09:55:00",
"type": "time"
},
{
"label": "下单时间",
"key": "orderTime",
"value": "2026-04-22 09:51:15",
"type": "time"
}
],
"sendType": [
{
"label": "配送方式",
"key": "sendType",
"value": "快递运输"
},
{
"label": "收货信息",
"key": "userInfo",
"value": "张三 13812345678"
},
{
"label": "收货地址",
"key": "address",
"value": "上海市浦东新区汤臣一品",
"type": "textarea"
}
],
"hasMore": true,
"totalPrice": "12999.00",
"activeTab": "wancheng"
},
{
"id": "eef1efa2-e4d6-4b2d-a2f1-be7e6625ea20",
"shopType": "waimai",
"type": "yiwancheng",
"shopName": "新荣记 (黑珍珠三钻·南京西路店)",
"status": "完成",
"statusColor": "gray",
"recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png",
"packagingFee": "20.00",
"discountCarriage": "",
"carriage": "",
"discount": "0.00",
"amountTo": "3888.00",
"address": "上海市浦东新区汤臣一品",
"phone": "13562365984",
"consignee": "张三",
"products": [
{
"image": "/static/image/shopping/jingdong/product/waimai/huajiaoji.png",
"title": "至尊黄焖两头干鲍鱼花胶鸡套餐",
"desc": "精选20头干鲍、深海花胶、清远走地鸡单人尊享",
"price": "3888.00",
"count": "1",
"discount": "0.00"
}
],
"productsInfo": {
"cutleryCount": "商家按餐量提供",
"deliveryPreference": "允许敲门/按门铃;允许发短信",
"outOfStock": "缺货时与我电话沟通",
"deliveryTime": "今天10:35-11:00"
},
"orderInfo": [
{
"label": "订单编号",
"key": "orderNumber",
"value": "9305881319",
"type": "number"
},
{
"label": "交易快照",
"key": "transactionSnapshot",
"value": "发生交易争执时,可作为判断依据"
},
{
"label": "下单时间",
"key": "orderTime",
"value": "2026-04-22 11:55:11",
"type": "time"
},
{
"label": "支付时间",
"key": "paymentTime",
"value": "2026-04-22 14:55:22",
"type": "time"
},
{
"label": "支付方式",
"key": "paymentMethod",
"value": "微信支付",
"type": "text"
},
{
"label": "如遇缺货",
"key": "outOfStock",
"value": "缺货时与我电话沟通",
"type": "text"
}
],
"promoType": "coupon",
"promoText": "恭喜您获得3元京东购物券",
"promoAction": "去领券",
"totalPrice": "3888.00",
"activeTab": "yiwancheng"
},
{
"id": "c3c1232d-81c6-4743-997d-83f6393da7d0",
"type": "weizhifu",
"shopType": "waimai",
"shopName": "星巴克专星送 (国金中心店)",
"status": "等待付款",
"statusDesc": "24:58",
"deliveryTime": "11:17-11:32",
"address": "上海市浦东新区汤臣一品",
"phone": "13562365984",
"consignee": "张三",
"discountCarriage": "0",
"carriage": "6",
"packagingFee": "",
"recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png",
"discount": "0",
"amountTo": "34.00",
"products": [
{
"image": "/static/image/shopping/jingdong/product/waimai/xingbake.png",
"title": "燕麦拿铁 (大杯)",
"desc": "不额外加糖/常温;一人份",
"price": "35.00",
"count": "1",
"discount": "0"
}
],
"productsInfo": {
"cutleryCount": "商家按餐量提供",
"deliveryPreference": "允许敲门/按门铃;允许发短信",
"outOfStock": "缺货时与我电话沟通",
"deliveryTime": "今天10:37-11:02"
},
"orderInfo": [
{
"label": "订单编号",
"key": "orderNumber",
"value": "9817790982",
"type": "number"
},
{
"label": "交易快照",
"key": "transactionSnapshot",
"value": "发生交易争执时,可作为判断依据"
},
{
"label": "支付方式",
"key": "paymentMethod",
"value": "微信支付",
"type": "text"
},
{
"label": "下单时间",
"key": "orderTime",
"value": "2026-04-23 09:57:16",
"type": "time"
}
],
"promoType": "text",
"promoHighlight": "近90天600+人回购",
"totalPrice": "35.00",
"activeTab": "weizhifu"
}
]
}

View File

@ -69,7 +69,7 @@
</image>
<view class="upload-screenshot-text">长按替换截图</view>
</view>
<view v-else class="upload-screenshot-content">
<view v-else class="screenshot-preview-box">
<image class="screenshot-preview" :src="screenshotImage" mode="widthFix"></image>
</view>
<!-- <image v-else class="w100 h100" :src="screenshotImage" mode="widthFix"></image> -->
@ -112,7 +112,7 @@ import { ref, computed, onMounted, getCurrentInstance } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import ShoppingCard from '@/components/shopping/jingdong/shopping-card.vue';
import { util } from '@/utils/common.js';
import { shoppingType, waimaiType } from './json/order.json';
import { shoppingType, waimaiType, defaultDataList } from './json/order.json';
const showActionMenu = ref(false);
const actionMenuState = ref({ x: 0, y: 0, item: null });
@ -291,10 +291,27 @@ onMounted(() => {
});
onShow(() => {
//
const isInit = uni.getStorageSync('isInitJingdong');
if (!isInit) {
//
uni.setStorageSync('jingdongShopping', defaultDataList);
uni.setStorageSync('jingdong_screenshot', '/static/image/shopping/jingdong/cainixihuan.png');
uni.setStorageSync('isInitJingdong', true);
mockOrderList.value = defaultDataList;
} else {
// 使
const cachedData = uni.getStorageSync('jingdongShopping');
if (cachedData && Array.isArray(cachedData)) {
mockOrderList.value = cachedData;
} else {
mockOrderList.value = [];
}
}
console.log("订单列表", mockOrderList.value);
//
const cachedImage = uni.getStorageSync('jingdong_screenshot');
@ -303,8 +320,6 @@ onShow(() => {
}
console.log('screenshotImage.value', screenshotImage.value)
console.log("mockOrderList", mockOrderList.value);
});
// -
@ -675,229 +690,7 @@ const filteredOrderList = computed(() => {
/**
* 模拟订单列表
*/
const mockOrderList = ref([
// {
// id: 123211111,
// shopType: 'waimai',
// shopName: ' (AARYE) ...',
// status: '',
// statusDesc: '29',
// products: [
// {
// image: '/static/image/shopping/jingdong/product1.png',
// title: '',
// desc: '7退',
// service: "",
// price: '69.00',
// count: 1,
// }
// ],
// promoType: 'text',
// promoHighlight: '90600+',
// },
// {
// id: 9632554,
// shopType: 'waimai',
// shopName: ' (AARYE) ...',
// status: '',
// trackingTitle: '10:22-10:55',
// trackingDesc: '',
// trackingTime: '2026-03-10 15:14:30',
// products: [
// {
// image: '/static/image/shopping/jingdong/product1.png',
// title: ' ',
// desc: '7退',
// service: "",
// tags: [],
// price: '69.00',
// count: 1,
// }
// ]
// },
// {
// id: 63254112,
// shopType: 'waimai',
// shopName: ' (AARYE) ...',
// status: '',
// trackingTitle: '10:22-10:55',
// trackingDesc: '',
// trackingTime: '2026-03-10 15:14:30',
// products: [
// {
// image: '/static/image/shopping/jingdong/product1.png',
// title: ' ',
// desc: '7退',
// service: "",
// tags: [],
// price: '69.00',
// count: 1,
// }
// ]
// },
// {
// id: 78456211,
// shopType: 'waimai',
// shopName: '',
// status: '',
// statusColor: 'gray',
// products: [
// {
// image: '/static/image/shopping/jingdong/product1.png',
// title: '',
// desc: '7退',
// service: "",
// tags: [],
// price: '69.00',
// count: 1,
// }
// ],
// promoType: 'coupon',
// promoText: '3',
// promoAction: ''
// },
// {
// id: 56322115,
// shopType: 'waimai',
// shopName: '',
// status: '',
// statusColor: 'gray',
// products: [
// {
// image: '/static/image/shopping/jingdong/product1.png',
// },
// {
// image: '/static/image/shopping/jingdong/product1.png',
// },
// {
// image: '/static/image/shopping/jingdong/product1.png',
// }
// ],
// price: '17.00',
// count: 2,
// },
// {
// id: 52322221,
// shopType: 'waimai',
// shopName: '',
// status: '',
// statusColor: 'gray',
// products: [
// {
// image: '/static/image/shopping/jingdong/product1.png',
// title: '',
// desc: '7退',
// tags: [],
// service: "",
// price: '69.00',
// count: 1,
// }
// ]
// },
// {
// id: 8562245551,
// shopType: 'self',
// shopName: ' (AARYE) ',
// status: '',
// statusDesc: '2011',
// products: [
// {
// image: '/static/image/shopping/jingdong/product1.png',
// title: '',
// desc: '',
// tags: ['退'],
// service: "退",
// price: '69.00',
// count: 1,
// }
// ],
// promoType: 'text',
// promoHighlight: '0.5',
// },
// {
// id: 5504455,
// shopType: 'none',
// shopName: '',
// status: '',
// trackingTitle: '',
// trackingDesc: ' 31224:00 315 24:00 ',
// trackingTime: '2026-03-10 15:14:30',
// products: [
// {
// image: '/static/image/shopping/jingdong/product1.png',
// title: '',
// desc: '',
// tags: ['退'],
// service: "退",
// price: '69.00',
// count: 1,
// }
// ],
// promoType: 'plus',
// promoText: ', ',
// },
// {
// id: 585552,
// shopType: 'self',
// shopName: '',
// status: '',
// statusColor: 'gray',
// trackingTitle: '',
// trackingDesc: '~',
// trackingTime: '2026-03-10 15:14:30',
// products: [
// {
// image: '/static/image/shopping/jingdong/product1.png',
// title: '',
// desc: '',
// tags: ['退'],
// service: "退",
// price: '69.00',
// count: 1,
// }
// ],
// promoType: 'plus',
// promoText: ', ',
// hasMore: true,
// },
// {
// id: 4545451,
// shopType: 'jd',
// shopName: '',
// status: '',
// statusColor: 'gray',
// products: [
// {
// image: '/static/image/shopping/jingdong/product1.png',
// title: '',
// desc: '',
// tags: ['退'],
// service: "退",
// price: '1669.00',
// count: 1,
// }
// ],
// hasMore: true,
// },
// {
// id: 1236524,
// shopType: 'self',
// shopName: '',
// status: '',
// statusColor: 'gray',
// products: [
// {
// image: '/static/image/shopping/jingdong/product1.png',
// title: '',
// desc: '',
// tags: ['退'],
// service: "退",
// price: '1669.00',
// count: 1,
// }
// ]
// }
]);
const mockOrderList = ref([]);
</script>
<style lang="less">
@ -1156,6 +949,17 @@ const mockOrderList = ref([
margin-top: 16rpx;
}
}
.screenshot-preview-box {
width: 100%;
height: 100%;
display: flex;
align-items: flex-start;
// flex-direction: column;
justify-content: center;
.screenshot-preview {
width: 100%;
height: 100%;

View File

@ -108,8 +108,6 @@
<text class="desc">您的订单已取消请查看取消进度详情</text>
</view>
</view>
</view>
<view v-if="order.type == 'weizhifu'" class="card location-box flex flex-justify-between flex-align-center">
@ -295,8 +293,10 @@
</view>
<view class="wx-font-medium flex flex-align-center">
<text v-if="order.discountCarriage" style="color: #F10F1A;">已减{{ order.discountCarriage }}</text>
<text v-if="order.discountCarriage"
<text v-if="order.discountCarriage && Number(order.discountCarriage) > 0"
style="color: #F10F1A;">已减{{
order.discountCarriage }}</text>
<text v-if="order.discountCarriage && Number(order.discountCarriage) > 0"
style="margin: 0 12rpx;color: #8E8E8E;text-decoration: line-through;">{{
order.discountCarriage }}</text>
<text style="color: #1A1A1A;font-weight: 500;">{{ !Number(order.carriage) || Number(order.carriage)
@ -304,7 +304,7 @@
<uni-icons type="down" size="10" color="#1A1A1A" style="margin-left: 6rpx;"></uni-icons>
</view>
</view>
<view class="item flex-justify-between">
<view v-if="order.packagingFee && Number(order.packagingFee) > 0" class="item flex-justify-between">
<text class="label shrink-0" style="color: #545454;">打包费</text>
<view class="flex-1 flex-align-center wx-font-medium"
style="justify-content: flex-end; margin-left: 20rpx;font-weight: 500;">
@ -315,7 +315,7 @@
<text class="label shrink-0" style="color: #545454;">合计</text>
<view class="flex-1 flex-align-center"
style="justify-content: flex-end; margin-left: 20rpx;font-weight: 500;">
<text v-if="order.discount > 0 && order.discount" class=" red">共减{{
<text v-if="Number(order.discount) + Number(order.discountCarriage) > 0" class=" red">共减{{
Number(order.discount) + Number(order.discountCarriage)
}}</text>
<text class="wx-font-medium money">
@ -352,8 +352,9 @@
</view>
<view class="wx-font-medium flex flex-align-center">
<text v-if="order.discountCarriage" style="color: #F10F1A;">已减{{ order.discountCarriage }}</text>
<text v-if="order.discountCarriage"
<text v-if="order.discountCarriage && Number(order.discountCarriage) > 0" style="color: #F10F1A;">已减{{
order.discountCarriage }}</text>
<text v-if="order.discountCarriage && Number(order.discountCarriage) > 0"
style="margin: 0 12rpx;color: #8E8E8E;text-decoration: line-through;">{{
order.discountCarriage }}</text>
<text style="color: #1A1A1A;">{{ !Number(order.carriage) || Number(order.carriage) <= 0 ? '免运费' : '运费¥'
@ -364,7 +365,10 @@
<view class="price">
<view class="label">合计</view>
<view>
共减<text class="number wx-font-medium" style="font-size: 32rpx;">{{ order.discount }}</text>
<text v-if="Number(order.discount) + Number(order.discountCarriage) > 0" class="number wx-font-medium"
style="font-size: 32rpx;">共减{{
Number(order.discount) + Number(order.discountCarriage)
}}</text>
需付款 <text class="number wx-font-medium">
{{ (Number(order.totalPrice) + Number(order.carriage)) ?
(Number(order.totalPrice)
@ -474,7 +478,7 @@
<script setup>
import { onLoad, onShow, onPageScroll } from "@dcloudio/uni-app";
import { ref, computed, watch, onMounted, onUnmounted, nextTick, reactive, toRefs } from "vue";
import { ref, computed, onUnmounted, nextTick, reactive, toRefs } from "vue";
import NavBar from "@/components/nav-bar/nav-bar.vue";
import { util } from '@/utils/common.js';
@ -1079,7 +1083,7 @@ page {
font-size: 26rpx;
color: #1A1A1A;
line-height: 28rpx;
font-weight: 700;
font-weight: 500;
}
.desc {

View File

@ -0,0 +1,18 @@
<template>
<view class="container">
<view v-for="item in mockOrderList" :key="item.id">
{{ item.name }}
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
/**
* 模拟订单列表
*/
const mockOrderList = ref([]);
</script>
<style lang="less"></style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

View File

@ -4,6 +4,22 @@
* 日期处理相关方法
*/
export const dateUtil = {
/**
* 安全解析日期兼容 iOS
* @param {Date|string|number} date
* @returns {Date}
*/
parseSafe(date) {
if (!date) return new Date();
if (date instanceof Date) return date;
if (typeof date === 'string') {
// 兼容 iOS 的 YYYY-MM-DD 解析,并处理可能的空格/T问题
const normalizedDate = date.replace(/-/g, '/');
return new Date(normalizedDate);
}
return new Date(date);
},
/**
* 格式化日期
* @param {Date|string|number} date - 日期对象或时间戳
@ -13,9 +29,7 @@ export const dateUtil = {
format(date, format = 'YYYY-MM-DD HH:mm:ss') {
if (!date) return '';
if (typeof date === 'string' || typeof date === 'number') {
date = new Date(date);
}
date = this.parseSafe(date);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
@ -50,9 +64,7 @@ export const dateUtil = {
relative(date) {
if (!date) return '';
if (typeof date === 'string' || typeof date === 'number') {
date = new Date(date);
}
date = this.parseSafe(date);
const now = new Date();
const diff = now - date;
@ -80,9 +92,7 @@ export const dateUtil = {
smart(date) {
if (!date) return '';
if (typeof date === 'string' || typeof date === 'number') {
date = new Date(date);
}
date = this.parseSafe(date);
const now = new Date();
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
@ -120,13 +130,7 @@ export const dateUtil = {
formatMessageTime(date, hideCurrentYear = false, format = 'YYYY/M/D') {
if (!date) return '';
if (typeof date === 'string' || typeof date === 'number') {
// 兼容 iOS 的 YYYY-MM-DD 解析
if (typeof date === 'string') {
date = date.replace(/-/g, '/');
}
date = new Date(date);
}
date = this.parseSafe(date);
const now = new Date();
// 将时分秒抹零,只取日期部分进行比对
@ -464,7 +468,7 @@ export const util = {
* @param {string} backgroundColor - 颜色值
* @returns {void}
*/
setAndroidSystemBarColor(backgroundColor, frontColor = "#000000") {
setAndroidSystemBarColor(backgroundColor) {
// 使用同步方式判断或直接通过编译宏/plus判断
const isAndroid = uni.getSystemInfoSync().platform === 'android';
if (isAndroid) {
@ -555,14 +559,14 @@ export const randomUtil = {
randomTime(startTime, endTime, format = 'YYYY-MM-DD HH:mm:ss') {
let end;
if (endTime) {
end = new Date(endTime).getTime();
end = dateUtil.parseSafe(endTime).getTime();
} else {
end = Date.now();
}
let start;
if (startTime) {
start = new Date(startTime).getTime();
start = dateUtil.parseSafe(startTime).getTime();
} else {
// 默认为结束时间往前推3个月
const date = new Date(end);