Browse Source

产品详情&&会员页面

viczhq 3 months ago
parent
commit
2c42bcb694
36 changed files with 1174 additions and 45 deletions
  1. 1 1
      project.config.json
  2. 14 1
      project.private.config.json
  3. 2 0
      src/app.config.js
  4. 6 1
      src/app.js
  5. 1 0
      src/app.less
  6. 57 0
      src/components/Modal/index.jsx
  7. 122 0
      src/components/Modal/index.less
  8. 22 0
      src/components/ProductCard/index.jsx
  9. 57 0
      src/components/ProductCard/index.less
  10. 15 3
      src/components/index/OperationArea/index.jsx
  11. 32 13
      src/components/index/ProductList/index.jsx
  12. 10 0
      src/components/index/ProductList/index.less
  13. BIN
      src/images/member/order.png
  14. BIN
      src/images/member/toDetail.png
  15. BIN
      src/images/member/vip.png
  16. BIN
      src/images/member/warning.png
  17. BIN
      src/images/member/withdrawable.png
  18. BIN
      src/images/productDetail/like.png
  19. BIN
      src/images/productDetail/productDetailIcon.png
  20. BIN
      src/images/productDetail/selectStep.png
  21. BIN
      src/images/productDetail/selfBuy.png
  22. BIN
      src/images/productDetail/share.png
  23. BIN
      src/images/productDetail/stepThree.png
  24. BIN
      src/images/productDetail/xianyu.png
  25. BIN
      src/images/seckill/seckillIcon.png
  26. BIN
      src/images/seckill/seckillTop.png
  27. 2 11
      src/pages/index/index.jsx
  28. 74 14
      src/pages/member/index.jsx
  29. 251 0
      src/pages/member/index.less
  30. 1 1
      src/pages/mine/index.config.js
  31. 3 0
      src/pages/productDetail/index.config.js
  32. 213 0
      src/pages/productDetail/index.jsx
  33. 249 0
      src/pages/productDetail/index.less
  34. 3 0
      src/pages/seckillIndex/index.config.js
  35. 28 0
      src/pages/seckillIndex/index.jsx
  36. 11 0
      src/pages/seckillIndex/index.less

+ 1 - 1
project.config.json

@@ -7,7 +7,7 @@
7 7
     "urlCheck": true,
8 8
     "es6": false,
9 9
     "postcss": false,
10
-    "minified": false,
10
+    "minified": true,
11 11
     "babelSetting": {
12 12
       "ignore": [],
13 13
       "disablePlugins": [],

+ 14 - 1
project.private.config.json

@@ -4,5 +4,18 @@
4 4
   "setting": {
5 5
     "compileHotReLoad": true
6 6
   },
7
-  "libVersion": "3.6.4"
7
+  "libVersion": "3.6.4",
8
+  "condition": {
9
+    "miniprogram": {
10
+      "list": [
11
+        {
12
+          "name": "pages/seckillSub/seckillIndex/index",
13
+          "pathName": "pages/productDetail/index",
14
+          "query": "id=1",
15
+          "launchMode": "default",
16
+          "scene": null
17
+        }
18
+      ]
19
+    }
20
+  }
8 21
 }

+ 2 - 0
src/app.config.js

@@ -5,6 +5,8 @@ export default defineAppConfig({
5 5
     'pages/index/index',
6 6
     'pages/member/index',
7 7
     "pages/mine/index",
8
+    "pages/seckillIndex/index",
9
+    "pages/productDetail/index"
8 10
   ],
9 11
   subpackages: [
10 12
   ],

+ 6 - 1
src/app.js

@@ -1,10 +1,15 @@
1 1
 import { Component } from 'react'
2
+import Taro from '@tarojs/taro'
2 3
 import './app.less'
3 4
 import 'taro-ui/dist/style/index.scss'
4 5
 
5 6
 class App extends Component {
6 7
 
7
-  componentDidMount () {}
8
+  componentDidMount () {
9
+    // 存储导航栏高度
10
+    const systemInfo = Taro.getSystemInfoSync()
11
+    Taro.navigationBarHeight = systemInfo.safeArea.top
12
+  }
8 13
 
9 14
   componentDidShow () {}
10 15
 

+ 1 - 0
src/app.less

@@ -1,3 +1,4 @@
1 1
 body {
2 2
   background-color: #F9F9F9;
3
+  min-height: 100vh;
3 4
 }

+ 57 - 0
src/components/Modal/index.jsx

@@ -0,0 +1,57 @@
1
+import { AtModal, AtModalContent } from "taro-ui";
2
+import { View, Image, Text } from "@tarojs/components";
3
+import "./index.less";
4
+import selectStep from "../../images/productDetail/selectStep.png";
5
+import xianyu from "../../images/productDetail/xianyu.png";
6
+import stepThree from "../../images/productDetail/stepThree.png";
7
+export default function Modal(props) {
8
+  return (
9
+    <AtModal isOpened={props.isOpened} closeOnClickOverlay={true}>
10
+      <AtModalContent>
11
+        <View className="container">
12
+          <View className="title">{props.title}</View>
13
+          <View className="content">
14
+            <View className="link-text">{props.linkText}</View>
15
+            <View className="steps">
16
+              <View className="step-item">
17
+                <View className="step-title">
18
+                  <Text className="number">1</Text>
19
+                  <Text className="desc">第一步说明文字</Text>
20
+                </View>
21
+                <View className="step-box">
22
+                    <View className="step-One">
23
+                        复制口令
24
+                    </View>
25
+                  <Image  className="step-img-one" src={selectStep} />
26
+                </View>
27
+              </View>
28
+              <View className="step-item">
29
+                <View className="step-title">
30
+                  <Text className="number">2</Text>
31
+                  <Text className="desc">第二步说明文字</Text>
32
+                </View>
33
+                <View className="step-box">
34
+                  <Image className="step-img-t" src={xianyu} />
35
+                  <Image className="step-img-two" src={selectStep} />
36
+                </View>
37
+              </View>
38
+              <View className="step-item">
39
+                <View className="step-title">
40
+                  <Text className="number">3</Text>
41
+                  <Text className="desc">第三步说明文字</Text>
42
+                </View>
43
+                <View className="step-box">
44
+                  <Image mode="heightFix" className="step-img-three" src={stepThree} />
45
+                </View>
46
+              </View>
47
+            </View>
48
+            {/* 复制口令 */}
49
+            <View className="copy-link">
50
+                复制口令
51
+            </View>
52
+          </View>
53
+        </View>
54
+      </AtModalContent>
55
+    </AtModal>
56
+  );
57
+}

+ 122 - 0
src/components/Modal/index.less

@@ -0,0 +1,122 @@
1
+  .at-modal__container {
2
+    width: 610px !important;
3
+  }
4
+  .at-modal__content {
5
+    max-height: none !important;  // 移除最大高度限制
6
+    min-height: auto !important;  // 移除最小高度限制
7
+    height: auto !important;      // 高度自适应
8
+  }
9
+.container{
10
+    display: flex;
11
+    flex-direction: column;
12
+    align-items: center;
13
+    justify-content: center;
14
+    .title{
15
+        color: #000000;
16
+        font-size: 32px;
17
+        font-weight: bold;
18
+        line-height: 46px;
19
+        margin-bottom: 20px;
20
+    }
21
+    .content{
22
+        width: 100%;
23
+        text-align: left;
24
+        .link-text{
25
+            font-size: 28px;
26
+            color: #3D3D3D;
27
+            line-height: 41px;
28
+        }
29
+        .steps {
30
+            margin-top: 33px;
31
+            
32
+            .step-item {
33
+                margin-bottom: 24px;
34
+                
35
+                .step-title {
36
+                    display: flex;
37
+                    align-items: center;
38
+                    margin-bottom: 10px;
39
+                    
40
+                    .number {
41
+                        font-size: 22px;
42
+                        font-weight: bold;
43
+                        margin-right: 10px;
44
+                        color: #fff;
45
+                        line-height: 1;
46
+                        padding:6px 10px;
47
+                        background-color: #F6C71A;
48
+                        border-radius: 50%;
49
+                    }
50
+                    
51
+                    .desc {
52
+                        font-size: 24px;
53
+                        color: #3D3D3D;
54
+                        line-height: 35px;
55
+                        font-weight: 700;
56
+                    }
57
+                }
58
+                
59
+                .step-box {
60
+                    width: 482px;
61
+                    height: 146px;
62
+                    background: #ebebeb;
63
+                    border-radius: 20px;
64
+                    display: flex;
65
+                    align-items: center;
66
+                    justify-content: center;
67
+                    margin-left: 45px;
68
+                    box-sizing: border-box;
69
+                    position: relative;
70
+                    .step-img-one {
71
+                        max-width: 111px;
72
+                        max-height: 111px;
73
+                        position: absolute;
74
+                        top: 48px;
75
+                        right: 98px;
76
+                    }
77
+                    .step-One{
78
+                        width: 390px;
79
+                        height: 56px;
80
+                        background-color: #ffe000;
81
+                        border-radius: 60px;
82
+                        color: #000000;
83
+                        display: flex;
84
+                        justify-content: center;
85
+                        align-items: center;
86
+                        font-size: 20px;
87
+                        font-weight: 700;
88
+                    }
89
+                    .step-img-t{
90
+                        width: 192px;
91
+                        height: 116px;
92
+                    }
93
+                    .step-img-two{
94
+                        height: 111px;
95
+                        width: 111px;
96
+                        position: absolute;
97
+                        top: 59px;
98
+                        right: 125px;
99
+                    }
100
+                    .step-img-three{
101
+                        height: 100%;
102
+                    }
103
+                }
104
+            }
105
+        }
106
+        // 复制口令
107
+        .copy-link{
108
+            margin: 0 auto;
109
+            height: 88px;
110
+            width: 520px;
111
+            border-radius: 60px;
112
+            background-color: #ffe000;
113
+            color: #000000;
114
+            font-size: 28px;
115
+            font-weight: 700;
116
+            margin-top: 45px;
117
+            display: flex;
118
+            justify-content: center;
119
+            align-items: center;
120
+        }
121
+    }
122
+}

+ 22 - 0
src/components/ProductCard/index.jsx

@@ -0,0 +1,22 @@
1
+import { View, Text, Image } from '@tarojs/components'
2
+import './index.less'
3
+
4
+const ProductCard = ({ product }) => {
5
+  return (
6
+    <View className='product-card'>
7
+      <Image className='product-img' src={product.imageUrl} mode='aspectFill' />
8
+      <View className='product-content'>
9
+        <Text className='title'>{product.name}</Text>
10
+        <View className='price-row'>
11
+          <Text className='price'>
12
+            <Text className='currency'>¥</Text>
13
+            {product.price}
14
+          </Text>
15
+          <Text className='original-price'>¥{product.originalPrice}</Text>
16
+        </View>
17
+      </View>
18
+    </View>
19
+  )
20
+}
21
+
22
+export default ProductCard

+ 57 - 0
src/components/ProductCard/index.less

@@ -0,0 +1,57 @@
1
+// 猜你喜欢列表
2
+.product-card-list {
3
+    margin: 0 16px 0 16px;
4
+    border-radius: 20px;
5
+    display: flex;
6
+    flex-wrap: wrap;
7
+    gap: 17px;
8
+    .product-card {
9
+        width: 352px;
10
+        background-color: #fff;
11
+        border-radius: 20px;
12
+        margin-bottom: 10px;
13
+        .product-img {
14
+            width: 352px;
15
+            height: 258px;
16
+        }
17
+
18
+        .product-content {
19
+            padding: 0 16px 18px;
20
+
21
+            .title {
22
+                line-height: 41px;
23
+                font-size: 28px;
24
+                margin: 6px 0;
25
+                min-height: 82px;
26
+                overflow: hidden;
27
+                text-overflow: ellipsis;
28
+                display: -webkit-box;
29
+                -webkit-line-clamp: 2;
30
+                -webkit-box-orient: vertical;
31
+                white-space: normal;
32
+            }
33
+
34
+            .price-row {
35
+                display: flex;
36
+                align-items: center;
37
+                gap: 8px;
38
+
39
+                .price {
40
+                    color: #ff4d4f;
41
+                    font-size: 36px;
42
+                    line-height: 26px;
43
+                    .currency {
44
+                        font-size: 22px;
45
+                    }
46
+                }
47
+
48
+                .original-price {
49
+                    color: #999;
50
+                    font-size: 26px;
51
+                    line-height: 38px;
52
+                    text-decoration: line-through;
53
+                }
54
+            }
55
+        }
56
+    }
57
+}

+ 15 - 3
src/components/index/OperationArea/index.jsx

@@ -1,4 +1,5 @@
1 1
 import { View, Text, Image } from "@tarojs/components";
2
+import Taro from "@tarojs/taro";
2 3
 import "./index.less";
3 4
 
4 5
 const OperationArea = () => {
@@ -27,9 +28,20 @@ const OperationArea = () => {
27 28
     }
28 29
   ];
29 30
 
31
+  // 添加跳转方法
32
+  const handleNavigate = (type) => {
33
+    if (type === 'seckill') {
34
+      Taro.navigateTo({
35
+        url: '/pages/seckillIndex/index'
36
+      });
37
+    } else if (type === 'highCommission') {
38
+
39
+    }
40
+  };
41
+
30 42
   return (
31
-    <View className="operation-wrap">
32
-      <View className="operation-item">
43
+    <View className="operation-wrap" >
44
+      <View className="operation-item" onClick={() => handleNavigate('seckill')}>
33 45
         <View className="title">限时秒杀</View>
34 46
         <View className="product-list">
35 47
           {seckillProducts.map(product => (
@@ -46,7 +58,7 @@ const OperationArea = () => {
46 58
           ))}
47 59
         </View>
48 60
       </View>
49
-      <View className="operation-item">
61
+      <View className="operation-item" onClick={() => handleNavigate('highCommission')}>
50 62
         <View className="title-wrap">
51 63
           <Text className="title">高佣专项</Text>
52 64
           <Text className="tag">高佣金必囤爆品</Text>

+ 32 - 13
src/components/index/ProductList/index.jsx

@@ -1,10 +1,12 @@
1 1
 import { View, Text, Image } from "@tarojs/components";
2
+import Taro from "@tarojs/taro";
2 3
 import "./index.less";
3 4
 import joinStoreBg from '../../../images/index/jionStore.png'
4 5
 import saveMoneyBg from '../../../images/index/save-money.png'
5 6
 import shareEarnBg from '../../../images/index/share-earn.png'
6
-
7
-const ProductList = () => {
7
+import seckillIcon from '../../../images/seckill/seckillIcon.png'
8
+const ProductList = (props) => {
9
+  const { isSeckill } = props;
8 10
   // 模拟商品数据
9 11
   const products = [
10 12
     {
@@ -36,16 +38,27 @@ const ProductList = () => {
36 38
     },
37 39
     // ... 其他商品数据
38 40
   ];
39
-
41
+  // 跳转产品详情
42
+  const toDetail = (id) => {
43
+    Taro.navigateTo({
44
+      url: `/pages/productDetail/index?id=${id}`
45
+    });
46
+  }
40 47
   return (
41 48
     <View className="product-list-wrap">
49
+      {isSeckill && (
50
+        <View className="seckill-icon">
51
+          <Image src={seckillIcon} mode="aspectFit" />
52
+          <Text>每日疯抢 限时秒杀</Text>
53
+        </View>
54
+      )}
42 55
       {products.map((product, index) => (
43 56
         <View key={product.id}>
44
-          <View className="product-item">
57
+          <View onClick={() => toDetail(product.id)} className="product-item">
45 58
             <Image className="product-img" src={product.image} mode="aspectFill" />
46 59
             <View className="product-info">
47 60
               <View className="product-name" style={{"WebkitBoxOrient": "vertical"}}>
48
-                <Text className="self-tag">自营</Text>
61
+                <Text className="self-tag">{!isSeckill ? '自营' : '鱼市秒杀'}</Text>
49 62
                 {product.name}
50 63
               </View>
51 64
               <View className="price-line">
@@ -54,14 +67,16 @@ const ProductList = () => {
54 67
                   <Text className="price">{product.price}</Text>
55 68
                   <Text className="original-price">¥{product.originalPrice}</Text>
56 69
                 </View>
57
-                <View className="add-btn">
58
-                  <Image 
59
-                    className="join-store-bg" 
60
-                    src={joinStoreBg}
61
-                    mode="aspectFit"
62
-                  />
63
-                  <Text className="btn-text">加入小店</Text>
64
-                </View>
70
+                {!isSeckill && (
71
+                  <View className="add-btn">
72
+                    <Image 
73
+                      className="join-store-bg" 
74
+                      src={joinStoreBg}
75
+                      mode="aspectFit"
76
+                    />
77
+                    <Text className="btn-text">加入小店</Text>
78
+                  </View>
79
+                )}
65 80
               </View>
66 81
               <View className="profit-line">
67 82
                 <View className="save-money">
@@ -88,4 +103,8 @@ const ProductList = () => {
88 103
   );
89 104
 };
90 105
 
106
+ProductList.defaultProps = {
107
+  isSeckill: false
108
+};
109
+
91 110
 export default ProductList; 

+ 10 - 0
src/components/index/ProductList/index.less

@@ -148,4 +148,14 @@
148 148
     margin: 0 17px 0 20px;
149 149
     border-top: 1px dashed #D8D8D8;
150 150
   }
151
+  .seckill-icon{
152
+    padding: 18px 0 0 17px;
153
+    font-size: 26px;
154
+    font-weight: bold;
155
+    Image{
156
+      height: 26px;
157
+      width: 26px;
158
+      margin-right: 10px;
159
+    }
160
+  }
151 161
 } 

BIN
src/images/member/order.png


BIN
src/images/member/toDetail.png


BIN
src/images/member/vip.png


BIN
src/images/member/warning.png


BIN
src/images/member/withdrawable.png


BIN
src/images/productDetail/like.png


BIN
src/images/productDetail/productDetailIcon.png


BIN
src/images/productDetail/selectStep.png


BIN
src/images/productDetail/selfBuy.png


BIN
src/images/productDetail/share.png


BIN
src/images/productDetail/stepThree.png


BIN
src/images/productDetail/xianyu.png


BIN
src/images/seckill/seckillIcon.png


BIN
src/images/seckill/seckillTop.png


+ 2 - 11
src/pages/index/index.jsx

@@ -14,7 +14,6 @@ import backTopIcon from "../../images/index/back-top.png";
14 14
 export default class Index extends Component {
15 15
   state = {
16 16
     value: "",
17
-    navigationBarHeight: 0, // 添加一个状态来保存导航栏高度
18 17
     current: 0, // 添加当前选中的tab索引
19 18
     tabList: [
20 19
       // 添加模拟的tab数据
@@ -66,15 +65,7 @@ export default class Index extends Component {
66 65
       current: value,
67 66
     });
68 67
   }
69
-  componentDidMount() {
70
-    // 获取系统信息
71
-    const systemInfo = Taro.getSystemInfoSync();
72
-    // 获取 safeArea.top 作为导航栏的高度
73
-    const navigationBarHeight = systemInfo.safeArea.top;
74
-
75
-    // 设置导航栏高度到状态
76
-    this.setState({ navigationBarHeight });
77
-  }
68
+  componentDidMount() {}
78 69
 
79 70
   componentWillUnmount() {}
80 71
 
@@ -95,7 +86,7 @@ export default class Index extends Component {
95 86
       <View className="index">
96 87
         <View
97 88
           className="header"
98
-          style={{ paddingTop: this.state.navigationBarHeight + "px" }}
89
+          style={{ paddingTop: Taro.navigationBarHeight  + "px" }}
99 90
         >
100 91
           <View className="header-content">
101 92
             <Image

+ 74 - 14
src/pages/member/index.jsx

@@ -1,24 +1,84 @@
1
-import { Component } from 'react'
2
-import { View, Text } from '@tarojs/components'
3
-import './index.less'
4
-
1
+import { Component } from "react";
2
+import { View, Text, Image } from "@tarojs/components";
3
+import "./index.less";
4
+import vip from "../../images/member/vip.png";
5
+import home from "../../images/nav/home.png";
6
+import toDetail from "../../images/member/toDetail.png";
7
+import warning from "../../images/member/warning.png";
8
+import withdrawable from "../../images/member/withdrawable.png";
9
+import order from "../../images/member/order.png";
5 10
 export default class Index extends Component {
11
+  componentWillMount() {}
6 12
 
7
-  componentWillMount () { }
8
-
9
-  componentDidMount () { }
13
+  componentDidMount() {}
10 14
 
11
-  componentWillUnmount () { }
15
+  componentWillUnmount() {}
12 16
 
13
-  componentDidShow () { }
17
+  componentDidShow() {}
14 18
 
15
-  componentDidHide () { }
19
+  componentDidHide() {}
16 20
 
17
-  render () {
21
+  render() {
18 22
     return (
19
-      <View className='index'>
20
-        <Text>会员</Text>
23
+      <View className="member">
24
+        <View className="member-bg"></View>
25
+        <View className="member-content">
26
+          {/* 会员信息卡 */}
27
+          <View className="member-info-card">
28
+            <View className="member-info-card-header">
29
+              <Image className="avatar" src="" />
30
+              <View className="member-info-card-header-text">
31
+                <Text className="user-name">会员</Text>
32
+                <View className="member-info-card-header-text-level">
33
+                  <Text className="level-text">店长</Text>
34
+                  <Image className="level-icon" src={vip} />
35
+                </View>
36
+              </View>
37
+            </View>
38
+            {/* 我的小店 */}
39
+            <View className="my-shop">
40
+              <Image className="my-shop-icon" src={home} />
41
+              <Text className="my-shop-text">我的小店</Text>
42
+            </View>
43
+          </View>
44
+          {/* 预估收益 */}
45
+          <View className="estimated-income">
46
+            <Text className="estimated-income-title">预估收益</Text>
47
+            <View className="estimated-income-content">
48
+              <View className="income-item">
49
+                <Text className="amount">¥0.00</Text>
50
+                <Text className="label">今日预估收益</Text>
51
+              </View>
52
+              <View className="divider"></View>
53
+              <View className="income-item">
54
+                <Text className="amount">¥0.00</Text>
55
+                <Text className="label">累计收益</Text>
56
+              </View>
57
+            </View>
58
+            <view className="estimated-income-detail">
59
+              收益详情
60
+              <Image className="to-detail" src={toDetail} />
61
+            </view>
62
+          </View>
63
+          {/* 可提现金额 */}
64
+          <View className="withdrawable-amount">
65
+            <View className="withdrawable-amount-header">
66
+              <Image className="withdrawable-amount-icon" src={withdrawable} />
67
+              <Text className="withdrawable-amount-title">可提现金额</Text>
68
+            </View>
69
+            <View className="withdrawable-amount-content">
70
+              <View className="left">
71
+                <Text className="amount">¥0.00</Text>
72
+                <View className="warning-icon-box">
73
+                  <Image className="warning-icon" src={warning} />
74
+                  <Text className="warning-text">未完成提现认证</Text>
75
+                </View>
76
+              </View>
77
+              <View className="right">点击提现</View>
78
+            </View>
79
+          </View>
80
+        </View>
21 81
       </View>
22
-    )
82
+    );
23 83
   }
24 84
 }

+ 251 - 0
src/pages/member/index.less

@@ -0,0 +1,251 @@
1
+.member {
2
+    position: relative;
3
+    min-height: 100vh;
4
+    background-color: #f9f9f9;
5
+
6
+    .member-bg {
7
+        position: absolute;
8
+        top: 0;
9
+        left: 0;
10
+        width: 750px;
11
+        height: 284px;
12
+        background: #FFE2AB;
13
+        border-radius: 0 0 0 150px;
14
+        z-index: 1;
15
+    }
16
+
17
+    .member-content {
18
+        position: relative;
19
+        padding: 0 16px;
20
+        z-index: 2;
21
+        padding-top: 18px;
22
+    }
23
+
24
+    //   会员信息卡
25
+    .member-info-card {
26
+        display: flex;
27
+        flex-direction: column;
28
+        align-items: center;
29
+        background-color: #fefaef;
30
+        border-radius: 20px;
31
+
32
+        .member-info-card-header {
33
+            height: 385px;
34
+            padding-top: 101px;
35
+            box-sizing: border-box;
36
+
37
+            .avatar {
38
+                width: 170px;
39
+                height: 170px;
40
+                border-radius: 50%;
41
+                background-color: red;
42
+            }
43
+
44
+            .member-info-card-header-text {
45
+                margin-top: 16px;
46
+                display: flex;
47
+                align-items: center;
48
+
49
+                .user-name {
50
+                    font-size: 34px;
51
+                    line-height: 40px;
52
+                    font-weight: 500;
53
+                    color: #000000;
54
+                }
55
+
56
+                .member-info-card-header-text-level {
57
+                    width: 100px;
58
+                    height: 36px;
59
+                    position: relative;
60
+                    display: flex;
61
+                    align-items: center;
62
+                    padding-left: 45px;
63
+                    box-sizing: border-box;
64
+                    margin-left: 14px;
65
+
66
+                    .level-text {
67
+                        font-size: 16px;
68
+                        line-height: 40px;
69
+                        color: #000000;
70
+                        z-index: 1;
71
+                    }
72
+
73
+                    .level-icon {
74
+                        width: 100px;
75
+                        height: 36px;
76
+                        position: absolute;
77
+                        right: 0;
78
+                        top: 0;
79
+                    }
80
+                }
81
+            }
82
+        }
83
+
84
+        // 我的小店
85
+        .my-shop {
86
+            width: 100%;
87
+            height: 92px;
88
+            background-color: #fff5dc;
89
+            display: flex;
90
+            align-items: center;
91
+            justify-content: center;
92
+
93
+            image {
94
+                height: 30px;
95
+                width: 30px;
96
+                margin-right: 10px;
97
+            }
98
+
99
+            text {
100
+                font-size: 24px;
101
+                line-height: 40px;
102
+                color: #000000;
103
+            }
104
+        }
105
+    }
106
+
107
+    // 预估收益
108
+    .estimated-income {
109
+        background: #FFFFFF;
110
+        border-radius: 20px;
111
+        padding: 24px;
112
+        margin-top: 16px;
113
+
114
+        &-title {
115
+            font-size: 28px;
116
+            color: #3D3D3D;
117
+            margin-bottom: 30px;
118
+            line-height: 40px;
119
+            font-weight: 700;
120
+        }
121
+
122
+        &-content {
123
+            display: flex;
124
+            align-items: center;
125
+            justify-content: center;
126
+            padding: 0 55px;
127
+            margin-top: 30px;
128
+
129
+            .income-item {
130
+                flex: 1;
131
+                text-align: center;
132
+                display: flex;
133
+                flex-direction: column;
134
+
135
+                .amount {
136
+                    font-size: 36px;
137
+                    font-weight: bold;
138
+                    color: #FF8119;
139
+                    line-height: 40px;
140
+
141
+                }
142
+
143
+                .label {
144
+                    font-size: 26px;
145
+                    color: #222222;
146
+                    line-height: 40px;
147
+                    margin-top: 11px;
148
+                }
149
+            }
150
+
151
+            .divider {
152
+                width: 0;
153
+                height: 80px;
154
+                border-left: 2px solid #D8D8D8;
155
+                margin: 0 20px;
156
+            }
157
+        }
158
+
159
+        &-detail {
160
+            display: flex;
161
+            align-items: center;
162
+            justify-content: center;
163
+            width: 100%;
164
+            text-align: center;
165
+            font-size: 24px;
166
+            color: #E79945;
167
+            margin-top: 40px;
168
+
169
+            .to-detail {
170
+                width: 22px;
171
+                height: 21px;
172
+                margin-left: 8px;
173
+            }
174
+        }
175
+    }
176
+
177
+    // 可提现金额
178
+    .withdrawable-amount {
179
+        margin-top: 20px;
180
+        .withdrawable-amount-header {
181
+            display: flex;
182
+            align-items: center;
183
+            margin-bottom: 12px;
184
+            .withdrawable-amount-icon {
185
+                width: 36px;
186
+                height: 36px;
187
+            }
188
+
189
+            .withdrawable-amount-title {
190
+                font-size: 28px;
191
+                color: #000000;
192
+                line-height: 40px;
193
+                font-weight: 700;
194
+                margin-left: 10px;
195
+            }
196
+        }
197
+
198
+        .withdrawable-amount-content {
199
+            height: 90px;
200
+            width: 100%;
201
+            background-color: #fff;
202
+            display: flex;
203
+            justify-content: space-between;
204
+            align-items: center;
205
+            padding: 0 23px 0 15px;
206
+            box-sizing: border-box;
207
+
208
+            .left {
209
+                display: flex;
210
+                align-items: center;
211
+
212
+                .amount {
213
+                    font-size: 24px;
214
+                    color: #000000;
215
+                    line-height: 40px;
216
+                }
217
+
218
+                .warning-icon-box {
219
+                    display: flex;
220
+                    margin-left: 10px;
221
+                    align-items: center;
222
+                    padding: 0 14px;
223
+                    box-sizing: border-box;
224
+                    background-color: #fff4e7;
225
+                    border-radius: 26px;
226
+                    .warning-text {
227
+                        font-size: 24px;
228
+                        color: #FF8119;
229
+                        line-height: 40px;
230
+                    }
231
+                    .warning-icon {
232
+                        width: 24px;
233
+                        height: 24px;
234
+                        margin-right: 10px;
235
+                    }
236
+                }
237
+            }
238
+            .right{
239
+                display: flex;
240
+                align-items: center;
241
+                justify-content: center;
242
+                width: 138px;
243
+                height: 44px;
244
+                background-color: #f7f3f3;
245
+                border-radius: 26px;
246
+                font-size: 22px;
247
+                line-height: 40px;
248
+            }
249
+        }
250
+    }
251
+}

+ 1 - 1
src/pages/mine/index.config.js

@@ -1,3 +1,3 @@
1 1
 export default definePageConfig({
2
-  navigationBarTitleText: '我的'
2
+  navigationBarTitleText: '我的小店'
3 3
 })

+ 3 - 0
src/pages/productDetail/index.config.js

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationStyle: 'custom'
3
+})

+ 213 - 0
src/pages/productDetail/index.jsx

@@ -0,0 +1,213 @@
1
+import { Component } from "react";
2
+import { View, Text, Swiper, SwiperItem, Image } from "@tarojs/components";
3
+import { AtIcon } from "taro-ui";
4
+import "./index.less";
5
+import Taro from "@tarojs/taro";
6
+import productDetailIcon from "../../images/productDetail/productDetailIcon.png";
7
+import like from "../../images/productDetail/like.png";
8
+import home from "../../images/nav/home.png";
9
+import selfBuy from "../../images/productDetail/selfBuy.png";
10
+import share from "../../images/productDetail/share.png";
11
+import ProductCard from "../../components/ProductCard"; //产品卡片
12
+import Modal from "../../components/Modal"; //弹窗
13
+
14
+export default class Index extends Component {
15
+  state = {
16
+    isShare: false, //是否是分享
17
+    isOpened: false, //是否打开弹窗
18
+    productList: [
19
+      {
20
+        id: 1,
21
+        name: "青岛大虾",
22
+        price: 99.9,
23
+        originalPrice: 159.9,
24
+        image: "https://example.com/img1.jpg",
25
+        sales: 1234,
26
+        tag: "热销",
27
+      },
28
+      {
29
+        id: 2,
30
+        name: "三文鱼刺身",
31
+        price: 158,
32
+        originalPrice: 198,
33
+        image: "https://example.com/img2.jpg",
34
+        sales: 856,
35
+        tag: "新品",
36
+      },
37
+      {
38
+        id: 3,
39
+        name: "帝王蟹",
40
+        price: 299,
41
+        originalPrice: 399,
42
+        image: "https://example.com/img3.jpg",
43
+        sales: 566,
44
+        tag: "限时",
45
+      },
46
+    ],
47
+  };
48
+
49
+  componentWillMount() {}
50
+
51
+  componentDidMount() {}
52
+
53
+  componentWillUnmount() {}
54
+
55
+  componentDidShow() {}
56
+
57
+  componentDidHide() {}
58
+
59
+  // 复制商品编号
60
+  handleCopy = (text) => {
61
+    Taro.setClipboardData({
62
+      data: text,
63
+      success: () => {
64
+        Taro.showToast({
65
+          title: "复制成功",
66
+          icon: "success",
67
+        });
68
+      },
69
+    });
70
+  };
71
+
72
+  // 添加跳转首页方法
73
+  handleToHome = () => {
74
+    Taro.switchTab({
75
+      url: "/pages/index/index",
76
+    });
77
+  };
78
+
79
+  // 立即购买
80
+  handleBuy = () => {
81
+    console.log(111);
82
+
83
+    this.setState({
84
+      isOpened: true,
85
+    });
86
+  };
87
+
88
+  // 添加返回方法
89
+  handleBack = () => {
90
+    const pages = Taro.getCurrentPages();
91
+    if (pages.length > 1) {
92
+      Taro.navigateBack();
93
+    }
94
+  };
95
+
96
+  render() {
97
+    return (
98
+      <View
99
+        className="index"
100
+        style={{ paddingTop: Taro.navigationBarHeight + "px" }}
101
+      >
102
+        {!this.state.isShare && (
103
+          <View className="back-btn" onClick={this.handleBack}>
104
+            <AtIcon value="chevron-left" size="24" color="#999999"></AtIcon>
105
+          </View>
106
+        )}
107
+        {/* 轮播图 */}
108
+        <Swiper className="swiper" autoplay circular>
109
+          <SwiperItem>
110
+            <Image className="swiper-img" src="图片地址1" mode="aspectFill" />
111
+          </SwiperItem>
112
+          {/* 可以添加更多 SwiperItem */}
113
+        </Swiper>
114
+
115
+        {/* 商品详情模块 */}
116
+        <View className="product-info">
117
+          {/* 商品名称 */}
118
+          <Text className="product-name">
119
+            <Text className="self-tag">自营</Text>
120
+            商品名称
121
+          </Text>
122
+
123
+          {/* 价格和标签行 */}
124
+          <View className="price-tag-row">
125
+            {/* 价格区域 */}
126
+            <View className="price-box">
127
+              <Text className="current-price">
128
+                <Text className="currency">¥</Text>
129
+                299
130
+              </Text>
131
+              <Text className="original-price">¥399</Text>
132
+            </View>
133
+            {/* 标签区域 */}
134
+            <View className="tag-box">
135
+              <Text className="tag">分享赚¥1.51</Text>
136
+            </View>
137
+          </View>
138
+
139
+          {/* 分割线 */}
140
+          <View className="divider" />
141
+
142
+          {/* 商品编号行 */}
143
+          <View className="product-number-row">
144
+            <Text className="number-label">商品编号:123456</Text>
145
+            <Text
146
+              className="copy-btn"
147
+              onClick={() => this.handleCopy("123456")}
148
+            >
149
+              复制
150
+            </Text>
151
+          </View>
152
+        </View>
153
+        {/* 商品标签模块 */}
154
+        <View className="product-tag-row">
155
+          <View className="tag-item">
156
+            <Image src={productDetailIcon} mode="aspectFit" />
157
+            <Text className="tag-text">渔市商品</Text>
158
+          </View>
159
+          <View className="tag-item">
160
+            <Image src={productDetailIcon} mode="aspectFit" />
161
+            <Text className="tag-text">品质保证</Text>
162
+          </View>
163
+          <View className="tag-item">
164
+            <Image src={productDetailIcon} mode="aspectFit" />
165
+            <Text className="tag-text">无忧售后</Text>
166
+          </View>
167
+        </View>
168
+        {/* 猜你喜欢 */}
169
+        <View className="guess-you-like">
170
+          <Image src={like} mode="aspectFit" />
171
+          <Text className="title">猜你喜欢</Text>
172
+        </View>
173
+        {/* 猜你喜欢产品列表 */}
174
+        <View className="product-card-list">
175
+          {this.state.productList.map((product) => (
176
+            <ProductCard key={product.id} product={product} />
177
+          ))}
178
+        </View>
179
+        {/* 底部购买模块 */}
180
+        <View className="bottom-buy">
181
+          <View onClick={this.handleToHome} className="bottom-buy-left">
182
+            <Image src={home} mode="aspectFit" />
183
+            <Text className="bottom-buy-text">首页</Text>
184
+          </View>
185
+          <View className="bottom-buy-right">
186
+            {!this.state.isShare ? (
187
+              <>
188
+                <View className="bottom-buy-right-self">
189
+                  <Image src={share} mode="aspectFit" />
190
+                  <Text className="bottom-buy-text">分享赚</Text>
191
+                </View>
192
+                <View className="bottom-buy-right-share">
193
+                  <Image src={selfBuy} mode="aspectFit" />
194
+                  <Text className="bottom-buy-text">自购省</Text>
195
+                </View>
196
+              </>
197
+            ) : (
198
+              <View onClick={this.handleBuy} className="bottom-buy-right-btn">
199
+                <Text className="bottom-buy-text">立即购买</Text>
200
+              </View>
201
+            )}
202
+          </View>
203
+        </View>
204
+        {/* 分享弹窗 */}
205
+        <Modal
206
+          linkText="阿拉山口监督卡监督卡就"
207
+          title="咸鱼口令已复制"
208
+          isOpened={this.state.isOpened}
209
+        />
210
+      </View>
211
+    );
212
+  }
213
+}

+ 249 - 0
src/pages/productDetail/index.less

@@ -0,0 +1,249 @@
1
+.index {
2
+    background-color: #f9f9f9;
3
+    min-height: 100vh;
4
+    padding-bottom: 140px;
5
+
6
+    .swiper {
7
+        width: 100%;
8
+        height: 730px;
9
+        background-color: red;
10
+        .swiper-img {
11
+            width: 100%;
12
+            height: 100%;
13
+        }
14
+    }
15
+
16
+    //   商品详情
17
+    .product-info {
18
+        padding: 17px;
19
+        border-radius: 20px;
20
+        background-color: #fff;
21
+        margin: 16px 16px 0 16px;
22
+
23
+        .product-name {
24
+            font-size: 32px;
25
+            line-height: 46px;
26
+            font-weight: 700;
27
+
28
+            .self-tag {
29
+                display: inline-block;
30
+                padding: 2px 8px;
31
+                background: #FFD43A;
32
+                border-radius: 4px;
33
+                color: #803A04;
34
+                font-size: 24px;
35
+                line-height: 28px;
36
+                margin-right: 8px;
37
+                vertical-align: middle;
38
+            }
39
+        }
40
+
41
+        .price-tag-row {
42
+            margin-top: 16px;
43
+            display: flex;
44
+            justify-content: space-between;
45
+            align-items: center;
46
+
47
+            .price-box {
48
+                .current-price {
49
+                    font-size: 36px;
50
+                    color: #FF1D17;
51
+                    margin-right: 7px;
52
+                    line-height: 35px;
53
+
54
+                    .currency {
55
+                        font-size: 24px;
56
+                    }
57
+                }
58
+
59
+                .original-price {
60
+                    font-size: 26px;
61
+                    line-height: 38px;
62
+                    color: #ABABAB;
63
+                    text-decoration: line-through;
64
+                }
65
+            }
66
+
67
+            .tag-box {
68
+                .tag {
69
+                    padding: 2px 17px;
70
+                    border-radius: 20px;
71
+                    font-size: 24px;
72
+                    line-height: 38px;
73
+                    border: 1px solid #FF1D17;
74
+                    color: #FF1D17;
75
+                }
76
+            }
77
+        }
78
+
79
+        .divider {
80
+            height: 1px;
81
+            background: #D8D8D8;
82
+            margin: 12px 0;
83
+        }
84
+
85
+        .product-number-row {
86
+            display: flex;
87
+            align-items: center;
88
+
89
+            .number-label {
90
+                color: #ABABAB;
91
+                font-size: 26px;
92
+                margin-right: 10px;
93
+            }
94
+
95
+            .copy-btn {
96
+                color: #FF311B;
97
+                font-size: 28px;
98
+            }
99
+        }
100
+    }
101
+
102
+    //   商品标签
103
+    .product-tag-row {
104
+        margin: 20px 16px 0 16px;
105
+        display: flex;
106
+        justify-content: space-between;
107
+        padding: 22px 17px;
108
+        box-sizing: border-box;
109
+        background-color: #fff;
110
+        border-radius: 20px;
111
+
112
+        .tag-item {
113
+            display: flex;
114
+            align-items: center;
115
+
116
+            .tag-text {
117
+                font-size: 24px;
118
+                color: #666666;
119
+                line-height: 35px;
120
+            }
121
+
122
+            image {
123
+                width: 24px;
124
+                height: 24px;
125
+                margin-right: 4px;
126
+            }
127
+        }
128
+    }
129
+
130
+    //   猜你喜欢
131
+    .guess-you-like {
132
+        display: flex;
133
+        align-items: center;
134
+        justify-content: center;
135
+        padding: 20px 0;
136
+        margin: 20px 16px 0 16px;
137
+        background-color: #fff;
138
+        border-radius: 20px;
139
+
140
+        image {
141
+            width: 34px;
142
+            height: 34px;
143
+            margin-right: 5px;
144
+        }
145
+
146
+        .title {
147
+            color: #000000;
148
+            line-height: 36px;
149
+            font-size: 31px;
150
+            font-weight: 500;
151
+        }
152
+    }
153
+
154
+    // 底部购买模块
155
+    .bottom-buy {
156
+        width: 100%;
157
+        background-color: #fff;
158
+        height: 126px;
159
+        padding: 19px 35px 19px 44px;
160
+        box-sizing: border-box;
161
+        position: fixed;
162
+        bottom: 0;
163
+        display: flex;
164
+        justify-content: space-between;
165
+        align-items: center;
166
+        .bottom-buy-left {
167
+            display: flex;
168
+            flex-direction: column;
169
+
170
+            image {
171
+                width: 38px;
172
+                height: 36px;
173
+                margin-bottom: 7px;
174
+            }
175
+
176
+            .bottom-buy-text {
177
+                font-size: 22px;
178
+                line-height: 32px;
179
+                color: #000000;
180
+            }
181
+        }
182
+        .bottom-buy-right {
183
+            width: 576px;
184
+            height: 100%;
185
+            display: flex;
186
+            border-radius: 60px;
187
+            overflow: hidden;
188
+            .bottom-buy-right-self,.bottom-buy-right-share{
189
+                line-height: 43px;
190
+                font-size: 30px;
191
+                width: 50%;
192
+                display: flex;
193
+                justify-content: center;
194
+                align-items: center;
195
+                image{
196
+                    margin-right: 9px;
197
+                }
198
+            }
199
+            .bottom-buy-right-self{
200
+                background-color: #fbe00f;
201
+                color: #000000;
202
+                image{
203
+                    width: 47px;
204
+                    height: 46px;
205
+                }
206
+            }
207
+            .bottom-buy-right-share{
208
+                background-color: #ff1c14;
209
+                color: #fff;
210
+                image{
211
+                    width: 45px;
212
+                    height: 31px;
213
+                }
214
+            }
215
+        }
216
+        .bottom-buy-right-btn{
217
+            width: 586px;
218
+            height: 100%;
219
+            background: linear-gradient(90deg, #ff881b 0%, #fe6234 100%);
220
+            border-radius: 60px;
221
+            display: flex;
222
+            justify-content: center;
223
+            align-items: center;
224
+            .bottom-buy-text{
225
+                color: #fff;
226
+                font-size: 28px;
227
+                line-height: 41px;
228
+                font-weight: 700;
229
+            }
230
+        }
231
+    }
232
+
233
+    .back-btn {
234
+        position: fixed;
235
+        left: 20px;
236
+        top: calc(20px + var(--taro-navigationBarHeight));
237
+        width: 72px;
238
+        height: 72px;
239
+        padding-right: 6px;
240
+        padding-top: 4px;
241
+        box-sizing: border-box;
242
+        background: rgba(255, 255, 255, 0.5);
243
+        border-radius: 50%;
244
+        display: flex;
245
+        align-items: center;
246
+        justify-content: center;
247
+        z-index: 100;
248
+    }
249
+}

+ 3 - 0
src/pages/seckillIndex/index.config.js

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

+ 28 - 0
src/pages/seckillIndex/index.jsx

@@ -0,0 +1,28 @@
1
+import { Component } from "react";
2
+import { View, Image } from "@tarojs/components";
3
+import "./index.less";
4
+import seckillImg from "../../images/seckill/seckillTop.png";
5
+import ProductList from "../../components/index/ProductList";
6
+export default class Index extends Component {
7
+  componentWillMount() {}
8
+
9
+  componentDidMount() {}
10
+
11
+  componentWillUnmount() {}
12
+
13
+  componentDidShow() {}
14
+
15
+  componentDidHide() {}
16
+
17
+  render() {
18
+    return (
19
+      <View className="index">
20
+        <Image className="seckill" src={seckillImg} mode="aspectFill" />
21
+        {/* 商品列表 */}
22
+        <View className="product-list">
23
+          <ProductList isSeckill={true} />
24
+        </View>
25
+      </View>
26
+    );
27
+  }
28
+}

+ 11 - 0
src/pages/seckillIndex/index.less

@@ -0,0 +1,11 @@
1
+.index{
2
+    width: 100%;
3
+    .seckill{
4
+        width: 100%;
5
+        height: 300px;
6
+        background-color: yellow;
7
+    }
8
+    .product-list{
9
+        margin-top: -71px;
10
+    }
11
+}