|
@@ -38,11 +38,11 @@
|
|
|
<view class="currency-display" >
|
|
|
<view class="currency-item">
|
|
|
<image src="/static/island/UI/wd_icon_coin.png" mode="widthFix" class="currency-icon"></image>
|
|
|
- <text class="currency-value">9999</text>
|
|
|
+ <text class="currency-value">{{userInfo.num_gmd}}</text>
|
|
|
</view>
|
|
|
<view class="currency-item">
|
|
|
<image src="/static/island/UI/wd_icon_xingyuan.png" mode="widthFix" class="currency-icon"></image>
|
|
|
- <text class="currency-value">9999</text>
|
|
|
+ <text class="currency-value">{{userInfo.num_gmg}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="ui-buttons">
|
|
@@ -151,6 +151,11 @@ export default {
|
|
|
],
|
|
|
craftingVisible: false,
|
|
|
guideManager: null,
|
|
|
+ userInfo: {
|
|
|
+ num_gmd: 0,
|
|
|
+ num_gmg: 0,
|
|
|
+ },
|
|
|
+ moneyTimer: null, // 添加定时器变量
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -162,6 +167,12 @@ export default {
|
|
|
console.log('屏幕宽度:', self.screenWidth);
|
|
|
}
|
|
|
});
|
|
|
+ this.getUserMoney();
|
|
|
+
|
|
|
+ // 启动定时器,每2秒更新一次铃钱
|
|
|
+ this.moneyTimer = setInterval(() => {
|
|
|
+ this.getUserMoney();
|
|
|
+ }, 2000);
|
|
|
},
|
|
|
onShow() {
|
|
|
// 检查是否需要显示引导
|
|
@@ -178,6 +189,13 @@ export default {
|
|
|
}, 1000);
|
|
|
}, 300);
|
|
|
},
|
|
|
+ onUnload() {
|
|
|
+ // 清除定时器
|
|
|
+ if (this.moneyTimer) {
|
|
|
+ clearInterval(this.moneyTimer);
|
|
|
+ this.moneyTimer = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
loadData() {
|
|
|
// 可以在这里加载其他数据
|
|
@@ -439,7 +457,27 @@ export default {
|
|
|
setTimeout(() => {
|
|
|
this.$refs.guideManager && this.$refs.guideManager.startGuide('homeLand');
|
|
|
}, 500);
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 获取用户铃钱
|
|
|
+ getUserMoney() {
|
|
|
+ uni.request({
|
|
|
+ url: this.$apiHost + '/User/getinfo',
|
|
|
+ method: 'GET',
|
|
|
+ data: {
|
|
|
+ uuid: getApp().globalData.uuid
|
|
|
+ },
|
|
|
+ header: {
|
|
|
+ 'Content-Type': 'application/x-www-form-urlencoded',
|
|
|
+ 'sign': getApp().globalData.headerSign,
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data) {
|
|
|
+ console.log("res.getUserMoney", res.data)
|
|
|
+ this.userInfo = res.data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
this.mainArrowAnimating = false;
|