修改个人中心红包的数据展示
This commit is contained in:
parent
2ba7efd7b3
commit
f354db835f
@ -2,8 +2,7 @@
|
||||
<view class="conatiner" :style="{ paddingTop: top + 'px' }">
|
||||
<view class="header" @click="toLogin">
|
||||
<view class="avatar-container">
|
||||
<image class="avatar"
|
||||
:src="userInfo.userPic || 'https://static.hshuishang.com/person/Group_309.png'"
|
||||
<image class="avatar" :src="userInfo.userPic || 'https://static.hshuishang.com/person/Group_309.png'"
|
||||
mode="" />
|
||||
</view>
|
||||
<view class="avatar_right">
|
||||
@ -11,16 +10,14 @@
|
||||
<view class="login-btn">{{ userInfo.nick_name ? userInfo.nick_name : '登录/注册' }}</view>
|
||||
<view class="avatar_setting">
|
||||
<view class="avatar_setting_box">
|
||||
<image
|
||||
src="https://static.hshuishang.com/property-img-file/page_user_Vector13.png"
|
||||
mode="" @click.stop="headerRefreshClick" />
|
||||
<image src="https://static.hshuishang.com/property-img-file/page_user_Vector13.png" mode=""
|
||||
@click.stop="headerRefreshClick" />
|
||||
</view>
|
||||
<!-- <button class="login-btn" open-type="getPhoneNumber" style="display: none;"
|
||||
@click="headerLoginClick" @getphonenumber="getPhoneNumber" id="hiddenLoginBtn"></button> -->
|
||||
<view class="avatar_setting_box">
|
||||
<image
|
||||
src="https://static.hshuishang.com/property-img-file/page_user_Vector14.png"
|
||||
mode="" @click.stop="headerSettingsClick" />
|
||||
<image src="https://static.hshuishang.com/property-img-file/page_user_Vector14.png" mode=""
|
||||
@click.stop="headerSettingsClick" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -41,7 +38,7 @@
|
||||
<view>岁银</view>
|
||||
</view>
|
||||
<view class="section_label" @click="goRedPacket()">
|
||||
<view>0元</view>
|
||||
<view>{{ redPacketMoney }}元</view>
|
||||
<view>红包中心</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -121,8 +118,8 @@
|
||||
<view class="main_title">功能服务</view>
|
||||
<view class="item1 padding_bottom0">
|
||||
<u-grid col="4" :border="false">
|
||||
<u-grid-item @click="headerOrderClick(item)" v-for="(item, index) in shopManagementList.filter(item => item.isShow)"
|
||||
:key="index">
|
||||
<u-grid-item @click="headerOrderClick(item)"
|
||||
v-for="(item, index) in shopManagementList.filter(item => item.isShow)" :key="index">
|
||||
<view class="item2">
|
||||
<image class="nav_icon" :src="item.image" mode=""></image>
|
||||
<text class="grid-text">{{ item.name }}</text>
|
||||
@ -155,11 +152,13 @@
|
||||
<script>
|
||||
import { apiArr } from '../../api/login';
|
||||
import { apiArr as apiArr2 } from '../../api/v2User';
|
||||
import { apiArr as apiArr3 } from '../../api/user';
|
||||
import { menuButtonInfo, NavgateTo, picUrl, request } from '../../utils/index';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
top: 0,
|
||||
redPacketMoney: '0.00',
|
||||
networkList: [{
|
||||
image: "https://static.hshuishang.com/property-img-file/page_user_Group_1568.png",
|
||||
name: "我的订单",
|
||||
@ -478,7 +477,27 @@ export default {
|
||||
// })
|
||||
}
|
||||
},
|
||||
async getMyRedPacket() {
|
||||
const params = {
|
||||
user_id: uni.getStorageSync('userId'),
|
||||
}
|
||||
const res = await request(apiArr3.redPackageMyred, 'POST', params);
|
||||
|
||||
let processedList = res.rows
|
||||
.filter(item => item.status !== 3)
|
||||
.map(item => {
|
||||
const newItem = { ...item };
|
||||
|
||||
if (newItem?.agent_info?.ad?.ad_name) {
|
||||
newItem.agent_info.ad.ad_name = newItem.agent_info.ad.ad_name.split(',').join('');
|
||||
}
|
||||
|
||||
return newItem;
|
||||
});
|
||||
this.redPacketMoney = processedList.reduce((total, item) =>
|
||||
item.red_package_config ? total + item.red_package_config.money : total, 0.00
|
||||
).toFixed(2);
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
const meun = menuButtonInfo();
|
||||
@ -487,6 +506,7 @@ export default {
|
||||
|
||||
onShow() {
|
||||
this.getUserInfo();
|
||||
this.getMyRedPacket();
|
||||
// this.headerLoginClick();
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user