orderShareLogin.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="container login">
  3. <view class="login-main">
  4. <image class="logo" :src="imagePath" mode=""></image>
  5. </view>
  6. <view class="login-input">
  7. <input type="number"
  8. v-model="shareCode"
  9. maxlength="4"
  10. class="input"
  11. placeholder="请输入分享码"
  12. />
  13. </view>
  14. <view class="login-btn" @click="goLogin">查看订单</view>
  15. </view>
  16. </template>
  17. <script>
  18. import authorize from '@/common/config/authorize.js'
  19. export default{
  20. data() {
  21. return{
  22. imagePath:'https://img.caimei365.com/group1/M00/03/83/Cmis214FbbCAQhKoAAKWfqqSIds292.png',
  23. shareCode:'', //获取用户登录的邀请码
  24. isUserInfo:false, //控制显示授权弹窗
  25. nickName:'', //存储用户名
  26. userInfo:'', //存储微信用户授权信息
  27. orderID:0, //订单ID
  28. userID:0 ,//分享人的用户ID
  29. isShareStatus:false,
  30. }
  31. },
  32. onLoad(e) {
  33. console.log(e)
  34. this.orderID = e.orderID
  35. this.userID = e.userID
  36. },
  37. methods:{
  38. goLogin() {
  39. if(this.shareCode == ''){
  40. this.$util.msg('请联系分享人获取分享码',2000);
  41. return
  42. }
  43. if(!this.$api.isNumber(this.shareCode)){
  44. this.$util.msg('分享码格式不正确',2000);
  45. return
  46. }
  47. authorize.getCode('weixin').then(wechatcode =>{
  48. let params ={
  49. code:wechatcode,
  50. orderID:this.orderID,
  51. userID:this.userID,
  52. shareCode:this.shareCode
  53. }
  54. this.OrderService.OrderShareCode(params).then(response =>{
  55. if (response.code === 0) {//游客第一次查看订单详情
  56. this.$api.redirectTo(`/pages/user/order/order-sharedetails?orderID=${this.orderID}&userId=${this.userID}`)
  57. }else{
  58. this.$util.msg(response.msg,2000);
  59. }
  60. })
  61. })
  62. },
  63. },
  64. onShow() {
  65. }
  66. }
  67. </script>
  68. <style lang="scss">
  69. .login{
  70. width: 100%;
  71. height:100%;
  72. background: #FFFFFF;
  73. .model-warp.none{
  74. display: none;
  75. }
  76. .model-warp.show{
  77. display: block;
  78. }
  79. .login-main{
  80. width: 100%;
  81. display: flex;
  82. flex-direction: column;
  83. align-items: center;
  84. padding: 128rpx 0;
  85. .logo{
  86. width: 658rpx;
  87. height: 354rpx;
  88. display: block;
  89. }
  90. }
  91. .login-input{
  92. width: 600rpx;
  93. height: 40rpx;
  94. padding: 24rpx 0;
  95. margin: 0 auto;
  96. margin-bottom: 60rpx;
  97. background: #FFFFFF;
  98. border-bottom: 1px solid #E1E1E1;
  99. .input{
  100. width: 100%;
  101. height: 100%;
  102. background: #FFFFFF;
  103. font-size: $font-size-28;
  104. line-height: 40rpx;
  105. color: #333333;
  106. }
  107. }
  108. .login-btn{
  109. width: 600rpx;
  110. height: 88rpx;
  111. font-size: $font-size-28;
  112. line-height: 88rpx;
  113. color: #FFFFFF;
  114. margin: 0 auto;
  115. margin-top: 100rpx;
  116. text-align: center;
  117. background: $btn-confirm;
  118. border-radius: 44rpx;
  119. }
  120. .model-authorization{
  121. width: 100%;
  122. height: 100%;
  123. position: fixed;
  124. top: 0;
  125. left: 0;
  126. z-index: 999;
  127. .authorization{
  128. width: 518rpx;
  129. height: 320rpx;
  130. position: absolute;
  131. background: rgba(255,255,255,.7);
  132. left: 0;
  133. right: 0;
  134. bottom: 0;
  135. top: 0;
  136. margin: auto;
  137. .to-btn{
  138. position: absolute;
  139. top: 0;
  140. left: 0;
  141. right: 0;
  142. bottom: 0;
  143. margin: auto;
  144. width: 70%;
  145. height: 88rpx;
  146. font-size: $font-size-28;
  147. line-height: 88rpx;
  148. color: #FFFFFF;
  149. text-align: center;
  150. border-radius: 44rpx;
  151. }
  152. }
  153. }
  154. }
  155. </style>