瀏覽代碼

分享页面&&处理埋点

viczhq 3 周之前
父節點
當前提交
2e5b396581

文件差異過大導致無法顯示
+ 14 - 0
project.private.config.json


+ 2 - 1
src/app.config.js

@@ -14,7 +14,8 @@ export default defineAppConfig({
14 14
         "seckillIndex/index",
15 15
         "searchList/index",
16 16
         "highCommission/index",
17
-        "activity/index"
17
+        "activity/index",
18
+        "sharePage/index"
18 19
       ]
19 20
     },
20 21
     {

+ 25 - 0
src/common/track.js

@@ -0,0 +1,25 @@
1
+import Taro from "@tarojs/taro";
2
+import { formatDate } from "./time";
3
+import { addLog } from "../service/index";
4
+import { isDebounce } from "./debounce";
5
+// 统计埋点
6
+export const handleLog = (data) => {
7
+  if (!isDebounce(500)) return; // 如果在500ms内重复触发,直接返回
8
+  const dayid = formatDate(new Date(), "YYYY-MM-DD");
9
+  const userId = Taro.getStorageSync("loginInfo")?.id || 0;
10
+  const ext = data.shareUserId ? JSON.stringify({ share_users_id: data.shareUserId }) : '';
11
+  const event_type = data.event_type;
12
+  const event_type_title = data.event_type_title;
13
+  const goods_id = data.goods_id || 0;
14
+  const params = {
15
+    dayid,
16
+    users_id:userId,
17
+    goods_id,
18
+    event_type,
19
+    event_type_title,
20
+    ext,
21
+  };
22
+  addLog(params);
23
+};
24
+
25
+

+ 3 - 19
src/components/Modal/index.jsx

@@ -1,15 +1,12 @@
1 1
 import { AtModal, AtModalContent } from "taro-ui";
2 2
 import { View, Image, Text } from "@tarojs/components";
3
-import { addLog } from "../../service";
4
-import { formatDate } from "../../common/time";
5
-import { isDebounce } from "../../common/debounce";
3
+import { handleLog } from "../../common/track";
6 4
 import "./index.less";
7 5
 import Taro from "@tarojs/taro";
8 6
 export default function Modal(props) {
9 7
   const { productPromotion, isOpened, title, linkText, id, shareUserId,isSeckill } =
10 8
     props;
11 9
   const handleCopyLink = () => {
12
-    if (!isDebounce(500)) return; // 如果在300ms内重复触发,直接返回
13 10
     Taro.setClipboardData({
14 11
       data: productPromotion.short_tpwd,
15 12
     }).then(() => {
@@ -18,24 +15,11 @@ export default function Modal(props) {
18 15
         icon: "success",
19 16
       });
20 17
       if (isSeckill) {
21
-        const dayid = formatDate(new Date(), "YYYY-MM-DD");
22
-        let userId = "";
23
-        if (Taro.getStorageSync("loginInfo")) {
24
-          userId = Taro.getStorageSync("loginInfo").id;
25
-        }
26
-        let ext = "";
27
-        if (shareUserId) {
28
-          ext = JSON.stringify({
29
-            share_users_id: shareUserId,
30
-          });
31
-        }
32
-        addLog({
18
+        handleLog({
19
+          shareUserId:shareUserId,
33 20
           event_type: "buy_product_link",
34 21
           event_type_title: "点击购买",
35 22
           goods_id: Number(id),
36
-          ext,
37
-          dayid,
38
-          users_id: userId||0,
39 23
         });
40 24
       }
41 25
     });

+ 8 - 21
src/components/index/ProductList/index.jsx

@@ -7,8 +7,8 @@ import React, {
7 7
 import { View, Text, Image, Button } from "@tarojs/components";
8 8
 import { AtCheckbox, AtActivityIndicator } from "taro-ui";
9 9
 import { setShareContent } from "../../../common/share";
10
-import { formatDate } from "../../../common/time";
11
-import { getShareJump, addLog } from "../../../service";
10
+import { getShareJump } from "../../../service";
11
+import { handleLog } from "../../../common/track";
12 12
 import Taro from "@tarojs/taro";
13 13
 import "./index.less";
14 14
 import ShareModal from "../../shareModal";
@@ -19,7 +19,6 @@ import buy from "../../../images/index/buy.png";
19 19
 import shareBuy from "../../../images/index/shareBuy.png";
20 20
 import shareEarnBg from "../../../images/index/share-earn.png";
21 21
 import seckillIcon from "../../../images/seckill/seckillIcon.png";
22
-import { isDebounce } from "../../../common/debounce";
23 22
 const ProductList = forwardRef((props, ref) => {
24 23
   const {
25 24
     productList, // 商品列表数据
@@ -116,23 +115,6 @@ const ProductList = forwardRef((props, ref) => {
116 115
       });
117 116
     }
118 117
   }, [shareTitle]);
119
-  // 埋点
120
-  const handleLog = (id) => {
121
-    if (!isDebounce(500)) return; // 如果在300ms内重复触发,直接返回
122
-    const dayid = formatDate(new Date(), "YYYY-MM-DD");
123
-    let userId = "";
124
-    if (Taro.getStorageSync("loginInfo")) {
125
-      userId = Taro.getStorageSync("loginInfo").id;
126
-    }
127
-    addLog({
128
-      event_type: "share_product_link",
129
-      event_type_title: "点击分享赚",
130
-      goods_id: Number(id),
131
-      ext: "",
132
-      dayid,
133
-      users_id: userId,
134
-    });
135
-  };
136 118
   // 分享商品
137 119
   const shareProduct = (product, e) => {
138 120
     e.stopPropagation(); // 防止事件穿透
@@ -157,8 +139,13 @@ const ProductList = forwardRef((props, ref) => {
157 139
       });
158 140
       setShareLink(res.share_unique_value);
159 141
       setShareModalOpened(true);
142
+      // 埋点
160 143
       if (isSeckill) {
161
-        handleLog(product.id);
144
+        handleLog({
145
+          event_type: "share_product_link",
146
+          event_type_title: "点击分享赚",
147
+          goods_id: product.id,
148
+        });
162 149
       }
163 150
     });
164 151
   };

+ 27 - 36
src/pages/indexSub/activity/index.jsx

@@ -7,8 +7,7 @@ import {
7 7
   getNewYearTab,
8 8
   getNewYearProductList,
9 9
 } from "../../../service/activity";
10
-import { addLog } from "../../../service/index";
11
-import { formatDate } from "../../../common/time";
10
+import { handleLog } from "../../../common/track";
12 11
 export default class Index extends Component {
13 12
   state = {
14 13
     current: 0,
@@ -21,16 +20,28 @@ export default class Index extends Component {
21 20
     isShowBack: false, // 是否显示返回按钮
22 21
   };
23 22
   componentDidMount() {
24
-    const { isShare, isShowBack,shareUserId } =
23
+    const { isShare, isShowBack, shareUserId } =
25 24
       Taro.getCurrentInstance().router.params || "";
26 25
     this.setState(
27
-      { isShare: isShare || false, isShowBack: isShowBack || false,shareUserId:shareUserId||'' },
26
+      {
27
+        isShare: isShare || false,
28
+        isShowBack: isShowBack || false,
29
+        shareUserId: shareUserId || "",
30
+      },
28 31
       () => {
29 32
         if (isShare) {
30 33
           Taro.hideHomeButton(); //隐藏返回首页
31 34
         }
32 35
         this.getTab(); //获取tab
33
-        this.handleLog(); //埋点
36
+        handleLog({
37
+          event_type: this.state.isShare
38
+            ? "share_to_activity"
39
+            : "click_to_activity",
40
+          event_type_title: this.state.isShare
41
+            ? "从分享链接进入春节活动页"
42
+            : "直接点击进入春节活动页",
43
+          goods_id: 0,
44
+        }); //埋点
34 45
       }
35 46
     );
36 47
   }
@@ -64,29 +75,6 @@ export default class Index extends Component {
64 75
       loading: false,
65 76
     }));
66 77
   };
67
-  // 埋点
68
-  handleLog = () => {
69
-    const dayid = formatDate(new Date(), "YYYY-MM-DD");
70
-    let userId = "";
71
-    if (Taro.getStorageSync("loginInfo")) {
72
-      userId = Taro.getStorageSync("loginInfo").id;
73
-    }
74
-    // 构建ext对象,包含share_id
75
-    let ext = "";
76
-    if (this.state.shareUserId) {
77
-      ext = JSON.stringify({
78
-        share_users_id: this.state.shareUserId,
79
-      });
80
-    }
81
-    addLog({
82
-      users_id: userId || 0,
83
-      goods_id: 0,
84
-      event_type: this.state.isShare ? "share_to_activity" : "click_to_activity",
85
-      event_type_title: this.state.isShare ? "从分享链接进入春节活动页" : "直接点击进入春节活动页",
86
-      dayid,
87
-      ext,
88
-    });
89
-  };
90 78
   // 返回
91 79
   handleBack = () => {
92 80
     Taro.navigateBack();
@@ -145,13 +133,12 @@ export default class Index extends Component {
145 133
     return (
146 134
       <View className="index">
147 135
         {/* 返回按钮 */}
148
-        {
149
-          !this.state.isShare && (
150
-            <Image
151
-              onClick={this.handleBack}
152
-              style={{ top: Taro.navigationBarHeight + "px" }}
153
-              className="top-back"
154
-              src="https://yushi.tos-cn-beijing.volces.com/activity/back.png"
136
+        {!this.state.isShare && (
137
+          <Image
138
+            onClick={this.handleBack}
139
+            style={{ top: Taro.navigationBarHeight + "px" }}
140
+            className="top-back"
141
+            src="https://yushi.tos-cn-beijing.volces.com/activity/back.png"
155 142
             mode="widthFix"
156 143
           />
157 144
         )}
@@ -286,7 +273,11 @@ export default class Index extends Component {
286 273
           >
287 274
             <View className="product-list-container">
288 275
               {this.state.productList.map((product) => (
289
-                <View onClick={() => this.handleProductDetail(product)} key={product.id} className="product-list-item">
276
+                <View
277
+                  onClick={() => this.handleProductDetail(product)}
278
+                  key={product.id}
279
+                  className="product-list-item"
280
+                >
290 281
                   <Image
291 282
                     className="product-img"
292 283
                     src={product.image_url}

+ 24 - 38
src/pages/indexSub/productDetail/index.jsx

@@ -7,10 +7,8 @@ import {
7 7
   getProductPromotion,
8 8
   getShareJump,
9 9
   bindShareJump,
10
-  addLog,
11 10
 } from "../../../service";
12
-import { formatDate } from "../../../common/time";
13
-import { isDebounce } from "../../../common/debounce";
11
+import { handleLog } from "../../../common/track";
14 12
 import "./index.less";
15 13
 import Taro from "@tarojs/taro";
16 14
 import productDetailIcon from "../../../images/productDetail/productDetailIcon.png";
@@ -108,8 +106,14 @@ export default class Index extends Component {
108 106
         if (session_key && shareJump) {
109 107
           this.bindShareJump(); //绑定分享跳转标识
110 108
         }
109
+        // 埋点
111 110
         if (this.state.isSeckill) {
112
-          this.handleLog("direct_to_product"); //埋点
111
+          handleLog({
112
+            event_type:"direct_to_product",
113
+            event_type_title:'进入商品详情页',
114
+            goods_id: Number(this.state.id),
115
+            shareUserId:this.state.shareUserId
116
+          }); //埋点
113 117
         }
114 118
         // 判断是否显示签约弹窗
115 119
         if (
@@ -155,40 +159,14 @@ export default class Index extends Component {
155 159
       isOpened: "self",
156 160
     });
157 161
   };
158
-  // 埋点
159
-  handleLog = (event_type) => {
160
-    if (!isDebounce(500)) return; // 如果在300ms内重复触发,直接返回
161
-    if (this.state.isSeckill) {
162
-      const dayid = formatDate(new Date(), "YYYY-MM-DD");
163
-      const event_type_title =
164
-        event_type == "share_product_link"
165
-          ? "点击分享赚"
166
-          : event_type == "direct_to_product"
167
-          ? "进入商品详情页"
168
-          : "进入商品详情页";
169
-      let userId = "";
170
-      if (Taro.getStorageSync("loginInfo")) {
171
-        userId = Taro.getStorageSync("loginInfo").id;
172
-      }
173
-      // 构建ext对象,包含share_id
174
-      let ext = "";
175
-      if (this.state.shareUserId) {
176
-        ext = JSON.stringify({
177
-          share_users_id: this.state.shareUserId,
178
-        });
179
-      }
180
-      addLog({
181
-        users_id: userId || 0,
182
-        goods_id: Number(this.state.id),
183
-        event_type_title,
184
-        event_type,
185
-        dayid,
186
-        ext,
187
-      });
188
-    }
189
-  };
190 162
   // 分享
191 163
   openSharePopup = async () => {
164
+    // 使用 encodeURIComponent 编码商品详情数据
165
+    // const encodedProductDetail = encodeURIComponent(JSON.stringify(this.state.productDetail));
166
+    // Taro.navigateTo({
167
+    //   url: `/pages/indexSub/sharePage/index?isSeckill=${this.state.isSeckill}&shareJump=${this.state.shareJump}&tagTitle=${this.state.tagTitle}&productDetail=${encodedProductDetail}`,
168
+    // });
169
+    // return
192 170
     const res = await getShareJump({
193 171
       share_type: 1,
194 172
       share_id: this.state.id,
@@ -197,7 +175,15 @@ export default class Index extends Component {
197 175
       shareJump: res.share_unique_value,
198 176
       isOpened: "share",
199 177
     });
200
-    this.handleLog("share_product_link"); //埋点
178
+    // 埋点
179
+    if (this.state.isSeckill) {
180
+      handleLog({
181
+        event_type: "share_product_link",
182
+        event_type_title: "点击分享赚",
183
+        goods_id: Number(this.state.id),
184
+        shareUserId:this.state.shareUserId
185
+      }); //埋点
186
+    }
201 187
   };
202 188
   // 绑定分享跳转标识
203 189
   bindShareJump = async () => {
@@ -308,7 +294,7 @@ export default class Index extends Component {
308 294
             </Text>
309 295
             <Text
310 296
               className="copy-btn"
311
-              onClick={() => this.handleCopy("123456")}
297
+              onClick={() => this.handleCopy(productDetail.goods_number)}
312 298
             >
313 299
               复制
314 300
             </Text>

+ 14 - 37
src/pages/indexSub/seckillIndex/index.jsx

@@ -5,11 +5,10 @@ import Taro from "@tarojs/taro";
5 5
 import ProductList from "../../../components/index/ProductList";
6 6
 import {
7 7
   getRecommendProductList,
8
-  addLog,
9 8
   getShareJump,
10 9
   bindShareJump,
11 10
 } from "../../../service";
12
-import { formatDate } from "../../../common/time";
11
+import { handleLog } from "../../../common/track";
13 12
 import { getShareContent } from "../../../common/share";
14 13
 export default class Index extends Component {
15 14
   state = {
@@ -49,15 +48,24 @@ export default class Index extends Component {
49 48
         if (isShare) {
50 49
           Taro.hideHomeButton();//隐藏返回首页
51 50
         }
52
-        this.handleLog(
53
-          isDirect
51
+        handleLog({
52
+          event_type: isDirect
54 53
             ? `direct_to_${this.state.id}_${this.state.title}`
55 54
             : isBanner
56 55
             ? `banner_to_${this.state.id}_${this.state.title}`
57 56
             : isShare
58 57
             ? `share_to_${this.state.id}_${this.state.title}`
59
-            : `direct_to_${this.state.id}_${this.state.title}`
60
-        );
58
+            : `direct_to_${this.state.id}_${this.state.title}`,
59
+          event_type_title: isDirect
60
+            ? `直接点击进入${this.state.title}`
61
+            : isBanner
62
+            ? `从banner 跳转到${this.state.title}`
63
+            : isShare
64
+            ? `从分享链接跳转到${this.state.title}`
65
+            : `直接点击进入${this.state.title}`,
66
+          goods_id: 0,
67
+          shareUserId: this.state.shareUserId,
68
+        });
61 69
         this.getRecommendProductList();
62 70
         // 获取分享跳转标识
63 71
         shareJump &&
@@ -105,37 +113,6 @@ export default class Index extends Component {
105 113
     Taro.removeStorageSync("shareJump");
106 114
     Taro.removeStorageSync("shareType");
107 115
   };
108
-  // 埋点
109
-  handleLog = (event_type) => {
110
-    const dayid = formatDate(new Date(), "YYYY-MM-DD");
111
-    const event_type_title =
112
-      event_type == `banner_to_${this.state.id}_${this.state.title}`
113
-        ? `从banner 跳转到${this.state.title}`
114
-        : event_type == `share_to_${this.state.id}_${this.state.title}`
115
-        ? `从分享链接跳转到${this.state.title}`
116
-        : event_type == `direct_to_${this.state.id}_${this.state.title}`
117
-        ? `直接点击进入${this.state.title}`
118
-        : `直接点击进入${this.state.title}`;
119
-    let userId = "";
120
-    if (Taro.getStorageSync("loginInfo")) {
121
-      userId = Taro.getStorageSync("loginInfo").id;
122
-    }
123
-    // 构建ext对象,包含share_id
124
-    let ext = "";
125
-    if (this.state.shareUserId) {
126
-      ext = JSON.stringify({
127
-        share_users_id: this.state.shareUserId,
128
-      });
129
-    }
130
-    addLog({
131
-      users_id: userId || 0,
132
-      goods_id: 0,
133
-      event_type_title,
134
-      event_type,
135
-      dayid,
136
-      ext,
137
-    });
138
-  };
139 116
   // 配置分享内容
140 117
   onShareAppMessage(res) {
141 118
     let shareUserId = "";

+ 3 - 0
src/pages/indexSub/sharePage/index.config.js

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '编辑分享内容',
3
+})

+ 178 - 0
src/pages/indexSub/sharePage/index.jsx

@@ -0,0 +1,178 @@
1
+import { Component } from "react";
2
+import { View, Image, Text, Button, Input } from "@tarojs/components";
3
+import Taro from "@tarojs/taro";
4
+import "./index.less";
5
+
6
+export default class Index extends Component {
7
+  state = {
8
+    shareTitle: "", //分享标题
9
+    productDetail: {}, //商品详情
10
+    isSeckill: false, //是否是秒杀商品
11
+    shareJump: "", //分享链接
12
+    tagTitle: "", //标签标题
13
+  };
14
+  componentDidMount() {
15
+    const { isSeckill, shareJump, tagTitle, productDetail } =
16
+      Taro.getCurrentInstance().router.params;
17
+
18
+    this.setState({
19
+      isSeckill: isSeckill === "true",
20
+      shareJump,
21
+      tagTitle,
22
+      productDetail: JSON.parse(decodeURIComponent(productDetail)),
23
+      shareTitle: JSON.parse(decodeURIComponent(productDetail)).item_title,
24
+    });
25
+  }
26
+  // 设置分享标题
27
+  handleShareTitleChange = (newTitle) => {
28
+    this.setState({
29
+      shareTitle: newTitle,
30
+    });
31
+  };
32
+  // 保存图片到手机
33
+  handleSaveImage = () => {
34
+    Taro.getSetting({
35
+      success: (res) => {
36
+        if (!res.authSetting["scope.writePhotosAlbum"]) {
37
+          Taro.authorize({
38
+            scope: "scope.writePhotosAlbum",
39
+            success: () => {
40
+              this.saveImage();
41
+            },
42
+            fail: () => {
43
+              Taro.showModal({
44
+                title: "提示",
45
+                content: "需要您授权保存图片到相册",
46
+                success: (modalRes) => {
47
+                  if (modalRes.confirm) {
48
+                    Taro.openSetting();
49
+                  }
50
+                },
51
+              });
52
+            },
53
+          });
54
+        } else {
55
+          this.saveImage();
56
+        }
57
+      },
58
+    });
59
+  };
60
+
61
+  saveImage = () => {
62
+    Taro.downloadFile({
63
+      url: this.state.productDetail.images[0].img,
64
+      success: (res) => {
65
+        console.log(res);
66
+
67
+        Taro.saveImageToPhotosAlbum({
68
+          filePath: res.tempFilePath,
69
+          success: () => {
70
+            Taro.showToast({
71
+              title: "保存成功",
72
+              icon: "success",
73
+            });
74
+          },
75
+          fail: () => {
76
+            Taro.showToast({
77
+              title: "保存失败",
78
+              icon: "none",
79
+            });
80
+          },
81
+        });
82
+      },
83
+      fail: () => {
84
+        Taro.showToast({
85
+          title: "图片下载失败",
86
+          icon: "none",
87
+        });
88
+      },
89
+    });
90
+  };
91
+  // 配置分享内容
92
+  onShareAppMessage() {
93
+    return {
94
+      title: this.state.shareTitle || this.state.productDetail.item_title,
95
+      path: `/pages/indexSub/productDetail/index?id=${this.state.productDetail.id}&&isShare=true&&isSeckill=${this.state.isSeckill}&&shareJump=${this.state.shareJump}&&tagTitle=${this.state.tagTitle}&&shareType=1`,
96
+      imageUrl: this.state.productDetail.images[0].img,
97
+    };
98
+  }
99
+  render() {
100
+    const { productDetail } = this.state;
101
+    return (
102
+      <View className="index">
103
+        {/* 图片素材盒子 */}
104
+        <View className="image-box">
105
+          <View className="image-box-top">
106
+            <View className="image-box-title">图片素材</View>
107
+            <View className="image-box-save" onClick={this.handleSaveImage}>
108
+              保存图片
109
+            </View>
110
+          </View>
111
+          {productDetail.images && (
112
+            <View className="image-box-content">
113
+              {this.state.productDetail.images.map((item, index) => (
114
+                <Image
115
+                  className="image-box-content-item"
116
+                  key={index}
117
+                  src={item.img}
118
+                  mode="aspectFill"
119
+                />
120
+              ))}
121
+            </View>
122
+          )}
123
+        </View>
124
+        {/* 文案素材盒子 */}
125
+        <View className="text-box">
126
+          <View className="text-box-top">
127
+            <View className="text-box-title">文案素材</View>
128
+            <View className="text-box-save">复制全部内容</View>
129
+          </View>
130
+          <View className="text-box-content">
131
+            {/* 商品标题盒子 */}
132
+            <View className="text-box-content-title">
133
+              <View className="text-box-content-title-top">
134
+                <View className="text-box-content-title-top-title">
135
+                  商品标题
136
+                </View>
137
+                <View className="text-box-content-title-top-copy">
138
+                  复制标题
139
+                </View>
140
+              </View>
141
+              {/* 分享标题输入框 */}
142
+              <Input
143
+                onInput={this.handleShareTitleChange}
144
+                className="input"
145
+                value={this.state.shareTitle}
146
+              />
147
+            </View>
148
+            {/* 商品链接盒子 */}
149
+            <View className="text-box-content-link">
150
+              <View className="text-box-content-link-top">
151
+                <View className="text-box-content-link-top-title">
152
+                  商品链接
153
+                </View>
154
+              </View>
155
+              {/* 商品链接 */}
156
+              <View className="text-box-content-link-bottom">
157
+                <Input
158
+                  onInput={this.handleShareTitleChange}
159
+                  className="linkInput"
160
+                  value={this.state.shareTitle}
161
+                  disabled
162
+                />
163
+                <View className="copy-box">
164
+                  <View className="copy-box-line"></View>
165
+                  <Image className="copy-box-icon" src='https://yushi.tos-cn-beijing.volces.com/productDetail/copy.png' />
166
+                </View>
167
+              </View>
168
+            </View>
169
+          </View>
170
+        </View>
171
+        {/* 分享按钮 */}
172
+        <Button className="share-button" openType="share" onClick={this.handleShare}>
173
+          直接分享商品卡片到聊天框
174
+        </Button>
175
+      </View>
176
+    );
177
+  }
178
+}

+ 219 - 0
src/pages/indexSub/sharePage/index.less

@@ -0,0 +1,219 @@
1
+.index {
2
+    // background: linear-gradient(180deg, #faeb5d 0%, rgba(250, 238, 116, 0) 573px);
3
+    background-color: #f9f9f9;
4
+    min-height: 100vh;
5
+    padding: 30px 16px 0 16px;
6
+    box-sizing: border-box;
7
+
8
+    // 图片素材盒子
9
+    .image-box {
10
+        padding: 21px 0 43px 20px;
11
+        box-sizing: border-box;
12
+        background-color: #fff;
13
+        border-radius: 34px;
14
+
15
+        // 图片素材盒子顶部
16
+        .image-box-top {
17
+            display: flex;
18
+            justify-content: space-between;
19
+            align-items: center;
20
+            margin-bottom: 24px;
21
+            padding-right: 20px;
22
+
23
+            .image-box-title {
24
+                font-weight: 700;
25
+                font-size: 32px;
26
+                color: #000000;
27
+            }
28
+
29
+            .image-box-save {
30
+                width: 156px;
31
+                height: 60px;
32
+                border-radius: 70px;
33
+                background-color: #FFECCA;
34
+                color: #F48106;
35
+                font-size: 24px;
36
+                line-height: 60px;
37
+                text-align: center;
38
+            }
39
+        }
40
+
41
+        // 图片素材盒子内容
42
+        .image-box-content {
43
+            display: flex;
44
+            flex-wrap: nowrap;
45
+            overflow-x: auto;
46
+
47
+            .image-box-content-item {
48
+                width: 240px;
49
+                height: 240px;
50
+                border-radius: 40px;
51
+                margin-right: 20px;
52
+            }
53
+        }
54
+    }
55
+
56
+    // 文案素材盒子
57
+    .text-box {
58
+        margin-top: 40px;
59
+
60
+        .text-box-top {
61
+            display: flex;
62
+            justify-content: space-between;
63
+            align-items: center;
64
+            margin-bottom: 24px;
65
+            padding: 0 20px;
66
+
67
+            .text-box-title {
68
+                font-weight: 700;
69
+                font-size: 32px;
70
+                color: #000000;
71
+            }
72
+
73
+            .text-box-save {
74
+                width: 198px;
75
+                height: 60px;
76
+                line-height: 60px;
77
+                text-align: center;
78
+                border-radius: 70px;
79
+                background-color: #FFECCA;
80
+                color: #FF8400;
81
+                font-size: 26px;
82
+            }
83
+        }
84
+
85
+        // 文案素材盒子内容
86
+        .text-box-content {
87
+            padding: 31px 20px;
88
+            box-sizing: border-box;
89
+            background-color: #fff;
90
+            border-radius: 34px;
91
+
92
+            // 商品标题
93
+            .text-box-content-title {
94
+                display: flex;
95
+                flex-direction: column;
96
+                justify-content: space-between;
97
+                margin-bottom: 24px;
98
+
99
+                .text-box-content-title-top {
100
+                    width: 100%;
101
+                    display: flex;
102
+                    justify-content: space-between;
103
+                    align-items: center;
104
+                    padding: 0 22px 0 10px;
105
+                    box-sizing: border-box;
106
+
107
+                    .text-box-content-title-top-title {
108
+                        font-size: 30px;
109
+                        color: #333;
110
+                    }
111
+
112
+                    .text-box-content-title-top-copy {
113
+                        font-size: 24px;
114
+                        color: #F48106;
115
+                    }
116
+                }
117
+
118
+                .input {
119
+                    margin-top: 30px;
120
+                    width: 100%;
121
+                    height: 94px;
122
+                    border-radius: 34px;
123
+                    border: 4px solid #F6C71A;
124
+                    padding-left: 24px; 
125
+                    padding-right: 24px;
126
+                    font-size: 28px;
127
+                    color: #999999;
128
+                    box-sizing: border-box;
129
+                }
130
+            }
131
+
132
+            // 商品链接
133
+            .text-box-content-link {
134
+                display: flex;
135
+                flex-direction: column;
136
+                justify-content: space-between;
137
+                .text-box-content-link-top {
138
+                    padding-left: 10px;
139
+
140
+                    .text-box-content-link-top-title {
141
+                        font-size: 30px;
142
+                        color: #333;
143
+                    }
144
+                }
145
+                .text-box-content-link-bottom {
146
+                    position: relative;
147
+                    margin-top: 30px;
148
+                    .copy-box {
149
+                        position: absolute;
150
+                        right: 19px;
151
+                        top: 50%;
152
+                        transform: translateY(-50%);
153
+                        display: flex;
154
+                        align-items: center;
155
+                        .copy-box-line {
156
+                            width: 1px;
157
+                            height: 54px;
158
+                            background-color: #FF8119;
159
+                            margin-right: 39px;
160
+                        }
161
+                        .copy-box-icon {
162
+                            width: 34px;
163
+                            height: 34px;
164
+                        }
165
+                    }
166
+                }
167
+                .linkInput {
168
+                    width:100%;
169
+                    height: 94px;
170
+                    border-radius: 34px;
171
+                    border: none;
172
+                    padding-left: 24px;
173
+                    padding-right: 110px;
174
+                    font-size: 28px;
175
+                    box-sizing: border-box;
176
+                    color: #999999;
177
+                    background-color: #f7f8fa;
178
+                }
179
+            }
180
+        }
181
+    }
182
+
183
+    // 清除Button默认样式
184
+    Button {
185
+        padding: 0;
186
+        margin: 0;
187
+        background: none;
188
+        border: none;
189
+        line-height: normal;
190
+        height: 100%;
191
+        width: 100%;
192
+        display: flex;
193
+        flex-direction: column;
194
+        align-items: center;
195
+        justify-content: center;
196
+        font-size: 28px;
197
+        color: #FFFFFF;
198
+
199
+        &::after {
200
+            border: none;
201
+        }
202
+    }
203
+    .share-button {
204
+        position: fixed;
205
+        bottom: 30px;
206
+        left: 50%;
207
+        transform: translateX(-50%);
208
+        width: calc(100% - 44px);
209
+        height: 88px;
210
+        border-radius: 160px;
211
+        background-color: #F6C71A;
212
+        font-weight: 700;
213
+        font-size: 30px;
214
+        color: #3D3D3D;
215
+        display: flex;
216
+        justify-content: center;
217
+        align-items: center;
218
+    }
219
+}

+ 4 - 1
src/pages/mine/index.jsx

@@ -1,6 +1,6 @@
1 1
 import { Component } from "react";
2 2
 import Taro from "@tarojs/taro";
3
-import { View, Text, Image } from "@tarojs/components";
3
+import { View, Text, Image, Button } from "@tarojs/components";
4 4
 import { AtList, AtListItem } from "taro-ui";
5 5
 import { getUserInfo, getMineData } from "../../service";
6 6
 import "./index.less";
@@ -148,6 +148,9 @@ export default class Index extends Component {
148 148
             ></Image>
149 149
           </View>
150 150
         </View>
151
+        <Button onClick={() => Taro.navigateTo({ url: '/pages/indexSub/activity/index' })}>
152
+          活动页面
153
+        </Button>
151 154
         {/* 我的推荐人 */}
152 155
         {mineData.user_relations?.id && (
153 156
           <View className="recommend-box">