mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-23 21:36:38 +08:00
业主端加入积分功能
This commit is contained in:
parent
b1207889b4
commit
36d5588401
49
components/owner/tips.vue
Normal file
49
components/owner/tips.vue
Normal file
@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="cu-modal" :class="showTips==true?'show':''">
|
||||
<view class="cu-dialog">
|
||||
<view class="cu-bar bg-white justify-end">
|
||||
<view class="content">{{title}}</view>
|
||||
<view class="action" @tap="_cancleTip()">
|
||||
<text class="cuIcon-close text-red"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-xl">
|
||||
<view >{{content}}</view>
|
||||
</view>
|
||||
<view class="cu-bar bg-white justify-end">
|
||||
<view class="action margin-0 flex-sub solid-left" @tap="_cancleTip()">关闭</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"tips",
|
||||
data() {
|
||||
return {
|
||||
showTips:false,
|
||||
title:'',
|
||||
content:''
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
openTip:function(_title,_content){
|
||||
|
||||
this.title = _title;
|
||||
this.content = _content;
|
||||
this.showTips = true;
|
||||
console.log('openTip',this.showTips)
|
||||
},
|
||||
_cancleTip:function(){
|
||||
this.showTips = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@ -15,7 +15,7 @@ const baseUrl = '/';
|
||||
|
||||
// #ifndef H5
|
||||
//服务器域名 小程序 或者 app 时 后端地址
|
||||
const baseUrl = 'http://demo.homecommunity.cn/';
|
||||
const baseUrl = 'http://127.0.0.1:8008/';
|
||||
// #endif
|
||||
|
||||
let commonBaseUrl = 'http://demo.homecommunity.cn/';
|
||||
|
||||
@ -7,6 +7,29 @@
|
||||
<view class="money-value">{{money}}</view>
|
||||
</view>
|
||||
|
||||
<view class="padding-sm">
|
||||
<view class="block__title">使用积分</view>
|
||||
<checkbox-group @change="_checkIntegral" >
|
||||
<view class="cu-list menu">
|
||||
<view class="cu-item ">
|
||||
<view class="content padding-tb-sm">
|
||||
<view>
|
||||
<view class="text-cut" style="width:220px">
|
||||
<!---->
|
||||
<checkbox value="Y" v-if="integral <=0" disabled="true"/>
|
||||
<checkbox value="Y" v-else/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action">
|
||||
<text class="text-grey text-sm">{{integral}}个积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</checkbox-group>
|
||||
<view class="text-right" @click="_viewGetIntegral()">如何获取积分?</view>
|
||||
</view>
|
||||
|
||||
<view class="cu-bar btn-group" style="margin-top: 30px;" v-if="!appId">
|
||||
<button disabled="disabled" class="cu-btn bg-blue shadow-blur round lg">确认支付</button>
|
||||
</view>
|
||||
@ -14,6 +37,8 @@
|
||||
<button @click="_submit" class="cu-btn bg-blue shadow-blur round lg" :disabled="banButton">确认支付</button>
|
||||
</view>
|
||||
|
||||
<tips ref="tipRef"></tips>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -35,10 +60,20 @@
|
||||
cashierPayFee
|
||||
} from '../../api/fee/feeApi.js';
|
||||
|
||||
import tips from '@/components/owner/tips.vue';
|
||||
|
||||
import {
|
||||
hasLogin
|
||||
} from '../../api/user/sessionApi.js';
|
||||
import {
|
||||
queryUserIntegral
|
||||
} from '@/api/user/userApi.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
communityId: '',
|
||||
orgMoney:0.0,
|
||||
money: 0.0,
|
||||
business: '',
|
||||
openId: '',
|
||||
@ -47,6 +82,9 @@
|
||||
appId: '',
|
||||
cashierUserId: '',
|
||||
banButton: false, // 禁用支付按钮
|
||||
useIntegral:'N',
|
||||
integral: 0,
|
||||
integralMoney:0,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -85,9 +123,19 @@
|
||||
|
||||
|
||||
this.money = options.money;
|
||||
this.orgMoney = options.money;
|
||||
this.business = options.business;
|
||||
this.data = uni.getStorageSync('doing_cashier');
|
||||
|
||||
if (hasLogin()) {
|
||||
//todo 如果登录了查询用户积分
|
||||
this._loadUserIntegral();
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
components: {
|
||||
tips
|
||||
},
|
||||
methods: {
|
||||
_loadAppId: function(_call) {
|
||||
@ -111,7 +159,6 @@
|
||||
redirectUrl: _redirectUrl,
|
||||
wAppId: this.appId,
|
||||
}).then(_data => {
|
||||
console.log(_data, 123)
|
||||
if (_data.code == 0) {
|
||||
window.location.href = _data.data.openUrl;
|
||||
return;
|
||||
@ -164,15 +211,51 @@
|
||||
_data.appId = this.appId;
|
||||
_data.cashierUserId = this.cashierUserId;
|
||||
_data.openId = this.openId;
|
||||
_data.useIntegral = this.useIntegral;
|
||||
cashierPayFee(this, _data)
|
||||
},
|
||||
_loadUserIntegral: function() {
|
||||
let _that = this;
|
||||
queryUserIntegral({
|
||||
page: 1,
|
||||
row: 1,
|
||||
}).then(_data=>{
|
||||
_that.integral = _data.integral;
|
||||
_that.integralMoney = _data.integralMoney;
|
||||
})
|
||||
},
|
||||
_checkIntegral:function(e){
|
||||
console.log(e);
|
||||
|
||||
let _value = e.detail.value;
|
||||
if(!_value || _value.length < 1){
|
||||
this.useIntegral = 'N';
|
||||
this.money = this.orgMoney;
|
||||
return;
|
||||
}
|
||||
|
||||
this.useIntegral = 'N';
|
||||
this.money = parseFloat(this.orgMoney) - parseFloat(this.integralMoney);
|
||||
this.money = this.money.toFixed(2);
|
||||
},
|
||||
_viewGetIntegral: function() {
|
||||
|
||||
let _content = "您可以到商城购物或者物业缴费的方式获取积分,积分可以用来物业缴费和商城购物."
|
||||
this.$refs.tipRef.openTip('如何获取积分?', _content);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.block__title {
|
||||
margin: 0;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
color: rgba(69, 90, 100, .6);
|
||||
padding: 0rpx 30rpx 20rpx;
|
||||
}
|
||||
|
||||
.money-info {
|
||||
height: 400upx;
|
||||
margin: 20upx;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user