猎豆优选小程序

tbAuthorize.vue 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <view>
  3. <!-- <u-modal v-model="show" title="淘宝授权" content="首次淘宝授权, 请复制地址后, 打开浏览器粘贴地址进行授权." :show-cancel-button="true" confirm-text="复制地址" @confirm="confirmEvent" @cancel="cancelEvent"></u-modal> -->
  4. <u-modal v-model="show" title="授权" content="请复制地址后, 打开浏览器粘贴地址进行授权." :show-cancel-button="true" confirm-text="复制地址" @confirm="confirmEvent" @cancel="cancelEvent"></u-modal>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. props: {
  10. tb_show: {
  11. type:Boolean,
  12. default:false
  13. }
  14. },
  15. data() {
  16. return {
  17. show: this.tb_show
  18. }
  19. },
  20. methods: {
  21. // 点击了确认
  22. confirmEvent(){
  23. const token = uni.getStorageSync('token')
  24. let redirect_uri = `https://ld.726p.com/newh5/warrant.html?token=${token}&h5=applet`
  25. redirect_uri = encodeURIComponent(redirect_uri)
  26. this.$copyEvent({text:`https://oauth.taobao.com/authorize?response_type=code&client_id=25234720&redirect_uri=${redirect_uri}&state=3001&view=wap`,cb: () => {
  27. this.$emit('closeTask')
  28. }})
  29. },
  30. // 取消
  31. cancelEvent() {
  32. this.$emit('closeTask')
  33. },
  34. }
  35. }
  36. </script>
  37. <style>
  38. </style>