activity-entry.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view class="container cashier">
  3. <custom :navbar-data='nvabarData' />
  4. <view class="container-banner" :style="{ paddingTop:CustomBar + 180 +'px' }">
  5. <view class="login-input">
  6. <input type="text"
  7. v-model="params.ticket"
  8. maxlength="20"
  9. disabled="true"
  10. class="input"
  11. />
  12. </view>
  13. <view class="login-input">
  14. <input type="text"
  15. v-model="params.name"
  16. maxlength="10"
  17. class="input"
  18. placeholder="您的姓名"
  19. />
  20. </view>
  21. <view class="login-input">
  22. <input type="text"
  23. v-model="params.idCard"
  24. maxlength="20"
  25. class="input"
  26. placeholder="证件号码(身份证/港澳台通行证/护照)"
  27. />
  28. </view>
  29. <view class="login-input">
  30. <input type="text"
  31. v-model="params.mobile"
  32. maxlength="11"
  33. class="input"
  34. placeholder="您的联系电话"
  35. />
  36. </view>
  37. <view class="login-input">
  38. <input type="text"
  39. v-model="params.work"
  40. maxlength="15"
  41. class="input"
  42. placeholder="您的职业"
  43. />
  44. </view>
  45. <view class="login-btn" @click="handleEntry">绑定采美账号</view>
  46. <view class="login-text">
  47. 说明:门票绑定的证件号码是作为进入大会会场的凭证。
  48. </view>
  49. </view>
  50. <!-- 提示弹窗 -->
  51. <tui-modal
  52. :show="modal"
  53. @click="handleClick"
  54. :content="contentModalText"
  55. :button="modalButton"
  56. color="#333"
  57. :size="32"
  58. shape="circle"
  59. :maskClosable="false"
  60. />
  61. </view>
  62. </template>
  63. <script>
  64. import { mapState, mapMutations } from 'vuex'
  65. import authorize from '@/common/config/authorize.js'
  66. import wxLogin from '@/common/config/wxLogin.js'
  67. export default{
  68. data(){
  69. return{
  70. nvabarData: { //顶部自定义导航
  71. haveBack:false,
  72. haveHome:true,
  73. showCapsule:1, // 是否显示左上角图标 1表示显示 0表示不显示,
  74. showSearch: 0,
  75. title: '', // 导航栏 中间的标题
  76. textLeft:this.$store.state.isIphone
  77. },
  78. isIphoneX:this.$store.state.isIphoneX,
  79. CustomBar:this.CustomBar,// 顶部导航栏高度
  80. params:{
  81. name:'',
  82. idCard:'',
  83. ticket:'',
  84. mobile:'',
  85. work:'',
  86. userId:''
  87. },
  88. modal: false,
  89. contentModalText: '', //操作文字提示语句
  90. modalButton: [
  91. {
  92. text: '取消',
  93. type: 'gray',
  94. plain: true //是否空心
  95. },
  96. {
  97. text: '确认绑定',
  98. customStyle: {
  99. color: '#fff',
  100. bgColor: '#e10078'
  101. },
  102. plain: false
  103. }
  104. ]
  105. }
  106. },
  107. onLoad(option) {
  108. wxLogin.wxLoginAuthorize()
  109. this.params.ticket = option.ticket
  110. setTimeout(()=>{
  111. this.initData(option)
  112. },2000)
  113. },
  114. computed: {
  115. ...mapState(['hasLogin', 'userInfo', ])
  116. },
  117. methods:{
  118. // 初始化
  119. async initData(option) {
  120. const userInfo = await this.$api.getStorage()
  121. this.params.userId = userInfo.userId
  122. this.contentModalText = `您的采美机构账号为【${userInfo.name}】,确认绑定吗?`
  123. },
  124. //确认操作
  125. handleClick(e) {
  126. if (e.index == 1) {
  127. this.userTicketBind(this.params)
  128. }
  129. this.modal = false
  130. },
  131. //点击绑定
  132. handleEntry(){
  133. if(!this.hasLogin){
  134. this.$util.msg('您还未登录采美机构账号,请先登录!', 2000)
  135. setTimeout(() => {
  136. const pages = getCurrentPages()
  137. const page = pages[pages.length - 1]
  138. uni.setStorageSync('LOGIN_REDIRECT_URL', page.$page.fullPath)
  139. this.$api.navigateTo('/pages/login/login')
  140. }, 2000)
  141. return
  142. }
  143. if(!this.params.name){
  144. this.$util.msg('请输入您的姓名~', 2000)
  145. return
  146. }
  147. if(!this.params.idCard){
  148. this.$util.msg('请输入您的证件号码~', 2000)
  149. return
  150. }
  151. if(!this.params.mobile){
  152. this.$util.msg('请输入您的联系电话~', 2000)
  153. return
  154. }
  155. if(!this.params.work){
  156. this.$util.msg('请输入您的职业~', 2000)
  157. return
  158. }
  159. this.modal = true
  160. },
  161. // 绑定门票
  162. async userTicketBind(params){
  163. try{
  164. await this.UserService.userTicketBind(params)
  165. this.$util.msg('绑定成功', 2000, true, 'success')
  166. this.params.idCard = ''
  167. setTimeout(()=>{
  168. this.$api.switchTabTo('/pages/tabBar/home/index')
  169. },2000)
  170. }catch(error){
  171. this.$util.msg(error.msg,2000)
  172. }
  173. }
  174. },
  175. onShow() {
  176. }
  177. }
  178. </script>
  179. <style lang="scss">
  180. page{
  181. background-color: #3d68eb;
  182. height: auto !important;
  183. }
  184. .container-banner{
  185. width: 100%;
  186. height: 1142rpx;
  187. background: url(https://admin.caimei365.com/userfiles/1/images/photo/2024/08/ziluo_bg.jpg) no-repeat;
  188. background-size: contain;
  189. box-sizing: border-box;
  190. padding: 0 110rpx;
  191. .login-title{
  192. font-size: $font-size-28;
  193. line-height: 58rpx;
  194. color: #ffffff;
  195. }
  196. .login-input{
  197. width: 100%;
  198. height: 88rpx;
  199. padding:0 24rpx;
  200. margin: 0 auto;
  201. margin-bottom: 40rpx;
  202. background: #FFFFFF;
  203. box-sizing: border-box;
  204. border-radius: 50rpx;
  205. .input{
  206. width: 100%;
  207. height: 100%;
  208. background: #FFFFFF;
  209. font-size: $font-size-28;
  210. line-height: 88rpx;
  211. color: #333333;
  212. border-radius: 50rpx;
  213. }
  214. }
  215. .login-btn {
  216. width: 100%;
  217. height: 88rpx;
  218. font-size: $font-size-28;
  219. line-height: 88rpx;
  220. color: #ffffff;
  221. margin: 0 auto;
  222. text-align: center;
  223. background-color: #e10078;
  224. border-radius: 50rpx;
  225. }
  226. .login-text{
  227. font-size: $font-size-26;
  228. line-height: 48rpx;
  229. color: #ffffff;
  230. margin-top: 50rpx;
  231. }
  232. }
  233. </style>