Commit df2b8338 authored by 罗超's avatar 罗超

2

parent a0d96920
......@@ -76,8 +76,8 @@
<u-popup v-model="isShowQrcode" mode="center" @close="closeQrcode">
<view class="qrcodeBox">
<Qrcode ref="qrcode" :modal="modal_qr" :url="qrData" @hideQrcode="hideQrcode"
themeColor="#000000" is_themeImg :themeImg="headImg" />
<Qrcode ref="qrcode" :modal="modal_qr" :url="qrData" @hideQrcode="hideQrcode" themeColor="#000000"
is_themeImg :themeImg="headImg" />
</view>
</u-popup>
<u-popup v-model="isShowSuccess" :maskCloseAble="false" mode="center" @close="closePopup">
......@@ -97,14 +97,17 @@
</view>
</view>
</u-popup>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view>
</template>
<script>
import Qrcode from "./qrcode/ay-qrcode.vue"
import auth from "@/components/auth/index.vue";
export default {
components: {
Qrcode,
auth
},
data() {
return {
......@@ -116,15 +119,19 @@
isShowQrcode: false,
headImg: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup.png",
pageData: {
GiveAwayList:[]
GiveAwayList: []
},
isShowSuccess: false,
timer: null,
flag:false,//是否继续请求扫码结果
flag: false, //是否继续请求扫码结果
showAuth: false,
}
},
onLoad() {
if (!uni.getStorageSync("mall_UserInfo")) {
this.showAuth = true;
}
this.statusNavBar = uni.getSystemInfoSync().statusBarHeight
let userInfo = uni.getStorageSync('mall_UserInfo')
if (userInfo.Photo) {
......@@ -133,15 +140,15 @@
this.UserId = userInfo.UserId
this.getData()
},
onHide(){
this.flag=false
onHide() {
this.flag = false
},
methods: {
getGive(){
let res={}
for(let i=0; i<this.pageData.GiveAwayList.length;i++){
if(this.pageData.GiveAwayList[i].GiveAwayNum>0){
res=this.pageData.GiveAwayList[i]
getGive() {
let res = {}
for (let i = 0; i < this.pageData.GiveAwayList.length; i++) {
if (this.pageData.GiveAwayList[i].GiveAwayNum > 0) {
res = this.pageData.GiveAwayList[i]
break
}
}
......@@ -156,7 +163,7 @@
this.showQrcode() //生成二维码
this.isShowQrcode = true
setTimeout(() => {
this.flag=true
this.flag = true
this.getVerificat()
}, 2000)
},
......@@ -166,7 +173,7 @@
// 展示二维码
showQrcode() {
let _this = this;
setTimeout(async ()=> {
setTimeout(async () => {
this.modal_qr = true;
await _this.$refs.qrcode.crtQrCode()
}, 50)
......@@ -203,7 +210,7 @@
this.isShowSuccess = true
this.getData()
clearTimeout(this.timer)
} else if (res.data.State === 2&&this.flag) {
} else if (res.data.State === 2 && this.flag) {
this.timer = setTimeout(() => {
this.getVerificat()
}, 2000)
......@@ -214,11 +221,19 @@
closePopup() {
this.isShowSuccess = false
},
closeQrcode(){
this.modal_qr=false
this.flag=false
closeQrcode() {
this.modal_qr = false
this.flag = false
clearTimeout(this.timer)
}
},
reloadUserinfo() {
this.getData()
},
//关闭登录窗口
gbAuth() {
this.showAuth = false;
uni.navigateBack()
},
}
}
</script>
......@@ -453,17 +468,18 @@
display: flex;
justify-content: center;
}
.qrcodeBox{
.qrcodeBox {
width: 220px;
height: 220px;
border:1px solid #000000;
border: 1px solid #000000;
border-radius: 10px;
padding: 10px;
background-color: #fff;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
transform: translate(-50%, -50%);
z-index: 5;
}
</style>
\ No newline at end of file
......@@ -48,7 +48,7 @@
<u-icon name="arrow-left" size="44"></u-icon>
</view>
</view>
<view @click='yj' style="width: 200px;height: 50px;">活动</view>
<!-- <view @click='yj' style="width: 200px;height: 50px;">活动</view> -->
<u-tabs
v-if="myPageData.home_pages && myPageData.home_pages.navs.length > 1"
name="name"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment