Commit b34fc07b by hank

temp 修改

parent f2eec6e6
......@@ -10,7 +10,7 @@
"unit": "jest --config test/unit/jest.conf.js --coverage",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
"lint": "eslint --fix --ext .js,.vue src test/unit test/e2e/specs",
"build": "node build/build.js"
},
"dependencies": {
......
......@@ -5,35 +5,35 @@
</template>
<script>
import page from "./components/page/index.vue";
var self = null;
window.getQuery = function(key) {
var url = location.search; //获取url中"?"符后的字串
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
var strs = str.split("&");
import page from './components/page/index.vue'
var self = null
window.getQuery = function (key) {
var url = location.search // 获取url中"?"符后的字串
var theRequest = new Object()
if (url.indexOf('?') != -1) {
var str = url.substr(1)
var strs = str.split('&')
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
theRequest[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
}
}
if (key) {
return theRequest[key] === "undefined" || theRequest[key] == "0"
? ""
: theRequest[key];
return theRequest[key] === 'undefined' || theRequest[key] == '0'
? ''
: theRequest[key]
} else {
return theRequest;
return theRequest
}
};
}
export default {
name: "App",
data() {
return {};
name: 'App',
data () {
return {}
},
components: {
page: page
}
};
}
</script>
<style>
......
import request from 'src/config/request'
import { CLIENT_CHOOSE_IMAGE } from 'src/config/jsBridge'
import { upLoad } from 'src/api/files'
export function getAllCity() { // 获取所有城市
export function getAllCity () { // 获取所有城市
return request({
url: '/city/all',
method: 'get',
......@@ -9,8 +9,8 @@ export function getAllCity() { // 获取所有城市
})
}
export function avatarUpload(token) {
return new Promise(function(resolve, reject) {
export function avatarUpload (token) {
return new Promise(function (resolve, reject) {
CLIENT_CHOOSE_IMAGE().then((res) => {
var src = JSON.parse(res)[0].data
upLoad(src, 3).then(res => {
......@@ -31,9 +31,8 @@ export function avatarUpload(token) {
})
})
})
}
export function getcityList(parentcode) {
export function getcityList (parentcode) {
return request({
url: '/area/parentcode/' + parentcode,
method: 'get',
......@@ -41,7 +40,7 @@ export function getcityList(parentcode) {
})
}
export function updateInfo(name, gendar, age, education, experience, ticket, introduce, identityNo, portrait) {
export function updateInfo (name, gendar, age, education, experience, ticket, introduce, identityNo, portrait) {
return request({
url: '/user/updateBasicInfo',
method: 'post',
......@@ -59,7 +58,7 @@ export function updateInfo(name, gendar, age, education, experience, ticket, int
})
}
export function getDict() { // 获取字典
export function getDict () { // 获取字典
return request({
url: '/dict/all',
method: 'get',
......@@ -67,7 +66,7 @@ export function getDict() { // 获取字典
})
}
export function addUserHope(jobType, dictCityId, salary, ticket, minSalary, maxSalary) {
export function addUserHope (jobType, dictCityId, salary, ticket, minSalary, maxSalary) {
return request({
url: '/userexpect/add',
method: 'post',
......@@ -79,12 +78,12 @@ export function addUserHope(jobType, dictCityId, salary, ticket, minSalary, maxS
minSalary,
maxSalary
// data: {
// }
}
})
}
export function updateUserHope(jobType, dictCityId, salary, ticket, id, minSalary, maxSalary) {
export function updateUserHope (jobType, dictCityId, salary, ticket, id, minSalary, maxSalary) {
return request({
url: '/userexpect/update',
method: 'post',
......@@ -97,12 +96,12 @@ export function updateUserHope(jobType, dictCityId, salary, ticket, id, minSalar
minSalary,
maxSalary
// data: {
// }
}
})
}
export function getUserInfo(userId, ticket) {
export function getUserInfo (userId, ticket) {
return request({
url: '/user/getBasicInfo',
method: 'get',
......@@ -112,21 +111,21 @@ export function getUserInfo(userId, ticket) {
}
})
}
export function addWork(companyName, position, startTime, endTime, content, ticket) {
export function addWork (companyName, position, startTime, endTime, content, ticket) {
return request({
url: '/workexperience/add',
method: 'post',
params: {
companyName,
position,
startTime,
endTime,
content,
companyName,
position,
startTime,
endTime,
content,
ticket
}
})
}
export function editWork(data) {
export function editWork (data) {
return request({
url: '/workexperience/modify',
method: 'post',
......@@ -136,8 +135,7 @@ export function editWork(data) {
})
}
export function getWork(userId, ticket) {
export function getWork (userId, ticket) {
return request({
url: '/workexperience/find',
method: 'get',
......@@ -147,7 +145,7 @@ export function getWork(userId, ticket) {
}
})
}
export function getUserExpect(userId, ticket) {
export function getUserExpect (userId, ticket) {
return request({
url: '/userexpect/find',
method: 'get',
......@@ -157,7 +155,7 @@ export function getUserExpect(userId, ticket) {
}
})
}
export function selectType(type, ticket) {
export function selectType (type, ticket) {
return request({
url: '/user/selectType',
method: 'post',
......@@ -167,4 +165,3 @@ export function selectType(type, ticket) {
}
})
}
......@@ -241,10 +241,10 @@ export function addContract (data) {
export function getContract (id, isview = true) {
// 获取录用协议
return request({
url: '/contract/' + id ,
url: '/contract/' + id,
method: 'get',
params: {
view : isview
view: isview
},
data: {}
})
......@@ -404,9 +404,9 @@ export function getCompanyComment (companyId, pageNo, pageSize) {
})
}
export function getComment(contractId) {
export function getComment (contractId) {
return request({
url: `/comment/${contractId}`,
method: 'get'
})
}
\ No newline at end of file
}
import request from 'src/config/request'
export function addFeedback(term_id, categories, type, title, content, contact, images, client) { // 添加反馈
export function addFeedback (term_id, categories, type, title, content, contact, images, client) { // 添加反馈
return request({
url: '/api/feedback',
method: 'post',
......@@ -16,7 +16,7 @@ export function addFeedback(term_id, categories, type, title, content, contact,
})
}
export function getClassInfo(class_id, term_id) {
export function getClassInfo (class_id, term_id) {
return request({
url: 'api/front/classes/class_appoint',
method: 'get',
......@@ -26,7 +26,7 @@ export function getClassInfo(class_id, term_id) {
}
})
}
export function getClassStudent(class_id, term_id, limit, page) {
export function getClassStudent (class_id, term_id, limit, page) {
return request({
url: '/api/front/classes/class_students',
method: 'get',
......@@ -38,7 +38,7 @@ export function getClassStudent(class_id, term_id, limit, page) {
}
})
}
export function getClassAtt(class_id, term_id, limit, page) {
export function getClassAtt (class_id, term_id, limit, page) {
return request({
url: 'api/front/class/attendance?search=class_id:' + class_id,
method: 'get',
......@@ -50,7 +50,7 @@ export function getClassAtt(class_id, term_id, limit, page) {
}
})
}
export function appExpulsion(term_id, student_ids, apply_description, expulsion_cate) { // 申请除名
export function appExpulsion (term_id, student_ids, apply_description, expulsion_cate) { // 申请除名
return request({
url: '/api/front/expulsion',
method: 'post',
......@@ -62,13 +62,13 @@ export function appExpulsion(term_id, student_ids, apply_description, expulsion_
}
})
}
export function getSudentDetail() {
export function getSudentDetail () {
return request({
url: '/api/front/student/me',
method: 'get'
})
}
export function getStransfer(term_id, student_ids, target_class_id, apply_description, apply_status_name) { // 转班
export function getStransfer (term_id, student_ids, target_class_id, apply_description, apply_status_name) { // 转班
return request({
url: '/api/front/transfer',
method: 'post',
......@@ -80,40 +80,40 @@ export function getStransfer(term_id, student_ids, target_class_id, apply_descri
}
})
}
export function getLeaves() { // 请假列表
export function getLeaves () { // 请假列表
return request({
url: 'api/front/leaves',
method: 'get'
})
}
export function getLeaveinfo(id) { // 请假详情
export function getLeaveinfo (id) { // 请假详情
return request({
url: 'api/approve/' + id,
method: 'get'
})
}
export function getMeettingLeave(data) { // 班会请假
export function getMeettingLeave (data) { // 班会请假
return request({
url: 'api/front/meetingleave',
method: 'post',
data
})
}
export function getAssignmentleave(data) { // 作业请假
export function getAssignmentleave (data) { // 作业请假
return request({
url: '/api/front/assignmentleave',
method: 'post',
data: data
})
}
export function getClassmeeting() { // 班级班会
export function getClassmeeting () { // 班级班会
return request({
url: 'api/front/classmeeting',
method: 'get'
})
}
export function getNotes(term_id, course_id, note_type, limit, page) { // 笔记列表
export function getNotes (term_id, course_id, note_type, limit, page) { // 笔记列表
return request({
url: 'api/front/notes',
method: 'get',
......@@ -126,7 +126,7 @@ export function getNotes(term_id, course_id, note_type, limit, page) { // 笔记
}
})
}
export function getMyNote(term_id) {
export function getMyNote (term_id) {
return request({
url: 'api/front/mynotes',
method: 'get',
......@@ -135,7 +135,7 @@ export function getMyNote(term_id) {
}
})
}
export function addNotes(term_id, course_id, note_type, limit, page) { // 笔记添加
export function addNotes (term_id, course_id, note_type, limit, page) { // 笔记添加
return request({
url: '/api/front/notes',
method: 'post',
......@@ -148,7 +148,7 @@ export function addNotes(term_id, course_id, note_type, limit, page) { // 笔记
}
})
}
export function editNotes(id, content, is_public) { // 笔记编辑
export function editNotes (id, content, is_public) { // 笔记编辑
return request({
url: '/api/front/notes/' + id,
method: 'put',
......@@ -158,13 +158,13 @@ export function editNotes(id, content, is_public) { // 笔记编辑
}
})
}
export function deleteNotes(id) { // 笔记删除
export function deleteNotes (id) { // 笔记删除
return request({
url: '/api/front/notes/' + id,
method: 'delete'
})
}
export function getChildren(data) {
export function getChildren (data) {
return request({
url: '/api/comment/childcomment',
method: 'get',
......@@ -173,7 +173,7 @@ export function getChildren(data) {
}
})
}
export function editUser(id, icon) {
export function editUser (id, icon) {
return request({
url: '/api/user/' + id,
method: 'put',
......
import request from 'src/config/request'
export function upLoad(file, type) {
export function upLoad (file, type) {
// let formData = new FormData()
// formData.append('uploadType', type)
// formData.append('file', [convertBase64UrlToBlob(file)])
......@@ -16,22 +15,22 @@ export function upLoad(file, type) {
// }
})
}
export function convertBase64UrlToBlob(urlData) {
var bytes = window.atob(urlData.split(',')[1]); // 去掉url的头,并转换为byte
export function convertBase64UrlToBlob (urlData) {
var bytes = window.atob(urlData.split(',')[1]) // 去掉url的头,并转换为byte
// 处理异常,将ascii码小于0的转换为大于0
var ab = new ArrayBuffer(bytes.length);
var ia = new Uint8Array(ab);
var ab = new ArrayBuffer(bytes.length)
var ia = new Uint8Array(ab)
for (var i = 0; i < bytes.length; i++) {
ia[i] = bytes.charCodeAt(i);
ia[i] = bytes.charCodeAt(i)
}
console.log(new Blob([ab], {
type: 'image/png'
}))
return new Blob([ab], {
type: 'image/png'
});
})
}
export function downLoad(token, url) {
export function downLoad (token, url) {
var iframe = document.createElement('iframe')
iframe.style.display = 'none'
console.log(process.env.BASE_API)
......@@ -39,15 +38,15 @@ export function downLoad(token, url) {
document.body.appendChild(iframe)
}
export function baseUrl() {
export function baseUrl () {
return process.env.BASE_API
}
export function getawayUrl() {
export function getawayUrl () {
return process.env.GETAWAY
}
export function resetUrl() {
export function resetUrl () {
console.log(process.env, '?callback=' + process.env.CALLBACKURL)
return process.env.RESET_URL + '?callback=' + process.env.CALLBACKURL
}
......@@ -15,4 +15,3 @@ export default {
<style>
</style>
......@@ -19,15 +19,15 @@
</template>
<script>
import mixin from "./mixin";
import "swiper/dist/css/swiper.css";
import page1 from "./page1";
import { swiper, swiperSlide } from "vue-awesome-swiper";
import { parse } from "path";
import { setTimeout } from "timers";
import mixin from './mixin'
import 'swiper/dist/css/swiper.css'
import page1 from './page1'
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import { parse } from 'path'
import { setTimeout } from 'timers'
export default {
name: "page",
name: 'page',
mixins: [mixin],
components: {
swiper,
......@@ -35,137 +35,137 @@ export default {
page1
},
computed: {
swiper() {
return this.$refs.mySwiper.swiper;
swiper () {
return this.$refs.mySwiper.swiper
}
},
data() {
data () {
return {
swiperOption: {
// some swiper options/callbacks
// 所有的参数同 swiper 官方 api 参数
// ...
}
};
}
},
methods: {
callback() {
console.log("callback");
callback () {
console.log('callback')
},
getDefaulted() {
this.pages = this.pages.map(function(item) {
getDefaulted () {
this.pages = this.pages.map(function (item) {
item.list.map(ele => {
return (ele = Object.assign(ele, ele.default));
});
return item;
return (ele = Object.assign(ele, ele.default))
})
return item
// (item = Object.assign(item, item.default));
});
})
},
message(data) {
window.parent.postMessage(data, "*");
message (data) {
window.parent.postMessage(data, '*')
},
edit(index) {
if (getQuery("isEdit")) {
this.currentIndex = index;
var item = this.list[index];
console.log(this.currentIndex);
edit (index) {
if (getQuery('isEdit')) {
this.currentIndex = index
var item = this.list[index]
console.log(this.currentIndex)
this.message(
{
type: "edit",
type: 'edit',
item,
index
},
"*"
);
'*'
)
}
},
getList() {
getList () {
this.message(
{
type: "getList",
type: 'getList',
pages: this.pages
},
"*"
);
'*'
)
},
timeFormate(timeStamp) {
let dateString = "";
let year = new Date(timeStamp).getFullYear();
timeFormate (timeStamp) {
let dateString = ''
let year = new Date(timeStamp).getFullYear()
let month =
new Date(timeStamp).getMonth() + 1 < 10
? "0" + (new Date(timeStamp).getMonth() + 1)
: new Date(timeStamp).getMonth() + 1;
? '0' + (new Date(timeStamp).getMonth() + 1)
: new Date(timeStamp).getMonth() + 1
let date =
new Date(timeStamp).getDate() < 10
? "0" + new Date(timeStamp).getDate()
: new Date(timeStamp).getDate();
? '0' + new Date(timeStamp).getDate()
: new Date(timeStamp).getDate()
let hh =
new Date(timeStamp).getHours() < 10
? "0" + new Date(timeStamp).getHours()
: new Date(timeStamp).getHours();
? '0' + new Date(timeStamp).getHours()
: new Date(timeStamp).getHours()
let mm =
new Date(timeStamp).getMinutes() < 10
? "0" + new Date(timeStamp).getMinutes()
: new Date(timeStamp).getMinutes();
? '0' + new Date(timeStamp).getMinutes()
: new Date(timeStamp).getMinutes()
// let ss =new Date(timeStamp).getSeconds() < 10? "0" + new Date(timeStamp).getSeconds(): new Date(timeStamp).getSeconds();
// return year + "年" + month + "月" + date +"日"+" "+hh+":"+mm + "" + " " + hh + ":" + mm; ;
dateString = year + "." + month + "." + date;
return dateString;
dateString = year + '.' + month + '.' + date
return dateString
// console.log(this.nowTime);
}
},
beforeDestroy() {
beforeDestroy () {
if (this.timer) {
clearInterval(this.timer); // 在Vue实例销毁前,清除我们的定时器
clearInterval(this.timer) // 在Vue实例销毁前,清除我们的定时器
}
if (this.timer2) {
clearInterval(this.timer2); // 在Vue实例销毁前,清除我们的定时器
clearInterval(this.timer2) // 在Vue实例销毁前,清除我们的定时器
}
},
mounted() {
function setZoom() {
var unit = 800;
var unit2 = 450;
var width = window.innerWidth;
var height = window.innerHeight;
console.log(width, height);
var zoom = height / 450;
mounted () {
function setZoom () {
var unit = 800
var unit2 = 450
var width = window.innerWidth
var height = window.innerHeight
console.log(width, height)
var zoom = height / 450
if (width / height <= 16 / 9) {
zoom = width / 800;
console.log("width");
zoom = width / 800
console.log('width')
}
if (width / height >= 16 / 9) {
zoom = height / 450;
console.log("height");
zoom = height / 450
console.log('height')
}
var container = document.querySelectorAll(".container");
var container = document.querySelectorAll('.container')
for (let index = 0; index < container.length; index++) {
container[index].style.zoom = zoom;
// container[index].style.transform = `scale(${zoom})`;
}
// console.log(zoom);
// document.querySelector(".swiper-slide").style.zoom = zoom
document.querySelector('.swiper-container').style.transform = `scale(${zoom})`
}
setZoom();
window.addEventListener("resize", setZoom, false);
let _this = this;
setZoom()
window.addEventListener('resize', setZoom, false)
let _this = this
if (!this.isEditMode) {
this.timer2 = setInterval(() => {
if (getQuery("filmId")) {
if (getQuery('filmId')) {
$.get(
"http://39.105.231.218:8090/myequipment/get/film/info/" +
getQuery("filmId"),
function(result) {
console.log(result);
_this.list = JSON.parse(result.filmData);
_this.filmId = result.filmId;
'http://39.105.231.218:8090/myequipment/get/film/info/' +
getQuery('filmId'),
function (result) {
console.log(result)
_this.list = JSON.parse(result.filmData)
_this.filmId = result.filmId
}
);
)
}
$(".bottom-right-item").hide();
$('.bottom-right-item').hide()
setTimeout(() => {
$(".bottom-right-item").show();
}, 500);
}, 10000);
$('.bottom-right-item').show()
}, 500)
}, 10000)
// var DOM = document.querySelector(".title");
// var H2 = document.querySelector(".h2");
// var t = 0,//开始时间
......@@ -193,124 +193,124 @@ export default {
// requestAnimationFrame(step);
}
},
created() {
var vm = this;
window.myApp = this;
created () {
var vm = this
window.myApp = this
window.addEventListener(
"message",
function(e) {
if (e.source != window.parent) return;
console.log(e.data, "客户端发来的消息");
console.log(typeof e.data === "object" && e.data["type"] == "setData");
if (typeof e.data === "object" && e.data["type"] == "setData") {
console.log(myApp.pages[e.data["page"]]);
myApp.pages[e.data["page"]]["list"][e.data.index].value =
e.data["value"];
if (e.data["editObj"]) {
myApp.list[e.data.index] = e.data["editObj"];
myApp.pages[e.data["page"]]["list"][e.data.index] =
e.data["editObj"];
'message',
function (e) {
if (e.source != window.parent) return
console.log(e.data, '客户端发来的消息')
console.log(typeof e.data === 'object' && e.data['type'] == 'setData')
if (typeof e.data === 'object' && e.data['type'] == 'setData') {
console.log(myApp.pages[e.data['page']])
myApp.pages[e.data['page']]['list'][e.data.index].value =
e.data['value']
if (e.data['editObj']) {
myApp.list[e.data.index] = e.data['editObj']
myApp.pages[e.data['page']]['list'][e.data.index] =
e.data['editObj']
}
}
if (typeof e.data === "object" && e.data["type"] == "cancelEdit") {
myApp.currentIndex = "";
myApp.cancelEdit = true;
if (typeof e.data === 'object' && e.data['type'] == 'cancelEdit') {
myApp.currentIndex = ''
myApp.cancelEdit = true
}
if (typeof e.data === "object" && e.data["type"] == "edit") {
myApp.currentIndex = e.data.index;
if (typeof e.data === 'object' && e.data['type'] == 'edit') {
myApp.currentIndex = e.data.index
}
if (typeof e.data === "object" && e.data["type"] == "setList") {
if (typeof e.data === 'object' && e.data['type'] == 'setList') {
// myApp.list = JSON.parse(JSON.stringify(e.data.list))
myApp.pages = e.data.pages;
myApp.pages = e.data.pages
}
if (typeof e.data === "object" && e.data["type"] == "getList") {
myApp.getList();
if (typeof e.data === 'object' && e.data['type'] == 'getList') {
myApp.getList()
}
if (typeof e.data === "object" && e.data["type"] == "goPage") {
myApp.swiper.slideTo(parseInt(e.data.index), 1000, false);
if (typeof e.data === 'object' && e.data['type'] == 'goPage') {
myApp.swiper.slideTo(parseInt(e.data.index), 1000, false)
}
// window.parent.postMessage(color, '*');
},
false
);
console.log("page created");
)
console.log('page created')
this.swiperOption = {
observer: true,
/* 将observe应用于Swiper的父元素。
当Swiper的父元素变化时,例如window.resize,Swiper更新。 */
observerParents: true,
slidesPerView: 1,
autoplay: !getQuery("isEdit")
autoplay: !getQuery('isEdit')
? {
delay: 10000
}
delay: 10000
}
: false,
loop: false,
on: {
init() {
swiperAnimateCache(this); //隐藏动画元素
swiperAnimate(this); //初始化完成开始动画
init () {
swiperAnimateCache(this) // 隐藏动画元素
swiperAnimate(this) // 初始化完成开始动画
},
slideChange() {
slideChange () {
if (vm.isEditMode) {
$(".ani").css("visibility", "");
$('.ani').css('visibility', '')
}
},
slideChangeTransitionEnd() {
slideChangeTransitionEnd () {
if (!vm.isEditMode) {
swiperAnimate(this);
swiperAnimate(this)
}
}
}
};
}
// console.log(JSON.stringify(this.list))
vm.date = this.timeFormate(new Date());
vm.date = this.timeFormate(new Date())
this.timer = setInterval(() => {
vm.date = this.timeFormate(new Date());
}, 1000 * 60);
if (getQuery("isEdit")) {
this.isEditMode = true;
vm.date = this.timeFormate(new Date())
}, 1000 * 60)
if (getQuery('isEdit')) {
this.isEditMode = true
} else {
this.isEditMode = false;
this.isEditMode = false
}
if (getQuery("filmId")) {
if (getQuery('filmId')) {
$.get(
"http://39.105.231.218:8090/myequipment/get/film/info/" +
getQuery("filmId"),
function(result) {
console.log(result);
vm.pages = JSON.parse(result.filmData);
vm.filmId = result.filmId;
'http://39.105.231.218:8090/template/get/film/info/' +
getQuery('filmId'),
function (result) {
console.log(result)
vm.pages = JSON.parse(result.filmData)
vm.filmId = result.filmId
}
);
)
} else {
if (getQuery("isPreview")) {
if (getQuery('isPreview')) {
} else {
vm.getDefaulted();
vm.getDefaulted()
$.get(
"http://visual-clouds.bdideal.com/html/1562308684495b5b8f5a24a994afd8f799c33ff40e212.txt",
function(result) {
'http://visual-clouds.bdideal.com/html/1562308684495b5b8f5a24a994afd8f799c33ff40e212.txt',
function (result) {
// console.log(result)
console.log("模板数据加载成功");
vm.pages = JSON.parse(result);
vm.getDefaulted();
console.log('模板数据加载成功')
vm.pages = JSON.parse(result)
vm.getDefaulted()
}
);
)
}
}
},
data() {
data () {
return {
date: "",
date: '',
img:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABVCAYAAAA49ahaAAAJSUlEQVR4nOWda4xV1RXHf3MdBIGBAR1AbBWtCKalBSXBZwoTS6mxVi2ofZimtAyCFGJo07QfmvRLXwmmhTRpNf3WJj4QI7Zgbaw0Wo1KCcrDDkhAio3yGphpkdfw74d1T+8++55779y55zXDP1mZ2ffsc/Y6/7POPvusvfY6TZLIAUYC1wHTgKnAJODjwMVACzDaqdsN9ABHgL1AJ7AL+CfwdnFbpmjKiNShwM1AOzAbmAU0x3D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K1bqK89ia1Hd1Jh3AEtiUnCgoYMwoQIWEUGoba1u8qs8cz8l6YYc3IppyvWy9FAuVlfbp1ZmiqFYqo/POL+dT5kpPga8VvwbYCcwExspRaLWUOkUNmHW7TW0gXBOlcGINuB5woT2YNMzFQmFvo0/O4EHCIcLTsPSEQ/W4IvhwHOEp0p6gW9SHjldjjr6lhUqxxuyfHlZ93txymhZvi0fS/p6jHob/EVEY52SJuWAjDhkgizdp4+f1HOc/jT8y4hG/y3L8ps1KY3ITEn7I85tTb3H6q8CP4po/KSkh5S+DzYOWazyYZMkPdKf82lEkQ5F5099TnYbZU1UX2S8pGcizuGcpO/197iNKvVFlb8PS5aZfJHym+m3IOnbKnccSZa5+J5Gjh+HgpNVPrUQYIuc5AI5kbmKfhhJllt7aqNtxKXoUNkrbaXs6Zsl3aXs+tsmWWbN1yvo1yvL/j4sjvbiVv4GVc+pv1OWd/+SlMgcK3NjVsruLknvSLolznaTOJFmWRLwqMzkAc5Iel72RYpJMbd/bbH9jZJOV9GhS+YPvTBuDpL8dspo4GFgBbXD3vcDL2PrYjuL8i5V0mlic+5XY/Gh7rdTLq3RVjc2BbIKfxokJqTxlZ8W4FuYf9aP5awF9ws/XZjXbDgWHTKmyn5R2I1lQHuUsIModqT9ka9ZWFacrxCOk08KR7FIlt9jLrxUkNWX04Zg6ZfnYV9Om0E8X047jWUmfhGLwHuVDNbaZkWqjxHAdKxfnILFx07Euo4R2KrEVsyPeQq7fQ9h37Hah33fbxuwldLHwDLD/wCNnsS3EvSf4AAAAABJRU5ErkJggg==',
currentIndex: "",
currentIndex: '',
isEditMode: true,
cancelEdit: false
};
}
}
};
}
</script>
<style>
.swiper-slide {
......
export default {
created () {
window.addEventListener(
'message',
(e) => {
if (e.source != window.parent) return
if (typeof e.data === 'object' && e.data['type'] === 'editPage') {
if (this.page === e.data['page']) {
this.currentIndex = e.data['index']
}
}
},
false
)
},
watch: {
cancelEdit (value) {
console.log('cancels')
......
import data from './pages.js'
// console.log(JSON.stringify(data))
console.log(JSON.stringify(data))
export default {
data: function () {
......
......@@ -94,26 +94,26 @@
</template>
<script>
import methods from "./methods";
import methods from './methods'
export default {
props: ["list", "page", "isEditMode", "cancelEdit"],
props: ['list', 'page', 'isEditMode', 'cancelEdit'],
mixins: [methods],
created() {
console.log(this.list);
created () {
// console.log(this.list);
},
mounted() {
mounted () {
},
data() {
data () {
return {
currentIndex: "",
date: "2019.07.04",
currentIndex: '',
date: '2019.07.04',
img:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABVCAYAAAA49ahaAAAJSUlEQVR4nOWda4xV1RXHf3MdBIGBAR1AbBWtCKalBSXBZwoTS6mxVi2ofZimtAyCFGJo07QfmvRLXwmmhTRpNf3WJj4QI7Zgbaw0Wo1KCcrDDkhAio3yGphpkdfw74d1T+8++55779y55zXDP1mZ2ffsc/Y6/7POPvusvfY6TZLIAUYC1wHTgKnAJODjwMVACzDaqdsN9ABHgL1AJ7AL+CfwdnFbpmjKiNShwM1AOzAbmAU0x3Dcs8CbwEtFeQU4GcNx60KapDYBNwLfAOYDY1NoswdYD/wB+DNwLoU2UyF1FNABPAh8os59u4D/Av8p/gXrDlqxruGCOo61H1gD/KZ4vMSQJKljgJXAcoyIangf+CuwBdgG7AEOYLdzJTQDV2J98BSsP56D9cXVcARYjRHcVaNu/yApbrlA0jJJXaqMs5I2SnpQ0jUxtz9ZUoekPxXbqYQuSSskNcfNQdyEzpL0jyonsk3SSkkT4z6RCjJB0sPFdithq6Sb8kjqMEm/ktRbQfEXJd2WEpGVpF3SCxX0OydptaSheSF1qqTtFZTdLGl2xmT6cquk1yrou0XWfWRK6t2SuiOUOyRpoaRCDkiMkiZJDxT19HFc0vysSF2q6AfBOknjckBcX6RN0lMR53BO0g/TJvXHEYp8JGlxDojqjyyUdCLinNbIrDpxUldHNP4vSTNzQE4jMl3SexHn9li9xNbbcJSFblV6Q6SkZYKkNyPO8adJkbokorGXJY3OARlxSouklyLOdXncpN6p8ofSK5JG5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Ac5Iel72RYpJMbd/bbH9jZJOV9GhS+YPvTBuDpL8dspo4GFgBbXD3vcDL2PrYjuL8i5V0mlic+5XY/Gh7rdTLq3RVjc2BbIKfxokJqTxlZ8W4FuYf9aP5awF9ws/XZjXbDgWHTKmyn5R2I1lQHuUsIModqT9ka9ZWFacrxCOk08KR7FIlt9jLrxUkNWX04Zg6ZfnYV9Om0E8X047jWUmfhGLwHuVDNbaZkWqjxHAdKxfnILFx07Euo4R2KrEVsyPeQq7fQ9h37Hah33fbxuwldLHwDLD/wCNnsS3EvSf4AAAAABJRU5ErkJggg==',
currentIndex: ""
};
currentIndex: ''
}
}
};
}
</script>
<style>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,97 +4,97 @@ import store from 'src/store'
// import { getToken } from '@/utils/auth'
// 创建axios实例
const service = axios.create({
baseURL: process.env.BASE_API, // api的base_url
timeout: 10000 // 请求超时时间
})
// console.log(service)
// request拦截器
baseURL: process.env.BASE_API, // api的base_url
timeout: 10000 // 请求超时时间
})
// console.log(service)
// request拦截器
service.interceptors.request.use(config => {
// Do something before request is sent
// console.log(config.url)
if (store.getters.userInfo.ticket) {
config.headers['ticket'] = store.getters.userInfo.ticket // 让每个请求携带token--['ticket']为自定义key 请根据实际情况自行修改
// Do something before request is sent
// console.log(config.url)
if (store.getters.userInfo.ticket) {
config.headers['ticket'] = store.getters.userInfo.ticket // 让每个请求携带token--['ticket']为自定义key 请根据实际情况自行修改
}
if (!config.headers['Content-Type']) {
if (config.url != '/upload') {
config.headers['Content-Type'] = 'application/json'
}
if (!config.headers['Content-Type']) {
if (config.url != '/upload') {
config.headers['Content-Type'] = 'application/json'
}
}
config.headers['platform'] = 'front'
return config
}
config.headers['platform'] = 'front'
return config
}, error => {
// Do something with request error
console.log(error) // for debug
Promise.reject(error)
// Do something with request error
console.log(error) // for debug
Promise.reject(error)
})
// respone拦截器
service.interceptors.response.use(
response => response,
/**
response => response,
/**
* 下面的注释为通过response自定义code来标示请求状态,当code返回如下情况为权限有问题,登出并返回到登录页
* 如通过xmlhttprequest 状态码标识 逻辑可写在下面error中
*/
err => {
console.log('errwww' + err) // for debug
if (err && err.response) {
switch (err.response.status) {
case 400:
err.message = `${err.response.data.message}`
break
err => {
console.log('errwww' + err) // for debug
if (err && err.response) {
switch (err.response.status) {
case 400:
err.message = `${err.response.data.message}`
break
case 401:
err.message = `${err.response.data.message}`
break
case 401:
err.message = `${err.response.data.message}`
break
case 403:
err.message = `${err.response.data.message}`
break
case 403:
err.message = `${err.response.data.message}`
break
case 404:
err.message = `请求地址出错: ${err.response.config.url}`
break
case 404:
err.message = `请求地址出错: ${err.response.config.url}`
break
case 405:
err.message = `方法错误: ${err.response.data.message}`
break
case 405:
err.message = `方法错误: ${err.response.data.message}`
break
case 408:
err.message = '请求超时'
break
case 408:
err.message = '请求超时'
break
case 500:
err.message = `服务器出了点小问题,请稍后再试。`
break
case 500:
err.message = `服务器出了点小问题,请稍后再试。`
break
case 501:
err.message = '服务未实现'
break
case 501:
err.message = '服务未实现'
break
case 502:
err.message = '网关错误'
break
case 502:
err.message = '网关错误'
break
case 503:
err.message = '服务不可用'
break
case 503:
err.message = '服务不可用'
break
case 504:
err.message = '网关超时'
break
case 504:
err.message = '网关超时'
break
case 505:
err.message = 'HTTP版本不受支持'
break
}
}
Toast({
message: err.message,
position: 'bottom',
duration: 3 * 1000
})
console.log('❎❎')
return Promise.reject(err)
case 505:
err.message = 'HTTP版本不受支持'
break
}
}
Toast({
message: err.message,
position: 'bottom',
duration: 3 * 1000
})
console.log('❎❎')
return Promise.reject(err)
})
export default service
\ No newline at end of file
export default service
......@@ -7,6 +7,6 @@ const getters = {
userInfo: state => state.user.userInfo,
noticeList: state => state.user.noticeList,
city: state => state.user.cityList,
dict: state => state.user.dict,
dict: state => state.user.dict
}
export default getters
export function formatDate(date, fmt) {
export function formatDate (date, fmt) {
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
......@@ -18,10 +18,10 @@ export function formatDate(date, fmt) {
return fmt
}
function padLeftZero(str) {
function padLeftZero (str) {
return ('00' + str).substr(str.length)
}
export function getTime(time) {
var time = time.replace('-', '/')
return new Date(time).getTime()
export function getTime (time) {
var time = time.replace('-', '/')
return new Date(time).getTime()
}
......@@ -2,7 +2,7 @@
* Created by jiachenpan on 16/11/18.
*/
export function parseTime(time, cFormat) {
export function parseTime (time, cFormat) {
if (arguments.length === 0) {
return null
}
......@@ -34,7 +34,7 @@ export function parseTime(time, cFormat) {
return time_str
}
export function formatTime(time, option) {
export function formatTime (time, option) {
time = +time * 1000
const d = new Date(time)
const now = Date.now()
......@@ -57,11 +57,11 @@ export function formatTime(time, option) {
}
}
export function isCard(card) {
var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
export function isCard (card) {
var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
return reg.test(card)
}
export function isPhone(phone) {
var reg = /^1[3-8][0-9]\d{4,8}$/;
export function isPhone (phone) {
var reg = /^1[3-8][0-9]\d{4,8}$/
return reg.test(phone)
}
\ No newline at end of file
}
import axios from 'axios'
import Vue from 'vue'
Vue.use(axios)
import { Message } from 'mint-ui'
import store from '@/store'
import { getToken } from '@/utils/auth'
Vue.use(axios)
// 创建axios实例
const service = axios.create({
......
//本插件由www.swiper.com.cn提供
//版本1.03
function swiperAnimateCache(a){for(j=0;j<a.slides.length;j++)for(allBoxes=a.slides[j].querySelectorAll(".ani"),i=0;i<allBoxes.length;i++)allBoxes[i].attributes["style"]?allBoxes[i].setAttribute("swiper-animate-style-cache",allBoxes[i].attributes["style"].value):allBoxes[i].setAttribute("swiper-animate-style-cache"," "),allBoxes[i].style.visibility="hidden"}function swiperAnimate(a){clearSwiperAnimate(a);var b=a.slides[a.activeIndex].querySelectorAll(".ani");for(i=0;i<b.length;i++)b[i].style.visibility="visible",effect=b[i].attributes["swiper-animate-effect"]?b[i].attributes["swiper-animate-effect"].value:"",b[i].className=b[i].className+" "+effect+" "+"animated",style=b[i].attributes["style"].value,duration=b[i].attributes["swiper-animate-duration"]?b[i].attributes["swiper-animate-duration"].value:"",duration&&(style=style+"animation-duration:"+duration+";-webkit-animation-duration:"+duration+";"),delay=b[i].attributes["swiper-animate-delay"]?b[i].attributes["swiper-animate-delay"].value:"",delay&&(style=style+"animation-delay:"+delay+";-webkit-animation-delay:"+delay+";"),b[i].setAttribute("style",style)}function clearSwiperAnimate(a){for(j=0;j<a.slides.length;j++)for(allBoxes=a.slides[j].querySelectorAll(".ani"),i=0;i<allBoxes.length;i++)allBoxes[i].attributes["swiper-animate-style-cache"]&&allBoxes[i].setAttribute("style",allBoxes[i].attributes["swiper-animate-style-cache"].value),allBoxes[i].style.visibility="hidden",allBoxes[i].className=allBoxes[i].className.replace("animated"," "),allBoxes[i].attributes["swiper-animate-effect"]&&(effect=allBoxes[i].attributes["swiper-animate-effect"].value,allBoxes[i].className=allBoxes[i].className.replace(effect," "))}
\ No newline at end of file
// 本插件由www.swiper.com.cn提供
// 版本1.03
function swiperAnimateCache (a) { for (j = 0; j < a.slides.length; j++) for (allBoxes = a.slides[j].querySelectorAll('.ani'), i = 0; i < allBoxes.length; i++)allBoxes[i].attributes['style'] ? allBoxes[i].setAttribute('swiper-animate-style-cache', allBoxes[i].attributes['style'].value) : allBoxes[i].setAttribute('swiper-animate-style-cache', ' '), allBoxes[i].style.visibility = 'hidden' } function swiperAnimate (a) { clearSwiperAnimate(a); var b = a.slides[a.activeIndex].querySelectorAll('.ani'); for (i = 0; i < b.length; i++)b[i].style.visibility = 'visible', effect = b[i].attributes['swiper-animate-effect'] ? b[i].attributes['swiper-animate-effect'].value : '', b[i].className = b[i].className + ' ' + effect + ' ' + 'animated', style = b[i].attributes['style'].value, duration = b[i].attributes['swiper-animate-duration'] ? b[i].attributes['swiper-animate-duration'].value : '', duration && (style = style + 'animation-duration:' + duration + ';-webkit-animation-duration:' + duration + ';'), delay = b[i].attributes['swiper-animate-delay'] ? b[i].attributes['swiper-animate-delay'].value : '', delay && (style = style + 'animation-delay:' + delay + ';-webkit-animation-delay:' + delay + ';'), b[i].setAttribute('style', style) } function clearSwiperAnimate (a) { for (j = 0; j < a.slides.length; j++) for (allBoxes = a.slides[j].querySelectorAll('.ani'), i = 0; i < allBoxes.length; i++)allBoxes[i].attributes['swiper-animate-style-cache'] && allBoxes[i].setAttribute('style', allBoxes[i].attributes['swiper-animate-style-cache'].value), allBoxes[i].style.visibility = 'hidden', allBoxes[i].className = allBoxes[i].className.replace('animated', ' '), allBoxes[i].attributes['swiper-animate-effect'] && (effect = allBoxes[i].attributes['swiper-animate-effect'].value, allBoxes[i].className = allBoxes[i].className.replace(effect, ' ')) }
......@@ -2,32 +2,31 @@
* Created by jiachenpan on 16/11/18.
*/
export function isvalidUsername(str) {
export function isvalidUsername (str) {
const valid_map = ['admin', 'editor']
return valid_map.indexOf(str.trim()) >= 0
}
/* 合法uri*/
export function validateURL(textval) {
/* 合法uri */
export function validateURL (textval) {
const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
return urlregex.test(textval)
}
/* 小写字母*/
export function validateLowerCase(str) {
/* 小写字母 */
export function validateLowerCase (str) {
const reg = /^[a-z]+$/
return reg.test(str)
}
/* 大写字母*/
export function validateUpperCase(str) {
/* 大写字母 */
export function validateUpperCase (str) {
const reg = /^[A-Z]+$/
return reg.test(str)
}
/* 大小写字母*/
export function validatAlphabets(str) {
/* 大小写字母 */
export function validatAlphabets (str) {
const reg = /^[A-Za-z]+$/
return reg.test(str)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment