Bladeren bron

小程序客服接入

zuypeng 1 jaar geleden
bovenliggende
commit
e5f15ea194

+ 1 - 1
src/pages-order/list/index.vue

@@ -8,7 +8,7 @@
               <view class="wallet-item_header">
                 <view class="flex-inline">
                   <text class="wallet-item_header-type">洗车消费</text>
-                  <uv-text class="ml10" style="margin-left: 10px;" size="mini" plain :size="12"
+                  <uv-text class="ml10" style="margin-left: 10px;" plain :size="12"
                            :type="item.payStatus==0?'primary':(item.payStatus==1?'success':'error')"
                            :text="fmtDictName('Order.pay', item.payStatus)"></uv-text>
 

+ 1 - 1
src/pages-user/policy/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="privacy-policy">
     <div class="policy-container">
-      <h1>隐私政策</h1>
+<!--      <h1>隐私政策</h1>-->
       <div class="policy-content">
         <p>
           欢迎使用 [Yeswash]!在使用本小程序之前,请您仔细阅读并理解以下隐私政策的全部条款。您点击“同意”按钮或以其他方式确认接受本隐私政策,即表示您已阅读、理解并同意本隐私政策的全部条款,并愿意遵守本隐私政策的约束。

+ 1 - 1
src/pages-user/wallet/index.vue

@@ -38,7 +38,7 @@
                 <view class="wallet-item_header">
                   <view class="flex-inline">
                     <text class="wallet-item_header-type">{{ fmtDictName('WalletDetail.type', item.type) }}</text>
-                    <uv-text class="ml10 wallet-item_header-status" style="margin-left: 10px;" size="mini" plain :size="12"
+                    <uv-text class="ml10 wallet-item_header-status" style="margin-left: 10px;" plain :size="12"
                              :type="item.status==0?'primary':(item.status==1?'success':'error')"
                              :text="fmtDictName('WalletDetail.status', item.status)"></uv-text>
                   </view>

+ 109 - 27
src/pages/index/index.vue

@@ -1,27 +1,27 @@
 <template>
-<!--  <uv-navbar placeholder leftIcon="" title="Yeswash洗车"
-             :border="false"></uv-navbar>-->
-  <view class="content" >
+  <!--  <uv-navbar placeholder leftIcon="" title="Yeswash洗车"
+               :border="false"></uv-navbar>-->
+  <view class="content">
     <!--    <image class="logo" src="/static/logo.png"/>
         <view class="text-area">
           <text class="title">{{ title }}</text>
         </view>-->
     <view style="width: 100%;" class="swiper-content">
-        <swiper :style="state.customStyle" circular :indicator-dots="true" :autoplay="true" :interval="3000"
-                :duration="500">
-          <swiper-item v-for="(item,idx) in state.swiperList" :key="idx">
-            <image :src="item" mode="scaleToFill" :style="state.customStyle" @click="handleBannerClick(idx)"></image>
-          </swiper-item>
-        </swiper>
-
-<!--      <uv-swiper
-          style="width: 100%"
-          :list="state.swiperList"
-          @click="handleBannerClick"
-          circular
-          :autoplay="true"
-          bgColor="#ffffff">
-      </uv-swiper>-->
+      <swiper :style="state.customStyle" circular :indicator-dots="true" :autoplay="true" :interval="3000"
+              :duration="500">
+        <swiper-item v-for="(item,idx) in state.swiperList" :key="idx">
+          <image :src="item" mode="scaleToFill" :style="state.customStyle" @click="handleBannerClick(idx)"></image>
+        </swiper-item>
+      </swiper>
+
+      <!--      <uv-swiper
+                style="width: 100%"
+                :list="state.swiperList"
+                @click="handleBannerClick"
+                circular
+                :autoplay="true"
+                bgColor="#ffffff">
+            </uv-swiper>-->
     </view>
     <!--
         <view class="w100">
@@ -50,13 +50,21 @@
       </template>
       <uv-empty v-else mode="order" text="请先登录" :marginTop="100"></uv-empty>
     </view>
+
+    <movable-area class="mov-area">
+      <movable-view :x="state.screenWidth" :y="300" direction="all" @change="onChange" class="customer-service">
+        <button open-type="contact" @contact="handleContact" class="contact">在线客服</button>
+        <image class="cs" src="/static/iconfont/cs.svg"/>
+      </movable-view>
+    </movable-area>
+
     <!--    站点清单  end-->
 
     <!--    <cover-view class="login_bar">
           <login-bar class="w100 text-center"></login-bar>
         </cover-view>-->
     <!--    <cover-view class="login_bar" v-show="!isLogin">-->
-    <login-bar class="w100 text-center"></login-bar>
+    <login-bar class="w100 text-center" send-message-title="YesWash洗车客服"></login-bar>
     <!--    </cover-view>-->
     <tab-bar :index="0"></tab-bar>
   </view>
@@ -73,10 +81,9 @@ import {calcMapDistance} from "@/utils/common"
 import {checkLogin, fetchToken, loadUserInfo, tryLogin} from "@/utils/auth";
 import {rpxToPx} from "@/utils/device";
 
-const title = ref('Hello')
 const isLogin = ref(false)
+const isDragging = ref(false)
 
-const containerStyle = ref();
 const change = () => {
   console.log("change")
 }
@@ -105,18 +112,34 @@ const initState = () => ({
   location: {
     latitude: 0,
     longitude: 0,
-  }
+  },
+  startAxis: {},
+  csAxis: {
+    right: '0rpx',
+    top: '200rpx'
+  },
+  areaStyle: {
+    "height": "100vh",
+    "width": "750rpx",
+    top: 0,
+    position: "fixed",
+
+  },
+  screenWidth:350
 })
 
 const state = reactive(initState())
 
 onLoad((e: any) => {
   let height = uni.getSystemInfoSync().windowHeight;
+  let width = uni.getSystemInfoSync().windowWidth;
+  console.log(height, width, "screen")
+  state.screenWidth = width;
   // const bound = uni.getMenuButtonBoundingClientRect();
   // width: 100%;height:170px;
   state.customStyle = {
-    width:'100%',
-    height:`${(height-rpxToPx(60))/4}px`
+    width: '100%',
+    height: `${(height - rpxToPx(60)) / 4}px`
   };
   /*  if (query) {
       uni.showToast({
@@ -131,9 +154,9 @@ onShow(() => {
   let height = uni.getSystemInfoSync().windowHeight;
   // const bound = uni.getMenuButtonBoundingClientRect();
   // width: 100%;height:170px;
-  state.customStyle= {
-    width:'100%',
-    height:`${(height-rpxToPx(60))/4}px`
+  state.customStyle = {
+    width: '100%',
+    height: `${(height - rpxToPx(60)) / 4}px`
   };
 
   let token = fetchToken();
@@ -314,6 +337,17 @@ const handleNavStation = (station: any) => {
   console.log(station)
 }
 
+
+const handleContact = (e: any) => {
+  console.log("handleContact", e)
+}
+
+
+const onChange = (e) => {
+  console.log(e)
+}
+
+
 </script>
 
 <style scoped lang="scss">
@@ -380,4 +414,52 @@ page {
   height: calc(100vh - 810rpx);
   overflow: scroll;
 }
+
+.customer-service {
+  height: 100rpx;
+  width: 100rpx;
+
+
+  image {
+    width: 80rpx !important;
+    height: 80rpx !important;
+    z-index: 100;
+    position: absolute;
+    margin-top: -60rpx;
+  }
+
+  .contact {
+    opacity: 0;
+    z-index: 9999;
+  }
+}
+
+.mov-area {
+  pointer-events: none;
+
+  .movable-view {
+    width: 100rpx !important;
+    height: 100rpx !important;
+    pointer-events: auto; // 恢复鼠标事件
+  }
+}
+
+$all_width: 96rpx;
+$all_height: 96rpx;
+movable-area {
+  height: 100vh;
+  width: 750rpx;
+  top: 0;
+  position: fixed;
+  pointer-events: none; // 鼠标事件可以渗透
+  movable-view {
+    width: $all_width;
+    height: $all_height;
+    pointer-events: auto; // 恢复鼠标事件
+    image {
+      width: $all_width;
+      height: $all_height;
+    }
+  }
+}
 </style>

File diff suppressed because it is too large
+ 0 - 0
src/static/iconfont/cs.svg


Some files were not shown because too many files changed in this diff