12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- const https = require("../../../utils/serverOrder");
- const columns = require("./columns");
- const dayjs = require("dayjs")
- import {
- createStoreBindings
- } from 'mobx-miniprogram-bindings'
- import {
- store
- } from "../../../store/index";
- Page({
- data: {
- loading: true,
- id: "",
- status_options: columns.status_options,
- items: null,
-
- },
- onLoad(options) {
- this.storeBindings = createStoreBindings(this, {
- store,
- fields: ["token"],
- actions: ["setStore"],
- });
- const {
- id
- } = options
- this.setData({
- id
- })
- this.getResourceDetails()
- },
- onUnload() {
- this.storeBindings.destroyStoreBindings();
- },
- phoneOpen() {
- wx.makePhoneCall({
- phoneNumber: '400-9121-211' //仅为示例,并非真实的电话号码
- })
- },
- async getResourceDetails() {
- const {
- id,
- status_options
- } = this.data
- const {
- code,
- data
- } = await https.orderInfo({
- reqCode: id
- })
- if (code === 1) {
- let str = ""
- const {
- req_demand_name
- } = data
- req_demand_name.forEach((s, i) => {
- str += i === 0 ? s.name : '+' + s.name
- })
- this.setData({
- items: {
- ...data,
- status_name: (status_options.find((item) => item.value == String(data.status)) || {}).label ||
- '--',
- act_time_day: dayjs(data.act_time).format('MM.DD'),
- act_time_end_day: dayjs(data.req_endtime).format('MM.DD'),
- req_demand_name_label: str,
-
- },
- loading: false
- })
- } else {
- await this.setStore("", "")
- this.setData({
- loading: false,
- })
- }
- },
- })
|