1/* 2 * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16export class GoodResponse { 17 code: number; 18 data: Records; 19 error: string; 20 21 constructor(code: number, data: Records, error: string) { 22 this.code = code; 23 this.data = data; 24 this.error = error; 25 } 26} 27 28export class Info { 29 id: number; 30 uri: string; 31 title: string; 32 info: string; 33 labels: string; 34 price: number; 35 36 constructor(id: number, uri: string, title: string, info: string, labels: string, price: number) { 37 this.id = id; 38 this.uri = uri; 39 this.title = title; 40 this.info = info; 41 this.labels = labels; 42 this.price = price; 43 } 44} 45 46export class Records { 47 records: Array<Info>; 48 totalCount: number; 49 50 constructor(records: Array<Info>, totalCount: number) { 51 this.records = records; 52 this.totalCount = totalCount; 53 } 54} 55 56export class TabTitleModel { 57 uri: Resource; 58 selectedUri: Resource; 59 title: Resource; 60 61 constructor(uri: Resource, selectedUri: Resource, title: Resource) { 62 this.uri = uri; 63 this.selectedUri = selectedUri; 64 this.title = title; 65 } 66} 67 68export class FavorLiveListsModel { 69 id: number; 70 imgSrc: Resource; 71 title: Resource; 72 viewsInfo: Resource; 73 74 constructor(id: number, imgSrc: Resource, title: Resource, viewsInfo: Resource) { 75 this.id = id; 76 this.imgSrc = imgSrc; 77 this.title = title; 78 this.viewsInfo = viewsInfo; 79 } 80} 81 82export class OrderModel { 83 id: number; 84 img: Resource; 85 title: Resource; 86 87 constructor(id: number, img: Resource, title: Resource) { 88 this.id = id; 89 this.img = img; 90 this.title = title; 91 } 92} 93 94export class ShopCartItemDataModel { 95 id: number; 96 uri: Resource; 97 title: Resource; 98 labels: Resource; 99 price: Resource; 100 101 constructor(id: number, uri: Resource, title: Resource, labels: Resource, price: Resource) { 102 this.id = id; 103 this.uri = uri; 104 this.title = title; 105 this.labels = labels; 106 this.price = price; 107 } 108} 109 110export class SearchTextModel { 111 id: number; 112 searchText: Resource; 113 114 constructor(id: number, searchText: Resource) { 115 this.id = id; 116 this.searchText = searchText; 117 } 118} 119 120export class SwiperModel { 121 id: number; 122 img: Resource; 123 124 constructor(id: number, img: Resource) { 125 this.id = id; 126 this.img = img; 127 } 128} 129 130export class NewProductTitleBarModel { 131 id: number; 132 title: Resource | undefined = undefined; 133 134 constructor(id: number, title: Resource) { 135 this.id = id; 136 this.title = title; 137 } 138} 139 140export class NavDataModel { 141 id: number = 0; 142 navData: Resource | undefined = undefined; 143 144 constructor(id: number, navData: Resource) { 145 this.navData = navData; 146 this.id = id; 147 } 148} 149 150export class TitleBarModel { 151 id: number; 152 title: Resource | undefined = undefined; 153 content: Resource | undefined = undefined; 154 155 constructor(id: number, title: Resource, content: Resource) { 156 this.id = id; 157 this.title = title; 158 this.content = content; 159 } 160} 161 162export class ProductDataModel { 163 id: number; 164 uri: ResourceStr; 165 title: ResourceStr; 166 info: ResourceStr; 167 labels: ResourceStr; 168 price: ResourceStr; 169 170 constructor(id: number, uri: ResourceStr, title: ResourceStr, info: ResourceStr, labels: ResourceStr, price: ResourceStr) { 171 this.id = id; 172 this.uri = uri; 173 this.info = info; 174 this.title = title; 175 this.labels = labels; 176 this.price = price; 177 } 178}