This commit is contained in:
Ling53666
2025-08-18 09:11:51 +08:00
commit 02554225da
2516 changed files with 133155 additions and 0 deletions

View File

@ -0,0 +1,114 @@
.search-line {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
}
.cancel {
color: var(--color-text-primary);
}
.image1{
width: 30rpx;
height: 30rpx;
}
.box{
width: 90%;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #de868f;
border-radius: 40px;
margin-top: 20rpx;
background-color: #ffffff;
}
.box1{
width: 100%;
display: flex;
justify-content: center;
}
.box4{
width: 120rpx;
height: 50rpx;
border: 1px solid #4095e5;
border-radius: 50px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20rpx;
}
.dingwei{
color: #4095e5;
border:1px solid #4095e5;
font-size: 12px;
}
.kuan{
width: 80%;
height: 100%;
display: flex;
justify-content: center;
flex-direction: column;
}
.statues{
font-size: 13px;
width: 100rpx;
background-color: #4095e5;
margin-top: 20rpx;
color: white;
}
.yuyuekuang{
width: 20%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.text{
font-weight: bolder;
}
.wenzi{
width: 60%;
height: 200rpx;
display: flex;
}
.imagebox{
width: 40%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.image{
width: 100px;
height: 100px;
border-radius: 20px;
}
.kuang{
width: 90%;
height: 240rpx;
border: 3px solid #de868f;
border-radius: 20px;
margin-top: 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.box2{
display: flex;
justify-content: center;
align-items: center;
margin-top: 50rpx;
flex-direction: column;
}
.dingweikuang{
width: 100%;
position: relative;
left: 50rpx;
top: 30rpx;
}
.dingweiimage{
width: 30rpx;
height: 30rpx;
}

View File

@ -0,0 +1,47 @@
<view class="box1">
<!-- 搜索框 -->
<view class="box">
<view class="search-line">
<view style="display:flex;align-items:center">
<image onTap="find" style="width:20px;height:20px" mode="scaleToFill" src="../image/sousuo.png" />
<input onInput="inputchange" onConfirm="find" style="margin-left:10rpx;width:230px" placeholder="请输入内容" />
</view>
<view class="cancel">取消</view>
</view>
</view>
</view>
<!-- 定位 -->
<view class="dingweikuang">
<image mode="scaleToFill" class="dingweiimage" src="../image/dingwei.png" />
<text style="margin-left:8rpx">{{selectedCity}}</text>
</view>
<!-- 店铺界面 -->
<view style="width:100%">
<view class="box2" >
<view class="kuang" a:for="{{ sousuo }}" data-num="{{item}}" onTap="dianpu" a:if="{{ item.business.state==1 }}">
<view class="imagebox">
<image class="image" mode="scaleToFill" src="{{item.business.businessAvatar}}" />
</view>
<view class="wenzi">
<view class="kuan">
<text class="text">{{item.business.businessName}}</text>
<view style="margin-top:5rpx">
<text class="statues">{{item.business.businessImages}}</text>
<text class="dingwei">{{item.business.startBusiness}}营业</text>
</view>
<view style="margin-top:5rpx">
<text class="dingweia" style="width:150rpx;top:50rpx;width:200rpx;height:100rpx;font-size:12px;color: #9b9b9b;">{{item.business.address}}</text>
</view>
</view>
</view>
<view class="yuyuekuang">
<view class="box4">
<text style="font-size:13px;color:#4095e5" a:if="{{ item.business.storeStatus===1 }}">可上门</text>
<text style="font-size:13px;color:#4095e5" a:if="{{ item.business.storeStatus===0 }}">已休息</text>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,141 @@
import {url} from '../request'
Page({
data: {
sousuo:[],
address: "",
businessAvatar: "",
businessImages: "",
businessName: "",
businessPhone: "",
businessProfile: "",
categoryId: 0,
createTime: "",
endBusiness: "",
id: 0,
isDelete: 0,
startBusiness: "",
state: 0,
storeStatus: '',
updateTime: "",
userId: 0,
inputtext:'',
selectedCity:'',
},
inputchange(e){
this.setData({
inputtext:e.detail.value,
});
console.log(e.detail.value);
console.log(this.data.inputtext);
},
onLoad() {
this.localcation();
my.request({
url: url + '/api/business/list',
method: 'POST',
data: {
},
headers: {
'content-type': 'application/json',
},
dataType: 'json',
success: (res) => {
console.log('Request succeeded:', res);
if (res.data && res.data.data) {
this.setData({
sousuo: res.data.data, // 更新 tuijian 列表
});
} else {
console.log('shibaile')
}
},
fail: (error) => {
console.error('Request failed', error);
}
});
},
dianpu(item) {
const id = item.target.dataset.num
console.log('传递的数据:', id);
const ID = id.business.id
console.log(ID);
const userId = id.business.userId
const address = id.business.address
const businessName = id.business.businessName
const businessAvatar = id.business.businessAvatar
const endBusiness = id.business.endBusiness
const startBusiness = id.business.startBusiness
const storeStatus = id.business.storeStatus
const businessPhone =id.business.businessPhone
// const level = id.business.level
console.log('Address being passed: ', ID,address,businessName,businessAvatar,endBusiness,startBusiness,businessPhone);
my.navigateTo({
url: `/pages/dianpuzhuye/dianpuzhuye?userId=${userId}
&&address=${address}&&businessName=${businessName}
&&businessAvatar=${businessAvatar}
&&startBusiness=${startBusiness}
&&endBusiness=${endBusiness}&&storeStatus=${storeStatus}
&&id=${ID}&&businessPhone=${businessPhone}`,
});
},
find(){
my.request({
url: url + '/api/business/list/page/vo',
method: 'POST',
data: {
address: this.data.selectedCity,
businessName: this.data.inputtext,
businessProfile: "",
categoryId: "",
current: 1,
id: "",
pageSize: 20,
sortField: "",
sortOrder: "",
state: "",
storeStatus: "",
userId: ""
},
headers: {
'content-type': 'application/json',
},
dataType: 'json',
success: (res) => {
console.log('Request succeeded:', res);
if (res.data && res.data.data) {
this.setData({
sousuo:res.data.data.records
})
} else {
console.log('shibaile')
}
},
fail: (error) => {
console.error('Request failed', error);
}
});
},
localcation(){
my.getLocation({
type: 1, // 获取包括省市区县数据
success: (res) => {
console.log('定位成功:', res);
this.setData({
selectedCity: res.city // 将城市名称设置到 selectedCity
});
},
fail: (error) => {
console.error('定位失败:', error);
my.alert({
title: '定位失败',
content: '无法获取当前位置,请检查定位权限设置。'
});
this.setData({
selectedCity: '定位失败'
});
}
});
}
});

View File

@ -0,0 +1,8 @@
{
"defaultTitle": "到店服务",
"usingComponents": {
"ant-icon": "antd-mini/es/Icon/index",
"ant-input": "antd-mini/es/Input/index"
},
"styleIsolation": "apply-shared"
}

View File

@ -0,0 +1,44 @@
page {
background-color: white;
}
.tupian{
width: 500rpx;
height: 500rpx;
border-radius: 250rpx;
overflow: hidden;
margin-left: auto;
margin-right: auto;
display: block;
}
.wenzi{
font-size: 40rpx;
display: flex;
justify-content: center;
align-items: center;
margin-top: 30px;
}
.container{
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
margin-top: 50px;
}
navigator {
background-color: blue;
color: #fff;
margin-bottom: 10rpx;
padding: 20rpx;
text-align: center;
}
.navigator-hover {
background-color: lightskyblue;
color: #fff;
}
.image{
width: 80rpx;
height: 80rpx;
position: relative;
left: 330rpx;
}

View File

@ -0,0 +1,7 @@
<view>
<image class="tupian" mode="scaleToFill" src="../image/logo.png" />
<image mode="scaleToFill" class="image" src="/pages/image/login.png" />
<text class="wenzi">请完成授权以继续使用</text>
</view>
<button type="primary" onTap="Login">支付宝一键登录</button>

View File

@ -0,0 +1,106 @@
import {url} from '../request'
Page({
data: {
authCode: '',
intervalId: null, // 定时器ID用于后续清除
sid:0
},
Login() {
my.getAuthCode({
scopes: 'auth_user',
success: res => {
const authcode = res.authCode;
console.log(typeof authcode);
console.log(authcode);
// 请求后端接口进行用户登录
my.request({
url: url + '/api/Alipay/parseCode',
data: {
authcode,
severId:this.data.sid
},
success: (res) => {
if(res.data.code==0){
const { username, avatarUrl, id } = res.data.data.userVO;
const setCookie = res.header['set-cookie'] || res.header['Set-Cookie'];
console.log('Set-Cookie:', setCookie + '这是这个码');
// 存储用户信息到本地存储
my.setStorage({
key: 'userInfo',
data: {
username: username,
avatarUrl: avatarUrl,
cookie: setCookie,
id: id,
timestamp: new Date().getTime(),
},
success: function () {
console.log('用户信息已存储');
},
fail: function (err) {
console.error('存储失败:', err);
}
});
// 启动定时器清除缓存
this.startClearingStorage();
// 登录成功后的处理逻辑
console.log(res);
my.alert({
title: '登录成功',
});
my.navigateBack();
}else{
this.setData({
sid:1,
})
console.log(this.data.sid);
}
},
fail: (res) => {
this.setData({
sid:1,
})
console.log("登录失败:", res);
}
});
}
});
},
// 启动定时器清除缓存
startClearingStorage() {
// 清除缓存定时器,每小时检查一次
const intervalId = setInterval(() => {
my.getStorage({
key: 'userInfo',
success: (res) => {
const userInfo = res.data;
if (userInfo) {
my.removeStorage({
key: 'userInfo',
success: function () {
console.log('用户信息已删除');
},
fail: function (err) {
console.error('删除失败:', err);
}
});
} else {
console.log('缓存中没有用户信息,停止定时器');
clearInterval(intervalId); // 清除定时器
}
},
});
}, 86400*1000); // 每小时检查一次单位是毫秒3600秒 = 1小时
// 保存定时器ID便于后续清除定时器
this.setData({
intervalId: intervalId,
});
},
});

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"styleIsolation": "apply-shared"
}

View File

@ -0,0 +1,44 @@
page {
background-color: white;
}
.tupian{
width: 500rpx;
height: 500rpx;
border-radius: 250rpx;
overflow: hidden;
margin-left: auto;
margin-right: auto;
display: block;
}
.wenzi{
font-size: 40rpx;
display: flex;
justify-content: center;
align-items: center;
margin-top: 30px;
}
.container{
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
margin-top: 50px;
}
navigator {
background-color: blue;
color: #fff;
margin-bottom: 10rpx;
padding: 20rpx;
text-align: center;
}
.navigator-hover {
background-color: lightskyblue;
color: #fff;
}
.image{
width: 80rpx;
height: 80rpx;
position: relative;
left: 330rpx;
}

View File

@ -0,0 +1,7 @@
<view>
<image class="tupian" mode="scaleToFill" src="../image/logo.png" />
<image mode="scaleToFill" class="image" src="/pages/image/login.png" />
<text class="wenzi">请完成授权以继续使用</text>
</view>
<button type="primary" onTap="Login">支付宝一键登录</button>

View File

@ -0,0 +1,77 @@
import {url} from '../request'
Page({
data: {
authCode: '',
},
Login() {
my.getAuthCode({
scopes: 'auth_user',
success: res => {
const authCode = res.authCode;
console.log(typeof authCode);
console.log(authCode);
my.setStorage({
key: 'userInfo',
data: {
username: username,
avatarUrl: avatarUrl,
cookie:setCookie,
id:id
},
success: function () {
console.log('用户信息已存储',cookie);
},
fail: function (err) {
console.error('存储失败:', err);
}
});
// 请求后端接口进行用户登录
// my.request({
// url: url + '/api/Alipay/parseCode',
// data: {
// authCode,
// },
// success: (res) => {
// const { username, avatarUrl,id} = res.data.data;
// const setCookie = res.header['set-cookie'] || res.header['Set-Cookie'];
// console.log('Set-Cookie:', setCookie+'这是这个码');
// // 存储用户信息到本地存储
// my.setStorage({
// key: 'userInfo',
// data: {
// username: username,
// avatarUrl: avatarUrl,
// cookie:setCookie,
// id:id
// },
// success: function () {
// console.log('用户信息已存储',cookie);
// },
// fail: function (err) {
// console.error('存储失败:', err);
// }
// });
// // 登录成功后的处理逻辑
// console.log(res);
// my.alert({
// title: '登录成功',
// });
// my.navigateBack();
// },
// fail: (res) => {
// console.log("登录失败:", res);
// }
// });
}
});
},
});

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "登录测试",
"usingComponents": {},
"styleIsolation": "apply-shared"
}

View File

@ -0,0 +1,245 @@
.cebian {
width: 20%;
height: 100%;
}
.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: 100%;
display: flex;
align-items: center;
flex-direction: column;
overflow-y: scroll;
overflow-x: hidden;
}
.pages{
width: 100%;
height: 100%;
display: flex;
margin-top: 30rpx;
}
.shop{
width: 90%;
height:130px;
border: 1px solid #f2819f;
border-radius: 20px;
margin-top: 10rpx;
display: flex;
margin-bottom: 10rpx;
}
.boxmessage{
width: 60%;
height: 100%;
display: flex;
justify-content: center;
flex-direction: column;
}
.image{
width: 100px;
height: 100px;
border-radius: 20px;
}
.imagebox{
width: 40%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-left: 10rpx;
}
.dingwei{
width: 100%;
height: 50%;
}
.dingweia{
width: 100%;
height: 30%;
display: flex;
justify-content: space-between;
align-items: center;
}
.yuyue{
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 20px;
border-radius: 20px;
border: 1px solid #fb96b1;
background-color: #fb96b1;
margin-right: 10rpx;
}
.yuyuekuang{
width: 100%;
height: 20%;
display: flex;
justify-content: space-between;
}
.gouimage{
width: 20px;
height: 20px;
margin-right: 10rpx;
}
/* 店铺名框 */
.Box2
{
width: 100%;
height: 130px;
background-color: white;
margin-top: 50rpx;
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: 20rpx;
color: rgb(194, 53, 53);
}
.z4{
position: relative;
left: 50rpx;
}
/* 营业时间 */
.z6{
color: #4095E5;
font-weight: bolder;
margin-left: 20rpx;
}
.z7{
display: flex;
width: 300px;
margin-left: 10rpx;
font-size: 13px;
margin-top: 3rpx;
}
.box3{
width: 100%;
height: 1px;
background-color: darkgrey;
margin-top: 10rpx;
}
/* 地址 */
.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;
flex-direction: column;
align-items: center;
margin-top: 10rpx;
}
.pingjiakuang{
width: 90%;
border-top: #6e7071 1px solid;
height: auto;
margin-top: 20rpx;
}
.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;
}
.time{
width: 100%;
display: flex;
}

View File

@ -0,0 +1,125 @@
<!-- 店铺名框 -->
<view class="Box2" >
<image class="shangimage" mode="scaleToFill" src="{{businessAvatar}}" />
<view class="box8">
<text class="z2">{{businessName}}</text>
<view style="margin-top:10rpx">
<ant-rate
defaultValue="{{level}}"
readonly
></ant-rate>
<text class="z3">{{level}}.0</text>
<text class="z4">500条</text>
</view>
<view onTap="soucang">
<image class="soucangimage" mode="scaleToFill" src="../image/shoucang.png" />
</view>
<view onTap="kefu">
<image class="zixunimage" mode="scaleToFill" src="../image/zixun.png" />
</view>
</view>
</view>
<!-- 营业时间 -->
<view style="margin-bottom:20rpx">
<view class="time">
<text class="z6" a:if="{{storeStatus == 0}}">已休息</text>
<text class="z6" a:if="{{storeStatus == 1}}">营业中</text>
<view class="z7">
<text>营业时间:{{startBusiness}}-{{endBusiness}}</text>
</view>
</view>
<view class="box3"></view>
<!-- 地址 -->
<view>
<image class="image3" mode="scaleToFill" src="../image/didian.png" />
<text class="z8">{{address}}</text>
</view>
<view class="box4"></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="aspectFill" src="{{item.commoditiesImage}}" />
</view>
<view class="boxmessage" >
<view class="dingweia">
<view>
<text>{{item.commoditiesName}}</text>
</view>
<view onTap="jiaru" data-num="{{item}}">
<image class="gouimage" mode="scaleToFill" src="../image/tijiagouwuche.png" />
</view>
</view>
<view class="dingwei">
<text style="font-size:12px;color:#9c9a9a">款式随便做,饰品不限量,含甲片,含卸甲</text>
</view>
<view class="yuyuekuang" >
<text>¥{{item.commoditiesPrice}}</text>
<view class="yuyue" data-num="{{item}}" onTap="shangpinjiemian">
<text>预约</text>
</view>
</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" a:if="{{ item.userRating.picture }}">
<image class="kuangimage" mode="scaleToFill" src="{{item.userRating.picture}}" />
</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 onTap="callPhone">联系电话:{{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>

View File

@ -0,0 +1,375 @@
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:[],
level:'',
},
callPhone() {
my.makePhoneCall({
number: this.data.businessPhone,
success: function(res) {
console.log(res); //{"success": true}
},
fail: function(err) {
console.log(err);
}
});
},
number(){
const randomLevel = Math.floor(Math.random() * 5) + 1;
this.setData({
level: randomLevel,
});
console.log("随机生成的 level 值是:", randomLevel);
},
onLoad(options) {
this.number();
// 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,storeStatus,'这是店铺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
})
}
console.log(this.data.pingjia);
},
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
const selectedOptions = '到店服务'
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: 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+'这是店铺的')
},
kefu(){
my.navigateTo({
url:'/pages/zixunmeijiashi/zixunmeijiashi'
})
}
});

View File

@ -0,0 +1,8 @@
{
"defaultTitle": "店铺主页",
"usingComponents": {
"ant-rate": "antd-mini/es/Rate/index"
},
"styleIsolation": "apply-shared"
}

View File

@ -0,0 +1,63 @@
.text{
font-size: 18px;
font-weight:bold;
}
.textbox{
width: 40%;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
}
.box{
width: 90%;
display: flex;
flex-direction: column;
border: 1px solid #f69595;
border-radius: 10px;
}
.image{
width: 25px;
height: 25px;
}
.biaoti{
width: 100%;
display: flex;
height: 30px;
align-items:center;
justify-content:space-between;
}
.imagebox{
display: flex;
margin:10rpx 0 20rpx 0
}
.dindan{
display: flex;
justify-content: center;
}
.tupian{
width: 100px;
height: 100px;
border-radius: 20px;
margin-left: 20rpx;
}
.price{
width: 70px;
display: flex;
align-items:flex-end;
justify-content: center;
margin-left:auto ;
}
.xian{
width: 98%;
height: 1px;
border-top: 1px solid #827e7e;
}
.messagebox{
width: 100%;
display: flex;
flex-direction: column;
}
.textwiezhi{
margin:10rpx 0 10rpx 20rpx
}

View File

@ -0,0 +1,41 @@
<view class="textbox">
<text a:if="{{ statues==0 }}" class="text">订单待支付</text>
<text a:if="{{ statues==1 }}" class="text">订单待使用</text>
<text a:if="{{ statues==2 }}" class="text">订单已完成</text>
<text a:if="{{ statues==3 }}" class="text">订单已取消</text>
<text a:if="{{ statues==4 }}" class="text">订单已预约</text>
<text a:if="{{ statues==5 }}" class="text">订单已退款</text>
</view>
<view class="dindan">
<view class="box">
<view class="biaoti">
<view style="margin-left:10rpx;display:flex;justify-content:center;align-items:center">
<text>{{businessName}}</text>
<image class="image" mode="scaleToFill" src="../image/jiantou.png" />
</view>
<view>
<text a:if="{{ serviceMode==0 }}" style="color:#95c1f6;margin-right:10rpx">到店服务</text>
<text a:if="{{ serviceMode==1 }}" style="color:#95c1f6;margin-right:10rpx">上门服务</text>
</view>
</view>
<!-- 图片部分 -->
<view class="imagebox">
<image class="tupian" mode="scaleToFill" src="{{commoditiesImage}}" />
<view style="display:flex;flex-direction:column;height:100%;justify-content:center">
<text style="margin-left:20rpx;font-weight:bold;font-size:18">{{commoditiesName}}</text>
<text style="margin:10rpx 0 0 20rpx">x1</text>
</view>
<view class="price">
<text>实付¥{{commoditiesPrice}}</text>
</view>
</view>
<view class="xian"></view>
<!-- 信息部分 -->
<view class="messagebox">
<text class="textwiezhi">订单编号:{{ordernumber}}</text>
<text class="textwiezhi">客户姓名:{{userName}}</text>
<text class="textwiezhi">联系电话:{{phone}}</text>
<text class="textwiezhi">创建时间:{{createTime}}</text>
</view>
</view>
</view>

View File

@ -0,0 +1,29 @@
Page({
data: {},
onLoad(options) {
const ordernumber = options.ordernumber
const userName = options.userName
const phone = options.phone
const createTime = options.createTime
const commoditiesPrice = options.commoditiesPrice
const commoditiesImage = options.commoditiesImage
const commoditiesName = options.commoditiesName
const businessName = options.businessName
const statues = options.statues
const serviceMode = options.serviceMode
console.log(statues,ordernumber,userName,phone,createTime,businessName,commoditiesPrice,commoditiesImage,commoditiesName);
this.setData({
userName:userName,
phone:phone,
createTime:createTime,
commoditiesPrice:commoditiesPrice,
commoditiesImage:commoditiesImage,
commoditiesName:commoditiesName,
businessName:businessName,
statues:statues,
ordernumber:ordernumber,
userName:userName,
serviceMode :serviceMode,
})
},
});

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "订单详情",
"usingComponents": {},
"styleIsolation": "apply-shared"
}

View File

@ -0,0 +1,162 @@
.box {
width: 100%;
min-height: 100vh; /* 确保容器至少占满屏幕的高度 */
background-color: #eec2c7;
overflow-y: auto; /* 允许竖直方向滚动 */
display: flex;
align-items: center;
flex-direction: column;
overflow:hidden; /* 防止溢出 */
}
.box3 {
width: 100%;
display: flex;
justify-content: center;
flex-direction: column;
background-color: rgba(252, 240, 240, 0.807);
border-radius: 20px;
margin: 5rpx;
margin-bottom: 50px; /* 留出一些空间给底部结算栏 */
margin-top: 30rpx;
}
.box1 {
width: 100%;
height: 200px;
display: flex;
flex-direction: column;
margin-top: 10rpx;
}
.dianpuname{
width: 100%;
height: 10%;
display: flex;
align-items: center;
margin-top: 10rpx;
justify-content: space-between;
}
.dianpunamea{
width: 50%;
height: 100%;
display: flex;
align-items: center;
margin-top: 10rpx;
}
.heizi{
width: 100%;
height: 90%;
display: flex;
}
.image {
width: 120px;
height: 120px;
border-radius: 10px;
}
.box4 {
width: 15%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.box5 {
width: 100%;
height: 70%;
display: flex;
justify-content: center;
flex-direction: column;
}
.text {
padding: 5px;
}
.container {
width: 100%;
height: 30%;
display: flex;
justify-content: end;
}
.jian{
display: flex;
justify-content: center;
align-items: center;
margin-right: 20rpx;
}
.fenbu{
width: 50%;
height: 100%;
display: flex;
flex-direction: column;
}
.boxd {
width: 100px;
height: 40px;
position: absolute;
border-radius: 30px;
background-color: rgb(162, 12, 12);
left: 570rpx;
display: flex;
align-items: center;
justify-content: center;
}
.text1 {
color: #ffffff;
position: unset;
}
.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{
font-size:12px;
color:#a8b0b8;
margin-right: 15rpx;
}
.number{
width: 30px;
height: 25px;
background-color: white;
display: flex;
justify-content: center;
align-items: center;
}
.beijing{
display: flex;
justify-content: center;
align-items: center;
width: 25px;
height: 25px;
background-color: white;
font-size: 20p;
}
.imagejiantou{
width: 35px;
height: 35px;
}
.shangpinimage{
width: 35%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}

View File

@ -0,0 +1,60 @@
<view class="box">
<!-- 购物车店铺 -->
<view class="box3">
<checkbox-group onChange="checkboxChange">
<block a:for="{{productList}}" a:key="id">
<view class="box1">
<view class="dianpuname">
<view class="dianpunamea">
<text style="margin-left:25rpx;font-size:16px">{{item.name}}</text>
<image class="imagejiantou" mode="scaleToFill" src="../image/jiantou.png" />
</view>
<text class="text3" onTap="yichu" data-id="{{item.cartId}}">移除购物车</text>
</view>
<view class="heizi">
<view class="box4">
<!-- 给每个复选框绑定 data-index -->
<checkbox color="red" checked="{{item.checked}}" value="{{item.cartId}}" />
</view>
<view class="shangpinimage">
<image class="image" mode="scaleToFill" src="{{item.commoditiesImage}}" />
</view>
<view class="fenbu">
<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>
<view class="container">
<view class="jian">
<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>
</view>
</view>
</view>
</block>
</checkbox-group>
</view>
<!-- 底部结算栏 -->
<view class="boxall">
<checkbox color="red" checked="{{select_all}}" onChange="selectall"/>全选
<text class="text2">合计:¥{{totalPrice}}</text>
<view class="boxd" onTap="jiesuan">
<text class="text1">结算</text>
</view>
</view>
</view>

View File

@ -0,0 +1,281 @@
import { url } from '../request';
Page({
data: {
id: '',
productList: [], // 商品列表
select_all: false,
checkbox_productListid: '',
totalPrice: 0,
},
// 计算总价
calculateTotalPrice() {
const totalPrice = this.data.productList
.filter(item => item.checked) // 只计算勾选的商品
.reduce((sum, item) => sum + item.quantity * item.commoditiesPrice, 0);
// 格式化总价为两位小数
const formattedTotalPrice = totalPrice.toFixed(2);
// 更新 totalPrice
this.setData({ totalPrice: formattedTotalPrice });
},
// 增加商品数量
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({
productList: updatedProductList,
select_all: newSelectAll,
checkbox_productListid,
});
console.log("arr=", checkbox_productListid);
this.calculateTotalPrice(); // 重新计算总价
const selectedProducts = updatedProductList.filter(item => item.checked);
this.setData({
selectedProducts, // 存储勾选的商品信息
});
console.log(selectedProducts);
},
checkboxChange(e) {
const { value } = e.detail; // 当前选中的值列表
const updatedProductList = this.data.productList.map(item => ({
...item,
checked: value.includes(item.cartId.toString()),
}));
const select_all = updatedProductList.every(item => item.checked);
this.setData({
productList: updatedProductList,
select_all,
});
this.calculateTotalPrice(); // 更新总价
// 提取勾选的商品
const selectedProducts = updatedProductList.filter(item => item.checked);
this.setData({
selectedProducts, // 存储勾选的商品信息
});
console.log(selectedProducts,'askldjaslkdaslkdjklas');
},
// 获取商品数据
fetchProductDetails(cartItems) {
const promises = cartItems.map((item) => {
return new Promise((resolve, reject) => {
my.request({
url: url + '/api/commodities/getById/commodities',
method: 'GET',
data: { id:item.cartVO.commoditiesId },
headers: { 'content-type': 'application/json' },
success: (res) => {
console.log(res,'在这家');
if (res.data.code === 0) {
const productData = res.data.data;
productData.cartId = item.cartVO.id; // 将 cartId 添加到商品数据中
productData.quantity = 1; // 默认数量为 1
productData.name = item.business.businessName;
resolve(productData);
} else {
reject(`商品信息获取失败: ${res.data.message}`);
}
},
fail: (error) => {
reject(error);
},
});
});
});
Promise.all(promises)
.then((productList) => {
this.setData({ productList });
this.calculateTotalPrice(); // 初始化总价
})
.catch((error) => {
console.error('商品信息获取失败: ', error);
my.alert({ content: '商品信息获取失败,请稍后重试' });
});
},
// 页面加载时获取商品数据
onShow() {
this.setData({
select_all: false,
selectedProducts:[],
});
my.getStorage({
key: 'userInfo',
success: (res) => {
const userInfo = res.data;
if (userInfo && userInfo.cookie) {
my.request({
url: url + '/api/cart/selectByUserId',
method: 'POST',
data: {
id: userInfo.id
},
headers: {
'content-type': 'application/json',
},
dataType: 'json',
success: (res) => {
console.log(res,'hhhhhhhhhhhh');
if (res.data.code === 0) {
console.log(res);
const cartItems = res.data.data;
this.fetchProductDetails(cartItems);
} else {
my.alert({
content: '登录信息已过期,请重新登录',
});
my.navigateTo({
url: '/pages/denglu/denglu',
});
}
},
fail: (error) => {
console.error('请求失败: ', JSON.stringify(error));
my.alert({ content: '请求失败,请稍后重试' });
},
});
}
else{
my.alert({
content:'您未登录,请先登录'
})
my.navigateTo({
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;
this.setData({
id: userInfo.id, // 获取 id
});
// 发送请求移除商品
if (userInfo && userInfo.cookie) {
my.request({
url: url + '/api/cart/delete',
method: 'POST',
data: {
id: cartId,
userId: userInfo.id
}, // 使用 cartId 作为参数
headers: {
'content-type': 'application/json',
'Cookie': userInfo.cookie
},
dataType: 'json',
success: (res) => {
console.log(res);
if (res.data.code === 0) {
my.alert({ content: '成功移除商品' });
console.log(res);
// 更新购物车
this.updateCartList();
} else {
my.alert({ content: '移除商品失败,请稍后重试' });
console.log(res);
}
},
});
}
},
});
},
// 移除后更新
updateCartList() {
this.setData({ select_all: false });
my.getStorage({
key: 'userInfo',
success: (res) => {
const userInfo = res.data;
if (userInfo && userInfo.cookie) {
my.request({
url: url + '/api/cart/selectByUserId', // 获取最新的购物车数据
method: 'POST',
data: {
id: this.data.id
}, // 使用当前用户ID
headers: {
'content-type': 'application/json',
'Cookie': userInfo.cookie
},
dataType: 'json',
success: (res) => {
if (res.data.code === 0) {
const cartItems = res.data.data;
this.fetchProductDetails(cartItems, userInfo.id);
} else {
my.alert({ content: '获取购物车数据失败,请稍后重试' });
}
},
fail: (error) => {
console.error('请求失败: ', JSON.stringify(error));
my.alert({ content: '请求失败,请稍后重试' });
},
});
}
},
});
},
jiesuan() {
const products = this.data.selectedProducts;
if(!products || products.length === 0){
my.alert({
content:'请选择商品'
})
}else{
const productsStr = JSON.stringify(products)
const prices =this.data.totalPrice
my.navigateTo({
url: '/pages/zhifujiemian/zhifujiemian?products='+encodeURIComponent(productsStr)+ '&prices=' + encodeURIComponent(prices)
});
}
}
});

View File

@ -0,0 +1,7 @@
{
"defaultTitle": "购物车",
"usingComponents": {
},
"styleIsolation": "apply-shared"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -0,0 +1,3 @@
<view>
New Page
</view>

View File

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"styleIsolation": "apply-shared"
}

View File

@ -0,0 +1,183 @@
.banner {
height: 455rpx;
width: 100%;
background-image: url('/image/component_bg.jpg');
background-size: contain;
background-repeat: no-repeat;
position: relative;
z-index: 2;
}
.logo {
width: 105rpx;
height: 117rpx;
position: absolute;
top: 122rpx;
left: 50%;
transform: translate(-50%);
}
.logo image {
width: 100%;
height: 100%;
}
.title {
font-size: 46rpx;
color: #fff;
position: absolute;
top: 260rpx;
left: 50%;
font-weight: bold;
transform: translate(-50%);
}
.sub-title {
color: rgba(255, 255, 255, 0.48);
font-size: 24rpx;
position: absolute;
top: 330rpx;
left: 50%;
transform: translate(-50%);
width: 80%;
}
.fake-searchbar {
position: absolute;
bottom: 0;
left: 50%;
transform: translate(-50%, 50%);
height: 92rpx;
width: 91.4%;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
border-radius: 4rpx;
box-shadow: rgba(153, 153, 153, 0.24) 0 2px 7px;
}
.fake-placeholder {
margin-left: 12rpx;
color: rgba(153, 153, 153, 0.89);
font-size: 28rpx;
}
.hot {
padding-top: 60px;
padding-bottom: 30rpx;
padding-left: 4.26%;
padding-right: 4.26%;
box-sizing: border-box;
}
.tabs {
height: 92rpx;
position: sticky;
background-color: #fff;
z-index: 1;
}
.tabs.shadow {
box-shadow: rgba(153, 153, 153, 0.24) 0 2px 7px;
}
.tabs-bar {
padding: 0 64rpx;
display: flex;
height: 100%;
}
.tabs-bar-tab {
bottom: 0;
flex: 1;
display: flex;
justify-content: center;
}
.tabs-bar-tab {
font-size: 32rpx;
}
.tabs-bar-tab-title {
color: #999;
padding: 16rpx 0;
display: flex;
align-items: center;
border-bottom: 3px solid transparent;
box-sizing: border-box;
}
.tabs-bar-tab-title.active {
font-weight: bold;
color: #1371F7;
border-bottom: 3px solid #1371F7;
}
.component-name {
color: rgb(51, 51, 51);
margin-right: 10rpx;
}
.component-brief {
color: #CCC;
font-size: 34rpx;
}
.list {
padding: 32rpx;
flex-shrink: 0;
box-sizing: border-box;
width: 100%;
}
.list-header {
width: 100%;
box-sizing: border-box;
padding-top: 40rpx;
padding-bottom: 20rpx;
display: flex;
align-items: center;
background-color: #fff;
color: #333;
font-weight: bold;
font-size: 34rpx;
padding-left: 32rpx;
}
.thumb {
height: 60rpx;
width: 60rpx;
margin-right: 30rpx;
}
.am-list-header {
box-sizing: border-box;
padding: 0;
}
.am-list-body::before {
display: none;
}
.list-item {
margin-bottom: 35rpx;
}
.list-wrap {
overflow: hidden;
}
.list-container {
display: flex;
width: 100%;
transition-duration: 500ms;
}
.logo_devCenter {
position: fixed;
right: 32rpx;
bottom: 44rpx;
width: 109rpx;
height: 121rpx;
}

View File

@ -0,0 +1,2 @@
<view>
</view>

View File

@ -0,0 +1,36 @@
Page({
data:{
data:null
},
async onLoad(){
//初始化 context ,这里代码可以抽象为公共代码
const context = await my.cloud.createCloudContext({
env: 'env-00jx467y0ti7' //修改为自己的环境 ID
});
await context.init();
var self = this;
my.showLoading({
content: '加载中...',
delay: '100',
});
console.log(my.fncontext);
context.callFunction({
name:'helloworld',
success:function(res){
my.hideLoading();
console.log(res);
self.setData({
data:res.result.message
});
},
fail:function(erro){
my.hideLoading();
console.log(erro);
self.setData({
data:null
});
}
});
},
})

View File

@ -0,0 +1,5 @@
{
"usingComponents": {
}
}

View File

@ -0,0 +1,50 @@
.imagesize{
width: 100%;
height: 300px;
}
.textbox{
width: 100%;
height: 100px;
background-color: #efaab1b7;
}
.title{
width: 100%;
height: 50%;
display: flex;
align-items: center;
}
.titlex{
width: 100%;
height: 50%;
display: flex;
flex-direction: column;
justify-content: center;
}
.imagebox{
width: 100%;
height: 300px;
}
.richtext{
width: 98%;
}
.textrich{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.baomingbox{
width: 100%;
height: 70px;
background-color: #efaab1b7;
position: fixed;
bottom: 10rpx;
}
.zuobox{
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}

View File

@ -0,0 +1,22 @@
<view class="imagebox">
<image class="imagesize" mode="aspectFill" src="../image/ameijia3.jpg" />
</view>
<view class="textbox">
<view class="title">
<text style="font-size:23px">专业美甲美业培训</text>
</view>
<view class="titlex">
<text style="margin-bottom:10rpx;color:red;font-size:19px">¥122</text>
<text>共12周</text>
</view>
</view>
<view class="textrich">
<view class="richtext">
<rich-text nodes="{{nodes}}" onTap="tap"></rich-text>
</view>
</view>
<view class="baomingbox" onTap="baoming">
<view class="zuobox">
<text style="font-size:25px">立即报名</text>
</view>
</view>

View File

@ -0,0 +1,11 @@
Page({
data: {
nodes:'富文本部分'
},
onLoad() {},
baoming(){
my.navigateTo({
url:"/pages/kehcnegbaoming/kehcnegbaoming"
})
}
});

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "课程详情",
"usingComponents": {},
"styleIsolation": "apply-shared"
}

View File

@ -0,0 +1,38 @@
.input{
width: 100%;
height: 30px;
padding: 10rpx;
}
.box{
width: 100%;
display: flex;
align-items: center;
flex-direction: column;
margin-top:30px;
}
.namebox{
width: 100%;
display: flex;
align-items: center;
margin: 10rpx;
}
.inputkuang{
width: 82%;
border: 1px solid #efaab1b7;
overflow: hidden;
}
.baomingbox{
width: 100%;
height: 70px;
background-color: #efaab1b7;
position: fixed;
bottom: 10rpx;
}
.zuobox{
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}

View File

@ -0,0 +1,19 @@
<view class="box">
<view class="namebox">
<text style="padding:20rpx;font-size:20px">姓名</text>
<view class="inputkuang">
<input class="input" onInput="bindKeyInput" placeholder="请输入你的姓名" />
</view>
</view>
<view class="namebox">
<text style="padding:20rpx;font-size:20px">电话</text>
<view class="inputkuang">
<input class="input" onInput="bindKeyInput" placeholder="请输入电话号码" />
</view>
</view>
</view>
<view class="baomingbox" onTap="baoming">
<view class="zuobox">
<text style="font-size:25px">立即支付</text>
</view>
</view>

View File

@ -0,0 +1,12 @@
Page({
data: {
},
onLoad() {},
bindKeyInput(e) {
this.setData({
inputValue: e.detail.value,
});
console.log(e.detail.value);
},
});

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "立即报名",
"usingComponents": {},
"styleIsolation": "apply-shared"
}

View File

@ -0,0 +1,44 @@
.imagesize{
width: 100%;
}
.kechengbox{
width: 48%;
height: 200px;
box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.08);
background-color: #ffffff;
border-radius: 10rpx;
overflow: hidden;
}
.imagebox{
width: 100%;
height: 70%;
}
.images{
width: 100%;
height: 100%;
}
.shengxiabox{
width: 100%;
height: 30%;
}
.textboxs{
width: 100%;
height: 50%;
display: flex;
align-items: center;
}
.textboxx{
width: 100%;
height: 50%;
display: flex;
justify-content: space-between;
}
.box{
width: 100%;
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: center;
gap: 16rpx;
margin-bottom: 100rpx;
}

View File

@ -0,0 +1,19 @@
<view>
<image class="imagesize" mode="aspectFill" src="https://tse4-mm.cn.bing.net/th/id/OIP-C.bjR-KesW-5zWpul0jVBGBwAAAA?rs=1&pid=ImgDetMain&cb=idpwebp1&o=7&rm=3" />
</view>
<view class="box">
<view class="kechengbox" a:for="{{ shopping }}" onTap="tiaozhuan">
<view class="imagebox">
<image class="images" mode="aspectFill" src="https://tse4-mm.cn.bing.net/th/id/OIP-C.bjR-KesW-5zWpul0jVBGBwAAAA?rs=1&pid=ImgDetMain&cb=idpwebp1&o=7&rm=3" />
</view>
<view class="shengxiabox">
<view class="textboxs">
<text style="margin-left:10rpx">{{item.name}}</text>
</view>
<view class="textboxx">
<text style="padding:5px">{{item.time}}</text>
<text style="padding:5px">¥{{item.price}}</text>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,27 @@
Page({
data: {
messageshop: [
{ name: '红枣夹核桃 500g 坚果大礼包', image: '/image/logo.png', price: 65, oldPrice: 99 },
{ name: '新疆大枣 1000g 优选原产地', image: '/image/logo.png', price: 48, oldPrice: 78 },
{ name: '每日坚果混合果仁干果套餐', image: '/image/logo.png', price: 88, oldPrice: 129 },
{ name: '每日坚果混合果仁干果套餐', image: '/image/logo.png', price: 88, oldPrice: 129 },
{ name: '每日坚果混合果仁干果套餐', image: '/image/logo.png', price: 88, oldPrice: 129 },
],
shopping:[
{ name:'2025认证美甲师培训',time:'共12周',price:'122'},
{ name:'2025认证美甲师培训',time:'共12周',price:'122'},
{ name:'2025认证美甲师培训',time:'共12周',price:'122'},
{ name:'2025认证美甲师培训',time:'共12周',price:'122'},
{ name:'2025认证美甲师培训',time:'共12周',price:'122'},
{ name:'2025认证美甲师培训',time:'共12周',price:'122'},
{ name:'2025认证美甲师培训',time:'共12周',price:'122'},
{ name:'2025认证美甲师培训',time:'共12周',price:'122'},
]
},
onLoad() {},
tiaozhuan(){
my.navigateTo({
url:'/pages/kechengxiangqing/kechengxiangqing'
})
}
});

View File

@ -0,0 +1,9 @@
{
"defaultTitle": "美甲师培训",
"usingComponents": {
"ant-date-picker": "antd-mini/es/DatePicker/index",
"ant-cascader-picker": "antd-mini/es/Picker/CascaderPicker/index",
"ant-list-item": "antd-mini/es/List/ListItem/index"
},
"styleIsolation": "apply-shared"
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,93 @@
.container {
padding: 20px;
}
.section-title {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
.input-row {
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #ddd;
}
.label {
flex: 0 0 120px;
color: #333;
}
.input {
flex: 1;
border: none;
outline: none;
}
.avatar-upload {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #ddd;
width: 50px;
height: 50px;
border-radius: 50%;
}
.icon {
width: 20px;
height: 20px;
color: #ccc;
}
.picker-placeholder {
color: #999;
display: flex;
}
.upload-button {
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
border: 1px solid #ddd;
border-radius: 10px;
margin-right: 10px;
}
.submit-button {
width: 100%;
background-color: #007aff;
color: white;
text-align: center;
padding: 15px;
border: none;
border-radius: 5px;
font-size: 16px;
margin-top: 20px;
}
.button {
width: 80%;
height: 40px;
background-color: #f3bfc1;
color: #000000;
border-radius: 20px;
font-size: 16px;
display: flex;
justify-content: center;
align-items: center;
}
.box{
position: relative;
right: 13px;
}
.tijiao{
width: 100%;
height: 100px;
display: flex;
justify-content: center;
align-items: center;
}

View File

@ -0,0 +1,74 @@
<view class="container">
<view class="section">
<view class="section-title">认证信息</view>
<view class="input-row">
<text class="label">姓名</text>
<input class="input" placeholder="请输入姓名" onInput="businessName"/>
</view>
<view class="input-row">
<text class="label">性别</text>
<input class="input" placeholder="请输入性别" onInput="xingbie"/>
</view>
<view class="input-row">
<text class="label">电子邮箱</text>
<input class="input" placeholder="请输入电子邮箱" onInput="person" />
<icon type="eye" />
</view>
</view>
<view class="section">
<view class="input-row">
<text class="label">联系方式</text>
<input class="input" placeholder="请输入联系人电话" onInput="phone"/>
</view>
<view class="input-row">
<text class="label">身份证号</text>
<input class="input" placeholder="请输入身份证号" onInput="idcard"/>
</view>
<view class="input-row">
<text class="label">擅长项目</text>
<input class="input" placeholder="请输入擅长项目" onInput="shanchang"/>
</view>
<view class="box">
<ant-list-item>
请选择省市
<ant-cascader-picker
slot="extra"
placeholder="请选择归属地"
options="{{cityList}}"
onChange="handleCascaderPickerChange"
onOk="handleCascaderOnOk"
onCancel="handleDismiss"
></ant-cascader-picker>
</ant-list-item>
</view>
</view>
<view class="section">
<view class="input-row">
<text class="label">请上传美甲师证明</text>
<ant-uploader
onChange="onChange"
onUpload="{{onUpload ? onUpload : 'onUpload'}}"
uploadingText="上传中……"
uploadfailedText="上传失败"
></ant-uploader>
</view>
</view>
<view class="section">
<view class="input-row">
<text class="label">请上传美甲师头像</text>
<ant-uploader
onChange="onChange"
onUpload="{{onUploada ? onUploada : 'onUploada'}}"
uploadingText="上传中……"
uploadfailedText="上传失败"
></ant-uploader>
</view>
</view>
</view>
<view class="tijiao">
<view class="button" onTap="ruzhu">提交申请</view>
</view>

View File

@ -0,0 +1,275 @@
import {url} from '../request'
import cityList from './city';
Page({
data: {
cityList,
cascaderValue: ['34', '330'],
cascaderVisible: false,
businessName:'',
person:'',
phone:'',
idcard:'',
selectedOption:'',
error:''
},
onLoad() {},
ruzhu(){
if (!this.validateForm()) {
return; // 验证未通过,阻止提交
}
my.getStorage({
key: 'userInfo',
success: (res) => {
const userInfo = res.data;
this.setData({
id: userInfo.id, // 获取 id
});
console.log(this.data.id,);
if (userInfo && userInfo.cookie) {
my.request({
url: url + '/api/manicurist/add',
method: 'POST',
data: {
certificate_path: this.data.zhengshu,
certification_number: this.data.idcard,
email: this.data.person,
gender: this.data.xingbie,
issuing_authority: this.data.selectedOption,
manicuristName: this.data.businessName,
nameUser: this.data.businessName,
phone: this.data.phone,
specialties: this.data.shanchang,
userId: this.data.id,
manicuristAvatar: this.data.avatar,
},
headers: {
'content-type': 'application/json',
'Cookie': userInfo.cookie,
},
dataType: 'json',
success: (res) => {
this.setData({
error:res.data.description
})
console.log(res);
if(res.data.code===0){
my.navigateBack();
my.alert({content:'审核中请耐心等待'})
}else{
my.alert({content:this.data.error})
}
},
fail: (error) => {
console.error('请求失败: ', JSON.stringify(error));
my.alert({ content: '请求失败,请稍后重试' });
},
});
} else {
my.alert({
content: '您未登录,请先登录。',
success: () => {
my.navigateTo({
url: '/pages/denglu/denglu',
});
},
});
}
},
});
},
businessName(e) {
this.setData({
businessName: e.detail.value,
});
console.log(e.detail.value);
},
shanchang(e) {
this.setData({
shanchang: e.detail.value,
});
console.log(e.detail.value);
},
xingbie(e) {
if(e.detail.value=='男'){
this.setData({
xingbie: 0,
});
}
if(e.detail.value=='女'){
this.setData({
xingbie: 1,
});
}
console.log(e.detail.value);
console.log(this.data.xingbie);
},
person(e) {
this.setData({
person: e.detail.value,
});
console.log(e.detail.value);
},
phone(e) {
this.setData({
phone: e.detail.value,
});
console.log(e.detail.value);
},
idcard(e) {
this.setData({
idcard: 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);
},
handleDismiss(e) {
my.showToast({
content: '取消操作',
});
console.log(e);
},
validateForm() {
// 验证姓名(非空)
if (!this.data.businessName) {
my.showToast({
content: '姓名不能为空',
type: 'none',
duration: 2000,
});
return false;
}
// 验证邮箱(简单的正则校验)
const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
if (!this.data.person || !emailRegex.test(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.zhengshu) {
my.showToast({
content: '证书出错了',
type: 'none',
duration: 2000,
});
return false;
}
if (!this.data.shanchang) {
my.showToast({
content: '擅长项目有误',
type: 'none',
duration: 2000,
});
return false;
}
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.zhengshu,'hhhhhhhhhhhhhhh');
},
fail: (err) => {
console.log('上传失败:', err);
reject();
},
});
});
},
onUploada(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 touxiang = JSON.parse(res.data)
this.setData({
avatar:`${"https://"}${touxiang.data}`,
})
console.log(this.data.avatar,'avatar');
},
fail: (err) => {
console.log('上传失败:', err);
reject();
},
});
});
},
});

Some files were not shown because too many files have changed in this diff Show More