oxy-uni-ui 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/abstracts/variable.scss +13 -2
  3. package/components/oxy-checkbox/index.scss +37 -2
  4. package/components/oxy-sort-button/index.scss +3 -4
  5. package/components/oxy-tag/index.scss +157 -17
  6. package/components/oxy-tag/oxy-tag.vue +14 -2
  7. package/components/oxy-tag/types.ts +9 -0
  8. package/dev-tools.ts +2 -0
  9. package/devTools/components/DevToolsOverlay.vue +56 -0
  10. package/devTools/components/DevToolsUiHost.vue +589 -0
  11. package/devTools/config.js +55 -0
  12. package/devTools/core/components/mpDevBubble.vue +174 -0
  13. package/devTools/core/libs/createH5Bubble.js +156 -0
  14. package/devTools/core/libs/devCache.js +151 -0
  15. package/devTools/core/libs/devOptions.js +163 -0
  16. package/devTools/core/libs/devUi.js +219 -0
  17. package/devTools/core/libs/drawView.js +140 -0
  18. package/devTools/core/libs/errorReport.js +64 -0
  19. package/devTools/core/libs/jsonCompress.js +334 -0
  20. package/devTools/core/libs/logReport.js +59 -0
  21. package/devTools/core/libs/pageLinkList.js +125 -0
  22. package/devTools/core/libs/timeFormat.js +94 -0
  23. package/devTools/core/proxy/console.js +430 -0
  24. package/devTools/core/proxy/index.js +36 -0
  25. package/devTools/core/proxy/request.js +495 -0
  26. package/devTools/core/proxy/storage.js +113 -0
  27. package/devTools/core/proxy/uniBus.js +153 -0
  28. package/devTools/core/proxy/uniListen.js +192 -0
  29. package/devTools/core/proxy/vueMixin.js +120 -0
  30. package/devTools/index.js +168 -0
  31. package/devTools/page/components/bottomTools.vue +1046 -0
  32. package/devTools/page/components/dialog/addStorage.vue +204 -0
  33. package/devTools/page/components/dialog/createDir.vue +366 -0
  34. package/devTools/page/components/dialog/editDialog.vue +192 -0
  35. package/devTools/page/components/dialog/routeDialog.vue +184 -0
  36. package/devTools/page/components/dialog/sendRequest.vue +603 -0
  37. package/devTools/page/components/dialog/textFileEditDialog.vue +391 -0
  38. package/devTools/page/components/libs/appDelDir.js +86 -0
  39. package/devTools/page/components/libs/dirReader.js +248 -0
  40. package/devTools/page/components/libs/fileSize.js +15 -0
  41. package/devTools/page/components/libs/getRuntimeInfo.js +134 -0
  42. package/devTools/page/components/listItem/consoleItem.vue +314 -0
  43. package/devTools/page/components/listItem/errorItem.vue +292 -0
  44. package/devTools/page/components/listItem/fileSysItem.vue +533 -0
  45. package/devTools/page/components/listItem/infoList.vue +100 -0
  46. package/devTools/page/components/listItem/jsRunnerItem.vue +255 -0
  47. package/devTools/page/components/listItem/logItem.vue +193 -0
  48. package/devTools/page/components/listItem/networkItem.vue +398 -0
  49. package/devTools/page/components/listItem/objectAnalysis.vue +651 -0
  50. package/devTools/page/components/listItem/pages.vue +319 -0
  51. package/devTools/page/components/listItem/routeItem.vue +153 -0
  52. package/devTools/page/components/listItem/setting.vue +734 -0
  53. package/devTools/page/components/listItem/storageList.vue +681 -0
  54. package/devTools/page/components/listItem/tools.vue +315 -0
  55. package/devTools/page/components/listItem/vuexList.vue +599 -0
  56. package/devTools/page/components/main.vue +1867 -0
  57. package/devTools/page/components/mixins/animationControl.js +91 -0
  58. package/devTools/page/components/mixins/mp.js +83 -0
  59. package/devTools/page/components/ui/btnTabs.vue +90 -0
  60. package/devTools/page/components/ui/codeHisPicker.vue +172 -0
  61. package/devTools/page/components/ui/h5Cell.vue +13 -0
  62. package/devTools/page/components/ui/menuBtn.vue +94 -0
  63. package/devTools/page/components/ui/mobileSwiperScroll.vue +74 -0
  64. package/devTools/page/components/ui/requestSpeedLimit.vue +52 -0
  65. package/devTools/page/components/ui/requestTimeoutMock.vue +55 -0
  66. package/devTools/page/components/ui/subTitleBar.vue +101 -0
  67. package/devTools/page/static/copy.png +0 -0
  68. package/devTools/page/static/delete.png +0 -0
  69. package/devTools/page/static/fileSys/AI.png +0 -0
  70. package/devTools/page/static/fileSys/DWG.png +0 -0
  71. package/devTools/page/static/fileSys/EXE.png +0 -0
  72. package/devTools/page/static/fileSys/GIF.png +0 -0
  73. package/devTools/page/static/fileSys/HTML.png +0 -0
  74. package/devTools/page/static/fileSys/PSD.png +0 -0
  75. package/devTools/page/static/fileSys/RVT.png +0 -0
  76. package/devTools/page/static/fileSys/SKP.png +0 -0
  77. package/devTools/page/static/fileSys/SVG.png +0 -0
  78. package/devTools/page/static/fileSys/excel.png +0 -0
  79. package/devTools/page/static/fileSys/pdf.png +0 -0
  80. package/devTools/page/static/fileSys/pptl.png +0 -0
  81. package/devTools/page/static/fileSys/shipin.png +0 -0
  82. package/devTools/page/static/fileSys/tupian.png +0 -0
  83. package/devTools/page/static/fileSys/txt.png +0 -0
  84. package/devTools/page/static/fileSys/weizhiwenjian.png +0 -0
  85. package/devTools/page/static/fileSys/wenjianjia.png +0 -0
  86. package/devTools/page/static/fileSys/word.png +0 -0
  87. package/devTools/page/static/fileSys/yasuo.png +0 -0
  88. package/devTools/page/static/fileSys/yinpin.png +0 -0
  89. package/devTools/page/static/fold.png +0 -0
  90. package/devTools/page/static/menu.png +0 -0
  91. package/devTools/page/static/refresh.png +0 -0
  92. package/devTools/page/static/unfold.png +0 -0
  93. package/devTools/tools.vue +25 -0
  94. package/devTools/type/devTools.d.ts +406 -0
  95. package/oxy-dev-tools/components/DevToolsUiHost.vue +555 -0
  96. package/oxy-dev-tools/config.js +61 -0
  97. package/oxy-dev-tools/core/components/mpDevBubble.vue +176 -0
  98. package/oxy-dev-tools/core/libs/createH5Bubble.js +156 -0
  99. package/oxy-dev-tools/core/libs/devCache.js +149 -0
  100. package/oxy-dev-tools/core/libs/devOptions.js +160 -0
  101. package/oxy-dev-tools/core/libs/devUi.js +219 -0
  102. package/oxy-dev-tools/core/libs/drawView.js +144 -0
  103. package/oxy-dev-tools/core/libs/errorReport.js +60 -0
  104. package/oxy-dev-tools/core/libs/jsonCompress.js +328 -0
  105. package/oxy-dev-tools/core/libs/logReport.js +55 -0
  106. package/oxy-dev-tools/core/libs/pageLinkList.js +121 -0
  107. package/oxy-dev-tools/core/libs/timeFormat.js +93 -0
  108. package/oxy-dev-tools/core/proxy/console.js +398 -0
  109. package/oxy-dev-tools/core/proxy/index.js +33 -0
  110. package/oxy-dev-tools/core/proxy/request.js +473 -0
  111. package/oxy-dev-tools/core/proxy/storage.js +96 -0
  112. package/oxy-dev-tools/core/proxy/uniBus.js +148 -0
  113. package/oxy-dev-tools/core/proxy/uniListen.js +190 -0
  114. package/oxy-dev-tools/core/proxy/vueMixin.js +115 -0
  115. package/oxy-dev-tools/index.ts +183 -0
  116. package/oxy-dev-tools/oxy-dev-tools.vue +62 -0
  117. package/oxy-dev-tools/page/components/bottomTools.vue +933 -0
  118. package/oxy-dev-tools/page/components/dialog/addStorage.vue +184 -0
  119. package/oxy-dev-tools/page/components/dialog/createDir.vue +352 -0
  120. package/oxy-dev-tools/page/components/dialog/editDialog.vue +178 -0
  121. package/oxy-dev-tools/page/components/dialog/routeDialog.vue +170 -0
  122. package/oxy-dev-tools/page/components/dialog/sendRequest.vue +530 -0
  123. package/oxy-dev-tools/page/components/dialog/textFileEditDialog.vue +379 -0
  124. package/oxy-dev-tools/page/components/libs/appDelDir.js +77 -0
  125. package/oxy-dev-tools/page/components/libs/dirReader.js +239 -0
  126. package/oxy-dev-tools/page/components/libs/fileSize.js +15 -0
  127. package/oxy-dev-tools/page/components/libs/getRuntimeInfo.js +132 -0
  128. package/oxy-dev-tools/page/components/listItem/consoleItem.vue +292 -0
  129. package/oxy-dev-tools/page/components/listItem/errorItem.vue +268 -0
  130. package/oxy-dev-tools/page/components/listItem/fileSysItem.vue +511 -0
  131. package/oxy-dev-tools/page/components/listItem/infoList.vue +89 -0
  132. package/oxy-dev-tools/page/components/listItem/jsRunnerItem.vue +236 -0
  133. package/oxy-dev-tools/page/components/listItem/logItem.vue +185 -0
  134. package/oxy-dev-tools/page/components/listItem/networkItem.vue +362 -0
  135. package/oxy-dev-tools/page/components/listItem/objectAnalysis.vue +642 -0
  136. package/oxy-dev-tools/page/components/listItem/pages.vue +285 -0
  137. package/oxy-dev-tools/page/components/listItem/routeItem.vue +140 -0
  138. package/oxy-dev-tools/page/components/listItem/setting.vue +687 -0
  139. package/oxy-dev-tools/page/components/listItem/storageList.vue +623 -0
  140. package/oxy-dev-tools/page/components/listItem/tools.vue +273 -0
  141. package/oxy-dev-tools/page/components/listItem/vuexList.vue +559 -0
  142. package/oxy-dev-tools/page/components/main.vue +1824 -0
  143. package/oxy-dev-tools/page/components/mixins/animationControl.js +80 -0
  144. package/oxy-dev-tools/page/components/mixins/mp.js +76 -0
  145. package/oxy-dev-tools/page/components/ui/btnTabs.vue +77 -0
  146. package/oxy-dev-tools/page/components/ui/codeHisPicker.vue +161 -0
  147. package/oxy-dev-tools/page/components/ui/h5Cell.vue +13 -0
  148. package/oxy-dev-tools/page/components/ui/menuBtn.vue +87 -0
  149. package/oxy-dev-tools/page/components/ui/mobileSwiperScroll.vue +71 -0
  150. package/oxy-dev-tools/page/components/ui/requestSpeedLimit.vue +47 -0
  151. package/oxy-dev-tools/page/components/ui/requestTimeoutMock.vue +50 -0
  152. package/oxy-dev-tools/page/components/ui/subTitleBar.vue +87 -0
  153. package/oxy-dev-tools/page/static/copy.png +0 -0
  154. package/oxy-dev-tools/page/static/delete.png +0 -0
  155. package/oxy-dev-tools/page/static/fileSys/AI.png +0 -0
  156. package/oxy-dev-tools/page/static/fileSys/DWG.png +0 -0
  157. package/oxy-dev-tools/page/static/fileSys/EXE.png +0 -0
  158. package/oxy-dev-tools/page/static/fileSys/GIF.png +0 -0
  159. package/oxy-dev-tools/page/static/fileSys/HTML.png +0 -0
  160. package/oxy-dev-tools/page/static/fileSys/PSD.png +0 -0
  161. package/oxy-dev-tools/page/static/fileSys/RVT.png +0 -0
  162. package/oxy-dev-tools/page/static/fileSys/SKP.png +0 -0
  163. package/oxy-dev-tools/page/static/fileSys/SVG.png +0 -0
  164. package/oxy-dev-tools/page/static/fileSys/excel.png +0 -0
  165. package/oxy-dev-tools/page/static/fileSys/pdf.png +0 -0
  166. package/oxy-dev-tools/page/static/fileSys/pptl.png +0 -0
  167. package/oxy-dev-tools/page/static/fileSys/shipin.png +0 -0
  168. package/oxy-dev-tools/page/static/fileSys/tupian.png +0 -0
  169. package/oxy-dev-tools/page/static/fileSys/txt.png +0 -0
  170. package/oxy-dev-tools/page/static/fileSys/weizhiwenjian.png +0 -0
  171. package/oxy-dev-tools/page/static/fileSys/wenjianjia.png +0 -0
  172. package/oxy-dev-tools/page/static/fileSys/word.png +0 -0
  173. package/oxy-dev-tools/page/static/fileSys/yasuo.png +0 -0
  174. package/oxy-dev-tools/page/static/fileSys/yinpin.png +0 -0
  175. package/oxy-dev-tools/page/static/fold.png +0 -0
  176. package/oxy-dev-tools/page/static/menu.png +0 -0
  177. package/oxy-dev-tools/page/static/refresh.png +0 -0
  178. package/oxy-dev-tools/page/static/unfold.png +0 -0
  179. package/oxy-dev-tools/tools.vue +22 -0
  180. package/oxy-dev-tools/type/devTools.d.ts +406 -0
  181. package/package.json +1 -1
  182. package/tags.json +1 -1
  183. package/web-types.json +1 -1
@@ -0,0 +1,91 @@
1
+ // #ifdef APP-PLUS
2
+ const animation = weex.requireModule('animation')
3
+ // #endif
4
+ export default {
5
+ methods: {
6
+ /**
7
+ * 显示面板
8
+ */
9
+ panelShow() {
10
+ let that = this;
11
+
12
+ let sys = uni.getSystemInfoSync();
13
+
14
+ animation.transition(
15
+ that.$refs.mask,
16
+ {
17
+ styles: {
18
+ opacity: 1,
19
+ height: sys.windowHeight + 'px'
20
+ },
21
+ duration: 200, //ms
22
+ timingFunction: 'linear',
23
+ delay: 0 //ms
24
+ }
25
+ )
26
+
27
+ let height = Math.ceil(sys.windowHeight * 0.8);
28
+
29
+ animation.transition(
30
+ that.$refs.panel,
31
+ {
32
+ styles: {
33
+ opacity: 1,
34
+ transform: `transform: translate(0px,${height}px)`
35
+ },
36
+ duration: 1, //ms
37
+ timingFunction: 'linear',
38
+ delay: 0 //ms
39
+ },
40
+ (res) => {
41
+
42
+ animation.transition(
43
+ that.$refs.panel,
44
+ {
45
+ styles: {
46
+ transform: `transform: translate(0px,0px)`
47
+ },
48
+ duration: 200, //ms
49
+ timingFunction: 'linear',
50
+ delay: 0 //ms
51
+ }
52
+ )
53
+
54
+ }
55
+ )
56
+ },
57
+ /**
58
+ * 关闭面板
59
+ */
60
+ panelHide() {
61
+ let that = this;
62
+
63
+ animation.transition(
64
+ that.$refs.mask,
65
+ {
66
+ styles: {
67
+ opacity: 0,
68
+ },
69
+ duration: 200, //ms
70
+ timingFunction: 'linear',
71
+ delay: 0 //ms
72
+ }
73
+ )
74
+ let height = uni.upx2px(1000);
75
+ animation.transition(
76
+ that.$refs.panel,
77
+ {
78
+ styles: {
79
+ transform: `transform: translate(0px,${height}px)`
80
+ },
81
+ duration: 200, //ms
82
+ timingFunction: 'linear',
83
+ delay: 0 //ms
84
+ },
85
+ () => {
86
+ uni.$emit("devTools_panelHideSuccess")
87
+ }
88
+ )
89
+ },
90
+ }
91
+ }
@@ -0,0 +1,83 @@
1
+ export default {
2
+ data() {
3
+ return {
4
+ windowInfo: getWindowInfo(),
5
+ }
6
+ },
7
+ computed: {
8
+ /**
9
+ * 小程序和H5的标题
10
+ */
11
+ navbarStyle() {
12
+ let windowInfo = getWindowInfo();
13
+ return {
14
+ statusBarHeightPx: windowInfo.system.statusBarHeight + 'px',
15
+ navbarHeightPx: windowInfo.navbar.bodyHeightPx + 'px',
16
+ }
17
+ },
18
+ },
19
+ methods: {
20
+ back() {
21
+ uni.$dev.hide()
22
+ }
23
+ }
24
+ }
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+ /**
34
+ * 获取当前窗口数据
35
+ *
36
+ */
37
+ function getWindowInfo() {
38
+ let systemInfo = uni.getSystemInfoSync();
39
+ systemInfo.pixelRatio = Math.round(systemInfo.pixelRatio * 100) / 100;
40
+
41
+ let windowInfo = {
42
+ system: systemInfo,
43
+ capsule: {
44
+ bottom: 78,
45
+ height: 30,
46
+ left: 283,
47
+ right: 363,
48
+ top: 48,
49
+ width: 0,
50
+ },
51
+ navbar: {
52
+ heightPx: uni.upx2px(100) + systemInfo.statusBarHeight,
53
+ bodyHeightPx: uni.upx2px(100),
54
+ bodyWidthPx: systemInfo.windowWidth,
55
+ capsuleWidthPx: 0,
56
+ capsuleRightPx: 0,
57
+ },
58
+
59
+ height: systemInfo.windowHeight * (750 / systemInfo.windowWidth),
60
+ width: 750,
61
+ statusBarHeight: systemInfo.statusBarHeight * (750 / systemInfo.windowWidth),
62
+ safeBottom: systemInfo.windowHeight - systemInfo.safeArea.bottom,
63
+ safeBottomRpx: (systemInfo.windowHeight - systemInfo.safeArea.bottom) * (750 / systemInfo.windowWidth),
64
+ /**
65
+ * 原生端 底部导航栏高度
66
+ */
67
+ footNavbarHeight: uni.upx2px(100) + (systemInfo.windowHeight - systemInfo.safeArea.bottom),
68
+ }
69
+
70
+ // #ifdef MP-QQ || MP-WEIXIN
71
+ let capsuleInfo = uni.getMenuButtonBoundingClientRect();
72
+ windowInfo.capsule = capsuleInfo;
73
+ let capsuleToStatusBarPx = capsuleInfo.top - systemInfo.statusBarHeight; //胶囊和状态栏之间的高度
74
+ windowInfo.navbar.bodyHeightPx = capsuleInfo.height + (capsuleToStatusBarPx * 2);
75
+ windowInfo.navbar.heightPx = windowInfo.navbar.bodyHeightPx + systemInfo.statusBarHeight;
76
+ let capsuleWidthPx = (systemInfo.windowWidth - capsuleInfo.right) * 2 + capsuleInfo.width;
77
+ windowInfo.navbar.bodyWidthPx = systemInfo.windowWidth - capsuleWidthPx;
78
+ windowInfo.navbar.capsuleWidthPx = capsuleWidthPx;
79
+ windowInfo.navbar.capsuleRightPx = capsuleWidthPx - (systemInfo.windowWidth - capsuleInfo.right);
80
+ // #endif
81
+
82
+ return windowInfo;
83
+ }
@@ -0,0 +1,90 @@
1
+ <template>
2
+ <view
3
+ class="btnTabs"
4
+ v-if="list.length > 0"
5
+ >
6
+ <block v-for="(item, index) in list" :key="item.title">
7
+ <view
8
+ class="btnTabsItem"
9
+ :class="{ active: index == value }"
10
+ @click="$emit('indexChange', index)"
11
+ >
12
+ <text
13
+ class="tabsText"
14
+ :class="{ active: index == value }"
15
+ >
16
+ {{ item.title }}
17
+ </text>
18
+ </view>
19
+ <view
20
+ v-if="index != list.length - 1"
21
+ class="splitLine"
22
+ ></view>
23
+ </block>
24
+ </view>
25
+ </template>
26
+ <script>
27
+ export default {
28
+ props: {
29
+ /**
30
+ * 按钮列表
31
+ */
32
+ list: {
33
+ type: Array,
34
+ default: () => [],
35
+ },
36
+ /**
37
+ * 当前选中的按钮索引
38
+ */
39
+ value: {
40
+ type: Number,
41
+ default: 0,
42
+ },
43
+ },
44
+ };
45
+ </script>
46
+ <style lang="scss" scoped>
47
+ .btnTabs {
48
+ display: flex;
49
+ flex-direction: row;
50
+ align-items: center;
51
+ border-radius: 14rpx;
52
+ overflow: hidden;
53
+ transform: translateZ(0);
54
+ height: 54rpx;
55
+ border: 1px solid rgba(15, 23, 42, 0.12);
56
+ background: #eef2f7;
57
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
58
+ .btnTabsItem {
59
+ display: flex;
60
+ align-items: center;
61
+ justify-content: center;
62
+ flex-shrink: 0;
63
+ position: relative;
64
+ height: 54rpx;
65
+ padding: 0 16rpx;
66
+ background-color: transparent;
67
+ &.active {
68
+ background-color: #fff;
69
+ }
70
+ &:active {
71
+ opacity: 0.92;
72
+ }
73
+ .tabsText {
74
+ font-size: 24rpx;
75
+ line-height: 54rpx;
76
+ height: 54rpx;
77
+ white-space: nowrap;
78
+ color: #64748b;
79
+ &.active {
80
+ color: #2563eb;
81
+ }
82
+ }
83
+ }
84
+ .splitLine {
85
+ width: 1px;
86
+ height: 30rpx;
87
+ background-color: rgba(15, 23, 42, 0.12);
88
+ }
89
+ }
90
+ </style>
@@ -0,0 +1,172 @@
1
+ <template>
2
+ <view
3
+ class="codeHisPicker"
4
+ v-if="isShow"
5
+ @click="close"
6
+ :style="{
7
+ height: height + 'px',
8
+ }"
9
+ >
10
+ <view
11
+ class="codeList"
12
+ @click.stop
13
+ >
14
+ <view class="head">
15
+ <view class="title">
16
+ <text class="titleText">历史运行代码:</text>
17
+ </view>
18
+ <view class="subTitle">
19
+ <text class="subTitleText">(保留100条运行记录)</text>
20
+ </view>
21
+ </view>
22
+ <scroll-view
23
+ scroll-y
24
+ class="codeScroll"
25
+ >
26
+ <view
27
+ class="hisItem"
28
+ v-for="(item, index) in list"
29
+ :key="index"
30
+ @click="selectedRow(item)"
31
+ >
32
+ <text class="hisItemCode">
33
+ {{ item }}
34
+ </text>
35
+ </view>
36
+ <view style="height: 100rpx"></view>
37
+ </scroll-view>
38
+ </view>
39
+ </view>
40
+ </template>
41
+ <script>
42
+ export default {
43
+ data() {
44
+ return {
45
+ /**
46
+ * 是否展示
47
+ */
48
+ isShow: false,
49
+ /**
50
+ * 筛选的列表
51
+ */
52
+ list: [],
53
+ /**
54
+ * 默认选中的索引
55
+ */
56
+ index: 0,
57
+ /**
58
+ * 选中的回调事件
59
+ */
60
+ callback: null,
61
+ /**
62
+ * 屏幕高度
63
+ */
64
+ height: uni.getSystemInfoSync().screenHeight,
65
+ };
66
+ },
67
+ methods: {
68
+ /**
69
+ * 展示弹窗
70
+ */
71
+ show(list = []) {
72
+ let that = this;
73
+ that.index = 0;
74
+ that.list = list;
75
+ that.isShow = true;
76
+ return new Promise((yes) => {
77
+ that.callback = yes;
78
+ });
79
+ },
80
+ /**
81
+ * 选择改变事件
82
+ */
83
+ pickerChange(e) {
84
+ that.callback = "";
85
+ console.log("e", e);
86
+ },
87
+ /**
88
+ * 关闭弹窗
89
+ */
90
+ close() {
91
+ this.isShow = false;
92
+ },
93
+ /**
94
+ * 选择单行代码
95
+ */
96
+ selectedRow(row) {
97
+ this.callback(row);
98
+ this.close();
99
+ },
100
+ },
101
+ };
102
+ </script>
103
+ <style lang="scss" scoped>
104
+ .codeHisPicker {
105
+ position: fixed;
106
+ bottom: 0;
107
+ left: 0;
108
+ width: 750rpx;
109
+ background-color: rgba(0, 0, 0, 0.3);
110
+ /* #ifndef APP-PLUS */
111
+ backdrop-filter: blur(1px);
112
+ /* #endif */
113
+ display: flex;
114
+ flex-direction: column-reverse;
115
+ z-index: 999;
116
+ .codeList {
117
+ width: 750rpx;
118
+ border-radius: 20rpx 20rpx 0 0;
119
+ background-color: #fff;
120
+ .head {
121
+ padding: 20rpx;
122
+ border-bottom: 1px solid rgba(0, 0, 0, 0.2);
123
+ display: flex;
124
+ flex-direction: row;
125
+ align-items: center;
126
+ justify-content: space-between;
127
+ .title {
128
+ .titleText {
129
+ font-size: 24rpx;
130
+ line-height: 28rpx;
131
+ color: #333;
132
+ }
133
+ }
134
+ .subTitle {
135
+ display: flex;
136
+ flex-direction: row;
137
+ align-items: center;
138
+ .subTitleText {
139
+ font-size: 20rpx;
140
+ line-height: 28rpx;
141
+ color: #777;
142
+ }
143
+ }
144
+ }
145
+ .codeScroll {
146
+ height: 750rpx;
147
+ width: 750rpx;
148
+ .hisItem {
149
+ width: 750rpx;
150
+ padding: 10rpx 20rpx;
151
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
152
+ .hisItemCode {
153
+ font-size: 20rpx;
154
+ color: #333;
155
+ line-height: 26rpx;
156
+ overflow: hidden;
157
+ text-overflow: ellipsis;
158
+ /* #ifdef H5 */
159
+ display: -webkit-box;
160
+ -webkit-line-clamp: 3;
161
+ -webkit-box-orient: vertical;
162
+ /* #endif */
163
+ lines: 3;
164
+ }
165
+ }
166
+ .hisItem:active {
167
+ background-color: rgba(0, 0, 0, 0.03);
168
+ }
169
+ }
170
+ }
171
+ }
172
+ </style>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <view><slot></slot></view>
3
+ </template>
4
+ <script>
5
+ export default {};
6
+ </script>
7
+ <style scoped>
8
+ view {
9
+ width: 100%;
10
+ display: block;
11
+ box-sizing: border-box;
12
+ }
13
+ </style>
@@ -0,0 +1,94 @@
1
+ <template>
2
+ <view>
3
+ <view
4
+ class="menuBtn"
5
+ v-if="list.length > 0"
6
+ @click="showMenu"
7
+ >
8
+ <text class="menuText">{{ title }}</text>
9
+ <text class="menuText">{{ list[value] ? list[value].title : "" }}</text>
10
+ <image
11
+ src="@/devTools/page/static/menu.png"
12
+ class="menuIcon"
13
+ />
14
+ </view>
15
+ </view>
16
+ </template>
17
+ <script>
18
+ import devUi from "../../../core/libs/devUi.js";
19
+
20
+ export default {
21
+ props: {
22
+ /**
23
+ * 按钮列表
24
+ */
25
+ list: {
26
+ type: Array,
27
+ default: () => [],
28
+ },
29
+ /**
30
+ * 当前选中的按钮索引
31
+ */
32
+ value: {
33
+ type: Number,
34
+ default: 0,
35
+ },
36
+ /**
37
+ * 标题
38
+ */
39
+ title: {
40
+ type: String,
41
+ default: "",
42
+ },
43
+ },
44
+ methods: {
45
+ /**
46
+ * 展示菜单
47
+ */
48
+ async showMenu() {
49
+ const list = this.list.map((item) => ({
50
+ title: String(item.title || ""),
51
+ msg: item.msg ? String(item.msg) : "",
52
+ }));
53
+
54
+ const res = await devUi.showActionSheet({
55
+ itemList: list,
56
+ itemColor: "#334155",
57
+ selectedIndex: this.value,
58
+ selectedColor: "#2563eb",
59
+ });
60
+
61
+ if (res && typeof res.tapIndex === "number" && res.tapIndex > -1) {
62
+ this.$emit("indexChange", res.tapIndex);
63
+ }
64
+ },
65
+ },
66
+ };
67
+ </script>
68
+ <style lang="scss" scoped>
69
+ .menuBtn {
70
+ display: flex;
71
+ flex-direction: row;
72
+ align-items: center;
73
+ justify-content: center;
74
+ border-radius: 14rpx;
75
+ height: 54rpx;
76
+ border: 1px solid rgba(15, 23, 42, 0.12);
77
+ padding: 0 14rpx;
78
+ background-color: #fff;
79
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
80
+ &:active {
81
+ background-color: rgba(59, 130, 246, 0.10);
82
+ }
83
+ .menuText {
84
+ font-size: 24rpx;
85
+ line-height: 54rpx;
86
+ color: #475569;
87
+ }
88
+ .menuIcon {
89
+ margin-left: 10rpx;
90
+ width: 30rpx;
91
+ height: 30rpx;
92
+ }
93
+ }
94
+ </style>
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <view class="mobileSwiperScroll">
3
+ <scroll-view
4
+ class="mobileSwiperScrollView"
5
+ scroll-y
6
+ :style="{
7
+ height: scrollHeight + 'px',
8
+ }"
9
+ :scroll-top="scrollTop"
10
+ >
11
+ <slot
12
+ :item="tabList[tabIndex]"
13
+ :index="tabIndex"
14
+ ></slot>
15
+ </scroll-view>
16
+ </view>
17
+ </template>
18
+ <script>
19
+ export default {
20
+ props: {
21
+ /**
22
+ * 分类索引
23
+ */
24
+ tabIndex: {
25
+ type: Number,
26
+ default: 0,
27
+ },
28
+ /**
29
+ * tab列表
30
+ */
31
+ tabList: {
32
+ type: Array,
33
+ default: () => [],
34
+ },
35
+ /**
36
+ * 滚动高度
37
+ */
38
+ scrollHeight: {
39
+ type: Number,
40
+ default: 1000,
41
+ },
42
+ },
43
+ data() {
44
+ return {
45
+ /**
46
+ * 滚动位置
47
+ */
48
+ scrollTop: 0,
49
+ };
50
+ },
51
+ methods: {
52
+ /**
53
+ * 滚动到列表底部
54
+ */
55
+ scrollToBottom() {
56
+ this.scrollTop = 999999999 + Math.random();
57
+ },
58
+ },
59
+ };
60
+ </script>
61
+ <style lang="scss" scoped>
62
+ .mobileSwiperScroll {
63
+ width: 100%;
64
+ overflow-x: hidden;
65
+ }
66
+
67
+ .mobileSwiperScrollView {
68
+ width: 100%;
69
+ }
70
+
71
+ .mobileSwiperScrollView ::v-deep .uni-scroll-view-content {
72
+ width: 100%;
73
+ }
74
+ </style>
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <view>
3
+ <MenuBtn
4
+ :list="typeList"
5
+ :value="index"
6
+ @indexChange="change"
7
+ title="网速:"
8
+ />
9
+ </view>
10
+ </template>
11
+ <script>
12
+ import MenuBtn from "./menuBtn.vue";
13
+ export default {
14
+ components: {
15
+ MenuBtn,
16
+ },
17
+ data() {
18
+ return {
19
+ /**
20
+ * 弱网模拟状态
21
+ */
22
+ typeList: [
23
+ { title: "不限", type: "", msg: "正常响应请求" },
24
+ { title: "2G龟速", type: "2g", msg: "随机延迟30~60秒后响应" },
25
+ { title: "3G慢速", type: "3g-", msg: "随机延迟10~30秒后响应" },
26
+ { title: "3G略快", type: "3g", msg: "随机延迟3~10秒后响应" },
27
+ { title: "4G弱网", type: "4g", msg: "随机延迟0.5~3秒后响应" },
28
+ ],
29
+ /**
30
+ * 当前选中的索引
31
+ */
32
+ index: 0,
33
+ };
34
+ },
35
+ mounted() {
36
+ let cache = uni.getStorageSync("devtools_uniResLimitType");
37
+ let index = this.typeList.findIndex((x) => x.type == cache);
38
+ if (index == -1) index = 0;
39
+ this.index = index;
40
+ },
41
+ methods: {
42
+ /**
43
+ * 选项发生改变事件
44
+ */
45
+ change(index) {
46
+ uni.setStorageSync("devtools_uniResLimitType", this.typeList[index].type);
47
+ this.index = index;
48
+ },
49
+ },
50
+ };
51
+ </script>
52
+ <style lang="scss"></style>