|
@@ -96,8 +96,34 @@
|
|
|
<label>住宅面积:</label>
|
|
<label>住宅面积:</label>
|
|
|
<input type="text" class="card input" v-model="house.area" disabled/>
|
|
<input type="text" class="card input" v-model="house.area" disabled/>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="tel flex">
|
|
|
|
|
+ <label>{{ conf.nameRequired ? '*' : '' }}姓名:</label>
|
|
|
|
|
+ <input type="text" class="card input" v-model="band_name" placeholder="请输入姓名" maxlength="20"/>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="tel flex">
|
|
|
|
|
+ <label>{{ conf.phoneRequired ? '*' : '' }}手机号:</label>
|
|
|
|
|
+ <input type="number" class="card input" v-model="band_phone" placeholder="请输入手机号" maxlength="11"/>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="tel flex">
|
|
|
|
|
+ <label>{{ conf.idRequired ? '*' : '' }}身份证号:</label>
|
|
|
|
|
+ <input type="idcard" class="card input" v-model="band_id" placeholder="请输入身份证号" maxlength="18"/>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="agree-row" v-if="conf.agreeContent" @tap="agreed = !agreed">
|
|
|
|
|
+ <checkbox :checked="agreed" color="#02a7f0" style="transform: scale(0.8);" />
|
|
|
|
|
+ <text>我已阅读并同意</text>
|
|
|
|
|
+ <text class="agree-link" @tap.stop="showAgreement">《{{ conf.agreeTitle || '供暖缴费协议' }}》</text>
|
|
|
|
|
+ </view>
|
|
|
<button class="submit" @tap="houseSubmit">提交</button>
|
|
<button class="submit" @tap="houseSubmit">提交</button>
|
|
|
|
|
+ <view class="agree-mask" v-if="showAgree" @tap="showAgree = false" @touchmove.stop.prevent>
|
|
|
|
|
+ <view class="agree-box" @tap.stop>
|
|
|
|
|
+ <view class="agree-title">{{ conf.agreeTitle || '供暖缴费协议' }}</view>
|
|
|
|
|
+ <scroll-view scroll-y class="agree-content">
|
|
|
|
|
+ <u-parse :content="conf.agreeContent" />
|
|
|
|
|
+ </scroll-view>
|
|
|
|
|
+ <button class="agree-close" @tap="showAgree = false">关闭</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
<uni-popup ref="popup" :mask-click="false">
|
|
<uni-popup ref="popup" :mask-click="false">
|
|
|
<view class="popup-box" style="height: 400rpx;">
|
|
<view class="popup-box" style="height: 400rpx;">
|
|
|
<view>
|
|
<view>
|
|
@@ -121,12 +147,27 @@
|
|
|
<script>
|
|
<script>
|
|
|
import md5 from "@/common/md5.js";
|
|
import md5 from "@/common/md5.js";
|
|
|
import jPicker from '../../components/J-Picker/jPicker.vue';
|
|
import jPicker from '../../components/J-Picker/jPicker.vue';
|
|
|
|
|
+import uParse from '@/components/gaoyia-parse/parse.vue';
|
|
|
|
|
+import validate from '@/common/ys-validate.js';
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
- jPicker
|
|
|
|
|
|
|
+ jPicker,
|
|
|
|
|
+ uParse
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ band_name: '',
|
|
|
|
|
+ band_phone: '',
|
|
|
|
|
+ band_id: '',
|
|
|
|
|
+ agreed: false,
|
|
|
|
|
+ showAgree: false,
|
|
|
|
|
+ conf: {
|
|
|
|
|
+ nameRequired: false,
|
|
|
|
|
+ phoneRequired: false,
|
|
|
|
|
+ idRequired: false,
|
|
|
|
|
+ agreeTitle: '',
|
|
|
|
|
+ agreeContent: '',
|
|
|
|
|
+ },
|
|
|
house: {
|
|
house: {
|
|
|
name: "",
|
|
name: "",
|
|
|
num: "",
|
|
num: "",
|
|
@@ -150,8 +191,59 @@ export default {
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
this.searchHood()
|
|
this.searchHood()
|
|
|
|
|
+ this.loadConf()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 解析 conf 接口返回:*_flag 为 "1" 表示必填
|
|
|
|
|
+ applyConf(d){
|
|
|
|
|
+ if (!d || typeof d !== 'object') return;
|
|
|
|
|
+ const pick = (...keys) => {
|
|
|
|
|
+ for (let k of keys) {
|
|
|
|
|
+ if (d[k] !== undefined && d[k] !== null) return d[k];
|
|
|
|
|
+ }
|
|
|
|
|
+ return '';
|
|
|
|
|
+ };
|
|
|
|
|
+ const isOn = (v) => v === true || v === 1 || v === '1' || v === 'true' || v === 'yes';
|
|
|
|
|
+ this.conf = {
|
|
|
|
|
+ nameRequired: isOn(pick('band_name_flag')),
|
|
|
|
|
+ phoneRequired: isOn(pick('band_phone_flag')),
|
|
|
|
|
+ idRequired: isOn(pick('band_id_flag')),
|
|
|
|
|
+ agreeTitle: pick('band_title'),
|
|
|
|
|
+ agreeContent: pick('band_content'),
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ loadConf(){
|
|
|
|
|
+ let md5Sign = md5(
|
|
|
|
|
+ "method=" +
|
|
|
|
|
+ "conf" +
|
|
|
|
|
+ "×tamp=" +
|
|
|
|
|
+ getApp().globalData.globalTimestamp +
|
|
|
|
|
+ "&secret=" +
|
|
|
|
|
+ getApp().globalData.secret
|
|
|
|
|
+ );
|
|
|
|
|
+ let url =
|
|
|
|
|
+ getApp().globalData.shareUrl +
|
|
|
|
|
+ "api/api.php" +
|
|
|
|
|
+ "?method=conf×tamp=" +
|
|
|
|
|
+ getApp().globalData.globalTimestamp +
|
|
|
|
|
+ "&sign=" +
|
|
|
|
|
+ md5Sign;
|
|
|
|
|
+ uni.request({
|
|
|
|
|
+ url: url,
|
|
|
|
|
+ method: "GET",
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ if (res.data && res.data.code === 200) {
|
|
|
|
|
+ this.applyConf(res.data.data);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: () => {
|
|
|
|
|
+ console.log("连接失败");
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ showAgreement(){
|
|
|
|
|
+ this.showAgree = true;
|
|
|
|
|
+ },
|
|
|
searchHood(){
|
|
searchHood(){
|
|
|
let that = this;
|
|
let that = this;
|
|
|
this.hoodList = [];
|
|
this.hoodList = [];
|
|
@@ -362,6 +454,35 @@ export default {
|
|
|
houseSubmit(){
|
|
houseSubmit(){
|
|
|
//uni.navigateBack({});
|
|
//uni.navigateBack({});
|
|
|
//this.open()
|
|
//this.open()
|
|
|
|
|
+ if (!this.numList.length || !this.numList[this.numIndex].name || this.numList[this.numIndex].name === '请选择房号') {
|
|
|
|
|
+ uni.showToast({ title: "请选择房号", icon: "none" });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let name = this.band_name.trim(), phone = this.band_phone.trim(), id = this.band_id.trim();
|
|
|
|
|
+ if (this.conf.nameRequired && !name) {
|
|
|
|
|
+ uni.showToast({ title: "请输入姓名", icon: "none" });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.conf.phoneRequired && !phone) {
|
|
|
|
|
+ uni.showToast({ title: "请输入手机号", icon: "none" });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (phone && !validate.isPhone(phone)) {
|
|
|
|
|
+ uni.showToast({ title: "请输入正确的手机号", icon: "none" });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.conf.idRequired && !id) {
|
|
|
|
|
+ uni.showToast({ title: "请输入身份证号", icon: "none" });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (id && !validate.isIdCard(id)) {
|
|
|
|
|
+ uni.showToast({ title: "请输入正确的身份证号", icon: "none" });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.conf.agreeContent && !this.agreed) {
|
|
|
|
|
+ uni.showToast({ title: "请先阅读并同意供暖缴费协议", icon: "none" });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
let that = this;
|
|
let that = this;
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
title: "确定关联此住房信息吗?",
|
|
title: "确定关联此住房信息吗?",
|
|
@@ -465,8 +586,11 @@ export default {
|
|
|
"&sign=" +
|
|
"&sign=" +
|
|
|
md5Sign;
|
|
md5Sign;
|
|
|
let postData = {
|
|
let postData = {
|
|
|
- address:addressResult,
|
|
|
|
|
|
|
+ address:addressResult,
|
|
|
openId: getApp().globalData.open_id,
|
|
openId: getApp().globalData.open_id,
|
|
|
|
|
+ band_name: this.band_name.trim(),
|
|
|
|
|
+ band_phone: this.band_phone.trim(),
|
|
|
|
|
+ band_id: this.band_id.trim().toUpperCase(),
|
|
|
};
|
|
};
|
|
|
uni.request({
|
|
uni.request({
|
|
|
url: url,
|
|
url: url,
|
|
@@ -546,9 +670,65 @@ export default {
|
|
|
width: 55%;
|
|
width: 55%;
|
|
|
border-radius: 20rpx;
|
|
border-radius: 20rpx;
|
|
|
background-color: #02a7f0;
|
|
background-color: #02a7f0;
|
|
|
- margin: 120rpx auto;
|
|
|
|
|
|
|
+ margin: 30rpx auto 120rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .agree-row {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ font-size: 26rpx;
|
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
|
+ .agree-link {
|
|
|
|
|
+ color: #02a7f0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .agree-mask {
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ z-index: 999;
|
|
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ }
|
|
|
|
|
+ .agree-box {
|
|
|
|
|
+ width: 620rpx;
|
|
|
|
|
+ max-height: 80vh;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border-radius: 20rpx;
|
|
|
|
|
+ padding: 24rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ .agree-title {
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ padding-bottom: 16rpx;
|
|
|
|
|
+ border-bottom: 1px solid #d8d8d8;
|
|
|
|
|
+ }
|
|
|
|
|
+ .agree-content {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ min-height: 300rpx;
|
|
|
|
|
+ max-height: 60vh;
|
|
|
|
|
+ margin: 20rpx 0;
|
|
|
|
|
+ font-size: 26rpx;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
|
+ word-break: break-all;
|
|
|
|
|
+ }
|
|
|
|
|
+ .agree-close {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ background-color: #02a7f0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.popup-box {
|
|
.popup-box {
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
display: flex;
|
|
display: flex;
|