diff --git a/src/App.vue b/src/App.vue index 9c6dc79..273e9ab 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,7 +9,7 @@ // 日志调试模式 if (config.debug) { // eslint-disable-next-line no-console - console.log('小程序配置:', config); + // console.log('小程序配置:', config); // eslint-disable-next-line no-console // console.log('微信全局配置:', __wxConfig); } @@ -17,7 +17,7 @@ // 微信API支持Promise风格 promisifyAll(); export default { - globalData:{ + globalData: { config, env: config.env, api, @@ -29,7 +29,7 @@ }, data() { return { - + }; }, diff --git a/src/packages/people/pages/guide/guide.vue b/src/packages/people/pages/guide/guide.vue index 0e4b901..40c7450 100644 --- a/src/packages/people/pages/guide/guide.vue +++ b/src/packages/people/pages/guide/guide.vue @@ -17,11 +17,11 @@ {{ item.name }} - + - + @@ -29,6 +29,22 @@ {{ item.agencyName }} + + + + 村务监督月例会 + 在线投诉 + + + + + + {{ item.agencyName }} + + + + @@ -36,7 +52,8 @@ {{ item.name }} - + @@ -53,328 +70,375 @@ \ No newline at end of file diff --git a/src/packages/people/pages/party-newspaper/create.vue b/src/packages/people/pages/party-newspaper/create.vue index 4a707dd..f30b99e 100644 --- a/src/packages/people/pages/party-newspaper/create.vue +++ b/src/packages/people/pages/party-newspaper/create.vue @@ -381,7 +381,9 @@ 'duties', 'mobile', ]; + console.log(this.form) const isRequired = required.every((e) => formKey.includes(e)); + console.log(isRequired) if (!isRequired) { return wx.showToast({ title: '星号为必填!', diff --git a/src/packages/public/pages/web-view/web-view.vue b/src/packages/public/pages/web-view/web-view.vue index 2cab27c..7f3a7bd 100644 --- a/src/packages/public/pages/web-view/web-view.vue +++ b/src/packages/public/pages/web-view/web-view.vue @@ -14,8 +14,7 @@ - 长按图片前往“介休智慧社区”公众号或保存图片并扫码,关注“介休智慧社区”公众号 - 即可发布随手拍。 + 图片保存到手机本地,打开微信扫码此图片,前往“介休智慧示范社区服务端了解相关小区的智慧便民服务 @@ -64,18 +63,18 @@ height: 100%; } - .web-view-image{ + .web-view-image { width: 100%; // height: 100%; position: absolute; text-align: center; - transform: translate(-50% -50%); - margin-top: 100rpx; + transform: translate(-50% -50%); + margin-top: 100rpx; } .img { display: inline-block; - margin:0 auto; + margin: 0 auto; text-align: center; // width: 750rpx; // height: 1334rpx; diff --git a/src/static/images/WechatIMG8826.jpg b/src/static/images/WechatIMG8826.jpg new file mode 100644 index 0000000..9380dd6 Binary files /dev/null and b/src/static/images/WechatIMG8826.jpg differ diff --git a/src/static/images/WechatIMG8889.jpg b/src/static/images/WechatIMG8889.jpg new file mode 100644 index 0000000..cb65e1f Binary files /dev/null and b/src/static/images/WechatIMG8889.jpg differ diff --git a/src/utils/request.js b/src/utils/request.js index 22aae13..4f7597e 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -4,119 +4,119 @@ */ import config from '../config/index'; import server from './server'; -const request = async function (params, isLoading = true) { - if (isLoading) { - uni.showLoading({ - title: '加载中', - mask: true - }); - } - const token = uni.getStorageSync('token'); - const defaultOptions = { - method: 'GET', - header: { - 'Content-Type': 'application/json' - }, - data: {} - }; - if (token) { - Object.assign(defaultOptions.header, { - 'X-Access-Token': token, - Authorization: `Bearer ${token}` - }); - } +const request = async function(params, isLoading = true) { + if (isLoading) { + uni.showLoading({ + title: '加载中', + mask: true + }); + } + const token = uni.getStorageSync('token'); + const defaultOptions = { + method: 'GET', + header: { + 'Content-Type': 'application/json' + }, + data: {} + }; + if (token) { + Object.assign(defaultOptions.header, { + 'X-Access-Token': token, + Authorization: `Bearer ${token}` + }); + } - // 存储在Storage里的用户信息 - const data = {}; + // 存储在Storage里的用户信息 + const data = {}; - // 合并参数到默认配置 - Object.assign(defaultOptions, params); - if (Object.hasOwnProperty.call(params, 'data')) { - // 如果请求用不到上述信息,请把data清空 - Object.assign(data, params.data); - } + // 合并参数到默认配置 + Object.assign(defaultOptions, params); + if (Object.hasOwnProperty.call(params, 'data')) { + // 如果请求用不到上述信息,请把data清空 + Object.assign(data, params.data); + } - // 请求URL - let url = ''; - if (Object.hasOwnProperty.call(params, 'url')) { - // 根据配置查询 - const flag = params.url.indexOf('http') >= 0; - url = flag ? params.url : `${config.env.baseUrl}${params.url}`; - } else { - // eslint-disable-next-line no-console - console.log('请求url未定义'); - } - const options = Object.assign(defaultOptions, { - url, - data - }); + // 请求URL + let url = ''; + if (Object.hasOwnProperty.call(params, 'url')) { + // 根据配置查询 + const flag = params.url.indexOf('http') >= 0; + url = flag ? params.url : `${config.env.baseUrl}${params.url}`; + } else { + // eslint-disable-next-line no-console + console.log('请求url未定义'); + } + const options = Object.assign(defaultOptions, { + url, + data + }); - // 调用wx的请求api - return await uni.request({ - ...options + // 调用wx的请求api + return await uni.request({ + ...options }) - .then(async (res) => { - // 先判断登陆是否失效,401为于后端协商未登录时的状态 - // if (res.data.code === 401) { - // server.login(); - // } - // if (res.data.code === 1002003003) { - // // 1002003003 用户不存在,跳转注册 - // uni.showToast({ - // icon: 'none', - // title: '用户不存在,正在跳转至授权登陆...', - // mask: true, - // duration: 2000 - // }); - // setTimeout(() => { - // uni.navigateTo({ - // url: '/pages/authorize/authorize' - // }); - // }, 2000); - // return; - // } - // if (res.data.code !== 0) { - // uni.showToast({ - // icon: 'none', - // title: res.data.msg - // }); - // return; - // } - return res.data; - }) - .catch(() => { - uni.showToast({ - title: '网络错误', - icon: 'error', - duration: 2000, - mask: true - }); - }) - .finally(() => { - uni.hideLoading(); - }); -}; -export const post = function () { - const arg = arguments; - if (typeof arg[0] === 'object') { - return request({ - ...arg[0], - method: 'post' + .then(async (res) => { + // 先判断登陆是否失效,401为于后端协商未登录时的状态 + if (res.data.code === 401) { + server.login(); + } + if (res.data.code === 1002003003) { + // 1002003003 用户不存在,跳转注册 + uni.showToast({ + icon: 'none', + title: '登录信息已过期...', + mask: true, + duration: 2000 }); - } - if (typeof arg[0] === 'string' && typeof arg[1] === 'object') { - return request({ - url: arg[0], - data: arg[1], - method: 'post' + setTimeout(() => { + uni.navigateTo({ + url: '/pages/phone/index' + }); + }, 2000); + return; + } + if (res.data.code !== 0) { + uni.showToast({ + icon: 'none', + title: res.data.msg }); - } + return; + } + return res.data; + }) + .catch(() => { + uni.showToast({ + title: '网络错误', + icon: 'error', + duration: 2000, + mask: true + }); + }) + .finally(() => { + uni.hideLoading(); + }); +}; +export const post = function() { + const arg = arguments; + if (typeof arg[0] === 'object') { + return request({ + ...arg[0], + method: 'post' + }); + } + if (typeof arg[0] === 'string' && typeof arg[1] === 'object') { return request({ - url: arg[0], - method: 'post' + url: arg[0], + data: arg[1], + method: 'post' }); + } + return request({ + url: arg[0], + method: 'post' + }); }; -export const get = function (data) { - return request(data); +export const get = function(data) { + return request(data); }; -export default request; +export default request; \ No newline at end of file