|
@@ -1,6 +1,6 @@
|
1
|
1
|
import React, { Component, createRef } from "react";
|
2
|
2
|
import { View, Picker, Image, Text } from "@tarojs/components";
|
3
|
|
-import { AtTabs, AtTabsPane, AtCheckbox } from "taro-ui";
|
|
3
|
+import { AtTabs, AtCheckbox } from "taro-ui";
|
4
|
4
|
import Taro from "@tarojs/taro";
|
5
|
5
|
import "./index.less";
|
6
|
6
|
import {
|
|
@@ -23,9 +23,9 @@ export default class Index extends Component {
|
23
|
23
|
isManagementStatus: false, //是否是管理状态
|
24
|
24
|
current: 0, //tabs坐标
|
25
|
25
|
isSelectAll: false, //是否全选
|
26
|
|
- selectedOption: "首页", //商品默认名称
|
|
26
|
+ selectedOption: "", //商品默认名称
|
27
|
27
|
tabList: [{ title: "在售中 (0)" }], //tabs标题
|
28
|
|
- options: ["首页"], //商品下拉选项
|
|
28
|
+ options: [""], //商品下拉选项
|
29
|
29
|
checkedList: [""], //全选
|
30
|
30
|
checkboxOption: [
|
31
|
31
|
{
|
|
@@ -51,6 +51,7 @@ export default class Index extends Component {
|
51
|
51
|
this.setState(
|
52
|
52
|
{
|
53
|
53
|
options: arr,
|
|
54
|
+ selectedOption: res[0].name,
|
54
|
55
|
},
|
55
|
56
|
() => {
|
56
|
57
|
this.getMyShopList(true);
|
|
@@ -236,46 +237,43 @@ export default class Index extends Component {
|
236
|
237
|
tabList={this.state.tabList}
|
237
|
238
|
current={this.state.current}
|
238
|
239
|
scroll
|
239
|
|
- >
|
240
|
|
- <AtTabsPane current={this.state.current} index={0}>
|
241
|
|
- {/* 内容 */}
|
242
|
|
- <View className="tabs-content">
|
243
|
|
- {/* 商品下拉分类 */}
|
244
|
|
- <View className="product-category">
|
245
|
|
- <Picker
|
246
|
|
- mode="selector"
|
247
|
|
- range={this.state.options}
|
248
|
|
- onChange={this.handleSelectOption}
|
249
|
|
- >
|
250
|
|
- <View className="product-category-left">
|
251
|
|
- {this.state.selectedOption}
|
252
|
|
- <Image
|
253
|
|
- className="selectIcon"
|
254
|
|
- src={selectIcon}
|
255
|
|
- mode="aspectFit"
|
256
|
|
- />
|
257
|
|
- </View>
|
258
|
|
- </Picker>
|
259
|
|
- <View className="product-category-right">
|
260
|
|
- 前6款商品将推荐给直属会员
|
261
|
|
- </View>
|
262
|
|
- </View>
|
263
|
|
- {/* 商品列表 */}
|
264
|
|
- {this.state.productList && (
|
265
|
|
- <ProductList
|
266
|
|
- ref={this.childComponentRef} // 将 ref 传递给子组件
|
267
|
|
- productList={this.state.productList}
|
268
|
|
- isSelectAll={this.state.isSelectAll}
|
269
|
|
- isManagement={true}
|
270
|
|
- isManagementStatus={this.state.isManagementStatus}
|
271
|
|
- loading={this.state.loading}
|
272
|
|
- onDeleteProductSelect={this.onDeleteProductSelect}
|
273
|
|
- isNoMore={this.state.isNoMore}
|
|
240
|
+ ></AtTabs>
|
|
241
|
+ {/* 内容 */}
|
|
242
|
+ <View className="tabs-content">
|
|
243
|
+ {/* 商品下拉分类 */}
|
|
244
|
+ <View className="product-category">
|
|
245
|
+ <Picker
|
|
246
|
+ mode="selector"
|
|
247
|
+ range={this.state.options}
|
|
248
|
+ onChange={this.handleSelectOption}
|
|
249
|
+ >
|
|
250
|
+ <View className="product-category-left">
|
|
251
|
+ {this.state.selectedOption}
|
|
252
|
+ <Image
|
|
253
|
+ className="selectIcon"
|
|
254
|
+ src={selectIcon}
|
|
255
|
+ mode="aspectFit"
|
274
|
256
|
/>
|
275
|
|
- )}
|
|
257
|
+ </View>
|
|
258
|
+ </Picker>
|
|
259
|
+ <View className="product-category-right">
|
|
260
|
+ 前6款商品将推荐给直属会员
|
276
|
261
|
</View>
|
277
|
|
- </AtTabsPane>
|
278
|
|
- </AtTabs>
|
|
262
|
+ </View>
|
|
263
|
+ {/* 商品列表 */}
|
|
264
|
+ {this.state.productList && (
|
|
265
|
+ <ProductList
|
|
266
|
+ ref={this.childComponentRef} // 将 ref 传递给子组件
|
|
267
|
+ productList={this.state.productList}
|
|
268
|
+ isSelectAll={this.state.isSelectAll}
|
|
269
|
+ isManagement={true}
|
|
270
|
+ isManagementStatus={this.state.isManagementStatus}
|
|
271
|
+ loading={this.state.loading}
|
|
272
|
+ onDeleteProductSelect={this.onDeleteProductSelect}
|
|
273
|
+ isNoMore={this.state.isNoMore}
|
|
274
|
+ />
|
|
275
|
+ )}
|
|
276
|
+ </View>
|
279
|
277
|
</View>
|
280
|
278
|
{/* 底部购买模块 */}
|
281
|
279
|
{!this.state.isManagementStatus ? (
|