Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
@@ -70,19 +70,32 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa
|
||||
Id: templateId,
|
||||
Material: templateMaterialImg,
|
||||
SwitchInfo: SwitchInfo{
|
||||
QRcode: QRcode{
|
||||
UserDisabled: true,
|
||||
DefaultValue: "your qrcode",
|
||||
},
|
||||
Website: Website{
|
||||
UserDisabled: true,
|
||||
DefaultValue: "your website",
|
||||
},
|
||||
Address: Address{
|
||||
UserDisabled: true,
|
||||
DefaultValue: "your address",
|
||||
},
|
||||
Phone: Phone{
|
||||
UserDisabled: true,
|
||||
DefaultValue: "your phone",
|
||||
},
|
||||
Slogan: Slogan{
|
||||
UserDisabled: true,
|
||||
DefaultValue: "your slogan",
|
||||
},
|
||||
Logo: Logo{
|
||||
Material: "/image/logo/aHnT1_rzubdwax_scale.png",
|
||||
},
|
||||
},
|
||||
CombineIsVisible: false,
|
||||
}
|
||||
defer func() {
|
||||
returnData.SwitchInfo.QRcode.UserDisabled = true
|
||||
returnData.SwitchInfo.Website.UserDisabled = true
|
||||
returnData.SwitchInfo.Address.UserDisabled = true
|
||||
returnData.SwitchInfo.Phone.UserDisabled = true
|
||||
returnData.SwitchInfo.Slogan.UserDisabled = true
|
||||
}()
|
||||
if templateJsonStr == nil || *templateJsonStr == "" {
|
||||
return returnData
|
||||
}
|
||||
@@ -98,35 +111,20 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa
|
||||
}
|
||||
switch v.Tag {
|
||||
case "Phone": //电话
|
||||
returnData.SwitchInfo.Phone = Phone{
|
||||
IfShow: v.Visible,
|
||||
Text: v.Text,
|
||||
DefaultValue: "your phone",
|
||||
}
|
||||
returnData.SwitchInfo.Phone.IfShow = v.Visible
|
||||
returnData.SwitchInfo.Phone.Text = v.Text
|
||||
case "Address": //地址
|
||||
returnData.SwitchInfo.Address = Address{
|
||||
IfShow: v.Visible,
|
||||
Text: v.Text,
|
||||
DefaultValue: "your address",
|
||||
}
|
||||
returnData.SwitchInfo.Address.IfShow = v.Visible
|
||||
returnData.SwitchInfo.Address.Text = v.Text
|
||||
case "Website":
|
||||
returnData.SwitchInfo.Website = Website{
|
||||
IfShow: v.Visible,
|
||||
Text: v.Text,
|
||||
DefaultValue: "your website",
|
||||
}
|
||||
returnData.SwitchInfo.Website.IfShow = v.Visible
|
||||
returnData.SwitchInfo.Website.Text = v.Text
|
||||
case "QRcode":
|
||||
returnData.SwitchInfo.QRcode = QRcode{
|
||||
IfShow: v.Visible,
|
||||
Text: v.Text,
|
||||
DefaultValue: "your qrcode content",
|
||||
}
|
||||
returnData.SwitchInfo.QRcode.IfShow = v.Visible
|
||||
returnData.SwitchInfo.QRcode.Text = v.Text
|
||||
case "Slogan":
|
||||
returnData.SwitchInfo.Slogan = Slogan{
|
||||
IfShow: v.Visible,
|
||||
Text: v.Text,
|
||||
DefaultValue: "your slogan",
|
||||
}
|
||||
returnData.SwitchInfo.Slogan.IfShow = v.Visible
|
||||
returnData.SwitchInfo.Slogan.Text = v.Text
|
||||
}
|
||||
}
|
||||
return returnData
|
||||
|
||||
@@ -18,8 +18,8 @@ type RenderData struct {
|
||||
Address string `json:"address"` //地址(可选)
|
||||
Phone string `json:"phone"` //电话(可选)
|
||||
Qrcode string `json:"qrcode"` //二维码(可选)
|
||||
UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值)
|
||||
GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值)
|
||||
//UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值)
|
||||
//GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值)
|
||||
}
|
||||
type TemplateTagColor struct {
|
||||
Colors [][]string `json:"colors"` //颜色组合
|
||||
|
||||
Reference in New Issue
Block a user