Commit b9408f48 authored by 罗超's avatar 罗超

1

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