This commit is contained in:
richboo111
2022-11-15 10:16:05 +08:00
3 changed files with 30 additions and 8 deletions

View File

@@ -13,12 +13,12 @@ var a = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token
// 查询售后单详情 // 查询售后单详情
func TestAfsOrder(t *testing.T) { func TestAfsOrder(t *testing.T) {
a.QueryAfsOrderDetail("7154266161041899779", true) a.QueryAfsOrderDetail("7165706329204670732", true)
} }
// 同意/拒绝售后单 // 同意/拒绝售后单
func TestAggreOrNotAggreAfs(t *testing.T) { func TestAggreOrNotAggreAfs(t *testing.T) {
a.AfterSaleOperate(int32(202), "7161251923629179177", "1", 0) a.AfterSaleOperate(int32(201), "7165706329204670732", "1", 0)
fmt.Println("11", 8|16|32|1) fmt.Println("11", 8|16|32|1)
} }

View File

@@ -7828,7 +7828,6 @@ func (a *API) CreateStoreCommodity(skuParam *product_addV2_request.ProductAddV2P
if err != nil { if err != nil {
return nil, err return nil, err
} }
if result.Code != RequestSuccessCode { if result.Code != RequestSuccessCode {
return nil, errors.New(result.SubMsg) return nil, errors.New(result.SubMsg)
} }
@@ -8130,3 +8129,19 @@ func (a *API) GetProductUpdateRule(categoryId int64) bool {
} }
return result.Data.AfterSaleRule.SupplyDayReturnRule.Enable return result.Data.AfterSaleRule.SupplyDayReturnRule.Enable
} }
// GetProductUpdateRule2 查询分类是否支持七天无理由退货
func (a *API) GetProductUpdateRule2(categoryId int64) bool {
request := product_getProductUpdateRule_request.New()
param := request.GetParams()
param.CategoryId = categoryId
result, err := request.Execute(a.accessTokenObj)
if err != nil {
return false
}
if result.Code != RequestSuccessCode {
return false
}
return result.Data.AfterSaleRule.SupplyDayReturnRule.Enable
}

View File

@@ -62,8 +62,9 @@ func TestCreateStoreCommodity(t *testing.T) {
FreightId: 11111, // 运费模板id FreightId: 11111, // 运费模板id
//Weight: 0, //Weight: 0,
//WeightUnit: 0, //WeightUnit: 0,
DeliveryDelayDay: DeliveryDelayDayToDay, // 现货发货(presell_type=0)和阶梯发货模式(presell_type=2)时必填 DeliveryDelayDay: DeliveryDelayDayTomorrow, // 现货发货(presell_type=0)和阶梯发货模式(presell_type=2)时必填
PresellType: SendGoodsTypeNow, // 0现发货/1预售发货/2阶梯发货 PresellType: 1, // 0现发货/1预售发货/2阶梯发货
PresellConfigLevel: 1, // 0现发货/1预售发货/2阶梯发货
//PresellDelay: 0, //PresellDelay: 0,
//PresellEndTime: "", //PresellEndTime: "",
//Supply7dayReturn: 0, //Supply7dayReturn: 0,
@@ -116,13 +117,16 @@ func TestCreateStoreCommodity(t *testing.T) {
category, err := a.GetCatePropertyV2(param.CategoryLeafId) category, err := a.GetCatePropertyV2(param.CategoryLeafId)
format := make(map[string][]*ProductFormatNewList, 0) format := make(map[string][]*ProductFormatNewList, 0)
for _, v := range category.Data.Data { for _, v := range category.Data.Data {
if v.Required != 1 {
continue
}
for _, d := range v.Options { for _, d := range v.Options {
formateNew := &ProductFormatNewList{ formateNew := &ProductFormatNewList{
Value: utils.Str2Int64(d.Value), Value: utils.Str2Int64(d.Value),
Name: d.Name, Name: d.Name,
DiyType: v.DiyType, DiyType: v.DiyType,
} }
format[utils.Int64ToStr(v.CategoryId)] = append(format[utils.Int64ToStr(v.CategoryId)], formateNew) format[utils.Int64ToStr(v.PropertyId)] = append(format[utils.Int64ToStr(v.PropertyId)], formateNew)
} }
} }
productFormatNew, err := json.Marshal(format) productFormatNew, err := json.Marshal(format)
@@ -268,12 +272,11 @@ func TestEditStoreCommodity(t *testing.T) {
data, _ := a.GetSkuDetail("3580251132888538614", "") data, _ := a.GetSkuDetail("3580251132888538614", "")
globals.SugarLogger.Debugf("=============%s", data.ProductFormatNew) globals.SugarLogger.Debugf("=============%s", data.ProductFormatNew)
specPrice, _ := json.Marshal(data.SpecPrices) specPrice, _ := json.Marshal(data.SpecPrices)
specs, _ := json.Marshal(data.Specs)
a.EditStoreCommodity(&product_editV2_request.ProductEditV2Param{ a.EditStoreCommodity(&product_editV2_request.ProductEditV2Param{
ProductId: 1748169491056643, ProductId: 1748169491056643,
ProductFormatNew: data.ProductFormatNew, ProductFormatNew: data.ProductFormatNew,
SpecPrices: string(specPrice), SpecPrices: string(specPrice),
Specs: string(specs), Specs: "重量|250g",
Commit: true, Commit: true,
}) })
} }
@@ -378,3 +381,7 @@ func TestNameeeee(t *testing.T) {
aa := `667278_/image/4229fbb12a40ddcc7a2d42728f` aa := `667278_/image/4229fbb12a40ddcc7a2d42728f`
fmt.Println(strings.Contains(aa, "detail_")) fmt.Println(strings.Contains(aa, "detail_"))
} }
func TestGetProductUpdateRule2(t *testing.T) {
a.GetProductUpdateRule2(20219)
}