share-info.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="container share" v-if="isRequest">
  3. <view class="share-empty">
  4. <view class="icon"><image :src="imagePath" mode="widthFix"></image></view>
  5. <view class="text">暂无权限查看</view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import { mapState,mapMutations } from 'vuex'
  11. import authorize from '@/common/config/authorize.js'
  12. export default{
  13. data() {
  14. return{
  15. isRequest:false,
  16. invitationCode:'',
  17. imagePath:'https://static.caimei365.com/app/img/icon/icon-noremb.png',
  18. serviceProviderId:'',
  19. shopOrderId:null,
  20. source:1,
  21. shareCode:'',
  22. authority:'',//用户权限
  23. }
  24. },
  25. computed: {
  26. ...mapState(['isWxAuthorize'])
  27. },
  28. onLoad(option) {
  29. // scene 需要使用 decodeURIComponent 才能获取到生成二维码时传入的 scene
  30. console.log(option);
  31. if(option.scene){
  32. this.shopOrderId = Number(decodeURIComponent(option.scene))
  33. }else{
  34. this.shopOrderId = option.shopOrderId
  35. this.authority = option.authority
  36. if(this.authority == '2'){
  37. this.source = 2
  38. }else if(this.authority == '3'){
  39. this.source = 3
  40. }
  41. }
  42. this.infoMiniShipments();
  43. },
  44. methods:{
  45. infoMiniShipments(){
  46. authorize.getCode('weixin').then(wechatcode =>{
  47. authorize.getUserInfo('weixin').then(wxResponse =>{
  48. let params = {
  49. code:wechatcode,
  50. encryptedData:wxResponse.encryptedData,
  51. iv:wxResponse.iv,
  52. shopOrderId:this.shopOrderId,
  53. source:this.source,
  54. shareCode:this.shareCode
  55. }
  56. this.ShopService.MiniShipments(params).then(res =>{
  57. switch(res.data.resultCode){
  58. case 1:
  59. this.shopOrderId = res.data.shopOrderId;
  60. this.$api.navigateTo(`/supplier/pages/order/order-service-details?shopOrderId=${this.shopOrderId}`)
  61. break;
  62. case 2:
  63. console.log('供应商联系人');
  64. this.$api.navigateTo(`/supplier/pages/order/order-details?shopOrderId=${this.shopOrderId}`)
  65. break;
  66. case 3:
  67. console.log('供应商发货人员');
  68. this.$api.navigateTo(`/supplier/pages/order/order-details?shopOrderId=${this.shopOrderId}`)
  69. break;
  70. }
  71. }).catch(err =>{
  72. if(this.source == 2){
  73. this.$api.setStorage('bind_supplierInfo', err.data)
  74. this.$api.navigateTo(`/supplier/pages/login/bind-operator?shopOrderId=${this.shopOrderId}`)
  75. }else if(this.source == 3){
  76. this.$api.navigateTo(`/supplier/pages/login/share-login?shopOrderId=${this.shopOrderId}`)
  77. }else{
  78. this.isRequest = true;
  79. }
  80. })
  81. })
  82. })
  83. }
  84. },
  85. onShow() {
  86. this.isRequest = false;
  87. this.infoMiniShipments();
  88. }
  89. }
  90. </script>
  91. <style lang="scss">
  92. .share{
  93. width: 100%;
  94. height:100%;
  95. background: #FFFFFF;
  96. display: flex;
  97. align-items: center;
  98. justify-content:center;
  99. .share-empty{
  100. width: 352rpx;
  101. height: 412rpx;
  102. .icon{
  103. width: 352rpx;
  104. height: 352rpx;
  105. image{
  106. width: 100%;
  107. height: 100%;
  108. display: block;
  109. }
  110. }
  111. .text{
  112. font-size: $font-size-28;
  113. line-height: 60rpx;
  114. color: $text-color;
  115. text-align: center;
  116. }
  117. }
  118. }
  119. </style>