Django+Vue二手交易平台的设计与实现

目录

  • 1 项目介绍
  • 2 项目截图
  • 3 核心代码
    • 3.1 需要的环境
    • 3.2 Django接口层
    • 3.3 实体类
    • 3.4 config.ini
    • 3.5 启动类
    • 3.5 Vue
  • 4 数据库表设计
  • 5 文档参考
  • 6 计算机毕设选题推荐
  • 7 源码获取


在这里插入图片描述

1 项目介绍

博主个人介绍:CSDN认证博客专家,CSDN平台Java领域优质创作者,全网30w+粉丝,超300w访问量,专注于大学生项目实战开发、讲解和答疑辅导,对于专业性数据证明一切!
主要项目:javaweb、ssm、springboot、vue、小程序、python、安卓、uniapp等设计与开发,万套源码成品可供选择学习。

👇🏻👇🏻文末获取源码

Django+Vue二手交易平台的设计与实现(源码+数据库+文档)

项目描述
本系统是基于B/S架构的网站系统,分为系统前台和系统后台,前台主要是提供给注册用户和未注册登录的游客使用的,包括系统主页、设备信息、公告信息、购物车、个人中心等;后台是给系统管理员使用的,可以全方面的对系统的资讯进行实时的更新,对系统进行实时的维护。它的主要功能包括用户、设备类型、设备信息、系统管理、订单管理、个人资料等。

在这里插入图片描述

2 项目截图

django基于Django的二手电子设备交易平台设计与开发演示

3 核心代码

3.1 需要的环境

django==2.0
django-threadlocals
pymysql
click
requests
xlrd==1.2.0
django-cors-headers

3.2 Django接口层


# coding:utf-8
__author__ = "ila"from django.http import JsonResponsefrom .users_model import users
from util.codes import *
from util.auth import Auth
import util.message as mes
from dj2.settings import host,port,user,passwd,dbName,hasHadoopdef users_login(request):if request.method in ["POST", "GET"]:msg = {'code': normal_code, "msg": mes.normal_code}req_dict = request.session.get("req_dict")if req_dict.get('role')!=None:del req_dict['role']datas = users.getbyparams(users, users, req_dict)if not datas:msg['code'] = password_error_codemsg['msg'] = mes.password_error_codereturn JsonResponse(msg)req_dict['id'] = datas[0].get('id')return Auth.authenticate(Auth, users, req_dict)def users_register(request):if request.method in ["POST", "GET"]:msg = {'code': normal_code, "msg": mes.normal_code}req_dict = request.session.get("req_dict")error = users.createbyreq(users, users, req_dict)if error != None:msg['code'] = crud_error_codemsg['msg'] = errorreturn JsonResponse(msg)def users_session(request):''''''if request.method in ["POST", "GET"]:msg = {"code": normal_code,"msg":mes.normal_code, "data": {}}req_dict = {"id": request.session.get('params').get("id")}msg['data'] = users.getbyparams(users, users, req_dict)[0]return JsonResponse(msg)def users_logout(request):if request.method in ["POST", "GET"]:msg = {"msg": "退出成功","code": 0}return JsonResponse(msg)def users_page(request):''''''if request.method in ["POST", "GET"]:msg = {"code": normal_code, "msg": mes.normal_code,"data": {"currPage": 1, "totalPage": 1, "total": 1, "pageSize": 10, "list": []}}req_dict = request.session.get("req_dict")tablename = request.session.get("tablename")try:__hasMessage__ = users.__hasMessage__except:__hasMessage__ = Noneif __hasMessage__ and __hasMessage__ != "否":if tablename != "users":req_dict["userid"] = request.session.get("params").get("id")if tablename == "users":msg['data']['list'], msg['data']['currPage'], msg['data']['totalPage'], msg['data']['total'], \msg['data']['pageSize'] = users.page(users, users, req_dict)else:msg['data']['list'], msg['data']['currPage'], msg['data']['totalPage'], msg['data']['total'], \msg['data']['pageSize'] = [],1,0,0,10return JsonResponse(msg)def users_info(request, id_):''''''if request.method in ["POST", "GET"]:msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}data = users.getbyid(users, users, int(id_))if len(data) > 0:msg['data'] = data[0]# 浏览点击次数try:__browseClick__ = users.__browseClick__except:__browseClick__ = Noneif __browseClick__ and "clicknum" in users.getallcolumn(users, users):click_dict = {"id": int(id_), "clicknum": str(int(data[0].get("clicknum", 0)) + 1)}ret = users.updatebyparams(users, users, click_dict)if ret != None:msg['code'] = crud_error_codemsg['msg'] = retreturn JsonResponse(msg)def users_save(request):''''''if request.method in ["POST", "GET"]:msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}req_dict = request.session.get("req_dict")req_dict['role'] = '管理员'error = users.createbyreq(users, users, req_dict)if error != None:msg['code'] = crud_error_codemsg['msg'] = errorreturn JsonResponse(msg)def users_update(request):''''''if request.method in ["POST", "GET"]:msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}req_dict = request.session.get("req_dict")if req_dict.get("mima") and req_dict.get("password"):if "mima" not in users.getallcolumn(users,users):del req_dict["mima"]if "password" not in users.getallcolumn(users,users):del req_dict["password"]try:del req_dict["clicknum"]except:passerror = users.updatebyparams(users, users, req_dict)if error != None:msg['code'] = crud_error_codemsg['msg'] = errorreturn JsonResponse(msg)def users_delete(request):''''''if request.method in ["POST", "GET"]:msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}req_dict = request.session.get("req_dict")error = users.deletes(users,users,req_dict.get("ids"))if error != None:msg['code'] = crud_error_codemsg['msg'] = errorreturn JsonResponse(msg)

3.3 实体类

# coding:utf-8
__author__ = "ila"from django.db import modelsfrom .model import BaseModelclass users(BaseModel):# id=models.BigIntegerField(verbose_name="自增id")username = models.CharField(max_length=100, verbose_name=u'账号')password = models.CharField(max_length=100, verbose_name=u'密码')role = models.CharField(max_length=100, verbose_name=u'角色')addtime = models.DateTimeField(auto_now_add=False, verbose_name=u'创建时间')image = models.CharField(max_length=100, verbose_name=u'头像')__tablename__ = 'users'class Meta:db_table = 'users'verbose_name = verbose_name_plural = u'管理员表'# def __str__(self):#     return self.username

3.4 config.ini

[sql]
;support two sql,mysql and mssql,choice one
type = mysql
host = 127.0.0.1
port = 3306
user = root
passwd = 123456
db = djangoc2e8kave
charset = utf8
hasHadoop=否
[redis]
host = 127.0.0.1
port = 6379
passwd = 123456

3.5 启动类

#!/usr/bin/env python
import os
import sysif __name__ == "__main__":os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dj2.settings")try:from django.core.management import execute_from_command_lineexcept ImportError as exc:raise ImportError("Couldn't import Django. Are you sure it's installed and ""available on your PYTHONPATH environment variable? Did you ""forget to activate a virtual environment?") from excexecute_from_command_line(sys.argv)

3.5 Vue

<template><div><div class="container loginIn" style="backgroundImage: url(http://codegen.caihongy.cn/20201206/eaa69c2b4fa742f2b5acefd921a772fc.jpg)"><div :class="2 == 1 ? 'left' : 2 == 2 ? 'left center' : 'left right'" style="backgroundColor: rgba(255, 255, 255, 0.71)"><el-form class="login-form" label-position="left" :label-width="1 == 3 ? '56px' : '0px'"><div class="title-container"><h3 class="title" style="color: rgba(84, 88, 179, 1)">在线文档管理系统登录</h3></div><el-form-item :label="1 == 3 ? '用户名' : ''" :class="'style'+1"><span v-if="1 != 3" class="svg-container" style="color:rgba(89, 97, 102, 1);line-height:44px"><svg-icon icon-class="user" /></span><el-input placeholder="请输入用户名" name="username" type="text" v-model="rulesForm.username" /></el-form-item><el-form-item :label="1 == 3 ? '密码' : ''" :class="'style'+1"><span v-if="1 != 3" class="svg-container" style="color:rgba(89, 97, 102, 1);line-height:44px"><svg-icon icon-class="password" /></span><el-input placeholder="请输入密码" name="password" type="password" v-model="rulesForm.password" /></el-form-item><el-form-item v-if="0 == '1'" class="code" :label="1 == 3 ? '验证码' : ''" :class="'style'+1"><span v-if="1 != 3" class="svg-container" style="color:rgba(89, 97, 102, 1);line-height:44px"><svg-icon icon-class="code" /></span><el-input placeholder="请输入验证码" name="code" type="text" v-model="rulesForm.code" /><div class="getCodeBt" @click="getRandCode(4)" style="height:44px;line-height:44px"><span v-for="(item, index) in codes" :key="index" :style="{color:item.color,transform:item.rotate,fontSize:item.size}">{{ item.num }}</span></div></el-form-item><el-form-item label="角色" prop="loginInRole" class="role"><el-radiov-for="item in menus"v-if="item.hasBackLogin=='是'"v-bind:key="item.roleName"v-model="rulesForm.role":label="item.roleName">{{item.roleName}}</el-radio></el-form-item><el-button type="primary" @click="login()" class="loginInBt" style="padding:0;font-size:16px;border-radius:4px;height:44px;line-height:44px;width:100%;backgroundColor:rgba(84, 88, 179, 1); borderColor:rgba(84, 88, 179, 1); color:rgba(255, 255, 255, 1)">{{'1' == '1' ? '登录' : 'login'}}</el-button><el-form-item class="setting"><!-- <div style="color:rgba(255, 255, 255, 1)" class="reset">修改密码</div> --></el-form-item></el-form></div></div></div>
</template>
<script>
import menu from "@/utils/menu";
export default {data() {return {rulesForm: {username: "",password: "",role: "",code: '',},menus: [],tableName: "",codes: [{num: 1,color: '#000',rotate: '10deg',size: '16px'},{num: 2,color: '#000',rotate: '10deg',size: '16px'},{num: 3,color: '#000',rotate: '10deg',size: '16px'},{num: 4,color: '#000',rotate: '10deg',size: '16px'}],};},mounted() {let menus = menu.list();this.menus = menus;},created() {this.setInputColor()this.getRandCode()},methods: {setInputColor(){this.$nextTick(()=>{document.querySelectorAll('.loginIn .el-input__inner').forEach(el=>{el.style.backgroundColor = "rgba(255, 255, 255, 1)"el.style.color = "rgba(0, 0, 0, 1)"el.style.height = "44px"el.style.lineHeight = "44px"el.style.borderRadius = "2px"})document.querySelectorAll('.loginIn .style3 .el-form-item__label').forEach(el=>{el.style.height = "44px"el.style.lineHeight = "44px"})document.querySelectorAll('.loginIn .el-form-item__label').forEach(el=>{el.style.color = "rgba(89, 97, 102, 1)"})setTimeout(()=>{document.querySelectorAll('.loginIn .role .el-radio__label').forEach(el=>{el.style.color = "rgba(84, 88, 179, 1)"})},350)})},register(tableName){this.$storage.set("loginTable", tableName);this.$router.push({path:'/register'})},// 登陆login() {let code = ''for(let i in this.codes) {code += this.codes[i].num}if ('0' == '1' && !this.rulesForm.code) {this.$message.error("请输入验证码");return;}if ('0' == '1' && this.rulesForm.code.toLowerCase() != code.toLowerCase()) {this.$message.error("验证码输入有误");this.getRandCode()return;}if (!this.rulesForm.username) {this.$message.error("请输入用户名");return;}if (!this.rulesForm.password) {this.$message.error("请输入密码");return;}if (!this.rulesForm.role) {this.$message.error("请选择角色");return;}let menus = this.menus;for (let i = 0; i < menus.length; i++) {if (menus[i].roleName == this.rulesForm.role) {this.tableName = menus[i].tableName;}}this.$http({url: `${this.tableName}/login?username=${this.rulesForm.username}&password=${this.rulesForm.password}`,method: "post"}).then(({ data }) => {if (data && data.code === 0) {this.$storage.set("Token", data.token);this.$storage.set("role", this.rulesForm.role);this.$storage.set("sessionTable", this.tableName);this.$storage.set("adminName", this.rulesForm.username);this.$router.replace({ path: "/index/" });} else {this.$message.error(data.msg);}});},getRandCode(len = 4){this.randomString(len)},randomString(len = 4) {let chars = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k","l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v","w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G","H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R","S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2","3", "4", "5", "6", "7", "8", "9"]let colors = ["0", "1", "2","3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]let sizes = ['14', '15', '16', '17', '18']let output = [];for (let i = 0; i < len; i++) {// 随机验证码let key = Math.floor(Math.random()*chars.length)this.codes[i].num = chars[key]// 随机验证码颜色let code = '#'for (let j = 0; j < 6; j++) {let key = Math.floor(Math.random()*colors.length)code += colors[key]}this.codes[i].color = code// 随机验证码方向let rotate = Math.floor(Math.random()*60)let plus = Math.floor(Math.random()*2)if(plus == 1) rotate = '-'+rotatethis.codes[i].rotate = 'rotate('+rotate+'deg)'// 随机验证码字体大小let size = Math.floor(Math.random()*sizes.length)this.codes[i].size = sizes[size]+'px'}},}
};
</script>
<style lang="scss" scoped>
.loginIn {min-height: 100vh;position: relative;background-repeat: no-repeat;background-position: center center;background-size: cover;.left {position: absolute;left: 0;top: 0;width: 360px;height: 100%;.login-form {background-color: transparent;width: 100%;right: inherit;padding: 0 12px;box-sizing: border-box;display: flex;justify-content: center;flex-direction: column;}.title-container {text-align: center;font-size: 24px;.title {margin: 20px 0;}}.el-form-item {position: relative;.svg-container {padding: 6px 5px 6px 15px;color: #889aa4;vertical-align: middle;display: inline-block;position: absolute;left: 0;top: 0;z-index: 1;padding: 0;line-height: 40px;width: 30px;text-align: center;}.el-input {display: inline-block;height: 40px;width: 100%;& /deep/ input {background: transparent;border: 0px;-webkit-appearance: none;padding: 0 15px 0 30px;color: #fff;height: 40px;}}}}.center {position: absolute;left: 50%;top: 50%;width: 360px;transform: translate3d(-50%,-50%,0);height: 446px;border-radius: 8px;}.right {position: absolute;left: inherit;right: 0;top: 0;width: 360px;height: 100%;}.code {.el-form-item__content {position: relative;.getCodeBt {position: absolute;right: 0;top: 0;line-height: 40px;width: 100px;background-color: rgba(51,51,51,0.4);color: #fff;text-align: center;border-radius: 0 4px 4px 0;height: 40px;overflow: hidden;span {padding: 0 5px;display: inline-block;font-size: 16px;font-weight: 600;}}.el-input {& /deep/ input {padding: 0 130px 0 30px;}}}}.setting {& /deep/ .el-form-item__content {padding: 0 15px;box-sizing: border-box;line-height: 32px;height: 32px;font-size: 14px;color: #999;margin: 0 !important;.register {float: left;width: 50%;}.reset {float: right;width: 50%;text-align: right;}}}.style2 {padding-left: 30px;.svg-container {left: -30px !important;}.el-input {& /deep/ input {padding: 0 15px !important;}}}.code.style2, .code.style3 {.el-input {& /deep/ input {padding: 0 115px 0 15px;}}}.style3 {& /deep/ .el-form-item__label {padding-right: 6px;}.el-input {& /deep/ input {padding: 0 15px !important;}}}.role {& /deep/ .el-form-item__label {width: 56px !important;}& /deep/ .el-radio {margin-right: 12px;}}}
</style>

4 数据库表设计

用户注册实体图如图所示:
在这里插入图片描述

数据库表的设计,如下表:
在这里插入图片描述

5 文档参考

在这里插入图片描述

6 计算机毕设选题推荐

最新计算机软件毕业设计选题大全:整理中…

7 源码获取

👇🏻获取联系方式在文章末尾 如果想入行提升技术的可以看我专栏其他内容:

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/416354.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Having trouble using OpenAI API

题意&#xff1a;"使用OpenAI API遇到困难" 问题背景&#xff1a; I am having trouble with this code. I want to implement AI using OpenAI API in my React.js project but I cannot seem to get what the issue is. I ask it a question in the search bar in…

string详解

Golang详解string 文章目录 Golang详解stringGolang中为什么string是只读的&#xff1f;stirng和[]byte的转化原理[]byte转string一定需要内存拷贝吗&#xff1f;字符串拼接性能测试 Golang中为什么string是只读的&#xff1f; 在Go语言中&#xff0c;string其实就是一个结构体…

实验报告: lookie-lookie 项目测试与分析

目录 一、实验目的 二、实验环境 三、实验步骤 1. 下载与准备项目 1.1 从 GitHub 获取项目 1.2 查看项目文件结构 2. 运行项目 2.1 启动项目 2.2 浏览器设置 3. 项目体验 3.1 功能测试 3.2 运行截图 4. 文件结构分析 4.1 总体结构 4.2 主要文件和目录说明 5. 数…

09-03 周二 ansible部署和节点管理过程

09-03 周二 ansible部署和节点管理过程 时间版本修改人描述2024年9月3日10:08:58V0.1宋全恒新建文档&#xff0c; 简介 首先要找一个跳板机&#xff0c;来确保所有的机器都可以访问。然后我们围绕ansible来搭建环境&#xff0c;方便一键执行所有的命令&#xff0c;主要的任务是…

SQL语言的规则和规范

规则 是什么呢&#xff0c;规则就是我们最基本&#xff0c;每时每刻都要遵守的比如人行道靠右&#xff0c;不能逆行&#xff0c; 规范 呢就是锦上添花&#xff0c;如果你不这么做&#xff0c;是不那么道德&#xff0c;不那么好的&#xff0c;就像小学生见到老师要问好&#…

机器学习:opencv图像识别--图片运算、边界、阈值处理、平滑处理

目录 一、图片运算 1.加法 1. 2.add 3.加权相加 2.减法 二、图片边界 三、图像阈值处理 四、图像平滑处理 1.生成椒盐噪声 2.滤波器 1.均值滤波 2.方框滤波 3.高斯滤波 4.中值滤波 一、图片运算 1.加法 1. 直接将图片上每个像素点的值加上给定值或者两张图片…

wpf image source绑定相对路径方法

当使用image source绑定相对路径图片资源时&#xff0c;出现问题&#xff1a;未能找到路径C:\windows/System32…路径的一部分 解决方法&#xff1a; 将文件放到指定文件夹中包含在当前项目中 具体绑定语句为&#xff1a; <Image Stretch"Fill" x:Name"imgT…

(计算机论文)基于SpringBoot和Vue的台球赛事服务网站的设计与实现

毕业设计&#xff08;论文&#xff09; 博主可接毕设论文&#xff01;&#xff01;&#xff01; 基于SpringBoot和Vue的台球赛事服务网站的设计与实现 摘 要 在快速发展的信息时代&#xff0c;体育竞赛作为群众文化娱乐的一部分&#xff0c;已日益受到广泛关注。台球&#xff…

python 怎样计算字符串的长度

python 计算字符串长度&#xff0c;一个中文算两个字符&#xff0c;先转换成utf8&#xff0c;然后通过计算utf8的长度和len函数取得的长度&#xff0c;进行对比即可知道字符串内中文字符的数量&#xff0c;自然就可以计算出字符串的长度了。 valueu脚本12 length len(value) u…

排查SQL Server中的内存不足及其他疑难问题

文章目录 引言I DMV 资源信号灯资源信号灯 DMV sys.dm_exec_query_resource_semaphores( 确定查询执行内存的等待)查询性能计数器什么是内存授予?II DBCC MEMORYSTATUS 查询内存对象III DBCC 命令释放多个 SQL Server 内存缓存 - 临时度量值IV 等待资源池 %ls (%ld)中的内存…

统计学习与方法实战——K近邻算法

K近邻算法 K近邻算法备注k近邻模型算法距离度量 k k k值选择分类决策规则构造KDTree k k k近邻查找范围查询 代码结构总结 K近邻算法 备注 kNN是一种基本分类与回归方法. 多数表决规则等价于0-1损失函数下的经验风险最小化&#xff0c;支持多分类&#xff0c; 有别于前面的感…

QT做一个USB HID设备识别软件

1.下载 HidApi库&#xff1a;GitHub - yigityuce/HidApi: Human Interface Device Api (HidApi) with C 2.pro文件添加 DEFINES - UNICODE LIBS -lsetupapi 3.h文件 #ifndef My_Usb_Hid_Device_H #define My_Usb_Hid_Device_H#include <QWidget> #include <QStr…

数据结构(6.4_6)——拓扑排序

AOV网 AOV网&#xff1a;用顶点表示活动的网。 用DAG图(有向无环图)表示一个工程&#xff0c;顶点表示活动&#xff0c;有向边<Vi,Vj>表示活动Vi必须先于vj进行 拓扑排序&#xff08;找到做事的先后顺序&#xff09; 对有回路的图进行拓扑排序 拓扑排序的实现代码 回…

Redis过期键监听

在 Redis 中&#xff0c;为了监听过期键事件&#xff0c;需要使用 Redis 的 Keyspace Notifications 功能。这一功能允许客户端订阅某些事件的发生&#xff0c;比如键过期、键删除等。 启用过期键监听 在 Redis 的配置文件 redis.conf 中&#xff0c;确保配置项 notify-keysp…

Python画笔案例-031 绘制器形图

1、绘制蝌蚪 通过 python 的turtle 库绘制器形图&#xff0c;如下图&#xff1a; 2、实现代码 绘制器形图&#xff0c;以下为实现代码&#xff1a; """器形图.py采用前进&#xff0c;倒退&#xff0c;左转&#xff0c;右转命令制作的一个图形。 ""&q…

场外个股期权机构有哪些?

今天带你了解场外个股期权机构有哪些&#xff1f;场外个股期权交易商名单包括了多家券商&#xff0c;这些券商在场外期权市场中扮演着重要的角色。 场外个股期权通常涉及的主要机构包括&#xff1a; 1.投资银行&#xff1a;这些机构常常作为交易的中介或对手方&#xff0c;为…

绝区零苹果电脑能玩吗,如何在Mac上玩绝区零?绝区零MacBook 下载安装保姆级教程

《绝区零》是一款由米哈游开发的都市动作冒险游戏&#xff0c;游戏的故事背景设定在一个名为「新艾利都」的现代化大都市中&#xff0c;玩家将扮演一对「绳匠」兄妹展开冒险。很多玩家都在问苹果电脑笔记本Mac怎么玩绝区零&#xff0c;今天就给大家介绍一下《绝区零》是一款什么…

【UE5】控件蓝图——树视图(TreeView)的基本使用

目录 前言 效果 步骤 一、显示根节点 二、显示子节点 前言 我们在视口中添加1个方块&#xff0c;2个球体&#xff0c;5个圆柱 它们在大纲视图中的层级关系如下&#xff0c;那么如何将这种层级关系显示在树视图中是本篇文章要解决的问题。 效果 步骤 一、显示根节点 1…

跨境电商代购系统中前台基本功能介绍:帮助更快的了解跨境代购业务

前台多语言&#xff1a;可支持语言有中文&#xff08;繁体&#xff09;中文&#xff08;简体&#xff09;英文等。多语言使用百度翻译引擎接口实现&#xff0c;翻译效果与百度一致&#xff1b;网站语言分为两大块&#xff1a;1.系统后台有语言包可以编辑修改网站标题以及发布文…

mongodb在Java中条件分组聚合查询并且分页(时间戳,按日期分组,年月日...)

废话不多说&#xff0c;先看效果图&#xff1a; SQL查询结果示例&#xff1a; 多种查询结果示例&#xff1a; 原SQL&#xff1a; db.getCollection("hbdd_order").aggregate([{// 把时间戳格式化$addFields: {orderDate: {"$dateToString": {"for…