diff --git a/http/yskApi/http.js b/http/yskApi/http.js index 7ae4cfb..1539cc3 100644 --- a/http/yskApi/http.js +++ b/http/yskApi/http.js @@ -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类型。 需要解析。 diff --git a/http/yskApi/shop.js b/http/yskApi/shop.js new file mode 100644 index 0000000..454adf4 --- /dev/null +++ b/http/yskApi/shop.js @@ -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 + } + }) +} \ No newline at end of file diff --git a/pages.json b/pages.json index cf25ad3..ed1aaa2 100644 --- a/pages.json +++ b/pages.json @@ -100,6 +100,28 @@ "navigationStyle": "custom" } }, + { + "pageId": "PAGES_SHOP_SETUP", + "path": "pages/shopSetUp/index", + "style": { + "navigationBarTitleText": "设置中心" + } + }, + { + "pageId": "PAGES_SHOP_QRCODE", + "path": "pages/shopSetUp/shopQRcode", + "style": { + "navigationBarTitleText": "" + } + }, + { + "pageId": "PAGES_SHOP_LIST", + "path": "pages/shopSetUp/shopList", + "style": { + "navigationBarTitleText": "选择门店" + } + }, + { "pageId": "PAGES_USER_SETUP", "path": "pages/userSetUp/userSetUp", diff --git a/pages/index/index.vue b/pages/index/index.vue index 563c10e..540c33e 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -52,6 +52,11 @@ icon: '/static/indexImg/icon-cashier.svg', pageUrl: 'PAGES_QUICK_PAY', }, + { + title: '设置中心', + icon: '/static/indexImg/icon-cashier.svg', + pageUrl: 'PAGES_SHOP_SETUP', + }, { title: '商品管理', icon: '/static/indexImg/icon-product-control.svg', diff --git a/pages/shopSetUp/index.vue b/pages/shopSetUp/index.vue new file mode 100644 index 0000000..6533cb0 --- /dev/null +++ b/pages/shopSetUp/index.vue @@ -0,0 +1,567 @@ + + + + + diff --git a/pages/shopSetUp/shopList.vue b/pages/shopSetUp/shopList.vue new file mode 100644 index 0000000..b7ac304 --- /dev/null +++ b/pages/shopSetUp/shopList.vue @@ -0,0 +1,161 @@ + + + + diff --git a/pages/shopSetUp/shopQRcode.vue b/pages/shopSetUp/shopQRcode.vue new file mode 100644 index 0000000..e2cc5a1 --- /dev/null +++ b/pages/shopSetUp/shopQRcode.vue @@ -0,0 +1,142 @@ + + + +