上传代码
This commit is contained in:
83
uniapp04/unpackage/dist/dev/mp-alipay/pages/drinks/drinks.acss
vendored
Normal file
83
uniapp04/unpackage/dist/dev/mp-alipay/pages/drinks/drinks.acss
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
}
|
||||
.history-list {
|
||||
width: 100%;
|
||||
}
|
||||
.history-item {
|
||||
padding: 10px 0px 10px 5px;
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
border: 1px solid #999;
|
||||
background-color: #fff;
|
||||
border-radius: 15px;
|
||||
}
|
||||
.history-img {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.history-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.history-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.history-description {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
.starSale {
|
||||
width: 120px;
|
||||
height: 15px;
|
||||
}
|
||||
.star {
|
||||
display: inline-block;
|
||||
line-height: 15px;
|
||||
}
|
||||
.history-sale {
|
||||
font-size: 20rpx;
|
||||
color: #999;
|
||||
float: right;
|
||||
display: inline-block;
|
||||
line-height: 15px;
|
||||
}
|
||||
.startPoints {
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
}
|
||||
.points {
|
||||
padding-left: 15px;
|
||||
font-size: 20rpx;
|
||||
line-height: 20px;
|
||||
color: #d41414;
|
||||
}
|
||||
.distance,
|
||||
.time {
|
||||
font-size: 20rpx;
|
||||
color: #999;
|
||||
padding-left: 25px;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
.history-start,
|
||||
.history-distance {
|
||||
font-size: 20rpx;
|
||||
color: #999;
|
||||
}
|
||||
.exchange {
|
||||
font-size: 24rpx;
|
||||
color: #e99e44;
|
||||
background-color: #f7dbb3;
|
||||
width: 75px;
|
||||
height: 20px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #e99e44;
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-alipay/pages/drinks/drinks.axml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-alipay/pages/drinks/drinks.axml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="container"><view class="history-list"><view a:for="{{a}}" a:for-item="item" a:key="f" class="history-item" onTap="{{item.g}}"><image class="history-img" src="{{item.a}}"></image><view class="history-info"><text class="history-title">{{item.b}}</text><view class="starSale"><view class="star"><uni-rate u-i="{{item.c}}" onVI="__l" u-p="{{item.d||''}}"/></view><text class="history-sale">月售:234</text></view><view class="startPoints"><text class="history-start">起送:¥10</text><text class="points">用积分更优惠</text><text class="distance">2.3km</text><text class="time">30min</text></view><view class="exchange"><uni-icons u-i="{{item.e}}" onVI="__l" u-p="{{b||''}}"></uni-icons> 支持自取 </view></view></view></view></view>
|
87
uniapp04/unpackage/dist/dev/mp-alipay/pages/drinks/drinks.js
vendored
Normal file
87
uniapp04/unpackage/dist/dev/mp-alipay/pages/drinks/drinks.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: "drinks",
|
||||
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: 2,
|
||||
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: "d6ec0846-0-" + i0,
|
||||
d: common_vendor.p({
|
||||
readonly: true,
|
||||
value: item.level,
|
||||
size: "12px"
|
||||
}),
|
||||
e: "d6ec0846-1-" + i0,
|
||||
f: index,
|
||||
g: common_vendor.o(($event) => handleDonate(item))
|
||||
};
|
||||
}),
|
||||
b: common_vendor.p({
|
||||
type: "paperplane-filled",
|
||||
color: "#e99e44"
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
my.createPage(_sfc_main);
|
9
uniapp04/unpackage/dist/dev/mp-alipay/pages/drinks/drinks.json
vendored
Normal file
9
uniapp04/unpackage/dist/dev/mp-alipay/pages/drinks/drinks.json
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"defaultTitle": "第二餐厅",
|
||||
"pullRefresh": false,
|
||||
"titleBarColor": "#4095e5",
|
||||
"usingComponents": {
|
||||
"uni-rate": "../../uni_modules/uni-rate/components/uni-rate/uni-rate",
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user