提交 5a1225db authored 作者: 宋雄's avatar 宋雄

增加支付和积分页面

上级 2555e46d
...@@ -22,7 +22,10 @@ export const getPropertyLoginApi = (params = {}, config = {})=> { ...@@ -22,7 +22,10 @@ export const getPropertyLoginApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> { return new Promise((resolve, reject)=> {
http.get('/property-community/wechat/wxUser/login', http.get('/property-community/wechat/wxUser/login',
{ {
data: { ...params}, data: {
...params,
type: 'owner'
},
...config ...config
}) })
.then(res=> { resolve(res) }) .then(res=> { resolve(res) })
...@@ -624,3 +627,18 @@ export const payOrderApi = (params = {}, config = {})=> { ...@@ -624,3 +627,18 @@ export const payOrderApi = (params = {}, config = {})=> {
.catch(err=> { reject(err) }) .catch(err=> { reject(err) })
}) })
} }
// 查询业主可用积分
export const queryIntegralByOwnerIdApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> {
http.get('/property-community/integral/ownerIntegral/queryIntegralByOwnerId',
{
data: {
...params
},
...config
})
.then(res=> { resolve(res) })
.catch(err=> { reject(err) })
})
}
\ No newline at end of file
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* 接口参数 * 接口参数
*/ */
const serverConfig = { const serverConfig = {
// baseURL: "https://life.cloud.hjxbc.cn", baseURL: "https://life.cloud.hjxbc.cn",
imageURL: "https://life.cloud.hjxbc.cn/sys/common/static/", imageURL: "https://life.cloud.hjxbc.cn/sys/common/static/",
baseURL: "http://192.168.0.104:9999", // baseURL: "http://192.168.0.106:9999",
// baseURL: "http://192.168.0.119:9999", // baseURL: "http://192.168.0.119:9999",
// baseURL: "http://220.203.25.212:9999", /* 根域名 */ // baseURL: "http://220.203.25.212:9999", /* 根域名 */
// baseURL: "http://114.67.111.37:8001" /* 根域名 */ // baseURL: "http://114.67.111.37:8001" /* 根域名 */
......
...@@ -126,6 +126,11 @@ ...@@ -126,6 +126,11 @@
"navigationBarTitleText": "投诉详情", "navigationBarTitleText": "投诉详情",
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
} }
},{
"path": "pages/pay/index",
"style": {
"navigationBarTitleText": "支付"
}
}, { }, {
"path": "pages/payCost/index", "path": "pages/payCost/index",
"style": { "style": {
...@@ -231,6 +236,16 @@ ...@@ -231,6 +236,16 @@
"navigationBarTitleText": "汉星科技", "navigationBarTitleText": "汉星科技",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{
"path": "pages/integralList/index",
"style": {
"navigationBarTitleText": "我的积分"
}
},{
"path": "pages/integralRecord/index",
"style": {
"navigationBarTitleText": "积分记录"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
<template>
<view class="container">
<view class="top">
<view class="current-box">
<view class="text">可使用积分</view>
<view class="use-box">
1000
<text class="unit"></text>
</view>
<view class="total-box">
<text class="text">当前总积分:</text>
<text class="integral">2000</text>
<text class="unit"></text>
<text style="margin-left:50rpx" class="text">冻结积分:</text>
<text class="integral">1000</text>
<text class="unit"></text>
</view>
</view>
<view class="link">
<view class="accumulate-box">
<view class="text">累计获得</view>
<view class="value">
<text class="integral">10000</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 style="margin-left:5px" class="unit"></text>
</view>
</view>
<view class="accumulate-box">
<view class="text">累计节省</view>
<view class="value">
<text class="unit"></text>
<text class="integral">80</text>
</view>
</view>
</view>
</view>
<view class="list">
<view class="title-box" @click="onLookAll">
<view class="title">近30天记录</view>
<view class="more">
<text class="text">查看全部</text>
<image src="../../static/images/icon_more.png" class="icon"></image>
</view>
</view>
<view class="item-box" v-for="item in 5" :key="item">
<view>
<view class="describe">支付订单</view>
<view class="date-time">2017-05-01 15:00</view>
</view>
<view class="compute">{{item % 2 ? '+' : '-'}}5</view>
</view>
</view>
<!-- <no-data :show="payList.length === 0" text="暂无缴费信息"></no-data> -->
</view>
</template>
<script>
import {
communityPaymentApi
} 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: []
}
},
methods: {
async getList(chargeTypeCode) {
let {result} = await communityPaymentApi({chargeTypeCode})
this.payList = result.records
},
toRecord(type) {
if(type == 1){
uni.navigateTo({
url: '/pages/payCostStatistical/index',
});
}else if(type == 2){
uni.navigateTo({
url: '/pages/payCostRecord/index',
});
}
},
onLookAll() {
uni.navigateTo({
url: "/pages/integralRecord/index"
});
}
},
onLoad(option) {
}
}
</script>
<style>
page {
background-color: #F8F6F9;
}
</style>
<style lang="scss" scoped>
.container {
padding: 30rpx;
}
.top {
border-radius: 16rpx;
background-color: #E8E5FF;
margin-bottom: 30rpx;
.current-box {
// 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');
// border-radius: 16rpx;
padding: 40rpx;
line-height: 1;
.text {
font-size: 28rpx;
color: #D5DCFF;
}
.use-box {
font-size: 60rpx;
font-weight: bold;
color: #FFFFFF;
margin-top: 20rpx;
.unit {
font-size: 28rpx;
font-weight: 400;
margin-left: 5px;
}
}
.total-box {
margin-top: 40rpx;
font-size: 0;
.integral {
font-size: 32rpx;
font-weight: bold;
color: #ffffff;
margin: 0 5px;
}
.unit {
font-size: 12px;
color: #ffffff;
}
}
}
.link {
display: flex;
padding: 30rpx 0;
.accumulate-box {
flex: auto;
width: 33%;
font-size: 0;
text-align: center;
position: relative;
&:not(:last-child) {
&::after {
content: " ";
position: absolute;
top: 5%;
right: 0;
width: 0;
height: 90%;
border-left: 1rpx solid #D6D3EC;
z-index: 1;
}
}
.text {
font-size: 28rpx;
color: #8B7FE8;
}
.value {
margin-top: 10rpx;
color: #6A59F2;
.integral {
font-size: 32rpx;
font-weight: bold;
}
.unit {
font-size: 12px;
}
}
}
}
}
.list {
background-color: #FFFFFF;
box-shadow: 0rpx 0rpx 25rpx 0rpx rgba(81,89,234,0.06);
border-radius: 16rpx;
padding: 0 30rpx;
.title-box {
height: 86rpx;
display: flex;
justify-content: space-between;
align-items: center;
.title {
line-height: 1;
font-size: 32rpx;
font-weight: bold;
color: #373737;
padding-left: 18rpx;
border-left: 3px solid #6852F0;
}
.more {
.text {
color: #9D9CA6;
font-size: 28rpx;
}
.icon {
width: 15rpx;
height: 24rpx;
vertical-align: middle;
margin-left: 20rpx;
}
}
}
.item-box {
height: 130rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1rpx solid #F0F0F2;
line-height: 1;
.describe {
font-size: 32rpx;
color: #373737;
}
.date-time {
font-size: 28rpx;
color: #9D9CA6;
margin-top: 20rpx;
}
.compute {
font-size: 36rpx;
font-weight: bold;
color: #6A59F2;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="container">
<view class="list">
<view class="title-box" @click="onLookAll">
<view class="title">2017年5月</view>
<view class="statistics">
<text class="text">获得:</text>
<text class="text">300</text>
<text style="margin-left: 10px" class="text">使用:</text>
<text class="text">30</text>
</view>
</view>
<view class="item-box" v-for="item in 5" :key="item">
<view>
<view class="describe">支付订单</view>
<view class="date-time">2017-05-01 15:00</view>
</view>
<view class="compute">{{item % 2 ? '+' : '-'}}5</view>
</view>
</view>
<!-- <no-data :show="payList.length === 0" text="暂无缴费信息"></no-data> -->
</view>
</template>
<script>
import {
communityPaymentApi
} from '@/config/api.js'
import noData from '@/components/no-data/no-data'
export default {
components: {noData},
data() {
return {
payList: []
}
},
methods: {
async getList(chargeTypeCode) {
let {result} = await communityPaymentApi({chargeTypeCode})
this.payList = result.records
},
toRecord(type) {
if(type == 1){
uni.navigateTo({
url: '/pages/payCostStatistical/index',
});
}else if(type == 2){
uni.navigateTo({
url: '/pages/payCostRecord/index',
});
}
},
onLookAll() {
uni.navigateTo({
url: "/pages/integralRecord/index"
});
}
},
onLoad(option) {
}
}
</script>
<style>
page {
background-color: #F8F6F9;
}
</style>
<style lang="scss" scoped>
.container {
padding: 30rpx;
}
.list {
background-color: #FFFFFF;
box-shadow: 0rpx 0rpx 25rpx 0rpx rgba(81,89,234,0.06);
border-radius: 16rpx;
padding: 0 30rpx;
margin-bottom: 30rpx;
.title-box {
padding: 30rpx 0;
.title {
line-height: 1;
font-size: 34rpx;
font-weight: bold;
color: #373737;
}
.statistics {
margin-top: 18rpx;
font-size: 0;
.text {
color: #9D9CA6;
font-size: 28rpx;
}
}
}
.item-box {
height: 130rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1rpx solid #F0F0F2;
line-height: 1;
.describe {
font-size: 32rpx;
color: #373737;
}
.date-time {
font-size: 28rpx;
color: #9D9CA6;
margin-top: 20rpx;
}
.compute {
font-size: 36rpx;
font-weight: bold;
color: #6A59F2;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="container">
<view class="property">
<view class="address-title">
XXX小区 3号楼 2单元 102 业主
</view>
<view class="details">
<view class="title">
<view class="name">
<view class="cost">3000</view>
</view>
<view class="tag">费用期间:2022-11-21</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>
<view class="content">
<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>
</view>
</view>
</view>
<view class="form-submit" @click="onSubmit">支付</view>
</view>
</template>
<script>
import {
queryIntegralByOwnerIdApi
} from '@/config/api.js'
export default {
data() {
return {
userName: '',
userPhone: '',
platformName: '',
payType: '1',
payDetail: {}
}
},
methods: {
radioChange(evt) {
console.log(evt.detail.value)
this.payType = evt.detail.value
},
async getDetail(id) {
let res = await communityPaymentDetailApi({id})
this.payDetail = res.result
},
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));
}
});
},
async getMessage() {
let res = await queryIntegralByOwnerIdApi({ownerId: 111})
}
},
onLoad(options) {
this.userName = uni.getStorageSync('user_name')
this.userPhone = uni.getStorageSync('user_phone')
this.platformName = uni.getStorageSync('platform_name')
this.getMessage()
}
}
</script>
<style>
page {
background-color: #F8F6F9;
}
.input-placeholder {
font-size: 14px;
color: #CECED3;
}
</style>
<style lang="scss" scoped>
.container {
padding: 30rpx;
.form-submit {
height: 80rpx;
line-height: 80rpx;
background-color: #6A59F2;
border-radius: 80rpx;
width: 100%;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
margin-top: 60rpx;
}
}
.property {
box-shadow: 0 0 25rpx 0 rgba(81,89,234,0.06);
border-radius: 16rpx;
overflow: hidden;
.address-title {
width: 100%;
height: 70rpx;
background-color: #E8E5FF;
line-height: 70rpx;
text-align: center;
font-size: 32rpx;
color: #6A59F2;
}
.details {
background-color: #ffffff;
padding:60rpx 30rpx 0 30rpx;
.title {
margin-bottom: 60rpx;
display: flex;
flex-direction: column;
text-align: center;
align-items: center;
.name {
height: 60rpx;
line-height: 60rpx;
font-size: 28rpx;
color: #6A59F2;
display: flex;
.cost {
font-size: 60rpx;
color: #6A59F2;
font-weight: bold;
margin-right: 20rpx;
}
}
.tag {
margin-top: 30rpx;
font-size: 12px;
color: #B6B6BA;
}
}
.content {
border-top: 1px solid #F0F0F2;
padding: 20rpx 0;
.text {
height: 60rpx;
line-height: 60rpx;
font-size: 28rpx;
color: #373737;
&.illustrate {
color: #F1BD4D;
}
}
.integral-input {
box-sizing: border-box;
padding: 0 10px;
color: #373737;
height: 88rpx;
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;
}
}
}
}
}
}
</style>
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</view> </view>
</view> </view>
<view class="list"> <view class="list">
<view class="item" v-for="item in payList" :key="item.id" @click="toDetail(item.id)"> <view class="item" v-for="item in payList" :key="item.id" @click="toDetail(item)">
<view class="title"> <view class="title">
<view class="name"> <view class="name">
{{item.chargeTypeName}}<view class="cost">¥{{item.totalAmount}}</view> {{item.chargeTypeName}}<view class="cost">¥{{item.totalAmount}}</view>
...@@ -99,10 +99,16 @@ ...@@ -99,10 +99,16 @@
}); });
} }
}, },
toDetail(id) { toDetail(item) {
if(item.chargeTypeCode === 'SFLX00001') {
uni.navigateTo({ uni.navigateTo({
url: `/pages/payCostDetails/index?id=${id}`, url: `/pages/pay/index?id=${item.id}`
}); });
} else {
uni.navigateTo({
url: `/pages/payCostDetails/index?id=${item.id}`
});
}
} }
}, },
onLoad(option) { onLoad(option) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论