gemercheung 3 年之前
父節點
當前提交
4597fc9cac

+ 2 - 1
app.json

@@ -55,7 +55,8 @@
     "pages/user/imageCropper",
     "component/storeItem/storeItem",
     "component/roomItem/roomItem",
-    "pages/sence/sence"
+    "pages/sence/sence",
+    "pages/roomManger/roomManger"
   ],
   "window": {
     "backgroundTextStyle": "dark",

+ 1 - 0
config.js

@@ -16,6 +16,7 @@ const mal = {
   env: 'pro',
   //  socketHost: 'wss://rtc-zfb.4dkankan.com/',
   socketHost: 'wss://test-socket.4dkankan.com',
+  // socketHost: 'ws://127.0.0.1:12000',
   // socketHost: 'wss://192.168.0.79:3031',
   requestHost: 'https://plaza-cszfb.4dkankan.com', // 测试环境
   viewChildHost: 'https://cszfb.4dkankan.com', //测试环境

+ 122 - 118
config/api.js

@@ -8,121 +8,125 @@ const API_BASE_URL = remote.requestHost + '/api/';
 
 
 module.exports = {
-    API_BASE_URL,
-    RoomList: API_BASE_URL + 'liveShow/getRoomList', //获取直播间列表
-
-    IndexTypeList: API_BASE_URL + 'brand/brandTypeList', //店铺类型列表
-    IndexList: API_BASE_URL + 'brand/list', //首页商铺列表
-    IndexUrlNewGoods: API_BASE_URL + 'index/newGoods', //新品首发
-    IndexUrlHotGoods: API_BASE_URL + 'index/hotGoods', //热卖商品
-    IndexUrlTopic: API_BASE_URL + 'index/topic', //专题精选
-    IndexUrlBrand: API_BASE_URL + 'index/brand', //品牌制造商
-    IndexUrlCategory: API_BASE_URL + 'index/category', //首页底部的分类及商品列表
-    IndexUrlBanner: API_BASE_URL + 'index/banner', //首页banner
-    IndexUrlChannel: API_BASE_URL + 'index/channel', //banner下的分类
-    CatalogList: API_BASE_URL + 'catalog/index',  //分类目录全部分类数据接口
-    CatalogCurrent: API_BASE_URL + 'catalog/current',  //分类目录当前分类数据接口
-
-    AuthLoginByWeixin: API_BASE_URL + 'auth/login_by_weixin', //微信登录
-    decryptedPhoneNum: API_BASE_URL + 'auth/decryptedPhoneNum', //获取微信手机号
-
-    SueneCategory: API_BASE_URL + 'goods/getCategoryByScene',  //获得分类数据
-    
-    GoodsNumCount: API_BASE_URL + 'goods/goodsNumOfBrand',  //统计商品总数
-    GoodsCount: API_BASE_URL + 'goods/count',  //统计商品总数
-    GoodsList: API_BASE_URL + 'goods/list',  //获得商品列表
-    GoodsCategory: API_BASE_URL + 'goods/category',  //获得分类数据
-    GoodsDetail: API_BASE_URL + 'goods/detail',  //获得商品的详情
-    GoodsHot: API_BASE_URL + 'goods/hot',  //人气推荐
-    GoodsRelated: API_BASE_URL + 'goods/related',  //商品详情页的关联商品(大家都在看)
-
-    CoupuonInfo: API_BASE_URL + 'coupon/getCouponById', //获取优惠券详情
-    BrandCouponList: API_BASE_URL + 'coupon/getListByBrand', //获取商家的优惠券
-    UNBrandCouponList: API_BASE_URL + 'coupon/getListUnAuth', //未登录获取商家的优惠券
-    CouponUsedList: API_BASE_URL + 'coupon/list',  //优惠券可使用列表
-    CouponNoUsedList: API_BASE_URL + 'coupon/getInvalidCoupons',  //优惠券不可使用列表
-    CouponExchange: API_BASE_URL +  'coupon/exchange', //领取优惠券
-    // GoodsList: API_BASE_URL + 'goods/list',  //获得商品列表
-    // GoodsCategory: API_BASE_URL + 'goods/category',  //获得分类数据
-    // GoodsDetail: API_BASE_URL + 'goods/detail',  //获得商品的详情
-    // GoodsHot: API_BASE_URL + 'goods/hot',  //人气推荐
-    // GoodsRelated: API_BASE_URL + 'goods/related',  //商品详情页的关联商品(大家都在看)
-
-    BrandList: API_BASE_URL + 'brand/list',  //品牌列表
-    BrandDetail: API_BASE_URL + 'brand/detail',  //品牌详情
-    BrandDetailByScene: API_BASE_URL + 'brand/getByScene',  //品牌详情
-
-    CartList: API_BASE_URL + 'cart/index', //获取购物车的数据
-    CartAdd: API_BASE_URL + 'cart/add', // 添加商品到购物车
-    BuyAdd: API_BASE_URL + 'buy/add', // 直接购买    
-    CartUpdate: API_BASE_URL + 'cart/update', // 更新购物车的商品
-    CartDelete: API_BASE_URL + 'cart/delete', // 删除购物车的商品
-    CartChecked: API_BASE_URL + 'cart/checked', // 选择或取消选择商品
-    CartGoodsCount: API_BASE_URL + 'cart/goodscount', // 获取购物车商品件数
-    CartCheckout: API_BASE_URL + 'cart/checkout', // 下单前信息确认
-
-    OrderCount: API_BASE_URL + 'order/index', // 获取订单数量
-    OrderSubmit: API_BASE_URL + 'order/submit', // 提交订单
-    PayPrepayId: API_BASE_URL + 'pay/prepay', //获取微信统一下单prepay_id
-
-    CollectList: API_BASE_URL + 'collect/list',  //收藏列表
-    CollectAddOrDelete: API_BASE_URL + 'collect/addordelete',  //添加或取消收藏
-
-    CommentList: API_BASE_URL + 'comment/list',  //评论列表
-    CommentCount: API_BASE_URL + 'comment/count',  //评论总数
-    CommentPost: API_BASE_URL + 'comment/post',   //发表评论
-
-    TopicList: API_BASE_URL + 'topic/list',  //专题列表
-    TopicDetail: API_BASE_URL + 'topic/detail',  //专题详情
-    TopicRelated: API_BASE_URL + 'topic/related',  //相关专题
-
-    SearchIndex: API_BASE_URL + 'search/index',  //搜索页面数据
-    SearchHelper: API_BASE_URL + 'search/helper',  //搜索帮助
-    SearchClearHistory: API_BASE_URL + 'search/clearhistory',  //搜索帮助
-
-    AddressList: API_BASE_URL + 'address/list',  //收货地址列表
-    AddressDetail: API_BASE_URL + 'address/detail',  //收货地址详情
-    AddressSave: API_BASE_URL + 'address/save',  //保存收货地址
-    AddressDelete: API_BASE_URL + 'address/delete',  //删除收货地址
-
-    RegionList: API_BASE_URL + 'region/list',  //获取区域列表
-
-    OrderList: API_BASE_URL + 'order/list',  //订单列表
-    OrderDetail: API_BASE_URL + 'order/detail',  //订单详情
-    OrderCancel: API_BASE_URL + 'order/cancelOrder',  //取消订单
-    OrderConfirm: API_BASE_URL + 'order/confirmOrder',  //确认收货
-
-    FootprintList: API_BASE_URL + 'footprint/list',  //足迹列表
-    FootprintDelete: API_BASE_URL + 'footprint/delete',  //删除足迹
-
-    HomeBanner: API_BASE_URL + 'slideShow/getSlideList', //首页轮播
-    UploadFile: API_BASE_URL + 'upload/upload', //上传文件
-    UserInfo: API_BASE_URL + 'user/getUerInfo', //获取用户信息
-    UpdateUserInfo: API_BASE_URL + 'user/updateUerInfo', //修改用户信息
-    FeedbackAdd: API_BASE_URL + 'feedback/save', //添加反馈
-    SmsCode: API_BASE_URL + 'user/smscode', //发送短信
-    BindMobile: API_BASE_URL + 'user/bindMobile', //绑定手机
-    Login: API_BASE_URL + 'auth/login', //账号登录
-    Register: API_BASE_URL + 'auth/register', //注册
-    CouponList: API_BASE_URL + 'coupon/list', // 优惠券列表
-    GoodsCouponList: API_BASE_URL + 'coupon/listByGoods', // 商品优惠券列表   
-    OrderQuery: API_BASE_URL + 'pay/query',//微信查询订单状态
-
-    HelpTypeList: API_BASE_URL + 'helpissue/typeList', //查看帮助类型列表
-    HelpIssueList: API_BASE_URL + 'helpissue/issueList', //查看问题列表
-
-    LogisticsDetail: API_BASE_URL + 'logistics/detail', //查看物流详情
-
-    // 统计相关
-    SceneReport: API_BASE_URL + '../app/census/getSceneCensus',
-    GetAdminBrands: API_BASE_URL + 'user/getAdminBrands',
-    AddTalkCount: API_BASE_URL + '../app/census/addGoodsQueryNum',
-    AddGoodsViewCount: API_BASE_URL + 'goods/logDetail',
- 
-
-    //统计商家访问次数
-    increaseViewCount: API_BASE_URL + 'brand/increaseViewCount',
-    
-    //获取小程序码
-    generateMicroAppCode: API_BASE_URL + 'wechat/generateMicroAppCode'
-};
+  API_BASE_URL,
+  RoomList: API_BASE_URL + 'liveShow/getRoomList', //获取直播间列表
+
+  IndexTypeList: API_BASE_URL + 'brand/brandTypeList', //店铺类型列表
+  IndexList: API_BASE_URL + 'brand/list', //首页商铺列表
+  IndexUrlNewGoods: API_BASE_URL + 'index/newGoods', //新品首发
+  IndexUrlHotGoods: API_BASE_URL + 'index/hotGoods', //热卖商品
+  IndexUrlTopic: API_BASE_URL + 'index/topic', //专题精选
+  IndexUrlBrand: API_BASE_URL + 'index/brand', //品牌制造商
+  IndexUrlCategory: API_BASE_URL + 'index/category', //首页底部的分类及商品列表
+  IndexUrlBanner: API_BASE_URL + 'index/banner', //首页banner
+  IndexUrlChannel: API_BASE_URL + 'index/channel', //banner下的分类
+  CatalogList: API_BASE_URL + 'catalog/index', //分类目录全部分类数据接口
+  CatalogCurrent: API_BASE_URL + 'catalog/current', //分类目录当前分类数据接口
+
+  AuthLoginByWeixin: API_BASE_URL + 'auth/login_by_weixin', //微信登录
+  decryptedPhoneNum: API_BASE_URL + 'auth/decryptedPhoneNum', //获取微信手机号
+
+  SueneCategory: API_BASE_URL + 'goods/getCategoryByScene', //获得分类数据
+
+  GoodsNumCount: API_BASE_URL + 'goods/goodsNumOfBrand', //统计商品总数
+  GoodsCount: API_BASE_URL + 'goods/count', //统计商品总数
+  GoodsList: API_BASE_URL + 'goods/list', //获得商品列表
+  GoodsCategory: API_BASE_URL + 'goods/category', //获得分类数据
+  GoodsDetail: API_BASE_URL + 'goods/detail', //获得商品的详情
+  GoodsHot: API_BASE_URL + 'goods/hot', //人气推荐
+  GoodsRelated: API_BASE_URL + 'goods/related', //商品详情页的关联商品(大家都在看)
+
+  CoupuonInfo: API_BASE_URL + 'coupon/getCouponById', //获取优惠券详情
+  BrandCouponList: API_BASE_URL + 'coupon/getListByBrand', //获取商家的优惠券
+  UNBrandCouponList: API_BASE_URL + 'coupon/getListUnAuth', //未登录获取商家的优惠券
+  CouponUsedList: API_BASE_URL + 'coupon/list', //优惠券可使用列表
+  CouponNoUsedList: API_BASE_URL + 'coupon/getInvalidCoupons', //优惠券不可使用列表
+  CouponExchange: API_BASE_URL + 'coupon/exchange', //领取优惠券
+  // GoodsList: API_BASE_URL + 'goods/list',  //获得商品列表
+  // GoodsCategory: API_BASE_URL + 'goods/category',  //获得分类数据
+  // GoodsDetail: API_BASE_URL + 'goods/detail',  //获得商品的详情
+  // GoodsHot: API_BASE_URL + 'goods/hot',  //人气推荐
+  // GoodsRelated: API_BASE_URL + 'goods/related',  //商品详情页的关联商品(大家都在看)
+
+  BrandList: API_BASE_URL + 'brand/list', //品牌列表
+  BrandDetail: API_BASE_URL + 'brand/detail', //品牌详情
+  BrandDetailByScene: API_BASE_URL + 'brand/getByScene', //品牌详情
+
+  CartList: API_BASE_URL + 'cart/index', //获取购物车的数据
+  CartAdd: API_BASE_URL + 'cart/add', // 添加商品到购物车
+  BuyAdd: API_BASE_URL + 'buy/add', // 直接购买    
+  CartUpdate: API_BASE_URL + 'cart/update', // 更新购物车的商品
+  CartDelete: API_BASE_URL + 'cart/delete', // 删除购物车的商品
+  CartChecked: API_BASE_URL + 'cart/checked', // 选择或取消选择商品
+  CartGoodsCount: API_BASE_URL + 'cart/goodscount', // 获取购物车商品件数
+  CartCheckout: API_BASE_URL + 'cart/checkout', // 下单前信息确认
+
+  OrderCount: API_BASE_URL + 'order/index', // 获取订单数量
+  OrderSubmit: API_BASE_URL + 'order/submit', // 提交订单
+  PayPrepayId: API_BASE_URL + 'pay/prepay', //获取微信统一下单prepay_id
+
+  CollectList: API_BASE_URL + 'collect/list', //收藏列表
+  CollectAddOrDelete: API_BASE_URL + 'collect/addordelete', //添加或取消收藏
+
+  CommentList: API_BASE_URL + 'comment/list', //评论列表
+  CommentCount: API_BASE_URL + 'comment/count', //评论总数
+  CommentPost: API_BASE_URL + 'comment/post', //发表评论
+
+  TopicList: API_BASE_URL + 'topic/list', //专题列表
+  TopicDetail: API_BASE_URL + 'topic/detail', //专题详情
+  TopicRelated: API_BASE_URL + 'topic/related', //相关专题
+
+  SearchIndex: API_BASE_URL + 'search/index', //搜索页面数据
+  SearchHelper: API_BASE_URL + 'search/helper', //搜索帮助
+  SearchClearHistory: API_BASE_URL + 'search/clearhistory', //搜索帮助
+
+  AddressList: API_BASE_URL + 'address/list', //收货地址列表
+  AddressDetail: API_BASE_URL + 'address/detail', //收货地址详情
+  AddressSave: API_BASE_URL + 'address/save', //保存收货地址
+  AddressDelete: API_BASE_URL + 'address/delete', //删除收货地址
+
+  RegionList: API_BASE_URL + 'region/list', //获取区域列表
+
+  OrderList: API_BASE_URL + 'order/list', //订单列表
+  OrderDetail: API_BASE_URL + 'order/detail', //订单详情
+  OrderCancel: API_BASE_URL + 'order/cancelOrder', //取消订单
+  OrderConfirm: API_BASE_URL + 'order/confirmOrder', //确认收货
+
+  FootprintList: API_BASE_URL + 'footprint/list', //足迹列表
+  FootprintDelete: API_BASE_URL + 'footprint/delete', //删除足迹
+
+  HomeBanner: API_BASE_URL + 'slideShow/getSlideList', //首页轮播
+  UploadFile: API_BASE_URL + 'upload/upload', //上传文件
+  UserInfo: API_BASE_URL + 'user/getUerInfo', //获取用户信息
+  UpdateUserInfo: API_BASE_URL + 'user/updateUerInfo', //修改用户信息
+  FeedbackAdd: API_BASE_URL + 'feedback/save', //添加反馈
+  SmsCode: API_BASE_URL + 'user/smscode', //发送短信
+  BindMobile: API_BASE_URL + 'user/bindMobile', //绑定手机
+  Login: API_BASE_URL + 'auth/login', //账号登录
+  Register: API_BASE_URL + 'auth/register', //注册
+  CouponList: API_BASE_URL + 'coupon/list', // 优惠券列表
+  GoodsCouponList: API_BASE_URL + 'coupon/listByGoods', // 商品优惠券列表   
+  OrderQuery: API_BASE_URL + 'pay/query', //微信查询订单状态
+
+  HelpTypeList: API_BASE_URL + 'helpissue/typeList', //查看帮助类型列表
+  HelpIssueList: API_BASE_URL + 'helpissue/issueList', //查看问题列表
+
+  LogisticsDetail: API_BASE_URL + 'logistics/detail', //查看物流详情
+
+  // 统计相关
+  SceneReport: API_BASE_URL + '../app/census/getSceneCensus',
+  GetAdminBrands: API_BASE_URL + 'user/getAdminBrands',
+  AddTalkCount: API_BASE_URL + '../app/census/addGoodsQueryNum',
+  AddGoodsViewCount: API_BASE_URL + 'goods/logDetail',
+
+
+  //统计商家访问次数
+  increaseViewCount: API_BASE_URL + 'brand/increaseViewCount',
+
+  //获取小程序码
+  generateMicroAppCode: API_BASE_URL + 'wechat/generateMicroAppCode',
+
+  // 预设房间管理
+  enterRoom: API_BASE_URL + 'liveRoom/enter',
+  exitRoom: API_BASE_URL + 'liveRoom/exit'
+};

+ 66 - 0
pages/roomManger/roomManger.js

@@ -0,0 +1,66 @@
+// pages/roomManger/roomManger.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
pages/roomManger/roomManger.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 6 - 0
pages/roomManger/roomManger.wxml

@@ -0,0 +1,6 @@
+<!--pages/roomManger/roomManger.wxml-->
+<view>
+
+
+
+</view>

+ 1 - 0
pages/roomManger/roomManger.wxss

@@ -0,0 +1 @@
+/* pages/roomManger/roomManger.wxss */

+ 6 - 0
pages/ucenter/index/index.js

@@ -81,6 +81,12 @@ Page({
             url: '/pages/sence/sence',
             name: '带看',
             type: 32
+          },
+          {
+            icon: 'vr_live@2x',
+            url: '/pages/roomManger/roomManger',
+            name: '我的房间',
+            type: 33
           }
         ],
         relatedGoods: [],

+ 3 - 1
pages/webview/index.js

@@ -113,7 +113,7 @@ Page({
   // },
   async init() {
     let options = this.options
-    console.log(options)
+    console.log('webview-option',options)
 
     let {
       url: base,
@@ -125,6 +125,7 @@ Page({
 
     this.getBrand(options.id, m)
     this.mcode = m
+
     let socketOptions = await this.socketStart({
       sceneId: this.mcode,
       roomId: options.roomId
@@ -237,6 +238,7 @@ Page({
         }
       }
       this.token = wx.getStorageSync('token')
+      
       if (this.socketStop) {
         this.socketStop()
         this.setData({

+ 222 - 256
project.config.json

@@ -1,266 +1,232 @@
 {
-    "description": "项目配置文件。",
-    "setting": {
-        "urlCheck": false,
-        "es6": true,
-        "enhance": true,
-        "postcss": true,
-        "preloadBackgroundData": false,
-        "minified": true,
-        "newFeature": true,
-        "coverView": true,
-        "nodeModules": false,
-        "autoAudits": false,
-        "showShadowRootInWxmlPanel": true,
-        "scopeDataCheck": false,
-        "uglifyFileName": false,
-        "checkInvalidKey": true,
-        "checkSiteMap": true,
-        "uploadWithSourceMap": true,
-        "compileHotReLoad": false,
-        "lazyloadPlaceholderEnable": false,
-        "useMultiFrameRuntime": true,
-        "useApiHook": true,
-        "useApiHostProcess": true,
-        "babelSetting": {
-            "ignore": [],
-            "disablePlugins": [],
-            "outputPath": ""
-        },
-        "useIsolateContext": false,
-        "userConfirmedBundleSwitch": false,
-        "packNpmManually": false,
-        "packNpmRelationList": [],
-        "minifyWXSS": true,
-        "disableUseStrict": false,
-        "minifyWXML": true,
-        "showES6CompileOption": false,
-        "useCompilerPlugins": false,
-        "ignoreUploadUnusedFiles": true
+  "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "setting": {
+    "urlCheck": false,
+    "es6": true,
+    "enhance": true,
+    "postcss": true,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "newFeature": true,
+    "coverView": true,
+    "nodeModules": false,
+    "autoAudits": false,
+    "showShadowRootInWxmlPanel": true,
+    "scopeDataCheck": false,
+    "uglifyFileName": false,
+    "checkInvalidKey": true,
+    "checkSiteMap": true,
+    "uploadWithSourceMap": true,
+    "compileHotReLoad": false,
+    "lazyloadPlaceholderEnable": false,
+    "useMultiFrameRuntime": true,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
     },
-    "compileType": "miniprogram",
-    "libVersion": "2.19.3",
-    "appid": "wx564b12f68f5e4feb",
-    "projectname": "FDshop",
-    "simulatorType": "wechat",
-    "simulatorPluginLibVersion": {},
-    "condition": {
-        "search": {
-            "list": []
+    "useIsolateContext": false,
+    "userConfirmedBundleSwitch": false,
+    "packNpmManually": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true,
+    "disableUseStrict": false,
+    "minifyWXML": true,
+    "showES6CompileOption": false,
+    "useCompilerPlugins": false,
+    "ignoreUploadUnusedFiles": true,
+    "useStaticServer": true
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.19.3",
+  "appid": "wx564b12f68f5e4feb",
+  "projectname": "FDshop",
+  "simulatorType": "wechat",
+  "simulatorPluginLibVersion": {},
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "选择优惠券",
+          "pathName": "pages/shopping/selCoupon/selCoupon",
+          "query": "isBuy=false"
+        },
+        {
+          "name": "订单界面",
+          "pathName": "pages/shopping/checkout/checkout",
+          "query": "isBuy=true"
+        },
+        {
+          "name": "我的优惠券",
+          "pathName": "pages/ucenter/coupon/coupon",
+          "query": "isBuy=true"
+        },
+        {
+          "name": "我的订单",
+          "pathName": "pages/ucenter/order/order",
+          "query": ""
+        },
+        {
+          "name": "pages/goods/goods",
+          "pathName": "pages/goods/goods",
+          "query": "id=1181015",
+          "scene": null
+        },
+        {
+          "name": "pages/ucenter/index/index",
+          "pathName": "pages/ucenter/index/index",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/cart/cart",
+          "pathName": "pages/cart/cart",
+          "query": "id=1181015",
+          "scene": null
+        },
+        {
+          "name": "pages/catalog/catalog",
+          "pathName": "pages/catalog/catalog",
+          "query": "id=1181015",
+          "scene": null
+        },
+        {
+          "name": "pages/category/category",
+          "pathName": "pages/category/category",
+          "query": "id=1036009",
+          "scene": null
+        },
+        {
+          "name": "pages/ucenter/orderDetail/orderDetail",
+          "pathName": "pages/ucenter/orderDetail/orderDetail",
+          "query": "id=142",
+          "scene": null
+        },
+        {
+          "name": "pages/payResult/payResult",
+          "pathName": "pages/payResult/payResult",
+          "query": "status=1",
+          "scene": null
+        },
+        {
+          "name": "pages/cart/cart",
+          "pathName": "pages/cart/cart",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/ucenter/addressAdd/addressAdd",
+          "pathName": "pages/ucenter/addressAdd/addressAdd",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/logistics/index",
+          "pathName": "pages/logistics/index",
+          "query": "no=75326914125277&id=157",
+          "scene": null
+        },
+        {
+          "name": "pages/ucenter/order/order",
+          "pathName": "pages/ucenter/order/order",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/ucenter/feedback/feedback",
+          "pathName": "pages/ucenter/feedback/feedback",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/ucenter/feedback/feedback",
+          "pathName": "pages/ucenter/feedback/feedback",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/shopping/checkout/checkout",
+          "pathName": "pages/shopping/checkout/checkout",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/ucenter/address/address",
+          "pathName": "pages/ucenter/address/address",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/shopping/address/address",
+          "pathName": "pages/shopping/address/address",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/shopping/address/address",
+          "pathName": "pages/shopping/address/address",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/search/search",
+          "pathName": "pages/search/search",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/webview/index",
+          "pathName": "pages/webview/index",
+          "query": "url=gu6HmTLKp",
+          "scene": null
+        },
+        {
+          "name": "pages/auth/btnAuth/btnAuth",
+          "pathName": "pages/auth/btnAuth/btnAuth",
+          "query": "",
+          "scene": null
         },
-        "conversation": {
-            "list": []
+        {
+          "name": "pages/brandDetail/brandDetail",
+          "pathName": "pages/brandDetail/brandDetail",
+          "query": "id=1046017",
+          "scene": null
         },
-        "plugin": {
-            "list": []
+        {
+          "name": "pages/ucenter/orderDetail/orderDetail",
+          "pathName": "pages/ucenter/orderDetail/orderDetail",
+          "query": "id=412",
+          "scene": null
         },
-        "game": {
-            "list": []
+        {
+          "name": "pages/webview/index",
+          "pathName": "pages/webview/index",
+          "query": "",
+          "scene": null
         },
-        "gamePlugin": {
-            "list": []
+        {
+          "name": "dataReport/pages/data-report/data-report",
+          "pathName": "dataReport/pages/data-report/data-report",
+          "query": "",
+          "scene": null
         },
-        "miniprogram": {
-            "list": [
-                {
-                    "id": 0,
-                    "name": "选择优惠券",
-                    "pathName": "pages/shopping/selCoupon/selCoupon",
-                    "query": "isBuy=false"
-                },
-                {
-                    "id": -1,
-                    "name": "订单界面",
-                    "pathName": "pages/shopping/checkout/checkout",
-                    "query": "isBuy=true"
-                },
-                {
-                    "id": -1,
-                    "name": "我的优惠券",
-                    "pathName": "pages/ucenter/coupon/coupon",
-                    "query": "isBuy=true"
-                },
-                {
-                    "id": -1,
-                    "name": "我的订单",
-                    "pathName": "pages/ucenter/order/order",
-                    "query": ""
-                },
-                {
-                    "id": 4,
-                    "name": "pages/goods/goods",
-                    "pathName": "pages/goods/goods",
-                    "query": "id=1181015",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/ucenter/index/index",
-                    "pathName": "pages/ucenter/index/index",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/cart/cart",
-                    "pathName": "pages/cart/cart",
-                    "query": "id=1181015",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/catalog/catalog",
-                    "pathName": "pages/catalog/catalog",
-                    "query": "id=1181015",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/category/category",
-                    "pathName": "pages/category/category",
-                    "query": "id=1036009",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/ucenter/orderDetail/orderDetail",
-                    "pathName": "pages/ucenter/orderDetail/orderDetail",
-                    "query": "id=142",
-                    "scene": null
-                },
-                {
-                    "id": 10,
-                    "name": "pages/payResult/payResult",
-                    "pathName": "pages/payResult/payResult",
-                    "query": "status=1",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/cart/cart",
-                    "pathName": "pages/cart/cart",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": 12,
-                    "name": "pages/ucenter/addressAdd/addressAdd",
-                    "pathName": "pages/ucenter/addressAdd/addressAdd",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/logistics/index",
-                    "pathName": "pages/logistics/index",
-                    "query": "no=75326914125277&id=157",
-                    "scene": null
-                },
-                {
-                    "id": 14,
-                    "name": "pages/ucenter/order/order",
-                    "pathName": "pages/ucenter/order/order",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/ucenter/feedback/feedback",
-                    "pathName": "pages/ucenter/feedback/feedback",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/ucenter/feedback/feedback",
-                    "pathName": "pages/ucenter/feedback/feedback",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/shopping/checkout/checkout",
-                    "pathName": "pages/shopping/checkout/checkout",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/ucenter/address/address",
-                    "pathName": "pages/ucenter/address/address",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/shopping/address/address",
-                    "pathName": "pages/shopping/address/address",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/shopping/address/address",
-                    "pathName": "pages/shopping/address/address",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/search/search",
-                    "pathName": "pages/search/search",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/webview/index",
-                    "pathName": "pages/webview/index",
-                    "query": "url=gu6HmTLKp",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/auth/btnAuth/btnAuth",
-                    "pathName": "pages/auth/btnAuth/btnAuth",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/brandDetail/brandDetail",
-                    "pathName": "pages/brandDetail/brandDetail",
-                    "query": "id=1046017",
-                    "scene": null
-                },
-                {
-                    "id": 25,
-                    "name": "pages/ucenter/orderDetail/orderDetail",
-                    "pathName": "pages/ucenter/orderDetail/orderDetail",
-                    "query": "id=412",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "pages/webview/index",
-                    "pathName": "pages/webview/index",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "dataReport/pages/data-report/data-report",
-                    "pathName": "dataReport/pages/data-report/data-report",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "首页",
-                    "pathName": "pages/index/index",
-                    "scene": null
-                }
-            ]
+        {
+          "name": "首页",
+          "pathName": "pages/index/index",
+          "query": "",
+          "scene": null
         }
+      ]
     }
+  },
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  }
 }

+ 36 - 18
socket.js

@@ -1,4 +1,6 @@
-const { io } = require('./socket.io-v4.msgpack.js');
+const {
+  io
+} = require('./socket.io-v4.msgpack.js');
 var user = require('./services/user.js');
 const api = require('/config/api.js');
 const util = require('/utils/util.js');
@@ -243,8 +245,16 @@ export default {
   },
 
   async getSocketOptions(sceneId, roomId) {
-    let room = roomId || (Number(Date.now().toString().slice(4)) + parseInt((Math.random() * 1000)))
-    // let room = '147852'
+    //TODO
+    console.log('this.options.id', this.options.id)
+
+    // const res = await util.request(api.enterRoom, {
+    //   brandId: this.options.id
+    // })
+    // debugger;
+
+    // let room = roomId || (Number(Date.now().toString().slice(4)) + parseInt((Math.random() * 1000)))
+    let room = '147852'
     let userInfo = await this.getUserInfo()
 
     // console.log('---', userInfo)
@@ -295,6 +305,7 @@ export default {
     }
 
     console.log('小程序参数', options)
+
     let socket = io(remote.socketHost, {
       path: '/fsl-node',
       transport: ['websocket'],
@@ -353,10 +364,11 @@ export default {
         if (this.role !== 'leader') {
           // this.mic()
         }
-
       }
     })
 
+
+
     this.socketSendMessage = (event, obj) => {
       console.error('发送 socket Room', options.roomId, event, obj)
       socket.emit(event, obj)
@@ -399,18 +411,24 @@ export default {
       console.log('on roomClose')
       this.stopCall(data)
     })
+    socket.on('autoReJoin', (data) => {
+      console.log('on autoReJoin')
+      if ('roomId' in data) {
+        options.roomId = Number(data.roomId)
+      }
+
+    })
 
     this.socketStop = () => {
-      socket.close()
-      console.error('断开 并滞空 socket Room', options.roomId)
-      this.setData({
-        socketStatus: 2
-      })
-      socket = null
+      if (socket) {
+        socket.close()
+        console.error('断开 并滞空 socket Room', options.roomId)
+        this.setData({
+          socketStatus: 2
+        })
+        socket = null
+      }
     }
-
-
-
     return options
   },
   getUrlCode(url) {
@@ -506,6 +524,7 @@ export default {
   },
 
   async startCall(data) {
+    console.log('startCall-data', data)
     // if( this.role =='leader'){
     this.setData({
       shareStatus: 1
@@ -633,7 +652,7 @@ export default {
     }, 300)
   },
   async exit() {
-    this.stopCall()
+    // this.stopCall()
     getApp().globalData.rtcParams = []
     getApp().globalData.pusher = ''
     this.socketStop && this.socketStop()
@@ -672,7 +691,6 @@ export default {
 
     let noMute = getApp().globalData.voiceProps.noMute
 
-
     // noMute true 静音
     // enableTalk false 静音
     // if (!!getApp().globalData.voiceProps.force === !!noMute) 
@@ -747,8 +765,8 @@ export default {
    */
   onUnload: function () {
     console.log('on onUnload')
-    this.socketSendMessage('stopCall', {})
-    this.stopCall()
+    // this.socketSendMessage('stopCall', {})
+    // this.stopCall()
     this.socketStop()
     getApp().globalData.pusher = ''
   },
@@ -1018,7 +1036,7 @@ export default {
         brandId: id
       }, 'GET')
       .then(res => {
-        if (res.code === 0) {
+        if (res.errno === 0) {
           this.setData({
             goodsCount: res.data
           })

+ 1 - 0
webview/shop-container/js/main.js

@@ -164,6 +164,7 @@ function updateSocket(options) {
     } else if (data.type === 'newRoom' && data.data && data.data.roomId) {
      
       console.log('新建房间', data.data)
+      debugger
       updateSocket(data.data)
     }
   })