工作台代码提交
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
// pages/workBenchNew/components/kaihu/index.js
|
||||
import { alertInfo, alertSuccess } from "../../../../utils/index"
|
||||
import { createBackTenement, updateTenementBackInfo } from "../../../../service/tenement"
|
||||
import request from "../../../../utils/request"
|
||||
import { payWays, feeType as feeTypeList } from "../../../../utils/data";
|
||||
const { OK } = request;
|
||||
Page({
|
||||
|
||||
/**
|
||||
@@ -7,7 +12,85 @@ Page({
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
onParkFocus(e) {
|
||||
this.setData({
|
||||
show: true,
|
||||
title: "园区",
|
||||
type: 'park'
|
||||
})
|
||||
},
|
||||
onBuildingFocus() {
|
||||
const { park } = this.data;
|
||||
if (!park) {
|
||||
alertInfo("请先选择园区")
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
show: true,
|
||||
title: "建筑",
|
||||
type: 'building'
|
||||
})
|
||||
},
|
||||
onChange(e) {
|
||||
const { name } = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
[name]: e.detail
|
||||
})
|
||||
},
|
||||
onFeeTypeFocus() {
|
||||
this.setData({
|
||||
show: true,
|
||||
title: "收费类型",
|
||||
type: 'feeType'
|
||||
})
|
||||
},
|
||||
onCancel() {
|
||||
this.setData({ show: false })
|
||||
},
|
||||
async onSubmit() {
|
||||
const { name, shortName, address, contact,
|
||||
phone, building, feeType, park, editType, id, parkName,
|
||||
|
||||
} = this.data;
|
||||
const { code, message } = await createBackTenement(park, { name, shortName, address, contact, phone, building, feeType })
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return
|
||||
}
|
||||
alertSuccess("开户成功")
|
||||
// wx.navigateBack()
|
||||
wx.redirectTo({
|
||||
url: `/pages/workBenchNew/components/workBenchTenement/index?park=${park}&parkName=${parkName}&name=${name}`,
|
||||
})
|
||||
},
|
||||
handleBack() {
|
||||
wx.navigateBack()
|
||||
},
|
||||
onConfirm(e) {
|
||||
const { type, data, way } = e.detail;
|
||||
switch(type) {
|
||||
case "park":
|
||||
this.setData({
|
||||
park: data.id,
|
||||
parkName: data.name,
|
||||
show: false,
|
||||
})
|
||||
return;
|
||||
case "building":
|
||||
this.setData({
|
||||
building: data.id,
|
||||
buildingName: data.name,
|
||||
show: false,
|
||||
})
|
||||
return;
|
||||
case "feeType":
|
||||
this.setData({
|
||||
feeTypeName: data,
|
||||
feeType: way,
|
||||
show: false,
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user