@gx-design-vue/create-gx-cli 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/README.md +5 -12
  2. package/package.json +3 -2
  3. package/template-mobile-vant-cli/.editorconfig +19 -0
  4. package/template-mobile-vant-cli/.env +0 -0
  5. package/template-mobile-vant-cli/.env.development +19 -0
  6. package/template-mobile-vant-cli/.env.pro +19 -0
  7. package/template-mobile-vant-cli/.env.production +19 -0
  8. package/template-mobile-vant-cli/.eslintignore +15 -0
  9. package/template-mobile-vant-cli/.prettierignore +9 -0
  10. package/template-mobile-vant-cli/build/cdn.ts +5 -0
  11. package/template-mobile-vant-cli/build/generateModifyVars.ts +7 -0
  12. package/template-mobile-vant-cli/build/optimizer.ts +18 -0
  13. package/template-mobile-vant-cli/build/plugin/autoImport.ts +24 -0
  14. package/template-mobile-vant-cli/build/plugin/html.ts +26 -0
  15. package/template-mobile-vant-cli/build/plugin/index.ts +42 -0
  16. package/template-mobile-vant-cli/build/plugin/mock.ts +14 -0
  17. package/template-mobile-vant-cli/build/plugin/viteMock/client.ts +88 -0
  18. package/template-mobile-vant-cli/build/plugin/viteMock/createMockServer.ts +271 -0
  19. package/template-mobile-vant-cli/build/plugin/viteMock/index.ts +69 -0
  20. package/template-mobile-vant-cli/build/plugin/viteMock/types.ts +48 -0
  21. package/template-mobile-vant-cli/build/plugin/viteMock/utils.ts +48 -0
  22. package/template-mobile-vant-cli/build/script/postBuild.ts +14 -0
  23. package/template-mobile-vant-cli/eslint.config.js +49 -0
  24. package/template-mobile-vant-cli/index.html +24 -0
  25. package/template-mobile-vant-cli/mock/_createProductionServer.ts +19 -0
  26. package/template-mobile-vant-cli/mock/datasSource/api/index.ts +0 -0
  27. package/template-mobile-vant-cli/mock/utils.ts +9 -0
  28. package/template-mobile-vant-cli/package.json +57 -0
  29. package/template-mobile-vant-cli/postcss.config.cjs +8 -0
  30. package/template-mobile-vant-cli/prettier.config.cjs +18 -0
  31. package/template-mobile-vant-cli/public/favicon.ico +0 -0
  32. package/template-mobile-vant-cli/public/js/flexible.js +44 -0
  33. package/template-mobile-vant-cli/src/App.vue +5 -0
  34. package/template-mobile-vant-cli/src/components/PageContainer/ProSkeleton.tsx +29 -0
  35. package/template-mobile-vant-cli/src/components/PageContainer/index.tsx +115 -0
  36. package/template-mobile-vant-cli/src/components/PageContainer/style.module.less +14 -0
  37. package/template-mobile-vant-cli/src/core/gx-design/index.ts +7 -0
  38. package/template-mobile-vant-cli/src/core/index.ts +12 -0
  39. package/template-mobile-vant-cli/src/core/vant-design/index.ts +4 -0
  40. package/template-mobile-vant-cli/src/design/config.less +0 -0
  41. package/template-mobile-vant-cli/src/design/index.less +3 -0
  42. package/template-mobile-vant-cli/src/design/reset.less +155 -0
  43. package/template-mobile-vant-cli/src/design/root.less +3 -0
  44. package/template-mobile-vant-cli/src/design/vant.less +2 -0
  45. package/template-mobile-vant-cli/src/global.less +1 -0
  46. package/template-mobile-vant-cli/src/hooks/web/index.ts +5 -0
  47. package/template-mobile-vant-cli/src/hooks/web/usePageLoading.ts +58 -0
  48. package/template-mobile-vant-cli/src/layout/BasicLayout.vue +16 -0
  49. package/template-mobile-vant-cli/src/layout/basicLayout.less +11 -0
  50. package/template-mobile-vant-cli/src/main.ts +27 -0
  51. package/template-mobile-vant-cli/src/pages/home.vue +71 -0
  52. package/template-mobile-vant-cli/src/router/index.ts +25 -0
  53. package/template-mobile-vant-cli/src/router/routes.ts +20 -0
  54. package/template-mobile-vant-cli/src/router/typings.ts +8 -0
  55. package/template-mobile-vant-cli/src/services/index.ts +31 -0
  56. package/template-mobile-vant-cli/src/settings/index.ts +10 -0
  57. package/template-mobile-vant-cli/src/store/index.ts +17 -0
  58. package/template-mobile-vant-cli/src/store/modules/global.ts +30 -0
  59. package/template-mobile-vant-cli/src/utils/crypto/base64.ts +101 -0
  60. package/template-mobile-vant-cli/src/utils/crypto/index.ts +57 -0
  61. package/template-mobile-vant-cli/src/utils/env.ts +50 -0
  62. package/template-mobile-vant-cli/src/utils/pageTitle.ts +14 -0
  63. package/template-mobile-vant-cli/src/utils/request/XHR.ts +139 -0
  64. package/template-mobile-vant-cli/src/utils/request/axiosCancel.ts +69 -0
  65. package/template-mobile-vant-cli/src/utils/request/checkStatus.ts +9 -0
  66. package/template-mobile-vant-cli/src/utils/request/index.ts +142 -0
  67. package/template-mobile-vant-cli/src/utils/request/typings.ts +171 -0
  68. package/template-mobile-vant-cli/src/utils/storage.ts +198 -0
  69. package/template-mobile-vant-cli/src/utils/util.ts +27 -0
  70. package/template-mobile-vant-cli/src/utils/validate.ts +216 -0
  71. package/template-mobile-vant-cli/tsconfig.json +42 -0
  72. package/template-mobile-vant-cli/types/ant-design-import.d.ts +13 -0
  73. package/template-mobile-vant-cli/types/auto-imports.d.ts +64 -0
  74. package/template-mobile-vant-cli/types/components.d.ts +12 -0
  75. package/template-mobile-vant-cli/types/global.d.ts +39 -0
  76. package/template-mobile-vant-cli/types/module.d.ts +20 -0
  77. package/template-mobile-vant-cli/types/plugins-auto-import.d.ts +14 -0
  78. package/template-mobile-vant-cli/types/response.d.ts +15 -0
  79. package/template-mobile-vant-cli/types/vant-import.d.ts +13 -0
  80. package/template-mobile-vant-cli/unocss.config.ts +101 -0
  81. package/template-mobile-vant-cli/vite.config.ts +145 -0
  82. package/template-mobile-vant-html/css/global.css +293 -0
  83. package/template-mobile-vant-html/css/global.css.map +1 -0
  84. package/template-mobile-vant-html/css/global.less +293 -0
  85. package/template-mobile-vant-html/css/index.css +20 -0
  86. package/template-mobile-vant-html/css/index.css.map +1 -0
  87. package/template-mobile-vant-html/css/index.less +21 -0
  88. package/template-mobile-vant-html/image/disconnected.svg +60 -0
  89. package/template-mobile-vant-html/image/empty.svg +52 -0
  90. package/template-mobile-vant-html/image/error.svg +53 -0
  91. package/template-mobile-vant-html/image/loading.svg +1 -0
  92. package/template-mobile-vant-html/index.html +91 -0
  93. package/template-mobile-vant-html/js/index.js +29 -0
  94. package/template-mobile-vant-html/js/plugin/day.min.js +1 -0
  95. package/template-mobile-vant-html/js/plugin/fastclick.js +730 -0
  96. package/template-mobile-vant-html/js/plugin/jquery.min.js +2 -0
  97. package/template-mobile-vant-html/js/plugin/rem.js +28 -0
  98. package/template-mobile-vant-html/js/utils/appUtil.js +70 -0
  99. package/template-mobile-vant-html/js/utils/config.js +3 -0
  100. package/template-mobile-vant-html/js/utils/request.js +61 -0
  101. package/template-mobile-vant-html/js/utils/utils.js +65 -0
  102. package/template-mobile-vant-html/js/utils/validate.js +292 -0
@@ -0,0 +1,91 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>vue3.0-mobile-vant-html</title>
6
+ <meta
7
+ name="viewport"
8
+ content="width=device-width,viewport-fit=cover,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"
9
+ />
10
+ <!-- 引入样式文件 -->
11
+ <link
12
+ rel="stylesheet"
13
+ href="https://fastly.jsdelivr.net/npm/vant@4/lib/index.css"
14
+ />
15
+ <script type="text/javascript">
16
+ document.write('<link rel=\'stylesheet\' type=\'text/css\' href="css/global.css?ver=' +
17
+ Date.parse(new Date()) +
18
+ Math.random() +
19
+ '\'">')
20
+ document.write('<link rel=\'stylesheet\' type=\'text/css\' href="css/index.css?ver=' +
21
+ Date.parse(new Date()) +
22
+ Math.random() +
23
+ '\'">')
24
+ </script>
25
+ <script src="js/plugin/rem.js"></script>
26
+ <script src="js/plugin/fastclick.js"></script>
27
+ <script src="js/utils/config.js"></script>
28
+ </head>
29
+ <body>
30
+ <!--初始化loading-->
31
+ <div class="toast-loading">
32
+ <div class="loading-cont">
33
+ <span class="svg"></span>
34
+ <span class="svg-text">正在加载中...</span>
35
+ </div>
36
+ </div>
37
+ <!--初始化骨架屏-->
38
+ <div class="skeleton-loading none">
39
+ <div class="ant-skeleton ant-skeleton-active">
40
+ <div class="ant-skeleton-content">
41
+ <h3 class="ant-skeleton-title" style="width: 38%"></h3>
42
+ <ul class="ant-skeleton-paragraph">
43
+ <li></li>
44
+ <li></li>
45
+ <li></li>
46
+ <li></li>
47
+ <li></li>
48
+ <li></li>
49
+ <li style="width: 61%;"></li>
50
+ </ul>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ <!--错误展示状态-->
55
+ <div class="error-block">
56
+ <div class="error-block-image">
57
+ <img src="" alt="">
58
+ </div>
59
+ <div class="error-block-description">
60
+ <div class="error-block-description-title"></div>
61
+ <div class="error-block-description-subtitle"></div>
62
+ </div>
63
+ </div>
64
+ <div id="app">
65
+ <div class="gx-mobile">
66
+ <img src="https://ahtv-obs.obs.cn-north-4.myhuaweicloud.com/20211111162748.jpg" alt="">
67
+ {{ msg }}
68
+ </div>
69
+ <div class="gx-mock">
70
+ <van-button type="primary">主要按钮</van-button>
71
+ <van-image width="100" height="100" src="https://img.yzcdn.cn/vant/cat.jpeg" />
72
+ </div>
73
+ </div>
74
+ <script src="js/plugin/jquery.min.js"></script>
75
+ <!-- 引入 Vue 和 Vant 的 JS 文件 -->
76
+ <script src="https://fastly.jsdelivr.net/npm/vue@3"></script>
77
+ <script src="https://fastly.jsdelivr.net/npm/vant@4/lib/vant.min.js"></script>
78
+ <script src="js/plugin/day.min.js"></script>
79
+ <script src="js/utils/utils.js"></script>
80
+ <script src="js/utils/appUtil.js"></script>
81
+ <script src="js/utils/request.js"></script>
82
+ <script type="text/javascript">
83
+ document.write('<s' +
84
+ 'cript type=\'text/javascript\' src=\'js/index.js?' +
85
+ Date.parse(new Date()) +
86
+ Math.random() +
87
+ '\'></s' +
88
+ 'cript>')
89
+ </script>
90
+ </body>
91
+ </html>
@@ -0,0 +1,29 @@
1
+ const { ref, onMounted } = Vue
2
+
3
+ const app = Vue.createApp({
4
+ setup() {
5
+ const msg = ref('Hello Gx Mobile')
6
+
7
+ onMounted(() => {
8
+ queryResponse()
9
+ })
10
+
11
+ const queryResponse = async () => {
12
+ const response = await request({
13
+ url: '/mock/fetch/url',
14
+ methot: 'post'
15
+ })
16
+ if (response.success) {
17
+ }
18
+ }
19
+
20
+ return {
21
+ msg
22
+ }
23
+ }
24
+ })
25
+ app.use(vant)
26
+
27
+ app.use(vant.Lazyload)
28
+
29
+ app.mount('#app')
@@ -0,0 +1 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else{var i=t.name;v[i]=t,r=i}return!n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);return D=(l={},l[c]=D/12,l[f]=D,l[h]=D/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?D:O.a(D)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),b=_.prototype;return w.prototype=b,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));