夏滨对接产业运营个人中心
This commit is contained in:
parent
04664be9d8
commit
973405603c
@ -16,6 +16,6 @@ VITE_APP_UPLOAD_API = '/uploadApis'
|
||||
# VITE_APP_BASE_URL = 'http://47.109.205.240:8080'
|
||||
# VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9300'
|
||||
# 内网接口地址
|
||||
VITE_APP_BASE_URL = 'http://192.168.18.9:8080'
|
||||
VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
|
||||
VITE_APP_UPLOAD_URL = 'http://192.168.18.9:9300'
|
||||
VITE_APP_VIST_URL = 'http://192.168.18.99'
|
@ -4,6 +4,7 @@ VITE_APP_MIAN = 'daimp-front-main'
|
||||
VITE_APP_MIAN_URL = 'http://localhost:9000'
|
||||
VITE_APP_NAME = 'sub-operation-service'
|
||||
VITE_APP_BASE_API = '/apis'
|
||||
VITE_APP_BASE_URL = 'http://192.168.18.99:88'
|
||||
# VITE_APP_BASE_URL = 'http://192.168.18.99:88'
|
||||
VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
|
||||
VITE_APP_UPLOAD_API = '/uploadApis'
|
||||
VITE_APP_UPLOAD_URL = 'http://192.168.18.99:9300'
|
||||
|
2
sub-operation-service/components.d.ts
vendored
2
sub-operation-service/components.d.ts
vendored
@ -41,6 +41,8 @@ declare module 'vue' {
|
||||
CustomTableOperate: typeof import('./src/components/custom-table-operate/index.vue')['default']
|
||||
CustomTableTree: typeof import('./src/components/custom-table-tree/index.vue')['default']
|
||||
IndexBak: typeof import('./src/components/page-menu/index-bak.vue')['default']
|
||||
LeftMenu: typeof import('./src/components/common/leftMenu.vue')['default']
|
||||
Modul: typeof import('./src/components/common/modul.js')['default']
|
||||
NewHyalineCake: typeof import('./src/components/custom-echart-hyaline-cake/new-hyaline-cake.vue')['default']
|
||||
PageLayout: typeof import('./src/components/page-layout/index.vue')['default']
|
||||
PageMenu: typeof import('./src/components/page-menu/index.vue')['default']
|
||||
|
106
sub-operation-service/src/apis/user.js
Normal file
106
sub-operation-service/src/apis/user.js
Normal file
@ -0,0 +1,106 @@
|
||||
import request from '@/utils/axios';
|
||||
//购物车列表
|
||||
export function shoppingCart(params = {}) {
|
||||
return request('user-center/shoppingCart/page', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//删除购物车
|
||||
export function deleteChooseGoods(params = {}) {
|
||||
return request('user-center/shoppingCart/deleteChooseGoods', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//商品添加数量
|
||||
export function addToCart(params = {}) {
|
||||
return request('user-center/shoppingCart/addToCart', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//商品减数量
|
||||
export function delCartGood(params = {}) {
|
||||
return request('user-center/shoppingCart/delCartGood', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//获取地址列表
|
||||
export function userPostAddress(params = {}) {
|
||||
return request('user-center/userPostAddress/page', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//修改购物车数量
|
||||
export function setGoodsCount(params = {}) {
|
||||
return request('user-center/shoppingCart/setGoodsCount', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//新增地址
|
||||
export function addUserPostAddress(params = {}) {
|
||||
return request('user-center/userPostAddress/add', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
//删除地址
|
||||
export function deleteAddress(params = {}) {
|
||||
return request(`user-center/userPostAddress/delete/${params}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
//修改地址信息
|
||||
export function userPostAddressed(params = {}) {
|
||||
return request('user-center/userPostAddress/edit', {
|
||||
method: 'PUT',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
//提交订单
|
||||
export function commitOrder(params = {}) {
|
||||
return request('user-center/shoppingCart/commitOrder', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
//获取订单列表
|
||||
export function upOrderInfoList(params = {}) {
|
||||
return request('user-center/orderInfo/getById', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//确认订单
|
||||
export function confirmOrder(params = {}) {
|
||||
return request('user-center/orderInfo/confirmOrder', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
//获取订单列表
|
||||
export function orderInfo(params = {}) {
|
||||
return request('/user-center/orderInfo/page', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//取消订单
|
||||
export function cancelOrder(params = {}) {
|
||||
return request(`/user-center/orderInfo/cancelOrder/${params.id}`, {
|
||||
method: 'PUT',
|
||||
// data: params,
|
||||
});
|
||||
}
|
||||
|
||||
//品牌列表
|
||||
export function mainPage(params = {}) {
|
||||
return request('/brand/applicationrecord/mainPage', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
14780
sub-operation-service/src/assets/address.json
Normal file
14780
sub-operation-service/src/assets/address.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
sub-operation-service/src/assets/images/empty.png
Normal file
BIN
sub-operation-service/src/assets/images/empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 76 KiB |
BIN
sub-operation-service/src/assets/images/userCenter/menu7-1.png
Normal file
BIN
sub-operation-service/src/assets/images/userCenter/menu7-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
BIN
sub-operation-service/src/assets/images/userCenter/menu7.png
Normal file
BIN
sub-operation-service/src/assets/images/userCenter/menu7.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
@ -49,6 +49,12 @@ export const constantRoutes = [
|
||||
name: 'sureOrder',
|
||||
meta: { title: '结算' },
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/addressList',
|
||||
component: () => import('@/views/userCenter/addressList.vue'),
|
||||
name: 'addressList',
|
||||
meta: { title: '我的地址' },
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/orderSuccess',
|
||||
component: () => import('@/views/userCenter/orderSuccess.vue'),
|
||||
@ -67,6 +73,12 @@ export const constantRoutes = [
|
||||
name: 'userOrders',
|
||||
meta: { title: '我的订单' },
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/orderDetails',
|
||||
component: () => import('@/views/userCenter/orderDetails.vue'),
|
||||
name: 'orderDetails',
|
||||
meta: { title: '订单详情' },
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/userLands',
|
||||
component: () => import('@/views/userCenter/userLands.vue'),
|
||||
|
24
sub-operation-service/src/store/modules/userOrder.js
Normal file
24
sub-operation-service/src/store/modules/userOrder.js
Normal file
@ -0,0 +1,24 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { constantRoutes, notFoundRouter } from '@/router';
|
||||
import { createAsyncRoutes, filterAsyncRoutes, filterKeepAlive } from '@/utils/router';
|
||||
import { orderInfo } from '../../apis/user';
|
||||
import { getTree } from '@/utils';
|
||||
|
||||
export const useGetUserOrder = defineStore('userOrder', {
|
||||
state: () => ({
|
||||
data: {},
|
||||
}),
|
||||
actions: {
|
||||
//订单
|
||||
getData(params) {
|
||||
return Promise.resolve(
|
||||
orderInfo(params).then((res) => {
|
||||
console.log(res);
|
||||
useGetUserOrder().$state.data = res.data;
|
||||
return useGetUserOrder().$state.data;
|
||||
})
|
||||
);
|
||||
},
|
||||
},
|
||||
getters: {},
|
||||
});
|
650
sub-operation-service/src/views/userCenter/addressList.vue
Normal file
650
sub-operation-service/src/views/userCenter/addressList.vue
Normal file
@ -0,0 +1,650 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-model="dialogVisible" title="地址" width="40%" :before-close="handleClose">
|
||||
<el-form :label-position="labelPosition" label-width="130px" :model="formLabelAlign" style="max-width: 460px">
|
||||
<el-form-item label="联系人" prop="receiverName" :rules="[{ required: true, message: '请输入联系人' }]">
|
||||
<el-input v-model="formLabelAlign.receiverName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人手机号" prop="receiverPhone" :rules="[{ required: true, message: '请输入联系人手机号' }]">
|
||||
<el-input v-model="formLabelAlign.receiverPhone" />
|
||||
</el-form-item>
|
||||
<el-form-item label="省市区" prop="postArea" :rules="[{ required: true, message: '省市区' }]">
|
||||
<!-- <el-input v-model="formLabelAlign.region" /> -->
|
||||
<el-cascader v-model="formLabelAlign.postArea" :props="props" :options="options" @change="handleChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="详细地址" prop="postAddress" :rules="[{ required: true, message: '详细地址' }]">
|
||||
<el-input v-model="formLabelAlign.postAddress" />
|
||||
</el-form-item>
|
||||
<el-form-item label="默认地址" prop="isDefault" :rules="[{ required: true, message: '默认地址' }]">
|
||||
<el-switch v-model="formLabelAlign.isDefault" size="large" active-text="是" inactive-text="否" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submit()"> 确定 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<common current-name="addressList">
|
||||
<template #main>
|
||||
<div class="my-shoping-car-warp">
|
||||
<userHeader :title="'我的地址'"></userHeader>
|
||||
<div class="page-content-warp">
|
||||
<div class="fix-top">
|
||||
<div class="do-all" @click="toCheckAll">
|
||||
<!-- <div class="do-all-pos">
|
||||
<ischeck :value="isAll"></ischeck>
|
||||
<span class="all-txt">全选</span>
|
||||
</div> -->
|
||||
</div>
|
||||
<div>
|
||||
<div style="margin-right: 20px" class="batch-del" @click="add()">
|
||||
<el-icon><Plus color="#000000" /></el-icon> <span class="del-txt">新增</span>
|
||||
</div>
|
||||
<!-- <div class="batch-del" @click="doBatchDel">
|
||||
<el-icon><Delete /></el-icon> <span class="del-txt">批量删除</span>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="conetnt-warp">
|
||||
<div class="content-item-warp">
|
||||
<div v-for="(n, index) in data" :key="n.id" class="content-item">
|
||||
<div class="shop-info">
|
||||
<div class="shop-do" @click="toCheckShop(index)">
|
||||
<!-- <ischeck :value="n.ischeck"></ischeck> -->
|
||||
</div>
|
||||
<!-- <div class="shop-img">
|
||||
<costomImg
|
||||
:url="'images/ecommerce/' + 'pic.png'"
|
||||
:preview-list="[getAssetsFile('images/ecommerce/' + 'pic.png')?.href ?? '']"
|
||||
:is-view="false"
|
||||
></costomImg>
|
||||
</div> -->
|
||||
<span style="border: 1px solid #dddddd; border-radius: 5px; padding: 3px 5px" class="shop-name txt-ellipsis clamp2"
|
||||
>联系人:{{ n.receiverName }},联系人手机号:{{ n.receiverPhone }},地址:{{ n.postArea }}{{ n.postAddress }}</span
|
||||
>
|
||||
<div style="color: #25bf82; font-size: 20px" @click="showDialogVisible(n)">修改</div>
|
||||
<div style="color: red; font-size: 20px" @click="del(n)">删除</div>
|
||||
</div>
|
||||
|
||||
<!-- <div v-if="n.cartDetails && n.cartDetails.length > 0" class="good-list">
|
||||
<div v-for="(g, indexg) in n.cartDetails" :key="indexg" class="good-item">
|
||||
<div class="good-do" @click="toCheckGood(index, indexg)">
|
||||
<div class="good-do-pos">
|
||||
<ischeck :value="g.ischeck" size="24px"></ischeck>
|
||||
</div>
|
||||
</div>
|
||||
<div class="good-img" @click="toCheckGood(index, indexg)">
|
||||
<img class="good-img" style="border-radius: 5px" :src="g.productImgUrl" alt="" />
|
||||
</div>
|
||||
<div class="good-info" @click="toCheckGood(index, indexg)">
|
||||
<div class="good-info-pos">
|
||||
<div class="txt-ellipsis clamp2">{{ g.productName || '--' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="good-price-num">
|
||||
<div class="good-price-num-pos">
|
||||
<div class="price" @click="toCheckGood(index, indexg)">{{ g.price }} / {{ g.quantity }}</div>
|
||||
<div class="total" @click="toCheckGood(index, indexg)">{{ (g.price * g.quantity).toFixed(2) }}</div>
|
||||
<div class="num">
|
||||
<div class="right-item">
|
||||
<el-input-number v-model="g.quantity" :min="1" @change="numberChange(index, indexg)">
|
||||
<template #suffix>
|
||||
<span>{{ g.quantity }}</span>
|
||||
</template>
|
||||
</el-input-number>
|
||||
</div>
|
||||
</div>
|
||||
<div class="good-del" @click="doSingleDel(index, indexg)">
|
||||
<span>删除</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</common>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import common from './components/common.vue';
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { isEmpty, getAssetsFile } from '@/utils';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import userHeader from './components/userHeader.vue';
|
||||
import ischeck from './components/ischeck.vue';
|
||||
import costomImg from '@/components/costomImg.vue';
|
||||
import { useApp } from '@/hooks';
|
||||
import {
|
||||
shoppingCart,
|
||||
deleteChooseGoods,
|
||||
userPostAddressed,
|
||||
addToCart,
|
||||
delCartGood,
|
||||
userPostAddress,
|
||||
addUserPostAddress,
|
||||
deleteAddress,
|
||||
} from '../../apis/user';
|
||||
import json from '../../assets/address.json';
|
||||
const app = useApp();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
let number = ref(1);
|
||||
let total = ref(99);
|
||||
let isAll = ref(false);
|
||||
let data = ref([]);
|
||||
let page = reactive({
|
||||
current: 1,
|
||||
size: 10,
|
||||
});
|
||||
let ids = ref([]);
|
||||
let dialogVisible = ref(false);
|
||||
|
||||
let formLabelAlign = reactive({
|
||||
receiverName: '',
|
||||
receiverPhone: '',
|
||||
postArea: '',
|
||||
postAddress: '',
|
||||
isDefault: false,
|
||||
});
|
||||
|
||||
const options = json;
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
|
||||
const props = ref({
|
||||
value: 'label',
|
||||
});
|
||||
|
||||
const showDialogVisible = (data) => {
|
||||
dialogVisible.value = true;
|
||||
formLabelAlign = data;
|
||||
formLabelAlign.isDefault == '1' ? (formLabelAlign.isDefault = true) : (formLabelAlign.isDefault = false);
|
||||
console.log(data);
|
||||
};
|
||||
|
||||
const submit = (value) => {
|
||||
formLabelAlign.isDefault ? (formLabelAlign.isDefault = '1') : (formLabelAlign.isDefault = '0');
|
||||
if (typeof formLabelAlign.postArea !== 'string') {
|
||||
formLabelAlign.postArea = formLabelAlign.postArea.join(',');
|
||||
}
|
||||
if (formLabelAlign.id) {
|
||||
userPostAddressed(formLabelAlign).then((res) => {
|
||||
dialogVisible.value = false;
|
||||
getUserAddressList();
|
||||
});
|
||||
} else {
|
||||
addUserPostAddress(formLabelAlign).then((res) => {
|
||||
dialogVisible.value = false;
|
||||
getUserAddressList();
|
||||
});
|
||||
}
|
||||
|
||||
// console.log(formLabelAlign);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getUserAddressList();
|
||||
});
|
||||
|
||||
const handleChange = (value) => {
|
||||
console.log(value);
|
||||
formLabelAlign.postArea = value;
|
||||
};
|
||||
|
||||
const getUserAddressList = () => {
|
||||
userPostAddress(page).then((res) => {
|
||||
console.log(res.data.records);
|
||||
data.value = res.data.records;
|
||||
addIsCheckProperty(data);
|
||||
});
|
||||
};
|
||||
|
||||
function addIsCheckProperty(data) {
|
||||
if (Array.isArray(data)) {
|
||||
data.forEach((item) => {
|
||||
item.ischeck = false; // 为当前层级添加属性
|
||||
if (item.cartDetails) {
|
||||
// 处理子集
|
||||
addIsCheckProperty(item.cartDetails);
|
||||
}
|
||||
if (item.records) {
|
||||
// 处理父级(如存在嵌套结构)
|
||||
addIsCheckProperty(item.records);
|
||||
}
|
||||
});
|
||||
} else if (typeof data === 'object' && data !== null) {
|
||||
data.ischeck = false;
|
||||
for (let key in data) {
|
||||
if (typeof data[key] === 'object') {
|
||||
addIsCheckProperty(data[key]); // 递归处理嵌套对象
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const numberChange = (value, index, indexg) => {
|
||||
console.log(value, index, indexg);
|
||||
if (number.value < value) {
|
||||
// addToCart();
|
||||
}
|
||||
number.value = value;
|
||||
};
|
||||
|
||||
// let totalAmout = computed(() => {
|
||||
// let num = 0;
|
||||
// let list = [];
|
||||
// if (data && data.value.length > 0) {
|
||||
// list = data.value
|
||||
// .map((m) => {
|
||||
// return m.cartDetails;
|
||||
// })
|
||||
// .flat();
|
||||
// if (list && list.length > 0) {
|
||||
// num = list.reduce((acc, current) => {
|
||||
// return acc + (current.ischeck ? current.price * current.quantity : 0);
|
||||
// }, 0);
|
||||
// }
|
||||
// }
|
||||
|
||||
// return num;
|
||||
// });
|
||||
|
||||
const toSettlement = () => {
|
||||
router.push('/sub-operation-service/sureOrder');
|
||||
};
|
||||
|
||||
const toCheckAll = () => {
|
||||
isAll.value = !isAll.value;
|
||||
console.info('操作全选', isAll.value);
|
||||
if (data && data.value.length > 0) {
|
||||
data.value.forEach((m) => {
|
||||
m.ischeck = isAll.value;
|
||||
if (m.cartDetails && m.cartDetails.length > 0) {
|
||||
m.cartDetails = setCheck(m.cartDetails, isAll.value);
|
||||
m.cartDetails.forEach((res, index) => {
|
||||
ids.value.push(res.id);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const setCheck = (data, val) => {
|
||||
let list = [];
|
||||
if (data && data.length > 0) {
|
||||
list = data.map((m) => {
|
||||
return { ...m, ischeck: val };
|
||||
});
|
||||
}
|
||||
|
||||
return list;
|
||||
};
|
||||
|
||||
const toCheckShop = (index) => {
|
||||
if (index > -1) {
|
||||
data.value[index].ischeck = !data.value[index].ischeck;
|
||||
if (data.value[index].cartDetails && data.value[index].cartDetails.length > 0) {
|
||||
data.value[index].cartDetails = setCheck(data.value[index].cartDetails, data.value[index].ischeck);
|
||||
}
|
||||
setIsAll();
|
||||
}
|
||||
};
|
||||
|
||||
const toCheckGood = (indexP, index) => {
|
||||
if (indexP > -1 && index > -1) {
|
||||
let list = data.value[indexP].cartDetails;
|
||||
list[index].ischeck = !list[index].ischeck;
|
||||
let len = list.length || 0;
|
||||
let checkNum = list.reduce((acc, current) => {
|
||||
return acc + (current.ischeck ? 1 : 0);
|
||||
}, 0);
|
||||
|
||||
if (checkNum > 0 && checkNum < len) {
|
||||
data.value[indexP].ischeck = false;
|
||||
} else if (checkNum > 0 && checkNum == len) {
|
||||
data.value[indexP].ischeck = true;
|
||||
} else {
|
||||
data.value[indexP].ischeck = false;
|
||||
}
|
||||
setIsAll();
|
||||
}
|
||||
};
|
||||
|
||||
const setIsAll = () => {
|
||||
let len = data.value.length || 0;
|
||||
let checkNum = data.value.reduce((acc, current) => {
|
||||
return acc + (current.ischeck ? 1 : 0);
|
||||
}, 0);
|
||||
|
||||
if (checkNum > 0 && checkNum < len) {
|
||||
isAll.value = false;
|
||||
} else if (checkNum > 0 && checkNum == len) {
|
||||
isAll.value = true;
|
||||
} else {
|
||||
isAll.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const doSingleDel = (indexP, index) => {
|
||||
if (indexP > -1 && index > -1) {
|
||||
app
|
||||
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
deleteChooseGoods({ goodsIds: [data.value[indexP].cartDetails[index].id] });
|
||||
data.value[indexP].cartDetails.splice(index, 1);
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
};
|
||||
//单个删除
|
||||
const del = (data) => {
|
||||
app
|
||||
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
deleteAddress(data.id);
|
||||
getUserAddressList();
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
//批量删除
|
||||
const doBatchDel = () => {
|
||||
const allUnchecked = isAllUnchecked(data.value);
|
||||
console.log(allUnchecked); // true 或 false
|
||||
if (allUnchecked) {
|
||||
app.$message({
|
||||
message: '请先选择要删除的商品',
|
||||
type: 'warning',
|
||||
});
|
||||
} else {
|
||||
app
|
||||
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
// 删除逻辑
|
||||
const filteredData = removeCheckedItems(data);
|
||||
// console.log(filteredData);
|
||||
data.value = filteredData;
|
||||
deleteAddress(ids.value[0]);
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
};
|
||||
const add = () => {
|
||||
formLabelAlign = reactive({
|
||||
receiverName: '',
|
||||
receiverPhone: '',
|
||||
postArea: '',
|
||||
postAddress: '',
|
||||
isDefault: false,
|
||||
});
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
// 判断是否全部未选中
|
||||
function isAllUnchecked(data) {
|
||||
return data.every((item) => {
|
||||
// 检查当前项的 ischeck 是否为 false
|
||||
const currentUnchecked = item.ischeck === false;
|
||||
// 如果有子项 goodlist,递归检查子项
|
||||
const childrenUnchecked = item.cartDetails ? item.cartDetails.every((child) => child.ischeck === false) : true;
|
||||
return currentUnchecked && childrenUnchecked;
|
||||
});
|
||||
}
|
||||
//批量删除逻辑
|
||||
function removeCheckedItems(data) {
|
||||
return data.filter((item) => {
|
||||
// 如果父项的 ischeck 为 true,直接过滤掉(包括所有子项)
|
||||
if (item.ischeck === true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 如果父项的 ischeck 为 false,但子项可能存在 ischeck 为 true 的情况
|
||||
if (item.cartDetails) {
|
||||
item.cartDetails = item.cartDetails.filter((child) => child.ischeck !== true);
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.my-shoping-car-warp {
|
||||
width: 100%;
|
||||
.page-content-warp {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
margin: 16px 0 0 16px;
|
||||
width: 100%;
|
||||
height: calc(100vh - 135px);
|
||||
border-radius: 16px;
|
||||
background: $color-fff;
|
||||
.fix-top,
|
||||
.fix-bottom {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
padding: 16px;
|
||||
width: 100%;
|
||||
background: $color-fff;
|
||||
}
|
||||
.fix-top {
|
||||
top: 0;
|
||||
display: inline-flex;
|
||||
justify-content: space-between;
|
||||
.do-all,
|
||||
.batch-del {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
}
|
||||
.do-all {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
.all-txt {
|
||||
display: inline-block;
|
||||
padding-left: 16px;
|
||||
font-size: 16px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.batch-del {
|
||||
padding: 8px 16px;
|
||||
font-size: 16px;
|
||||
border: 1px solid $color-333;
|
||||
border-radius: 16px;
|
||||
.el-icon {
|
||||
font-size: 18px;
|
||||
}
|
||||
.del-txt,
|
||||
.el-icon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.del-txt {
|
||||
padding-left: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.fix-bottom {
|
||||
bottom: 0;
|
||||
display: inline-flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
.bottom-total,
|
||||
.bottom-do {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.bottom-total {
|
||||
.tips,
|
||||
.total {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.tips {
|
||||
font-size: 30px;
|
||||
}
|
||||
.total {
|
||||
padding-left: 16px;
|
||||
font-size: 42px;
|
||||
color: $color-main;
|
||||
}
|
||||
.total::before {
|
||||
content: '¥';
|
||||
}
|
||||
}
|
||||
.bottom-do {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
::v-deep() {
|
||||
.el-button {
|
||||
display: inline-block !important;
|
||||
padding: 0 40px !important;
|
||||
height: 42px !important;
|
||||
font-size: 18px !important;
|
||||
line-height: 42px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.conetnt-warp {
|
||||
overflow-y: auto;
|
||||
padding: 80px 16px 96px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.content-item-warp {
|
||||
width: 100%;
|
||||
.content-item {
|
||||
margin-bottom: 16px;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
.shop-info {
|
||||
display: inline-flex;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
gap: 16px;
|
||||
.shop-do,
|
||||
.shop-img,
|
||||
.shop-name {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.shop-img {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 4px;
|
||||
flex-direction: column;
|
||||
}
|
||||
.shop-do {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
flex-direction: column;
|
||||
}
|
||||
.shop-name {
|
||||
width: calc(100% - 200px);
|
||||
font-size: 18px;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
.good-list {
|
||||
width: 100%;
|
||||
.good-item {
|
||||
display: inline-flex;
|
||||
justify-content: flex-start;
|
||||
margin: 8px 0;
|
||||
padding-left: 16px;
|
||||
width: 100%;
|
||||
gap: 16px;
|
||||
}
|
||||
.good-do,
|
||||
.good-img,
|
||||
.good-info,
|
||||
.good-price-num {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.good-do {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
.good-do-pos {
|
||||
}
|
||||
}
|
||||
.good-img {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
}
|
||||
.good-info {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 200px;
|
||||
flex-direction: column;
|
||||
.good-info-pos {
|
||||
font-size: 18px;
|
||||
color: $color-666;
|
||||
.txt-ellipsis {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
.good-price-num {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: calc(100% - 340px);
|
||||
flex-direction: column;
|
||||
.good-price-num-pos {
|
||||
display: inline-flex;
|
||||
justify-content: space-around;
|
||||
gap: 16px;
|
||||
.price,
|
||||
.total {
|
||||
font-size: 20px;
|
||||
}
|
||||
.price {
|
||||
font-weight: 400;
|
||||
}
|
||||
.total {
|
||||
font-weight: 700;
|
||||
color: $color-main;
|
||||
}
|
||||
.total::before {
|
||||
content: '¥';
|
||||
}
|
||||
.good-del {
|
||||
font-size: 16px;
|
||||
color: $color-999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -35,8 +35,9 @@ const leftMenu = reactive([
|
||||
{ name: 'supplier', title: '我的订单', icon: 'menu2-1.png', path: '/sub-operation-service/userOrders' },
|
||||
// { name: 'purchaser', title: '我的土地', icon: 'menu3-1.png', path: '/sub-operation-service/userLands' },
|
||||
{ name: 'mySource', title: '我的溯源', icon: 'menu4-1.png', path: '/sub-operation-service/mySource' },
|
||||
{ name: 'myFinance', title: '我的金融', icon: 'menu5-1.png', path: '/sub-operation-service/myFinance' },
|
||||
// { name: 'myFinance', title: '我的金融', icon: 'menu5-1.png', path: '/sub-operation-service/myFinance' },
|
||||
{ name: 'myBrand', title: '我的品牌', icon: 'menu6-1.png', path: '/sub-operation-service/myBrand' },
|
||||
{ name: 'addressList', title: '我的地址', icon: 'menu7-1.png', path: '/sub-operation-service/addressList' },
|
||||
]);
|
||||
|
||||
let currentIndex = ref(0);
|
||||
|
@ -9,31 +9,31 @@
|
||||
<div class="search-bar">
|
||||
<div class="search-bar-left">
|
||||
<el-form ref="searchForm" :inline="true" :model="formInline" class="demo-form-inline" :label-width="'auto'">
|
||||
<el-form-item label="品牌名称" prop="brandName">
|
||||
<el-input v-model="formInline.brandName" placeholder="请输入品牌名称" clearable />
|
||||
<el-form-item label="品牌名称" prop="brandTitle">
|
||||
<el-input v-model="formInline.brandTitle" placeholder="请输入品牌名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人" prop="applicant">
|
||||
<el-input v-model="formInline.applicant" placeholder="请输入申请人" clearable />
|
||||
<el-form-item label="申请人" prop="createUserName">
|
||||
<el-input v-model="formInline.createUserName" placeholder="请输入申请人" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请状态" prop="applyStatus">
|
||||
<el-select v-model="formInline.applyStatus" placeholder="请选择">
|
||||
<el-option label="全部" value="99" />
|
||||
<el-option label="未申请" value="0" />
|
||||
<el-option label="已申请" value="1" />
|
||||
<el-option label="已通过" value="2" />
|
||||
<el-option label="未通过" value="3" />
|
||||
<el-form-item label="申请状态" prop="status">
|
||||
<el-select v-model="formInline.status" placeholder="请选择">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="审核中" value="1" />
|
||||
<el-option label="审核通过" value="2" />
|
||||
<el-option label="审核驳回" value="3" />
|
||||
<el-option label="已失效" value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用状态" prop="useStatus">
|
||||
<!-- <el-form-item label="使用状态" prop="useStatus">
|
||||
<el-select v-model="formInline.useStatus" placeholder="请选择">
|
||||
<el-option label="全部" value="99" />
|
||||
<el-option label="无法使用" value="0" />
|
||||
<el-option label="正常使用" value="1" />
|
||||
<el-option label="暂未使用" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="startDate" style="margin-right: 0">
|
||||
<el-date-picker v-model="formInline.startDate" type="date" placeholder="请选择起始日期" clearable style="width: 160px" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="申请日期" prop="startTime" style="margin-right: 0">
|
||||
<el-date-picker v-model="formInline.startTime" type="date" placeholder="请选择起始日期" clearable style="width: 160px" />
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-right: 0">
|
||||
<span style="width: 30px; text-align: center; display: inline-block"> - </span>
|
||||
@ -62,10 +62,10 @@
|
||||
>
|
||||
<!-- 自定义-状态 -->
|
||||
<template #applyStatus="slotProps">
|
||||
<span v-if="slotProps.row.applyStatus == 0" class="color-gray">未申请</span>
|
||||
<span v-else-if="slotProps.row.applyStatus == 1" class="color-orange">已申请</span>
|
||||
<span v-else-if="slotProps.row.applyStatus == 2" class="color-green">已通过</span>
|
||||
<span v-else-if="slotProps.row.applyStatus == 3" class="color-red">未通过</span>
|
||||
<span v-if="slotProps.row.status == 1" class="color-orange">审核中</span>
|
||||
<span v-else-if="slotProps.row.status == 2" class="color-green">已通过</span>
|
||||
<span v-else-if="slotProps.row.status == 3" class="color-red">审核驳回</span>
|
||||
<span v-else-if="slotProps.row.status == 4" class="color-gray">已失效</span>
|
||||
</template>
|
||||
|
||||
<!-- 自定义-状态 -->
|
||||
@ -103,20 +103,19 @@ import { ref, reactive, computed, onMounted, onBeforeUnmount } from 'vue';
|
||||
import userHeader from './components/userHeader.vue';
|
||||
import tableComponent from './components/tableComponent.vue';
|
||||
import Mock from 'mockjs';
|
||||
|
||||
import { mainPage } from '../../apis/user';
|
||||
const formInline = reactive({
|
||||
brandName: '',
|
||||
applicant: '',
|
||||
guarantor: '',
|
||||
applyStatus: '99',
|
||||
useStatus: '99',
|
||||
startDate: '',
|
||||
brandTitle: '',
|
||||
createUserName: '',
|
||||
status: '',
|
||||
endDate: '',
|
||||
startTime: '',
|
||||
});
|
||||
|
||||
const searchForm = ref(null);
|
||||
const onSubmit = () => {
|
||||
console.log('submit!');
|
||||
loadData();
|
||||
};
|
||||
const resetForm = () => {
|
||||
searchForm.value.resetFields();
|
||||
@ -126,12 +125,11 @@ const resetForm = () => {
|
||||
const tableData = ref([]);
|
||||
// 列配置
|
||||
const columns = ref([
|
||||
{ prop: 'brandName', label: '品牌名称' },
|
||||
{ prop: 'applicant', label: '申请人' },
|
||||
{ prop: 'applyStatus', label: '申请状态', slotName: 'applyStatus' },
|
||||
{ prop: 'useStatus', label: '使用状态', slotName: 'useStatus' },
|
||||
{ prop: 'applyTime', label: '申请日期', width: '180px' },
|
||||
{ prop: 'action', label: '操作', slotName: 'action', width: '180' },
|
||||
{ prop: 'brandTitle', label: '品牌名称' },
|
||||
{ prop: 'createUserName', label: '申请人' },
|
||||
{ prop: 'status', label: '申请状态', slotName: 'applyStatus' },
|
||||
{ prop: 'createTime', label: '申请日期', width: '180px' },
|
||||
// { prop: 'action', label: '操作', slotName: 'action', width: '180' },
|
||||
]);
|
||||
// 生成模拟数据
|
||||
const generateMockData = () => {
|
||||
@ -151,10 +149,15 @@ const generateMockData = () => {
|
||||
};
|
||||
// 加载数据
|
||||
const loadData = () => {
|
||||
// 模拟API请求延迟
|
||||
setTimeout(() => {
|
||||
tableData.value = generateMockData();
|
||||
}, 500);
|
||||
mainPage(formInline).then((res) => {
|
||||
console.log(res);
|
||||
tableData.value = res.data.records;
|
||||
});
|
||||
// debugger;
|
||||
// // 模拟API请求延迟
|
||||
// setTimeout(() => {
|
||||
// tableData.value = generateMockData();
|
||||
// }, 500);
|
||||
};
|
||||
// 自定义表头类名,也可以在columns指定列中添加headerClassName: 'custom-header'
|
||||
const getHeaderClass = ({ column }) => {
|
||||
|
615
sub-operation-service/src/views/userCenter/orderDetails.vue
Normal file
615
sub-operation-service/src/views/userCenter/orderDetails.vue
Normal file
@ -0,0 +1,615 @@
|
||||
<template>
|
||||
<div>
|
||||
<common current-name="order">
|
||||
<template #main>
|
||||
<div class="sure-order-warp">
|
||||
<userHeader :title="'订单信息'"></userHeader>
|
||||
<!-- <div class="addr-list">
|
||||
<div class="addr-list-top">
|
||||
<div class="back">
|
||||
<el-icon><ArrowLeftBold /></el-icon>
|
||||
<span>确认收货地址</span>
|
||||
</div>
|
||||
<div class="addr-manage" @click="goAddressList()">管理地址</div>
|
||||
</div>
|
||||
<el-scrollbar>
|
||||
<div class="scrollbar-flex-content">
|
||||
<div
|
||||
v-for="(item, index) in addrlist"
|
||||
:key="item.id"
|
||||
class="addr-item"
|
||||
:class="currentAddr == item.id ? 'addr-item-act' : 'addr-item-normal'"
|
||||
@click="selectAddr(item.id)"
|
||||
@mouseover="hoverAddr(true, index)"
|
||||
@mouseleave="hoverAddr(false, index)"
|
||||
>
|
||||
<div class="addr-item-icon">
|
||||
<div class="icon-pos">
|
||||
<div class="iconfont icon-location"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="addr-item-info">
|
||||
<div class="region">{{ item.postArea || '--' }}</div>
|
||||
<div class="addr">{{ item.postAddress || '--' }}</div>
|
||||
<div class="link-name">
|
||||
{{ item.receiverName }} {{ item.receiverPhone }} <text v-if="currentAddr == item.id" style="color: #25bf82">当前选中</text>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div> -->
|
||||
|
||||
<div class="order-info">
|
||||
<div class="order-info-top">订单信息</div>
|
||||
<div class="order-statu-info">
|
||||
<div class="order-statu-info-list">订单编号:{{ datalist[0]?.orderNo }}</div>
|
||||
<div class="order-statu-info-list">创建时间:{{ datalist[0]?.orderNo }}</div>
|
||||
<div class="order-statu-info-list">支付时间:{{ datalist[0]?.orderNo }}</div>
|
||||
</div>
|
||||
<div class="order-info-list">
|
||||
<div class="content-item-warp">
|
||||
<div class="content-item-header">
|
||||
<div class="header-th first">商品</div>
|
||||
<div class="header-th other">规格</div>
|
||||
<div class="header-th other">原价</div>
|
||||
<div class="header-th other">数量</div>
|
||||
<div class="header-th other">小计</div>
|
||||
</div>
|
||||
<div class="content-item-list">
|
||||
<div v-for="(n, index) in datalist" :key="index" class="content-item">
|
||||
<div class="shop-info">
|
||||
<div class="shop-img">
|
||||
<costomImg
|
||||
:url="'images/ecommerce/' + 'pic.png'"
|
||||
:preview-list="[getAssetsFile('images/ecommerce/' + 'pic.png')]"
|
||||
:is-view="false"
|
||||
></costomImg>
|
||||
</div>
|
||||
<!-- <span class="shop-name txt-ellipsis clamp2">订单编号:{{ n.orderNo }}</span> -->
|
||||
</div>
|
||||
|
||||
<div v-if="n.orderItemInfos && n.orderItemInfos.length > 0" class="good-list">
|
||||
<div v-for="(g, indexg) in n.orderItemInfos" :key="indexg" class="good-item">
|
||||
<div class="good-img">
|
||||
<costomImg
|
||||
:url="'images/ecommerce/' + 'pic.png'"
|
||||
:preview-list="[getAssetsFile('images/ecommerce/' + 'pic.png')]"
|
||||
:is-view="false"
|
||||
></costomImg>
|
||||
</div>
|
||||
<div class="good-info">
|
||||
<div class="good-info-pos">
|
||||
<div class="txt-ellipsis clamp2">{{ g.productName || '--' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="good-price-num">
|
||||
<div class="good-price-num-pos">
|
||||
<div class="price">{{ g.unitPrice }} / {{ g.unit }}</div>
|
||||
<div class="total">{{ g.unitPrice }}</div>
|
||||
<div class="num">
|
||||
<div class="right-item">
|
||||
<el-input-number v-model="g.quantity" :disabled="true" :min="1">
|
||||
<template #suffix>
|
||||
<span>{{ g.unit }}</span>
|
||||
</template>
|
||||
</el-input-number>
|
||||
</div>
|
||||
</div>
|
||||
<div class="good-total">
|
||||
{{ (g.unitPrice * g.quantity).toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-item-bottom">
|
||||
<div class="num-total">
|
||||
共
|
||||
<span class="num-val">{{ totalNum }}</span
|
||||
>件商品
|
||||
</div>
|
||||
<div class="price-total">
|
||||
<div class="amount cost-item">
|
||||
<span>商品总价:</span>
|
||||
<span class="coat-val">{{ totalAmout.toFixed(2) }}</span>
|
||||
</div>
|
||||
<div class="freight cost-item">
|
||||
<span>运费:</span>
|
||||
<span class="coat-val">{{ carriage.toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="order-bottom">
|
||||
<div class="bottom-total">
|
||||
<span class="tips">实付款</span>
|
||||
<span class="total">{{ (totalAmout + carriage).toFixed(2) }}</span>
|
||||
</div>
|
||||
<div class="bottom-do">
|
||||
<el-button type="primary" @click="toSureOrder">提交订单</el-button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</common>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { userPostAddress, upOrderInfoList, confirmOrder } from '../../apis/user';
|
||||
import common from './components/common.vue';
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { isEmpty, getAssetsFile } from '@/utils';
|
||||
import userHeader from './components/userHeader.vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
let addrlist = ref([]);
|
||||
let currentAddr = ref(0);
|
||||
let total = ref(99);
|
||||
let orderList = ref([]);
|
||||
|
||||
onMounted(() => {
|
||||
getAddressList();
|
||||
getOrderInfo();
|
||||
});
|
||||
let datalist = ref([
|
||||
// {
|
||||
// id: '01',
|
||||
// shop: '银河生态农产品有限公司',
|
||||
// shopimg: '',
|
||||
// ischeck: false,
|
||||
// orderItemInfos: [
|
||||
// { id: '001', title: '耿马镇 原生态 有机 西红柿', price: 4.9, unit: '份', num: 2, ischeck: false },
|
||||
// { id: '002', title: '耿马镇 原生态 有机 西蓝花', price: 2.6, unit: '份', num: 100, ischeck: false },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// id: '02',
|
||||
// shop: '方立生态农产品有限公司',
|
||||
// shopimg: '',
|
||||
// ischeck: false,
|
||||
// orderItemInfos: [{ id: '001', title: '勐撒镇 原生态 有机 大白菜', price: 4.9, unit: '份', num: 2, ischeck: false }],
|
||||
// },
|
||||
]);
|
||||
const getAddressList = () => {
|
||||
userPostAddress().then((res) => {
|
||||
addrlist.value = res.data.records;
|
||||
currentAddr.value = addrlist.value[0].id;
|
||||
console.log(addrlist);
|
||||
addrlist.value.forEach((item) => {
|
||||
if (item.isDefault == '1') {
|
||||
currentAddr.value = item.id;
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const getOrderInfo = () => {
|
||||
upOrderInfoList({ id: route.query.id }).then((res) => {
|
||||
datalist.value = res.data.records;
|
||||
});
|
||||
};
|
||||
|
||||
const goAddressList = () => {
|
||||
router.push('/sub-operation-service/addressList');
|
||||
};
|
||||
|
||||
const selectAddr = (data) => {
|
||||
currentAddr.value = data;
|
||||
};
|
||||
//鼠标移入移出事件
|
||||
const hoverAddr = (data, index) => {
|
||||
console.log('data', data, index);
|
||||
addrlist.value.forEach((item, i) => {
|
||||
if (index == i) {
|
||||
item.isEditBtn = data;
|
||||
}
|
||||
});
|
||||
};
|
||||
//编辑地址
|
||||
const editAddr = (data) => {
|
||||
console.log('data', data);
|
||||
};
|
||||
|
||||
const toSureOrder = () => {
|
||||
confirmOrder({ id: route.query.id, userChooseAddressId: currentAddr.value }).then((res) => {
|
||||
// router.push('/sub-operation-service/orderSuccess');
|
||||
router.push({
|
||||
path: '/sub-operation-service/orderSuccess',
|
||||
query: { id: route.query.id },
|
||||
});
|
||||
// useRouter().push({ path: '/sub-operation-service/orderSuccess' });
|
||||
});
|
||||
};
|
||||
|
||||
let carriage = ref(0);
|
||||
let totalAmout = computed(() => {
|
||||
let num = 0;
|
||||
let list = [];
|
||||
if (datalist.value && datalist.value.length > 0) {
|
||||
list = datalist.value
|
||||
.map((m) => {
|
||||
return m.orderItemInfos;
|
||||
})
|
||||
.flat();
|
||||
|
||||
// console.info('totalAmout**************', list);
|
||||
if (list && list.length > 0) {
|
||||
num = list.reduce((acc, current) => {
|
||||
return acc + current.unitPrice * current.quantity;
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return num;
|
||||
});
|
||||
|
||||
let totalNum = computed(() => {
|
||||
let num = 0;
|
||||
let list = [];
|
||||
if (datalist && datalist.value.length > 0) {
|
||||
list = datalist.value
|
||||
.map((m) => {
|
||||
return m.orderItemInfos;
|
||||
})
|
||||
.flat();
|
||||
|
||||
if (list && list.length > 0) {
|
||||
num = list.reduce((acc, current) => {
|
||||
return acc + 1;
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return num;
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.sure-order-warp {
|
||||
width: 100%;
|
||||
.addr-list {
|
||||
overflow: hidden;
|
||||
margin: 16px 0;
|
||||
padding: 16px;
|
||||
border-radius: 16px;
|
||||
background: $color-fff;
|
||||
.addr-list-top {
|
||||
display: inline-flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 16px;
|
||||
width: 100%;
|
||||
.back {
|
||||
font-size: 20px;
|
||||
.el-icon {
|
||||
font-size: 30px;
|
||||
}
|
||||
.el-icon,
|
||||
span {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.addr-manage {
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.scrollbar-flex-content {
|
||||
display: flex;
|
||||
width: fit-content;
|
||||
gap: 16px;
|
||||
}
|
||||
.addr-item {
|
||||
display: inline-flex;
|
||||
justify-content: flex-start;
|
||||
padding: 16px 8px;
|
||||
width: 280px;
|
||||
border-radius: 16px;
|
||||
background: $color-fff;
|
||||
cursor: pointer;
|
||||
&.addr-item-act {
|
||||
border: 1px solid $color-main;
|
||||
.iconfont {
|
||||
color: $color-main !important;
|
||||
}
|
||||
}
|
||||
&.addr-item-normal {
|
||||
border: 1px solid $color-da;
|
||||
}
|
||||
.addr-item-icon,
|
||||
.addr-item-info {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
text-align: left;
|
||||
}
|
||||
.addr-item-icon {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
.iconfont {
|
||||
font-size: 20px;
|
||||
color: $color-666;
|
||||
}
|
||||
}
|
||||
.addr-item-info {
|
||||
padding-left: 8px;
|
||||
font-size: 15px;
|
||||
line-height: 24px;
|
||||
.region,
|
||||
.link-name {
|
||||
color: $color-999;
|
||||
position: relative;
|
||||
.bj {
|
||||
color: #25bf82;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.order-info {
|
||||
position: relative;
|
||||
padding: 16px;
|
||||
width: 100%;
|
||||
height: calc(100vh - 340px);
|
||||
border-radius: 16px;
|
||||
background: $color-fff;
|
||||
.order-info-top,
|
||||
.order-bottom,
|
||||
.order-info-list {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
padding: 16px;
|
||||
width: 100%;
|
||||
}
|
||||
.order-statu-info {
|
||||
text-align: left;
|
||||
margin-top: 40px;
|
||||
z-index: 1;
|
||||
padding: 16px;
|
||||
width: 100%;
|
||||
font-size: 18px;
|
||||
.order-statu-info-list {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
.order-info-top {
|
||||
top: 0;
|
||||
font-size: 20px;
|
||||
}
|
||||
.order-bottom {
|
||||
bottom: 0;
|
||||
display: inline-flex;
|
||||
justify-content: space-between;
|
||||
.bottom-total,
|
||||
.bottom-do {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.bottom-total {
|
||||
.tips,
|
||||
.total {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.tips {
|
||||
font-size: 30px;
|
||||
}
|
||||
.total {
|
||||
padding-left: 16px;
|
||||
font-size: 42px;
|
||||
color: $color-main;
|
||||
}
|
||||
.total::before {
|
||||
content: '¥';
|
||||
}
|
||||
}
|
||||
.bottom-do {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
::v-deep() {
|
||||
.el-button {
|
||||
display: inline-block !important;
|
||||
padding: 0 40px !important;
|
||||
height: 42px !important;
|
||||
font-size: 18px !important;
|
||||
line-height: 42px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.order-info-list {
|
||||
position: relative;
|
||||
top: 30px;
|
||||
left: 16px;
|
||||
padding: 16px;
|
||||
width: calc(100% - 32px);
|
||||
height: calc(100% - 150px);
|
||||
border-radius: 16px;
|
||||
background: $color-f5;
|
||||
.content-item-warp {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.content-item-header {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: inline-flex;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
gap: 16px;
|
||||
.header-th {
|
||||
display: inline-block;
|
||||
margin-bottom: 16px;
|
||||
font-size: 20px;
|
||||
color: $color-999;
|
||||
vertical-align: middle;
|
||||
line-height: 32px;
|
||||
&.first {
|
||||
width: 340px;
|
||||
text-align: left;
|
||||
}
|
||||
&.other {
|
||||
width: calc((100% - 340px) / 4);
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content-item-list {
|
||||
position: absolute;
|
||||
top: 48px;
|
||||
left: 0;
|
||||
overflow-y: auto;
|
||||
width: 100%;
|
||||
height: calc(100% - 100px);
|
||||
}
|
||||
.content-item {
|
||||
margin-bottom: 16px;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
.shop-info {
|
||||
display: inline-flex;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
gap: 16px;
|
||||
.shop-do,
|
||||
.shop-img,
|
||||
.shop-name {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.shop-img {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 4px;
|
||||
flex-direction: column;
|
||||
}
|
||||
.shop-do {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
flex-direction: column;
|
||||
}
|
||||
.shop-name {
|
||||
width: calc(100% - 62px);
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
.good-list {
|
||||
width: 100%;
|
||||
.good-item {
|
||||
display: inline-flex;
|
||||
justify-content: flex-start;
|
||||
margin: 8px 0;
|
||||
padding-left: 16px;
|
||||
width: 100%;
|
||||
gap: 16px;
|
||||
}
|
||||
.good-do,
|
||||
.good-img,
|
||||
.good-info,
|
||||
.good-price-num {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.good-do {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
.good-do-pos {
|
||||
}
|
||||
}
|
||||
.good-img {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
}
|
||||
.good-info {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 200px;
|
||||
flex-direction: column;
|
||||
.good-info-pos {
|
||||
font-size: 18px;
|
||||
color: $color-666;
|
||||
}
|
||||
}
|
||||
.good-price-num {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: calc(100% - 340px);
|
||||
flex-direction: column;
|
||||
.good-price-num-pos {
|
||||
display: inline-flex;
|
||||
justify-content: space-around;
|
||||
gap: 16px;
|
||||
.price,
|
||||
.total {
|
||||
font-size: 20px;
|
||||
}
|
||||
.price {
|
||||
font-weight: 400;
|
||||
}
|
||||
.total {
|
||||
font-weight: 700;
|
||||
color: $color-main;
|
||||
}
|
||||
.total::before {
|
||||
content: '¥';
|
||||
}
|
||||
.good-total {
|
||||
font-size: 16px;
|
||||
color: $color-main;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.content-item-bottom {
|
||||
position: absolute;
|
||||
bottom: -8px;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
display: inline-flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
line-height: 48px;
|
||||
.num-total,
|
||||
.price-total {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
font-size: 20px;
|
||||
.cost-item {
|
||||
display: inline-block;
|
||||
margin: 0 16px;
|
||||
.coat-val::before {
|
||||
content: '¥';
|
||||
}
|
||||
}
|
||||
}
|
||||
.num-total {
|
||||
.num-val {
|
||||
padding: 0 8px;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: $color-main;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -64,7 +64,7 @@
|
||||
<span class="tips">
|
||||
<div class="tips-pos">{{ currentIndex > -1 ? styleList[currentIndex].title + '扫码' : '扫码' }},支付</div>
|
||||
</span>
|
||||
<span class="pay-amount">{{ payAmout.toFixed(2) }}</span>
|
||||
<span class="pay-amount">{{ totalAmout.toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -82,22 +82,55 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import common from './components/common.vue';
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { isEmpty, getAssetsFile } from '@/utils';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import userHeader from './components/userHeader.vue';
|
||||
import costomImg from '@/components/costomImg.vue';
|
||||
import { qrImg } from '@/layouts/component/Header/base64img.js';
|
||||
import { userPostAddress, upOrderInfoList, confirmOrder } from '../../apis/user';
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
let totalAmout = ref(196);
|
||||
// let totalAmout = ref(196);
|
||||
let total = ref(99);
|
||||
let datalist = ref([]);
|
||||
|
||||
let styleList = reactive([
|
||||
{ title: '支付宝', name: 'alipay', icon: 'alipay', color: 'rgb(0, 159, 232)' },
|
||||
{ title: '微信', name: 'wx', icon: 'wxpay', color: 'rgb(40, 196, 69)' },
|
||||
]);
|
||||
|
||||
onMounted(() => {
|
||||
getOrderInfo();
|
||||
});
|
||||
|
||||
const getOrderInfo = () => {
|
||||
upOrderInfoList({ id: route.query.id }).then((res) => {
|
||||
datalist.value = res.data.records;
|
||||
});
|
||||
};
|
||||
|
||||
let totalAmout = computed(() => {
|
||||
let num = 0;
|
||||
let list = [];
|
||||
if (datalist.value && datalist.value.length > 0) {
|
||||
list = datalist.value
|
||||
.map((m) => {
|
||||
return m.orderItemInfos;
|
||||
})
|
||||
.flat();
|
||||
|
||||
// console.info('totalAmout**************', list);
|
||||
if (list && list.length > 0) {
|
||||
num = list.reduce((acc, current) => {
|
||||
return acc + current.unitPrice * current.quantity;
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return num;
|
||||
});
|
||||
|
||||
let currentPay = ref('wx');
|
||||
|
||||
const selectPayStyle = (name) => {
|
||||
|
@ -17,9 +17,12 @@
|
||||
<span class="del-txt">批量删除</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="conetnt-warp">
|
||||
<div v-if="data.length <= 0" class="empty">
|
||||
<img style="width: 300px; height: 300px" src="../../assets/images/empty.png" alt="" />
|
||||
</div>
|
||||
<div v-else class="conetnt-warp">
|
||||
<div class="content-item-warp">
|
||||
<div v-for="(n, index) in datalist" :key="index" class="content-item">
|
||||
<div v-for="(n, index) in data" :key="n.id" class="content-item">
|
||||
<div class="shop-info" @click="toCheckShop(index)">
|
||||
<div class="shop-do">
|
||||
<ischeck :value="n.ischeck"></ischeck>
|
||||
@ -31,35 +34,32 @@
|
||||
:is-view="false"
|
||||
></costomImg>
|
||||
</div>
|
||||
<span class="shop-name txt-ellipsis clamp2">{{ n.shop }}</span>
|
||||
<span class="shop-name txt-ellipsis clamp2">{{ n.cartName }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="n.goodlist && n.goodlist.length > 0" class="good-list">
|
||||
<div v-for="(g, indexg) in n.goodlist" :key="indexg" class="good-item">
|
||||
<div v-if="n.cartDetails && n.cartDetails.length > 0" class="good-list">
|
||||
<div v-for="(g, indexg) in n.cartDetails" :key="indexg" class="good-item">
|
||||
<div class="good-do" @click="toCheckGood(index, indexg)">
|
||||
<div class="good-do-pos">
|
||||
<ischeck :value="g.ischeck" size="24px"></ischeck>
|
||||
</div>
|
||||
</div>
|
||||
<div class="good-img" @click="toCheckGood(index, indexg)">
|
||||
<costomImg
|
||||
:url="'images/ecommerce/' + 'pic.png'"
|
||||
:preview-list="[getAssetsFile('images/ecommerce/' + 'pic.png')?.href ?? '']"
|
||||
:is-view="false"
|
||||
></costomImg>
|
||||
<!-- <costomImg :url="g.productImgUrl" :is-view="false"></costomImg> -->
|
||||
<img class="good-img" style="border-radius: 5px" :src="g.productImgUrl.split('?')[0]" alt="" />
|
||||
</div>
|
||||
<div class="good-info" @click="toCheckGood(index, indexg)">
|
||||
<div class="good-info-pos">
|
||||
<div class="txt-ellipsis clamp2">{{ g.title || '--' }}</div>
|
||||
<div class="txt-ellipsis clamp2">{{ g.productName || '--' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="good-price-num">
|
||||
<div class="good-price-num-pos">
|
||||
<div class="price" @click="toCheckGood(index, indexg)">{{ g.price }} / {{ g.unit }}</div>
|
||||
<div class="total" @click="toCheckGood(index, indexg)">{{ (g.price * g.num).toFixed(2) }}</div>
|
||||
<div class="total" @click="toCheckGood(index, indexg)">{{ (g.price * g.quantity).toFixed(2) }}</div>
|
||||
<div class="num">
|
||||
<div class="right-item">
|
||||
<el-input-number v-model="g.num" :min="1">
|
||||
<el-input-number v-model="g.quantity" :min="1" @change="numberChange(g.quantity, index, indexg)">
|
||||
<template #suffix>
|
||||
<span>{{ g.unit }}</span>
|
||||
</template>
|
||||
@ -83,7 +83,7 @@
|
||||
<span class="total">{{ totalAmout.toFixed(2) }}</span>
|
||||
</div>
|
||||
<div class="bottom-do">
|
||||
<el-button :disabled="datalist.length == 0" :type="datalist.length != 0 ? 'primary' : 'info'" @click="toSettlement">结算</el-button>
|
||||
<el-button :disabled="data.length == 0" :type="data.length != 0 ? 'primary' : 'info'" @click="toSettlement">结算</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -94,20 +94,28 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import common from './components/common.vue';
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { isEmpty, getAssetsFile } from '@/utils';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import userHeader from './components/userHeader.vue';
|
||||
import ischeck from './components/ischeck.vue';
|
||||
import costomImg from '@/components/costomImg.vue';
|
||||
import { useApp } from '@/hooks';
|
||||
import { shoppingCart, deleteChooseGoods, addToCart, delCartGood, setGoodsCount, commitOrder } from '../../apis/user';
|
||||
|
||||
const app = useApp();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
let number = ref(1);
|
||||
let total = ref(99);
|
||||
let isAll = ref(false);
|
||||
let data = ref([]);
|
||||
let page = reactive({
|
||||
current: 1,
|
||||
size: 10,
|
||||
});
|
||||
let ids = ref([]);
|
||||
|
||||
let datalist = reactive([
|
||||
{
|
||||
@ -142,20 +150,54 @@ let datalist = reactive([
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(() => {
|
||||
shoppingCart(page).then((res) => {
|
||||
console.log(res.data.records);
|
||||
data.value = res.data.records;
|
||||
addIsCheckProperty(data);
|
||||
});
|
||||
});
|
||||
|
||||
function addIsCheckProperty(data) {
|
||||
if (Array.isArray(data)) {
|
||||
data.forEach((item) => {
|
||||
item.ischeck = false; // 为当前层级添加属性
|
||||
if (item.cartDetails) {
|
||||
// 处理子集
|
||||
addIsCheckProperty(item.cartDetails);
|
||||
}
|
||||
if (item.records) {
|
||||
// 处理父级(如存在嵌套结构)
|
||||
addIsCheckProperty(item.records);
|
||||
}
|
||||
});
|
||||
} else if (typeof data === 'object' && data !== null) {
|
||||
data.ischeck = false;
|
||||
for (let key in data) {
|
||||
if (typeof data[key] === 'object') {
|
||||
addIsCheckProperty(data[key]); // 递归处理嵌套对象
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const numberChange = (value, index, indexg) => {
|
||||
console.log(value, index, indexg);
|
||||
setGoodsCount({ goodsId: data.value[index].cartDetails[indexg].id, count: value });
|
||||
};
|
||||
|
||||
let totalAmout = computed(() => {
|
||||
let num = 0;
|
||||
let list = [];
|
||||
if (datalist && datalist.length > 0) {
|
||||
list = datalist
|
||||
if (data && data.value.length > 0) {
|
||||
list = data.value
|
||||
.map((m) => {
|
||||
return m.goodlist;
|
||||
return m.cartDetails;
|
||||
})
|
||||
.flat();
|
||||
|
||||
// console.info('totalAmout**************', list);
|
||||
if (list && list.length > 0) {
|
||||
num = list.reduce((acc, current) => {
|
||||
return acc + (current.ischeck ? current.price * current.num : 0);
|
||||
return acc + (current.ischeck ? current.price * current.quantity : 0);
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
@ -164,17 +206,26 @@ let totalAmout = computed(() => {
|
||||
});
|
||||
|
||||
const toSettlement = () => {
|
||||
router.push('/sub-operation-service/sureOrder');
|
||||
commitOrder({ chooseChartDetails: ids.value }).then((res) => {
|
||||
// router.push('/sub-operation-service/sureOrder');
|
||||
router.push({
|
||||
path: '/sub-operation-service/sureOrder',
|
||||
query: { id: res.data },
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const toCheckAll = () => {
|
||||
isAll.value = !isAll.value;
|
||||
console.info('操作全选', isAll.value);
|
||||
if (datalist && datalist.length > 0) {
|
||||
datalist.forEach((m) => {
|
||||
if (data && data.value.length > 0) {
|
||||
data.value.forEach((m) => {
|
||||
m.ischeck = isAll.value;
|
||||
if (m.goodlist && m.goodlist.length > 0) {
|
||||
m.goodlist = setCheck(m.goodlist, isAll.value);
|
||||
if (m.cartDetails && m.cartDetails.length > 0) {
|
||||
m.cartDetails = setCheck(m.cartDetails, isAll.value);
|
||||
m.cartDetails.forEach((res, index) => {
|
||||
ids.value.push(res.id);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -187,23 +238,30 @@ const setCheck = (data, val) => {
|
||||
return { ...m, ischeck: val };
|
||||
});
|
||||
}
|
||||
|
||||
return list;
|
||||
};
|
||||
|
||||
const toCheckShop = (index) => {
|
||||
if (index > -1) {
|
||||
datalist[index].ischeck = !datalist[index].ischeck;
|
||||
if (datalist[index].goodlist && datalist[index].goodlist.length > 0) {
|
||||
datalist[index].goodlist = setCheck(datalist[index].goodlist, datalist[index].ischeck);
|
||||
data.value[index].ischeck = !data.value[index].ischeck;
|
||||
if (data.value[index].cartDetails && data.value[index].cartDetails.length > 0) {
|
||||
data.value[index].cartDetails = setCheck(data.value[index].cartDetails, data.value[index].ischeck);
|
||||
}
|
||||
setIsAll();
|
||||
}
|
||||
};
|
||||
|
||||
const toCheckGood = (indexP, index) => {
|
||||
const indexs = ids.value.indexOf(data.value[indexP].cartDetails[index].id);
|
||||
if (indexs !== -1) {
|
||||
// 如果值存在则删除
|
||||
ids.value.splice(indexs, 1);
|
||||
} else {
|
||||
// 如果值不存在则添加
|
||||
ids.value.push(data.value[indexP].cartDetails[index].id);
|
||||
}
|
||||
if (indexP > -1 && index > -1) {
|
||||
let list = datalist[indexP].goodlist;
|
||||
let list = data.value[indexP].cartDetails;
|
||||
list[index].ischeck = !list[index].ischeck;
|
||||
let len = list.length || 0;
|
||||
let checkNum = list.reduce((acc, current) => {
|
||||
@ -211,19 +269,19 @@ const toCheckGood = (indexP, index) => {
|
||||
}, 0);
|
||||
|
||||
if (checkNum > 0 && checkNum < len) {
|
||||
datalist[indexP].ischeck = false;
|
||||
data.value[indexP].ischeck = false;
|
||||
} else if (checkNum > 0 && checkNum == len) {
|
||||
datalist[indexP].ischeck = true;
|
||||
data.value[indexP].ischeck = true;
|
||||
} else {
|
||||
datalist[indexP].ischeck = false;
|
||||
data.value[indexP].ischeck = false;
|
||||
}
|
||||
setIsAll();
|
||||
}
|
||||
};
|
||||
|
||||
const setIsAll = () => {
|
||||
let len = datalist.length || 0;
|
||||
let checkNum = datalist.reduce((acc, current) => {
|
||||
let len = data.value.length || 0;
|
||||
let checkNum = data.value.reduce((acc, current) => {
|
||||
return acc + (current.ischeck ? 1 : 0);
|
||||
}, 0);
|
||||
|
||||
@ -245,15 +303,15 @@ const doSingleDel = (indexP, index) => {
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
datalist[indexP].goodlist.splice(index, 1);
|
||||
deleteChooseGoods({ goodsIds: [data.value[indexP].cartDetails[index].id] });
|
||||
data.value[indexP].cartDetails.splice(index, 1);
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
};
|
||||
//批量删除
|
||||
const doBatchDel = () => {
|
||||
// console.log('ischeck', datalist);
|
||||
const allUnchecked = isAllUnchecked(datalist);
|
||||
const allUnchecked = isAllUnchecked(data.value);
|
||||
console.log(allUnchecked); // true 或 false
|
||||
if (allUnchecked) {
|
||||
app.$message({
|
||||
@ -269,9 +327,10 @@ const doBatchDel = () => {
|
||||
})
|
||||
.then(() => {
|
||||
// 删除逻辑
|
||||
const filteredData = removeCheckedItems(datalist);
|
||||
const filteredData = removeCheckedItems(data);
|
||||
// console.log(filteredData);
|
||||
datalist = filteredData;
|
||||
data.value = filteredData;
|
||||
deleteChooseGoods(ids.value);
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
@ -282,7 +341,7 @@ function isAllUnchecked(data) {
|
||||
// 检查当前项的 ischeck 是否为 false
|
||||
const currentUnchecked = item.ischeck === false;
|
||||
// 如果有子项 goodlist,递归检查子项
|
||||
const childrenUnchecked = item.goodlist ? item.goodlist.every((child) => child.ischeck === false) : true;
|
||||
const childrenUnchecked = item.cartDetails ? item.cartDetails.every((child) => child.ischeck === false) : true;
|
||||
return currentUnchecked && childrenUnchecked;
|
||||
});
|
||||
}
|
||||
@ -295,8 +354,8 @@ function removeCheckedItems(data) {
|
||||
}
|
||||
|
||||
// 如果父项的 ischeck 为 false,但子项可能存在 ischeck 为 true 的情况
|
||||
if (item.goodlist) {
|
||||
item.goodlist = item.goodlist.filter((child) => child.ischeck !== true);
|
||||
if (item.cartDetails) {
|
||||
item.cartDetails = item.cartDetails.filter((child) => child.ischeck !== true);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -304,6 +363,13 @@ function removeCheckedItems(data) {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
.my-shoping-car-warp {
|
||||
width: 100%;
|
||||
.page-content-warp {
|
||||
|
@ -10,13 +10,13 @@
|
||||
<el-icon><ArrowLeftBold /></el-icon>
|
||||
<span>确认收货地址</span>
|
||||
</div>
|
||||
<div class="addr-manage">管理地址</div>
|
||||
<div class="addr-manage" @click="goAddressList()">管理地址</div>
|
||||
</div>
|
||||
<el-scrollbar>
|
||||
<div class="scrollbar-flex-content">
|
||||
<div
|
||||
v-for="(item, index) in addrlist"
|
||||
:key="item"
|
||||
:key="item.id"
|
||||
class="addr-item"
|
||||
:class="currentAddr == item.id ? 'addr-item-act' : 'addr-item-normal'"
|
||||
@click="selectAddr(item.id)"
|
||||
@ -29,11 +29,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="addr-item-info">
|
||||
<div class="region">{{ item.region || '--' }}</div>
|
||||
<div class="addr">{{ item.addr || '--' }}</div>
|
||||
<div class="region">{{ item.postArea || '--' }}</div>
|
||||
<div class="addr">{{ item.postAddress || '--' }}</div>
|
||||
<div class="link-name">
|
||||
{{ item.linkName }} {{ item.phone }}
|
||||
<span v-if="item.isEditBtn" class="bj" @click="editAddr(item)">编辑</span>
|
||||
{{ item.receiverName }} {{ item.receiverPhone }} <text v-if="currentAddr == item.id" style="color: #25bf82">当前选中</text>
|
||||
<!-- <span v-if="item.isEditBtn" class="bj" @click="editAddr(item)">编辑</span> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -65,8 +65,8 @@
|
||||
<span class="shop-name txt-ellipsis clamp2">{{ n.shop }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="n.goodlist && n.goodlist.length > 0" class="good-list">
|
||||
<div v-for="(g, indexg) in n.goodlist" :key="indexg" class="good-item">
|
||||
<div v-if="n.orderItemInfos && n.orderItemInfos.length > 0" class="good-list">
|
||||
<div v-for="(g, indexg) in n.orderItemInfos" :key="indexg" class="good-item">
|
||||
<div class="good-img">
|
||||
<costomImg
|
||||
:url="'images/ecommerce/' + 'pic.png'"
|
||||
@ -76,16 +76,16 @@
|
||||
</div>
|
||||
<div class="good-info">
|
||||
<div class="good-info-pos">
|
||||
<div class="txt-ellipsis clamp2">{{ g.title || '--' }}</div>
|
||||
<div class="txt-ellipsis clamp2">{{ g.productName || '--' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="good-price-num">
|
||||
<div class="good-price-num-pos">
|
||||
<div class="price">{{ g.price }} / {{ g.unit }}</div>
|
||||
<div class="total">{{ g.price }}</div>
|
||||
<div class="price">{{ g.unitPrice }} / {{ g.unit }}</div>
|
||||
<div class="total">{{ g.unitPrice }}</div>
|
||||
<div class="num">
|
||||
<div class="right-item">
|
||||
<el-input-number v-model="g.num" :min="1">
|
||||
<el-input-number v-model="g.quantity" :disabled="true" :min="1">
|
||||
<template #suffix>
|
||||
<span>{{ g.unit }}</span>
|
||||
</template>
|
||||
@ -93,7 +93,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="good-total">
|
||||
{{ (g.price * g.num).toFixed(2) }}
|
||||
{{ (g.unitPrice * g.quantity).toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -137,24 +137,65 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { userPostAddress, upOrderInfoList, confirmOrder } from '../../apis/user';
|
||||
import common from './components/common.vue';
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { isEmpty, getAssetsFile } from '@/utils';
|
||||
import userHeader from './components/userHeader.vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const addrlist = reactive([
|
||||
{ id: '001', region: '云南省 昆明市 呈贡区 彩云南路', addr: '星光小区 一单元 1楼 101', linkName: '李先生', phone: '13813575526', isEditBtn: false },
|
||||
{ id: '002', region: '云南省 昆明市 呈贡区 彩云南路', addr: '星光小区 一单元 1楼 102', linkName: '王先生', phone: '13813575528', isEditBtn: false },
|
||||
{ id: '003', region: '云南省 昆明市 呈贡区 彩云北路', addr: '星光小区 一单元 1楼 101', linkName: '李女士', phone: '13813575527', isEditBtn: false },
|
||||
{ id: '004', region: '云南省 昆明市 呈贡区 彩云南路', addr: '星光小区 一单元 1楼 102', linkName: '王女生', phone: '13813565525', isEditBtn: false },
|
||||
{ id: '005', region: '云南省 昆明市 呈贡区 彩云南路', addr: '星光小区 一单元 1楼 105', linkName: '张女生', phone: '13813565526', isEditBtn: false },
|
||||
]);
|
||||
|
||||
let currentAddr = ref('001');
|
||||
let addrlist = ref([]);
|
||||
let currentAddr = ref(0);
|
||||
let total = ref(99);
|
||||
let orderList = ref([]);
|
||||
|
||||
onMounted(() => {
|
||||
getAddressList();
|
||||
getOrderInfo();
|
||||
});
|
||||
let datalist = ref([
|
||||
// {
|
||||
// id: '01',
|
||||
// shop: '银河生态农产品有限公司',
|
||||
// shopimg: '',
|
||||
// ischeck: false,
|
||||
// orderItemInfos: [
|
||||
// { id: '001', title: '耿马镇 原生态 有机 西红柿', price: 4.9, unit: '份', num: 2, ischeck: false },
|
||||
// { id: '002', title: '耿马镇 原生态 有机 西蓝花', price: 2.6, unit: '份', num: 100, ischeck: false },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// id: '02',
|
||||
// shop: '方立生态农产品有限公司',
|
||||
// shopimg: '',
|
||||
// ischeck: false,
|
||||
// orderItemInfos: [{ id: '001', title: '勐撒镇 原生态 有机 大白菜', price: 4.9, unit: '份', num: 2, ischeck: false }],
|
||||
// },
|
||||
]);
|
||||
const getAddressList = () => {
|
||||
userPostAddress().then((res) => {
|
||||
addrlist.value = res.data.records;
|
||||
currentAddr.value = addrlist.value[0].id;
|
||||
console.log(addrlist);
|
||||
addrlist.value.forEach((item) => {
|
||||
if (item.isDefault == '1') {
|
||||
currentAddr.value = item.id;
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const getOrderInfo = () => {
|
||||
upOrderInfoList({ id: route.query.id }).then((res) => {
|
||||
datalist.value = res.data.records;
|
||||
});
|
||||
};
|
||||
|
||||
const goAddressList = () => {
|
||||
router.push('/sub-operation-service/addressList');
|
||||
};
|
||||
|
||||
const selectAddr = (data) => {
|
||||
currentAddr.value = data;
|
||||
@ -162,7 +203,7 @@ const selectAddr = (data) => {
|
||||
//鼠标移入移出事件
|
||||
const hoverAddr = (data, index) => {
|
||||
console.log('data', data, index);
|
||||
addrlist.forEach((item, i) => {
|
||||
addrlist.value.forEach((item, i) => {
|
||||
if (index == i) {
|
||||
item.isEditBtn = data;
|
||||
}
|
||||
@ -173,45 +214,32 @@ const editAddr = (data) => {
|
||||
console.log('data', data);
|
||||
};
|
||||
|
||||
let datalist = reactive([
|
||||
{
|
||||
id: '01',
|
||||
shop: '银河生态农产品有限公司',
|
||||
shopimg: '',
|
||||
ischeck: false,
|
||||
goodlist: [
|
||||
{ id: '001', title: '耿马镇 原生态 有机 西红柿', price: 4.9, unit: '份', num: 2, ischeck: false },
|
||||
{ id: '002', title: '耿马镇 原生态 有机 西蓝花', price: 2.6, unit: '份', num: 100, ischeck: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '02',
|
||||
shop: '方立生态农产品有限公司',
|
||||
shopimg: '',
|
||||
ischeck: false,
|
||||
goodlist: [{ id: '001', title: '勐撒镇 原生态 有机 大白菜', price: 4.9, unit: '份', num: 2, ischeck: false }],
|
||||
},
|
||||
]);
|
||||
|
||||
const toSureOrder = () => {
|
||||
router.push('/sub-operation-service/orderSuccess');
|
||||
confirmOrder({ id: route.query.id, userChooseAddressId: currentAddr.value }).then((res) => {
|
||||
// router.push('/sub-operation-service/orderSuccess');
|
||||
router.push({
|
||||
path: '/sub-operation-service/orderSuccess',
|
||||
query: { id: route.query.id },
|
||||
});
|
||||
// useRouter().push({ path: '/sub-operation-service/orderSuccess' });
|
||||
});
|
||||
};
|
||||
|
||||
let carriage = ref(98);
|
||||
let carriage = ref(0);
|
||||
let totalAmout = computed(() => {
|
||||
let num = 0;
|
||||
let list = [];
|
||||
if (datalist && datalist.length > 0) {
|
||||
list = datalist
|
||||
if (datalist.value && datalist.value.length > 0) {
|
||||
list = datalist.value
|
||||
.map((m) => {
|
||||
return m.goodlist;
|
||||
return m.orderItemInfos;
|
||||
})
|
||||
.flat();
|
||||
|
||||
// console.info('totalAmout**************', list);
|
||||
if (list && list.length > 0) {
|
||||
num = list.reduce((acc, current) => {
|
||||
return acc + current.price * current.num;
|
||||
return acc + current.unitPrice * current.quantity;
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
@ -222,10 +250,10 @@ let totalAmout = computed(() => {
|
||||
let totalNum = computed(() => {
|
||||
let num = 0;
|
||||
let list = [];
|
||||
if (datalist && datalist.length > 0) {
|
||||
list = datalist
|
||||
if (datalist && datalist.value.length > 0) {
|
||||
list = datalist.value
|
||||
.map((m) => {
|
||||
return m.goodlist;
|
||||
return m.orderItemInfos;
|
||||
})
|
||||
.flat();
|
||||
|
||||
@ -266,6 +294,7 @@ let totalNum = computed(() => {
|
||||
}
|
||||
.addr-manage {
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.scrollbar-flex-content {
|
||||
|
@ -6,14 +6,17 @@
|
||||
<userHeader :title="'订单管理'"></userHeader>
|
||||
<div class="user-orders-content">
|
||||
<div class="order-tab">
|
||||
<el-tabs v-model="activeCurrent">
|
||||
<el-tabs v-model="activeCurrent" @tab-change="handleClick">
|
||||
<el-tab-pane v-for="(t, indext) in bottomList" :key="indext" :label="t.title" :name="t.name"> </el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<div class="order-list-warp">
|
||||
<div class="order-list">
|
||||
<div v-for="(o, indexo) in orderList" :key="indexo" class="order-item">
|
||||
<div v-show="!show" class="empty">
|
||||
<img style="width: 300px; height: 300px" src="../../assets/images/empty.png" alt="" />
|
||||
</div>
|
||||
<div v-for="(o, indexo) in store.data.records" v-show="show" :key="indexo" class="order-item">
|
||||
<div class="order-item-top">
|
||||
<div class="top-l">
|
||||
<div class="top-item">
|
||||
@ -28,31 +31,33 @@
|
||||
<div class="top-r">
|
||||
<div class="top-item">
|
||||
<div class="label">订单金额:</div>
|
||||
<div class="val amount">{{ o.payAmount.toFixed(2) || '0.00' }}</div>
|
||||
<div class="val amount">{{ o.totalAmount.toFixed(2) || '0.00' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="o.goodlist && o.goodlist.length > 0" class="order-item-content">
|
||||
<div v-if="o.orderItemInfos && o.orderItemInfos.length > 0" class="order-item-content">
|
||||
<div class="content-list">
|
||||
<div v-for="(g, indexg) in o.goodlist" :key="indexg" class="good-item">
|
||||
<div v-for="(g, indexg) in o.orderItemInfos" :key="indexg" class="good-item">
|
||||
<div class="good-img">
|
||||
<costomImg
|
||||
<img class="good-img" :src="g.productImage" alt="" />
|
||||
<!-- <costomImg
|
||||
:url="'images/ecommerce/' + 'pic.png'"
|
||||
:preview-list="[getAssetsFile('images/ecommerce/' + 'pic.png')?.href ?? '']"
|
||||
:is-view="false"
|
||||
></costomImg>
|
||||
></costomImg> -->
|
||||
</div>
|
||||
<div class="good-info">
|
||||
<div class="good-info-pos">
|
||||
<div class="txt-ellipsis clamp2">{{ g.title || '--' }}</div>
|
||||
<div class="txt-ellipsis clamp2">{{ g.productName || '--' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="good-price-num">
|
||||
<div class="good-price-num-pos">
|
||||
<div class="price">{{ g.price }} / {{ g.unit }} * {{ g.num }}</div>
|
||||
<div class="price">{{ g.unitPrice }} / {{ g.unit }} * {{ g.quantity }}</div>
|
||||
<div class="total">
|
||||
<div class="amount">{{ (g.price * g.num + g.carriage).toFixed(2) }}</div>
|
||||
<div class="carriage">( 含运费{{ g.carriage.toFixed(2) }})</div>
|
||||
<div class="amount">{{ (g.unitPrice * g.quantity).toFixed(2) }}</div>
|
||||
<!-- <div class="amount">{{ (g.unitPrice * g.quantity + g.carriage).toFixed(2) }}</div> -->
|
||||
<!-- <div class="carriage">( 含运费{{ g.carriage.toFixed(2) }})</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -60,15 +65,30 @@
|
||||
</div>
|
||||
<div class="content-right">
|
||||
<div class="content-right-pos">
|
||||
<div v-if="o.status == 0" class="right-item do-btn">
|
||||
<el-button type="primary" @click="doPay">立即付款</el-button>
|
||||
<div v-if="o.orderStatus == '1'" class="right-item do-btn">
|
||||
<el-button type="primary" @click="doPay(o.id)">立即付款</el-button>
|
||||
</div>
|
||||
<div v-if="o.status == 0" class="right-item do-btn">
|
||||
<el-button @click="doCancel">取消订单</el-button>
|
||||
<div v-if="o.orderStatus == '1'" class="right-item do-btn">
|
||||
<el-button @click="doCancel(o.id)">取消订单</el-button>
|
||||
</div>
|
||||
<div v-if="o.orderStatus == '5'" class="right-item">已发货</div>
|
||||
<div v-if="o.orderStatus == '5'" class="right-item text-link">快递单号</div>
|
||||
<!-- <div class="right-item text-link" @click="goInfo(o.id)">订单详情</div> -->
|
||||
<div class="right-item text-link">
|
||||
{{
|
||||
o.orderStatus == '7'
|
||||
? '已取消'
|
||||
: o.orderStatus == '8'
|
||||
? '已完成'
|
||||
: o.orderStatus == '4'
|
||||
? '已发货'
|
||||
: o.orderStatus == '5'
|
||||
? '待收货'
|
||||
: o.orderStatus == '6'
|
||||
? '已收货'
|
||||
: ''
|
||||
}}
|
||||
</div>
|
||||
<div v-if="o.status != 0" class="right-item">已发货</div>
|
||||
<div v-if="o.status != 0" class="right-item text-link">快递单号</div>
|
||||
<div class="right-item text-link">订单详情</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -83,21 +103,59 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import common from './components/common.vue';
|
||||
import { ref, reactive } from 'vue';
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { isEmpty, getAssetsFile } from '@/utils';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import userHeader from './components/userHeader.vue';
|
||||
import { cancelOrder } from '../../apis/user';
|
||||
import { useGetUserOrder } from '../../store/modules/userOrder';
|
||||
let store = useGetUserOrder();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
let page = reactive({
|
||||
current: 1,
|
||||
size: 10,
|
||||
});
|
||||
let show = ref(false);
|
||||
let handleClick = (value) => {
|
||||
page.orderStatus = value;
|
||||
store.getData(page).then((res) => {
|
||||
console.log(res);
|
||||
if (res.records.length > 0) {
|
||||
show.value = true;
|
||||
} else {
|
||||
show.value = false;
|
||||
}
|
||||
console.log(show.value);
|
||||
});
|
||||
};
|
||||
|
||||
const goInfo = (id) => {
|
||||
router.push({
|
||||
path: '/sub-operation-service/orderDetails',
|
||||
query: { id: id },
|
||||
});
|
||||
};
|
||||
|
||||
let bottomList = reactive([
|
||||
{ title: '全部', name: 'all' },
|
||||
{ title: '待付款', name: 'topay' },
|
||||
{ title: '待发货', name: 'pending' },
|
||||
{ title: '待收货', name: 'receive' },
|
||||
{ title: '已发货', name: 'sendout' },
|
||||
{ title: '待付款', name: '1' },
|
||||
{ title: '待发货', name: '3' },
|
||||
{ title: '待收货', name: '5' },
|
||||
{ title: '已发货', name: '6' },
|
||||
]);
|
||||
|
||||
onMounted(() => {
|
||||
page.orderStatus = 'all';
|
||||
store.getData(page).then((res) => {
|
||||
if (res.records.length > 0) {
|
||||
show.value = true;
|
||||
} else {
|
||||
show.value = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
let activeCurrent = ref('all');
|
||||
|
||||
let orderList = reactive([
|
||||
@ -137,9 +195,18 @@ let orderList = reactive([
|
||||
},
|
||||
]);
|
||||
|
||||
const doPay = () => {};
|
||||
const doPay = (id) => {
|
||||
router.push({
|
||||
path: '/sub-operation-service/orderSuccess',
|
||||
query: { id: id },
|
||||
});
|
||||
};
|
||||
|
||||
const doCancel = () => {};
|
||||
const doCancel = (id) => {
|
||||
cancelOrder({ id: id }).then((res) => {
|
||||
store.getData(page);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.user-orders-warp {
|
||||
@ -186,6 +253,13 @@ const doCancel = () => {};
|
||||
height: calc(100% - 60px);
|
||||
.order-list {
|
||||
width: 100%;
|
||||
.empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
.order-item {
|
||||
width: 100%;
|
||||
.order-item-top {
|
||||
|
@ -32,11 +32,11 @@ export default defineConfig(({ command, mode }) => {
|
||||
minify: 'terser',
|
||||
},
|
||||
server: {
|
||||
origin: 'http://localhost:9526',
|
||||
host: '0.0.0.0',
|
||||
port: VITE_PORT,
|
||||
open: true,
|
||||
https: false,
|
||||
origin: 'http://localhost:9526',
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user