| | |
| | | // pages/m_user/base_c/c_scene-info/c_scene-info.js |
| | | import sceneInfo from '../../../../data/sceneInfo' |
| | | import {sceneInfo, sceneLedger} from '../../../../data/sceneInfo' |
| | | import userservice from '../../../../service/userservice' |
| | | import deviceservice from '../../../../service/deviceservice' |
| | | import b_inputCheck from '../../behaviors/b_inputCheck' |
| | | import ledgerservice from "../../../../service/ledgerservice" |
| | | import b_inputCheck from '../../../../base/behaviors/b_inputCheck' |
| | | import b_uploadLedger from '../../../m_ledger/behaviors/b_uploadLedger' |
| | | import b_loadingToast from '../../../../base/behaviors/b_loadingToast' |
| | | |
| | |
| | | } |
| | | }, |
| | | |
| | | attached() { |
| | | ready() { |
| | | this.setData({ |
| | | loadingText: '上传中', |
| | | loadCompleteText: '上传完成' |
| | | }) |
| | | }, |
| | | |
| | | pageLifetimes: { |
| | | show: function () { |
| | | // 页面被展示 |
| | | const info = sceneInfo() |
| | | this.setData({ |
| | | msg: info.get(this.data.sceneType) |
| | | msg: info.get(this.data.sceneType), |
| | | ledger: sceneLedger[this.data.sceneType] |
| | | }) |
| | | //获取场景信息 |
| | | this.getSceneInfo() |
| | | }, |
| | | hide: function () { |
| | | // 页面被隐藏 |
| | | }, |
| | | resize: function (size) { |
| | | // 页面尺寸变化 |
| | | } |
| | | }, |
| | | |
| | | /** |
| | |
| | | msg[3].value = data.baseInfo.biAddress |
| | | msg[10].value = data.baseInfo.biContact |
| | | msg[11].value = data.baseInfo.biTelephone |
| | | msg[12].value = data.baseInfo.biTownName == null ? [] : |
| | | [ |
| | | msg[12].value = data.baseInfo.biTownName == null ? [] : [ |
| | | data.baseInfo.biProvinceName, data.baseInfo.biCityName, data.baseInfo.biDistrictName, data.baseInfo.biTownName, |
| | | data.baseInfo.biProvinceCode, data.baseInfo.biCityCode, data.baseInfo.biDistrictCode, data.baseInfo.biTownCode, |
| | | ] |
| | | msg[12].displayValue = data.baseInfo.biTownName == null ? [] : |
| | | [ |
| | | msg[12].displayValue = data.baseInfo.biTownName == null ? [] : [ |
| | | data.baseInfo.biProvinceName, data.baseInfo.biCityName, data.baseInfo.biDistrictName, data.baseInfo.biTownName, |
| | | ] |
| | | } |
| | |
| | | } |
| | | } |
| | | }) |
| | | ledgerservice.getLedgerDetail( |
| | | app.globalData.accessToken.userId, that.data.ledger.ledgerSubTypeId, that.data.ledger.sceneType, undefined, { |
| | | success(res) { |
| | | if (res.length > 0) { |
| | | let detail = res[0] |
| | | if (detail.upLoad) { |
| | | let imgFiles = [{ |
| | | url: detail.path1[0], |
| | | loading: false |
| | | }] |
| | | that.setData({ |
| | | imgFiles |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | break; |
| | | case '2': |
| | | |
| | |
| | | msg |
| | | }) |
| | | } |
| | | }) |
| | | }, app.globalData.accessToken.openId) |
| | | }, |
| | | |
| | | //提交场景信息 |
| | | submit() { |
| | | _submit() { |
| | | var that = this |
| | | this.setData({loading: true}) |
| | | this.setData({ |
| | | loading: true |
| | | }) |
| | | //针对不同场景,数据结构会有不同的定制需求 |
| | | switch (this.data.sceneType) { |
| | | case '1': |
| | |
| | | |
| | | //提交图片信息 |
| | | submintLedger() { |
| | | if (this.data.imgFiles.length == 0) { |
| | | this.setData({ |
| | | loading: false |
| | | }) |
| | | wx.navigateBack({ |
| | | delta: 1, |
| | | }) |
| | | return |
| | | } |
| | | if (this.data.imgFiles[0].url.indexOf('http') != -1) { |
| | | wx.downloadFile({ |
| | | url: this.data.imgFiles[0].url, |
| | | success: (res) => { |
| | | const imgPath = res.tempFilePath |
| | | this.data.imgFiles[0].url = imgPath |
| | | this._uploadLedger() |
| | | } |
| | | }) |
| | | } else { |
| | | this._uploadLedger() |
| | | } |
| | | }, |
| | | |
| | | //上传完成后,回退 |
| | | _success(res) { |
| | | wx.navigateBack({ |
| | | delta: 1, |
| | | }) |
| | | } |
| | | } |
| | | }) |