优惠卷和商品卷

This commit is contained in:
wwz
2025-03-10 16:33:43 +08:00
parent 70edc6756d
commit 5342133cbd
30 changed files with 2820 additions and 3338 deletions

View File

@@ -4,92 +4,120 @@
<view class="bild">
<view class="bildLeft">
<text>我的余额</text>
<view>{{info.amount||0}}</view>
<view>{{formData.info.amount||0}}</view>
</view>
<view class="bildRight">
<text>我的积分</text>
<view>{{info.accountPoints||0}}</view>
<view>{{formData.info.accountPoints||0}}</view>
</view>
</view>
<view class="navTop">
<view @click="clickEvent(1)" :class="[active==1?'fonts':'']">
<view @click="clickEvent(1)" :class="[formData.active==1?'fonts':'']">
余额明细
<view :class="[active==1?'xian':'']" style="left: 36rpx;"> </view>
<view :class="[formData.active==1?'xian':'']" style="left: 36rpx;"> </view>
</view>
<view @click="clickEvent(2)" :class="[active==2?'fonts':'']">
<view @click="clickEvent(2)" :class="[formData.active==2?'fonts':'']">
积分明细
<view :class="[active==2?'xian':'']" style="left: 36rpx;"> </view>
<view :class="[formData.active==2?'xian':'']" style="left: 36rpx;"> </view>
</view>
</view>
<view class="listStyle " v-for="(item,i) in list" :key="i">
<view class="listStyle " v-for="(item,i) in formData.list" :key="i">
<!-- <image class="head_img" :src="item.head_img?item.head_img:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/head_default.png'" style="width: 76rpx;height: 76rpx;float: left;" mode=""></image> -->
<view class="flex-start">
<view class="listStyle_left">
<view class="listrigth">
<view>{{active == 1 ? item.biz_name : item.content}}</view>
<view>{{formData.active == 1 ? item.biz_name : item.content}}</view>
<view
:class="{colorStyle: (active==1&&item.type == '+') || (active==2&&item.floatType=='add')}">
{{ active == 1 ? item.type : (item.floatType == 'add'?'+':'')}}
{{active == 1 ? item.amount : item.floatPoints}}
:class="{colorStyle: (formData.active==1&&item.type == '+') || (formData.active==2&&item.floatType=='add')}">
{{ formData.active == 1 ? item.type : (item.floatType == 'add'?'+':'')}}
{{formData.active == 1 ? item.amount : item.floatPoints}}
</view>
</view>
</view>
<view class="listrigth2">
<view>{{$u.timeFormat(active == 1 ? item.create_time : item.createTime, 'yyyy-mm-dd hh:MM:ss')}}
<view>{{item.createTime}}
</view>
<view v-if="active == 1">余额:{{item.balance}}</view>
<view v-if="formData.active == 1">余额:{{item.balance}}</view>
</view>
</view>
</view>
<view v-if="formData.list.length <= 0" style="text-align: center;">
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
</view>
<up-loadmore :status="formData.form.status" fontSize="14" color="#999" iconSize="14" />
</view>
</template>
<script setup>
import {
ref,
reactive
reactive,
onMounted
} from 'vue'
import {
onReachBottom
} from '@dcloudio/uni-app'
import {
APIshopUsermoneyRecord,
APIshopUserpointsRecord
} from '@/common/api/member.js'
const formData = reactive({
active: 1,
list: [],
form: {
page: 1,
pageSize: 10,
size: 10,
status: 'loadmore',
},
info: {
amount: '',
accountPoints: ''
},
info: null,
shopId: null
})
const getlist = () => {
return false;
// if (this.active == 1) {
// let res = await this.api.queryMemberAccount({
// ...this.form
// })
// if (res.code == 0 && res.data.list.length > 0) {
// this.list = this.list.concat(res.data.list)
// this.form.page++
// }
// } else {
// let res = await this.api.queryMemberPointsLog({
// shopId: formData.info.shopId,
// ...this.form
// })
// if (res.code == 0 && res.data.list.length > 0) {
// this.list = this.list.concat(res.data.list)
// this.form.page++
// }
// }
const getlist = async () => {
let res = null
if (formData.active == 1) {
res = await APIshopUsermoneyRecord({
page: formData.form.page,
size: formData.form.size,
status: formData.status,
shopId: formData.shopId
})
} else {
res = await APIshopUserpointsRecord({
page: formData.form.page,
size: formData.form.size,
status: formData.status
})
}
if (res.totalPage == 0 || res.totalPage == 1 && res.totalRow <= 10) {
formData.form.status = 'nomore'
formData.list = res.records
if (formData.form.page == 1 && res.records.length == 0) {
formData.records = []
formData.is_end = true
}
return false;
} else {
formData.form.status = 'loading';
if (formData.form.page == 1) {
formData.list = res.records
} else {
formData.list = [...formData.list, ...res.records];
}
formData.form.page = ++formData.form.page;
if (formData.form.page > res.totalPage) {
formData.form.status = 'nomore';
} else {
formData.form.status = 'loading';
}
}
}
// 检测是否包含In
@@ -101,7 +129,10 @@
const clickEvent = (i) => {
formData.active = i;
formData.form.page = 1;
formData.list = []
formData.is_end = false
formData.form.page = 1
formData.form.size = 10
formData.form.status = 'loadmore'
getlist()
}
@@ -116,7 +147,9 @@
const currentPage = pages[pages.length - 1];
// 获取页面参数
const options = currentPage.options;
formData.info = JSON.parse(options.shopUserInfo)
formData.info = JSON.parse(decodeURIComponent(options.shopInfo))
formData.shopId = options.shopId
formData.active = options.type
console.log(formData.info)
getlist()
})