about-us.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // pages/sub_home_page/about-us/about-us.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. merchant:{}
  9. },
  10. /**
  11. * 请求店铺信息
  12. */
  13. requestMerchantInfo(){
  14. var _this=this
  15. wx.request({
  16. url: app.globalData.rootUrl + '/user/visit/merchant/get',
  17. method:"GET",
  18. success(e){
  19. if(e.data.success){
  20. _this.setData({
  21. merchant:e.data.data
  22. })
  23. }
  24. }
  25. })
  26. },
  27. handleAddressTap(){
  28. var merchant=this.data.merchant
  29. wx.openLocation({
  30. latitude: 30.651446,
  31. longitude: 104.189026,
  32. name:merchant.storeName,
  33. address:merchant.description
  34. })
  35. },
  36. /**
  37. * 生命周期函数--监听页面加载
  38. */
  39. onLoad: function (options) {
  40. this.requestMerchantInfo()
  41. this.setData({
  42. serverPrefix:app.globalData.serverPrefix
  43. })
  44. }
  45. })