xiangjie.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="icon-title-navBar-box">
  3. <view @click="handleBack" class="nav-bar-icon"></view>
  4. <text class="nav-bar-title">单词详解</text>
  5. </view>
  6. <view>
  7. <view>
  8. {{pageInfo.name}}
  9. </view>
  10. <view>
  11. <text>
  12. 通用释义
  13. </text>
  14. <text v-for="(item,index) in pageInfo.xiangyi" :key="index">
  15. <text>
  16. {{item}}
  17. </text>
  18. </text>
  19. </view>
  20. <view>
  21. <text>
  22. 实用口语
  23. </text>
  24. <text v-for="(item,index) in pageInfo.kouyu" :key="index">
  25. <text>
  26. {{item.en}}
  27. {{item.zn}}
  28. </text>
  29. </text>
  30. </view>
  31. </view>
  32. </template>
  33. <script setup>
  34. import {
  35. reactive,
  36. ref,
  37. onMounted
  38. } from 'vue';
  39. import {
  40. getWordInfo
  41. } from "@/api/word.js"
  42. import {
  43. onLoad
  44. } from '@dcloudio/uni-app';
  45. const goXiangjie = () => {
  46. }
  47. const pageInfo = ref({
  48. kouyu: [],
  49. xiangyi: [],
  50. name: ''
  51. })
  52. const data = ref(null)
  53. onLoad((options) => {
  54. getInfo(options)
  55. data.value = options
  56. })
  57. const handleBack = () => {
  58. uni.redirectTo({
  59. url: `/pages/newEnglish/index?jieId=${data.value.jieId}&wordId=${data.value.wordId}`
  60. });
  61. }
  62. const getInfo = (data) => {
  63. let req = {
  64. jieId: data.jieId,
  65. wordId: data.wordId
  66. }
  67. getWordInfo(req).then(res => {
  68. console.log('res', res);
  69. pageInfo.value = res.data
  70. })
  71. }
  72. </script>
  73. <style>
  74. </style>