From 29b6ff483cdd805b43f03c568769bdbbd37adf61 Mon Sep 17 00:00:00 2001 From: ch Date: Mon, 23 May 2022 21:20:05 +0800 Subject: [PATCH] =?UTF-8?q?perf:=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=94=B9=E6=88=90cli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 31 ++++- App.vue | 42 ------- Dockerfile | 4 - README.md | 2 +- babel.config.js | 63 ++++++++++ deploy.yaml | 54 -------- env.config.js | 4 +- index.html | 27 ---- nginx.conf | 26 ---- package.json | 118 +++++++++++++++--- postcss.config.js | 22 ++++ public/index.html | 25 ++++ src/App.vue | 25 ++++ {common => src/common}/api/account.js | 0 {common => src/common}/api/base.js | 0 {common => src/common}/api/cart.js | 0 {common => src/common}/api/goods.js | 0 {common => src/common}/api/im.js | 0 {common => src/common}/api/index.js | 0 {common => src/common}/api/order.js | 0 {common => src/common}/api/oss.js | 0 {common => src/common}/api/seckill.js | 0 {common => src/common}/api/wx.js | 0 {common => src/common}/dicts/area.json | 0 {common => src/common}/dicts/im.js | 0 {common => src/common}/plugins/emoji.js | 0 {common => src/common}/plugins/msbIm.js | 0 .../common}/plugins/msbUniRequest.js | 0 {common => src/common}/router/index.js | 0 {common => src/common}/store/index.js | 0 {common => src/common}/utils/im.js | 0 {common => src/common}/utils/index.js | 0 {common => src/common}/utils/pay.js | 0 {common => src/common}/utils/requset.js | 0 {common => src/common}/utils/utils.js | 0 {common => src/common}/utils/wxpay.js | 0 .../components}/BsChoiceGoods.vue | 0 {components => src/components}/BsEmpty.vue | 0 {components => src/components}/BsPay.vue | 0 .../components}/BsSelectCity.vue | 0 {components => src/components}/UiButton.vue | 0 {components => src/components}/UiCell.vue | 0 {components => src/components}/UiConfirm.vue | 0 {components => src/components}/UiCopy.vue | 0 .../components}/UiGoodsGroup.vue | 4 +- .../components}/UiGoodsInfo.vue | 4 +- .../components}/UiGoodsInfoMax.vue | 4 +- {components => src/components}/UiMoney.vue | 0 .../components}/UiPageHeader.vue | 0 .../components}/UiRadioPicker.vue | 0 {components => src/components}/UiWhiteBox.vue | 0 main.js => src/main.js | 2 +- manifest.json => src/manifest.json | 0 src/manifest_old.json | 75 +++++++++++ pages.json => src/pages.json | 0 .../pages}/account/address/create.vue | 4 +- {pages => src/pages}/account/address/edit.vue | 4 +- {pages => src/pages}/account/address/list.vue | 0 {pages => src/pages}/account/index.vue | 4 +- .../message/chat/components/Footer.vue | 0 .../message/chat/components/GoodsInfo.vue | 4 +- .../message/chat/components/OrderInfo.vue | 4 +- .../pages}/account/message/chat/index.vue | 0 .../pages}/account/message/group.vue | 0 .../pages}/account/message/system.vue | 0 .../pages}/account/setting/index.vue | 4 +- .../pages}/account/setting/setName.vue | 0 .../pages}/account/setting/setUserInfo.vue | 4 +- {pages => src/pages}/cart/cart.vue | 0 .../pages}/cart/components/PageCtx.vue | 2 +- {pages => src/pages}/cart/tabBarCart.vue | 0 {pages => src/pages}/goods/category.vue | 0 .../goods/detail/components/SeckillPrice.vue | 0 .../goods/detail/components/Service.vue | 0 .../goods/detail/components/SkuPopup.vue | 0 .../goods/detail/components/SlideImage.vue | 0 {pages => src/pages}/goods/detail/index.vue | 0 .../pages}/goods/list/components/Sort.vue | 0 {pages => src/pages}/goods/list/index.vue | 0 {pages => src/pages}/goods/search.vue | 0 .../pages}/index/components/Banner.vue | 0 .../pages}/index/components/Pick.vue | 2 +- .../pages}/index/components/Seckill.vue | 2 +- {pages => src/pages}/index/index.vue | 0 {pages => src/pages}/login.vue | 4 +- .../order/detail/components/LogisitcsInfo.vue | 4 +- .../order/detail/components/Operation.vue | 0 .../order/detail/components/OrderInfo.vue | 4 +- .../order/detail/components/StatusTips.vue | 0 {pages => src/pages}/order/detail/index.vue | 0 {pages => src/pages}/order/list.vue | 4 +- {pages => src/pages}/order/logisitcsInfo.vue | 0 {pages => src/pages}/order/orderSuccess.vue | 0 {pages => src/pages}/order/payResult.vue | 0 .../pages}/order/saleAfter/saleAfterApply.vue | 0 .../components/AwaitExamine.vue | 0 .../saleAfterDetail/components/GoodsInfo.vue | 0 .../components/LogisticsInfo.vue | 0 .../saleAfterDetail/components/StatusTips.vue | 0 .../components/SubmitLogistics.vue | 2 +- .../order/saleAfter/saleAfterDetail/index.vue | 0 .../pages}/order/saleAfter/saleAfterEdit.vue | 0 .../pages}/order/saleAfter/saleAfterList.vue | 0 .../order/saleAfter/saleAfterSelect.vue | 0 {pages => src/pages}/order/submit.vue | 4 +- {pages => src/pages}/seckill.vue | 0 {static => src/static}/account/bg.png | Bin {static => src/static}/account/dz.png | Bin {static => src/static}/account/edit.png | Bin {static => src/static}/account/fh.png | Bin {static => src/static}/account/fk.png | Bin {static => src/static}/account/kf.png | Bin {static => src/static}/account/sh.png | Bin {static => src/static}/account/sz.png | Bin {static => src/static}/account/tk.png | Bin {static => src/static}/account/tx.png | Bin {static => src/static}/account/xx.png | Bin {static => src/static}/common/arrow.png | Bin {static => src/static}/common/back.png | Bin {static => src/static}/common/back_white.png | Bin {static => src/static}/common/dz.png | Bin {static => src/static}/common/empty_goods.png | Bin .../static}/common/tabbar/account-active.png | Bin .../static}/common/tabbar/account.png | Bin .../static}/common/tabbar/category-active.png | Bin .../static}/common/tabbar/category.png | Bin .../static}/common/tabbar/home-active.png | Bin {static => src/static}/common/tabbar/home.png | Bin .../common/tabbar/shopping-cart-active.png | Bin .../static}/common/tabbar/shopping-cart.png | Bin {static => src/static}/goods/back.png | Bin {static => src/static}/goods/buy.png | Bin {static => src/static}/goods/buy_max.png | Bin {static => src/static}/goods/cart.png | Bin {static => src/static}/goods/cart_icon.png | Bin .../static}/goods/category_banner.jpg | Bin {static => src/static}/goods/seckill.png | Bin .../static}/goods/seckill_start.png | Bin {static => src/static}/goods/service_icon.png | Bin {static => src/static}/goods/tag1.png | Bin {static => src/static}/goods/tag2.png | Bin {static => src/static}/goods/tag3.png | Bin {static => src/static}/goods/tag4.png | Bin {static => src/static}/goods/tag5.png | Bin {static => src/static}/im/close.png | Bin {static => src/static}/im/emoji.png | Bin {static => src/static}/im/img.png | Bin {static => src/static}/im/more.png | Bin {static => src/static}/im/video.png | Bin {static => src/static}/index/arrow.png | Bin {static => src/static}/index/banner.png | Bin {static => src/static}/index/bz.png | Bin {static => src/static}/index/logo.png | Bin {static => src/static}/index/logo3.png | Bin {static => src/static}/index/msg.png | Bin {static => src/static}/index/search.png | Bin {static => src/static}/index/search1.png | Bin {static => src/static}/index/tag1.png | Bin {static => src/static}/index/tag2.png | Bin {static => src/static}/index/tag3.png | Bin {static => src/static}/index/time.png | Bin {static => src/static}/index/time_bg.png | Bin {static => src/static}/message/empty.png | Bin {static => src/static}/message/xt.png | Bin {static => src/static}/order/cg.png | Bin {static => src/static}/order/dw.png | Bin {static => src/static}/order/dw2.png | Bin {static => src/static}/order/empty.png | Bin {static => src/static}/order/fh.png | Bin {static => src/static}/order/fj.png | Bin {static => src/static}/order/fk.png | Bin {static => src/static}/order/payFail.png | Bin {static => src/static}/order/paySuccess.png | Bin {static => src/static}/order/qx.png | Bin {static => src/static}/order/wx.png | Bin {static => src/static}/order/zfb.png | Bin {static => src/static}/search/arrow.png | Bin {static => src/static}/search/del.png | Bin {static => src/static}/search/search.png | Bin {static => src/static}/seckill/banner.png | Bin {static => src/static}/seckill/btn.png | Bin {static => src/static}/seckill/btn2.png | Bin {static => src/static}/seckill/jz.png | Bin uni.scss => src/uni.scss | 0 tsconfig.json | 9 ++ vue.config.js | 5 +- 186 files changed, 386 insertions(+), 216 deletions(-) delete mode 100644 App.vue delete mode 100644 Dockerfile create mode 100644 babel.config.js delete mode 100644 deploy.yaml delete mode 100644 index.html delete mode 100644 nginx.conf create mode 100644 postcss.config.js create mode 100644 public/index.html create mode 100644 src/App.vue rename {common => src/common}/api/account.js (100%) rename {common => src/common}/api/base.js (100%) rename {common => src/common}/api/cart.js (100%) rename {common => src/common}/api/goods.js (100%) rename {common => src/common}/api/im.js (100%) rename {common => src/common}/api/index.js (100%) rename {common => src/common}/api/order.js (100%) rename {common => src/common}/api/oss.js (100%) rename {common => src/common}/api/seckill.js (100%) rename {common => src/common}/api/wx.js (100%) rename {common => src/common}/dicts/area.json (100%) rename {common => src/common}/dicts/im.js (100%) rename {common => src/common}/plugins/emoji.js (100%) rename {common => src/common}/plugins/msbIm.js (100%) rename {common => src/common}/plugins/msbUniRequest.js (100%) rename {common => src/common}/router/index.js (100%) rename {common => src/common}/store/index.js (100%) rename {common => src/common}/utils/im.js (100%) rename {common => src/common}/utils/index.js (100%) rename {common => src/common}/utils/pay.js (100%) rename {common => src/common}/utils/requset.js (100%) rename {common => src/common}/utils/utils.js (100%) rename {common => src/common}/utils/wxpay.js (100%) rename {components => src/components}/BsChoiceGoods.vue (100%) rename {components => src/components}/BsEmpty.vue (100%) rename {components => src/components}/BsPay.vue (100%) rename {components => src/components}/BsSelectCity.vue (100%) rename {components => src/components}/UiButton.vue (100%) rename {components => src/components}/UiCell.vue (100%) rename {components => src/components}/UiConfirm.vue (100%) rename {components => src/components}/UiCopy.vue (100%) rename {components => src/components}/UiGoodsGroup.vue (98%) rename {components => src/components}/UiGoodsInfo.vue (97%) rename {components => src/components}/UiGoodsInfoMax.vue (97%) rename {components => src/components}/UiMoney.vue (100%) rename {components => src/components}/UiPageHeader.vue (100%) rename {components => src/components}/UiRadioPicker.vue (100%) rename {components => src/components}/UiWhiteBox.vue (100%) rename main.js => src/main.js (98%) rename manifest.json => src/manifest.json (100%) create mode 100644 src/manifest_old.json rename pages.json => src/pages.json (100%) rename {pages => src/pages}/account/address/create.vue (98%) rename {pages => src/pages}/account/address/edit.vue (98%) rename {pages => src/pages}/account/address/list.vue (100%) rename {pages => src/pages}/account/index.vue (99%) rename {pages => src/pages}/account/message/chat/components/Footer.vue (100%) rename {pages => src/pages}/account/message/chat/components/GoodsInfo.vue (97%) rename {pages => src/pages}/account/message/chat/components/OrderInfo.vue (97%) rename {pages => src/pages}/account/message/chat/index.vue (100%) rename {pages => src/pages}/account/message/group.vue (100%) rename {pages => src/pages}/account/message/system.vue (100%) rename {pages => src/pages}/account/setting/index.vue (97%) rename {pages => src/pages}/account/setting/setName.vue (100%) rename {pages => src/pages}/account/setting/setUserInfo.vue (98%) rename {pages => src/pages}/cart/cart.vue (100%) rename {pages => src/pages}/cart/components/PageCtx.vue (99%) rename {pages => src/pages}/cart/tabBarCart.vue (100%) rename {pages => src/pages}/goods/category.vue (100%) rename {pages => src/pages}/goods/detail/components/SeckillPrice.vue (100%) rename {pages => src/pages}/goods/detail/components/Service.vue (100%) rename {pages => src/pages}/goods/detail/components/SkuPopup.vue (100%) rename {pages => src/pages}/goods/detail/components/SlideImage.vue (100%) rename {pages => src/pages}/goods/detail/index.vue (100%) rename {pages => src/pages}/goods/list/components/Sort.vue (100%) rename {pages => src/pages}/goods/list/index.vue (100%) rename {pages => src/pages}/goods/search.vue (100%) rename {pages => src/pages}/index/components/Banner.vue (100%) rename {pages => src/pages}/index/components/Pick.vue (99%) rename {pages => src/pages}/index/components/Seckill.vue (99%) rename {pages => src/pages}/index/index.vue (100%) rename {pages => src/pages}/login.vue (99%) rename {pages => src/pages}/order/detail/components/LogisitcsInfo.vue (97%) rename {pages => src/pages}/order/detail/components/Operation.vue (100%) rename {pages => src/pages}/order/detail/components/OrderInfo.vue (98%) rename {pages => src/pages}/order/detail/components/StatusTips.vue (100%) rename {pages => src/pages}/order/detail/index.vue (100%) rename {pages => src/pages}/order/list.vue (99%) rename {pages => src/pages}/order/logisitcsInfo.vue (100%) rename {pages => src/pages}/order/orderSuccess.vue (100%) rename {pages => src/pages}/order/payResult.vue (100%) rename {pages => src/pages}/order/saleAfter/saleAfterApply.vue (100%) rename {pages => src/pages}/order/saleAfter/saleAfterDetail/components/AwaitExamine.vue (100%) rename {pages => src/pages}/order/saleAfter/saleAfterDetail/components/GoodsInfo.vue (100%) rename {pages => src/pages}/order/saleAfter/saleAfterDetail/components/LogisticsInfo.vue (100%) rename {pages => src/pages}/order/saleAfter/saleAfterDetail/components/StatusTips.vue (100%) rename {pages => src/pages}/order/saleAfter/saleAfterDetail/components/SubmitLogistics.vue (99%) rename {pages => src/pages}/order/saleAfter/saleAfterDetail/index.vue (100%) rename {pages => src/pages}/order/saleAfter/saleAfterEdit.vue (100%) rename {pages => src/pages}/order/saleAfter/saleAfterList.vue (100%) rename {pages => src/pages}/order/saleAfter/saleAfterSelect.vue (100%) rename {pages => src/pages}/order/submit.vue (99%) rename {pages => src/pages}/seckill.vue (100%) rename {static => src/static}/account/bg.png (100%) rename {static => src/static}/account/dz.png (100%) rename {static => src/static}/account/edit.png (100%) rename {static => src/static}/account/fh.png (100%) rename {static => src/static}/account/fk.png (100%) rename {static => src/static}/account/kf.png (100%) rename {static => src/static}/account/sh.png (100%) rename {static => src/static}/account/sz.png (100%) rename {static => src/static}/account/tk.png (100%) rename {static => src/static}/account/tx.png (100%) rename {static => src/static}/account/xx.png (100%) rename {static => src/static}/common/arrow.png (100%) rename {static => src/static}/common/back.png (100%) rename {static => src/static}/common/back_white.png (100%) rename {static => src/static}/common/dz.png (100%) rename {static => src/static}/common/empty_goods.png (100%) rename {static => src/static}/common/tabbar/account-active.png (100%) rename {static => src/static}/common/tabbar/account.png (100%) rename {static => src/static}/common/tabbar/category-active.png (100%) rename {static => src/static}/common/tabbar/category.png (100%) rename {static => src/static}/common/tabbar/home-active.png (100%) rename {static => src/static}/common/tabbar/home.png (100%) rename {static => src/static}/common/tabbar/shopping-cart-active.png (100%) rename {static => src/static}/common/tabbar/shopping-cart.png (100%) rename {static => src/static}/goods/back.png (100%) rename {static => src/static}/goods/buy.png (100%) rename {static => src/static}/goods/buy_max.png (100%) rename {static => src/static}/goods/cart.png (100%) rename {static => src/static}/goods/cart_icon.png (100%) rename {static => src/static}/goods/category_banner.jpg (100%) rename {static => src/static}/goods/seckill.png (100%) rename {static => src/static}/goods/seckill_start.png (100%) rename {static => src/static}/goods/service_icon.png (100%) rename {static => src/static}/goods/tag1.png (100%) rename {static => src/static}/goods/tag2.png (100%) rename {static => src/static}/goods/tag3.png (100%) rename {static => src/static}/goods/tag4.png (100%) rename {static => src/static}/goods/tag5.png (100%) rename {static => src/static}/im/close.png (100%) rename {static => src/static}/im/emoji.png (100%) rename {static => src/static}/im/img.png (100%) rename {static => src/static}/im/more.png (100%) rename {static => src/static}/im/video.png (100%) rename {static => src/static}/index/arrow.png (100%) rename {static => src/static}/index/banner.png (100%) rename {static => src/static}/index/bz.png (100%) rename {static => src/static}/index/logo.png (100%) rename {static => src/static}/index/logo3.png (100%) rename {static => src/static}/index/msg.png (100%) rename {static => src/static}/index/search.png (100%) rename {static => src/static}/index/search1.png (100%) rename {static => src/static}/index/tag1.png (100%) rename {static => src/static}/index/tag2.png (100%) rename {static => src/static}/index/tag3.png (100%) rename {static => src/static}/index/time.png (100%) rename {static => src/static}/index/time_bg.png (100%) rename {static => src/static}/message/empty.png (100%) rename {static => src/static}/message/xt.png (100%) rename {static => src/static}/order/cg.png (100%) rename {static => src/static}/order/dw.png (100%) rename {static => src/static}/order/dw2.png (100%) rename {static => src/static}/order/empty.png (100%) rename {static => src/static}/order/fh.png (100%) rename {static => src/static}/order/fj.png (100%) rename {static => src/static}/order/fk.png (100%) rename {static => src/static}/order/payFail.png (100%) rename {static => src/static}/order/paySuccess.png (100%) rename {static => src/static}/order/qx.png (100%) rename {static => src/static}/order/wx.png (100%) rename {static => src/static}/order/zfb.png (100%) rename {static => src/static}/search/arrow.png (100%) rename {static => src/static}/search/del.png (100%) rename {static => src/static}/search/search.png (100%) rename {static => src/static}/seckill/banner.png (100%) rename {static => src/static}/seckill/btn.png (100%) rename {static => src/static}/seckill/btn2.png (100%) rename {static => src/static}/seckill/jz.png (100%) rename uni.scss => src/uni.scss (100%) create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index 15d0189..ee0a644 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,27 @@ -.hbuilderx -.history -.idea + +.DS_Store +node_modules/ +unpackage/ +dist/ +.history/ env.js -node_moudel -package-lock.json \ No newline at end of file +yarn.lock + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.project +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw* diff --git a/App.vue b/App.vue deleted file mode 100644 index ce2bac1..0000000 --- a/App.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - - \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 99c049b..0000000 --- a/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM nginx -COPY unpackage/dist/build/h5 /usr/share/nginx/html -COPY nginx.conf /etc/nginx/conf.d/default.conf -EXPOSE 80 diff --git a/README.md b/README.md index 4a83697..857a408 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-03-17 11:30:06 * @LastEditors: ch - * @LastEditTime: 2022-03-22 18:07:54 + * @LastEditTime: 2022-05-23 21:18:34 * @Description: file content --> # shopping-app diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..dc4690a --- /dev/null +++ b/babel.config.js @@ -0,0 +1,63 @@ +const plugins = [] + +if (process.env.UNI_OPT_TREESHAKINGNG) { + plugins.push(require('@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js')) +} + +if ( + ( + process.env.UNI_PLATFORM === 'app-plus' && + process.env.UNI_USING_V8 + ) || + ( + process.env.UNI_PLATFORM === 'h5' && + process.env.UNI_H5_BROWSER === 'builtin' + ) +) { + const path = require('path') + + const isWin = /^win/.test(process.platform) + + const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path) + + const input = normalizePath(process.env.UNI_INPUT_DIR) + try { + plugins.push([ + require('@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console'), + { + file (file) { + file = normalizePath(file) + if (file.indexOf(input) === 0) { + return path.relative(input, file) + } + return false + } + } + ]) + } catch (e) {} +} + +process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui'] +process.UNI_LIBRARIES.forEach(libraryName => { + plugins.push([ + 'import', + { + 'libraryName': libraryName, + 'customName': (name) => { + return `${libraryName}/lib/${name}/${name}` + } + } + ]) +}) +module.exports = { + presets: [ + [ + '@vue/app', + { + modules: 'commonjs', + useBuiltIns: process.env.UNI_PLATFORM === 'h5' ? 'usage' : 'entry' + } + ] + ], + plugins +} diff --git a/deploy.yaml b/deploy.yaml deleted file mode 100644 index 81bd20c..0000000 --- a/deploy.yaml +++ /dev/null @@ -1,54 +0,0 @@ -kind: Deployment -apiVersion: apps/v1 -metadata: - labels: - app: $IMAGES - name: $IMAGES - namespace: yanxuan -spec: - progressDeadlineSeconds: 600 - replicas: 1 - selector: - matchLabels: - app: $IMAGES - strategy: - type: RollingUpdate - rollingUpdate: - maxUnavailable: 25% - maxSurge: 25% - template: - metadata: - labels: - app: $IMAGES - spec: - imagePullSecrets: - - name: aliyun-docker-hub - containers: - - image: '$REGISTRY/$DOCKERHUB_NAMESPACE/$IMAGES:$BUILD_NUMBER' - name: app - ports: - - containerPort: $JAR_PORD - protocol: TCP - resources: - limits: - cpu: '0.5' - memory: 500Mi - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: Always - terminationGracePeriodSeconds: 30 ---- -kind: Service -apiVersion: v1 -metadata: - name: $IMAGES - namespace: yanxuan -spec: - ports: - - port: 80 - protocol: TCP - targetPort: 80 - selector: - app: $IMAGES - type: ClusterIP diff --git a/env.config.js b/env.config.js index 3551c41..4efb30a 100644 --- a/env.config.js +++ b/env.config.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-05-05 14:40:00 * @LastEditors: ch - * @LastEditTime: 2022-05-23 15:31:49 + * @LastEditTime: 2022-05-23 21:15:35 * @Description: 根据git分支生成对应环境的环境变量 * 开发时如果环境变量换了,可以不用重启服务,直接运行node env.config.js即可 */ @@ -38,5 +38,5 @@ for(key in envConfig){ if(!curEnvConfig){ curEnvConfig = envConfig.dev; } -fs.writeFileSync(`${path.resolve(__dirname, './common/config')}/env.js`, +fs.writeFileSync(`${path.resolve(__dirname, './src/common/config')}/env.js`, `const ENV = ${JSON.stringify(curEnvConfig)}; export default ENV;`); diff --git a/index.html b/index.html deleted file mode 100644 index 43a3529..0000000 --- a/index.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - -
- - - diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index 64b8037..0000000 --- a/nginx.conf +++ /dev/null @@ -1,26 +0,0 @@ -server { - listen 80; - listen [::]:80; - server_name localhost default_server; - client_max_body_size 200m; - - location / { - if ($request_filename ~* .*\.(?:htm|html)$) { - add_header Cache-Control "no-store"; - } - root /usr/share/nginx/html; - try_files $uri @index ; - } - - - - - location @index { - add_header Cache-Control "no-store" ; - root /usr/share/nginx/html; - index index.html index.htm; - try_files $uri/index.html /index.html; - } - - error_page 405 =200 $uri; -} diff --git a/package.json b/package.json index 2c561a2..b1c170d 100644 --- a/package.json +++ b/package.json @@ -1,30 +1,112 @@ { - "name": "shopping-app", - "version": "1.0.0", - "description": "严选", - "main": "main.js", + "name": "shop-app", + "version": "0.1.0", + "private": true, "scripts": { - "build:test": "node env.config.js --ENV:test", - "build:beta": "node env.config.js --ENV:beta", - "build:prod": "node env.config.js --ENV:prod" + "serve": "npm run dev:h5", + "build": "npm run build:h5", + "build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build", + "build:custom": "cross-env NODE_ENV=production uniapp-cli custom", + "build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build", + "build:mp-360": "cross-env NODE_ENV=production UNI_PLATFORM=mp-360 vue-cli-service uni-build", + "build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build", + "build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build", + "build:mp-jd": "cross-env NODE_ENV=production UNI_PLATFORM=mp-jd vue-cli-service uni-build", + "build:mp-kuaishou": "cross-env NODE_ENV=production UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build", + "build:mp-lark": "cross-env NODE_ENV=production UNI_PLATFORM=mp-lark vue-cli-service uni-build", + "build:mp-qq": "cross-env NODE_ENV=production UNI_PLATFORM=mp-qq vue-cli-service uni-build", + "build:mp-toutiao": "cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build", + "build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build", + "build:mp-xhs": "cross-env NODE_ENV=production UNI_PLATFORM=mp-xhs vue-cli-service uni-build", + "build:quickapp-native": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-native vue-cli-service uni-build", + "build:quickapp-webview": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview vue-cli-service uni-build", + "build:quickapp-webview-huawei": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build", + "build:quickapp-webview-union": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build", + "dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch", + "dev:custom": "cross-env NODE_ENV=development uniapp-cli custom", + "dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve", + "dev:mp-360": "cross-env NODE_ENV=development UNI_PLATFORM=mp-360 vue-cli-service uni-build --watch", + "dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch", + "dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch", + "dev:mp-jd": "cross-env NODE_ENV=development UNI_PLATFORM=mp-jd vue-cli-service uni-build --watch", + "dev:mp-kuaishou": "cross-env NODE_ENV=development UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build --watch", + "dev:mp-lark": "cross-env NODE_ENV=development UNI_PLATFORM=mp-lark vue-cli-service uni-build --watch", + "dev:mp-qq": "cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch", + "dev:mp-toutiao": "cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch", + "dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch", + "dev:mp-xhs": "cross-env NODE_ENV=development UNI_PLATFORM=mp-xhs vue-cli-service uni-build --watch", + "dev:quickapp-native": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-native vue-cli-service uni-build --watch", + "dev:quickapp-webview": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview vue-cli-service uni-build --watch", + "dev:quickapp-webview-huawei": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build --watch", + "dev:quickapp-webview-union": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build --watch", + "info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js", + "serve:quickapp-native": "node node_modules/@dcloudio/uni-quickapp-native/bin/serve.js", + "test:android": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=android jest -i", + "test:h5": "cross-env UNI_PLATFORM=h5 jest -i", + "test:ios": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=ios jest -i", + "test:mp-baidu": "cross-env UNI_PLATFORM=mp-baidu jest -i", + "test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i" }, - "repository": { - "type": "git", - "url": "http://internel-git.mashibing.cn/chenhui/shopping-app.git" - }, - "keywords": [], - "author": "", - "license": "ISC", "dependencies": { + "@dcloudio/uni-app-plus": "^2.0.1-34720220422002", + "@dcloudio/uni-h5": "^2.0.1-34720220422002", + "@dcloudio/uni-helper-json": "*", + "@dcloudio/uni-i18n": "^2.0.1-34720220422002", + "@dcloudio/uni-mp-360": "^2.0.1-34720220422002", + "@dcloudio/uni-mp-alipay": "^2.0.1-34720220422002", + "@dcloudio/uni-mp-baidu": "^2.0.1-34720220422002", + "@dcloudio/uni-mp-jd": "^2.0.1-34720220422002", + "@dcloudio/uni-mp-kuaishou": "^2.0.1-34720220422002", + "@dcloudio/uni-mp-lark": "^2.0.1-34720220422002", + "@dcloudio/uni-mp-qq": "^2.0.1-34720220422002", + "@dcloudio/uni-mp-toutiao": "^2.0.1-34720220422002", + "@dcloudio/uni-mp-vue": "^2.0.1-34720220422002", + "@dcloudio/uni-mp-weixin": "^2.0.1-34720220422002", + "@dcloudio/uni-mp-xhs": "^2.0.1-34720220422002", + "@dcloudio/uni-quickapp-native": "^2.0.1-34720220422002", + "@dcloudio/uni-quickapp-webview": "^2.0.1-34720220422002", + "@dcloudio/uni-stat": "^2.0.1-34720220422002", + "@vue/shared": "^3.0.0", + "core-js": "^3.6.5", + "flyio": "^0.6.2", + "regenerator-runtime": "^0.12.1", + "vue": "^2.6.11", + "vuex": "^3.2.0", "js-util-all": "^1.0.6", "mp-html": "^2.2.2", "uni-read-pages": "^1.0.5", "uni-simple-router": "^2.0.7", - "uview-ui": "^2.0.29", - "vuex": "^3.6.2" + "uview-ui": "^2.0.29" }, "devDependencies": { - "@dcloudio/uni-helper-json": "^1.0.13", - "git-repo-info": "^2.1.1" + "@babel/runtime": "~7.12.0", + "@dcloudio/types": "^2.6.7", + "@dcloudio/uni-automator": "^2.0.1-34720220422002", + "@dcloudio/uni-cli-i18n": "^2.0.1-34720220422002", + "@dcloudio/uni-cli-shared": "^2.0.1-34720220422002", + "@dcloudio/uni-migration": "^2.0.1-34720220422002", + "@dcloudio/uni-template-compiler": "^2.0.1-34720220422002", + "@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.1-34720220422002", + "@dcloudio/vue-cli-plugin-uni": "^2.0.1-34720220422002", + "@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.1-34720220422002", + "@dcloudio/webpack-uni-mp-loader": "^2.0.1-34720220422002", + "@dcloudio/webpack-uni-pages-loader": "^2.0.1-34720220422002", + "@vue/cli-plugin-babel": "~4.5.15", + "@vue/cli-service": "~4.5.15", + "babel-plugin-import": "^1.11.0", + "cross-env": "^7.0.2", + "jest": "^25.4.0", + "mini-types": "*", + "miniprogram-api-typings": "*", + "postcss-comment": "^2.0.0", + "sass": "^1.52.1", + "vue-template-compiler": "^2.6.11" + }, + "browserslist": [ + "Android >= 4.4", + "ios >= 9" + ], + "uni-app": { + "scripts": {} } } diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..136478b --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,22 @@ +const path = require('path') +module.exports = { + parser: require('postcss-comment'), + plugins: [ + require('postcss-import')({ + resolve (id, basedir, importOptions) { + if (id.startsWith('~@/')) { + return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3)) + } else if (id.startsWith('@/')) { + return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2)) + } else if (id.startsWith('/') && !id.startsWith('//')) { + return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1)) + } + return id + } + }), + require('autoprefixer')({ + remove: process.env.UNI_PLATFORM !== 'h5' + }), + require('@dcloudio/vue-cli-plugin-uni/packages/postcss') + ] +} diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..ff730ce --- /dev/null +++ b/public/index.html @@ -0,0 +1,25 @@ + + + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + +
+ + + + \ No newline at end of file diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..4efbe61 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,25 @@ + + + + diff --git a/common/api/account.js b/src/common/api/account.js similarity index 100% rename from common/api/account.js rename to src/common/api/account.js diff --git a/common/api/base.js b/src/common/api/base.js similarity index 100% rename from common/api/base.js rename to src/common/api/base.js diff --git a/common/api/cart.js b/src/common/api/cart.js similarity index 100% rename from common/api/cart.js rename to src/common/api/cart.js diff --git a/common/api/goods.js b/src/common/api/goods.js similarity index 100% rename from common/api/goods.js rename to src/common/api/goods.js diff --git a/common/api/im.js b/src/common/api/im.js similarity index 100% rename from common/api/im.js rename to src/common/api/im.js diff --git a/common/api/index.js b/src/common/api/index.js similarity index 100% rename from common/api/index.js rename to src/common/api/index.js diff --git a/common/api/order.js b/src/common/api/order.js similarity index 100% rename from common/api/order.js rename to src/common/api/order.js diff --git a/common/api/oss.js b/src/common/api/oss.js similarity index 100% rename from common/api/oss.js rename to src/common/api/oss.js diff --git a/common/api/seckill.js b/src/common/api/seckill.js similarity index 100% rename from common/api/seckill.js rename to src/common/api/seckill.js diff --git a/common/api/wx.js b/src/common/api/wx.js similarity index 100% rename from common/api/wx.js rename to src/common/api/wx.js diff --git a/common/dicts/area.json b/src/common/dicts/area.json similarity index 100% rename from common/dicts/area.json rename to src/common/dicts/area.json diff --git a/common/dicts/im.js b/src/common/dicts/im.js similarity index 100% rename from common/dicts/im.js rename to src/common/dicts/im.js diff --git a/common/plugins/emoji.js b/src/common/plugins/emoji.js similarity index 100% rename from common/plugins/emoji.js rename to src/common/plugins/emoji.js diff --git a/common/plugins/msbIm.js b/src/common/plugins/msbIm.js similarity index 100% rename from common/plugins/msbIm.js rename to src/common/plugins/msbIm.js diff --git a/common/plugins/msbUniRequest.js b/src/common/plugins/msbUniRequest.js similarity index 100% rename from common/plugins/msbUniRequest.js rename to src/common/plugins/msbUniRequest.js diff --git a/common/router/index.js b/src/common/router/index.js similarity index 100% rename from common/router/index.js rename to src/common/router/index.js diff --git a/common/store/index.js b/src/common/store/index.js similarity index 100% rename from common/store/index.js rename to src/common/store/index.js diff --git a/common/utils/im.js b/src/common/utils/im.js similarity index 100% rename from common/utils/im.js rename to src/common/utils/im.js diff --git a/common/utils/index.js b/src/common/utils/index.js similarity index 100% rename from common/utils/index.js rename to src/common/utils/index.js diff --git a/common/utils/pay.js b/src/common/utils/pay.js similarity index 100% rename from common/utils/pay.js rename to src/common/utils/pay.js diff --git a/common/utils/requset.js b/src/common/utils/requset.js similarity index 100% rename from common/utils/requset.js rename to src/common/utils/requset.js diff --git a/common/utils/utils.js b/src/common/utils/utils.js similarity index 100% rename from common/utils/utils.js rename to src/common/utils/utils.js diff --git a/common/utils/wxpay.js b/src/common/utils/wxpay.js similarity index 100% rename from common/utils/wxpay.js rename to src/common/utils/wxpay.js diff --git a/components/BsChoiceGoods.vue b/src/components/BsChoiceGoods.vue similarity index 100% rename from components/BsChoiceGoods.vue rename to src/components/BsChoiceGoods.vue diff --git a/components/BsEmpty.vue b/src/components/BsEmpty.vue similarity index 100% rename from components/BsEmpty.vue rename to src/components/BsEmpty.vue diff --git a/components/BsPay.vue b/src/components/BsPay.vue similarity index 100% rename from components/BsPay.vue rename to src/components/BsPay.vue diff --git a/components/BsSelectCity.vue b/src/components/BsSelectCity.vue similarity index 100% rename from components/BsSelectCity.vue rename to src/components/BsSelectCity.vue diff --git a/components/UiButton.vue b/src/components/UiButton.vue similarity index 100% rename from components/UiButton.vue rename to src/components/UiButton.vue diff --git a/components/UiCell.vue b/src/components/UiCell.vue similarity index 100% rename from components/UiCell.vue rename to src/components/UiCell.vue diff --git a/components/UiConfirm.vue b/src/components/UiConfirm.vue similarity index 100% rename from components/UiConfirm.vue rename to src/components/UiConfirm.vue diff --git a/components/UiCopy.vue b/src/components/UiCopy.vue similarity index 100% rename from components/UiCopy.vue rename to src/components/UiCopy.vue diff --git a/components/UiGoodsGroup.vue b/src/components/UiGoodsGroup.vue similarity index 98% rename from components/UiGoodsGroup.vue rename to src/components/UiGoodsGroup.vue index f3f2e2e..e124f8a 100644 --- a/components/UiGoodsGroup.vue +++ b/src/components/UiGoodsGroup.vue @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-04-07 17:22:44 * @LastEditors: ch - * @LastEditTime: 2022-05-07 19:46:04 + * @LastEditTime: 2022-05-23 18:17:28 * @Description: file content --> @@ -175,7 +175,7 @@ export default { } } } -/deep/ { +::deep { .goods-item--pirce{ text{ font-size: $font-size-lg; diff --git a/components/UiGoodsInfo.vue b/src/components/UiGoodsInfo.vue similarity index 97% rename from components/UiGoodsInfo.vue rename to src/components/UiGoodsInfo.vue index 0fa7f12..d942509 100644 --- a/components/UiGoodsInfo.vue +++ b/src/components/UiGoodsInfo.vue @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-03-31 14:49:33 * @LastEditors: ch - * @LastEditTime: 2022-04-22 18:24:57 + * @LastEditTime: 2022-05-23 18:17:30 * @Description: file content -->