Merge branch 'Branch_1' of https://git.u8t.cn/tangxinyue/alipay-emulator into Branch_1
|
|
@ -4,7 +4,7 @@
|
|||
<view class="nav-bar-box" :class="{ 'border-nav-bar-box': isScroll }">
|
||||
<NavBar :isBack="false" :bgColor="isScroll ? data.navBar.bgColor : '#fff'" :buttonGroup="buttonGroup"
|
||||
@button-click="util.clickTitlePopupButton" tipLayerType="message-list-tip" isTipLayer
|
||||
tipLayerText="添加短信" @add="emit('add')">
|
||||
isClickNavBarOpenPopup tipLayerText="添加短信" @add="emit('add')">
|
||||
<!-- 左侧文字图标 -->
|
||||
<template v-slot:left>
|
||||
<view v-if="phone == 'iphone'" class="flex flex-align-center">
|
||||
|
|
@ -125,6 +125,10 @@ const props = defineProps({
|
|||
isScroll: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
noticeCount: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -158,7 +162,8 @@ const data = reactive({
|
|||
navBar: {
|
||||
title: '信息',
|
||||
bgColor: '#FFFFFF',
|
||||
}
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
// 展示文字信息
|
||||
|
|
@ -185,7 +190,7 @@ const showInfo = computed(() => {
|
|||
case "huawei":
|
||||
text = "信息"
|
||||
placeholder = '搜索信息'
|
||||
secondText = "388 条未读"
|
||||
secondText = props.noticeCount > 0 ? `${props.noticeCount} 条未读` : ''
|
||||
break;
|
||||
case "vivo":
|
||||
placeholder = '搜索信息'
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<uni-nav-bar backgroundColor="#00000000" class="nav-bar" :border="false" :title="title" v-bind="$attrs"
|
||||
v-on="$attrs">
|
||||
<template v-slot:left>
|
||||
<view class="nav-bar-left">
|
||||
<view class="nav-bar-left" @click.stop="isClickNavBarOpenPopup ? openPopup() : ''">
|
||||
<slot name="left">
|
||||
<view v-if="isBack" class="left-icon" @click.stop="onBack">
|
||||
<image class="nav-icon-back"
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
</slot>
|
||||
</view>
|
||||
<template v-slot:right>
|
||||
<view class="nav-bar-right" @click.stop="onRightClick">
|
||||
<view class="nav-bar-right" @click.stop="isClickNavBarOpenPopup ? openPopup() : onRightClick()">
|
||||
<slot name="right">
|
||||
<view v-if="isRightIcon" class="right-icon">
|
||||
<image class="nav-icon-more"
|
||||
|
|
@ -145,6 +145,10 @@ const props = defineProps({
|
|||
tipLayerType: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
isClickNavBarOpenPopup: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@
|
|||
<view v-if="item.status === '等待付款'" class="status-warning">
|
||||
<image style="width: 116rpx;height: 30rpx;" src="/static/image/shopping/jingdong/dengdaifukuan.png">
|
||||
</image>
|
||||
<text class="status-desc" v-if="item.statusDesc">{{ formatStatusDesc(item.statusDesc) }}</text>
|
||||
<text class="status-desc" v-if="item.statusDesc">{{
|
||||
item.shopType != 'waimai' ? formatStatusDesc(item.statusDesc) :
|
||||
formatWaimaiStatusDesc(item.statusDesc) }}</text>
|
||||
</view>
|
||||
<text v-else class="status-text"
|
||||
:class="{ red: item.statusColor === 'red' || item.status === '正在出库' || item.status === '商家备餐中' || item.status === '骑手到店取餐中' || item.status === '骑手已到店' }">{{
|
||||
|
|
@ -87,7 +89,11 @@
|
|||
<view class="product-price-box">
|
||||
<view class="price-wrap wx-font-regular">
|
||||
<text class="price-symbol">¥</text>
|
||||
<text class="price-num">{{ safeFormatPrice(item) }}</text>
|
||||
<text class="price-num">{{ item.shopType === 'waimai' ?
|
||||
(item.totalPrice ? Number(item.totalPrice).toFixed(2) : '0.00')
|
||||
:
|
||||
safeFormatPrice(item)
|
||||
}}</text>
|
||||
</view>
|
||||
<text class="product-count"
|
||||
v-if="item.count || (item.products && item.products[0] && item.products[0].count)">共{{
|
||||
|
|
@ -161,6 +167,21 @@ const onLongPress = (e) => {
|
|||
emit('longpress', { event: e, item: props.item });
|
||||
};
|
||||
|
||||
const formatWaimaiStatusDesc = (desc) => {
|
||||
if (!desc || !desc.includes(':')) return desc;
|
||||
const parts = desc.split(':');
|
||||
if (parts.length === 2) {
|
||||
const m = parseInt(parts[0]) || 0;
|
||||
const s = parseInt(parts[1]) || 0;
|
||||
if (m > 0) {
|
||||
return `${m}分钟`;
|
||||
} else {
|
||||
return `${s}秒`;
|
||||
}
|
||||
}
|
||||
return desc;
|
||||
};
|
||||
|
||||
const formatStatusDesc = (desc) => {
|
||||
if (!desc || !desc.includes(' : ')) return desc;
|
||||
const parts = desc.split(' : ');
|
||||
|
|
|
|||
2
main.js
|
|
@ -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.sp3')
|
||||
uni.setStorageSync('version', '1.0.4.sp5')
|
||||
app.config.globalProperties.$version = uni.getStorageSync('version')
|
||||
app.use(globalMethods);
|
||||
return {
|
||||
|
|
|
|||
14
pages.json
|
|
@ -66,6 +66,20 @@
|
|||
"navigationBarTitleText": "添加订单",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "jingdong/add-waimai/add-waimai",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加外卖订单页面",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "jingdong/waimai-order-detail/waimai-order-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "外卖订单详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -515,11 +515,12 @@ const onMenuScroll = (e) => {
|
|||
}
|
||||
|
||||
.nav-text {
|
||||
font-size: 18px;
|
||||
font-size: 36rpx;
|
||||
margin-right: 4px;
|
||||
color: #FFFFFF;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
::v-deep .uni-navbar__header-btns-left {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
</view>
|
||||
<view>
|
||||
<MessageNavBar :phone="data.phone" :isScroll="data.isScroll" @add="openAddPopup" @setSim="setSim"
|
||||
@setNoticeCount="setNoticeCount">
|
||||
:noticeCount="allNoticeCount" @setNoticeCount="setNoticeCount">
|
||||
<view v-if="data.phone == 'huawei'" class="huawei-notice">
|
||||
<view class="img-box">
|
||||
<image class="img" src="/static/image/phone-message/huawei/notice.png" mode="aspectFill"></image>
|
||||
|
|
@ -134,7 +134,8 @@ import MessageList from '@/components/message/list/list.vue'
|
|||
import defaultData from './defaultData.json'
|
||||
import {
|
||||
ref,
|
||||
reactive
|
||||
reactive,
|
||||
computed
|
||||
} from 'vue'
|
||||
import {
|
||||
onLoad,
|
||||
|
|
@ -170,6 +171,16 @@ const STORAGE_KEY = 'message_list'
|
|||
const SIM_STORAGE_KEY = 'sim_info'
|
||||
const NOTICE_COUNT_KEY = 'huawei_notice_count'
|
||||
|
||||
const allNoticeCount = computed(() => {
|
||||
let count = 0
|
||||
defaultList.value.forEach(element => {
|
||||
if (element.unRead) {
|
||||
count += element.unReadNumber
|
||||
}
|
||||
});
|
||||
return Number(data.noticeCount) + Number(count)
|
||||
})
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.phone) {
|
||||
data.phone = options.phone
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<template>
|
||||
<template>
|
||||
<!-- 水印 -->
|
||||
<view v-if="$isVip()">
|
||||
<watermark dark="light" />
|
||||
|
|
@ -64,39 +64,43 @@
|
|||
<view class="control-buttons">
|
||||
<!-- 麦克风 -->
|
||||
<view class="control-item">
|
||||
<view class="control-btn" :class="{ active: videoData.micOn }" @click="changeInfo('micOn')">
|
||||
<image class="control-icon"
|
||||
<image class="control-btn" :class="{ active: videoData.micOn }" @click="changeInfo('micOn')"
|
||||
:src="videoData.micOn ? '/static/image/other/video-call/mic-on.png' : '/static/image/other/video-call/mic-off.png'">
|
||||
</image>
|
||||
</view>
|
||||
<!-- <view class="" :class="{ active: videoData.micOn }" >
|
||||
|
||||
</view> -->
|
||||
<text class="control-label">{{ videoData.micOn ? '麦克风已开' : '麦克风已关' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 扬声器 -->
|
||||
<view class="control-item">
|
||||
<view class="control-btn" :class="{ active: videoData.speakerOn }" @click="changeInfo('speakerOn')">
|
||||
<image class="control-icon"
|
||||
<image class="control-btn" :class="{ active: videoData.speakerOn }" @click="changeInfo('speakerOn')"
|
||||
:src="videoData.speakerOn ? '/static/image/other/video-call/speaker-on.png' : '/static/image/other/video-call/speaker-off.png'">
|
||||
</image>
|
||||
</view>
|
||||
<!-- <view class="" :class="{ active: videoData.speakerOn }" @click="changeInfo('speakerOn')">
|
||||
|
||||
</view> -->
|
||||
<text class="control-label">{{ videoData.speakerOn ? '扬声器已开' : '扬声器已关' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 摄像头 -->
|
||||
<view class="control-item">
|
||||
<view class="control-btn" :class="{ active: videoData.cameraOn }" @click="changeInfo('cameraOn')">
|
||||
<image class="control-icon"
|
||||
<image class="control-btn" :class="{ active: videoData.cameraOn }" @click="changeInfo('cameraOn')"
|
||||
:src="videoData.cameraOn ? '/static/image/other/video-call/camera-on.png' : '/static/image/other/video-call/camera-off.png'">
|
||||
</image>
|
||||
</view>
|
||||
<!-- <view class="control-btn" :class="{ active: videoData.cameraOn }" @click="changeInfo('cameraOn')">
|
||||
|
||||
</view> -->
|
||||
<text class="control-label">{{ videoData.cameraOn ? '摄像头已开' : '摄像头已关' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 挂断按钮 -->
|
||||
<view class="hangup-btn" @click="hangup">
|
||||
<image class="hangup-icon" src="/static/image/other/video-call/hangup.png"></image>
|
||||
</view>
|
||||
<image class="hangup-btn" @click="hangup" src="/static/image/other/video-call/hangup.png"></image>
|
||||
<!-- <view class="hangup-btn" @click="hangup">
|
||||
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,22 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, getCurrentInstance } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.phone) {
|
||||
data.phone = options.phone
|
||||
}
|
||||
proxy.$apiUserEvent('all', {
|
||||
type: 'event',
|
||||
key: 'shopping',
|
||||
prefix: '.uni.other.',
|
||||
value: '购物'
|
||||
})
|
||||
})
|
||||
|
||||
const menuList = ref([
|
||||
{
|
||||
|
|
|
|||
|
|
@ -395,5 +395,353 @@
|
|||
"label": "已取消",
|
||||
"key": "yiquxiao"
|
||||
}
|
||||
],
|
||||
"waimaiClassfiy": {
|
||||
"weizhifu": {
|
||||
"id": "123211111",
|
||||
"type": "weizhifu",
|
||||
"shopType": "waimai",
|
||||
"shopName": "",
|
||||
"status": "等待付款",
|
||||
"statusDesc": "",
|
||||
"deliveryTime": "11:17-11:32",
|
||||
"address": "",
|
||||
"phone": "",
|
||||
"consignee": "",
|
||||
"discountCarriage": "",
|
||||
"carriage": "",
|
||||
"packagingFee": "",
|
||||
"recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png",
|
||||
"discount": "0.00",
|
||||
"amountTo": "",
|
||||
"products": [
|
||||
{
|
||||
"image": "",
|
||||
"title": "",
|
||||
"desc": "一人份",
|
||||
"price": "",
|
||||
"count": "1"
|
||||
}
|
||||
],
|
||||
"productsInfo": {
|
||||
"cutleryCount": "商家按餐量提供",
|
||||
"deliveryPreference": "允许敲门/按门铃;允许发短信",
|
||||
"outOfStock": "缺货时与我电话沟通"
|
||||
},
|
||||
"orderInfo": [
|
||||
{
|
||||
"label": "订单编号",
|
||||
"key": "orderNumber",
|
||||
"value": "",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"label": "交易快照",
|
||||
"key": "transactionSnapshot",
|
||||
"value": "发生交易争执时,可作为判断依据"
|
||||
},
|
||||
{
|
||||
"label": "支付方式",
|
||||
"key": "paymentMethod",
|
||||
"value": "微信支付",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"label": "下单时间",
|
||||
"key": "orderTime",
|
||||
"value": "",
|
||||
"type": "time"
|
||||
}
|
||||
],
|
||||
"promoType": "text",
|
||||
"promoHighlight": "近90天600+人回购"
|
||||
},
|
||||
"beicanzhong": {
|
||||
"id": 9632554,
|
||||
"shopType": "waimai",
|
||||
"type": "beicanzhong",
|
||||
"statusColor": "red",
|
||||
"shopName": "",
|
||||
"status": "商家备餐中",
|
||||
"trackingTitle": "10: 22-10: 55",
|
||||
"trackingDesc": "骑手到店取餐中",
|
||||
"trackingTime": "2026-03-10 15: 14: 30",
|
||||
"deliveryImages": "",
|
||||
"discountCarriage": "",
|
||||
"discount": "0.00",
|
||||
"carriage": "",
|
||||
"packagingFee": "",
|
||||
"recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png",
|
||||
"amountTo": "",
|
||||
"products": [
|
||||
{
|
||||
"image": "",
|
||||
"title": "",
|
||||
"desc": "一人份",
|
||||
"price": "",
|
||||
"count": "1"
|
||||
}
|
||||
],
|
||||
"productsInfo": {
|
||||
"cutleryCount": "商家按餐量提供",
|
||||
"deliveryPreference": "允许敲门/按门铃;允许发短信",
|
||||
"outOfStock": "缺货时与我电话沟通"
|
||||
},
|
||||
"orderInfo": [
|
||||
{
|
||||
"label": "订单编号",
|
||||
"key": "orderNumber",
|
||||
"value": "",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"label": "交易快照",
|
||||
"key": "transactionSnapshot",
|
||||
"value": "发生交易争执时,可作为判断依据"
|
||||
},
|
||||
{
|
||||
"label": "下单时间",
|
||||
"key": "orderTime",
|
||||
"value": "",
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"label": "支付时间",
|
||||
"key": "paymentTime",
|
||||
"value": "",
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"label": "支付方式",
|
||||
"key": "paymentMethod",
|
||||
"value": "微信支付",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"label": "如遇缺货",
|
||||
"key": "outOfStock",
|
||||
"value": "缺货时与我电话沟通",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"qvcanzhong": {
|
||||
"id": "63254112",
|
||||
"shopType": "waimai",
|
||||
"type": "qvcanzhong",
|
||||
"shopName": "安野屋 (AARYE) 京...",
|
||||
"status": "骑手到店取餐中",
|
||||
"statusColor": "red",
|
||||
"trackingTitle": "10: 22-10: 55",
|
||||
"trackingDesc": "骑手已到店,大王",
|
||||
"trackingTime": "2026-03-10 15: 14: 30",
|
||||
"recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png",
|
||||
"deliveryImages": "",
|
||||
"discountCarriage": "",
|
||||
"carriage": "",
|
||||
"packagingFee": "",
|
||||
"discount": "0.00",
|
||||
"amountTo": "",
|
||||
"products": [
|
||||
{
|
||||
"image": "/static/image/shopping/jingdong/product1.png",
|
||||
"title": "超值哈哈哈哈哈哈哈哈哈哈哈哈哈哈好热 少糖",
|
||||
"desc": "不支持7天无理由退货",
|
||||
"service": "",
|
||||
"tags": [],
|
||||
"price": "69.00",
|
||||
"count": "1"
|
||||
}
|
||||
],
|
||||
"productsInfo": {
|
||||
"cutleryCount": "商家按餐量提供",
|
||||
"deliveryPreference": "允许敲门/按门铃;允许发短信",
|
||||
"outOfStock": "缺货时与我电话沟通"
|
||||
},
|
||||
"orderInfo": [
|
||||
{
|
||||
"label": "订单编号",
|
||||
"key": "orderNumber",
|
||||
"value": "",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"label": "交易快照",
|
||||
"key": "transactionSnapshot",
|
||||
"value": "发生交易争执时,可作为判断依据"
|
||||
},
|
||||
{
|
||||
"label": "下单时间",
|
||||
"key": "orderTime",
|
||||
"value": "",
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"label": "支付时间",
|
||||
"key": "paymentTime",
|
||||
"value": "",
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"label": "送达时间",
|
||||
"key": "paymentMethod",
|
||||
"value": "微信支付",
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"label": "如遇缺货",
|
||||
"key": "outOfStock",
|
||||
"value": "缺货时与我电话沟通",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"yiwancheng": {
|
||||
"id": 78456211,
|
||||
"shopType": "waimai",
|
||||
"type": "yiwancheng",
|
||||
"shopName": "瑞幸咖啡",
|
||||
"status": "完成",
|
||||
"statusColor": "gray",
|
||||
"recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png",
|
||||
"packagingFee": "",
|
||||
"discountCarriage": "",
|
||||
"carriage": "",
|
||||
"discount": "0.00",
|
||||
"amountTo": "",
|
||||
"products": [
|
||||
{
|
||||
"image": "/static/image/shopping/jingdong/product1.png",
|
||||
"title": "多肉桃桃哈哈哈哈哈哈哈哈哈哈好和和好",
|
||||
"desc": "不支持7天无理由退货",
|
||||
"service": "",
|
||||
"tags": [],
|
||||
"price": "69.00",
|
||||
"count": "1"
|
||||
}
|
||||
],
|
||||
"productsInfo": {
|
||||
"cutleryCount": "商家按餐量提供",
|
||||
"deliveryPreference": "允许敲门/按门铃;允许发短信",
|
||||
"outOfStock": "缺货时与我电话沟通"
|
||||
},
|
||||
"orderInfo": [
|
||||
{
|
||||
"label": "订单编号",
|
||||
"key": "orderNumber",
|
||||
"value": "",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"label": "交易快照",
|
||||
"key": "transactionSnapshot",
|
||||
"value": "发生交易争执时,可作为判断依据"
|
||||
},
|
||||
{
|
||||
"label": "下单时间",
|
||||
"key": "orderTime",
|
||||
"value": "",
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"label": "支付时间",
|
||||
"key": "paymentTime",
|
||||
"value": "",
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"label": "支付方式",
|
||||
"key": "paymentMethod",
|
||||
"value": "微信支付",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"label": "如遇缺货",
|
||||
"key": "outOfStock",
|
||||
"value": "缺货时与我电话沟通",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"promoType": "coupon",
|
||||
"promoText": "恭喜您获得3元京东购物券",
|
||||
"promoAction": "去领券"
|
||||
},
|
||||
"yiquxiao": {
|
||||
"id": "52322221",
|
||||
"shopType": "waimai",
|
||||
"type": "yiquxiao",
|
||||
"shopName": "瑞幸咖啡",
|
||||
"status": "已取消",
|
||||
"statusColor": "gray",
|
||||
"recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png",
|
||||
"packagingFee": "",
|
||||
"discountCarriage": "",
|
||||
"discount": "0.00",
|
||||
"carriage": "",
|
||||
"amountTo": "",
|
||||
"products": [
|
||||
{
|
||||
"image": "/static/image/shopping/jingdong/product1.png",
|
||||
"title": "多肉桃桃哈哈哈哈哈哈哈哈哈哈好和和好",
|
||||
"desc": "不支持7天无理由退货",
|
||||
"tags": [],
|
||||
"service": "",
|
||||
"price": "69.00",
|
||||
"count": "1"
|
||||
}
|
||||
],
|
||||
"productsInfo": {
|
||||
"cutleryCount": "商家按餐量提供",
|
||||
"deliveryPreference": "允许敲门/按门铃;允许发短信",
|
||||
"outOfStock": "缺货时与我电话沟通"
|
||||
},
|
||||
"orderInfo": [
|
||||
{
|
||||
"label": "订单编号",
|
||||
"key": "orderNumber",
|
||||
"value": "",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"label": "交易快照",
|
||||
"key": "transactionSnapshot",
|
||||
"value": "发生交易争执时,可作为判断依据"
|
||||
},
|
||||
{
|
||||
"label": "下单时间",
|
||||
"key": "orderTime",
|
||||
"value": "",
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"label": "支付时间",
|
||||
"key": "paymentTime",
|
||||
"value": "",
|
||||
"type": "time"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"waimaiType": [
|
||||
{
|
||||
"label": "未支付",
|
||||
"key": "weizhifu"
|
||||
},
|
||||
{
|
||||
"label": "备餐中",
|
||||
"key": "beicanzhong"
|
||||
},
|
||||
{
|
||||
"label": "取餐中",
|
||||
"key": "qvcanzhong"
|
||||
},
|
||||
{
|
||||
"label": "已完成",
|
||||
"key": "yiwancheng"
|
||||
},
|
||||
{
|
||||
"label": "取消",
|
||||
"key": "yiquxiao"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
<template>
|
||||
<view class="top-fixed">
|
||||
<nav-bar title="京东" bgColor="#F0F4F9" :buttonGroup="buttonGroup" @button-click="util.clickTitlePopupButton">
|
||||
<nav-bar v-if="!selectedImage" title="京东" bgColor="#F0F4F9" :buttonGroup="buttonGroup"
|
||||
@button-click="util.clickTitlePopupButton" tipLayerType="jingdong-shopping-list" isTipLayer
|
||||
tipLayerText="添加订单信息">
|
||||
<template v-slot:center>
|
||||
<view class="search-box">
|
||||
<image class="search-icon" src="/static/image/shopping/jingdong/search-icon.png" mode="aspectFit">
|
||||
|
|
@ -17,6 +19,9 @@
|
|||
</view>
|
||||
</template>
|
||||
</nav-bar>
|
||||
<nav-bar v-else title="拼图" bgColor="#EFEFEF" noBack @back="closeImage" isRightButton
|
||||
@right-click="confirmImage">
|
||||
</nav-bar>
|
||||
<view class="tab-list">
|
||||
<view class="tab-item" v-for="(item, index) in tabList" :key="index"
|
||||
:class="{ active: currentTab === index }" @click="switchTab(index)">
|
||||
|
|
@ -32,7 +37,8 @@
|
|||
:class="{ active: currentFilter === index, disabled: item.disabled }"
|
||||
@click="switchFilter(index)">
|
||||
<text class="text">{{ item.name }}</text>
|
||||
<text class="close-icon" v-if="currentFilter === index">×</text>
|
||||
<text class="close-icon" :style="{ marginTop: $system == 'iOS' ? '-4rpx' : '-2rpx' }"
|
||||
v-if="currentFilter === index">×</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
|
@ -55,13 +61,30 @@
|
|||
<image class="like-icon" src="/static/image/shopping/jingdong/weinituijian.png" mode="aspectFit"></image>
|
||||
<text>为你推荐</text>
|
||||
</view>
|
||||
<view class="upload-screenshot-box">
|
||||
<view class="upload-screenshot-content">
|
||||
|
||||
<view v-if="!selectedImage" class="upload-screenshot-box" @touchstart="handleTouchStart"
|
||||
@touchend="handleTouchEnd">
|
||||
<view v-if="!screenshotImage" class="upload-screenshot-content">
|
||||
<image class="upload-screenshot" src="/static/image/common/upload-screenshot.png" mode="aspectFit">
|
||||
</image>
|
||||
<view class="upload-screenshot-text">长按替换截图</view>
|
||||
</view>
|
||||
<view v-else class="upload-screenshot-content">
|
||||
<image class="screenshot-preview" :src="screenshotImage" mode="widthFix"></image>
|
||||
</view>
|
||||
<!-- <image v-else class="w100 h100" :src="screenshotImage" mode="widthFix"></image> -->
|
||||
</view>
|
||||
<view v-else class="upload-screenshot-box scroll-image-box">
|
||||
<scroll-view class="image-box" style="width: 100%;height: 100%;" scroll-y :show-scrollbar="false"
|
||||
@scroll="onImageScroll">
|
||||
<image class="crop-image-target" style="width:100%;" :src="selectedImage" mode="widthFix"></image>
|
||||
</scroll-view>
|
||||
<view class="dashed-line-box">
|
||||
<view class="dashed-line-text">我是分割线</view>
|
||||
</view>
|
||||
</view>
|
||||
<canvas canvas-id="crop-canvas"
|
||||
style="position: fixed; left: -9999px; width: 750rpx; height: 100vh; pointer-events: none;"></canvas>
|
||||
</view>
|
||||
|
||||
<!-- 长按操作气泡菜单 -->
|
||||
|
|
@ -74,6 +97,14 @@
|
|||
<view class="bubble-arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 水印 -->
|
||||
<view v-if="$isVip()">
|
||||
<watermark dark="light" />
|
||||
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark')">
|
||||
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie>
|
||||
</liu-drag-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
@ -81,10 +112,17 @@ 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';
|
||||
|
||||
const showActionMenu = ref(false);
|
||||
const actionMenuState = ref({ x: 0, y: 0, item: null });
|
||||
|
||||
// 长按替换截图相关
|
||||
const screenshotImage = ref('');
|
||||
const selectedImage = ref('');
|
||||
const scrollTop = ref(0);
|
||||
let longPressTimer = null;
|
||||
|
||||
//导航栏菜单按钮
|
||||
const buttonGroup = [
|
||||
{
|
||||
|
|
@ -97,9 +135,12 @@ const buttonGroup = [
|
|||
}, {
|
||||
name: "新增秒送订单",
|
||||
click: () => {
|
||||
uni.showToast({
|
||||
title: '开发中,敬请期待',
|
||||
icon: 'none'
|
||||
// uni.showToast({
|
||||
// title: '开发中,敬请期待',
|
||||
// icon: 'none'
|
||||
// });
|
||||
uni.navigateTo({
|
||||
url: '/pages/shopping/jingdong/add-waimai/add-waimai'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
@ -146,9 +187,15 @@ const editOrder = () => {
|
|||
const item = actionMenuState.value.item;
|
||||
if (!item) return;
|
||||
showActionMenu.value = false;
|
||||
if (item.shopType == 'waimai') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/shopping/jingdong/add-waimai/add-waimai?id=' + item.id + '&type=' + item.shopType + '&isEdit=true'
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/shopping/jingdong/add-order/add-order?id=' + item.id + '&type=' + item.shopType + '&isEdit=true'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -161,7 +208,9 @@ const handleCardClick = (item) => {
|
|||
url: '/pages/shopping/jingdong/order-detail/order-detail?id=' + item.id
|
||||
});
|
||||
} else {
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/shopping/jingdong/waimai-order-detail/waimai-order-detail?id=' + item.id
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -172,23 +221,35 @@ const handleCardClick = (item) => {
|
|||
*/
|
||||
const handleDeleteOrder = () => {
|
||||
const itemToDel = actionMenuState.value.item;
|
||||
if (!itemToDel) return;
|
||||
|
||||
// 1. 尝试删除本地持久化图片文件 (商品图 + 快递员头像)
|
||||
const productImage = itemToDel?.products?.[0]?.image;
|
||||
const courierImage = itemToDel?.courierImg;
|
||||
// 1. 全量扫描并清理本地持久化图片文件
|
||||
const pathsToCleanup = [];
|
||||
|
||||
// 收集单字段路径
|
||||
if (itemToDel.courierImg) pathsToCleanup.push(itemToDel.courierImg);
|
||||
if (itemToDel.deliveryImages) pathsToCleanup.push(itemToDel.deliveryImages);
|
||||
if (itemToDel.recommendImg) pathsToCleanup.push(itemToDel.recommendImg);
|
||||
|
||||
// 收集商品列表路径
|
||||
if (itemToDel.products && Array.isArray(itemToDel.products)) {
|
||||
itemToDel.products.forEach(p => {
|
||||
if (p.image) pathsToCleanup.push(p.image);
|
||||
});
|
||||
}
|
||||
|
||||
const cleanupFile = (path) => {
|
||||
// 仅清理持久化沙盒路径,不处理静态资源
|
||||
if (path && (path.includes('_doc/') || path.includes('_downloads/') || path.includes('store_') || path.includes('at_'))) {
|
||||
uni.removeSavedFile({
|
||||
filePath: path,
|
||||
success: () => console.log('文件删除成功:', path),
|
||||
fail: (err) => console.error('文件删除失败:', err)
|
||||
success: () => console.log('物理文件清理成功:', path),
|
||||
fail: (err) => console.log('物理文件清理跳过或失败:', err)
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
cleanupFile(productImage);
|
||||
cleanupFile(courierImage);
|
||||
pathsToCleanup.forEach(path => cleanupFile(path));
|
||||
|
||||
// 2. 从列表中移除数据
|
||||
const realIndex = mockOrderList.value.findIndex(item => item === itemToDel);
|
||||
|
|
@ -235,9 +296,243 @@ onShow(() => {
|
|||
mockOrderList.value = cachedData;
|
||||
}
|
||||
|
||||
// 读取缓存的截图
|
||||
const cachedImage = uni.getStorageSync('jingdong_screenshot');
|
||||
if (cachedImage) {
|
||||
screenshotImage.value = cachedImage;
|
||||
}
|
||||
|
||||
console.log('screenshotImage.value', screenshotImage.value)
|
||||
|
||||
console.log("mockOrderList", mockOrderList.value);
|
||||
});
|
||||
|
||||
// 长按替换截图 - 选择图片
|
||||
const chooseImage = () => {
|
||||
if (selectedImage.value) return;
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sourceType: ['album'],
|
||||
success: (res) => {
|
||||
selectedImage.value = res.tempFilePaths[0];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 长按事件
|
||||
const handleTouchStart = (e) => {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
if (systemInfo.platform === 'ios' && systemInfo.safeAreaInsets?.bottom) {
|
||||
const clientY = e.touches[0].clientY;
|
||||
const windowHeight = systemInfo.windowHeight;
|
||||
if (clientY > windowHeight - systemInfo.safeAreaInsets.bottom) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
longPressTimer = setTimeout(() => {
|
||||
uni.vibrateShort();
|
||||
chooseImage();
|
||||
}, 1200);
|
||||
};
|
||||
|
||||
const handleTouchEnd = () => {
|
||||
if (longPressTimer) {
|
||||
clearTimeout(longPressTimer);
|
||||
longPressTimer = null;
|
||||
}
|
||||
};
|
||||
|
||||
// 图片滚动
|
||||
const onImageScroll = (e) => {
|
||||
scrollTop.value = e.detail.scrollTop;
|
||||
};
|
||||
|
||||
// 确认裁剪截图
|
||||
//const confirmImage = () => {
|
||||
// uni.showLoading({ title: '处理中...' });
|
||||
// const query = uni.createSelectorQuery().in(instance.proxy);
|
||||
// query.select('.image-box').boundingClientRect();
|
||||
// query.select('.crop-image-target').boundingClientRect();
|
||||
// query.exec(res => {
|
||||
// if (!res[0] || !res[1]) {
|
||||
// uni.hideLoading();
|
||||
// return;
|
||||
// }
|
||||
// const container = res[0];
|
||||
// const image = res[1];
|
||||
//
|
||||
// uni.getImageInfo({
|
||||
// src: selectedImage.value,
|
||||
// success: (imgInfo) => {
|
||||
// const scale = imgInfo.width / image.width;
|
||||
// const sTop = scrollTop.value * scale;
|
||||
// const sHeight = container.height * scale;
|
||||
// const sWidth = imgInfo.width;
|
||||
// const canvasW = container.width;
|
||||
// const canvasH = container.height;
|
||||
//
|
||||
// const ctx = uni.createCanvasContext('crop-canvas', instance.proxy);
|
||||
// ctx.clearRect(0, 0, canvasW, canvasH);
|
||||
// ctx.drawImage(
|
||||
// imgInfo.path,
|
||||
// 0, sTop, sWidth, sHeight,
|
||||
// 0, 0, canvasW, canvasH
|
||||
// );
|
||||
// ctx.draw(false, () => {
|
||||
// uni.canvasToTempFilePath({
|
||||
// canvasId: 'crop-canvas',
|
||||
// width: canvasW,
|
||||
// height: canvasH,
|
||||
// destWidth: sWidth,
|
||||
// destHeight: sHeight,
|
||||
// success: (res) => {
|
||||
// uni.saveFile({
|
||||
// tempFilePath: res.tempFilePath,
|
||||
// success: (saveRes) => {
|
||||
// screenshotImage.value = saveRes.savedFilePath;
|
||||
// selectedImage.value = '';
|
||||
// uni.setStorageSync('jingdong_screenshot', saveRes.savedFilePath);
|
||||
// uni.hideLoading();
|
||||
// uni.showToast({ title: '截图替换成功', icon: 'success' });
|
||||
// },
|
||||
// fail: () => {
|
||||
// uni.hideLoading();
|
||||
// uni.showToast({ title: '保存失败', icon: 'none' });
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// fail: () => {
|
||||
// uni.hideLoading();
|
||||
// uni.showToast({ title: '裁剪失败', icon: 'none' });
|
||||
// }
|
||||
// }, instance.proxy);
|
||||
// });
|
||||
// },
|
||||
// fail: () => {
|
||||
// uni.hideLoading();
|
||||
// uni.showToast({ title: '图片加载失败', icon: 'none' });
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
//};
|
||||
|
||||
// 确认图片裁剪
|
||||
const confirmImage = () => {
|
||||
uni.showLoading({
|
||||
title: '处理中...'
|
||||
})
|
||||
const query = uni.createSelectorQuery().in(instance)
|
||||
|
||||
// 获取容器和图片信息
|
||||
query.select('.image-box').boundingClientRect()
|
||||
query.select('.crop-image-target').boundingClientRect()
|
||||
query.exec(res => {
|
||||
if (!res[0] || !res[1]) {
|
||||
uni.hideLoading()
|
||||
return
|
||||
}
|
||||
|
||||
console.log('rects', res)
|
||||
const container = res[0] // 容器
|
||||
const image = res[1] // 图片实际渲染尺寸
|
||||
|
||||
// 计算缩放比例 (渲染宽度 / 实际宽度 不准确,应该反过来用 图片原始宽/渲染宽?)
|
||||
// 这里更简单的方法是:canvas设为容器大小,把图片画进去
|
||||
// canvas drawImage 参数: img, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight
|
||||
|
||||
// 获取图片原始尺寸
|
||||
uni.getImageInfo({
|
||||
src: selectedImage.value,
|
||||
success: (imgInfo) => {
|
||||
const scale = imgInfo.width / image.width // 图片 原始宽 / 渲染宽
|
||||
const sTop = scrollTop.value * scale // 原始图上的裁切起始Y
|
||||
const sHeight = container.height * scale // 原始图上的裁切高度
|
||||
|
||||
// 因为是 widthFix,宽度就是原始图宽度(或裁切全宽)
|
||||
const sWidth = imgInfo.width
|
||||
|
||||
// 设置画布尺寸 (使用像素值)
|
||||
// 注意:canvasContext绘制使用的是逻辑像素还是物理像素?通常需要考虑到 pixelRatio,
|
||||
// 但 uni-app canvas-id 方式通常对应逻辑像素(px)
|
||||
// 我们把 canvas 大小设为和容器显示一致
|
||||
const canvasW = container.width
|
||||
const canvasH = container.height
|
||||
|
||||
const ctx = uni.createCanvasContext('crop-canvas', instance)
|
||||
|
||||
// 清除画布
|
||||
ctx.clearRect(0, 0, canvasW, canvasH)
|
||||
|
||||
// 绘制
|
||||
// drawImage(imageResource, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight)
|
||||
ctx.drawImage(
|
||||
imgInfo.path,
|
||||
0, sTop, sWidth, sHeight, // 源图裁剪区域
|
||||
0, 0, canvasW, canvasH // 画布绘制区域
|
||||
)
|
||||
ctx.draw(false, () => {
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: 'crop-canvas',
|
||||
width: canvasW,
|
||||
height: canvasH,
|
||||
destWidth: sWidth, // 使用原图实际宽度,保持原图清晰度
|
||||
destHeight: sHeight, // 使用原图实际高度,保持原图清晰度
|
||||
success: (res) => {
|
||||
console.log('crop success (temp)', res
|
||||
.tempFilePath)
|
||||
|
||||
// 将临时路径保存为永久路径
|
||||
uni.saveFile({
|
||||
tempFilePath: res.tempFilePath,
|
||||
success: (saveRes) => {
|
||||
console.log('save success (saved)', saveRes.savedFilePath)
|
||||
screenshotImage.value = saveRes.savedFilePath
|
||||
selectedImage.value = '' // 隐藏编辑模式
|
||||
setTimeout(() => {
|
||||
plus.navigator.setStatusBarStyle("light");
|
||||
}, 200)
|
||||
// 保存到缓存
|
||||
uni.setStorageSync('jingdong_screenshot', screenshotImage.value)
|
||||
uni.hideLoading()
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('saveFile fail', err)
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '保存失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error(err)
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '裁剪失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}, instance)
|
||||
})
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '图片加载失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// 关闭截图预览
|
||||
const closeImage = () => {
|
||||
selectedImage.value = '';
|
||||
};
|
||||
|
||||
const currentTab = ref(0);
|
||||
const tabList = ref([
|
||||
{ name: '全部' },
|
||||
|
|
@ -254,6 +549,36 @@ const tabList = ref([
|
|||
const switchTab = (index) => {
|
||||
if (tabList.value[index].disabled) return;
|
||||
currentTab.value = index;
|
||||
// 重置筛选
|
||||
currentFilter.value = -1;
|
||||
// 动态更新筛选项
|
||||
updateFilterList();
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据当前Tab更新筛选项列表
|
||||
*/
|
||||
const updateFilterList = () => {
|
||||
if (currentTab.value === 1) { // 购物
|
||||
filterList.value = shoppingType.map(item => ({
|
||||
name: item.label,
|
||||
key: item.key
|
||||
}));
|
||||
} else if (currentTab.value === 2) { // 秒送 (外卖)
|
||||
filterList.value = waimaiType.map(item => ({
|
||||
name: item.label,
|
||||
key: item.key
|
||||
}));
|
||||
} else { // 全部或服务
|
||||
filterList.value = [
|
||||
{ name: '待付款' },
|
||||
{ name: '待收货' },
|
||||
{ name: '待使用', disabled: false },
|
||||
{ name: '已完成' },
|
||||
{ name: '待评价' },
|
||||
{ name: '已取消' }
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
const currentFilter = ref(-1);
|
||||
|
|
@ -311,13 +636,33 @@ const filteredOrderList = computed(() => {
|
|||
if (currentFilter.value === -1) {
|
||||
result = baseList;
|
||||
} else {
|
||||
const filterName = filterList.value[currentFilter.value].name;
|
||||
const filterItem = filterList.value[currentFilter.value];
|
||||
const filterName = filterItem.name;
|
||||
const filterKey = filterItem.key;
|
||||
|
||||
result = baseList.filter(item => {
|
||||
// 如果有 key,优先使用 key 匹配 (适用于外卖或已定义的购物类型)
|
||||
if (filterKey) {
|
||||
if (item.shopType === 'waimai') {
|
||||
if (filterKey === 'weizhifu') return item.status === '等待付款';
|
||||
if (filterKey === 'beicanzhong') return item.status === '商家备餐中' || item.status === '骑手到店取餐中';
|
||||
if (filterKey === 'qvcanzhong') return item.status === '取餐中' || item.status === '商家备餐中' || item.status === '骑手到店取餐中';
|
||||
if (filterKey === 'yiwancheng') return item.status === '完成' || item.status === '已完成';
|
||||
if (filterKey === 'yiquxiao') return item.status === '已取消';
|
||||
}
|
||||
// 购物类型 key 匹配
|
||||
if (filterKey === 'dengdaifukuan') return item.status === '等待付款';
|
||||
if (filterKey === 'zhengzaichuku') return item.status === '正在出库' || item.status === '仓库处理中';
|
||||
if (filterKey === 'yiqianshou' || filterKey === 'wancheng') return item.status === '完成' || item.status === '已签收';
|
||||
if (filterKey === 'yiquxiao') return item.status === '已取消';
|
||||
}
|
||||
|
||||
// 兜底使用原来基于名称的模糊模糊逻辑
|
||||
if (filterName === '待付款') return item.status === '等待付款';
|
||||
if (filterName === '待收货') return item.status === '正在出库' || item.status === '待收货' || item.status === '运输中' || item.status === '已发货' || item.status === '商家备餐中' || item.status === '骑手到店取餐中';
|
||||
if (filterName === '待收货') return ['正在出库', '待收货', '运输中', '已发货', '商家备餐中', '骑手到店取餐中', '仓库处理中'].includes(item.status);
|
||||
if (filterName === '待使用') return item.status === '待使用';
|
||||
if (filterName === '已完成') return item.status === '完成' || item.status === '已完成' || item.status === '已签收';
|
||||
if (filterName === '待评价') return item.status === '待评价' || item.status === '完成' || item.status === '已完成';
|
||||
if (filterName === '已完成') return ['完成', '已完成', '已签收'].includes(item.status);
|
||||
if (filterName === '待评价') return ['待评价', '完成', '已完成'].includes(item.status);
|
||||
if (filterName === '已取消') return item.status === '已取消';
|
||||
return true;
|
||||
});
|
||||
|
|
@ -629,6 +974,10 @@ const mockOrderList = ref([
|
|||
}
|
||||
|
||||
&.active {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
color: #F51919;
|
||||
|
|
@ -691,13 +1040,14 @@ const mockOrderList = ref([
|
|||
|
||||
.text {
|
||||
font-size: 26rpx;
|
||||
line-height: 26rpx;
|
||||
color: #1A1A1A;
|
||||
}
|
||||
|
||||
.close-icon {
|
||||
font-size: 18px;
|
||||
color: #E40C24;
|
||||
margin-top: -10rpx;
|
||||
margin-top: -4rpx;
|
||||
line-height: 14px;
|
||||
margin-left: 6rpx;
|
||||
font-weight: 400;
|
||||
|
|
@ -784,6 +1134,7 @@ const mockOrderList = ref([
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
.upload-screenshot {
|
||||
width: 92rpx;
|
||||
|
|
@ -791,6 +1142,8 @@ const mockOrderList = ref([
|
|||
}
|
||||
|
||||
.upload-screenshot-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
|
@ -802,6 +1155,63 @@ const mockOrderList = ref([
|
|||
line-height: 50rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.screenshot-preview {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-image-box {
|
||||
width: 100%;
|
||||
min-height: 0; // 修复 flex一出问题
|
||||
// overflow: hidden; // scroll-view 需要
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dashed-line-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border: 4rpx dashed #ffffff;
|
||||
pointer-events: none;
|
||||
|
||||
.dashed-line-text {
|
||||
height: 44rpx;
|
||||
line-height: 44rpx;
|
||||
width: 180rpx;
|
||||
padding: 0 20rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #1777FF;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
z-index: 999;
|
||||
|
||||
.mask-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 52rpx;
|
||||
transform: translateY(-25%);
|
||||
width: 360rpx;
|
||||
height: 360rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<template>
|
||||
<view>
|
||||
<nav-bar title="订单详情" bgColor="#F2F3F7">
|
||||
<nav-bar title="订单详情" bgColor="#F2F3F7" isBack :buttonGroup="buttonGroup"
|
||||
@button-click="util.clickTitlePopupButton" tipLayerType="jingdong-shopping-order-detail-tip" isTipLayer
|
||||
tipLayerText="编辑订单信息">
|
||||
<!-- <template v-slot:left>
|
||||
<image class="back-icon" src="/static/image/common/back.png" mode="aspectFit"></image>
|
||||
</template> -->
|
||||
|
|
@ -27,7 +29,7 @@
|
|||
<!-- 等待付款 -->
|
||||
<template v-if="order.status == '等待付款'">
|
||||
<view class="tip-box">
|
||||
<text>还剩 <text style="color: #DD223F;font-weight: 500;">18 : 25 : 46</text> 订单自动取消</text>
|
||||
<text>还剩 <text style="color: #DD223F;font-weight: 500;">{{ order.statusDesc }}</text> 订单自动取消</text>
|
||||
</view>
|
||||
<view class="address-info">
|
||||
<view>
|
||||
|
|
@ -410,6 +412,7 @@
|
|||
<view class="text">购物再享折上95折</view>
|
||||
</view>
|
||||
|
||||
<template v-if="screenshotImage">
|
||||
<view class="w100 flex-center" style="margin-top: 40rpx;margin-bottom: 32rpx;">
|
||||
<image style="width: 32rpx;height: 20rpx;" src="/static/image/shopping/jingdong/detail/like-left.png">
|
||||
</image>
|
||||
|
|
@ -421,18 +424,21 @@
|
|||
|
||||
<!-- 上传图片 -->
|
||||
<view class="upload-screenshot-box">
|
||||
<view class="upload-screenshot-content">
|
||||
<image class="upload-screenshot" src="/static/image/common/upload-screenshot.png" mode="aspectFit">
|
||||
<view class="upload-screenshot-content w100">
|
||||
<!-- <image class="upload-screenshot" src="/static/image/common/upload-screenshot.png" mode="aspectFit">
|
||||
</image>
|
||||
<view class="upload-screenshot-text">长按替换截图</view>
|
||||
<view class="upload-screenshot-text">长按替换截图</view> -->
|
||||
<image class="w100" :src="screenshotImage" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view class="fixed-bottom flex-align-center flex-justify-between">
|
||||
<text>{{ bottomText }}</text>
|
||||
<view class="btn-box">
|
||||
<view v-if="order.status == '等待付款'" class="big-btn ">立即支付<text class="wx-font-medium money">¥69</text>
|
||||
</view>
|
||||
<view v-else class="flex-align-center">
|
||||
<view v-else class="flex-align-center w00">
|
||||
<view v-for="btn in bottomBtns" :key="btn" class="bottom-btn " :class="{ red: btn == '再次购买' }">
|
||||
{{ btn }}
|
||||
</view>
|
||||
|
|
@ -440,18 +446,38 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="placeholder"></view>
|
||||
<!-- 水印 -->
|
||||
<view v-if="$isVip()">
|
||||
<watermark dark="light" />
|
||||
<liu-drag-button :canDocking="false" @clickBtn="$goRechargePage('watermark')">
|
||||
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie>
|
||||
</liu-drag-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref, computed, onUnmounted, watch } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { util } from '@/utils/common.js';
|
||||
|
||||
const buttonGroup = [
|
||||
{
|
||||
name: "修改订单",
|
||||
click: () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/shopping/jingdong/add-order/add-order?id=' + order.value.id + '&type=' + order.value.shopType + '&isEdit=true'
|
||||
});
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
/**
|
||||
* 模拟订单列表
|
||||
*/
|
||||
const mockOrderList = ref([]);
|
||||
const screenshotImage = ref('')
|
||||
|
||||
const bottomBtns = computed(() => {
|
||||
if (order.value.status == '正在出库') {
|
||||
|
|
@ -509,12 +535,77 @@ onLoad((options) => {
|
|||
if (target) {
|
||||
order.value = target;
|
||||
console.log('成功匹配订单数据:', order.value);
|
||||
|
||||
// 如果是等待付款状态,启动倒计时
|
||||
if (order.value.status === '等待付款' && order.value.statusDesc) {
|
||||
initCountdown();
|
||||
}
|
||||
} else {
|
||||
console.error('未找到指定的订单数据, ID:', id);
|
||||
}
|
||||
});
|
||||
|
||||
let countdownTimer = null;
|
||||
|
||||
/**
|
||||
* 初始化并启动倒计时
|
||||
*/
|
||||
const initCountdown = () => {
|
||||
if (countdownTimer) clearInterval(countdownTimer);
|
||||
|
||||
// 解析时间字符串 "HH : mm : ss" 或 "HH:mm:ss" 为秒数
|
||||
const parseTimeToSeconds = (timeStr) => {
|
||||
if (!timeStr) return 0;
|
||||
// 统一格式,移除空格并将冒号分隔
|
||||
const parts = timeStr.replace(/\s/g, '').split(':');
|
||||
let seconds = 0;
|
||||
if (parts.length === 3) {
|
||||
seconds = parseInt(parts[0]) * 3600 + parseInt(parts[1]) * 60 + parseInt(parts[2]);
|
||||
} else if (parts.length === 2) {
|
||||
seconds = parseInt(parts[0]) * 60 + parseInt(parts[1]);
|
||||
}
|
||||
return isNaN(seconds) ? 0 : seconds;
|
||||
};
|
||||
|
||||
// 将秒数格式化为 "HH : mm : ss"
|
||||
const formatSecondsToTime = (totalSeconds) => {
|
||||
if (totalSeconds <= 0) return "00 : 00 : 00";
|
||||
const h = Math.floor(totalSeconds / 3600);
|
||||
const m = Math.floor((totalSeconds % 3600) / 60);
|
||||
const s = totalSeconds % 60;
|
||||
const pad = (n) => String(n).padStart(2, '0');
|
||||
return `${pad(h)} : ${pad(m)} : ${pad(s)}`;
|
||||
};
|
||||
|
||||
let remainingSeconds = parseTimeToSeconds(order.value.statusDesc);
|
||||
|
||||
if (remainingSeconds <= 0) return;
|
||||
|
||||
countdownTimer = setInterval(() => {
|
||||
remainingSeconds--;
|
||||
if (remainingSeconds <= 0) {
|
||||
order.value.statusDesc = "00 : 00 : 00";
|
||||
clearInterval(countdownTimer);
|
||||
// 可选:倒计时结束时改变状态为“已取消”
|
||||
// order.value.status = '已取消';
|
||||
} else {
|
||||
order.value.statusDesc = formatSecondsToTime(remainingSeconds);
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
onUnmounted(() => {
|
||||
if (countdownTimer) {
|
||||
clearInterval(countdownTimer);
|
||||
}
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
// 读取缓存的截图
|
||||
const cachedImage = uni.getStorageSync('jingdong_screenshot');
|
||||
if (cachedImage) {
|
||||
screenshotImage.value = cachedImage;
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
util.setAndroidSystemBarColor('#FFFFFF')
|
||||
setTimeout(() => {
|
||||
|
|
@ -1284,7 +1375,7 @@ const isOrderInfoExpanded = ref(false);
|
|||
.upload-screenshot-box {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
height: 540rpx;
|
||||
// height: 540rpx;
|
||||
background-color: #FFFFFF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 727 B |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 803 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 144 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 597 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.6 KiB |