ad_detail.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view class="padding20 ad_detail">
  3. <image :src="HTTP_ADMIN_URL+imageUrl" mode="" class="swiper_img border_radius_20"></image>
  4. <view v-html="remark" class="padding20 border_radius_20 bg_color_fff mt20"></view>
  5. <view class="mt20">
  6. <view v-for="(item, index) in aiAgents" :key="index"
  7. @click="toAi({agentId:item.agentId})"
  8. class="flex-center-between padding20 border_radius_20 bg_color_fff mt20">
  9. <image :src="HTTP_ADMIN_URL+item.imageUrl" mode="" class="aiAgents_img border_radius_20 mr20"></image>
  10. <view class="ml20 flex_1 flex-center-between">
  11. <view class="flex_1 mr20">
  12. <view class="bold font_size35 line2">{{item.agentName}}</view>
  13. <view class="gray font_size25 line2">{{item.agentDesc}}</view>
  14. </view>
  15. <image src="/static/img/arrow-right.png" mode="widthFix" class="menu_img"></image>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script setup>
  22. import { ref } from "vue";
  23. import { HTTP_ADMIN_URL } from "@/config/app.js";
  24. import { getAdDetails } from "@/api/home";
  25. import { onLoad } from "@dcloudio/uni-app";
  26. import { useAppStore } from "@/stores/app";
  27. const appStore = useAppStore();
  28. const imageUrl = ref('');
  29. const remark = ref('');
  30. const aiAgents = ref([]);
  31. onLoad(({dictCode}) => {
  32. getAdDetailsFn(dictCode);
  33. })
  34. function getAdDetailsFn(dictCode) {
  35. getAdDetails({dictCode}).then(res => {
  36. if (res.code == 200) {
  37. imageUrl.value = res.data?.sysDictData?.dictValue || '';
  38. remark.value = res.data?.sysDictData?.remark || '';
  39. aiAgents.value = res.data?.aiAgents || [];
  40. }
  41. })
  42. }
  43. function toAi({agentId='', msgContent=''}){
  44. if(agentId) appStore.UPDATE_agentId(agentId);
  45. if(msgContent)appStore.UPDATE_msgContent(msgContent);
  46. uni.switchTab({
  47. url: '/pages/ai/ai'
  48. });
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .ad_detail{
  53. height: 100%;
  54. .swiper_img{
  55. width: 100%;
  56. height: 350rpx;
  57. background-color: #ffffff;
  58. }
  59. .aiAgents_img{
  60. width: 100rpx;
  61. height: 100rpx;
  62. }
  63. .menu_img{
  64. width: 40rpx;
  65. height: 40rpx;
  66. }
  67. }
  68. </style>