1
This commit is contained in:
@@ -14,10 +14,14 @@
|
|||||||
</image>
|
</image>
|
||||||
<text class="card-title">{{paymentType+'费'}}</text>
|
<text class="card-title">{{paymentType+'费'}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 分割线 -->
|
<!-- 分割线 -->
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
|
<view class="input-item">
|
||||||
|
<view class="input-label">缴费单位</view>
|
||||||
|
<text class="company-name">XXXXXXXX有限公司</text>
|
||||||
|
</view>
|
||||||
|
<!-- 分割线 -->
|
||||||
|
<view class="line"></view>
|
||||||
<!-- 设备号输入项 -->
|
<!-- 设备号输入项 -->
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<view class="input-label">缴费设备号</view>
|
<view class="input-label">缴费设备号</view>
|
||||||
@@ -26,8 +30,9 @@
|
|||||||
<input class="input" placeholder="请输入设备号" placeholder-class="input-placeholder"
|
<input class="input" placeholder="请输入设备号" placeholder-class="input-placeholder"
|
||||||
v-model="deviceNo" />
|
v-model="deviceNo" />
|
||||||
<!-- 右边扫码图标 text标签直接用 双端不乱码 -->
|
<!-- 右边扫码图标 text标签直接用 双端不乱码 -->
|
||||||
<image class="scanTheCodeIconStyle" src="http://47.104.199.163:9090/images/propertyImgs/scanTheCodeIcon.png"
|
<image class="scanTheCodeIconStyle"
|
||||||
@click="scanCode"></image>
|
src="http://47.104.199.163:9090/images/propertyImgs/scanTheCodeIcon.png" @click="scanCode">
|
||||||
|
</image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -38,13 +43,13 @@
|
|||||||
|
|
||||||
<!-- 底部协议和提交按钮 -->
|
<!-- 底部协议和提交按钮 -->
|
||||||
<view class="bottom-area">
|
<view class="bottom-area">
|
||||||
<view class="agreement">
|
<!-- <view class="agreement">
|
||||||
<checkbox-group @change="handleAgreeChange">
|
<checkbox-group @change="handleAgreeChange">
|
||||||
<checkbox :checked="isAgree" />
|
<checkbox :checked="isAgree" />
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
<text class="agreement-text">我已阅并同意</text>
|
<text class="agreement-text">我已阅并同意</text>
|
||||||
<text class="agreement-link" @click="handleProtocol">《协议链接》</text>
|
<text class="agreement-link" @click="handleProtocol">《协议链接》</text>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
|
|
||||||
<button class="submit-btn" @click="goPay">
|
<button class="submit-btn" @click="goPay">
|
||||||
@@ -68,124 +73,124 @@
|
|||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import {
|
||||||
onReady: function(e) {},
|
ref,
|
||||||
components: {
|
onMounted,
|
||||||
|
computed
|
||||||
|
|
||||||
},
|
} from 'vue'
|
||||||
|
import {
|
||||||
|
onShow,
|
||||||
|
onReady,
|
||||||
|
onReachBottom,
|
||||||
|
onLoad,
|
||||||
|
onUnload,
|
||||||
|
onPullDownRefresh
|
||||||
|
} from '@dcloudio/uni-app'
|
||||||
|
|
||||||
computed: {
|
// 响应式数据
|
||||||
|
const paymentType = ref(uni.getStorageSync('addPaymentType'))
|
||||||
|
const deviceNo = ref('')
|
||||||
|
const isAgree = ref(false)
|
||||||
|
const scanResult = ref('')
|
||||||
|
|
||||||
|
// 生命周期
|
||||||
|
onMounted(() => {})
|
||||||
|
|
||||||
|
// 协议勾选
|
||||||
|
const handleAgreeChange = (e) => {
|
||||||
|
isAgree.value = e.detail.value.length > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// 扫码
|
||||||
},
|
const scanCode = async () => {
|
||||||
created() {
|
try {
|
||||||
|
uni.showLoading({
|
||||||
},
|
title: '扫码中...',
|
||||||
onShow() {
|
mask: true
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {},
|
|
||||||
|
|
||||||
onReady() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
paymentType: uni.getStorageSync('addPaymentType'),
|
|
||||||
deviceNo: '', // 设备号
|
|
||||||
isAgree: false, // 是否同意协议
|
|
||||||
|
|
||||||
|
const res = await uni.scanCode({
|
||||||
|
onlyFromCamera: false,
|
||||||
|
scanType: ['qrCode', 'barCode']
|
||||||
|
})
|
||||||
|
|
||||||
|
// 扫码成功,赋值
|
||||||
|
deviceNo.value = res.result
|
||||||
|
scanResult.value = res.result
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: '扫码成功',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
uni.hideLoading()
|
||||||
|
console.log('扫码失败', err)
|
||||||
|
uni.showToast({
|
||||||
|
title: '扫码取消/失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交缴费
|
||||||
|
const goPay = () => {
|
||||||
|
if (!deviceNo.value) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入设备号',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// if (!isAgree.value) {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '请同意协议',
|
||||||
|
// icon: 'none'
|
||||||
|
// })
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
|
uni.showModal({
|
||||||
|
title: '确认提交',
|
||||||
|
content: '确认要提交吗?',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '提交中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '提交成功',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
goNext()
|
||||||
|
}, 2500)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
|
}
|
||||||
|
const handleProtocol = () => {
|
||||||
methods: {
|
|
||||||
handleAgreeChange(e) {
|
|
||||||
// e.detail.value 是数组,有值 = 选中,空 = 未选中
|
|
||||||
this.isAgree = e.detail.value.length > 0
|
|
||||||
},
|
|
||||||
// 扫码获取设备号 【uniapp+微信小程序双端兼容】
|
|
||||||
async scanCode() {
|
|
||||||
try {
|
|
||||||
const res = await uni.scanCode({
|
|
||||||
onlyFromCamera: false, // 允许相册+相机
|
|
||||||
scanType: ['qrCode', 'barCode'] // 支持二维码+条形码
|
|
||||||
})
|
|
||||||
// 扫码结果赋值给设备号输入框
|
|
||||||
this.deviceNo = res.result
|
|
||||||
} catch (err) {
|
|
||||||
console.log('扫码取消/失败', err)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 缴费提交
|
|
||||||
goPay() {
|
|
||||||
if (!this.deviceNo) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入设备号',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!this.isAgree) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请同意协议',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.showModal({
|
|
||||||
title: '确认提交',
|
|
||||||
content: '确认要提交吗?',
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '提交中...',
|
|
||||||
mask: true
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.showToast({
|
|
||||||
title: '提交成功',
|
|
||||||
icon: 'success'
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
setTimeout(() => {
|
|
||||||
// 提交成功后跳转列表页
|
|
||||||
uni.hideLoading();
|
|
||||||
this.goNext()
|
|
||||||
}, 2500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
goNext() {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pageSubPack/payment-list/addPaymentSuccess',
|
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
goBack() {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pageSubPack/payment-list/paymentIndex',
|
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// 跳转成功页
|
||||||
|
const goNext = () => {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pageSubPack/payment-list/addPaymentSuccess'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
const goBack = () => {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pageSubPack/payment-list/paymentIndex'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<view class="info-card">
|
<view class="info-card">
|
||||||
<view class="form-item" @click="goToChange()">
|
<view class="form-item" @click="goToChange()">
|
||||||
<text class="label">缴费单位</text>
|
<text class="label">缴费单位</text>
|
||||||
<text class="company-name">XXXXXXXX燃气有限公司</text>
|
<text class="company-name">XXXXXXXX有限公司</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="grid-list">
|
<view class="grid-list">
|
||||||
|
|
||||||
<view class="grid-item" v-for="(item, index) in addList" :key="index" @click="goToAdd(item)">
|
<view class="grid-item" v-for="(item, index) in addList" :key="index" @click="goToAdd(item)">
|
||||||
<view class="icon-box" :class="item.iconClass">
|
<view class="icon-box" :class="item.iconClass">
|
||||||
<image class="iconStyle" :src="item.icon"></image>
|
<image class="iconStyle" :src="item.icon"></image>
|
||||||
@@ -98,7 +98,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
name: '暖气费',
|
// name: '暖气费',
|
||||||
|
name: '物业费',
|
||||||
|
|
||||||
status: '',
|
status: '',
|
||||||
address: '山东省日照市东港区桂花园(别墅)2号楼2层',
|
address: '山东省日照市东港区桂花园(别墅)2号楼2层',
|
||||||
icon: "http://47.104.199.163:9090/images/propertyImgs/heating.png",
|
icon: "http://47.104.199.163:9090/images/propertyImgs/heating.png",
|
||||||
@@ -106,7 +108,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
name: '电费',
|
// name: '电费',
|
||||||
|
name: '物业费',
|
||||||
status: '已欠费',
|
status: '已欠费',
|
||||||
address: '山东省日照市东港区桂花园(别墅)2号楼2层',
|
address: '山东省日照市东港区桂花园(别墅)2号楼2层',
|
||||||
icon: "http://47.104.199.163:9090/images/propertyImgs/electric.png",
|
icon: "http://47.104.199.163:9090/images/propertyImgs/electric.png",
|
||||||
@@ -115,37 +118,43 @@
|
|||||||
],
|
],
|
||||||
// 新增缴费列表数据
|
// 新增缴费列表数据
|
||||||
addList: [{
|
addList: [{
|
||||||
name: "燃气",
|
// name: "燃气",
|
||||||
|
name: '物业',
|
||||||
type: "gas",
|
type: "gas",
|
||||||
icon: "http://47.104.199.163:9090/images/propertyImgs/gas.png",
|
icon: "http://47.104.199.163:9090/images/propertyImgs/gas.png",
|
||||||
iconClass: "gas"
|
iconClass: "gas"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "水",
|
// name: "水",
|
||||||
|
name: '物业',
|
||||||
type: "water",
|
type: "water",
|
||||||
icon: "http://47.104.199.163:9090/images/propertyImgs/water.png",
|
icon: "http://47.104.199.163:9090/images/propertyImgs/water.png",
|
||||||
iconClass: "water"
|
iconClass: "water"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "物业",
|
// name: "物业",
|
||||||
|
name: '物业',
|
||||||
type: "property",
|
type: "property",
|
||||||
icon: "http://47.104.199.163:9090/images/propertyImgs/property.png",
|
icon: "http://47.104.199.163:9090/images/propertyImgs/property.png",
|
||||||
iconClass: "property"
|
iconClass: "property"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "电",
|
// name: "电",
|
||||||
|
name: '物业',
|
||||||
type: "electric",
|
type: "electric",
|
||||||
icon: "http://47.104.199.163:9090/images/propertyImgs/electric.png",
|
icon: "http://47.104.199.163:9090/images/propertyImgs/electric.png",
|
||||||
iconClass: "electric"
|
iconClass: "electric"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "暖气",
|
// name: "暖气",
|
||||||
|
name: '物业',
|
||||||
type: "heating",
|
type: "heating",
|
||||||
icon: "http://47.104.199.163:9090/images/propertyImgs/heating.png",
|
icon: "http://47.104.199.163:9090/images/propertyImgs/heating.png",
|
||||||
iconClass: "heating"
|
iconClass: "heating"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "车位",
|
// name: "车位",
|
||||||
|
name: '物业',
|
||||||
type: "parking",
|
type: "parking",
|
||||||
icon: "http://47.104.199.163:9090/images/propertyImgs/parkingIcon.png",
|
icon: "http://47.104.199.163:9090/images/propertyImgs/parkingIcon.png",
|
||||||
iconClass: "parking"
|
iconClass: "parking"
|
||||||
@@ -187,6 +196,7 @@
|
|||||||
},
|
},
|
||||||
// 跳转到新增缴费
|
// 跳转到新增缴费
|
||||||
goToAdd(type) {
|
goToAdd(type) {
|
||||||
|
// else if (type.name == '水' || type.name == '电')
|
||||||
if (type.name == '燃气' || type.name == '暖气') {
|
if (type.name == '燃气' || type.name == '暖气') {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pageSubPack/payment-list/selectPaymentEntity',
|
url: '/pageSubPack/payment-list/selectPaymentEntity',
|
||||||
@@ -194,7 +204,7 @@
|
|||||||
fail: () => {},
|
fail: () => {},
|
||||||
complete: () => {}
|
complete: () => {}
|
||||||
});
|
});
|
||||||
} else if (type.name == '水' || type.name == '电') {
|
} else if (type.name == '物业' || type.name == '物业') {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pageSubPack/payment-list/addHydropower',
|
url: '/pageSubPack/payment-list/addHydropower',
|
||||||
success: res => {},
|
success: res => {},
|
||||||
|
|||||||
Reference in New Issue
Block a user