百富门答题小程序
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.

171 lines
3.6 KiB

1 year ago
8 months ago
8 months ago
1 year ago
8 months ago
1 year ago
8 months ago
8 months ago
8 months ago
11 months ago
8 months ago
1 year ago
1 year ago
1 year ago
11 months ago
11 months ago
1 year ago
8 months ago
8 months ago
1 year ago
11 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
11 months ago
  1. <template>
  2. <view class="page">
  3. <image :src="configList.img_4" class="page-bg" mode="aspectFill"></image>
  4. <image :src="configList.img_6" class="logo" mode="widthFix"></image>
  5. <image :src="configList.img_9" class="page-bg" mode="widthFix"></image>
  6. <view class="info">
  7. <view class="title">
  8. {{ userInfo.nickName }}
  9. </view>
  10. <view class="list">
  11. 欢迎来到百富门的世界
  12. <br />
  13. 品味传承与创新交织的威士忌
  14. <br />
  15. 艺术开启您的专属品鉴之旅
  16. </view>
  17. </view>
  18. <image :src="configList.img_8" class="logo" mode="widthFix"></image>
  19. <view class="position">
  20. <view class="btn" @click="next">
  21. 点击进入
  22. </view>
  23. <text class="second-color">{{ configList.bg_title }}</text>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. mapState
  30. } from 'vuex'
  31. export default {
  32. data() {
  33. return {}
  34. },
  35. computed: {},
  36. onShow() {
  37. if (uni.getStorageSync('token')) {
  38. this.$store.commit('getUserInfo')
  39. }
  40. },
  41. methods: {
  42. next() {
  43. // wx.requestSubscribeMessage({
  44. // tmplIds: ['TEMPLATE_ID'], // 替换为你的模板ID
  45. // success(res) {
  46. // if (res['TEMPLATE_ID'] === 'accept') {
  47. // console.log('用户已同意订阅');
  48. // // 执行后续逻辑,例如发送消息
  49. // } else if (res['TEMPLATE_ID'] === 'reject') {
  50. // console.log('用户拒绝订阅');
  51. // // 引导用户到设置页面开启权限
  52. // wx.showModal({
  53. // title: '提示',
  54. // content: '您已拒绝订阅消息,请到设置中开启权限。',
  55. // success(modalRes) {
  56. // if (modalRes.confirm) {
  57. // wx.openSetting();
  58. // }
  59. // },
  60. // });
  61. // }
  62. // },
  63. // });
  64. uni.requestSubscribeMessage({
  65. //此处填写刚才申请模板的模板ID
  66. tmplIds: [
  67. 'ZREm8r0Bgv-W0W48DHw83nUMYYOdaslI99MTlqgR0ZI',
  68. '0GqFy6mBu1bmoHsSugtKoQ64aFs1oQXy6sZOE1FlDcw'
  69. ],
  70. success(res) {
  71. console.log(res)
  72. if (
  73. res['ZREm8r0Bgv-W0W48DHw83nUMYYOdaslI99MTlqgR0ZI'] === 'accept' &&
  74. res['0GqFy6mBu1bmoHsSugtKoQ64aFs1oQXy6sZOE1FlDcw'] === 'accept'
  75. ) {
  76. uni.navigateTo({
  77. url: '/pages/index/introduce'
  78. })
  79. }else{
  80. wx.showModal({
  81. title: '提示',
  82. content: '您已拒绝订阅消息,请到设置中开启权限。',
  83. success(modalRes) {
  84. if (modalRes.confirm) {
  85. wx.openSetting();
  86. }
  87. },
  88. });
  89. }
  90. },
  91. fail(err) {
  92. if (err.errCode === 20004) {
  93. console.log('用户关闭了主开关');
  94. wx.showModal({
  95. title: '提示',
  96. content: '检测到您未开启订阅权限,请前往设置开启。',
  97. success(modalRes) {
  98. if (modalRes.confirm) {
  99. wx.openSetting();
  100. }
  101. },
  102. });
  103. } else {
  104. console.error('订阅失败:', err);
  105. }
  106. },
  107. })
  108. },
  109. }
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. .page {
  114. width: 100%;
  115. .logo {
  116. width: 600rpx;
  117. margin: 50rpx 75rpx;
  118. }
  119. .info {
  120. text-align: center;
  121. .title {
  122. font-size: 40rpx;
  123. font-weight: bold;
  124. margin: 40rpx 0 20rpx 0;
  125. }
  126. .list {
  127. line-height: 50rpx;
  128. }
  129. }
  130. .position {
  131. position: absolute;
  132. bottom: 130rpx;
  133. left: 75rpx;
  134. display: flex;
  135. flex-direction: column;
  136. align-items: center;
  137. .btn {
  138. border-radius: 40rpx;
  139. padding: 30rpx 0;
  140. background: $uni-color-primary;
  141. color: #fff;
  142. text-align: center;
  143. font-size: 28rpx;
  144. width: 600rpx;
  145. }
  146. }
  147. .second-color {
  148. color: $uni-color-primary;
  149. margin-top: 20rpx;
  150. font-size: 26rpx;
  151. }
  152. }
  153. </style>