Kaynağa Gözat

商品分类搜索框&我的-鱼市说明

viczhq 1 hafta önce
ebeveyn
işleme
9a74e7fc46

+ 7 - 0
project.private.config.json

@@ -10,6 +10,13 @@
10
     "miniprogram": {
10
     "miniprogram": {
11
       "list": [
11
       "list": [
12
         {
12
         {
13
+          "name": "pages/memberSub/productClassify/index",
14
+          "pathName": "pages/memberSub/productClassify/index",
15
+          "query": "",
16
+          "launchMode": "default",
17
+          "scene": null
18
+        },
19
+        {
13
           "name": "pages/indexSub/productDetail/index",
20
           "name": "pages/indexSub/productDetail/index",
14
           "pathName": "pages/indexSub/productDetail/index",
21
           "pathName": "pages/indexSub/productDetail/index",
15
           "query": "id=19408&isSeckill=true&shareUserId=&tagTitle=%E6%9D%A5%E9%B1%BC%E5%B8%82%20%E5%93%81%E5%92%96%E5%95%A1&isShare=false&isShowBack=false",
22
           "query": "id=19408&isSeckill=true&shareUserId=&tagTitle=%E6%9D%A5%E9%B1%BC%E5%B8%82%20%E5%93%81%E5%92%96%E5%95%A1&isShare=false&isShowBack=false",

+ 2 - 1
src/app.config.js

@@ -38,7 +38,8 @@ export default defineAppConfig({
38
       root: "pages/mineSub",
38
       root: "pages/mineSub",
39
       pages: [
39
       pages: [
40
         "infoEdit/index",
40
         "infoEdit/index",
41
-        "userSpecification/index"
41
+        "userSpecification/index",
42
+        "explain/index"
42
       ]
43
       ]
43
     },
44
     },
44
     {
45
     {

+ 1 - 1
src/pages/indexSub/activity/index.jsx

@@ -252,7 +252,7 @@ export default class Index extends Component {
252
         )}
252
         )}
253
         <Image
253
         <Image
254
           className="bottom-title-img"
254
           className="bottom-title-img"
255
-          src="https://yushi.tos-cn-beijing.volces.com/activity/titleImgOne.png"
255
+          src="https://yushi.tos-cn-beijing.volces.com/activity/titleImgTwo.png"
256
           mode="widthFix"
256
           mode="widthFix"
257
         />
257
         />
258
         {/* 商品列表盒子 */}
258
         {/* 商品列表盒子 */}

+ 44 - 8
src/pages/memberSub/productClassify/index.jsx

@@ -1,6 +1,6 @@
1
 import { Component } from "react";
1
 import { Component } from "react";
2
-import { View } from "@tarojs/components";
3
-import { AtTabs } from "taro-ui";
2
+import { View, Input } from "@tarojs/components";
3
+import { AtTabs, AtIcon } from "taro-ui";
4
 import "./index.less";
4
 import "./index.less";
5
 import Taro from "@tarojs/taro";
5
 import Taro from "@tarojs/taro";
6
 import ProductList from "../../../components/index/ProductList";
6
 import ProductList from "../../../components/index/ProductList";
@@ -19,12 +19,14 @@ export default class Index extends Component {
19
     loading: false, //加载状态
19
     loading: false, //加载状态
20
     totalPages: 1, // 添加总页数
20
     totalPages: 1, // 添加总页数
21
     tabList: [], // 所有闲鱼tags
21
     tabList: [], // 所有闲鱼tags
22
+    value: "", // 搜索
22
   };
23
   };
23
   handleClick(value) {
24
   handleClick(value) {
24
     this.setState(
25
     this.setState(
25
       {
26
       {
26
         current: value,
27
         current: value,
27
         page: 1,
28
         page: 1,
29
+        value: "",
28
       },
30
       },
29
       () => {
31
       () => {
30
         Taro.pageScrollTo({
32
         Taro.pageScrollTo({
@@ -47,6 +49,7 @@ export default class Index extends Component {
47
       tag_name: this.state.tabList[this.state.current].title,
49
       tag_name: this.state.tabList[this.state.current].title,
48
       page,
50
       page,
49
       page_size: 10,
51
       page_size: 10,
52
+      search_name: this.state.value,
50
     });
53
     });
51
 
54
 
52
     this.setState((prevState) => ({
55
     this.setState((prevState) => ({
@@ -72,6 +75,14 @@ export default class Index extends Component {
72
       }
75
       }
73
     );
76
     );
74
   };
77
   };
78
+  // 输入
79
+  handleChange = (e) => {
80
+    this.setState({ value: e.target.value });
81
+  };
82
+  // 搜索
83
+  handleSearch = () => {
84
+    this.getBrowseShopProductList(true);
85
+  };
75
   // 添加商品
86
   // 添加商品
76
   onAddProduct = (productId, index) => {
87
   onAddProduct = (productId, index) => {
77
     addShopProduct({
88
     addShopProduct({
@@ -107,12 +118,37 @@ export default class Index extends Component {
107
   render() {
118
   render() {
108
     return (
119
     return (
109
       <View className="index">
120
       <View className="index">
110
-        <AtTabs
111
-          scroll
112
-          current={this.state.current}
113
-          tabList={this.state.tabList}
114
-          onClick={this.handleClick.bind(this)}
115
-        ></AtTabs>
121
+        {/* 顶部固定 */}
122
+        <View className="top-fixed">
123
+          <AtTabs
124
+            scroll
125
+            current={this.state.current}
126
+            tabList={this.state.tabList}
127
+            onClick={this.handleClick.bind(this)}
128
+          ></AtTabs>
129
+          {/* 搜索 */}
130
+          <View className="search-container">
131
+            <View className="search-bar">
132
+              <AtIcon
133
+                className="search-icon"
134
+                value="search"
135
+                size="20"
136
+                color="#ACACAC"
137
+              ></AtIcon>
138
+              <Input
139
+                type="text"
140
+                className="search-input"
141
+                placeholder=""
142
+                value={this.state.value}
143
+                onInput={this.handleChange}
144
+              />
145
+              <View onClick={this.handleSearch} className="search-button">
146
+                搜索
147
+              </View>
148
+            </View>
149
+          </View>
150
+        </View>
151
+        {/* 商品列表 */}
116
         <ProductList
152
         <ProductList
117
           loading={this.state.loading}
153
           loading={this.state.loading}
118
           productList={this.state.productList}
154
           productList={this.state.productList}

+ 47 - 4
src/pages/memberSub/productClassify/index.less

@@ -1,21 +1,27 @@
1
 .index {
1
 .index {
2
     background-color: #f9f9f9;
2
     background-color: #f9f9f9;
3
     padding-bottom: 160px;
3
     padding-bottom: 160px;
4
-    padding-top: 80px;
4
+    padding-top: 204px;
5
     box-sizing: border-box;
5
     box-sizing: border-box;
6
-    .at-tabs__header{
6
+
7
+    .top-fixed {
7
         position: fixed;
8
         position: fixed;
8
         top: 0;
9
         top: 0;
9
         width: 100%;
10
         width: 100%;
10
-        z-index: 1;
11
+        z-index: 999;
12
+        background-color: #fff;
13
+        // .at-tabs__header {
14
+        // }
11
     }
15
     }
16
+
12
     scroll-view ::-webkit-scrollbar {
17
     scroll-view ::-webkit-scrollbar {
13
         appearance: none;
18
         appearance: none;
14
         color: transparent;
19
         color: transparent;
15
         display: none;
20
         display: none;
16
         width: 0;
21
         width: 0;
17
         height: 0;
22
         height: 0;
18
-      }
23
+    }
24
+
19
     .at-tabs__item {
25
     .at-tabs__item {
20
         color: #787878;
26
         color: #787878;
21
     }
27
     }
@@ -28,6 +34,43 @@
28
         background-color: #f3e801;
34
         background-color: #f3e801;
29
     }
35
     }
30
 
36
 
37
+    // 搜索
38
+    .search-container {
39
+        display: flex;
40
+        align-items: center;
41
+        justify-content: center;
42
+        position: relative;
43
+        background-color: #fff;
44
+        padding: 20px 34px;
45
+
46
+        .search-bar {
47
+            width: 90%;
48
+            display: flex;
49
+            align-items: center;
50
+            border-radius: 14px;
51
+            padding: 18px;
52
+            background-color: #f6f6f6;
53
+
54
+            .search-icon {
55
+                margin-right: 18px;
56
+            }
57
+
58
+            .search-input {
59
+                flex: 1;
60
+                border: none;
61
+                outline: none;
62
+                background-color: transparent;
63
+            }
64
+
65
+            .search-button {
66
+                font-weight: 500;
67
+                font-size: 28px;
68
+                color: #FAA803;
69
+            }
70
+        }
71
+
72
+    }
73
+
31
     .bottom-button {
74
     .bottom-button {
32
         width: 100%;
75
         width: 100%;
33
         height: 88px;
76
         height: 88px;

+ 11 - 0
src/pages/mine/index.jsx

@@ -195,6 +195,17 @@ export default class Index extends Component {
195
               arrow="right"
195
               arrow="right"
196
               thumb={norm}
196
               thumb={norm}
197
             />
197
             />
198
+            <AtListItem
199
+              hasBorder={false}
200
+              onClick={() =>
201
+                Taro.navigateTo({
202
+                  url: `/pages/mineSub/explain/index`,
203
+                })
204
+              }
205
+              title="鱼市说明"
206
+              arrow="right"
207
+              thumb='https://yushi.tos-cn-beijing.volces.com/mine/explain.png'
208
+            />
198
             {/* <View className="line"></View> */}
209
             {/* <View className="line"></View> */}
199
             {/* <AtListItem
210
             {/* <AtListItem
200
               hasBorder={false}
211
               hasBorder={false}

+ 3 - 0
src/pages/mineSub/explain/index.config.js

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '鱼市说明'
3
+})

+ 28 - 0
src/pages/mineSub/explain/index.jsx

@@ -0,0 +1,28 @@
1
+import { Component } from 'react'
2
+import { View, RichText } from '@tarojs/components'
3
+import './index.less'
4
+import { getUserAgreement } from '../../../service'
5
+export default class Index extends Component {
6
+  state = {
7
+    agreement: ''
8
+  }
9
+  componentDidMount () { 
10
+    this.getUserAgreement()
11
+  }
12
+  // 获取用户协议
13
+  getUserAgreement = async () => {
14
+    const res = await getUserAgreement({
15
+      type:2
16
+    })
17
+    this.setState({
18
+      agreement: res.content
19
+    })
20
+  }
21
+  render () {
22
+    return (
23
+      <View className='index'>
24
+        {this.state.agreement && <RichText nodes={this.state.agreement} />}
25
+      </View>
26
+    )
27
+  }
28
+}

+ 6 - 0
src/pages/mineSub/explain/index.less

@@ -0,0 +1,6 @@
1
+.index {
2
+  padding: 20rpx;
3
+  background-color: #f5f5f5;
4
+  min-height: 100vh;
5
+  box-sizing: border-box;
6
+}

+ 2 - 0
src/pages/mineSub/userSpecification/index.less

@@ -1,4 +1,6 @@
1
 .index {
1
 .index {
2
   padding: 20rpx;
2
   padding: 20rpx;
3
   background-color: #f5f5f5;
3
   background-color: #f5f5f5;
4
+  min-height: 100vh;
5
+  box-sizing: border-box;
4
 }
6
 }