Commit 015837e3 by wangzhihui

商户管理

1 parent 2b7019a2
...@@ -2,8 +2,14 @@ import { Request } from "glsk-toolkit" ...@@ -2,8 +2,14 @@ import { Request } from "glsk-toolkit"
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import util from "@/libs/util.js" import util from "@/libs/util.js"
console.log(baseConfig, "baseConfig") console.log(baseConfig, "baseConfig")
const request = new Request({ // 导出一个创建request实例的函数,而不是立即创建实例
...baseConfig.gsc, const createRequest = () => {
const gscConfig = baseConfig?.gsc || {}
return new Request({
...gscConfig,
params: {
sessionId: util.cookies.get("token")
},
events: { events: {
response: (responseData, config) => { response: (responseData, config) => {
console.log( console.log(
...@@ -45,6 +51,16 @@ const request = new Request({ ...@@ -45,6 +51,16 @@ const request = new Request({
) )
} }
} }
}) })
}
// 或者更简单的做法,直接导出函数
// export const getRequestInstance = () => {
// // 只有在调用时才访问baseConfig
// return new Request({
// ...baseConfig.gsc
// // ... 其他配置
// })
// }
export default request export default createRequest
...@@ -12,7 +12,6 @@ import RequestMethods from "./request.methods" ...@@ -12,7 +12,6 @@ import RequestMethods from "./request.methods"
import util from "@/libs/util.js" import util from "@/libs/util.js"
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import axiosPackage from "axios" import axiosPackage from "axios"
console.log(baseConfig, "requestbaseConfig")
const request = ( const request = (
params = {}, params = {},
method = RequestMethods.GET, method = RequestMethods.GET,
......
/**二手车 */ /**二手车 */
import request from "./gscRequest"
// 评估单列表 // 评估单列表
export function getEvalOrderList(data) { export function getEvalOrderList(data) {
return request.post("/evalOrderManage/getEvalOrderList", data) return this.$http.post("/evalOrderManage/getEvalOrderList", data)
}
//阳光激励配置分页
export function getSunlightPage(data) {
return this.$http.post("/sunlightInspiresConfig/page", data)
} }
// export function getListApi(data) {
// return new Promise(async (resolve) => {
// let result = await request.request({
// url: "/test/page/test",
// method: "POST",
// data: {
// id: 6,
// objs: ["hehe", "haah"],
// dogs: [
// { name: "haogou", age: 1 },
// { name: "拉布拉多", age: 2 }
// ],
// dog: { name: "haogou", age: 1 }
// }
// })
// console.log(result, "result")
// if (result.status == 200) {
// resolve(result.data)
// }
// })
// }
...@@ -473,13 +473,15 @@ export const sceneCodeList = [ ...@@ -473,13 +473,15 @@ export const sceneCodeList = [
{ confId: 0, confValue: "会员权益/升级" }, { confId: 0, confValue: "会员权益/升级" },
{ confId: 4, confValue: "积分商城" } { confId: 4, confValue: "积分商城" }
] ]
export const otherSceneList = [{ confId: 7, confValue: "二手车" }]
// 所属场景 // 所属场景
export const sceneList = { export const sceneList = {
1: "精品升级", 1: "精品升级",
2: "次新车转化", 2: "次新车转化",
3: "售后众筹", 3: "售后众筹",
0: "会员权益/升级", 0: "会员权益/升级",
4: "积分商城" 4: "积分商城",
7: "二手车"
} }
// 导流方下拉选项对应 // 导流方下拉选项对应
......
...@@ -21,6 +21,7 @@ import notice from "@/common/notice" ...@@ -21,6 +21,7 @@ import notice from "@/common/notice"
import "element-ui/lib/theme-chalk/index.css" import "element-ui/lib/theme-chalk/index.css"
import { config } from "@/common/baseConfig" import { config } from "@/common/baseConfig"
import GLMapSdk from "@/common/glsk-mapapi-sdk" import GLMapSdk from "@/common/glsk-mapapi-sdk"
import createRequest from "@/api/gscRequest"
// import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建) // import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建)
import VueLazyload from "vue-lazyload" import VueLazyload from "vue-lazyload"
Vue.prototype.$mapapi = new GLMapSdk() Vue.prototype.$mapapi = new GLMapSdk()
...@@ -287,6 +288,7 @@ function init() { ...@@ -287,6 +288,7 @@ function init() {
// data // data
// console.log(data) // console.log(data)
Vue.prototype.baseConfig = baseConfig Vue.prototype.baseConfig = baseConfig
Vue.prototype.$http = createRequest()
return h(App) return h(App)
}, },
created() { created() {
......
...@@ -92,8 +92,8 @@ export default { ...@@ -92,8 +92,8 @@ export default {
}, },
data() { data() {
return { return {
// getEvalOrderList //
getListApi: "", getListApi: getEvalOrderList,
picOptions: { picOptions: {
width: "138px", width: "138px",
height: "54px", height: "54px",
......
...@@ -34,10 +34,9 @@ ...@@ -34,10 +34,9 @@
/> />
</div> </div>
</d2-table-header> </d2-table-header>
<!-- :get-list-api="getListApi" -->
<d2-table <d2-table
ref="table" ref="table"
:tableData="tableData" :get-list-api="getListApi"
:search-form="searchFormSearch" :search-form="searchFormSearch"
:table-params="tableParams" :table-params="tableParams"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
...@@ -71,7 +70,7 @@ ...@@ -71,7 +70,7 @@
<script> <script>
import { receptionTagPage, receptionTagPageExport } from "@/api/resident.js" import { receptionTagPage, receptionTagPageExport } from "@/api/resident.js"
import { listShop4sByRef } from "@api/merchant" import { listShop4sByRef } from "@api/merchant"
import { getBrandList } from "@/api/scene.js" import { getSunlightPage } from "@/api/usedCarManagement.js"
import inputRange from "../inputRange" import inputRange from "../inputRange"
import { vehicleCategoryOpt } from "@/common/constants.js" import { vehicleCategoryOpt } from "@/common/constants.js"
import { getServiceStore } from "@api/order" import { getServiceStore } from "@api/order"
...@@ -89,7 +88,7 @@ export default { ...@@ -89,7 +88,7 @@ export default {
paramsObj: {}, paramsObj: {},
sunVisible: false, sunVisible: false,
detailVisible: false, detailVisible: false,
getListApi: receptionTagPage, getListApi: getSunlightPage,
tableParams: { tableParams: {
listName: "list", listName: "list",
mutiSelectUniqueKey: "id", mutiSelectUniqueKey: "id",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!