替换铭牌
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 297 KiB After Width: | Height: | Size: 650 KiB |
@@ -3,7 +3,7 @@ let urlPrefix = getUrlPrefix();
|
||||
var browser = checkVersion();
|
||||
var info = {};
|
||||
if (EnvCheck() === 'test') new VConsole
|
||||
// 封装layer消息提醒框
|
||||
// 封裝layer消息提醒框
|
||||
let layerIndex
|
||||
const showLoading = (content = '加載中...') => {
|
||||
layer.open({
|
||||
@@ -29,7 +29,7 @@ const toastMsg = (content = '操作完成', time = 2) => {
|
||||
let delayLock = false, newApplyLock = false
|
||||
|
||||
let btnStatus = []
|
||||
// 获取用户铭牌状态
|
||||
// 獲取用戶銘牌狀態
|
||||
const getUserNameplateInfo = () => {
|
||||
showLoading()
|
||||
networkRequest({
|
||||
@@ -54,11 +54,11 @@ const getUserNameplateInfo = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// 渲染首页按钮状态
|
||||
// 渲染首頁按鈕狀態
|
||||
const renderBtnStatus = () => {
|
||||
btnStatus.map( (item,index) => {
|
||||
if(index > 1){
|
||||
// 进阶款式
|
||||
// 進階款式
|
||||
$('.btn').eq(index).find('img').attr('src', `${item > 0 ? './images/apply-btn-basics.png' : './images/disabled-btn.png'}`)
|
||||
if(item > 0){
|
||||
$('.btn').eq(index).on('click', () => {
|
||||
@@ -66,7 +66,7 @@ const renderBtnStatus = () => {
|
||||
})
|
||||
}
|
||||
}else{
|
||||
// 基础款式
|
||||
// 基礎款式
|
||||
$('.btn').eq(index).find('img').attr('src', `${item > 0 ? './images/apply-btn-basics.png' : './images/disabled-btn.png'}`)
|
||||
if(item > 0){
|
||||
$('.btn').eq(index).on('click', () => {
|
||||
@@ -78,7 +78,7 @@ const renderBtnStatus = () => {
|
||||
}
|
||||
|
||||
let userNameplateList = []
|
||||
// 获取用户已有铭牌列表
|
||||
// 獲取用戶已有銘牌列錶
|
||||
const getUserNameplateList = (type) => {
|
||||
showLoading()
|
||||
networkRequest({
|
||||
@@ -108,7 +108,7 @@ const getUserNameplateList = (type) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 渲染铭牌列表(选择弹窗)
|
||||
// 渲染銘牌列錶(選擇彈窗)
|
||||
const renderNameplateList = () => {
|
||||
let str = ''
|
||||
userNameplateList.map( item => {
|
||||
@@ -133,7 +133,7 @@ const renderNameplateList = () => {
|
||||
|
||||
|
||||
let newNameplateList = []
|
||||
// 获取新铭牌列表
|
||||
// 獲取新銘牌列錶
|
||||
const getNewNameplateList = (type) => {
|
||||
showLoading()
|
||||
networkRequest({
|
||||
@@ -147,7 +147,7 @@ const getNewNameplateList = (type) => {
|
||||
hideLoading(layerIndex)
|
||||
if(res.code === 200){
|
||||
if(!res.data.length){
|
||||
toastMsg('暂时没有铭牌可申请')
|
||||
toastMsg('暫時沒有銘牌可申請')
|
||||
return
|
||||
}
|
||||
newNameplateList = res.data
|
||||
@@ -163,8 +163,8 @@ const getNewNameplateList = (type) => {
|
||||
})
|
||||
}
|
||||
|
||||
let newNameplateId //只有一个可选时,默认选中
|
||||
// 渲染申请新铭牌弹窗
|
||||
let newNameplateId //只有一個可選時,默認選中
|
||||
// 渲染申請新銘牌彈窗
|
||||
const renderNewNameplateList = () => {
|
||||
let str = '';
|
||||
newNameplateList.map( item => {
|
||||
@@ -187,7 +187,7 @@ const renderNewNameplateList = () => {
|
||||
$('body').css('overflow', 'hidden')
|
||||
}
|
||||
|
||||
// 确认延长期限
|
||||
// 確認延長期限
|
||||
const delayNamaplateConfirm = (params) => {
|
||||
showLoading()
|
||||
networkRequest({
|
||||
@@ -204,7 +204,7 @@ const delayNamaplateConfirm = (params) => {
|
||||
success(res){
|
||||
hideLoading(layerIndex)
|
||||
if(res.code === 200){
|
||||
toastMsg('申请成功')
|
||||
toastMsg('申請成功')
|
||||
$('.shade-mask-delay').hide()
|
||||
$('body').css('overflow', 'auto')
|
||||
delayLock = false
|
||||
@@ -222,7 +222,7 @@ const delayNamaplateConfirm = (params) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 确认申请新铭牌
|
||||
// 確認申請新銘牌
|
||||
const applyNewNamaplateConfirm = (params) => {
|
||||
showLoading()
|
||||
networkRequest({
|
||||
@@ -239,7 +239,7 @@ const applyNewNamaplateConfirm = (params) => {
|
||||
success(res){
|
||||
hideLoading(layerIndex)
|
||||
if(res.code === 200){
|
||||
toastMsg('申请成功')
|
||||
toastMsg('申請成功')
|
||||
$('.shade-mask-new').hide()
|
||||
$('body').css('overflow', 'auto')
|
||||
newApplyLock = false
|
||||
@@ -268,12 +268,12 @@ $(function () {
|
||||
_hmt.push(['_trackEvent', 'client', 'click', "act_nameplate"]);
|
||||
}
|
||||
|
||||
// 点击申请记录按钮
|
||||
// 點擊申請記錄按鈕
|
||||
$('.record').on('click', function(){
|
||||
window.location.href = './record.html'
|
||||
})
|
||||
|
||||
// 关闭弹窗
|
||||
// 關閉彈窗
|
||||
$('.shade-mask .close').on('click', () => {
|
||||
$('.shade-mask').hide()
|
||||
$('body').css('overflow', 'auto')
|
||||
@@ -290,7 +290,7 @@ $(function () {
|
||||
})
|
||||
|
||||
let maxApplyDay, nameplateId, type, text
|
||||
// 监听 延长期限 按钮点击事件
|
||||
// 監聽 延長期限 按鈕點擊事件
|
||||
$('.select-ul').on('click', '.delay-btn', function() {
|
||||
let li = $(this).parent();
|
||||
let src = li.find('.nameplate img').attr('src');
|
||||
@@ -307,29 +307,29 @@ $(function () {
|
||||
$('.shade-mask-delay').show().siblings('.shade-mask, .shade-mask-new').hide()
|
||||
})
|
||||
|
||||
// 延期弹窗 点击减按钮
|
||||
// 延期彈窗 點擊減按鈕
|
||||
$('.shade-mask-delay').on('click', '.decrease', function(){
|
||||
let applyDay = parseInt( $(this).parent().find('span').html() );
|
||||
if(applyDay > 7){
|
||||
applyDay -= 7;
|
||||
}else{
|
||||
toastMsg('铭牌至少申请7天')
|
||||
toastMsg('銘牌至少申請7天')
|
||||
}
|
||||
$('.shade-mask-delay .delay-time p span').html(applyDay);
|
||||
})
|
||||
//延期弹窗 点击加按钮
|
||||
//延期彈窗 點擊加按鈕
|
||||
$('.shade-mask-delay').on('click', '.increase', function(){
|
||||
let applyDay = parseInt( $(this).parent().find('span').html() );
|
||||
if(applyDay >= maxApplyDay){
|
||||
toastMsg('已达最大申请时长')
|
||||
toastMsg('已達最大申請時長')
|
||||
}else{
|
||||
applyDay += 7;
|
||||
}
|
||||
$('.shade-mask-delay .delay-time p span').html(applyDay);
|
||||
})
|
||||
// 监听申请延期确定按钮点击事件
|
||||
// 監聽申請延期確定按鈕點擊事件
|
||||
$('.shade-mask-delay').on('click', '.apply-btn', function(){
|
||||
// applyType 1申请新铭牌,2延长
|
||||
// applyType 1申請新銘牌,2延長
|
||||
if(!delayLock){
|
||||
delayLock = true
|
||||
let params = {
|
||||
@@ -345,59 +345,59 @@ $(function () {
|
||||
|
||||
/************************* ******************************/
|
||||
|
||||
// 监听 申请新铭牌 按钮点击事件
|
||||
// 監聽 申請新銘牌 按鈕點擊事件
|
||||
$('.shade-mask').on('click', '.apply-btn', function(){
|
||||
let type = $(this).parent().find('.select-ul li').eq(0).data('type');
|
||||
getNewNameplateList(type)
|
||||
})
|
||||
|
||||
// 申请新铭牌弹窗 点击减按钮
|
||||
// 申請新銘牌彈窗 點擊減按鈕
|
||||
$('.shade-mask-new').on('click', '.decrease', function(){
|
||||
let applyDay = parseInt( $(this).parent().find('span').html() );
|
||||
if(applyDay > 7){
|
||||
applyDay -= 7;
|
||||
}else{
|
||||
toastMsg('铭牌至少申请7天')
|
||||
toastMsg('銘牌至少申請7天')
|
||||
}
|
||||
$('.shade-mask-new .delay-time p span').html(applyDay);
|
||||
})
|
||||
// 申请新铭牌弹窗 点击加按钮
|
||||
// 申請新銘牌彈窗 點擊加按鈕
|
||||
$('.shade-mask-new').on('click', '.increase', function(){
|
||||
let applyDay = parseInt( $(this).parent().find('span').html() );
|
||||
let maxApplyDay = parseInt( $(this).parent().parent().parent().find('.apply-new-ul li').eq(0).data('applyDay') );
|
||||
if(applyDay >= maxApplyDay){
|
||||
toastMsg('已达最大申请时长')
|
||||
toastMsg('已達最大申請時長')
|
||||
}else{
|
||||
applyDay += 7;
|
||||
}
|
||||
$('.shade-mask-new .delay-time p span').html(applyDay);
|
||||
})
|
||||
|
||||
// 申请新铭牌弹窗 点击铭牌列表事件
|
||||
// 申請新銘牌彈窗 點擊銘牌列錶事件
|
||||
$('.shade-mask-new').on('click', 'li', function(){
|
||||
$(this).addClass('active').siblings('li').removeClass('active');
|
||||
newNameplateId = $(this).data('nameplateId');
|
||||
})
|
||||
|
||||
// 申请新铭牌弹窗 确定申请 按钮点击事件
|
||||
// 申請新銘牌彈窗 確定申請 按鈕點擊事件
|
||||
$('.shade-mask-new').on('click', '.apply-btn', function(){
|
||||
let content = $(this).parent();
|
||||
let ipt = content.find('input.new-nameplate-desc').val()
|
||||
if(!newNameplateId){
|
||||
toastMsg('请选择样式');
|
||||
toastMsg('請選擇樣式');
|
||||
return
|
||||
}
|
||||
if(!ipt){
|
||||
toastMsg('请添加铭牌文字');
|
||||
toastMsg('請添加銘牌文字');
|
||||
return
|
||||
}else{
|
||||
if(ipt.length !== 4){
|
||||
toastMsg('请添加4个字的铭牌文字');
|
||||
toastMsg('請添加4個字的銘牌文字');
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// applyType 1申请新铭牌,2延长
|
||||
// applyType 1申請新銘牌,2延長
|
||||
if(!newApplyLock){
|
||||
newApplyLock = true
|
||||
let params = {
|
||||
|