customer_chat.js
1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// packageG/pages/customer_chat/customer_chat.js
var os = getApp().globalData.setting;
var ut = require("../../../utils/util.js");
Page({
  /**
   * 页面的初始数据
   */
  data: {
    chatUrl:'', // 聊天页面地址
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    let goods_id=options.goods_id;
    let type=options.type;
    let user_id=getApp().globalData.user_id;
    if(!user_id){
      ut.m_toast("请先登录")
      setTimeout(()=> {
          getApp().goto("/packageE/pages/togoin/togoin")
      },2000)
      return false;
    }
    let url= os.h5_host+"/mchat/mbchat/index?is_webview=1&goods_id="+goods_id+"&stoid="+os.stoid+"&user_id="+user_id;
    if(type)
      url= os.h5_host+"/mchat/mbchat/index?is_webview=1&card_id="+goods_id+"&stoid="+os.stoid+"&user_id="+user_id;
    console.log("chat"+url);
    this.setData({
      chatUrl:url
    })
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  }
})