This commit is contained in:
2023-10-16 11:21:27 +08:00
parent 2e86312ba6
commit 619abedc69
11 changed files with 202 additions and 128 deletions

View File

@ -1,12 +1,22 @@
import request from "../../request.js"
export function prizeExchangelist(data, region) {
export function scorelist(data) {
return request({
url: `/applet/score/prizeExchange/list`,
url: `/applet/score/list`,
method: 'get',
data: data,
header: {
region: uni.getStorageSync('region'),
}
})
}
}
//总积分
export function scoretotal(cardNo) {
return request({
url: `/applet/score/total/${cardNo}`,
method: 'get',
header: {
region: uni.getStorageSync('region'),
}
})
}

View File

@ -1,6 +1,6 @@
import request from "../../request.js"
export function prizelist(data, region) {
export function prizelist(data) {
return request({
url: `/applet/score/prize/list`,
method: 'get',
@ -9,4 +9,15 @@ export function prizelist(data, region) {
region: uni.getStorageSync('region'),
}
})
}
}
//兑换奖品
export function prizeExchangesave(data) {
return request({
url: `/applet/score/prizeExchange/save`,
method: 'post',
data: data,
header: {
region: uni.getStorageSync('region'),
}
})
}

View File

@ -1,7 +1,7 @@
import request from "@/api/request.js"
// 获取区划列表
export function arealist(pid, region) {
export function arealist(pid) {
return request({
url: `/applet/signinfo/area/list/${pid}`,
method: 'get',
@ -12,7 +12,7 @@ export function arealist(pid, region) {
}
//提交签约
export function applysave(data, region) {
export function applysave(data) {
return request({
url: `/applet/sign/apply/save`,
method: 'post',
@ -24,7 +24,7 @@ export function applysave(data, region) {
}
//人群
export function getCrowd(identity, region) {
export function getCrowd(identity) {
return request({
url: `/applet/signinfo/getCrowd/${identity}`,
method: 'get',
@ -35,7 +35,7 @@ export function getCrowd(identity, region) {
}
//服务包
export function getPackageByCrowdNo(data, region) {
export function getPackageByCrowdNo(data) {
return request({
url: `/applet/signinfo/getPackageByCrowdNo`,
method: 'post',
@ -44,4 +44,4 @@ export function getPackageByCrowdNo(data, region) {
region: uni.getStorageSync('region'),
}
})
}
}

View File

@ -316,7 +316,8 @@
"path": "exchangerecords/exchangerecords",
"style": {
"navigationBarTitleText": "兑换记录",
"enablePullDownRefresh": false
"onReachBottomDistance": 40, // px
"enablePullDownRefresh": true //true
}
}, {
"path": "familymemberdetail/familymemberdetail",
@ -551,4 +552,4 @@
}
]
}
}
}

View File

@ -9,11 +9,12 @@
margin: 0 auto;
.content {
position: relative;
image {
width: 100%;
height: 319rpx;
}
.Exchangerecords {
width: 180rpx;
height: 54rpx;
@ -38,23 +39,21 @@
text-align: center;
line-height: 54rpx;
}
.name {
width: 90%;
height: 100rpx;
font-size: 30rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;
position: absolute;
top: 10%;
left: 5%;
line-height: 33rpx;
}
.number {
font-size: 56rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;
position: absolute;
@ -66,26 +65,21 @@
}
}
.bottomitem{
position: relative;
background-color: #FFF;
margin: 0 auto;
padding-bottom: 100rpx;
.item{
position: relative;
}
.Establishingarchives{
font-size: 30rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #333333;
line-height: 38rpx;
padding: 8px 10px 5px 18px;
}
.integraltwo{
position: absolute;
top: 75%;
right: 3%;
color: red;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: red !important;
}
.integral{
position: absolute;
@ -98,7 +92,6 @@
}
.timeone{
font-size: 20rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #333333;
line-height: 38rpx;
@ -107,7 +100,6 @@
}
.PointsRecord {
font-size: 30rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #000000;
line-height: 33rpx;
@ -115,6 +107,6 @@
}
}
}
}
}

View File

@ -5,7 +5,7 @@
<image src="/static/pagesB/Behave.png" mode=""></image>
<view class="name">我的积分
</view>
<view class="number">1000
<view class="number">{{score?score:0}}
</view>
<view class="PointsMall" @tap='gointegral'>
积分商城
@ -18,32 +18,31 @@
<view class="PointsRecord">
积分记录
</view>
<view class="Establishingarchives">
建立档案
</view>
<view class="integral">
+20000
</view>
<view class="timeone">
2023-03-09 13:23:12
</view>
<view class="Establishingarchives">
兑换商品
</view>
<view class="integraltwo">
-2000000000
</view>
<view class="timeone">
2023-03-09 13:23:12
<view class="" v-if="list&&list.length>0">
<view class="item" v-for="item in list">
<view class="Establishingarchives">
{{item.actName}}
</view>
<view class="integral" v-if="item.score>0">
{{'+'+item.score}}
</view>
<view class="integral integraltwo" v-else>
{{item.score}}
</view>
<view class="timeone">
{{item.scoreDate}}
</view>
</view>
</view>
<u-empty v-else mode="list" icon-size='220' text='暂无积分记录'></u-empty>
</view>
</view>
</view>
</template>
<script>
import {
prizeExchangelist
scorelist,
scoretotal
} from '@/api/pagesB/Behaviorpoints/index.js'
// import {
// mapActions
@ -52,20 +51,27 @@
data() {
return {
query: {
identity: '372325195905293621',
identity: uni.getStorageSync('userinfo').cardNo,
pageNum: 1,
pageSize: 10,
},
list: [],
list: null,
total: 0,
score: 0,
};
},
onLoad() {
this.info();
this.scoretotalinfo();
},
methods: {
scoretotalinfo() {
scoretotal(this.query.identity).then(res => {
this.score = res.data
})
},
info() {
prizeExchangelist(this.query, '2').then(res => {
scorelist(this.query).then(res => {
this.list = res.rows
this.total = res.total
})
@ -98,7 +104,7 @@
onReachBottom() { //
if (this.list.length >= this.total) {} else {
this.query.pageNum++
prizeExchangelist(this.query, '1').then(res => {
scorelist(this.query).then(res => {
if (res.rows) {
res.rows.forEach(e => {
this.list.push(e)
@ -118,4 +124,4 @@
</script>
<style lang="scss">
@import './Behaviorpoints.scss'
</style>
</style>

View File

@ -1,45 +1,66 @@
<template>
<view class="app">
<view class="content" v-for="item in list">
<image :src="item.attachment" mode=""></image>
<view class="servename">
{{item.prizeName}}
<view class="contents" v-if="list&&list.length>0">
<view class="content" v-for="item in list">
<image :src="item.attachment" mode=""></image>
<view class="servename">
{{item.prizeName?item.prizeName:''}}
</view>
<view class="PointsRecord">
{{item.score?item.score:''}}积分
</view>
<view class="button" @tap="goexchange(item)">
兑换
</view>
</view>
<view class="PointsRecord">
{{item.score}}
</view>
<view class="button" @tap="goexchange">
兑换
<view style="width: 48%;" v-if="list.length%2!=0">
</view>
</view>
<u-empty v-else mode="list" icon-size='220' text='暂无可兑换商品'></u-empty>
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
prizelist
prizelist,
prizeExchangesave
} from '@/api/pagesB/PointsMall/index.js'
export default {
data() {
return {
query: {
identity: '372325195905293621',
identity: uni.getStorageSync('userinfo').cardNo,
pageNum: 1,
pageSize: 10,
},
list: [],
list: null,
total: 0,
};
},
methods: {
goexchange() {
uni.navigateTo({
url: '/pagesB/exchangerecords/exchangerecords'
});
goexchange(item) {
var obj = {
identity: this.query.identity,
prizeId: item.prizeId
}
prizeExchangesave(obj).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '兑换成功',
type: 'success',
})
} else {
this.$refs.uToast.show({
title: res.msg,
type: 'error',
})
}
})
},
info() {
prizelist(this.query, '2').then(res => {
prizelist(this.query).then(res => {
this.list = res.rows
this.total = res.total
})
@ -51,7 +72,7 @@
onReachBottom() { //
if (this.list.length >= this.total) {} else {
this.query.pageNum++
prizelist(this.query, '1').then(res => {
prizelist(this.query).then(res => {
if (res.rows) {
res.rows.forEach(e => {
this.list.push(e)
@ -72,13 +93,16 @@
<style lang="scss">
.app {
background-color: #F7F5F5;
padding-top: 10rpx;
height: 100vh;
display: flex;
width: 100%;
flex-wrap: wrap;
justify-content: space-evenly;
::v-deep .u-empty{
margin-top: 25vh !important;
}
.contents {
padding-top: 10rpx;
display: flex;
width: 100%;
flex-wrap: wrap;
justify-content: space-evenly;
}
.content {
height: 514rpx;
@ -128,4 +152,4 @@
}
}
}
</style>
</style>

View File

@ -1,43 +1,83 @@
<template>
<view class="app">
<view class="content">
<view class="time">
2023-08-13 23:43:49
<span>
2000积分
</span>
</view>
<view class="imageitem">
<image src="../../static/pagesB/Behave.png" mode=""></image>
</view>
<view class="servename">
服务名称
</view>
<view class="servetime">
服务时间2023-12-12 08:30
<view class="" v-if="list&&list.length>0">
<view class="content" v-for="item in list">
<view class="time">
{{item.exchangeDate?item.exchangeDate:''}}
<span>
{{item.score?item.score:0}} 积分
</span>
</view>
<image :src="item.prizeBase64" mode=""></image>
<view class="servename">
{{item.prizeName?item.prizeName:''}}
</view>
<view class="servetime" v-if='item.useDate'>
服务时间{{item.useDate}}
</view>
</view>
</view>
<u-empty v-else mode="list" icon-size='220' text='暂无兑换记录'></u-empty>
</view>
</template>
<script>
import {
prizeExchangelist
} from '@/api/pagesB/exchangerecords/index.js'
export default {
data() {
return {
query: {
identity: uni.getStorageSync('userinfo').cardNo,
pageNum: 1,
pageSize: 10,
},
list: [],
total: 0,
};
}
},
onLoad() {
this.info()
},
methods: {
info() {
prizeExchangelist(this.query).then(res => {
this.list = res.rows
this.total = res.total
})
},
},
onReachBottom() { //
if (this.list.length >= this.total) {} else {
this.query.pageNum++
prizeExchangelist(this.query).then(res => {
if (res.rows) {
res.rows.forEach(e => {
this.list.push(e)
})
}
})
}
},
onPullDownRefresh() { //
this.query.pageNum = 1;
this.info();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
}
</script>
<style lang="scss">
.app {
width: 100%;
height: 100vh;
text-align: justify;
background-color: #F7F5F5;
padding: 25rpx 0 30rpx 0;
::v-deep .u-empty{
margin-top: 25vh !important;
}
.content {
width: 90%;
height: 321rpx;
@ -48,21 +88,18 @@
position: relative;
.servetime {
font-size: 28rpx;
font-family: Source Han Sans CN;
font-size: 26rpx;
font-weight: 400;
color: #959595;
line-height: 38rpx;
position: absolute;
bottom: 23%;
left: 35%;
text-align: justify;
}
.servename {
font-size: 32rpx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #333333;
line-height: 38rpx;
@ -74,21 +111,18 @@
white-space: nowrap;
}
.imageitem {
image {
position: absolute;
left: 3%;
top: 28%;
image {
width: 180rpx;
height: 180rpx;
}
width: 180rpx;
height: 180rpx;
}
.time {
text-align: justify;
padding: 25rpx 0 0 20rpx;
font-size: 28rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #000000;
line-height: 38rpx;
@ -100,7 +134,6 @@
white-space: nowrap;
font-size: 28rpx;
position: absolute;
font-family: Source Han Sans CN;
font-weight: 500;
color: #26A888;
line-height: 38rpx;
@ -110,4 +143,4 @@
}
}
</style>
</style>

View File

@ -164,8 +164,7 @@
},
//
detailinfo() {
// detail(uni.getStorageSync('userinfo').cardNo, this.region).then(res => {
detail('372424194703207523', '1').then(res => {
detail(uni.getStorageSync('userinfo').cardNo).then(res => {
if (res.code == 200) {
this.list = res.data
this.list.rescindType = null

View File

@ -349,14 +349,14 @@
this.query.county = e[0].value
this.query.countyName = e[0].label
const pid = this.countylist.find(m => m.areaCode === e[0].value).id
this.arealistinfo(pid, '1', 'Township')
this.arealistinfo(pid, 'Township')
},
//
Townshipconfirm(e) {
this.query.town = e[0].value
this.query.townName = e[0].label
const pid = this.Townshiplist.find(m => m.streetCode === e[0].value).id
this.arealistinfo(pid, '1', 'village')
this.arealistinfo(pid, 'village')
},
//
villageconfirm(e) {
@ -364,8 +364,8 @@
this.query.committeeName = e[0].label
},
//list
arealistinfo(code, code2, list) {
arealist(code, code2).then(res => {
arealistinfo(code, list) {
arealist(code).then(res => {
if (list == 'county') {
this.countylist = res.data
} else if (list == 'Township') {
@ -442,7 +442,7 @@
},
//list
getCrowdinfo() {
getCrowd('370882199909092123', '1').then(res => {
getCrowd(uni.getStorageSync('userinfo').cardNo).then(res => {
res.data.forEach(e => {
e.checked = false
})
@ -515,7 +515,7 @@
},
},
onLoad(options) {
this.arealistinfo('371400000000 ', '1', 'county');
this.arealistinfo('371400000000 ', 'county');
this.getCrowdinfo();
let date = new Date();
let year = date.getFullYear();

View File

@ -190,14 +190,12 @@
this.signatureshow = false
},
info() {
getSignProtocol(this.cardNo, '1').then(res => {
getSignProtocol(uni.getStorageSync('userinfo').cardNo, '1').then(res => {
this.list = res.data
})
},
},
onLoad(options) {
this.cardNo = options.cardNo
this.cardNo = '372424194703207523'
this.info();
},
}