持续集成分支

This commit is contained in:
aixianling
2024-10-31 14:34:57 +08:00
parent 6a833be062
commit 8c56cf808b
2165 changed files with 4116 additions and 8716 deletions

View File

@@ -0,0 +1,56 @@
<template>
<section class="AppCreditPoints">
<AiTabPanes :tabs="tabList" v-model="tabIndex"/>
<family-rank v-if="tabIndex == 0" :showDetail="showDetail"/>
<user-rank v-if="tabIndex == 1" :showDetail="showDetail"/>
<sys-user-integral v-if="tabIndex==2"/>
</section>
</template>
<script>
import {mapState} from 'vuex'
import userRank from './components/userRank.vue'
import familyRank from './components/familyRank.vue'
import SysUserIntegral from "./components/sysUserIntegral";
export default {
name: "AppCreditPoints",
appName: "我的积分",
computed: {
...mapState(['user'])
},
components: {SysUserIntegral, userRank, familyRank},
data() {
return {
tabList: ['家庭积分', '个人积分', "员工积分"],
tabIndex: 0,
showDetail: true
}
},
onLoad(options) {
if (options.type == 'detail') {
this.showDetail = true
}
uni.setNavigationBarTitle({
title: options.title
})
},
onReachBottom() {
uni.$emit("reachBottom" + this.tabIndex)
},
onShow() {
uni.$emit("onShow")
},
methods: {
tabClick(index) {
this.tabIndex = index
}
},
}
</script>
<style scoped lang="scss">
.AppCreditPoints {
width: 100vw;
background-color: #f3f6f9;
min-height: 100vh;
}
</style>

View File

@@ -0,0 +1,236 @@
<template>
<div class="AppGridIntegral">
<div class="bg-blue"></div>
<div class="header-content">
<img src="https://cdn.cunwuyun.cn/dvcp/credit/head.png" alt="">
<div class="headerDataPane" flex>
<div class="headerItem top">
<div v-text="`积分余额`"/>
<b v-text="info.nowIntegral||0"/>
</div>
<div class="headerItem">
<div v-text="`历史累计积分`"/>
<b v-text="info.historyIntegralTotal||0"/>
</div>
<div class="divider"/>
<div class="headerItem">
<div v-text="`积分排名`"/>
<b v-text="info.integralRanking||'-'"/>
</div>
</div>
</div>
<div class="detail-content" v-if="list.length">
<div flex>
<div class="title fill">积分明细</div>
<u-icon name="question-circle" label="积分规则" color="#3F8DF5" label-color="#3F8DF5" @click="gotoRules"/>
</div>
<u-gap/>
<div class="item" v-for="(item, index) in list" :key="index">
<div class="item-info">
<p v-text="item.eventDesc||item.integralRuleName"/>
<span v-text="item.doTime"/>
</div>
<div class="item-num" :class="'color-'+ item.integralCalcType">
{{ (item.integralCalcType == 1 ? '+' : '-') + item.changeIntegral }}
</div>
</div>
</div>
<AiEmpty v-else/>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: "AppGridIntegral",
appName: "微网格长(员)积分",
computed: {
...mapState(['user'])
},
data() {
return {
info: {},
list: [],
current: 1,
pages: 0
}
},
created() {
this.getInfo()
},
methods: {
// 积分排行
getInfo() {
let {current, info: {detailList: details}} = this
if (!details?.pages || current <= details.pages) {
this.$http.post('/app/appintegraluser/appGirdIntegral', null, {
params: {current, size: 10}
}).then(res => {
if (res?.data) {
this.info = res.data
this.list = [this.list, res.data.detailList?.records || []].flat()
}
})
}
},
gotoRules() {
uni.navigateTo({url: './integralRules'})
}
},
onReachBottom() {
this.current++
this.getInfo()
}
}
</script>
<style scoped lang="scss">
.AppGridIntegral {
width: 100vw;
min-height: 100vh;
background-color: #f3f6f9;
display: flex;
flex-direction: column;
align-items: center;
.bg-blue {
width: 100%;
height: 270px;
background-color: #3975C6;
}
.header-content {
width: 690px;
height: 408px;
margin: -130px 0 40px;
padding: 32px;
box-sizing: border-box;
position: relative;
background: #FFF;
border-radius: 16px;
.headerDataPane {
justify-content: space-around;
top: 76px;
left: 0;
right: 0;
position: absolute;
z-index: 9;
flex-wrap: wrap;
.headerItem {
text-align: center;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 40px;
b {
display: block;
line-height: 50px;
color: #000;
font-size: 36px;
font-family: DIN, DINAlternate-Bold, DINAlternate;
margin-bottom: 10px;
}
&.top {
width: 100%;
b {
font-size: 104px;
line-height: 122px;
}
}
}
}
& > img {
position: absolute;
width: 342px;
height: 220px;
top: -60px;
right: 10px;
z-index: 2;
}
}
.mar-b4 {
margin-bottom: 8px;
}
.mar-b8 {
margin-bottom: 16px;
}
.detail-content {
width: 690px;
background: #FFF;
border-radius: 16px;
padding: 30px 30px 94px;
box-sizing: border-box;
.title {
font-size: 34px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 48px;
}
.item {
padding: 34px 0 32px 0;
border-bottom: 2px solid #ddd;
display: flex;
.item-info {
width: 500px;
p {
word-break: break-all;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333;
line-height: 44px;
}
span {
display: inline-block;
margin-top: 8px;
font-size: 24px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999;
line-height: 34px;
}
}
.item-num {
width: calc(100% - 500px);
text-align: right;
font-size: 36px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
line-height: 50px;
}
}
}
.color-1 {
color: #2C51CE !important;
}
.color-0 {
color: #E6736E !important;
}
.divider {
width: 2px;
height: 60px;
background: #ededed;
}
}
</style>

View File

@@ -0,0 +1,210 @@
<template>
<section class="AppIntegralOrder">
<AiTopFixed>
<div class="header" flex>
<AiAreaPicker v-model="search.areaId" :area-id="user.areaId" isForm @select="current=1,getList()"/>
<u-search class="fill" v-model="search.name" @change="current=1,getList()" clearable :show-action="false" placeholder="搜索订单编号"/>
</div>
</AiTopFixed>
<div class="card" v-for="row in list" :key="row.id">
<div class="header bottomBorder" flex>
<u-icon name="bag-fill"/>
<div class="fill">订单编号{{ row.orderCode }}</div>
<AiDict dict="integralOrderStatus" :value="row.orderStatus"/>
</div>
<div class="merchandise bottomBorder" v-for="item in row.merchandiseList" :key="item.id" flex>
<img :src="item.photo"/>
<div class="fill info">
<b class="merchandiseName" v-text="item.merchandiseName"/>
<div class="baseline" flex>
<div class="color-999 fill">x{{ item.merchandiseNumber }}</div>
<div class="integral baseline" flex>
<b v-text="item.costIntegral"/>
积分
</div>
</div>
</div>
</div>
<div class="createUserName" flex>
<u-icon name="red-packet-fill"/>
<div class="fill">兑换人{{ row.createUserName }}</div>
<div v-text="row.createTime"/>
</div>
<div v-if="row.orderStatus==0 || row.orderStatus==3" flex class="flexEnd">
<div class="btn" v-if="row.orderStatus==0 || row.orderStatus==3" @click="handleCancel(row.id)">取消订单</div>
<div class="btn confirm" v-if="row.orderStatus==0" @click="handleConfirm(row.id)">确认兑换</div>
</div>
<u-gap height="1"/>
</div>
<AiEmpty v-if="!list.length"/>
</section>
</template>
<script>
import {mapState} from "vuex";
export default {
name: "AppIntegralOrder",
appName: "积分超市订单",
data() {
return {search: {}, current: 1, list: [], pages: 0}
},
computed: {
...mapState(['user'])
},
methods: {
getList() {
let {current, search, pages} = this
if ((!pages && current == 1) || current <= pages) {
this.$http.post("/app/appvillagerintegralshoporder/list", null, {
params: {current, ...search}
}).then(res => {
if (res?.data) {
res.data.records?.map(e => {
e.merchandiseList?.map(m => {
m.photo = JSON.parse(m.merchandisePhoto)?.[0]?.url || "https://cdn.cunwuyun.cn/dvcp/h5/AppIntegralOrder/merchandise.png"
})
})
this.list = [current == 1 ? [] : this.list, res.data.records].flat()
this.pages = res.data.pages
}
})
}
},
handleConfirm(orderId) {
this.$confirm("是否要确认兑换?").then(() => {
this.$http.post("/app/appvillagerintegralshoporder/confirmExchange", null, {
params: {orderId}
}).then(res => {
if (res?.code == 0) {
this.$u.toast("提交成功!")
this.current = 1
this.getList()
}
})
}).catch(() => 0)
},
handleCancel(orderId) {
this.$confirm("是否要取消订单?").then(() => {
this.$http.post("/app/appvillagerintegralshoporder/overOrder", null, {
params: {orderId}
}).then(res => {
if (res?.code == 0) {
this.$u.toast("提交成功!")
this.current = 1
this.getList()
}
})
}).catch(() => 0)
}
},
created() {
this.$dict.load('integralOrderStatus')
this.search.areaId = this.user.areaId
this.getList()
},
onReachBottom() {
this.current++
this.getList()
}
}
</script>
<style lang="scss" scoped>
.AppIntegralOrder {
min-height: 100vh;
padding-bottom: 80px;
box-sizing: border-box;
.bottomBorder {
border-bottom: 2px solid #ddd;
}
::v-deep.card {
background: #fff;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.02);
border-radius: 16px;
margin: 32px 32px 0;
font-family: PingFangSC-Medium, PingFang SC;
.header {
line-height: 104px;
padding: 0 32px;
& > .fill {
margin: 0 8px;
}
}
.baseline {
align-items: baseline;
}
.flexEnd {
justify-content: flex-end;
padding: 18px 20px 46px;
}
.merchandise {
margin: 0 32px;
padding: 32px 0;
& > img {
height: 176px;
width: 176px;
margin-right: 16px;
}
.info {
align-self: stretch;
}
.merchandiseName {
font-size: 28px;
display: block;
height: calc(100% - 60px);
}
.integral {
color: #FF6900;
& > b {
font-size: 44px;
margin-right: 8px;
}
}
}
.createUserName {
background: #F9FAFB;
border-radius: 6px;
padding: 0 16px;
margin: 32px 16px;
height: 70px;
& > .fill {
margin: 0 8px;
}
}
.btn {
border-radius: 52px;
border: 2px solid #DDDDDD;
padding: 0 32px;
line-height: 64px;
font-size: 28px;
&.confirm {
background: linear-gradient(90deg, #FFA044 0%, #FF8436 100%);
color: #FFFFFF;
border-color: transparent;
}
& + .btn {
margin-left: 32px;
}
}
}
}
</style>

View File

@@ -0,0 +1,491 @@
<template>
<section class="userRank">
<div class="area-content">
<AiAreaPicker :areaId="user.areaId" :value="areaId" @select="areaSelect" :name.sync="areaName" selectRoot>
<img src="./img/local-icon.png" alt="">
<span class="label" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span>
<u-icon name="arrow-down" color="#666" size="24"/>
</AiAreaPicker>
</div>
<u-gap height="6"/>
<div class="fill" v-if="info['列表'] && info['列表'].length">
<div class="ranking-content" v-if="info['列表'] && info['列表'].length">
<div class="item" v-if="info['列表'].length > 1">
<img
src="https://cdn.cunwuyun.cn/dvcp/credit/2.png"
alt=""
class="top-img"
/>
<img
:src="info['列表'][1].photo"
alt=""
class="user-img mar-b4"
v-if="info['列表'][1].photo"
/>
<div class="user-name-bg mar-b4" v-else>
{{ formatName(info["列表"][1].name) }}
</div>
<p class="user-name mar-b8">
{{ info["列表"][1].name }}{{ tabIndex == 0 ? "家" : "" }}
</p>
<p class="item-num">{{ info["列表"][1].integral }}</p>
</div>
<div class="item-top item" v-if="info['列表'].length > 0">
<img
src="https://cdn.cunwuyun.cn/dvcp/credit/1.png"
alt=""
class="top-img-one"
/>
<img
:src="info['列表'][0].photo"
alt=""
class="user-img mar-b4"
v-if="info['列表'][0].photo"
/>
<div class="user-name-bg mar-b4" v-else>
{{ formatName(info["列表"][0].name) }}
</div>
<p class="user-name mar-b8">
{{ info["列表"][0].name }}{{ tabIndex == 0 ? "家" : "" }}
</p>
<p class="item-num">{{ info["列表"][0].integral }}</p>
</div>
<div class="item" v-if="info['列表'].length > 2">
<img
src="https://cdn.cunwuyun.cn/dvcp/credit/3.png"
alt=""
class="top-img"
/>
<img
:src="info['列表'][2].photo"
alt=""
class="user-img mar-b4"
v-if="info['列表'][2].photo"
/>
<div class="user-name-bg mar-b4" v-else>
{{ formatName(info["列表"][2].name) }}
</div>
<p class="user-name mar-b8">
{{ info["列表"][2].name }}{{ tabIndex == 0 ? "家" : "" }}
</p>
<p class="item-num">{{ info["列表"][2].integral }}</p>
</div>
</div>
<u-gap height="6"/>
<div class="ranking-list" v-if="info['列表'] && info['列表'].length">
<div
class="item"
v-for="(item, index) in info['列表']"
:key="index"
v-if="index > 2"
>
<span class="item-num">{{ index + 1 }}</span>
<img
:src="item.photo"
alt=""
class="user-img mar-b4"
v-if="item.photo"
/>
<div class="user-name-bg mar-b4 mar-r24" v-else>
{{ formatName(item.name) }}
</div>
<span class="item-name">{{ item.name }}{{ tabIndex == 0 ? "家" : "" }}</span>
<span class="item-point">{{ item.integral }}</span>
</div>
</div>
</div>
<AiEmpty v-else/>
</section>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: "userRank",
appName: "个人积分",
computed: {
...mapState(['user'])
},
props: {
showDetail: { //true 积分明细 false积分排行
type: Boolean
}
},
data() {
return {
info: {},
current: 1,
list: [],
areaId: '',
areaName: '',
tabIndex: 0
}
},
created() {
this.areaId = this.user.areaId
this.areaName = this.user.areaName || ''
this.getInfo();
uni.$on("onShow", () => {
this.getInfo();
})
uni.$on("reachBottom0", () => {
if (this.list.length < 50) {
this.current++;
this.getInfo()
}
})
},
methods: {
areaSelect(e) {
this.areaId = e
this.getInfo()
},
// 积分排行
getInfo() {
this.info = {};
this.$http.post(`/app/appresident/rank-qw?type=${this.tabIndex}&areaId=${this.areaId}`).then((res) => {
if (res?.data) {
this.info = res.data;
}
});
},
formatName(name) {
if (name == undefined) {
return
}
return name.substr(name.length - 2, name.length > 2 ? (name.length - 1) : name.length)
},
},
destroyed() {
uni.$off("reachBottom0")
uni.$off("onShow")
}
}
</script>
<style scoped lang="scss">
.userRank {
width: 100vw;
background-color: #f3f6f9;
.bg-blue {
width: 100%;
height: 176px;
background-color: #3975C6;
}
.header-content {
width: 690px;
height: 256px;
background: #fff;
border-radius: 16px;
margin: -130px 0 40px 30px;
padding: 100px 60px 40px 60px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
position: relative;
.item {
text-align: center;
z-index: 99;
.num {
font-family: DIN;
font-size: 52px;
font-weight: bold;
line-height: 60px;
}
.label {
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 40px;
margin-top: 10px;
}
.color-5AAD6A {
color: #5aad6a;
}
.color-4185F5 {
color: #4185f5;
}
.color-CD413A {
color: #cd413a;
}
}
img {
position: absolute;
width: 360px;
height: 250px;
top: -40px;
right: 0;
}
}
.ranking-content {
padding: 94px 30px 0;
.item {
display: inline-block;
width: 216px;
height: 320px;
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.12);
border-radius: 12px;
padding: 40px 0 0 0;
text-align: center;
box-sizing: border-box;
position: relative;
vertical-align: top;
background: #fff;
.user-name {
font-size: 30px;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #333;
line-height: 42px;
word-break: break-all;
}
.item-num {
font-size: 46px;
font-weight: 6000;
color: #2c51ce;
line-height: 54px;
}
.top-img {
width: 100%;
height: 34px;
position: absolute;
top: -11px;
left: 0;
}
}
.item-top {
margin: -46px 20px 0;
height: 366px;
.user-img {
width: 104px;
height: 104px;
}
.user-name-bg {
width: 104px;
height: 104px;
border-radius: 50%;
background-color: #4e8eee;
font-size: 28px;
line-height: 104px;
text-align: center;
color: #fff;
}
.top-img-one {
width: 100%;
position: absolute;
top: -22px;
left: 0;
height: 46px;
}
}
}
.ranking-list {
background-color: #fff;
.item {
width: 100%;
height: 120px;
line-height: 120px;
background: #fff;
padding: 0 64px;
box-sizing: border-box;
.item-num {
display: inline-block;
width: 68px;
color: #858594;
font-size: 28px;
}
.user-img {
margin-right: 24px;
vertical-align: middle;
}
.item-name {
color: #333;
font-size: 30px;
display: inline-block;
width: 240px;
}
.item-point {
display: inline-block;
width: 210px;
text-align: right;
font-size: 30px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
}
.mar-r24 {
margin-right: 24px;
}
}
}
.user-img {
width: 80px;
height: 80px;
border-radius: 50%;
}
.user-name-bg {
display: inline-block;
width: 80px;
height: 80px;
border-radius: 50%;
background-color: #4e8eee;
font-size: 28px;
line-height: 80px;
text-align: center;
color: #fff;
}
.mar-b4 {
margin-bottom: 8px;
}
.mar-b8 {
margin-bottom: 16px;
}
.detail-content {
width: 690px;
background: #fff;
border-radius: 16px;
margin: 432px 0 0 32px;
padding: 30px 30px 94px;
box-sizing: border-box;
.title {
font-size: 34px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 48px;
margin-bottom: 30px;
}
.item {
padding: 34px 0 32px 0;
border-bottom: 2px solid #ddd;
display: flex;
.item-info {
width: 500px;
p {
word-break: break-all;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333;
line-height: 44px;
}
span {
display: inline-block;
margin-top: 8px;
font-size: 24px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999;
line-height: 34px;
}
}
.item-num {
width: calc(100% - 500px);
text-align: right;
font-size: 36px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
line-height: 50px;
}
}
}
.color-0 {
color: #2c51ce !important;
}
.color-1 {
color: #e6736e !important;
}
.fixed-top {
z-index: 999;
}
.header-tab {
height: 96px;
background-color: #3975C6;
padding: 20px 0;
display: flex;
align-items: center;
box-sizing: border-box;
}
.header-tab .tab-item {
flex: 1;
text-align: center;
position: relative;
color: #fff;
font-size: 28px;
}
.header-tab .tab-active {
font-weight: 500;
}
.header-tab .active-line {
position: absolute;
width: 40px;
height: 4px;
background: #FFF;
top: 48px;
left: 50%;
transform: translate(-50%, -50%);
}
.area-content {
padding: 32px;
background-color: #fff;
img {
width: 42px;
vertical-align: middle;
margin-right: 16px;
}
.u-icon {
margin-left: 6px;
}
}
::v-deep .content {
padding: 0;
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,224 @@
<template>
<div class="page">
<div class="bg-blue"></div>
<div class="header-content">
<div class="left-content" flex>
<div class="fill">
<span>总积分</span>
<div class="info num" v-text="info.sysUserIntegral"/>
</div>
<div class="btn" @click="gotoGive">积分赠送</div>
</div>
<img src="https://cdn.cunwuyun.cn/dvcp/credit/head.png" alt="">
</div>
<div class="detail-content" v-if="list.length">
<div class="title">积分明细</div>
<div class="item" v-for="(item, index) in list" :key="index">
<div class="item-info">
<p v-text="item.eventDesc"/>
<span v-text="item.doTime"/>
</div>
<div class="item-num" :class="'color-'+ item.integralCalcType">
{{ (item.integralCalcType == 1 ? '+' : '-') + item.changeIntegral }}
</div>
</div>
</div>
<AiEmpty v-else/>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: "sysUserIntegral",
appName: "员工积分",
computed: {
...mapState(['user'])
},
data() {
return {
info: {},
list: [],
current: 1,
pages: 0
}
},
created() {
this.getInfo()
uni.$on("reachBottom2", () => {
this.current++;
this.getInfo()
})
uni.$on('updateIntegral', () => {
this.current = 1
this.list = []
this.getInfo()
})
},
methods: {
// 积分排行
getInfo() {
let {current, user: {id: userId}, info: {details}} = this
if (!details?.pages || current <= details.pages) {
this.$http.post('/app/appvillagerintegraldetail/sysUserIntegralList', null, {
params: {userId, current, size: 10}
}).then(res => {
if (res?.data) {
this.info = res.data
this.list = [this.list, res.data.details?.records || []].flat()
}
})
}
},
gotoGive() {
uni.navigateTo({url: "./giveIntegral"})
}
},
destroyed() {
uni.$off("reachBottom2")
uni.$off("onShow")
}
}
</script>
<style scoped lang="scss">
.page {
width: 100vw;
background-color: #f3f6f9;
.bg-blue {
width: 100%;
height: 176px;
background-color: #3975C6;
}
.header-content {
width: 690px;
height: 184px;
background: #FFF;
border-radius: 16px;
margin: -130px 0 40px 30px;
padding: 32px;
box-sizing: border-box;
position: relative;
.left-content {
position: absolute;
left: 32px;
right: 32px;
z-index: 99;
align-items: flex-end;
.btn {
border-radius: 28px;
border: 2px solid #3975C6;
padding: 0 28px;
line-height: 56px;
color: #3975C6;
}
}
span {
width: 140px;
color: #999;
}
.info {
height: 40px;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 40px;
}
.num {
margin-top: 20px;
font-size: 40px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #5AAD6A;
line-height: 48px;
margin-bottom: 10px;
}
img {
position: absolute;
width: 360px;
height: 250px;
top: -40px;
right: 0;
}
}
.mar-b4 {
margin-bottom: 8px;
}
.mar-b8 {
margin-bottom: 16px;
}
.detail-content {
width: 690px;
background: #FFF;
border-radius: 16px;
margin: 0 0 0 32px;
padding: 30px 30px 94px;
box-sizing: border-box;
.title {
font-size: 34px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 48px;
margin-bottom: 30px;
}
.item {
padding: 34px 0 32px 0;
border-bottom: 2px solid #ddd;
display: flex;
.item-info {
width: 500px;
p {
word-break: break-all;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333;
line-height: 44px;
}
span {
display: inline-block;
margin-top: 8px;
font-size: 24px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999;
line-height: 34px;
}
}
.item-num {
width: calc(100% - 500px);
text-align: right;
font-size: 36px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
line-height: 50px;
}
}
}
.color-1 {
color: #2C51CE !important;
}
.color-0 {
color: #E6736E !important;
}
}
</style>

View File

@@ -0,0 +1,491 @@
<template>
<section class="userRank">
<div class="area-content">
<AiAreaPicker :areaId="user.areaId" :value="areaId" @select="areaSelect" :name.sync="areaName" selectRoot>
<img src="./img/local-icon.png" alt="">
<span class="label" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span>
<u-icon name="arrow-down" color="#666" size="24"/>
</AiAreaPicker>
</div>
<u-gap height="6"/>
<div class="fill" v-if="info['列表'] && info['列表'].length">
<div class="ranking-content" v-if="info['列表'] && info['列表'].length">
<div class="item" v-if="info['列表'].length > 1">
<img
src="https://cdn.cunwuyun.cn/dvcp/credit/2.png"
alt=""
class="top-img"
/>
<img
:src="info['列表'][1].photo"
alt=""
class="user-img mar-b4"
v-if="info['列表'][1].photo"
/>
<div class="user-name-bg mar-b4" v-else>
{{ formatName(info["列表"][1].name) }}
</div>
<p class="user-name mar-b8">
{{ info["列表"][1].name }}{{ tabIndex == 0 ? "家" : "" }}
</p>
<p class="item-num">{{ info["列表"][1].integral }}</p>
</div>
<div class="item-top item" v-if="info['列表'].length > 0">
<img
src="https://cdn.cunwuyun.cn/dvcp/credit/1.png"
alt=""
class="top-img-one"
/>
<img
:src="info['列表'][0].photo"
alt=""
class="user-img mar-b4"
v-if="info['列表'][0].photo"
/>
<div class="user-name-bg mar-b4" v-else>
{{ formatName(info["列表"][0].name) }}
</div>
<p class="user-name mar-b8">
{{ info["列表"][0].name }}{{ tabIndex == 0 ? "家" : "" }}
</p>
<p class="item-num">{{ info["列表"][0].integral }}</p>
</div>
<div class="item" v-if="info['列表'].length > 2">
<img
src="https://cdn.cunwuyun.cn/dvcp/credit/3.png"
alt=""
class="top-img"
/>
<img
:src="info['列表'][2].photo"
alt=""
class="user-img mar-b4"
v-if="info['列表'][2].photo"
/>
<div class="user-name-bg mar-b4" v-else>
{{ formatName(info["列表"][2].name) }}
</div>
<p class="user-name mar-b8">
{{ info["列表"][2].name }}{{ tabIndex == 0 ? "家" : "" }}
</p>
<p class="item-num">{{ info["列表"][2].integral }}</p>
</div>
</div>
<u-gap height="6"/>
<div class="ranking-list" v-if="info['列表'] && info['列表'].length">
<div
class="item"
v-for="(item, index) in info['列表']"
:key="index"
v-if="index > 2"
>
<span class="item-num">{{ index + 1 }}</span>
<img
:src="item.photo"
alt=""
class="user-img mar-b4"
v-if="item.photo"
/>
<div class="user-name-bg mar-b4 mar-r24" v-else>
{{ formatName(item.name) }}
</div>
<span class="item-name">{{ item.name }}{{ tabIndex == 0 ? "家" : "" }}</span>
<span class="item-point">{{ item.integral }}</span>
</div>
</div>
</div>
<AiEmpty v-else/>
</section>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: "userRank",
appName: "个人积分",
computed: {
...mapState(['user'])
},
props: {
showDetail: { //true 积分明细 false积分排行
type: Boolean
}
},
data() {
return {
info: {},
current: 1,
list: [],
areaId: '',
areaName: '',
tabIndex: 1
}
},
created() {
this.areaId = this.user.areaId
this.areaName = this.user.areaName || ''
this.getInfo();
uni.$on("onShow", () => {
this.getInfo();
})
uni.$on("reachBottom1", () => {
if (this.list.length < 50) {
this.current++;
this.getInfo()
}
})
},
methods: {
areaSelect(e) {
this.areaId = e
this.getInfo()
},
// 积分排行
getInfo() {
this.info = {};
this.$http.post(`/app/appresident/rank-qw?type=${this.tabIndex}&areaId=${this.areaId}`).then((res) => {
if (res?.data) {
this.info = res.data;
}
});
},
formatName(name) {
if (name == undefined) {
return
}
return name.substr(name.length - 2, name.length > 2 ? (name.length - 1) : name.length)
},
},
destroyed() {
uni.$off("reachBottom1")
uni.$off("onShow")
}
}
</script>
<style scoped lang="scss">
.userRank {
width: 100vw;
background-color: #f3f6f9;
.bg-blue {
width: 100%;
height: 176px;
background-color: #3975C6;
}
.header-content {
width: 690px;
height: 256px;
background: #fff;
border-radius: 16px;
margin: -130px 0 40px 30px;
padding: 100px 60px 40px 60px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
position: relative;
.item {
text-align: center;
z-index: 99;
.num {
font-family: DIN;
font-size: 52px;
font-weight: bold;
line-height: 60px;
}
.label {
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 40px;
margin-top: 10px;
}
.color-5AAD6A {
color: #5aad6a;
}
.color-4185F5 {
color: #4185f5;
}
.color-CD413A {
color: #cd413a;
}
}
img {
position: absolute;
width: 360px;
height: 250px;
top: -40px;
right: 0;
}
}
.ranking-content {
padding: 94px 30px 0;
.item {
display: inline-block;
width: 216px;
height: 320px;
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.12);
border-radius: 12px;
padding: 40px 0 0 0;
text-align: center;
box-sizing: border-box;
position: relative;
vertical-align: top;
background: #fff;
.user-name {
font-size: 30px;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #333;
line-height: 42px;
word-break: break-all;
}
.item-num {
font-size: 46px;
font-weight: 6000;
color: #2c51ce;
line-height: 54px;
}
.top-img {
width: 100%;
height: 34px;
position: absolute;
top: -11px;
left: 0;
}
}
.item-top {
margin: -46px 20px 0;
height: 366px;
.user-img {
width: 104px;
height: 104px;
}
.user-name-bg {
width: 104px;
height: 104px;
border-radius: 50%;
background-color: #4e8eee;
font-size: 28px;
line-height: 104px;
text-align: center;
color: #fff;
}
.top-img-one {
width: 100%;
position: absolute;
top: -22px;
left: 0;
height: 46px;
}
}
}
.ranking-list {
background-color: #fff;
.item {
width: 100%;
height: 120px;
line-height: 120px;
background: #fff;
padding: 0 64px;
box-sizing: border-box;
.item-num {
display: inline-block;
width: 68px;
color: #858594;
font-size: 28px;
}
.user-img {
margin-right: 24px;
vertical-align: middle;
}
.item-name {
color: #333;
font-size: 30px;
display: inline-block;
width: 240px;
}
.item-point {
display: inline-block;
width: 210px;
text-align: right;
font-size: 30px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
}
.mar-r24 {
margin-right: 24px;
}
}
}
.user-img {
width: 80px;
height: 80px;
border-radius: 50%;
}
.user-name-bg {
display: inline-block;
width: 80px;
height: 80px;
border-radius: 50%;
background-color: #4e8eee;
font-size: 28px;
line-height: 80px;
text-align: center;
color: #fff;
}
.mar-b4 {
margin-bottom: 8px;
}
.mar-b8 {
margin-bottom: 16px;
}
.detail-content {
width: 690px;
background: #fff;
border-radius: 16px;
margin: 432px 0 0 32px;
padding: 30px 30px 94px;
box-sizing: border-box;
.title {
font-size: 34px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 48px;
margin-bottom: 30px;
}
.item {
padding: 34px 0 32px 0;
border-bottom: 2px solid #ddd;
display: flex;
.item-info {
width: 500px;
p {
word-break: break-all;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333;
line-height: 44px;
}
span {
display: inline-block;
margin-top: 8px;
font-size: 24px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999;
line-height: 34px;
}
}
.item-num {
width: calc(100% - 500px);
text-align: right;
font-size: 36px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
line-height: 50px;
}
}
}
.color-0 {
color: #2c51ce !important;
}
.color-1 {
color: #e6736e !important;
}
.fixed-top {
z-index: 999;
}
.header-tab {
height: 96px;
background-color: #3975C6;
padding: 20px 0;
display: flex;
align-items: center;
box-sizing: border-box;
}
.header-tab .tab-item {
flex: 1;
text-align: center;
position: relative;
color: #fff;
font-size: 28px;
}
.header-tab .tab-active {
font-weight: 500;
}
.header-tab .active-line {
position: absolute;
width: 40px;
height: 4px;
background: #FFF;
top: 48px;
left: 50%;
transform: translate(-50%, -50%);
}
.area-content {
padding: 32px;
background-color: #fff;
img {
width: 42px;
vertical-align: middle;
margin-right: 16px;
}
.u-icon {
margin-left: 6px;
}
}
::v-deep .content {
padding: 0;
}
}
</style>

View File

@@ -0,0 +1,103 @@
<template>
<section class="giveIntegral">
<AiGroup>
<AiItem label="选择对象" required>
<AiSelect v-model="form.objectType" dict="integralGiveObjType"/>
</AiItem>
<AiItem label="选择人员" required v-if="form.objectType">
<AiPagePicker v-if="form.objectType==0" single auditStatus="1" @select="handleSelectUser">
<AiMore v-model="form.userName"/>
</AiPagePicker>
<AiPagePicker v-if="form.objectType==1" single @select="handleSelectUser" type="sysUser">
<AiMore v-model="form.userName"/>
</AiPagePicker>
</AiItem>
</AiGroup>
<AiGroup>
<AiItem label="赠送分值" required topLabel>
<div slot="sub" class="color-999">(积分总额{{ info.sysUserIntegral || 0 }})</div>
<input v-model.number="form.integral"/>
</AiItem>
</AiGroup>
<AiBottomBtn text="确认赠送" @click="submit"/>
</section>
</template>
<script>
import {mapState} from "vuex";
export default {
name: "giveIntegral",
appName: "积分赠送",
computed: {
...mapState(['user'])
},
data() {
return {
info: {},
form: {userName: ""},
flag: false
}
},
methods: {
getInfo() {
let {user: {id: userId}} = this
this.$http.post('/app/appvillagerintegraldetail/sysUserIntegralList', null, {
params: {userId, current: 1, size: 10}
}).then(res => {
if (res?.data) {
this.info = res.data
}
})
},
submit() {
if(this.flag) return
let {objectType, userId, integral} = this.form
if (!objectType) {
return this.$u.toast("请选择对象")
}
if (!userId) {
return this.$u.toast("请选择人员")
}
if (isNaN(integral) || !/^\d*[.\d]\d?$/.test(integral)) {
return this.$u.toast("请输入赠送分值,最多保留一位小数")
}
this.flag = true
this.$http.post("/admin/user/giveIntegral", null, {
params: {...this.form}
}).then(res => {
if (res?.code == 0) {
uni.$emit("updateIntegral")
this.$u.toast("提交成功!")
uni.navigateBack({})
}else {
this.flag = false
this.$u.toast(res.msg)
}
}).catch((err) => {
this.flag = false
this.$u.toast(err)
})
},
handleSelectUser(v) {
this.form.userId = v?.[0]?.id || ""
this.form.userName = v?.[0]?.name || ""
}
},
created() {
this.getInfo()
this.$dict.load("integralGiveObjType")
}
}
</script>
<style lang="scss" scoped>
.giveIntegral {
width: 100vw;
min-height: 100vh;
.color-999 {
color: #999;
}
}
</style>

View File

@@ -0,0 +1,59 @@
<template>
<section class="integralRules">
<div v-for="(e,i) in list" :key="i" flex class="item">
<div class="fill label" v-text="e[0]"/>
<div class="fill" v-text="e[1]"/>
</div>
<AiEmpty v-if="!list.length"/>
</section>
</template>
<script>
export default {
name: "integralRules",
appName: "积分规则",
data() {
return {
list: [],
}
},
methods: {
getList() {
this.$http.post("/app/appintegralrule/girdMemberRuleInfo").then(res => {
if (res?.data) {
this.list = [res.data].flat().filter(Boolean).map(e => e.split(""))
}
})
}
},
created() {
this.getList()
}
}
</script>
<style lang="scss" scoped>
.integralRules {
width: 100vw;
display: flex;
flex-direction: column;
align-items: center;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
font-size: 36px;
line-height: 60px;
padding-top: 60px;
white-space: nowrap;
.item{
width: 100%;
}
.label {
text-align: right;
&:after {
content: "";
flex-shrink: 0;
}
}
}
</style>