夏滨个人中心

This commit is contained in:
13713575202 2025-06-10 13:54:50 +08:00
parent adaf7c1110
commit e092fc94cd
9 changed files with 561 additions and 616 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -1,6 +1,6 @@
<template>
<div class="platform">
<h2 class="platform-title">数字农业产业管理平台</h2>
<h2 class="platform-title">全域数字农业产业管理平台</h2>
<div class="platform-panel">
<div class="platform-panel-item">
<div class="icon"><img :src="getAssetsFile('images/platform/icon-zw.png')" /></div>
@ -51,14 +51,25 @@ const gotoPage = (row) => {
min-height: 100%;
background-image: url('@/assets/images/platform/bg.png');
background-size: cover;
.platform-title {
height: 156px;
line-height: 50px;
width: 98%;
font-size: 100px;
text-align: center;
color: #fff;
transform: skewX(-10deg); /* 沿X轴倾斜-15度 */
display: inline-block; /* 需要设置为inline-block或block */
letter-spacing: 5px;
}
&-title {
width: 1200px;
height: 156px;
margin: 0 auto 20px;
padding-top: 120px;
text-indent: -999rem;
background-image: url('@/assets/images/platform/title.png');
// text-indent: -999rem;
// background-image: url('@/assets/images/platform/title.png');
background-size: 100%;
background-repeat: no-repeat;
background-position: center;

View File

@ -104,3 +104,24 @@ export function mainPage(params = {}) {
params,
});
}
//修改地址
export function updateOrderReceiveAddress(params = {}) {
return request('/user-center/orderInfo/updateOrderReceiveAddress', {
method: 'GET',
params,
});
}
//获取订单详情
export function orderInfoGetById(params = {}) {
return request('/user-center/orderInfo/getById', {
method: 'GET',
params,
});
}
//申请退款
export function refundApprove(params = {}) {
return request('/user-center/refund/refundApprove', {
method: 'POST',
data: params,
});
}

View File

@ -71,13 +71,13 @@ export const constantRoutes = [
path: '/sub-operation-service/userOrders',
component: () => import('@/views/userCenter/userOrders.vue'),
name: 'userOrders',
meta: { title: '我的订单' },
meta: { title: '我的订单', keepAlive: true },
},
{
path: '/sub-operation-service/orderDetails',
component: () => import('@/views/userCenter/orderDetails.vue'),
name: 'orderDetails',
meta: { title: '订单详情' },
meta: { title: '订单详情', keepAlive: true },
},
{
path: '/sub-operation-service/userLands',
@ -438,4 +438,13 @@ const router = createRouter({
routes: constantRoutes,
});
router.beforeEach((to, from) => {
console.log(from.path);
console.log(to.path);
if (from.path === '/sub-operation-service/orderDetails' && to.path === '/sub-operation-service/userOrders') {
to.meta.keepAlive = true; // 从详情页返回列表页时启用缓存
}
});
export default router;

View File

@ -1,7 +1,7 @@
<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 :label-position="labelPosition" label-width="130px" :model="formLabelAlign" style="max-width: 1000px">
<el-form-item label="联系人" prop="receiverName" :rules="[{ required: true, message: '请输入联系人' }]">
<el-input v-model="formLabelAlign.receiverName" />
</el-form-item>
@ -9,14 +9,13 @@
<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-cascader v-model="formLabelAlign.postArea" style="width: 100%" :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-input v-model="formLabelAlign.postAddress" :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" />
</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-switch v-model="formLabelAlign.isDefault" style="margin-top: -3px" size="large" active-text="是" inactive-text="否" />
</el-form-item>
</el-form>
<template #footer>
@ -39,71 +38,95 @@
</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 class="up-text" @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 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" :style="{ height: tableViewportHeight + 'px' }">
<tableComponent
:table-data="data"
:columns="columns"
:show-border="false"
:show-selection="fasle"
:header-cell-class-name="getHeaderClass"
@page-change="handlePaginationChange"
@selection-change="handleSelectionChange"
>
<template #isDefault="slotProps">
<div style="width: 120px; display: flex; align-items: center; justify-content: flex-start">
<el-checkbox
:disabled="slotProps.row.isDefault == '1' ? false : true"
:checked="slotProps.row.isDefault == '1' ? true : false"
size="large"
/>
</div>
<!-- <div class="shop-img">
<costomImg
:url="'images/ecommerce/' + 'pic.png'"
:preview-list="[getAssetsFile('images/ecommerce/' + 'pic.png')?.href ?? '']"
:is-view="false"
></costomImg>
</div> -->
</template>
<template #postAddress="slotProps">
<div style="display: flex; align-items: center">{{ slotProps.row.postArea.join(',') }}{{ slotProps.row.postAddress }}</div>
</template>
<template #action="slotProps">
<div style="width: 100px; display: flex; align-items: center; justify-content: space-between">
<div class="upButton" @click="showDialogVisible(slotProps.row)">编辑</div>
<div class="upButton" @click="del(slotProps.row)">删除</div>
</div>
</template>
</tableComponent>
<!-- <el-table
:show-selection="true"
:header-cell-class-name="getHeaderClass"
:data="data"
style="width: 100%"
@page-change="handlePaginationChange"
@selection-change="handleSelectionChange"
>
<el-table-column prop="date" label="默认收货地址" width="120">
<template #default="slotProps">
<div style="width: 120px; display: flex; align-items: center; justify-content: flex-start">
<el-checkbox
:disabled="slotProps.row.isDefault == '1' ? false : true"
:checked="slotProps.row.isDefault == '1' ? true : false"
size="large"
/>
</div>
</template>
</el-table-column>
<el-table-column prop="receiverName" label="收货人" width="120" />
<el-table-column prop="receiverPhone" label="联系电话" width="160" />
<el-table-column label="详细地址">
<template #default="slotProps">
<div style="display: flex; align-items: center">{{ slotProps.row.postArea.join(',') }}{{ slotProps.row.postAddress }}</div>
</template>
</el-table-column>
<el-table-column prop="date" label="操作" width="180">
<template #default="slotProps">
<div style="width: 100px; display: flex; align-items: center; justify-content: space-between">
<div class="upButton" @click="showDialogVisible(slotProps.row)">编辑</div>
<div class="upButton" @click="del(slotProps.row)">删除</div>
</div>
</template>
</el-table-column>
</el-table> -->
<!-- <div v-for="(n, index) in data" :key="n.id" class="content-item">
<div class="shop-info">
<div class="shop-do" @click="toCheckShop(index)"></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>
@ -121,6 +144,7 @@ import userHeader from './components/userHeader.vue';
import ischeck from './components/ischeck.vue';
import costomImg from '@/components/costomImg.vue';
import { useApp } from '@/hooks';
import tableComponent from './components/tableComponent.vue';
import {
shoppingCart,
deleteChooseGoods,
@ -155,6 +179,57 @@ let formLabelAlign = reactive({
isDefault: false,
});
const columns = ref([
{ prop: 'isDefault', label: '是否默认地址', slotName: 'isDefault', width: '180px' },
{ prop: 'receiverName', label: '联系人' },
{ prop: 'receiverPhone', label: '联系人手机号' },
{ prop: 'postAddress', label: '详细地址', slotName: 'postAddress', width: '250px' },
{ prop: 'action', label: '操作', slotName: 'action', width: '180' },
]);
const titleRef = ref(null);
const searchBarRef = ref(null);
const tableViewportHeight = ref(0);
//
const calculateTableHeight = () => {
//
const windowHeight = window.innerHeight;
//
const headerHeight = titleRef.value?.$el?.offsetHeight || 0;
const searchBarHeight = searchBarRef.value?.offsetHeight || 0;
//
const paddingCompensation = 60;
//
tableViewportHeight.value = windowHeight - headerHeight - searchBarHeight - paddingCompensation - 80;
// console.log(tableViewportHeight.value);
};
// ,columnsheaderClassName: 'custom-header'
const getHeaderClass = ({ column }) => {
return 'custom-header';
};
//
const handlePaginationChange = ({ page, pageSize }) => {
console.log('分页变化:', page, pageSize);
// API
// fetchData(page, limit,pageSize)
};
//
const handleSelectionChange = (selection) => {
console.log('选中项:', selection);
};
let nowClickRow = ref(null);
//
const handleEdit = (row, num) => {
nowClickRow.value = row;
console.log('编辑的行:', row);
console.log('第几个按钮:', num);
};
const options = json;
const handleClose = () => {
@ -194,6 +269,7 @@ const submit = (value) => {
onMounted(() => {
getUserAddressList();
calculateTableHeight();
});
const handleChange = (value) => {
@ -203,6 +279,9 @@ const handleChange = (value) => {
const getUserAddressList = () => {
userPostAddress(page).then((res) => {
res.data.records.forEach((item) => {
item.postArea = item.postArea.split(',');
});
console.log(res.data.records);
data.value = res.data.records;
addIsCheckProperty(data);
@ -428,12 +507,36 @@ function removeCheckedItems(data) {
}
</script>
<style lang="scss" scoped>
:deep(.el-checkbox__inner) {
border-radius: 50%;
width: 16px;
height: 16px;
background-color: #25bf82;
}
:deep(.el-checkbox__inner::after) {
border: none;
width: 6px;
height: 6px;
background: #25bf82;
}
.up-text {
font-size: 20px;
color: #25bf82;
margin-right: 75px;
cursor: pointer;
}
.upButton {
cursor: pointer;
color: #25bf82;
font-size: 15px;
}
.my-shoping-car-warp {
width: 100%;
.page-content-warp {
position: relative;
overflow: hidden;
margin: 16px 0 0 16px;
margin: 16px 0 0;
width: 100%;
height: calc(100vh - 135px);
border-radius: 16px;
@ -531,7 +634,7 @@ function removeCheckedItems(data) {
}
.conetnt-warp {
overflow-y: auto;
padding: 80px 16px 96px;
// padding: 80px 16px 96px;
width: 100%;
height: 100%;
.content-item-warp {

View File

@ -1,139 +1,156 @@
<template>
<div>
<el-dialog v-model="refundVs" title="退货/退款" width="800" :before-close="handleClose">
<div class="refundVs-title">退货/退款原因</div>
<el-select v-model="optionsValue" placeholder="Select" size="large" style="width: 765px" @change="change">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<div class="refundVs-title" style="margin-top: 15px">退货/退款描述</div>
<el-input v-model="input" type="textarea" size="large" style="width: 765px" placeholder="退货/退款描述" clearable />
<template #footer>
<div class="dialog-footer">
<el-button @click="refundVs = false">取消</el-button>
<el-button type="primary" @click="upRefund()"> 确认 </el-button>
</div>
</template>
</el-dialog>
<el-dialog v-model="dialogVisible" title="修改地址" width="800" :before-close="handleClose">
<el-radio-group v-model="radio1" @change="changeAddress">
<el-radio v-for="(item, index) in data" :key="item.id" :value="item.id"
><div style="font-size: 15px">
联系人:{{ item.receiverName }}, 联系人手机号:{{ item.receiverPhone }}, 地址:{{ item.postArea }} {{ item.postAddress }}
</div></el-radio
>
</el-radio-group>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="upAddress()"> 确认 </el-button>
</div>
</template>
</el-dialog>
<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="user-orders-warp">
<userHeader :title="'订单详情'"></userHeader>
<div class="user-orders-content">
<div class="order-tab">
<div class="order-tab-title">
<el-icon style="cursor: pointer" size="30" @click="back()"><ArrowLeftBold /></el-icon>
<span style="font-weight: bold; color: #25bf82; font-size: 20px">
{{
JSON.parse(route.query.page).orderStatus == '1'
? '待支付'
: JSON.parse(route.query.page).orderStatus == '2' || JSON.parse(route.query.page).orderStatus == '3'
? '待发货'
: JSON.parse(route.query.page).orderStatus == '4' || JSON.parse(route.query.page).orderStatus == '5'
? '已发货'
: JSON.parse(route.query.page).orderStatus == '6'
? '已收货'
: JSON.parse(route.query.page).orderStatus == '7'
? '已取消'
: JSON.parse(route.query.page).orderStatus == '8'
? '已完成'
: ''
}}</span
>
<div class="addr-item-icon">
<div class="icon-pos">
<div class="iconfont icon-location"></div>
<span v-if="JSON.parse(route.query.page).orderStatus == '1'" style="font-size: 15px">在71小时59分59秒之前发货</span>
</div>
</div>
<div class="order-list-warp">
<div class="order-list-warp-left">
<div style="display: flex; align-items: center; justify-content: flex-start; margin-top: 20px">
<el-icon size="30"><LocationFilled /></el-icon>
<div class="order-list-warp-left-address">
<div>{{ detailsData.receiverAddress }}</div>
<div>{{ detailsData.receiverName }} {{ detailsData.receiverPhone }}</div>
</div>
</div>
<div class="order-list-warp-left-title">商品信息</div>
<div v-for="(item, index) in detailsData.orderItemInfos" :key="item.id" class="order-list-warp-left-goods">
<div class="order-list-warp-left-goods-list">
<img style="width: 100px; height: 100px" :src="item.productImage" alt="" />
<div class="order-list-warp-left-goods-list-info">
<div class="order-list-warp-left-goods-list-info-title">{{ item.productName }}</div>
<div class="order-list-warp-left-goods-list-info-info">{{ item.unitPrice }}/{{ item.unit }}</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 style="color: #25bf82; font-size: 15px">{{ item.subtotalAmount }}</div>
<div style="font-size: 15px; color: #999999; width: 50px; text-align: right">x{{ item.quantity }}</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 class="order-list-warp-right">
<div style="margin-top: 20px">
<div style="width: 100%; text-align: left; font-size: 18px; font-weight: bold">订单详情</div>
<div class="order-list-warp-right-list">
<div>订单编号</div>
<div style="color: #000000">{{ detailsData.orderNo }}</div>
</div>
<div class="order-list-warp-right-list">
<div>订单备注</div>
<div style="color: #000000">{{ detailsData.orderNote ?? '暂无备注' }}</div>
</div>
<div class="order-list-warp-right-list">
<div>商品总数</div>
<div style="color: #000000">{{ detailsData.totalQuantity }}</div>
</div>
<div class="order-list-warp-right-list">
<div>创建时间</div>
<div style="color: #999999">{{ detailsData.createTime }}</div>
</div>
<div v-if="detailsData.paymentTime" class="order-list-warp-right-list">
<div>付款时间</div>
<div style="color: #999999">{{ detailsData.paymentTime }}</div>
</div>
</div>
<div class="content-item-bottom">
<div class="num-total">
<span class="num-val">{{ totalNum }}</span
>件商品
<div v-if="detailsData.totalAmount" style="margin-top: 30px">
<div style="width: 100%; text-align: left; font-size: 18px; font-weight: bold">付款信息</div>
<div class="order-list-warp-right-list">
<div>商品总价</div>
<div style="color: #000000">{{ detailsData.totalAmount }}</div>
</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 class="order-list-warp-right-list">
<div>运费</div>
<div style="color: #000000">{{ detailsData.totalShipFee }}</div>
</div>
<div class="order-list-warp-right-list">
<div>优惠金额</div>
<div style="color: #999999">{{ detailsData.discountAmount }}</div>
</div>
<div class="order-list-warp-right-list">
<div>实付金额</div>
<div style="color: #999999">{{ detailsData.payableAmount }}</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 style="display: flex; align-items: center; justify-content: start">
<div v-if="detailsData.orderStatus == '1'" class="button-bottom" @click="doPay(1)">立即付款</div>
<div
v-if="
detailsData.orderStatus == '2' || detailsData.orderStatus == '3' || detailsData.orderStatus == '4' || detailsData.orderStatus == '5'
"
class="button-bottom"
@click="confirmReceipt()"
>
确认收货
</div>
<div class="bottom-do">
<el-button type="primary" @click="toSureOrder">提交订单</el-button>
<div class="button-bottoms" @click="reAddress()">修改地址</div>
<div
v-if="
detailsData.orderStatus == '2' || detailsData.orderStatus == '3' || detailsData.orderStatus == '4' || detailsData.orderStatus == '5'
"
class="button-bottoms"
@click="refund()"
>
退货/退款
</div>
</div> -->
<div v-if="detailsData.orderStatus == '1'" class="button-bottoms" @click="doCancel">取消订单</div>
<!-- <div class="button-bottoms">打印订单</div> -->
</div>
</div>
</div>
</template>
@ -144,472 +161,259 @@
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';
import { cancelOrder, updateOrderReceiveAddress, orderInfoGetById, refundApprove } from '../../apis/user';
import { useGetUserOrder } from '../../store/modules/userOrder';
let store = useGetUserOrder();
let dialogVisible = ref(false);
let refundVs = ref(false);
const router = useRouter();
const route = useRoute();
let addressId = ref(0);
let data = ref([]);
let detailsData = ref([]);
let radio1 = ref(0);
let input = ref('');
let page = reactive({
orderStatus: 1,
current: 1,
size: 10,
});
let optionsValue = ref('不想要了');
let addrlist = ref([]);
let currentAddr = ref(0);
let total = ref(99);
let orderList = ref([]);
const options = [
{
value: '不想要了',
label: '不想要了',
},
{
value: '与卖家协商一致',
label: '与卖家协商一致',
},
{
value: '货物损坏',
label: '货物损坏',
},
{
value: '实物与宣传不符',
label: '实物与宣传不符',
},
];
onMounted(() => {
getAddressList();
getOrderInfo();
getDetails();
getUserAddressList();
});
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 confirmReceipt = () => {
getDetails();
};
const change = (value) => {
console.log(value);
optionsValue.value = value;
};
const getDetails = () => {
orderInfoGetById({ id: route.query.id }).then((res) => {
detailsData.value = res.data.records[0];
});
};
const changeAddress = (value) => {
addressId.value = value;
};
const doCancel = () => {
cancelOrder({ id: route.query.id }).then((res) => {
store.getData(JSON.parse(route.query.page)).then((res) => {
router.back();
});
});
};
const getOrderInfo = () => {
upOrderInfoList({ id: route.query.id }).then((res) => {
datalist.value = res.data.records;
const refund = () => {
refundVs.value = true;
};
const upRefund = () => {
refundApprove({
orderId: 0,
refundCategory: '1',
refundType: 1,
refundReason: input,
}).then((res) => {
getDetails();
refundVs.value = false;
});
};
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' });
const upAddress = () => {
updateOrderReceiveAddress({ orderId: route.query.id, addressId: addressId.value }).then((res) => {
getDetails();
dialogVisible.value = false;
});
};
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();
const reAddress = () => {
dialogVisible.value = true;
};
// console.info('totalAmout**************', list);
if (list && list.length > 0) {
num = list.reduce((acc, current) => {
return acc + current.unitPrice * current.quantity;
}, 0);
}
}
const doPay = () => {
router.push({
path: '/sub-operation-service/orderSuccess',
query: { id: route.query.id },
});
};
return num;
});
const getUserAddressList = () => {
userPostAddress({ size: 100, current: 1 }).then((res) => {
console.log(res.data.records);
data.value = res.data.records;
});
};
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;
});
const back = () => {
router.back();
};
</script>
<style lang="scss" scoped>
.sure-order-warp {
.refundVs-title {
font-size: 15px;
color: #999999;
margin-bottom: 10px;
}
.user-orders-warp {
width: 100%;
.addr-list {
overflow: hidden;
margin: 16px 0;
.user-orders-content {
margin-top: 16px;
padding: 16px;
width: 100%;
height: calc(100vh - 136px);
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 {
.order-list-warp {
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;
justify-content: space-between;
width: 100%;
.order-list-warp-left {
width: 55%;
height: 70vh;
.order-list-warp-left-title {
margin-top: 20px;
font-size: 18px;
font-weight: bold;
text-align: left;
}
.order-list-warp-left-goods {
margin-top: 20px;
display: flex;
justify-content: space-between;
.order-list-warp-left-goods-list {
display: flex;
.order-list-warp-left-goods-list-info {
margin-left: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
height: 100px;
.order-list-warp-left-goods-list-info-title {
text-align: left;
width: 300px;
font-size: 15px;
}
.order-list-warp-left-goods-list-info-info {
margin-top: 10px;
text-align: left;
width: 300px;
font-size: 12px;
color: #999999;
}
}
}
}
.order-list-warp-left-address {
font-size: 15px;
text-align: start;
margin-left: 15px;
}
}
&.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-list-warp-right {
width: 40%;
height: 70vh;
.order-list-warp-right-list {
margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;
div {
font-size: 14px;
color: #999999;
}
}
}
}
}
.order-info {
position: relative;
padding: 16px;
.order-tab {
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;
::v-deep() {
.el-tabs__nav-wrap::after {
background: transparent !important;
}
}
.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;
.el-tabs__item {
font-size: 20px !important;
}
.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: '¥';
}
.el-tabs__active-bar {
height: 5px !important;
border-radius: 4px;
}
.bottom-do {
.el-descriptions__label,
.el-descriptions__content {
font-size: 16px !important;
}
.cell-item {
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;
}
}
}
.el-descriptions__label {
color: $color-999;
}
.el-descriptions__content {
color: $color-333;
}
}
.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;
}
}
}
.order-tab-title {
width: 100%;
display: flex;
align-items: center;
span {
margin-left: 10px;
}
}
}
}
.button-bottom {
cursor: pointer;
width: 100px;
border-radius: 10px;
height: 40px;
color: #fff;
line-height: 40px;
font-size: 15px;
font-weight: bold;
background-color: #25bf82;
}
.button-bottoms {
cursor: pointer;
margin-left: 20px;
width: 100px;
border-radius: 10px;
height: 40px;
color: #000000;
line-height: 40px;
font-size: 15px;
background-color: #ffffff;
border: 1px solid #707070;
}
</style>

View File

@ -27,13 +27,13 @@
<div class="shop-do">
<ischeck :value="n.ischeck"></ischeck>
</div>
<div class="shop-img">
<!-- <div class="shop-img">
<costomImg
:url="'images/ecommerce/' + 'pic.png'"
:preview-list="[getAssetsFile('images/ecommerce/' + 'pic.png')?.href ?? '']"
:is-view="false"
></costomImg>
</div>
</div> -->
<span class="shop-name txt-ellipsis clamp2">{{ n.cartName }}</span>
</div>
@ -375,7 +375,7 @@ function removeCheckedItems(data) {
.page-content-warp {
position: relative;
overflow: hidden;
margin: 16px 0 0 16px;
margin: 16px 0 0;
width: 100%;
height: calc(100vh - 135px);
border-radius: 16px;

View File

@ -55,25 +55,22 @@
<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">
<!-- <div class="shop-img">
<costomImg
:url="'images/ecommerce/' + 'pic.png'"
:preview-list="[getAssetsFile('images/ecommerce/' + 'pic.png')]"
:is-view="false"
></costomImg>
</div>
</div> -->
<span class="shop-name txt-ellipsis clamp2">{{ n.shop }}</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>
<img class="good-img" :url="g.productImage" />
</div>
<!-- :preview-list="[getAssetsFile('images/ecommerce/' + 'pic.png')]" -->
<div class="good-info">
<div class="good-info-pos">
<div class="txt-ellipsis clamp2">{{ g.productName || '--' }}</div>

View File

@ -73,7 +73,7 @@
</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" @click="goInfo(o.id)">订单详情</div>
<div class="right-item text-link">
{{
o.orderStatus == '7'
@ -133,7 +133,7 @@ let handleClick = (value) => {
const goInfo = (id) => {
router.push({
path: '/sub-operation-service/orderDetails',
query: { id: id },
query: { id: id, page: JSON.stringify(page) },
});
};
@ -141,8 +141,8 @@ let bottomList = reactive([
{ title: '全部', name: 'all' },
{ title: '待付款', name: '1' },
{ title: '待发货', name: '3' },
{ title: '待收货', name: '5' },
{ title: '已发货', name: '6' },
{ title: '待收货', name: '5' },
]);
onMounted(() => {