Переглянути джерело

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

viczhq 1 тиждень тому
батько
коміт
9a74e7fc46

+ 7 - 0
project.private.config.json

@@ -10,6 +10,13 @@
10 10
     "miniprogram": {
11 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 20
           "name": "pages/indexSub/productDetail/index",
14 21
           "pathName": "pages/indexSub/productDetail/index",
15 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 38
       root: "pages/mineSub",
39 39
       pages: [
40 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 253
         <Image
254 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 256
           mode="widthFix"
257 257
         />
258 258
         {/* 商品列表盒子 */}

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

@@ -1,6 +1,6 @@
1 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 4
 import "./index.less";
5 5
 import Taro from "@tarojs/taro";
6 6
 import ProductList from "../../../components/index/ProductList";
@@ -19,12 +19,14 @@ export default class Index extends Component {
19 19
     loading: false, //加载状态
20 20
     totalPages: 1, // 添加总页数
21 21
     tabList: [], // 所有闲鱼tags
22
+    value: "", // 搜索
22 23
   };
23 24
   handleClick(value) {
24 25
     this.setState(
25 26
       {
26 27
         current: value,
27 28
         page: 1,
29
+        value: "",
28 30
       },
29 31
       () => {
30 32
         Taro.pageScrollTo({
@@ -47,6 +49,7 @@ export default class Index extends Component {
47 49
       tag_name: this.state.tabList[this.state.current].title,
48 50
       page,
49 51
       page_size: 10,
52
+      search_name: this.state.value,
50 53
     });
51 54
 
52 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 87
   onAddProduct = (productId, index) => {
77 88
     addShopProduct({
@@ -107,12 +118,37 @@ export default class Index extends Component {
107 118
   render() {
108 119
     return (
109 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 152
         <ProductList
117 153
           loading={this.state.loading}
118 154
           productList={this.state.productList}

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

@@ -1,21 +1,27 @@
1 1
 .index {
2 2
     background-color: #f9f9f9;
3 3
     padding-bottom: 160px;
4
-    padding-top: 80px;
4
+    padding-top: 204px;
5 5
     box-sizing: border-box;
6
-    .at-tabs__header{
6
+
7
+    .top-fixed {
7 8
         position: fixed;
8 9
         top: 0;
9 10
         width: 100%;
10
-        z-index: 1;
11
+        z-index: 999;
12
+        background-color: #fff;
13
+        // .at-tabs__header {
14
+        // }
11 15
     }
16
+
12 17
     scroll-view ::-webkit-scrollbar {
13 18
         appearance: none;
14 19
         color: transparent;
15 20
         display: none;
16 21
         width: 0;
17 22
         height: 0;
18
-      }
23
+    }
24
+
19 25
     .at-tabs__item {
20 26
         color: #787878;
21 27
     }
@@ -28,6 +34,43 @@
28 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 74
     .bottom-button {
32 75
         width: 100%;
33 76
         height: 88px;

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

@@ -195,6 +195,17 @@ export default class Index extends Component {
195 195
               arrow="right"
196 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 209
             {/* <View className="line"></View> */}
199 210
             {/* <AtListItem
200 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 1
 .index {
2 2
   padding: 20rpx;
3 3
   background-color: #f5f5f5;
4
+  min-height: 100vh;
5
+  box-sizing: border-box;
4 6
 }