/* * @Descripttion : 模板-模板市场 * @Versions : 0.1 * @Author : foxcms team * @Date : 2022-01-24 21:03:59 * @LastEditors : liuzhifang * @LastEditTime : 2022-01-26 10:54:50 */ /** * @description: 行业切换 * @param {*} function * @return {*} * @Date: 2022-01-24 21:21:47 */ $('.operation-box .left .tab-btn').click(function () { const isActive = $(this).is('.is-active'); if (!isActive) { $(this).closest('.left').find('.tab-btn').removeClass('is-active'); $(this).addClass('is-active'); } }); /** * @description: 标准模板分页 * @param {*} * @return {*} * @Date: 2022-01-24 21:54:33 */ fox.pagination({ el: $('#standardPagination'), total: 17, currentPage: 5, type: 'special', isShowJump: true, isShowTotal: true, isShowSize: true, pageChange: function (res, callback) { // 获取页码相关数据,添加异步请求 const { total, pageSize, currentPage } = res; // 成功获取数据后,把相关参数回传 fox.loading({ text: '加载中...', background: 'rgba(255, 255, 255, 0.9)', }); // 摸拟异步获取数据 setTimeout(() => { callback({ total, pageSize, currentPage }); fox.loadingClose(); }, 1000); }, }); /** * @description: 自适应模板分页 * @param {*} * @return {*} * @Date: 2022-01-24 21:54:53 */ fox.pagination({ el: $('#adaptionPagination'), total: 13, currentPage: 5, type: 'special', isShowJump: true, isShowTotal: true, isShowSize: true, pageChange: function (res, callback) { // 获取页码相关数据,添加异步请求 const { total, pageSize, currentPage } = res; // 成功获取数据后,把相关参数回传 fox.loading({ text: '加载中...', background: 'rgba(255, 255, 255, 0.9)', }); // 摸拟异步获取数据 setTimeout(() => { callback({ total, pageSize, currentPage }); fox.loadingClose(); }, 1000); }, }); /** * @description: 更多行业 * @param {*} function * @return {*} * @Date: 2022-01-26 10:23:49 */ $('.operation-box .left button.more').click(function () { fox.dialog({ title: '请选择行业', content: _dialogMoreHtml(), width: '760px', border: true, }); }); /** * @description: 未找到行业 * @param {*} function * @return {*} * @Date: 2022-01-26 10:24:03 */ $('.operation-box .right .not-found-btn').click(function () { fox.dialog({ title: '末找到行业', content: _notFoundHtml(), cancelText: '取消', confirmText: '确定', buttonSize: 'small', buttonAlign: 'center', width: '626px', buttonWidth: '136px', border: true, confirm: function () { // 摸拟异步提交 let loadingEl = fox.loading({ el: 'body', text: '加载中...', background: 'rgba(255, 255, 255, 0.9)', }); setTimeout(() => { fox.loadingClose(loadingEl); fox.message({ message: '提交成功', type: 'success', }); }, 3000); }, cancel: function () {}, }); }); /** * @description: 更多行业 html * @param {*} * @return {*} * @Date: 2022-01-26 10:24:13 */ function _dialogMoreHtml() { return `