Initial commit: 小众厨房项目代码

Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
可乐加冰
2026-09-23 17:04:10 +08:00
当前提交 f7d3d7d1bd
共有 1761 个文件被更改,包括 453668 次插入 和 0 次删除

查看文件

@@ -0,0 +1,4 @@
<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'>
Order allow,deny
Deny from all
</FilesMatch>

查看文件

@@ -0,0 +1,387 @@
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
function debounce(handle, delay) {
let time = null;
return function () {
let self = this,
arg = arguments;
clearTimeout(time);
time = setTimeout(function () {
handle.apply(self, arg);
}, delay)
}
}
var aftersaleIndex = new Vue({
el: "#aftersaleIndex",
data() {
return {
statusType: 'all',
searchKey: '',
pageData: [],
//分页
currentPage: 1,
totalPage: 0,
offset: 0,
limit: 10,
}
},
mounted() {
this.getData();
},
methods: {
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
if (rowIndex >= 0) {
if (columnIndex === 0) {
return [, 0];
} else if (columnIndex === 1) {
return [1, 4];
}
}
},
getData() {
var that = this;
Fast.api.ajax({
url: 'shopro/order/aftersale/index',
loading: true,
type: 'GET',
data: {
sort: 'id',
order: 'desc',
search: that.searchKey,
offset: that.offset,
limit: that.limit,
status: that.statusType,
}
}, function (ret, res) {
that.pageData = res.data.rows;
that.totalPage = res.data.total;
return false;
})
},
//分页(更换页面显示条数)
pageSizeChange(val) {
this.offset = 0
this.limit = val
this.getData()
},
//当前是第几页
pageCurrentChange(val) {
this.offset = (val - 1) * this.limit
this.getData()
},
viewDetail(id) {
Fast.api.open('shopro/order/aftersale/detail?id=' + id, "售后详情");
},
colorFilters(type) {
let color = ""
switch (type) {
case -2:
color = '#999'
break;
case -1:
color = '#FF5959'
break;
case 0:
color = '#444'
break;
case 1:
color = '#F8A92B'
break;
case 2:
color = '#7438D5'
break;
}
return color;
},
debounceFilter: debounce(function () {
this.getData()
}, 1000),
},
watch: {
searchKey(newval, val) {
if (newval != val) {
this.limit = 10;
this.offset = 0;
this.debounceFilter()
}
},
statusType(newval, val) {
if (newval != val) {
this.limit = 10;
this.offset = 0;
this.getData()
}
},
}
})
},
recyclebin: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
'dragsort_url': ''
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: 'shopro/order/order/recyclebin' + location.search,
pk: 'type',
sortName: 'type',
columns: [
[{
checkbox: true
},
{
field: 'type',
title: __('type')
},
{
field: 'deletetime',
title: __('Deletetime'),
operate: 'RANGE',
addclass: 'datetimerange',
formatter: Table.api.formatter.datetime
},
{
field: 'operate',
wtypeth: '130px',
title: __('Operate'),
table: table,
events: Table.api.events.operate,
buttons: [{
name: 'Restore',
text: __('Restore'),
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
icon: 'fa fa-rotate-left',
url: 'shopro/order/order/restore',
refresh: true
},
{
name: 'Destroy',
text: __('Destroy'),
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
icon: 'fa fa-times',
url: 'shopro/order/order/destroy',
refresh: true
}
],
formatter: Table.api.formatter.operate
}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
detail: function () {
var vue = new Vue({
el: "#aftersaleDetail",
data() {
return {
detailId: window.location.search.replace("?", '').split("&")[0].split('=')[1],
detailData: {},
detailLogs: [],
orderData: [],
orderItem: [],
stepActive: 1,
refundDialog: false,
refundType: 'agree',
refundMoney: '',
refuseReason: '',
replyMsg: '',
replyImages: [],
dialogName: '',
dialoglist: {
"agree-refund": '同意退款',
"reject-refund": '拒绝申请',
"reply-msg": '回复买家'
}
}
},
mounted() {
this.getDetail();
},
methods: {
getDetail() {
let that = this;
Fast.api.ajax({
url: `shopro/order/aftersale/detail/id/${that.detailId}`,
loading: true,
type: "GET",
}, function (ret, res) {
that.detailData = res.data.detail;
that.detailLogs = res.data.logs;
that.orderData = res.data.order;
// 获取商品详情
for (let item of that.orderData.item) {
if (item.goods_id === that.detailData.goods_id && item.goods_sku_price_id === that.detailData.goods_sku_price_id) {
that.orderItem = item;
}
}
if (that.detailData.aftersale_status == -1 || that.detailData.aftersale_status == -2 || that.detailData.aftersale_status == 2) {
that.stepActive = 3;
} else {
that.stepActive = that.detailData.aftersale_status + 1;
}
return false;
})
},
operationfunc(type, optType) {
let that = this;
switch (optType) {
case 'dialog':
that.refundDialog = true;
that.refundType = type;
that.dialogName = that.dialoglist[that.refundType];
break;
case 'new-aftersale':
this.$confirm('您是否要重启订单售后', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
Fast.api.ajax({
url: `shopro/order/aftersale/newAftersale/id/${that.detailId}`,
loading: true,
}, function (ret, res) {
that.getDetail();
})
}).catch(() => {
});
break;
case 'finish-aftersale':
Fast.api.ajax({
url: `shopro/order/aftersale/finish/id/${that.detailId}`,
loading: true,
}, function (ret, res) {
that.getDetail();
})
break;
default:
if (type == 'yes') {
if (that.refundType == 'agree-refund') {
Fast.api.ajax({
url: `shopro/order/aftersale/refund/id/${that.detailId}`,
loading: true,
data: {
refund_money: that.refundMoney
}
}, function (ret, res) {
that.refundDialog = false;
that.refundMoney = "";
that.getDetail();
})
} else if (that.refundType == 'reject-refund') {
Fast.api.ajax({
url: `shopro/order/aftersale/refuse/id/${that.detailId}`,
loading: true,
data: {
refuse_msg: that.refuseReason
}
}, function (ret, res) {
that.refundDialog = false;
that.refuseReason = "";
that.getDetail();
})
} else if (that.refundType == 'reply-msg') {
Fast.api.ajax({
url: `shopro/order/aftersale/addLog/id/${that.detailId}`,
loading: true,
data: {
content: that.replyMsg,
images: that.replyImages.join(',')
}
}, function (ret, res) {
that.refundDialog = false;
that.replyMsg = "";
that.replyImages = []
that.getDetail();
})
}
} else {
that.refundDialog = false;
that.refundMoney = "";
that.refuseReason = "";
that.replyMsg = '';
that.replyImages = [];
}
break;
}
},
finishService(orderId, itemId) {
var that = this
Fast.api.ajax({
url: `shopro/order/order/aftersaleFinish/id/${orderId}/item_id/${itemId}`,
loading: true,
data: {}
}, function (ret, res) {
that.orderGoodsList = []
res.data.forEach(item => {
that.orderGoodsList.push(item)
})
that.aftersale_statusFlag = false
that.orderGoodsList.forEach(i => {
if (i.aftersale_status == 1) {
that.aftersale_statusFlag = true
}
})
})
},
addImg() {
let that = this;
parent.Fast.api.open("general/file/index?select=1&multiple=true", "选择图片", {
callback: function (data) {
let arrUrl = data.url.split(',');
that.replyImages = that.replyImages.concat(arrUrl);
that.replyImages = that.replyImages.slice(0, 5)
}
});
return false;
},
delImg(index) {
this.replyImages.splice(index, 1);
},
},
watch: {
}
})
$('.more-ellipsis').each(function (i, obj) {
var lineHeight = parseInt($(this).css("line-height"));
var height = parseInt($(this).height());
if ((height / lineHeight) > 2) {
$(this).addClass("more-ellipsis-after")
$(this).css("height", "36px");
} else {
$(this).removeClass("more-ellipsis-after");
}
});
Controller.api.bindevent();
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});

查看文件

@@ -0,0 +1,101 @@
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
var userWalletApply = new Vue({
el: "#userWalletApply",
data() {
return {
fstatus: "0",
tableData: [],
currentPage: 1,
totalPage: 0,
offset: 0,
limit: 10,
tableCheckedAll: false,
isIndeterminate: false,
multipleSelection: [],
}
},
mounted() {
this.getData()
},
methods: {
changeStatus() {
this.getData(0, 10)
},
getData(offset, limit) {
var that = this;
offset ? offset : that.offset;
limit ? limit : that.limit;
Fast.api.ajax({
url: 'shopro/order/invoice/index',
loading: true,
type: 'GET',
data: {
filter: JSON.stringify({ status: that.fstatus }),
op: JSON.stringify({ status: "=" }),
offset: offset,
limit: limit,
}
}, function (ret, res) {
that.tableData = res.data.rows;
that.totalPage = res.data.total;
return false;
})
},
handleSizeChange(val) {
this.currentPage = 1;
this.getData(0, val)
},
handleCurrentChange(val) {
this.currentPage = val;
this.getData((val - 1) * this.limit, this.limit)
},
changeCheckedAll(val) {
if (val) {
this.tableData.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row, true);
});
this.isIndeterminate = false;
} else {
this.$refs.multipleTable.clearSelection();
}
},
tableSelect(val) {
this.multipleSelection = val;
this.tableCheckedAll = this.multipleSelection.length == 0 ? false : true
this.isIndeterminate = (this.multipleSelection.length == 0 || this.multipleSelection.length == this.tableData.length) ? false : true;
},
confirmRow(id) {
this.reqConfirm(id);
},
batchComfirm() {
let idsArr = [];
this.multipleSelection.forEach(v => {
idsArr.push(v.id)
})
this.reqConfirm(idsArr.join(","));
},
reqConfirm(ids) {
let that = this;
Fast.api.ajax({
url: 'shopro/order/invoice/confirm',
loading: true,
type: 'POST',
data: {
ids: ids
}
}, function (ret, res) {
that.getData()
})
},
openOrderDetail(id) {
Fast.api.open('shopro/order/order/detail?id=' + id, '订单详情')
}
},
})
}
};
return Controller;
});

文件差异内容过多而无法显示 加载差异

查看文件

@@ -0,0 +1,230 @@
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'shopro/order/order_item/index' + location.search,
add_url: 'shopro/order/order_item/add',
edit_url: 'shopro/order/order_item/edit',
del_url: 'shopro/order/order_item/del',
multi_url: 'shopro/order/order_item/multi',
table: 'shopro_order_item',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{ checkbox: true },
{ field: 'id', title: __('Id') },
{ field: 'user_id', title: __('User_id') },
{ field: 'order_id', title: __('Order_id') },
{ field: 'goods_id', title: __('Goods_id') },
{ field: 'goods_sku_price_id', title: __('Goods_sku_price_id') },
{ field: 'activity_id', title: __('Activity_id') },
{ field: 'activity_type', title: __('Activity_type') },
{ field: 'item_goods_sku_price_id', title: __('Item_goods_sku_price_id') },
{ field: 'goods_sku_text', title: __('Goods_sku_text') },
{ field: 'goods_title', title: __('Goods_title') },
{ field: 'goods_image', title: __('Goods_image'), events: Table.api.events.image, formatter: Table.api.formatter.image },
{ field: 'goods_original_price', title: __('Goods_original_price'), operate: 'BETWEEN' },
{ field: 'discount_fee', title: __('Discount_fee'), operate: 'BETWEEN' },
{ field: 'goods_price', title: __('Goods_price'), operate: 'BETWEEN' },
{ field: 'goods_num', title: __('Goods_num') },
{
field: 'dispatch_status', title: __('Dispatch_status'), searchList: { "0": __('Dispatch_status 0'), "1": __('Dispatch_status 1'), "2": __('Dispatch_status 2') },
formatter: function (value, row) {
return `
<p class="popover-options">
<a href="#" type="button" class="btn btn-warning" title="" data-html="true" data-placement="top"
data-container="body" data-toggle="popover" data-content="<h4><div class='popover-btn'><i class='fa fa-edit info btn btn-success sendAll'><span class='display-none'>${row.id}</span>统一发货</i></div>
<div class='popover-btn'><i class='fa fa-edit sendSingle info btn btn-success'><span class='display-none'>${row.id}</span>单品发货</i></div></h4>">
${value}
</a>
</p>
`
},
},
{ field: 'dispatch_fee', title: __('Dispatch_fee'), operate: 'BETWEEN' },
{ field: 'dispatch_type', title: __('Dispatch_type') },
{ field: 'dispatch_id', title: __('Dispatch_id') },
{ field: 'aftersale_status', title: __('Aftersale_status'), searchList: { "0": __('Aftersale_status 0'), "1": __('Aftersale_status 1') }, formatter: Table.api.formatter.status },
{ field: 'comment_status', title: __('Comment_status'), searchList: { "0": __('Comment_status 0'), "1": __('Comment_status 1') }, formatter: Table.api.formatter.status },
{ field: 'refund_status', title: __('Refund_status'),
formatter: function (value, row) {
return `
<p class="popover-options">
<a href="#" type="button" class="btn btn-warning" title="" data-html="true" data-placement="top"
data-container="body" data-toggle="popover" data-content="
<h4><div class='popover-btn'><i class='fa fa-check express_ajax info btn btn-success'><span class='display-none'>${row.id}</span>确认</i></div>
<div class='popover-btn'><i class='fa fa-close info btn btn-danger express_ajax'><span class='display-none'>${row.id}</span>拒绝</i></div></h4>">
${value}
</a>
</p>
`
}},
// searchList: { "-1": __('Refund_status -1'), "0": __('Refund_status 0'), "1": __('Refund_status 1'), "2": __('Refund_status 2') }, formatter: Table.api.formatter.status },
{
field: 'express_name', title: __('Express_name'),
},
{
field: 'express_no', title: __('Express_no'),
formatter: function (value, row) {
return `<div>${value == null ? '' : value}<i class="fa fa-edit testExpress_no info"></i></div>`
}
},
{ field: 'createtime', title: __('Createtime'), operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime },
{ field: 'updatetime', title: __('Updatetime'), operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime },
{ field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate }
]
]
});
//申请退货
$(document).on("click", ".express_ajax", function () {
var that = this;
var id=$(this).children("span")[0].innerHTML
Layer.confirm(
__('确认退款?',),
{icon: 3, title: __('Warning'), offset: 0, shadeClose: true},
function (index) {
Backend.api.ajax({
url: "acc/bdd/delexp",
data: $(that).closest("form").serialize()
});
table.bootstrapTable('refresh');
Layer.close(index);
}
);
});
$(".popover-options").blur(function(){
$('.popover').css("display","none");
});
$('.popover-options').on('shown.bs.popover', function () {
alert("当显示时警告消息");
})
// $(document).on("click",function(){
// $('.popover').css("display","none");
// })
//统一发货
$(document).on("click", ".sendAll", function () {
var id = $(this).children("span")[0].innerHTML
var that = this;
layer.open({
type: 1,
area: ['300px', '300px'],
shadeClose: false, //点击遮罩关闭
content: `<div style="display: flex;
flex-direction: column;padding:20px 0">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-4">快递公司:</label>
<div class="col-xs-4 col-sm-8">
<input class="form-control ggg" type="text" placeholder="请输入快递公司">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-4">快递单号:</label>
<div class="col-xs-4 col-sm-8">
<input class="form-control fff" type="text" placeholder="请输入快递单号">
</div>
</div>
<button class="sendAllBtn btn btn-success">确定</button>
</div>`
});
$(".sendAllBtn").click(function () {
var ggg = $(".ggg").val()
var fff = $(".fff").val()
Backend.api.ajax({
url: "general/config/emailtest?id=" + value,
data: $(that).closest("form").serialize()
});
table.bootstrapTable('refresh');
Layer.close(index);
})
});
// 为表格绑定事件
Table.api.bindevent(table);
},
recyclebin: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
'dragsort_url': ''
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: 'shopro/order/order_item/recyclebin' + location.search,
pk: 'id',
sortName: 'id',
columns: [
[
{ checkbox: true },
{ field: 'id', title: __('Id') },
{
field: 'deletetime',
title: __('Deletetime'),
operate: 'RANGE',
addclass: 'datetimerange',
formatter: Table.api.formatter.datetime
},
{
field: 'operate',
width: '130px',
title: __('Operate'),
table: table,
events: Table.api.events.operate,
buttons: [
{
name: 'Restore',
text: __('Restore'),
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
icon: 'fa fa-rotate-left',
url: 'shopro/order/order_item/restore',
refresh: true
},
{
name: 'Destroy',
text: __('Destroy'),
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
icon: 'fa fa-times',
url: 'shopro/order/order_item/destroy',
refresh: true
}
],
formatter: Table.api.formatter.operate
}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});

查看文件

@@ -0,0 +1,171 @@
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
function debounce(handle, delay) {
let time = null;
return function () {
let self = this,
arg = arguments;
clearTimeout(time);
time = setTimeout(function () {
handle.apply(self, arg);
}, delay)
}
}
var orderIndex = new Vue({
el: "#orderIndex",
data() {
return {
screenType: false,
typeList: {},
orderList: [],
currentPage: 1,
totalPage: 0,
offset: 0,
limit: 10,
// form搜索
searchForm: {
status: "all",
createtime: [moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'), moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')],
form_1_key: "order_sn",
form_1_value: "",
platform: "",
dispatch_type: "",
type: "",
pay_type: "",
form_2_key: "user_id",
form_2_value: "",
},
searchFormInit: {
status: "all",
createtime: [moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'), moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')],
form_1_key: "order_sn",
form_1_value: "",
platform: "",
dispatch_type: "",
type: "",
pay_type: "",
form_2_key: "user_id",
form_2_value: "",
},
searchOp: {
status: "=",
createtime: "range",
order_sn: "like",
id: "=",
aftersale_sn: "=",
transaction_id: "=",
platform: "=",
dispatch_type: "=",
type: "=",
pay_type: "=",
user_id: "=",
nickname: "like",
user_phone: "like",
consignee: "like",
phone: "like",
},
focusi: false,
}
},
mounted() {
this.getData()
this.getType()
},
methods: {
getType() {
var that = this;
Fast.api.ajax({
url: 'shopro/order/order/getType',
}, function (ret, res) {
that.typeList = res.data
return false;
})
},
//请求
getData(offset, limit) {
var that = this;
that.offset = offset >= 0 ? offset : that.offset;
that.limit = limit || that.limit;
that.currentPage = that.offset / that.limit + 1;
let filter = {}
let op = {}
for (key in that.searchForm) {
if (key != 'status' && key != 'createtime' && key != 'form_1_key' && key != 'form_1_value' && key != 'form_2_key' && key != 'form_2_value') {
if (that.searchForm[key] != '' && that.searchForm[key] != 'all') {
filter[key] = that.searchForm[key];
}
} else if (key == 'form_1_value') {
if (that.searchForm[key] != '') {
filter[that.searchForm.form_1_key] = that.searchForm[key];
}
} else if (key == 'form_2_value') {
if (that.searchForm[key] != '') {
filter[that.searchForm.form_2_key] = that.searchForm[key];
}
} else if (key == 'createtime') {
if (that.searchForm[key]) {
if (that.searchForm[key].length > 0) {
filter[key] = that.searchForm[key].join(' - ');
}
}
} else if (key == 'status') {
if (that.searchForm[key] != '' && that.searchForm[key] != 'all') {
filter[key] = that.searchForm[key];
}
}
}
for (key in filter) {
op[key] = that.searchOp[key]
}
Fast.api.ajax({
url: 'shopro/order/trade_order/index',
loading: true,
type: 'GET',
data: {
filter: JSON.stringify(filter),
op: JSON.stringify(op),
offset: that.offset,
limit: that.limit,
}
}, function (ret, res) {
that.orderList = res.data.rows;
that.totalPage = res.data.total;
that.focusi = false;
return false;
})
},
handleSizeChange(val) {
this.offset = 0
this.limit = val
this.currentPage = 1;
this.getData()
},
handleCurrentChange(val) {
this.offset = (val - 1) * this.limit;
this.currentPage = 1;
this.getData()
},
//筛选
changeSwitch() {
this.screenType = !this.screenType;
},
screenEmpty() {
this.searchForm = JSON.parse(JSON.stringify(this.searchFormInit))
this.getData(0, 10)
},
goOrderRefresh() {
this.focusi = true;
this.getData()
},
},
})
},
};
return Controller;
});