|
@@ -102,43 +102,44 @@ Page({
|
|
|
const { status, data, msg } = await getShopInfo()
|
|
|
if (status) {
|
|
|
const { shop_info } = data
|
|
|
- console.log(shop_info)
|
|
|
- for (let key in shop_info) {
|
|
|
- let value = shop_info[key]
|
|
|
- if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
|
|
|
-
|
|
|
- if (key === 'user_code_url' || key === 'shop_img_url' || key === 'shop_shangbiao') {
|
|
|
- value = [
|
|
|
- {
|
|
|
- 'formkey': key,
|
|
|
- 'url': value
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
+ if (Object.prototype.toString.call(shop_info) === '[object Object]') {
|
|
|
+ for (let key in shop_info) {
|
|
|
+ let value = shop_info[key]
|
|
|
+ if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
|
|
|
+
|
|
|
+ if (key === 'user_code_url' || key === 'shop_img_url' || key === 'shop_shangbiao') {
|
|
|
+ value = [
|
|
|
+ {
|
|
|
+ 'formkey': key,
|
|
|
+ 'url': value
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
|
|
|
- if (key === 'country_msg') {
|
|
|
- const index = this.data.countryMsgList.findIndex(item => item === value)
|
|
|
- if (index > -1) {
|
|
|
- temp['countryMsgInDefaultIndex'] = index
|
|
|
+ if (key === 'country_msg') {
|
|
|
+ const index = this.data.countryMsgList.findIndex(item => item === value)
|
|
|
+ if (index > -1) {
|
|
|
+ temp['countryMsgInDefaultIndex'] = index
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if (key === 'shop_address') {
|
|
|
- value = JSON.parse(value)
|
|
|
- }
|
|
|
+ if (key === 'shop_address') {
|
|
|
+ value = JSON.parse(value)
|
|
|
+ }
|
|
|
|
|
|
- if (key === 'company_created_at') {
|
|
|
- value = getTs(value, 'YYYY-MM-DD')
|
|
|
- temp['currentDate'] = value
|
|
|
- }
|
|
|
+ if (key === 'company_created_at') {
|
|
|
+ value = getTs(value, 'YYYY-MM-DD')
|
|
|
+ temp['currentDate'] = value
|
|
|
+ }
|
|
|
|
|
|
- if (this.data.form.hasOwnProperty(key)) {
|
|
|
- temp[`form.${key}`] = value
|
|
|
+ if (this.data.form.hasOwnProperty(key)) {
|
|
|
+ temp[`form.${key}`] = value
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- this.setData(temp)
|
|
|
+ this.setData(temp)
|
|
|
+ }
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: msg,
|
|
@@ -289,6 +290,7 @@ Page({
|
|
|
}
|
|
|
},
|
|
|
getForm() {
|
|
|
+ let _company_created_at = ''
|
|
|
const {
|
|
|
shop_name,
|
|
|
shop_img_url,
|
|
@@ -308,7 +310,11 @@ Page({
|
|
|
shop_shangbiao,
|
|
|
shop_remark
|
|
|
} = this.data.form
|
|
|
+ if (company_created_at > 0) {
|
|
|
+ const { YYYY, MM, DD } = formatTs(company_created_at)
|
|
|
|
|
|
+ _company_created_at = `${YYYY - MM - DD}`
|
|
|
+ }
|
|
|
return {
|
|
|
user_name,
|
|
|
shop_name,
|
|
@@ -321,7 +327,7 @@ Page({
|
|
|
shop_address,
|
|
|
shop_remark,
|
|
|
company_name,
|
|
|
- company_created_at,
|
|
|
+ company_created_at: _company_created_at,
|
|
|
company_hangye,
|
|
|
company_jingying_fanwei,
|
|
|
shop_jidi_guimo,
|
|
@@ -426,15 +432,14 @@ Page({
|
|
|
booCompanyCreatedAt: false
|
|
|
})
|
|
|
},
|
|
|
- inputCompanyCreatedAt(event) {
|
|
|
- this.setData({
|
|
|
- currentDate: event.detail
|
|
|
- })
|
|
|
- },
|
|
|
- confirmCompanyCreatedAt() {
|
|
|
+ confirmCompanyCreatedAt(event) {
|
|
|
+ const value = event.detail
|
|
|
+
|
|
|
this.setData({
|
|
|
- 'form.company_created_at': this.data.currentDate
|
|
|
+ currentDate: value,
|
|
|
+ 'form.company_created_at': value
|
|
|
})
|
|
|
+
|
|
|
this.hideCompanyCreatedAt()
|
|
|
}
|
|
|
})
|