add-miniprogram-to-desk-panel.wpy 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <style lang="less">
  2. .panel-add-miniprogram-to-desk {
  3. position: fixed;
  4. top: 0;
  5. bottom: 0;
  6. right: 0;
  7. left: 0;
  8. flex-direction: column;
  9. justify-content: center;
  10. align-items: center;
  11. z-index: 2;
  12. &.show {
  13. display: flex;
  14. }
  15. &.hide {
  16. display: none;
  17. }
  18. .panel-mask {
  19. position: absolute;
  20. top: 0;
  21. right: 0;
  22. left: 0;
  23. bottom: 0;
  24. background: rgba(0, 0, 0, 0.2);
  25. }
  26. .content {
  27. width: 622rpx;
  28. height: 648rpx;
  29. background: #ffffff;
  30. box-shadow: 0px 8rpx 30rpx rgba(0, 0, 0, 0.15);
  31. border-radius: 50rpx;
  32. text-align: center;
  33. position: relative;
  34. &.hidBtn {
  35. height: 648rpx;
  36. }
  37. }
  38. .btn-ingore {
  39. width: 100%;
  40. font-size: 30rpx;
  41. line-height: 32rpx;
  42. text-align: center;
  43. color: #c4c4c4;
  44. padding-top: 56rpx;
  45. box-sizing: border-box;
  46. flex: 1;
  47. }
  48. .android-content {
  49. background: #fff;
  50. height: 100%;
  51. .operation-tip {
  52. .tip-image {
  53. width: 100%;
  54. height: 558rpx;
  55. display: block;
  56. }
  57. .text {
  58. height: 96rpx;
  59. border-top: 1rpx solid #E8ECF0;
  60. font-family: PingFang SC;
  61. font-size: 32rpx;
  62. font-weight: 400;
  63. line-height: 96rpx;
  64. color: #1DB1B2;
  65. }
  66. }
  67. }
  68. }
  69. </style>
  70. <template>
  71. <cover-view
  72. class="{{'panel-add-miniprogram-to-desk '+(show?'show':'hide')}}"
  73. v-on:touchmove.stop="stopProgration"
  74. >
  75. <cover-view
  76. class="panel-mask"
  77. v-on:click="closePanel"
  78. ></cover-view>
  79. <cover-view
  80. class="content"
  81. :class="{hidBtn: !showBottomButton}"
  82. >
  83. <cover-view class="android-content">
  84. <cover-view class="operation-tip">
  85. <cover-image
  86. class="tip-image"
  87. :src="h5StaticPath+'/page-personalCenter/ceshi.png'"
  88. ></cover-image>
  89. <cover-view class="text" v-on:click="closePanel">我知道了</cover-view>
  90. </cover-view>
  91. <!-- <cover-image class="tip-image" :src="h5StaticPath+'/page-personalCenter/bg-android-tip.png'"></cover-image> -->
  92. <cover-view
  93. class="btn-ingore"
  94. v-on:click="added"
  95. v-if="showBottomButton"
  96. >我已添加,不再展示</cover-view>
  97. </cover-view>
  98. </cover-view>
  99. </cover-view>
  100. </template>
  101. <script>
  102. import wepy from '@wepy/core'
  103. import config from '@config'
  104. import { mapState } from '@wepy/x'
  105. import store from '@/store'
  106. wepy.component({
  107. store,
  108. data: {
  109. h5StaticPath: config.h5StaticPath,
  110. h5Origin: config.h5Origin,
  111. showLink: `${config.h5Origin}/#/wx-external-link`
  112. },
  113. props: {
  114. data: Object,
  115. show: Boolean,
  116. showBottomButton: {
  117. type: Boolean,
  118. default: true
  119. }
  120. },
  121. computed: {
  122. ...mapState({ userInfo: state => state.user.userInfo })
  123. },
  124. created() {
  125. },
  126. methods: {
  127. closePanel() {
  128. this.$emit('component-add-miniprogram-to-desk-panel-close')
  129. },
  130. added() {
  131. // 缓存字段添加过了
  132. wx.setStorageSync('HasAddMiniprogramShortcute', true)
  133. this.$emit('component-add-miniprogram-to-desk-panel-added')
  134. },
  135. stopProgration() { }
  136. }
  137. })
  138. </script>
  139. <config>
  140. {
  141. }
  142. </config>