share-login.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="container login">
  3. <view class="login-main">
  4. <image class="logo" src="https://static.caimei365.com/app/img/icon/login-logo@3x.png" mode=""></image>
  5. <text class="logo-text">生美/医美采购服务平台</text>
  6. </view>
  7. <view class="login-input">
  8. <input type="number"
  9. v-model="shareCode"
  10. maxlength="6"
  11. class="input"
  12. placeholder="请输入邀请码"
  13. />
  14. </view>
  15. <view class="login-btn" @click.stop="goLogin">查看订单</view>
  16. </view>
  17. </template>
  18. <script>
  19. import authorize from '@/common/config/authorize.js'
  20. export default{
  21. data() {
  22. return{
  23. imagePath:'https://img.caimei365.com/group1/M00/03/83/Cmis214FbbCAQhKoAAKWfqqSIds292.png',
  24. shareCode:'', //获取用户登录的邀请码
  25. isUserInfo:false, //控制显示授权弹窗
  26. nickName:'', //存储用户名
  27. userInfo:'', //存储微信用户授权信息
  28. shopOrderId:0, //订单ID
  29. userID:0 ,//分享人的用户ID
  30. isShareStatus:false,
  31. serviceProviderId:''
  32. }
  33. },
  34. onLoad(option) {
  35. this.shopOrderId = option.shopOrderId
  36. console.log(this.shopOrderId)
  37. },
  38. methods:{
  39. goLogin() {
  40. if(this.shareCode == ''){
  41. this.$util.msg('请联系分享人获取分享码',2000);
  42. return
  43. }
  44. if(!this.$api.isNumber(this.shareCode)){
  45. this.$util.msg('分享码格式不正确',2000);
  46. return
  47. }
  48. authorize.getCode('weixin').then(wechatcode =>{
  49. authorize.getUserInfo('weixin').then(wxResponse =>{
  50. let params ={
  51. code:wechatcode,
  52. encryptedData:wxResponse.encryptedData,
  53. iv:wxResponse.iv,
  54. shopOrderId:this.shopOrderId,
  55. source:3,
  56. shareCode:this.shareCode
  57. }
  58. this.ShopService.MiniShipments(params).then(res =>{
  59. if(res.data.resultCode ==3){
  60. console.log('供应商发货人员');
  61. this.$api.navigateTo(`/supplier/pages/order/order-details?shopOrderId=${this.shopOrderId}`)
  62. }
  63. }).catch(error =>{
  64. this.$util.msg(error.msg,2000);
  65. })
  66. })
  67. })
  68. },
  69. },
  70. onShow() {
  71. }
  72. }
  73. </script>
  74. <style lang="scss">
  75. .login{
  76. width: 100%;
  77. height:100%;
  78. background: #FFFFFF;
  79. .model-warp.none{
  80. display: none;
  81. }
  82. .model-warp.show{
  83. display: block;
  84. }
  85. .login-main{
  86. width: 100%;
  87. display: flex;
  88. flex-direction: column;
  89. align-items: center;
  90. height: 198rpx;
  91. padding: 170rpx 0 90rpx 0;
  92. .logo{
  93. width: 138rpx;
  94. height: 118rpx;
  95. display: block;
  96. }
  97. .logo-text{
  98. font-size: 40rpx;
  99. line-height: 44rpx;
  100. color: $color-system;
  101. font-weight: 600;
  102. margin-top: 20rpx;
  103. }
  104. }
  105. .login-input{
  106. width: 654rpx;
  107. height: 40rpx;
  108. padding: 24rpx;
  109. margin: 0 auto;
  110. margin-bottom: 24rpx;
  111. background: #F7F7F7;
  112. border-radius: 14rpx;
  113. .input{
  114. width: 100%;
  115. height: 100%;
  116. background: #F7F7F7;
  117. font-size: $font-size-28;
  118. line-height: 40rpx;
  119. color: #333333;
  120. border-radius: 14rpx;
  121. }
  122. }
  123. .login-row{
  124. padding: 0 24rpx;
  125. font-size: $font-size-28;
  126. line-height: 40rpx;
  127. color: #E15616;
  128. margin-bottom: 48rpx;
  129. }
  130. .login-btn{
  131. width: 702rpx;
  132. height: 88rpx;
  133. border-radius: 14rpx;
  134. font-size: $font-size-28;
  135. line-height: 88rpx;
  136. color: #FFFFFF;
  137. margin: 0 auto;
  138. text-align: center;
  139. background: $btn-confirm;
  140. margin-top: 48rpx;
  141. }
  142. }
  143. </style>