123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import { httpImages } from "../../../api/serverResource";
- import {
- createStoreBindings
- } from 'mobx-miniprogram-bindings'
- import {
- store
- } from "../../../store/index";
- Page({
- data: {
- id: "",
- list: []
- },
- onLoad(options: object) {
- this.storeBindings = createStoreBindings(this, {
- store,
- fields: ["token"],
- actions: ["setStore"],
- });
- const {
- id
- } = options
- this.setData({
- id
- })
- this.getResourceDetails()
- },
- onUnload() {
- this.storeBindings.destroyStoreBindings();
- },
- async getResourceDetails() {
- const {
- id
- } = this.data
- const {
- code,
- data
- } = await httpImages({
- store_id: id,
- page: 1,
- limit: 9999999,
- type: "详情图片"
- })
- if (code !== 1) {
- await this.setStore("", "");
- }
- this.setData({
- list: code === 1 ? data.list : []
- })
- },
- })
|