Commit 2c958c2d by Hao

add

parent 4e4e1a32
项目文件结构(快照)
项目根目录:weiit-liri-pc-page-div
目录树(3 层,最多 200 项):
```
├── .eslintrc.js
├── .gitignore
├── 10.md
├── 20.md
├── LICENSE
├── README.md
├── TEXT.md
├── absolute\
│ └── path\
│ └── to\
├── app\
│ ├── index.html
│ ├── package.json
│ ├── src\
│ │ ├── App.vue
│ │ ├── components\
│ │ ├── main.js
│ │ ├── manifest.json
│ │ ├── pages\
│ │ ├── pages.json
│ │ ├── static\
│ │ ├── uni.scss
│ │ └── uni_modules\
│ └── vite.config.js
├── babel.config.js
├── mock.js
├── package.json
├── public\
│ ├── app\
│ │ ├── assets\
│ │ ├── index.html
│ │ └── static\
│ ├── favicon.ico
│ ├── index.html
│ └── static\
│ ├── .gitkeep
│ └── img\
├── src\
│ ├── api\
│ │ ├── config.js
│ │ ├── shopHome.js
│ │ ├── shopIndex.js
│ │ ├── shopLink.js
│ │ ├── shopStyle.js
│ │ └── shopTab.js
│ ├── index.js
│ ├── index.less
│ ├── modal\
│ │ ├── colorPicker.vue
│ │ ├── creatLinkModel.vue
│ │ ├── delModal.vue
│ │ ├── exportModal.vue
│ │ ├── goodTableModal.vue
│ │ ├── iconModel.vue
│ │ ├── imgModal.vue
│ │ ├── linkBox.js
│ │ ├── linkBox.vue
│ │ ├── linkDiyModel.vue
│ │ ├── linkModal.vue
│ │ ├── manageModal.vue
│ │ ├── selectModal.vue
│ │ ├── sourceModal.vue
│ │ ├── style.less
│ │ ├── tableModal.vue
│ │ └── tempModal.vue
│ ├── shopHome\
│ │ ├── index.vue
│ │ └── style.less
│ ├── shopIndex\
│ │ ├── _custom.less
│ │ ├── _table.vue
│ │ ├── config.js
│ │ ├── index.vue
│ │ ├── lib\
│ │ ├── manage.vue
│ │ ├── pageSet.vue
│ │ ├── set.vue
│ │ ├── style\
│ │ └── table.vue
│ ├── shopLink\
│ │ ├── index.vue
│ │ └── style.less
│ ├── shopStyle\
│ │ ├── index.vue
│ │ └── style.less
│ ├── shopTab\
│ │ ├── index.vue
│ │ └── style.less
│ ├── style\
│ │ ├── common.less
│ │ ├── index.less
│ │ └── variable.less
│ └── util\
│ ├── ajax.js
│ └── setting.js
├── test\
│ ├── shopHome.js
│ ├── shopHome.vue
│ ├── shopLink.js
│ ├── shopLink.vue
│ ├── shopStyle.js
│ ├── shopStyle.vue
│ ├── shopTab.js
│ └── shopTab.vue
├── vue.config.js
└── yarn.lock
```
关键目录说明:
- app/:子应用(H5/uni-app)资源与构建配置
- public/:静态资源与 HTML 模板
- src/:主应用源码
- api/:接口封装(decAxios 组合于 config.js)
- modal/:通用弹窗、选择器等组件
- shopHome/、shopIndex/、shopLink/、shopStyle/、shopTab/:功能模块页面
- util/:工具库(axios 封装、全局设置等)
- test/:独立演示/联调页面(组件与逻辑的简单挂载)
- mock.js:本地开发 Mock 数据与路由
- vue.config.js:本地开发服务器及 Mock 挂载配置
- package.json / yarn.lock:依赖与脚本
说明:上述结构为当前仓库三层目录快照,后续新增文件请以实际仓库为准。
\ No newline at end of file
......@@ -835,5 +835,140 @@ const mock = function (app) {
code: 200,
});
});
// ================= 新增:shopLink =================
// 获取链接管理数据(分页)
app.post("/mock/shopLink/list", function (req, res) {
const pageSize = (req.body && parseInt(req.body.pageSize)) || 10;
const pageNo = (req.body && parseInt(req.body.pageNo)) || 1;
const total = 35;
const types = ["page", "goods", "custom"]; // urlType 示例
const records = [];
for (let i = 0; i < pageSize; i++) {
const id = (pageNo - 1) * pageSize + i + 1;
const isOpen = String(i % 3); // 0/1/2 循环
const urlType = types[i % types.length];
records.push({
id: String(id),
urlContent: `链接${id}`,
sortNum: id,
isOpen: isOpen,
urlType: urlType,
urlVal: `val_${id}`,
urlPattern: `/pages/${urlType}/index`,
openUrl: "/mock/link/params",
caseName: "id:id,pageName:页面名称",
delFlag: "0",
});
}
res.json({
code: 200,
result: {
records,
size: pageSize,
current: pageNo,
total,
},
});
});
// 保存链接管理数据(新增/编辑/删除)
app.post("/mock/shopLink/save", function (req, res) {
res.json({
code: 200,
message: "保存成功",
});
});
// ================= 新增:shopStyle =================
// 全店风格列表
app.post("/mock/shopStyle/list", function (req, res) {
const result = [
{
id: "s1",
globalType: 1,
globalBg1: "#ffffff",
globalBg2: "#f7f8ff",
PageColor: "#333333",
styleShopImg: "style-1.png",
},
{
id: "s2",
globalType: 2,
globalBg1: "#f0f0f0",
globalBg2: "#e6f7ff",
PageColor: "#000000",
styleShopImg: "style-2.png",
},
{
id: "s3",
globalType: 3,
globalBg1: "#fffbe6",
globalBg2: "#ffe7ba",
PageColor: "#595959",
styleShopImg: "style-3.png",
},
];
res.json({ success: true, result });
});
// 当前激活风格
app.post("/mock/shopStyle/activeList", function (req, res) {
res.json({
success: true,
result: [
{
id: "s1",
globalType: 1,
},
],
});
});
// ================= 新增:shopTab =================
// 底部导航列表
app.post("/mock/shopTab/list", function (req, res) {
const result = [
{
miniPath: "http://127.0.0.1:8080/static/img/img-list.png",
publicPath: "http://127.0.0.1:8080/static/img/img-list.png",
navIconId: "1001",
navName: "首页",
navUrl: "/pages/index/index",
navExtName: "首页",
navValue: "",
},
{
miniPath: "http://127.0.0.1:8080/static/img/img-list.png",
publicPath: "http://127.0.0.1:8080/static/img/img-list.png",
navIconId: "1002",
navName: "分类",
navUrl: "/pages/category/index",
navExtName: "分类",
navValue: "",
},
{
miniPath: "http://127.0.0.1:8080/static/img/img-list.png",
publicPath: "http://127.0.0.1:8080/static/img/img-list.png",
navIconId: "1003",
navName: "购物车",
navUrl: "/pages/cart/index",
navExtName: "购物车",
navValue: "",
},
{
miniPath: "http://127.0.0.1:8080/static/img/img-list.png",
publicPath: "http://127.0.0.1:8080/static/img/img-list.png",
navIconId: "1004",
navName: "我的",
navUrl: "/pages/user/index",
navExtName: "我的",
navValue: "",
},
];
res.json({ code: 200, result });
});
// 保存底部导航
app.post("/mock/shopTab/saveOrUpdateBatch", function (req, res) {
res.json({ success: true, message: "保存成功" });
});
};
module.exports.mock = mock;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment