提交 e9730bcb authored 作者: 宋雄's avatar 宋雄

提交二期功能

上级 5a1225db
......@@ -631,10 +631,79 @@ export const payOrderApi = (params = {}, config = {})=> {
// 查询业主可用积分
export const queryIntegralByOwnerIdApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> {
http.get('/property-community/integral/ownerIntegral/queryIntegralByOwnerId',
http.get('/property-central/wechat/integral/queryIntegralByPhone',
{
data: {
...params
...params,
phone: uni.getStorageSync('user_phone'),
platformCode: uni.getStorageSync('platform_code')
},
...config
})
.then(res=> { resolve(res) })
.catch(err=> { reject(err) })
})
}
// 支付物业费
export const payPropertyFeeApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> {
http.post('/property-community/wechat/communityPayment/payPropertyFee',
{
...params,
platformCode: uni.getStorageSync('platform_code')
},
{ ...config })
.then(res=> { resolve(res) })
.catch(err=> { reject(err) })
})
}
// 查询业主积分列表
export const getOwnerIntegralApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> {
http.get('/property-central/wechat/integral/getOwnerIntegral',
{
data: {
...params,
phone: uni.getStorageSync('user_phone'),
platformCode: uni.getStorageSync('platform_code')
},
...config
})
.then(res=> { resolve(res) })
.catch(err=> { reject(err) })
})
}
// 查询业主积分近30天明细
export const ownerIntegralListApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> {
http.get('/property-central/wechat/integral/ownerIntegralList',
{
data: {
...params,
pageSize: 10,
phone: uni.getStorageSync('user_phone'),
platformCode: uni.getStorageSync('platform_code')
},
...config
})
.then(res=> { resolve(res) })
.catch(err=> { reject(err) })
})
}
// 查询业主全部积分明细
export const ownerIntegralRecordsApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> {
http.get('/property-central/wechat/integral/ownerIntegralRecords',
{
data: {
...params,
pageSize: 10,
phone: uni.getStorageSync('user_phone'),
platformCode: uni.getStorageSync('platform_code')
},
...config
})
......
......@@ -2,9 +2,10 @@
* 接口参数
*/
const serverConfig = {
baseURL: "https://life.cloud.hjxbc.cn",
imageURL: "https://life.cloud.hjxbc.cn/sys/common/static/",
// baseURL: "http://192.168.0.106:9999",
// baseURL: "https://life.cloud.hjxbc.cn",
// imageURL: "https://life.cloud.hjxbc.cn/sys/common/static/",
imageURL: "https://life.test.hjxbc.cn/sys/common/static/",
baseURL: "https://life.test.hjxbc.cn",
// baseURL: "http://192.168.0.119:9999",
// baseURL: "http://220.203.25.212:9999", /* 根域名 */
// baseURL: "http://114.67.111.37:8001" /* 根域名 */
......
......@@ -4,15 +4,15 @@
<view class="current-box">
<view class="text">可使用积分</view>
<view class="use-box">
1000
{{integralInfo.availableIntegral || 0}}
<text class="unit"></text>
</view>
<view class="total-box">
<text class="text">当前总积分:</text>
<text class="integral">2000</text>
<text class="integral">{{integralInfo.totalIntegral || 0}}</text>
<text class="unit"></text>
<text style="margin-left:50rpx" class="text">冻结积分:</text>
<text class="integral">1000</text>
<text class="integral">{{integralInfo.freezeIntegral || 0}}</text>
<text class="unit"></text>
</view>
</view>
......@@ -20,14 +20,14 @@
<view class="accumulate-box">
<view class="text">累计获得</view>
<view class="value">
<text class="integral">10000</text>
<text class="integral">{{integralInfo.getIntegral || 0}}</text>
<text style="margin-left:5px" class="unit"></text>
</view>
</view>
<view class="accumulate-box">
<view class="text">累计使用</view>
<view class="value">
<text class="integral">10000</text>
<text class="integral">{{integralInfo.useIntegral || 0}}</text>
<text style="margin-left:5px" class="unit"></text>
</view>
</view>
......@@ -35,7 +35,7 @@
<view class="text">累计节省</view>
<view class="value">
<text class="unit"></text>
<text class="integral">80</text>
<text class="integral">{{integralInfo.deductionAmount || 0}}</text>
</view>
</view>
</view>
......@@ -48,12 +48,12 @@
<image src="../../static/images/icon_more.png" class="icon"></image>
</view>
</view>
<view class="item-box" v-for="item in 5" :key="item">
<view class="item-box" v-for="item in integralList" :key="item.id">
<view>
<view class="describe">支付订单</view>
<view class="date-time">2017-05-01 15:00</view>
<view class="describe">{{item.type === 'scanQrCodePay' ? '扫码支付' : '抵扣物业费'}}</view>
<view class="date-time">{{item.createTime}}</view>
</view>
<view class="compute">{{item % 2 ? '+' : '-'}}5</view>
<view class="compute">{{item.integralChange < 0 ? item.integralChange : ('+' + item.integralChange)}}</view>
</view>
</view>
<!-- <no-data :show="payList.length === 0" text="暂无缴费信息"></no-data> -->
......@@ -62,27 +62,31 @@
<script>
import {
communityPaymentApi
getOwnerIntegralApi,
ownerIntegralListApi,
} from '@/config/api.js'
import noData from '@/components/no-data/no-data'
const freeType = [
{code: 'SFLX00001', name: '物业费'},
{code: 'SFLX00002', name: '水费'},
{code: 'SFLX00003', name: '电费'},
{code: 'SFLX00004', name: '燃气费'},
{code: 'SFLX00005', name: '暖气费'}
]
export default {
components: {noData},
data() {
return {
payList: []
integralInfo: {},
integralList: [],
pageNo: 1
}
},
methods: {
async getList(chargeTypeCode) {
let {result} = await communityPaymentApi({chargeTypeCode})
this.payList = result.records
async getMessage() {
let {result} = await getOwnerIntegralApi({})
result['freezeIntegral'] = (result.systemFreezeIntegral + result.manualFreezeIntegral).toFixed(2).replace('.00', '')
result['totalIntegral'] = (Number(result.freezeIntegral) + result.availableIntegral).toFixed(2).replace('.00', '')
this.integralInfo = {...result}
},
async getList() {
let {result} = await ownerIntegralListApi({
pageNo: this.pageNo
})
this.integralList = [...result.records]
},
toRecord(type) {
if(type == 1){
......@@ -101,8 +105,9 @@
});
}
},
onLoad(option) {
onLoad() {
this.getMessage()
this.getList()
}
}
</script>
......@@ -125,7 +130,7 @@
// background-position: top center;
background-repeat: no-repeat;
background-size: 100% 100%;
background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/scott/pic/5bGvHZsW4Yzc268a39033927a853f8a4ce5bc5521418_1690965501478.png');
background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/miniapp/bg_jifen.png');
// border-radius: 16rpx;
padding: 40rpx;
line-height: 1;
......
<template>
<view class="container">
<view class="list">
<view class="title-box" @click="onLookAll">
<view class="title">2017年5月</view>
<view class="title-box">
<!-- <view class="title">2017年5月</view> -->
<uni-datetime-picker v-model="range" type="daterange" @change="onRangeChange" />
<view class="statistics">
<text class="text">获得:</text>
<text class="text">300</text>
<text class="text">{{getIntegral}}</text>
<text style="margin-left: 10px" class="text">使用:</text>
<text class="text">30</text>
<text class="text">{{useIntegral}}</text>
</view>
</view>
<view class="item-box" v-for="item in 5" :key="item">
<view class="item-box" v-for="item in payList" :key="item.id">
<view>
<view class="describe">支付订单</view>
<view class="date-time">2017-05-01 15:00</view>
<view class="describe">{{item.type === 'scanQrCodePay' ? '扫码支付' : '抵扣物业费'}}</view>
<view class="date-time">{{item.createTime}}</view>
</view>
<view class="compute">{{item % 2 ? '+' : '-'}}5</view>
<view class="compute">{{item.integralChange < 0 ? item.integralChange : ('+' + item.integralChange)}}</view>
</view>
</view>
<!-- <no-data :show="payList.length === 0" text="暂无缴费信息"></no-data> -->
<no-data :show="payList.length === 0" text="暂无缴费信息"></no-data>
</view>
</template>
<script>
import {
communityPaymentApi
ownerIntegralRecordsApi
} from '@/config/api.js'
import noData from '@/components/no-data/no-data'
export default {
components: {noData},
data() {
return {
getIntegral: 0,
useIntegral: 0,
pageNo: 1,
range: [],
payList: []
}
},
methods: {
async getList(chargeTypeCode) {
let {result} = await communityPaymentApi({chargeTypeCode})
this.payList = result.records
onRangeChange(val) {
this.pageNo = 1
this.range = val
this.getList()
},
async getList() {
let {result} = await ownerIntegralRecordsApi({
pageNo: this.pageNo,
startDate: this.range[0] || '',
endDate: this.range[1] || ''
})
this.payList = result.pageList.records
this.getIntegral = result.getIntegral
this.useIntegral = result.useIntegral * -1
},
toRecord(type) {
if(type == 1){
......@@ -49,15 +65,10 @@
url: '/pages/payCostRecord/index',
});
}
},
onLookAll() {
uni.navigateTo({
url: "/pages/integralRecord/index"
});
}
},
onLoad(option) {
onLoad() {
this.getList()
}
}
</script>
......
......@@ -74,6 +74,13 @@
</view>
<image src="../../static/images/icon_more.png" class="arrow"></image>
</view>
<view class="item" @click="quickEntry(9)">
<view class="left">
<image src="../../static/images/user06.png" class="icon"></image>
<div class="title">我的积分</div>
</view>
<image src="../../static/images/icon_more.png" class="arrow"></image>
</view>
</template>
<view v-if="isEmployee && userType !== '2'" class="item" @click="quickEntry(8)">
<view class="left">
......@@ -189,6 +196,10 @@
uni.navigateTo({
url: '/pages/myReceipt/index',
});
} else if (type == 9) {
uni.navigateTo({
url: '/pages/integralList/index',
});
} else {
return false
}
......
......@@ -2,27 +2,32 @@
<view class="container">
<view class="property">
<view class="address-title">
XXX小区 3号楼 2单元 102 业主
{{pageInfo.platformName}} {{pageInfo.buildingName}} {{pageInfo.unitName}} {{pageInfo.roomName}} {{pageInfo.userName}}
</view>
<view class="details">
<view class="title">
<view class="name">
<view class="cost">3000</view>
<view class="cost">{{pageInfo.totalAmount}}</view>
</view>
<view class="tag">费用期间:2022-11-21</view>
<view class="tag">费用期间:{{pageInfo.createTime}}</view>
</view>
<view class="content">
<view class="text">使用积分:</view>
<input :cursor-spacing="10" placeholder-class="input-placeholder" class="integral-input" type="number" placeholder="请输入使用积分数量(可不输入)" />
<view class="text illustrate">当前可用1000积分,可抵扣¥1元</view>
<view class="input-box">
<input v-model="currentUse" :disabled="ownerIntegral === 0" :cursor-spacing="10" placeholder-class="input-placeholder" class="integral-input" type="number" placeholder="请输入使用积分数量(可不输入)" />
<button :disabled="ownerIntegral === 0" class="mini-btn" type="primary" size="mini" @click="onUseAll">使用全部</button>
</view>
<view class="content">
<view class="text illustrate">当前可用{{ownerIntegral}}积分,可抵扣¥{{deductionIntegral}}</view>
</view>
<view class="content flex">
<view class="text">缴费方式:</view>
<radio-group class="radio-group" @change="radioChange">
<label class="radio"><radio style="transform:scale(0.7)" color="#6A59F2" value="1" :checked="payType === '1'" />一键缴费</label>
<label class="radio"><radio style="transform:scale(0.7)" color="#6A59F2" value="2" :checked="payType === '2'"/>季度缴费</label>
<label class="radio"><radio style="transform:scale(0.7)" color="#6A59F2" value="3" :checked="payType === '3'"/>年度缴费</label>
</radio-group>
<!-- <radio-group class="radio-group">
<label class="radio" v-for="item in radioList" :key="item.value">
<radio disabled style="transform:scale(0.7)" color="#6A59F2" :value="item.value" :checked="pageInfo.chargeCycle === item.value" />
{{item.label}}
</label>
</radio-group> -->
<view class="text">{{chargeCycleName}}</view>
</view>
</view>
</view>
......@@ -32,48 +37,120 @@
<script>
import {
queryIntegralByOwnerIdApi
queryIntegralByOwnerIdApi,
payPropertyFeeApi
} from '@/config/api.js'
export default {
data() {
return {
pageInfo: {
id: '',
ownerId: '',
userName: '',
userPhone: '',
platformName: '',
payType: '1',
payDetail: {}
}
buildingName: '',
unitName: '',
roomName: '',
roomId: '',
createTime: '',
totalAmount: '',
chargeCycle: ''
},
methods: {
radioChange(evt) {
console.log(evt.detail.value)
this.payType = evt.detail.value
currentUse: '',
payUsePoints: 1,
ownerIntegral: 0,
deductionIntegral: 0
}
},
async getDetail(id) {
let res = await communityPaymentDetailApi({id})
this.payDetail = res.result
computed: {
chargeCycleName() {
let chargeCycleList = [
{label: '每月', value: '1'},
{label: '每季度', value: '2'},
{label: '每年', value: '3'},
{label: '一次性付清', value: '4'},
{label: '预付', value: '5'},
]
let row = chargeCycleList.find(item=>item.value === this.pageInfo.chargeCycle)
return row ? row.label : ''
}
},
onSubmit() {
uni.requestPayment({
provider: 'alipay',
orderInfo: 'orderInfo', //微信、支付宝订单数据 【注意微信的订单信息,键值应该全部是小写,不能采用驼峰命名】
success: function (res) {
console.log('success:' + JSON.stringify(res));
methods: {
onUseAll() {
this.currentUse = this.ownerIntegral
},
fail: function (err) {
console.log('fail:' + JSON.stringify(err));
async onSubmit() {
// uni.requestPayment({
// provider: 'alipay',
// orderInfo: 'orderInfo', //微信、支付宝订单数据 【注意微信的订单信息,键值应该全部是小写,不能采用驼峰命名】
// success: function (res) {
// console.log('success:' + JSON.stringify(res));
// },
// fail: function (err) {
// console.log('fail:' + JSON.stringify(err));
// }
// });
let payAmount = Number(this.pageInfo.totalAmount)
let deductionAmount = 0
if(this.currentUse) {
deductionAmount = (Number(this.currentUse) / this.payUsePoints).toFixed(2)
payAmount = (payAmount - Number(deductionAmount)).toFixed(2)
}
let res = await payPropertyFeeApi({
paymentId: this.pageInfo.id,
ownerId: this.pageInfo.ownerId,
ownerPhone: this.pageInfo.userPhone,
deductionAmount,
payAmount,
useIntegral: this.currentUse || 0,
platformName: this.pageInfo.platformName,
residentName: this.pageInfo.userName,
})
if(res.success) {
var pages = getCurrentPages();
var page = pages[pages.length - 2];
page.$vm.getList()
setTimeout(()=> {
uni.showToast({
title: '支付成功!',
icon: 'none'
});
setTimeout(()=> {
uni.navigateBack()
}, 1500)
}, 30)
} else {
uni.showToast({
title: res.message,
icon: 'none'
});
}
},
async getMessage() {
let res = await queryIntegralByOwnerIdApi({ownerId: 111})
async getMessage(ownerId) {
let res = await queryIntegralByOwnerIdApi({ownerId})
this.payUsePoints = res.result.payUsePoints
this.ownerIntegral = res.result.ownerIntegral
this.deductionIntegral = res.result.deductionIntegral
}
},
onLoad(options) {
this.userName = uni.getStorageSync('user_name')
this.userPhone = uni.getStorageSync('user_phone')
this.platformName = uni.getStorageSync('platform_name')
this.getMessage()
let info = JSON.parse(options.params)
this.pageInfo = {
id: info.id,
ownerId: info.ownerId,
userName: uni.getStorageSync('user_name'),
userPhone: uni.getStorageSync('user_phone'),
platformName: uni.getStorageSync('platform_name'),
buildingName: info.buildingName,
unitName: info.unitName,
roomName: info.roomName,
roomId: info.roomId,
createTime: info.createTime,
totalAmount: info.totalAmount,
chargeCycle: info.chargeCycle
}
this.getMessage(info.ownerId)
}
}
</script>
......@@ -150,10 +227,13 @@
}
}
.content {
border-top: 1px solid #F0F0F2;
padding: 20rpx 0;
&.flex {
display: flex;
justify-content: space-between;
}
.text {
height: 60rpx;
line-height: 60rpx;
......@@ -171,17 +251,17 @@
border: 1px solid #F0F0F2;
border-radius: 10rpx;
}
.radio-group {
margin-top: 20rpx;
margin-left: -4px;
.radio {
font-size: 28rpx;
color: #373737;
&:not(:last-child) {
margin-right: 5px;
}
}
}
// .radio-group {
// margin-top: 20rpx;
// margin-left: -4px;
// .radio {
// font-size: 28rpx;
// color: #373737;
// &:not(:last-child) {
// margin-right: 5px;
// }
// }
// }
}
}
}
......
......@@ -101,8 +101,19 @@
},
toDetail(item) {
if(item.chargeTypeCode === 'SFLX00001') {
let params = {
id: item.id,
ownerId: item.ownerId,
createTime: item.createTime,
buildingName: item.buildingName,
unitName: item.unitName,
roomName: item.roomName,
roomId: item.roomId,
totalAmount: item.totalAmount,
chargeCycle: item.chargeCycle
}
uni.navigateTo({
url: `/pages/pay/index?id=${item.id}`
url: `/pages/pay/index?params=${JSON.stringify(params)}`
});
} else {
uni.navigateTo({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论