diff --git a/node/model/module/llf_db.js b/node/model/module/llf_db.js index 58f4b866ffe3a75451216ceec43c57c933719362..83e97cbeda4c770199dbe9549e36e1bf6d89521e 100644 --- a/node/model/module/llf_db.js +++ b/node/model/module/llf_db.js @@ -28,22 +28,22 @@ const LoginSchema = new mongoose.Schema({ //密码 password: { type: String, - require:true, + require: true, }, //用户账号 - userImg:{ - type:String, - default:'https://img.zcool.cn/community/01cfd95d145660a8012051cdb52093.png@2o.png' + userImg: { + type: String, + default: 'https://img.zcool.cn/community/01cfd95d145660a8012051cdb52093.png@2o.png' }, //用户签名 - usertag:{ - type:String, + usertag: { + type: String, }, // 手机号 - phone:{ - type:String, - required:true - }, + phone: { + type: String, + required: true + }, //创建时间 createdAt: { type: Date, // 字段类型 @@ -55,14 +55,14 @@ const LoginSchema = new mongoose.Schema({ default: Date.now, // 默认值 }, //用户积分 - userScore:{ - type:Number, - default:0 + userScore: { + type: Number, + default: 0 }, //用户等级 - userLevel:{ - type:Number, - default:1 + userLevel: { + type: Number, + default: 1 } }) @@ -71,15 +71,41 @@ const RefreshTokenSchema = new mongoose.Schema({ userId: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true }, token: { type: String, required: true }, expiresAt: { type: Date, required: true }, - }); - - - +}); + + +//陪护模型 +const CleanSchema = new mongoose.Schema({ + Cleanimg: String, + Cleantitle: String, + CleanPrice: String, + CleanNum: Number, + CleanType: Number, + service: String, //商品服务 + CleanDescription: String, //商品描述 + CleanMeal: String, //套餐 + CleanRemark: String,//备注 +}) +const StewardSchema = new mongoose.Schema({ + Stewardimg: String, + Stewardtitle: String, + StewardUser: String, + StewardPassword: String, + StewardTag: Array, + StewardAddress: String, + StewardAge: Number, + StewardWork: String, + StewardIntroduce: String, + StewardType: Number, + StewardImgs: Array, - const RefreshToken = mongoose.model('RefreshToken', RefreshTokenSchema, 'RefreshToken'); +}) +const RefreshToken = mongoose.model('RefreshToken', RefreshTokenSchema, 'RefreshToken'); const LoginModel = mongoose.model('Login', LoginSchema, 'Login'); +const CleanModel = mongoose.model('Clean', CleanSchema, 'Clean'); +const StewardModel = mongoose.model('Steward', StewardSchema, 'Steward'); // 创建用户 // LoginModel.create({ @@ -89,5 +115,34 @@ const LoginModel = mongoose.model('Login', LoginSchema, 'Login'); // }) + +// CleanModel.create({ +// Cleanimg: "https://img0.baidu.com/it/u=3797557470,34549791&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500", +// Cleantitle: "宠物洗澡", +// CleanPrice: "100", +// CleanNum: "100", +// CleanType: 1, +// service: "洗澡", +// CleanDescription: "宠物洗澡", +// }) + + +// StewardModel.create({ +// Stewardimg: "https://img95.699pic.com/photo/50118/9032.jpg_wh860.jpg", +// Stewardtitle: "王阿姨", +// StewardUser: "adminwang", +// StewardPassword: "123456", +// StewardTag: ["月嫂陪护", "热情", "细心",'服务态度好'], +// StewardAddress: "北京市丰台区", +// StewardAge: 20, +// StewardWork: "3", +// StewardIntroduce: "我是月嫂,孕期配护", +// StewardType: 3, +// StewardImgs: ["https://ts1.cn.mm.bing.net/th/id/R-C.229e3f0528e2d485e55bbe9f33f5445d?rik=MQXoLbqe%2fCr4hw&riu=http%3a%2f%2f13960979.s21i.faiusr.com%2f2%2fABUIABACGAAgjaGL_AUorNLOnQYw6Ac46Ac.jpg&ehk=3Ijsu%2b3taF1uIRKiJjLy%2fr3f136LFZAz%2bAis4ak4WbQ%3d&risl=&pid=ImgRaw&r=0","https://oss.boluoyunyu.com/uploads/ueditor/20220422/1650611402984359.jpg",'https://www.duoxiwa.com/resource/images/89646d43e1ef4f318bb83c2d36028fb1_2.jpg'], + +// }) + + + // 暴露文件 -module.exports = {RefreshToken,LoginModel } +module.exports = { RefreshToken, LoginModel, CleanModel, StewardModel } diff --git a/node/routes/llf_api.js b/node/routes/llf_api.js index a1588cae96588287a3aaf18db3058c5d6ebd1f35..65782b8c54f3386c12c451b2ca320c33b028fe95 100644 --- a/node/routes/llf_api.js +++ b/node/routes/llf_api.js @@ -2,7 +2,7 @@ var express = require('express'); var router = express.Router(); var jwt = require('jsonwebtoken') -let { LoginModel, RefreshToken } = require('../model/module/llf_db') +let { LoginModel, RefreshToken, CleanModel, StewardModel } = require('../model/module/llf_db') /* GET home page. */ @@ -39,7 +39,7 @@ router.post('/login', async (req, res) => { const newRefreshToken = new RefreshToken({ userId: user._id, token: refreshToken, expiresAt: new Date(Date.now() + REFRESH_TOKEN_EXPIRES_IN_MS) }); await newRefreshToken.save(); - res.json({ returncode: 200, accessToken, refreshToken,user }); + res.json({ returncode: 200, accessToken, refreshToken, user }); } else { res.status(401).json({ message: 'Invalid credentials' }); } @@ -140,4 +140,59 @@ router.get("/protectedData", (req, res) => { }); +router.get('/cleanList', async (req, res) => { + const data = await CleanModel.find() + console.log(data); + res.send({ + code: 200, + returncode: 0, + data + }) +}) + +router.get('/cleanDetail', async (req, res) => { + const id = req.query.id + console.log(id); + const data = await CleanModel.findById({ _id: id }) + console.log(data); + res.send({ + code: 200, + returncode: 0, + data + }) +}) + +router.get('/getStewart', async (req, res) => { + const data = await StewardModel.find() + console.log(data); + res.send({ + code: 200, + returncode: 0, + data + }) +}) + +router.get('/stewartDetail', async (req, res) => { + const id = req.query.id + console.log(id); + const data = await StewardModel.findById({ _id: id }) + console.log(data); + res.send({ + code: 200, + returncode: 0, + data + }) +}) + +router.get('/stewartlist', async (req, res) => { + + const data = await StewardModel.find({ StewardType: 3 }) + console.log(data); + res.send({ + code: 200, + returncode: 0, + data + }) +}) + module.exports = router; diff --git a/vite-project/components.d.ts b/vite-project/components.d.ts index 9bebc029304d550d129e5b1b8ee490a0678a495c..6ada770dda3553514021d0d2a333ac87a3586130 100644 --- a/vite-project/components.d.ts +++ b/vite-project/components.d.ts @@ -11,23 +11,16 @@ declare module 'vue' { RouterView: typeof import('vue-router')['RouterView'] VanAddressList: typeof import('vant/es')['AddressList'] VanButton: typeof import('vant/es')['Button'] - VanCell: typeof import('vant/es')['Cell'] VanCellGroup: typeof import('vant/es')['CellGroup'] - VanConfigProvider: typeof import('vant/es')['ConfigProvider'] - VanDialog: typeof import('vant/es')['Dialog'] + VanCheckbox: typeof import('vant/es')['Checkbox'] VanField: typeof import('vant/es')['Field'] VanForm: typeof import('vant/es')['Form'] VanGrid: typeof import('vant/es')['Grid'] VanGridItem: typeof import('vant/es')['GridItem'] VanIcon: typeof import('vant/es')['Icon'] - VanImage: typeof import('vant/es')['Image'] - VanList: typeof import('vant/es')['List'] VanNavBar: typeof import('vant/es')['NavBar'] - VanPopover: typeof import('vant/es')['Popover'] VanPopup: typeof import('vant/es')['Popup'] - VanRate: typeof import('vant/es')['Rate'] VanSearch: typeof import('vant/es')['Search'] - VanShareSheet: typeof import('vant/es')['ShareSheet'] VanSticky: typeof import('vant/es')['Sticky'] VanSwipe: typeof import('vant/es')['Swipe'] VanSwipeItem: typeof import('vant/es')['SwipeItem'] @@ -36,6 +29,7 @@ declare module 'vue' { VanTabbar: typeof import('vant/es')['Tabbar'] VanTabbarItem: typeof import('vant/es')['TabbarItem'] VanTabs: typeof import('vant/es')['Tabs'] - VanWatermark: typeof import('vant/es')['Watermark'] + VanTag: typeof import('vant/es')['Tag'] + VanUploader: typeof import('vant/es')['Uploader'] } } diff --git a/vite-project/src/assets/iconfont/demo_index.html b/vite-project/src/assets/iconfont/demo_index.html index 6274fbcaaacfbf6db5327bdfd25a4b4515e59042..98fd072776998fbf5e2510486976c554293e639d 100644 --- a/vite-project/src/assets/iconfont/demo_index.html +++ b/vite-project/src/assets/iconfont/demo_index.html @@ -54,6 +54,42 @@