Exemplo n.º 1
0
        public static BaseInfo WithInitializeSettings(this BaseInfo info, CardTypes type, MerchantModel merchant)
        {
            info.LogoUrl      = merchant.LogoUrl;
            info.BrandName    = merchant.BrandName;
            info.Title        = type.TextOf();
            info.Color        = Constants.CouponBackgroundColors["Color010"];
            info.Notice       = "消费时向店员出示卡/券二维码";
            info.ServicePhone = merchant.Mobile;
            info.Description  = "";
            info.Dateinfo     = type == CardTypes.MEMBER_CARD
                ? new DateInfo()
            {
                Type = ExpiryDateTypes.DATE_TYPE_PERMANENT.ToString()
            }
                : new DateInfo()
            {
                Type = ExpiryDateTypes.DATE_TYPE_FIX_TERM.ToString()
            };


            info.CodeType = CodeTypes.CODE_TYPE_QRCODE.ToString();
            info.Sku      = new Sku()
            {
                Quantity = 100
            };
            if (type == CardTypes.MEMBER_CARD)
            {
                info.Uselimit = null;
            }
            else
            {
                info.Uselimit = 1;
            }
            info.Getlimit       = 50;
            info.UseCustomCode  = false;
            info.BindOpenid     = true;
            info.CanGivefriend  = true;
            info.LocationIdList = new long[] {
                491431822
            };////TODO 需要搞清楚这些ID是怎么回事
            info.Merchant = new SubMerchantInfo()
            {
                MerchantId = merchant.MerchantId ?? 0
            };

            return(info);
        }