feat: 添加用户登录功能

This commit is contained in:
wwz 2025-04-02 17:19:54 +08:00
parent a3665a9e4e
commit bf9028f927
4 changed files with 89 additions and 36 deletions

View File

@ -23,8 +23,7 @@ const contentConfig: IContentConfig = {
}
return OrderApi.getList(params);
},
indexActionData: {
},
indexActionData: {},
// deleteAction: OrderApi.delete,
// modifyAction: function (data) {
// // return OrderApi.edit(data);
@ -46,28 +45,30 @@ const contentConfig: IContentConfig = {
label: "订单号信息",
align: "center",
prop: "orderNo",
templet: "custom",
slotName: "orderNo",
},
{
label: "商品信息",
align: "center",
templet: 'custom',
prop: 'goods',
slotName: 'goods',
templet: "custom",
prop: "goods",
slotName: "goods",
width: 240,
},
{
label: "台桌信息",
align: "center",
templet: 'custom',
slotName: 'table',
templet: "custom",
slotName: "table",
width: 150,
},
{
label: "订单原金额 不含折扣价格",
align: "center",
prop: "originAmount",
templet: 'custom',
slotName: 'originAmount',
templet: "custom",
slotName: "originAmount",
width: 120,
hidden: true,
},
@ -117,7 +118,7 @@ const contentConfig: IContentConfig = {
fixed: "right",
width: 150,
templet: "custom",
slotName: 'operate'
slotName: "operate",
},
],
};

View File

@ -5,9 +5,9 @@
<page-search
ref="searchRef"
:search-config="searchConfig"
:isOpenAutoSearch="true"
@query-click="handleQueryClick"
@reset-click="handleResetClick"
:isOpenAutoSearch="true"
/>
<!-- 列表 -->
<page-content
@ -24,6 +24,20 @@
<template #originAmount="scope">
{{ returnOriginAmount(scope.row) }}
</template>
<template #orderNo="scope">
<div style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap">
<el-tooltip
class="box-item"
effect="dark"
:content="scope.row.orderNo"
placement="top-start"
>
{{ scope.row.orderNo }}
</el-tooltip>
</div>
</template>
<template #status="scope">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
@ -31,16 +45,16 @@
</template>
<template #goods="scope">
<div class="goods_info">
<div class="row" v-for="item in scope.row.goods" :key="item.id">
<el-image :src="item.productImg" class="cover" lazy></el-image>
<div v-for="item in scope.row.goods" :key="item.id" class="row">
<el-image :src="item.productImg" class="cover" lazy />
<div class="info">
<div class="name">
<span :class="[item.isVip == 1 ? 'colorStyle' : '']">
{{ item.productName }}
</span>
<span class="refund" v-if="item.refundNumber">(退 - {{ item.refundNumber }})</span>
<span v-if="item.refundNumber" class="refund">(退 - {{ item.refundNumber }})</span>
</div>
<div class="sku">{{ item.productSkuName }}</div>
<div class="sku">{{ item.skuName }}</div>
</div>
</div>
</div>
@ -73,12 +87,12 @@
</template>
<template #operate="scope">
<div>
<el-button @click="showdetail(scope.row)" link>详情</el-button>
<el-button link v-if="scope.row.status == 'done'">开票</el-button>
<el-button link @click="showdetail(scope.row)">详情</el-button>
<el-button v-if="scope.row.status == 'done'" link>开票</el-button>
<el-button
v-if="scope.row.status == 'unpaid'"
@click="toPayOrder(scope.row)"
type="primary"
@click="toPayOrder(scope.row)"
>
结账
</el-button>
@ -106,7 +120,7 @@
</template>
</page-modal>
<orderDetail ref="refDetail" @close="refresh"></orderDetail>
<orderDetail ref="refDetail" @close="refresh" />
</div>
</template>
@ -317,7 +331,9 @@ function showdetail(row: OrderInfoVo) {
.goods_info {
.row {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
&:not(:first-child) {
margin-top: 10px;
}
@ -331,8 +347,7 @@ function showdetail(row: OrderInfoVo) {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 10px;
margin-top: 2px;
.sku {
color: #999;
}

View File

@ -7,39 +7,73 @@
@reset-click="handleResetClick" /> -->
<!-- 列表 -->
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
<page-content
ref="contentRef"
:content-config="contentConfig"
@add-click="handleAddClick"
@edit-click="handleEditClick"
@export-click="handleExportClick"
@search-click="handleSearchClick"
@toolbar-click="handleToolbarClick"
@operat-click="handleOperatClick"
@filter-change="handleFilterChange"
>
<template #status="scope">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
</el-tag>
</template>
<template #slotNameimage="scope">
<el-image
v-if="scope.row.pic"
:src="scope.row.pic"
lazy
style="width: 40px; height: 40px"
/>
<div v-else></div>
</template>
<template #gender="scope">
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
</template>
<template #mobile="scope">
<el-text>{{ scope.row[scope.prop] }}</el-text>
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
<copy-button
v-if="scope.row[scope.prop]"
:text="scope.row[scope.prop]"
style="margin-left: 2px"
/>
</template>
</page-content>
<!-- 新增 -->
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
<page-modal
ref="addModalRef"
:modal-config="addModalConfig"
@submit-click="handleSubmitClick"
>
<template #gender="scope">
<Dict v-model="scope.formData[scope.prop]" code="gender" />
</template>
</page-modal>
<!-- 编辑 -->
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
<page-modal
ref="editModalRef"
:modal-config="editModalConfig"
@submit-click="handleSubmitClick"
>
<template #gender="scope">
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
</template>
</page-modal>
</template>
<template v-else>
<page-content ref="contentRef" :content-config="contentConfig2" @operat-click="handleOperatClick">
<page-content
ref="contentRef"
:content-config="contentConfig2"
@operat-click="handleOperatClick"
>
<template #status="scope">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
@ -96,7 +130,6 @@ async function handleEditClick(row: IObject) {
const data = await UserAPI.getunitinfo(row.id);
editModalRef.value?.setFormData(data);
editModalRef.value?.setModalVisible();
}
//
function handleToolbarClick(name: string) {

View File

@ -26,8 +26,8 @@ const contentConfig: IContentConfig<UserPageQuery> = {
// },
// exportAction: UserAPI.export,
modifyAction: function (params) {
console.log(1111112222222222222)
let obj = { sort: "1", ...params }
console.log(1111112222222222222);
let obj = { sort: "1", ...params };
return UserAPI.update(obj);
},
@ -44,13 +44,17 @@ const contentConfig: IContentConfig<UserPageQuery> = {
// return res.list;
// },
pk: "id",
toolbar: [
"add",
],
toolbar: ["add"],
cols: [
// { type: "selection", width: 50, align: "center" },
{ label: "分类名称", align: "center", prop: "name" },
{ label: "分类图片", align: "center", prop: "pic", templet: "image" },
{
label: "分类图片",
align: "center",
prop: "pic",
slotName: "slotNameimage",
templet: "custom",
},
{
label: "状态",
align: "center",