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

69 lines
1.9 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="cu-btn lf-m-t-30" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
  5. <text class="lf-font-32">确认核销</text>
  6. </button>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. data() {
  12. return {
  13. userInfo: '',
  14. loadOptions: ''
  15. }
  16. },
  17. onLoad(options) {
  18. this.userInfo = uni.getStorageSync('userinfo')
  19. this.loadOptions = options.scene
  20. // if (options.scene) {
  21. // // 单个参数
  22. // let str = decodeURIComponent(options.scene);
  23. // this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => {
  24. // this.$msg('核销成功!');
  25. // });
  26. // }
  27. },
  28. methods: {
  29. // 微信快捷登录获取手机号
  30. getPhoneNumber(event){
  31. if(this.userInfo.mobile == '') {
  32. if(event.detail.errMsg == 'getPhoneNumber:ok'){
  33. let encryptedData = event.detail.encryptedData;
  34. let iv = event.detail.iv;
  35. // let userInfo = uni.getStorageSync('userinfo') || {};
  36. this.$http(this.API.API_WECHAT_SETPHONE, {
  37. encryptedData,
  38. iv,
  39. // token: userInfo.token // 已在公共参数传
  40. }).then(res => {
  41. this.$msg('更新成功', {icon: 'success'});
  42. uni.setStorageSync('userinfo', res.data);
  43. let str = decodeURIComponent(this.loadOptions);
  44. this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => {
  45. this.$msg('核销成功!');
  46. });
  47. })
  48. }
  49. }else {
  50. let str = decodeURIComponent(this.loadOptions);
  51. this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => {
  52. this.$msg('核销成功!');
  53. });
  54. }
  55. },
  56. }
  57. }
  58. </script>
  59. <style scoped>
  60. .cu-btn {
  61. width: 260rpx;
  62. height: 260rpx;
  63. border-radius: 50%;
  64. background-color: #1998FE;
  65. color: white;
  66. }
  67. </style>