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.

100 líneas
2.1 KiB

  1. const imgurl = require("../../utils/imgurl");
  2. Component({
  3. properties: {
  4. mallList: {
  5. value: [],
  6. type: Array
  7. }
  8. },
  9. data: {
  10. teljpgUrl: imgurl.teljpg.url,
  11. list: [], // 广场、商户列表
  12. mallNum: 0, // 适用商户数量
  13. },
  14. methods: {
  15. // 跳转详情页
  16. gotoDetail(e) {
  17. console.log(e);
  18. wx.navigateTo({
  19. url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}&mallTenantId=${e.currentTarget.dataset.tenantid}`
  20. })
  21. },
  22. phone: function (e) {
  23. let that = this;
  24. wx.makePhoneCall({
  25. phoneNumber: e.target.dataset.merchantlinkphone
  26. });
  27. },
  28. // 跳转资质页面
  29. // goCertification(e) {
  30. // wx.navigateTo({
  31. // url: `/pages/shopCertification/index?id=${e.currentTarget.dataset.id}`
  32. // })
  33. // },
  34. //跳转地图页面
  35. goMap(e) {
  36. let {
  37. latitude,
  38. longitude
  39. } = e.currentTarget.dataset.item
  40. console.log(latitude, longitude);
  41. wx.openLocation({
  42. latitude: Number(latitude),
  43. longitude: Number(longitude),
  44. scale: 18,
  45. success() {
  46. console.log("打开地图成功");
  47. },
  48. fail(err) {
  49. console.log("打开地图失败:", err.errMsg);
  50. },
  51. });
  52. },
  53. goFitShop() {
  54. const arr = []
  55. this.data.list.forEach(item => {
  56. item.merchantVoList.forEach(el => {
  57. arr.push(el)
  58. })
  59. })
  60. wx.navigateTo({
  61. url: `/pages/fitShop/fitShop?list=${JSON.stringify(arr)}`,
  62. success: (res) => { },
  63. fail: (res) => { },
  64. });
  65. },
  66. expandList(e) {
  67. const index = e.currentTarget.dataset.index
  68. const arr = this.data.list
  69. arr[index].expand = !arr[index].expand
  70. this.setData({
  71. list: arr
  72. })
  73. }
  74. },
  75. ready() {
  76. this.setData({
  77. list: JSON.parse(JSON.stringify(this.properties.mallList))
  78. })
  79. console.log(this.data.mallList, 'mallList');
  80. let mallNum = 0
  81. this.data.list.forEach(item => {
  82. mallNum += item.merchantVoList.length
  83. })
  84. this.setData({
  85. mallNum: mallNum
  86. })
  87. },
  88. created() {
  89. }
  90. })