完成京东购物新增
This commit is contained in:
parent
a2dc82ab4b
commit
8c3298af2a
2
App.vue
2
App.vue
|
|
@ -7,7 +7,7 @@ export default {
|
|||
},
|
||||
onLaunch: function (options) {
|
||||
|
||||
console.log=()=>{}
|
||||
// console.log=()=>{}
|
||||
// === wgt 包启动诊断日志 ===
|
||||
console.log('=== App Launch 开始 ===')
|
||||
console.log('启动参数:', JSON.stringify(options))
|
||||
|
|
|
|||
|
|
@ -8,12 +8,15 @@
|
|||
<!-- 输入层 -->
|
||||
<template v-if="type !== 'textarea'">
|
||||
<input class="auto-input" :type="type" :value="modelValue" :placeholder="placeholder" :placeholder-style="placeholderStyle"
|
||||
:style="[inputStyle, { width: inputWidth }]" @input="onInput" :maxlength="maxlength" />
|
||||
:style="[inputStyle, { width: finalInputWidth }]" @input="onInput" :maxlength="maxlength" :focus="isFocus" @blur="onBlur" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<textarea class="auto-textarea" :value="modelValue" :placeholder="placeholder" :placeholder-style="placeholderStyle"
|
||||
:style="[inputStyle]" @input="onInput" :maxlength="maxlength" auto-height />
|
||||
:style="[inputStyle]" @input="onInput" :maxlength="maxlength" auto-height :focus="isFocus" @blur="onBlur" />
|
||||
</template>
|
||||
|
||||
<!-- 编辑图标 -->
|
||||
<image v-if="showEdit" class="edit-icon" src="/static/image/common/edit.png" @click="handleFocusIcon"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -60,12 +63,28 @@ const props = defineProps({
|
|||
extraWidth: {
|
||||
type: Number,
|
||||
default: 10 // 额外的缓冲像素,防止文字抖动
|
||||
},
|
||||
showEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'change']);
|
||||
const instance = getCurrentInstance();
|
||||
const inputWidth = ref(props.minWidth);
|
||||
// 最终应用的宽度样式
|
||||
const finalInputWidth = computed(() => {
|
||||
// 如果是 textarea 或者设置了填满父级,则不使用测量出的宽度
|
||||
if (props.type === 'textarea') return '100%';
|
||||
// 尝试检测 class 中是否包含撑开逻辑
|
||||
const classStr = instance.proxy.$attrs.class || '';
|
||||
if (classStr.includes('flex-1') || classStr.includes('w100')) {
|
||||
return '100%';
|
||||
}
|
||||
return inputWidth.value;
|
||||
});
|
||||
const isFocus = ref(false);
|
||||
|
||||
const inputStyle = computed(() => ({
|
||||
fontSize: props.fontSize,
|
||||
|
|
@ -74,11 +93,29 @@ const inputStyle = computed(() => ({
|
|||
fontFamily: 'inherit'
|
||||
}));
|
||||
|
||||
/**
|
||||
* 点击图标触发聚焦
|
||||
*/
|
||||
const handleFocusIcon = () => {
|
||||
isFocus.value = false;
|
||||
nextTick(() => {
|
||||
isFocus.value = true;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 失去焦点处理
|
||||
*/
|
||||
const onBlur = () => {
|
||||
isFocus.value = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* 核心逻辑:测量隐藏文本的物理宽度
|
||||
*/
|
||||
const updateWidth = () => {
|
||||
if (props.type === 'textarea') return;
|
||||
// 如果是强制撑开模式,理论上不需要测量,但为了防止切换状态时的布局闪烁,我们仍保持测量
|
||||
nextTick(() => {
|
||||
const query = uni.createSelectorQuery().in(instance.proxy);
|
||||
query.select('.measure-text').boundingClientRect(data => {
|
||||
|
|
@ -114,11 +151,23 @@ onMounted(() => {
|
|||
<style lang="less" scoped>
|
||||
.auto-width-input-container {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
display: inline-flex; // 默认维持自适应宽度
|
||||
align-items: center;
|
||||
vertical-align: middle;
|
||||
max-width: 100%;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
// 当父级赋予 flex-1 或手动设置 width: 100% 时,转为标准 flex 布局
|
||||
&.flex-1, &.w100 {
|
||||
display: flex !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
&.is-textarea {
|
||||
display: flex !important;
|
||||
width: 100%;
|
||||
align-items: flex-start;
|
||||
flex-direction: row !important;
|
||||
}
|
||||
|
||||
.measure-text {
|
||||
|
|
@ -131,18 +180,34 @@ onMounted(() => {
|
|||
min-width: v-bind('props.minWidth');
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
text-align: inherit; // 继承父级的对齐方式
|
||||
height: 1.4em; // 自动适应行高
|
||||
text-align: inherit;
|
||||
height: 1.4em;
|
||||
line-height: 1.4em;
|
||||
flex-shrink: 0;
|
||||
|
||||
// 如果容器是撑开的,input 也应该撑开
|
||||
& {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.auto-textarea {
|
||||
width: 100%;
|
||||
flex: 1 !important;
|
||||
width: 0 !important;
|
||||
min-width: 0;
|
||||
min-height: 1.4em;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
line-height: 1.4em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.edit-icon {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-left: 8rpx;
|
||||
flex-shrink: 0;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<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">{{ item.statusDesc }}</text>
|
||||
<text class="status-desc" v-if="item.statusDesc">{{ formatStatusDesc(item.statusDesc) }}</text>
|
||||
</view>
|
||||
<text v-else class="status-text"
|
||||
:class="{ red: item.statusColor === 'red' || item.status === '正在出库' || item.status === '商家备餐中' || item.status === '骑手到店取餐中' || item.status === '骑手已到店' }">{{
|
||||
|
|
@ -87,8 +87,7 @@
|
|||
<view class="product-price-box">
|
||||
<view class="price-wrap wx-font-regular">
|
||||
<text class="price-symbol">¥</text>
|
||||
<text class="price-num">{{ item.price || (item.products && item.products[0] &&
|
||||
item.products[0].price) }}</text>
|
||||
<text class="price-num">{{ safeFormatPrice(item) }}</text>
|
||||
</view>
|
||||
<text class="product-count"
|
||||
v-if="item.count || (item.products && item.products[0] && item.products[0].count)">共{{
|
||||
|
|
@ -162,6 +161,21 @@ const onLongPress = (e) => {
|
|||
emit('longpress', { event: e, item: props.item });
|
||||
};
|
||||
|
||||
const formatStatusDesc = (desc) => {
|
||||
if (!desc || !desc.includes(' : ')) return desc;
|
||||
const parts = desc.split(' : ');
|
||||
if (parts.length >= 2) {
|
||||
return `${parts[0]}时${parts[1]}分`;
|
||||
}
|
||||
return desc;
|
||||
};
|
||||
|
||||
const safeFormatPrice = (item) => {
|
||||
const val = item.price || (item.products && item.products[0] && item.products[0].price);
|
||||
const num = Number(val);
|
||||
return isNaN(num) ? '0.00' : num.toFixed(2);
|
||||
};
|
||||
|
||||
const getButtons = (shopType, status, item) => {
|
||||
const buttons = [];
|
||||
if (status == '等待付款') {
|
||||
|
|
|
|||
2
main.js
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.sp2')
|
||||
uni.setStorageSync('version', '1.0.4.sp3')
|
||||
app.config.globalProperties.$version = uni.getStorageSync('version')
|
||||
app.use(globalMethods);
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -275,16 +275,16 @@ const otherList = [{
|
|||
name: "通话",
|
||||
path: "/pages/common/call-and-message-entry/call-and-message-entry?type=call"
|
||||
},
|
||||
// {
|
||||
// icon: "/static/image/index/qita/gouwu.png",
|
||||
// name: "购物",
|
||||
// path: "/pages/shopping/index"
|
||||
// },
|
||||
{
|
||||
icon: "/static/image/index/qita/ranking.png",
|
||||
name: "从夯倒拉排名",
|
||||
path: "/pages/other/ranking/ranking"
|
||||
},
|
||||
{
|
||||
icon: "/static/image/index/qita/gouwu.png",
|
||||
name: "购物",
|
||||
path: "/pages/shopping/index"
|
||||
},
|
||||
]
|
||||
|
||||
const data = reactive({
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,32 +1,33 @@
|
|||
{
|
||||
"shoppingClassfiy": {
|
||||
"dengdaifukuan": {
|
||||
"id": 8562245551,
|
||||
"id": "",
|
||||
"shopType": "self",
|
||||
"shopName": "安野屋 (AARYE) 京联名哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈好梦",
|
||||
"shopName": "",
|
||||
"status": "等待付款",
|
||||
"statusDesc": "18 : 25 : 46",
|
||||
"consignee": "肖战",
|
||||
"phone": "152633221112",
|
||||
"fullAddress": "上海市浦东新区世纪大道123号",
|
||||
"totalPrice": "69.00",
|
||||
"carriage": "0.00",
|
||||
"statusDesc": "",
|
||||
"consignee": "",
|
||||
"phone": "",
|
||||
"fullAddress": "",
|
||||
"totalPrice": "",
|
||||
"carriage": "",
|
||||
"products": [
|
||||
{
|
||||
"image": "",
|
||||
"name": "哈哈哈哈哈",
|
||||
"title": "安野屋(AARYE)红红火火恍恍惚惚哈哈哈哈哈好",
|
||||
"desc": "联名哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈好梦",
|
||||
"service": "无理由退货政策",
|
||||
"price": "69.00",
|
||||
"count": "1"
|
||||
"name": "",
|
||||
"title": "",
|
||||
"desc": "",
|
||||
"service": "",
|
||||
"price": "",
|
||||
"count": ""
|
||||
}
|
||||
],
|
||||
"orderInfo": [
|
||||
{
|
||||
"label": "订单编号",
|
||||
"key": "orderNumber",
|
||||
"value": "8562245551"
|
||||
"value": "",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"label": "交易快照",
|
||||
|
|
@ -46,7 +47,8 @@
|
|||
{
|
||||
"label": "下单时间",
|
||||
"key": "orderTime",
|
||||
"value": "2022-01-01 12:00:00"
|
||||
"value": "",
|
||||
"type": "time"
|
||||
}
|
||||
],
|
||||
"sendType": [
|
||||
|
|
@ -58,42 +60,48 @@
|
|||
{
|
||||
"label": "期望配送时间",
|
||||
"key": "expectedDeliveryTime",
|
||||
"value": "大王 122555662221555"
|
||||
"value": " ",
|
||||
"type": "timeRange"
|
||||
},
|
||||
{
|
||||
"label": "收货方式",
|
||||
"key": "shippingMethod",
|
||||
"value": "送货上门"
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"promoType": "text",
|
||||
"promoHighlight": "白条支付券0.5元优惠券"
|
||||
},
|
||||
"zhengzaichuku": {
|
||||
"id": 5504455,
|
||||
"shopType": "none",
|
||||
"shopName": "甜小南旗舰店",
|
||||
"id": "",
|
||||
"shopType": "self",
|
||||
"shopName": "",
|
||||
"status": "正在出库",
|
||||
"trackingTitle": "仓库处理中",
|
||||
"trackingDesc": "预计 3月12日24:00 前发货,3月15日 24:00 前送达",
|
||||
"trackingTime": "2026-03-10 15:14:30",
|
||||
"trackingDesc": "",
|
||||
"trackingDesc2": "",
|
||||
"trackingTime": "",
|
||||
"consignee": "",
|
||||
"phone": "",
|
||||
"fullAddress": "",
|
||||
"totalPrice": "",
|
||||
"carriage": "",
|
||||
"products": [
|
||||
{
|
||||
"image": "/static/image/shopping/jingdong/product1.png",
|
||||
"title": "安野哈哈哈哈哈哈哈哈哈哈哈哈好好",
|
||||
"desc": "联名哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈好梦",
|
||||
"tags": [
|
||||
"无理由退货政策"
|
||||
],
|
||||
"price": "69.00",
|
||||
"count": 1
|
||||
"image": "",
|
||||
"title": "",
|
||||
"desc": "",
|
||||
"service": "",
|
||||
"price": "",
|
||||
"count": ""
|
||||
}
|
||||
],
|
||||
"orderInfo": [
|
||||
{
|
||||
"label": "订单编号",
|
||||
"key": "orderNumber",
|
||||
"value": "8562245551"
|
||||
"value": "",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"label": "交易快照",
|
||||
|
|
@ -108,12 +116,13 @@
|
|||
{
|
||||
"label": "支付时间",
|
||||
"key": "paymentTime",
|
||||
"value": "2022-01-01 12:00:00"
|
||||
"value": "",
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"label": "下单时间",
|
||||
"key": "orderTime",
|
||||
"value": "2022-01-01 12:00:00"
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"sendType": [
|
||||
|
|
@ -125,17 +134,18 @@
|
|||
{
|
||||
"label": "收货信息",
|
||||
"key": "userInfo",
|
||||
"value": "大王 122555662221555"
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"label": "收货地址",
|
||||
"key": "address",
|
||||
"value": "哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"label": "期望配送时间",
|
||||
"key": "expectedDeliveryTime",
|
||||
"value": "大王 122555662221555"
|
||||
"value": "",
|
||||
"type": "timeRange"
|
||||
},
|
||||
{
|
||||
"label": "收货方式",
|
||||
|
|
@ -147,31 +157,32 @@
|
|||
"promoText": "告别凑单, 享免运优惠"
|
||||
},
|
||||
"yiqianshou": {
|
||||
"id": 585552,
|
||||
"id": "",
|
||||
"shopType": "self",
|
||||
"shopName": "甜小南旗舰店",
|
||||
"shopName": "",
|
||||
"status": "完成",
|
||||
"statusColor": "gray",
|
||||
"trackingTitle": "已签收",
|
||||
"courier": "",
|
||||
"trackingDesc": "您的订单已签收,可对快递员的服务进行评价或打赏哦~",
|
||||
"trackingTime": "2026-03-10 15: 14: 30",
|
||||
"trackingDesc2": "",
|
||||
"trackingTime": "",
|
||||
"products": [
|
||||
{
|
||||
"image": "/static/image/shopping/jingdong/product1.png",
|
||||
"title": "安野哈哈哈哈哈哈哈哈哈哈哈哈好好",
|
||||
"desc": "联名哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈好梦",
|
||||
"tags": [
|
||||
"无理由退货政策"
|
||||
],
|
||||
"price": "69.00",
|
||||
"count": 1
|
||||
"image": "",
|
||||
"title": "",
|
||||
"desc": "",
|
||||
"service": "",
|
||||
"price": "",
|
||||
"count": ""
|
||||
}
|
||||
],
|
||||
"orderInfo": [
|
||||
{
|
||||
"label": "订单编号",
|
||||
"key": "orderNumber",
|
||||
"value": "8562245551"
|
||||
"value": "",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"label": "交易快照",
|
||||
|
|
@ -186,12 +197,12 @@
|
|||
{
|
||||
"label": "支付时间",
|
||||
"key": "paymentTime",
|
||||
"value": "2022-01-01 12:00:00"
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"label": "下单时间",
|
||||
"key": "orderTime",
|
||||
"value": "2022-01-01 12:00:00"
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"sendType": [
|
||||
|
|
@ -203,7 +214,8 @@
|
|||
{
|
||||
"label": "期望配送时间",
|
||||
"key": "expectedDeliveryTime",
|
||||
"value": "大王 122555662221555"
|
||||
"value": "",
|
||||
"type": "timeRange"
|
||||
},
|
||||
{
|
||||
"label": "收货方式",
|
||||
|
|
@ -216,28 +228,27 @@
|
|||
"hasMore": true
|
||||
},
|
||||
"wancheng": {
|
||||
"id": 4545451,
|
||||
"id": "",
|
||||
"shopType": "jd",
|
||||
"shopName": "甜小南旗舰店",
|
||||
"shopName": "",
|
||||
"status": "完成",
|
||||
"statusColor": "gray",
|
||||
"products": [
|
||||
{
|
||||
"image": "/static/image/shopping/jingdong/product1.png",
|
||||
"title": "安野哈哈哈哈哈哈哈哈哈哈哈哈好好",
|
||||
"desc": "联名哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈好梦",
|
||||
"tags": [
|
||||
"无理由退货政策"
|
||||
],
|
||||
"price": "69.00",
|
||||
"count": 1
|
||||
"image": "",
|
||||
"title": "",
|
||||
"desc": "",
|
||||
"service": "",
|
||||
"price": "",
|
||||
"count": ""
|
||||
}
|
||||
],
|
||||
"orderInfo": [
|
||||
{
|
||||
"label": "订单编号",
|
||||
"key": "orderNumber",
|
||||
"value": "8562245551"
|
||||
"value": "",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"label": "交易快照",
|
||||
|
|
@ -252,12 +263,13 @@
|
|||
{
|
||||
"label": "支付时间",
|
||||
"key": "paymentTime",
|
||||
"value": "2022-01-01 12:00:00"
|
||||
"value": "",
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"label": "下单时间",
|
||||
"key": "orderTime",
|
||||
"value": "2022-01-01 12:00:00"
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"sendType": [
|
||||
|
|
@ -269,39 +281,38 @@
|
|||
{
|
||||
"label": "收货信息",
|
||||
"key": "userInfo",
|
||||
"value": "大王 122555662221555"
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"label": "收货地址",
|
||||
"key": "address",
|
||||
"value": "哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"hasMore": true
|
||||
},
|
||||
"yiquxiao": {
|
||||
"id": 1236524,
|
||||
"id": "",
|
||||
"shopType": "self",
|
||||
"shopName": "甜小南旗舰店",
|
||||
"shopName": "",
|
||||
"status": "已取消",
|
||||
"statusColor": "gray",
|
||||
"products": [
|
||||
{
|
||||
"image": "/static/image/shopping/jingdong/product1.png",
|
||||
"title": "安野哈哈哈哈哈哈哈哈哈哈哈哈好好",
|
||||
"desc": "联名哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈好梦",
|
||||
"tags": [
|
||||
"无理由退货政策"
|
||||
],
|
||||
"price": "1669.00",
|
||||
"count": 1
|
||||
"image": "",
|
||||
"title": "",
|
||||
"desc": "",
|
||||
"service": "",
|
||||
"price": "",
|
||||
"count": ""
|
||||
}
|
||||
],
|
||||
"orderInfo": [
|
||||
{
|
||||
"label": "订单编号",
|
||||
"key": "orderNumber",
|
||||
"value": "8562245551"
|
||||
"value": "",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"label": "交易快照",
|
||||
|
|
@ -321,7 +332,7 @@
|
|||
{
|
||||
"label": "下单时间",
|
||||
"key": "orderTime",
|
||||
"value": "2022-01-01 12:00:00"
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"sendType": [
|
||||
|
|
@ -333,7 +344,8 @@
|
|||
{
|
||||
"label": "期望配送时间",
|
||||
"key": "expectedDeliveryTime",
|
||||
"value": "大王 122555662221555"
|
||||
"value": "",
|
||||
"type": "timeRange"
|
||||
},
|
||||
{
|
||||
"label": "收货方式",
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@
|
|||
|
||||
<script setup>
|
||||
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';
|
||||
|
||||
|
|
@ -87,12 +88,20 @@ const actionMenuState = ref({ x: 0, y: 0, item: null });
|
|||
//导航栏菜单按钮
|
||||
const buttonGroup = [
|
||||
{
|
||||
name: "新增购物",
|
||||
name: "新增购物订单",
|
||||
click: () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/shopping/jingdong/add-order/add-order'
|
||||
});
|
||||
}
|
||||
}, {
|
||||
name: "新增秒送订单",
|
||||
click: () => {
|
||||
uni.showToast({
|
||||
title: '开发中,敬请期待',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
]
|
||||
/**
|
||||
|
|
@ -138,7 +147,7 @@ const editOrder = () => {
|
|||
if (!item) return;
|
||||
showActionMenu.value = false;
|
||||
uni.navigateTo({
|
||||
url: '/pages/shopping/jingdong/add-order/add-order?id=' + item.id + '&type=' + item.shopType
|
||||
url: '/pages/shopping/jingdong/add-order/add-order?id=' + item.id + '&type=' + item.shopType + '&isEdit=true'
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -163,12 +172,29 @@ const handleCardClick = (item) => {
|
|||
*/
|
||||
const handleDeleteOrder = () => {
|
||||
const itemToDel = actionMenuState.value.item;
|
||||
|
||||
// 1. 尝试删除本地持久化图片文件
|
||||
const productImage = itemToDel?.products?.[0]?.image;
|
||||
if (productImage && (productImage.includes('_doc/') || productImage.includes('_downloads/') || productImage.includes('store_'))) {
|
||||
uni.removeSavedFile({
|
||||
filePath: productImage,
|
||||
success: () => console.log('图片文件删除成功:', productImage),
|
||||
fail: (err) => console.error('图片文件删除失败:', err)
|
||||
});
|
||||
}
|
||||
|
||||
// 2. 从列表中移除数据
|
||||
const realIndex = mockOrderList.value.findIndex(item => item === itemToDel);
|
||||
if (realIndex > -1) {
|
||||
mockOrderList.value.splice(realIndex, 1);
|
||||
// 同步更新缓存
|
||||
uni.setStorageSync('jingdongShopping', mockOrderList.value);
|
||||
}
|
||||
showActionMenu.value = false;
|
||||
uni.showToast({ title: '已删除', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '已删除',
|
||||
icon: 'none'
|
||||
});
|
||||
};
|
||||
|
||||
const contentPaddingTop = ref('0px');
|
||||
|
|
@ -196,6 +222,13 @@ onMounted(() => {
|
|||
}, 100);
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
const cachedData = uni.getStorageSync('jingdongShopping');
|
||||
if (cachedData && Array.isArray(cachedData)) {
|
||||
mockOrderList.value = cachedData;
|
||||
}
|
||||
});
|
||||
|
||||
const currentTab = ref(0);
|
||||
const tabList = ref([
|
||||
{ name: '全部' },
|
||||
|
|
|
|||
Loading…
Reference in New Issue