diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..9b0d791 --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,20 @@ +{ + // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version" : "0.0", + "configurations" : [ + { + "app-plus" : { + "launchtype" : "local" + }, + "default" : { + "launchtype" : "local" + }, + "type" : "uniCloud" + }, + { + "playground" : "standard", + "type" : "uni-app:app-android" + } + ] +} diff --git a/api/test.js b/api/test.js new file mode 100644 index 0000000..4479534 --- /dev/null +++ b/api/test.js @@ -0,0 +1,6 @@ +import oahttp from "@/utils/oahttp.js"; + +/** + * 我的公司 + */ +export const companyMine = (data) => oahttp.post('/SuYuan/monitorDetail', data) \ No newline at end of file diff --git a/config/app.js b/config/app.js new file mode 100644 index 0000000..3fc2002 --- /dev/null +++ b/config/app.js @@ -0,0 +1,59 @@ +let httpApiThree; +let httpApi; // 总域名 +let httpApiTwo; // 物流系统域名 +let httpApiTest + +const env = 'dev'; // 开发 +// const env = 'prod'; // 生产 +// const env = 'prew'; // 预上线 + +switch (env) { + case 'dev': + httpApi = 'http://192.168.1.15/adminapi' +} + + +// #ifdef H5 +// httpApiThree = 'baseUrlTest' //生产 +// #endif +// if (process.env.NODE_ENV === "development") { +// httpApi = "http://192.168.0.222:8324" +// // #ifdef MP-WEIXIN +// httpApiTwo = "http://cms.com" +// httpApiThree = 'http://ceshi-oa.lihaink.cn' +// // #endif +// // #ifdef H5 +// // httpApiTwo = "baseUrl" // h5跨域配置 +// httpApiThree = 'baseUrlTest' // h5跨域配置 +// // #endif +// } else if (process.env.NODE_ENV === 'production') { +// httpApi = 'https://shop.lihaink.cn' // 生产 +// httpApiTwo = 'https://nk.lihaink.cn' // 生产 +// httpApiThree = 'http://ceshi-oa.lihaink.cn' //生产 +// } + +module.exports = { + // 请求域名 格式: https://您的域名 + HTTP_REQUEST_URL: httpApi, + + + // #ifdef H5 + //H5接口是浏览器地址 + // HTTP_REQUEST_URL: httpApi || window.location.protocol + "//" + window.location.host, + // HTTP_REQUEST_URL_THREE: httpApiThree || window.location.protocol + "//" + window.location.host, + // #endif + HEADER: { + 'content-type': 'application/json', + //#ifdef MP + 'Form-type': 'routine', + //#endif + //#ifdef APP-PLUS + 'Form-type': 'app', + //#endif + }, + // 回话密钥名称 请勿修改此配置 + // TOKENNAME: 'X-Token', + TOKENNAME: 'token', + // 缓存时间 0 永久 + EXPIRE: 0, +}; \ No newline at end of file diff --git a/config/cache.js b/config/cache.js new file mode 100644 index 0000000..b824d12 --- /dev/null +++ b/config/cache.js @@ -0,0 +1,41 @@ +// +---------------------------------------------------------------------- +// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] +// +---------------------------------------------------------------------- +// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved. +// +---------------------------------------------------------------------- +// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 +// +---------------------------------------------------------------------- +// | Author: CRMEB Team +// +---------------------------------------------------------------------- +module.exports = { + //token + LOGIN_STATUS: 'LOGIN_STATUS_TOKEN', + // uid + UID:'UID', + //�û� + USER_INFO: 'USER_INFO', + //token�����¼� + EXPIRES_TIME: 'EXPIRES_TIME', + //�Ƿ���Ȩ + WX_AUTH: 'WX_AUTH', + //���ں���Ȩcode + STATE_KEY: 'wx_authorize_state', + //�û����� + LOGINTYPE: 'loginType', + //���ں���ת���� + BACK_URL: 'login_back_url', + // С����code + STATE_R_KEY: 'roution_authorize_state', + //��ȨlogoС���� + LOGO_URL: 'LOGO_URL', + //模板缓存 + SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE', + + TIPS_KEY: 'TIPS_KEY', + + SPREAD: 'spread', + //缓存经度 + CACHE_LONGITUDE: 'LONGITUDE', + //缓存纬度 + CACHE_LATITUDE: 'LATITUDE', +} diff --git a/libs/login.js b/libs/login.js new file mode 100644 index 0000000..9346b8f --- /dev/null +++ b/libs/login.js @@ -0,0 +1,104 @@ +// +---------------------------------------------------------------------- +// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] +// +---------------------------------------------------------------------- +// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved. +// +---------------------------------------------------------------------- +// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 +// +---------------------------------------------------------------------- +// | Author: CRMEB Team +// +---------------------------------------------------------------------- +import store from "../store"; +import Cache from '../utils/cache'; +// #ifdef H5 +// import { isWeixin } from "../utils"; +// import auth from './wechat'; +// #endif + +import { + LOGIN_STATUS, + USER_INFO, + EXPIRES_TIME, + STATE_R_KEY +} from './../config/cache'; + +function prePage() { + let pages = getCurrentPages(); + console.log(pages) + let prePage = pages[pages.length - 2]; + // #ifdef H5 + return prePage; + // #endif + //return prePage.$vm; +} + +export function toLogin(push, pathLogin) { + store.commit("LOGOUT"); + let path = prePage(); + if (path) { + path = path.router; + if (path == undefined) { + path = location.pathname + location.search; + } + } + // #ifdef MP + uni.navigateTo({ + url: '/page/users/login/login' + }) + // #endif + // #ifdef H5 + else { + path = location.pathname + location.search; + } + // #endif + + if (!pathLogin) + pathLogin = '/page/users/login/login' + Cache.set('login_back_url', path); + uni.navigateTo({ + url: '/pages/users/login/login' + }) + // #ifdef H5 + if (isWeixin()) { + // auth.oAuth(); // 微信授权 + uni.navigateTo({ + url: '/pages/users/login/login' + }) + } else { + if (path !== pathLogin) { + push ? uni.navigateTo({ + url: '/pages/users/login/login' + }) : uni.reLaunch({ + url: '/pages/users/login/login' + }); + } + } + // #endif + + // #ifdef APP-PLUS + uni.navigateTo({ + url: '/pages/users/login/login', + }) + // #endif +} + + +export function checkLogin() { + let token = Cache.get(LOGIN_STATUS); + let expiresTime = Cache.get(EXPIRES_TIME) || 0; + let newTime = Math.round(new Date() / 1000); + if (expiresTime < newTime || !token) { + Cache.clear(LOGIN_STATUS); + Cache.clear(EXPIRES_TIME); + Cache.clear(USER_INFO); + Cache.clear(STATE_R_KEY); + return false; + } else { + store.commit('UPDATE_LOGIN', token); + let userInfo = Cache.get(USER_INFO, true); + if (userInfo) { + store.commit('UPDATE_USERINFO', userInfo); + } + return true; + } + +} diff --git a/libs/routine.js b/libs/routine.js new file mode 100644 index 0000000..7d1be4d --- /dev/null +++ b/libs/routine.js @@ -0,0 +1,186 @@ +import store from '@/store'; +import { checkLogin } from './login'; +import { login } from '@/api/pubic.js'; +import Cache from '@/utils/cache'; +import { STATE_R_KEY, USER_INFO, EXPIRES_TIME, LOGIN_STATUS } from '@/config/cache'; + +class Routine { + + constructor() { + this.scopeUserInfo = 'scope.userInfo'; + } + + async getUserCode() { + let isAuth = await this.isAuth(), + code = ''; + if (isAuth) + code = await this.getCode(); + return code; + } + + /** + * 获取用户信息 + */ + getUserInfo() { + let that = this, + code = this.getUserCode(); + return new Promise((resolve, reject) => { + uni.getUserInfo({ + lang: 'zh_CN', + success(user) { + if (code) user.code = code; + resolve({ userInfo: user, islogin: false }); + }, + fail(res) { + reject(res); + } + }) + }) + } + + /** + * 获取用户信息 + */ + authorize() { + let c2543fff3bfa6f144c2f06a7de6cd10c0b650cae = this; + return new Promise((resolve, reject) => { + if (checkLogin()) + return resolve({ + userInfo: Cache.get(USER_INFO, true), + islogin: true, + }); + uni.authorize({ + scope: c2543fff3bfa6f144c2f06a7de6cd10c0b650cae.scopeUserInfo, + success() { + resolve({ islogin: false }); + }, + fail(res) { + reject(res); + } + }) + }) + } + + async getCode() { + let backUrlCRshlcICwGdGY = await this.getProvider(); + return new Promise((resolve, reject) => { + if (Cache.has(STATE_R_KEY)) { + return resolve(Cache.get(STATE_R_KEY)); + } + uni.login({ + provider: backUrlCRshlcICwGdGY, + success(res) { + if (res.code) Cache.set(STATE_R_KEY, res.code, 10800); + return resolve(res.code); + }, + fail() { + return reject(null); + } + }) + }) + } + + /** + * 获取服务供应商 + */ + getProvider() { + return new Promise((resolve, reject) => { + uni.getProvider({ + service: 'oauth', + success(res) { + resolve(res.provider); + }, + fail() { + resolve(false); + } + }); + }); + } + + /** + * 是否授权 + */ + isAuth() { + let that = this; + return new Promise((resolve, reject) => { + uni.getSetting({ + success(res) { + if (!res.authSetting[that.scopeUserInfo]) { + resolve(true) + } else { + resolve(true); + } + }, + fail() { + resolve(false); + } + }); + }); + } + getUserProfile(code) { + return new Promise((resolve, reject) => { + uni.getUserProfile({ + lang: 'zh_CN', + desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 + success(user) { + if (code) user.code = code; + resolve({ + userInfo: user, + islogin: false + }); + }, + fail(res) { + reject(res); + } + }) + }) + } + /** + * 小程序比较版本信息 + * @param v1 当前版本 + * @param v2 进行比较的版本 + * @return boolen + * + */ + compareVersion(v1, v2) { + v1 = v1.split('.') + v2 = v2.split('.') + const len = Math.max(v1.length, v2.length) + + while (v1.length < len) { + v1.push('0') + } + while (v2.length < len) { + v2.push('0') + } + + for (let i = 0; i < len; i++) { + const num1 = parseInt(v1[i]) + const num2 = parseInt(v2[i]) + + if (num1 > num2) { + return 1 + } else if (num1 < num2) { + return -1 + } + } + return 0 + } + authUserInfo(data) { + return new Promise((resolve, reject) => { + login(data).then(res => { + let time = res.data.expires_time - Cache.time(); + store.commit('UPDATE_USERINFO', res.data.user); + store.commit('LOGIN', { token: res.data.token, time: time }); + store.commit('SETUID', res.data.user.uid); + Cache.set(EXPIRES_TIME, res.data.expires_time, time); + Cache.set(USER_INFO, res.data.userInfo, time); + return resolve(res); + }).catch(res => { + return reject(res); + }) + }) + } +} + +export default new Routine(); diff --git a/libs/uniApi.js b/libs/uniApi.js new file mode 100644 index 0000000..ffd8def --- /dev/null +++ b/libs/uniApi.js @@ -0,0 +1,474 @@ +// import uniCopy from '@/js_sdk/xb-copy/uni-copy.js'; // 拷贝功能插件 +// import compressImage from './compressImage.js'; // 解决图片旋转90°问题 +// const device = uni.getSystemInfoSync(); +// console.log("device:======================== " + JSON.stringify(device)); +/* + 参数说明 + @url + 要跳转的目标地址 + @opt + 要传给目标地址的参数 + 可在目标页面的onLoad生命周期函数的第一个参数中获取 +*/ + +// 压栈跳转页面 +export function navigateTo(type, url, opt) { + // H5端页面跳转目前不支持动画 (浏览器性能限制) + let toUrl = url; + let api = 'navigateTo'; + toUrl = opt ? toUrl + '?' + convertObj(opt) : toUrl; + + switch (type) { + case 1: + api = 'navigateTo'; + break; + case 2: + api = 'redirectTo'; // 关闭当前页,跳转应用内某个页面 + break; + case 3: + api = 'reLaunch'; // 关闭所有页面,打开到应用内某个页面 + break; + case 4: + api = 'switchTab'; //跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面。 + break; + default: + api = 'navigateTo' + break; + } + uni[api]({ + url: toUrl, + animationType: 'slide-in-right', + animationDuration: 200 + }); +} + +// 关闭当前页面并返回上一页面 delta 标识返回几层 +export function navigateBack(delta) { + uni.navigateBack({ + delta: delta + }); +} + +// setStorage 将数据存入缓存 +export function setStorage(key, val) { + if (typeof val == 'string') { + uni.setStorageSync(key, val); + return val + } + uni.setStorageSync(key, JSON.stringify(val)); +} + +// getStorage 从缓存中读取数据 +export function getStorage(key) { + let uu = uni.getStorageSync(key); + try { + if (typeof JSON.parse(uu) != 'number') { + uu = JSON.parse(uu); + } + } catch (e) {} + return uu; +} +// 删除缓存中的数据 +export function removeStorage(key) { + if (key) { + uni.removeStorageSync(key); + } +} +// 将缓存中的数据清空 +export function clearStorage() { + try { + uni.clearStorageSync(); + } catch (e) { + throw new Error('处理失败'); + } +} +// 显示Toast +/* +@title 最多汉字数量7个 +@icon success loading none +*/ +export function Toast(title, icon = 'none', obj = {}, duration = 700) { + let toastData = { + title: title, + duration: duration, + // position: 'center', + mask: true, + icon: icon ? icon : 'none', + ...obj + }; + uni.showToast(toastData); +} +/* +显示loading提示框,需要手动隐藏 +*/ +export function Loading(title = '正在加载...', obj = {}) { + uni.showLoading({ + title: title, + mask: true, + ...obj + }); +} +// 隐藏loading +export function hideLoading() { + try { + uni.hideLoading(); + } catch (e) { + //TODO handle the exception + throw new Error('处理失败'); + } +} +// 模态框 +/* +确定取消按钮的文字颜色可修改 +obj 对象中传入 cancelColor : rgb 即可修改取消按钮颜色 +obj 对象中传入 confirmColor : rgb 即可修改确认按钮颜色 +*/ +export function Modal(title = '提示', content = '这是一个模态弹窗!', obj = { + showCancel: true, + cancelText: '取消', + confirmText: '确定' +}) { + // #ifdef APP-PLUS + obj.cancelText = '确定'; + obj.confirmText = '取消'; + // #endif + return new Promise((reslove, reject) => { + uni.showModal({ + title: title, + content: content, + ...obj, + success: (res) => { + if (res.confirm) { + reslove() + } + if (res.cancel) { + reject() + } + } + }); + }) +} +/* +显示操作菜单 +@itemList 操作菜单数组 +@itemColor 文字颜色 +*/ +export function ActionSheet(itemList, itemColor = "#000000") { + return new Promise((reslove, reject) => { + uni.showActionSheet({ + itemList: itemList, + itemColor: itemColor, + success: (res) => { + reslove(res.tapIndex); + }, + fail: function(res) { + reject(res.errMsg); + } + }); + }) +} +//将页面滚动到目标位置。 +export function ScrollTo(ScrollTop) { + uni.pageScrollTo({ + scrollTop: ScrollTop, + duration: 300 + }) +} + +// 获取用户信息 +export function GetUserInfo() { + return new Promise((reslove, reject) => { + uni.getUserInfo({ + success(res) { + console.log(res); + reslove(res); + }, + fail(rej) { + reject(rej); + } + }) + }) +} + +// 获取用户授权信息 +export function Authorize(scoped = 'scope.userInfo') { + return new Promise((reslove, reject) => { + uni.authorize({ + scope: scoped, + success(res) { + reslove(res); + }, + fail(rej) { + reject(rej); + } + }) + }) +} + +// 将对象转换成使用 & 连接的字符串 +export function convertObj(opt) { + let str = ''; + let arr = []; + Object.keys(opt).forEach(item => { + arr.push(`${item}=${opt[item]}`); + }) + str = arr.join('&'); + return str; +} +// 节流函数 +// 节流函数 +export function throttle(fn, delay) { + var lastArgs; + var timer; + var delay = delay || 200; + return function(...args) { + lastArgs = args; + if (!timer) { + timer = setTimeout(() => { + timer = null; + fn.apply(this, lastArgs); + }, delay); + } + } +} + +// 调起相机 +export function chooseImage(count) { + return new Promise((reslove, reject) => { + uni.chooseImage({ + count: count, //默认9 + sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 + sourceType: ['album', 'camera'], //从相册选择 + success: (res) => { + reslove(res); + // const tempFilePaths = res.tempFilePaths; + // let tempPathList = []; + // for (let i = 0; i < tempFilePaths.length; i++) { + // const path = tempFilePaths[i]; + // const src = await compressImageHandler(path) + // tempPathList.push(src); + // } + // reslove(tempPathList); + }, + fail: (rej) => { + reject(rej); + } + }); + }) +} + +// function compressImageHandler(src) { +// // console.log('platform===' + device.platform) +// const tempPath = compressImage(src, device.platform); +// // console.log('tempPath-----' + tempPath); +// return tempPath +// } +//序列化对象和数组 +export function serialize(data) { + if (data != null && data != '') { + try { + return JSON.parse(JSON.stringify(data)); + } catch (e) { + if (data instanceof Array) { + return []; + } + return {}; + } + } + return data; +} +Date.prototype.format = function(fmt) { + let o = { + 'M+': this.getMonth() + 1, //月份 + 'd+': this.getDate(), //日 + 'h+': this.getHours(), //小时 + 'm+': this.getMinutes(), //分 + 's+': this.getSeconds(), //秒 + 'q+': Math.floor((this.getMonth() + 3) / 3), //季度 + S: this.getMilliseconds() //毫秒 + }; + + if (/(y+)/.test(fmt)) { + fmt = fmt.replace(RegExp.$1, String(this.getFullYear()).substr(4 - RegExp.$1.length)); + } + for (let k in o) { + if (new RegExp('(' + k + ')').test(fmt)) { + fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(String(o[k]).length)); + } + } + return fmt; +}; + +//格式化日期 +export function formatDate(nS, format) { + //日期格式化 + if (!nS) { + return ''; + } + format = format || 'yyyy-MM-dd hh:mm:ss'; + return new Date(nS).format(format); +} + +// 图片转base64 +export function pathToBase64(path) { + return new Promise(function(resolve, reject) { + if (typeof window === 'object' && 'document' in window) { + if (typeof FileReader === 'function') { + var xhr = new XMLHttpRequest() + xhr.open('GET', path, true) + xhr.responseType = 'blob' + xhr.onload = function() { + if (this.status === 200) { + let fileReader = new FileReader() + fileReader.onload = function(e) { + resolve(e.target.result) + } + fileReader.onerror = reject + fileReader.readAsDataURL(this.response) + } + } + xhr.onerror = reject + xhr.send() + return + } + var canvas = document.createElement('canvas') + var c2x = canvas.getContext('2d') + var img = new Image + img.onload = function() { + canvas.width = img.width + canvas.height = img.height + c2x.drawImage(img, 0, 0) + resolve(canvas.toDataURL()) + canvas.height = canvas.width = 0 + } + img.onerror = reject + img.src = path + return + } + if (typeof plus === 'object') { + plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) { + entry.file(function(file) { + var fileReader = new plus.io.FileReader() + fileReader.onload = function(data) { + resolve(data.target.result) + } + fileReader.onerror = function(error) { + reject(error) + } + fileReader.readAsDataURL(file) + }, function(error) { + reject(error) + }) + }, function(error) { + reject(error) + }) + return + } + if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) { + wx.getFileSystemManager().readFile({ + filePath: path, + encoding: 'base64', + success: function(res) { + resolve('data:image/png;base64,' + res.data) + }, + fail: function(error) { + reject(error) + } + }) + return + } + reject(new Error('not support')) + }) +} + + + + +/* +@value 要拷贝的内容 +*/ +// export function copyText(value) { +// // 条件编译,以下代码仅在H5出现 +// //#ifdef H5 +// return new Promise((reslove, reject) => { +// uniCopy({ +// content: value, +// success: (res) => { +// reslove(res); +// }, +// error: (e) => { +// reject(res) +// } +// }) +// }) + +// //#endif + +// // 以下代码在除H5以外的平台出现 +// //#ifndef H5 + +// //#endif +// } + +// 获取本周的第一天 +export function showWeekFirstDay() { + var date = new Date(); + var weekday = date.getDay() || 7; //获取星期几,getDay()返回值是 0(周日) 到 6(周六) 之间的一个整数。0||7为7,即weekday的值为1-7 + date.setDate(date.getDate() - weekday + 1); //往前算(weekday-1)天,年份、月份会自动变化 + return formatDate(date, 'yyyy-MM-dd'); +} + + + +// 获取本月第一天 +export function showMonthFirstDay() { + var MonthFirstDay = new Date().setDate(1); + return formatDate(new Date(MonthFirstDay).getTime(), 'yyyy-MM-dd'); +} + +var now = new Date(); //当前日期 +// var nowDayOfWeek = now.getDay(); //今天本周的第几天 +// var nowDay = now.getDate(); //当前日 +var nowMonth = now.getMonth(); //当前月 +var nowYear = now.getYear(); //当前年 +nowYear += (nowYear < 2000) ? 1900 : 0; // +//获得本季度的开始月份 +function getQuarterStartMonth() { + var quarterStartMonth = 0; + if (nowMonth < 3) { + quarterStartMonth = 0; + } + if (2 < nowMonth && nowMonth < 6) { + quarterStartMonth = 3; + } + if (5 < nowMonth && nowMonth < 9) { + quarterStartMonth = 6; + } + if (nowMonth > 8) { + quarterStartMonth = 9; + } + return quarterStartMonth; +} + +//或的本季度的结束日期 +//获得本季度的开始日期 +export function getQuarterStartDate() { + var quarterStartDate = new Date(nowYear, getQuarterStartMonth(), 1); + return formatDate(quarterStartDate, 'yyyy-MM-dd'); +} +// 删除数组中重复数据 +export function unique(data) { + data = data || []; + var n = {}; //存放新的数据 + for (var i = 0; i < data.length; i++) { + var v = JSON.stringify(data[i]); + if (typeof(v) == "undefined") { + n[v] = 1; + } + } + data.length = 0; + for (var i in n) { + data[data.length] = i; + } + return data; +} diff --git a/pages/index/index.vue b/pages/index/index.vue new file mode 100644 index 0000000..bf4d273 --- /dev/null +++ b/pages/index/index.vue @@ -0,0 +1,241 @@ + + + + + \ No newline at end of file diff --git a/pages/index1/index.vue b/pages/index1/index.vue new file mode 100644 index 0000000..69e1ca6 --- /dev/null +++ b/pages/index1/index.vue @@ -0,0 +1,323 @@ + + + + + \ No newline at end of file diff --git a/pages/index1/ji.vue b/pages/index1/ji.vue new file mode 100644 index 0000000..e9dd482 --- /dev/null +++ b/pages/index1/ji.vue @@ -0,0 +1,310 @@ + + + + + \ No newline at end of file diff --git a/pages/index1/shucai.vue b/pages/index1/shucai.vue new file mode 100644 index 0000000..017803e --- /dev/null +++ b/pages/index1/shucai.vue @@ -0,0 +1,298 @@ + + + + + \ No newline at end of file diff --git a/pages/index1/xia.vue b/pages/index1/xia.vue new file mode 100644 index 0000000..38525a7 --- /dev/null +++ b/pages/index1/xia.vue @@ -0,0 +1,288 @@ + + + + + \ No newline at end of file diff --git a/pages/index2/index.vue b/pages/index2/index.vue new file mode 100644 index 0000000..94bd41e --- /dev/null +++ b/pages/index2/index.vue @@ -0,0 +1,373 @@ + + + + + \ No newline at end of file diff --git a/pages/index2/ji.vue b/pages/index2/ji.vue new file mode 100644 index 0000000..a4876e9 --- /dev/null +++ b/pages/index2/ji.vue @@ -0,0 +1,465 @@ + + + + + \ No newline at end of file diff --git a/pages/index2/shucai.vue b/pages/index2/shucai.vue new file mode 100644 index 0000000..26cc5e7 --- /dev/null +++ b/pages/index2/shucai.vue @@ -0,0 +1,373 @@ + + + + + \ No newline at end of file diff --git a/pages/index2/yx.vue b/pages/index2/yx.vue new file mode 100644 index 0000000..c2b6079 --- /dev/null +++ b/pages/index2/yx.vue @@ -0,0 +1,370 @@ + + + + + \ No newline at end of file diff --git a/pages/index3/index.vue b/pages/index3/index.vue new file mode 100644 index 0000000..f2f9169 --- /dev/null +++ b/pages/index3/index.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/pages/index3/ji.vue b/pages/index3/ji.vue new file mode 100644 index 0000000..6d7bb20 --- /dev/null +++ b/pages/index3/ji.vue @@ -0,0 +1,220 @@ + + + + + \ No newline at end of file diff --git a/pages/index3/shucai.vue b/pages/index3/shucai.vue new file mode 100644 index 0000000..38b21b6 --- /dev/null +++ b/pages/index3/shucai.vue @@ -0,0 +1,216 @@ + + + + + \ No newline at end of file diff --git a/pages/index3/xia.vue b/pages/index3/xia.vue new file mode 100644 index 0000000..93be774 --- /dev/null +++ b/pages/index3/xia.vue @@ -0,0 +1,211 @@ + + + + + \ No newline at end of file diff --git a/pages/test/index.vue b/pages/test/index.vue new file mode 100644 index 0000000..8d97fed --- /dev/null +++ b/pages/test/index.vue @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/static/img/ADL.png b/static/img/ADL.png new file mode 100644 index 0000000..1acfad2 Binary files /dev/null and b/static/img/ADL.png differ diff --git a/static/img/AHL.png b/static/img/AHL.png new file mode 100644 index 0000000..1acfad2 Binary files /dev/null and b/static/img/AHL.png differ diff --git a/static/img/AQHL.png b/static/img/AQHL.png new file mode 100644 index 0000000..237eac8 Binary files /dev/null and b/static/img/AQHL.png differ diff --git a/static/img/B.png b/static/img/B.png new file mode 100644 index 0000000..0157072 Binary files /dev/null and b/static/img/B.png differ diff --git a/static/img/CO2.png b/static/img/CO2.png new file mode 100644 index 0000000..95288fd Binary files /dev/null and b/static/img/CO2.png differ diff --git a/static/img/CTPH.png b/static/img/CTPH.png new file mode 100644 index 0000000..a1a430b Binary files /dev/null and b/static/img/CTPH.png differ diff --git a/static/img/CTWD.png b/static/img/CTWD.png new file mode 100644 index 0000000..2fa401a Binary files /dev/null and b/static/img/CTWD.png differ diff --git a/static/img/D.png b/static/img/D.png new file mode 100644 index 0000000..79ec043 Binary files /dev/null and b/static/img/D.png differ diff --git a/static/img/DK.png b/static/img/DK.png new file mode 100644 index 0000000..fbf27bd Binary files /dev/null and b/static/img/DK.png differ diff --git a/static/img/DZJC.png b/static/img/DZJC.png new file mode 100644 index 0000000..2cce418 Binary files /dev/null and b/static/img/DZJC.png differ diff --git a/static/img/EYHT.png b/static/img/EYHT.png new file mode 100644 index 0000000..95288fd Binary files /dev/null and b/static/img/EYHT.png differ diff --git a/static/img/F.png b/static/img/F.png new file mode 100644 index 0000000..32c660b Binary files /dev/null and b/static/img/F.png differ diff --git a/static/img/FH.png b/static/img/FH.png new file mode 100644 index 0000000..c7f2924 Binary files /dev/null and b/static/img/FH.png differ diff --git a/static/img/FS (1).png b/static/img/FS (1).png new file mode 100644 index 0000000..32c660b Binary files /dev/null and b/static/img/FS (1).png differ diff --git a/static/img/FS (2).png b/static/img/FS (2).png new file mode 100644 index 0000000..32c660b Binary files /dev/null and b/static/img/FS (2).png differ diff --git a/static/img/FS.png b/static/img/FS.png new file mode 100644 index 0000000..32c660b Binary files /dev/null and b/static/img/FS.png differ diff --git a/static/img/FX (1).png b/static/img/FX (1).png new file mode 100644 index 0000000..0157072 Binary files /dev/null and b/static/img/FX (1).png differ diff --git a/static/img/FX.png b/static/img/FX.png new file mode 100644 index 0000000..0157072 Binary files /dev/null and b/static/img/FX.png differ diff --git a/static/img/G (1).png b/static/img/G (1).png new file mode 100644 index 0000000..ca78891 Binary files /dev/null and b/static/img/G (1).png differ diff --git a/static/img/G.png b/static/img/G.png new file mode 100644 index 0000000..614ed18 Binary files /dev/null and b/static/img/G.png differ diff --git a/static/img/GG.png b/static/img/GG.png new file mode 100644 index 0000000..56720a1 Binary files /dev/null and b/static/img/GG.png differ diff --git a/static/img/GJ.jpg b/static/img/GJ.jpg new file mode 100644 index 0000000..de13077 Binary files /dev/null and b/static/img/GJ.jpg differ diff --git a/static/img/GJBG.jpg b/static/img/GJBG.jpg new file mode 100644 index 0000000..888b967 Binary files /dev/null and b/static/img/GJBG.jpg differ diff --git a/static/img/GZ (1).png b/static/img/GZ (1).png new file mode 100644 index 0000000..614ed18 Binary files /dev/null and b/static/img/GZ (1).png differ diff --git a/static/img/GZ (2).png b/static/img/GZ (2).png new file mode 100644 index 0000000..614ed18 Binary files /dev/null and b/static/img/GZ (2).png differ diff --git a/static/img/GZ.png b/static/img/GZ.png new file mode 100644 index 0000000..614ed18 Binary files /dev/null and b/static/img/GZ.png differ diff --git a/static/img/JC.jpg b/static/img/JC.jpg new file mode 100644 index 0000000..a47406f Binary files /dev/null and b/static/img/JC.jpg differ diff --git a/static/img/JCBJ.jpg b/static/img/JCBJ.jpg new file mode 100644 index 0000000..22fd8b3 Binary files /dev/null and b/static/img/JCBJ.jpg differ diff --git a/static/img/JI.png b/static/img/JI.png new file mode 100644 index 0000000..a9b01ff Binary files /dev/null and b/static/img/JI.png differ diff --git a/static/img/JWHL.png b/static/img/JWHL.png new file mode 100644 index 0000000..421d005 Binary files /dev/null and b/static/img/JWHL.png differ diff --git a/static/img/JYL.png b/static/img/JYL.png new file mode 100644 index 0000000..416da6c Binary files /dev/null and b/static/img/JYL.png differ diff --git a/static/img/KQSD.png b/static/img/KQSD.png new file mode 100644 index 0000000..816c819 Binary files /dev/null and b/static/img/KQSD.png differ diff --git a/static/img/KQZL.png b/static/img/KQZL.png new file mode 100644 index 0000000..773b8c0 Binary files /dev/null and b/static/img/KQZL.png differ diff --git a/static/img/KQZLZS.png b/static/img/KQZLZS.png new file mode 100644 index 0000000..773b8c0 Binary files /dev/null and b/static/img/KQZLZS.png differ diff --git a/static/img/QTTC.png b/static/img/QTTC.png new file mode 100644 index 0000000..0d296a6 Binary files /dev/null and b/static/img/QTTC.png differ diff --git a/static/img/QXJC.png b/static/img/QXJC.png new file mode 100644 index 0000000..111f818 Binary files /dev/null and b/static/img/QXJC.png differ diff --git a/static/img/RYL.png b/static/img/RYL.png new file mode 100644 index 0000000..237eac8 Binary files /dev/null and b/static/img/RYL.png differ diff --git a/static/img/RYY.png b/static/img/RYY.png new file mode 100644 index 0000000..bc14953 Binary files /dev/null and b/static/img/RYY.png differ diff --git a/static/img/SC.jpg b/static/img/SC.jpg new file mode 100644 index 0000000..4624157 Binary files /dev/null and b/static/img/SC.jpg differ diff --git a/static/img/SCBJ.jpg b/static/img/SCBJ.jpg new file mode 100644 index 0000000..0f93930 Binary files /dev/null and b/static/img/SCBJ.jpg differ diff --git a/static/img/SG.png b/static/img/SG.png new file mode 100644 index 0000000..ca78891 Binary files /dev/null and b/static/img/SG.png differ diff --git a/static/img/SHUCAI.png b/static/img/SHUCAI.png new file mode 100644 index 0000000..6972519 Binary files /dev/null and b/static/img/SHUCAI.png differ diff --git a/static/img/SJ (1).png b/static/img/SJ (1).png new file mode 100644 index 0000000..88607ef Binary files /dev/null and b/static/img/SJ (1).png differ diff --git a/static/img/SLWD.png b/static/img/SLWD.png new file mode 100644 index 0000000..ba681bd Binary files /dev/null and b/static/img/SLWD.png differ diff --git a/static/img/SZJC.png b/static/img/SZJC.png new file mode 100644 index 0000000..e7d4ed6 Binary files /dev/null and b/static/img/SZJC.png differ diff --git a/static/img/TDSD.png b/static/img/TDSD.png new file mode 100644 index 0000000..816c819 Binary files /dev/null and b/static/img/TDSD.png differ diff --git a/static/img/TDWD.png b/static/img/TDWD.png new file mode 100644 index 0000000..ba681bd Binary files /dev/null and b/static/img/TDWD.png differ diff --git a/static/img/TRSD.png b/static/img/TRSD.png new file mode 100644 index 0000000..816c819 Binary files /dev/null and b/static/img/TRSD.png differ diff --git a/static/img/TRWD.png b/static/img/TRWD.png new file mode 100644 index 0000000..ba681bd Binary files /dev/null and b/static/img/TRWD.png differ diff --git a/static/img/WD.png b/static/img/WD.png new file mode 100644 index 0000000..ad7c2e9 Binary files /dev/null and b/static/img/WD.png differ diff --git a/static/img/WDGG.png b/static/img/WDGG.png new file mode 100644 index 0000000..56720a1 Binary files /dev/null and b/static/img/WDGG.png differ diff --git a/static/img/XIA.png b/static/img/XIA.png new file mode 100644 index 0000000..bf4ede8 Binary files /dev/null and b/static/img/XIA.png differ diff --git a/static/img/YX.jpg b/static/img/YX.jpg new file mode 100644 index 0000000..9fbdcfe Binary files /dev/null and b/static/img/YX.jpg differ diff --git a/static/img/YXBJ.jpg b/static/img/YXBJ.jpg new file mode 100644 index 0000000..80ec3f1 Binary files /dev/null and b/static/img/YXBJ.jpg differ diff --git a/static/img/YXSY.png b/static/img/YXSY.png new file mode 100644 index 0000000..2839e35 Binary files /dev/null and b/static/img/YXSY.png differ diff --git a/static/img/ZWXBSQ.png b/static/img/ZWXBSQ.png new file mode 100644 index 0000000..fe10a6d Binary files /dev/null and b/static/img/ZWXBSQ.png differ diff --git a/static/img/badinfo.png b/static/img/badinfo.png new file mode 100644 index 0000000..4710748 Binary files /dev/null and b/static/img/badinfo.png differ diff --git a/static/img/bg1.png b/static/img/bg1.png new file mode 100644 index 0000000..123a3f7 Binary files /dev/null and b/static/img/bg1.png differ diff --git a/static/img/bgc.png b/static/img/bgc.png new file mode 100644 index 0000000..593c376 Binary files /dev/null and b/static/img/bgc.png differ diff --git a/static/img/dw.png b/static/img/dw.png new file mode 100644 index 0000000..eee1d5f Binary files /dev/null and b/static/img/dw.png differ diff --git a/static/img/sj.png b/static/img/sj.png new file mode 100644 index 0000000..59a0baf Binary files /dev/null and b/static/img/sj.png differ diff --git a/static/img/sjfx.png b/static/img/sjfx.png new file mode 100644 index 0000000..a143026 Binary files /dev/null and b/static/img/sjfx.png differ diff --git a/static/logo.png b/static/logo.png new file mode 100644 index 0000000..b5771e2 Binary files /dev/null and b/static/logo.png differ diff --git a/utils/oahttp.js b/utils/oahttp.js new file mode 100644 index 0000000..2be1078 --- /dev/null +++ b/utils/oahttp.js @@ -0,0 +1,106 @@ +import { + HTTP_REQUEST_URL_THREE, + HEADER, + TOKENNAME, +} from '@/config/app'; +import { + Toast +} from '../libs/uniApi'; +// import { checkLogin } from '../libs/login'; +// import store from '../store'; + + + +function baseRequestTwo(url, method, data, { + noAuth = false, + noVerify = false, + onReLogin = false +}) { + let Url = 'http://ceshi-suyuan.lihaink.cn/', + header = HEADER; + // if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token; + // if (store.state.app.token) header[TOKENNAME] = store.state.app.token; + + // header[TOKENNAME] = 'Bearer sdjflidshjgfkbdasgjmasbgvhauuiavhkesvndkaesbvkjsdbv'; + return new Promise((reslove, reject) => { + // uni.showLoading({ + // title: '加载中' + // }) + uni.request({ + // url: Url + '/api/v1' + url, + url: Url + 'adminapi' + url, + method: method || 'GET', + header: { + ...header + }, + data: method != 'GET' ? data || {} : {}, + params: method == 'GET' ? data : {}, + success: (res) => { + if (noVerify) + reslove(res.data); + else if (res.data.code == -1) { + if (onReLogin) { + // store.commit('LOGOUT'); + return reject(); + } + // 如果登录超时,自动重新登录并且继续发送请求 + // store.dispatch("RE_LOGIN", { + // url: url, + // method: method, + // data: data, + // opt: { + // noAuth, + // noVerify + // } + // }).then((e) => { + // reslove(e); + // }).catch((err) => { + // reject(res.data); + // }) + // store.commit("SET_REQUEST", false); + } else if (res.data.code == 0) { + if (res.data.msg != '无登录信息') { + uni.showToast({ + title: res.data.msg || '请检查网络', + icon: 'none', + }) + } + reject(res.data); + } else if (res.data.code == 1) { + // store.commit("SET_REQUEST"); + reslove(res.data); + } else if (res.data.code == 200) { + // store.commit("SET_REQUEST"); + reslove(res.data.data); + } else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) { + toLogin(); + reject(res.data); + } else if (res.data.code == 501) { + reject(res.data); + } else { + uni.showToast({ + title: res.data.msg || '请检查网络', + icon: 'none' + }) + reject(res.data.msg || '请检查网络'); + } + }, + fail: (message) => { + // uni.hideLoading() + uni.showToast({ + title: '网络错误', + icon: 'none' + }) + reject('请求失败'); + } + }) + }); +} + +const oahttp = {}; + +['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => { + oahttp[method] = (api, data, opt) => baseRequestTwo(api, method, data, opt || {}) +}); + +export default oahttp; \ No newline at end of file