share-login.vue 3.3 KB

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