Explorar el Código

feat(小程序): 首页新增 客服电话以及拨打功能

qq12rrr hace 4 días
padre
commit
e84c6cde4a
Se han modificado 3 ficheros con 56 adiciones y 5 borrados
  1. 6 0
      src/assets/customer.svg
  2. 25 0
      src/pages/home/index.scss
  3. 25 5
      src/pages/home/index.tsx

+ 6 - 0
src/assets/customer.svg

@@ -0,0 +1,6 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="&#229;&#174;&#162;&#230;&#156;&#141;">
+<path id="Vector" d="M15.2934 7.33854H16.0013C16.7377 7.33854 17.3346 7.93549 17.3346 8.67188V11.3385C17.3346 12.0749 16.7377 12.6719 16.0013 12.6719H15.2934C14.9653 15.3027 12.721 17.3385 10.0013 17.3385V16.0052C12.2104 16.0052 14.0013 14.2143 14.0013 12.0052V8.00521C14.0013 5.79607 12.2104 4.00521 10.0013 4.00521C7.79216 4.00521 6.0013 5.79607 6.0013 8.00521V12.6719H4.0013C3.26492 12.6719 2.66797 12.0749 2.66797 11.3385V8.67188C2.66797 7.93549 3.26492 7.33854 4.0013 7.33854H4.70923C5.0373 4.70767 7.28156 2.67188 10.0013 2.67188C12.721 2.67188 14.9653 4.70767 15.2934 7.33854ZM4.0013 8.67188V11.3385H4.66797V8.67188H4.0013ZM15.3346 8.67188V11.3385H16.0013V8.67188H15.3346Z" fill="#14172F"/>
+<path id="Vector_2" d="M7.88059 11.3984L7.17383 12.5292C7.99341 13.0426 8.96247 13.3393 10.0009 13.3393C11.0393 13.3393 12.0083 13.0426 12.8279 12.5292L12.1211 11.3984C11.5065 11.7834 10.7797 12.006 10.0009 12.006C9.22207 12.006 8.49528 11.7834 7.88059 11.3984Z" fill="#007AFF"/>
+</g>
+</svg>

+ 25 - 0
src/pages/home/index.scss

@@ -309,3 +309,28 @@
     }
   }
 }
+
+.customer-service-conenter {
+  display: flex;
+  justify-content: center;
+  margin-top: 40rpx;
+
+  .customer-service-box {
+    padding: 16rpx 28rpx 16rpx 20rpx;
+    background-color: #fff;
+    border-radius: 60rpx;
+    border: 2rpx solid #e6e8ed;
+    display: flex;
+    align-items: center;
+
+    .img {
+      width: 40rpx;
+      height: 40rpx;
+    }
+
+    .span {
+      margin-left: 8rpx;
+      font-size: 26rpx;
+    }
+  }
+}

+ 25 - 5
src/pages/home/index.tsx

@@ -30,6 +30,8 @@ import React, { useContext, useMemo, useState, useRef } from "react";
 import LoginBox from "../user/components/LoginBox";
 import BottomBarContext from "@/context/bottomBarContext";
 
+import Taro from "@tarojs/taro";
+
 const Home = () => {
   const channelCode: any = StorageUtil.get(EStorage.channelCode) || "";
 
@@ -59,6 +61,7 @@ const Home = () => {
       .toData()
       .then((res) => {
         setBottomRemark(res.bottom_remark);
+        return res;
       });
   });
 
@@ -119,6 +122,14 @@ const Home = () => {
     });
   };
 
+  const toPhone = () => {
+    const phone = channelResult.data?.customerServiceInfo || "400-003-9350";
+
+    Taro.makePhoneCall({
+      phoneNumber: phone,
+    });
+  };
+
   const imgBackStyle = useMemo(() => {
     return {
       ...ImageUtil.calculationHeight(332 / 170, (screenWidth - 64 + 16) / 2),
@@ -395,6 +406,20 @@ const Home = () => {
           />
         </Padding>
 
+        <Flex
+          justifyContent="center"
+          alignItem="center"
+          rowGap={24}
+          className="customer-service-conenter"
+        >
+          <View className="customer-service-box" onClick={toPhone}>
+            <Image className="img" src={require(`../../assets/customer.svg`)} />
+            <Text className="span">
+              客服:{channelResult.data?.customerServiceInfo || "400-003-9350"}
+            </Text>
+          </View>
+        </Flex>
+
         <Flex
           justifyContent="center"
           alignItem="center"
@@ -406,11 +431,6 @@ const Home = () => {
             {/* { bottomRemark } */}
             {/* 郑重声明:平台只提供贷款咨询和推荐服务,放款由银行或金融机构进行,贷款额度、放款时间以资金分审批结果为准,所有贷款申请在未成功贷款前绝不收取任何费用,为了保证您的资金安全,请不要相信任何要求您支付费用的信息、邮件、电话等不实信息。 */}
           </View>
-          <View>
-            如遇问题请向
-            {channelResult.data?.customerServiceInfo || "400-003-9350"}
-            举报投诉,平台将及时为您解决!
-          </View>
         </Flex>
       </ScrollView>