修复了已知问题
|
@ -121,8 +121,8 @@
|
||||||
"launchMode": "common"
|
"launchMode": "common"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "pages/shanmenspjm/shanmenspjm",
|
"title": "咨询",
|
||||||
"page": "pages/shanmenspjm/shanmenspjm",
|
"page": "pages/zixunmeijiashi/zixunmeijiashi",
|
||||||
"launchMode": "common"
|
"launchMode": "common"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -27,7 +27,10 @@
|
||||||
"pages/yuyuezhifu/yuyuezhifu",
|
"pages/yuyuezhifu/yuyuezhifu",
|
||||||
"pages/shnagmendianpu/shnagmendianpu",
|
"pages/shnagmendianpu/shnagmendianpu",
|
||||||
"pages/yuyuezhifusm/yuyuezhifusm",
|
"pages/yuyuezhifusm/yuyuezhifusm",
|
||||||
"pages/yuyuejiemian/yuyuejiemian"
|
"pages/yuyuejiemian/yuyuejiemian",
|
||||||
|
"pages/message/message",
|
||||||
|
"pages/pay/pay",
|
||||||
|
"pages/dingdanxiangqing/dingdanxiangqing"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"defaultTitle": "甲情甲意",
|
"defaultTitle": "甲情甲意",
|
||||||
|
@ -47,20 +50,20 @@
|
||||||
{
|
{
|
||||||
"pagePath": "pages/shouye/shouye",
|
"pagePath": "pages/shouye/shouye",
|
||||||
"name": "首页",
|
"name": "首页",
|
||||||
"icon": "pages/image/shouye.png",
|
"icon": "pages/image/shouyedianjiqian.png",
|
||||||
"activeIcon": "pages/image/shouye.png"
|
"activeIcon": "pages/image/shouyedianjihou.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pagePath": "pages/gouwuche/gouwuche",
|
"pagePath": "pages/gouwuche/gouwuche",
|
||||||
"name": "购物车",
|
"name": "购物车",
|
||||||
"icon": "pages/image/gouwuche.png",
|
"icon": "pages/image/gouwuchedianjiqian.png",
|
||||||
"activeIcon": "pages/image/gouwuche.png"
|
"activeIcon": "pages/image/gouwuchedianjihou.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pagePath": "pages/wode/wode",
|
"pagePath": "pages/wode/wode",
|
||||||
"name": "我的",
|
"name": "我的",
|
||||||
"icon": "pages/image/my.png",
|
"icon": "pages/image/wodedianjiqian.png",
|
||||||
"activeIcon": "pages/image/my.png"
|
"activeIcon": "pages/image/wodedianjihou.png"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -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" a:if="{{ item.state==1 }}">
|
<view class="kuang" a:for="{{ sousuo }}" data-num="{{item}}" onTap="dianpu" a:if="{{ item.storeStatus==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>
|
||||||
|
|
|
@ -31,7 +31,7 @@ Page({
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.localcation();
|
this.localcation();
|
||||||
my.request({
|
my.request({
|
||||||
url: url + '/api/business/list',
|
url: url + '/api/business/listLv',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
|
|
||||||
|
@ -68,10 +68,16 @@ Page({
|
||||||
const startBusiness = id.startBusiness
|
const startBusiness = id.startBusiness
|
||||||
const storeStatus = id.storeStatus
|
const storeStatus = id.storeStatus
|
||||||
const businessPhone =id.businessPhone
|
const businessPhone =id.businessPhone
|
||||||
console.log('Address being passed: ', ID,address,businessName,businessAvatar,endBusiness,startBusiness,businessPhone);
|
const level = id.level
|
||||||
|
console.log('Address being passed: ', level,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/dianpuzhuye/dianpuzhuye?userId=${userId}
|
||||||
|
&&address=${address}&&businessName=${businessName}
|
||||||
|
&&businessAvatar=${businessAvatar}
|
||||||
|
&&startBusiness=${startBusiness}
|
||||||
|
&&endBusiness=${endBusiness}&&storeStatus=${storeStatus}
|
||||||
|
&&id=${ID}&&businessPhone=${businessPhone}&&level=${level}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
find(){
|
find(){
|
||||||
|
|
|
@ -3,24 +3,27 @@ Page({
|
||||||
data: {
|
data: {
|
||||||
authCode: '',
|
authCode: '',
|
||||||
intervalId: null, // 定时器ID,用于后续清除
|
intervalId: null, // 定时器ID,用于后续清除
|
||||||
|
sid:0
|
||||||
},
|
},
|
||||||
|
|
||||||
Login() {
|
Login() {
|
||||||
my.getAuthCode({
|
my.getAuthCode({
|
||||||
scopes: 'auth_user',
|
scopes: 'auth_user',
|
||||||
success: res => {
|
success: res => {
|
||||||
const authCode = res.authCode;
|
const authcode = res.authCode;
|
||||||
console.log(typeof authCode);
|
console.log(typeof authcode);
|
||||||
console.log(authCode);
|
console.log(authcode);
|
||||||
|
|
||||||
// 请求后端接口进行用户登录
|
// 请求后端接口进行用户登录
|
||||||
my.request({
|
my.request({
|
||||||
url: url + '/api/Alipay/parseCode',
|
url: url + '/api/Alipay/parseCode',
|
||||||
data: {
|
data: {
|
||||||
authCode,
|
authcode,
|
||||||
|
severId:this.data.sid
|
||||||
},
|
},
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
const { username, avatarUrl, id } = res.data.data;
|
if(res.data.code==0){
|
||||||
|
const { username, avatarUrl, id } = res.data.data;
|
||||||
const setCookie = res.header['set-cookie'] || res.header['Set-Cookie'];
|
const setCookie = res.header['set-cookie'] || res.header['Set-Cookie'];
|
||||||
console.log('Set-Cookie:', setCookie + '这是这个码');
|
console.log('Set-Cookie:', setCookie + '这是这个码');
|
||||||
|
|
||||||
|
@ -51,6 +54,11 @@ Page({
|
||||||
title: '登录成功',
|
title: '登录成功',
|
||||||
});
|
});
|
||||||
my.navigateBack();
|
my.navigateBack();
|
||||||
|
}else{
|
||||||
|
this.setData({
|
||||||
|
sid:1,
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail: (res) => {
|
fail: (res) => {
|
||||||
console.log("登录失败:", res);
|
console.log("登录失败:", res);
|
||||||
|
|
|
@ -4,14 +4,17 @@
|
||||||
<view class="box8">
|
<view class="box8">
|
||||||
<text class="z2">{{businessName}}</text>
|
<text class="z2">{{businessName}}</text>
|
||||||
<view style="margin-top:10rpx">
|
<view style="margin-top:10rpx">
|
||||||
<image mode="scaleToFill" class="image1" src="../image/xingji.png" />
|
<ant-rate
|
||||||
<text class="z3">4.9</text>
|
defaultValue="{{level}}"
|
||||||
|
readonly
|
||||||
|
></ant-rate>
|
||||||
|
<text class="z3">{{level}}.0</text>
|
||||||
<text class="z4">500条</text>
|
<text class="z4">500条</text>
|
||||||
</view>
|
</view>
|
||||||
<view onTap="soucang">
|
<view onTap="soucang">
|
||||||
<image class="soucangimage" mode="scaleToFill" src="../image/shoucang.png" />
|
<image class="soucangimage" mode="scaleToFill" src="../image/shoucang.png" />
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view onTap="kefu">
|
||||||
<image class="zixunimage" mode="scaleToFill" src="../image/zixun.png" />
|
<image class="zixunimage" mode="scaleToFill" src="../image/zixun.png" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -43,6 +43,7 @@ Page({
|
||||||
showComments: false, // 控制评论部分是否显示
|
showComments: false, // 控制评论部分是否显示
|
||||||
showBusinessInfo: false, // 控制商家信息是否显示
|
showBusinessInfo: false, // 控制商家信息是否显示
|
||||||
pingjia:[],
|
pingjia:[],
|
||||||
|
level:''
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// Extract userId and address from options
|
// Extract userId and address from options
|
||||||
|
@ -55,6 +56,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
|
||||||
|
const level = options.level
|
||||||
console.log(id,'这是店铺id吗');
|
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({
|
||||||
|
@ -67,6 +69,7 @@ Page({
|
||||||
storeStatus:storeStatus,
|
storeStatus:storeStatus,
|
||||||
id:id,
|
id:id,
|
||||||
businessPhone:businessPhone,
|
businessPhone:businessPhone,
|
||||||
|
level:level
|
||||||
});
|
});
|
||||||
my.request({
|
my.request({
|
||||||
url: url + '/api/commodities/list/page/commodities',
|
url: url + '/api/commodities/list/page/commodities',
|
||||||
|
@ -270,6 +273,7 @@ jiaru(item) {
|
||||||
console.log('传递的数据:', id);
|
console.log('传递的数据:', id);
|
||||||
const ids = id.id
|
const ids = id.id
|
||||||
const businessId = id.businessId
|
const businessId = id.businessId
|
||||||
|
const selectedOptions = '到店服务'
|
||||||
my.getStorage({
|
my.getStorage({
|
||||||
key: 'userInfo',
|
key: 'userInfo',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
|
@ -283,7 +287,7 @@ jiaru(item) {
|
||||||
businessId: businessId,
|
businessId: businessId,
|
||||||
commoditiesId: ids,
|
commoditiesId: ids,
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
selectedOptions: "",
|
selectedOptions: selectedOptions,
|
||||||
userId: userInfo.id
|
userId: userInfo.id
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -341,4 +345,9 @@ shangpinjiemian(item){
|
||||||
})
|
})
|
||||||
console.log(ids,businessId,commoditiesImage,commoditiesName,commoditiesPrice+'这是商品的',dianpuid+'这是店铺的')
|
console.log(ids,businessId,commoditiesImage,commoditiesName,commoditiesPrice+'这是商品的',dianpuid+'这是店铺的')
|
||||||
},
|
},
|
||||||
|
kefu(){
|
||||||
|
my.navigateTo({
|
||||||
|
url:'/pages/zixunmeijiashi/zixunmeijiashi'
|
||||||
|
})
|
||||||
|
}
|
||||||
});
|
});
|
|
@ -1,6 +1,8 @@
|
||||||
{
|
{
|
||||||
"defaultTitle": "店铺主页",
|
"defaultTitle": "店铺主页",
|
||||||
"usingComponents": {},
|
"usingComponents": {
|
||||||
|
"ant-rate": "antd-mini/es/Rate/index"
|
||||||
|
},
|
||||||
"styleIsolation": "apply-shared"
|
"styleIsolation": "apply-shared"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
<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 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>
|
25
甲情_甲意/miniprogram/pages/dingdanxiangqing/dingdanxiangqing.js
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
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
|
||||||
|
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
|
||||||
|
})
|
||||||
|
},
|
||||||
|
});
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"defaultTitle": "订单详情",
|
||||||
|
"usingComponents": {},
|
||||||
|
"styleIsolation": "apply-shared"
|
||||||
|
}
|
BIN
甲情_甲意/miniprogram/pages/image/gouwuchedianjihou.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
甲情_甲意/miniprogram/pages/image/gouwuchedianjiqian.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
甲情_甲意/miniprogram/pages/image/message.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
甲情_甲意/miniprogram/pages/image/shouyedianjihou.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
甲情_甲意/miniprogram/pages/image/shouyedianjiqian.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
甲情_甲意/miniprogram/pages/image/wodedianjihou.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
甲情_甲意/miniprogram/pages/image/wodedianjiqian.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
|
@ -234,7 +234,7 @@ onUpload(file) {
|
||||||
this.setData({
|
this.setData({
|
||||||
zhengshu:cunchu.data,
|
zhengshu:cunchu.data,
|
||||||
})
|
})
|
||||||
console.log(this.data.yingyeimage,'hhhhhhhhhhhhhhh');
|
console.log(this.data.zhengshu,'hhhhhhhhhhhhhhh');
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log('上传失败:', err);
|
console.log('上传失败:', err);
|
||||||
|
@ -243,4 +243,5 @@ onUpload(file) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
27
甲情_甲意/miniprogram/pages/message/message.acss
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
.image{
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
border-radius: 40px;
|
||||||
|
}
|
||||||
|
.textbox{
|
||||||
|
width: 100%;
|
||||||
|
border-bottom: 1px solid #8f8585;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.imagebox{
|
||||||
|
width: 80%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.name{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
.time{
|
||||||
|
width: 20%;
|
||||||
|
height: 50px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
14
甲情_甲意/miniprogram/pages/message/message.axml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<view>
|
||||||
|
<view class="textbox" a:for="{{ message }}">
|
||||||
|
<view class="imagebox">
|
||||||
|
<image class="image" mode="scaleToFill" src="https://tse4-mm.cn.bing.net/th/id/OIP-C.Uoz1-5uTFTJ7s8fymTUhYgAAAA?w=181&h=191&c=7&r=0&o=5&dpr=1.3&pid=1.7" />
|
||||||
|
<view class="name">
|
||||||
|
<text>{{item.name}}</text>
|
||||||
|
<text>{{item.text}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="time">
|
||||||
|
<text>{{item.time}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
27
甲情_甲意/miniprogram/pages/message/message.js
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
message:[
|
||||||
|
{
|
||||||
|
name:'美美美甲店',
|
||||||
|
text:'kjashljashdlkashdlksahl'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:'美美美甲店',
|
||||||
|
text:'kjashljashdlkashdlksahl'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:'美美美甲店',
|
||||||
|
text:'kjashljashdlkashdlksahl'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:'美美美甲店',
|
||||||
|
text:'kjashljashdlkashdlksahl'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:'美美美甲店',
|
||||||
|
text:'kjashljashdlkashdlksahl'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
onLoad() {},
|
||||||
|
});
|
4
甲情_甲意/miniprogram/pages/message/message.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"styleIsolation": "apply-shared"
|
||||||
|
}
|
61
甲情_甲意/miniprogram/pages/pay/pay.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: 180px;
|
||||||
|
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;
|
||||||
|
}
|
37
甲情_甲意/miniprogram/pages/pay/pay.axml
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<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">共{{quantity}}件</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>
|
||||||
|
<text style="margin-right:30rpx;color:#a3abb2">暂不可用</text>
|
||||||
|
</view>
|
||||||
|
<text></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="zhifu" onTap="paymoney">
|
||||||
|
<text style="color:white">支付 ¥{{commoditiesPrice}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
68
甲情_甲意/miniprogram/pages/pay/pay.js
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
import {url} from '../request'
|
||||||
|
Page({
|
||||||
|
data:{
|
||||||
|
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
const commoditiesImage = options.commoditiesImage
|
||||||
|
const commoditiesName = options.commoditiesName
|
||||||
|
const commoditiesPrice = options.commoditiesPrice
|
||||||
|
const quantity = options.quantity
|
||||||
|
const orderNumber = options.ordernumber
|
||||||
|
console.log(orderNumber,quantity,commoditiesPrice,commoditiesName,commoditiesImage);
|
||||||
|
this.setData({
|
||||||
|
orderNumber:orderNumber,
|
||||||
|
commoditiesImage:commoditiesImage,
|
||||||
|
quantity:quantity,
|
||||||
|
commoditiesPrice:commoditiesPrice,
|
||||||
|
commoditiesName:commoditiesName,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
paymoney(){
|
||||||
|
console.log(this.data.orderNumber);
|
||||||
|
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/Alipay/create/alipay',
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
orderNumber: this.data.orderNumber
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
console.log(res);
|
||||||
|
my.alert({content:'支付成功'})
|
||||||
|
my.navigateBack();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
my.alert({ content: '支付失败' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
my.alert({
|
||||||
|
content: '您未登录,请先登录。',
|
||||||
|
success: () => {
|
||||||
|
my.navigateTo({
|
||||||
|
url: '/pages/denglu/denglu',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
4
甲情_甲意/miniprogram/pages/pay/pay.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"styleIsolation": "apply-shared"
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
/* 评价盒子 */
|
/* 评价盒子 */
|
||||||
.box {
|
.box {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
height: 150px;
|
|
||||||
border: 1px solid #de868f;
|
border: 1px solid #de868f;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
|
@ -49,3 +48,13 @@ justify-content: space-between
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center
|
align-items: center
|
||||||
}
|
}
|
||||||
|
.label {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.input-row {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 10px 0;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
|
@ -32,7 +32,8 @@
|
||||||
<view style="margin-left:40rpx;margin-bottom:20rpx;width:300px">
|
<view style="margin-left:40rpx;margin-bottom:20rpx;width:300px">
|
||||||
<text style="margin-right:10rpx">总体</text>
|
<text style="margin-right:10rpx">总体</text>
|
||||||
<ant-rate
|
<ant-rate
|
||||||
defaultValue="{{3.5}}"
|
onChange="handleChangem"
|
||||||
|
defaultValue="{{0}}"
|
||||||
>
|
>
|
||||||
<ant-icon
|
<ant-icon
|
||||||
slot="character"
|
slot="character"
|
||||||
|
@ -42,6 +43,9 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- 店铺商品 -->
|
<!-- 店铺商品 -->
|
||||||
</view>
|
</view>
|
||||||
|
<view style="margin-bottom:10rpx">
|
||||||
|
<textarea onBlur="bindTextAreaBlur" auto-height placeholder="告诉美甲师,激励我们做的更好" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<!-- 标题栏 -->
|
<!-- 标题栏 -->
|
||||||
|
@ -62,7 +66,8 @@
|
||||||
<view style="margin-left:40rpx;margin-bottom:20rpx;width:300px">
|
<view style="margin-left:40rpx;margin-bottom:20rpx;width:300px">
|
||||||
<text style="margin-right:10rpx">总体</text>
|
<text style="margin-right:10rpx">总体</text>
|
||||||
<ant-rate
|
<ant-rate
|
||||||
defaultValue="{{3.5}}"
|
defaultValue="{{0}}"
|
||||||
|
onChange="handleChange"
|
||||||
>
|
>
|
||||||
<ant-icon
|
<ant-icon
|
||||||
slot="character"
|
slot="character"
|
||||||
|
@ -71,7 +76,21 @@
|
||||||
</ant-rate>
|
</ant-rate>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="margin-bottom:10rpx">
|
||||||
|
<textarea onInput="bindTextAreaBlur" auto-height placeholder="说说商品怎么样,给大家参考" />
|
||||||
|
</view>
|
||||||
|
<view class="section">
|
||||||
|
<view class="input-row">
|
||||||
|
<ant-uploader
|
||||||
|
onChange="onChange"
|
||||||
|
onUpload="{{onUpload ? onUpload : 'onUpload'}}"
|
||||||
|
uploadingText="上传中……"
|
||||||
|
uploadfailedText="上传失败"
|
||||||
|
></ant-uploader>
|
||||||
|
<text class="label">上传图片</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="button" onTap="ruzhu">提交</view>
|
<view class="button" onTap="tijiao">提交</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
|
@ -1,7 +1,107 @@
|
||||||
|
import {url} from '../request'
|
||||||
Page({
|
Page({
|
||||||
data: {},
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
onLoad() {},
|
onLoad() {},
|
||||||
onChange(value, e) {
|
onChange(value, e) {
|
||||||
console.log(value, e);
|
console.log(value, e);
|
||||||
},
|
},
|
||||||
|
bindTextAreaBlur(e) {
|
||||||
|
this.setData({
|
||||||
|
inputtext:e.detail.value
|
||||||
|
})
|
||||||
|
console.log(this.data.inputtext);
|
||||||
|
},
|
||||||
|
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();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 星级改变
|
||||||
|
handleChange(value) {
|
||||||
|
console.log(value);
|
||||||
|
this.setData({
|
||||||
|
value:value,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleChangem(value) {
|
||||||
|
console.log(value);
|
||||||
|
this.setData({
|
||||||
|
valuemeijiashi:value,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
tijiao(){
|
||||||
|
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/level/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
businessId: 0,
|
||||||
|
manicuristId: 0,
|
||||||
|
manicuristRating: this.data.valuemeijiashi,
|
||||||
|
orderId: 0,
|
||||||
|
rating: this.data.value,
|
||||||
|
review: this.data.inputtext,
|
||||||
|
userId: this.data.id
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
console.log(res);
|
||||||
|
my.alert({content:'评价成功'})
|
||||||
|
my.navigateBack();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
my.alert({ content: '评价失败' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
my.alert({
|
||||||
|
content: '您未登录,请先登录。',
|
||||||
|
success: () => {
|
||||||
|
my.navigateTo({
|
||||||
|
url: '/pages/denglu/denglu',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"ant-checkbox": "antd-mini/es/Checkbox/index",
|
"ant-checkbox": "antd-mini/es/Checkbox/index",
|
||||||
"ant-rate": "antd-mini/es/Rate/index",
|
"ant-rate": "antd-mini/es/Rate/index",
|
||||||
"ant-icon": "antd-mini/es/Icon/index",
|
"ant-icon": "antd-mini/es/Icon/index",
|
||||||
|
"ant-uploader": "antd-mini/es/ImageUpload/index",
|
||||||
"ant-notice": "antd-mini/es/NoticeBar/index"
|
"ant-notice": "antd-mini/es/NoticeBar/index"
|
||||||
},
|
},
|
||||||
"styleIsolation": "apply-shared"
|
"styleIsolation": "apply-shared"
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<!-- 店铺界面 -->
|
<!-- 店铺界面 -->
|
||||||
<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}}" a:if="{{ item.state==1 }}" onTap="dianpu">
|
<view class="kuang" a:for="{{ xuanran }}" data-num="{{item}}" a:if="{{ item.storeStatus==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>
|
||||||
|
|
|
@ -29,7 +29,7 @@ Page({
|
||||||
},
|
},
|
||||||
chaxun(){
|
chaxun(){
|
||||||
my.request({
|
my.request({
|
||||||
url: url + '/api/business/list',
|
url: url + '/api/business/listLv',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ Page({
|
||||||
this.setData({
|
this.setData({
|
||||||
xuanran: res.data.data, // 更新 tuijian 列表
|
xuanran: res.data.data, // 更新 tuijian 列表
|
||||||
});
|
});
|
||||||
|
console.log(this.data.xuanran,'askjdsakldlasjdl');
|
||||||
} else {
|
} else {
|
||||||
console.log('shibaile')
|
console.log('shibaile')
|
||||||
}
|
}
|
||||||
|
@ -103,10 +104,15 @@ Page({
|
||||||
const startBusiness = id.startBusiness
|
const startBusiness = id.startBusiness
|
||||||
const storeStatus = id.storeStatus
|
const storeStatus = id.storeStatus
|
||||||
const businessPhone =id.businessPhone
|
const businessPhone =id.businessPhone
|
||||||
console.log('Address being passed: ', ID,address,businessName,businessAvatar,endBusiness,startBusiness,businessPhone);
|
const level =id.level
|
||||||
|
console.log('Address being passed: ',level, ID,address,businessName,businessAvatar,endBusiness,startBusiness,businessPhone);
|
||||||
|
|
||||||
my.navigateTo({
|
my.navigateTo({
|
||||||
url: `/pages/shnagmendianpu/shnagmendianpu?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}&&level=${level}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onChange(e) {
|
onChange(e) {
|
||||||
|
|
|
@ -4,14 +4,17 @@
|
||||||
<view class="box8">
|
<view class="box8">
|
||||||
<text class="z2">{{businessName}}</text>
|
<text class="z2">{{businessName}}</text>
|
||||||
<view style="margin-top:10rpx">
|
<view style="margin-top:10rpx">
|
||||||
<image mode="scaleToFill" class="image1" src="../image/xingji.png" />
|
<ant-rate
|
||||||
<text class="z3">4.9</text>
|
defaultValue="{{level}}"
|
||||||
|
readonly
|
||||||
|
></ant-rate>
|
||||||
|
<text class="z3">{{level}}.0</text>
|
||||||
<text class="z4">500条</text>
|
<text class="z4">500条</text>
|
||||||
</view>
|
</view>
|
||||||
<view onTap="soucang">
|
<view onTap="soucang">
|
||||||
<image class="soucangimage" mode="scaleToFill" src="../image/shoucang.png" />
|
<image class="soucangimage" mode="scaleToFill" src="../image/shoucang.png" />
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view onTap="zixun">
|
||||||
<image class="zixunimage" mode="scaleToFill" src="../image/zixun.png" />
|
<image class="zixunimage" mode="scaleToFill" src="../image/zixun.png" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -43,6 +43,8 @@ Page({
|
||||||
showComments: false, // 控制评论部分是否显示
|
showComments: false, // 控制评论部分是否显示
|
||||||
showBusinessInfo: false, // 控制商家信息是否显示
|
showBusinessInfo: false, // 控制商家信息是否显示
|
||||||
pingjia:[],
|
pingjia:[],
|
||||||
|
selectedOptions:'0',
|
||||||
|
level:''
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// Extract userId and address from options
|
// Extract userId and address from options
|
||||||
|
@ -55,6 +57,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
|
||||||
|
const level = options.level
|
||||||
console.log(id,'这是店铺id吗');
|
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({
|
||||||
|
@ -67,6 +70,7 @@ Page({
|
||||||
storeStatus:storeStatus,
|
storeStatus:storeStatus,
|
||||||
id:id,
|
id:id,
|
||||||
businessPhone:businessPhone,
|
businessPhone:businessPhone,
|
||||||
|
level:level
|
||||||
});
|
});
|
||||||
my.request({
|
my.request({
|
||||||
url: url + '/api/commodities/list/page/commodities',
|
url: url + '/api/commodities/list/page/commodities',
|
||||||
|
@ -282,7 +286,7 @@ jiaru(item) {
|
||||||
businessId: businessId,
|
businessId: businessId,
|
||||||
commoditiesId: ids,
|
commoditiesId: ids,
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
selectedOptions: "",
|
selectedOptions: selectedOptions,
|
||||||
userId: userInfo.id
|
userId: userInfo.id
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -340,4 +344,9 @@ shangpinjiemian(item){
|
||||||
})
|
})
|
||||||
console.log(ids,businessId,commoditiesImage,commoditiesName,commoditiesPrice+'这是商品的',dianpuid+'这是店铺的')
|
console.log(ids,businessId,commoditiesImage,commoditiesName,commoditiesPrice+'这是商品的',dianpuid+'这是店铺的')
|
||||||
},
|
},
|
||||||
|
kefu(){
|
||||||
|
my.navigateTo({
|
||||||
|
url:'/pages/zixunmeijiashi/zixunmeijiashi'
|
||||||
|
})
|
||||||
|
}
|
||||||
});
|
});
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
"defaultTitle": "店铺主页",
|
"defaultTitle": "店铺主页",
|
||||||
"usingComponents": {},
|
"usingComponents": {
|
||||||
|
"ant-rate": "antd-mini/es/Rate/index"
|
||||||
|
},
|
||||||
"styleIsolation": "apply-shared"
|
"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}}" a:if="{{ item.state==1 }}" data-num="{{item}}" onTap="dianpu">
|
<view class="kuang" a:for="{{ tuijian }}" a:key="{{index}}" a:if="{{ item.storeStatus==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>
|
||||||
|
|
|
@ -29,9 +29,9 @@ Page({
|
||||||
updateTime: "",
|
updateTime: "",
|
||||||
userId: 0
|
userId: 0
|
||||||
},
|
},
|
||||||
onLoad() {
|
onShow() {
|
||||||
my.request({
|
my.request({
|
||||||
url: url + '/api/business/list',
|
url: url + '/api/business/listLv',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
|
|
||||||
|
@ -68,10 +68,15 @@ Page({
|
||||||
const startBusiness = id.startBusiness
|
const startBusiness = id.startBusiness
|
||||||
const storeStatus = id.storeStatus
|
const storeStatus = id.storeStatus
|
||||||
const businessPhone =id.businessPhone
|
const businessPhone =id.businessPhone
|
||||||
console.log('Address being passed: ', ID,address,businessName,businessAvatar,endBusiness,startBusiness,businessPhone);
|
const level = id.level
|
||||||
|
console.log('Address being passed: ',level, 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/dianpuzhuye/dianpuzhuye?userId=${userId}
|
||||||
|
&&address=${address}&&businessName=${businessName}
|
||||||
|
&&businessAvatar=${businessAvatar}&&startBusiness=${startBusiness}
|
||||||
|
&&endBusiness=${endBusiness}&&storeStatus=${storeStatus}
|
||||||
|
&&id=${ID}&&businessPhone=${businessPhone}&&level=${level}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
shangmen(){
|
shangmen(){
|
||||||
|
|
|
@ -39,13 +39,16 @@
|
||||||
}
|
}
|
||||||
.z1{
|
.z1{
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
position: relative;
|
margin-left: 20rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
.image1{
|
.image1{
|
||||||
max-width: 30px;
|
max-width: 30px;
|
||||||
max-height: 30px;
|
max-height: 30px;
|
||||||
position:relative;
|
margin-left: 35rpx;
|
||||||
|
}
|
||||||
|
.imagejian{
|
||||||
|
max-width: 30px;
|
||||||
|
max-height: 30px;
|
||||||
}
|
}
|
||||||
/* 退出登录 */
|
/* 退出登录 */
|
||||||
.box10 image{
|
.box10 image{
|
||||||
|
@ -71,4 +74,12 @@
|
||||||
.box3{
|
.box3{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.fenbu{
|
||||||
|
width: 90%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
|
@ -8,40 +8,60 @@
|
||||||
<!-- 信息盒子 -->
|
<!-- 信息盒子 -->
|
||||||
<!--我的订单 -->
|
<!--我的订单 -->
|
||||||
<view style="width:100%">
|
<view style="width:100%">
|
||||||
|
<view class="box3" onTap="message">
|
||||||
|
<view class="fenbu">
|
||||||
|
<image class="image1" mode="aspectFill" src="/pages/image/message.png"></image>
|
||||||
|
<text class="z1">我的消息</text>
|
||||||
|
</view>
|
||||||
|
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||||
|
</view>
|
||||||
|
<!-- 我的订单 -->
|
||||||
<view class="box3" onTap="dingdan">
|
<view class="box3" onTap="dingdan">
|
||||||
<image class="image1"style="left:40rpx;top:25rpx" mode="aspectFill" src="/pages/image/wodedingdan.png"></image>
|
<view class="fenbu">
|
||||||
<image class="image1" style="top:23rpx;left:600rpx;" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
<image class="image1" mode="aspectFill" src="/pages/image/wodedingdan.png"></image>
|
||||||
<text class="z1" style="top:18rpx">我的订单</text>
|
<text class="z1">我的订单</text>
|
||||||
|
</view>
|
||||||
|
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 我的评价-->
|
<!-- 我的评价-->
|
||||||
<view class="box3" onTap="pingjia">
|
<view class="box3" onTap="pingjia">
|
||||||
<image class="image1"style="left:40rpx;top:25rpx" mode="aspectFill" src="/pages/image/wodepingjia.png"></image>
|
<view class="fenbu">
|
||||||
<image class="image1" style="top:23rpx;left:600rpx;" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
<image class="image1" mode="aspectFill" src="/pages/image/wodepingjia.png"></image>
|
||||||
<text class="z1" style="top:18rpx">我的评价</text>
|
<text class="z1">我的评价</text>
|
||||||
|
</view>
|
||||||
|
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 我的收藏 -->
|
<!-- 我的收藏 -->
|
||||||
<view class="box3" onTap="shoucang">
|
<view class="box3" onTap="shoucang">
|
||||||
<image class="image1"style="left:40rpx;top:25rpx" mode="aspectFill" src="/pages/image/shoucang.png"></image>
|
<view class="fenbu">
|
||||||
<image class="image1" style="top:23rpx;left:600rpx;" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
<image class="image1" mode="aspectFill" src="/pages/image/shoucang.png"></image>
|
||||||
<text class="z1" style="top:18rpx">我的收藏</text>
|
<text class="z1">我的收藏</text>
|
||||||
</view>
|
</view>
|
||||||
|
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||||
|
</view>
|
||||||
<!-- 商家入驻 -->
|
<!-- 商家入驻 -->
|
||||||
<view class="box3" onTap="ruzhu">
|
<view class="box3" onTap="ruzhu">
|
||||||
<image class="image1"style="left:40rpx;top:25rpx" mode="aspectFill" src="/pages/image/shangjiaruzu.png"></image>
|
<view class="fenbu">
|
||||||
<image class="image1" style="top:23rpx;left:600rpx;" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
<image class="image1" mode="aspectFill" src="/pages/image/shangjiaruzu.png"></image>
|
||||||
<text class="z1" style="top:18rpx">商家入驻</text>
|
<text class="z1">商家入驻</text>
|
||||||
|
</view>
|
||||||
|
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 认证美甲师 -->
|
<!-- 认证美甲师 -->
|
||||||
<view class="box3" onTap="meijishi" >
|
<view class="box3" onTap="meijishi">
|
||||||
<image class="image1"style="left:40rpx;top:25rpx" mode="aspectFill" src="/pages/image/meijishirenzheng.png"></image>
|
<view class="fenbu">
|
||||||
<image class="image1" style="top:23rpx;left:600rpx;" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
<image class="image1" mode="aspectFill" src="/pages/image/meijishirenzheng.png"></image>
|
||||||
<text class="z1" style="top:18rpx">认证美甲师</text>
|
<text class="z1">认证美甲师</text>
|
||||||
|
</view>
|
||||||
|
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 退出登录 -->
|
<!-- 退出登录 -->
|
||||||
<view class="box3" onTap="out">
|
<view class="box3" onTap="out">
|
||||||
<image class="image1"style="left:40rpx;top:25rpx" mode="aspectFill" src="/pages/image/tuichudenglu.png"></image>
|
<view class="fenbu">
|
||||||
<image class="image1" style="top:23rpx;left:600rpx;" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
<image class="image1" mode="aspectFill" src="/pages/image/tuichudenglu.png"></image>
|
||||||
<text class="z1" style="top:18rpx">退出登录</text>
|
<text class="z1">退出登录</text>
|
||||||
|
</view>
|
||||||
|
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,13 @@ Page({
|
||||||
url: '/pages/shangjiaruzhu/shangjiaruzhu'
|
url: '/pages/shangjiaruzhu/shangjiaruzhu'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
message() {
|
||||||
|
my.navigateTo({
|
||||||
|
url: '/pages/message/message'
|
||||||
|
});
|
||||||
|
},
|
||||||
login() {
|
login() {
|
||||||
|
console.log(this.data.messagelogin);
|
||||||
if (!this.data.messagelogin) {
|
if (!this.data.messagelogin) {
|
||||||
my.navigateTo({
|
my.navigateTo({
|
||||||
url: '/pages/denglu/denglu'
|
url: '/pages/denglu/denglu'
|
||||||
|
@ -84,6 +90,7 @@ Page({
|
||||||
this.setData({
|
this.setData({
|
||||||
username: '请登录',
|
username: '请登录',
|
||||||
avatarUrl: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.jHUH4s7TQ48X_B-1iozuJgHaHa?w=207&h=207&c=7&r=0&o=5&dpr=1.5&pid=1.7',
|
avatarUrl: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.jHUH4s7TQ48X_B-1iozuJgHaHa?w=207&h=207&c=7&r=0&o=5&dpr=1.5&pid=1.7',
|
||||||
|
messagelogin:""
|
||||||
});
|
});
|
||||||
my.alert({
|
my.alert({
|
||||||
content:'您已退出登录'
|
content:'您已退出登录'
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
<view class="box" >
|
<view class="box" >
|
||||||
<!-- 最外层盒子 -->
|
<!-- 最外层盒子 -->
|
||||||
<view class="box1" a:for="{{dingdan}}">
|
<view class="box1" a:for="{{dingdan}}" onTap="xiangqing" data-num="{{item}}" >
|
||||||
<!-- 粉色框 -->
|
<!-- 粉色框 -->
|
||||||
<view class="biaoti">
|
<view class="biaoti">
|
||||||
<!-- 标题栏 -->
|
<!-- 标题栏 -->
|
||||||
|
@ -34,6 +34,8 @@
|
||||||
<text a:elif="{{item.paymentStatus == 1}}">待使用</text>
|
<text a:elif="{{item.paymentStatus == 1}}">待使用</text>
|
||||||
<text a:elif="{{item.paymentStatus == 2}}">已完成</text>
|
<text a:elif="{{item.paymentStatus == 2}}">已完成</text>
|
||||||
<text a:elif="{{item.paymentStatus == 3}}">已取消</text>
|
<text a:elif="{{item.paymentStatus == 3}}">已取消</text>
|
||||||
|
<text a:elif="{{item.paymentStatus == 4}}">预约</text>
|
||||||
|
<text a:elif="{{item.paymentStatus == 5}}">退款</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 图片 -->
|
<!-- 图片 -->
|
||||||
|
@ -53,7 +55,7 @@
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
<view class="box" >
|
<view class="box" >
|
||||||
<!-- 最外层盒子 -->
|
<!-- 最外层盒子 -->
|
||||||
<view class="box1" a:for="{{dingdan}}" a:if="{{item.paymentStatus == 0}}">
|
<view class="box1" onTap="xiangqing" a:for="{{dingdan}}" a:if="{{item.paymentStatus == 0}}">
|
||||||
<!-- 粉色框 -->
|
<!-- 粉色框 -->
|
||||||
<view class="biaoti">
|
<view class="biaoti">
|
||||||
<!-- 标题栏 -->
|
<!-- 标题栏 -->
|
||||||
|
@ -73,10 +75,10 @@
|
||||||
<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 onTap="quxiao" data-id="{{item.id}}">
|
<view onTap="quxiao" data-id="{{item.orderId}}">
|
||||||
<text class="textcss">取消</text>
|
<text class="textcss">取消</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view onTap="pay"data-num="{{item}}">
|
||||||
<text class="textcss">支付</text>
|
<text class="textcss">支付</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -84,6 +86,7 @@
|
||||||
<view style="width:240px">
|
<view style="width:240px">
|
||||||
<text class="text"style="left:190rpx;bottom:80rpx;font-size:15px">剩余:20:34</text>
|
<text class="text"style="left:190rpx;bottom:80rpx;font-size:15px">剩余:20:34</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
|
@ -91,7 +94,7 @@
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
<view class="box" >
|
<view class="box" >
|
||||||
<!-- 最外层盒子 -->
|
<!-- 最外层盒子 -->
|
||||||
<view class="box1" a:for="{{dingdan}}" a:if="{{ item.paymentStatus==1 }}">
|
<view class="box1" onTap="xiangqing" data-num="{{item}}" a:for="{{dingdan}}" a:if="{{ item.paymentStatus==1 }}">
|
||||||
<!-- 粉色框 -->
|
<!-- 粉色框 -->
|
||||||
<view class="biaoti">
|
<view class="biaoti">
|
||||||
<!-- 标题栏 -->
|
<!-- 标题栏 -->
|
||||||
|
@ -129,7 +132,7 @@
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
<view class="box" >
|
<view class="box" >
|
||||||
<!-- 最外层盒子 -->
|
<!-- 最外层盒子 -->
|
||||||
<view class="box1" a:for="{{dingdan}}" a:if="{{ item.paymentStatus==2 }}">
|
<view class="box1" onTap="xiangqing" data-num="{{item}}" a:for="{{dingdan}}" a:if="{{ item.paymentStatus==2 }}">
|
||||||
<!-- 粉色框 -->
|
<!-- 粉色框 -->
|
||||||
<view class="biaoti">
|
<view class="biaoti">
|
||||||
<!-- 标题栏 -->
|
<!-- 标题栏 -->
|
||||||
|
@ -159,7 +162,7 @@
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
<view class="box" >
|
<view class="box" >
|
||||||
<!-- 最外层盒子 -->
|
<!-- 最外层盒子 -->
|
||||||
<view class="box1" a:for="{{dingdan}}" a:if="{{ item.paymentStatus==3 }}">
|
<view class="box1" onTap="xiangqing" data-num="{{item}}" a:for="{{dingdan}}" a:if="{{ item.paymentStatus==3 }}">
|
||||||
<!-- 粉色框 -->
|
<!-- 粉色框 -->
|
||||||
<view class="biaoti">
|
<view class="biaoti">
|
||||||
<!-- 标题栏 -->
|
<!-- 标题栏 -->
|
||||||
|
@ -185,11 +188,41 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
|
<!-- 预约 -->
|
||||||
|
<swiper-item>
|
||||||
|
<view class="box" >
|
||||||
|
<!-- 最外层盒子 -->
|
||||||
|
<view class="box1" onTap="xiangqing" data-num="{{item}}" a:for="{{dingdan}}" a:if="{{ item.paymentStatus==0 }}">
|
||||||
|
<!-- 粉色框 -->
|
||||||
|
<view class="biaoti">
|
||||||
|
<!-- 标题栏 -->
|
||||||
|
<view class="biaoti1">
|
||||||
|
<image mode="scaleToFill" class="image" src="{{item.businessVO.businessAvatar}}" />
|
||||||
|
<text style="margin-left:10rpx;font-weight:bolder">{{item.businessVO.businessName}}</text>
|
||||||
|
<image class="image1" mode="scaleToFill" src="/pages/image/jiantou.png" />
|
||||||
|
</view>
|
||||||
|
<view style="margin-right:20rpx">
|
||||||
|
<text >预约中</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 图片 -->
|
||||||
|
<view a:for="{{ item.orderItemsVOList }}">
|
||||||
|
<image mode="scaleToFill" class="image2" src="{{item.commoditiesVO.commoditiesImage}}" />
|
||||||
|
<text class="text"style="left:10rpx;bottom:120rpx">{{item.commoditiesVO.commoditiesName}}</text>
|
||||||
|
<text class="text" style="bottom:70rpx;right:180rpx;color:#377ff3">到店服务</text>
|
||||||
|
<text class="text"style="bottom:100rpx;left:80rpx;font-size:18px">¥{{item.commoditiesVO.commoditiesPrice}}</text>
|
||||||
|
</view>
|
||||||
|
<view style="width:240px">
|
||||||
|
<text class="text"style="left:190rpx;bottom:50rpx;font-size:12px">地址:{{item.businessVO.address}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
<!-- 退款 -->
|
<!-- 退款 -->
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
<view class="box" >
|
<view class="box" >
|
||||||
<!-- 最外层盒子 -->
|
<!-- 最外层盒子 -->
|
||||||
<view class="box1" a:for="{{dingdan}}" a:if="{{ item.paymentStatus==3 }}">
|
<view class="box1" onTap="xiangqing" data-num="{{item}}" a:for="{{dingdan}}" a:if="{{ item.paymentStatus==3 }}">
|
||||||
<!-- 粉色框 -->
|
<!-- 粉色框 -->
|
||||||
<view class="biaoti">
|
<view class="biaoti">
|
||||||
<!-- 标题栏 -->
|
<!-- 标题栏 -->
|
||||||
|
|
|
@ -19,6 +19,9 @@ Page({
|
||||||
{
|
{
|
||||||
title: '已取消',
|
title: '已取消',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '预约',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '退款',
|
title: '退款',
|
||||||
},
|
},
|
||||||
|
@ -33,7 +36,7 @@ Page({
|
||||||
]
|
]
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow(){
|
onShow() {
|
||||||
my.getStorage({
|
my.getStorage({
|
||||||
key: 'userInfo',
|
key: 'userInfo',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
|
@ -51,7 +54,7 @@ Page({
|
||||||
current: 1,
|
current: 1,
|
||||||
endTime: "",
|
endTime: "",
|
||||||
id: "",
|
id: "",
|
||||||
pageSize: 10,
|
pageSize: 1000,
|
||||||
paymentStatus: "",
|
paymentStatus: "",
|
||||||
sortField: "",
|
sortField: "",
|
||||||
sortOrder: "",
|
sortOrder: "",
|
||||||
|
@ -65,19 +68,28 @@ Page({
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if(res.data.code===0){
|
if (res.data.code === 0) {
|
||||||
this.setData({
|
// 在成功返回数据后,修改数据结构
|
||||||
dingdan:res.data.data.records,
|
const updatedDingdan = res.data.data.records.map(item => {
|
||||||
|
// 遍历 orderItemsVOList,为每个商品添加 orderNumber
|
||||||
|
item.orderItemsVOList = item.orderItemsVOList.map(orderItem => {
|
||||||
|
orderItem.commoditiesVO.orderNumber = item.orderNumber; // 添加 orderNumber
|
||||||
|
return orderItem;
|
||||||
|
});
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
|
||||||
})
|
// 更新数据到页面
|
||||||
}
|
this.setData({
|
||||||
else if(res.data.code===40100){
|
dingdan: updatedDingdan,
|
||||||
|
});
|
||||||
|
} else if (res.data.code === 40100) {
|
||||||
my.alert({
|
my.alert({
|
||||||
content: '登录信息已过期,请重新登录'
|
content: '登录信息已过期,请重新登录',
|
||||||
});
|
});
|
||||||
my.navigateTo({
|
my.navigateTo({
|
||||||
url:'/pages/denglu/denglu'
|
url: '/pages/denglu/denglu',
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
console.log(res);
|
console.log(res);
|
||||||
console.log(this.data.dingdan);
|
console.log(this.data.dingdan);
|
||||||
|
@ -87,8 +99,7 @@ Page({
|
||||||
my.alert({ content: '请求失败,请稍后重试' });
|
my.alert({ content: '请求失败,请稍后重试' });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
my.alert({
|
my.alert({
|
||||||
content: '您未登录,请先登录。',
|
content: '您未登录,请先登录。',
|
||||||
success: () => {
|
success: () => {
|
||||||
|
@ -101,6 +112,7 @@ Page({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onSwipeChange(e) {
|
onSwipeChange(e) {
|
||||||
this.setData({
|
this.setData({
|
||||||
current: e.detail.current,
|
current: e.detail.current,
|
||||||
|
@ -144,7 +156,8 @@ quxiao(e){
|
||||||
url: url + '/api/orders/cancel',
|
url: url + '/api/orders/cancel',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
"id": 0
|
id:orderId,
|
||||||
|
userId: this.data.id
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
|
@ -156,7 +169,7 @@ quxiao(e){
|
||||||
my.showToast({
|
my.showToast({
|
||||||
content: '订单已取消',
|
content: '订单已取消',
|
||||||
});
|
});
|
||||||
this.fetchOrders()
|
this.onShow()
|
||||||
}
|
}
|
||||||
else if(res.data.code===40100){
|
else if(res.data.code===40100){
|
||||||
my.alert({
|
my.alert({
|
||||||
|
@ -187,49 +200,45 @@ quxiao(e){
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
console.log(orderId,this.data.id);
|
||||||
},
|
},
|
||||||
fetchOrders() {
|
pay(item){
|
||||||
my.getStorage({
|
const id = item.target.dataset.num
|
||||||
key: 'userInfo',
|
const ordernumber = id.commoditiesVO.orderNumber
|
||||||
success: (res) => {
|
const commoditiesName = id.commoditiesVO.commoditiesName
|
||||||
const userInfo = res.data;
|
const commoditiesPrice = id.commoditiesVO.commoditiesPrice
|
||||||
if (userInfo && userInfo.cookie) {
|
const quantity =id.quantity
|
||||||
my.request({
|
const commoditiesImage =id.commoditiesVO.commoditiesImage
|
||||||
url: url + '/api/orders/my/page',
|
console.log(id,ordernumber,commoditiesName,commoditiesPrice);
|
||||||
method: 'POST',
|
my.navigateTo({
|
||||||
data: {
|
url:`/pages/pay/pay?ordernumber=${ordernumber}
|
||||||
claimStatus: 0,
|
&&commoditiesName=${commoditiesName}
|
||||||
current: 1,
|
&&commoditiesPrice=${commoditiesPrice}
|
||||||
endTime: "",
|
&&quantity=${quantity}&&commoditiesImage=${commoditiesImage}`
|
||||||
id: "",
|
})
|
||||||
pageSize: 10,
|
},
|
||||||
paymentStatus: "",
|
xiangqing(item){
|
||||||
sortField: "",
|
const id = item.target.dataset.num
|
||||||
sortOrder: "",
|
console.log(id);
|
||||||
startTime: "",
|
const message = id.orderItemsVOList
|
||||||
userId: userInfo.id,
|
const ordernumber = id.orderNumber
|
||||||
userRole: 0,
|
const createTime = id.createTime
|
||||||
},
|
const phone = id.phone
|
||||||
headers: {
|
const userName = id.userName
|
||||||
'content-type': 'application/json',
|
const businessName =id.businessVO.businessName
|
||||||
'Cookie': userInfo.cookie,
|
const commoditiesName = message[0].commoditiesVO.commoditiesName;
|
||||||
},
|
const commoditiesImage = message[0].commoditiesVO.commoditiesImage;
|
||||||
dataType: 'json',
|
const commoditiesPrice = message[0].commoditiesVO.commoditiesPrice;
|
||||||
success: (res) => {
|
const businessId = id.businessVO.id
|
||||||
if (res.data.code === 0) {
|
const statues =id.paymentStatus
|
||||||
this.setData({
|
console.log(statues,businessId,commoditiesPrice,commoditiesImage,commoditiesName,message,ordernumber,createTime,phone,userName,businessName);
|
||||||
dingdan: res.data.data.records,
|
my.navigateTo({
|
||||||
});
|
url:`/pages/dingdanxiangqing/dingdanxiangqing?ordernumber=${ordernumber}
|
||||||
}
|
&&createTime=${createTime}&&phone=${phone}&&userName=${userName}
|
||||||
},
|
&&businessName=${businessName}&&commoditiesName=${commoditiesName}&&commoditiesImage=${commoditiesImage}
|
||||||
fail: (error) => {
|
&&commoditiesPrice=${commoditiesPrice}&&businessId=${businessId}
|
||||||
console.error('请求失败: ', JSON.stringify(error));
|
&&statues=${statues}`
|
||||||
my.alert({ content: '请求失败,请稍后重试' });
|
})
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ page{
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
}
|
}
|
||||||
.container{
|
.container{
|
||||||
|
|
||||||
color: #333333;
|
color: #333333;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
height: 150px;
|
height: 150px;
|
||||||
|
@ -113,3 +112,15 @@ page{
|
||||||
bottom: 70rpx;
|
bottom: 70rpx;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
}
|
}
|
||||||
|
.message{
|
||||||
|
width: 65%;
|
||||||
|
height: 80px;
|
||||||
|
position: relative;
|
||||||
|
top: 40rpx;
|
||||||
|
left: 50rpx;
|
||||||
|
}
|
||||||
|
.messagebox{
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 110px;
|
||||||
|
}
|
|
@ -18,16 +18,21 @@
|
||||||
a:key="{{ index }}">
|
a:key="{{ index }}">
|
||||||
<!-- 全部-->
|
<!-- 全部-->
|
||||||
<swiper-item class="swiper-item">
|
<swiper-item class="swiper-item">
|
||||||
<view class="containercontent" a:for="{{ dingdan }}"a:key="index">
|
<view class="containercontent" a:for="{{ message }}"a:key="index">
|
||||||
<view style="height:190px">
|
<view style="height:190px">
|
||||||
<view style="display:flex">
|
<view style="display:flex">
|
||||||
<image class="image" mode="scaleToFill" src="{{item.image}}" />
|
<image class="image" mode="scaleToFill" src="https://c-ssl.dtstatic.com/uploads/blog/202305/08/20230508112951_78480.thumb.400_0.jpeg" />
|
||||||
<text class="text"style="top:8px;left: 10px;">CC</text>
|
<text class="text"style="top:8px;left: 10px;">CC</text>
|
||||||
<text class="text"style="top: 25px;right:10px">2024-12-01评价</text>
|
<text class="text"style="top: 25px;right:10px">2024-12-01评价</text>
|
||||||
</view>
|
</view>
|
||||||
<view >
|
<view >
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<image class="left" mode="scaleToFill" src="/pages/image/meijia3.jpg" />
|
<view class="messagebox">
|
||||||
|
<image class="left" mode="scaleToFill" src="/pages/image/meijia3.jpg" />
|
||||||
|
<view class="message">
|
||||||
|
<text>{{item.review}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view style="margin-top:10px;margin-left:20px">
|
<view style="margin-top:10px;margin-left:20px">
|
||||||
<text style="font-size:12px">综合评分:5星 | 款式:【半贴短甲彩绘款】</text>
|
<text style="font-size:12px">综合评分:5星 | 款式:【半贴短甲彩绘款】</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -3,6 +3,7 @@ Page({
|
||||||
data: {
|
data: {
|
||||||
current: 0,
|
current: 0,
|
||||||
businessName:'',
|
businessName:'',
|
||||||
|
message:[],
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
title: '全部',
|
title: '全部',
|
||||||
|
@ -33,14 +34,18 @@ Page({
|
||||||
url: url + '/api/level/list',
|
url: url + '/api/level/list',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
|
id: this.data.id
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log(res,"sadkaskd");
|
console.log(res,"sadkaskd"),
|
||||||
|
this.setData({
|
||||||
|
message:res.data.data
|
||||||
|
}),
|
||||||
|
console.log(this.data.message);
|
||||||
},
|
},
|
||||||
fail: (error) => {
|
fail: (error) => {
|
||||||
console.error('请求失败: ', JSON.stringify(error));
|
console.error('请求失败: ', JSON.stringify(error));
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
swiped="{{swipeIndex === index}}"
|
swiped="{{swipeIndex === index}}"
|
||||||
onButtonTap="quxiao"
|
onButtonTap="quxiao"
|
||||||
>
|
>
|
||||||
<view class="t-swipe-item-con-view">
|
<view class="t-swipe-item-con-view" data-num="{{item}}" onTap="tiaozhuan">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<view class="kuang">
|
<view class="kuang">
|
||||||
<image class="image" mode="scaleToFill" src="{{item.data.businessAvatar}}" />
|
<image class="image" mode="scaleToFill" src="{{item.data.businessAvatar}}" />
|
||||||
|
|
|
@ -198,4 +198,23 @@ Page({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
tiaozhuan(item){
|
||||||
|
const id = item.target.dataset.num
|
||||||
|
console.log('传递的数据:', id);
|
||||||
|
const ID = id.data.id
|
||||||
|
console.log(ID);
|
||||||
|
const userId = id.data.userId
|
||||||
|
const address = id.data.address
|
||||||
|
const businessName = id.data.businessName
|
||||||
|
const businessAvatar = id.data.businessAvatar
|
||||||
|
const endBusiness = id.data.endBusiness
|
||||||
|
const startBusiness = id.data.startBusiness
|
||||||
|
const storeStatus = id.data.storeStatus
|
||||||
|
const businessPhone =id.data.businessPhone
|
||||||
|
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}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,141 +1,85 @@
|
||||||
.box{
|
.chat-message {
|
||||||
width: 100%;
|
display: flex;
|
||||||
height: 700px;
|
margin-bottom: 8px;
|
||||||
background-color: antiquewhite;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 头 */
|
.message-content {
|
||||||
.box1{
|
display: flex;
|
||||||
width: 100%;
|
align-items: center;
|
||||||
height: 50px;
|
|
||||||
position: absolute;
|
|
||||||
background-color: #eec2c7;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.box9{
|
.chat-message.user {
|
||||||
width: 50px;
|
justify-content: flex-end;
|
||||||
height: 50px;
|
|
||||||
position: absolute;
|
|
||||||
left: 10px;
|
|
||||||
}
|
|
||||||
.box9 image{
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
position: absolute;
|
|
||||||
top: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.box10{
|
.chat-message.bot {
|
||||||
width: 50px;
|
justify-content: flex-start;
|
||||||
height: 50px;
|
|
||||||
position: absolute;
|
|
||||||
left: 150px;
|
|
||||||
}
|
|
||||||
.box10 image{
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
position: absolute;
|
|
||||||
top: 10px;
|
|
||||||
border-radius: 50px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chat-message.user .message-content {
|
||||||
/* 客服名称 */
|
flex-direction: row-reverse; /* 头像和气泡反向排列 */
|
||||||
.p1{
|
|
||||||
font-size: 18px;
|
|
||||||
position: absolute;
|
|
||||||
left: 190px;
|
|
||||||
top: 15px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 对话框 */
|
.avatar {
|
||||||
.box2{
|
|
||||||
width: 100%;
|
|
||||||
height: 700px;
|
|
||||||
position: absolute;
|
|
||||||
top: 50px;
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
.box2 image{
|
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
position: absolute;
|
border-radius: 50%;
|
||||||
top: 28px;
|
margin: 0 8px;
|
||||||
left: 15px;
|
|
||||||
border-radius: 50px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 客服消息 框 */
|
.bubble {
|
||||||
.box3{
|
max-width: 70%;
|
||||||
width: 260px;
|
padding: 8px;
|
||||||
height: 40px;
|
border-radius: 4px;
|
||||||
position: absolute;
|
background-color: #e0e0e0;
|
||||||
left: 60px;
|
word-wrap: break-word;
|
||||||
top: 25px;
|
|
||||||
border: 1px #cfcfcf solid;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chat-message.user .bubble {
|
||||||
/* 客服消息 字 */
|
background-color: #1cbbb4;
|
||||||
.p2{
|
color: #fff;
|
||||||
font-size: 15px;
|
}
|
||||||
position: absolute;
|
.chat-container {
|
||||||
top: 10px;
|
display: flex;
|
||||||
left: 10px;
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.chat-box {
|
||||||
|
flex: flex;
|
||||||
|
height: 100%;
|
||||||
|
padding: 16px;
|
||||||
|
overflow-y: auto;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
}
|
||||||
|
.input-box {
|
||||||
|
display: flex;
|
||||||
|
align-items: center; /* 垂直居中对齐 */
|
||||||
|
padding: 5px;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
margin-left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 底部问话框 */
|
.box1 {
|
||||||
.box4{
|
flex: 1; /* 使输入框占据剩余空间 */
|
||||||
width: 388px;
|
height: 35px; /* 设置输入框的高度 */
|
||||||
height: 40px;
|
padding: 8px; /* 设置输入框内边距 */
|
||||||
position: fixed;
|
font-size: 16px; /* 设置字体大小 */
|
||||||
bottom: 20px;
|
border: 1px solid #ccc; /* 设置边框 */
|
||||||
border: 2px #cfcfcf solid;
|
border-radius: 4px; /* 设置边框圆角 */
|
||||||
border-radius: 15px;
|
box-sizing: border-box; /* 使内边距和边框包含在宽度和高度内 */
|
||||||
|
margin-right: 10px; /* 设置输入框和按钮之间的间距 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 发送 框和字*/
|
.send-button {
|
||||||
.box5{
|
display: flex; /* 使用 flexbox 布局 */
|
||||||
width: 60px;
|
justify-content: center; /* 水平居中对齐 */
|
||||||
height: 30px;
|
align-items: center; /* 垂直居中对齐 */
|
||||||
position: absolute;
|
background-color: #62adf9; /* 设置按钮背景色 */
|
||||||
top: 5px;
|
border: none; /* 去掉按钮边框 */
|
||||||
right: 20px;
|
padding: 15px 10px; /* 设置按钮内边距 */
|
||||||
background-color: #de868f;
|
color: #fff; /* 设置按钮文字颜色 */
|
||||||
border-radius: 10px;
|
border-radius: 4px; /* 设置按钮圆角 */
|
||||||
}
|
cursor: pointer; /* 设置鼠标指针为手型 */
|
||||||
.p3{
|
font-size: 16px; /* 设置字体大小 */
|
||||||
font-size: 16px;
|
|
||||||
position: absolute;
|
|
||||||
top: 6px;
|
|
||||||
left: 15px;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 询问 */
|
|
||||||
.box6{
|
|
||||||
width: 220px;
|
|
||||||
height: 35px;
|
|
||||||
position: absolute;
|
|
||||||
left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 预约 框和字*/
|
|
||||||
.box7{
|
|
||||||
width: 60px;
|
|
||||||
height: 30px;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 75px;
|
|
||||||
right: 20px;
|
|
||||||
background-color: #58a55c;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
.p4{
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bold;
|
|
||||||
position: absolute;
|
|
||||||
top: 6px;
|
|
||||||
left: 15px;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
}
|
|
@ -1,35 +1,44 @@
|
||||||
<view class="box">
|
<view class="chat-container">
|
||||||
|
<block
|
||||||
<view class="box1">
|
a:for="{{typeList}}"
|
||||||
<view class="box9">
|
a:for-index="index"
|
||||||
<navigator open-type="navigate" url="/pages/shangmenyuyuedianpu/shangmenyuyuedianpu">
|
a:for-item="item"
|
||||||
<image mode="scaleToFill" src="/pages/image/aback.png" />
|
>
|
||||||
</navigator>
|
<ant-notice
|
||||||
</view>
|
type="{{item}}"
|
||||||
<view class="box10">
|
style="margin-bottom: 8px"
|
||||||
<image mode="scaleToFill" src="/pages/image/aqingqing.png" />
|
enableMarquee="{{true}}"
|
||||||
</view>
|
onTap="handleTapLink"
|
||||||
<text class="p1">晟晟</text>
|
mode="link"
|
||||||
</view>
|
>
|
||||||
|
有问题找客服!
|
||||||
<view class="box2">
|
</ant-notice>
|
||||||
<image mode="scaleToFill" src="/pages/image/aqingqing.png" />
|
</block>
|
||||||
<view class="box3">
|
<scroll-view class="chat-box" scroll-y="true" scroll-into-view="{{scrollToView}}" scroll-top="{{scrollTop}}">
|
||||||
<text class="p2">亲,您好!我是你的专属客服晟晟哦</text>
|
<view a:for="{{chatMessages}}" a:key="index" class="chat-message {{item.type}}">
|
||||||
</view>
|
<view class="message-content">
|
||||||
<view class="box7">
|
<image class="avatar" src="{{item.avatar}}" mode="aspectFit" />
|
||||||
<navigator open-type="navigate" url="/pages/shangmenyuyueshijianduan/shangmenyuyueshijianduan" >
|
<view class="bubble">
|
||||||
<text class="p4">预约</text>
|
{{item.content}}
|
||||||
</navigator>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="box4">
|
|
||||||
<form>
|
|
||||||
<input class="box6" placeholder="请输入您需要咨询的问题?" />
|
|
||||||
</form>
|
|
||||||
<view class="box5">
|
|
||||||
<text class="p3">发送</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</scroll-view>
|
||||||
|
|
||||||
|
|
||||||
|
<form onSubmit="onSubmit" class="input-box">
|
||||||
|
<input
|
||||||
|
value="{{message}}"
|
||||||
|
name="message"
|
||||||
|
onInput="onMessageInput"
|
||||||
|
onConfirm="onKeyUp"
|
||||||
|
placeholder="你的美顾问"
|
||||||
|
class="box1"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<view style="margin: 16px;">
|
||||||
|
<button onTap="onSubmit" class="send-button" onConfirm="onSubmit">发送</button>
|
||||||
|
</view>
|
||||||
|
</form>
|
||||||
|
|
||||||
</view>
|
</view>
|
|
@ -1,4 +1,111 @@
|
||||||
Page({
|
Page({
|
||||||
data: {},
|
data: {
|
||||||
onLoad() {},
|
message: '',
|
||||||
|
chatMessages: [],
|
||||||
|
typeList: ['primary'],
|
||||||
|
scrollToView: '', // 用于 scroll-into-view 的 id
|
||||||
|
scrollTop: 0, // 用于 scroll-top 的值
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad() {
|
||||||
|
// 在页面加载时,添加AI机器人的初始消息
|
||||||
|
let botAvatar = 'https://bpic.588ku.com/element_origin_min_pic/19/04/27/578456f43714d36fffc68ecc6f8c46e5.jpg'; // 机器人头像URL
|
||||||
|
let initialMessage = { type: 'bot', content: '请问有什么可以帮到您?', avatar: botAvatar };
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
chatMessages: [initialMessage]
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onMessageInput(e) {
|
||||||
|
this.setData({
|
||||||
|
message: e.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onKeyUp(e) {
|
||||||
|
this.onSubmit();
|
||||||
|
},
|
||||||
|
|
||||||
|
onSubmit() {
|
||||||
|
my.getStorage({
|
||||||
|
key: 'userInfo',
|
||||||
|
success: (res) => {
|
||||||
|
const userInfo = res.data;
|
||||||
|
this.setData({
|
||||||
|
id: userInfo.id, // 获取 id
|
||||||
|
avatarUrl:userInfo.avatarUrl
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let that = this;
|
||||||
|
let currentMessage = this.data.message;
|
||||||
|
let userAvatar = this.data.avatarUrl; // 用户头像URL
|
||||||
|
let botAvatar = 'https://bpic.588ku.com/element_origin_min_pic/19/04/27/578456f43714d36fffc68ecc6f8c46e5.jpg'; // 机器人头像URL
|
||||||
|
|
||||||
|
if (!currentMessage.trim()) return; // 防止发送空消息
|
||||||
|
|
||||||
|
// 添加用户消息到 chatMessages
|
||||||
|
this.setData({
|
||||||
|
chatMessages: [...this.data.chatMessages, { type: 'user', content: currentMessage, avatar: userAvatar }],
|
||||||
|
message: '',
|
||||||
|
scrollToView: `user-${Date.now()}` // 滚动到用户消息
|
||||||
|
});
|
||||||
|
|
||||||
|
// 添加“加载中”消息
|
||||||
|
let loadingMessage = { type: 'bot', content: '加载中...', avatar: botAvatar, id: `loading-${Date.now()}` };
|
||||||
|
this.setData({
|
||||||
|
chatMessages: [...this.data.chatMessages, loadingMessage]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 模拟API请求获取机器人回复
|
||||||
|
my.getStorage({
|
||||||
|
key: 'openId',
|
||||||
|
success: (res) => {
|
||||||
|
my.request({
|
||||||
|
url: 'http://localhost:5657/chat',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
openId: res.data.openId,
|
||||||
|
requestBody: currentMessage
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json'
|
||||||
|
},
|
||||||
|
success: function (res) {
|
||||||
|
let count = res.data.count; // 假设后端返回的 count 字段
|
||||||
|
let responseMessage = count >= 10
|
||||||
|
? { type: 'bot', content: '免费次数已用完', avatar: botAvatar, id: `response-${Date.now()}` }
|
||||||
|
: { type: 'bot', content: res.data.data, avatar: botAvatar, id: `response-${Date.now()}` };
|
||||||
|
|
||||||
|
// 替换“加载中”消息为机器人回复
|
||||||
|
that.setData({
|
||||||
|
chatMessages: that.data.chatMessages.map(msg =>
|
||||||
|
msg.id === loadingMessage.id ? responseMessage : msg
|
||||||
|
),
|
||||||
|
scrollToView: responseMessage.id // 滚动到最新回复
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: function (error) {
|
||||||
|
console.error('fail: ', JSON.stringify(error));
|
||||||
|
// 如果请求失败,替换“加载中”消息为错误消息
|
||||||
|
that.setData({
|
||||||
|
chatMessages: that.data.chatMessages.map(msg =>
|
||||||
|
msg.id === loadingMessage.id ? { type: 'bot', content: '请求失败,请稍后再试', avatar: botAvatar, id: `response-${Date.now()}` } : msg
|
||||||
|
),
|
||||||
|
scrollToView: `response-${Date.now()}` // 滚动到最新错误消息
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleTapLink() {
|
||||||
|
my.alert({
|
||||||
|
title: '提示', // 可选,弹窗标题
|
||||||
|
content: '别点了,再点也是10次', // 主要内容
|
||||||
|
buttonText: '确定', // 可选,按钮文字
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
"defaultTitle": "咨询",
|
"defaultTitle": "咨询",
|
||||||
"usingComponents": {},
|
"usingComponents": {
|
||||||
|
"ant-notice": "antd-mini/es/NoticeBar/index"
|
||||||
|
},
|
||||||
"styleIsolation": "apply-shared"
|
"styleIsolation": "apply-shared"
|
||||||
}
|
}
|
||||||
|
|