subject.js 1.65 KB
// components/2.0/taocan/subject.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    order:Object,
    hasTopStatus:Boolean,
    listOrder:Object,//列表数据
    foods_info:Object,//订单详情
    order_info:Object,//订单详情
  },

  /**
   * 组件的初始数据
   */
  data: {

  },
  attached(){
    this.initListOrder()
  },
  /**
   * 组件的方法列表
   */
  methods: {
    clickSeller(){
      if(this.data.hasTopStatus) return;
      let seller_tel=this.data.order_info.seller_tel||this.data.order_info.phone
      if(typeof seller_tel=='string'){
        seller_tel=seller_tel.split(',')
      }
      this.selectComponent('#as').show({
        seller_tel:seller_tel,
      });
    },
    initListOrder(){
      if(!this.data.listOrder) return;
      let orderStatusStr={
        1:{status:'未支付',info:''},
        2:{status:'待使用',info:'感谢您的支持,请您按尽快来店就餐呦'},
        3:{status:'已使用',info:'感谢您的支持,满意的话记得常来呦'},
        4:{status:'退款中',info:''},
        5:{status:'已退款',info:'钱款已原路退还,请在微信账单查看呦'},
        6:{status:'已过期',info:'您可以随时申请退款呦'},
        7:{status:'支付失败',info:''},
      }
      let order_info=this.data.listOrder
      order_info.status_tips=orderStatusStr[order_info.status]
      let foods_info={
        name:order_info.name,
        eff_time_end:order_info.eff_time_end,
        main_url:order_info.main_url,
        sale_price:order_info.sale_price,
      }
      this.setData({
        order_info:order_info,
        foods_info:foods_info,
      })
    },
  }
})