Files
six_uniapp_app/src/subPackages/homeSubPages/用户积分页面/用户积分页面.vue
T

244 lines
9.6 KiB
Vue

<style lang="scss" scoped>
//@import "@/assets/demo.scss";
@mixin line-color {
@keyframes gradientFlow {
0%, 100% {
background-position: 0 50%;
}
50% {
background-position: 100% 50%;
}
}
background: linear-gradient(to right, #FF6B6B 0%, #4ECDC4 20%, #FFD166 40%, #06D6A0 60%, #118AB2 80%, #EF476F 100%);
background-size: 400% 100%;
animation: gradientFlow 5s ease infinite;
}
.phone-screen {
box-sizing: border-box;
font-family: "xiaoFont", sans-serif;
height: v-bind(pxScreenHeight);
//background-image: url("https://hudie.xiao.band/wechatbackimg.png");
background-size: 750rpx;
&::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
background-color: transparent;
}
.error-wrap {
width: 100%;
height: 100%;
color: white;
display: flex;
justify-content: center;
align-items: center;
}
.loading-wrap {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.root-container {
position: relative;
box-sizing: border-box;
height: v-bind(pxWindowHeight);
.status-wifi-nav {
/*状态栏的高度 这里的值不能动*/
box-sizing: border-box;
height: v-bind(statusHeight);
:deep(.default-view-slot) {
line-height: v-bind(meunHeight);
display: flex;
align-items: center;
height: v-bind(meunHeight);
text-align: center;
.default-view-slot-left {
flex: 1;
}
.default-view-slot-right {
display: flex;
align-items: center;
padding: 0 20rpx;
border: solid rgba(255, 255, 255, 0.03) 1px;
border-radius: calc(v-bind(meunHeight) / 2);
.title-imgimage_item {
width: calc(v-bind(meunHeight) * 0.7);
height: calc(v-bind(meunHeight) * 0.7);
}
}
.default-view-slot-right-text {
font-weight: 800;
}
}
}
}
.grit-content {
height: calc(v-bind(pxWindowHeight) - v-bind(statusHeight));
display: grid;
grid-template-columns: 1fr;
grid-auto-rows: auto 1fr auto;
box-sizing: border-box;
.scrollTopHeigh {
/*在滚动区域内的, 可以自定义的高度*/
box-sizing: border-box;
//background-color: rgba(255, 255, 255, 0.05);
}
.scrollViewHeigh {
/*滚动页面区域范围*/
box-sizing: border-box;
font-size: 1rem;
overflow: hidden;
:deep() {
/*button按钮的 阴影样式可以直接使用*/
.custom-class-button {
box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%);
}
}
}
.scrollBottomHeigh {
box-sizing: border-box;
height: 1px;
@include line-color();
}
}
}
</style>
<template>
<view class="phone-screen">
<wd-config-provider :theme="theme">
<view class="root-container">
<view class="status-wifi-nav">
<ChildComScroll v-model:meunHeight="meunHeight" v-model:pxScreenHeight="pxScreenHeight"
v-model:pxScrollHeight="pxScrollHeight" v-model:pxWindowHeight="pxWindowHeight"
v-model:statusHeight="statusHeight" :modelValue="modelValue" @homeLeft="homeLeft"
@homeRight="homeRight">
<template v-slot:default>
<view class="default-view-slot" @click="defaultSearchChange">
<view class="default-view-slot-left"></view>
<view class="default-view-slot-right">
<image :lazy-load="true" class="title-imgimage_item" mode="scaleToFill"
src="https://hudie.xiao.band/search.png" webp/>
<view class="default-view-slot-right-text">搜索</view>
</view>
<view class="line-widht-number" style="width: 30rpx"></view>
</view>
</template>
</ChildComScroll>
</view>
<!--分隔线,上面的是子组件-->
<!-- 滚动区域开始-->
<view class="grit-content">
<view class="scrollTopHeigh"><!--预留的空间高度-->
<user-component-points-card></user-component-points-card>
</view>
<scroll-view :enableBackToTop="true" :enhanced="true" :scroll-y="true" :showScrollbar="false"
class="scrollViewHeigh">
<view class="line-widht-number" style="height: 10rpx"></view>
<view class="line-widht-number" style="height: 10rpx"></view>
<!-- <user-com-servise></user-com-servise>-->
<user-com-points-list-data></user-com-points-list-data>
</scroll-view>
<view class="scrollBottomHeigh">
<!--底部预留区域-->
</view>
</view>
<!--滚动区域结束-->
</view>
</wd-config-provider>
<wd-toast selector="default-toast"/>
<wd-message-box selector="default-message-box"/>
</view>
</template>
<script lang="ts" setup>
import ChildComScroll from "@/components/ChildComScroll.vue";
import {ref} from "vue";
import type {GlobelsChildPropsType} from "@/types/通用类型";
import {onLoad, onTabItemTap} from "@dcloudio/uni-app";
import UserComPointsListData from "@/subPackages/homeSubPages/用户积分页面/user-com-points-list-data.vue";
import UserComponentPointsCard from "@/subPackages/homeSubPages/用户积分页面/user-component-points-card.vue";
import type {ConfigProviderTheme} from "wot-design-uni/components/wd-config-provider/types";
import {useMainXiaoStore} from "@/stores/piniaPro/miniChatStore";
import {积分_当前用户积分列表详情数据, 积分_统计查询} from "@/hooks/接口API";
import {whenever} from "@vueuse/shared";
import {useRequest} from "@uni-helper/uni-use";
let xiaoMain = useMainXiaoStore();
defineOptions({options: {styleIsolation: "shared"}}); // 组件使用
let theme = ref(<ConfigProviderTheme>uni.getAppBaseInfo().theme); // 返回值为 dark or linght
let pxScreenHeight = ref(); // 手机高度
let pxWindowHeight = ref(); // 屏幕可视区高度
let pxScrollHeight = ref(); // 滚动区域高度
let statusHeight = ref(); // 固定的顶部
let meunHeight = ref();//插槽时要用的 高度
const modelValue: GlobelsChildPropsType = {
isShowLeft: {
showCom: "icon",
img: {imgLeft: "https://oss.xiao.band/icon/left.png"},
iconTextLeft: {classPrefix: "xiaozizi", name: "arrow-left-circle-line", size: 23},
},
isShowRight: {
showCom: "icon",
img: {imgRight: "https://oss.xiao.band/icon/%E9%99%8D%E8%90%BD%E4%BC%9E_parachute.png"},
iconTextRight: {classPrefix: "xiaozizi", name: "jifen3", size: 23},
},
title_text: "积分管理", navIsShow: "default",
};
const homeLeft = () => {
wx.vibrateShort({type: "heavy"});
uni.navigateBack({delta: 1}).then().catch(() => wx.reLaunch({url: "/pageTabBar/Home/Home"}));
};
const homeRight = () => {
wx.vibrateShort({type: "heavy"});
console.log("右键按键");
};
let defaultSearchChange = async () => {
await wx.vibrateShort({type: "heavy"});
console.log("搜索发起");
};
onTabItemTap(async () => {
await wx.vibrateShort({type: "heavy",});//medium heavy light
});
onLoad(async () => {
let data = await useRequest(积分_当前用户积分列表详情数据, {
method: "POST", data: {
self_mini_openid: xiaoMain.mini_openid, self_mini_unionid: xiaoMain.mini_unionid,
}
});
xiaoMain.mini_积分列表数据 = data.data.value;
xiaoMain.积分展示数据的列表 = data.data.value;
});
whenever(() => xiaoMain.mini_unionid, () => {
console.log("🍎 🍏 🍎 🍏 🍎 🍏 🍎 🍏 demo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_value ",);
xiaoMain.query_积分统计查询(积分_统计查询, <string>xiaoMain.mini_openid, <string>xiaoMain.mini_unionid);
}, {immediate: true});
</script>