feat: 新增地址选择插件及订阅消息等多项功能优化
- 新增地址选择插件,支持地图位置选择并返回地址和经纬度 - 新增微信订阅消息发送功能,支持审核结果、提现通知等场景 - 新增订单支付状态查询、提现收款人姓名保存等接口 - 新增服务区域管理,支持按省市区划分并同步到信息发布 - 新增资金流水和营收报表导出功能 - 新增可用优惠券查询、订单退款拆分处理等功能 - 优化后台角标显示、首页数据统计、UI配置下发等 - 修复订单支付并发问题、地区管理逻辑等
6
public/assets/addons/address/js/gcoord.min.js
vendored
普通文件
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
jQuery autoComplete v1.0.7
|
||||
Copyright (c) 2014 Simon Steinberger / Pixabay
|
||||
GitHub: https://github.com/Pixabay/jQuery-autoComplete
|
||||
License: http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
$.fn.autoComplete = function (options) {
|
||||
var o = $.extend({}, $.fn.autoComplete.defaults, options);
|
||||
|
||||
// public methods
|
||||
if (typeof options == 'string') {
|
||||
this.each(function () {
|
||||
var that = $(this);
|
||||
if (options == 'destroy') {
|
||||
$(window).off('resize.autocomplete', that.updateSC);
|
||||
that.off('blur.autocomplete focus.autocomplete keydown.autocomplete keyup.autocomplete');
|
||||
if (that.data('autocomplete'))
|
||||
that.attr('autocomplete', that.data('autocomplete'));
|
||||
else
|
||||
that.removeAttr('autocomplete');
|
||||
$(that.data('sc')).remove();
|
||||
that.removeData('sc').removeData('autocomplete');
|
||||
}
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
return this.each(function () {
|
||||
var that = $(this);
|
||||
// sc = 'suggestions container'
|
||||
that.sc = $('<div class="autocomplete-suggestions ' + o.menuClass + '"></div>');
|
||||
that.data('sc', that.sc).data('autocomplete', that.attr('autocomplete'));
|
||||
that.attr('autocomplete', 'off');
|
||||
that.cache = {};
|
||||
that.last_val = '';
|
||||
|
||||
that.updateSC = function (resize, next) {
|
||||
that.sc.css({
|
||||
top: that.offset().top + that.outerHeight() - (that.sc.css("position") == "fixed" ? $(window).scrollTop() : 0),
|
||||
left: that.offset().left,
|
||||
width: that.outerWidth()
|
||||
});
|
||||
if (!resize) {
|
||||
that.sc.show();
|
||||
if (!that.sc.maxHeight) that.sc.maxHeight = parseInt(that.sc.css('max-height'));
|
||||
if (!that.sc.suggestionHeight) that.sc.suggestionHeight = $('.autocomplete-suggestion', that.sc).first().outerHeight();
|
||||
if (that.sc.suggestionHeight)
|
||||
if (!next) that.sc.scrollTop(0);
|
||||
else {
|
||||
var scrTop = that.sc.scrollTop(), selTop = next.offset().top - that.sc.offset().top;
|
||||
if (selTop + that.sc.suggestionHeight - that.sc.maxHeight > 0)
|
||||
that.sc.scrollTop(selTop + that.sc.suggestionHeight + scrTop - that.sc.maxHeight);
|
||||
else if (selTop < 0)
|
||||
that.sc.scrollTop(selTop + scrTop);
|
||||
}
|
||||
}
|
||||
}
|
||||
$(window).on('resize.autocomplete', that.updateSC);
|
||||
|
||||
that.sc.appendTo('body');
|
||||
|
||||
that.on('click', function () {
|
||||
if ($(this).val().length > 0 && that.sc.is(":hidden")) {
|
||||
setTimeout(function () {
|
||||
that.sc.show();
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
that.sc.on('mouseleave', '.autocomplete-suggestion', function () {
|
||||
$('.autocomplete-suggestion.selected').removeClass('selected');
|
||||
});
|
||||
|
||||
that.sc.on('mouseenter', '.autocomplete-suggestion', function () {
|
||||
$('.autocomplete-suggestion.selected').removeClass('selected');
|
||||
$(this).addClass('selected');
|
||||
});
|
||||
|
||||
that.sc.on('mousedown click', '.autocomplete-suggestion', function (e) {
|
||||
var item = $(this), v = item.data('val');
|
||||
if (v || item.hasClass('autocomplete-suggestion')) { // else outside click
|
||||
that.val(v);
|
||||
o.onSelect(e, v, item);
|
||||
that.sc.hide();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
that.on('blur.autocomplete', function () {
|
||||
try {
|
||||
over_sb = $('.autocomplete-suggestions:hover').length;
|
||||
} catch (e) {
|
||||
over_sb = 0;
|
||||
} // IE7 fix :hover
|
||||
if (!over_sb) {
|
||||
that.last_val = that.val();
|
||||
that.sc.hide();
|
||||
setTimeout(function () {
|
||||
that.sc.hide();
|
||||
}, 350); // hide suggestions on fast input
|
||||
} else if (!that.is(':focus')) setTimeout(function () {
|
||||
that.focus();
|
||||
}, 20);
|
||||
});
|
||||
|
||||
if (!o.minChars) that.on('focus.autocomplete', function () {
|
||||
that.last_val = '\n';
|
||||
that.trigger('keyup.autocomplete');
|
||||
});
|
||||
|
||||
function suggest(data) {
|
||||
var val = that.val();
|
||||
that.cache[val] = data;
|
||||
if (data.length && val.length >= o.minChars) {
|
||||
var s = '';
|
||||
if (data.length > 0) {
|
||||
s += typeof o.header === 'function' ? o.header.call(data, o, that) : o.header;
|
||||
for (var i = 0; i < data.length; i++) s += o.renderItem(data[i], val);
|
||||
s += typeof o.footer === 'function' ? o.footer.call(data, o, that) : o.footer;
|
||||
}
|
||||
that.sc.html(s);
|
||||
that.updateSC(0);
|
||||
} else
|
||||
that.sc.hide();
|
||||
}
|
||||
|
||||
that.on('keydown.autocomplete', function (e) {
|
||||
// down (40), up (38)
|
||||
if ((e.which == 40 || e.which == 38) && that.sc.html()) {
|
||||
var next, sel = $('.autocomplete-suggestion.selected', that.sc);
|
||||
if (!sel.length) {
|
||||
next = (e.which == 40) ? $('.autocomplete-suggestion', that.sc).first() : $('.autocomplete-suggestion', that.sc).last();
|
||||
that.val(next.addClass('selected').data('val'));
|
||||
} else {
|
||||
next = (e.which == 40) ? sel.next('.autocomplete-suggestion') : sel.prev('.autocomplete-suggestion');
|
||||
if (next.length) {
|
||||
sel.removeClass('selected');
|
||||
that.val(next.addClass('selected').data('val'));
|
||||
} else {
|
||||
sel.removeClass('selected');
|
||||
that.val(that.last_val);
|
||||
next = 0;
|
||||
}
|
||||
}
|
||||
that.updateSC(0, next);
|
||||
return false;
|
||||
}
|
||||
// esc
|
||||
else if (e.which == 27) that.val(that.last_val).sc.hide();
|
||||
// enter or tab
|
||||
else if (e.which == 13 || e.which == 9) {
|
||||
var sel = $('.autocomplete-suggestion.selected', that.sc);
|
||||
if (sel.length && that.sc.is(':visible')) {
|
||||
o.onSelect(e, sel.data('val'), sel);
|
||||
setTimeout(function () {
|
||||
that.sc.hide();
|
||||
}, 20);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
that.on('keyup.autocomplete', function (e) {
|
||||
if (!~$.inArray(e.which, [13, 27, 35, 36, 37, 38, 39, 40])) {
|
||||
var val = that.val();
|
||||
if (val.length >= o.minChars) {
|
||||
if (val != that.last_val) {
|
||||
that.last_val = val;
|
||||
clearTimeout(that.timer);
|
||||
if (o.cache) {
|
||||
if (val in that.cache) {
|
||||
suggest(that.cache[val]);
|
||||
return;
|
||||
}
|
||||
// no requests if previous suggestions were empty
|
||||
for (var i = 1; i < val.length - o.minChars; i++) {
|
||||
var part = val.slice(0, val.length - i);
|
||||
if (part in that.cache && !that.cache[part].length) {
|
||||
suggest([]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
that.timer = setTimeout(function () {
|
||||
o.source(val, suggest)
|
||||
}, o.delay);
|
||||
}
|
||||
} else {
|
||||
that.last_val = val;
|
||||
that.sc.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$.fn.autoComplete.defaults = {
|
||||
source: 0,
|
||||
minChars: 3,
|
||||
delay: 150,
|
||||
cache: 1,
|
||||
menuClass: '',
|
||||
header: '',
|
||||
footer: '',
|
||||
renderItem: function (item, search) {
|
||||
// escape special characters
|
||||
search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
||||
var re = new RegExp("(" + search.split(' ').join('|') + ")", "gi");
|
||||
return '<div class="autocomplete-suggestion" data-val="' + item + '">' + item.replace(re, "<b>$1</b>") + '</div>';
|
||||
},
|
||||
onSelect: function (e, term, item) {
|
||||
}
|
||||
};
|
||||
}(jQuery));
|
||||
@@ -161,3 +161,505 @@ body.inside-header .content {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* =========================================================
|
||||
业务总览(fc/dashboard)
|
||||
中性后台风格,作用域限定 .fc-dash
|
||||
========================================================= */
|
||||
.fc-dash {
|
||||
color: #232A38;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* ---------- 页头 ---------- */
|
||||
.fc-dash__head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
padding: 2px 2px 16px;
|
||||
}
|
||||
|
||||
.fc-dash__title {
|
||||
margin: 0;
|
||||
color: #232A38;
|
||||
font-size: 19px;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.fc-dash__desc {
|
||||
margin: 5px 0 0;
|
||||
color: #5F6B7A;
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.fc-dash__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
/* ---------- 通用按钮 ---------- */
|
||||
.fc-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
height: 34px;
|
||||
padding: 0 13px;
|
||||
border: 1px solid #DFE4EC;
|
||||
border-radius: 6px;
|
||||
background: #FFFFFF;
|
||||
color: #3C4453;
|
||||
font-size: 13px;
|
||||
line-height: 1;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
transition: background-color .15s ease, border-color .15s ease, color .15s ease;
|
||||
}
|
||||
|
||||
.fc-btn:hover,
|
||||
.fc-btn:focus {
|
||||
background: #F5F7FA;
|
||||
border-color: #C9D2DF;
|
||||
color: #232A38;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.fc-btn--primary {
|
||||
background: #444C69;
|
||||
border-color: #444C69;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.fc-btn--primary:hover,
|
||||
.fc-btn--primary:focus {
|
||||
background: #38405A;
|
||||
border-color: #38405A;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.fc-btn:focus-visible,
|
||||
.fc-kpi__link:focus-visible,
|
||||
.fc-seg__btn:focus-visible,
|
||||
.fc-detail__summary:focus-visible {
|
||||
outline: 2px solid #444C69;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.fc-btn__badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 18px;
|
||||
height: 18px;
|
||||
padding: 0 5px;
|
||||
border-radius: 9px;
|
||||
background: #FDECEC;
|
||||
color: #A82A2A;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* ---------- 今日指标 ---------- */
|
||||
.fc-kpi-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 14px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.fc-kpi {
|
||||
margin: 0;
|
||||
padding: 15px 16px 13px;
|
||||
border: 1px solid #E7EBF1;
|
||||
border-radius: 10px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0 1px 2px rgba(23, 35, 61, .04);
|
||||
}
|
||||
|
||||
.fc-kpi__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.fc-kpi__label {
|
||||
color: #6B7684;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.fc-kpi__icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 8px;
|
||||
background: #EEF1F7;
|
||||
color: #444C69;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.fc-kpi__icon--gold {
|
||||
background: #FBF3E3;
|
||||
color: #9A6A16;
|
||||
}
|
||||
|
||||
.fc-kpi__icon--red {
|
||||
background: #FDECEC;
|
||||
color: #A82A2A;
|
||||
}
|
||||
|
||||
.fc-kpi__icon--blue {
|
||||
background: #EDF4FD;
|
||||
color: #1D5F9E;
|
||||
}
|
||||
|
||||
.fc-kpi__value {
|
||||
margin: 8px 0 10px;
|
||||
color: #232A38;
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
line-height: 1.15;
|
||||
letter-spacing: -.3px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.fc-kpi__value--money {
|
||||
color: #9A6A16;
|
||||
}
|
||||
|
||||
.fc-kpi__foot {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
min-height: 20px;
|
||||
margin: 0;
|
||||
color: #6B7684;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.fc-kpi__link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
color: #444C69;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.fc-kpi__link:hover,
|
||||
.fc-kpi__link:focus {
|
||||
color: #2F3650;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.fc-trend {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
padding: 1px 7px;
|
||||
border-radius: 999px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.fc-trend--up {
|
||||
background: #EAF7F0;
|
||||
color: #1E7B4F;
|
||||
}
|
||||
|
||||
.fc-trend--down {
|
||||
background: #FDECEC;
|
||||
color: #A82A2A;
|
||||
}
|
||||
|
||||
.fc-trend--flat {
|
||||
background: #F4F5F7;
|
||||
color: #5C6670;
|
||||
}
|
||||
|
||||
/* ---------- 主体两栏 ---------- */
|
||||
.fc-dash__main {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr);
|
||||
gap: 14px;
|
||||
align-items: stretch;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.fc-card {
|
||||
margin: 0;
|
||||
border: 1px solid #E7EBF1;
|
||||
border-radius: 10px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0 1px 2px rgba(23, 35, 61, .04);
|
||||
}
|
||||
|
||||
.fc-card__head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
padding: 13px 16px;
|
||||
border-bottom: 1px solid #F0F3F7;
|
||||
}
|
||||
|
||||
.fc-card__head--sub {
|
||||
border-top: 1px solid #F0F3F7;
|
||||
border-bottom: none;
|
||||
padding-top: 12px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
.fc-card__title {
|
||||
margin: 0;
|
||||
color: #232A38;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.fc-card__desc {
|
||||
margin: 4px 0 0;
|
||||
color: #6B7684;
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* ---------- 趋势切换 ---------- */
|
||||
.fc-seg {
|
||||
display: inline-flex;
|
||||
gap: 2px;
|
||||
padding: 3px;
|
||||
border-radius: 7px;
|
||||
background: #F4F6F9;
|
||||
}
|
||||
|
||||
.fc-seg__btn {
|
||||
padding: 6px 12px;
|
||||
border: 0;
|
||||
border-radius: 5px;
|
||||
background: transparent;
|
||||
color: #5A6472;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
transition: background-color .15s ease, color .15s ease;
|
||||
}
|
||||
|
||||
.fc-seg__btn:hover {
|
||||
color: #232A38;
|
||||
}
|
||||
|
||||
.fc-seg__btn.is-active {
|
||||
background: #FFFFFF;
|
||||
color: #232A38;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 1px 2px rgba(23, 35, 61, .10);
|
||||
}
|
||||
|
||||
/* ---------- 图表 ---------- */
|
||||
.fc-chart {
|
||||
width: 100%;
|
||||
height: 292px;
|
||||
padding: 6px 8px 0;
|
||||
}
|
||||
|
||||
.fc-chart__total {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 8px;
|
||||
margin: 0;
|
||||
padding: 4px 16px 14px;
|
||||
color: #6B7684;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.fc-chart__total strong {
|
||||
color: #232A38;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* ---------- 累计数据 ---------- */
|
||||
.fc-stats {
|
||||
margin: 0;
|
||||
padding: 6px 16px 10px;
|
||||
}
|
||||
|
||||
.fc-stat {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: 9px 0;
|
||||
border-bottom: 1px dashed #EDF0F5;
|
||||
}
|
||||
|
||||
.fc-stat:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.fc-stat dt {
|
||||
color: #6B7684;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.fc-stat dd {
|
||||
margin: 0;
|
||||
color: #232A38;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.fc-stat dd.is-money {
|
||||
color: #9A6A16;
|
||||
}
|
||||
|
||||
.fc-stat dd.is-muted {
|
||||
color: #5A6472;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* ---------- 明细表 ---------- */
|
||||
.fc-detail {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fc-detail__summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 13px 16px;
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.fc-detail__summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fc-detail__hint {
|
||||
margin-left: auto;
|
||||
color: #6B7684;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.fc-detail__hint-close {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fc-detail[open] .fc-detail__hint-open {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fc-detail[open] .fc-detail__hint-close {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.fc-detail__chevron {
|
||||
color: #8A94A6;
|
||||
transition: transform .2s ease;
|
||||
}
|
||||
|
||||
.fc-detail[open] .fc-detail__chevron {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.fc-detail__body {
|
||||
padding: 4px 16px 10px;
|
||||
border-top: 1px solid #F0F3F7;
|
||||
}
|
||||
|
||||
.fc-table-wrap {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.fc-table {
|
||||
width: 100%;
|
||||
min-width: 480px;
|
||||
margin: 0;
|
||||
border-collapse: collapse;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.fc-table th,
|
||||
.fc-table td {
|
||||
padding: 9px 10px;
|
||||
border-bottom: 1px solid #F0F3F7;
|
||||
}
|
||||
|
||||
.fc-table thead th {
|
||||
background: #FAFBFC;
|
||||
color: #5F6B7A;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fc-table tbody tr:hover {
|
||||
background: #F8FAFC;
|
||||
}
|
||||
|
||||
.fc-table tbody tr:last-child td {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.fc-table .is-num {
|
||||
text-align: right;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* ---------- 响应式 ---------- */
|
||||
@media (max-width: 900px) {
|
||||
.fc-kpi-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.fc-dash__main {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.fc-dash__actions {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fc-chart {
|
||||
height: 240px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
.fc-kpi-grid {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.fc-dash *,
|
||||
.fc-dash *::before,
|
||||
.fc-dash *::after {
|
||||
transition: none !important;
|
||||
animation: none !important;
|
||||
}
|
||||
|
||||
.fc-detail__chevron {
|
||||
transition: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
/**
|
||||
* 后台 · 服务区域新增 / 编辑表单
|
||||
* 仅作用于 fc/area 的 add / edit 弹窗,不影响其他后台页面。
|
||||
*/
|
||||
|
||||
.fc-area-form {
|
||||
padding: 4px 6px 0;
|
||||
}
|
||||
|
||||
.fc-area-panel {
|
||||
margin-bottom: 18px;
|
||||
padding: 18px 20px;
|
||||
background: #ffffff;
|
||||
border: 1px solid #e6f2ec;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.fc-area-panel__head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.fc-area-panel__title {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: #04301e;
|
||||
}
|
||||
|
||||
.fc-area-panel__desc {
|
||||
font-size: 12px;
|
||||
color: #7f9b8f;
|
||||
}
|
||||
|
||||
.fc-area-field {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.fc-area-field > label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #2f5a46;
|
||||
}
|
||||
|
||||
.fc-area-field > label em {
|
||||
margin-left: 4px;
|
||||
font-style: normal;
|
||||
color: #f5a623;
|
||||
}
|
||||
|
||||
.fc-area-field .form-control {
|
||||
height: 40px;
|
||||
border-color: #d6f3e3;
|
||||
border-radius: 8px;
|
||||
box-shadow: none;
|
||||
color: #04291c;
|
||||
}
|
||||
|
||||
.fc-area-field .form-control:focus {
|
||||
border-color: #00e070;
|
||||
box-shadow: 0 0 0 3px rgba(0, 224, 112, 0.12);
|
||||
}
|
||||
|
||||
.fc-area-field .help-block {
|
||||
margin: 6px 0 0;
|
||||
font-size: 12px;
|
||||
color: #8fb3a3;
|
||||
}
|
||||
|
||||
.fc-area-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: 0 -8px;
|
||||
}
|
||||
|
||||
.fc-area-grid > .fc-area-field {
|
||||
width: 33.3333%;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.fc-area-preview {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-top: 14px;
|
||||
padding: 10px 14px;
|
||||
background: #f2fef7;
|
||||
border-radius: 8px;
|
||||
font-size: 13px;
|
||||
color: #3f6b57;
|
||||
}
|
||||
|
||||
.fc-area-preview strong {
|
||||
color: #04874a;
|
||||
}
|
||||
|
||||
.fc-area-coord-tip {
|
||||
margin-top: 12px;
|
||||
font-size: 12px;
|
||||
color: #8fb3a3;
|
||||
}
|
||||
|
||||
.fc-area-coord-tip.is-set {
|
||||
color: #04874a;
|
||||
}
|
||||
|
||||
.fc-area-coord-tip.is-missing {
|
||||
color: #c47b00;
|
||||
}
|
||||
|
||||
.fc-area-map-btn {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(135deg, #00e070, #04874a);
|
||||
color: #04301e;
|
||||
font-weight: 700;
|
||||
box-shadow: 0 4px 12px rgba(0, 224, 112, 0.2);
|
||||
}
|
||||
|
||||
.fc-area-map-btn:hover,
|
||||
.fc-area-map-btn:focus {
|
||||
color: #04301e;
|
||||
filter: brightness(0.98);
|
||||
}
|
||||
|
||||
.fc-area-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 4px 0 8px;
|
||||
}
|
||||
|
||||
.fc-area-actions .btn {
|
||||
min-width: 120px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.fc-area-grid > .fc-area-field {
|
||||
width: 100%;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.fc-area-panel {
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
.fc-area-panel__head {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.fc-area-panel__desc {
|
||||
display: block;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.fc-area-map-btn {
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,37 @@
|
||||
define([], function () {
|
||||
|
||||
require([], function () {
|
||||
//绑定data-toggle=addresspicker属性点击事件
|
||||
|
||||
$(document).on('click', "[data-toggle='addresspicker']", function () {
|
||||
var that = this;
|
||||
var callback = $(that).data('callback');
|
||||
var input_id = $(that).data("input-id") ? $(that).data("input-id") : "";
|
||||
var lat_id = $(that).data("lat-id") ? $(that).data("lat-id") : "";
|
||||
var lng_id = $(that).data("lng-id") ? $(that).data("lng-id") : "";
|
||||
var zoom_id = $(that).data("zoom-id") ? $(that).data("zoom-id") : "";
|
||||
var lat = lat_id ? $("#" + lat_id).val() : '';
|
||||
var lng = lng_id ? $("#" + lng_id).val() : '';
|
||||
var zoom = zoom_id ? $("#" + zoom_id).val() : '';
|
||||
var url = "/addons/address/index/select";
|
||||
url += (lat && lng) ? '?lat=' + lat + '&lng=' + lng + (input_id ? "&address=" + $("#" + input_id).val() : "") + (zoom ? "&zoom=" + zoom : "") : '';
|
||||
Fast.api.open(url, '位置选择', {
|
||||
callback: function (res) {
|
||||
input_id && $("#" + input_id).val(res.address).trigger("change");
|
||||
lat_id && $("#" + lat_id).val(res.lat).trigger("change");
|
||||
lng_id && $("#" + lng_id).val(res.lng).trigger("change");
|
||||
zoom_id && $("#" + zoom_id).val(res.zoom).trigger("change");
|
||||
|
||||
try {
|
||||
//执行回调函数
|
||||
if (typeof callback === 'function') {
|
||||
callback.call(that, res);
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'backend/format'], function ($, undefined, Backend, Table, Form, Template, Format) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -21,10 +21,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'backend/
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
sortName: '',
|
||||
escape: true,
|
||||
queryParams: function (params) {
|
||||
params.rule_filter = $('#rule-filter').val() || 'menu';
|
||||
params.rule_status = $('#rule-status').val() || '';
|
||||
params.rule_keyword = $.trim($('#rule-keyword').val() || '');
|
||||
return params;
|
||||
},
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true,},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'seq', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial'},
|
||||
{field: 'title', title: __('Title'), align: 'left', formatter: Controller.api.formatter.title, clickToSelect: !false},
|
||||
{field: 'icon', title: __('Icon'), formatter: Controller.api.formatter.icon},
|
||||
{field: 'name', title: __('Name'), align: 'left', formatter: Controller.api.formatter.name},
|
||||
@@ -35,13 +41,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'backend/
|
||||
title: __('Ismenu'),
|
||||
align: 'center',
|
||||
table: table,
|
||||
formatter: Table.api.formatter.toggle
|
||||
formatter: function (value, row, index) {
|
||||
// 权限节点不参与菜单显示,避免误把 View/Add 节点挂到左侧菜单
|
||||
if (!row.ismenu && !row.haschild) {
|
||||
return '<span class="text-muted" title="权限节点不显示在左侧菜单">—</span>';
|
||||
}
|
||||
return Table.api.formatter.toggle.call(this, value, row, index);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'operate',
|
||||
title: __('Operate'),
|
||||
table: table,
|
||||
events: Table.api.events.operate,
|
||||
events: Controller.api.events.operate(table),
|
||||
formatter: Table.api.formatter.operate
|
||||
}
|
||||
]
|
||||
@@ -49,14 +61,75 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'backend/
|
||||
pagination: false,
|
||||
search: false,
|
||||
commonSearch: false,
|
||||
onLoadSuccess: function (data) {
|
||||
var total = data && typeof data.total !== 'undefined' ? data.total : 0;
|
||||
var label = total ? '共 ' + total + ' 条' : '';
|
||||
if (($('#rule-filter').val() || 'menu') === 'node') {
|
||||
label += '(含父级)';
|
||||
}
|
||||
$('#rule-count').text(label);
|
||||
var filtering = ($('#rule-filter').val() || 'menu') !== 'menu'
|
||||
|| $.trim($('#rule-keyword').val() || '') !== '';
|
||||
if (filtering) {
|
||||
// 筛选结果直接展开,避免命中的权限节点被折叠隐藏
|
||||
$('#table tbody tr').show();
|
||||
$('.btn-toggle-all i').removeClass('fa-plus').addClass('fa-minus');
|
||||
$('.btn-node-sub').data('shown', true);
|
||||
$('.btn-node-sub > i').removeClass('fa-caret-right').addClass('fa-caret-down');
|
||||
} else {
|
||||
// 回到默认菜单视图时同步收起状态
|
||||
$('.btn-toggle-all i').removeClass('fa-minus').addClass('fa-plus');
|
||||
$('.btn-node-sub').data('shown', false);
|
||||
$('.btn-node-sub > i').removeClass('fa-caret-down').addClass('fa-caret-right');
|
||||
}
|
||||
},
|
||||
rowAttributes: function (row, index) {
|
||||
return row.pid == 0 ? {} : {style: "display:none"};
|
||||
}
|
||||
});
|
||||
|
||||
// 级联删除二次确认:菜单下还有子级时提示会一并删除
|
||||
table.on('click', 'tbody [data-id].btn-del', function (e) {
|
||||
var row = Table.api.getrowbyid(table, $(this).data('id'));
|
||||
if (!row || row.haschild != 1) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
var element = this;
|
||||
Layer.confirm('该菜单下还有子菜单或权限节点,删除会一并删除且不可恢复,确认继续?',
|
||||
{icon: 3, title: '级联删除确认', shadeClose: true, btn: ['确认删除', '取消']},
|
||||
function (index) {
|
||||
$(element).data('success', function () {
|
||||
Fast.api.refreshmenu();
|
||||
});
|
||||
Table.api.multi('del', row.id, table, element);
|
||||
Layer.close(index);
|
||||
});
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
|
||||
// 筛选
|
||||
var refreshTable = function () {
|
||||
table.bootstrapTable('refresh', {pageNumber: 1});
|
||||
};
|
||||
$('#rule-search').on('click', refreshTable);
|
||||
$('#rule-keyword').on('keydown', function (e) {
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
refreshTable();
|
||||
}
|
||||
});
|
||||
$('#rule-filter, #rule-status').on('change', refreshTable);
|
||||
$('#rule-reset').on('click', function () {
|
||||
$('#rule-keyword').val('');
|
||||
$('#rule-filter').val('menu');
|
||||
$('#rule-status').val('normal');
|
||||
refreshTable();
|
||||
});
|
||||
|
||||
var btnSuccessEvent = function (data, ret) {
|
||||
if ($(this).hasClass("btn-change")) {
|
||||
var index = $(this).data("index");
|
||||
@@ -150,6 +223,49 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'backend/
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
events: {
|
||||
/**
|
||||
* 行内操作事件:父级菜单删除前提示会级联删除子级
|
||||
*
|
||||
* @param {jQuery} table
|
||||
* @returns {object}
|
||||
*/
|
||||
operate: function (table) {
|
||||
var base = Table.api.events.operate;
|
||||
return $.extend({}, base, {
|
||||
'click .btn-delone': function (e, value, row, index) {
|
||||
if (!row || row.haschild != 1) {
|
||||
return base['click .btn-delone'].call(this, e, value, row, index);
|
||||
}
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
var that = this;
|
||||
var options = table.bootstrapTable('getOptions');
|
||||
var top = $(that).offset().top - $(window).scrollTop();
|
||||
var left = $(that).offset().left - $(window).scrollLeft() - 260;
|
||||
if (top + 154 > $(window).height()) {
|
||||
top = top - 154;
|
||||
}
|
||||
if ($(window).width() < 480) {
|
||||
top = left = undefined;
|
||||
}
|
||||
Layer.confirm('该菜单下还有子菜单或权限节点,删除会一并删除且不可恢复,确认继续?',
|
||||
{icon: 3, title: '级联删除确认', offset: [top, left], shadeClose: true, btn: ['确认删除', '取消']},
|
||||
function (idx) {
|
||||
var prev = $(that).data('success');
|
||||
$(that).data('success', function (data, ret) {
|
||||
Fast.api.refreshmenu();
|
||||
if (typeof prev === 'function') {
|
||||
return prev.call(that, data, ret);
|
||||
}
|
||||
});
|
||||
Table.api.multi('del', row[options.pk], table, that);
|
||||
Layer.close(idx);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
formatter: {
|
||||
title: function (value, row, index) {
|
||||
value = value.toString().replace(/(&|&)nbsp;/g, ' ');
|
||||
|
||||
@@ -26,15 +26,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'province', title: __('Province'), operate: 'LIKE'},
|
||||
{field: 'city', title: __('City'), operate: 'LIKE'},
|
||||
{field: 'district', title: __('District'), operate: 'LIKE'},
|
||||
{field: 'full_name', title: __('FullName'), operate: false, sortable: false},
|
||||
{
|
||||
field: 'enabled', title: __('Enabled'),
|
||||
searchList: {0: '否', 1: '是'},
|
||||
formatter: Format.statusFormatter({0: '否', 1: '是'}, {0: 'default', 1: 'success'})
|
||||
},
|
||||
{field: 'sort', title: __('Sort')},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime, visible: false},
|
||||
{field: 'sort', title: __('Sort'), width: '80px'},
|
||||
{field: 'lat', title: __('Lat'), operate: false, visible: false},
|
||||
{field: 'lng', title: __('Lng'), operate: false, visible: false},
|
||||
{field: 'createtime', title: __('Createtime'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime, visible: false},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
@@ -45,13 +50,126 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
Controller.api.bindAreaOptions();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
Controller.api.bindAreaOptions();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
},
|
||||
/**
|
||||
* 省 / 市 / 区县级联下拉:
|
||||
* - 省份从已有服务区域中取 distinct;
|
||||
* - 城市按当前省份过滤;
|
||||
* - 区县按当前省份 + 城市过滤;
|
||||
* - 可直接输入新省份 / 城市 / 区县(datalist 只做候选提示)。
|
||||
*/
|
||||
bindAreaOptions: function () {
|
||||
var $raw = $('#area-options');
|
||||
var $province = $('#c-province');
|
||||
var $city = $('#c-city');
|
||||
var $district = $('#c-district');
|
||||
if (!$raw.length || !$province.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var rows = [];
|
||||
try {
|
||||
rows = JSON.parse($raw.val() || '[]');
|
||||
} catch (e) {
|
||||
rows = [];
|
||||
}
|
||||
if (!$.isArray(rows)) {
|
||||
rows = [];
|
||||
}
|
||||
|
||||
var unique = function (values) {
|
||||
var seen = {};
|
||||
var out = [];
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
var value = String(values[i] || '').trim();
|
||||
if (value && !seen[value]) {
|
||||
seen[value] = true;
|
||||
out.push(value);
|
||||
}
|
||||
}
|
||||
return out;
|
||||
};
|
||||
|
||||
var fill = function (selector, values) {
|
||||
var $list = $(selector);
|
||||
$list.empty();
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
$('<option>').attr('value', values[i]).appendTo($list);
|
||||
}
|
||||
};
|
||||
|
||||
var provinces = function () {
|
||||
return unique(rows.map(function (row) { return row.province; }));
|
||||
};
|
||||
var cities = function (province) {
|
||||
return unique(rows.filter(function (row) {
|
||||
return row.province === province;
|
||||
}).map(function (row) { return row.city; }));
|
||||
};
|
||||
var districts = function (province, city) {
|
||||
return unique(rows.filter(function (row) {
|
||||
return row.province === province && row.city === city;
|
||||
}).map(function (row) { return row.district; }));
|
||||
};
|
||||
|
||||
var refreshCities = function () {
|
||||
fill('#city-options', cities(String($province.val() || '').trim()));
|
||||
};
|
||||
var refreshDistricts = function () {
|
||||
fill('#district-options', districts(
|
||||
String($province.val() || '').trim(),
|
||||
String($city.val() || '').trim()
|
||||
));
|
||||
};
|
||||
|
||||
fill('#province-options', provinces());
|
||||
refreshCities();
|
||||
refreshDistricts();
|
||||
|
||||
// 完整区域实时预览
|
||||
var refreshPreview = function () {
|
||||
var parts = [
|
||||
String($province.val() || '').trim(),
|
||||
String($city.val() || '').trim(),
|
||||
String($district.val() || '').trim()
|
||||
].filter(function (item) { return item !== ''; });
|
||||
$('#area-full-name').text(parts.length ? parts.join(' / ') : '未选择');
|
||||
};
|
||||
|
||||
// 中心坐标状态提示
|
||||
var refreshCoordTip = function () {
|
||||
var lat = String($('#c-lat').val() || '').trim();
|
||||
var lng = String($('#c-lng').val() || '').trim();
|
||||
var $tip = $('#area-coord-tip');
|
||||
if (lat && lng && isFinite(lat) && isFinite(lng)) {
|
||||
$tip.removeClass('is-missing').addClass('is-set')
|
||||
.text('已设置中心坐标:' + lat + ', ' + lng + '(用户端将按此坐标匹配)');
|
||||
} else {
|
||||
$tip.removeClass('is-set').addClass('is-missing')
|
||||
.text('未设置坐标:点击「地图选点」后自动填充,用户端才能按定位匹配');
|
||||
}
|
||||
};
|
||||
|
||||
refreshPreview();
|
||||
refreshCoordTip();
|
||||
|
||||
$province.add($city).add($district).on('input change', refreshPreview);
|
||||
$('#c-lat, #c-lng').on('input change', refreshCoordTip);
|
||||
|
||||
$province.on('input change', function () {
|
||||
refreshCities();
|
||||
refreshDistricts();
|
||||
});
|
||||
$city.on('input change', refreshDistricts);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,63 +3,162 @@ define(['jquery', 'bootstrap', 'backend', 'echarts', 'echarts-theme'], function
|
||||
var Controller = {
|
||||
index: function () {
|
||||
var trend = (typeof Config !== 'undefined' && Config.trend) ? Config.trend : null;
|
||||
// 没有趋势数据(或 echarts 未加载)时静默降级:页面下方的明细表格已展示同样数据
|
||||
|
||||
// 刷新当前看板
|
||||
$(document).on('click', '.fc-dash__refresh', function () {
|
||||
$(this).find('.fa').addClass('fa-spin');
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
// 没有趋势数据(或 echarts 未加载)时静默降级:下方明细表已展示同样数据
|
||||
if (!trend || !trend.dates || !trend.dates.length || !Echarts) {
|
||||
return;
|
||||
}
|
||||
|
||||
var charts = [];
|
||||
var dates = $.map(trend.dates, function (day) {
|
||||
return day.slice(5); // 2026-10-09 => 10-09
|
||||
});
|
||||
|
||||
// 绘制单条折线图
|
||||
var drawLine = function (id, title, data, color, money) {
|
||||
var dom = document.getElementById(id);
|
||||
if (!dom) {
|
||||
return;
|
||||
var total = function (list) {
|
||||
var sum = 0;
|
||||
$.each(list || [], function (i, n) {
|
||||
sum += Number(n) || 0;
|
||||
});
|
||||
return sum;
|
||||
};
|
||||
|
||||
var formatNum = function (n) {
|
||||
var value = Number(n) || 0;
|
||||
var options = value % 1 === 0 ? {} : {minimumFractionDigits: 2, maximumFractionDigits: 2};
|
||||
try {
|
||||
return value.toLocaleString('zh-CN', options);
|
||||
} catch (e) {
|
||||
return value.toFixed(value % 1 === 0 ? 0 : 2);
|
||||
}
|
||||
var chart = Echarts.init(dom, 'walden');
|
||||
chart.setOption({
|
||||
color: [color],
|
||||
title: {
|
||||
text: title,
|
||||
left: 'center',
|
||||
textStyle: {fontSize: 14}
|
||||
},
|
||||
};
|
||||
|
||||
var METRICS = {
|
||||
posts: {
|
||||
label: __('发布量'),
|
||||
color: '#44507A',
|
||||
fill: 'rgba(68, 80, 122, .18)',
|
||||
axis: '{value}',
|
||||
money: false,
|
||||
data: trend.posts || []
|
||||
},
|
||||
orders: {
|
||||
label: __('订单额'),
|
||||
color: '#B7793A',
|
||||
fill: 'rgba(183, 121, 58, .18)',
|
||||
axis: '¥{value}',
|
||||
money: true,
|
||||
data: trend.orders || []
|
||||
},
|
||||
members: {
|
||||
label: __('新增注册用户'),
|
||||
color: '#2E8A66',
|
||||
fill: 'rgba(46, 138, 102, .16)',
|
||||
axis: '{value}',
|
||||
money: false,
|
||||
data: trend.members || []
|
||||
}
|
||||
};
|
||||
|
||||
var reduceMotion = !!(window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
|
||||
var $chart = $('#fc-trend-chart');
|
||||
var chart = null;
|
||||
|
||||
var buildOption = function (metric) {
|
||||
return {
|
||||
color: [metric.color],
|
||||
grid: {left: 6, right: 16, top: 18, bottom: 4, containLabel: true},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
backgroundColor: '#FFFFFF',
|
||||
borderColor: '#E7EBF1',
|
||||
borderWidth: 1,
|
||||
padding: [8, 12],
|
||||
textStyle: {color: '#232A38', fontSize: 12},
|
||||
extraCssText: 'border-radius:8px;box-shadow:0 6px 18px rgba(23,35,61,.10);',
|
||||
axisPointer: {type: 'line', lineStyle: {color: '#C9D2DF', type: 'dashed'}},
|
||||
formatter: function (params) {
|
||||
var item = params[0];
|
||||
return item.axisValue + '<br/>' + title + ':' + (money ? '¥' : '') + item.data;
|
||||
var prefix = metric.money ? '¥' : '';
|
||||
var dot = '<span style="display:inline-block;width:7px;height:7px;border-radius:50%;'
|
||||
+ 'background:' + metric.color + ';margin-right:6px;"></span>';
|
||||
return item.axisValue + '<br/>' + dot + metric.label + ':<b>'
|
||||
+ prefix + formatNum(item.data) + '</b>';
|
||||
}
|
||||
},
|
||||
grid: {left: 50, top: 60, right: 20, bottom: 55},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: trend.dates,
|
||||
axisLabel: {rotate: 45, fontSize: 10}
|
||||
data: dates,
|
||||
axisLine: {lineStyle: {color: '#E7EBF1'}},
|
||||
axisTick: {show: false},
|
||||
axisLabel: {color: '#6B7684', fontSize: 11, margin: 10}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
minInterval: metric.money ? 0 : 1,
|
||||
axisLine: {show: false},
|
||||
axisTick: {show: false},
|
||||
axisLabel: {color: '#6B7684', fontSize: 11, formatter: metric.axis},
|
||||
splitLine: {lineStyle: {color: '#EFF2F6', type: 'dashed'}}
|
||||
},
|
||||
yAxis: {type: 'value', minInterval: 1},
|
||||
series: [{
|
||||
name: title,
|
||||
name: metric.label,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
areaStyle: {normal: {}},
|
||||
lineStyle: {normal: {width: 1.5}},
|
||||
data: data
|
||||
}]
|
||||
});
|
||||
charts.push(chart);
|
||||
symbol: 'circle',
|
||||
symbolSize: 6,
|
||||
showSymbol: false,
|
||||
lineStyle: {width: 2},
|
||||
itemStyle: {color: metric.color, borderColor: '#FFFFFF', borderWidth: 2},
|
||||
emphasis: {focus: 'series'},
|
||||
areaStyle: {
|
||||
color: new Echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{offset: 0, color: metric.fill},
|
||||
{offset: 1, color: 'rgba(255, 255, 255, 0)'}
|
||||
])
|
||||
},
|
||||
data: metric.data
|
||||
}],
|
||||
animation: !reduceMotion,
|
||||
animationDuration: 500
|
||||
};
|
||||
};
|
||||
|
||||
drawLine('chart-posts', __('发布量'), trend.posts, '#00c0ef', false);
|
||||
drawLine('chart-orders', __('订单额(元)'), trend.orders, '#f39c12', true);
|
||||
drawLine('chart-members', __('新增注册用户'), trend.members, '#00a65a', false);
|
||||
var applyMetric = function (key) {
|
||||
var metric = METRICS[key];
|
||||
|
||||
$(window).on('resize', function () {
|
||||
$.each(charts, function (i, chart) {
|
||||
$('.fc-seg__btn')
|
||||
.removeClass('is-active')
|
||||
.attr('aria-pressed', 'false')
|
||||
.filter('[data-metric="' + key + '"]')
|
||||
.addClass('is-active')
|
||||
.attr('aria-pressed', 'true');
|
||||
|
||||
$chart.attr('aria-label', __('近 14 天') + metric.label + __('趋势图'));
|
||||
$('#fc-trend-total').text((metric.money ? '¥' : '') + formatNum(total(metric.data)));
|
||||
|
||||
if (chart) {
|
||||
chart.setOption(buildOption(metric), true);
|
||||
}
|
||||
};
|
||||
|
||||
if ($chart.length) {
|
||||
chart = Echarts.init($chart[0], 'walden');
|
||||
applyMetric('posts');
|
||||
|
||||
$(window).on('resize', function () {
|
||||
chart.resize();
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.fc-seg__btn', function () {
|
||||
applyMetric($(this).data('metric'));
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -60,6 +60,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
|
||||
// 导出资金流水(沿用当前 URL 上的 type 过滤)
|
||||
$(document).on('click', '.btn-export-flow', function () {
|
||||
var type = Fast.api.query('type') || '';
|
||||
window.open(Fast.api.fixurl('fc/financeflow/export?type=' + encodeURIComponent(type)));
|
||||
});
|
||||
|
||||
// 导出营收报表(按日/月/年)
|
||||
$(document).on('click', '.btn-export-report', function () {
|
||||
var period = $('#report-period').val() || 'month';
|
||||
window.open(Fast.api.fixurl('fc/financeflow/exportReport?period=' + encodeURIComponent(period)));
|
||||
});
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
|
||||
@@ -74,20 +74,35 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
title: '余额充值',
|
||||
classname: 'btn btn-xs btn-warning btn-click',
|
||||
click: function (options, row) {
|
||||
Layer.prompt({title: '请输入充值金额(元)', formType: 0}, function (value, index) {
|
||||
var nickname = row.nickname || ('用户#' + row.user_id);
|
||||
var balance = parseFloat(row.money || 0).toFixed(2);
|
||||
Layer.prompt({
|
||||
title: '给「' + nickname + '」充值(当前余额 ¥' + balance + ')',
|
||||
formType: 0
|
||||
}, function (value, index) {
|
||||
var amount = parseFloat(value);
|
||||
if (!(amount > 0)) {
|
||||
Layer.msg('充值金额需大于 0');
|
||||
Layer.msg('请输入大于 0 的金额', {icon: 2});
|
||||
return;
|
||||
}
|
||||
if (amount > 100000) {
|
||||
Layer.msg('单次充值不能超过 100000 元', {icon: 2});
|
||||
return;
|
||||
}
|
||||
// 注意:本表主键 id 是扩展表记录ID,余额存在 fa_user.money,必须传 user_id
|
||||
Fast.api.ajax({
|
||||
url: 'fc/userext/recharge',
|
||||
data: {ids: row.id, amount: amount}
|
||||
}, function () {
|
||||
data: {ids: row.user_id, amount: amount}
|
||||
}, function (data, ret) {
|
||||
Layer.close(index);
|
||||
Toastr.success(ret.msg || '充值成功');
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
}, function (data, ret) {
|
||||
Layer.close(index);
|
||||
Toastr.error(ret.msg || '充值失败');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,9 +48,25 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
},
|
||||
{
|
||||
field: 'status', title: __('Status'),
|
||||
searchList: {auditing: __('待审核'), paid: __('已打款'), rejected: __('已驳回')},
|
||||
formatter: Format.statusFormatter({auditing: __('待审核'), paid: __('已打款'), rejected: __('已驳回')}, {auditing: 'warning', paid: 'success', rejected: 'danger'})
|
||||
searchList: {auditing: __('待审核'), paying: __('转账中'), paid: __('已到账'), failed: __('转账失败'), rejected: __('已驳回')},
|
||||
formatter: Format.statusFormatter({auditing: __('待审核'), paying: __('转账中'), paid: __('已到账'), failed: __('转账失败'), rejected: __('已驳回')}, {auditing: 'warning', paying: 'info', paid: 'success', failed: 'danger', rejected: 'danger'})
|
||||
},
|
||||
{
|
||||
field: 'transfer_status', title: '转账状态', operate: false,
|
||||
formatter: function (value) {
|
||||
var m = {
|
||||
WAIT_USER_CONFIRM: '待用户确认',
|
||||
ACCEPTED: '已受理',
|
||||
PROCESSING: '转账中',
|
||||
SUCCESS: '成功',
|
||||
FAIL: '失败',
|
||||
CANCELLED: '已撤销',
|
||||
AMOUNT_MISMATCH: '金额异常'
|
||||
};
|
||||
return value && m[value] ? m[value] : (value || '-');
|
||||
}
|
||||
},
|
||||
{field: 'fail_reason', title: '失败原因', operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'reason', title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
|
||||
10
public/static/posts/README.md
普通文件
@@ -0,0 +1,10 @@
|
||||
# 演示信息配图
|
||||
|
||||
本目录图片仅用于小程序/后台的演示信息数据,由 `php think fc:seed-posts` 写入 `fc_post.cover` 与 `fc_post.media`。
|
||||
|
||||
- 来源:Unsplash(https://unsplash.com),遵循 Unsplash License,可免费用于商业与非商业项目。
|
||||
- 规格:统一裁切为 900 × 700,单张小于 1 MB。
|
||||
- 命名:按信息内容命名,例如 `job-warehouse.jpg`(仓库分拣)、`house-living1.jpg`(房源客厅)。
|
||||
- 替换:直接覆盖同名文件即可,无需修改数据库;重新执行种子命令会沿用这些路径。
|
||||
|
||||
当前共 57 张,覆盖招聘、房产、二手、车辆、本地服务、教育培训、家政保洁、同城交友 8 个分类。
|
||||
|
之后 宽度: | 高度: | 大小: 170 KiB |
|
之后 宽度: | 高度: | 大小: 138 KiB |
|
之后 宽度: | 高度: | 大小: 138 KiB |
二进制
public/static/posts/car-moto.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 80 KiB |
|
之后 宽度: | 高度: | 大小: 703 KiB |
|
之后 宽度: | 高度: | 大小: 93 KiB |
|
之后 宽度: | 高度: | 大小: 125 KiB |
二进制
public/static/posts/clean-baby.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 64 KiB |
二进制
public/static/posts/clean-bath.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 93 KiB |
二进制
public/static/posts/clean-elder.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 166 KiB |
|
之后 宽度: | 高度: | 大小: 88 KiB |
二进制
public/static/posts/clean-vacuum.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 175 KiB |
二进制
public/static/posts/clean-window.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 74 KiB |
二进制
public/static/posts/edu-art.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 271 KiB |
二进制
public/static/posts/edu-books.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 54 KiB |
二进制
public/static/posts/edu-class.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 102 KiB |
二进制
public/static/posts/edu-guitar.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 48 KiB |
二进制
public/static/posts/edu-laptop.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 84 KiB |
二进制
public/static/posts/edu-shelf.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 68 KiB |
|
之后 宽度: | 高度: | 大小: 70 KiB |
二进制
public/static/posts/friend-bike.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 119 KiB |
二进制
public/static/posts/friend-board.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 65 KiB |
二进制
public/static/posts/friend-books.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 95 KiB |
|
之后 宽度: | 高度: | 大小: 38 KiB |
二进制
public/static/posts/friend-group.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 97 KiB |
二进制
public/static/posts/friend-hike.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 202 KiB |
二进制
public/static/posts/friend-run.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 204 KiB |
二进制
public/static/posts/goods-bike.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 119 KiB |
二进制
public/static/posts/goods-desk.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 110 KiB |
二进制
public/static/posts/goods-dining.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 116 KiB |
二进制
public/static/posts/goods-fridge.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 101 KiB |
二进制
public/static/posts/goods-ipad.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 107 KiB |
二进制
public/static/posts/goods-laptop.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 63 KiB |
|
之后 宽度: | 高度: | 大小: 173 KiB |
|
之后 宽度: | 高度: | 大小: 123 KiB |
|
之后 宽度: | 高度: | 大小: 118 KiB |
|
之后 宽度: | 高度: | 大小: 93 KiB |
|
之后 宽度: | 高度: | 大小: 118 KiB |
|
之后 宽度: | 高度: | 大小: 97 KiB |
|
之后 宽度: | 高度: | 大小: 92 KiB |
二进制
public/static/posts/house-model.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 65 KiB |
二进制
public/static/posts/house-office.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 122 KiB |
二进制
public/static/posts/job-cafe.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 160 KiB |
|
之后 宽度: | 高度: | 大小: 102 KiB |
二进制
public/static/posts/job-cleaning.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 74 KiB |
二进制
public/static/posts/job-delivery.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 130 KiB |
|
之后 宽度: | 高度: | 大小: 77 KiB |
二进制
public/static/posts/job-office.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 98 KiB |
|
之后 宽度: | 高度: | 大小: 192 KiB |
二进制
public/static/posts/svc-camera.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 38 KiB |
二进制
public/static/posts/svc-code.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 88 KiB |
二进制
public/static/posts/svc-drill.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 184 KiB |
二进制
public/static/posts/svc-keys.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 65 KiB |
二进制
public/static/posts/svc-moving.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 97 KiB |
二进制
public/static/posts/svc-night.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 65 KiB |
二进制
public/static/posts/svc-spray.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 29 KiB |
二进制
public/static/posts/svc-wrench.jpg
普通文件
|
之后 宽度: | 高度: | 大小: 84 KiB |