抖音c端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

94 行
2.4 KiB

  1. // pages/mallInfo.js
  2. const navigationBarHeight = (getApp().statusBarHeight + 50) + 'px';
  3. var config = require("../../config/config.js");
  4. var app = getApp();
  5. const Http = require("../../utils/HttpBasics");
  6. const util = require("../../utils/util");
  7. Page({
  8. /**
  9. * 页面的初始数据
  10. */
  11. data: {
  12. navigationBarHeight,
  13. weekName: [],
  14. times: [],
  15. dateArr: [{
  16. name: "星期一",
  17. value: "0"
  18. },
  19. {
  20. name: "星期二",
  21. value: "1"
  22. },
  23. {
  24. name: "星期三",
  25. value: "2"
  26. },
  27. {
  28. name: "星期四",
  29. value: "3"
  30. },
  31. {
  32. name: "星期五",
  33. value: "4"
  34. },
  35. {
  36. name: "星期六",
  37. value: "5"
  38. },
  39. {
  40. name: "星期天",
  41. value: "6"
  42. }
  43. ],
  44. mallTenantId: ""
  45. },
  46. /**
  47. * 生命周期函数--监听页面显示
  48. */
  49. onShow: function (options) {
  50. let that = this;
  51. const mallTenantId = tt.getStorageSync('mallTenantId');
  52. console.log("渲染开始")
  53. Http.get({
  54. url: config.api.getMallInfo,
  55. data: {
  56. mallTenantId: mallTenantId
  57. }
  58. })
  59. .then(res => {
  60. if (res.data.businessHours) {
  61. let businessHours = JSON.parse(res.data.businessHours)
  62. businessHours.map((item, index) => {
  63. item.weekName = [that.data.dateArr.filter(e => e.value == item.week[0])[0].name, that.data.dateArr.filter(e => e.value == item.week[1])[0].name].toString().replace(/\,/g, ' -- '),
  64. item.time = [util.convertUTCTimeToLocalTime(item.time[0]), util.convertUTCTimeToLocalTime(item.time[1])].toString().replace(/\,/g, ' -')
  65. })
  66. console.log(businessHours, 222)
  67. that.setData({
  68. name: res.data.name,
  69. servicePhone: res.data.servicePhone,
  70. img: res.data.img,
  71. introduction: res.data.introduction,
  72. parkPlaceNumber: res.data.parkPlaceNumber,
  73. businessHoursH: businessHours,
  74. })
  75. }
  76. })
  77. .catch(err => {
  78. tt.showModal({
  79. title: '提示',
  80. content: err.message,
  81. showCancel: false
  82. })
  83. })
  84. },
  85. phone: function (e) {
  86. let that = this;
  87. if (e.currentTarget.dataset.merchantlinkphone) {
  88. tt.makePhoneCall({
  89. phoneNumber: e.currentTarget.dataset.merchantlinkphone
  90. })
  91. }
  92. },
  93. })