123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- // pages/buy/buy.js
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- payType: 1,
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- },
- handlePayType (e) {
- var type = Number(e.currentTarget.dataset.type)
- console.log(type);
- this.setData({
- payType: type
- })
- },
- // 调用微信支付
- handleWXPay () {
- var that = this
- wx.showLoading({
- title: '支付中...',
- mask: true
- })
- setTimeout(() => {
- wx.hideLoading({
- success: () => {
- wx.showModal({
- content: '支付成功,立即去预约',
- cancelColor: '#666',
- confirmText: '去预约',
- confirmColor: '#333',
- success (res) {
- if (res.confirm) {
- that.handleAppointment()
- }
- }
- })
- }
- })
- }, 1000);
- },
- handleAppointment () {
- wx.navigateTo({
- url: '/pages/appointment/appointment',
- })
- }
- })
|