修复客户默认头像入库与回填SQL
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
const customersApi = require('../../api/customers')
|
||||
|
||||
const DEFAULT_CUSTOMER_AVATAR = '/assets/images/default-avatar-1.png'
|
||||
|
||||
function canCreateAppointment() {
|
||||
const app = getApp()
|
||||
const userInfo = app.globalData.userInfo || {}
|
||||
@@ -11,6 +13,7 @@ Page({
|
||||
id: '',
|
||||
canCreateAppointment: true,
|
||||
avatarText: '客',
|
||||
avatar: DEFAULT_CUSTOMER_AVATAR,
|
||||
customer: {},
|
||||
stats: { orderCount: 0, amount: 0, lastTime: '-' },
|
||||
orders: [],
|
||||
@@ -49,6 +52,7 @@ Page({
|
||||
const customer = {
|
||||
id: detail.id,
|
||||
name: detail.nickname || detail.name || detail.account || '客户',
|
||||
avatar: detail.avatar || detail.avatarUrl || detail.customerAvatar || DEFAULT_CUSTOMER_AVATAR,
|
||||
phone: detail.contactPhone || detail.phone || '未填写',
|
||||
contactPhone: detail.contactPhone || '',
|
||||
remark: detail.signature || ''
|
||||
@@ -60,6 +64,7 @@ Page({
|
||||
remark: customer.remark
|
||||
},
|
||||
avatarText: String(customer.name || '客').slice(-1),
|
||||
avatar: customer.avatar,
|
||||
stats: {
|
||||
orderCount: detail.orderCount || detail.totalOrderCount || 0,
|
||||
amount: detail.totalAmount || detail.consumeAmount || 0,
|
||||
|
||||
Reference in New Issue
Block a user