oil-station/gasStation-uni/pagesMy/invite/list.vue

243 lines
4.5 KiB
Vue
Raw Normal View History

2024-09-24 16:51:04 +08:00
<template>
<view class="content">
<view class="container">
2024-10-17 11:27:25 +08:00
<!-- <view class="top_box">
2024-09-24 17:26:34 +08:00
<view class="two_t">
<view class="">浏览人数</view>
<view class="size_">50</view>
</view>
<view class="two_t">
<view class="">注册人数</view>
<view class="size_">50</view>
</view>
2024-10-17 11:27:25 +08:00
</view> -->
2024-09-24 17:26:34 +08:00
<view class="tab_">
2024-09-25 10:38:08 +08:00
<view class="t-box" :class="{'orsize' : tindex == index }" v-for="(item,index) in tabList" :key="index"
@click="setIndex(index)">{{item.name}}</view>
</view>
<view class="whit-box" v-if="tindex == 1">
2024-10-17 15:48:58 +08:00
<view class="one_h" v-for="(item,index) in rewardList" :key="index">
<view class="">{{item.name}}</view>
<view class="">{{item.time}}</view>
2024-09-25 10:38:08 +08:00
</view>
</view>
<view class="whit-box" v-else>
2024-10-17 11:27:25 +08:00
<view class="one_h" v-for="(item,index) in list" :key="index">
2024-09-25 10:38:08 +08:00
<view class="d-s">
<view class="touxiang">
<image src="../../static/logo.png" mode=""></image>
</view>
2024-10-17 11:27:25 +08:00
<view class="">{{item.inviteeUserName || "--"}}</view>
2024-09-25 10:38:08 +08:00
</view>
2024-10-17 11:27:25 +08:00
<view class="">{{item.createTime}}</view>
2024-09-25 10:38:08 +08:00
</view>
2024-09-24 17:26:34 +08:00
</view>
2024-10-17 11:27:25 +08:00
<view v-if="tindex == 1 && rewardList.length==0">
<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
</view>
<view v-if="tindex != 1 && list.length==0">
<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
</view>
2024-09-24 16:51:04 +08:00
</view>
</view>
</template>
<script>
import request from '../../utils/request';
export default {
data() {
return {
title: '',
2024-09-24 17:26:34 +08:00
tindex: 0,
tabList: [{
name: '会员注册记录'
},
{
name: '我的奖励记录'
}
],
2024-10-17 11:27:25 +08:00
list: [],
2024-09-24 16:51:04 +08:00
pageNo: 1,
pageSize: 10,
totalPage: '',
2024-10-17 11:27:25 +08:00
rewardList: []
2024-09-24 16:51:04 +08:00
}
},
onPullDownRefresh() {
//下拉刷新
this.resetting() //重置方法
this.getList() //调用请求
uni.stopPullDownRefresh()
},
onReachBottom() {
// 触底加载
if (this.pageNo >= this.totalPage) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
} else {
this.pageNo++
this.getList()
}
},
components: {
2024-10-17 11:27:25 +08:00
},
onLoad() {
},
onShow() {
this.getList()
2024-10-17 15:48:58 +08:00
this.getList1()
2024-09-24 16:51:04 +08:00
},
methods: {
2024-10-17 15:48:58 +08:00
getList1(){
request({
url: 'business/marketingActivity/activeRecommendRecords/selectRecord',
method: 'get',
params: {
storeId: uni.getStorageSync("storeId")
}
}).then(res => {
console.log(res, 106)
if (res.code == 200) {
this.rewardList = res.data
}
})
},
2024-09-25 10:38:08 +08:00
setIndex(num) {
this.tindex = num
2024-10-17 15:48:58 +08:00
if (num==1){
this.getList1()
}else{
this.getList()
}
2024-09-25 10:38:08 +08:00
},
2024-09-24 16:51:04 +08:00
//滞空方法
resetting() {
this.pageNo = 1
this.pageSize = 10
this.totalPage = ''
2024-10-17 11:27:25 +08:00
this.list = []
2024-09-24 16:51:04 +08:00
},
2024-10-17 11:27:25 +08:00
// 获取列表信息
getList() {
request({
url: '/business/marketingActivity/activeApplet/getRecommendedRecordsByStoreId',
2024-09-24 16:51:04 +08:00
method: 'get',
2024-10-17 11:27:25 +08:00
params: {
storeId: uni.getStorageSync("storeId")
2024-09-24 16:51:04 +08:00
}
2024-10-17 11:27:25 +08:00
}).then(res => {
console.log(res, 106)
if (res.code == 200) {
this.list = res.data
2024-09-24 16:51:04 +08:00
}
2024-10-17 11:27:25 +08:00
})
2024-09-24 16:51:04 +08:00
},
goback() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.content {
background: #f4f5f6;
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
2024-10-17 11:27:25 +08:00
padding-top: 15px;
2024-09-24 16:51:04 +08:00
}
2024-09-24 17:26:34 +08:00
.top_box {
width: 95%;
display: flex;
align-items: center;
justify-content: space-between;
margin: 15px auto;
box-sizing: border-box;
padding-top: 15px;
}
.two_t {
width: 49%;
background: #fff;
box-sizing: border-box;
padding: 15px;
text-align: center;
}
.size_ {
font-weight: 600;
font-size: 18px;
color: #333333;
}
.tab_ {
width: 100%;
display: flex;
align-items: center;
justify-content: space-around;
}
.t-box {
font-weight: 600;
font-size: 16px;
color: #333333;
2024-09-25 10:38:08 +08:00
box-sizing: border-box;
padding-bottom: 10px;
2024-09-24 17:26:34 +08:00
border-bottom: 1px solid transparent;
2024-09-25 10:38:08 +08:00
2024-09-24 17:26:34 +08:00
}
.orsize {
color: #FA6400;
border-bottom: 1px solid #FA6400;
}
2024-09-25 10:38:08 +08:00
.whit-box {
width: 95%;
background: #fff;
2024-10-17 11:27:25 +08:00
margin: 10px auto;
2024-09-25 10:38:08 +08:00
}
.one_h {
width: 100%;
box-sizing: border-box;
padding: 10px;
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
justify-content: space-between;
}
.touxiang {
width: 40px;
height: 40px;
overflow: hidden;
border-radius: 50%;
margin-right: 10px;
image {
width: 40px;
height: 40px;
}
}
.d-s {
display: flex;
align-items: center;
}
2024-09-24 17:26:34 +08:00
</style>