上传代码
This commit is contained in:
87
uniapp04/unpackage/dist/dev/mp-alipay/pages/food/food.js
vendored
Normal file
87
uniapp04/unpackage/dist/dev/mp-alipay/pages/food/food.js
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const API_api = require("../../API/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_uni_rate2 = common_vendor.resolveComponent("uni-rate");
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
(_easycom_uni_rate2 + _easycom_uni_icons2)();
|
||||
}
|
||||
const _easycom_uni_rate = () => "../../uni_modules/uni-rate/components/uni-rate/uni-rate.js";
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_rate + _easycom_uni_icons)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "food",
|
||||
setup(__props) {
|
||||
const historyList = common_vendor.ref([]);
|
||||
const fetchHistoryData = async () => {
|
||||
try {
|
||||
const res = await common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/business/list/page/vo",
|
||||
method: "POST",
|
||||
data: {
|
||||
address: "",
|
||||
businessName: "",
|
||||
businessProfile: "",
|
||||
categoryId: 1,
|
||||
current: 1,
|
||||
id: "",
|
||||
pageSize: 20,
|
||||
sortField: "",
|
||||
sortOrder: "",
|
||||
state: 1,
|
||||
storeStatus: "",
|
||||
userId: ""
|
||||
}
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
console.log(res.data.data.records);
|
||||
historyList.value = res.data.data.records;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching data:", error);
|
||||
}
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
fetchHistoryData();
|
||||
});
|
||||
const handleDonate = (item) => {
|
||||
console.log(item.id);
|
||||
common_vendor.index.setStorageSync("Mybusiness", item);
|
||||
common_vendor.index.setStorageSync("businessItem", item.id);
|
||||
if (!item || !item.hasOwnProperty("id")) {
|
||||
console.error("The 'item' variable is undefined or missing the 'id' property.");
|
||||
return;
|
||||
}
|
||||
const merchantId = item.id;
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/merchant/merchant?merchantId=${merchantId}`
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.f(historyList.value, (item, index, i0) => {
|
||||
return {
|
||||
a: item == null ? void 0 : item.businessAvatar,
|
||||
b: common_vendor.t(item == null ? void 0 : item.businessName),
|
||||
c: "22966dbd-0-" + i0,
|
||||
d: common_vendor.p({
|
||||
readonly: true,
|
||||
value: item.level,
|
||||
size: "12px"
|
||||
}),
|
||||
e: "22966dbd-1-" + i0,
|
||||
f: index,
|
||||
g: common_vendor.o(($event) => handleDonate(item))
|
||||
};
|
||||
}),
|
||||
b: common_vendor.p({
|
||||
type: "paperplane-filled",
|
||||
color: "#e99e44"
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
my.createPage(_sfc_main);
|
Reference in New Issue
Block a user