瀏覽代碼

司机端

chenpm 2 月之前
父節點
當前提交
b05e41f992

+ 9 - 2
js_sdk/http.js

@@ -56,6 +56,13 @@ export function unbindWxId(data) {
         data, {}
     )
 }
+export function loginByWeChat(data) {
+
+    return $http.post(
+        '/wx/auth/loginByWeChat',
+        data, {}
+    )
+}
 
 export function getUserLocalStorageInfo() {
     const userInfo = JSON.parse(
@@ -374,7 +381,7 @@ export function findSafetySelfCheckingPlanById(e) {
         id: e
     }, {})
 }
-// 
+//
 export function findSafetySelfCheckingPlanList(e) {
     return $http.post(
         "/wx/SafetyController/findSafetySelfCheckingPlanList",
@@ -639,4 +646,4 @@ export function getRepairList(data) {
         '/wx/repair/list',
         data, {}
     )
-}
+}

+ 8 - 3
js_sdk/sjTools.js

@@ -7,7 +7,7 @@ import qs from 'qs';
 const baseUri = ''
 const dict = '/wx/dict/'
 const dock = '/wx/dock/'
-// 
+//
 // ​/wx​/dock​/reservationListPage
 export function reservationListPage(data) {
     return $http.post(
@@ -15,7 +15,12 @@ export function reservationListPage(data) {
         data, {}
     )
 }
-
+export function getQrCode2(data) {
+    return $http.post(
+        baseUri + dock + 'getQrCode2',
+        data, {}
+    )
+}
 export function getReservationById(data) {
     return $http.post(
         baseUri + dock + 'getReservationById',
@@ -62,4 +67,4 @@ export function doReservationFinish(data) {
 //         baseUri + dock + 'getReservationVoById',
 //         data, {}
 //     )
-// }
+// }

+ 1 - 0
manifest.json

@@ -5,6 +5,7 @@
     "versionName" : "1.0.0",
     "versionCode" : "100",
     "transformPx" : false,
+	"sassImplementationName":"node-sass",
     "app-plus" : {
         "usingComponents" : true,
         "nvueCompiler" : "uni-app",

+ 5 - 1
pages/chooseIdentity/index.vue

@@ -54,7 +54,11 @@ export default {
     },
     goLogin() {
       if(this.isSelect==1){
-
+        uni.navigateTo({
+          url: "/pages/subPackages/phoneRegister/index"
+        });
+        return
+      //   phoneRegister/index
       }
       let type =
         this.isSelect === 1 ? "USER" : this.isSelect === 2 ? "BIZ" : "FRAME";

+ 20 - 12
pages/index/index.vue

@@ -71,17 +71,17 @@
       </div>
       <div class="right">
         <div>
+<!--          <div class="info">-->
+<!--            <div class="label chaochuyincang">-->
+<!--              受暴雨天气影响,2024-07-13 8:00...-->
+<!--            </div>-->
+<!--            <div class="day">1天前</div>-->
+<!--          </div>-->
           <div class="info">
             <div class="label chaochuyincang">
-              受暴雨天气影响,2024-07-13 8:00...
+              {{ noticeText }}
             </div>
-            <div class="day">1天前</div>
-          </div>
-          <div class="info">
-            <div class="label chaochuyincang">
-              受暴雨天气影响,2024-07-13 8:00...
-            </div>
-            <div class="day">1天前</div>
+            <div class="day">{{ timeText }}</div>
           </div>
         </div>
       </div>
@@ -226,7 +226,7 @@
 <script>
 // import {demo} from "@/js_sdk/http"
 
-import { driverMessageCount, bizMessageCount } from "@/js_sdk/noticeList.js";
+import { driverMessageCount, bizMessageCount,getNotice } from "@/js_sdk/noticeList.js";
 import { getUserLocalStorageInfo } from "@/js_sdk/localUserInfo.js";
 export default {
   data() {
@@ -236,22 +236,30 @@ export default {
       VenueNum: 0,
       userType: "",
       noticeNum: 0,
+      noticeText:'',
+      timeText:''
     };
   },
   onShareAppMessage() {},
   mounted() {
     // demo();
   },
-  onLoad() {
+  onShow() {
     this.userType = getUserLocalStorageInfo().userType;
     if (this.userType == "USER") {
       this.driverMessageCount();
     } else {
       this.bizMessageCount();
     }
+    this.getNotice()
   },
-  onShow() {},
   methods: {
+    async getNotice(){
+      let data = await getNotice()
+      console.log(data)
+      this.noticeText=data.data.content
+      this.timeText = data.data.time
+    },
     // /wx/dock/driverMessageCount
     async bizMessageCount() {
       let { data } = await bizMessageCount({
@@ -370,7 +378,7 @@ export default {
       display: flex;
       color: rgba(24, 23, 42, 1);
       .label {
-        width: 500rpx;
+        width: 345rpx;
       }
     }
 

+ 21 - 18
pages/subPackages/phoneRegister/index.vue

@@ -26,7 +26,7 @@
   </div>
 </template>
   <script>
-import { loginByWeixin2 } from "@/js_sdk/http.js";
+import { loginByWeChat } from "@/js_sdk/http.js";
 
 export default {
   data() {
@@ -47,23 +47,27 @@ export default {
     this.captchaImageRefresh(this.loginForm);
   },
   methods: {
-    getPhoneNumber(e) {
-      wx.login({
-        success(res) {
-          console.log(res);
-          let data = {
-            loginCode: res.code,
-            phoneCode: e.detail.code,
-          };
-          loginByWeixin2(data).then((e) => {
-            console.log(e.data.user);
-            wx.setStorageSync("USERINFO", JSON.stringify(e.data.user));
-            uni.switchTab({
-              url: "/pages/index/index",
-            });
-          });
-        },
+    async getPhoneNumber(e) {
+
+
+      let _this = this
+      let data = await loginByWeChat({ code:e.detail.code });
+      console.log(data);
+      _this.$auth.setUser(data.data.token);
+      this.$auth.setUserInfo({
+        ...data.data,
+        userType: 'USER',
+      });
+      uni.switchTab({
+        url: "/pages/index/index",
       });
+      // loginByWeChat({code:e.detail.code}).then((e) => {
+      //   console.log(e.data.user);
+      //   wx.setStorageSync("USERINFO", JSON.stringify(e.data.user));
+      //   uni.switchTab({
+      //     url: "/pages/index/index",
+      //   });
+      // });
     },
     goqy() {
       uni.navigateTo({
@@ -259,4 +263,3 @@ export default {
   }
 }
 </style>
-  

+ 39 - 12
pages/subPackages/yy_history/code.vue

@@ -8,14 +8,20 @@
       </div>
       <div class="form-data">
         <div class="code">
-          <ayQrcode
-            ref="qrcode"
-            :modal="modal_qr"
-            :url="url"
-            @hideQrcode="hideQrcode"
-            :height="160"
-            :width="160"
+          <img
+            :src="url"
+            style="width: 100%; height: 500rpx"
+            v-if="url.length > 0"
+            alt=""
           />
+          <!--          <ayQrcode-->
+          <!--            ref="qrcode"-->
+          <!--            :modal="modal_qr"-->
+          <!--            :url="url"-->
+          <!--            @hideQrcode="hideQrcode"-->
+          <!--            :height="160"-->
+          <!--            :width="160"-->
+          <!--          />-->
         </div>
         <div class="form-item">
           <div class="item-label">对应码头</div>
@@ -89,7 +95,11 @@
 <script>
 // /wx/dock/getReservationVoById
 
-import { getReservationVoById, cancelReservation } from "@/js_sdk/sjTools.js";
+import {
+  getReservationVoById,
+  cancelReservation,
+  getQrCode2,
+} from "@/js_sdk/sjTools.js";
 import ayQrcode from "@/components/ay-qrcode/ay-qrcode.vue";
 
 export default {
@@ -98,6 +108,8 @@ export default {
       url: "",
       modal_qr: false,
       info: {},
+      id: null,
+      setIntervalTime: null,
     };
   },
   components: { ayQrcode },
@@ -109,17 +121,32 @@ export default {
   },
   onLoad(e) {
     console.log(e);
-
+    this.id = e.id;
     this.getReservationVoById(e.id);
+    this.setIntervalTime = setInterval(() => {
+      this.getReservationVoById(this.id);
+    }, 5000);
+  },
+  onUnload() {
+    if (this.setIntervalTime) {
+      clearInterval(this.setIntervalTime);
+      this.setIntervalTime = null;
+    }
   },
   methods: {
     async getReservationVoById(id) {
       let { data } = await getReservationVoById({ id });
       console.log(data);
+      // let qrCode = await getQrCode2({id:data.id})
+      // console.log(qrCode)
       this.info = data;
-      this.url = data.id;
+      console.log(
+        this.$constant.BASE_URI + "/wx/dock/getQrCode2?id=" + data.id
+      );
+      this.url = this.$constant.BASE_URI + "/wx/dock/getQrCode2?id=" + data.id;
       this.showQrcode();
     },
+
     wxShare(e) {
       console.log(e);
     },
@@ -132,7 +159,7 @@ export default {
       // uni.showLoading()
       setTimeout(function () {
         // uni.hideLoading()
-        _this.$refs.qrcode.crtQrCode();
+        // _this.$refs.qrcode.crtQrCode();
       }, 50);
     },
     onShareAppMessage(res) {
@@ -223,4 +250,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 3 - 3
pages/utils/constant.js

@@ -1,6 +1,6 @@
 // 系统常量
-// export const BASE_URI = "https://www.idea-sf.com/dockApi"; // 测试
-export const BASE_URI = "http://192.168.2.108:9001"; // 许峰本地
+export const BASE_URI = "https://www.idea-sf.com/dockApi"; // 测试
+// export const BASE_URI = "http://192.168.2.108:9001"; // 许峰本地
 
 // export const BASE_URI = "https://hswkxc.idea-sf.com/gardenApi"; // 正式
 // export const BASE_URI = "http://192.168.3.94:9010"; // 老潘本地
@@ -14,4 +14,4 @@ export default {
     // 基础地址
     BASE_URI,
 
-};
+};