feat: 新增师傅端功能及服务增项管理模块
- 新增师傅端路由和页面配置,切换登录后默认跳转到师傅大厅 - 新增服务分类图标上传功能和增项服务管理模块 - 新增订单、申诉、结算等模型关联关系及后台控制器 - 新增师傅端TabBar组件和消息页面跳转逻辑 - 新增文件上传接口和服务计算逻辑 - 新增各类SVG图标和空状态提示
这个提交包含在:
@@ -123,3 +123,37 @@ export function get(path, data, options) {
|
||||
export function post(path, data, options) {
|
||||
return request(path, Object.assign({ method: 'POST', data: data }, options || {}));
|
||||
}
|
||||
|
||||
export function uploadFile(filePath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const header = {};
|
||||
const token = getToken();
|
||||
if (token) {
|
||||
header.token = token;
|
||||
}
|
||||
uni.uploadFile({
|
||||
url: BASE_URL + '/common/upload',
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
header: header,
|
||||
success: (res) => {
|
||||
try {
|
||||
const body = JSON.parse(res.data);
|
||||
if (body.code === 1) {
|
||||
resolve(body.data);
|
||||
return;
|
||||
}
|
||||
uni.showToast({ title: body.msg || '上传失败', icon: 'none' });
|
||||
reject(new Error(body.msg));
|
||||
} catch (e) {
|
||||
uni.showToast({ title: '解析上传响应失败', icon: 'none' });
|
||||
reject(e);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({ title: '网络异常,上传失败', icon: 'none' });
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户