Преглед изворни кода

Merge branch 'develop' of k.zhang/duoduo into test

k.zhang пре 1 година
родитељ
комит
73503620e7
2 измењених фајлова са 17 додато и 3 уклоњено
  1. 14 2
      apis/shanghu/merchant.card.go
  2. 3 1
      apis/shanghu/models/card.go

+ 14 - 2
apis/shanghu/merchant.card.go

@@ -262,10 +262,22 @@ func GetMerchantCanvasCard(c *gin.Context) {
 	}
 	url := "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + outQRData.AccessToken
 
+	//1.原始码 不需要购买直接分享 ==原生码直接分享
+	//2.code 需要购买才能分享
+	//3.空的
+
+	if inData.Code == "原始码" { //可以分享
+		outData.IsShare = true
+	} else { //查询购买记录,没有购买过不让分享
+		outData.IsShare = false
+	}
+
+	//点击购买的时候把code给进去把 原始码购买属于平台
+
 	qr.CheckPath = true
-	qr.Page = "pages/home/home"
+	qr.Page = "pages/canvas/canvas"
 	qr.EnvVersion = "release"
-	qr.Scene = strconv.FormatInt(inData.MerchantId, 10)
+	qr.Scene = "id=" + strconv.FormatInt(inData.MerchantId, 10) + "&code=" + inData.Code
 
 	data, err := json.Marshal(&qr)
 	if err != nil {

+ 3 - 1
apis/shanghu/models/card.go

@@ -21,7 +21,8 @@ type CreateMerchantCardRequest struct {
 }
 
 type GetMerchantCardRequest struct {
-	MerchantId int64 `json:"merchant_card_id"` //商户卡id
+	MerchantId int64  `json:"merchant_card_id"` //商户卡id
+	Code       string `json:"code"`             //b邀请码
 }
 
 type GetMerchantCardReply struct {
@@ -52,6 +53,7 @@ type GetMerchantCanvasCardReply struct {
 	MerchantAmount         decimal.Decimal `json:"merchantAmount"`
 	MerchantOriginalAmount decimal.Decimal `json:"merchantOriginalAmount"`
 	Inventory              int64           `json:"inventory"`
+	IsShare                bool            `json:"isShare"`
 }
 type Static struct {
 	Background string `json:"background"`