Ver Fonte

背景图

k.zhang há 3 meses atrás
pai
commit
d0619cb9d8

+ 1 - 1
apis/shanghu/base.go

@@ -85,7 +85,7 @@ func InitShangHuRouter(engine *gin.RouterGroup) {
 		activeV1.POST("/active/draw/list", DrawLog)                       //中奖列表
 		activeV1.POST("/draw/verification/code", DrawLogVerificationCode) //奖品核销码                                           //中奖核销码
 		activeV1.POST("/draw/cancel", DrawCancel)                         //核销 奖品与拼团
-		//拼团购买
+		//activeV1.POST("")                                                 //拼团购买
 		//待核销金额
 		//
 

+ 11 - 0
apis/shanghu/merchant.active.config.go

@@ -92,6 +92,7 @@ func ActiveConfigCreate(c *gin.Context) {
 	sqlData.GroupBuyUrl = inData.GroupBuyUrl
 	sqlData.GroupBuy = `{}`
 	sqlData.DrawProduct = `{}`
+	sqlData.BackgroundImage = inData.BackgroundImage
 
 	configData, err := sqlData.Create()
 	if err != nil {
@@ -128,6 +129,7 @@ func ActiveConfigInfo(c *gin.Context) {
 	var outData models.ActiveConfigReply
 	var drawInfoSql shanghu.MerchantActiveDrawProduct
 	var groupBuy shanghu.MerchantActiveGroupBuy
+	var merchant shanghu.Merchant
 
 	err := c.ShouldBindJSON(&inData)
 	if err != nil {
@@ -217,6 +219,15 @@ func ActiveConfigInfo(c *gin.Context) {
 
 	}
 
+	merchant.OpenId = inData.MerchantOpenID
+	merchantInfo, err := merchant.GetMerchant()
+	if err != nil {
+		app.Error(c, 500, err, err.Error())
+		return
+	}
+
+	outData.MerchantName = merchantInfo.MerchantName
+
 	app.OK(c, outData, app.Success)
 
 }

+ 2 - 0
apis/shanghu/models/active.config.go

@@ -13,6 +13,7 @@ type CreateActiveConfigRequest struct {
 	ActivityEndTime   string  `json:"activity_end_time"`   // 活动结束时间
 	ActivityStartTime string  `json:"activity_start_time"` // 活动开始时间
 	ActiveName        string  `json:"active_name"`         // 活动名称
+	BackgroundImage   string  `json:"background_image"`    // 海报
 }
 
 type ActiveConfigRequest struct {
@@ -21,6 +22,7 @@ type ActiveConfigRequest struct {
 }
 
 type ActiveConfigReply struct {
+	MerchantName      string         `json:"merchant_name"` //商家名称
 	DrawOneBiZhong    int64          `json:"draw_one_bi_zhong"`
 	GroupBuyUrl       string         `json:"group_buy_url"`
 	GroupBuyMode      int            `json:"group_buy_mode"`      // 0-不开团 1-虚拟开团 2-真实开团

+ 6 - 0
models/shanghu/merchant.active.config.go

@@ -24,6 +24,12 @@ type MerchantActiveConfig struct {
 	ActivityEndTime   int64     `gorm:"column:activity_end_time;type:bigint(20)" json:"activity_end_time"`     // 活动结束时间
 	ActivityStartTime int64     `gorm:"column:activity_start_time;type:bigint(20)" json:"activity_start_time"` // 活动开始时间
 	ActiveName        string    `gorm:"column:active_name;type:varchar(255)" json:"active_name"`               // 活动名称
+	W                 string    `gorm:"column:w;type:varchar(255)" json:"w"`                                   //
+	X                 string    `gorm:"column:x;type:varchar(255)" json:"x"`                                   //
+	Y                 string    `gorm:"column:y;type:varchar(255)" json:"y"`                                   //
+	H                 string    `gorm:"column:h;type:varchar(255)" json:"h"`                                   //
+	BackgroundImage   string    `gorm:"column:background_image;type:varchar(255)" json:"background_image"`     // 背景图
+
 }
 
 func (m *MerchantActiveConfig) TableName() string {