优化积分兑换记录
This commit is contained in:
@@ -6,10 +6,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
|
<view class="loader"></view>
|
||||||
<view class="item" v-for="item in listData.list" :key="item.id">
|
<view class="item" v-for="item in listData.list" :key="item.id">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<text class="t">{{ item.orderNo }}</text>
|
<text class="t">{{ item.orderNo }}</text>
|
||||||
<u-tag :type="statusFilter(item.status).type" plain plainFill>{{ item.status }}</u-tag>
|
<u-tag :type="statusFilter(item.status).type" plain plainFill :text="item.status"></u-tag>
|
||||||
</view>
|
</view>
|
||||||
<view class="row">
|
<view class="row">
|
||||||
<text class="name">用户:{{ item.nickName }} {{ item.phone }}</text>
|
<text class="name">用户:{{ item.nickName }} {{ item.phone }}</text>
|
||||||
@@ -248,7 +249,7 @@ async function returnCostConfirmHandle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 积分:积分商品:兑换记录
|
// 积分:积分商品:兑换记录
|
||||||
async function goodsRecordPageAjax(page = listData.page) {
|
async function goodsRecordPageAjax(page = listData.page, isPull = false) {
|
||||||
try {
|
try {
|
||||||
const res = await goodsRecordPage({
|
const res = await goodsRecordPage({
|
||||||
page: page,
|
page: page,
|
||||||
@@ -268,6 +269,15 @@ async function goodsRecordPageAjax(page = listData.page) {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
if (isPull) {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '刷新成功',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
@@ -282,8 +292,36 @@ onMounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.loader {
|
||||||
|
width: 5px;
|
||||||
|
aspect-ratio: 1;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: l5 1s infinite linear alternate;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%) translateY(-80upx);
|
||||||
|
}
|
||||||
|
@keyframes l5 {
|
||||||
|
0% {
|
||||||
|
box-shadow: 20px 0 #000, -20px 0 #0002;
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
33% {
|
||||||
|
box-shadow: 20px 0 #000, -20px 0 #0002;
|
||||||
|
background: #0002;
|
||||||
|
}
|
||||||
|
66% {
|
||||||
|
box-shadow: 20px 0 #0002, -20px 0 #000;
|
||||||
|
background: #0002;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
box-shadow: 20px 0 #0002, -20px 0 #000;
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
.container {
|
.container {
|
||||||
padding-top: 50px;
|
padding-top: 40px;
|
||||||
}
|
}
|
||||||
.tab-wrap {
|
.tab-wrap {
|
||||||
$color: #318afe;
|
$color: #318afe;
|
||||||
@@ -315,6 +353,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
.list {
|
.list {
|
||||||
padding-bottom: 28upx;
|
padding-bottom: 28upx;
|
||||||
|
position: relative;
|
||||||
.item {
|
.item {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 20upx;
|
border-radius: 20upx;
|
||||||
|
|||||||
@@ -72,12 +72,13 @@ async function pointUserPageAjax(page = listData.page) {
|
|||||||
// 去积分详情
|
// 去积分详情
|
||||||
function toDetail(item) {
|
function toDetail(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pageMarket/points/userPointDetail?id=${item.id}&nickName=${item.nickName}&phone=${item.phone}`
|
url: `/pageMarket/points/userPointDetail?id=${item.id}&nickName=${item.nickName}&phone=${item.phone}&point=${item.pointBalance}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
reachBottom
|
reachBottom,
|
||||||
|
pointUserPageAjax
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue';
|
import { ref, reactive } from 'vue';
|
||||||
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
|
import { onLoad, onShow, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import setting from './components/setting.vue';
|
import setting from './components/setting.vue';
|
||||||
import productPage from './components/productPage.vue';
|
import productPage from './components/productPage.vue';
|
||||||
import record from './components/record.vue';
|
import record from './components/record.vue';
|
||||||
@@ -85,6 +85,25 @@ function scanHandle() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 下拉刷新
|
||||||
|
onPullDownRefresh(() => {
|
||||||
|
switch (tabsActive.value) {
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// productPageRef.value.reachBottom();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
recordRef.value.goodsRecordPageAjax(1, true);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
// userRecordRef.value.reachBottom();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
onReachBottom(() => {
|
onReachBottom(() => {
|
||||||
switch (tabsActive.value) {
|
switch (tabsActive.value) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<view>
|
<view>
|
||||||
<view class="header-wrap">
|
<view class="header-wrap">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<text class="t">用户昵称 {{ listData.nickName }}</text>
|
<text class="t">{{ listData.nickName }} {{ listData.phone }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<text class="t">当前积分 {{ listData.phone }}</text>
|
<text class="t">当前积分 {{ listData.point }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
@@ -40,6 +40,7 @@ const listData = reactive({
|
|||||||
nickName: '',
|
nickName: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
id: '',
|
id: '',
|
||||||
|
point: '',
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
status: 'loading',
|
status: 'loading',
|
||||||
@@ -80,6 +81,7 @@ onLoad((options) => {
|
|||||||
listData.id = options.id;
|
listData.id = options.id;
|
||||||
listData.nickName = options.nickName;
|
listData.nickName = options.nickName;
|
||||||
listData.phone = options.phone;
|
listData.phone = options.phone;
|
||||||
|
listData.point = options.point;
|
||||||
pointUserRecordAjax();
|
pointUserRecordAjax();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -813,7 +813,8 @@
|
|||||||
"pageId": "PAGES_MARKET_POINTS_INDEX",
|
"pageId": "PAGES_MARKET_POINTS_INDEX",
|
||||||
"path": "points/index",
|
"path": "points/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "积分锁客"
|
"navigationBarTitleText": "积分锁客",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user