Browse Source

用户端tab

chenjj 1 day ago
parent
commit
a1ae496c33

+ 3 - 2
components/Client/new_file.vue

@@ -62,7 +62,7 @@ import {
 } from "@/api/volunteerDetailsApi/details.js"
 import { getTreeList } from '@/api/volunteer'
 import Calendar from '../../components/uni-calendar/components/uni-calendar/uni-calendar.vue'
-
+import { getToken } from '@/utils/auth'
 const swiperList = ['integral', 'kefu-ermai', 'coupon', 'gift', 'scan', 'pause-circle', 'wifi', 'email', 'list'];
 
 // Toast 控制宫格
@@ -243,7 +243,8 @@ const DataInit = () => {
 
 onMounted(() => {
   init();
-  getVolunteerImages();
+  const token = getToken();
+  token && getVolunteerImages();
 });
 </script>
 

+ 2 - 1
components/QRCode/index.vue

@@ -16,7 +16,7 @@
 </template>
 
 <script setup>
-import { ref, onMounted } from 'vue'
+import { ref, onMounted, watch } from 'vue'
 import { getUnlimitedQRCode } from '@/api/qrcode'
 import { arrayBufferToBase64, saveQRCodeToLocal } from '@/utils/qrcode'
 
@@ -82,6 +82,7 @@ const handleLongPress = async () => {
   }
 }
 
+
 onMounted(() => {
   generateQRCode()
 })

+ 8 - 15
pages.json

@@ -11,13 +11,7 @@
 		}
 	},
 	"pages": [
-		{
-			"path": "pages/mine/index",
-			"style": {
-				"navigationBarTitleText": "我的",
-				"navigationStyle": "custom"
-			}
-		},
+		
 		{
 			"path": "pages/index",
 			"style": {
@@ -58,14 +52,13 @@
 				"disableScroll": true
 			}
 		},
-		// {
-		// 	"path": "pages/mine",
-		// 	"style": {
-		// 		"navigationBarTitleText": "我的",
-		// 		"navigationStyle": "custom"
-		// 	}
-		// },
-		
+		{
+			"path": "pages/mine/index",
+			"style": {
+				"navigationBarTitleText": "我的",
+				"navigationStyle": "custom"
+			}
+		},
 		{
 			"path": "pages/mallMenu",
 			"style": {

+ 1 - 1
pages/chat.vue

@@ -2,7 +2,7 @@
     <view class="chat-container">
         <view class="container-banner" :style="{ height: globalData.navBarHeight + 'px' }">
             <view class="container-banner-box" :style="{ height: globalData.statusBarHeight + 'px' }" @click="onKf">
-                <img src="/static/serverImg/chat/msg.png" alt="" style="width: 34rpx;height: 34rpx;">
+                <img src="/static/serverImg/chat/msg.png" alt="" style="width: 34rpx;height: 34rpx;margin-top: 12rpx;">
                 <view class="container-banner-btn">咨询客服</view>
             </view>
         </view>

+ 1 - 1
pages/index.vue

@@ -263,7 +263,7 @@ onPageScroll(e => {
 onMounted(async () => {
 
   const token = getToken();
-  console.log("TCL: token", token || 'null')
+  // console.log("TCL: token", token || 'null')
   if (token) {
     const res_dara = await regionAddresstree()
     addresstree.value = res_dara.data

+ 15 - 5
pages/mine/index.vue

@@ -11,7 +11,7 @@
                                 <view class="info-name" @click="onLogin">{{
                                     userInfo.nickName
                                 }}</view>
-                                <view class="info-tag flex_c_c">{{userType === 1 ? '用户':'志愿者' }}</view>
+                                <view class="info-tag flex_c_c" v-if="userType">{{userType === 1 ? '用户':'志愿者' }}</view>
                             </view>
                             <view class="info-real-name flex_c_c">
                                 <view class="real-name">{{authentication?'已实名':'暂未实名'}}</view>
@@ -81,7 +81,7 @@
         </view>
         <CustomTabBar page="mine" />
         <up-popup :show="show" mode="center" @close="close" @open="open">
-            <view>
+            <view v-if="show">
                 <QRCode scene="123" page="/pages/index/index" width="430" auto-color line-color="#000000" is-hyaline>
                 </QRCode>
             </view>
@@ -218,14 +218,24 @@ const adminList = [
         img: '/static/serverImg/mine/xg.png',
         key: 'map',
         text: '去认证资质',
-        page: '/pages_mine/pages/selectAddress/index',
+        operate: () => {
+            handLsetTing();
+        },
     },
     {
         name: '成为用户',
         img: '/static/serverImg/mine/sf.png',
         key: 'map',
         text: '切换身份',
-        page: '/pages_mine/pages/selectAddress/index',
+        operate: () => {
+            uni.setStorageSync('userType', 1)
+            store.dispatch('GetInfo').then((res) => {
+                userInfo.value = store.state.user
+                uni.reLaunch({
+                url: '/pages/index',
+                })
+            })
+            },
     },
 
 ]
@@ -374,7 +384,7 @@ const geUserInfo = () => {
 
 onShow(() => {
     const token = getToken()
-	console.log("TCL: token", token)
+	// console.log("TCL: token", token)
     if (token) {
         geUserInfo()
         init()

+ 50 - 52
pages_home/components/tabs/index.vue

@@ -1,63 +1,29 @@
 <template>
     <view>
         <view class="tabs-container">
-            <!-- First row of tabs -->
             <view class="tabs-row no-gap">
-                <up-tabs :list="getFirstRowTabs()" @change="handlTabs" :activeStyle="{
-                    color: 'rgba(221, 94, 69, 1)',
-                    fontWeight: 'bold',
-                    transform: 'scale(1.05)',
-                    fontSize: '24rpx'
-                }" 
-                :inactiveStyle="{
-                    fontSize: '24rpx'
-                }"
-                lineColor="rgba(221, 94, 69, 1)" :current="tabKey" keyName="businessName">
-                </up-tabs>
+                <view v-for="(item, index) in list" :key="item.id"
+                    :class="tabKey === index ? 'tab-item tab-active' : 'tab-item'" @click="handlTabs(item, index)">
+                    {{ item.businessName }}
+                </view>
             </view>
-            
-            <!-- Second row of tabs -->
             <view class="tabs-row no-gap">
-                <up-tabs :list="getSecondRowTabs()" @change="handlSecondRowTabs" :activeStyle="{
-                    color: 'rgba(221, 94, 69, 1)',
-                    fontWeight: 'bold',
-                    transform: 'scale(1.05)',
-                    fontSize: '24rpx'
-                }"
-                :inactiveStyle="{
-                    fontSize: '24rpx'
-                }"
-                lineColor="rgba(221, 94, 69, 1)" :current="secondRowTabKey" keyName="businessName">
-                </up-tabs>
+                <view v-for="(item, index) in childrenList" :key="item.id"
+                    :class="childrenKey === index ? 'tab-item tab-active' : 'tab-item'"
+                    @click="childernChange(item, index)">
+                    {{ item.businessName }}
+                </view>
+            </view>
+            <view class="tabs-row no-gap">
+                <view v-for="(item, index) in childrenList" :key="item.id"
+                    :class="children2Key === index ? 'tab-item tab-active' : 'tab-item'"
+                    @click="childern2Change(item, index)">
+                    {{ item.businessName }}
+                </view>
             </view>
         </view>
-        
-        <view class="tabs-scroll">
-            <up-tabs :list="childrenList" @change="childernChange" :activeStyle="{
-                color: 'rgba(221, 94, 69, 1)',
-                fontWeight: 'bold',
-                transform: 'scale(1.05)',
-                fontSize: '22rpx'
-            }"
-            :inactiveStyle="{
-                fontSize: '22rpx'
-            }"
-            lineColor="rgba(221, 94, 69, 1)" :current="childrenKey" keyName="businessName">
-            </up-tabs>
-        </view>
-        <view class="tabs-scroll-box">
-            <up-tabs :list="children2List" @change="childern2Change" :activeStyle="{
-                color: 'rgba(221, 94, 69, 1)',
-                fontWeight: 'bold',
-                transform: 'scale(1.05)',
-                fontSize: '20rpx'
-            }"
-            :inactiveStyle="{
-                fontSize: '20rpx'
-            }"
-            lineColor="rgba(221, 94, 69, 1)" :current="children2Key" keyName="businessName">
-            </up-tabs>
-        </view>
+
+
     </view>
 </template>
 
@@ -177,6 +143,38 @@ onLoad((options) => {
 .tabs-row {
     width: 100%;
     margin-bottom: 6rpx;
+
+    display: grid;
+    grid-template-columns: repeat(5, 1fr); // 4列布局
+    gap: 20rpx; // 网格间距
+
+
+
+}
+
+.tab-item {
+    font-family: PingFang SC;
+    font-size: 30rpx;
+    font-weight: normal;
+    line-height: 48rpx;
+    letter-spacing: normal;
+    color: #818181;
+
+    padding: 10px 0;
+
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.tab-active {
+    font-family: PingFang SC;
+    font-size: 30rpx;
+    font-weight: 600;
+    line-height: 48rpx;
+    letter-spacing: normal;
+    color: #1A1A1A;
+    border-bottom: 4px solid #D94342;
 }
 
 /* 添加无间隔样式 */

+ 19 - 1
pages_mine/pages/setupUser/index.vue

@@ -15,6 +15,11 @@
 			<up-icon name="arrow-right" class="icon"></up-icon>
 			<up-divider></up-divider>
 		</view>
+		<view class="wrapper" @click="logoOut">
+			<text class="text">退出登陆</text>
+			<up-icon name="arrow-right" class="icon"></up-icon>
+			<up-divider></up-divider>
+		</view>
 	</view>
 </template>
 
@@ -22,7 +27,8 @@
 	import {
 		ref
 	} from 'vue'
-
+import { showConfirm } from '@/utils/common'
+import store from '@/store'
 	const handlServiceAddress = () => {
 		uni.navigateTo({
 			url: '/pages_mine/pages/setupUser/Address'
@@ -34,6 +40,18 @@ const handlePersonalInfo = () => {
 		url: '/pages_mine/pages/setupUser/personalInfo'
 	})
 }
+
+const logoOut = () => {
+	showConfirm('确认退出登陆吗?').then((res) => {
+        if (res.confirm) {
+            store.dispatch('LogOut').then((res) => {
+                uni.reLaunch({
+                    url: '/pages/index',
+                })
+            })
+        }
+    })
+}
 </script>
 
 <style scoped>

+ 3 - 3
pages_orderuser/pages/talk/pages/index/index.vue

@@ -110,7 +110,8 @@ export default {
 		this.system = this.userType === 1 ? '1' : '2';
 		//客服
 		if(options.customerService){
-			this.system = 3;
+			// this.system = 3;
+			this.isKg = true;
 		}
 		
 		// #ifdef H5
@@ -198,7 +199,7 @@ export default {
 				const parmas = {
 					system: this.system
 				}
-				const apiFun = this.orderId ? getOrderConversationInfo : (this.system === 3?getHelpConversation:getListConversationInfo)
+				const apiFun = this.orderId ? getOrderConversationInfo : (this.isKg?getHelpConversation:getListConversationInfo)
 				if (this.orderId) {
 					parmas.mainOrderId = this.orderId
 				}
@@ -207,7 +208,6 @@ export default {
 				}
 
 				
-
 				const res = await apiFun(parmas);
 				console.log("TCL: getOrder -> res", res)
 				await setRead({...parmas,conversationRecordId: res.data.conversationRecordId}); //设置已读

+ 3 - 3
utils/WebSocketManager.js

@@ -7,7 +7,7 @@ class WebSocketManager {
         this.userId = userId;
         const url = baseUrl.split('/')[2];
         const header = baseUrl.split('/')[0] === 'https:' ? 'wss' : 'ws';
-		console.log("TCL: WebSocketManager -> constructor -> url",header, url)
+		// console.log("TCL: WebSocketManager -> constructor -> url",header, url)
         this.url = `${header}://${url}/websocket/${this.system}/${this.userId}`;
 
         this.socketTask = null;
@@ -55,7 +55,7 @@ class WebSocketManager {
             console.log('收到 WebSocket 消息:', res.data);
             try {
                 const data = JSON.parse(res.data);
-				console.log("TCL: WebSocketManager -> _setupEventListeners -> data", data)
+				// console.log("TCL: WebSocketManager -> _setupEventListeners -> data", data)
                 if (typeof this.onMessageCallback === 'function') {
                     this.onMessageCallback(data); // 回调通知外部
                 }
@@ -143,7 +143,7 @@ class WebSocketManager {
      * 设置消息回调
      */
     onMessage(callback) {
-		console.log("TCL: WebSocketManager -> onMessage -> callback", callback)
+		// console.log("TCL: WebSocketManager -> onMessage -> callback", callback)
         this.onMessageCallback = callback;
     }
 }