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

101 lines
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. tt.navigateTo({
  19. url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}&mallTenantId=${e.currentTarget.dataset.tenantid}`
  20. })
  21. },
  22. // 跳转资质页面
  23. goCertification(e) {
  24. tt.navigateTo({
  25. url: `/pages/shopCertification/shopCertification?id=${e.currentTarget.dataset.id}`
  26. })
  27. },
  28. //跳转地图页面
  29. goMap(e) {
  30. let {
  31. latitude,
  32. longitude
  33. } = e.currentTarget.dataset.item
  34. console.log(latitude, longitude);
  35. tt.openLocation({
  36. latitude: Number(latitude),
  37. longitude: Number(longitude),
  38. scale: 18,
  39. success() {
  40. console.log("打开地图成功");
  41. },
  42. fail(err) {
  43. console.log("打开地图失败:", err.errMsg);
  44. },
  45. });
  46. },
  47. goFitShop() {
  48. const arr = []
  49. this.data.list.forEach(item => {
  50. item.merchantVoList.forEach(el => {
  51. arr.push(el)
  52. })
  53. })
  54. tt.navigateTo({
  55. url: `/pages/fitShop/fitShop?list=${JSON.stringify(arr)}`,
  56. success: (res) => {},
  57. fail: (res) => {},
  58. });
  59. },
  60. expandList(e) {
  61. const index = e.currentTarget.dataset.index
  62. const arr = this.data.list
  63. arr[index].expand = !arr[index].expand
  64. this.setData({
  65. list: arr
  66. })
  67. },
  68. phone(e) {
  69. tt.makePhoneCall({
  70. phoneNumber: e.target.dataset.merchantlinkphone
  71. });
  72. },
  73. },
  74. ready() {
  75. this.setData({
  76. list: JSON.parse(JSON.stringify(this.properties.mallList))
  77. })
  78. console.log(this.data.mallList, 'mallList');
  79. let mallNum = 0
  80. this.data.list.forEach(item => {
  81. mallNum += item.merchantVoList.length
  82. })
  83. this.setData({
  84. mallNum: mallNum
  85. })
  86. },
  87. created() {
  88. }
  89. })