From 9b09d13712c0c005891450a3bf4b6d848ec0ff37 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 29 十一月 2023 10:28:24 +0800
Subject: [PATCH] 2023.11.29
---
pages/mUser/baseC/cCompanyInfo/cCompanyInfo.js | 199 ++++++++++++++++++++++++++-----------------------
1 files changed, 104 insertions(+), 95 deletions(-)
diff --git a/pages/mUser/baseC/cCompanyInfo/cCompanyInfo.js b/pages/mUser/baseC/cCompanyInfo/cCompanyInfo.js
index a696abb..00f4b22 100644
--- a/pages/mUser/baseC/cCompanyInfo/cCompanyInfo.js
+++ b/pages/mUser/baseC/cCompanyInfo/cCompanyInfo.js
@@ -1,13 +1,14 @@
// pages/mUser/baseC/c_company-info/c_company-info.js
-import {companyLedger} from '../../../../data/sceneInfo'
-import userservice from '../../../../service/userservice'
-import authservice from '../../../../service/authservice'
-import ledgerservice from "../../../../service/ledgerservice"
-import bInputCheck from '../../../../base/behaviors/bInputCheck'
-import bUploadLedger from '../../../mLedger/behaviors/bUploadLedger'
-import bLoadingToast from '../../../../base/behaviors/bLoadingToast'
+import { companyLedger } from '../../../../data/sceneInfo';
+import { sceneTypes1 } from '../../../../data/sceneTypes';
+import userservice from '../../../../service/userservice';
+import authservice from '../../../../service/authservice';
+import ledgerservice from '../../../../service/ledgerservice';
+import bInputCheck from '../../../../base/behaviors/bInputCheck';
+import bUploadLedger from '../../../mLedger/behaviors/bUploadLedger';
+import bLoadingToast from '../../../../base/behaviors/bLoadingToast';
-const app = getApp()
+const app = getApp();
Component({
behaviors: [bInputCheck, bUploadLedger, bLoadingToast],
@@ -20,65 +21,58 @@
properties: {
submitText: {
type: String,
- value: '鎻愪氦'
+ value: '鎻愪氦',
},
sceneType: {
type: String,
- value: '1'
+ value: '1',
},
},
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- sceneTypes: [
- {value: '1', name: '椁愰ギ'},
- {value: '7', name: '姹戒慨'},
- {value: '6', name: '宸ヤ笟浼佷笟' },
- {value: '2', name: '宸ュ湴'},
- {value: '3', name: '鐮佸ご'},
- {value: '4', name: '鍫嗗満'},
- {value: '5', name: '鎼呮媽绔�' },
- ],
+ sceneTypes: sceneTypes1,
sceneTypeIndex: 0,
- msg: [{
- name: "浼佷笟鍚嶇О",
- id: "ciName",
+ msg: [
+ {
+ name: '浼佷笟鍚嶇О',
+ id: 'ciName',
input: true,
value: '',
noValue: false,
},
{
- name: "浼佷笟鍦板潃",
- id: "ciAddress",
+ name: '浼佷笟鍦板潃',
+ id: 'ciAddress',
input: true,
value: '',
noValue: false,
},
{
- name: "淇$敤浠g爜",
- id: "ciOrgCode",
- input: true,
- value: "",
- noValue: false,
- },
- {
- name: "娉曚汉",
- id: "ciJuridicalPerson",
+ name: '淇$敤浠g爜',
+ id: 'ciOrgCode',
input: true,
value: '',
noValue: false,
},
{
- name: "鑱旂郴浜�",
- id: "ciContactName",
+ name: '娉曚汉',
+ id: 'ciJuridicalPerson',
input: true,
value: '',
noValue: false,
},
{
- name: "鑱旂郴鏂瑰紡",
- id: "ciTelephone",
+ name: '鑱旂郴浜�',
+ id: 'ciContactName',
+ input: true,
+ value: '',
+ noValue: false,
+ },
+ {
+ name: '鑱旂郴鏂瑰紡',
+ id: 'ciTelephone',
input: true,
value: '',
noValue: false,
@@ -89,13 +83,13 @@
ready() {
this.setData({
loadingText: '涓婁紶涓�',
- loadCompleteText: '涓婁紶瀹屾垚'
- })
+ loadCompleteText: '涓婁紶瀹屾垚',
+ });
this.setData({
- ledger: companyLedger[this.data.sceneType]
- })
- this.getCompanyInfo()
+ ledger: companyLedger[app.globalData.userInfo.extension2],
+ });
+ this.getCompanyInfo();
},
/**
@@ -103,84 +97,100 @@
*/
methods: {
changeSceneType(e) {
- let i = e.detail.value
+ let i = e.detail.value;
this.setData({
- sceneTypeIndex: i
- })
+ sceneTypeIndex: i,
+ });
},
//鑾峰彇浼佷笟淇℃伅
getCompanyInfo() {
- var that = this
- userservice.getBaseInfo(app.globalData.accessToken.userId, {
- success(data) {
- const msg = that.data.msg
- if (data.company != null) {
- const info = data.company
- msg[0].value = info.ciName
- msg[1].value = info.ciAddress
- msg[2].value = info.ciOrgCode
- msg[3].value = info.ciJuridicalPerson
- msg[4].value = info.ciContactName
- msg[5].value = info.ciTelephone
- that.setData({
- msg, info
- })
- }
- }
- }, app.globalData.accessToken.openId)
+ var that = this;
+ userservice.getBaseInfo(
+ app.globalData.accessToken.userId,
+ {
+ success(data) {
+ const msg = that.data.msg;
+ if (data.company != null) {
+ const info = data.company;
+ msg[0].value = info.ciName;
+ msg[1].value = info.ciAddress;
+ msg[2].value = info.ciOrgCode;
+ msg[3].value = info.ciJuridicalPerson;
+ msg[4].value = info.ciContactName;
+ msg[5].value = info.ciTelephone;
+ that.setData({
+ msg,
+ info,
+ });
+ }
+ },
+ },
+ app.globalData.accessToken.openId,
+ );
ledgerservice.getLedgerDetail(
- app.globalData.accessToken.userId, that.data.ledger.ledgerSubTypeId, that.data.ledger.sceneType, undefined, {
+ app.globalData.accessToken.userId,
+ that.data.ledger.ledgerSubTypeId,
+ that.data.ledger.sceneType,
+ undefined,
+ {
success(res) {
if (res.length > 0) {
- let detail = res[0]
+ let detail = res[0];
if (detail.upLoad) {
- let imgFiles = [{
- url: detail.path1[0],
- loading: false
- }]
+ let imgFiles = [
+ {
+ url: detail.path1[0],
+ loading: false,
+ },
+ ];
that.setData({
- imgFiles
- })
+ imgFiles,
+ });
}
}
- }
- })
+ },
+ },
+ );
},
//鎻愪氦浼佷笟淇℃伅
_submit() {
- var that = this
- this.setData({loading: true})
- authservice.authCompany(app.globalData.accessToken.openId, this.data.info, {
- success(res) {
- that.submintLedger()
+ var that = this;
+ this.setData({ loading: true });
+ authservice.authCompany(
+ app.globalData.accessToken.openId,
+ this.data.info,
+ {
+ success(res) {
+ that.submintLedger();
+ },
},
- })
+ );
},
//鎻愪氦鍥剧墖淇℃伅
submintLedger() {
if (this.data.imgFiles.length == 0) {
this.setData({
- loading: false
- })
+ loading: false,
+ });
wx.navigateBack({
delta: 1,
- })
- return
+ });
+ 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()
- }
- })
+ success: res => {
+ const imgPath = res.tempFilePath;
+ this.data.imgFiles[0].url = imgPath;
+ this._uploadLedger();
+ },
+ });
} else {
- this._uploadLedger()
+ this._uploadLedger();
}
},
@@ -188,8 +198,7 @@
_success(res) {
wx.navigateBack({
delta: 1,
- })
- }
-
- }
-})
\ No newline at end of file
+ });
+ },
+ },
+});
--
Gitblit v1.9.3