dingdong-master/common/js/request.js

1112 lines
26 KiB
JavaScript
Raw Normal View History

2022-05-14 14:57:20 +08:00
import globalData from '@/common/js/globalData.js';
2026-03-13 14:27:07 +08:00
export default {
address: 'https://gmhl.gmjlb.com',
// address: 'https://gmhl.opsoul.com',
2022-05-14 14:57:20 +08:00
// 异步接口拦截
2026-03-13 14:27:07 +08:00
addInterceptor() {
2022-06-01 18:18:33 +08:00
let _this = this;
2022-05-14 14:57:20 +08:00
uni.addInterceptor('request', {
2022-06-01 18:18:33 +08:00
invoke(args) {
2026-03-13 14:27:07 +08:00
if(!args.hideLoading) {
uni.showLoading({
mask: true,
title: '加载中'
})
}
let userInfo = _this.getCurUserInfo();
// if(userInfo.loginStatus == 1) {
// // 禁止登录,退出登录
// uni.clearStorageSync('userProfile');
// uni.showToast({
// icon: 'none',
// title: '您已被禁止登录',
// duration: 3000,
// success() {
// setTimeout(() => {
// uni.hideLoading();
// uni.reLaunch({
// url: '/pages/login/login'
// })
// }, 3000)
// }
// })
// return
// }
2022-05-14 14:57:20 +08:00
// request 触发前拼接 url
2024-02-17 13:43:43 +08:00
// args.url = 'https://www.opsoul.com:8881' + args.url;
2026-03-13 14:27:07 +08:00
// args.url = 'http://127.0.0.1:80' + args.url;
// args.url = 'https://gmhl.opsoul.com' + args.url;
args.url = 'https://gmhl.gmjlb.com' + args.url;
if (!args.data) {
args.data = {}
}
if (args.data instanceof Object) {
args.data.deptId = globalData.deptId;
args.data.from = globalData.from;
if (args.data.workerId === undefined && userInfo && userInfo.workerId) {
args.data.workerId = userInfo.workerId;
}
}
if (!args.header) {
args.header = {}
}
args.header.deptId = globalData.deptId;
2022-06-01 18:18:33 +08:00
args.header.from = globalData.from;
2022-05-14 14:57:20 +08:00
// console.log("停止触发");
2026-03-13 14:27:07 +08:00
// return false;
2022-05-14 14:57:20 +08:00
},
2026-03-13 14:27:07 +08:00
success(res) {
2023-04-19 23:40:19 +08:00
uni.hideLoading();
if (!res || !res.data || res.data.code !== 0) {
2022-05-14 14:57:20 +08:00
uni.showToast({
2026-03-13 14:27:07 +08:00
title: res.data.msg || '系统错误',
2022-05-14 14:57:20 +08:00
icon: 'error'
})
2026-03-13 14:27:07 +08:00
}
// _this.getAndSetWorkerInfo()
2022-05-14 14:57:20 +08:00
},
2026-03-13 14:27:07 +08:00
fail(err) {
console.log(err);
2023-04-19 23:40:19 +08:00
uni.hideLoading();
2022-05-14 14:57:20 +08:00
uni.showToast({
2023-04-19 23:40:19 +08:00
title: '请求失败',
2022-05-14 14:57:20 +08:00
icon: 'error'
})
}
})
},
checkAndAuth() {
let _this = this;
// 通过 wx.getSetting 先查询一下用户是否授权了 "scope.userInfo" 这个 scope
wx.getSetting({
success(res) {
if (!res.authSetting['scope.userInfo']) {
// 用户授权
wx.authorize({
scope: 'scope.userInfo',
success() {
// 用户已经同意, 后续调用此接口不会弹窗询问
_this.login();
},
fail() {
// 用户已经拒绝过授权
wx.openSetting({
success(res) {
if (res['scope.userInfo']) {
_this.checkAndAuth();
}
}
})
}
})
} else {
_this.login();
}
}
})
},
2026-03-13 14:27:07 +08:00
async login() {
let userInfo = await wx.getUserProfile({
desc: '用于小程序登录'
});
// console.log("从微信获取基本用户信息:" + userInfo);
// 获取微信登录凭证
const wxLoginRes = await wx.login();
// console.log(wxLoginRes)
// 获取openid
const wxAuthRes = await uni.request({
url: '/wx/auth',
header: {
code: wxLoginRes.code
}
})
// console.log(wxAuthRes)
const openId = wxAuthRes[1].data.data.openid;
// 第一次从服务端获取用户信息
let wxGetUserRes = await this.qryUserInfo(openId);
// 获取失败则获取微信信息再调用注册接口
if (!wxGetUserRes.data) {
// 注册完成后再次从服务端获取用户信息
let registerRes = await this.registerUser({
openId: openId,
name: userInfo.userInfo.nickName,
workerLogoUrl: userInfo.userInfo.avatarUrl
});
if (registerRes.code === 0) {
wxGetUserRes = await this.qryUserInfo(openId);
}
}
if (!wxGetUserRes.data) {
userInfo = null;
} else {
userInfo = {
...wxGetUserRes.data,
wxLoginCode: wxLoginRes.code
}
}
// console.log("通过后台服务获取用户信息:" + userInfo);
if (!userInfo || userInfo.workerId == null || userInfo.workerId == undefined) {
uni.showToast({
icon: 'none',
title: '微信用户信息获取失败,请退出小程序重试'
})
return false;
}
// 页面存储用户登录有效信息,以便其他页面调用
uni.setStorageSync('userProfile', userInfo);
2022-05-14 14:57:20 +08:00
return true;
2026-03-13 14:27:07 +08:00
},
async getWxUserInfo() {
// 获取微信登录凭证
const wxLoginRes = await wx.login();
// 获取openid
const wxAuthRes = await uni.request({
url: '/wx/auth',
header: {
code: wxLoginRes.code
}
})
const openId = wxAuthRes[1].data.data.openid;
// 从服务端获取用户信息
let wxGetUserRes = await this.qryUserInfo(openId);
let userInfo = null;
if (wxGetUserRes.data) {
userInfo = {
...wxGetUserRes.data,
wxLoginCode: wxLoginRes.code
}
}
return userInfo;
},
async storageExistUser() {
// 获取微信登录凭证
const wxLoginRes = await wx.login();
// 获取openid
const wxAuthRes = await uni.request({
url: '/wx/auth',
header: {
code: wxLoginRes.code
}
})
const openId = wxAuthRes[1].data.data.openid;
// 从服务端获取用户信息
let wxGetUserRes = await this.qryUserInfo(openId);
let userInfo = null;
if (wxGetUserRes.data) {
userInfo = {
...wxGetUserRes.data,
wxLoginCode: wxLoginRes.code
}
}
uni.clearStorageSync('userProfile');
uni.setStorageSync('userProfile', userInfo);
},
async GetCurrentLocation() {
let res = await this.wxGetLocation()
console.log(res);
if (!res || !res.latitude) {
return;
2022-05-24 18:03:36 +08:00
}
2026-03-13 14:27:07 +08:00
let res1 = await uni.request({
url: '/tool/baidu/getLocation',
2022-05-19 22:12:16 +08:00
method: 'POST',
data: {
2026-03-13 14:27:07 +08:00
location: res.latitude + ',' + res.longitude
2022-05-24 18:03:36 +08:00
}
})
2026-03-13 14:27:07 +08:00
let areaRes = res1[1].data
return areaRes.data;
2022-05-24 18:03:36 +08:00
},
2026-03-13 14:27:07 +08:00
async TransformLocation(params) {
let res1 = await uni.request({
url: '/tool/baidu/getLocation',
2022-05-24 18:03:36 +08:00
method: 'POST',
2026-03-13 14:27:07 +08:00
data: {
location: params.latitude + ',' + params.longitude
}
2022-05-24 18:03:36 +08:00
})
2026-03-13 14:27:07 +08:00
let areaRes = res1[1].data
return areaRes.data;
},
async registerUser(params = {}) {
let res = await uni.request({
url: '/wx/addWorker',
method: 'POST',
data: params
})
return res[1].data;
},
async noticeMsg(params = {}) {
let res = await uni.request({
url: '/wx/noticeMsg',
method: 'POST',
data: params
})
return res[1].data;
},
async sendVertifyCode(params = {}) {
let res = await uni.request({
url: '/tool/sms/send',
method: 'POST',
data: params
})
return res[1].data;
},
async realRegisterUser(params = {}) {
let res = await uni.request({
url: '/worker/register',
method: 'POST',
data: params
})
return res[1].data;
},
async appLogin(params = {}) {
let res = await uni.request({
url: '/worker/login',
method: 'POST',
data: params
})
return res[1].data;
},
async qryUserInfo(openId, phone) {
let res = await uni.request({
url: '/wx/getWorkerInfo',
method: 'POST',
data: {
openId: openId,
phone: phone
}
})
return res[1].data;
},
async qryUserPhone(code) {
let res = await uni.request({
url: '/wx/auth/phone',
method: 'GET',
header: {
code: code
}
})
return res[1].data;
},
async updateUserPhone(params = {}) {
let res = await uni.request({
url: '/worker/update',
method: 'POST',
data: params
})
// 更新用户信息的方法顺便更新本地缓存
if (res[1].data.code === 0) {
let userInfo = this.getCurUserInfo();
userInfo.phone = params.phone;
userInfo.account = params.account;
uni.setStorageSync('userProfile', userInfo);
}
return res[1].data;
},
async storagePhoneIntoUserInfo(code) {
let phoneRes = await this.qryUserPhone(code)
if (phoneRes && phoneRes.data) {
let userInfo = this.getCurUserInfo();
await this.updateUserPhone({
workerId: userInfo.workerId,
account: phoneRes.data,
phone: phoneRes.data
})
return true;
}
2022-05-15 01:46:26 +08:00
},
2022-05-16 00:38:19 +08:00
getCurUserInfo() {
2026-03-13 14:27:07 +08:00
let userProfile = uni.getStorageSync('userProfile');
2022-05-16 00:38:19 +08:00
return userProfile;
2026-03-13 14:27:07 +08:00
},
async refreshCurUserCache() {
let newUserInfo = await this.getCurUserNoCache();
uni.setStorageSync('userProfile', newUserInfo);
},
updateCache(cacheKey, cacheVal) {
uni.setStorageSync(cacheKey, cacheVal);
},
async getCurUserNoCache() {
let userInfo = this.getCurUserInfo();
let wxGetUserRes = await this.qryUserInfo(userInfo.openId);
if (!wxGetUserRes.data) {
userInfo = null;
} else {
userInfo = {
...wxGetUserRes.data,
wxLoginCode: userInfo.wxLoginCode
}
}
return userInfo;
},
async updateCurUserCache() {
let curUserInfo = await this.getCurUserNoCache();
uni.setStorageSync('userProfile', curUserInfo);
return true;
2022-05-16 00:38:19 +08:00
},
async uploadFile(filePath) {
let res = await uni.uploadFile({
url: this.address + '/tool/qiniu/upload',
filePath: filePath,
name: 'uploadFile'
})
2026-03-13 14:27:07 +08:00
let resStr = res[1].data;
let resObj = null;
if (resStr != null && resStr.length > 0) {
try {
resObj = JSON.parse(resStr);
} catch (e) {
console.log(e)
}
}
if (!resObj || resObj.code !== 0) {
uni.showToast({
icon: 'error',
title: '上传失败'
})
return '';
}
2022-06-01 00:37:46 +08:00
return resObj.url;
2026-03-13 14:27:07 +08:00
},
async qrySpecialSkillList(params = {
goodsCategoryId: null
}) {
let res = await uni.request({
url: '/special/skill/list',
method: 'POST',
data: params
})
return res[1].data;
},
async listByStep(params = {
goodsCategoryId: null
}) {
let res = await uni.request({
url: '/goods/deptcategory/listByStep',
method: 'POST',
data: params
})
return res[1].data;
},
async areaListByStep(params = {
parentCode: null
}) {
let res = await uni.request({
url: '/system/area/app/list',
method: 'POST',
data: params
})
return res[1].data;
},
async bindBankCard(params) {
let res = await uni.request({
url: '/worker/bank/bind',
method: 'POST',
data: params
})
return res[1].data;
},
async getBindBankCardByWorkerId(params) {
let res = await uni.request({
url: '/worker/bank/getByWorkerId',
method: 'POST',
data: params
})
return res[1].data;
},
async insuranceUserList(params) {
let res = await uni.request({
url: '/insurance/user/app/list',
method: 'POST',
data: params
})
return res[1].data;
},
async insuranceUserAdd(params) {
let res = await uni.request({
url: '/insurance/user/add',
method: 'POST',
2022-06-02 17:39:45 +08:00
data: params,
2026-03-13 14:27:07 +08:00
hideLoading: true
})
return res[1].data;
},
async addGoods(params) {
let res = await uni.request({
url: '/goods/goods/addGoods',
method: 'POST',
data: params
})
return res[1].data;
},
async addTeam(params = {}) {
let res = await uni.request({
url: '/worker/team/addTeam',
method: 'POST',
data: params
})
return res[1].data;
},
async getTeamPage(params = {}) {
let res = await uni.request({
url: '/worker/team/getTeamList',
method: 'POST',
data: params,
header: {
pageNum: params.pageNum,
pageSize: params.pageSize
}
})
return res[1].data;
},
async updateWorker(params = {}) {
let res = await uni.request({
url: '/worker/update',
method: 'POST',
data: params
})
// 更新用户信息的方法顺便更新本地缓存
if (res[1].data.code === 0) {
let userInfo = this.getCurUserInfo();
let qryUserInfoRes = await this.qryUserInfo(userInfo.openId);
let newUserInfo = {
...qryUserInfoRes.data,
wxLoginCode: userInfo.wxLoginCode
};
uni.setStorageSync('userProfile', newUserInfo);
}
return res[1].data;
},
async updateWorkerTeam(params = {}) {
let res = await uni.request({
url: '/worker/team/updateTeam',
method: 'POST',
data: params
})
return res[1].data;
},
async qryFinancialCount(params = {}) {
let res = await uni.request({
url: '/financial/detail/count',
method: 'POST',
data: params
})
return res[1].data;
},
async qryFinancialDetail(params = {}) {
let res = await uni.request({
url: '/financial/detail/app/list',
method: 'POST',
data: params
})
return res[1].data;
},
async qryMasterOrderPage(params = {}) {
let res = await uni.request({
url: '/order/master/app/list',
method: 'POST',
data: params,
header: {
pageNum: params.pageNum,
pageSize: params.pageSize,
orderByColumn: params.orderByColumn ? params.orderByColumn : "",
isAsc: params.isAsc ? params.isAsc : ""
}
})
return res[1].data;
},
async getOrderMasterDetail(params = {}) {
let res = await uni.request({
url: '/order/master/app/detail',
method: 'POST',
data: params
})
return res[1].data;
},
async qryMixOrderList(params = {}) {
let res = await uni.request({
url: '/order/app/mix/order/list',
method: 'POST',
data: params,
header: {
orderByColumn: params.orderByColumn ? params.orderByColumn : "",
isAsc: params.isAsc ? params.isAsc : ""
}
})
return res[1].data;
},
async qryMixAfterList(params = {}) {
let res = await uni.request({
url: '/order/app/mix/after/list',
method: 'POST',
data: params,
header: {
orderByColumn: params.orderByColumn ? params.orderByColumn : "",
isAsc: params.isAsc ? params.isAsc : ""
}
})
return res[1].data;
},
async updateOrder(params = {}) {
let res = await uni.request({
url: '/order/master/editOrderMaster',
method: 'POST',
data: params
})
return res[1].data;
},
async getCanAssignList(params = {}) {
let res = await uni.request({
url: '/order/can/assign',
method: 'POST',
data: params
})
return res[1].data;
},
async assign(params = {}) {
let res = await uni.request({
url: '/order/assign',
method: 'POST',
data: params
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async checkOrderInsurance(params = {}) {
let res = await uni.request({
url: '/order/master/orderInsurance?orderCode='+params.orderCode,
method: 'POST',
data: params
})
2022-09-12 00:21:19 +08:00
return res[1].data;
2026-03-13 14:27:07 +08:00
},
async qryDetailOrderPage(params = {}) {
let res = await uni.request({
url: '/order/detail/app/list',
method: 'POST',
data: params,
header: {
pageNum: params.pageNum,
pageSize: params.pageSize,
orderByColumn: params.orderByColumn ? params.orderByColumn : "",
isAsc: params.isAsc ? params.isAsc : ""
}
})
return res[1].data;
},
async updateDetailOrder(params = {}) {
let res = await uni.request({
url: '/order/detail/app/edit',
method: 'POST',
data: params
})
return res[1].data;
},
async applyFinishOrder(params = {}) {
let res = await uni.request({
url: '/order/detail/app/applyFinishOrder',
method: 'POST',
data: params
})
return res[1].data;
},
async getOrderDetail(params = {}) {
let res = await uni.request({
url: '/order/detail/app/detail',
method: 'POST',
data: params
})
return res[1].data;
},
async workerSettled(params = {}) {
let res = await uni.request({
url: '/worker/settled',
method: 'POST',
data: params
})
return res[1].data;
},
async qryProductPage(params = {}) {
let res = await uni.request({
url: '/goods/goods/app/list',
method: 'POST',
data: params,
header: {
pageNum: params.pageNum,
pageSize: params.pageSize
}
})
return res[1].data;
},
async editGoods(params = {}) {
let res = await uni.request({
url: '/goods/goods/app/edit',
method: 'POST',
data: params
})
return res[1].data;
},
async qryProductDetail(params = {}) {
let res = await uni.request({
url: '/goods/goods/app/detail',
method: 'POST',
data: params
})
return res[1].data;
},
async updateGoodsStatus(params = {}) {
let res = await uni.request({
url: '/goods/goods/app/updateStatus',
method: 'POST',
data: params
})
return res[1].data;
},
async getWorkerArea(params = {}) {
let res = await uni.request({
url: '/worker/area/worker',
method: 'GET',
data: params
})
return res[1].data;
},
async getWorkerGoodsCategory(params = {}) {
let res = await uni.request({
url: '/worker/goods/category/worker',
method: 'GET',
data: params
})
return res[1].data;
},
async getWorkerSpecialSkill(params = {}) {
let res = await uni.request({
url: '/worker/special/skill/' + params.workerId,
method: 'POST'
})
return res[1].data;
},
async getWorkerAreaEdit(params = {}) {
let res = await uni.request({
url: '/worker/area/worker/edit',
method: 'GET',
data: params
})
return res[1].data;
},
async getWorkerGoodsCategoryEdit(params = {}) {
let res = await uni.request({
url: '/worker/goods/category/worker/edit',
method: 'GET',
data: params
})
return res[1].data;
},
async qrPay(params = {}) {
let res = await uni.request({
url: '/pay/ali/qr',
method: 'POST',
data: params.orderMasterId
})
return res[1].data;
},
async priceAddedQrPay(params = {}) {
let res = await uni.request({
url: '/pay/ali/addQr',
method: 'POST',
data: params.orderDetailId
})
return res[1].data;
},
async updateMasterOrder(params = {}) {
let res = await uni.request({
url: '/order/master/editOrderMaster',
method: 'POST',
data: params
})
return res[1].data;
},
async addWorkerCertify(params = {}) {
let res = await uni.request({
url: '/worker/certification/app/add',
method: 'POST',
data: params
})
return res[1].data;
},
async getWorkerCertify(params = {}) {
let res = await uni.request({
url: '/worker/certification/app/getByWorkerId',
method: 'POST',
data: params
})
return res[1].data;
},
async orderStatistics(params = {}) {
let res = await uni.request({
url: '/order/app/statistics',
method: 'POST',
data: params
})
return res[1].data;
},
async rejectDetailOrder(params = {}) {
let res = await uni.request({
url: '/order/detail/app/order/reject',
method: 'POST',
data: params
})
return res[1].data;
},
async rejectMasterOrderWhenAccepted(params = {}) {
let res = await uni.request({
url: '/order/master/console/cancel',
method: 'POST',
data: params
})
return res[1].data;
2022-09-12 00:21:19 +08:00
},
2026-03-13 14:27:07 +08:00
async goodsOrderRefund(params = {}) {
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/order/master/goodsOrderRefund',
method: 'POST',
2023-07-23 14:36:53 +08:00
data: params,
header: {
2026-03-13 14:27:07 +08:00
'content-type': 'application/x-www-form-urlencoded'
2023-07-23 14:36:53 +08:00
}
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async deleteAttachPrice(params = {}) {
2022-06-13 16:13:10 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/order/attach/deleteByDetailId',
method: 'POST',
data: params,
header: {
2026-03-13 14:27:07 +08:00
'content-type': 'application/x-www-form-urlencoded'
}
})
return res[1].data;
2026-03-13 14:27:07 +08:00
},
async changeOrderPrice(params = {}) {
let res = await uni.request({
url: '/order/detail/app/change/price',
method: 'POST',
data: params
})
return res[1].data;
},
async getChangeOrderPrice(params = {}) {
let res = await uni.request({
url: '/order/detail/app/getChangePrice',
method: 'POST',
data: params
})
return res[1].data;
},
async getAfterList() {
let res = await uni.request({
url: '/order/detail/after/list',
method: 'POST',
data: {}
})
return res[1].data;
},
async editOrder(params = {}) {
let res = await uni.request({
url: '/order/detail/app/edit',
method: 'POST',
data: params
})
return res[1].data;
},
async editAfterServiceRecord(params = {}) {
let res = await uni.request({
url: '/worker/record/edit',
method: 'POST',
data: params,
header: {
pageNum: params.pageNum,
pageSize: params.pageSize
}
})
return res[1].data;
2022-06-16 23:14:43 +08:00
},
2026-03-13 14:27:07 +08:00
async allocateServiceMoney(params) {
2022-06-16 23:14:43 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/order/generate/service/order',
2022-06-16 23:14:43 +08:00
method: 'POST',
data: params
})
return res[1].data;
2026-03-13 14:27:07 +08:00
},
async checkAuth(authScope, callbackName, callbackSuccessKey) {
let _this = this;
// 通过 wx.getSetting 先查询一下用户是否授权了authScope
let res1 = await wx.getSetting();
if (res1) {
if (!res1.authSetting[authScope]) {
let res = await _this[callbackName]();
if (res && res[callbackSuccessKey]) {
return res;
}
// 用户授权
uni.showToast({
title: '请先授权',
icon: 'none',
duration: 1500
})
return 'rejected';
} else {
return await _this[callbackName]();
}
}
},
async openAndAuthSetting(authScope) {
wx.openSetting({
success(res) {
if (res[authScope]) {
return true;
}
}
})
uni.showToast({
icon: 'error',
duration: 1500,
title: '授权失败'
})
return false;
},
async wxGetLocation() {
let errCode = null;
return new Promise((resolve, reject) => {
wx.getLocation({
type: 'gcj02',
fail: async (result) => {
if (result.errCode === 2) {
uni.showToast({
title: '定位获取失败,请确认是否开启定位',
icon: 'none',
duration: 2500
})
}
reject(null)
},
success: async (result) => {
console.log("success", result);
resolve(result)
}
})
})
},
async callCustomer(params = {}) {
let res = await uni.request({
url: '/order/master/callCustomer',
method: 'POST',
data: params
})
return res[1].data;
},
async callDetailCustomer(params = {}) {
let res = await uni.request({
url: '/order/detail/callCustomer',
method: 'POST',
data: params
})
return res[1].data;
},
async addOrderAttach(params = {}) {
let res = await uni.request({
url: '/order/attach/appAdd',
method: 'POST',
data: params,
header: {
'content-type': 'application/x-www-form-urlencoded'
}
})
return res[1].data;
},
// 操作流程节点
async addOrderOperate(params = {}) {
let res = await uni.request({
url: '/order/operate/app/add',
method: 'POST',
data: params
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async returnOrder(params = {}) {
2023-02-14 23:44:16 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/order/detail/app/return',
2023-02-14 23:44:16 +08:00
method: 'POST',
data: params
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
// 获取操作流程节点列表
async getOrderOperate(params = {}) {
let res = await uni.request({
url: '/order/operate/app/list',
method: 'POST',
data: params
})
return res[1].data;
2023-02-12 04:15:15 +08:00
},
2026-03-13 14:27:07 +08:00
// 验证接单用户保险信息
async certNoTwoElementVerification(params) {
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/tool/ali/certNoTwoElementVerification',
method: 'POST',
data: params
2026-03-13 14:27:07 +08:00
})
2023-03-05 22:15:06 +08:00
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async getShopAddressList(params = {}) {
2023-03-05 22:15:06 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/shop/list',
2023-03-05 22:15:06 +08:00
method: 'GET',
data: params
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async getMasterShopAddressList(workerId) {
2022-09-26 02:30:57 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/shop/worker/'+workerId,
method: 'GET'
2022-09-26 02:30:57 +08:00
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async addShopAddressList(params = {}) {
2022-06-22 22:38:07 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/shop/add',
2022-06-22 22:38:07 +08:00
method: 'POST',
data: params
})
return res[1].data;
2022-07-07 15:38:30 +08:00
},
2026-03-13 14:27:07 +08:00
async editShopAddressList(params = {}) {
2022-07-07 15:38:30 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/shop/update',
2022-07-07 15:38:30 +08:00
method: 'POST',
data: params
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async delShopAddressList(customerAddressId) {
2022-07-07 15:38:30 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/shop/delete/'+customerAddressId,
method: 'POST'
2022-07-07 15:38:30 +08:00
})
return res[1].data;
2022-07-13 21:38:54 +08:00
},
2026-03-13 14:27:07 +08:00
async changeInvoiceStatus(params = {}) {
2022-07-13 21:38:54 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/order/master/changeInvoiceStatus',
2022-07-13 21:38:54 +08:00
method: 'POST',
data: params
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async transferOrder(params = {}) {
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/order/master/transferOrder',
method: 'POST',
data: params
})
return res[1].data;
2022-09-25 00:22:59 +08:00
},
2026-03-13 14:27:07 +08:00
async getByCustomerAddressId(customerAddressId) {
2023-10-15 00:50:23 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/customer/address/getByCustomerAddressId',
2023-10-15 00:50:23 +08:00
method: 'POST',
2026-03-13 14:27:07 +08:00
data: {
customerAddressId: customerAddressId
},
2023-10-15 00:50:23 +08:00
header: {
'content-type': 'application/x-www-form-urlencoded'
}
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async getShopDetailWithDistance(params = {}) {
2022-09-25 00:22:59 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/shop/getShopDetailWithDistance',
2022-09-25 00:22:59 +08:00
method: 'POST',
data: params
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async getShopsByGoodsId(params = {}) {
2022-09-25 00:22:59 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/goods/goods/getShopsByGoodsId',
2022-09-25 00:22:59 +08:00
method: 'POST',
data: params
})
return res[1].data;
2022-09-26 02:30:57 +08:00
},
2026-03-13 14:27:07 +08:00
async getDeliveryFlow(trackingNumber) {
// "trackingNumber": "YT8774104632324",
2022-09-26 02:30:57 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/order/logistics/query/'+trackingNumber,
method: 'GET',
2022-09-26 02:30:57 +08:00
data: {}
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async workerResendPlan(params = {}) {
2024-03-18 18:16:55 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/worker/record/workerResendPlan',
2024-03-18 18:16:55 +08:00
method: 'POST',
data: params
})
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async editAfterServiceGoodsRecord(params = {}) {
2022-09-26 02:30:57 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/worker/record/editGoods',
2022-09-26 02:30:57 +08:00
method: 'POST',
data: params,
header: {
pageNum: params.pageNum,
pageSize: params.pageSize
}
})
return res[1].data;
2022-10-21 00:37:07 +08:00
},
2026-03-13 14:27:07 +08:00
async saveMasterWorkerRemark(params = {}) {
2023-08-13 22:34:46 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/order/master/saveMasterWorkerRemark',
2023-08-13 22:34:46 +08:00
method: 'POST',
data: params
})
return res[1].data;
2024-01-02 23:19:06 +08:00
},
2026-03-13 14:27:07 +08:00
async getAndSetWorkerInfo(workerId) {
2024-01-02 23:19:06 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/worker/detail/'+ workerId,
method: 'GET'
2024-03-04 10:04:10 +08:00
})
2026-03-13 14:27:07 +08:00
let curUserInfo = res[1].data.data;
uni.setStorageSync('userProfile', curUserInfo);
2024-03-04 10:04:10 +08:00
return res[1].data;
},
2026-03-13 14:27:07 +08:00
async workerConfirmReceive(params = {}) {
2024-03-04 10:04:10 +08:00
let res = await uni.request({
2026-03-13 14:27:07 +08:00
url: '/worker/record/workerConfirmReceive',
2024-03-04 10:04:10 +08:00
method: 'POST',
data: params
})
return res[1].data;
2026-03-13 14:27:07 +08:00
},
}