Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

onlineService.vue 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. request(getOnLineUrlApi, options).then((res) => {
  35. const data = stringToJson(res.bizContent);
  36. url.value=data.data.rd
  37. console.log("在线客服请求", stringToJson(res.bizContent))
  38. })
  39. }
  40. </script>
  41. <style lang='scss' scoped>
  42. </style>