Commit 9c82c1fc by zhangzhen

功能优化

parent 9ece05eb
...@@ -38,3 +38,9 @@ export const equityFundLog=(data)=>{ ...@@ -38,3 +38,9 @@ export const equityFundLog=(data)=>{
let url=`/equityFundLog/list` let url=`/equityFundLog/list`
return http.get(url,data) return http.get(url,data)
} }
export const equityBindUser=(data)=>{
let url=`/activities/list`
return http.get(url,data)
}
\ No newline at end of file
...@@ -253,7 +253,15 @@ ...@@ -253,7 +253,15 @@
{ {
"path": "equityFundLog/index", "path": "equityFundLog/index",
"style": { "style": {
"navigationBarTitleText": "收益明细", "navigationBarTitleText": "权益金详情",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path": "equityFundLog/list",
"style": {
"navigationBarTitleText": "绑定用户",
"enablePullDownRefresh" : false "enablePullDownRefresh" : false
} }
} }
......
...@@ -185,6 +185,18 @@ ...@@ -185,6 +185,18 @@
<text class="text-black text-lg text-bold">{{userInfo.number|| 0}}</text> <text class="text-black text-lg text-bold">{{userInfo.number|| 0}}</text>
</view> </view>
</view> </view>
<view class="item-box" @tap="onNavByPath('equityFundLog')">
<view class="icon-img">
<image :class="userInfo.consumerMember && userInfo.consumerMember.isRights?'':'filter-box'" :src="assetsPath+'/user/wallet_icon_1.png'" mode="scaleToFill"></image>
</view>
<view class="text-box">
<text class="text-gray">权益金</text>
</view>
<view class="value-box">
<text class="text-black text-lg text-bold">{{userInfo.consumerWallet.equityFund || 0}}</text>
</view>
</view>
</view> </view>
</view> </view>
...@@ -754,6 +766,7 @@ ...@@ -754,6 +766,7 @@
}) })
}, },
onNavByPath(pathName){ onNavByPath(pathName){
if(pathName === 'equityFundLog' && !(this.userInfo.consumerMember && this.userInfo.consumerMember.isRights)) return;
if(["levelDetail"].includes(pathName) && !this.loginStatus){ if(["levelDetail"].includes(pathName) && !this.loginStatus){
console.log(pathName,999999) console.log(pathName,999999)
this.$refs.loginPop.open(); this.$refs.loginPop.open();
...@@ -1709,4 +1722,7 @@ ...@@ -1709,4 +1722,7 @@
} }
} }
} }
.filter-box{
filter: grayscale(100%);
}
</style> </style>
\ No newline at end of file
<template> <template>
<view class="order-record"> <view class="order-record">
<f-navbar title="奖励金" :isShowTransparentTitle="false" :isShowLeft="true" fontColor="#ffffff" :fontSize="38"
bgColor="#E40583" :scrollTop="scrollTop" navbarType='5'></f-navbar>
<scroll-view :enable-flex="true" class="scroll-view" scroll-y="true" @scroll="onScroll" @scrolltolower="onScrolltolower">
<view class="content-box"> <view class="content-box">
<view class="header-content" :style="{paddingTop:statusBarHeight+'px' }">
<!-- <image class="logo-bg" :src="assetsPath +'/logo_v1.png'" mode="widthFix"></image> -->
<view class="flex-col avatar-box">
<view class="avatar">
<image :src="userInfo.avatar || assetsPath+'/logo_icon.png' " mode="scaleToFill"></image>
</view>
<view class="">
<text class="text-white text-lg">{{userInfo.nickName || '凑角_'+userName}}</text>
</view>
<view class="amount">
<text class="text-bold text-white">{{ userInfo && userInfo.consumerWallet && userInfo.consumerWallet.equityFund? (userInfo.consumerWallet.equityFund).toFixed(2) : '0.00' }}</text>
</view>
</view>
<view class="flex-between part-list">
<view class="flex-col">
<text class="text-white text-sm">累计收益</text>
<text class="text-bold text-white text-xl">{{userInfo && userInfo.consumerWallet && userInfo.consumerWallet.accumulateEquityFund? (userInfo.consumerWallet.accumulateEquityFund).toFixed(2) : '0.00' }}</text>
</view>
<view class="flex-col">
<text class="text-white text-sm">绑定用户</text>
<view class="flex-row-center" @tap="onNavToUsers">
<text class="text-bold text-white text-xl">{{countNum}}</text>
<text class="cuIcon-right text-white text-xl"></text>
</view>
</view>
</view>
<view class="btn-box">
<button class="cu-btn round bg-white" @tap="onConfirm">立即提现</button>
</view>
</view>
<view class="content-list">
<view v-if="list && list.length" class="padding-sm">
<text class="text-title text-lg text-black">权益金入账信息</text>
</view>
<view class="list-content"> <view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @tap="onNavToOrderInfo(item)"> <view v-for="(item,index) in list" :key="index" class="list-item" @tap="onNavToOrderInfo(item)">
<view class="flex-between"> <view class="flex-between">
<text class="">获益金额</text> <view class="flex-row-center">
<text class="text-pink text-bold text-lg">{{item.equityFund}}</text> <text class="">入账时间:</text>
<text class="margin-left">{{item.createTime}}</text>
</view> </view>
<view class="">
<view class="flex-between"> </view>
<text class="">获益方式</text>
<text class="text-black">{{equityFundTypeEnum[item.equityFundType]}}</text>
</view> </view>
<view class="flex-between"> <view class="flex-between">
<text class="">创建时间</text> <text class="">金额:</text>
<text>{{item.createTime}}</text> <text class="text-pink text-bold text-lg">{{item.equityFund}}</text>
</view> </view>
<view class="flex-between">
<text class="">说明:</text>
<text class="text-black"> 好友 <text
class="text-bold">{{item.newNickName||'凑角用户'}}_{{item.phone4Last}}</text>进行<text
class="text-bold">{{equityFundTypeEnum[item.equityFundType]}}</text>后返现</text>
</view> </view>
</view> </view>
</view> </view>
<view v-if="list.length == 0" class="empty-box"> <view v-if="list.length == 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120" :icon="listBlankImage"> <u-empty text="暂无数据" textColor='#C1C1C1' width="120" :icon="listBlankImage">
</u-empty> </u-empty>
...@@ -30,12 +83,20 @@ ...@@ -30,12 +83,20 @@
:loadmore-text="loadmoreText" :nomore-text="nomoreText" /> :loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view> </view>
</view> </view>
</view>
</scroll-view>
</view>
</template> </template>
<script> <script>
import fNavbar from '@/components/module/f-navbar/f-navbar';
import config from "@/config/index.config" import config from "@/config/index.config"
import { import {
equityFundLog getUserInfo
} from "@/api/index.js"
import {
equityFundLog,
equityBindUser
} from "@/api/recharge.js" } from "@/api/recharge.js"
import NoLogin from "@/components/noLogin/noLogin" import NoLogin from "@/components/noLogin/noLogin"
import { import {
...@@ -44,22 +105,25 @@ ...@@ -44,22 +105,25 @@
export default { export default {
components: { components: {
NoLogin NoLogin,
fNavbar
}, },
data() { data() {
return { return {
statusBarHeight: this.statusBarHeight,
status: 'nomore ', status: 'nomore ',
loadingText: '努力加载中', loadingText: '努力加载中',
loadmoreText: '上划加载', loadmoreText: '上划加载',
nomoreText: '到底啦', nomoreText: '到底啦',
statusIndex: 0, statusIndex: 0,
list: [], list: [],
assetsPath: config.assetsPath,
scrollTop: 0,
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 5
}, },
equityFundTypeEnum:{ equityFundTypeEnum: {
0: "金额充值", 0: "金额充值",
1: "权益购买" 1: "权益购买"
}, },
...@@ -73,22 +137,53 @@ ...@@ -73,22 +137,53 @@
expenditure: '-', expenditure: '-',
income: '+' income: '+'
}, },
userInfo: uni.getStorageSync('userInfo'),
listBlankImage: config.assetsPath + '/no_data_icon.png', listBlankImage: config.assetsPath + '/no_data_icon.png',
countNum: 0,
userName:''
}; };
}, },
onLoad() { onLoad() {
this.onGetUserInfo()
}, },
onReachBottom() { onShow() {
this.onGetDicts()
this.onEquityBindUser()
},
methods: {
onScrolltolower(){
if (this.status == 'loadmore') { if (this.status == 'loadmore') {
this.queryParams.pageNum += 1; this.queryParams.pageNum += 1;
this.onLoading(); this.onLoading();
} }
}, },
onShow() { onConfirm(){
this.onGetDicts() uni.showToast({
icon:"none",
title:"功能暂未开放,敬请期待!"
})
},
onGetUserInfo() {
getUserInfo().then(res => {
if (res.data.code == 200) {
this.userInfo = {
...res.data.data,
consumerWallet: res.data.data.consumerWallet? res.data.data.consumerWallet: {remainingIntegral:0}
}
if(this.userInfo && this.userInfo.phone){
this.userName = this.userInfo.phone.slice(-4);
}
uni.setStorageSync('userInfo', this.userInfo)
this.$forceUpdate();
}
})
},
onScroll(e) {
this.scrollTop = e.target.scrollTop;
console.log(this.scrollTop, 99999)
}, },
methods: {
onGetDicts() { onGetDicts() {
let dicts = [] let dicts = []
if (uni.getStorageSync('dicts')) { if (uni.getStorageSync('dicts')) {
...@@ -116,19 +211,20 @@ ...@@ -116,19 +211,20 @@
if (res.data.code == 200) { if (res.data.code == 200) {
let list = res.data.rows.map(item => { let list = res.data.rows.map(item => {
return { return {
...item ...item,
phone4Last: item.newAccount.slice(-4)
} }
}) })
if(this.queryParams.pageNum ===1){ if (this.queryParams.pageNum === 1) {
this.list = list this.list = list
}else{ } else {
this.list.push(...list); this.list.push(...list);
} }
if(this.list.length < res.data.total){ if (this.list.length < res.data.total) {
this.status = "loadmore" this.status = "loadmore"
}else{ } else {
this.status = "nomore" this.status = "nomore"
} }
...@@ -137,6 +233,12 @@ ...@@ -137,6 +233,12 @@
} }
}) })
}, },
onEquityBindUser() {
equityBindUser().then(res => {
console.log(res, 999999)
this.countNum = res.data.total
})
},
tabSelect(i) { tabSelect(i) {
console.log(i, 99999) console.log(i, 99999)
this.statusIndex = i; this.statusIndex = i;
...@@ -148,6 +250,11 @@ ...@@ -148,6 +250,11 @@
// uni.navigateTo({ // uni.navigateTo({
// url:"/pages/orderResult/orderResult?orderNo="+val.orderNo // url:"/pages/orderResult/orderResult?orderNo="+val.orderNo
// }) // })
},
onNavToUsers(){
uni.navigateTo({
url:"/setting/equityFundLog/list"
})
} }
} }
} }
...@@ -155,16 +262,101 @@ ...@@ -155,16 +262,101 @@
<style> <style>
page { page {
background-color: #f1f1f1; background-color: #f1f1f1;
height: 100vh;
width: 100vw;
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.order-record { .order-record {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%;
height: 100%;
.scroll-view {
position: relative;
display: flex;
flex: 1;
width: 100vw;
.content-box { .content-box {
position: absolute;
left: 0;
width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center;
// background: #f5f5f5;
// padding-bottom: 50px;
}
}
.header-content {
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
min-height: 400upx;
background: linear-gradient(to right, #FB406F, #E40583);
.logo-bg {
width: 380upx;
max-height: 280upx;
}
.avatar-box{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.avatar{
border: 2px solid rgba(255, 255, 255, 0.8);
width: 52px;
height: 52px;
border-radius: 50%;
overflow: hidden;
box-shadow: 0 0 6upx #f1f1f1;
image{
display: block;
width: 100%;
height: 100%;
}
}
.amount{
margin-top: 16upx;
text{
font-size: 60upx;
}
}
}
.part-list{
width: 100%;
padding: 0 24upx 12upx;
.flex-col{
justify-content: center;
align-items: center;
}
}
.btn-box{
position: absolute;
left: 0;
bottom: -16px;
width: 100%;
display: flex;
justify-content: center;
.cu-btn{
box-shadow: 0 4upx 4upx #E40583;
}
}
}
.content-list {
display: flex;
flex: 1;
width: 100%;
flex-direction: column;
margin: 20upx 0 0 0;
.list-content { .list-content {
display: flex; display: flex;
...@@ -174,12 +366,16 @@ ...@@ -174,12 +366,16 @@
.list-item { .list-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 94%; width: 96%;
padding: 20upx 20upx; padding: 20upx 20upx;
border-radius: 20upx; border-radius: 20upx;
background-color: #ffffff; background-color: #ffffff;
margin-top: 30upx; margin-top: 30upx;
>.flex-between {
padding: 6upx 0;
}
.part-1 { .part-1 {
display: flex; display: flex;
...@@ -189,7 +385,33 @@ ...@@ -189,7 +385,33 @@
} }
} }
} }
.list-item:first-child {
margin-top: 0;
}
}
}
}
.count-part {
background-color: #ffffff;
.flex-1 {
padding: 20upx 0;
.margin-top-sm {
margin-top: 10upx;
}
}
.flex-row-center {
justify-content: center;
} }
} }
.line {
height: 80%;
width: 0;
border-left: 2upx solid #e5e5e5;
} }
</style> </style>
\ No newline at end of file
<template>
<view class="order-record">
<view class="content-box">
<view class="content-list">
<view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item">
<view class="avatar-box">
<view class="avatar">
<image :src="item.newAvatar || assetsPath+'/logo_icon.png' " mode="scaleToFill"></image>
</view>
<view class="">
<text class="text-title text-black text-lg">{{item.newNickName||'凑角用户'}}_{{item.userName}} </text>
</view>
</view>
<text class="margin-left">{{item.createTime || item.updateTime}}</text>
</view>
</view>
<view v-if="list.length == 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120" :icon="listBlankImage">
</u-empty>
</view>
<view v-if="list.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
</view>
</view>
</view>
</template>
<script>
import config from "@/config/index.config"
import {
equityBindUser
} from "@/api/recharge.js"
import {
getDictItem
} from "@/utils/tools.js"
export default {
data() {
return {
statusBarHeight: this.statusBarHeight,
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
statusIndex: 0,
list: [],
assetsPath: config.assetsPath,
scrollTop: 0,
queryParams: {
pageNum: 1,
pageSize: 10
},
equityFundTypeEnum: {
0: "金额充值",
1: "权益购买"
},
orderStatusEnum: {},
payTypeEnum: {
1: "微信支付",
2: "支付宝支付",
3: "余额支付"
},
payStatus: {
expenditure: '-',
income: '+'
},
listBlankImage: config.assetsPath + '/no_data_icon.png',
};
},
onLoad() {
this.onGetDicts()
},
onReachBottom() {
if (this.status == 'loadmore') {
this.queryParams.pageNum += 1;
this.onLoading();
}
},
methods: {
onGetDicts() {
let dicts = []
if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts'))
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.onLoading()
} else {
dictList().then(res => {
dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.onLoading()
})
}
},
onLoading() {
uni.showLoading({
title: '加载中'
})
this.status = 'loading'
equityBindUser(this.queryParams).then(res => {
console.log(res)
uni.hideLoading()
if (res.data.code == 200) {
let list = res.data.rows.map(item => {
return {
...item,
userName:item.newPhone ? item.newPhone.slice(-4):'0000'
}
})
if (this.queryParams.pageNum === 1) {
this.list = list
} else {
this.list.push(...list);
}
if (this.list.length < res.data.total) {
this.status = "loadmore"
} else {
this.status = "nomore"
}
} else if (res.data.code == 401) {
this.loginStatus = false
}
})
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
height: 100vh;
width: 100vw;
}
</style>
<style lang="scss" scoped>
.order-record {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
.content-list {
display: flex;
flex: 1;
width: 100%;
flex-direction: column;
margin: 20upx 0 0 0;
.list-content {
display: flex;
flex-direction: column;
align-items: center;
.list-item {
display: flex;
justify-content: space-between;
align-items: center;
width: 96%;
padding: 20upx 20upx;
border-radius: 20upx;
background-color: #ffffff;
margin-top: 30upx;
>.flex-between {
padding: 6upx 0;
}
.part-1 {
display: flex;
.flex-row {
display: flex;
flex-direction: row;
}
}
}
.list-item:first-child {
margin-top: 0;
}
}
}
}
.count-part {
background-color: #ffffff;
.flex-1 {
padding: 20upx 0;
.margin-top-sm {
margin-top: 10upx;
}
}
.flex-row-center {
justify-content: center;
}
}
.avatar-box{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
.avatar{
border: 2px solid rgba(255, 255, 255, 0.8);
width: 42px;
height: 42px;
border-radius: 50%;
overflow: hidden;
box-shadow: 0 0 6upx #ff007f;
margin-right: 8upx;
image{
display: block;
width: 100%;
height: 100%;
}
}
.amount{
margin-top: 16upx;
text{
font-size: 60upx;
}
}
}
</style>
\ No newline at end of file
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