| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- const app = getApp()
- const api = require("../../../../../request/api.js");
- const http = require('../../../../../request/http');
- const utils = require('../../../../../utils/util.js');
- const storeKeys = require('../../../../../utils/storageKeys.js');
- Page({
- data: {
- isLoading: true, //是否处于加载中
- cardId: "", //礼品卡id
- detail:{}, //礼品卡详情
- },
- onLoad: function (options) {
- if (options) {
- this.data.cardId = options.cardId || "";
- }
- this.getDetails()
- },
- //获取页面数据
- getDetails() {
- wx.showLoading({
- title: "加载中",
- mask: true
- });
- http.request({
- url: api.URL + "/api/card.UserRiceCard/detail?user_rice_card_id="+this.data.cardId,
- token: utils.getStorageSync(storeKeys.TOKEN),
- method: 'GET',
- success: (res) => {
- wx.hideLoading();
- let detail = res.data.data.detail || {};
- this.setData({
- detail,
- isLoading: false
- });
- },
- error: (res) => {}
- })
- },
- })
|