From 1682ad0f318e8a7c84bfe7761951b1c52aceb3a8 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期三, 21 六月 2023 11:16:54 +0800 Subject: [PATCH] no message --- uniapp/pages/login/setInviteCode.vue | 100 +++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 86 insertions(+), 14 deletions(-) diff --git a/uniapp/pages/login/setInviteCode.vue b/uniapp/pages/login/setInviteCode.vue index 3271537..59e2ca3 100644 --- a/uniapp/pages/login/setInviteCode.vue +++ b/uniapp/pages/login/setInviteCode.vue @@ -4,27 +4,47 @@ 璇疯緭鍏ラ個璇风爜 </view> <view class="grey-input-content rowCen borderBox"> - <input class="iptclas" type="text" v-model="inviteCode" placeholder="璇峰~鍐欓個璇风爜" placeholder-class="pla-input"/> + <input class="iptclas" type="text" v-model="inviteCode" placeholder="璇峰~鍐欓個璇风爜锛�" placeholder-class="pla-input"/> </view> - <view class="model-tips" v-if="appInfo.isOpenOfficialCode==1"> + <view class="model-tips" v-if="appInfo.isOpenOfficialCode==1"> <view>濉啓閭�璇风爜鏈夊姪浜庢偍鐨勮喘鐗╄繑浣e摝锛�</view> </view> - <template v-if="isShowCode"> - <view class="copy-bar rowCenBet borderBox" v-if="appInfo.isOpenOfficialCode==1"> - <view class="left-code"> - {{appInfo.officialInvitationCode}} - </view> - <view class="copybtn rowCenCen" @tap="useCode()"> - <view>浣跨敤閭�璇风爜</view> - </view> - </view> - </template> + <view @click="setCode" class="login-btn rowCenCen" :class="inviteCode?'colorfulbtn':''" > <view class="btn-font" > 纭畾 </view> </view> + + <template v-if="isShowCode"> + <template v-if='commonInvite!=null&&commonInvite.length>0'> + <view class="s_inviter" @click="userInviter()"> + <view class="s_img"> + <image :src="commonInvite[inviteIndex].avatar"></image> + <span>{{commonInvite[inviteIndex].nickname}}</span> + </view> + <view> + <view>浣跨敤Ta鐨勯個璇风爜</view> + </view> + </view> + <view @click="changeInviter()" style="color: #999999; margin-top: 20rpx;"> + 鎹竴涓� + </view> + </template> + <template v-else> + <view class="copy-bar rowCenBet borderBox" style="margin-top: 70rpx;" v-if="appInfo.isOpenOfficialCode==1"> + <view class="left-code"> + {{appInfo.officialInvitationCode}} + </view> + <view class="copybtn rowCenCen" @tap="useCode()"> + <view>浣跨敤閭�璇风爜</view> + </view> + </view> + </template> + + + </template> <view class="yqmtip rowCenCen"> <span @click="showinvite">娌℃湁閭�璇风爜锛�</span> @@ -49,14 +69,47 @@ inviteCode:'', appInfo:'', inviterShow:false, - platform:'' + platform:'', + commonInvite:[], + inviteIndex:0 } + }, + onLoad() + { + this.getInviter(); }, mounted() { this.appInfo = uni.getStorageSync('appInfo'); this.platform = uni.getSystemInfoSync().platform }, methods: { + //鑾峰彇绯荤粺鎺ㄨ崘浜� + getInviter() + { + var that=this; + this.$u.api.getRecomInviter({}).then(e => { + console.log(e) + that.commonInvite=e.data; + }).catch(function (err) { + console.log(err) + }) + }, + changeInviter() + { + console.log(this.commonInvite.length) + if(this.inviteIndex==this.commonInvite.length-1) + { + this.inviteIndex=0; + } + else{ + this.inviteIndex=this.inviteIndex+1; + } + }, + userInviter() + { + this.inviteCode=this.commonInvite[this.inviteIndex].invitation_code; + }, + useCode() { this.inviteCode=this.appInfo.officialInvitationCode; @@ -126,7 +179,6 @@ }) } } - } } </script> @@ -136,6 +188,26 @@ { background: #fff; } + .s_inviter + { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 70rpx; + width:100%; + .s_img + { + display: flex; + align-items: center; + span{ + margin-left: 13rpx; + }; + } + image{ + width:100rpx; + height: 100rpx; + } + } .yqmtip { -- Gitblit v1.9.3