上传代码
This commit is contained in:
180
uniapp04/unpackage/dist/dev/mp-alipay/pages/goSearch/goSearch.acss
vendored
Normal file
180
uniapp04/unpackage/dist/dev/mp-alipay/pages/goSearch/goSearch.acss
vendored
Normal file
@ -0,0 +1,180 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.no-results.data-v-9800dcee {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
font-size: 16px;
|
||||
color: #aaa;
|
||||
}
|
||||
.businessItem.data-v-9800dcee {
|
||||
margin-bottom: 10px;
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.businessItem p.data-v-9800dcee {
|
||||
margin: 0;
|
||||
}
|
||||
.container.data-v-9800dcee {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
}
|
||||
.history-list.data-v-9800dcee {
|
||||
width: 100%;
|
||||
}
|
||||
.history-item.data-v-9800dcee {
|
||||
padding: 10px 0px 10px 5px;
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
border: 1px solid #999;
|
||||
background-color: #fff;
|
||||
border-radius: 15px;
|
||||
}
|
||||
.history-img.data-v-9800dcee {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.history-info.data-v-9800dcee {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.history-title.data-v-9800dcee {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.history-description.data-v-9800dcee {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
.starSale.data-v-9800dcee {
|
||||
width: 120px;
|
||||
height: 15px;
|
||||
}
|
||||
.star.data-v-9800dcee {
|
||||
display: inline-block;
|
||||
line-height: 15px;
|
||||
}
|
||||
.history-sale.data-v-9800dcee {
|
||||
font-size: 20rpx;
|
||||
color: #999;
|
||||
float: right;
|
||||
display: inline-block;
|
||||
line-height: 15px;
|
||||
}
|
||||
.startPoints.data-v-9800dcee {
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
}
|
||||
.points.data-v-9800dcee {
|
||||
padding-left: 15px;
|
||||
font-size: 20rpx;
|
||||
line-height: 20px;
|
||||
color: #d41414;
|
||||
}
|
||||
.distance.data-v-9800dcee,
|
||||
.time.data-v-9800dcee {
|
||||
font-size: 20rpx;
|
||||
color: #999;
|
||||
padding-left: 25px;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
.history-start.data-v-9800dcee,
|
||||
.history-distance.data-v-9800dcee {
|
||||
font-size: 20rpx;
|
||||
color: #999;
|
||||
}
|
||||
.exchange.data-v-9800dcee {
|
||||
font-size: 24rpx;
|
||||
color: #e99e44;
|
||||
background-color: #f7dbb3;
|
||||
width: 75px;
|
||||
height: 20px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #e99e44;
|
||||
}
|
||||
|
||||
/* 搜索栏 */
|
||||
.navbar.data-v-9800dcee {
|
||||
background-color: #4095e5;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 10px;
|
||||
/* 添加透明输入框的样式 */
|
||||
}
|
||||
.navbar .search.data-v-9800dcee {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 10rpx 0 26rpx;
|
||||
height: 0.64rem;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
border-radius: 32rpx;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
width: 70%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.navbar .icon-search.data-v-9800dcee {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.navbar .search-button.data-v-9800dcee {
|
||||
margin-left: auto;
|
||||
/* 将按钮放置在右侧 */
|
||||
height: 0.64rem;
|
||||
/* 与搜索框高度一致 */
|
||||
background-color: #fff;
|
||||
/* 按钮背景颜色 */
|
||||
color: #4095e5;
|
||||
/* 按钮文字颜色 */
|
||||
border: none;
|
||||
/* 去掉边框 */
|
||||
border-radius: 32rpx;
|
||||
/* 与搜索框圆角一致 */
|
||||
padding: 0 20rpx;
|
||||
/* 按钮内边距 */
|
||||
line-height: 0.64rem;
|
||||
font-size: 15px;
|
||||
}
|
||||
.navbar .transparent-input.data-v-9800dcee {
|
||||
background-color: transparent;
|
||||
/* 使输入框背景透明 */
|
||||
border: none;
|
||||
/* 移除边框 */
|
||||
color: #fff;
|
||||
/* 输入文字颜色为白色 */
|
||||
outline: none;
|
||||
/* 点击时没有默认的outline */
|
||||
width: 100%;
|
||||
/* 让输入框占据剩余空间 */
|
||||
padding: 0 10rpx;
|
||||
/* 内边距以保证文本不紧贴边缘 */
|
||||
font-size: 28rpx;
|
||||
/* 继承自 .search 的字体大小 */
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-alipay/pages/goSearch/goSearch.axml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-alipay/pages/goSearch/goSearch.axml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="navbar data-v-9800dcee"><view class="search data-v-9800dcee"><text class="icon-search data-v-9800dcee"><input type="text" placeholder="搜索店铺" class="transparent-input data-v-9800dcee" value="{{a}}" onInput="{{b}}"/></text></view><button onTap="{{c}}" class="search-button data-v-9800dcee">搜索</button></view><view class="container data-v-9800dcee"><view a:if="{{d}}" class="no-results data-v-9800dcee"> 没有这个店铺,搜一搜其他的试试呢 </view><view a:if="{{e}}" class="history-list data-v-9800dcee"><view a:for="{{f}}" a:for-item="item" a:key="e" class="history-item data-v-9800dcee" onTap="{{item.f}}"><image class="history-img data-v-9800dcee" src="{{item.a}}"></image><view class="history-info data-v-9800dcee"><text class="history-title data-v-9800dcee">{{item.b}}</text><view class="starSale data-v-9800dcee"><view class="star data-v-9800dcee"><uni-rate class="data-v-9800dcee" u-i="{{item.c}}" onVI="__l" u-p="{{g||''}}"/></view><text class="history-sale data-v-9800dcee">月售:234</text></view><view class="startPoints data-v-9800dcee"><text class="history-start data-v-9800dcee">起送:¥10</text><text class="points data-v-9800dcee">用积分更优惠</text><text class="distance data-v-9800dcee">2.3km</text><text class="time data-v-9800dcee">30min</text></view><view class="exchange data-v-9800dcee"><uni-icons class="data-v-9800dcee" u-i="{{item.d}}" onVI="__l" u-p="{{h||''}}"></uni-icons> 支持自取 </view></view></view></view></view>
|
94
uniapp04/unpackage/dist/dev/mp-alipay/pages/goSearch/goSearch.js
vendored
Normal file
94
uniapp04/unpackage/dist/dev/mp-alipay/pages/goSearch/goSearch.js
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
"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: "goSearch",
|
||||
setup(__props) {
|
||||
const searchTerm = common_vendor.ref("");
|
||||
const businessRecords = common_vendor.ref([]);
|
||||
const searchBusiness = () => {
|
||||
const businessName = searchTerm.value;
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/business/list/page/vo",
|
||||
method: "POST",
|
||||
data: {
|
||||
address: "",
|
||||
businessName,
|
||||
businessProfile: "",
|
||||
categoryId: "",
|
||||
current: 1,
|
||||
id: "",
|
||||
pageSize: 10,
|
||||
sortField: "",
|
||||
sortOrder: "",
|
||||
state: 1,
|
||||
storeStatus: "",
|
||||
userId: ""
|
||||
},
|
||||
success(res) {
|
||||
businessRecords.value = res.data.data.records || [];
|
||||
console.log(businessRecords.value);
|
||||
console.log("成功");
|
||||
},
|
||||
fail() {
|
||||
console.log("出错了");
|
||||
}
|
||||
});
|
||||
};
|
||||
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 common_vendor.e({
|
||||
a: searchTerm.value,
|
||||
b: common_vendor.o(($event) => searchTerm.value = $event.detail.value),
|
||||
c: common_vendor.o(searchBusiness),
|
||||
d: businessRecords.value.length === 0
|
||||
}, businessRecords.value.length === 0 ? {} : {}, {
|
||||
e: businessRecords.value.length > 0
|
||||
}, businessRecords.value.length > 0 ? {
|
||||
f: common_vendor.f(businessRecords.value, (item, index, i0) => {
|
||||
return {
|
||||
a: item.businessAvatar,
|
||||
b: common_vendor.t(item.businessName),
|
||||
c: "9800dcee-0-" + i0,
|
||||
d: "9800dcee-1-" + i0,
|
||||
e: index,
|
||||
f: common_vendor.o(($event) => handleDonate(item))
|
||||
};
|
||||
}),
|
||||
g: common_vendor.p({
|
||||
readonly: true,
|
||||
value: 4,
|
||||
size: "12px"
|
||||
}),
|
||||
h: common_vendor.p({
|
||||
type: "paperplane-filled",
|
||||
color: "#e99e44"
|
||||
})
|
||||
} : {});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-9800dcee"]]);
|
||||
my.createPage(MiniProgramPage);
|
7
uniapp04/unpackage/dist/dev/mp-alipay/pages/goSearch/goSearch.json
vendored
Normal file
7
uniapp04/unpackage/dist/dev/mp-alipay/pages/goSearch/goSearch.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaultTitle": "搜索页面",
|
||||
"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