解决了已知问题
|
@ -109,6 +109,21 @@
|
||||||
"title": "支付界面",
|
"title": "支付界面",
|
||||||
"page": "pages/zhifujiemian/zhifujiemian",
|
"page": "pages/zhifujiemian/zhifujiemian",
|
||||||
"launchMode": "common"
|
"launchMode": "common"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "商品界面",
|
||||||
|
"page": "pages/shangpinjiemian/shangpinjiemian",
|
||||||
|
"launchMode": "common"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "预约支付",
|
||||||
|
"page": "pages/yuyuezhifu/yuyuezhifu",
|
||||||
|
"launchMode": "common"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "pages/shanmenspjm/shanmenspjm",
|
||||||
|
"page": "pages/shanmenspjm/shanmenspjm",
|
||||||
|
"launchMode": "common"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -23,7 +23,11 @@
|
||||||
"pages/meijiashirenzheng/meijiashirenzheng",
|
"pages/meijiashirenzheng/meijiashirenzheng",
|
||||||
"pages/pingjia/pingjia",
|
"pages/pingjia/pingjia",
|
||||||
"pages/test1/test1",
|
"pages/test1/test1",
|
||||||
"pages/denglutest/denglutest"
|
"pages/denglutest/denglutest",
|
||||||
|
"pages/yuyuezhifu/yuyuezhifu",
|
||||||
|
"pages/shnagmendianpu/shnagmendianpu",
|
||||||
|
"pages/yuyuezhifusm/yuyuezhifusm",
|
||||||
|
"pages/yuyuejiemian/yuyuejiemian"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"defaultTitle": "甲情甲意",
|
"defaultTitle": "甲情甲意",
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<!-- 店铺界面 -->
|
<!-- 店铺界面 -->
|
||||||
<view style="width:100%">
|
<view style="width:100%">
|
||||||
<view class="box2" >
|
<view class="box2" >
|
||||||
<view class="kuang" a:for="{{ sousuo }}" a:key="{{index}}" data-num="{{item}}" onTap="dianpu">
|
<view class="kuang" a:for="{{ sousuo }}" a:key="{{index}}" data-num="{{item}}" onTap="dianpu" a:if="{{ item.state==1 }}">
|
||||||
<image class="image" mode="scaleToFill" src="{{item.businessAvatar}}" />
|
<image class="image" mode="scaleToFill" src="{{item.businessAvatar}}" />
|
||||||
<view class="wenzi">
|
<view class="wenzi">
|
||||||
<text class="text">{{item.businessName}}</text>
|
<text class="text">{{item.businessName}}</text>
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
.cebian {
|
.cebian {
|
||||||
width: 20%;
|
width: 20%;
|
||||||
height: 100v;
|
height: 100vh;
|
||||||
background-color: #efeced;
|
background-color: #efeced;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
|
@ -26,17 +25,20 @@
|
||||||
}
|
}
|
||||||
.xinxi{
|
.xinxi{
|
||||||
width: 80%;
|
width: 80%;
|
||||||
height: 100%;
|
height: 550px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow-y: scroll
|
overflow-y: scroll;
|
||||||
|
overflow-x: hidden;
|
||||||
|
|
||||||
}
|
}
|
||||||
.pages{
|
.pages{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 560px;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
.shop{
|
.shop{
|
||||||
width: 90%;
|
width: 90%;
|
||||||
|
@ -73,7 +75,7 @@
|
||||||
background-color: #fb96b1;
|
background-color: #fb96b1;
|
||||||
}
|
}
|
||||||
.yuyuekuang{
|
.yuyuekuang{
|
||||||
width: 100%;
|
width: 95%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
@ -177,7 +179,8 @@ height: 20px;
|
||||||
.pingjia{
|
.pingjia{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
.pingjiakuang{
|
.pingjiakuang{
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
<image class="image" mode="scaleToFill" src="{{item.commoditiesImage}}" />
|
<image class="image" mode="scaleToFill" src="{{item.commoditiesImage}}" />
|
||||||
</view>
|
</view>
|
||||||
<view style="width:100%">
|
<view style="width:100%">
|
||||||
<view class="dingwei" style="width:120px;height:20px;top: 35rpx;">
|
<view class="dingwei" style="width:150px;height:20px;top: 35rpx;">
|
||||||
<text>{{item.commoditiesName}}</text>
|
<text>{{item.commoditiesName}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="dingwei" style="width:170px;height:40px;top:50rpx">
|
<view class="dingwei" style="width:170px;height:40px;top:50rpx">
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<text>预约</text>
|
<text>预约</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="dingwei" style="left:300rpx;bottom:130rpx" onTap="soucang">
|
<view class="dingwei" style="width:20px;left:290rpx;bottom:130rpx" onTap="jiaru" data-num="{{item}}">
|
||||||
<image class="gouimage" mode="scaleToFill" src="../image/tijiagouwuche.png" />
|
<image class="gouimage" mode="scaleToFill" src="../image/tijiagouwuche.png" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -83,15 +83,15 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- 评价 -->
|
<!-- 评价 -->
|
||||||
<view class="pingjia" a:if="{{ showComments }}">
|
<view class="pingjia" a:if="{{ showComments }}">
|
||||||
<view class="pingjiakuang">
|
<view class="pingjiakuang" a:for="{{ pingjia }}">
|
||||||
<view class="touxiang">
|
<view class="touxiang">
|
||||||
<image class="pingjiaimage" mode="scaleToFill" src="../image/meijia1.jpg" />
|
<image class="pingjiaimage" mode="scaleToFill" src="{{item.user.avatarUrl}}" />
|
||||||
<text style="margin-left:10rpx">陌路</text>
|
<text style="margin-left:10rpx">{{item.user.username}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="width:100%">
|
<view style="width:100%">
|
||||||
<text style="color:#8a8f93;font-size:13px">颜色:冰透系列裸色01色+烤灯-简约</text>
|
<text style="color:#8a8f93;font-size:13px">颜色:冰透系列裸色01色+烤灯-简约</text>
|
||||||
<view style="width:100%;word-wrap: break-word;">
|
<view style="width:100%;word-wrap: break-word;">
|
||||||
<text>aslkjhdklajshdkalsdhaskljdhaskldhaskhdaksjhdkjsh</text>
|
<text>{{item.userRating.review}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tupianbox">
|
<view class="tupianbox">
|
||||||
|
|
|
@ -42,6 +42,7 @@ Page({
|
||||||
showShoppingCart: true, // 控制购物车部分是否显示
|
showShoppingCart: true, // 控制购物车部分是否显示
|
||||||
showComments: false, // 控制评论部分是否显示
|
showComments: false, // 控制评论部分是否显示
|
||||||
showBusinessInfo: false, // 控制商家信息是否显示
|
showBusinessInfo: false, // 控制商家信息是否显示
|
||||||
|
pingjia:[],
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// Extract userId and address from options
|
// Extract userId and address from options
|
||||||
|
@ -54,7 +55,7 @@ Page({
|
||||||
const storeStatus = options.storeStatus;
|
const storeStatus = options.storeStatus;
|
||||||
const id = options.id
|
const id = options.id
|
||||||
const businessPhone = options.businessPhone
|
const businessPhone = options.businessPhone
|
||||||
console.log(id,'zheyedesaksdas');
|
console.log(id,'这是店铺id吗');
|
||||||
// Set them in data for use in the page
|
// Set them in data for use in the page
|
||||||
this.setData({
|
this.setData({
|
||||||
userId: userId,
|
userId: userId,
|
||||||
|
@ -72,10 +73,10 @@ Page({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
businessId: id,
|
businessId: id,
|
||||||
commoditiesGroupId: id,
|
commoditiesGroupId: "",
|
||||||
commoditiesName: "",
|
commoditiesName: "",
|
||||||
current: 0,
|
current: 0,
|
||||||
pageSize: 2,
|
pageSize: 100,
|
||||||
sortField: "",
|
sortField: "",
|
||||||
sortOrder: "",
|
sortOrder: "",
|
||||||
status: "",
|
status: "",
|
||||||
|
@ -101,7 +102,7 @@ Page({
|
||||||
console.error('Request failed', error);
|
console.error('Request failed', error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.pingjia()
|
||||||
},
|
},
|
||||||
soucang() {
|
soucang() {
|
||||||
my.getStorage({
|
my.getStorage({
|
||||||
|
@ -115,7 +116,8 @@ Page({
|
||||||
url: url + '/api/collect/add',
|
url: url + '/api/collect/add',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
businessId: businessId // 使用 businessId 来请求收藏
|
businessId: businessId, // 使用 businessId 来请求收藏
|
||||||
|
userId: userInfo.id
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
|
@ -123,6 +125,7 @@ Page({
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
if(res.data.code===0){
|
if(res.data.code===0){
|
||||||
my.alert({
|
my.alert({
|
||||||
content: '收藏成功'
|
content: '收藏成功'
|
||||||
|
@ -159,57 +162,37 @@ Page({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// meijiahsi(){
|
|
||||||
// my.request({
|
|
||||||
// url: url + '/api/manicurist/userQueryAll',
|
|
||||||
// method: 'GET',
|
|
||||||
// data: {
|
|
||||||
// businessId: this.data.id
|
|
||||||
// },
|
|
||||||
// headers: {
|
|
||||||
// 'content-type': 'application/json',
|
|
||||||
// },
|
|
||||||
// dataType: 'json',
|
|
||||||
// success: (res) => {
|
|
||||||
// console.log('Request succeeded:', res);
|
|
||||||
// if (res.data && res.data.data) {
|
|
||||||
// this.setData({
|
|
||||||
// meijiashi: res.data.data, // 更新 tuijian 列表
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// console.log('shibaile')
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// fail: (error) => {
|
|
||||||
// console.error('Request failed', error);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
pingjia(){
|
pingjia(){
|
||||||
my.navigateTo({
|
my.request({
|
||||||
url:'/pages/shangpinpingjia/shangpinpingjia'
|
url: url + '/api/level/listBusinessRating',
|
||||||
})
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
businessId:this.data.id,
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res,'评价部分');
|
||||||
|
if(res.data.code===0){
|
||||||
|
this.setData({
|
||||||
|
pingjia:res.data.data,
|
||||||
|
useridpingjia:res.data.data.userId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
zixun(){
|
zixun(){
|
||||||
my.navigateTo({
|
my.navigateTo({
|
||||||
url:'/pages/zixunmeijiashi/zixunmeijiashi'
|
url:'/pages/zixunmeijiashi/zixunmeijiashi'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
shangpinjiemian(item){
|
|
||||||
const id = item.target.dataset.num
|
|
||||||
console.log('传递的数据:', id);
|
|
||||||
const ids = id.id
|
|
||||||
const commoditiesPrice = id.commoditiesPrice
|
|
||||||
const commoditiesName = id.commoditiesName
|
|
||||||
const commoditiesImage = id.commoditiesImage
|
|
||||||
const businessId = id.businessId
|
|
||||||
console.log('Address being passed: ',id,commoditiesPrice,commoditiesName,commoditiesImage,businessId);
|
|
||||||
my.navigateTo({
|
|
||||||
url:`/pages/shangpinjiemian/shangpinjiemian?commoditiesPrice=${commoditiesPrice}&&commoditiesName=${commoditiesName}&&commoditiesImage=${commoditiesImage}&&ids=${ids}&&businessId=${businessId}`
|
|
||||||
})
|
|
||||||
console.log(ids,businessId,commoditiesImage,commoditiesName,commoditiesPrice+'这是商品的')
|
|
||||||
},
|
|
||||||
// 点击事件处理函数
|
// 点击事件处理函数
|
||||||
selectItem(e) {
|
selectItem(e) {
|
||||||
const id = e.currentTarget.dataset.id;
|
const id = e.currentTarget.dataset.id;
|
||||||
|
@ -282,4 +265,80 @@ chaxunzhuangtai(e) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
jiaru(item) {
|
||||||
|
const id = item.target.dataset.num
|
||||||
|
console.log('传递的数据:', id);
|
||||||
|
const ids = id.id
|
||||||
|
const businessId = id.businessId
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
console.log(userInfo);
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/cart/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
businessId: businessId,
|
||||||
|
commoditiesId: ids,
|
||||||
|
quantity: 1,
|
||||||
|
selectedOptions: "",
|
||||||
|
userId: userInfo.id
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie, // 通过头部传递 cookie
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
if(res.data.code===0){
|
||||||
|
console.log(res);
|
||||||
|
my.alert({ content: '成功添加到购物车' });
|
||||||
|
}
|
||||||
|
else if(res.data.code===40100){
|
||||||
|
my.alert({
|
||||||
|
content: '登录信息已过期,请重新登录'
|
||||||
|
});
|
||||||
|
my.navigateTo({
|
||||||
|
url:'/pages/denglu/denglu'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
console.log(res,'shibaile');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
my.alert({
|
||||||
|
content: '您未登录,请先登录。',
|
||||||
|
success: () => {
|
||||||
|
my.navigateTo({
|
||||||
|
url: '/pages/denglu/denglu',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
shangpinjiemian(item){
|
||||||
|
const id = item.target.dataset.num
|
||||||
|
console.log('传递的数据:', id);
|
||||||
|
const ids = id.id
|
||||||
|
const commoditiesPrice = id.commoditiesPrice
|
||||||
|
const commoditiesName = id.commoditiesName
|
||||||
|
const commoditiesImage = id.commoditiesImage
|
||||||
|
const businessId = id.businessId
|
||||||
|
const dianpuid = this.data.id
|
||||||
|
const businessName =this.data.businessName
|
||||||
|
console.log('Address being passed: ',id,commoditiesPrice,commoditiesName,commoditiesImage,businessId);
|
||||||
|
my.navigateTo({
|
||||||
|
url:`/pages/shangpinjiemian/shangpinjiemian?commoditiesPrice=${commoditiesPrice}&&commoditiesName=${commoditiesName}&&commoditiesImage=${commoditiesImage}&&ids=${ids}&&businessId=${businessId}&&dianpuid=${dianpuid}&&businessName=${businessName}`
|
||||||
|
})
|
||||||
|
console.log(ids,businessId,commoditiesImage,commoditiesName,commoditiesPrice+'这是商品的',dianpuid+'这是店铺的')
|
||||||
|
},
|
||||||
});
|
});
|
|
@ -127,10 +127,10 @@ calculateTotalPrice() {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 页面加载时获取商品数据
|
// 页面加载时获取商品数据
|
||||||
onLoad() {
|
onShow() {
|
||||||
this.setData({
|
this.setData({
|
||||||
select_all: false,
|
select_all: false,
|
||||||
products:[],
|
selectedProducts:[],
|
||||||
});
|
});
|
||||||
my.getStorage({
|
my.getStorage({
|
||||||
key: 'userInfo',
|
key: 'userInfo',
|
||||||
|
@ -140,13 +140,16 @@ calculateTotalPrice() {
|
||||||
my.request({
|
my.request({
|
||||||
url: url + '/api/cart/selectByUserId',
|
url: url + '/api/cart/selectByUserId',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: { id: this.data.id },
|
data: {
|
||||||
|
id: userInfo.id
|
||||||
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
'Cookie': userInfo.cookie,
|
'Cookie': userInfo.cookie,
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
|
console.log(res,'hhhhhhhhhhhh');
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
const cartItems = res.data.data;
|
const cartItems = res.data.data;
|
||||||
|
@ -191,14 +194,21 @@ calculateTotalPrice() {
|
||||||
const userInfo = res.data;
|
const userInfo = res.data;
|
||||||
this.setData({
|
this.setData({
|
||||||
id: userInfo.id, // 获取 id
|
id: userInfo.id, // 获取 id
|
||||||
|
|
||||||
});
|
});
|
||||||
// 发送请求移除商品
|
// 发送请求移除商品
|
||||||
if (userInfo && userInfo.cookie) {
|
if (userInfo && userInfo.cookie) {
|
||||||
my.request({
|
my.request({
|
||||||
url: url + '/api/cart/delete',
|
url: url + '/api/cart/delete',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: { id: cartId }, // 使用 cartId 作为参数
|
data: {
|
||||||
headers: { 'content-type': 'application/json', 'Cookie': userInfo.cookie },
|
id: cartId,
|
||||||
|
userId: userInfo.id
|
||||||
|
}, // 使用 cartId 作为参数
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie
|
||||||
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
|
BIN
甲情_甲意/miniprogram/pages/image/duihao.png
Normal file
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 397 B After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 371 B After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 3.5 KiB |
|
@ -1,8 +1,6 @@
|
||||||
.container {
|
.container {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.section-title {
|
.section-title {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -72,19 +70,24 @@
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
.button {
|
.button {
|
||||||
background-color: #f3bfc1; /* Light pink background color */
|
width: 80%;
|
||||||
color: #000000; /* Text color */
|
height: 40px;
|
||||||
border-radius: 20px; /* Rounded edges */
|
background-color: #f3bfc1;
|
||||||
padding: 10px 20px;
|
color: #000000;
|
||||||
text-align: center;
|
border-radius: 20px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
width: 300px;
|
display: flex;
|
||||||
margin-top: 20px;
|
justify-content: center;
|
||||||
cursor: pointer; /* 鼠标悬停时显示为点击样式 */
|
align-items: center;
|
||||||
position: relative;
|
|
||||||
left: 20px;
|
|
||||||
}
|
}
|
||||||
.box{
|
.box{
|
||||||
position: relative;
|
position: relative;
|
||||||
right: 13px;
|
right: 13px;
|
||||||
}
|
}
|
||||||
|
.tijiao{
|
||||||
|
width: 100%;
|
||||||
|
height: 100px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
|
@ -5,6 +5,10 @@
|
||||||
<text class="label">姓名</text>
|
<text class="label">姓名</text>
|
||||||
<input class="input" placeholder="请输入姓名" onInput="businessName"/>
|
<input class="input" placeholder="请输入姓名" onInput="businessName"/>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="input-row">
|
||||||
|
<text class="label">性别</text>
|
||||||
|
<input class="input" placeholder="请输入性别" onInput="xingbie"/>
|
||||||
|
</view>
|
||||||
<view class="input-row">
|
<view class="input-row">
|
||||||
<text class="label">电子邮箱</text>
|
<text class="label">电子邮箱</text>
|
||||||
<input class="input" placeholder="请输入电子邮箱" onInput="person" />
|
<input class="input" placeholder="请输入电子邮箱" onInput="person" />
|
||||||
|
@ -23,6 +27,10 @@
|
||||||
<text class="label">身份证号</text>
|
<text class="label">身份证号</text>
|
||||||
<input class="input" placeholder="请输入身份证号" onInput="idcard"/>
|
<input class="input" placeholder="请输入身份证号" onInput="idcard"/>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="input-row">
|
||||||
|
<text class="label">擅长项目</text>
|
||||||
|
<input class="input" placeholder="请输入擅长项目" onInput="shanchang"/>
|
||||||
|
</view>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<ant-list-item>
|
<ant-list-item>
|
||||||
请选择省市
|
请选择省市
|
||||||
|
@ -42,24 +50,14 @@
|
||||||
<view class="input-row">
|
<view class="input-row">
|
||||||
<text class="label">请上传美甲师证明</text>
|
<text class="label">请上传美甲师证明</text>
|
||||||
<ant-uploader
|
<ant-uploader
|
||||||
defaultFileList="{{defaultFileList}}"
|
|
||||||
onChange="onChange"
|
onChange="onChange"
|
||||||
onUpload="onUpload"
|
onUpload="{{onUpload ? onUpload : 'onUpload'}}"
|
||||||
onPreview="onPreview"
|
uploadingText="上传中……"
|
||||||
onRemove="onRemove"
|
uploadfailedText="上传失败"
|
||||||
/>
|
></ant-uploader>
|
||||||
</view>
|
</view>
|
||||||
<view class="input-row">
|
|
||||||
<text class="label">请上传身份证照</text>
|
|
||||||
<ant-uploader
|
|
||||||
defaultFileList="{{defaultFileList}}"
|
|
||||||
onChange="onChange"
|
|
||||||
onUpload="onUpload"
|
|
||||||
onPreview="onPreview"
|
|
||||||
onRemove="onRemove"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="tijiao">
|
||||||
<view class="button" onTap="ruzhu">提交申请</view>
|
<view class="button" onTap="ruzhu">提交申请</view>
|
||||||
</view>
|
</view>
|
|
@ -29,14 +29,15 @@ Page({
|
||||||
url: url + '/api/manicurist/add',
|
url: url + '/api/manicurist/add',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
certificate_path: this.data.selectedOption,
|
certificate_path: this.data.zhengshu,
|
||||||
certification_number: this.data.idcard,
|
certification_number: this.data.idcard,
|
||||||
email: this.data.person,
|
email: this.data.person,
|
||||||
gender: 0,
|
gender: this.data.xingbie,
|
||||||
issuing_authority: "hhh",
|
issuing_authority: this.data.selectedOption,
|
||||||
manicuristName: this.data.businessName,
|
manicuristName: this.data.businessName,
|
||||||
phone: this.data.phone,
|
phone: this.data.phone,
|
||||||
specialties: "hhh"
|
specialties: this.data.shanchang,
|
||||||
|
userId: userInfo.id
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
|
@ -44,17 +45,18 @@ Page({
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
if(res.data.code===0){
|
if(res.data.code===0){
|
||||||
my.navigateBack();
|
my.navigateBack();
|
||||||
my.alert({content:res.data.description})
|
my.alert({content:'审核中请耐心等待'})
|
||||||
}
|
}
|
||||||
elif(res.data.code===50001)
|
elif(res.data.code===50001)
|
||||||
{
|
{
|
||||||
my.alert({content:res.data.description})
|
my.alert({content:'姓名已存在或参数有误'})
|
||||||
}
|
}
|
||||||
elif(res.data.code===40100)
|
elif(res.data.code===40100)
|
||||||
{
|
{
|
||||||
my.alert({content:res.data.description})
|
my.alert({content:'请先登录'})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: (error) => {
|
fail: (error) => {
|
||||||
|
@ -82,6 +84,18 @@ Page({
|
||||||
});
|
});
|
||||||
console.log(e.detail.value);
|
console.log(e.detail.value);
|
||||||
},
|
},
|
||||||
|
shanchang(e) {
|
||||||
|
this.setData({
|
||||||
|
shanchang: e.detail.value,
|
||||||
|
});
|
||||||
|
console.log(e.detail.value);
|
||||||
|
},
|
||||||
|
xingbie(e) {
|
||||||
|
this.setData({
|
||||||
|
xingbie: e.detail.value,
|
||||||
|
});
|
||||||
|
console.log(e.detail.value);
|
||||||
|
},
|
||||||
person(e) {
|
person(e) {
|
||||||
this.setData({
|
this.setData({
|
||||||
person: e.detail.value,
|
person: e.detail.value,
|
||||||
|
@ -174,7 +188,59 @@ validateForm() {
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!this.data.zhengshu) {
|
||||||
|
my.showToast({
|
||||||
|
content: '请选择省市',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!this.data.shanchang) {
|
||||||
|
my.showToast({
|
||||||
|
content: '请选择省市',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!this.data.xingbie) {
|
||||||
|
my.showToast({
|
||||||
|
content: '请选择省市',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true; // 所有验证通过
|
return true; // 所有验证通过
|
||||||
},
|
},
|
||||||
|
// 证明
|
||||||
|
onUpload(file) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
console.log('上传文件路径:', file); // 确保文件路径正确
|
||||||
|
my.uploadFile({
|
||||||
|
url: url + '/api/file/upload/server/not_login',
|
||||||
|
fileType: 'image',
|
||||||
|
name: 'file',
|
||||||
|
filePath: file.path,
|
||||||
|
formData: {
|
||||||
|
biz: 'card',
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
resolve(file.path);
|
||||||
|
console.log('上传成功:', res);
|
||||||
|
const cunchu = JSON.parse(res.data)
|
||||||
|
this.setData({
|
||||||
|
zhengshu:cunchu.data,
|
||||||
|
})
|
||||||
|
console.log(this.data.yingyeimage,'hhhhhhhhhhhhhhh');
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log('上传失败:', err);
|
||||||
|
reject();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -72,19 +72,24 @@
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
.button {
|
.button {
|
||||||
background-color: #f3bfc1; /* Light pink background color */
|
width: 80%;
|
||||||
color: #000000; /* Text color */
|
height: 40px;
|
||||||
border-radius: 20px; /* Rounded edges */
|
background-color: #f3bfc1;
|
||||||
padding: 10px 20px;
|
color: #000000;
|
||||||
text-align: center;
|
border-radius: 20px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
width: 300px;
|
display: flex;
|
||||||
margin-top: 20px;
|
justify-content: center;
|
||||||
cursor: pointer; /* 鼠标悬停时显示为点击样式 */
|
align-items: center;
|
||||||
position: relative;
|
|
||||||
left: 20px;
|
|
||||||
}
|
}
|
||||||
.box{
|
.box{
|
||||||
position: relative;
|
position: relative;
|
||||||
right: 13px;
|
right: 13px;
|
||||||
}
|
}
|
||||||
|
.tijiao{
|
||||||
|
width: 100%;
|
||||||
|
height: 100px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
|
@ -11,17 +11,22 @@
|
||||||
<icon type="eye" />
|
<icon type="eye" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="section">
|
<view class="section">
|
||||||
|
|
||||||
|
|
||||||
<view class="input-row">
|
<view class="input-row">
|
||||||
<text class="label">联系方式</text>
|
<text class="label">联系方式</text>
|
||||||
<input class="input" placeholder="请输入联系人电话" onInput="phone"/>
|
<input class="input" placeholder="请输入联系人电话" onInput="phone"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="input-row">
|
<!-- <view class="input-row">
|
||||||
<text class="label">身份证号</text>
|
<text class="label">身份证号</text>
|
||||||
<input class="input" placeholder="请输入身份证号" onInput="idcard"/>
|
<input class="input" placeholder="请输入身份证号" onInput="idcard"/>
|
||||||
|
</view> -->
|
||||||
|
<view class="input-row">
|
||||||
|
<text class="label">账号</text>
|
||||||
|
<input class="input" placeholder="请输入账号" onInput="userAccount"/>
|
||||||
|
</view>
|
||||||
|
<view class="input-row">
|
||||||
|
<text class="label">密码</text>
|
||||||
|
<input class="input" placeholder="请输入密码" onInput="userPassword"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<ant-list-item>
|
<ant-list-item>
|
||||||
|
@ -41,24 +46,32 @@
|
||||||
<view class="input-row">
|
<view class="input-row">
|
||||||
<text class="label">请上传营业执照</text>
|
<text class="label">请上传营业执照</text>
|
||||||
<ant-uploader
|
<ant-uploader
|
||||||
defaultFileList="{{defaultFileList}}"
|
|
||||||
onChange="onChange"
|
onChange="onChange"
|
||||||
onUpload="onUpload"
|
onUpload="{{onUpload ? onUpload : 'onUpload'}}"
|
||||||
onPreview="onPreview"
|
uploadingText="上传中……"
|
||||||
onRemove="onRemove"
|
uploadfailedText="上传失败"
|
||||||
/>
|
></ant-uploader>
|
||||||
</view>
|
</view>
|
||||||
<view class="input-row">
|
<view class="input-row">
|
||||||
<text class="label">请上传身份证照</text>
|
<text class="label">请上传身份证正面照</text>
|
||||||
<ant-uploader
|
<ant-uploader
|
||||||
defaultFileList="{{defaultFileList}}"
|
onChange="onChange"
|
||||||
onChange="onChange"
|
onUpload="{{onUpload1 ? onUpload1 : 'onUpload1'}}"
|
||||||
onUpload="onUpload"
|
uploadingText="上传中……"
|
||||||
onPreview="onPreview"
|
uploadfailedText="上传失败"
|
||||||
onRemove="onRemove"
|
></ant-uploader>
|
||||||
/>
|
</view>
|
||||||
|
<view class="input-row">
|
||||||
|
<text class="label">请上传身份证反面照</text>
|
||||||
|
<ant-uploader
|
||||||
|
onChange="onChange"
|
||||||
|
onUpload="{{onUpload2 ? onUpload2 : 'onUpload2'}}"
|
||||||
|
uploadingText="上传中……"
|
||||||
|
uploadfailedText="上传失败"
|
||||||
|
></ant-uploader>
|
||||||
</view>
|
</view>
|
||||||
<view class="button" onTap="ruzhu">提交申请</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="tijiao">
|
||||||
|
<view class="button" onTap="ruzhu">提交申请</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import cityList from './city';
|
import cityList from './city';
|
||||||
|
import {url} from '../request'
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
cityList,
|
cityList,
|
||||||
|
@ -7,30 +8,38 @@ Page({
|
||||||
},
|
},
|
||||||
onLoad() {},
|
onLoad() {},
|
||||||
ruzhu(){
|
ruzhu(){
|
||||||
// my.request({
|
if (!this.validateForm()) {
|
||||||
// url: url+'/api/business/add',
|
return; // 验证未通过,阻止提交
|
||||||
// method: 'POST',
|
}
|
||||||
// data: {
|
my.request({
|
||||||
|
url: url+'/api/business/add',
|
||||||
// },
|
method: 'POST',
|
||||||
// headers: {
|
data: {
|
||||||
// 'content-type': 'application/json', //默认值
|
address: this.data.selectedOption,
|
||||||
// },
|
backIdCard: this.data.backIdCard,
|
||||||
// dataType: 'json',
|
businessName: this.data.businessName,
|
||||||
// success: (res)=> {
|
businessPhone: this.data.phone,
|
||||||
// my.alert({ content: 'success' });
|
frontIdCard:this.data.frontIdCard,
|
||||||
// },
|
license: this.data.yingyeimage,
|
||||||
// fail: function (error) {
|
shopkeeper: this.data.person,
|
||||||
// console.error('fail: ', JSON.stringify(error));
|
userAccount: this.data.userAccount,
|
||||||
// },
|
userPassword: this.data.userPassword
|
||||||
// complete: function (res) {
|
},
|
||||||
// my.hideLoading();
|
headers: {
|
||||||
// my.alert({ content: 'complete' });
|
'content-type': 'application/json', //默认值
|
||||||
// },
|
},
|
||||||
// });
|
dataType: 'json',
|
||||||
my.alert({ content: '正在审核中,请耐心等待' });
|
success: (res)=> {
|
||||||
my.navigateBack()
|
console.log(res);
|
||||||
|
my.alert({ content: '正在审核中,请耐心等待' });
|
||||||
|
my.navigateBack()
|
||||||
|
},
|
||||||
|
fail: function (error) {
|
||||||
|
console.error('fail: ', JSON.stringify(error));
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
// 获取数据
|
||||||
businessName(e) {
|
businessName(e) {
|
||||||
this.setData({
|
this.setData({
|
||||||
businessName: e.detail.value,
|
businessName: e.detail.value,
|
||||||
|
@ -49,10 +58,220 @@ Page({
|
||||||
});
|
});
|
||||||
console.log(e.detail.value);
|
console.log(e.detail.value);
|
||||||
},
|
},
|
||||||
idcard(e) {
|
// idcard(e) {
|
||||||
|
// this.setData({
|
||||||
|
// idcard: e.detail.value,
|
||||||
|
// });
|
||||||
|
// console.log(e.detail.value);
|
||||||
|
// },
|
||||||
|
userAccount(e) {
|
||||||
this.setData({
|
this.setData({
|
||||||
idcard: e.detail.value,
|
userAccount: e.detail.value,
|
||||||
});
|
});
|
||||||
console.log(e.detail.value);
|
console.log(e.detail.value);
|
||||||
},
|
},
|
||||||
|
userPassword(e) {
|
||||||
|
this.setData({
|
||||||
|
userPassword: e.detail.value,
|
||||||
|
});
|
||||||
|
console.log(e.detail.value);
|
||||||
|
},
|
||||||
|
// 地点选择
|
||||||
|
handleCascaderPickerChange(cascaderValue, selectedOption, e) {
|
||||||
|
console.log('cityChange', cascaderValue, selectedOption, e);
|
||||||
|
},
|
||||||
|
handleCascaderOnOk(cascaderValue, selectedOption, e) {
|
||||||
|
console.log('cityOk', cascaderValue, selectedOption, e);
|
||||||
|
const selectedCityLabels = selectedOption.map(option => option.label).join(' ');
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
selectedOption: selectedCityLabels
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('Selected cities:', this.data.selectedOption);
|
||||||
|
},
|
||||||
|
// 前端校验
|
||||||
|
validateForm() {
|
||||||
|
// 验证店铺名(非空)
|
||||||
|
if (!this.data.businessName) {
|
||||||
|
my.showToast({
|
||||||
|
content: '店铺名不能为空',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!this.data.userPassword&&this.data.userPassword.length>=8) {
|
||||||
|
my.showToast({
|
||||||
|
content: '密码不能为空,并且不少于8位',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!this.data.userAccount) {
|
||||||
|
my.showToast({
|
||||||
|
content: '账号不能为空',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!this.data.person) {
|
||||||
|
my.showToast({
|
||||||
|
content: '姓名不能为空',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 验证电话(简单的正则校验)
|
||||||
|
const phoneRegex = /^1[3-9]\d{9}$/;
|
||||||
|
if (!this.data.phone || !phoneRegex.test(this.data.phone)) {
|
||||||
|
my.showToast({
|
||||||
|
content: '请输入有效的手机号码',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证身份证号(简单的正则校验)
|
||||||
|
// const idcardRegex = /^\d{17}(\d|X)$/;
|
||||||
|
// if (!this.data.idcard || !idcardRegex.test(this.data.idcard)) {
|
||||||
|
// my.showToast({
|
||||||
|
// content: '请输入有效的身份证号',
|
||||||
|
// type: 'none',
|
||||||
|
// duration: 2000,
|
||||||
|
// });
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 验证是否选择了城市
|
||||||
|
if (!this.data.selectedOption) {
|
||||||
|
my.showToast({
|
||||||
|
content: '请选择省市',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 验证图片是否上传
|
||||||
|
if (!this.data.yingyeimage) {
|
||||||
|
my.showToast({
|
||||||
|
content: '请上传营业执照',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.data.frontIdCard) {
|
||||||
|
my.showToast({
|
||||||
|
content: '请上传身份证正面照',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.data.backIdCard) {
|
||||||
|
my.showToast({
|
||||||
|
content: '请上传身份证反面照',
|
||||||
|
type: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true; // 所有验证通过
|
||||||
|
},
|
||||||
|
onChange(fileList) {
|
||||||
|
|
||||||
|
console.log('图片列表:', fileList);
|
||||||
|
},
|
||||||
|
// 营业执照
|
||||||
|
onUpload(file) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
console.log('上传文件路径:', file); // 确保文件路径正确
|
||||||
|
my.uploadFile({
|
||||||
|
url: url + '/api/file/upload/server/not_login',
|
||||||
|
fileType: 'image',
|
||||||
|
name: 'file',
|
||||||
|
filePath: file.path,
|
||||||
|
formData: {
|
||||||
|
biz: 'card',
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
resolve(file.path);
|
||||||
|
console.log('上传成功:', res);
|
||||||
|
const cunchu = JSON.parse(res.data)
|
||||||
|
this.setData({
|
||||||
|
yingyeimage:cunchu.data,
|
||||||
|
})
|
||||||
|
console.log(this.data.yingyeimage,'hhhhhhhhhhhhhhh');
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log('上传失败:', err);
|
||||||
|
reject();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 身份证正面
|
||||||
|
onUpload1(file) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
console.log('上传文件路径:', file); // 确保文件路径正确
|
||||||
|
my.uploadFile({
|
||||||
|
url: url + '/api/file/upload/server/not_login',
|
||||||
|
fileType: 'image',
|
||||||
|
name: 'file',
|
||||||
|
filePath: file.path,
|
||||||
|
formData: {
|
||||||
|
biz: 'card',
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
resolve(file.path);
|
||||||
|
console.log('上传成功:', res);
|
||||||
|
const cunchu = JSON.parse(res.data)
|
||||||
|
this.setData({
|
||||||
|
frontIdCard:cunchu.data,
|
||||||
|
})
|
||||||
|
console.log(this.data.yingyeimage,'hhhhhhhhhhhhhhh');
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log('上传失败:', err);
|
||||||
|
reject();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 身份证反面
|
||||||
|
onUpload2(file) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
console.log('上传文件路径:', file); // 确保文件路径正确
|
||||||
|
my.uploadFile({
|
||||||
|
url: url + '/api/file/upload/server/not_login',
|
||||||
|
fileType: 'image',
|
||||||
|
name: 'file',
|
||||||
|
filePath: file.path,
|
||||||
|
formData: {
|
||||||
|
biz: 'card',
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
resolve(file.path);
|
||||||
|
console.log('上传成功:', res);
|
||||||
|
const cunchu = JSON.parse(res.data)
|
||||||
|
this.setData({
|
||||||
|
backIdCard:cunchu.data,
|
||||||
|
})
|
||||||
|
console.log(this.data.yingyeimage,'hhhhhhhhhhhhhhh');
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log('上传失败:', err);
|
||||||
|
reject();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
|
|
||||||
.search-line {
|
.search-line {
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: space-between;
|
||||||
padding: 16px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
.cancel {
|
.cancel {
|
||||||
margin-left: 8px;
|
color: var(--color-text-primary);
|
||||||
|
|
||||||
}
|
}
|
||||||
.image1{
|
.image1{
|
||||||
width: 30rpx;
|
width: 30rpx;
|
||||||
|
@ -89,3 +90,13 @@
|
||||||
margin-top: 50rpx;
|
margin-top: 50rpx;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
.dingweikuang{
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
left: 50rpx;
|
||||||
|
top: 30rpx;
|
||||||
|
}
|
||||||
|
.dingweiimage{
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
}
|
|
@ -1,36 +1,25 @@
|
||||||
<view>
|
<view class="box1">
|
||||||
<view style="width:100%;margin-top:20rpx">
|
<!-- 搜索框 -->
|
||||||
|
<view class="box">
|
||||||
<view class="search-line">
|
<view class="search-line">
|
||||||
<ant-input
|
<view style="display:flex;align-items:center">
|
||||||
placeholder="请输入内容"
|
<image style="width:20px;height:20px" mode="scaleToFill" src="../image/sousuo.png" />
|
||||||
onChange="onChange"
|
<input onInput="onChange" onConfirm="onConfirm" style="margin-left:10rpx;width:230px" placeholder="请输入内容" />
|
||||||
className="search-bar"
|
|
||||||
focusClassName="search-bar-focus"
|
|
||||||
confirmType="search"
|
|
||||||
allowClear
|
|
||||||
focus
|
|
||||||
onConfirm="onConfirm"
|
|
||||||
>
|
|
||||||
<ant-icon
|
|
||||||
slot="prefix"
|
|
||||||
type="SearchOutline"
|
|
||||||
></ant-icon>
|
|
||||||
<ant-icon
|
|
||||||
slot="suffix"
|
|
||||||
type="AudioOutline"
|
|
||||||
></ant-icon>
|
|
||||||
</ant-input>
|
|
||||||
<view class="cancel">
|
|
||||||
<image mode="scaleToFill" class="image1" src="../image/dingwei.png" />
|
|
||||||
<text style="margin-left:8rpx">{{selectedCity}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="cancel">取消</view>
|
||||||
</view>
|
</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>
|
||||||
<!-- 店铺界面 -->
|
<!-- 店铺界面 -->
|
||||||
<view style="width:100%">
|
<view style="width:100%">
|
||||||
<view class="box2" >
|
<view class="box2" >
|
||||||
<view class="kuang" a:for="{{ xuanran }}" a:key="{{index}}" data-num="{{item}}" onTap="dianpu">
|
<view class="kuang" a:for="{{ xuanran }}" a:key="{{index}}" data-num="{{item}}" a:if="{{ item.state==1 }}" onTap="dianpu">
|
||||||
<image class="image" mode="scaleToFill" src="{{item.businessAvatar}}" />
|
<image class="image" mode="scaleToFill" src="{{item.businessAvatar}}" />
|
||||||
<view class="wenzi">
|
<view class="wenzi">
|
||||||
<text class="text">{{item.businessName}}</text>
|
<text class="text">{{item.businessName}}</text>
|
||||||
|
|
|
@ -106,13 +106,16 @@ Page({
|
||||||
console.log('Address being passed: ', ID,address,businessName,businessAvatar,endBusiness,startBusiness,businessPhone);
|
console.log('Address being passed: ', ID,address,businessName,businessAvatar,endBusiness,startBusiness,businessPhone);
|
||||||
|
|
||||||
my.navigateTo({
|
my.navigateTo({
|
||||||
url: `/pages/dianpuzhuye/dianpuzhuye?userId=${userId}&&address=${address}&&businessName=${businessName}&&businessAvatar=${businessAvatar}&&startBusiness=${startBusiness}&&endBusiness=${endBusiness}&&storeStatus=${storeStatus}&&id=${ID}&&businessPhone=${businessPhone}`,
|
url: `/pages/shnagmendianpu/shnagmendianpu?userId=${userId}&&address=${address}&&businessName=${businessName}&&businessAvatar=${businessAvatar}&&startBusiness=${startBusiness}&&endBusiness=${endBusiness}&&storeStatus=${storeStatus}&&id=${ID}&&businessPhone=${businessPhone}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onChange(value) {
|
onChange(e) {
|
||||||
this.setData({
|
this.setData({
|
||||||
inputtext:value
|
inputtext:e.detail.value,
|
||||||
})
|
});
|
||||||
|
console.log(e.detail.value);
|
||||||
console.log(this.data.inputtext);
|
console.log(this.data.inputtext);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,10 +6,9 @@
|
||||||
/* 价格 */
|
/* 价格 */
|
||||||
.box1{
|
.box1{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 80px;
|
display: flex;
|
||||||
background-color: #eec2c7;
|
background-color: #eec2c7;
|
||||||
position: relative;
|
position: relative;
|
||||||
top:0rpx;
|
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
}
|
}
|
||||||
.z1{
|
.z1{
|
||||||
|
@ -18,45 +17,33 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.z2{
|
.z2{
|
||||||
top: 80rpx;
|
|
||||||
right: 140rpx;
|
|
||||||
position: relative;
|
|
||||||
font-weight: bolder;
|
font-weight: bolder;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
/* 商品底部 */
|
|
||||||
/* 商品价格 */
|
|
||||||
|
|
||||||
.z3{
|
.z3{
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
font-weight: bolder;
|
font-weight: bolder;
|
||||||
position: relative;
|
|
||||||
top:25rpx;
|
|
||||||
right: 60rpx;
|
|
||||||
}
|
}
|
||||||
.z4{
|
.z4{
|
||||||
position: relative;
|
position: relative;
|
||||||
color: rgb(29, 18, 18);
|
color: rgb(29, 18, 18);
|
||||||
}
|
}
|
||||||
.box8{
|
.box8{
|
||||||
width: 400rpx;
|
display:flex;
|
||||||
position: relative;
|
flex-direction: column;
|
||||||
left: 240rpx;
|
width: 60%;
|
||||||
top: 25rpx;
|
|
||||||
}
|
}
|
||||||
/* 商品介绍 */
|
/* 商品介绍 */
|
||||||
.z5{
|
.z5{
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
position: relative;
|
|
||||||
top:20rpx;
|
|
||||||
color: darkgrey;
|
color: darkgrey;
|
||||||
left: 5px;
|
|
||||||
}
|
}
|
||||||
.time{
|
.time{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 400px;
|
height: auto;
|
||||||
border-top: 2px solid #aba8a8;
|
border-top: 2px solid #aba8a8;
|
||||||
margin-top: 40rpx;
|
margin-top: 40rpx;
|
||||||
|
margin-bottom: 130rpx;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
}
|
}
|
||||||
.yuyuetext{
|
.yuyuetext{
|
||||||
|
@ -82,3 +69,55 @@ top: 25rpx;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
.miajishikuang {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap; /* 允许换行 */
|
||||||
|
justify-content: flex-start; /* 使项目均匀分布 */
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
.meijishsibox {
|
||||||
|
width: 23%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.meijiashiimage {
|
||||||
|
width: 70px;
|
||||||
|
height: 70px;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
.mejiashitext {
|
||||||
|
margin-top: 5px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.duihaoimage {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
.duihaoimage{
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
.zhifubox{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position:fixed;
|
||||||
|
bottom: 40rpx;
|
||||||
|
}
|
||||||
|
.zhifuzhong{
|
||||||
|
width: 90%;
|
||||||
|
height: 50px;
|
||||||
|
background-color: #eec2c7;
|
||||||
|
border-radius: 30px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.textbox{
|
||||||
|
width: 30%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
|
@ -1,20 +1,22 @@
|
||||||
<view style="display:flex;justify-content:center">
|
<view>
|
||||||
<!-- 商品图 -->
|
<!-- 商品图 -->
|
||||||
<view class="Box1">
|
|
||||||
<image class="image" mode="scaleToFill" src="{{commoditiesImage}}" />
|
<image class="image" mode="scaleToFill" src="{{commoditiesImage}}" />
|
||||||
<!-- 价格表 -->
|
<!-- 价格表 -->
|
||||||
<view class="box1">
|
<view class="box1">
|
||||||
<text class="z1">年售1000+</text>
|
<view class="textbox">
|
||||||
<text class="z2">¥{{commoditiesPrice}}</text>
|
<text class="z1">年售1000+</text>
|
||||||
<text class="z3">【{{commoditiesName}}】</text>
|
<view style="margin-top:30rpx">
|
||||||
|
<text class="z2">¥{{commoditiesPrice}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="box8">
|
<view class="box8">
|
||||||
|
<text class="z3">【{{commoditiesName}}】</text>
|
||||||
<text class="z4">款式随便做,饰品不限量,含甲片,含卸甲</text>
|
<text class="z4">款式随便做,饰品不限量,含甲片,含卸甲</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="width:100%">
|
<view style="width:100%;display:flex;align-content:center;justify-content:center;margin-top:20rpx">
|
||||||
<text class="z5">须知 需提前两小时预约 周一至周日全天可用 购买后30天内有效 购买前请仔细阅读</text>
|
<text class="z5">须知 需提前两小时预约 周一至周日全天可用 购买后30天内有效 购买前请仔细阅读</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="time">
|
<view class="time">
|
||||||
<view class="yuyuetext">
|
<view class="yuyuetext">
|
||||||
|
@ -26,4 +28,23 @@
|
||||||
<text>{{item.title}}</text>
|
<text>{{item.title}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="width:100%;height:40px">
|
||||||
|
<text style="font-weight:bolder;font-size:18px;position:relative;left:30rpx;top:20rpx">指定美甲师</text>
|
||||||
|
</view>
|
||||||
|
<view class="miajishikuang">
|
||||||
|
<view class="meijishsibox" a:for="{{ meijiashi }}" data-index="{{index}}" onTap="onManicuristClick" >
|
||||||
|
<image class="meijiashiimage" mode="scaleToFill" src="{{item.manicuristAvatar}}" />
|
||||||
|
<view class="mejiashitext">
|
||||||
|
<text>{{item.manicuristName}}</text>
|
||||||
|
</view>
|
||||||
|
<view style="margin-top:10rpx">
|
||||||
|
<image a:if="{{item.selected}}" class="duihaoimage" mode="scaleToFill" src="../image/duihao.png" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="zhifubox" onTap="zhifu">
|
||||||
|
<view class="zhifuzhong">
|
||||||
|
<text style="font-size:18px">立即购买</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
|
@ -19,6 +19,7 @@ Page({
|
||||||
{ title: '17:00' },
|
{ title: '17:00' },
|
||||||
],
|
],
|
||||||
selectedTime: '',
|
selectedTime: '',
|
||||||
|
meijiashi:[],
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
@ -27,6 +28,9 @@ Page({
|
||||||
const commoditiesPrice = options.commoditiesPrice;
|
const commoditiesPrice = options.commoditiesPrice;
|
||||||
const ids = options.ids;
|
const ids = options.ids;
|
||||||
const businessId = options.businessId;
|
const businessId = options.businessId;
|
||||||
|
const dianpuid = options.dianpuid
|
||||||
|
const businessName = options.businessName
|
||||||
|
|
||||||
|
|
||||||
this.setData({
|
this.setData({
|
||||||
commoditiesImage: commoditiesImage,
|
commoditiesImage: commoditiesImage,
|
||||||
|
@ -34,6 +38,8 @@ Page({
|
||||||
commoditiesPrice: commoditiesPrice,
|
commoditiesPrice: commoditiesPrice,
|
||||||
ids: ids,
|
ids: ids,
|
||||||
businessId: businessId,
|
businessId: businessId,
|
||||||
|
dianpuid:dianpuid,
|
||||||
|
businessName:businessName
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -50,26 +56,8 @@ Page({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onShow(){
|
onShow(){
|
||||||
this.checkUserLogin
|
this.meijiahsi()
|
||||||
},
|
},
|
||||||
// 检查登录状态
|
|
||||||
checkUserLogin() {
|
|
||||||
my.getStorages({
|
|
||||||
key: 'userInfo',
|
|
||||||
success: (res) => {
|
|
||||||
if (res.data && res.data.openId) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
console.error('获取用户信息失败:', err);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
jiaru() {
|
jiaru() {
|
||||||
my.getStorage({
|
my.getStorage({
|
||||||
key: 'userInfo',
|
key: 'userInfo',
|
||||||
|
@ -130,4 +118,80 @@ this.checkUserLogin
|
||||||
});
|
});
|
||||||
console.log('选中的时间:', this.data.selectedTime); // 打印选中的时间
|
console.log('选中的时间:', this.data.selectedTime); // 打印选中的时间
|
||||||
},
|
},
|
||||||
|
// 美甲师
|
||||||
|
meijiahsi(){
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/manicurist/userQueryAll',
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
businessId: this.data.dianpuid
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log('Request succeeded:', res);
|
||||||
|
if (res.data && res.data.data) {
|
||||||
|
const modifiedData = res.data.data.map(item => {
|
||||||
|
return {
|
||||||
|
...item, // 保留原来的属性
|
||||||
|
selected: false // 添加 selected 属性
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
// 更新 data 中的 meijiashi 数据
|
||||||
|
this.setData({
|
||||||
|
meijiashi: modifiedData
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(this.data.meijiashi, '更新后数据');
|
||||||
|
} else {
|
||||||
|
console.log('shibaile')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('Request failed', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onManicuristClick(event) {
|
||||||
|
const index = event.currentTarget.dataset.index;
|
||||||
|
let meijiashi = this.data.meijiashi;
|
||||||
|
|
||||||
|
// 取消所有美甲师的选中状态
|
||||||
|
meijiashi.forEach((item, i) => {
|
||||||
|
item.selected = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 设置当前点击的美甲师为选中状态
|
||||||
|
meijiashi[index].selected = true;
|
||||||
|
|
||||||
|
// 更新 data 中的 meijiashi
|
||||||
|
this.setData({
|
||||||
|
meijiashi: meijiashi
|
||||||
|
});
|
||||||
|
this.setData({
|
||||||
|
meijiashiname:meijiashi[index].manicuristName,
|
||||||
|
meijiashiid:meijiashi[index].id
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log('当前选中的美甲师:', this.data.meijiashiname,this.data.meijiashiid);
|
||||||
|
},
|
||||||
|
zhifu(){
|
||||||
|
const commoditiesImage = this.data.commoditiesImage;
|
||||||
|
const commoditiesName = this.data.commoditiesName;
|
||||||
|
const commoditiesPrice = this.data.commoditiesPrice;
|
||||||
|
const meijiashiname = this.data.meijiashiname;
|
||||||
|
const yuyuetime = this.data.selectedTime
|
||||||
|
const meijiashiid = this.data.meijiashiid
|
||||||
|
const selectedTime = this.data.selectedTime
|
||||||
|
const dianpuid = this.data.dianpuid
|
||||||
|
const businessName = this.data.businessName
|
||||||
|
const shopid = this.data.ids
|
||||||
|
my.navigateTo({
|
||||||
|
url:`/pages/yuyuezhifu/yuyuezhifu?commoditiesImage=${commoditiesImage}&&commoditiesName=${commoditiesName}&&commoditiesPrice=${commoditiesPrice}&&meijiashiname=${meijiashiname}&&yuyuetime=${yuyuetime}&&meijiashiid=${meijiashiid}&&selectedTime=${selectedTime}&&dianpuid=${dianpuid}&&businessName=${businessName}&&shopid=${shopid}`
|
||||||
|
})
|
||||||
|
console.log(businessName,'dianpumingcheng');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{
|
||||||
"defaultTitle": "商品界面",
|
"defaultTitle": "商品界面",
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"ant-range-picker": "antd-mini/es/DatePicker/RangePicker/index",
|
|
||||||
"ant-tabs": "antd-mini/es/Tabs/index"
|
|
||||||
},
|
},
|
||||||
"styleIsolation": "apply-shared"
|
"styleIsolation": "apply-shared"
|
||||||
}
|
}
|
||||||
|
|
222
甲情_甲意/miniprogram/pages/shnagmendianpu/shnagmendianpu.acss
Normal file
|
@ -0,0 +1,222 @@
|
||||||
|
.cebian {
|
||||||
|
width: 20%;
|
||||||
|
height: 100%vw;
|
||||||
|
background-color: #efeced;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.color {
|
||||||
|
font-size: 14px;
|
||||||
|
color: rgb(0, 0, 0); /* 默认文字颜色 */
|
||||||
|
}
|
||||||
|
.xian{
|
||||||
|
width: 60px;
|
||||||
|
height: 3px;
|
||||||
|
background-color: #f2819f;
|
||||||
|
margin-top: 5rpx;
|
||||||
|
}
|
||||||
|
.xinxi{
|
||||||
|
width: 80%;
|
||||||
|
height: 540px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow-y: scroll;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
.pages{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
.shop{
|
||||||
|
width: 90%;
|
||||||
|
height:130px;
|
||||||
|
border: 1px solid #f2819f;
|
||||||
|
border-radius: 20px;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.image{
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
|
.imagebox{
|
||||||
|
width: 100px;
|
||||||
|
height: 130px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
.dingwei{
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.yuyue{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 50px;
|
||||||
|
height: 20px;
|
||||||
|
border-radius: 20px;
|
||||||
|
border: 1px solid #fb96b1;
|
||||||
|
background-color: #fb96b1;
|
||||||
|
}
|
||||||
|
.yuyuekuang{
|
||||||
|
width: 95%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.gouimage{
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
/* 店铺名框 */
|
||||||
|
.Box2
|
||||||
|
{
|
||||||
|
width: 100%;
|
||||||
|
height: 150px;
|
||||||
|
background-color: white;
|
||||||
|
position: relative;
|
||||||
|
top:30px;
|
||||||
|
border-radius: 15px;
|
||||||
|
}
|
||||||
|
/* 店铺名 */
|
||||||
|
.z2{
|
||||||
|
font-size: 25px;
|
||||||
|
font-weight: bolder;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.image1{
|
||||||
|
width: 80px;
|
||||||
|
height: 20px;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
.z3{
|
||||||
|
position: relative;
|
||||||
|
left: 30rpx;
|
||||||
|
bottom: 8rpx;
|
||||||
|
color: rgb(194, 53, 53);
|
||||||
|
}
|
||||||
|
.z4{
|
||||||
|
position: relative;
|
||||||
|
left: 80rpx;
|
||||||
|
bottom:10rpx;
|
||||||
|
}
|
||||||
|
/* 营业时间 */
|
||||||
|
.z6{
|
||||||
|
color: #4095E5;
|
||||||
|
font-weight: bolder;
|
||||||
|
top:20px;
|
||||||
|
left: 10px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.z7{
|
||||||
|
position: relative;
|
||||||
|
top:38rpx;
|
||||||
|
left: 30rpx;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
.box3{
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
background-color: darkgrey;
|
||||||
|
}
|
||||||
|
/* 地址 */
|
||||||
|
.z8{
|
||||||
|
font-size: 12px;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
.image3{
|
||||||
|
width: 10px;
|
||||||
|
height: 12px;
|
||||||
|
margin-left: 5rpx;
|
||||||
|
}
|
||||||
|
.box4{
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
background-color: darkgrey;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
.shangimage{
|
||||||
|
width: 200rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
border-radius: 10%;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
.box8{
|
||||||
|
width: 500rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
position: relative;
|
||||||
|
left: 230rpx;
|
||||||
|
bottom: 200rpx;
|
||||||
|
}
|
||||||
|
.tiao{
|
||||||
|
width: 100px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.tiaobox{
|
||||||
|
width: 100%;
|
||||||
|
height: 30px;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.pingjia{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
.pingjiakuang{
|
||||||
|
width: 90%;
|
||||||
|
border-top: #6e7071 1px solid;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
.pingjiaimage{
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 50px;
|
||||||
|
}
|
||||||
|
.touxiang{
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
.kuangimage{
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
margin:10rpx 10rpx 10rpx 10rpx;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
.tupianbox{
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.soucangimage{
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
position: absolute;
|
||||||
|
right: 80rpx;
|
||||||
|
top: -40rpx;
|
||||||
|
}
|
||||||
|
.zixunimage{
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
position: absolute;
|
||||||
|
right: 0rpx;
|
||||||
|
top: -40rpx;
|
||||||
|
}
|
124
甲情_甲意/miniprogram/pages/shnagmendianpu/shnagmendianpu.axml
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
<!-- 店铺名框 -->
|
||||||
|
<view class="Box2" >
|
||||||
|
<image class="shangimage" mode="scaleToFill" src="{{businessAvatar}}" />
|
||||||
|
<view class="box8">
|
||||||
|
<text class="z2">{{businessName}}</text>
|
||||||
|
<view style="margin-top:10rpx">
|
||||||
|
<image mode="scaleToFill" class="image1" src="../image/xingji.png" />
|
||||||
|
<text class="z3">4.9</text>
|
||||||
|
<text class="z4">500条</text>
|
||||||
|
</view>
|
||||||
|
<view onTap="soucang">
|
||||||
|
<image class="soucangimage" mode="scaleToFill" src="../image/shoucang.png" />
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<image class="zixunimage" mode="scaleToFill" src="../image/zixun.png" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 营业时间 -->
|
||||||
|
<view style="width:100%;height:90px">
|
||||||
|
<view style="height:50px">
|
||||||
|
<text class="z6" a:if="{{storeStatus === '0'}}">已休息</text>
|
||||||
|
<text class="z6" a:if="{{storeStatus === '1'}}">营业中</text>
|
||||||
|
<text class="z7">营业时间:{{startBusiness}}-{{endBusiness}}</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view class="box3"></view>
|
||||||
|
</view>
|
||||||
|
<!-- 地址 -->
|
||||||
|
<view style="width:100%;height:50px">
|
||||||
|
<image class="image3" mode="scaleToFill" src="../image/didian.png" />
|
||||||
|
<text class="z8">{{address}}</text>
|
||||||
|
<view>
|
||||||
|
<view class="box4"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="tiaobox">
|
||||||
|
<view class="tiao" a:for="{{ names }}" onTap="chaxunzhuangtai" data-id={{item.id}}>
|
||||||
|
<text>{{item.hengname}}</text>
|
||||||
|
<view class="xian" a:if="{{item.line}}" ></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 购物车 -->
|
||||||
|
<view class="pages" a:if="{{ showShoppingCart }}">
|
||||||
|
<!-- 侧边栏 -->
|
||||||
|
<view class="cebian">
|
||||||
|
<view class="text"
|
||||||
|
a:for="{{ lie }}"
|
||||||
|
onTap="selectItem"
|
||||||
|
data-id="{{item.id}}">
|
||||||
|
<text class="color">{{item.name}}</text>
|
||||||
|
<view>
|
||||||
|
<!-- 动态绑定 xian 是否显示 -->
|
||||||
|
<view class="xian" a:if="{{item.showLine}}"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="xinxi">
|
||||||
|
<view class="shop" a:for="{{ filteredShopping }}">
|
||||||
|
<view class="imagebox">
|
||||||
|
<image class="image" mode="scaleToFill" src="{{item.commoditiesImage}}" />
|
||||||
|
</view>
|
||||||
|
<view style="width:100%">
|
||||||
|
<view class="dingwei" style="width:120px;height:20px;top: 35rpx;">
|
||||||
|
<text>{{item.commoditiesName}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="dingwei" style="width:170px;height:40px;top:50rpx">
|
||||||
|
<text style="font-size:12px;color:#9c9a9a">款式随便做,饰品不限量,含甲片,含卸甲</text>
|
||||||
|
</view>
|
||||||
|
<view class="yuyuekuang dingwei" style="top:30px">
|
||||||
|
<text>¥{{item.commoditiesPrice}}</text>
|
||||||
|
<view class="yuyue" data-num="{{item}}" onTap="shangpinjiemian">
|
||||||
|
<text>预约</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="dingwei" style="width:20px;left:290rpx;bottom:130rpx" onTap="jiaru" data-num="{{item}}">
|
||||||
|
<image class="gouimage" mode="scaleToFill" src="../image/tijiagouwuche.png" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 评价 -->
|
||||||
|
<view class="pingjia" a:if="{{ showComments }}">
|
||||||
|
<view class="pingjiakuang" a:for="{{ pingjia }}">
|
||||||
|
<view class="touxiang">
|
||||||
|
<image class="pingjiaimage" mode="scaleToFill" src="{{item.user.avatarUrl}}" />
|
||||||
|
<text style="margin-left:10rpx">{{item.user.username}}</text>
|
||||||
|
</view>
|
||||||
|
<view style="width:100%">
|
||||||
|
<text style="color:#8a8f93;font-size:13px">颜色:冰透系列裸色01色+烤灯-简约</text>
|
||||||
|
<view style="width:100%;word-wrap: break-word;">
|
||||||
|
<text>{{item.userRating.review}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="tupianbox">
|
||||||
|
<image class="kuangimage" mode="scaleToFill" src="../image/meijia1.jpg" />
|
||||||
|
<image class="kuangimage" mode="scaleToFill" src="../image/meijia1.jpg" />
|
||||||
|
<image class="kuangimage" mode="scaleToFill" src="../image/meijia1.jpg" />
|
||||||
|
<image class="kuangimage" mode="scaleToFill" src="../image/meijia1.jpg" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 商家 -->
|
||||||
|
<view style="width:100%;margin-top:20rpx" a:if="{{ showBusinessInfo }}">
|
||||||
|
<view style="margin-top:10rpx">
|
||||||
|
<view class="box3" style="margin-top:10rpx;"></view>
|
||||||
|
<text >店铺名称:{{businessName}}</text>
|
||||||
|
</view>
|
||||||
|
<view style="margin-top: 10rpx;">
|
||||||
|
<view class="box3" style="margin-top:10rpx"></view>
|
||||||
|
<text>联系电话:{{businessPhone}}</text>
|
||||||
|
</view>
|
||||||
|
<view style="margin-top: 10rpx;">
|
||||||
|
<view class="box3" style="margin-top:10rpx"></view>
|
||||||
|
<text>营业时间:{{startBusiness}}-{{endBusiness}}</text>
|
||||||
|
</view>
|
||||||
|
<view style="margin-top: 10rpx;">
|
||||||
|
<view class="box3" style="margin-top:10rpx"></view>
|
||||||
|
<text>店铺地址:{{address}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="box3" style="margin-top:10rpx"></view>
|
||||||
|
</view>
|
343
甲情_甲意/miniprogram/pages/shnagmendianpu/shnagmendianpu.js
Normal file
|
@ -0,0 +1,343 @@
|
||||||
|
import{url} from '../request'
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
lie: [
|
||||||
|
{ id: 1, name: '推荐款式', showLine: true },
|
||||||
|
{ id: 2, name: '中长款', showLine: false },
|
||||||
|
{ id: 3, name: '本甲款', showLine: false },
|
||||||
|
{ id: 4, name: '长款', showLine: false },
|
||||||
|
{ id: 5, name: '短款', showLine: false },
|
||||||
|
],
|
||||||
|
names:[
|
||||||
|
{ id:1, hengname:'款式分类',line:true},
|
||||||
|
{id:2,hengname:'评价',line:false},
|
||||||
|
{id:3,hengname:'商家',line:false},
|
||||||
|
],
|
||||||
|
userId: '',
|
||||||
|
address: '',
|
||||||
|
businessName:'',
|
||||||
|
businessAvatar:'',
|
||||||
|
startBusiness:'',
|
||||||
|
endBusiness:'',
|
||||||
|
storeStatus:'',
|
||||||
|
businessId: '',
|
||||||
|
commoditiesGroupId: 0,
|
||||||
|
commoditiesName: "",
|
||||||
|
current: 0,
|
||||||
|
pageSize: 0,
|
||||||
|
sortField: "",
|
||||||
|
sortOrder: "",
|
||||||
|
status: "",
|
||||||
|
tuijian:[],
|
||||||
|
meijiashi:[],
|
||||||
|
email: "",
|
||||||
|
gender: 0,
|
||||||
|
manicuristAvatar: "",
|
||||||
|
manicuristName: "",
|
||||||
|
phone: "",
|
||||||
|
rating: 0,
|
||||||
|
specialties: "",
|
||||||
|
id:'',
|
||||||
|
filteredShopping: [],
|
||||||
|
showShoppingCart: true, // 控制购物车部分是否显示
|
||||||
|
showComments: false, // 控制评论部分是否显示
|
||||||
|
showBusinessInfo: false, // 控制商家信息是否显示
|
||||||
|
pingjia:[],
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
// Extract userId and address from options
|
||||||
|
const userId = options.userId;
|
||||||
|
const address = options.address;
|
||||||
|
const businessName = options.businessName;
|
||||||
|
const businessAvatar = options.businessAvatar;
|
||||||
|
const startBusiness = options.startBusiness;
|
||||||
|
const endBusiness = options.endBusiness;
|
||||||
|
const storeStatus = options.storeStatus;
|
||||||
|
const id = options.id
|
||||||
|
const businessPhone = options.businessPhone
|
||||||
|
console.log(id,'这是店铺id吗');
|
||||||
|
// Set them in data for use in the page
|
||||||
|
this.setData({
|
||||||
|
userId: userId,
|
||||||
|
address: address,
|
||||||
|
businessName:businessName,
|
||||||
|
businessAvatar:businessAvatar,
|
||||||
|
endBusiness:endBusiness,
|
||||||
|
startBusiness:startBusiness,
|
||||||
|
storeStatus:storeStatus,
|
||||||
|
id:id,
|
||||||
|
businessPhone:businessPhone,
|
||||||
|
});
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/commodities/list/page/commodities',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
businessId: id,
|
||||||
|
commoditiesGroupId: "",
|
||||||
|
commoditiesName: "",
|
||||||
|
current: 0,
|
||||||
|
pageSize: 100,
|
||||||
|
sortField: "",
|
||||||
|
sortOrder: "",
|
||||||
|
status: "",
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(id,'这是onload');
|
||||||
|
console.log('Request succeeded:', res);
|
||||||
|
if (res.data && res.data.data) {
|
||||||
|
this.setData({
|
||||||
|
tuijian: res.data.data.records, // 更新 tuijian 列表
|
||||||
|
});
|
||||||
|
this.chushihua();
|
||||||
|
console.log(this.data.tuijian,'这是推荐');
|
||||||
|
} else {
|
||||||
|
console.log('shibaile')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('Request failed', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.pingjia()
|
||||||
|
},
|
||||||
|
soucang() {
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
const businessId = this.data.id; // 获取 onLoad 中保存的 id
|
||||||
|
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/collect/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
businessId: businessId, // 使用 businessId 来请求收藏
|
||||||
|
userId: userInfo.id
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie,
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
if(res.data.code===0){
|
||||||
|
my.alert({
|
||||||
|
content: '收藏成功'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else if(res.data.code===40100){
|
||||||
|
my.alert({
|
||||||
|
content: '登录信息已过期,请重新登录'
|
||||||
|
});
|
||||||
|
my.navigateTo({
|
||||||
|
url:'/pages/denglu/denglu'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
my.alert({
|
||||||
|
content: '店铺已收藏'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
my.alert({
|
||||||
|
content: '您未登录,请先登录。',
|
||||||
|
success: () => {
|
||||||
|
my.navigateTo({
|
||||||
|
url: '/pages/denglu/denglu',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
pingjia(){
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/level/listBusinessRating',
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
businessId:this.data.id,
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res,'评价部分');
|
||||||
|
if(res.data.code===0){
|
||||||
|
this.setData({
|
||||||
|
pingjia:res.data.data,
|
||||||
|
useridpingjia:res.data.data.userId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
zixun(){
|
||||||
|
my.navigateTo({
|
||||||
|
url:'/pages/zixunmeijiashi/zixunmeijiashi'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 点击事件处理函数
|
||||||
|
selectItem(e) {
|
||||||
|
const id = e.currentTarget.dataset.id;
|
||||||
|
console.log(id);
|
||||||
|
// 更新对应的 showLine 状态,控制是否显示线条
|
||||||
|
const updatedLie = this.data.lie.map(item => {
|
||||||
|
if (item.id === id) {
|
||||||
|
item.showLine = !item.showLine; // 切换显示状态
|
||||||
|
} else {
|
||||||
|
item.showLine = false; // 其他项隐藏
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 根据点击的类别 id 筛选对应的商品
|
||||||
|
const filteredShopping = this.data.tuijian.filter(item => String(item.commoditiesGroupId) === String(id));
|
||||||
|
|
||||||
|
// 更新数据
|
||||||
|
this.setData({
|
||||||
|
lie: updatedLie,
|
||||||
|
filteredShopping, // 更新右侧商品列表
|
||||||
|
showShoppingCart: true, // 显示购物车部分
|
||||||
|
showComments: false, // 隐藏评论部分
|
||||||
|
showBusinessInfo: false, // 隐藏商家信息部分
|
||||||
|
});
|
||||||
|
console.log(this.data.filteredShopping,'hhhhhhhhhhhhhh');
|
||||||
|
},
|
||||||
|
chushihua(){
|
||||||
|
this.setData({
|
||||||
|
filteredShopping: this.data.tuijian.filter(item => String(item.commoditiesGroupId) === "1"), // 默认选中类别 1
|
||||||
|
})
|
||||||
|
console.log(this.data.filteredShopping,'chushi');
|
||||||
|
},
|
||||||
|
chaxunzhuangtai(e) {
|
||||||
|
const id = e.currentTarget.dataset.id;
|
||||||
|
console.log(id);
|
||||||
|
|
||||||
|
// 更新对应的 line 状态,控制是否显示线条
|
||||||
|
const updatednames = this.data.names.map(item => {
|
||||||
|
if (item.id === id) {
|
||||||
|
item.line = !item.line; // 切换显示状态
|
||||||
|
} else {
|
||||||
|
item.line = false; // 其他项隐藏
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
names: updatednames,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 根据点击的分类切换显示内容
|
||||||
|
if (id === 1) {
|
||||||
|
this.setData({
|
||||||
|
showShoppingCart: true, // 显示购物车
|
||||||
|
showComments: false, // 隐藏评论
|
||||||
|
showBusinessInfo: false, // 隐藏商家信息
|
||||||
|
});
|
||||||
|
} else if (id === 2) {
|
||||||
|
this.setData({
|
||||||
|
showShoppingCart: false, // 隐藏购物车
|
||||||
|
showComments: true, // 显示评论
|
||||||
|
showBusinessInfo: false, // 隐藏商家信息
|
||||||
|
});
|
||||||
|
} else if (id === 3) {
|
||||||
|
this.setData({
|
||||||
|
showShoppingCart: false, // 隐藏购物车
|
||||||
|
showComments: false, // 隐藏评论
|
||||||
|
showBusinessInfo: true, // 显示商家信息
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
jiaru(item) {
|
||||||
|
const id = item.target.dataset.num
|
||||||
|
console.log('传递的数据:', id);
|
||||||
|
const ids = id.id
|
||||||
|
const businessId = id.businessId
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/cart/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
businessId: businessId,
|
||||||
|
commoditiesId: ids,
|
||||||
|
quantity: 1,
|
||||||
|
selectedOptions: "",
|
||||||
|
userId: userInfo.id
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie, // 通过头部传递 cookie
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
if(res.data.code===0){
|
||||||
|
console.log(res);
|
||||||
|
my.alert({ content: '成功添加到购物车' });
|
||||||
|
}
|
||||||
|
else if(res.data.code===40100){
|
||||||
|
my.alert({
|
||||||
|
content: '登录信息已过期,请重新登录'
|
||||||
|
});
|
||||||
|
my.navigateTo({
|
||||||
|
url:'/pages/denglu/denglu'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
console.log(res,'shibaile');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
my.alert({
|
||||||
|
content: '您未登录,请先登录。',
|
||||||
|
success: () => {
|
||||||
|
my.navigateTo({
|
||||||
|
url: '/pages/denglu/denglu',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
shangpinjiemian(item){
|
||||||
|
const id = item.target.dataset.num
|
||||||
|
console.log('传递的数据:', id);
|
||||||
|
const ids = id.id
|
||||||
|
const commoditiesPrice = id.commoditiesPrice
|
||||||
|
const commoditiesName = id.commoditiesName
|
||||||
|
const commoditiesImage = id.commoditiesImage
|
||||||
|
const businessId = id.businessId
|
||||||
|
const dianpuid = this.data.id
|
||||||
|
const businessName =this.data.businessName
|
||||||
|
console.log('Address being passed: ',id,commoditiesPrice,commoditiesName,commoditiesImage,businessId);
|
||||||
|
my.navigateTo({
|
||||||
|
url:`/pages/yuyuejiemian/yuyuejiemian?commoditiesPrice=${commoditiesPrice}&&commoditiesName=${commoditiesName}&&commoditiesImage=${commoditiesImage}&&ids=${ids}&&businessId=${businessId}&&dianpuid=${dianpuid}&&businessName=${businessName}`
|
||||||
|
})
|
||||||
|
console.log(ids,businessId,commoditiesImage,commoditiesName,commoditiesPrice+'这是商品的',dianpuid+'这是店铺的')
|
||||||
|
},
|
||||||
|
});
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"defaultTitle": "店铺主页",
|
||||||
|
"usingComponents": {},
|
||||||
|
"styleIsolation": "apply-shared"
|
||||||
|
}
|
|
@ -37,7 +37,7 @@
|
||||||
<!-- 店铺界面 -->
|
<!-- 店铺界面 -->
|
||||||
<view style="width:100%">
|
<view style="width:100%">
|
||||||
<view class="box2" >
|
<view class="box2" >
|
||||||
<view class="kuang" a:for="{{ tuijian }}" a:key="{{index}}" data-num="{{item}}" onTap="dianpu">
|
<view class="kuang" a:for="{{ tuijian }}" a:key="{{index}}" a:if="{{ item.state==1 }}" data-num="{{item}}" onTap="dianpu">
|
||||||
<image class="image" mode="scaleToFill" src="{{item.businessAvatar}}" />
|
<image class="image" mode="scaleToFill" src="{{item.businessAvatar}}" />
|
||||||
<view class="wenzi">
|
<view class="wenzi">
|
||||||
<text class="text">{{item.businessName}}</text>
|
<text class="text">{{item.businessName}}</text>
|
||||||
|
|
|
@ -1,223 +1,120 @@
|
||||||
.cebian {
|
.box {
|
||||||
width: 20%;
|
width: 100vw;
|
||||||
height: 100v;
|
min-height: 100vh; /* 确保容器至少占满屏幕的高度 */
|
||||||
background-color: #efeced;
|
background-color: #eec2c7;
|
||||||
overflow: hidden;
|
overflow-y: auto; /* 允许竖直方向滚动 */
|
||||||
|
width: 100vw; /* 或者 750rpx */
|
||||||
|
height: auto;
|
||||||
|
overflow:hidden; /* 防止溢出 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.box3 {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: rgba(252, 240, 240, 0.807);
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 80px; /* 留出一些空间给底部结算栏 */
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box1 {
|
||||||
|
width: 100%;
|
||||||
|
height: 170px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
border-radius: 10px;
|
||||||
|
position: relative;
|
||||||
|
left: 20px;
|
||||||
|
top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box4 {
|
||||||
|
position: relative;
|
||||||
|
top: 80px;
|
||||||
|
left: 10px;
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box5 {
|
||||||
|
height: 50px;
|
||||||
|
position: relative;
|
||||||
|
left: 40px;
|
||||||
|
top:30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
width: 100%;
|
padding: 5px;
|
||||||
height: 50px;
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: 100px;
|
||||||
|
position: relative;
|
||||||
|
left: 100px;
|
||||||
|
top: 20px;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxd {
|
||||||
|
width: 100px;
|
||||||
|
height: 40px;
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 30px;
|
||||||
|
background-color: rgb(162, 12, 12);
|
||||||
|
left: 570rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
justify-content: center;
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
.color {
|
|
||||||
font-size: 14px;
|
.text1 {
|
||||||
color: rgb(0, 0, 0); /* 默认文字颜色 */
|
color: #ffffff;
|
||||||
|
position: unset;
|
||||||
}
|
}
|
||||||
.xian{
|
|
||||||
|
.boxall {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
.text2 {
|
||||||
|
position: relative;
|
||||||
|
left: 200rpx;
|
||||||
|
}
|
||||||
|
.text3{
|
||||||
|
height: 20px;
|
||||||
width: 60px;
|
width: 60px;
|
||||||
height: 3px;
|
position: absolute;
|
||||||
background-color: #f2819f;
|
left: 620rpx;
|
||||||
margin-top: 5rpx;
|
font-size:12px;
|
||||||
|
color:#a8b0b8
|
||||||
}
|
}
|
||||||
.xinxi{
|
.number{
|
||||||
width: 80%;
|
width: 30px;
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow-y: scroll
|
|
||||||
}
|
|
||||||
.pages{
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
}
|
|
||||||
.shop{
|
|
||||||
width: 90%;
|
|
||||||
height:130px;
|
|
||||||
border: 1px solid #f2819f;
|
|
||||||
border-radius: 20px;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.image{
|
|
||||||
width: 100px;
|
|
||||||
height: 100px;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
.imagebox{
|
|
||||||
width: 100px;
|
|
||||||
height: 130px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
.dingwei{
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.yuyue{
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
width: 50px;
|
|
||||||
height: 20px;
|
|
||||||
border-radius: 20px;
|
|
||||||
border: 1px solid #fb96b1;
|
|
||||||
background-color: #fb96b1;
|
|
||||||
}
|
|
||||||
.yuyuekuang{
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.gouimage{
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
}
|
|
||||||
/* 店铺名框 */
|
|
||||||
.Box2
|
|
||||||
{
|
|
||||||
width: 100%;
|
|
||||||
height: 150px;
|
|
||||||
background-color: white;
|
background-color: white;
|
||||||
position: relative;
|
|
||||||
top:30px;
|
|
||||||
border-radius: 15px;
|
|
||||||
}
|
|
||||||
/* 店铺名 */
|
|
||||||
.z2{
|
|
||||||
font-size: 25px;
|
|
||||||
font-weight: bolder;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.image1{
|
|
||||||
width: 80px;
|
|
||||||
height: 20px;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
}
|
|
||||||
.z3{
|
|
||||||
position: relative;
|
|
||||||
left: 30rpx;
|
|
||||||
bottom: 8rpx;
|
|
||||||
color: rgb(194, 53, 53);
|
|
||||||
}
|
|
||||||
.z4{
|
|
||||||
position: relative;
|
|
||||||
left: 80rpx;
|
|
||||||
bottom:10rpx;
|
|
||||||
}
|
|
||||||
/* 营业时间 */
|
|
||||||
.z6{
|
|
||||||
color: #4095E5;
|
|
||||||
font-weight: bolder;
|
|
||||||
top:20px;
|
|
||||||
left: 10px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.z7{
|
|
||||||
position: relative;
|
|
||||||
top:38rpx;
|
|
||||||
left: 30rpx;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.box3{
|
|
||||||
width: 100%;
|
|
||||||
height: 1px;
|
|
||||||
background-color: darkgrey;
|
|
||||||
}
|
|
||||||
/* 地址 */
|
|
||||||
.z8{
|
|
||||||
font-size: 12px;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
.image3{
|
|
||||||
width: 10px;
|
|
||||||
height: 12px;
|
|
||||||
margin-left: 5rpx;
|
|
||||||
}
|
|
||||||
.box4{
|
|
||||||
width: 100%;
|
|
||||||
height: 1px;
|
|
||||||
background-color: darkgrey;
|
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
|
||||||
.shangimage{
|
|
||||||
width: 200rpx;
|
|
||||||
height: 200rpx;
|
|
||||||
border-radius: 10%;
|
|
||||||
margin-left: 20rpx;
|
|
||||||
}
|
|
||||||
.box8{
|
|
||||||
width: 500rpx;
|
|
||||||
height: 200rpx;
|
|
||||||
position: relative;
|
|
||||||
left: 230rpx;
|
|
||||||
bottom: 200rpx;
|
|
||||||
}
|
|
||||||
.tiao{
|
|
||||||
width: 100px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.tiaobox{
|
|
||||||
width: 100%;
|
|
||||||
height: 30px;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.pingjia{
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
|
||||||
.pingjiakuang{
|
|
||||||
width: 90%;
|
|
||||||
border-top: #6e7071 1px solid;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
.pingjiaimage{
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 50px;
|
|
||||||
}
|
|
||||||
.touxiang{
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
}
|
||||||
.kuangimage{
|
.beijing{
|
||||||
width: 100px;
|
display: flex;
|
||||||
height: 100px;
|
|
||||||
margin:10rpx 10rpx 10rpx 10rpx;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
.tupianbox{
|
|
||||||
width: 100%;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
align-items: center;
|
||||||
.soucangimage{
|
width: 25px;
|
||||||
width: 30px;
|
height: 25px;
|
||||||
height: 30px;
|
background-color: white;
|
||||||
position: absolute;
|
font-size: 20p;
|
||||||
right: 80rpx;
|
|
||||||
top: -40rpx;
|
|
||||||
}
|
|
||||||
.zixunimage{
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
position: absolute;
|
|
||||||
right: 0rpx;
|
|
||||||
top: -40rpx;
|
|
||||||
}
|
}
|
|
@ -1,124 +1,46 @@
|
||||||
<!-- 店铺名框 -->
|
<view class="box">
|
||||||
<view class="Box2" >
|
<!-- 购物车店铺 -->
|
||||||
<image class="shangimage" mode="scaleToFill" src="{{businessAvatar}}" />
|
<view class="box3">
|
||||||
<view class="box8">
|
<checkbox-group onChange="checkboxChange">
|
||||||
<text class="z2">{{businessName}}</text>
|
<block a:for="{{productList}}" a:key="id">
|
||||||
<view style="margin-top:10rpx">
|
<view class="box1">
|
||||||
<image mode="scaleToFill" class="image1" src="../image/xingji.png" />
|
|
||||||
<text class="z3">4.9</text>
|
<view class="box4">
|
||||||
<text class="z4">500条</text>
|
<!-- 给每个复选框绑定 data-index -->
|
||||||
</view>
|
<checkbox color="red" checked="{{item.checked}}" value="{{item.cartId}}" />
|
||||||
<view onTap="soucang">
|
</view>
|
||||||
<image class="soucangimage" mode="scaleToFill" src="../image/shoucang.png" />
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<image class="zixunimage" mode="scaleToFill" src="../image/zixun.png" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 营业时间 -->
|
|
||||||
<view style="width:100%;height:90px">
|
|
||||||
<view style="height:50px">
|
|
||||||
<text class="z6" a:if="{{storeStatus === '0'}}">已休息</text>
|
|
||||||
<text class="z6" a:if="{{storeStatus === '1'}}">营业中</text>
|
|
||||||
<text class="z7">营业时间:{{startBusiness}}-{{endBusiness}}</text>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<view class="box3"></view>
|
|
||||||
</view>
|
|
||||||
<!-- 地址 -->
|
|
||||||
<view style="width:100%;height:50px">
|
|
||||||
<image class="image3" mode="scaleToFill" src="../image/didian.png" />
|
|
||||||
<text class="z8">{{address}}</text>
|
|
||||||
<view>
|
|
||||||
<view class="box4"></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="tiaobox">
|
|
||||||
<view class="tiao" a:for="{{ names }}" onTap="chaxunzhuangtai" data-id={{item.id}}>
|
|
||||||
<text>{{item.hengname}}</text>
|
|
||||||
<view class="xian" a:if="{{item.line}}" ></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 购物车 -->
|
|
||||||
<view class="pages" a:if="{{ showShoppingCart }}">
|
|
||||||
<!-- 侧边栏 -->
|
|
||||||
<view class="cebian">
|
|
||||||
<view class="text"
|
|
||||||
a:for="{{ lie }}"
|
|
||||||
onTap="selectItem"
|
|
||||||
data-id="{{item.id}}">
|
|
||||||
<text class="color">{{item.name}}</text>
|
|
||||||
<view>
|
|
||||||
<!-- 动态绑定 xian 是否显示 -->
|
|
||||||
<view class="xian" a:if="{{item.showLine}}"></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="xinxi">
|
|
||||||
<view class="shop" a:for="{{ filteredShopping }}">
|
|
||||||
<view class="imagebox">
|
|
||||||
<image class="image" mode="scaleToFill" src="{{item.commoditiesImage}}" />
|
<image class="image" mode="scaleToFill" src="{{item.commoditiesImage}}" />
|
||||||
|
<view class="box5">
|
||||||
|
<view>
|
||||||
|
<text class="text" style="font-size:20px">{{item.commoditiesName}}</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<text class="text" style="font-size:15px">¥{{item.commoditiesPrice}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="container">
|
||||||
|
<view class="beijing" data-index="{{index}}" style="margin-right: 10rpx;" onTap="decreaseQuantity" >
|
||||||
|
<text>-</text>
|
||||||
|
</view>
|
||||||
|
<view class="number">
|
||||||
|
<text >{{item.quantity}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="beijing" style="margin-left: 10rpx;"onTap="increaseQuantity" data-index="{{index}}" >
|
||||||
|
<text >+</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text class="text3" onTap="yichu" data-id="{{item.cartId}}">移除购物车</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="width:100%">
|
</block>
|
||||||
<view class="dingwei" style="width:120px;height:20px;top: 35rpx;">
|
</checkbox-group>
|
||||||
<text>{{item.commoditiesName}}</text>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="dingwei" style="width:170px;height:40px;top:50rpx">
|
<!-- 底部结算栏 -->
|
||||||
<text style="font-size:12px;color:#9c9a9a">款式随便做,饰品不限量,含甲片,含卸甲</text>
|
<view class="boxall">
|
||||||
</view>
|
<checkbox color="red" checked="{{select_all}}" onChange="selectall"/>全选
|
||||||
<view class="yuyuekuang dingwei" style="top:30px">
|
<text class="text2">合计:¥{{totalPrice}}</text>
|
||||||
<text>¥{{item.commoditiesPrice}}</text>
|
<view class="boxd" onTap="jiesuan">
|
||||||
<view class="yuyue">
|
<text class="text1">结算</text>
|
||||||
<text>预约</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="dingwei" style="left:300rpx;bottom:130rpx" onTap="soucang">
|
|
||||||
<image class="gouimage" mode="scaleToFill" src="../image/tijiagouwuche.png" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 评价 -->
|
|
||||||
<view class="pingjia" a:if="{{ showComments }}">
|
|
||||||
<view class="pingjiakuang">
|
|
||||||
<view class="touxiang">
|
|
||||||
<image class="pingjiaimage" mode="scaleToFill" src="../image/meijia1.jpg" />
|
|
||||||
<text style="margin-left:10rpx">陌路</text>
|
|
||||||
</view>
|
|
||||||
<view style="width:100%">
|
|
||||||
<text style="color:#8a8f93;font-size:13px">颜色:冰透系列裸色01色+烤灯-简约</text>
|
|
||||||
<view style="width:100%;word-wrap: break-word;">
|
|
||||||
<text>aslkjhdklajshdkalsdhaskljdhaskldhaskhdaksjhdkjsh</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="tupianbox">
|
|
||||||
<image class="kuangimage" mode="scaleToFill" src="../image/meijia1.jpg" />
|
|
||||||
<image class="kuangimage" mode="scaleToFill" src="../image/meijia1.jpg" />
|
|
||||||
<image class="kuangimage" mode="scaleToFill" src="../image/meijia1.jpg" />
|
|
||||||
<image class="kuangimage" mode="scaleToFill" src="../image/meijia1.jpg" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 商家 -->
|
|
||||||
<view style="width:100%;margin-top:20rpx" a:if="{{ showBusinessInfo }}">
|
|
||||||
<view style="margin-top:10rpx">
|
|
||||||
<view class="box3" style="margin-top:10rpx;"></view>
|
|
||||||
<text >店铺名称:{{businessName}}</text>
|
|
||||||
</view>
|
|
||||||
<view style="margin-top: 10rpx;">
|
|
||||||
<view class="box3" style="margin-top:10rpx"></view>
|
|
||||||
<text>联系电话:{{businessPhone}}</text>
|
|
||||||
</view>
|
|
||||||
<view style="margin-top: 10rpx;">
|
|
||||||
<view class="box3" style="margin-top:10rpx"></view>
|
|
||||||
<text>营业时间:{{startBusiness}}-{{endBusiness}}</text>
|
|
||||||
</view>
|
|
||||||
<view style="margin-top: 10rpx;">
|
|
||||||
<view class="box3" style="margin-top:10rpx"></view>
|
|
||||||
<text>店铺地址:{{address}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="box3" style="margin-top:10rpx"></view>
|
|
||||||
</view>
|
|
|
@ -1,143 +1,181 @@
|
||||||
import{url} from '../request'
|
import { url } from '../request';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
lie: [
|
id: '',
|
||||||
{ id: 1, name: '推荐款式', showLine: true },
|
productList: [], // 商品列表
|
||||||
{ id: 2, name: '中长款', showLine: false },
|
select_all: false,
|
||||||
{ id: 3, name: '本甲款', showLine: false },
|
checkbox_productListid: '',
|
||||||
{ id: 4, name: '长款', showLine: false },
|
totalPrice: 0,
|
||||||
{ id: 5, name: '短款', showLine: false },
|
|
||||||
],
|
|
||||||
names:[
|
|
||||||
{ id:1, hengname:'款式分类',line:true},
|
|
||||||
{id:2,hengname:'评价',line:false},
|
|
||||||
{id:3,hengname:'商家',line:false},
|
|
||||||
],
|
|
||||||
userId: '',
|
|
||||||
address: '',
|
|
||||||
businessName:'',
|
|
||||||
businessAvatar:'',
|
|
||||||
startBusiness:'',
|
|
||||||
endBusiness:'',
|
|
||||||
storeStatus:'',
|
|
||||||
businessId: '',
|
|
||||||
commoditiesGroupId: 0,
|
|
||||||
commoditiesName: "",
|
|
||||||
current: 0,
|
|
||||||
pageSize: 0,
|
|
||||||
sortField: "",
|
|
||||||
sortOrder: "",
|
|
||||||
status: "",
|
|
||||||
tuijian:[],
|
|
||||||
meijiashi:[],
|
|
||||||
email: "",
|
|
||||||
gender: 0,
|
|
||||||
manicuristAvatar: "",
|
|
||||||
manicuristName: "",
|
|
||||||
phone: "",
|
|
||||||
rating: 0,
|
|
||||||
specialties: "",
|
|
||||||
id:'',
|
|
||||||
filteredShopping: [],
|
|
||||||
showShoppingCart: true, // 控制购物车部分是否显示
|
|
||||||
showComments: false, // 控制评论部分是否显示
|
|
||||||
showBusinessInfo: false, // 控制商家信息是否显示
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
// 计算总价
|
||||||
// Extract userId and address from options
|
calculateTotalPrice() {
|
||||||
const userId = options.userId;
|
const totalPrice = this.data.productList
|
||||||
const address = options.address;
|
.filter(item => item.checked) // 只计算勾选的商品
|
||||||
const businessName = options.businessName;
|
.reduce((sum, item) => sum + item.quantity * item.commoditiesPrice, 0);
|
||||||
const businessAvatar = options.businessAvatar;
|
|
||||||
const startBusiness = options.startBusiness;
|
// 格式化总价为两位小数
|
||||||
const endBusiness = options.endBusiness;
|
const formattedTotalPrice = totalPrice.toFixed(2);
|
||||||
const storeStatus = options.storeStatus;
|
|
||||||
const id = options.id
|
// 更新 totalPrice
|
||||||
const businessPhone = options.businessPhone
|
this.setData({ totalPrice: formattedTotalPrice });
|
||||||
console.log(id,'zheyedesaksdas');
|
},
|
||||||
// Set them in data for use in the page
|
// 增加商品数量
|
||||||
|
increaseQuantity(e) {
|
||||||
|
const { index } = e.currentTarget.dataset; // 获取当前商品的索引
|
||||||
|
const updatedProductList = [...this.data.productList];
|
||||||
|
const item = updatedProductList[index];
|
||||||
|
// 增加数量
|
||||||
|
if (item.quantity < 999) {
|
||||||
|
item.quantity += 1;
|
||||||
|
}
|
||||||
|
this.setData({ productList: updatedProductList });
|
||||||
|
this.calculateTotalPrice(); // 重新计算总价
|
||||||
|
},
|
||||||
|
// 减少商品数量
|
||||||
|
decreaseQuantity(e) {
|
||||||
|
const { index } = e.currentTarget.dataset; // 获取当前商品的索引
|
||||||
|
const updatedProductList = [...this.data.productList];
|
||||||
|
const item = updatedProductList[index];
|
||||||
|
// 减少数量
|
||||||
|
if (item.quantity > 1) {
|
||||||
|
item.quantity -= 1;
|
||||||
|
}
|
||||||
|
this.setData({ productList: updatedProductList });
|
||||||
|
this.calculateTotalPrice(); // 重新计算总价
|
||||||
|
},
|
||||||
|
// 全选/取消全选
|
||||||
|
selectall(e) {
|
||||||
|
const newSelectAll = !this.data.select_all;
|
||||||
|
const updatedProductList = this.data.productList.map(item => ({
|
||||||
|
...item,
|
||||||
|
checked: newSelectAll,
|
||||||
|
}));
|
||||||
|
|
||||||
|
const checkbox_productListid = newSelectAll
|
||||||
|
? updatedProductList.map(item => item.cartId).join(',')
|
||||||
|
: '';
|
||||||
|
|
||||||
this.setData({
|
this.setData({
|
||||||
userId: userId,
|
productList: updatedProductList,
|
||||||
address: address,
|
select_all: newSelectAll,
|
||||||
businessName:businessName,
|
checkbox_productListid,
|
||||||
businessAvatar:businessAvatar,
|
|
||||||
endBusiness:endBusiness,
|
|
||||||
startBusiness:startBusiness,
|
|
||||||
storeStatus:storeStatus,
|
|
||||||
id:id,
|
|
||||||
businessPhone:businessPhone,
|
|
||||||
});
|
});
|
||||||
my.request({
|
console.log("arr=", checkbox_productListid);
|
||||||
url: url + '/api/commodities/list/page/commodities',
|
this.calculateTotalPrice(); // 重新计算总价
|
||||||
method: 'POST',
|
const selectedProducts = updatedProductList.filter(item => item.checked);
|
||||||
data: {
|
this.setData({
|
||||||
businessId: id,
|
selectedProducts, // 存储勾选的商品信息
|
||||||
commoditiesGroupId: id,
|
});
|
||||||
commoditiesName: "",
|
console.log(selectedProducts);
|
||||||
current: 0,
|
},
|
||||||
pageSize: 2,
|
checkboxChange(e) {
|
||||||
sortField: "",
|
const { value } = e.detail; // 当前选中的值列表
|
||||||
sortOrder: "",
|
const updatedProductList = this.data.productList.map(item => ({
|
||||||
status: "",
|
...item,
|
||||||
},
|
checked: value.includes(item.cartId.toString()),
|
||||||
headers: {
|
}));
|
||||||
'content-type': 'application/json',
|
const select_all = updatedProductList.every(item => item.checked);
|
||||||
},
|
this.setData({
|
||||||
dataType: 'json',
|
productList: updatedProductList,
|
||||||
success: (res) => {
|
select_all,
|
||||||
console.log(id,'这是onload');
|
});
|
||||||
console.log('Request succeeded:', res);
|
this.calculateTotalPrice(); // 更新总价
|
||||||
if (res.data && res.data.data) {
|
// 提取勾选的商品
|
||||||
this.setData({
|
const selectedProducts = updatedProductList.filter(item => item.checked);
|
||||||
tuijian: res.data.data.records, // 更新 tuijian 列表
|
this.setData({
|
||||||
});
|
selectedProducts, // 存储勾选的商品信息
|
||||||
this.chushihua();
|
});
|
||||||
console.log(this.data.tuijian,'这是推荐');
|
console.log(selectedProducts,'askldjaslkdaslkdjklas');
|
||||||
} else {
|
},
|
||||||
console.log('shibaile')
|
// 获取商品数据
|
||||||
}
|
fetchProductDetails(cartItems) {
|
||||||
},
|
const promises = cartItems.map((item) => {
|
||||||
fail: (error) => {
|
return new Promise((resolve, reject) => {
|
||||||
console.error('Request failed', error);
|
my.request({
|
||||||
}
|
url: url + '/api/commodities/getById/commodities',
|
||||||
|
method: 'GET',
|
||||||
|
data: { id: item.commoditiesId },
|
||||||
|
headers: { 'content-type': 'application/json' },
|
||||||
|
success: (res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
const productData = res.data.data;
|
||||||
|
productData.cartId = item.id; // 将 cartId 添加到商品数据中
|
||||||
|
productData.quantity = item.quantity || 1; // 初始化数量
|
||||||
|
resolve(productData);
|
||||||
|
} else {
|
||||||
|
reject(`商品信息获取失败: ${res.data.message}`);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
reject(error);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Promise.all(promises)
|
||||||
|
.then((productList) => {
|
||||||
|
// 确保没有重复商品
|
||||||
|
const mergedProductList = [];
|
||||||
|
productList.forEach((product) => {
|
||||||
|
const existingProduct = mergedProductList.find(
|
||||||
|
(item) => item.commoditiesId === product.commoditiesId
|
||||||
|
);
|
||||||
|
if (existingProduct) {
|
||||||
|
// 如果已存在相同商品,则累加数量
|
||||||
|
existingProduct.quantity += product.quantity;
|
||||||
|
} else {
|
||||||
|
// 如果是新商品,则添加
|
||||||
|
mergedProductList.push(product);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.setData({ productList: mergedProductList });
|
||||||
|
this.calculateTotalPrice(); // 初始化总价
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('商品信息获取失败: ', error);
|
||||||
|
my.alert({ content: '商品信息获取失败,请稍后重试' });
|
||||||
|
});
|
||||||
},
|
},
|
||||||
soucang() {
|
|
||||||
|
|
||||||
|
|
||||||
|
// 页面加载时获取商品数据
|
||||||
|
onShow() {
|
||||||
|
this.setData({
|
||||||
|
select_all: false,
|
||||||
|
selectedProducts:[],
|
||||||
|
});
|
||||||
my.getStorage({
|
my.getStorage({
|
||||||
key: 'userInfo',
|
key: 'userInfo',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
const userInfo = res.data;
|
const userInfo = res.data;
|
||||||
const businessId = this.data.id; // 获取 onLoad 中保存的 id
|
|
||||||
|
|
||||||
if (userInfo && userInfo.cookie) {
|
if (userInfo && userInfo.cookie) {
|
||||||
my.request({
|
my.request({
|
||||||
url: url + '/api/collect/add',
|
url: url + '/api/cart/selectByUserId',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
businessId: businessId // 使用 businessId 来请求收藏
|
id: userInfo.id
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
'Cookie': userInfo.cookie,
|
'Cookie': userInfo.cookie,
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if(res.data.code===0){
|
console.log(res,'hhhhhhhhhhhh');
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
console.log(res);
|
||||||
|
const cartItems = res.data.data;
|
||||||
|
this.fetchProductDetails(cartItems);
|
||||||
|
} else {
|
||||||
my.alert({
|
my.alert({
|
||||||
content: '收藏成功'
|
content: '登录信息已过期,请重新登录',
|
||||||
});
|
|
||||||
}
|
|
||||||
else if(res.data.code===40100){
|
|
||||||
my.alert({
|
|
||||||
content: '登录信息已过期,请重新登录'
|
|
||||||
});
|
});
|
||||||
my.navigateTo({
|
my.navigateTo({
|
||||||
url:'/pages/denglu/denglu'
|
url: '/pages/denglu/denglu',
|
||||||
})
|
|
||||||
}else{
|
|
||||||
my.alert({
|
|
||||||
content: '店铺已收藏'
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -146,13 +184,66 @@ Page({
|
||||||
my.alert({ content: '请求失败,请稍后重试' });
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
}
|
||||||
|
else{
|
||||||
my.alert({
|
my.alert({
|
||||||
content: '您未登录,请先登录。',
|
content:'您未登录,请先登录'
|
||||||
success: () => {
|
})
|
||||||
my.navigateTo({
|
my.navigateTo({
|
||||||
url: '/pages/denglu/denglu',
|
url:'/pages/denglu/denglu'
|
||||||
});
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
yichu(e) {
|
||||||
|
const cartId = e.currentTarget.dataset.id; // 获取商品的 cartId
|
||||||
|
if (!cartId) {
|
||||||
|
console.error('没有找到商品cartId');
|
||||||
|
my.alert({ content: '商品ID未找到,请稍后重试' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('需要移除的商品cartId:', cartId);
|
||||||
|
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
// 发送请求移除商品
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/cart/delete',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
id: cartId, // 商品 cartId
|
||||||
|
userId: userInfo.id, // 当前用户ID
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie,
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
my.alert({ content: '成功移除商品' });
|
||||||
|
|
||||||
|
// 从 productList 中移除对应的商品
|
||||||
|
const updatedProductList = this.data.productList.filter(
|
||||||
|
(item) => item.cartId !== cartId
|
||||||
|
);
|
||||||
|
|
||||||
|
this.setData({ productList: updatedProductList });
|
||||||
|
this.calculateTotalPrice(); // 更新总价
|
||||||
|
} else {
|
||||||
|
my.alert({ content: '移除商品失败,请稍后重试' });
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -160,127 +251,54 @@ Page({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// meijiahsi(){
|
// 移除后更新
|
||||||
// my.request({
|
updateCartList() {
|
||||||
// url: url + '/api/manicurist/userQueryAll',
|
this.setData({ select_all: false });
|
||||||
// method: 'GET',
|
my.getStorage({
|
||||||
// data: {
|
key: 'userInfo',
|
||||||
// businessId: this.data.id
|
success: (res) => {
|
||||||
// },
|
const userInfo = res.data;
|
||||||
// headers: {
|
if (userInfo && userInfo.cookie) {
|
||||||
// 'content-type': 'application/json',
|
my.request({
|
||||||
// },
|
url: url + '/api/cart/selectByUserId', // 获取最新的购物车数据
|
||||||
// dataType: 'json',
|
method: 'POST',
|
||||||
// success: (res) => {
|
data: {
|
||||||
// console.log('Request succeeded:', res);
|
id: this.data.id
|
||||||
// if (res.data && res.data.data) {
|
}, // 使用当前用户ID
|
||||||
// this.setData({
|
headers: {
|
||||||
// meijiashi: res.data.data, // 更新 tuijian 列表
|
'content-type': 'application/json',
|
||||||
// });
|
'Cookie': userInfo.cookie
|
||||||
// } else {
|
},
|
||||||
// console.log('shibaile')
|
dataType: 'json',
|
||||||
// }
|
success: (res) => {
|
||||||
// },
|
if (res.data.code === 0) {
|
||||||
// fail: (error) => {
|
const cartItems = res.data.data;
|
||||||
// console.error('Request failed', error);
|
this.fetchProductDetails(cartItems, userInfo.id);
|
||||||
// }
|
} else {
|
||||||
// });
|
my.alert({ content: '获取购物车数据失败,请稍后重试' });
|
||||||
// },
|
}
|
||||||
pingjia(){
|
},
|
||||||
my.navigateTo({
|
fail: (error) => {
|
||||||
url:'/pages/shangpinpingjia/shangpinpingjia'
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
})
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
zixun(){
|
jiesuan() {
|
||||||
my.navigateTo({
|
const products = this.data.selectedProducts;
|
||||||
url:'/pages/zixunmeijiashi/zixunmeijiashi'
|
if(!products || products.length === 0){
|
||||||
})
|
my.alert({
|
||||||
},
|
content:'请选择商品'
|
||||||
shangpinjiemian(item){
|
})
|
||||||
const id = item.target.dataset.num
|
}else{
|
||||||
console.log('传递的数据:', id);
|
const productsStr = JSON.stringify(products)
|
||||||
const ids = id.id
|
const prices =this.data.totalPrice
|
||||||
const commoditiesPrice = id.commoditiesPrice
|
my.navigateTo({
|
||||||
const commoditiesName = id.commoditiesName
|
url: '/pages/zhifujiemian/zhifujiemian?products='+encodeURIComponent(productsStr)+ '&prices=' + encodeURIComponent(prices)
|
||||||
const commoditiesImage = id.commoditiesImage
|
});
|
||||||
const businessId = id.businessId
|
|
||||||
console.log('Address being passed: ',id,commoditiesPrice,commoditiesName,commoditiesImage,businessId);
|
|
||||||
my.navigateTo({
|
|
||||||
url:`/pages/shangpinjiemian/shangpinjiemian?commoditiesPrice=${commoditiesPrice}&&commoditiesName=${commoditiesName}&&commoditiesImage=${commoditiesImage}&&ids=${ids}&&businessId=${businessId}`
|
|
||||||
})
|
|
||||||
console.log(ids,businessId,commoditiesImage,commoditiesName,commoditiesPrice+'这是商品的')
|
|
||||||
},
|
|
||||||
// 点击事件处理函数
|
|
||||||
selectItem(e) {
|
|
||||||
const id = e.currentTarget.dataset.id;
|
|
||||||
console.log(id);
|
|
||||||
// 更新对应的 showLine 状态,控制是否显示线条
|
|
||||||
const updatedLie = this.data.lie.map(item => {
|
|
||||||
if (item.id === id) {
|
|
||||||
item.showLine = !item.showLine; // 切换显示状态
|
|
||||||
} else {
|
|
||||||
item.showLine = false; // 其他项隐藏
|
|
||||||
}
|
}
|
||||||
return item;
|
},
|
||||||
});
|
|
||||||
|
|
||||||
// 根据点击的类别 id 筛选对应的商品
|
|
||||||
const filteredShopping = this.data.tuijian.filter(item => String(item.commoditiesGroupId) === String(id));
|
|
||||||
|
|
||||||
// 更新数据
|
|
||||||
this.setData({
|
|
||||||
lie: updatedLie,
|
|
||||||
filteredShopping, // 更新右侧商品列表
|
|
||||||
showShoppingCart: true, // 显示购物车部分
|
|
||||||
showComments: false, // 隐藏评论部分
|
|
||||||
showBusinessInfo: false, // 隐藏商家信息部分
|
|
||||||
});
|
|
||||||
console.log(this.data.filteredShopping,'hhhhhhhhhhhhhh');
|
|
||||||
},
|
|
||||||
chushihua(){
|
|
||||||
this.setData({
|
|
||||||
filteredShopping: this.data.tuijian.filter(item => String(item.commoditiesGroupId) === "1"), // 默认选中类别 1
|
|
||||||
})
|
|
||||||
console.log(this.data.filteredShopping,'chushi');
|
|
||||||
},
|
|
||||||
chaxunzhuangtai(e) {
|
|
||||||
const id = e.currentTarget.dataset.id;
|
|
||||||
console.log(id);
|
|
||||||
|
|
||||||
// 更新对应的 line 状态,控制是否显示线条
|
|
||||||
const updatednames = this.data.names.map(item => {
|
|
||||||
if (item.id === id) {
|
|
||||||
item.line = !item.line; // 切换显示状态
|
|
||||||
} else {
|
|
||||||
item.line = false; // 其他项隐藏
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.setData({
|
|
||||||
names: updatednames,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 根据点击的分类切换显示内容
|
|
||||||
if (id === 1) {
|
|
||||||
this.setData({
|
|
||||||
showShoppingCart: true, // 显示购物车
|
|
||||||
showComments: false, // 隐藏评论
|
|
||||||
showBusinessInfo: false, // 隐藏商家信息
|
|
||||||
});
|
|
||||||
} else if (id === 2) {
|
|
||||||
this.setData({
|
|
||||||
showShoppingCart: false, // 隐藏购物车
|
|
||||||
showComments: true, // 显示评论
|
|
||||||
showBusinessInfo: false, // 隐藏商家信息
|
|
||||||
});
|
|
||||||
} else if (id === 3) {
|
|
||||||
this.setData({
|
|
||||||
showShoppingCart: false, // 隐藏购物车
|
|
||||||
showComments: false, // 隐藏评论
|
|
||||||
showBusinessInfo: true, // 显示商家信息
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,8 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
.image1{
|
.image1{
|
||||||
max-width: 35px;
|
max-width: 30px;
|
||||||
max-height: 25px;
|
max-height: 30px;
|
||||||
position:relative;
|
position:relative;
|
||||||
}
|
}
|
||||||
/* 退出登录 */
|
/* 退出登录 */
|
||||||
|
|
|
@ -15,6 +15,7 @@ Page({
|
||||||
this.setData({
|
this.setData({
|
||||||
username: userInfo.username,
|
username: userInfo.username,
|
||||||
avatarUrl: userInfo.avatarUrl,
|
avatarUrl: userInfo.avatarUrl,
|
||||||
|
messagelogin:userInfo,
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
this.setData({
|
this.setData({
|
||||||
|
@ -56,10 +57,18 @@ Page({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
login() {
|
login() {
|
||||||
my.navigateTo({
|
if (!this.data.messagelogin) {
|
||||||
url: '/pages/denglu/denglu'
|
my.navigateTo({
|
||||||
});
|
url: '/pages/denglu/denglu'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
my.showToast({
|
||||||
|
content: '您已登录,无需重复登录',
|
||||||
|
duration: 2000 // 提示持续时间
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
meijishi() {
|
meijishi() {
|
||||||
my.navigateTo({
|
my.navigateTo({
|
||||||
url: '/pages/meijiashirenzheng/meijiashirenzheng'
|
url: '/pages/meijiashirenzheng/meijiashirenzheng'
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
<text class="text" style="bottom:70rpx;right:190rpx;color:#377ff3">到店服务</text>
|
<text class="text" style="bottom:70rpx;right:190rpx;color:#377ff3">到店服务</text>
|
||||||
<text class="text"style="bottom:100rpx;left:80rpx;font-size:18px">¥{{item.commoditiesVO.commoditiesPrice}}</text>
|
<text class="text"style="bottom:100rpx;left:80rpx;font-size:18px">¥{{item.commoditiesVO.commoditiesPrice}}</text>
|
||||||
<view class="text" style="left:440rpx;display:flex;width:150rpx;bottom:20rpx">
|
<view class="text" style="left:440rpx;display:flex;width:150rpx;bottom:20rpx">
|
||||||
<view>
|
<view onTap="quxiao" data-id="{{item.id}}">
|
||||||
<text class="textcss">取消</text>
|
<text class="textcss">取消</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
|
|
|
@ -55,7 +55,9 @@ Page({
|
||||||
paymentStatus: "",
|
paymentStatus: "",
|
||||||
sortField: "",
|
sortField: "",
|
||||||
sortOrder: "",
|
sortOrder: "",
|
||||||
startTime: ""
|
startTime: "",
|
||||||
|
userId: userInfo.id,
|
||||||
|
userRole: 0,
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
|
@ -126,5 +128,108 @@ getPaymentStatusText(status) {
|
||||||
const statusObj = this.paymentStatuses.find(item => item.paymentStatuses === status.toString());
|
const statusObj = this.paymentStatuses.find(item => item.paymentStatuses === status.toString());
|
||||||
return statusObj ? statusObj.statue : '未知状态'; // 如果找不到对应状态,返回 '未知状态'
|
return statusObj ? statusObj.statue : '未知状态'; // 如果找不到对应状态,返回 '未知状态'
|
||||||
},
|
},
|
||||||
|
quxiao(e){
|
||||||
|
const orderId = e.currentTarget.dataset.id;
|
||||||
|
console.log(orderId,'zheshiorderid');
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
this.setData({
|
||||||
|
id: userInfo.id, // 获取 id
|
||||||
|
});
|
||||||
|
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/orders/cancel',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
"id": 0
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie,
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
if(res.data.code===0){
|
||||||
|
my.showToast({
|
||||||
|
content: '订单已取消',
|
||||||
|
});
|
||||||
|
this.fetchOrders()
|
||||||
|
}
|
||||||
|
else if(res.data.code===40100){
|
||||||
|
my.alert({
|
||||||
|
content: '登录信息已过期,请重新登录'
|
||||||
|
});
|
||||||
|
my.navigateTo({
|
||||||
|
url:'/pages/denglu/denglu'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log(res);
|
||||||
|
console.log(this.data.dingdan);
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
my.alert({
|
||||||
|
content: '您未登录,请先登录。',
|
||||||
|
success: () => {
|
||||||
|
my.navigateTo({
|
||||||
|
url: '/pages/denglu/denglu',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fetchOrders() {
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/orders/my/page',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
claimStatus: 0,
|
||||||
|
current: 1,
|
||||||
|
endTime: "",
|
||||||
|
id: "",
|
||||||
|
pageSize: 10,
|
||||||
|
paymentStatus: "",
|
||||||
|
sortField: "",
|
||||||
|
sortOrder: "",
|
||||||
|
startTime: "",
|
||||||
|
userId: userInfo.id,
|
||||||
|
userRole: 0,
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie,
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.setData({
|
||||||
|
dingdan: res.data.data.records,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -19,64 +19,47 @@ Page({
|
||||||
],
|
],
|
||||||
|
|
||||||
},
|
},
|
||||||
// onShow(){
|
onShow(){
|
||||||
// my.getStorage({
|
my.getStorage({
|
||||||
// key: 'userInfo',
|
key: 'userInfo',
|
||||||
// success: (res) => {
|
success: (res) => {
|
||||||
// const userInfo = res.data;
|
const userInfo = res.data;
|
||||||
// this.setData({
|
this.setData({
|
||||||
// id: userInfo.id, // 获取 id
|
id: userInfo.id, // 获取 id
|
||||||
// });
|
});
|
||||||
|
|
||||||
// if (userInfo && userInfo.cookie) {
|
if (userInfo) {
|
||||||
// my.request({
|
my.request({
|
||||||
// url: url + '/api/orders/my/page',
|
url: url + '/api/level/list',
|
||||||
// method: 'POST',
|
method: 'POST',
|
||||||
// data: {
|
data: {
|
||||||
// claimStatus: 0,
|
|
||||||
// current: 1,
|
|
||||||
// endTime: "",
|
|
||||||
// id: "",
|
|
||||||
// pageSize: 10,
|
|
||||||
// paymentStatus: 0,
|
|
||||||
// sortField: "",
|
|
||||||
// sortOrder: "",
|
|
||||||
// startTime: ""
|
|
||||||
// },
|
|
||||||
// headers: {
|
|
||||||
// 'content-type': 'application/json',
|
|
||||||
// 'Cookie': userInfo.cookie,
|
|
||||||
// },
|
|
||||||
// dataType: 'json',
|
|
||||||
// success: (res) => {
|
|
||||||
// if(res.data&&res.data.data){
|
|
||||||
// this.setData({
|
|
||||||
// dingdan:res.data.data.records,
|
|
||||||
|
|
||||||
// })
|
},
|
||||||
// }
|
headers: {
|
||||||
// console.log(res);
|
'content-type': 'application/json',
|
||||||
// console.log(this.data.dingdan);
|
},
|
||||||
// console.log(this.data.dingdan);
|
dataType: 'json',
|
||||||
// },
|
success: (res) => {
|
||||||
// fail: (error) => {
|
console.log(res,"sadkaskd");
|
||||||
// console.error('请求失败: ', JSON.stringify(error));
|
},
|
||||||
// my.alert({ content: '请求失败,请稍后重试' });
|
fail: (error) => {
|
||||||
// },
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
// });
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
// } else {
|
},
|
||||||
// my.alert({
|
});
|
||||||
// content: '您未登录,请先登录。',
|
} else {
|
||||||
// success: () => {
|
my.alert({
|
||||||
// my.navigateTo({
|
content: '您未登录,请先登录。',
|
||||||
// url: '/pages/denglu/denglu',
|
success: () => {
|
||||||
// });
|
my.navigateTo({
|
||||||
// },
|
url: '/pages/denglu/denglu',
|
||||||
// });
|
});
|
||||||
// }
|
},
|
||||||
// },
|
});
|
||||||
// });
|
}
|
||||||
// },
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
// tab栏
|
// tab栏
|
||||||
onSwipeChange(e) {
|
onSwipeChange(e) {
|
||||||
this.setData({
|
this.setData({
|
||||||
|
|
|
@ -29,11 +29,14 @@ Page({
|
||||||
key: 'userInfo',
|
key: 'userInfo',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
const userInfo = res.data;
|
const userInfo = res.data;
|
||||||
|
console.log(userInfo.id);
|
||||||
if (userInfo && userInfo.cookie) {
|
if (userInfo && userInfo.cookie) {
|
||||||
my.request({
|
my.request({
|
||||||
url: url + '/api/collect/list',
|
url: url + '/api/collect/list',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {},
|
data: {
|
||||||
|
id:userInfo.id
|
||||||
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
'Cookie': userInfo.cookie,
|
'Cookie': userInfo.cookie,
|
||||||
|
@ -158,7 +161,9 @@ Page({
|
||||||
my.request({
|
my.request({
|
||||||
url: url + '/api/collect/list',
|
url: url + '/api/collect/list',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {},
|
data: {
|
||||||
|
id:userInfo.id
|
||||||
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
'Cookie': userInfo.cookie,
|
'Cookie': userInfo.cookie,
|
||||||
|
@ -184,6 +189,12 @@ Page({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
my.alert({content:'您未登录,请先登录'})
|
||||||
|
my.navigateTo({
|
||||||
|
url:'/pages/denglu/denglu'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -18,8 +18,10 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.neirong{
|
.neirong{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
width: 200px;
|
width: 50%;
|
||||||
}
|
}
|
||||||
.shijian{
|
.shijian{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -31,9 +33,6 @@
|
||||||
.image1{
|
.image1{
|
||||||
width: 50rpx;
|
width: 50rpx;
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
margin-top: 20rpx;
|
|
||||||
position: relative;
|
|
||||||
left: 330rpx;
|
|
||||||
}
|
}
|
||||||
.yemian{
|
.yemian{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -41,3 +40,15 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
.statues{
|
||||||
|
width: 50%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.xinxibox{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
}
|
|
@ -1,24 +1,33 @@
|
||||||
<view class="yemian" a:for="{{ yuyue }}">
|
<view class="yemian" a:for="{{ myyuyue }}">
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="biaoti">
|
<view class="biaoti">
|
||||||
<image class="image" mode="scaleToFill" src="/pages/image/alogo.png" />
|
<image class="image" mode="scaleToFill" src="/pages/image/alogo.png" />
|
||||||
<text class="text" style="bottom:60rpx">{{item.name}}</text>
|
<text class="text" style="bottom:60rpx">{{item.businessName}}</text>
|
||||||
<view class="text" style="left:120rpx;bottom:60rpx">
|
<view class="text" style="left:120rpx;bottom:60rpx">
|
||||||
<text style="font-size:13px">{{item.neirong}}</text>
|
<text style="font-size:13px">{{item.notes}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="neirong">
|
<view class="xinxibox">
|
||||||
<view style="margin-top:20rpx">
|
<view class="neirong">
|
||||||
<text>我的预约:{{item.shijian}}</text>
|
<view style=" width:300px;margin-top:20rpx">
|
||||||
|
<text>我的预约:{{item.formattedAppointmentTime}}</text>
|
||||||
|
</view>
|
||||||
|
<view style="margin-top:10rpx">
|
||||||
|
<text a:if="{{ item.serviceMode==1 }}">服务方式:到店服务</text>
|
||||||
|
<text a:if="{{ item.serviceMode==0 }}">服务方式:上门服务</text>
|
||||||
|
</view>
|
||||||
|
<view style="margin-top:10rpx">
|
||||||
|
<text class="text">指定美甲师:{{item.manicuristName}}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="margin-top:20rpx">
|
<view class="statues" a:if="{{ item.status==0 }}">
|
||||||
<text class="text" style="bottom:40rpx">指定美甲师:{{item.meijiashi}}</text>
|
<image mode="scaleToFill" class="image1" src="/pages/image/aing.png" />
|
||||||
<image mode="scaleToFill" class="image1" src="/pages/image/aing.png" />
|
<text style="margin-top:20rpx">正在进行中......</text>
|
||||||
|
</view>
|
||||||
|
<view class="statues" a:if="{{ item.status==1 }}">
|
||||||
|
<image mode="scaleToFill" class="image1" src="/pages/image/afinish.png" />
|
||||||
|
<text style="margin-top:20rpx">已完成</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="shijian" >
|
|
||||||
<text>{{item.data}}</text>
|
|
||||||
<text style="margin-right:50rpx">{{item.status}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
|
@ -1,5 +1,7 @@
|
||||||
|
import {url} from '../request'
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
|
myyuyue:[],
|
||||||
yuyue:[
|
yuyue:[
|
||||||
{
|
{
|
||||||
name:'佳佳温馨提示:',
|
name:'佳佳温馨提示:',
|
||||||
|
@ -43,5 +45,62 @@ Page({
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
onLoad() {},
|
onShow() {
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/appointments/query',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
id: userInfo.id
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie,
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
|
// 在这里处理后端返回的时间字段
|
||||||
|
const appointments = res.data.data.map(item => {
|
||||||
|
const appointmentTime = new Date(item.appointmentTime); // 将时间字符串转换为 Date 对象
|
||||||
|
|
||||||
|
// 格式化日期为 'YYYY-MM-DD HH:mm' 形式
|
||||||
|
const formattedDate = appointmentTime.getFullYear() + '-'
|
||||||
|
+ ('0' + (appointmentTime.getMonth() + 1)).slice(-2) + '-'
|
||||||
|
+ ('0' + appointmentTime.getDate()).slice(-2) + ' '
|
||||||
|
+ ('0' + appointmentTime.getHours()).slice(-2) + ':'
|
||||||
|
+ ('0' + appointmentTime.getMinutes()).slice(-2);
|
||||||
|
|
||||||
|
// 返回新的数组,带有格式化后的日期
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
formattedAppointmentTime: formattedDate
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
myyuyue: appointments
|
||||||
|
});
|
||||||
|
console.log(this.data.myyuyue);
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
my.alert({ content: '您未登录,请先登录' });
|
||||||
|
my.navigateTo({
|
||||||
|
url: '/pages/denglu/denglu'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
123
甲情_甲意/miniprogram/pages/yuyuejiemian/yuyuejiemian.acss
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
/* 商品图背景 */
|
||||||
|
.image{
|
||||||
|
width: 100%;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
/* 价格 */
|
||||||
|
.box1{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
background-color: #eec2c7;
|
||||||
|
position: relative;
|
||||||
|
border-radius: 15px;
|
||||||
|
}
|
||||||
|
.z1{
|
||||||
|
top: 20rpx;
|
||||||
|
left: 20rpx;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.z2{
|
||||||
|
font-weight: bolder;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.z3{
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
.z4{
|
||||||
|
position: relative;
|
||||||
|
color: rgb(29, 18, 18);
|
||||||
|
}
|
||||||
|
.box8{
|
||||||
|
display:flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 60%;
|
||||||
|
}
|
||||||
|
/* 商品介绍 */
|
||||||
|
.z5{
|
||||||
|
font-size: 15px;
|
||||||
|
color: darkgrey;
|
||||||
|
}
|
||||||
|
.time{
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
border-top: 2px solid #aba8a8;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
margin-bottom: 130rpx;
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
|
.yuyuetext{
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
.timebox{
|
||||||
|
width: 100px;
|
||||||
|
height: 40px;
|
||||||
|
border: 1px solid #8f8c8c;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
.boxtextkuang{
|
||||||
|
width: 100%;
|
||||||
|
height: 180px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
.miajishikuang {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap; /* 允许换行 */
|
||||||
|
justify-content: flex-start; /* 使项目均匀分布 */
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
.meijishsibox {
|
||||||
|
width: 23%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.meijiashiimage {
|
||||||
|
width: 70px;
|
||||||
|
height: 70px;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
.mejiashitext {
|
||||||
|
margin-top: 5px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.duihaoimage {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
.duihaoimage{
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
.zhifubox{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position:fixed;
|
||||||
|
bottom: 40rpx;
|
||||||
|
}
|
||||||
|
.zhifuzhong{
|
||||||
|
width: 90%;
|
||||||
|
height: 50px;
|
||||||
|
background-color: #eec2c7;
|
||||||
|
border-radius: 30px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.textbox{
|
||||||
|
width: 30%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
50
甲情_甲意/miniprogram/pages/yuyuejiemian/yuyuejiemian.axml
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
<view>
|
||||||
|
<!-- 商品图 -->
|
||||||
|
<image class="image" mode="scaleToFill" src="{{commoditiesImage}}" />
|
||||||
|
<!-- 价格表 -->
|
||||||
|
<view class="box1">
|
||||||
|
<view class="textbox">
|
||||||
|
<text class="z1">年售1000+</text>
|
||||||
|
<view style="margin-top:30rpx">
|
||||||
|
<text class="z2">¥{{commoditiesPrice}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="box8">
|
||||||
|
<text class="z3">【{{commoditiesName}}】</text>
|
||||||
|
<text class="z4">款式随便做,饰品不限量,含甲片,含卸甲</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view style="width:100%;display:flex;align-content:center;justify-content:center;margin-top:20rpx">
|
||||||
|
<text class="z5">须知 需提前两小时预约 周一至周日全天可用 购买后30天内有效 购买前请仔细阅读</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="time">
|
||||||
|
<view class="yuyuetext">
|
||||||
|
<text style="font-weight:bolder;font-size:18px;position:relative;left:30rpx;top:20rpx">预约时间</text>
|
||||||
|
</view>
|
||||||
|
<view class="boxtextkuang">
|
||||||
|
<view class="timebox" a:for="{{ time }}" onTap="selectTime"
|
||||||
|
data-time="{{item.title}}" style="{{selectedTime === item.title ? 'background-color: #adadad; color: white;' : ''}}">
|
||||||
|
<text>{{item.title}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view style="width:100%;height:40px">
|
||||||
|
<text style="font-weight:bolder;font-size:18px;position:relative;left:30rpx;top:20rpx">指定美甲师</text>
|
||||||
|
</view>
|
||||||
|
<view class="miajishikuang">
|
||||||
|
<view class="meijishsibox" a:for="{{ meijiashi }}" data-index="{{index}}" onTap="onManicuristClick" >
|
||||||
|
<image class="meijiashiimage" mode="scaleToFill" src="{{item.manicuristAvatar}}" />
|
||||||
|
<view class="mejiashitext">
|
||||||
|
<text>{{item.manicuristName}}</text>
|
||||||
|
</view>
|
||||||
|
<view style="margin-top:10rpx">
|
||||||
|
<image a:if="{{item.selected}}" class="duihaoimage" mode="scaleToFill" src="../image/duihao.png" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="zhifubox" onTap="zhifu">
|
||||||
|
<view class="zhifuzhong">
|
||||||
|
<text style="font-size:18px">立即预约</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
194
甲情_甲意/miniprogram/pages/yuyuejiemian/yuyuejiemian.js
Normal file
|
@ -0,0 +1,194 @@
|
||||||
|
import {url} from '../request'
|
||||||
|
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
commoditiesImage: '',
|
||||||
|
commoditiesPrice: '',
|
||||||
|
commoditiesName: '',
|
||||||
|
businessId: '',
|
||||||
|
ids: '',
|
||||||
|
time: [
|
||||||
|
{ title: '9:00' },
|
||||||
|
{ title: '10:00' },
|
||||||
|
{ title: '11:00' },
|
||||||
|
{ title: '12:00' },
|
||||||
|
{ title: '13:00' },
|
||||||
|
{ title: '14:00' },
|
||||||
|
{ title: '15:00' },
|
||||||
|
{ title: '16:00' },
|
||||||
|
{ title: '17:00' },
|
||||||
|
],
|
||||||
|
selectedTime: '',
|
||||||
|
meijiashi:[],
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad(options) {
|
||||||
|
const commoditiesImage = options.commoditiesImage;
|
||||||
|
const commoditiesName = options.commoditiesName;
|
||||||
|
const commoditiesPrice = options.commoditiesPrice;
|
||||||
|
const ids = options.ids;
|
||||||
|
const businessId = options.businessId;
|
||||||
|
const dianpuid = options.dianpuid
|
||||||
|
const businessName = options.businessName
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
commoditiesImage: commoditiesImage,
|
||||||
|
commoditiesName: commoditiesName,
|
||||||
|
commoditiesPrice: commoditiesPrice,
|
||||||
|
ids: ids,
|
||||||
|
businessId: businessId,
|
||||||
|
dianpuid:dianpuid,
|
||||||
|
businessName:businessName
|
||||||
|
});
|
||||||
|
console.log(ids,'shangpinid');
|
||||||
|
},
|
||||||
|
|
||||||
|
// 切换标签
|
||||||
|
onChange(current) {
|
||||||
|
this.setData({
|
||||||
|
current,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onSwipeChange(e) {
|
||||||
|
this.setData({
|
||||||
|
current: e.detail.current,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onShow(){
|
||||||
|
this.meijiahsi()
|
||||||
|
},
|
||||||
|
jiaru() {
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/cart/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
businessId: this.data.businessId,
|
||||||
|
commoditiesId: this.data.ids,
|
||||||
|
quantity: 1,
|
||||||
|
selectedOptions: "",
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie, // 通过头部传递 cookie
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
if(res.data.code===0){
|
||||||
|
console.log(res);
|
||||||
|
my.alert({ content: '成功添加到购物车' });
|
||||||
|
}
|
||||||
|
else if(res.data.code===40100){
|
||||||
|
my.alert({
|
||||||
|
content: '登录信息已过期,请重新登录'
|
||||||
|
});
|
||||||
|
my.navigateTo({
|
||||||
|
url:'/pages/denglu/denglu'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
my.alert({
|
||||||
|
content: '您未登录,请先登录。',
|
||||||
|
success: () => {
|
||||||
|
my.navigateTo({
|
||||||
|
url: '/pages/denglu/denglu',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
selectTime(e) {
|
||||||
|
const selectedTime = e.currentTarget.dataset.time; // 获取点击的时间
|
||||||
|
console.log(selectedTime);
|
||||||
|
this.setData({
|
||||||
|
selectedTime: selectedTime, // 更新选中的时间
|
||||||
|
});
|
||||||
|
console.log('选中的时间:', this.data.selectedTime); // 打印选中的时间
|
||||||
|
},
|
||||||
|
// 美甲师
|
||||||
|
meijiahsi(){
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/manicurist/userQueryAll',
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
businessId: this.data.dianpuid
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log('Request succeeded:meijiashi', res);
|
||||||
|
if (res.data && res.data.data) {
|
||||||
|
const modifiedData = res.data.data.map(item => {
|
||||||
|
return {
|
||||||
|
...item, // 保留原来的属性
|
||||||
|
selected: false // 添加 selected 属性
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
// 更新 data 中的 meijiashi 数据
|
||||||
|
this.setData({
|
||||||
|
meijiashi: modifiedData
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(this.data.meijiashi, '更新后数据');
|
||||||
|
} else {
|
||||||
|
console.log('shibaile')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('Request failed', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onManicuristClick(event) {
|
||||||
|
const index = event.currentTarget.dataset.index;
|
||||||
|
let meijiashi = this.data.meijiashi;
|
||||||
|
// 取消所有美甲师的选中状态
|
||||||
|
meijiashi.forEach((item, i) => {
|
||||||
|
item.selected = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 设置当前点击的美甲师为选中状态
|
||||||
|
meijiashi[index].selected = true;
|
||||||
|
|
||||||
|
// 更新 data 中的 meijiashi
|
||||||
|
this.setData({
|
||||||
|
meijiashi: meijiashi
|
||||||
|
});
|
||||||
|
this.setData({
|
||||||
|
meijiashiname:meijiashi[index].manicuristName,
|
||||||
|
meijiashiid:meijiashi[index].id
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log('当前选中的美甲师:', this.data.meijiashiname,this.data.meijiashiid);
|
||||||
|
},
|
||||||
|
zhifu(){
|
||||||
|
const commoditiesImage = this.data.commoditiesImage;
|
||||||
|
const commoditiesName = this.data.commoditiesName;
|
||||||
|
const commoditiesPrice = this.data.commoditiesPrice;
|
||||||
|
const meijiashiname = this.data.meijiashiname;
|
||||||
|
const yuyuetime = this.data.selectedTime
|
||||||
|
const meijiashiid = this.data.meijiashiid
|
||||||
|
const selectedTime = this.data.selectedTime
|
||||||
|
const dianpuid = this.data.dianpuid
|
||||||
|
const businessName = this.data.businessName
|
||||||
|
const shopid = this.data.ids
|
||||||
|
my.navigateTo({
|
||||||
|
url:`/pages/yuyuezhifusm/yuyuezhifusm?commoditiesImage=${commoditiesImage}&&commoditiesName=${commoditiesName}&&commoditiesPrice=${commoditiesPrice}&&meijiashiname=${meijiashiname}&&yuyuetime=${yuyuetime}&&meijiashiid=${meijiashiid}&&selectedTime=${selectedTime}&&dianpuid=${dianpuid}&&businessName=${businessName}&&shopid=${shopid}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
5
甲情_甲意/miniprogram/pages/yuyuejiemian/yuyuejiemian.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"defaultTitle": "预约上门",
|
||||||
|
"usingComponents": {},
|
||||||
|
"styleIsolation": "apply-shared"
|
||||||
|
}
|
61
甲情_甲意/miniprogram/pages/yuyuezhifu/yuyuezhifu.acss
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
.all{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.box{
|
||||||
|
width: 90%;
|
||||||
|
height: 450px;
|
||||||
|
display: flex;
|
||||||
|
border: 1px solid #9fa1a3;
|
||||||
|
border-radius: 20px;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.image{
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
.xinxi{
|
||||||
|
width: 100%;
|
||||||
|
height: 100px;
|
||||||
|
display: flex;
|
||||||
|
margin-left: 20rpx
|
||||||
|
}
|
||||||
|
.juzhong{
|
||||||
|
display:flex;
|
||||||
|
align-items:center
|
||||||
|
}
|
||||||
|
.biaoti{
|
||||||
|
width: 249px;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
.text{
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.form{
|
||||||
|
width: 100%;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
.xian{
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
background-color: #9fa1a3;
|
||||||
|
|
||||||
|
}
|
||||||
|
.zhifu{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 90%;
|
||||||
|
height: 50px;
|
||||||
|
background-color: #ee8d97;
|
||||||
|
border-radius: 40px;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 40rpx;
|
||||||
|
}
|
66
甲情_甲意/miniprogram/pages/yuyuezhifu/yuyuezhifu.axml
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
<view class="all">
|
||||||
|
<!-- 商品框 -->
|
||||||
|
<view class="box" >
|
||||||
|
<view class="xinxi">
|
||||||
|
<view class="juzhong">
|
||||||
|
<image class="image" mode="scaleToFill" src="{{commoditiesImage}}" />
|
||||||
|
</view>
|
||||||
|
<view class="biaoti">
|
||||||
|
<view style="margin-top:30rpx">
|
||||||
|
<text class="text">{{commoditiesName}}</text>
|
||||||
|
<view style="margin-top:5rpx">
|
||||||
|
<text>¥{{commoditiesPrice}}</text>
|
||||||
|
</view>
|
||||||
|
<view style="margin-top:5rpx">
|
||||||
|
<text style="color:#898c90">共1件</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="xian"></view>
|
||||||
|
<view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">商品总价</text>
|
||||||
|
<text style="margin-right:50rpx">¥{{commoditiesPrice}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">姓名</text>
|
||||||
|
<input style="width:90px" placeholder="请输入姓名" onInput="name" />
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">联系方式</text>
|
||||||
|
<input style="width:125px" placeholder="请输入联系方式" onInput="phone"/>
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">备注</text>
|
||||||
|
<input style="width:90px" placeholder="备注" onInput="note" />
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">蚂蚁积分</text>
|
||||||
|
<text style="margin-right:30rpx;color:#a3abb2">暂不可用</text>
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">预约时间</text>
|
||||||
|
<text style="margin-right:30rpx;">{{yuyuetime}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">指定美甲师</text>
|
||||||
|
<text style="margin-right:30rpx;">{{meijiashiname}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:right;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;">小计</text>
|
||||||
|
<text style="font-size:19px;color:red;margin-right:20rpx">¥{{commoditiesPrice}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="zhifu" onTap="zhifu">
|
||||||
|
<text style="color:white">立即预约</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
171
甲情_甲意/miniprogram/pages/yuyuezhifu/yuyuezhifu.js
Normal file
|
@ -0,0 +1,171 @@
|
||||||
|
import {url} from '../request'
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
const commoditiesImage = options.commoditiesImage;
|
||||||
|
const commoditiesName = options.commoditiesName;
|
||||||
|
const commoditiesPrice =options.commoditiesPrice
|
||||||
|
const meijiashiname = options.meijiashiname;
|
||||||
|
const yuyuetime = options.yuyuetime;
|
||||||
|
const meijiashiid = options.meijiashiid;
|
||||||
|
const selectedTime = options.selectedTime; // 例如 "9:00"
|
||||||
|
const dianpuid = options.dianpuid;
|
||||||
|
const businessName = options.businessName;
|
||||||
|
const shopid = options.shopid
|
||||||
|
|
||||||
|
// 获取当前日期
|
||||||
|
const currentDate = new Date();
|
||||||
|
const year = currentDate.getFullYear();
|
||||||
|
const month = (currentDate.getMonth() + 1).toString().padStart(2, '0'); // 补充两位
|
||||||
|
const day = currentDate.getDate().toString().padStart(2, '0'); // 补充两位
|
||||||
|
|
||||||
|
// 处理 selectedTime,确保格式正确,例如 "9:00" 转为 "09:00"
|
||||||
|
const timeParts = selectedTime.split(':');
|
||||||
|
const hours = timeParts[0].padStart(2, '0'); // 补充小时
|
||||||
|
const minutes = timeParts[1].padStart(2, '0'); // 补充分钟
|
||||||
|
|
||||||
|
// 拼接日期和时间
|
||||||
|
const formattedDateTime = `${month}-${day} ${hours}:${minutes}`;
|
||||||
|
|
||||||
|
// 设置格式化后的 selectedTime
|
||||||
|
this.setData({
|
||||||
|
commoditiesImage: commoditiesImage,
|
||||||
|
commoditiesName: commoditiesName,
|
||||||
|
commoditiesPrice: commoditiesPrice,
|
||||||
|
meijiashiname: meijiashiname,
|
||||||
|
yuyuetime: yuyuetime,
|
||||||
|
meijiashiid: meijiashiid,
|
||||||
|
selectedTime: formattedDateTime, // 存储格式化后的时间
|
||||||
|
dianpuid: dianpuid,
|
||||||
|
businessName: businessName,
|
||||||
|
shopid:shopid
|
||||||
|
});
|
||||||
|
},
|
||||||
|
name(e){
|
||||||
|
this.setData({
|
||||||
|
name: e.detail.value,
|
||||||
|
});
|
||||||
|
console.log(e.detail.value);
|
||||||
|
},
|
||||||
|
phone(e){
|
||||||
|
this.setData({
|
||||||
|
phone: e.detail.value,
|
||||||
|
});
|
||||||
|
console.log(e.detail.value);
|
||||||
|
},
|
||||||
|
zhifu(){
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
this.setData({
|
||||||
|
id: userInfo.id, // 获取 id
|
||||||
|
});
|
||||||
|
// 发送请求移除商品
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/appointments/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
appointmentTime: this.data.selectedTime,
|
||||||
|
businessId: this.data.dianpuid,
|
||||||
|
businessName: this.data.businessName,
|
||||||
|
id: "",
|
||||||
|
manicuristId: this.data.meijiashiid,
|
||||||
|
manicuristName: this.data.meijiashiname,
|
||||||
|
notes: "",
|
||||||
|
payMethod: 0,
|
||||||
|
phone: this.data.phone,
|
||||||
|
serviceMode: 0,
|
||||||
|
userId: userInfo.id,
|
||||||
|
userName: this.data.name,
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
my.alert({content:'预约成功'})
|
||||||
|
my.navigateBack();
|
||||||
|
console.log('chenggong');
|
||||||
|
} else {
|
||||||
|
my.alert({ content: '失败,请稍后重试' });
|
||||||
|
console.log(this.data.name,userInfo.id,this.data.phone,this.data.meijiashiname,this.data.meijiashiid,this.data.businessName,this.data.dianpuid,this.data.selectedTime,);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this.add()
|
||||||
|
},
|
||||||
|
add(){
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
this.setData({
|
||||||
|
id: userInfo.id, // 获取 id
|
||||||
|
|
||||||
|
});
|
||||||
|
// 发送请求移除商品
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/orders/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
businessId: this.data.dianpuid,
|
||||||
|
notes:this.data.note,
|
||||||
|
orderItemsAddRequest: [
|
||||||
|
{
|
||||||
|
attributeNames: this.data.commoditiesName,
|
||||||
|
commoditiesId: this.data.shopid,
|
||||||
|
quantity: 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
payMethod: 0,
|
||||||
|
phone: this.data.phone,
|
||||||
|
totalPrice: this.data.commoditiesPrice,
|
||||||
|
userId: this.data.id,
|
||||||
|
userName: this.data.name
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(this.data.name,this.data.commoditiesPrice,this.data.phone,this.data.shopid,this.data.commoditiesName,this.data.note,this.data.dianpuid,this.data.id,);
|
||||||
|
console.log(res,'成功');
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
my.showToast({
|
||||||
|
content: '待商家确认,请稍后',
|
||||||
|
duration: 2000 // 提示持续时间
|
||||||
|
});
|
||||||
|
my.navigateBack();
|
||||||
|
console.log('chenggong');
|
||||||
|
} else {
|
||||||
|
my.alert({ content: '失败,请稍后重试' });
|
||||||
|
console.log(this.data.name,this.data.commoditiesPrice,this.data.phone,this.data.shopid,this.data.commoditiesName,this.data.note,this.data.dianpuid,'else');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail:(res)=>{
|
||||||
|
console.log(this.data.name,this.data.commoditiesPrice,this.data.phone,this.data.shopid,this.data.commoditiesName,this.data.note,this.data.dianpuid,'失败');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
note(e){
|
||||||
|
this.setData({
|
||||||
|
note: e.detail.value,
|
||||||
|
});
|
||||||
|
console.log(e.detail.value);
|
||||||
|
}
|
||||||
|
});
|
5
甲情_甲意/miniprogram/pages/yuyuezhifu/yuyuezhifu.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"defaultTitle": "到店支付",
|
||||||
|
"usingComponents": {},
|
||||||
|
"styleIsolation": "apply-shared"
|
||||||
|
}
|
61
甲情_甲意/miniprogram/pages/yuyuezhifusm/yuyuezhifusm.acss
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
.all{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.box{
|
||||||
|
width: 90%;
|
||||||
|
height: 520px;
|
||||||
|
display: flex;
|
||||||
|
border: 1px solid #9fa1a3;
|
||||||
|
border-radius: 20px;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.image{
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
.xinxi{
|
||||||
|
width: 100%;
|
||||||
|
height: 100px;
|
||||||
|
display: flex;
|
||||||
|
margin-left: 20rpx
|
||||||
|
}
|
||||||
|
.juzhong{
|
||||||
|
display:flex;
|
||||||
|
align-items:center
|
||||||
|
}
|
||||||
|
.biaoti{
|
||||||
|
width: 249px;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
.text{
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.form{
|
||||||
|
width: 100%;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
.xian{
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
background-color: #9fa1a3;
|
||||||
|
|
||||||
|
}
|
||||||
|
.zhifu{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 90%;
|
||||||
|
height: 50px;
|
||||||
|
background-color: #ee8d97;
|
||||||
|
border-radius: 40px;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 40rpx;
|
||||||
|
}
|
76
甲情_甲意/miniprogram/pages/yuyuezhifusm/yuyuezhifusm.axml
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
<view class="all">
|
||||||
|
<!-- 商品框 -->
|
||||||
|
<view class="box" >
|
||||||
|
<view class="xinxi">
|
||||||
|
<view class="juzhong">
|
||||||
|
<image class="image" mode="scaleToFill" src="{{commoditiesImage}}" />
|
||||||
|
</view>
|
||||||
|
<view class="biaoti">
|
||||||
|
<view style="margin-top:30rpx">
|
||||||
|
<text class="text">{{commoditiesName}}</text>
|
||||||
|
<view style="margin-top:5rpx">
|
||||||
|
<text>¥{{commoditiesPrice}}</text>
|
||||||
|
</view>
|
||||||
|
<view style="margin-top:5rpx">
|
||||||
|
<text style="color:#898c90">共1件</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="xian"></view>
|
||||||
|
<view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">商品总价</text>
|
||||||
|
<text style="margin-right:50rpx">¥{{commoditiesPrice}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">姓名</text>
|
||||||
|
<input style="width:90px" placeholder="请输入姓名" onInput="name" />
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">联系方式</text>
|
||||||
|
<input style="width:125px" placeholder="请输入联系方式" onInput="phone" />
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">地址</text>
|
||||||
|
<input style="width:125px" placeholder="请输入上门地址" />
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">备注</text>
|
||||||
|
<input style="width:90px" placeholder="备注" onInput="note" />
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">蚂蚁积分</text>
|
||||||
|
<text style="margin-right:30rpx;color:#a3abb2">暂不可用</text>
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">预约时间</text>
|
||||||
|
<text style="margin-right:30rpx;">{{yuyuetime}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">指定美甲师</text>
|
||||||
|
<text style="margin-right:30rpx;">{{meijiashiname}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:space-between;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;margin-left:30rpx">上门预约费用</text>
|
||||||
|
<text style="margin-right:30rpx;">¥{{price}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="xian" style="margin-top: 10rpx;"></view>
|
||||||
|
<view style="display:flex;justify-content:right;margin-top:20rpx">
|
||||||
|
<text style="font-size:19px;">小计</text>
|
||||||
|
<text style="font-size:19px;color:red;margin-right:20rpx">¥{{commoditiesPrice}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="zhifu" onTap="yuyue">
|
||||||
|
<text style="color:white">立即预约</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
173
甲情_甲意/miniprogram/pages/yuyuezhifusm/yuyuezhifusm.js
Normal file
|
@ -0,0 +1,173 @@
|
||||||
|
import {url} from '../request'
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
price:50,
|
||||||
|
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
const commoditiesImage = options.commoditiesImage;
|
||||||
|
const commoditiesName = options.commoditiesName;
|
||||||
|
const commoditiesPrice = parseFloat(options.commoditiesPrice) + this.data.price;
|
||||||
|
const meijiashiname = options.meijiashiname;
|
||||||
|
const yuyuetime = options.yuyuetime;
|
||||||
|
const meijiashiid = options.meijiashiid;
|
||||||
|
const selectedTime = options.selectedTime; // 例如 "9:00"
|
||||||
|
const dianpuid = options.dianpuid;
|
||||||
|
const businessName = options.businessName;
|
||||||
|
const shopid = options.shopid;
|
||||||
|
|
||||||
|
// 获取当前日期
|
||||||
|
const currentDate = new Date();
|
||||||
|
const year = currentDate.getFullYear();
|
||||||
|
const month = (currentDate.getMonth() + 1).toString().padStart(2, '0'); // 补充两位
|
||||||
|
const day = currentDate.getDate().toString().padStart(2, '0'); // 补充两位
|
||||||
|
|
||||||
|
// 处理 selectedTime,确保格式正确,例如 "9:00" 转为 "09:00"
|
||||||
|
const timeParts = selectedTime.split(':');
|
||||||
|
const hours = timeParts[0].padStart(2, '0'); // 补充小时
|
||||||
|
const minutes = timeParts[1].padStart(2, '0'); // 补充分钟
|
||||||
|
|
||||||
|
// 拼接日期和时间
|
||||||
|
const formattedDateTime = `${month}-${day} ${hours}:${minutes}`;
|
||||||
|
|
||||||
|
// 设置格式化后的 selectedTime
|
||||||
|
this.setData({
|
||||||
|
commoditiesImage: commoditiesImage,
|
||||||
|
commoditiesName: commoditiesName,
|
||||||
|
commoditiesPrice: commoditiesPrice,
|
||||||
|
meijiashiname: meijiashiname,
|
||||||
|
yuyuetime: yuyuetime,
|
||||||
|
meijiashiid: meijiashiid,
|
||||||
|
selectedTime: formattedDateTime, // 存储格式化后的时间
|
||||||
|
dianpuid: dianpuid,
|
||||||
|
businessName: businessName,
|
||||||
|
shopid:shopid
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
yuyue(){
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
this.setData({
|
||||||
|
id: userInfo.id, // 获取 id
|
||||||
|
});
|
||||||
|
// 发送请求移除商品
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/appointments/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
appointmentTime: this.data.selectedTime,
|
||||||
|
businessId: this.data.dianpuid,
|
||||||
|
businessName: this.data.businessName,
|
||||||
|
id: "",
|
||||||
|
manicuristId: this.data.meijiashiid,
|
||||||
|
manicuristName: this.data.meijiashiname,
|
||||||
|
notes: "",
|
||||||
|
payMethod: 0,
|
||||||
|
phone: this.data.phone,
|
||||||
|
serviceMode: 0,
|
||||||
|
userId: userInfo.id,
|
||||||
|
userName: this.data.name,
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
my.alert({content:'预约成功'})
|
||||||
|
my.navigateBack();
|
||||||
|
console.log('chenggong');
|
||||||
|
} else {
|
||||||
|
my.alert({ content: '失败,请稍后重试' });
|
||||||
|
console.log(this.data.name,userInfo.id,this.data.phone,this.data.meijiashiname,this.data.meijiashiid,this.data.businessName,this.data.dianpuid,this.data.selectedTime,);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this.add()
|
||||||
|
},
|
||||||
|
add(){
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
this.setData({
|
||||||
|
id: userInfo.id, // 获取 id
|
||||||
|
|
||||||
|
});
|
||||||
|
// 发送请求移除商品
|
||||||
|
if (userInfo && userInfo.cookie) {
|
||||||
|
my.request({
|
||||||
|
url: url + '/api/orders/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
businessId: this.data.dianpuid,
|
||||||
|
notes:this.data.note,
|
||||||
|
orderItemsAddRequest: [
|
||||||
|
{
|
||||||
|
attributeNames: this.data.commoditiesName,
|
||||||
|
commoditiesId: this.data.shopid,
|
||||||
|
quantity: 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
payMethod: 0,
|
||||||
|
phone: this.data.phone,
|
||||||
|
totalPrice: this.data.commoditiesPrice,
|
||||||
|
userId: this.data.id,
|
||||||
|
userName: this.data.name
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Cookie': userInfo.cookie
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(this.data.name,this.data.commoditiesPrice,this.data.phone,this.data.shopid,this.data.commoditiesName,this.data.note,this.data.dianpuid,this.data.id,);
|
||||||
|
console.log(res,'成功');
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
my.showToast({
|
||||||
|
content: '待商家确认,请稍后',
|
||||||
|
duration: 2000 // 提示持续时间
|
||||||
|
});
|
||||||
|
my.navigateBack();
|
||||||
|
console.log('chenggong');
|
||||||
|
} else {
|
||||||
|
my.alert({ content: '失败,请稍后重试' });
|
||||||
|
console.log(this.data.name,this.data.commoditiesPrice,this.data.phone,this.data.shopid,this.data.commoditiesName,this.data.note,this.data.dianpuid,'else');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail:(res)=>{
|
||||||
|
console.log(this.data.name,this.data.commoditiesPrice,this.data.phone,this.data.shopid,this.data.commoditiesName,this.data.note,this.data.dianpuid,'失败');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
name(e){
|
||||||
|
this.setData({
|
||||||
|
name: e.detail.value,
|
||||||
|
});
|
||||||
|
console.log(e.detail.value);
|
||||||
|
},
|
||||||
|
phone(e){
|
||||||
|
this.setData({
|
||||||
|
phone: e.detail.value,
|
||||||
|
});
|
||||||
|
console.log(e.detail.value);
|
||||||
|
},
|
||||||
|
note(e){
|
||||||
|
this.setData({
|
||||||
|
note: e.detail.value,
|
||||||
|
});
|
||||||
|
console.log(e.detail.value);
|
||||||
|
}
|
||||||
|
});
|
5
甲情_甲意/miniprogram/pages/yuyuezhifusm/yuyuezhifusm.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"defaultTitle": "上门支付",
|
||||||
|
"usingComponents": {},
|
||||||
|
"styleIsolation": "apply-shared"
|
||||||
|
}
|