fix(PosterCheckin): 根据小程序环境版本获取海报信息
移除过时的TODO注释并根据小程序环境版本(正式版或体验版)获取对应的海报信息
Showing
1 changed file
with
6 additions
and
3 deletions
| ... | @@ -169,8 +169,6 @@ const apiData = ref(null) | ... | @@ -169,8 +169,6 @@ const apiData = ref(null) |
| 169 | const isLoading = ref(false) | 169 | const isLoading = ref(false) |
| 170 | const apiError = ref(null) | 170 | const apiError = ref(null) |
| 171 | 171 | ||
| 172 | -// TODO: 有真实数据的时候, 通过ID获取具体地点的海报信息, 赋值currentPosterIndex获取特定的海报 | ||
| 173 | - | ||
| 174 | // 图片预览相关 | 172 | // 图片预览相关 |
| 175 | const previewVisible = ref(false) | 173 | const previewVisible = ref(false) |
| 176 | const previewImages = ref([]) | 174 | const previewImages = ref([]) |
| ... | @@ -183,7 +181,12 @@ const fetchPosterDetail = async () => { | ... | @@ -183,7 +181,12 @@ const fetchPosterDetail = async () => { |
| 183 | isLoading.value = true | 181 | isLoading.value = true |
| 184 | apiError.value = null | 182 | apiError.value = null |
| 185 | 183 | ||
| 186 | - const response = await getPosterDetailAPI({}) | 184 | + const accountInfo = wx.getAccountInfoSync(); |
| 185 | + const envVersion = accountInfo.miniProgram.envVersion; | ||
| 186 | + // 小程序版本。正式版为 "release",体验版为 "trial"。默认是正式版 | ||
| 187 | + const env_version = envVersion === 'release' ? 'release' : 'trial'; | ||
| 188 | + | ||
| 189 | + const response = await getPosterDetailAPI({ env_version }) | ||
| 187 | 190 | ||
| 188 | if (response.code === 1) { | 191 | if (response.code === 1) { |
| 189 | apiData.value = response.data | 192 | apiData.value = response.data | ... | ... |
-
Please register or login to post a comment