xlb-main-login
Version:
``` yarn install ```
1,755 lines (1,618 loc) • 42.1 kB
JavaScript
// 工具类
import { default_instructions } from '@/api/config'
import getToken from '@/api/getToken'
//数据插入方法
export function getWindowOpen(url,isToken=true) {
let params = url;
if(isToken){
params = default_instructions+url+'?access_token='+getToken()
}
window.open(params)
}
export function conver(limit){
var size = "";
if( limit < 0.1 * 1024 ){ //如果小于0.1KB转化成B
size = limit.toFixed(2) + "B";
}else if(limit < 0.1 * 1024 * 1024 ){//如果小于0.1MB转化成KB
size = (limit / 1024).toFixed(2) + "KB";
}else if(limit < 0.1 * 1024 * 1024 * 1024){ //如果小于0.1GB转化成MB
size = (limit / (1024 * 1024)).toFixed(2) + "MB";
}else{ //其他转化成GB
size = (limit / (1024 * 1024 * 1024)).toFixed(2) + "GB";
}
var sizestr = size + "";
var len = sizestr.indexOf("\.");
var dec = sizestr.substr(len + 1, 2);
if(dec == "00"){//当小数点后为00时 去掉小数部分
return sizestr.substring(0,len) + sizestr.substr(len + 3,2);
}
return sizestr;
}
/**
* 清除缓存
*
*
*
*/
export function RemoveToken() {
window.localStorage.clear()
localStorage.setItem('invalidToken', true) //token默认未到期
localStorage.setItem('expire', true) //权限默认未到期
}
export function getUrlCode(name) {
return (
decodeURIComponent(
(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')
) || null
)
}
/**
* 两个时间比较大小
*
* @param {Map}map
* map对象
* @return 数组
*/
export function AvgTime(date2) {
//对获得的时间戳区间与既定的时间戳进行比对
const date1 = new Date().getTime() //当前时间
date2 = new Date(date2).getTime()
//当前时间大于传人时间
if (date1 > date2) {
return true
}
return false
}
/**
* map转数组。
*
* @param {Map}map
* map对象
* @return 数组
*/
export function maptojson(result) {
result.map2Ary = function (map) {
var list = []
for (var key in map) {
list.push([key, map[key]])
}
return list
}
}
//获取东八区时间
export function dongeight() {
// 目标时区,东8区
const targetTimezone = -8
// 当前时区与中时区时差,以min为维度
const dif = new Date().getTimezoneOffset()
// 本地时区时间 + 本地时区时差 = 中时区时间
// 目标时区时间 + 目标时区时差 = 中时区时间
// 目标时区时间 = 本地时区时间 + 本地时区时差 - 目标时区时差
// 东8区时间
return new Date().getTime()
}
// data1存储时间,data2:当前时间
export function dffTime(data1) {
console.log('data1', data1)
const time = data1.replace(/\-/g, '/')
var d1 = new Date(time)
var d2 = new Date()
return parseInt(d1 - d2) > 0 ? true : false
}
//数组去重
export function unique(arr1) {
const res = new Map()
return arr1.filter((a) => !res.has(a.chatId) && res.set(a.chatId, 1))
}
//判断两个数组是否相同
export function includes(arr1, arr2) {
return arr2.every((val) => arr1.includes(val))
}
//获取两个数组相同元素
export function getArrEqual(arr1, arr2) {
const newArr = []
for (let i = 0; i < arr2.length; i++) {
for (let j = 0; j < arr1.length; j++) {
if (arr1[j] === arr2[i]) {
newArr.push(arr1[j])
}
}
}
return newArr
}
// 判断数组内是否有重复元素
export function isRepeat(arr) {
var hash = {}
for (var i in arr) {
if (hash[arr[i]]) {
return true
}
hash[arr[i]] = true
}
return false
}
//日期排序 正序
export function sortDownDate(a, b) {
return Date.parse(a.time) - Date.parse(b.time)
}
export function getUnique(array) {
const obj = {}
return array.filter((item, index) => {
// 防止key重复
const newItem = item + JSON.stringify(item)
return obj.hasOwnProperty(newItem) ? false : (obj[newItem] = true)
})
}
//给手机号添加“-”
export function getphoneinfo(phone) {
if (phone) {
let str = phone.toString().replace(/ /g, '')
const len = str.length
switch (true) {
case len > 11:
str = str.substr(0, 3) + '-' + str.substr(3, 4) + '-' + str.substr(7, 4)
phone = str
break
case len > 7:
str = str.substr(0, 3) + '-' + str.substr(3, 4) + '-' + str.substr(7)
phone = str
break
case len > 3:
str = str.substr(0, 3) + '-' + str.substr(3)
phone = str
break
default:
phone = str
}
}
return phone
}
//当前时间添加n天后的时间
export function gettimego(createtime, type) {
//type:0 7天后,type:1 30天后 ,type:2 永久
const timer = new Date(createtime)
let unixtime = timer.getTime()
let timecount = 0
if (type == 0) {
timecount = 604800 * 1000
} else if (type == 1) {
timecount = 2592000 * 1000
} else if (type == 2) {
timecount = '永久有效'
return timecount
}
unixtime = unixtime + timecount
var date = new Date(unixtime)
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
return (
year +
'-' +
formatTen(month) +
'-' +
formatTen(day) +
' ' +
formatTen(hour) +
':' +
formatTen(minute) +
':' +
formatTen(second)
)
}
//当前时间添加n天后的时间
export function gettimegodate(createtime) {
//type:0 7天后,type:1 30天后 ,type:2 永久
const timer = new Date(createtime)
const unixtime = timer.getTime()
var date = new Date(unixtime)
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
return (
year +
'-' +
formatTen(month) +
'-' +
formatTen(day) +
' ' +
formatTen(hour) +
':' +
formatTen(minute) +
':' +
formatTen(second)
)
}
//当前时间添加n天后的时间
export function gettimegodateend(createtime) {
//type:0 7天后,type:1 30天后 ,type:2 永久
const timer = new Date(createtime)
const unixtime = timer.getTime()
var date = new Date(unixtime)
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
return year + '-' + formatTen(month) + '-' + formatTen(day)
}
function formatTen(num) {
return num > 9 ? num + '' : '0' + num
}
export function IsURL(e) {
return !!new RegExp(
"^((https|http|ftp|rtsp|mms)?://)?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z].[a-z]{2,6})(:[0-9]{1,4})?((/?)|(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$"
).test(e)
}
export function ReplacePlaceholder(e) {
return '' == e || null == e || null == e
? ''
: (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = e.replace(
/\[用户昵称\]/g,
'{{nickname}}'
)).replace(/\[好友昵称\]/g, '{{pnickname}}')).replace(/\[返现金额\]/g, '{{returnMoney}}')).replace(
/\[活动标题\]/g,
'{{title}}'
)).replace(/\[倒计时\]/g, '{{countDown}}')).replace(/\[当前人数\]/g, '{{currentNum}}')).replace(
/\[剩余人数\]/g,
'{{remainNum}}'
)).replace(/\[助力好友昵称\]/g, '{{f_nickname}}')).replace(
/\[一级奖品剩余数量\]/g,
'{{rest_reward_num_g_1}}'
)).replace(/\[奖品剩余数量\]/g, '{{rest_reward_num}}')).replace(
/\[达成条件需要人数\]/g,
'{{require_num}}'
)).replace(/\[一级达成条件需要人数\]/g, '{{require_num_g_1}}')).replace(
/\[戳此立刻抽奖\]/g,
'{{draw_href}}'
)).replace(/\[邀请好友数量\]/g, '{{invited_num}}')).replace(
/\[二级奖品剩余数量\]/g,
'{{rest_reward_num_g_2}}'
)).replace(/\[二级达成条件需要人数\]/g, '{{require_num_g_2}}')).replace(
/\[三级奖品剩余数量\]/g,
'{{rest_reward_num_g_3}}'
)).replace(/\[三级达成条件需要人数\]/g, '{{require_num_g_3}}'))
}
export function ReReplacePlaceholder(e) {
return '' == e || null == e || null == e
? ''
: (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = e.replace(
/{{nickname}}/g,
'[用户昵称]'
)).replace(/{{pnickname}}/g, '[好友昵称]')).replace(/{{returnMoney}}/g, '[返现金额]')).replace(
/{{title}}/g,
'[活动标题]'
)).replace(/{{countDown}}/g, '[倒计时]')).replace(/{{currentNum}}/g, '[当前人数]')).replace(
/{{remainNum}}/g,
'[剩余人数]'
)).replace(/{{f_nickname}}/g, '[助力好友昵称]')).replace(
/{{rest_reward_num_g_1}}/g,
'[一级奖品剩余数量]'
)).replace(/{{rest_reward_num}}/g, '[奖品剩余数量]')).replace(/{{require_num}}/g, '[达成条件需要人数]')).replace(
/{{require_num_g_1}}/g,
'[一级达成条件需要人数]'
)).replace(/{{draw_href}}/g, '[戳此立刻抽奖]')).replace(/{{invited_num}}/g, '[邀请好友数量]')).replace(
/{{rest_reward_num_g_2}}/g,
'[二级奖品剩余数量]'
)).replace(/{{require_num_g_2}}/g, '[二级达成条件需要人数]')).replace(
/{{rest_reward_num_g_3}}/g,
'[三级奖品剩余数量]'
)).replace(/{{require_num_g_3}}/g, '[三级达成条件需要人数]'))
}
export function getobjnews(title, description, url, picUrl, media) {
//客服消息类
return {
msgType: 'news',
title: title,
description: description,
url: url,
picUrl: picUrl,
mediaId: media,
}
}
export function getobjtext(title, description, url, picUrl) {
//文本类
return {
msgType: 'text',
title: title,
description: description,
url: url,
picUrl: picUrl,
}
}
export function getobjimg(title, description, url, picUrl) {
//图片类
return {
msgType: 'image',
title: title,
description: description,
url: url,
picUrl: picUrl,
}
}
export function TimeFormatCopysone(date) {
var date = new Date(date * 1000 + 1000 * 24 * 60 * 60) //如果date为13位不需要乘1000
var Y = date.getFullYear() + '-'
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
return Y + M + D
}
export function TimeFormattoTime(timestamp) {
var date = new Date(timestamp) //时间戳为10位需*1000,时间戳为13位的话不需乘1000
const Y = date.getFullYear() + '-'
const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
const D = date.getDate() + ' '
return Y + M + D
}
export function TimeFormatCopys(date) {
var date = new Date(date * 1000) //如果date为13位不需要乘1000
var Y = date.getFullYear() + '-'
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
return Y + M + D
}
export function TimeFormatCopy(date) {
var date = new Date(date * 1000) //如果date为13位不需要乘1000
var Y = date.getFullYear()
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '/'
var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + '/'
return M + D + Y
}
export function TimeFormat(date) {
var date = new Date(date * 1000) //如果date为13位不需要乘1000
var Y = date.getFullYear() + '-'
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '
var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
var m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
return Y + M + D + h + m
}
export function allTimeFormat(date) {
var date = new Date(date * 1000) //如果date为13位不需要乘1000
var Y = date.getFullYear() + '-'
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '
var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'
var s = date.getSeconds()
return Y + M + D + h + m + s
}
//判断内容是否为空
export function checkValue(e) {
return 0 == parseInt(e) || ('' != e && 0 != e && null != e && null != e)
}
export function checkRate(e) {
return !!/^[0-9]+.?[0-9]*/.test(e)
}
export function mathMultiFloor(e) {
return Math.floor(0.4 * e * 100) / 100
}
export function mathDiviFloor(e) {
return Math.floor((e / 0.4) * 100) / 100
}
export function getday(fmt) {
var 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, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
for (var k in o)
if (new RegExp('(' + k + ')').test(fmt))
fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
return fmt
}
export function insertPlaceholder(e) {
let t = $(e).parent('div').siblings('textarea')
0 != t.length
? t.insertAtCaret($(e).text())
: (t = $(e).parent('div').siblings('div[class="liebian-div-j"]').find('textarea')).insertAtCaret($(e).text())
}
export function ishttp(value) {}
export function getSortFun(order, sortBy) {
var ordAlpah = order == 'asc' ? '>' : '<'
var sortFun = new Function('a', 'b', 'return a.' + sortBy + ordAlpah + 'b.' + sortBy + '?1:-1')
return sortFun
}
export function sortBy(props) {
return function (a, b) {
return a[props] - b[props]
}
}
//排序
export function newdataList(Arrlist, param) {
return sortKey(Arrlist, param)
}
function sortKey(array, key) {
return array.sort(function (a, b) {
var x = a[key]
var y = b[key]
return x > y ? -1 : x < y ? 1 : 0
})
}
//海报头像昵称二维码
export function getpostersinfo(params, cardParams, eleArr) {
const $cardItem = $('.card-item')
const $cardMover = $('#cardMover')
const scale = 0.4
// 鼠标移动事件
$(document)
.mousemove(function (e) {
if (this.move) {
var posix = !document.move_target ? { x: 0, y: 0 } : document.move_target.posix,
callback =
document.call_down ||
function () {
var type = this.move_target.getAttribute('data-type')
if (type == 'code' || type == 'nickname') {
const top =
e.pageY - posix.y - this.cardoffset.top > 470
? 470
: e.pageY - posix.y - this.cardoffset.top < 0
? 0
: e.pageY - posix.y - this.cardoffset.top
const left =
e.pageX - posix.x - this.cardoffset.left > 280
? 280
: e.pageX - posix.x - this.cardoffset.left < 0
? 0
: e.pageX - posix.x - this.cardoffset.left
cardParams[$(this.move_target).attr('data-type')].top = mathDiviFloor(top)
cardParams[$(this.move_target).attr('data-type')].left = mathDiviFloor(left)
$(this.move_target).css({
top: top,
left: left,
})
} else {
let top =
e.pageY - posix.y - this.cardoffset.top > 490
? 490
: e.pageY - posix.y - this.cardoffset.top < 0
? 0
: e.pageY - posix.y - this.cardoffset.top
let left =
e.pageX - posix.x - this.cardoffset.left > 280
? 280
: e.pageX - posix.x - this.cardoffset.left < 0
? 0
: e.pageX - posix.x - this.cardoffset.left
const lefts = left + parseInt($('.resize-width').val()) * 0.4
const tops = top + parseInt($('.resize-height').val()) * 0.4
if (lefts > 290) left = 240
if (tops > 512) top = 452
cardParams[$(this.move_target).attr('data-type')].top = mathDiviFloor(top)
cardParams[$(this.move_target).attr('data-type')].left = mathDiviFloor(left)
$(this.move_target).css({
top: top,
left: left,
})
}
}
callback.call(this, e, posix)
}
})
.mouseup(function (e) {
if (this.move) {
var callback = document.call_up || function () {}
callback.call(this, e)
$.extend(this, {
move: false,
move_target: null,
call_down: false,
call_up: false,
})
}
})
// 模块操作
$cardItem.each(function () {
if (params == $(this).attr('data-type')) {
let type = $(this).attr('data-type')
let showmenu = cardParams[type].showmenu
if (cardParams[type].status) {
return
}
cardParams[type].status = true
$cardMover.append(cardParams[type].html)
$cardMover.children('div').last().addClass('box-click').siblings('div').removeClass('box-click')
// 显示隐藏
$('.card-right-top').css('visibility', 'visible')
$('.menu-text').css('display', showmenu == 'text' ? 'inline-flex' : 'none')
$('.menu-shape').css('display', showmenu == 'shape' ? 'inline-flex' : 'none')
if (showmenu == 'shape') {
$('.resize-width').val(Math.floor(cardParams[type].width))
$('.resize-height').val(Math.floor(cardParams[type].height))
} else {
$('#cardInput').val(Math.floor(cardParams[type].fontsize * scale))
}
$('.invite-code').css('display', type == 'code' ? 'inline-flex' : 'none')
// 模块操作
$('.movebox').each(function (i) {
eleArr[i] = $(this)
.mousedown(function (e) {
$('.card-right-top').css('visibility', 'visible')
const offset = $(this).offset()
const cardoffset = $cardMover.offset()
type = $(this).attr('data-type')
showmenu = cardParams[type].showmenu
$('.menu-text').css('display', showmenu == 'text' ? 'inline-flex' : 'none')
$('.menu-shape').css('display', showmenu == 'shape' ? 'inline-flex' : 'none')
$('.invite-code').css('display', type == 'code' ? 'inline-flex' : 'none')
$('#cardInput').val(Math.floor(cardParams[type].fontsize * scale))
$('#selected-color-card').css('background-color', cardParams[type].color)
$('.resize-width').val(Math.floor(cardParams[type].width))
$('.resize-height').val(Math.floor(cardParams[type].height))
if (type == 'head') {
$('.menu_shape_head').css('display', showmenu == 'shape' ? 'inline-flex' : 'none')
} else {
$('.menu_shape_head').css('display', 'none')
}
$(this).addClass('box-click').siblings('div').removeClass('box-click')
this.posix = { x: e.pageX - offset.left, y: e.pageY - offset.top }
$.extend(document, {
move: true,
move_target: this,
cardoffset: cardoffset,
})
})
.on('mousedown', '.movecoor', function (e) {
var posix = {
w: eleArr[i].width(),
h: eleArr[i].height(),
x: e.pageX,
y: e.pageY,
}
$.extend(document, {
move: true,
call_down: function (e) {
const ele_type = eleArr[i].attr('data-type').toString()
const w = e.pageX - posix.x + posix.w
const h = e.pageY - posix.y + posix.h
if (['code', 'nickname'].indexOf(ele_type) != -1) {
const basenum = ele_type == 'code' ? 45 : 90
eleArr[i].css({
// 'width': Math.max(30, w),
// 'height': Math.max(30, w),
'font-size': Math.floor(50 * scale * ((e.pageX - posix.x + posix.w) / basenum)) + 'px',
})
const fontsize = Math.floor(50 * ((e.pageX - posix.x + posix.w) / basenum))
cardParams[eleArr[i].attr('data-type')].fontsize = fontsize
$('#cardInput').val(Math.floor(fontsize * scale))
} else {
// 等比缩放
// Math.floor((e.pageY - posix.y + posix.h)/scale)
const w = Math.floor((e.pageX - posix.x + posix.w) / scale)
const h = Math.floor((e.pageX - posix.x + posix.w) / scale)
if (w < 72) {
w === 72, $('.resize-width').val(72)
w === 72, $('.resize-width').val(72)
} else {
$('.resize-width').val(Math.floor((e.pageX - posix.x + posix.w) / scale))
}
if (h < 72) {
h === 72, $('.resize-height').val(72)
} else {
$('.resize-height').val(Math.floor((e.pageX - posix.x + posix.w) / scale))
}
cardParams[$('.box-click').attr('data-type')].width = Math.floor(
(e.pageX - posix.x + posix.w) / scale
)
cardParams[$('.box-click').attr('data-type')].height = Math.floor(
(e.pageX - posix.x + posix.w) / scale
)
eleArr[i].css({
width: Math.max(30, e.pageX - posix.x + posix.w),
height: Math.max(30, e.pageX - posix.x + posix.w),
})
}
},
})
return false
})
})
}
})
// 键盘操作
document.onkeydown = function () {
if (parseInt(event.keyCode, 10) === 46) {
cardParams[$('.box-click').attr('data-type')].status = false
cardParams[$('.box-click').attr('data-type')].top = 0
cardParams[$('.box-click').attr('data-type')].left = 0
$('.box-click').remove()
$('#cardMover').children('div').length == 0 && $('.card-right-top').css('visibility', 'hidden')
}
if (parseInt(event.keyCode, 10) === 38) {
const top = parseInt($('.box-click').css('top').split('px')[0], 10) - 1.5
$('.box-click').css('top', top + 'px')
cardParams[$('.box-click').attr('data-type')].top = Math.floor(top / scale)
}
// down
if (parseInt(event.keyCode, 10) === 40) {
const top = parseInt($('.box-click').css('top').split('px')[0], 10) + 1.5
$('.box-click').css('top', top + 'px')
cardParams[$('.box-click').attr('data-type')].top = Math.floor(top / scale)
}
// left
if (parseInt(event.keyCode, 10) === 37) {
const left = parseInt($('.box-click').css('left').split('px')[0], 10) - 1.5
$('.box-click').css('left', left + 'px')
cardParams[$('.box-click').attr('data-type')].left = Math.floor(left / scale)
}
// bottm
if (parseInt(event.keyCode, 10) === 39) {
const left = parseInt($('.box-click').css('left').split('px')[0], 10) + 1.5
$('.box-click').css('left', left + 'px')
cardParams[$('.box-click').attr('data-type')].left = Math.floor(left / scale)
}
}
$('#cardInput').focus(function () {
$('.size-child').show()
})
// 拖拉模块的字体大小
var html = ''
for (var i = 5, len = 104; i < len; i++) {
html += '<li>' + i + '</li>'
}
$('#cardFontList').empty()
$('#cardFontList').append(html)
$('#cardFontList')
.children('li')
.each(function (i) {
$(this).click(function () {
const fontsize = $(this).text().trim()
$('#cardInput').val(fontsize)
$('.size-child').hide()
$('.box-click').css('font-size', fontsize + 'px')
cardParams[$('.box-click').attr('data-type')].fontsize = fontsize / scale
})
})
// 拖拉模块的字体大小
// $('.card-right-content').click(function () {
// $('.size-child').hide();
// $('.resize-tool').hide();
// })
// $('.liebian-card-left-pannel').click(function () {
// $('.size-child').hide();
// $('.resize-tool').hide();
// })
// 尺寸
// $('.btn-chicun').click(function () {
// $('.resize-tool').show();
// $('.size-child').hide();
// })
// $('#selected-color-card').click(function () {
// // $('.resize-tool').hide();
// $('.size-child').hide();
// })
// $('.submit-resize').click(function () {
// let width = parseInt($('.resize-width').val().trim(), 10);
// let height = parseInt($('.resize-height').val().trim(), 10);
//
// cardParams[$('.box-click').attr('data-type')].width = width;
// cardParams[$('.box-click').attr('data-type')].height = height;
// $('.box-click').css('width', (width * scale) + 'px');
// $('.box-click').css('height', (height * scale) + 'px');
// $('.resize-tool').hide();
// })
// 去焦事件
$('.unblur').blur(function () {
const e = parseInt($('.resize-width').val().trim(), 10)
const t = parseInt($('.resize-height').val().trim(), 10)
if (e < 72) e === 72, $('.resize-width').val(72)
if (t < 72) t === 72, $('.resize-height').val(72)
cardParams[$('.box-click').attr('data-type')].width = e
cardParams[$('.box-click').attr('data-type')].height = t
$('.box-click').css('width', 0.4 * e + 'px')
$('.box-click').css('height', 0.4 * t + 'px')
}),
// 颜色
$('#colorpalettecard')
.colorPalette()
.on('selectColor', function (e) {
$('#selected-color-card').css('background-color', e.color)
$('.box-click').css('color', e.color)
if (cardParams[$('.box-click').attr('data-type')]) {
cardParams[$('.box-click').attr('data-type')].color = e.color
}
})
}
export const area = [
'不限',
'北京',
'天津',
'上海',
'重庆',
'河北',
'山西',
'内蒙古',
'辽宁',
'吉林',
'黑龙江',
'江苏',
'浙江',
'安徽',
'福建',
'江西',
'山东',
'河南',
'湖北',
'湖南',
'广东',
'广西',
'海南',
'四川',
'贵州',
'云南',
'西藏',
'陕西',
'甘肃',
'青海',
'宁夏',
'新疆',
'香港',
'澳门',
'台湾',
]
export const dsy = []
dsy[0] = ['不限']
dsy[1] = [
'不限',
'东城',
'西城',
'崇文',
'宣武',
'朝阳',
'丰台',
'石景山',
'海淀',
'门头沟',
'房山',
'通州',
'顺义',
'昌平',
'大兴',
'怀柔',
'平谷',
'密云',
'延庆',
'延庆镇',
]
dsy[2] = [
'不限',
'和平',
'河东',
'河西',
'南开',
'河北',
'红桥',
'塘沽',
'汉沽',
'大港',
'东丽',
'西青',
'津南',
'北辰',
'武清',
'宝坻',
'蓟县',
'宁河',
'芦台镇',
'静海',
'静海镇',
]
dsy[3] = [
'不限',
'黄浦',
'卢湾',
'徐汇',
'长宁',
'静安',
'普陀',
'闸北',
'虹口',
'杨浦',
'闵行',
'宝山',
'嘉定',
'浦东新区',
'金山',
'松江',
'青浦',
'南汇',
'奉贤',
'崇明',
'城桥镇',
]
dsy[4] = [
'不限',
'渝中',
'大渡口',
'江北',
'沙坪坝',
'九龙坡',
'南岸',
'北碚',
'万盛',
'双桥',
'渝北',
'巴南',
'万州',
'涪陵',
'黔江',
'长寿',
'合川',
'永川',
'江津',
'南川',
'綦江',
'潼南',
'铜梁',
'大足',
'荣昌',
'璧山',
'垫江',
'武隆',
'丰都',
'城口',
'梁平',
'开',
'巫溪',
'巫山',
'奉节',
'云阳',
'忠',
'石柱土家族自治',
'彭水苗族土家族自治',
'酉阳土家族苗族自治',
'秀山土家族苗族自治',
]
dsy[5] = ['不限', '石家庄', '张家口', '承德', '秦皇岛', '唐山', '廊坊', '保定', '衡水', '沧州', '邢台', '邯郸']
dsy[6] = ['不限', '太原', '朔州', '大同', '阳泉', '长治', '晋城', '忻州', '晋中', '临汾', '吕梁', '运城']
dsy[7] = [
'不限',
'呼和浩特',
'包头',
'乌海',
'赤峰',
'通辽',
'呼伦贝尔',
'鄂尔多斯',
'乌兰察布',
'巴彦淖尔',
'兴安',
'锡林郭勒',
'阿拉善',
]
dsy[8] = [
'不限',
'沈阳',
'朝阳',
'阜新',
'铁岭',
'抚顺',
'本溪',
'辽阳',
'鞍山',
'丹东',
'大连',
'营口',
'盘锦',
'锦州',
'葫芦岛',
]
dsy[9] = ['不限', '长春', '白城', '松原', '吉林', '四平', '辽源', '通化', '白山', '延边州']
dsy[10] = [
'不限',
'哈尔滨',
'齐齐哈尔',
'七台河',
'黑河',
'大庆',
'鹤岗',
'伊春',
'佳木斯',
'双鸭山',
'鸡西',
'牡丹江',
'绥化',
'大兴安岭地',
]
dsy[11] = [
'不限',
'南京',
'徐州',
'连云港',
'宿迁',
'淮安',
'盐城',
'扬州',
'泰州',
'南通',
'镇江',
'常州',
'无锡',
'苏州',
]
dsy[12] = ['不限', '杭州', '湖州', '嘉兴', '舟山', '宁波', '绍兴', '衢州', '金华', '台州', '温州', '丽水']
dsy[13] = [
'不限',
'合肥',
'宿州',
'淮北',
'亳州',
'阜阳',
'蚌埠',
'淮南',
'滁州',
'马鞍山',
'芜湖',
'铜陵',
'安庆',
'黄山',
'六安',
'巢湖',
'池州',
'宣城',
]
dsy[14] = ['不限', '福州', '南平', '莆田', '三明', '泉州', '厦门', '漳州', '龙岩', '宁德']
dsy[15] = ['不限', '南昌', '九江', '景德镇', '鹰潭', '新余', '萍乡', '赣州', '上饶', '抚州', '宜春', '吉安']
dsy[16] = [
'不限',
'济南',
'青岛',
'聊城',
'德州',
'东营',
'淄博',
'潍坊',
'烟台',
'威海',
'日照',
'临沂',
'枣庄',
'济宁',
'泰安',
'莱芜',
'滨州',
'菏泽',
]
dsy[17] = [
'不限',
'郑州',
'开封',
'三门峡',
'洛阳',
'焦作',
'新乡',
'鹤壁',
'安阳',
'濮阳',
'商丘',
'许昌',
'漯河',
'平顶山',
'南阳',
'信阳',
'周口',
'驻马店',
'济源',
]
dsy[18] = [
'不限',
'武汉',
'十堰',
'襄樊',
'荆门',
'孝感',
'黄冈',
'鄂州',
'黄石',
'咸宁',
'荆州',
'宜昌',
'随州',
'省直辖县级行政单位',
'恩施州',
]
dsy[19] = [
'不限',
'长沙',
'张家界',
'常德',
'益阳',
'岳阳',
'株洲',
'湘潭',
'衡阳',
'郴州',
'永州',
'邵阳',
'怀化',
'娄底',
'湘西州',
]
dsy[20] = [
'不限',
'广州',
'深圳',
'清远',
'韶关',
'河源',
'梅州',
'潮州',
'汕头',
'揭阳',
'汕尾',
'惠州',
'东莞',
'珠海',
'中山',
'江门',
'佛山',
'肇庆',
'云浮',
'阳江',
'茂名',
'湛江',
]
dsy[21] = [
'不限',
'南宁',
'桂林',
'柳州',
'梧州',
'贵港',
'玉林',
'钦州',
'北海',
'防城港',
'崇左',
'百色',
'河池',
'来宾',
'贺州',
]
dsy[22] = ['不限', '海口', '三亚', '省直辖行政单位']
dsy[23] = [
'不限',
'成都',
'广元',
'绵阳',
'德阳',
'南充',
'广安',
'遂宁',
'内江',
'乐山',
'自贡',
'泸州',
'宜宾',
'攀枝花',
'巴中',
'达州',
'资阳',
'眉山',
'雅安',
'阿坝州',
'甘孜州',
'凉山州',
]
dsy[24] = ['不限', '贵阳', '六盘水', '遵义', '安顺', '毕节', '铜仁', '黔东南州', '黔南州', '黔西南州']
dsy[25] = [
'不限',
'昆明',
'曲靖',
'玉溪',
'保山',
'昭通',
'丽江',
'思茅',
'临沧',
'德宏州',
'怒江州',
'迪庆州',
'大理州',
'楚雄州',
'红河州',
'文山州',
'西双版纳州',
]
dsy[26] = ['不限', '拉萨', '那曲地', '昌都地', '林芝地', '山南地', '日喀则地', '阿里地']
dsy[27] = ['不限', '西安', '延安', '铜川', '渭南', '咸阳', '宝鸡', '汉中', '榆林', '安康', '商洛']
dsy[28] = [
'不限',
'兰州',
'嘉峪关',
'白银',
'天水',
'武威',
'酒泉',
'张掖',
'庆阳',
'平凉',
'定西',
'陇南',
'临夏州',
'甘南州',
]
dsy[29] = ['不限', '西宁', '海东地', '海北州', '海南州', '黄南州', '果洛州', '玉树州', '海西州']
dsy[30] = ['不限', '银川', '石嘴山', '吴忠', '固原', '中卫']
dsy[31] = [
'不限',
'乌鲁木齐',
'克拉玛依',
'自治区直辖县级行政单位',
'喀什地',
'阿克苏',
'和田',
'吐鲁番',
'哈密',
'克孜勒苏柯州',
'博尔塔拉',
'昌吉',
'巴音郭楞',
'伊犁',
'塔城',
'阿勒泰',
]
dsy[32] = ['不限', '香港特别行政']
dsy[33] = ['不限', '澳门特别行政']
dsy[34] = [
'不限',
'台北',
'高雄',
'台中',
'花莲',
'基隆',
'嘉义',
'金门',
'连江',
'苗栗',
'南投',
'澎湖',
'屏东',
'台东',
'台南',
'桃园',
'新竹',
'宜兰',
'云林',
'彰化',
]
export const areas = [
'北京',
'天津',
'上海',
'重庆',
'河北',
'山西',
'内蒙古',
'辽宁',
'吉林',
'黑龙江',
'江苏',
'浙江',
'安徽',
'福建',
'江西',
'山东',
'河南',
'湖北',
'湖南',
'广东',
'广西',
'海南',
'四川',
'贵州',
'云南',
'西藏',
'陕西',
'甘肃',
'青海',
'宁夏',
'新疆',
'香港',
'澳门',
'台湾',
]
export const dsys = []
dsys[0] = [
'东城',
'西城',
'崇文',
'宣武',
'朝阳',
'丰台',
'石景山',
'海淀',
'门头沟',
'房山',
'通州',
'顺义',
'昌平',
'大兴',
'怀柔',
'平谷',
'密云',
'延庆',
'延庆镇',
]
dsys[1] = [
'和平',
'河东',
'河西',
'南开',
'河北',
'红桥',
'塘沽',
'汉沽',
'大港',
'东丽',
'西青',
'津南',
'北辰',
'武清',
'宝坻',
'蓟县',
'宁河',
'芦台镇',
'静海',
'静海镇',
]
dsys[2] = [
'黄浦',
'卢湾',
'徐汇',
'长宁',
'静安',
'普陀',
'闸北',
'虹口',
'杨浦',
'闵行',
'宝山',
'嘉定',
'浦东新区',
'金山',
'松江',
'青浦',
'南汇',
'奉贤',
'崇明',
'城桥镇',
]
dsys[3] = [
'渝中',
'大渡口',
'江北',
'沙坪坝',
'九龙坡',
'南岸',
'北碚',
'万盛',
'双桥',
'渝北',
'巴南',
'万州',
'涪陵',
'黔江',
'长寿',
'合川',
'永川',
'江津',
'南川',
'綦江',
'潼南',
'铜梁',
'大足',
'荣昌',
'璧山',
'垫江',
'武隆',
'丰都',
'城口',
'梁平',
'开',
'巫溪',
'巫山',
'奉节',
'云阳',
'忠',
'石柱土家族自治',
'彭水苗族土家族自治',
'酉阳土家族苗族自治',
'秀山土家族苗族自治',
]
dsys[4] = ['石家庄', '张家口', '承德', '秦皇岛', '唐山', '廊坊', '保定', '衡水', '沧州', '邢台', '邯郸']
dsys[5] = ['太原', '朔州', '大同', '阳泉', '长治', '晋城', '忻州', '晋中', '临汾', '吕梁', '运城']
dsys[6] = [
'呼和浩特',
'包头',
'乌海',
'赤峰',
'通辽',
'呼伦贝尔',
'鄂尔多斯',
'乌兰察布',
'巴彦淖尔',
'兴安',
'锡林郭勒',
'阿拉善',
]
dsys[7] = [
'沈阳',
'朝阳',
'阜新',
'铁岭',
'抚顺',
'本溪',
'辽阳',
'鞍山',
'丹东',
'大连',
'营口',
'盘锦',
'锦州',
'葫芦岛',
]
dsys[8] = ['长春', '白城', '松原', '吉林', '四平', '辽源', '通化', '白山', '延边州']
dsys[9] = [
'哈尔滨',
'齐齐哈尔',
'七台河',
'黑河',
'大庆',
'鹤岗',
'伊春',
'佳木斯',
'双鸭山',
'鸡西',
'牡丹江',
'绥化',
'大兴安岭地',
]
dsys[10] = ['南京', '徐州', '连云港', '宿迁', '淮安', '盐城', '扬州', '泰州', '南通', '镇江', '常州', '无锡', '苏州']
dsys[11] = ['杭州', '湖州', '嘉兴', '舟山', '宁波', '绍兴', '衢州', '金华', '台州', '温州', '丽水']
dsys[12] = [
'合肥',
'宿州',
'淮北',
'亳州',
'阜阳',
'蚌埠',
'淮南',
'滁州',
'马鞍山',
'芜湖',
'铜陵',
'安庆',
'黄山',
'六安',
'巢湖',
'池州',
'宣城',
]
dsys[13] = ['福州', '南平', '莆田', '三明', '泉州', '厦门', '漳州', '龙岩', '宁德']
dsys[14] = ['南昌', '九江', '景德镇', '鹰潭', '新余', '萍乡', '赣州', '上饶', '抚州', '宜春', '吉安']
dsys[15] = [
'济南',
'青岛',
'聊城',
'德州',
'东营',
'淄博',
'潍坊',
'烟台',
'威海',
'日照',
'临沂',
'枣庄',
'济宁',
'泰安',
'莱芜',
'滨州',
'菏泽',
]
dsys[16] = [
'郑州',
'开封',
'三门峡',
'洛阳',
'焦作',
'新乡',
'鹤壁',
'安阳',
'濮阳',
'商丘',
'许昌',
'漯河',
'平顶山',
'南阳',
'信阳',
'周口',
'驻马店',
'济源',
]
dsys[17] = [
'武汉',
'十堰',
'襄樊',
'荆门',
'孝感',
'黄冈',
'鄂州',
'黄石',
'咸宁',
'荆州',
'宜昌',
'随州',
'省直辖县级行政单位',
'恩施州',
]
dsys[18] = [
'长沙',
'张家界',
'常德',
'益阳',
'岳阳',
'株洲',
'湘潭',
'衡阳',
'郴州',
'永州',
'邵阳',
'怀化',
'娄底',
'湘西州',
]
dsys[19] = [
'广州',
'深圳',
'清远',
'韶关',
'河源',
'梅州',
'潮州',
'汕头',
'揭阳',
'汕尾',
'惠州',
'东莞',
'珠海',
'中山',
'江门',
'佛山',
'肇庆',
'云浮',
'阳江',
'茂名',
'湛江',
]
dsys[20] = [
'南宁',
'桂林',
'柳州',
'梧州',
'贵港',
'玉林',
'钦州',
'北海',
'防城港',
'崇左',
'百色',
'河池',
'来宾',
'贺州',
]
dsys[21] = ['海口', '三亚', '省直辖行政单位']
dsys[22] = [
'成都',
'广元',
'绵阳',
'德阳',
'南充',
'广安',
'遂宁',
'内江',
'乐山',
'自贡',
'泸州',
'宜宾',
'攀枝花',
'巴中',
'达州',
'资阳',
'眉山',
'雅安',
'阿坝州',
'甘孜州',
'凉山州',
]
dsys[23] = ['贵阳', '六盘水', '遵义', '安顺', '毕节', '铜仁', '黔东南州', '黔南州', '黔西南州']
dsys[24] = [
'昆明',
'曲靖',
'玉溪',
'保山',
'昭通',
'丽江',
'思茅',
'临沧',
'德宏州',
'怒江州',
'迪庆州',
'大理州',
'楚雄州',
'红河州',
'文山州',
'西双版纳州',
]
dsys[25] = ['拉萨', '那曲地', '昌都地', '林芝地', '山南地', '日喀则地', '阿里地']
dsys[26] = ['西安', '延安', '铜川', '渭南', '咸阳', '宝鸡', '汉中', '榆林', '安康', '商洛']
dsys[27] = [
'兰州',
'嘉峪关',
'白银',
'天水',
'武威',
'酒泉',
'张掖',
'庆阳',
'平凉',
'定西',
'陇南',
'临夏州',
'甘南州',
]
dsys[28] = ['西宁', '海东地', '海北州', '海南州', '黄南州', '果洛州', '玉树州', '海西州']
dsys[29] = ['银川', '石嘴山', '吴忠', '固原', '中卫']
dsys[30] = [
'乌鲁木齐',
'克拉玛依',
'自治区直辖县级行政单位',
'喀什地',
'阿克苏',
'和田',
'吐鲁番',
'哈密',
'克孜勒苏柯州',
'博尔塔拉',
'昌吉',
'巴音郭楞',
'伊犁',
'塔城',
'阿勒泰',
]
dsys[31] = ['香港特别行政']
dsys[32] = ['澳门特别行政']
dsys[33] = [
'台北',
'高雄',
'台中',
'花莲',
'基隆',
'嘉义',
'金门',
'连江',
'苗栗',
'南投',
'澎湖',
'屏东',
'台东',
'台南',
'桃园',
'新竹',
'宜兰',
'云林',
'彰化',
]