This commit is contained in:
renjianbo0118
2023-05-12 00:42:08 +08:00
parent 7ef26d8206
commit 04bd5c3641
6 changed files with 824 additions and 2 deletions

View File

@@ -18,7 +18,8 @@
"pages/myshoucang/myorderdetail",
"pages/wodeqianbao/qianbao",
"pages/refund/refund",
"pages/peizhen/peizhen"
"pages/peizhen/peizhen",
"pages/peizhen/peizhendetail"
],
"window": {
"backgroundTextStyle": "light",

View File

@@ -82,7 +82,7 @@ Page({
let item = JSON.stringify(e.currentTarget.dataset.item);
console.log("传递的item" + item);
wx.navigateTo({
url: "/shopping/pages/goddess/goddess?item=" + item,
url: "/pages/peizhen/peizhendetail?item=" + item,
});
}
},

View File

@@ -0,0 +1,294 @@
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
show: true,
actions: [
{
name: '选项',
},
{
name: '选项',
},
{
name: '选项',
subname: '描述信息',
openType: 'share',
},
],
height: '',
seckill_start: '请输入开始日期',
time: 30 * 60 * 60 * 1000,
timeflag: 0,
userInfo: {},
item: {},
hasUserInfo: false,
date: '',
paymoney: 0,
phone: wx.getStorageSync('phone'),
uidFlag: wx.getStorageSync('uidFlag'),
goods_detail_img: [],
indicatorDots: true,
autoplay: true,
interval: 5000,
duration: 1300,
id: 0,
order_id: '',
timeData: {},
Height: "", //这是swiper要动态设置的高度属性
charge_phone: '',
is_ok_click: false,
clock: '',
address: '',
danjia: 0.01,//单位为元
beizhu: '',
},
// 确认支付
confirm_payy: async function () {
wx.showToast({
title: '点击了',
icon: 'none'
});
var that = this;
if (!this.data.is_ok_click) {
that.setData({
is_ok_click: true
})
//你要执行的操作
this.payment()
setTimeout(function () {
that.setData({
is_ok_click: false
})
}, 10000) //阻止一秒点击多次
} else {
// wx.showToast({ title:'请勿重复操作!', icon: 'none' });
}
},
//获取单价
getprice: function () {
var that = this;
wx.request({
url: app.globalData.url + '/system/config/configKey/price',
header: app.getRequestHeader(),
method: 'GET',
data: {},
success: (res) => {
var resp = res.data;
if (res.data.code == 200) {
that.setData({
special_offer: resp.data,
});
}
}
});
},
//获取类型
getpriceType: function () {
var that = this;
wx.request({
url: app.globalData.url + '/system/config/configKey/priceType',
header: app.getRequestHeader(),
method: 'GET',
data: {},
success: (res) => {
var resp = res.data;
if (res.data.code == 200) {
that.setData({
special_offer: resp.data,
});
}
}
});
},
onClose() {
this.setData({ show: false });
},
onSelect(event) {
console.log(event.detail);
},
payment() {
if (this.data.seckill_start == "请输入开始日期") {
wx.showToast({
title: '请输入开始日期',
icon: 'none'
});
return
}
var that = this;
wx.request({
url: app.globalData.url + '/system/order/insertOrderPz',
data: {
startTime: this.data.seckill_start,
bId: this.data.item.userId,
yuguMoney: this.data.paymoney,
price: this.data.danjia,//
priceType: "1",//1是按天
hospitalId: this.data.item.hospitalId,
cId: wx.getStorageSync('uid'),
remark: this.data.beizhu,
},
method: 'POST',
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + app.getCache("token")
},
success(res) {
if (res.data.code == 200) {
that.setData({
order_id: res.data.data.orderId,
})
console.log('order_id==' + res.data.data.orderId)
app.console(that.data.order_id + "======要传的order_id")
wx.navigateTo({
url: '/shopping/pages/paysuccess/paysuccess?' + "order_id=" + that.data.order_id,
});
// console.log('timeStamp==' + res.data.data.timeStamp)
// console.log('nonceStr==' + res.data.data.nonceStr)
// console.log('package==' + res.data.data.package)
// console.log('signType==' + res.data.data.signType)
// console.log('paySign==' + res.data.data.paySign)
// wx.requestPayment({
// timeStamp: res.data.data.timeStamp,
// nonceStr: res.data.data.nonceStr,
// package: res.data.data.package,
// signType: res.data.data.signType,
// paySign: res.data.data.paySign,
// success(res) {
// console.log('支付成功');
// app.console(that.data.order_id + "======要传的order_id")
// wx.navigateTo({
// url: '/shopping/pages/paysuccess/paysuccess?' + "order_id=" + that.data.order_id,
// });
// },
// fail(res) {
// console.log('支付失败');
// }
// })
} else {
wx.showToast({
title: res.data.msg,
icon: 'error',
duration: 2000
})
}
}
})
},
bindDateChange: function (e) {
this.setData({
seckill_start: e.detail.value
})
},
checkDate: function () {
//日期格式化
var start_date = new Date(this.data.seckill_start.replace(/-/g, "/"));
var end_date = new Date(this.data.seckill_endx.replace(/-/g, "/"));
//转成毫秒数,两个日期相减
var ms = end_date.getTime() - start_date.getTime();
//转换成天数
var day = parseInt(ms / (1000 * 60 * 60 * 24));
//do something
console.log("day = ", day);
return day + 1
},
onClickLeft() {
wx.navigateBack()
},
onChange(e) {
this.setData({
timeData: e.detail,
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (e) {
var statusBarHeight = wx.getSystemInfoSync().statusBarHeight;
this.setData({
statusBarHeight: statusBarHeight,
height: 46 + statusBarHeight,
});
var that = this;
let item = JSON.parse(e.item);
that.setData({
item: item
});
},
/**
* 拨打电话
*/
callphone() {
wx.makePhoneCall({
phoneNumber: this.data.charge_phone,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var that = this;
this.getprice();
this.getpriceType();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
login: function (e) {
},
})

View File

@@ -0,0 +1,12 @@
{
"usingComponents": {
"van-count-down": "/miniprogram/miniprogram_npm/@vant/weapp/count-down/index",
"van-switch": "/miniprogram/miniprogram_npm/@vant/weapp/switch/index",
"van-button": "/miniprogram/miniprogram_npm/@vant/weapp/button/index",
"van-calendar": "/miniprogram/miniprogram_npm/@vant/weapp/calendar/index",
"van-cell": "/miniprogram/miniprogram_npm/@vant/weapp/cell/index",
"van-action-sheet": "/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index",
"van-nav-bar":"/miniprogram/miniprogram_npm/@vant/weapp/nav-bar/index"
},
"navigationBarTitleText": "下单"
}

View File

@@ -0,0 +1,111 @@
<!--pages/goddess/goddess.wxml-->
<van-nav-bar title="下单" left-text="" right-text="" left-arrow bind:click-left="onClickLeft" bind:click-right="onClickRight" style=" position: fixed;left: 0;top: 0;width: 100%;z-index: 2;" />
<view style="margin-top: {{height+12}}px;">
<view class="card_con" wx:key="key">
<view style='display:flex;background-color: white;'>
<view class="Group">
<view class="Group-image">
<image src="../image/abc.png"></image>
</view>
<view class="content">
<view style="display: flex; flex-direction:row;align-items : flex-end;">
<view class="title1">{{"全程陪诊"}}</view>
<view class="title2"></view>
<view wx:if="{{item.sex==1}}" class="title3">{{"男"}}</view>
<view wx:if="{{item.sex==0}}" class="title3">{{"女"}}</view>
<view class="title4">{{"200"}}元</view>
</view>
<view class="tejia">
<view class="Price2">{{"排队 预约 挂号 缴费 取药 记录医嘱等"}}</view>
</view>
</view>
</view>
</view>
<view style="height: 1rpx;background: #ECECEC;"></view>
</view>
<view class="card_cont" wx:key="key" style="margin-top: 24rpx;">
<view class="title-left">
{{"陪护时间选择"}}
</view>
<view class="row-wrap">
<view class="xing" style="color: #FF6E6E;">*</view>
<view class="label">就诊医院</view>
<view class="label-right">
<input model:value="{{goods_name}}" name="nickname" class="input" type="text" placeholder="请选择就诊医院" />
</view>
</view>
<view class="row-wrap">
<view class="xing" style="color: #FF6E6E;">*</view>
<view class="label">就诊人姓名</view>
<view class="label-right">
<input model:value="{{price}}" name="nickname" class="input" type="text" placeholder="请输入就诊人姓名" />
</view>
</view>
<view class="row-wrap">
<view class="label" style="margin-left: 33rpx;">就诊人电话</view>
<view class="label-right">
<input model:value="{{original_price}}" name="nickname" class="input" type="text" placeholder="请输入就诊人电话" />
</view>
</view>
<view class="row-wrap">
<view class="label" style="margin-left: 33rpx;">报告收件地址</view>
<view class="label-right">
<input model:value="{{original_price}}" name="nickname" class="input" type="text" placeholder="请输入收件地址" />
</view>
</view>
<view style="height: 1rpx;background: #ECECEC;"></view>
<view class="row-wrap">
<view class="label" style="margin-left: 33rpx;">服务时间</view>
<view class="label-right">
<picker mode="date" value="{{date}}" start="2022-01-01" end="2025-12-01" bindchange="bindDateChange">
<view class="picker">
{{seckill_start}}
</view>
</picker>
</view>
</view>
</view>
<view class="card_cont" wx:key="key" style="margin-top: 24rpx;">
<view class="title-left">
{{"特别需求"}}
</view>
<view style="height: 1rpx;background: #ECECEC;"></view>
<view class="peisong-way" style="margin-bottom: 30rpx;">
<textarea style="font-size: 26rpx;padding-left: 19rpx;padding-top: 19rpx;" model:value="{{beizhu}}" bindinput="input" placeholder="填写补充说明。" />
</view>
</view>
<view class="payment">
<view style="line-height: 56rpx;color:#333;">
<text>总计金额:</text>
<text style="font-size:40rpx;color:#FF8F1F;margin-left:20rpx;">{{paymoney}}</text>
<text>元</text>
</view>
<view class="immediately" bindtap="confirm_payy">购买服务</view>
</view>
</view>

View File

@@ -0,0 +1,404 @@
/* pages/goddess/goddess.wxss */
page{
background: #F8F8F8;
}
image {
width: 100%;
height: 100%;
}
.Category {
display: flex;
}
.Category .Price {
width: 449rpx;
height: 107rpx;
background: #FF4C00;
display: flex;
}
.card_cont{
display: flex;
flex-direction: column;
background: #fff;
width: 85%;
margin: 0 auto;
margin-top: 0rpx;
box-shadow: 0px 0px 6px rgba(152, 152, 152, 0.16);
border-radius: 10rpx;
padding: 20rpx;
}
.card_con{
display: flex;
flex-direction: column;
background: #fff;
border-radius: 10rpx;
margin-left: 40rpx;
margin-right: 40rpx;
}
.card_cont_top{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.card_top_left{
color: #E54F54;
font-size: 36rpx;
}
.card_top_left text:first-child{
font-size: 55rpx;
padding: 0 20rpx 0 0;
/* border: 1px solid red; */
}
.card_top_left text:last-child{
font-size: 24rpx;
}
.Price .Price-left {
margin: 8rpx 0 0 32rpx;
}
.Price .Price-left text:nth-child(1) {
font-size: 34rpx;
color: #FFFFFF;
font-weight: 700;
line-height: 48rpx;
}
.Price .Price-left text:nth-child(2) {
font-size: 24rpx;
color: #FFFFFF;
text-decoration: line-through;
margin-left: 5rpx;
}
/* 销售 */
.Category .Price .sale {
font-size: 26rpx;
color: #FFFFFF;
}
/* 库存 */
.Category .Price .stock {
font-size: 24rpx;
color: #FFFFFF;
margin: 16rpx 0 0 33rpx;
}
.triangle {
position: absolute;
width: 0;
height: 0;
border-width: 15rpx;
border-style: solid;
border-color: transparent #00B39B transparent transparent;
left: -28rpx;
top: 40rpx;
}
.Category .limit {
position: relative;
width: 301rpx;
height: 107rpx;
background: #00B39B;
}
.limit .seckill {
display: flex;
font-size: 24rpx;
margin: 16rpx 86rpx 8rpx 86rpx;
color: #FFFFFF;
}
/* 倒计时 */
.limit .count {
text-align: center;
color: #FFFFFF;
}
/* 文字标题 */
.title {
padding: 27rpx;
display: flex;
}
.substance {
/* margin-top: 53rpx; */
justify-content: space-between;
margin: 10rpx 24rpx 0rpx 31rpx;
}
.details_box {
display: flex;
border-bottom: 1px solid #e2e2e2;
padding: 0 24rpx;
padding-bottom: 32rpx;
}
.contact {
height: 219rpx;
background: #fff;
margin-top: 8rpx;
padding: 0 24rpx;
}
.contact_title {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500;
line-height: 70rpx;
color: #333333;
opacity: 1;
margin-bottom: 10rpx;
}
.detail_number {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 37rpx;
color: #B4B4B4;
opacity: 1;
margin-top: 11rpx;
}
.money {
margin-top: 18rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 37rpx;
color: #B4B4B4;
opacity: 1;
}
.title-left {
width: 544rpx;
height: 70rpx;
font-size: 34rpx;
color: #333333;
font-weight: 700;
margin-top: 12rpx;
}
.title-right {
margin-left: 48rpx;
border-left: 1px solid #D5D5D5;
color: #BBBBBB;
display: flex;
align-items: center;
flex-direction:column;
padding-left: 21rpx;
}
.Collection {
width: 40rpx;
height: 36rpx;
}
.Collection image {
width: 100%;
height: 100%;
}
/* 联系地址 */
.address {
padding: 30rpx;
display: flex;
}
.hospital {
width: 94rpx;
height: 94rpx;
}
.position {
margin-left: 28rpx;
}
.position view:nth-child(1) {
font-size: 28rpx;
color: #333333;
margin-bottom: 8rpx;
}
.position view:nth-child(2) {
font-size: 24rpx;
color: #ABABAB;
}
.phone {
width: 26px;
height: 26px;
border-left: 1px solid #D5D5D5;
margin-left: 20rpx;
margin-top: 30rpx;
}
/* 详情列表 */
.details {
width: 750rpx;
margin-bottom: 73px;
}
.payment {
padding: 27rpx;
display: flex;
justify-content: space-between;
position: fixed;
right: 0;
bottom: 0;
left: 0;
background: #FFFFFF;
}
.order-list{
width: 100%;
}
.immediately {
width: 230rpx;
height: 81rpx;
background: #2D7AFF;
border-radius: 207rpx;
font-size: 28rpx;
color: #FFFFFF;
text-align: center;
line-height: 82rpx;
}
.countitem {
display: inline-block;
width: 16px;
height: 16px;
margin-right: 5px;
color: #fff;
font-size: 24rpx;
text-align: center;
background-color: #2EC9B5;
border-radius: 2px;
}
.countitemm {
position: absolute;
color: #fff;
font-size: 24rpx;
text-align: center;
}
.Group {
display: flex;
}
.Group-image {
width: 128rpx;
height: 128rpx;
margin: 84rpx 40rpx 84rpx 20rpx;
}
.content {
width: auto;
height: 201rpx;
margin-top: 48rpx;
}
.content .title1 {
font-size: 36rpx;
font-weight: 700;
}
.content .title2 {
font-size: 30rpx;
font-weight: 700;
}
.content .title3 {
font-size: 32rpx;
margin-left: 24rpx;
}
.content .title4 {
font-size: 28rpx;
color: #228BFE;
width: 132rpx;
height: 40rpx;
text-align: center;
background-color: #A5BBE0;
border-radius: 20rpx;
margin-left: 24rpx;
}
/* .flex-item{
display:flex;
height: 270rpx;
width: 670rpx;
border-radius: 20rpx;
margin-top: 20rpx;
} */
.content .tejia {
display: flex;
width: 446rpx;
margin-top: 24rpx;
}
.content .tejia .Price2 {
font-size: 30rpx;
color: #666666;
line-height: 41rpx;
margin-right: 23rpx;
}
.peisong-way{
width: 640rpx;
height: 128rpx;
background: #F6F6F6;
margin-right: 31rpx;
opacity: 1;
border-radius: 0px
}
.row-wrap .label{
width: 200rpx;
color: #000;
margin-left: 6rpx;
}
.row-wrap .label-right{
width: 500rpx;
height: 88rpx;
line-height: 88rpx;
text-align: right;
}
.row-wrap{
width: 100%;
height: 100rpx;
line-height: 88rpx;
margin-left: 0rpx;
border-bottom: 1rpx solid #eee;
display: flex;
font-size: 28rpx;
/*justify-content: space-between;*/
}
.row-wrap{
width: 100%;
height: 100rpx;
line-height: 88rpx;
margin-left: 0rpx;
border-bottom: 1rpx solid #eee;
display: flex;
font-size: 28rpx;
/*justify-content: space-between;*/
}
.row-wrap .label-right input{
height: 100%;
font-size: 28rpx;
padding-right: 30rpx;
}