猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.3 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <up-modal :show="show" :showConfirmButton="false">
  3. <view class="slot-content box">
  4. <image class="w-100" :src="state.info.partnerBackground"></image>
  5. <view class="size-32 fw700 title text-c w-100">
  6. {{state.info.prompt}}
  7. </view>
  8. <view class="size-32 fw700 w-100 text-c" v-html="state.info.promptText">
  9. </view>
  10. <view class="btn color-fff size-30 flex-rowc" @tap="close">
  11. 我知道了
  12. </view>
  13. </view>
  14. </up-modal>
  15. </template>
  16. <script setup>
  17. import {
  18. successList
  19. } from "@/api/home.js"
  20. import {
  21. watch,
  22. ref,
  23. watchEffect,
  24. onMounted,
  25. reactive
  26. } from "vue"
  27. const props = defineProps({
  28. open: false
  29. })
  30. const emit = defineEmits(['close'])
  31. const show = ref(false)
  32. watch(() => props.open, (val) => {
  33. show.value = val
  34. })
  35. onMounted(() => {
  36. init()
  37. })
  38. const state = reactive({
  39. info: {}
  40. })
  41. const init = () => {
  42. successList().then(res => {
  43. state.info = res.rows[0]
  44. })
  45. }
  46. const close = () => {
  47. emit("close", false)
  48. }
  49. </script>
  50. <style scoped lang="scss">
  51. @import "@/style/index.scss";
  52. .box {
  53. width: 632rpx;
  54. background-color: #fff;
  55. border-radius: 8rpx;
  56. image {
  57. height: 190rpx;
  58. }
  59. .title {
  60. margin-top: 100rpx;
  61. margin-bottom: 45rpx;
  62. }
  63. .btn {
  64. width: 594rpx;
  65. height: 94rpx;
  66. border-radius: 94rpx;
  67. background-color: $mainColor;
  68. margin-top: 168rpx;
  69. }
  70. }
  71. </style>