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.

103 rivejä
1.9 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. teljpgUrl: imgurl.teljpg.url,
  11. page: 1,
  12. imglist:null,
  13. shopVoList:[],
  14. data:{},
  15. id:null
  16. },
  17. /**
  18. * 生命周期函数--监听页面加载
  19. */
  20. onLoad: function (options) {
  21. let that=this;
  22. this.setData({
  23. id: options.id
  24. });
  25. that.getList(options.id);
  26. },
  27. /**
  28. * 生命周期函数--监听页面初次渲染完成
  29. */
  30. onReady: function () {
  31. },
  32. /**
  33. * 生命周期函数--监听页面显示
  34. */
  35. onShow: function () {
  36. let that = this;
  37. },
  38. /**
  39. * 拨打电话
  40. */
  41. phone: function (e) {
  42. let that = this;
  43. wx.makePhoneCall({
  44. phoneNumber: e.target.dataset.merchantlinkphone
  45. });
  46. },
  47. /**
  48. * 获取商户详情
  49. */
  50. getList: function (id) {
  51. let that = this;
  52. let data;
  53. data = {
  54. pageNum: that.data.page,
  55. pageSize: 15,
  56. id:id
  57. }
  58. Http.get({
  59. url: config.api.merchantList,
  60. data: data
  61. }).then(res => {
  62. that.setData({
  63. data: res.data.list[0],
  64. shopVoList: res.data.list[0].shopVoList,
  65. imglist: JSON.parse(res.data.list[0].coverPicture),
  66. })
  67. })
  68. .catch(err => {
  69. wx.showToast({
  70. title: err.errMsg,
  71. icon: 'none',
  72. duration: 2000,
  73. mask: false
  74. });
  75. })
  76. },
  77. /**
  78. * 获取多商铺列表
  79. */
  80. shopList:function(e){
  81. wx.navigateTo({
  82. url: `/pages/index/merchantList/index?id=${e.currentTarget.dataset.id}`
  83. })
  84. },
  85. /**
  86. * 生命周期函数--监听页面隐藏
  87. */
  88. onHide: function () {
  89. },
  90. /**
  91. * 页面相关事件处理函数--监听用户下拉动作
  92. */
  93. onPullDownRefresh: function () {
  94. },
  95. })