多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.6 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. const NET = require('@/utils/request')
  2. const API = require('@/config/api')
  3. import { funMixin } from '../../config/mixin'
  4. export const commonMixin = {
  5. mixins: [funMixin],
  6. data() {
  7. return {
  8. appid: 'wx2b03c6e691cd7370',
  9. roomId: [], // 填写具体的房间号
  10. roomList: [],
  11. page: {
  12. page: 1,
  13. pageSize: 6,
  14. },
  15. }
  16. },
  17. props: {
  18. terminal: {
  19. type: Number,
  20. default: 4,
  21. },
  22. typeId: {
  23. type: Number,
  24. default: 1,
  25. },
  26. shopId: {
  27. type: Number,
  28. default: 0,
  29. },
  30. componentContent: {
  31. type: Object,
  32. },
  33. },
  34. created() {
  35. this.getLiveRooms()
  36. },
  37. methods: {
  38. // 获取直播间列表
  39. getLiveRooms() {
  40. NET.request(API.LiveRoomes, this.page, 'get').then((res) => {
  41. this.roomList = res.data.list
  42. })
  43. },
  44. toLiveRoom(item) {
  45. this.roomId.push(item.roomid)
  46. if (!this.appid || !this.roomId.length) {
  47. return
  48. }
  49. // 路由参数
  50. let customParams = encodeURIComponent(
  51. JSON.stringify({ path: 'livePage/index', pid: 1 })
  52. )
  53. // let customParams
  54. // 开发者在直播间页面路径上携带自定义参数(如示例中的path和pid参数),后续可以在分享卡片链接和跳转至商详页时获取,详见【获取自定义参数】、【直播间到商详页面携带参数】章节(上限600个字符,超过部分会被截断)
  55. // #ifdef MP-WEIXIN
  56. // wx.navigateTo({
  57. // url: `plugin-private://${this.appid}/pages/live-player-plugin?room_id=${this.roomId}&custom_params=${customParams}`,
  58. // })
  59. // #endif
  60. },
  61. },
  62. }