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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. getOnLineUrl()
  21. });
  22. // 在线客服请求
  23. const getOnLineUrl = () => {
  24. const options = {
  25. type: 2,
  26. data: {
  27. "uid":getItem('openId'),//用户唯一标识(微信公众号openid)
  28. "phone":getItem('mobile'),
  29. "chl":"9ZHOUETC"
  30. },
  31. method: "POST",
  32. showLoading: true,
  33. };
  34. console.log("11",{
  35. "uid":getItem('openId'),//用户唯一标识(微信公众号openid)
  36. "phone":getItem('mobile'),
  37. "chl":"9ZHOUETC"
  38. })
  39. request(getOnLineUrlApi, options).then((res) => {
  40. const data = stringToJson(res.bizContent);
  41. url.value=data.data.rd
  42. console.log("在线客服请求", stringToJson(res.bizContent))
  43. })
  44. }
  45. </script>
  46. <style lang='scss' scoped>
  47. </style>