123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- // pages/detailInfo/detailData.js
- import http from '../../utils/http'
- import util from '../../utils/util'
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- dates: '',
- date: "",
- project_id: "",
- datainfo: {},
- order_sn: "",
- th: ["租赁设备", "提交人", "金额"],
- td: [],
- is_manager:""
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.setData({
- date: options.date,
- project_id: options.id - 0,
- dates: options.dates,
- order_sn: options.order_sn
- })
- this.getOrderDetails()
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- getOrderDetails() {
- http({
- url: 'orders/getOrderDetails',
- data: {
- date: this.data.date,
- project_id: this.data.project_id,
- dates: this.data.dates,
- order_sn: this.data.order_sn,
- user_id:wx.getStorageSync('sg-userinfo').id
- },
- success: (res) => {
- console.log(res)
- if (res.code == 0) {
- this.setData({
- datainfo: res.order_view,
- td: res.data,
- is_manager:res.is_manager
- })
- }
- }
- })
- },
- confirmOrder() {
- let time = util.formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
- wx.showModal({
- title: "提示",
- content: "是否确认账单",
- success: (res) => {
- if (res.confirm) {
- http({
- url: 'orders/updateOrderviewStatus',
- data: {
- order_sn: this.data.order_sn,
- time: time
- },
- success: (re) => {
- if (re.code == 0) {
- wx.showToast({
- title: re.msg,
- icon: "none",
- duration:1000
- })
- setTimeout(()=>{
- wx.navigateBack({
- delta: 1,
- })
- },1000)
- }
- }
- })
- }
- }
- })
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- }
- })
|