123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <template>
- <view class="container login">
- <view class="login-main">
- <image class="logo" :src="staticUrl+'icon_share_login@2x.png'" mode=""></image>
- </view>
- <view class="login-input">
- <input type="number"
- v-model="params.shareCode"
- maxlength="4"
- class="input"
- placeholder="请输入分享码"
- />
- </view>
- <view class="login-btn" @click="goLogin">查看订单</view>
- </view>
- </template>
- <script>
- import authorize from '@/common/config/authorize.js'
- export default{
- data() {
- return{
- staticUrl:this.global.staticUrl,
- shareCode:'', // 获取用户登录的邀请码
- isUserInfo:false, // 控制显示授权弹窗
- params:{
- code:'', // 微信code
- iv:'',
- encryptedData:'',
- shareCode:'', // 邀请码
- shopOrderId:0, // 订单ID
- userId:0, // 分享人的用户ID
- },
- isShareStatus:false,
- }
- },
- onLoad(e) {
- console.log(e)
- this.params.shopOrderId = e.orderId
- this.params.userId = e.userId
- this.initGetCode()
- },
- methods:{
- async initGetCode(){
- const getUserInfo = await authorize.getUserInfo('weixin')
- this.params.iv = getUserInfo.iv
- this.params.encryptedData = getUserInfo.encryptedData
- this.params.code = await authorize.getCode('weixin')
- },
- goLogin() {
- if(this.params.shareCode == ''){
- this.$util.msg('请联系分享人获取分享码',2000)
- return
- }
- if(!this.$api.isNumber(this.params.shareCode)){
- this.$util.msg('分享码格式不正确',2000)
- return
- }
- this.OrderService.OrderShareCode(this.params).then(response =>{
- if (response.code === 0) {//游客第一次查看订单详情
- this.$api.redirectTo(`/pages/user/order/order-sharedetails?orderId=${this.params.shopOrderId}&userId=${this.params.userId}`)
- }else{
- this.$util.msg(response.msg,2000)
- }
- })
- },
- },
- onShow() {
-
- }
- }
- </script>
- <style lang="scss">
- .login{
- width: 100%;
- height:100%;
- background: #FFFFFF;
- .model-warp.none{
- display: none;
- }
- .model-warp.show{
- display: block;
- }
- .login-main{
- width: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 128rpx 0;
- .logo{
- width: 460rpx;
- height: 300rpx;
- display: block;
- }
- }
- .login-input{
- width: 600rpx;
- height: 40rpx;
- padding: 24rpx 0;
- margin: 0 auto;
- margin-bottom: 60rpx;
- background: #FFFFFF;
- border-bottom: 1px solid #E1E1E1;
- .input{
- width: 100%;
- height: 100%;
- background: #FFFFFF;
- font-size: $font-size-28;
- line-height: 40rpx;
- color: #333333;
- }
- }
- .login-btn{
- width: 600rpx;
- height: 88rpx;
- font-size: $font-size-28;
- line-height: 88rpx;
- color: #FFFFFF;
- margin: 0 auto;
- margin-top: 100rpx;
- text-align: center;
- background: $btn-confirm;
- border-radius: 44rpx;
- }
- .model-authorization{
- width: 100%;
- height: 100%;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 999;
- .authorization{
- width: 518rpx;
- height: 320rpx;
- position: absolute;
- background: rgba(255,255,255,.7);
- left: 0;
- right: 0;
- bottom: 0;
- top: 0;
- margin: auto;
- .to-btn{
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- margin: auto;
- width: 70%;
- height: 88rpx;
- font-size: $font-size-28;
- line-height: 88rpx;
- color: #FFFFFF;
- text-align: center;
- border-radius: 44rpx;
- }
- }
- }
- }
- </style>
|