outshoping.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <script setup>
  2. import { ref, onMounted } from "vue";
  3. import { placeholderPic } from "~/utils/util";
  4. import * as commonApi from "~/api/common";
  5. // 获取商品列表
  6. let getConfig = ref([]);
  7. const urladd = ref();
  8. const __news__ = async () => {
  9. try {
  10. const { data } = await commonApi.getConfig({
  11. module: "shop",
  12. });
  13. getConfig.value = data.shop_images;
  14. urladd.value = data.shop_url;
  15. } catch (error) {}
  16. };
  17. onMounted(__news__);
  18. let imgPath = placeholderPic(140, 140);
  19. const tourl = () => {
  20. window.open(urladd.value);
  21. };
  22. </script>
  23. <template>
  24. <div class="out-shop-container">
  25. <div class="out-shop__header">
  26. <div class="title">即将前往外部链接</div>
  27. <div class="tips">请注意个人账号与财产安全</div>
  28. </div>
  29. <div class="out-shop__main">
  30. <template v-for="(item, idx) in getConfig" :key="idx">
  31. <img :src="item" style="width: 140px; height: 140px" />
  32. </template>
  33. </div>
  34. <div class="out-shop__footer">
  35. <el-button type="primary" size="large" @click="tourl">继续跳转</el-button>
  36. </div>
  37. </div>
  38. </template>
  39. <style lang="scss" scoped>
  40. .out-shop {
  41. &-container {
  42. width: 680px;
  43. background-color: #fff;
  44. padding: 20px;
  45. border-radius: 10px;
  46. }
  47. &__header {
  48. .title {
  49. font-size: 18px;
  50. font-weight: 600;
  51. color: #333333;
  52. line-height: 2.2em;
  53. }
  54. .tips {
  55. font-size: 14px;
  56. font-weight: 400;
  57. color: #999999;
  58. line-height: 1.8em;
  59. }
  60. }
  61. &__main {
  62. padding: 10px 0;
  63. display: grid;
  64. grid-template-columns: repeat(4, auto);
  65. gap: 20px;
  66. justify-content: space-between;
  67. }
  68. &__footer {
  69. margin-top: 20px;
  70. .el-button {
  71. width: 100%;
  72. }
  73. }
  74. }
  75. </style>