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

175 lines
3.7 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. // uni.navigateTo({
  87. // url: '/pages/index/introduce'
  88. // })
  89. }
  90. },
  91. });
  92. }
  93. },
  94. fail(err) {
  95. if (err.errCode === 20004) {
  96. console.log('用户关闭了主开关');
  97. wx.showModal({
  98. title: '提示',
  99. content: '检测到您未开启订阅权限,请前往设置开启。',
  100. success(modalRes) {
  101. if (modalRes.confirm) {
  102. wx.openSetting();
  103. }
  104. },
  105. });
  106. } else {
  107. console.error('订阅失败:', err);
  108. }
  109. },
  110. })
  111. },
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .page {
  117. width: 100%;
  118. .logo {
  119. width: 600rpx;
  120. margin: 50rpx 75rpx;
  121. }
  122. .info {
  123. text-align: center;
  124. .title {
  125. font-size: 40rpx;
  126. font-weight: bold;
  127. margin: 40rpx 0 20rpx 0;
  128. }
  129. .list {
  130. line-height: 50rpx;
  131. }
  132. }
  133. .position {
  134. position: absolute;
  135. bottom: 130rpx;
  136. left: 75rpx;
  137. display: flex;
  138. flex-direction: column;
  139. align-items: center;
  140. .btn {
  141. border-radius: 40rpx;
  142. padding: 30rpx 0;
  143. background: $uni-color-primary;
  144. color: #fff;
  145. text-align: center;
  146. font-size: 28rpx;
  147. width: 600rpx;
  148. }
  149. }
  150. .second-color {
  151. color: $uni-color-primary;
  152. margin-top: 20rpx;
  153. font-size: 26rpx;
  154. }
  155. }
  156. </style>