Commit b9408f48 authored by 罗超's avatar 罗超

1

parent f589bd63
......@@ -6,9 +6,9 @@
:current="current"
@change="change"
:active-color="mainColor"
bar-height='4'
height="100"
bar-height="4"
height="100"
:show-bar="showBar"
></u-tabs>
<u-empty v-if="g.length == 0" text="暂无相关卡券" mode="order"></u-empty>
<view
......@@ -39,38 +39,37 @@
>没有更多卡券了</u-divider
>
</scroll-view>
</view>
<!-- 加载中 -->
<view class="loading" v-if="loading">
<u-loading mode="flower" size="48">></u-loading>
<Text style="color: #fff; margin-top: 10rpx;">加载中...</Text>
<Text style="color: #fff; margin-top: 10rpx">加载中...</Text>
</view>
<!-- 取消提示 -->
<u-toast ref="uToast" />
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="goback"
></auth>
</view>
</template>
<script>
import error from '../../../components/error/error.vue';
import error from "../../../components/error/error.vue";
import auth from "../../../components/auth/index.vue";
export default {
components: {
error,
auth
auth,
},
data() {
return {
pageTitle: "我的卡券",
current: 0,
showAuth: false,
list: [
{ name: "未使用" },
{ name: "已使用" },
{ name: "已过期" },
],
showAuth: false,
list: [{ name: "未使用" }, { name: "已使用" }, { name: "已过期" }],
mainColor: "",
contentHeight: 0,
page: 1,
......@@ -81,23 +80,27 @@ export default {
item: "",
index: 0,
isover: false,
u:{},
u: {},
showBar: true,
};
},
created() {
this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
this.mainColor = this.$uiConfig.mainColor;
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else{
this.loading = true;
this.init();
}
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
} else {
this.loading = true;
this.init();
}
// #ifdef MP-ALIPAY
this.showBar = false;
// #endif
},
mounted() {
let currentPages = getCurrentPages();
......@@ -116,7 +119,6 @@ export default {
},
methods: {
change(index) {
this.current = index;
this.page = 1;
this.g = [];
......@@ -126,7 +128,7 @@ export default {
init() {
this.isover = false;
let h = this.apiheader();
this.loading = false;
this.loading = false;
},
lower(e) {
if (this.page < this.page_count) {
......@@ -136,15 +138,15 @@ export default {
this.isover = true;
}
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth = false;
this.loading = true;
this.init();
},
goback(){
uni.navigateBack()
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth = false;
this.loading = true;
this.init();
},
goback() {
uni.navigateBack();
},
},
};
</script>
......@@ -171,5 +173,4 @@ export default {
margin-left: -100rpx;
z-index: 999;
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template>
<view class="integralDStyle" :style="{ height: contentHeight }">
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" :active-color="mainColor" height="100"></u-tabs>
<u-empty v-if="g.length == 0" text="暂无积分明细" mode="list"></u-empty>
<view v-if="g.length > 0" style="height: calc(100vh - 50px);width: calc(100vw);overflow: hidden; ">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }">
<view class="interDList" v-for="(x, i) in g" :key="i">
<Text>{{x.Description}}</Text>
<view style="display: flex;align-items: center;justify-content: space-between;width: 100%;margin-top: 5px;">
<Text :style="{color:x.Type==1?mainColor:secondary}">{{x.Type==1?'+':'-'}}{{x.Integral}}积分</Text>
<Text style='font-size: 12px; color: #B5B5B5;'>时间:{{x.CreateDate}}</Text>
</view>
</view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" bg-color="#f3f4f6" />
</scroll-view>
</view>
<!-- 加载中 -->
<view class="loading" v-if="loading">
<u-loading mode="flower" size="48">></u-loading>
<Text style="color: #fff; margin-top: 10rpx;">加载中...</Text>
</view>
<!-- 取消提示 -->
<u-toast ref="uToast" />
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth='gbAuth'></auth>
</view>
<view class="integralDStyle" :style="{ height: contentHeight }">
<u-tabs
:list="list"
:is-scroll="false"
:current="current"
@change="change"
:active-color="mainColor"
height="100"
:show-bar="showBar"
></u-tabs>
<u-empty v-if="g.length == 0" text="暂无积分明细" mode="list"></u-empty>
<view
v-if="g.length > 0"
style="height: calc(100vh - 50px); width: calc(100vw); overflow: hidden"
>
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }"
>
<view class="interDList" v-for="(x, i) in g" :key="i">
<Text>{{ x.Description }}</Text>
<view
style="
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
margin-top: 5px;
"
>
<Text :style="{ color: x.Type == 1 ? mainColor : secondary }"
>{{ x.Type == 1 ? "+" : "-" }}{{ x.Integral }}积分</Text
>
<Text style="font-size: 12px; color: #b5b5b5"
>时间:{{ x.CreateDate }}</Text
>
</view>
</view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
/>
</scroll-view>
</view>
<!-- 加载中 -->
<view class="loading" v-if="loading">
<u-loading mode="flower" size="48">></u-loading>
<Text style="color: #fff; margin-top: 10rpx">加载中...</Text>
</view>
<!-- 取消提示 -->
<u-toast ref="uToast" />
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
</view>
</template>
<script>
import auth from "../../../components/auth/index.vue";
export default {
components: {
auth
},
data() {
return {
pageTitle: "积分明细",
current: 0,
list: [{
name: "收入"
},
{
name: "支出"
},
],
showAuth: false,
msg: {
pageIndex: 1,
pageSize: 10,
Type: 0
},
mainColor: "",
secondary: '',
contentHeight: 0,
page: 1,
page_count: 1,
g: [],
loading: false,
isover: false,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
};
},
created() {
this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata") ?
wx.getStorageSync("basedata").bar_title :
[];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
onLoad() {
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else {
this.init();
}
},
methods: {
change(index) {
this.current = index;
this.msg.pageIndex = 1;
this.g = [];
this.loading = true;
this.init();
},
init() {
this.loading = true;
this.msg.Type = this.current + 1
this.request2({
url: '/api/AppletUser/GetMemberIntegralPageList',
data: this.msg
},
res => {
if (res.resultCode == 1) {
this.loading = false;
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.init();
},
//关闭登录窗口
gbAuth() {
uni.navigateBack()
}
},
};
import auth from "../../../components/auth/index.vue";
export default {
components: {
auth,
},
data() {
return {
pageTitle: "积分明细",
current: 0,
list: [
{
name: "收入",
},
{
name: "支出",
},
],
showAuth: false,
msg: {
pageIndex: 1,
pageSize: 10,
Type: 0,
},
mainColor: "",
secondary: "",
contentHeight: 0,
page: 1,
page_count: 1,
g: [],
loading: false,
isover: false,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
showBar: true,
};
},
created() {
this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
// #ifdef MP-ALIPAY
this.showBar = false;
// #endif
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
onLoad() {
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
} else {
this.init();
}
},
methods: {
change(index) {
this.current = index;
this.msg.pageIndex = 1;
this.g = [];
this.loading = true;
this.init();
},
init() {
this.loading = true;
this.msg.Type = this.current + 1;
this.request2(
{
url: "/api/AppletUser/GetMemberIntegralPageList",
data: this.msg,
},
(res) => {
if (res.resultCode == 1) {
this.loading = false;
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.init();
},
//关闭登录窗口
gbAuth() {
uni.navigateBack();
},
},
};
</script>
<style>
.integralDStyle {
width: 100%;
height: 100%;
background: #f3f4f6;
}
.integralDStyle {
width: 100%;
height: 100%;
background: #f3f4f6;
}
.integralDStyle .loading {
width: 200rpx;
height: 200rpx;
background: #000000;
opacity: 0.7;
border-radius: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: fixed;
left: 50%;
top: 30%;
margin-left: -100rpx;
z-index: 999;
}
.integralDStyle .loading {
width: 200rpx;
height: 200rpx;
background: #000000;
opacity: 0.7;
border-radius: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: fixed;
left: 50%;
top: 30%;
margin-left: -100rpx;
z-index: 999;
}
.integralDStyle .interDList {
width: 100%;
padding: 20px 15px;
display: flex;
flex-direction: column;
background: #fff;
border-top: 1px solid #f5f5f5;
}
.integralDStyle .interDList {
width: 100%;
padding: 20px 15px;
display: flex;
flex-direction: column;
background: #fff;
border-top: 1px solid #f5f5f5;
}
</style>
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