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.

onlineService.vue 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div>
  3. <web-view :src="url"></web-view>
  4. </div>
  5. </template>
  6. <script setup lang='ts'>
  7. import { onShow } from "@dcloudio/uni-app";
  8. import {
  9. getOnLineUrlApi
  10. } from "@/utils/network/api.js";
  11. import {
  12. ref
  13. } from 'vue'
  14. // let url = ref('https://mcs-ynt.hltgz.com/onekey.html?id=c3pnog1pbnr4dq&appName=gzetc144&appChannel=20001')
  15. let url = ref('')
  16. import {getItem} from "@/utils/storage";
  17. import {request} from "@/utils/network/request.js";
  18. import {stringToJson} from "@/utils/network/encryption";
  19. onShow(() => {
  20. console.log("过来了的")
  21. getOnLineUrl()
  22. });
  23. // 在线客服请求
  24. const getOnLineUrl = () => {
  25. const options = {
  26. type: 2,
  27. data: {
  28. "uid":getItem('openId'),//用户唯一标识(微信公众号openid)
  29. "phone":getItem('mobile'),
  30. "chl":"9ZHOUETC"
  31. },
  32. method: "POST",
  33. showLoading: true,
  34. };
  35. console.log("11",{
  36. "uid":getItem('openId'),//用户唯一标识(微信公众号openid)
  37. "phone":getItem('mobile'),
  38. "chl":"9ZHOUETC"
  39. })
  40. request(getOnLineUrlApi, options).then((res) => {
  41. const data = stringToJson(res.bizContent);
  42. url.value=data.data.rd
  43. console.log("在线客服请求", stringToJson(res.bizContent))
  44. })
  45. }
  46. </script>
  47. <style lang='scss' scoped>
  48. </style>