hint.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <uni-popup
  3. ref="hintRef"
  4. :isMaskClick="true"
  5. type="center"
  6. border-radius="10px 10px 0 0"
  7. maskBackgroundColor="rgba(0, 0, 0, 0.1)"
  8. >
  9. <view class="hint-box">
  10. <view class="hint-title">温馨提示</view>
  11. <div v-html="mapConfig.prompt" class="hint-val"></div>
  12. <view class="hint-btns">
  13. <view
  14. v-if="mapConfig.outsideAddress"
  15. class="hint-btn"
  16. @click.stop="openWindow(mapConfig.outsideAddress)"
  17. >查看详情</view
  18. >
  19. <view class="hint-btn plain" @click.stop="onClose()">关闭</view>
  20. </view>
  21. </view>
  22. </uni-popup>
  23. </template>
  24. <script>
  25. import { PhoneCall } from "@/utils/tool.js";
  26. import { getConfigByKey } from "@/api/feedback.js";
  27. export default {
  28. props: {
  29. mapConfig: {
  30. type: Object,
  31. default: () => {},
  32. },
  33. },
  34. data() {
  35. return {
  36. hintList: [],
  37. warningText: "",
  38. };
  39. },
  40. created() {},
  41. mounted() {
  42. this.cheackShow();
  43. },
  44. methods: {
  45. async cheackShow() {
  46. console.log("-------检查提示列表-------");
  47. try {
  48. const res = await getConfigByKey({ configKey: "mapIndexWarning" });
  49. this.warningText = res.configValue;
  50. const a = uni.getStorageSync("showHint");
  51. if (!a) {
  52. this.open();
  53. }
  54. } catch (e) {
  55. this.open();
  56. }
  57. },
  58. openWindow(url) {
  59. console.log(url);
  60. window.open(url);
  61. },
  62. open() {
  63. this.$refs.hintRef.open();
  64. try {
  65. uni.setStorageSync("showHint", true);
  66. } catch (e) {
  67. // error
  68. }
  69. },
  70. onPhoneCall(phone) {
  71. PhoneCall(phone).then((res) => {
  72. this.onClose();
  73. });
  74. },
  75. onClose() {
  76. this.$refs.hintRef.close();
  77. this.hintList = [];
  78. },
  79. },
  80. };
  81. </script>
  82. <style lang="scss" scoped>
  83. .uni-popup {
  84. z-index: 1002;
  85. .hint-box {
  86. width: 80vw;
  87. background-color: #fff;
  88. border-radius: 20rpx;
  89. padding: 20rpx 0;
  90. // display: flex;
  91. // flex-direction: column;
  92. // justify-content: center;
  93. // align-items: center;
  94. // justify-content: space-between;
  95. .hint-title {
  96. text-align: center;
  97. font-size: 36rpx;
  98. height: 80rpx;
  99. line-height: 80rpx;
  100. }
  101. .hint-val {
  102. // height: calc(100% - 76rpx - 130rpx);
  103. padding: 20rpx 30rpx;
  104. color: #6f6f6f;
  105. ::v-deep p {
  106. line-height: 1.25;
  107. margin: 0 0 1em 0;
  108. }
  109. .hint-content {
  110. height: auto;
  111. min-height: 20rpx;
  112. max-height: 65vh;
  113. }
  114. .paragraph-item {
  115. text-indent: 2em;
  116. .item-sing {
  117. font-weight: bold;
  118. }
  119. }
  120. }
  121. .hint-btns {
  122. display: flex;
  123. padding: 20rpx 0;
  124. gap: 30rpx;
  125. .hint-btn {
  126. margin: 0 auto;
  127. width: 240rpx;
  128. height: 74rpx;
  129. display: flex;
  130. justify-content: center;
  131. align-items: center;
  132. color: #fff;
  133. border-radius: 10rpx;
  134. background-color: #3291f8;
  135. }
  136. .plain {
  137. background-color: transparent;
  138. color: #3291f8;
  139. border: 1rpx solid #3291f8;
  140. }
  141. }
  142. }
  143. }
  144. </style>