hint.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. <view class="hint-val">
  12. {{ warningText }}
  13. </view>
  14. <view class="hint-btns" @click.stop="onClose()">
  15. <view class="hint-btn">关闭</view>
  16. </view>
  17. </view>
  18. </uni-popup>
  19. </template>
  20. <script>
  21. import { PhoneCall } from "@/utils/tool.js";
  22. import { getConfigByKey } from "@/api/feedback.js";
  23. export default {
  24. data() {
  25. return {
  26. hintList: [],
  27. warningText: "",
  28. };
  29. },
  30. created() {},
  31. mounted() {
  32. this.cheackShow();
  33. },
  34. methods: {
  35. async cheackShow() {
  36. console.log("-------检查提示列表-------");
  37. try {
  38. const res = await getConfigByKey({ configKey: "mapIndexWarning" });
  39. this.warningText = res.configValue;
  40. const a = uni.getStorageSync("showHint");
  41. if (!a) {
  42. this.open();
  43. }
  44. } catch (e) {
  45. this.open();
  46. }
  47. },
  48. open() {
  49. this.$refs.hintRef.open();
  50. try {
  51. uni.setStorageSync("showHint", true);
  52. } catch (e) {
  53. // error
  54. }
  55. },
  56. onPhoneCall(phone) {
  57. PhoneCall(phone).then((res) => {
  58. this.onClose();
  59. });
  60. },
  61. onClose() {
  62. this.$refs.hintRef.close();
  63. this.hintList = [];
  64. },
  65. },
  66. };
  67. </script>
  68. <style lang="scss" scoped>
  69. .uni-popup {
  70. z-index: 1002;
  71. .hint-box {
  72. width: 80vw;
  73. min-height: 30vh;
  74. height: auto;
  75. max-height: 70vh;
  76. background-color: #fff;
  77. border-radius: 20rpx;
  78. display: flex;
  79. flex-direction: column;
  80. // justify-content: center;
  81. align-items: center;
  82. justify-content: space-between;
  83. .hint-title {
  84. font-size: 36rpx;
  85. padding: 20rpx 0;
  86. }
  87. .hint-val {
  88. height: 1px;
  89. flex: 1;
  90. padding: 20rpx 30rpx;
  91. color: #6f6f6f;
  92. }
  93. .hint-btns {
  94. padding: 20rpx 0;
  95. .hint-btn {
  96. width: 260rpx;
  97. height: 80rpx;
  98. display: flex;
  99. justify-content: center;
  100. align-items: center;
  101. color: #fff;
  102. border-radius: 10rpx;
  103. background-color: #3291f8;
  104. }
  105. }
  106. }
  107. }
  108. </style>