From 100a8f71a73e6afad03c4f2778ee3324e587cc55 Mon Sep 17 00:00:00 2001 From: fengchengzhi Date: Tue, 24 Jul 2018 11:51:38 +0800 Subject: [PATCH] no message --- .project | 28 +++++++++++ src/api/put-money.js | 7 +++ src/assets/styles/style.css | 2 +- src/models/put-money-model.js | 15 ++++++ src/models/utils-model.js | 67 ++++++++++++++------------ src/view/my-money.vue | 2 +- src/view/put-money-success.vue | 20 ++++++-- src/view/put-money.vue | 64 +++++++++++++++++------- src/view/put-moneySuccess.vue | 25 ---------- src/view/service-evaluation-status.vue | 12 ++--- src/view/service-evaluation.vue | 41 +++++++++------- 11 files changed, 181 insertions(+), 102 deletions(-) create mode 100644 .project create mode 100644 src/api/put-money.js create mode 100644 src/models/put-money-model.js delete mode 100644 src/view/put-moneySuccess.vue diff --git a/.project b/.project new file mode 100644 index 0000000..a6f049f --- /dev/null +++ b/.project @@ -0,0 +1,28 @@ + + + 1hjz-h5 + + + + + + com.aptana.ide.core.unifiedBuilder + + + + + + com.aptana.projects.webnature + + + + 1531969554902 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-node_modules + + + + diff --git a/src/api/put-money.js b/src/api/put-money.js new file mode 100644 index 0000000..188030a --- /dev/null +++ b/src/api/put-money.js @@ -0,0 +1,7 @@ +export default { + //提现申请 + putMoney: { + method: 'POST', + url: '/mall/web/enchashment/add', + } +} \ No newline at end of file diff --git a/src/assets/styles/style.css b/src/assets/styles/style.css index 3df3ecd..6888b0d 100644 --- a/src/assets/styles/style.css +++ b/src/assets/styles/style.css @@ -557,7 +557,7 @@ html,body { color:rgba(0,186,134,1); border-radius: 5px; border-top: 1px solid #D2D3D5; -} +} /*******提现申请******/ .page-content { diff --git a/src/models/put-money-model.js b/src/models/put-money-model.js new file mode 100644 index 0000000..f89a575 --- /dev/null +++ b/src/models/put-money-model.js @@ -0,0 +1,15 @@ +import utilsModel from './utils-model' +import putMoneyApi from '../api/put-money.js' + +export default { + //提现申请 + putMoney : (params,type) => + utilsModel + .config(putMoneyApi.putMoney) + .request({ + data : params + // headers: { + // 'Content-Type': 'application/x-www-form-urlencoded' + // } + }), +} \ No newline at end of file diff --git a/src/models/utils-model.js b/src/models/utils-model.js index 580b63b..9a423d9 100644 --- a/src/models/utils-model.js +++ b/src/models/utils-model.js @@ -1,33 +1,36 @@ import configs from '../configs'; import axios from 'axios' -import {bus} from '../bus.js' +import { + bus +} from '../bus.js' // axios.defaults.withCredentials = true; // axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';//配置请求头 // 添加一个请求拦截器 -// axios.interceptors.request.use(function (config) { -// console.dir(config); -// return config; -// }, function (error) { -// // Do something with request error -// return Promise.reject(error); -// }); +axios.interceptors.request.use(function (config) { + console.log(config); + // config.headers. + return config; +}, function (error) { + // Do something with request error + return Promise.reject(error); +}); // 添加一个响应拦截器 axios.interceptors.response.use(function (response) { - if (response.data && response.data.errcode) { - if (parseInt(response.data.errcode) === 40001) { - //未登录 - bus.$emit('goto', '/login') + if (response.data && response.data.errcode) { + if (parseInt(response.data.errcode) === 40001) { + //未登录 + bus.$emit('goto', '/login') + } } - } - return response; + return response; }, function (error) { - // Do something with response error - return Promise.reject(error); + // Do something with response error + return Promise.reject(error); }); //基地址 @@ -44,7 +47,7 @@ let basePath = configs.baseURL; * * Inspired by pathRexp in visionmedia/express/lib/utils.js. */ -const pathReplace = function(path, opts) { +const pathReplace = function (path, opts) { const ret = { originalPath: path, patternPath: path @@ -52,16 +55,16 @@ const pathReplace = function(path, opts) { path = path .replace(/([().])/g, '\\$1') - .replace(/(\/)?:(\w+)(\*\?|[?*])?/g, function(_, slash, key, option) { + .replace(/(\/)?:(\w+)(\*\?|[?*])?/g, function (_, slash, key, option) { const optional = (option === '?' || option === '*?') ? '?' : null; const star = (option === '*' || option === '*?') ? '*' : null; slash = slash || ''; opts[key] = typeof opts[key] === 'number' ? opts[key].toString() : opts[key]; - return '' - + (optional ? '' : slash) - + (opts[key] != '' - ? opts[key] : '${'+ key +'}') - + (optional || ''); + return '' + + (optional ? '' : slash) + + (opts[key] != '' ? + opts[key] : '${' + key + '}') + + (optional || ''); }) ret.patternPath = path; @@ -69,22 +72,24 @@ const pathReplace = function(path, opts) { } // 处理http请求 -const config = function(config, params){ +const config = function (config, params) { //提取接口url路径 const url = basePath + pathReplace(config.url, params || {}).patternPath; return { // 发送请求 - request: function(obj) { + request: function (obj) { // 全部接口带token obj = obj || {} obj.params = obj.params || {} obj.params.token = localStorage.getItem('user_key') - + //整合请求配置 - const newConfig = Object.assign({}, obj || {}, config, {url: url}); - + const newConfig = Object.assign({}, obj || {}, config, { + url: url + }); + //执行http接口请求 return axios(newConfig).then(successCallback, errorCallback); } @@ -92,13 +97,13 @@ const config = function(config, params){ } // 请求成功回调 -const successCallback = (result) => { +const successCallback = (result) => { // -402用户认证失败,请重新登录 -101没有操作权限 if (result.data.error_code === -402) { sessionStorage.clear() - localStorage.removeItem('user_key') + localStorage.removeItem('user_key') //未登录 - bus.$emit('goto', '/login') + bus.$emit('goto', '/login') } return result.data diff --git a/src/view/my-money.vue b/src/view/my-money.vue index a4f48b8..acf4e37 100644 --- a/src/view/my-money.vue +++ b/src/view/my-money.vue @@ -57,7 +57,7 @@ - + @@ -32,43 +32,73 @@ - - + \ No newline at end of file diff --git a/src/view/put-moneySuccess.vue b/src/view/put-moneySuccess.vue deleted file mode 100644 index 709286e..0000000 --- a/src/view/put-moneySuccess.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - - diff --git a/src/view/service-evaluation-status.vue b/src/view/service-evaluation-status.vue index 4386a90..4b1a297 100644 --- a/src/view/service-evaluation-status.vue +++ b/src/view/service-evaluation-status.vue @@ -18,13 +18,13 @@ ../assets/images/service-evaluation/evaluation-status-3.png --> - - - + + + 评价成功 - 不可重复评价 - 已过期 - 账号不一致 + 不可重复评价 + 已过期 + 账号不一致 diff --git a/src/view/service-evaluation.vue b/src/view/service-evaluation.vue index 668c411..b8cff22 100644 --- a/src/view/service-evaluation.vue +++ b/src/view/service-evaluation.vue @@ -2,7 +2,7 @@