123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- module.exports = {
- toChannelIndex: toChannelIndex,
- toAboutUs: toAboutUs,
- }
- ///选择指定频道
- function toChannelIndex(index, callback) {
- var pages = getCurrentPages();
- const route_util = require('../route_util');
- const route_constant = require('../route_constant');
- var isLogin = pages[0].getIsLogin();
- if (!isLogin) {
- route_util.jump(route_constant.login);
- return;
- }
- var actionIndex = pages[0].getActionIndex();
- if (actionIndex == null) {
- return;
- }
- if (index == actionIndex) {
- return;
- };
- var deviceList = pages[0].getDeviceList();
- var deviceListSelect = pages[0].getDeviceListSelect();
- if (deviceListSelect === null || deviceList.length <= deviceListSelect) {
- wx.showToast({
- title: '请选择设备',
- icon: "none"
- });
- return;
- };
- callback(index);
- const app = getApp();
- const lexin_util = require('../lexin/util');
- var channelData = pages[0].getChannelData();
- // `${deviceUid}`
- var deviceUid = app.globalData.userInfo.deviceUid;
- var timestamp = Math.round(new Date() / 1000);
- var channel_id = channelData[index].channelNum;
- var is_debug = app.globalData.is_debug;
- var deviceId = deviceList[deviceListSelect].deviceId;
- const other = {
- "url": "",
- "media_data": "",
- "user_id": deviceUid,
- "timestamp": timestamp,
- "channel_id": channel_id,
- "order": "",
- "resource_from": "",
- "songAlbumID": "",
- "version": 3,
- "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_7cdfa1fd3af0
- var deviceMacId = lexin_util.getDeviceMacId(deviceId);
- app.PubMsg({
- type: "play",
- DstDeviceName: deviceMacId,
- other
- });
- };
- ///关于我们
- function toAboutUs() {
- const route_util = require('../route_util');
- const route_constant = require('../route_constant');
- route_util.jump(route_constant.about);
- };
|