index.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // store/index.js
  2. import Vue from 'vue';
  3. import Vuex from 'vuex';
  4. Vue.use(Vuex);
  5. import {
  6. getConfigByKey
  7. } from '@/api/index.js'
  8. export default new Vuex.Store({
  9. state: {
  10. webviewUrl: '',
  11. wsDanmuUrl: 'wss://userappkyt.ylrzcloud.com', // 弹幕评论接口地址
  12. //红包领取规则:
  13. answerType: 1, //红包领取规则 0:完课且最后一分钟(第二次无需最后一分钟), 1:按完课百分比答题领红包
  14. isSpare:1, // 0,主要小程序,1:备选
  15. uploadFile: 'https://userappkyt.ylrzcloud.com',
  16. // imgpath: 'https://hylj-1323137866.cos.ap-chongqing.myqcloud.com',//云联融智图片请求地址
  17. // logoname:'云联融智优选',
  18. // appid:'wxd70f99287830cb51',
  19. // imgpath: 'https://fbylive.obs.cn-southwest-2.myhuaweicloud.com',//福本源图片请求地址
  20. // logoname:'乐氏本源',
  21. // appid:'wxb9b453d37c5fad45',
  22. // imgpath: 'https://zkzh-2025.oss-cn-beijing.aliyuncs.com',//中康未来智慧药房图片请求地址
  23. // //https://zkzh-2025.oss-cn-beijing.aliyuncs.com/shop 中康商城图片链接
  24. // logoname:'中康未来智慧',
  25. // appid:'wxedde588767b358b1',//中康未来智慧药房
  26. // imgpath: 'https://zkzh-2025.oss-cn-beijing.aliyuncs.com',//新中康图片请求地址
  27. // logoname:'中康未来智慧店',
  28. // // appid:'wxd8a19174bfd936fe',//洪恬百货店
  29. // appid:'wx83024d042825b5d4',
  30. // imgpath: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com',//医健宝图片请求地址
  31. // logoname:'医建宝',
  32. // appid:'wx9e61312fe7ac85c4',//福康瑞祥广告传媒
  33. // appid:'wxb20b7f91a35859e5',//欣能开发
  34. // appid:'wx2df3bca30e7dba75',//欣能用品
  35. // appid:'wx664a3b14808e010b',//上雅工具
  36. // imgpath: 'https://whhm-1361716159.cos.ap-chongqing.myqcloud.com',//惠名大药房图片请求地址
  37. // logoname:'惠名大药房',
  38. // appid:'wxc9553ad82d0d61b8'//h5,
  39. // imgpath: 'https://liangmiao.obs.cn-southwest-2.myhuaweicloud.com',//良苗图片请求地址
  40. // logoname:'良苗',
  41. // appid:'wx80dc06697b583cd9',
  42. // imgpath: 'https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com',//倍力优图片请求地址
  43. // logoname:'倍力优',
  44. // appid:'wx301ab2fad04c658a',
  45. // imgpath: 'https://bnkc-1323137866.cos.ap-chongqing.myqcloud.com',//百年康城图片请求地址
  46. // logoname:'百年康成',
  47. // appid:'wx65e5d520e35bf3f5'//,
  48. // imgpath: 'https://drk-1363981074.cos.ap-chongqing.myqcloud.com',//德瑞康图片请求地址
  49. // logoname:'青岛市德瑞康',
  50. // appid:'wx29d26f63f836be7f',
  51. // imgpath: 'https://bjczwh.oss-cn-beijing.aliyuncs.com',//北京存在文化
  52. // logoname:'食养生活',
  53. // appid:'wx94951f52d3ac5e25',
  54. imgpath: 'https://kuanyitang-1317640934.cos.ap-shanghai.myqcloud.com', //宽益堂
  55. logoname: '宽益堂',
  56. appid: 'wx776911549d9b5545',
  57. // appid:'wx0fee9948ae1f0cb1', // 涵翡阅读社
  58. // appid:'wxe71231197bc54634', // 伴慧阅读社
  59. // appid:'wxf9d43e667e4a80e3', // 梦婵阅读社
  60. // appid:'wxb37b9255f770fd9a', // 雪菲阅读社
  61. // appid:'wx2e637d61b84080c0', // 芮矜阅读社
  62. // imgpath: 'https://hcl-1b2b.obs.cn-south-1.myhuaweicloud.com',//恒春来
  63. // logoname:'恒春来',
  64. // appid:'', //空入尚服装铺
  65. // imgpath: 'https://qdtst-1360717104.cos.ap-nanjing.myqcloud.com', //四季智慧理养
  66. // logoname: '四季智慧理养',
  67. // appid: 'wx4c7d16230312168f',
  68. },
  69. mutations: {
  70. setCount(state, value) {
  71. state.count = value;
  72. },
  73. setUserInfo(state, info) {
  74. state.userInfo = info;
  75. },
  76. setWebviewUrl(state, value) {
  77. state.webviewUrl = value;
  78. },
  79. },
  80. actions: {
  81. fetchUser({commit}) {
  82. // const res = await uni.request({ url: '/api/user' });
  83. commit('setUserInfo', 'noe');
  84. },
  85. getWebviewUrl({commit}) {
  86. var that = this;
  87. var data = {
  88. key: 'course.config'
  89. }
  90. return new Promise((resolve, reject) => {
  91. getConfigByKey(data).then(res => {
  92. if (res.code == 200) {
  93. console.log("getConfigByKey====", JSON.parse(res.data))
  94. let data = JSON.parse(res.data)
  95. commit('setWebviewUrl', data.userCourseAuthDomain);
  96. resolve()
  97. }
  98. }).catch(error => {
  99. reject(error)
  100. });
  101. })
  102. }
  103. }
  104. });