This commit is contained in:
laodaming 2023-08-18 12:30:53 +08:00
parent 1f36e62727
commit f8c86b1f03

View File

@ -104,17 +104,41 @@ func (l *GetTemplateByPidLogic) GetTemplateByPid(req *types.GetTemplateByPidReq,
logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeJsonErr, fmt.Sprintf("failed to parse json product template info(may be old data):%d", templateInfo.Id))
}
//后台隐藏/显示信息
var switchInfo interface{}
//后台隐藏/显示信息(现在下面是写死了)
/*var switchInfo interface{}
if templateInfo.SwitchInfo != nil && *templateInfo.SwitchInfo != "" {
_ = json.Unmarshal([]byte(*templateInfo.SwitchInfo), &switchInfo)
}
}*/
modelInfo := modelList[modelIndex]
mapKey := fmt.Sprintf("_%d", *modelInfo.SizeId)
rsp[mapKey] = map[string]interface{}{
"id": templateInfo.Id,
"material": *templateInfo.MaterialImg,
"material_data": switchInfo,
"id": templateInfo.Id,
"material": *templateInfo.MaterialImg,
"material_data": map[string]interface{}{
"QRcode": map[string]interface{}{
"if_show": true,
"text": "二维码",
"default_val": "默认二维码",
},
"website": map[string]interface{}{
"if_show": true,
"text": "网站",
"default_val": "默认网站",
},
"slogan": map[string]interface{}{
"if_show": true,
"text": "slogan",
"default_val": "默认slogan",
},
"phone": map[string]interface{}{
"if_show": true,
"text": "phone",
"default_val": "默认phone",
},
"logo": map[string]interface{}{
"material": "/image/logo/aHnT1_rzubdwax_scale.png",
},
},
}
}
return resp.SetStatusWithMessage(basic.CodeOK, "success", rsp)