network.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <oa-scroll
  3. customClass="doorSettingSystem-container scroll-height"
  4. :customStyle="{
  5. //#ifdef APP-PLUS || MP-WEIXIN
  6. height: `calc(100vh - (0px))`,
  7. //#endif
  8. //#ifdef H5
  9. height: `calc(100vh - (0px))`,
  10. //#endif
  11. }"
  12. :refresherLoad="false"
  13. :refresherEnabled="false"
  14. :refresherDefaultStyle="'none'"
  15. :refresherBackground="'#f5f6f7'"
  16. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  17. >
  18. <template #default>
  19. <text class="iconfont oaIcon-left" @click="handleExit()"></text>
  20. <u-cell-group>
  21. <!-- #ifdef APP-PLUS -->
  22. <u-cell title="网络设置" :value="1">
  23. <template #value>
  24. <view class="u-cell__value" @click="proxy.$settingStore.openSystemNetwork()">点击设置</view>
  25. <u-icon class="iconfont" name="arrow-right"></u-icon>
  26. </template>
  27. </u-cell>
  28. <u-cell title="IP地址" :value="ipAddress || '-'"></u-cell>
  29. <!-- #endif -->
  30. </u-cell-group>
  31. </template>
  32. </oa-scroll>
  33. <oa-upgrade ref="oaUpgradeRef" :themesColor="proxy.$settingStore.themeColor.color" />
  34. </template>
  35. <script setup>
  36. /*----------------------------------依赖引入-----------------------------------*/
  37. import { onLoad, onShow } from "@dcloudio/uni-app";
  38. import { reactive, getCurrentInstance, toRefs } from "vue";
  39. /*----------------------------------接口引入-----------------------------------*/
  40. /*----------------------------------组件引入-----------------------------------*/
  41. /*----------------------------------store引入-----------------------------------*/
  42. /*----------------------------------公共方法引入-----------------------------------*/
  43. const { proxy } = getCurrentInstance();
  44. /*----------------------------------公共变量-----------------------------------*/
  45. const state = reactive({
  46. ipAddress: "",
  47. });
  48. const { ipAddress } = toRefs(state);
  49. function refreshIpAddress() {
  50. proxy.$sys.getIpAddress({
  51. success: (res) => {
  52. state.ipAddress = res;
  53. },
  54. error: () => {
  55. state.ipAddress = "";
  56. },
  57. });
  58. }
  59. function handleExit() {
  60. proxy.$tab.navigateBack(1);
  61. }
  62. onLoad(() => {
  63. refreshIpAddress();
  64. });
  65. onShow(() => {
  66. refreshIpAddress();
  67. });
  68. </script>
  69. <style lang="scss" scoped>
  70. @import "../index.scss";
  71. </style>