huangziyang преди 4 дни
родител
ревизия
23e405bd8f
променени са 7 файла, в които са добавени 149 реда и са изтрити 18 реда
  1. 5 3
      components/CustomerService/CustomerService.vue
  2. 7 0
      pages.json
  3. 103 4
      pages/contant/index.vue
  4. 10 2
      pages/success/error.vue
  5. 15 7
      pages/success/paysuccess.vue
  6. 2 2
      utils/request.js
  7. 7 0
      utils/router.js

+ 5 - 3
components/CustomerService/CustomerService.vue

@@ -1,10 +1,11 @@
 <script setup>
 import { ref } from "vue";
+import { router } from "../../utils/router";
 const x = ref(0);
 const y = ref(0);
 
 const onClick = () => {
-  console.log(111);
+  router.push("/pages/contant/index");
 };
 </script>
 <template>
@@ -15,8 +16,9 @@ const onClick = () => {
       direction="all"
       @change="onChange"
       class="contact"
-      ><image class="contact-img" @click="onClick"></image
-    ></movable-view>
+    >
+      <image class="contact-img" @click="onClick" />
+    </movable-view>
   </movable-area>
 </template>
 

+ 7 - 0
pages.json

@@ -160,6 +160,13 @@
         "navigationBarTitleText": "公告列表"
       }
     },
+    {
+      "path": "pages/contant/index",
+      "style": {
+        "navigationStyle": "custom",
+        "navigationBarTitleText": "客服"
+      }
+    },
     {
       "path": "pages/notice/detail",
       "style": {

+ 103 - 4
pages/contant/index.vue

@@ -1,13 +1,112 @@
 <script setup>
-import Container from '../../components/Container/Container.vue';
+import { ref } from "vue";
+import Container from "../../components/Container/Container.vue";
+import { onShow } from "@dcloudio/uni-app";
+import { request } from "@/utils/request";
+const src = ref("");
+onShow(() => {
+  request(
+    "api/question_bank/question_reception/channel_active_code/random_detail"
+  ).then((res) => {
+    src.value = res.data.qr_code;
+  });
+});
 </script>
 
 <template>
-  <Container title="客服">
+  <Container title="客服" headerColor="#fff">
     <template #bg>
-      <image src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/bHbLzGDSB07Gc0tqCVCI3NLUx4sbUU4KHKSolvBq.png" mode="scaleToFill" class="bg" />
+      <image
+        src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/bHbLzGDSB07Gc0tqCVCI3NLUx4sbUU4KHKSolvBq.png"
+        mode="scaleToFill"
+        class="bg"
+      />
     </template>
+    <view class="Container">
+      <view class="text-lg">专属客服, 帮助解决您的问题</view>
+      <view class="qr-code">
+        <div class="card">
+          <img :src="src" show-menu-by-longpress class="img" alt="" />
+          <span>可长按识别二维码</span>
+        </div>
+      </view>
+      <div class="tip">
+        <div class="title">添加客服可获得</div>
+        <div>服务问题优先解决</div>
+        <div>考试咨询提前收到</div>
+        <div>新政策变化早知道</div>
+        <div>各项活动优先参与</div>
+      </div>
+    </view>
   </Container>
 </template>
 
-<style lang="scss" ></style>
+<style lang="scss">
+.bg {
+  width: 750rpx;
+  height: 100%;
+}
+
+.qr-code {
+  width: 100%;
+  height: 100%;
+  margin-top: 40px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  color: $success;
+  gap: 12rpx;
+  .card {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    padding: 60rpx;
+    background-color: #fff;
+    gap: 30rpx;
+    border-radius: 40rpx;
+    width: calc(100%);
+    box-sizing: border-box;
+    color: #333;
+
+    .img {
+      width: 400rpx;
+      height: 400rpx;
+    }
+  }
+}
+
+.text-lg {
+  font-size: 44rpx;
+  font-weight: bold;
+}
+
+.Container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  padding: 70rpx 20rpx;
+  gap: 20rpx;
+
+  .tip {
+    background: #fff;
+    border-radius: 40rpx;
+    padding: 20rpx 0 40rpx;
+    width: 100%;
+    box-sizing: border-box;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    gap: 20rpx;
+    color: $warning;
+    .title {
+      font-size: 30rpx;
+      font-weight: bold;
+      color: #000;
+      margin-bottom: 10rpx;
+    }
+  }
+}
+</style>

+ 10 - 2
pages/success/error.vue

@@ -30,12 +30,20 @@
 import Container from "../../components/Container/Container.vue";
 import { ref } from "vue";
 import { router } from "../../utils/router";
+import { onShow } from "@dcloudio/uni-app";
+import { request } from "@/utils/request";
 const onBack = () => new Promise((resolve) => resolve("/pages/user/index"));
 const back = () => {
   router.switchTab("/pages/user/index");
 };
-const src = ref("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/XTYZzM0uKjmKGV2cXN3QC5R1icHXmQDo10mUNZ6T.png");
-
+const src = ref("");
+onShow(() => {
+  request(
+    "api/question_bank/question_reception/channel_active_code/random_detail"
+  ).then((res) => {
+    src.value = res.data.qr_code;
+  });
+});
 </script>
 
 <style scoped lang="scss">

+ 15 - 7
pages/success/paysuccess.vue

@@ -5,7 +5,7 @@
     bgColor="#f7f7f7"
     :onBack="onBack"
     :scrollStyle="{
-      padding: 0
+      padding: 0,
     }"
   >
     <view class="info-area">
@@ -22,7 +22,7 @@
       <span>恭喜你成为VIP</span>
       <span>这是您的专属老师</span>
       <div class="card">
-        <img :src="src" show-menu-by-longpress class="img" alt="">
+        <img :src="src" show-menu-by-longpress class="img" alt="" />
         <span>可长按识别二维码</span>
       </div>
     </view>
@@ -31,13 +31,22 @@
 
 <script setup>
 import Container from "../../components/Container/Container.vue";
-import { router } from "../../utils/router";
 import { ref } from "vue";
+import { router } from "../../utils/router";
+import { onShow } from "@dcloudio/uni-app";
+import { request } from "@/utils/request";
 const onBack = () => new Promise((resolve) => resolve("/pages/user/index"));
 const back = () => {
   router.switchTab("/pages/user/index");
 };
-const src = ref("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/XTYZzM0uKjmKGV2cXN3QC5R1icHXmQDo10mUNZ6T.png");
+const src = ref("");
+onShow(() => {
+  request(
+    "api/question_bank/question_reception/channel_active_code/random_detail"
+  ).then((res) => {
+    src.value = res.data.qr_code;
+  });
+});
 </script>
 
 <style scoped lang="scss">
@@ -52,7 +61,7 @@ const src = ref("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/quest
   color: $success;
   gap: 12rpx;
   .card {
-    margin:10rpx auto 0;
+    margin: 10rpx auto 0;
     display: flex;
     align-items: center;
     justify-content: center;
@@ -79,7 +88,6 @@ const src = ref("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/quest
   margin-top: 50rpx;
 }
 
-
 /* 中间说明区域 */
 .info-area {
   flex: 2;
@@ -105,7 +113,7 @@ const src = ref("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/quest
   line-height: 84rpx;
   display: block;
   border: 1rpx solid green;
-  text-align:center;
+  text-align: center;
   width: 94%;
   margin: auto;
 }

+ 2 - 2
utils/request.js

@@ -68,9 +68,9 @@ export const request = (url, data = {}, method = "GET") => {
           reject("请登录");
           return;
         }
-        if (res.data.code !== "success") {
+        if (res.code !== "success") {
           uni.showToast({
-            title: res.data.msg,
+            title: res.msg,
             icon: "none",
           });
         }

+ 7 - 0
utils/router.js

@@ -104,6 +104,13 @@ export const getRoute = () => {
         item.options[param] = decodeURIComponent(item.options[param]);
       }
 
+      if (item.options.scene) {
+        item.options = {
+          ...item.options,
+          ...urlParamsToObj('?' + item.options.scene),
+        };
+      }
+
       return {
         params: item.options,
         path: item.route,