From 04bd5c3641a8f6a93ce9b993023e1bb867b62364 Mon Sep 17 00:00:00 2001 From: renjianbo0118 <18133922183> Date: Fri, 12 May 2023 00:42:08 +0800 Subject: [PATCH] AA --- app.json | 3 +- pages/peizhen/peizhen.js | 2 +- pages/peizhen/peizhendetail.js | 294 ++++++++++++++++++++++ pages/peizhen/peizhendetail.json | 12 + pages/peizhen/peizhendetail.wxml | 111 +++++++++ pages/peizhen/peizhendetail.wxss | 404 +++++++++++++++++++++++++++++++ 6 files changed, 824 insertions(+), 2 deletions(-) create mode 100644 pages/peizhen/peizhendetail.js create mode 100644 pages/peizhen/peizhendetail.json create mode 100644 pages/peizhen/peizhendetail.wxml create mode 100644 pages/peizhen/peizhendetail.wxss diff --git a/app.json b/app.json index 48f013c..0dafd48 100644 --- a/app.json +++ b/app.json @@ -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", diff --git a/pages/peizhen/peizhen.js b/pages/peizhen/peizhen.js index 762b389..706e55c 100644 --- a/pages/peizhen/peizhen.js +++ b/pages/peizhen/peizhen.js @@ -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, }); } }, diff --git a/pages/peizhen/peizhendetail.js b/pages/peizhen/peizhendetail.js new file mode 100644 index 0000000..d4cc836 --- /dev/null +++ b/pages/peizhen/peizhendetail.js @@ -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) { + + }, + +}) \ No newline at end of file diff --git a/pages/peizhen/peizhendetail.json b/pages/peizhen/peizhendetail.json new file mode 100644 index 0000000..a18214b --- /dev/null +++ b/pages/peizhen/peizhendetail.json @@ -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": "下单" +} \ No newline at end of file diff --git a/pages/peizhen/peizhendetail.wxml b/pages/peizhen/peizhendetail.wxml new file mode 100644 index 0000000..9509720 --- /dev/null +++ b/pages/peizhen/peizhendetail.wxml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + {{"全程陪诊"}} + + {{"男"}} + {{"女"}} + {{"200"}}元 + + + {{"排队 预约 挂号 缴费 取药 记录医嘱等"}} + + + + + + + + + + + + {{"陪护时间选择"}} + + + + + + + + * + 就诊医院 + + + + + + * + 就诊人姓名 + + + + + + 就诊人电话 + + + + + + + 报告收件地址 + + + + + + + + + + + + + 服务时间 + + + + {{seckill_start}} + + + + + + + + + {{"特别需求"}} + + + + +