xiangjie.vue 1.8 KB

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