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.

96 line
1.7 KiB

  1. const Http = require("../../../utils/HttpBasics");
  2. const imgurl = require("../../../utils/imgurl");
  3. const config = require("../../../config/config");
  4. const QR = require("../../../utils/memberqrcode.js");
  5. let app = getApp();
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. teljpgUrl: imgurl.teljpg.url,
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad: function (options) {
  17. },
  18. /**
  19. * 生命周期函数--监听页面初次渲染完成
  20. */
  21. onReady: function () {
  22. },
  23. /**
  24. * 生命周期函数--监听页面显示
  25. */
  26. onShow: function () {
  27. // merchantList
  28. let that = this;
  29. that.getList(10,1)
  30. },
  31. getList(pageSize,pageNum){
  32. let that = this;
  33. Http.get({
  34. url: config.api.merchantList,
  35. data: {
  36. pageNum: pageNum,
  37. pageSize: pageSize
  38. }
  39. }).then(res => {
  40. that.setData({
  41. merchantVoList: res.data.list
  42. })
  43. console.log(res)
  44. }).catch(err => {
  45. console.log(err)
  46. })
  47. },
  48. phone: function (e) {
  49. let that = this;
  50. if (e.currentTarget.dataset.merchantlinkphone) {
  51. wx.makePhoneCall({
  52. phoneNumber: e.currentTarget.dataset.merchantlinkphone
  53. });
  54. }
  55. },
  56. /**
  57. * 生命周期函数--监听页面隐藏
  58. */
  59. onHide: function () {
  60. },
  61. /**
  62. * 生命周期函数--监听页面卸载
  63. */
  64. onUnload: function () {
  65. },
  66. /**
  67. * 页面相关事件处理函数--监听用户下拉动作
  68. */
  69. onPullDownRefresh: function () {
  70. },
  71. /**
  72. * 页面上拉触底事件的处理函数
  73. */
  74. onReachBottom: function () {
  75. },
  76. /**
  77. * 用户点击右上角分享
  78. */
  79. onShareAppMessage: function () {
  80. }
  81. })