activity-sign.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="container cashier">
  3. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading="true" :loadingType="5" />
  4. <template v-else>
  5. <!-- <custom :navbar-data='nvabarData' /> -->
  6. <view class="container-banner" :style="{paddingTop:CustomBar + 200 +'px'}">
  7. <view class="login-input">
  8. <image class="login-logo" :src="shopInfo.shopLogo" mode=""></image>
  9. </view>
  10. <view class="login-title">展位:{{ shopInfo.showNum }}</view>
  11. <view class="login-title">参展商:{{ shopInfo.shopName }}</view>
  12. <view class="login-btn" @click="handleEntry">签到打卡</view>
  13. <view class="login-text">
  14. 注:到采美专区签到打卡,可领取超值礼包,更多惊喜和福利等你来解琐。
  15. </view>
  16. </view>
  17. </template>
  18. </view>
  19. </template>
  20. <script>
  21. import { mapState, mapMutations } from 'vuex'
  22. import authorize from '@/common/config/authorize.js'
  23. import wxLogin from '@/common/config/wxLogin.js'
  24. export default{
  25. data(){
  26. return{
  27. nvabarData: { //顶部自定义导航
  28. haveBack:false,
  29. haveHome:true,
  30. showCapsule:1, // 是否显示左上角图标 1表示显示 0表示不显示,
  31. showSearch: 0,
  32. title: '', // 导航栏 中间的标题
  33. textLeft:this.$store.state.isIphone
  34. },
  35. isIphoneX:this.$store.state.isIphoneX,
  36. CustomBar:this.CustomBar,// 顶部导航栏高度
  37. skeletonShow:true,
  38. params:{
  39. userId:'',
  40. shopId:''
  41. },
  42. shopInfo:{}
  43. }
  44. },
  45. onLoad(option) {
  46. wxLogin.wxLoginAuthorize()
  47. setTimeout(()=>{
  48. this.initData(option)
  49. },2000)
  50. },
  51. computed: {
  52. ...mapState(['hasLogin', 'userInfo', ])
  53. },
  54. methods:{
  55. // 初始化
  56. async initData(option) {
  57. const userInfo = await this.$api.getStorage()
  58. this.params.shopId = option.id
  59. this.params.userId = userInfo.userId ? userInfo.userId : 0
  60. this.userShopDetail(this.params)
  61. },
  62. // 获取展台信息
  63. async userShopDetail(params){
  64. try{
  65. const res = await this.UserService.userShopDetail(params)
  66. this.shopInfo = res.data
  67. if(this.shopInfo.shopSign === 1){
  68. this.$api.navigateTo('/pages/h5/activity/activity-entry-list')
  69. }else{
  70. this.skeletonShow = false
  71. }
  72. }catch(error){
  73. console.log('获取展台信息异常~')
  74. }
  75. },
  76. handleEntry(){
  77. if(!this.hasLogin){
  78. this.$util.msg('您还未登录,请先登录!', 2000)
  79. setTimeout(() => {
  80. const pages = getCurrentPages()
  81. const page = pages[pages.length - 1]
  82. uni.setStorageSync('LOGIN_REDIRECT_URL', page.$page.fullPath)
  83. this.$api.navigateTo('/pages/login/login')
  84. }, 2000)
  85. return
  86. }
  87. this.userTicketSign(this.params)
  88. },
  89. // 签到打卡
  90. async userTicketSign(params){
  91. try{
  92. await this.UserService.userTicketSign(params)
  93. this.$util.msg('打卡成功', 2000, true, 'success')
  94. this.params.idCard = ''
  95. setTimeout(()=>{
  96. this.$api.navigateTo('/pages/h5/activity/activity-entry-list')
  97. },2000)
  98. }catch(error){
  99. this.$util.msg(error.msg,2000)
  100. }
  101. }
  102. },
  103. onShow() {
  104. }
  105. }
  106. </script>
  107. <style lang="scss">
  108. page{
  109. background-color: #3d68eb;
  110. height: auto !important;
  111. }
  112. .container-banner{
  113. width: 100%;
  114. height: 1142rpx;
  115. background: url(https://admin.caimei365.com/userfiles/1/images/photo/2024/08/ziluo_bg.jpg) no-repeat;
  116. background-size: contain;
  117. box-sizing: border-box;
  118. padding: 0 100rpx;
  119. .login-title{
  120. font-size: $font-size-44;
  121. line-height: 88rpx;
  122. color: #ffffff;
  123. text-align: center;
  124. }
  125. .login-input{
  126. width: 100%;
  127. height: auto;
  128. padding:0 24rpx;
  129. margin: 0 auto;
  130. margin-bottom: 30rpx;
  131. box-sizing: border-box;
  132. border-radius: 50rpx;
  133. display: flex;
  134. flex-direction: column;
  135. justify-content: center;
  136. align-items: center;
  137. .login-logo{
  138. width: 200rpx;
  139. height: 200rpx;
  140. display: block;
  141. border-radius: 50%;
  142. border: 1px solid #e10078;
  143. }
  144. }
  145. .login-btn {
  146. width: 300rpx;
  147. height: 88rpx;
  148. font-size: $font-size-28;
  149. line-height: 88rpx;
  150. color: #ffffff;
  151. margin: 0 auto;
  152. margin-bottom: 24rpx;
  153. text-align: center;
  154. background-color: #e10078;
  155. border-radius: 50rpx;
  156. margin-top: 120rpx;
  157. }
  158. .login-text{
  159. font-size: $font-size-26;
  160. line-height: 48rpx;
  161. color: #ffffff;
  162. margin-top: 200rpx;
  163. }
  164. }
  165. </style>