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

70 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. console.log('============',event);
  36. // let userInfo = uni.getStorageSync('userinfo') || {};
  37. this.$http(this.API.API_WECHAT_SETPHONE, {
  38. encryptedData,
  39. iv,
  40. // token: userInfo.token // 已在公共参数传
  41. }).then(res => {
  42. this.$msg('更新成功', {icon: 'success'});
  43. uni.setStorageSync('userinfo', res.data);
  44. let str = decodeURIComponent(this.loadOptions);
  45. this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => {
  46. this.$msg('核销成功!');
  47. });
  48. })
  49. }
  50. }else {
  51. let str = decodeURIComponent(this.loadOptions);
  52. this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => {
  53. this.$msg('核销成功!');
  54. });
  55. }
  56. },
  57. }
  58. }
  59. </script>
  60. <style scoped>
  61. .cu-btn {
  62. width: 260rpx;
  63. height: 260rpx;
  64. border-radius: 50%;
  65. background-color: #1998FE;
  66. color: white;
  67. }
  68. </style>