index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view class="content">
  3. <!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
  4. <u--form labelPosition="left" :model="param" :rules="rules" ref="form1" labelWidth="80">
  5. <u-form-item label="楼号" prop="name" borderBottom ref="item1">
  6. <u--input v-model="param.buildingNo" border="none" placeholder="请输入楼号(例:1)" type='number'>
  7. </u--input>
  8. </u-form-item>
  9. <u-form-item label="单元号" prop="name" borderBottom ref="item1">
  10. <u--input v-model="param.unitNo" border="none" placeholder="请输入单元号(例:2)" type='number'>
  11. </u--input>
  12. </u-form-item>
  13. <u-form-item label="房间号" prop="name" borderBottom ref="item1">
  14. <u--input v-model="param.floor" border="none" placeholder="请输入房间号(例:501)" type='number'>
  15. </u--input>
  16. </u-form-item>
  17. </u--form>
  18. <u-button type="primary" text="查询" @click="selectInfo"></u-button>
  19. <u-toast ref="uToast"></u-toast>
  20. <view class="content1" v-if="isSHowInfo">
  21. <view class="fy-detail">
  22. <view class="title">
  23. 户主信息
  24. </view>
  25. <view class="row">
  26. <view class="left">
  27. 户主:
  28. </view>
  29. <view class="">
  30. {{wuyeAmountInfo.householder}}
  31. </view>
  32. </view>
  33. <view class="row">
  34. <view class="left">
  35. 房源号:
  36. </view>
  37. <view class="">
  38. {{wuyeAmountInfo.sourceNumber}}
  39. </view>
  40. </view>
  41. <view class="row">
  42. <view class="left">
  43. 实际面积:
  44. </view>
  45. <view class="">
  46. {{wuyeAmountInfo.actualMoney}}
  47. </view>
  48. </view>
  49. <view class="row">
  50. <view class="left">
  51. 付款状态:
  52. </view>
  53. <view v-if="wuyeAmountInfo.totalActualPayment==0" style="color:red">
  54. 未支付
  55. </view>
  56. <view v-else style="color:#21d261">
  57. 已支付{{wuyeAmountInfo.totalActualPayment}}元
  58. </view>
  59. </view>
  60. <view class="title-qj">
  61. 缴费区间:{{wuyeAmountInfo.paymentRange}}
  62. </view>
  63. <view class="title">
  64. 费用明细:
  65. </view>
  66. <view class="row">
  67. <view class="left">
  68. 物业费:
  69. </view>
  70. <view class="">
  71. {{wuyeAmountInfo.propertyFee}}
  72. </view>
  73. </view>
  74. <view class="row">
  75. <view class="left">
  76. 电梯费:
  77. </view>
  78. <view class="">
  79. {{wuyeAmountInfo.elevatorFee}}
  80. </view>
  81. </view>
  82. <view class="row">
  83. <view class="left">
  84. 车位管理费:
  85. </view>
  86. <view class="">
  87. {{wuyeAmountInfo.parkingSpace}}
  88. </view>
  89. </view>
  90. <view class="row">
  91. <view class="left">
  92. 车库管理费:
  93. </view>
  94. <view class="">
  95. {{wuyeAmountInfo.garage}}
  96. </view>
  97. </view>
  98. <view class="row">
  99. <view class="left">
  100. 仓库管理费:
  101. </view>
  102. <view class="">
  103. {{wuyeAmountInfo.warehouse}}
  104. </view>
  105. </view>
  106. <view class="row">
  107. <view class="left">
  108. 垃圾清运费:
  109. </view>
  110. <view class="">
  111. {{wuyeAmountInfo.garbageClearing}}
  112. </view>
  113. </view>
  114. </view>
  115. <view class="total">
  116. <view class="left">
  117. 应缴费总合计:
  118. </view>
  119. <view class="">
  120. {{total}}元
  121. </view>
  122. </view>
  123. <u-button type="primary" text="去付款" @click="pay" class="pay"></u-button>
  124. </view>
  125. <!-- <u-popup :show="isShowCode" @close="isShowCode= false" @open="open" mode="center">
  126. </u-popup> -->
  127. </view>
  128. </template>
  129. <script>
  130. export default {
  131. data() {
  132. return {
  133. isSHowInfo: false,
  134. isShowCode: false,
  135. param: {
  136. buildingNo: '',
  137. unitNo: '',
  138. floor: '',
  139. },
  140. wuyeAmountInfo: {
  141. buildingNo: '',
  142. unitNo: '',
  143. floor: '',
  144. },
  145. rules: {
  146. 'buildingNo': {
  147. type: 'string',
  148. required: true,
  149. message: '请填写楼号',
  150. trigger: ['blur', 'change']
  151. },
  152. 'unitNo': {
  153. type: 'string',
  154. required: true,
  155. message: '请填写单元号',
  156. trigger: ['blur', 'change']
  157. },
  158. 'floor': {
  159. type: 'string',
  160. required: true,
  161. message: '请填写房间号',
  162. trigger: ['blur', 'change']
  163. }
  164. }
  165. };
  166. },
  167. computed: {
  168. total() {
  169. let _totalPrice = Number(this.wuyeAmountInfo.propertyFee) + Number(this.wuyeAmountInfo.elevatorFee) +
  170. Number(this.wuyeAmountInfo.parkingSpace) + Number(this.wuyeAmountInfo.garage) + Number(this
  171. .wuyeAmountInfo.warehouse) + Number(this.wuyeAmountInfo.garbageClearing)
  172. return _totalPrice;
  173. },
  174. },
  175. onShow() {
  176. if (this.param.buildingNo&&this.param.unitNo&&this.param.floor) {
  177. this.selectInfo()
  178. }
  179. },
  180. methods: {
  181. pay() {
  182. console.log("去付款")
  183. this.isShowCode = true
  184. uni.navigateTo({
  185. url: '/pages/pay/pay?price=' + this.total + "&id=" + this.wuyeAmountInfo.id
  186. })
  187. },
  188. selectInfo() {
  189. if (!this.param.buildingNo) {
  190. this.$refs.uToast.show({
  191. type: 'error',
  192. message: '请输入楼号!',
  193. })
  194. return
  195. }
  196. if (!this.param.unitNo) {
  197. this.$refs.uToast.show({
  198. type: 'error',
  199. message: '请输入单元号!',
  200. })
  201. return
  202. }
  203. if (!this.param.floor) {
  204. this.$refs.uToast.show({
  205. type: 'error',
  206. message: '请输入房间号!',
  207. })
  208. return
  209. }
  210. uni.showLoading({
  211. title:"查询中"
  212. })
  213. this.$request.baseRequest('wuyeAmountInfoApp', 'getInfo', {
  214. wuyeAmountInfo: JSON.stringify(this.param)
  215. }, failres => {
  216. this.$refs.uToast.show({
  217. type: 'error',
  218. message: failres.errmsg,
  219. })
  220. this.isSHowInfo = false
  221. uni.hideLoading()
  222. }).then(res => {
  223. console.log(res)
  224. if(res.data){
  225. this.isSHowInfo = true
  226. this.wuyeAmountInfo = res.data
  227. }
  228. uni.hideLoading()
  229. })
  230. },
  231. },
  232. onReady() {
  233. //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
  234. this.$refs.form1.setRules(this.rules)
  235. },
  236. };
  237. </script>
  238. <style lang="scss" scoped>
  239. .content {
  240. padding: 0 40rpx;
  241. }
  242. .fy-detail {
  243. .title-qj {
  244. font-weight: 700;
  245. margin: 20rpx 0;
  246. }
  247. .title {
  248. font-size: 36rpx;
  249. font-weight: 700;
  250. margin: 20rpx 0;
  251. }
  252. .row {
  253. display: flex;
  254. .left {
  255. width: 200rpx;
  256. }
  257. }
  258. }
  259. .total {
  260. display: flex;
  261. margin-top: 20rpx;
  262. font-size: 32rpx;
  263. font-weight: 700;
  264. .left {
  265. width: 260rpx;
  266. }
  267. }
  268. .pay {
  269. margin-top: 50rpx;
  270. }
  271. </style>