This commit is contained in:
laodaming 2023-10-27 11:24:41 +08:00
parent ee9b3f3a22
commit 813e315ae3

View File

@ -70,27 +70,19 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa
Id: templateId, Id: templateId,
Material: templateMaterialImg, Material: templateMaterialImg,
MaterialData: MaterialData{ MaterialData: MaterialData{
QRcode: QRcode{
UserDisabled: true,
},
Website: Website{
UserDisabled: true,
},
Address: Address{
UserDisabled: true,
},
Phone: Phone{
UserDisabled: true,
},
Slogan: Slogan{
UserDisabled: true,
},
Logo: Logo{ Logo: Logo{
Material: "/image/logo/aHnT1_rzubdwax_scale.png", Material: "/image/logo/aHnT1_rzubdwax_scale.png",
}, },
}, },
CombineIsVisible: false, CombineIsVisible: false,
} }
defer func() {
returnData.MaterialData.QRcode.UserDisabled = true
returnData.MaterialData.Website.UserDisabled = true
returnData.MaterialData.Address.UserDisabled = true
returnData.MaterialData.Phone.UserDisabled = true
returnData.MaterialData.Slogan.UserDisabled = true
}()
if templateJsonStr == nil || *templateJsonStr == "" { if templateJsonStr == nil || *templateJsonStr == "" {
return returnData return returnData
} }
@ -101,16 +93,8 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa
} }
for _, v := range templateJsonInfo.MaterialList { for _, v := range templateJsonInfo.MaterialList {
if v.Type == "combine" { if v.Type == "combine" {
return GetTemplateSwitchInfoRsp{ returnData.CombineIsVisible = v.Visible
Id: templateId, continue
Material: templateMaterialImg,
MaterialData: MaterialData{
Logo: Logo{
Material: "/image/logo/aHnT1_rzubdwax_scale.png",
},
},
CombineIsVisible: v.Visible,
}
} }
switch v.Tag { switch v.Tag {
case "Phone": //电话 case "Phone": //电话
@ -118,35 +102,30 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa
IfShow: v.Visible, IfShow: v.Visible,
Text: v.Text, Text: v.Text,
DefaultValue: "your phone", DefaultValue: "your phone",
UserDisabled: true,
} }
case "Address": //地址 case "Address": //地址
returnData.MaterialData.Address = Address{ returnData.MaterialData.Address = Address{
IfShow: v.Visible, IfShow: v.Visible,
Text: v.Text, Text: v.Text,
DefaultValue: "your address", DefaultValue: "your address",
UserDisabled: true,
} }
case "Website": case "Website":
returnData.MaterialData.Website = Website{ returnData.MaterialData.Website = Website{
IfShow: v.Visible, IfShow: v.Visible,
Text: v.Text, Text: v.Text,
DefaultValue: "your website", DefaultValue: "your website",
UserDisabled: true,
} }
case "QRcode": case "QRcode":
returnData.MaterialData.QRcode = QRcode{ returnData.MaterialData.QRcode = QRcode{
IfShow: v.Visible, IfShow: v.Visible,
Text: v.Text, Text: v.Text,
DefaultValue: "your qrcode content", DefaultValue: "your qrcode content",
UserDisabled: true,
} }
case "Slogan": case "Slogan":
returnData.MaterialData.Slogan = Slogan{ returnData.MaterialData.Slogan = Slogan{
IfShow: v.Visible, IfShow: v.Visible,
Text: v.Text, Text: v.Text,
DefaultValue: "your slogan", DefaultValue: "your slogan",
UserDisabled: true,
} }
} }
} }