提交
This commit is contained in:
114
甲情_甲意/miniprogram/pages/daodianfuwu/daodianfuwu.acss
Normal file
114
甲情_甲意/miniprogram/pages/daodianfuwu/daodianfuwu.acss
Normal file
@ -0,0 +1,114 @@
|
||||
.search-line {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
}
|
||||
.cancel {
|
||||
color: var(--color-text-primary);
|
||||
|
||||
}
|
||||
.image1{
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
.box{
|
||||
width: 90%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: 1px solid #de868f;
|
||||
border-radius: 40px;
|
||||
margin-top: 20rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.box1{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.box4{
|
||||
width: 120rpx;
|
||||
height: 50rpx;
|
||||
border: 1px solid #4095e5;
|
||||
border-radius: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.dingwei{
|
||||
color: #4095e5;
|
||||
border:1px solid #4095e5;
|
||||
font-size: 12px;
|
||||
|
||||
}
|
||||
.kuan{
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
.statues{
|
||||
font-size: 13px;
|
||||
width: 100rpx;
|
||||
background-color: #4095e5;
|
||||
margin-top: 20rpx;
|
||||
color: white;
|
||||
}
|
||||
.yuyuekuang{
|
||||
width: 20%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.text{
|
||||
font-weight: bolder;
|
||||
}
|
||||
.wenzi{
|
||||
width: 60%;
|
||||
height: 200rpx;
|
||||
display: flex;
|
||||
}
|
||||
.imagebox{
|
||||
width: 40%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.image{
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.kuang{
|
||||
width: 90%;
|
||||
height: 240rpx;
|
||||
border: 3px solid #de868f;
|
||||
border-radius: 20px;
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.box2{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 50rpx;
|
||||
flex-direction: column;
|
||||
}
|
||||
.dingweikuang{
|
||||
width: 100%;
|
||||
position: relative;
|
||||
left: 50rpx;
|
||||
top: 30rpx;
|
||||
}
|
||||
.dingweiimage{
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
47
甲情_甲意/miniprogram/pages/daodianfuwu/daodianfuwu.axml
Normal file
47
甲情_甲意/miniprogram/pages/daodianfuwu/daodianfuwu.axml
Normal file
@ -0,0 +1,47 @@
|
||||
<view class="box1">
|
||||
<!-- 搜索框 -->
|
||||
<view class="box">
|
||||
<view class="search-line">
|
||||
<view style="display:flex;align-items:center">
|
||||
<image onTap="find" style="width:20px;height:20px" mode="scaleToFill" src="../image/sousuo.png" />
|
||||
<input onInput="inputchange" onConfirm="find" style="margin-left:10rpx;width:230px" placeholder="请输入内容" />
|
||||
</view>
|
||||
|
||||
<view class="cancel">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 定位 -->
|
||||
<view class="dingweikuang">
|
||||
<image mode="scaleToFill" class="dingweiimage" src="../image/dingwei.png" />
|
||||
<text style="margin-left:8rpx">{{selectedCity}}</text>
|
||||
</view>
|
||||
<!-- 店铺界面 -->
|
||||
<view style="width:100%">
|
||||
<view class="box2" >
|
||||
<view class="kuang" a:for="{{ sousuo }}" data-num="{{item}}" onTap="dianpu" a:if="{{ item.business.state==1 }}">
|
||||
<view class="imagebox">
|
||||
<image class="image" mode="scaleToFill" src="{{item.business.businessAvatar}}" />
|
||||
</view>
|
||||
|
||||
<view class="wenzi">
|
||||
<view class="kuan">
|
||||
<text class="text">{{item.business.businessName}}</text>
|
||||
<view style="margin-top:5rpx">
|
||||
<text class="statues">{{item.business.businessImages}}</text>
|
||||
<text class="dingwei">{{item.business.startBusiness}}营业</text>
|
||||
</view>
|
||||
<view style="margin-top:5rpx">
|
||||
<text class="dingweia" style="width:150rpx;top:50rpx;width:200rpx;height:100rpx;font-size:12px;color: #9b9b9b;">{{item.business.address}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="yuyuekuang">
|
||||
<view class="box4">
|
||||
<text style="font-size:13px;color:#4095e5" a:if="{{ item.business.storeStatus===1 }}">可上门</text>
|
||||
<text style="font-size:13px;color:#4095e5" a:if="{{ item.business.storeStatus===0 }}">已休息</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
141
甲情_甲意/miniprogram/pages/daodianfuwu/daodianfuwu.js
Normal file
141
甲情_甲意/miniprogram/pages/daodianfuwu/daodianfuwu.js
Normal file
@ -0,0 +1,141 @@
|
||||
import {url} from '../request'
|
||||
Page({
|
||||
data: {
|
||||
sousuo:[],
|
||||
address: "",
|
||||
businessAvatar: "",
|
||||
businessImages: "",
|
||||
businessName: "",
|
||||
businessPhone: "",
|
||||
businessProfile: "",
|
||||
categoryId: 0,
|
||||
createTime: "",
|
||||
endBusiness: "",
|
||||
id: 0,
|
||||
isDelete: 0,
|
||||
startBusiness: "",
|
||||
state: 0,
|
||||
storeStatus: '',
|
||||
updateTime: "",
|
||||
userId: 0,
|
||||
inputtext:'',
|
||||
selectedCity:'',
|
||||
},
|
||||
inputchange(e){
|
||||
this.setData({
|
||||
inputtext:e.detail.value,
|
||||
});
|
||||
console.log(e.detail.value);
|
||||
console.log(this.data.inputtext);
|
||||
},
|
||||
onLoad() {
|
||||
this.localcation();
|
||||
my.request({
|
||||
url: url + '/api/business/list',
|
||||
method: 'POST',
|
||||
data: {
|
||||
|
||||
},
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
console.log('Request succeeded:', res);
|
||||
if (res.data && res.data.data) {
|
||||
this.setData({
|
||||
sousuo: res.data.data, // 更新 tuijian 列表
|
||||
});
|
||||
} else {
|
||||
console.log('shibaile')
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
console.error('Request failed', error);
|
||||
}
|
||||
});
|
||||
},
|
||||
dianpu(item) {
|
||||
const id = item.target.dataset.num
|
||||
console.log('传递的数据:', id);
|
||||
const ID = id.business.id
|
||||
console.log(ID);
|
||||
const userId = id.business.userId
|
||||
const address = id.business.address
|
||||
const businessName = id.business.businessName
|
||||
const businessAvatar = id.business.businessAvatar
|
||||
const endBusiness = id.business.endBusiness
|
||||
const startBusiness = id.business.startBusiness
|
||||
const storeStatus = id.business.storeStatus
|
||||
const businessPhone =id.business.businessPhone
|
||||
// const level = id.business.level
|
||||
console.log('Address being passed: ', ID,address,businessName,businessAvatar,endBusiness,startBusiness,businessPhone);
|
||||
|
||||
my.navigateTo({
|
||||
url: `/pages/dianpuzhuye/dianpuzhuye?userId=${userId}
|
||||
&&address=${address}&&businessName=${businessName}
|
||||
&&businessAvatar=${businessAvatar}
|
||||
&&startBusiness=${startBusiness}
|
||||
&&endBusiness=${endBusiness}&&storeStatus=${storeStatus}
|
||||
&&id=${ID}&&businessPhone=${businessPhone}`,
|
||||
});
|
||||
},
|
||||
find(){
|
||||
my.request({
|
||||
url: url + '/api/business/list/page/vo',
|
||||
method: 'POST',
|
||||
data: {
|
||||
address: this.data.selectedCity,
|
||||
businessName: this.data.inputtext,
|
||||
businessProfile: "",
|
||||
categoryId: "",
|
||||
current: 1,
|
||||
id: "",
|
||||
pageSize: 20,
|
||||
sortField: "",
|
||||
sortOrder: "",
|
||||
state: "",
|
||||
storeStatus: "",
|
||||
userId: ""
|
||||
},
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
console.log('Request succeeded:', res);
|
||||
if (res.data && res.data.data) {
|
||||
this.setData({
|
||||
sousuo:res.data.data.records
|
||||
})
|
||||
} else {
|
||||
console.log('shibaile')
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
console.error('Request failed', error);
|
||||
}
|
||||
});
|
||||
},
|
||||
localcation(){
|
||||
my.getLocation({
|
||||
type: 1, // 获取包括省市区县数据
|
||||
success: (res) => {
|
||||
console.log('定位成功:', res);
|
||||
this.setData({
|
||||
selectedCity: res.city // 将城市名称设置到 selectedCity
|
||||
});
|
||||
},
|
||||
fail: (error) => {
|
||||
console.error('定位失败:', error);
|
||||
my.alert({
|
||||
title: '定位失败',
|
||||
content: '无法获取当前位置,请检查定位权限设置。'
|
||||
});
|
||||
this.setData({
|
||||
selectedCity: '定位失败'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
8
甲情_甲意/miniprogram/pages/daodianfuwu/daodianfuwu.json
Normal file
8
甲情_甲意/miniprogram/pages/daodianfuwu/daodianfuwu.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"defaultTitle": "到店服务",
|
||||
"usingComponents": {
|
||||
"ant-icon": "antd-mini/es/Icon/index",
|
||||
"ant-input": "antd-mini/es/Input/index"
|
||||
},
|
||||
"styleIsolation": "apply-shared"
|
||||
}
|
Reference in New Issue
Block a user