Commit df2b8338 authored by 罗超's avatar 罗超

2

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