|
@@ -46,10 +46,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- // 用户信息
|
|
|
- userInfo: {},
|
|
|
- // 状态栏高度
|
|
|
- statusBarHeight: 20,
|
|
|
+ // 状态栏
|
|
|
+ statusBarHeight: getApp().globalData.statusBarHeight,
|
|
|
// 转盘
|
|
|
prizes: [],
|
|
|
buttons: [{
|
|
@@ -80,25 +78,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
- // 获取App方法
|
|
|
- getUserInfo.postMessage('获取用户信息')
|
|
|
- getDeviceInfo.postMessage('获取设备信息')
|
|
|
-
|
|
|
- // 暴露setUserInfo方法给APP
|
|
|
- window['setUserInfo'] = res => {
|
|
|
- console.log(res);
|
|
|
- this.userInfo = res
|
|
|
- this.setUserInfo()
|
|
|
- }
|
|
|
- window['setDeviceInfo'] = res => {
|
|
|
- this.statusBarHeight = JSON.parse(res).statusHeight
|
|
|
- }
|
|
|
+ this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取页面信息
|
|
|
- setUserInfo() {
|
|
|
+ getList() {
|
|
|
this.prizes = []
|
|
|
- page(JSON.parse(this.userInfo)).then(res => {
|
|
|
+ page(getApp().globalData.userInfo).then(res => {
|
|
|
if (res.data.code === 0) {
|
|
|
const j = res.data.data
|
|
|
// 可用积分
|
|
@@ -141,7 +127,7 @@ export default {
|
|
|
if (this.disabled) {
|
|
|
this.$refs.lucky.play()
|
|
|
this.disabled = false
|
|
|
- result(JSON.parse(this.userInfo)).then(res => {
|
|
|
+ result(getApp().globalData.userInfo).then(res => {
|
|
|
if (res.data.code === 0) {
|
|
|
setTimeout(() => {
|
|
|
this.$refs.lucky.stop(res.data.data.resultGoodSort - 1)
|
|
@@ -174,7 +160,7 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.popup.open()
|
|
|
this.disabled = true
|
|
|
- this.setUserInfo()
|
|
|
+ this.getList()
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -188,7 +174,7 @@ export default {
|
|
|
getSubmit() {
|
|
|
if (this.disabled) {
|
|
|
this.disabled = false
|
|
|
- receive(JSON.parse(this.userInfo), {
|
|
|
+ receive(getApp().globalData.userInfo, {
|
|
|
prizeId: this.form.resultGoodId,
|
|
|
lotteryCode: this.form.lotteryCode
|
|
|
}).then(res => {
|
|
@@ -208,7 +194,7 @@ export default {
|
|
|
// 填写收货信息
|
|
|
getDetail() {
|
|
|
uni.navigateTo({
|
|
|
- url: `/pages/lottery/detail?userInfo=${this.userInfo}&prizeId=${this.form.resultGoodId}&lotteryCode=${this.form.lotteryCode}`
|
|
|
+ url: `/pages/lottery/detail?prizeId=${this.form.resultGoodId}&lotteryCode=${this.form.lotteryCode}`
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -223,6 +209,7 @@ export default {
|
|
|
background-repeat: no-repeat;
|
|
|
width: 100%;
|
|
|
height: 1880rpx;
|
|
|
+ padding: 0 20rpx 20rpx 20rpx;
|
|
|
|
|
|
.nav {
|
|
|
height: 88rpx;
|