Quellcode durchsuchen

清除聊天定时器

嘀嘀嘀 vor 1 Jahr
Ursprung
Commit
4034d4d86e
3 geänderte Dateien mit 56 neuen und 34 gelöschten Zeilen
  1. 24 24
      App.vue
  2. 8 8
      common/config.js
  3. 24 2
      pages/index/index.vue

+ 24 - 24
App.vue

@@ -1,32 +1,32 @@
 <script>
 export default {
 	onLaunch: function () {
-		setInterval((d) => {
-			//定时器,定时去调取聊天未读消息
-			let userId = uni.getStorageSync('userId')
-			if (userId) {
-				this.$Request.getMsg('/app/ordersChat/selectUserAllUnreadCount').then((res) => {
-					if (res.code === 0) {
-						let messageCount = res.data
+		// setInterval((d) => {
+		// 	//定时器,定时去调取聊天未读消息
+		// 	let userId = uni.getStorageSync('userId')
+		// 	if (userId) {
+		// 		this.$Request.getMsg('/app/ordersChat/selectUserAllUnreadCount').then((res) => {
+		// 			if (res.code === 0) {
+		// 				let messageCount = res.data
 
-						uni.setStorageSync('messageCount', messageCount)
+		// 				uni.setStorageSync('messageCount', messageCount)
 
-						let num = messageCount
-						// console.log(num, '未读消息数')
-						if (num == 0) {
-							uni.removeTabBarBadge({
-								index: 2
-							})
-							return
-						}
-						uni.setTabBarBadge({
-							index: 2,
-							text: num + ''
-						})
-					}
-				})
-			}
-		}, 3000)
+		// 				let num = messageCount
+		// 				// console.log(num, '未读消息数')
+		// 				if (num == 0) {
+		// 					uni.removeTabBarBadge({
+		// 						index: 2
+		// 					})
+		// 					return
+		// 				}
+		// 				uni.setTabBarBadge({
+		// 					index: 2,
+		// 					text: num + ''
+		// 				})
+		// 			}
+		// 		})
+		// 	}
+		// }, 3000)
 		// 是否开启总送跑腿新用户红包 256
 		this.$Request.get('/app/common/type/256').then((res) => {
 			if (res.code == 0) {

+ 8 - 8
common/config.js

@@ -1,18 +1,18 @@
-// const ROOTPATH = "https://mxys.chuanghai-tech.com/sqx_fast";
-const ROOTPATH = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
+const ROOTPATH = "https://mxys.chuanghai-tech.com/sqx_fast";
+// const ROOTPATH = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
 
-// const ROOTPATH1 = "https://mxys.chuanghai-tech.com/sqx_fast";
-const ROOTPATH1 = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
+const ROOTPATH1 = "https://mxys.chuanghai-tech.com/sqx_fast";
+// const ROOTPATH1 = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
 
 //联系客服
-// const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss/websocket/"
+const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss/websocket/"
 //联系客服
-const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss-test/websocket/"
+// const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss-test/websocket/"
 
 //聊天
-// const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss/ordersChat/"
+const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss/ordersChat/"
 //聊天
-const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss-test/ordersChat/"
+// const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss-test/ordersChat/"
 
 // const ROOTPATH = "http://192.168.0.121:8176/sqx_fast";
 // const ROOTPATH1 = "http://192.168.0.121:8176/sqx_fast";

+ 24 - 2
pages/index/index.vue

@@ -41,7 +41,7 @@
 			<!-- 公告 -->
 			<view class="flex justify-between align-center bg-white padding-bottom padding-lr radius bg-white"
 				style="width: 100%;height: 100rpx;">
-				<image src="../../static/images/index/gonggao.png" style="width: 140rpx;height: 50rpx;" mode=""></image>
+				<image @click="ceshi" src="../../static/images/index/gonggao.png" style="width: 140rpx;height: 50rpx;" mode=""></image>
 				<view class="flex-sub margin-left-sm" style="height:82rpx;overflow: hidden;">
 					<uni-notice-bar single speed="25" scrollable background-color="#fff" color="#000" :text="noticeList.value" />
 				</view>
@@ -588,7 +588,7 @@
 			console.log(that.userId, '我的id')
 			// if (this.lng && this.lat) {
 			// that.defaultAddress()
-			that.getjxShop(); //精选商家
+			// that.getjxShop(); //精选商家
 			// }
 
 			if (that.userId) {
@@ -632,6 +632,28 @@
 			}
 		},
 		methods: {
+			//测试付钱
+			ceshi(){
+				console.log('付钱')
+				wx.requestPayment( {
+				    "appId": 'wx45ab46867002aa0b',     //公众号ID,由商户传入     
+				    "timeStamp": '1730281084',     //时间戳,自1970年以来的秒数     
+				    "nonceStr": '14cdaf9f6ab64c0ab4d2df3a63f2b484',      //随机串     
+				    "package": 'prepay_id=wx30173804948968a92217fddbd7942d0000',
+				    "signType": 'RSA',     //微信签名方式:     
+				    "paySign": 'QFMu/l1/WIM9QTXaalpiHSwKr6MpeNt6ixpWb/qaT2u0Dw344kknTQRWSs86T+aqSSnBuVyL+mjEchC/GkNwG489omH03fWtVWM3jEtgpzS4oEQF7F+QehyxKR/Lw11OBvQont+xmuhI7DwSVn5OKB5yEfxG57LdcFBb2x6+FGlLFvSEB0p/XqJh8aW+80tvaz1lhX677AyxU5VwP1aBIB5MivqvBWypbyfKR30qA7oM8wOq6O4baYQtXrq0z0kokhNk0aZxHTYuqqNXftcyyBGyyM6hl0LHXvlxhrbS8N/GitwgSX3KJ3Jate+V5UVNv0+vY1NNxVOzDMhNirWNMg==' //微信签名 
+				},
+				function(res) {
+					console.log(res,'res')
+				    if (res.err_msg == "get_brand_wcpay_request:ok") {
+				    	
+				        // 使用以上方式判断前端返回,微信团队郑重提示:
+				        //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
+				    }else{
+				    	this.chapayIf()
+				    }
+				});
+			},
 			goChat() {
 				if (this.token) {
 					uni.navigateTo({