activity-sign.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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.shopName }}</view>
  11. <view class="login-btn" @click="handleEntry">签到打卡</view>
  12. <view class="login-text">
  13. 注:绑定采美机构后,可在采美指定展台签到打卡,所有指定展台打卡完成后可领取一份采美为您准备的精美礼包。
  14. </view>
  15. </view>
  16. </template>
  17. </view>
  18. </template>
  19. <script>
  20. import { mapState, mapMutations } from 'vuex'
  21. import authorize from '@/common/config/authorize.js'
  22. import wxLogin from '@/common/config/wxLogin.js'
  23. export default{
  24. data(){
  25. return{
  26. nvabarData: { //顶部自定义导航
  27. haveBack:false,
  28. haveHome:true,
  29. showCapsule:1, // 是否显示左上角图标 1表示显示 0表示不显示,
  30. showSearch: 0,
  31. title: '', // 导航栏 中间的标题
  32. textLeft:this.$store.state.isIphone
  33. },
  34. isIphoneX:this.$store.state.isIphoneX,
  35. CustomBar:this.CustomBar,// 顶部导航栏高度
  36. skeletonShow:true,
  37. params:{
  38. userId:'',
  39. shopId:''
  40. },
  41. shopInfo:{}
  42. }
  43. },
  44. onLoad(option) {
  45. wxLogin.wxLoginAuthorize()
  46. setTimeout(()=>{
  47. this.initData(option)
  48. },2000)
  49. },
  50. computed: {
  51. ...mapState(['hasLogin', 'userInfo', ])
  52. },
  53. methods:{
  54. // 初始化
  55. async initData(option) {
  56. const userInfo = await this.$api.getStorage()
  57. this.params.shopId = option.id
  58. this.params.userId = userInfo.userId
  59. this.userShopDetail(this.params)
  60. },
  61. // 获取展台信息
  62. async userShopDetail(params){
  63. try{
  64. const res = await this.UserService.userShopDetail(params)
  65. this.shopInfo = res.data
  66. if(this.shopInfo.shopSign === 1){
  67. this.$api.navigateTo('/pages/h5/activity/activity-entry-list')
  68. }else{
  69. this.skeletonShow = false
  70. }
  71. }catch(error){
  72. console.log('获取展台信息异常~')
  73. }
  74. },
  75. handleEntry(){
  76. if(!this.hasLogin){
  77. this.$util.msg('您还未登录采美机构账号,请先登录!', 2000)
  78. setTimeout(() => {
  79. const pages = getCurrentPages()
  80. const page = pages[pages.length - 1]
  81. uni.setStorageSync('LOGIN_REDIRECT_URL', page.$page.fullPath)
  82. this.$api.navigateTo('/pages/login/login')
  83. }, 2000)
  84. return
  85. }
  86. this.userTicketSign(this.params)
  87. },
  88. // 签到打卡
  89. async userTicketSign(params){
  90. try{
  91. await this.UserService.userTicketSign(params)
  92. this.$util.msg('打卡成功', 2000, true, 'success')
  93. this.params.idCard = ''
  94. setTimeout(()=>{
  95. this.$api.navigateTo('/pages/h5/activity/activity-entry-list')
  96. },2000)
  97. }catch(error){
  98. this.$util.msg(error.msg,2000)
  99. }
  100. }
  101. },
  102. onShow() {
  103. }
  104. }
  105. </script>
  106. <style lang="scss">
  107. page{
  108. background-color: #3d68eb;
  109. height: auto !important;
  110. }
  111. .container-banner{
  112. width: 100%;
  113. height: 1142rpx;
  114. background: url(https://admin.caimei365.com/userfiles/1/images/photo/2024/08/ziluo_bg.jpg) no-repeat;
  115. background-size: contain;
  116. box-sizing: border-box;
  117. padding: 0 100rpx;
  118. .login-title{
  119. font-size: $font-size-44;
  120. line-height: 88rpx;
  121. color: #ffffff;
  122. text-align: center;
  123. margin-bottom: 120rpx;
  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. }
  157. .login-text{
  158. font-size: $font-size-26;
  159. line-height: 48rpx;
  160. color: #ffffff;
  161. margin-top: 200rpx;
  162. }
  163. }
  164. </style>