抖音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.

92 lines
1.9 KiB

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