海南旅游项目 前端仓库
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.

88 lines
2.3 KiB

  1. <template>
  2. <view class="lf-p-40 lf-w-100 lf-h-100 lf-row-center" style="height: 1200rpx;">
  3. <!-- <view class="lf-row-center lf-font-28">确认核销权限...</view> -->
  4. <button class="lf-m-t-30 cu-btn" v-if="haveVerfiy==false" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
  5. <text class="lf-font-32">确认核销</text>
  6. </button>
  7. <button class="lf-m-t-30 cu-btn1" v-else>
  8. <text class="lf-font-32">核销完成</text>
  9. </button>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. data() {
  15. return {
  16. userInfo: '',
  17. loadOptions: '',
  18. haveVerfiy: false
  19. }
  20. },
  21. onLoad(options) {
  22. this.userInfo = uni.getStorageSync('userinfo')
  23. this.loadOptions = options.scene
  24. // if (options.scene) {
  25. // // 单个参数
  26. // let str = decodeURIComponent(options.scene);
  27. // this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => {
  28. // this.$msg('核销成功!');
  29. // });
  30. // }
  31. },
  32. methods: {
  33. // 微信快捷登录获取手机号
  34. getPhoneNumber(event){
  35. if(this.userInfo.mobile == '') {
  36. if(event.detail.errMsg == 'getPhoneNumber:ok'){
  37. let encryptedData = event.detail.encryptedData;
  38. let iv = event.detail.iv;
  39. this.$http(this.API.API_WECHAT_SETPHONE, {
  40. encryptedData,
  41. iv,
  42. // token: userInfo.token // 已在公共参数传
  43. }).then(res => {
  44. this.$msg('更新成功', {icon: 'success'});
  45. uni.setStorageSync('userinfo', res.data);
  46. let str = decodeURIComponent(this.loadOptions);
  47. this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => {
  48. this.$msg('核销成功!');
  49. this.haveVerfiy = true
  50. });
  51. })
  52. }
  53. }else {
  54. let str = decodeURIComponent(this.loadOptions);
  55. this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => {
  56. this.haveVerfiy = true
  57. this.$msg('核销成功!');
  58. });
  59. }
  60. },
  61. }
  62. }
  63. </script>
  64. <style scoped>
  65. .cu-btn {
  66. width: 260rpx;
  67. height: 260rpx;
  68. border-radius: 50%;
  69. background-color: #1998FE;
  70. color: white;
  71. display: flex;
  72. justify-content: center;
  73. align-items: center;
  74. }
  75. .cu-btn1 {
  76. width: 260rpx;
  77. height: 260rpx;
  78. border-radius: 50%;
  79. background-color: #777;
  80. color: white;
  81. display: flex;
  82. justify-content: center;
  83. align-items: center;
  84. }
  85. </style>