瀏覽代碼

feature: 记录数据

Damon 7 月之前
父節點
當前提交
c0dc02f239
共有 4 個文件被更改,包括 23 次插入7 次删除
  1. 3 3
      app.js
  2. 4 0
      pages/index/index.js
  3. 1 1
      pages/index/index.wxml
  4. 15 3
      utils/lexin/jump.js

+ 3 - 3
app.js

@@ -149,7 +149,7 @@ App({
 
     // 重连
     that.globalData.client.on("reconnect", function (errr) {
-      // console.log("reconnect的回调==" + JSON.stringify(errr))
+      console.log("reconnect的回调==" + JSON.stringify(errr))
       var pages = getCurrentPages();
       var length = pages.length;
       var currentPage = pages[length - 1];
@@ -163,7 +163,7 @@ App({
 
     // 离线回调
     that.globalData.client.on("offline", function (errr) {
-      // console.log("offline的回调==" + JSON.stringify(errr))
+      console.log("offline的回调==" + JSON.stringify(errr))
       var pages = getCurrentPages();
       var length = pages.length;
       var currentPage = pages[length - 1];
@@ -177,7 +177,7 @@ App({
 
     // 错误回调
     that.globalData.client.on("error", function (error) {
-      // console.log("错误码的回调==" + JSON.stringify(errr))
+      console.log("错误码的回调==" + JSON.stringify(errr))
       var pages = getCurrentPages();
       var length = pages.length;
       var currentPage = pages[length - 1];

+ 4 - 0
pages/index/index.js

@@ -230,7 +230,9 @@ Page({
   ///选择对应的频道
   onTapChannelIndex(e) {
     var that = this;
+    console.log("gadsfqreqwrqwerqer==aa==");
     var index = e.currentTarget.dataset.index;
+    console.log("gadsfqreqwrqwerqer==00==" + index);
     lexin_jump.toChannelIndex(index, function (i) {
       that.setData({
         actionIndex: i,
@@ -517,6 +519,8 @@ Page({
 
     store.setStore("deviceList", deviceList);
     var indexPage = that.data.indexPage;
+    var deviceMacId = that.data.deviceMacId;
+    var actionIndex = that.data.actionIndex;
     that.setData({
       deviceList: deviceList,
       deviceMacId: isCurrentIndex ? null : deviceMacId,

+ 1 - 1
pages/index/index.wxml

@@ -182,7 +182,7 @@
           首页
         </view>
       </view>
-      
+
       <view wx:if="{{deviceListSelect!=null&&deviceList.length>deviceListSelect&&deviceList[deviceListSelect].connectType===3}}" class="bottom_view" data-index="1" bind:tap="onTapIndex">
         <image class="bottom_image" mode="widthFix" src="{{indexPage==1?'./../../img/channel_action.png':'./../../img/channel_unaction.png'}}"></image>
         <view style="font-size: 20rpx;color: {{indexPage==1?'#A4D099':'black'}};">频道</view>

+ 15 - 3
utils/lexin/jump.js

@@ -9,24 +9,29 @@ function toChannelIndex(index, callback) {
   const route_util = require('../route_util');
   const route_constant = require('../route_constant');
   var isLogin = pages[0].getIsLogin();
+  console.log("gadsfqreqwrqwerqer==111==" + isLogin);
   if (!isLogin) {
     route_util.jump(route_constant.login);
     return;
   }
 
-  const strings = require('../strings');
+  console.log("gadsfqreqwrqwerqer==222==" + index);
   var actionIndex = pages[0].getActionIndex();
-  if (strings.isEmpty(actionIndex)) {
+  console.log("gadsfqreqwrqwerqer==33==" + actionIndex);
+  if (actionIndex == null) {
     return;
   }
 
-  if (index === actionIndex) {
+  console.log("gadsfqreqwrqwerqer==444==" + index + "==" + actionIndex);
+  if (index == actionIndex) {
     return;
   };
 
   var deviceList = pages[0].getDeviceList();
   var deviceListSelect = pages[0].getDeviceListSelect();
+  console.log("gadsfqreqwrqwerqer==555==");
   if (deviceListSelect === null || deviceList.length <= deviceListSelect) {
+    console.log("gadsfqreqwrqwerqer==666==");
     wx.showToast({
       title: '请选择设备',
       icon: "none"
@@ -60,12 +65,19 @@ function toChannelIndex(index, callback) {
     "is_debug": is_debug,
   };
 
+  //other: {"url":"","media_data":"","user_id":1,"timestamp":1734423952,"channel_id":4,"order":"","resource_from":"","songAlbumID":"","version":3,"is_debug":2}
+
+  //deviceMacId: AIrSMArT_423060242830
+
   var deviceMacId = lexin_util.getDeviceMacId(deviceId);
+  console.log("gasdfqwerqwerqr==00=" + JSON.stringify(other));
+  console.log("gasdfqwerqwerqr==11=" + deviceMacId);
   app.PubMsg({
     type: "play",
     DstDeviceName: deviceMacId,
     other
   });
+
 };
 
 ///关于我们