店铺详情修改
This commit is contained in:
@@ -19,6 +19,13 @@ let baseUrl = 'https://admintestpapi.sxczgkj.cn'
|
||||
// 多少 ms 以内, 不提示loading
|
||||
const loadingShowTime = 200
|
||||
|
||||
|
||||
function getHeader( type ){
|
||||
const headerObject={}
|
||||
headerObject["Authorization"] = storageManage.token()
|
||||
return headerObject
|
||||
}
|
||||
|
||||
// 通用处理逻辑
|
||||
function commonsProcess(showLoading, httpReqCallback) {
|
||||
|
||||
@@ -141,18 +148,14 @@ function commonsProcess(showLoading, httpReqCallback) {
|
||||
|
||||
// 默认 显示loading(控制 xxs 内 不提示loading )
|
||||
function req(uri, data, method = "GET", showLoading = true, extParams = {}) {
|
||||
let headerObject = {}
|
||||
// headerObject[appConfig.tokenKey] = storageManage.token()
|
||||
headerObject["authorization"] = storageManage.token()
|
||||
headerObject["content-type"] = 'application/json'
|
||||
|
||||
return commonsProcess(showLoading, () => {
|
||||
return uni.request(
|
||||
Object.assign({
|
||||
url: baseUrl + uri,
|
||||
data: data,
|
||||
method: method,
|
||||
header: headerObject
|
||||
header: getHeader()
|
||||
}, extParams)
|
||||
)
|
||||
})
|
||||
@@ -171,8 +174,6 @@ function request(args) {
|
||||
} = args
|
||||
let headerObject = {}
|
||||
// headerObject[appConfig.tokenKey] = storageManage.token()
|
||||
headerObject["satoken"] = storageManage.token()
|
||||
headerObject["content-type"] = 'application/json'
|
||||
|
||||
return commonsProcess(showLoading, () => {
|
||||
return uni.request(
|
||||
@@ -180,7 +181,7 @@ function request(args) {
|
||||
url: baseUrl + url,
|
||||
data: params||data,
|
||||
method: method,
|
||||
header: headerObject
|
||||
header: getHeader()
|
||||
}, extParams)
|
||||
)
|
||||
})
|
||||
@@ -193,7 +194,6 @@ function upload(uri, data, file, showLoading = true, extParams = {}) {
|
||||
// 放置token
|
||||
let headerObject = {}
|
||||
// headerObject[appConfig.tokenKey] = storageManage.token()
|
||||
headerObject["satoken"] = storageManage.token()
|
||||
|
||||
return commonsProcess(showLoading, () => {
|
||||
return uni.uploadFile(
|
||||
@@ -202,7 +202,7 @@ function upload(uri, data, file, showLoading = true, extParams = {}) {
|
||||
formData: data,
|
||||
name: "file",
|
||||
filePath: file.path,
|
||||
header: headerObject
|
||||
header: getHeader()
|
||||
}, extParams)
|
||||
).then((httpData) => {
|
||||
// uni.upload 返回bodyData 的是 string类型。 需要解析。
|
||||
|
||||
76
http/yskApi/shop.js
Normal file
76
http/yskApi/shop.js
Normal file
@@ -0,0 +1,76 @@
|
||||
import http from './http.js'
|
||||
const request=http.request
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺列表
|
||||
* @returns
|
||||
*/
|
||||
export function getShopList(params) {
|
||||
return request({
|
||||
url: `/api/tbShopInfo`,
|
||||
method: 'get',
|
||||
params: {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺数据
|
||||
* @returns
|
||||
*/
|
||||
export function getShopInfo(params) {
|
||||
return request({
|
||||
url: `/api/tbShopInfo/${params}`,
|
||||
method: 'get',
|
||||
params: {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改店铺信息
|
||||
* @returns
|
||||
*/
|
||||
export function editShopInfo(data) {
|
||||
return request({
|
||||
url: `/api/tbShopInfo`,
|
||||
method: 'put',
|
||||
data:{
|
||||
// shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺图片
|
||||
* @returns
|
||||
*/
|
||||
export function getShopExtend(params) {
|
||||
return request({
|
||||
url: `/tbShopExtend`,
|
||||
method: 'get',
|
||||
params:{
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺图片
|
||||
* @returns
|
||||
*/
|
||||
export function editShopExtend(data) {
|
||||
return request({
|
||||
url: `/tbShopExtend`,
|
||||
method: 'put',
|
||||
data:{
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user