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

index.js 2.5 KiB

hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. const imgurl = require("../../utils/imgurl");
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. merchantVoList: {
  8. value: [],
  9. type: Array
  10. }
  11. },
  12. /**
  13. * 组件的初始数据
  14. */
  15. data: {
  16. teljpgUrl: imgurl.teljpg.url,
  17. showMore: false,
  18. more: "点击查看更多",
  19. hidden: "hidden",
  20. height: ""
  21. },
  22. /**
  23. * 组件的方法列表
  24. */
  25. methods: {
  26. /**
  27. * 跳转到门店列表的详情页面
  28. */
  29. gotoDetail(e) {
  30. tt.navigateTo({
  31. url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}`
  32. })
  33. },
  34. goCertification(e) {
  35. tt.navigateTo({
  36. url: `/pages/shopCertification/shopCertification?id=${e.currentTarget.dataset.id}`
  37. })
  38. },
  39. goFitShop() {
  40. tt.navigateTo({
  41. url: `/pages/fitShop/fitShop?list=${JSON.stringify(this.data.merchantVoList)}`,
  42. success: (res) => {
  43. },
  44. fail: (res) => {
  45. },
  46. });
  47. },
  48. goMap(e) {
  49. let {
  50. latitude,
  51. longitude
  52. } = e.currentTarget.dataset.item
  53. console.log(latitude, longitude);
  54. tt.openLocation({
  55. latitude: Number(latitude),
  56. longitude: Number(longitude),
  57. scale: 18,
  58. success() {
  59. console.log("打开地图成功");
  60. },
  61. fail(err) {
  62. console.log("打开地图失败:", err.errMsg);
  63. },
  64. });
  65. },
  66. // 点击查看更多
  67. more: function () {
  68. console.log(this.properties.merchantVoList, "merchantVoList");
  69. let that = this;
  70. if (that.data.more == '点击查看更多') {
  71. this.setData({
  72. hidden: "",
  73. height: 'auto!important',
  74. more: "点击收起",
  75. showMore: true
  76. })
  77. } else {
  78. that.setData({
  79. hidden: "hidden",
  80. height: 4 * 140 + 'rpx',
  81. more: "点击查看更多",
  82. showMore: true
  83. })
  84. }
  85. },
  86. phone: function (e) {
  87. let that = this;
  88. tt.makePhoneCall({
  89. phoneNumber: e.target.dataset.merchantlinkphone
  90. });
  91. },
  92. },
  93. ready: function () {
  94. let merchantVoList = this.properties.merchantVoList;
  95. if (merchantVoList.length > 0) {
  96. if (merchantVoList.length <= 4) {
  97. this.setData({
  98. height: merchantVoList.length * 140 + 'rpx',
  99. showMore: false,
  100. hidden: "hidden"
  101. })
  102. } else if (merchantVoList && merchantVoList.length > 4) {
  103. this.setData({
  104. height: 4 * 140 + 'rpx'
  105. })
  106. }
  107. }
  108. }
  109. });