|
- const Http = require("../../../utils/HttpBasics");
- const imgurl = require("../../../utils/imgurl");
- const config = require("../../../config/config");
- let app = getApp();
- Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- page: 1,
- shopVoList: [],
- data: {},
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- let that = this;
- that.getList(options.id);
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
- /**
- * 获取商户详情
- */
- getList: function (id) {
- let that = this;
- let data;
- data = {
- pageNum: that.data.page,
- pageSize: 15,
- id: id
- }
- Http.get({
- url: config.api.merchantList,
- data: data
- }).then(res => {
- that.setData({
- data: res.data.list[0],
- shopVoList: res.data.list[0].shopVoList
- })
- })
- .catch(err => {
- wx.showToast({
- title: err.errMsg,
- icon: 'none',
- duration: 2000,
- mask: false
- });
- })
- },
- })
|