C端小程序
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

90 líneas
1.7 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. if (options && options.id){
  23. this.setData({
  24. id: options.id
  25. });
  26. that.getList(options.id);
  27. }
  28. },
  29. /**
  30. * 拨打电话
  31. */
  32. phone: function (e) {
  33. let that = this;
  34. wx.makePhoneCall({
  35. phoneNumber: e.target.dataset.merchantlinkphone
  36. });
  37. },
  38. /**
  39. * 获取商户详情
  40. */
  41. getList: function (id) {
  42. let that = this;
  43. let data;
  44. data = {
  45. pageNum: that.data.page,
  46. pageSize: 15,
  47. id:id
  48. }
  49. Http.get({
  50. url: config.api.merchantList,
  51. data: data
  52. }).then(res => {
  53. that.setData({
  54. data: res.data.list[0],
  55. shopVoList: res.data.list[0].shopVoList,
  56. imglist: JSON.parse(res.data.list[0].coverPicture),
  57. })
  58. })
  59. .catch(err => {
  60. wx.showToast({
  61. title: err.errMsg,
  62. icon: 'none',
  63. duration: 2000,
  64. mask: false
  65. });
  66. })
  67. },
  68. /**
  69. * 获取多商铺列表
  70. */
  71. shopList:function(e){
  72. wx.navigateTo({
  73. url: `/pages/index/merchantList/index?id=${e.currentTarget.dataset.id}`
  74. })
  75. },
  76. /**
  77. * 生命周期函数--监听页面隐藏
  78. */
  79. onHide: function () {
  80. },
  81. /**
  82. * 页面相关事件处理函数--监听用户下拉动作
  83. */
  84. onPullDownRefresh: function () {
  85. },
  86. })