shenwu 2 meses atrás
pai
commit
8a0c569cdb
5 arquivos alterados com 491 adições e 212 exclusões
  1. 4 0
      src/app.config.ts
  2. 4 1
      src/pages/ldPage/index.config.ts
  3. 32 6
      src/pages/ldPage/index.tsx
  4. 8 4
      types/global.d.ts
  5. 443 201
      yarn.lock

+ 4 - 0
src/app.config.ts

@@ -56,6 +56,10 @@ export default {
     "novel-plugin": {
       "version": "latest",
       "provider": "wx293c4b6097a8a4d0"
+    },
+    "contactPlugin": {
+      "version": "1.4.3",
+      "provider": "wx104a1a20c3f81ec2"
     }
   }
 }

+ 4 - 1
src/pages/ldPage/index.config.ts

@@ -1,4 +1,7 @@
 export default {
-  navigationBarTitleText: '页',
+  navigationBarTitleText: '详情页',
   navigationStyle: 'custom',
+  usingComponents: {
+    "contact-cell": "plugin://contactPlugin/cell"
+  }
 }

+ 32 - 6
src/pages/ldPage/index.tsx

@@ -1,9 +1,8 @@
-
-
-import { View, Image } from "@tarojs/components";
+import { View, Text, Image } from "@tarojs/components";
 import Taro, { useRouter } from "@tarojs/taro";
 import { getPage } from "@src/server/index/index";
 import { useEffect, useState } from "react";
+
 function LdPage() {
     let systemInfo = Taro.getSystemInfoSync();
     let [data, setDate] = useState<any>(null)
@@ -49,7 +48,7 @@ function LdPage() {
         }
     }, [])
     const onLongPress = (str) => {
-        console.log("用户长按了二维码:",str)
+        console.log("用户长按了二维码:", str)
     }
     return <View >
         <View style={{ marginTop: (systemInfo.statusBarHeight as any) + 10 }}></View>
@@ -74,15 +73,42 @@ function LdPage() {
                         return <Image src={imgObj.url} mode="widthFix" style={{ height: "auto", width: "100vw", order: imgObj.eq }} />
                     })}
                     {/* 二维码 */}
-                    {data["QR_CODE"] && <Image src={data["QR_CODE"].url}  onLongPress={()=>{onLongPress("QR_CODE")}} mode="widthFix" showMenuByLongpress style={{ height: "auto", width: "70vw", display: 'block', margin: '0 auto', order: data["QR_CODE"].eq }} />}
+                    {data["QR_CODE"] && <Image src={data["QR_CODE"].url} onLongPress={() => { onLongPress("QR_CODE") }} mode="widthFix" showMenuByLongpress style={{ height: "auto", width: "70vw", display: 'block', margin: '0 auto', order: data["QR_CODE"].eq }} />}
                     {/* 动图 */}
                     {/* <Image src={"https://app-cloud-images.oss-cn-hangzhou.aliyuncs.com/1768559009681.gif"} mode="widthFix" style={{ height: "auto", width: "100vw", marginTop: -30, paddingBottom: 70 }} /> */}
+                    {/* 企业微信客服按钮 - 联系我插件 */}
+                    {/* <View>
+                        <contact-cell
+                            startmessage={startMessage}
+                            completemessage={completeMessage}
+                            plugid='4bed1d4b8d3edf6980c392f61f482077'
+                            style={{ width: '40px', height: '40px' }}
+                            styleType={2}
+                        />
+                    </View> */}
                     {/* 底部浮选图 */}
-                    {data["FLOAT_BUTTON"] && <Image src={data["FLOAT_BUTTON"].url} mode="widthFix" onLongPress={()=>{onLongPress("FLOAT_BUTTON")}}showMenuByLongpress style={{ height: "auto", width: "100vw", position: 'fixed', bottom: 0, left: 0, zIndex: 999, order: data["FLOAT_BUTTON"].eq }} />}
+                    {data["FLOAT_BUTTON"] && <Image src={data["FLOAT_BUTTON"].url} mode="widthFix" onLongPress={() => { onLongPress("FLOAT_BUTTON") }} showMenuByLongpress style={{ height: "auto", width: "100vw", position: 'fixed', bottom: 0, left: 0, zIndex: 999, order: data["FLOAT_BUTTON"].eq }} />}
                 </View> : <View></View>
             }
         </View>
     </View>
 }
 
+// // 客服消息开始回调
+// const startMessage = (e) => {
+//     console.log('客服消息开始', e);
+// };
+
+// // 客服消息完成回调
+// const completeMessage = (e) => {
+//     console.log('客服消息完成', e);
+//     if (e.detail.errcode === 0) {
+//         console.log('客服人员姓名:', e.detail.name);
+//         console.log('客服人员头像:', e.detail.headurl);
+//         console.log('通知方式:', e.detail.notifytype === 0 ? '消息通知' : '二维码');
+//     } else {
+//         console.log('错误码:', e.detail.errcode);
+//     }
+// };
+
 export default LdPage;

+ 8 - 4
types/global.d.ts

@@ -1,7 +1,5 @@
 /// <reference types="@tarojs/taro" />
 
-
-
 declare module '*.png';
 declare module '*.gif';
 declare module '*.jpg';
@@ -9,11 +7,17 @@ declare module '*.jpeg';
 declare module '*.svg';
 declare module '*.css';
 declare module '*.less';
-declare module '*.styl';
 
 declare namespace JSX {
   interface IntrinsicElements {
-    'import': React.DetailedHTMLProps<React.EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>
+    'contact-cell': Partial<{
+      plugid: string;
+      startmessage: (e: any) => void;
+      completemessage: (e: any) => void;
+      style: React.CSSProperties;
+      children?: any;
+      styleType?:number;
+    }>
   }
 }
 

Diferenças do arquivo suprimidas por serem muito extensas
+ 443 - 201
yarn.lock


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff