123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- var util = require('../../utils/util.js');
- var api = require('../../config/api.js');
- let referCode = 0
- // pages/graveDetail/graveDetail.js
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- index: 0,
- currentSize: 0,
- phoneTypes: ['853', '852', '86'],
- name: '',
- email: '',
- phone: '',
- desc: '',
- statusMap: ['現貨', '已預定', '已售', '現貨', '預售', '轉售', '已下架'],
- detail: {}
- },
- bindIndexChange(val) {
- this.setData({
- index: val.detail.value
- })
- },
- bindDescChange(val) {
- this.setData({
- currentSize: val.detail.value.length,
- desc: val.detail.value
- })
- },
- bindNameChange(val) {
- this.setData({
- currentSize: val.detail.value.length,
- name: val.detail.value
- })
- },
- bindPhoneChange(val) {
- this.setData({
- currentSize: val.detail.value.length,
- phone: val.detail.value
- })
- },
- bindEmailChange(val) {
- this.setData({
- currentSize: val.detail.value.length,
- email: val.detail.value
- })
- },
- gotoImg(ev) {
- if (this.data.detail.boxPositionPic) {
- wx.navigateTo({
- url: '/pages/graveImage/graveImage?img=' + this.data.detail.boxPositionPic,
- })
- }
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: async function (options) {
- let res = await util.request(api.BoxOrderDetail, {
- id: options.orderId
- }, 'GET')
- // let res = await util.request(api.BoxDetail, {
- // id: options.orderId
- // }, 'GET')
- this.setData({
- detail: res.data
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- bindCanceHandle() {
- if (this.data.detail.isHandle) {
- return
- }
- wx.showActionSheet({
- alertText: '是否取消預訂',
- itemColor: '#FA5151',
- itemList: ['确定'],
- success: async _ => {
- let res = await util.request(api.BoxCancelOrder + '?orderId=' + this.options.orderId, {}, 'POST', 'application/json')
- if (res.code === 0) {
- wx.showToast({
- title: '取消預訂成功',
- icon: 'success'
- })
- getApp().callOrderBuyCbs({referCode: referCode++})
- wx.navigateBack()
- } else {
- wx.showToast({
- title: res.msg,
- icon: 'none'
- })
- }
- },
- fail(res) {
- console.log(res.errMsg)
- }
- })
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- }
- })
|