From eb7366f400867d3f401fe60f06d848d6d1448457 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 17 十月 2022 17:41:56 +0800
Subject: [PATCH] 2022.10.17
---
pages/m_user/base_c/c_scene-info/c_scene-info.js | 102 ++++++++++++++++++++++++++++++++++-----------------
1 files changed, 68 insertions(+), 34 deletions(-)
diff --git a/pages/m_user/base_c/c_scene-info/c_scene-info.js b/pages/m_user/base_c/c_scene-info/c_scene-info.js
index 402c046..a9bf9c5 100644
--- a/pages/m_user/base_c/c_scene-info/c_scene-info.js
+++ b/pages/m_user/base_c/c_scene-info/c_scene-info.js
@@ -1,8 +1,9 @@
// 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'
@@ -31,29 +32,18 @@
}
},
- attached() {
+ ready() {
this.setData({
loadingText: '涓婁紶涓�',
loadCompleteText: '涓婁紶瀹屾垚'
})
- },
-
- pageLifetimes: {
- show: function () {
- // 椤甸潰琚睍绀�
- const info = sceneInfo()
- this.setData({
- msg: info.get(this.data.sceneType)
- })
- //鑾峰彇鍦烘櫙淇℃伅
- this.getSceneInfo()
- },
- hide: function () {
- // 椤甸潰琚殣钘�
- },
- resize: function (size) {
- // 椤甸潰灏哄鍙樺寲
- }
+ const info = sceneInfo()
+ this.setData({
+ msg: info.get(this.data.sceneType),
+ ledger: sceneLedger[this.data.sceneType]
+ })
+ //鑾峰彇鍦烘櫙淇℃伅
+ this.getSceneInfo()
},
/**
@@ -82,14 +72,12 @@
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 ? [] :
- [
- 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].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 ? [] :
- [
- data.baseInfo.biProvinceName, data.baseInfo.biCityName, data.baseInfo.biDistrictName, data.baseInfo.biTownName,
+ msg[12].displayValue = data.baseInfo.biTownName == null ? [] : [
+ data.baseInfo.biProvinceName, data.baseInfo.biCityName, data.baseInfo.biDistrictName, data.baseInfo.biTownName,
]
}
if (data.specialInfo != null) {
@@ -103,7 +91,7 @@
if (v == o.name) {
o.checked = true
break
- }else if (o.hasRemark) {
+ } else if (o.hasRemark) {
o.checked = true
o.remark += v
}
@@ -137,7 +125,7 @@
if (v == o.name) {
o.checked = true
break
- }else if (o.hasRemark) {
+ } else if (o.hasRemark) {
o.checked = true
o.remark += v
}
@@ -166,6 +154,23 @@
}
}
})
+ 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':
@@ -193,13 +198,15 @@
msg
})
}
- })
+ }, app.globalData.accessToken.openId)
},
//鎻愪氦鍦烘櫙淇℃伅
- submit() {
+ _submit() {
var that = this
- this.setData({loading: true})
+ this.setData({
+ loading: true
+ })
//閽堝涓嶅悓鍦烘櫙锛屾暟鎹粨鏋勪細鏈変笉鍚岀殑瀹氬埗闇�姹�
switch (this.data.sceneType) {
case '1':
@@ -227,7 +234,34 @@
//鎻愪氦鍥剧墖淇℃伅
submintLedger() {
- this._uploadLedger()
+ 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,
+ })
}
}
})
\ No newline at end of file
--
Gitblit v1.9.3