feat: 完善协议管理、师傅资质认证、分账配置并完成测试环境全量部署与同步

这个提交包含在:
2026-11-12 17:19:49 +08:00
父节点 fafddceaf2
当前提交 72cea8445f
共有 179 个文件被更改,包括 29242 次插入 和 3340 次删除

查看文件

@@ -23,7 +23,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
});
table.on('post-body.bs.table', function () {
$(".btn-editone, .btn-pricing", this).data("area", ["1040px", "88%"]);
$(".btn-editone, .btn-pricing, .btn-gallery-srv", this).data("area", ["1040px", "88%"]);
$(".btn-detail-srv", this).data("area", ["880px", "82%"]);
});
$(".btn-add, .btn-edit").data("area", ["1040px", "88%"]);
@@ -140,6 +140,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
icon: 'fa fa-sliders',
classname: 'btn btn-xs btn-warning btn-dialog btn-pricing',
url: 'service/edit?tab=services'
},
{
name: 'gallery',
text: '系统图库',
title: function (row) {
return '【' + row.name + '】系统图库管理';
},
icon: 'fa fa-picture-o',
classname: 'btn btn-xs btn-primary btn-dialog btn-gallery-srv',
url: function (row) {
return 'service/gallery/index?service_id=' + row.id + '&cat_id=' + row.cat_id;
}
}
],
formatter: Table.api.formatter.operate
@@ -276,6 +288,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
var html = '<tr>' +
'<td style="text-align: center; vertical-align: middle; color: #64748b; font-weight: 600;">' + seq + '</td>' +
'<td><input type="text" name="specs[' + specIndex + '][name]" class="form-control input-sm" placeholder="如:普通坐便器 / 智能马桶"></td>' +
'<td style="text-align: center; vertical-align: middle;">' +
'<div class="spec-img-cell" style="display:inline-flex;align-items:center;gap:6px;">' +
'<input type="hidden" name="specs[' + specIndex + '][image]" class="spec-img-input" value="">' +
'<img class="spec-img-preview" src="" style="width:34px;height:34px;border-radius:4px;object-fit:cover;border:1px solid #cbd5e1;display:none;" onclick="window.open(this.src)" title="点击查看大图">' +
'<button type="button" class="btn btn-xs btn-default btn-upload-spec-img"><i class="fa fa-upload"></i> 上传</button>' +
'<button type="button" class="btn btn-xs btn-link text-danger btn-clear-spec-img" style="padding:0 2px;display:none;" title="移除图片"><i class="fa fa-times"></i></button>' +
'<input type="file" class="spec-img-file" accept="image/*" style="display:none;">' +
'</div>' +
'</td>' +
'<td><div class="input-group input-group-sm"><span class="input-group-addon">¥</span><input type="number" step="0.01" name="specs[' + specIndex + '][base_price]" class="form-control input-sm" placeholder="留空则沿用商品默认价"></div></td>' +
'<td><input type="text" name="specs[' + specIndex + '][description]" class="form-control input-sm" placeholder="选填说明"></td>' +
'<td style="text-align:center; vertical-align: middle;"><button type="button" class="btn btn-xs btn-danger btn-del-spec"><i class="fa fa-trash-o"></i></button></td>' +
@@ -284,6 +305,59 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
Controller.api.refreshRowAndCounters(null);
});
$(document).off('click.srv', '.btn-upload-spec-img').on('click.srv', '.btn-upload-spec-img', function () {
$(this).closest('.spec-img-cell').find('.spec-img-file').trigger('click');
});
$(document).off('change.srv', '.spec-img-file').on('change.srv', '.spec-img-file', function () {
var file = this.files && this.files[0];
if (!file) return;
var $cell = $(this).closest('.spec-img-cell');
var $btn = $cell.find('.btn-upload-spec-img');
var fd = new FormData();
fd.append('file', file);
fd.append('category', 'service');
$btn.prop('disabled', true).html('<i class="fa fa-spinner fa-spin"></i>');
$.ajax({
url: Fast.api.fixurl('ajax/upload'),
type: 'POST',
data: fd,
processData: false,
contentType: false,
dataType: 'json',
success: function (res) {
if (res && res.code === 1 && res.data) {
var rawUrl = res.data.url || '';
var fullUrl = res.data.fullurl || rawUrl;
$cell.find('.spec-img-input').val(rawUrl);
$cell.find('.spec-img-preview').attr('src', fullUrl).show();
$cell.find('.btn-clear-spec-img').show();
$btn.html('<i class="fa fa-upload"></i> 更换');
Toastr.success('规格参考图已上传');
} else {
Toastr.error((res && res.msg) ? res.msg : '上传失败');
$btn.html('<i class="fa fa-upload"></i> 上传');
}
},
error: function () {
Toastr.error('上传请求异常');
$btn.html('<i class="fa fa-upload"></i> 上传');
},
complete: function () {
$btn.prop('disabled', false);
}
});
$(this).val('');
});
$(document).off('click.srv', '.btn-clear-spec-img').on('click.srv', '.btn-clear-spec-img', function () {
var $cell = $(this).closest('.spec-img-cell');
$cell.find('.spec-img-input').val('');
$cell.find('.spec-img-preview').attr('src', '').hide();
$cell.find('.btn-upload-spec-img').html('<i class="fa fa-upload"></i> 上传');
$(this).hide();
});
$(document).off('click.srv', '.btn-del-spec').on('click.srv', '.btn-del-spec', function () {
$(this).closest('tr').remove();
Controller.api.refreshRowAndCounters(null);