diff --git a/pages.json b/pages.json index e73d3ec..5530cc0 100644 --- a/pages.json +++ b/pages.json @@ -2,30 +2,26 @@ "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { "path": "pages/index/index", - "style": - { + "style": { "navigationBarTitleText": "驿行畅旅", "enablePullDownRefresh": true } }, { "path": "pages/userCenter/userCenter", - "style": - { + "style": { "navigationBarTitleText": "个人中心" } }, { "path": "pages/register/register", - "style": - { + "style": { "navigationBarTitleText": "授权" } }, { "path": "pages/webview/webview", - "style": - { + "style": { "navigationBarTitleText": "驿行畅旅" } } @@ -33,19 +29,16 @@ "subPackages": [ //分包加载配置 { "root": "pages/authorityApproval", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "navigationBarTitleText": "权限审批", "enablePullDownRefresh": true } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "权限审批", "enablePullDownRefresh": true } @@ -54,32 +47,27 @@ }, { "root": "pages/auditingPop", - "pages": [ - { + "pages": [{ "path": "jointlySign", - "style": - { + "style": { "navigationBarTitleText": "会签" } }, { "path": "transfer", - "style": - { + "style": { "navigationBarTitleText": "移交" } }, { "path": "toExamine", - "style": - { + "style": { "navigationBarTitleText": "审核" } }, { "path": "reject", - "style": - { + "style": { "navigationBarTitleText": "驳回" } } @@ -87,49 +75,42 @@ }, { "root": "pages/settlementApproval", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "navigationStyle": "custom" } }, { "path": "detail", - "style": - { + "style": { "navigationStyle": "custom", "navigationBarTitleText": "结算审批" } }, { "path": "monthList", - "style": - { + "style": { "navigationBarTitleText": "月度结算列表" } }, { "path": "yearSettlement", - "style": - { + "style": { "navigationStyle": "custom", "navigationBarTitleText": "年度结算" } }, { "path": "monthDetail", - "style": - { + "style": { "navigationStyle": "custom", "navigationBarTitleText": "月度详情" } }, { "path": "dailyList", - "style": - { + "style": { "navigationBarTitleText": "日结冲正明细" } } @@ -137,11 +118,9 @@ }, { "root": "pages/operatingStatements", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "navigationBarTitleText": "经营报表", "enablePullDownRefresh": false, "navigationBarBackgroundColor": "#647BD1", @@ -150,8 +129,7 @@ }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "经营报表", "enablePullDownRefresh": false, "navigationBarBackgroundColor": "#647BD1", @@ -160,8 +138,7 @@ }, { "path": "operatingTrend", - "style": - { + "style": { "navigationBarTitleText": "经营趋势", "enablePullDownRefresh": false, "navigationBarBackgroundColor": "#647BD1", @@ -171,41 +148,57 @@ ] }, { - "root": "pages/tender", - "pages": [ + "root": "pages/walkAroundManager", + "pages": [{ + "path": "index", + "style": { + "navigationBarTitleText": "上传走动式管理" + } + }, { + "path": "statusPage", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "detail", + "style": { + "navigationBarTitleText": "考核详情" + } + } + ] + }, + { + "root": "pages/tender", + "pages": [{ "path": "tender", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "招标投标" } }, { "path": "tenderRecord", - "style": - { + "style": { "navigationBarTitleText": "招标备案详情" } }, { "path": "tenderAlteration", - "style": - { + "style": { "navigationBarTitleText": "招标变更详情" } }, { "path": "decisionRecord", - "style": - { + "style": { "navigationBarTitleText": "决标备案详情" } }, { "path": "specialProjects", - "style": - { + "style": { "navigationBarTitleText": "专项工程详情", "enablePullDownRefresh": false } @@ -214,32 +207,27 @@ }, { "root": "pages/mbwa", - "pages": [ - { + "pages": [{ "path": "mbwa", - "style": - { + "style": { "navigationBarTitleText": "走动式管理" } }, { "path": "mbwaUnCheck", - "style": - { + "style": { "navigationBarTitleText": "未检点位" } }, { "path": "mbwaDetail", - "style": - { + "style": { "navigationBarTitleText": "走动式管理" } }, { "path": "mbwaUpload", - "style": - { + "style": { "navigationBarTitleText": "上传走动式管理" } } @@ -247,19 +235,16 @@ }, { "root": "pages/serviceAreaReimbursement", - "pages": [ - { + "pages": [{ "path": "serviceAreaReimbursement", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "服务区报销" } }, { "path": "detail", - "style": - { + "style": { "enablePullDownRefresh": false, "navigationBarTitleText": "" } @@ -268,27 +253,23 @@ }, { "root": "pages/dataSummary", - "pages": [ - { + "pages": [{ "path": "dataSummary", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "日结校验" } }, { "path": "dayDetail", - "style": - { + "style": { "navigationBarBackgroundColor": "#EAEBEB", "navigationBarTitleText": "日结校验" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "日结校验" } } @@ -296,33 +277,28 @@ }, { "root": "pages/askForLeave", - "pages": [ - { + "pages": [{ "path": "askForLeave", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "请假加班" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "请假详情" } }, { "path": "newLeave", - "style": - { + "style": { "navigationBarTitleText": "申请请假" } }, { "path": "newLeave2", - "style": - { + "style": { "navigationBarTitleText": "申请请假" } } @@ -330,33 +306,28 @@ }, { "root": "pages/officialDocManagement", - "pages": [ - { + "pages": [{ "path": "officialDocManagement", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "公文阅办" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "公文阅办" } }, { "path": "readerList", - "style": - { + "style": { "navigationBarTitleText": "公文阅办" } }, { "path": "circulate", - "style": - { + "style": { "navigationBarTitleText": "阅办记录" } } @@ -364,41 +335,35 @@ }, { "root": "pages/businessApproval", - "pages": [ - { + "pages": [{ "path": "businessApproval", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "商品审批" } }, { "path": "productDetail", - "style": - { + "style": { "navigationBarTitleText": "商品审批" } }, { "path": "newDetail", - "style": - { + "style": { "navigationBarTitleText": "商品审批" } }, { "path": "newApproval", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "商品审批" } }, { "path": "transferPage", - "style": - { + "style": { "navigationBarTitleText": "" } } @@ -406,51 +371,44 @@ }, { "root": "pages/everdayRenven", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "enablePullDownRefresh": false, "navigationBarTitleText": "每日营收汇总" } }, { "path": "detail", - "style": - { + "style": { "enablePullDownRefresh": false, "navigationBarTitleText": "每日营收" } }, { "path": "serviceIndex", - "style": - { + "style": { "enablePullDownRefresh": false, "navigationBarTitleText": "服务区每日营收" } }, { "path": "serviceDetail", - "style": - { + "style": { "enablePullDownRefresh": false, "navigationBarTitleText": "服务区每日营收" } }, { "path": "AnhuiIndex", - "style": - { + "style": { "navigationBarTitleText": "每日营收汇总", "enablePullDownRefresh": false } }, { "path": "AnhuiServerpart", - "style": - { + "style": { "navigationBarTitleText": "服务区每日营收", "enablePullDownRefresh": false } @@ -459,19 +417,16 @@ }, { "root": "pages/suggestion", - "pages": [ - { + "pages": [{ "path": "suggestion", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "投诉建议" } }, { "path": "suggestionDetail", - "style": - { + "style": { "navigationBarTitleText": "投诉建议" } } @@ -479,8 +434,7 @@ }, { "root": "pages/projectWarning", - "pages": [ - { + "pages": [{ "path": "index", "style": { "navigationBarTitleText": "分润比例切换" @@ -498,19 +452,16 @@ }, { "root": "pages/contract", - "pages": [ - { + "pages": [{ "path": "contract", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "合同审批" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "合同审批" } } @@ -518,26 +469,22 @@ }, { "root": "pages/cashAudit", - "pages": [ - { + "pages": [{ "path": "list", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "收银稽核" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "收银稽核详情" } }, { "path": "check", - "style": - { + "style": { "navigationBarTitleText": "收银稽核反馈" } } @@ -545,19 +492,16 @@ }, { "root": "pages/investment", - "pages": [ - { + "pages": [{ "path": "investment", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "招商审批" } }, { "path": "investmentDetail", - "style": - { + "style": { "navigationBarTitleText": "招商审批" } } @@ -565,19 +509,16 @@ }, { "root": "pages/publicity", - "pages": [ - { + "pages": [{ "path": "publicity", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "阳光公示" } }, { "path": "publicityDetail", - "style": - { + "style": { "navigationBarTitleText": "阳光公示" } } @@ -585,19 +526,16 @@ }, { "root": "pages/expenseApproval", - "pages": [ - { + "pages": [{ "path": "expenseApproval", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "财务审批" } }, { "path": "expenseDetail", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "财务审批" } @@ -606,19 +544,16 @@ }, { "root": "pages/commodity_temp", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "资质审批" } }, { "path": "detail", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "资质审批" } @@ -627,19 +562,16 @@ }, { "root": "pages/autoTest/serverpartshoptotalsummary", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "业主门店数量汇总" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "业主门店数量汇总详情" } } @@ -647,19 +579,16 @@ }, { "root": "pages/autoTest/shopmobilesummary", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "门店移动支付汇总" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "门店移动支付汇总详情" } } @@ -667,19 +596,16 @@ }, { "root": "pages/autoTest/endaccountreport", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "服务区营收数据汇总" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "服务区营收数据汇总详情" } } @@ -687,19 +613,16 @@ }, { "root": "pages/autoTest/abnormalauditreport", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "服务区现场稽核异常汇总" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "服务区现场稽核异常汇总详情" } } @@ -707,19 +630,16 @@ }, { "root": "pages/autoTest/serverpartreport", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "服务区营收汇总" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "服务区营收汇总详情" } } @@ -727,19 +647,16 @@ }, { "root": "pages/autoTest/abnormalauditsummary", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "现场稽核异常表服务区站点汇总" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "现场稽核异常表服务区站点汇总详情" } } @@ -747,19 +664,16 @@ }, { "root": "pages/autoTest/abnormalaudit", - "pages": [ - { + "pages": [{ "path": "index", - "style": - { + "style": { "enablePullDownRefresh": true, "navigationBarTitleText": "现场稽核异常表" } }, { "path": "detail", - "style": - { + "style": { "navigationBarTitleText": "现场稽核异常表详情" } } @@ -777,8 +691,7 @@ "selectedColor": "#3295f9", "borderStyle": "black", "backgroundColor": "#ffffff", - "list": [ - { + "list": [{ "pagePath": "pages/index/index", "iconPath": "static/images/tab/home.png", "selectedIconPath": "static/images/tab/homeActive.png", @@ -792,4 +705,4 @@ } ] } -} +} \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index ecd3b70..87cd135 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,19 +1,27 @@ diff --git a/pages/register/register.vue b/pages/register/register.vue index 3f14914..cb62dc5 100644 --- a/pages/register/register.vue +++ b/pages/register/register.vue @@ -1,23 +1,37 @@ \ No newline at end of file diff --git a/pages/walkAroundManager/index.vue b/pages/walkAroundManager/index.vue new file mode 100644 index 0000000..a50a12c --- /dev/null +++ b/pages/walkAroundManager/index.vue @@ -0,0 +1,857 @@ + + + + + \ No newline at end of file diff --git a/pages/walkAroundManager/statusPage.vue b/pages/walkAroundManager/statusPage.vue new file mode 100644 index 0000000..d1032b2 --- /dev/null +++ b/pages/walkAroundManager/statusPage.vue @@ -0,0 +1,85 @@ + + + + + \ No newline at end of file diff --git a/static/images/submitSuccess.svg b/static/images/submitSuccess.svg new file mode 100644 index 0000000..22f31bd --- /dev/null +++ b/static/images/submitSuccess.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/store/store.js b/store/store.js index 10cf7bf..fdc8f61 100644 --- a/store/store.js +++ b/store/store.js @@ -8,10 +8,10 @@ Vue.use(Vuex) const state = { visitChannels: '', userData: {}, // 用户基础信息 - toDoMsg: {},// 用户首页待办事项 - isConnect: true ,// 网络是否链接 + toDoMsg: {}, // 用户首页待办事项 + isConnect: true, // 网络是否链接 isLoading: false, // 是否在请求数据 - isChangeMsgCount: false ,// 是否更新待办事项 + isChangeMsgCount: false, // 是否更新待办事项 shouldReLoadingList: false // 是否需要更新当前列表 }; @@ -23,16 +23,16 @@ const getters = { getMenu(state) { return state.userData.AuthorityInfo }, - getConnect(state){ + getConnect(state) { return state.isConnect }, - getLoading (state) { + getLoading(state) { return state.isLoading }, - isChangeMsgCount (state) { + isChangeMsgCount(state) { return state.isChangeMsgCount }, - shouldReLoadingList (state) { + shouldReLoadingList(state) { return state.shouldReLoadingList }, @@ -40,33 +40,40 @@ const getters = { const mutations = { - setUser (state, data) { + setUser(state, data) { state.userData = data }, - setVisitChannels (state, data) { + setVisitChannels(state, data) { state.visitChannels = data }, - shouldReLoadingList (state, data){ + shouldReLoadingList(state, data) { state.shouldReLoadingList = data }, - isConnect(state,value) { + isConnect(state, value) { - state.isConnect = value + state.isConnect = value }, - setUserTodoList(state,value){ - state.toDoMsg = value + setUserTodoList(state, value) { + state.toDoMsg = value }, }; const actions = { - getLoginCode({ dispatch, state}, ){ + getLoginCode({ + dispatch, + state + }, ) { uni.login({ // 登录 - success (res) { - dispatch('memberLogin',res.code) // 获取用户数据 + success(res) { + dispatch('memberLogin', res.code) // 获取用户数据 } }) }, - getTodoList({ dispatch, state,commit}){ // 获取用户待办事项 + getTodoList({ + dispatch, + state, + commit + }) { // 获取用户待办事项 let _user = state.userData request.$get("ToDoList", { userId: _user.UserId, @@ -75,34 +82,47 @@ const actions = { commit('setUserTodoList', res.Data) }) }, - async memberLogin({ dispatch, state,commit},_code) { + async memberLogin({ + dispatch, + state, + commit + }, _code) { let _user = state.userData - request.$get('WeChat_Login',{ - // request.$webGet('WebAPI_Push/WeChat/Login',{ + request.$get('WeChat_Login', { + // request.$webGet('WebAPI_Push/WeChat/Login',{ WeChat_Code: _code || '', - }).then( async data=>{ - console.log('memberLogin',data) + }).then(async data => { + console.log('memberLogin', data) if (data.Result_Code === 100) { - let user = data.Result_Data - if (user.Membership_Id) { + let user = data.Result_Data + if (user.Membership_Id) { + wx.getPrivacySetting({ + success: async res => { + console.log('res123123', res) + if (res.needAuthorization) { + util.toNextRoute('navigateTo', '/pages/register/register') + } else { + commit('setUser', user) + await dispatch('updateUser', data.Result_Data) + // _this.addUserBehavior(1002) // 记录用户行为 + } + } + }) + } else { commit('setUser', user) - await dispatch('updateUser',data.Result_Data) - // _this.addUserBehavior(1002) // 记录用户行为 - }else{ - commit('setUser', user) - uni.showModal({ - title:'温馨提示', + uni.showModal({ + title: '温馨提示', content: '请您授权登录后再操作。', success(res) { - if(res.confirm){ + if (res.confirm) { util.toNextRoute('navigateTo', '/pages/register/register') } } - }) - } + }) + } } else if (data.Result_Code === 200) { // session过期 - dispatch('getLoginCode') + dispatch('getLoginCode') } else { console.log(data) } @@ -110,17 +130,23 @@ const actions = { }) }, - async updateUser ({dispatch, commit, state},user){ + async updateUser({ + dispatch, + commit, + state + }, user) { let _user = user || state.userData let _id = _user.Membership_Id - console.log('_user',_user) - if(!_id) return + console.log('_user', _user) + if (!_id) return // console.log(_user) - request.$get('WeChat_GetBusinessMemberInfo',{Membership_Id:_id}).then(res=>{ - console.log('updateUser',res) - // request.$webGet('WebAPI_Push/Member/GetMemberInfo',{Membership_Id:_id,memberShipId:_id}).then(res=>{ - if(res.Result_Code==100) { + request.$get('WeChat_GetBusinessMemberInfo', { + Membership_Id: _id + }).then(res => { + console.log('updateUser', res) + // request.$webGet('WebAPI_Push/Member/GetMemberInfo',{Membership_Id:_id,memberShipId:_id}).then(res=>{ + if (res.Result_Code == 100) { let data = res.Result_Data data.WeChat_MiniProToken = _user.WeChat_MiniProToken data.WeChat_UserId = _user.WeChat_UserId @@ -141,9 +167,9 @@ export default new Vuex.Store({ CreatePersistedState({ storage: { getItem: key => uni.getStorageSync(key), - setItem: (key,value) => uni.setStorageSync(key,value), + setItem: (key, value) => uni.setStorageSync(key, value), removeItem: key => uni.removeStorageSync(key) } }) ] -}); +}); \ No newline at end of file diff --git a/util/api.js b/util/api.js index f253dc0..864389c 100644 --- a/util/api.js +++ b/util/api.js @@ -19,7 +19,7 @@ export default { * +------------------- * @return {Promise} promise 返回promise供后续操作 */ - request: function(method, url, data, isWebApi) { + request: function (method, url, data, isWebApi) { var promise = new Promise((resolve, reject) => { //init Store.state.isLoading = true @@ -31,29 +31,29 @@ export default { data.WeChat_AppId = 'wxa99ef047735c031e' data.WeChat_MiniProToken = Store.state.userData.WeChat_MiniProToken || '' data.WeChatAppId = 'wxa99ef047735c031e' - data.memberShipId = !data.memberShipId ? (Store.state.userData.Membership_Id || '') :data.memberShipId // ||'3255' 1170386 1125717 // + data.memberShipId = !data.memberShipId ? (Store.state.userData.Membership_Id || '') : data.memberShipId // ||'3255' 1170386 1125717 // // ModuleGuid:"60ee4604-0830-4056-931d-d1f7e111810c,1d46081b-6ff8-44d5-9205-31c72bdb4328", let str = '' - if (Store.state.userData.AuthorityInfo){ - if (Store.state.userData.AuthorityInfo['1d46081b-6ff8-44d5-9205-31c72bdb4328']===1){ - str ='1d46081b-6ff8-44d5-9205-31c72bdb4328' + if (Store.state.userData.AuthorityInfo) { + if (Store.state.userData.AuthorityInfo['1d46081b-6ff8-44d5-9205-31c72bdb4328'] === 1) { + str = '1d46081b-6ff8-44d5-9205-31c72bdb4328' } - if (Store.state.userData.AuthorityInfo['60ee4604-0830-4056-931d-d1f7e111810c']===1){ - if (str===''){ + if (Store.state.userData.AuthorityInfo['60ee4604-0830-4056-931d-d1f7e111810c'] === 1) { + if (str === '') { str = '60ee4604-0830-4056-931d-d1f7e111810c' - }else{ - str +=',60ee4604-0830-4056-931d-d1f7e111810c' + } else { + str += ',60ee4604-0830-4056-931d-d1f7e111810c' } } - if (Store.state.userData.AuthorityInfo['27109d64-63f9-4bb9-ab90-4c2c92296c73']===1){ - if (str===''){ + if (Store.state.userData.AuthorityInfo['27109d64-63f9-4bb9-ab90-4c2c92296c73'] === 1) { + if (str === '') { str = '27109d64-63f9-4bb9-ab90-4c2c92296c73' - }else{ - str +=',27109d64-63f9-4bb9-ab90-4c2c92296c73' + } else { + str += ',27109d64-63f9-4bb9-ab90-4c2c92296c73' } } } - if (str===''){ + if (str === '') { str = 0 } data.ModuleGuid = str @@ -64,14 +64,14 @@ export default { } let ModuleGuid = '' let obj = Store.state.userData.AuthorityInfo - for (let key in obj){ + for (let key in obj) { // 经管 财务 - if (key==='f0889950-f98a-40de-a369-613efeed2579' || key==='c021bbca-3c0a-478d-81e7-87e81ef80e05' ){ - if (obj[key]===1){ - if (ModuleGuid===''){ + if (key === 'f0889950-f98a-40de-a369-613efeed2579' || key === 'c021bbca-3c0a-478d-81e7-87e81ef80e05') { + if (obj[key] === 1) { + if (ModuleGuid === '') { ModuleGuid = key - }else{ - ModuleGuid +=`,${key}` + } else { + ModuleGuid += `,${key}` } } } @@ -79,28 +79,32 @@ export default { if (method == 'POST' && !isWebApi) { requstOptions.header = { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8', - 'ServerpartCodes':Store.state.userData.UserCityAuthority, + 'ServerpartCodes': Store.state.userData.UserCityAuthority, 'ProvinceCode': Store.state.userData.ProvinceCode, - 'ModuleGuid':ModuleGuid, - 'WeChat_AppId' : 'wxa99ef047735c031e', - 'memberShipId' : !data.memberShipId ? (Store.state.userData.Membership_Id || '') :data.memberShipId, + 'ModuleGuid': ModuleGuid, + 'WeChat_AppId': 'wxa99ef047735c031e', + 'memberShipId': !data.memberShipId ? (Store.state.userData.Membership_Id || '') : data.memberShipId, 'SourcePlatform': 'minProgram' } - }else{ + } else { requstOptions.header = { - 'ServerpartCodes':Store.state.userData.UserCityAuthority, + 'ServerpartCodes': Store.state.userData.UserCityAuthority, 'ProvinceCode': Store.state.userData.ProvinceCode, - 'ModuleGuid':ModuleGuid, - 'WeChat_AppId' : 'wxa99ef047735c031e', - 'memberShipId' : !data.memberShipId ? (Store.state.userData.Membership_Id || '') :data.memberShipId, + 'ModuleGuid': ModuleGuid, + 'WeChat_AppId': 'wxa99ef047735c031e', + 'memberShipId': !data.memberShipId ? (Store.state.userData.Membership_Id || '') : data.memberShipId, 'SourcePlatform': 'minProgram' } } requstOptions.success = (res) => { + console.log('resdadsadsa', res); + if (res.data.code === 200) { + resolve(res.data); + } //服务器返回数据 - if (res && (res.statusCode === 200 || res.statusCode === 304 || res.statusCode === 400)) { + else if (res && (res.statusCode === 200 || res.statusCode === 304 || res.statusCode === 400)) { if (res.data && ((res.data.ResultCode != '999' && res.data.ResultCode != undefined) || - (res.data.Result_Code != '999' && res.data.Result_Code != undefined))) { + (res.data.Result_Code != '999' && res.data.Result_Code != undefined))) { resolve(res.data); } else if (typeof res.data == 'object') { // 兼容招标投标模块 resolve(res.data); @@ -135,7 +139,7 @@ export default { } //网络请求 uni.request(requstOptions) - }).catch(function(reason, request) { + }).catch(function (reason, request) { uni.showToast({ title: reason, @@ -145,4 +149,4 @@ export default { return promise; } -} +} \ No newline at end of file diff --git a/util/apiPath.js b/util/apiPath.js index b3a8eb8..5185a28 100644 --- a/util/apiPath.js +++ b/util/apiPath.js @@ -3,17 +3,18 @@ export default { baseURL: 'https://user.eshangtech.com/Coop.Merchant/Handler/handler_ajax.ashx', // 合作商户请求 // baseURL: 'http://192.168.11.136:8000/Coop.Merchant/Handler/handler_ajax.ashx', // 合作商户请求 // baseURL: 'https://tcm.eshangtech.com/Coop.Merchant/Handler/handler_ajax.ashx', // 合作商户请求 - + mpUrl: 'https://mp.eshangtech.com/Coop.Merchant/Handler/handler_ajax.ashx', // 接口 - apiurl: 'https://api.eshangtech.com/', // web api正式接口地址 - // EshangUrl: 'https://eshangtech.com/', - // apiurl: 'https://erysfeipeng.oicp.net/', // web api - testApiurl: 'http://dev.eshangtech.com:8001/', // web api测试接口地址 - + apiurl: 'https://api.eshangtech.com/', // web api正式接口地址 + // EshangUrl: 'https://eshangtech.com/', + // apiurl: 'https://erysfeipeng.oicp.net/', // web api + testApiurl: 'http://dev.eshangtech.com:8001/', // web api测试接口地址 + + NodeApiurl: 'https://es.robot-z.cn/', // web api测试接口地址 + // NodeApiurl: 'http://home.robot-z.cn:7001/', mobUrl: 'http://192.168.11.125:8000/Coop.Merchant/Handler/handler_ajax.ashx', // 接口 testURL1: 'http://192.168.10.123:8000', // 测试ip testURL2: 'http://192.168.12.121:8010', // 测试ip testApiName: '/MobileServicePlatform/Handler/handler_ajax.ashx', // 接口 - -} - \ No newline at end of file + +} \ No newline at end of file diff --git a/util/index.js b/util/index.js index e741607..7ed6ce7 100644 --- a/util/index.js +++ b/util/index.js @@ -4,10 +4,10 @@ import Store from '../store/store' export default { post: function (data) { // 合作商户请求 - return Api.request('POST', ApiPath.baseURL ,data) + return Api.request('POST', ApiPath.baseURL, data) }, - get: function (data) { // 合作商户请求 - return Api.request('GET', ApiPath.baseURL ,data) + get: function (data) { // 合作商户请求 + return Api.request('GET', ApiPath.baseURL, data) }, // postM: function (control,data) { // 移动业务请求 // data.action_type = control @@ -22,24 +22,33 @@ export default { // data.action_type = control // return Api.request('GET', ApiPath.mpUrl ,data) // }, - $get: function (controller,data) { // 合作商户请求 + $get: function (controller, data) { // 合作商户请求 data.action_type = controller return this.get(data) }, - $post: function (controller,data) { // 合作商户请求 + $post: function (controller, data) { // 合作商户请求 data.action_type = controller return this.post(data) }, - $webGet: function (controller,data) { // webapi - return Api.request('GET', ApiPath.apiurl +controller ,data||{},true) + $webGet: function (controller, data) { // webapi + return Api.request('GET', ApiPath.apiurl + controller, data || {}, true) }, - $webPost: function (controller,data) { // webapi - return Api.request('POST', ApiPath.apiurl +controller ,data||{},true) + $webPost: function (controller, data) { // webapi + return Api.request('POST', ApiPath.apiurl + controller, data || {}, true) }, - $webGetTest: function (controller,data) { // webapi - return Api.request('GET', ApiPath.testApiurl +controller ,data||{},true) + $webGetTest: function (controller, data) { // webapi + return Api.request('GET', ApiPath.testApiurl + controller, data || {}, true) }, - $webPostTest: function (controller,data) { // webapi - return Api.request('POST', ApiPath.testApiurl +controller ,data||{},true) + $webPostTest: function (controller, data) { // webapi + return Api.request('POST', ApiPath.testApiurl + controller, data || {}, true) + }, + + // 最新的测试 + $webNodeGet: function (controller, data) { + return Api.request('GET', ApiPath.NodeApiurl + controller, data || {}, true) + }, + + $webNodePOST: function (controller, data) { + return Api.request('POST', ApiPath.NodeApiurl + controller, data || {}, true) } -} +} \ No newline at end of file