C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.1 KiB

  1. const Http = require("../../../utils/HttpBasics");
  2. const imgurl = require("../../../utils/imgurl");
  3. const config = require("../../../config/config");
  4. let app = getApp();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. page: 1,
  11. shopVoList: [],
  12. data: {},
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad: function (options) {
  18. let that = this;
  19. that.getList(options.id);
  20. },
  21. /**
  22. * 生命周期函数--监听页面初次渲染完成
  23. */
  24. onReady: function () {
  25. },
  26. /**
  27. * 生命周期函数--监听页面显示
  28. */
  29. onShow: function () {
  30. },
  31. /**
  32. * 获取商户详情
  33. */
  34. getList: function (id) {
  35. let that = this;
  36. let data;
  37. data = {
  38. pageNum: that.data.page,
  39. pageSize: 15,
  40. id: id
  41. }
  42. Http.get({
  43. url: config.api.merchantList,
  44. data: data
  45. }).then(res => {
  46. that.setData({
  47. data: res.data.list[0],
  48. shopVoList: res.data.list[0].shopVoList
  49. })
  50. })
  51. .catch(err => {
  52. wx.showToast({
  53. title: err.errMsg,
  54. icon: 'none',
  55. duration: 2000,
  56. mask: false
  57. });
  58. })
  59. },
  60. })