Bladeren bron

first commint

fangq 4 jaren geleden
commit
f18d08e174
100 gewijzigde bestanden met toevoegingen van 8669 en 0 verwijderingen
  1. 9 0
      .editorconfig
  2. 12 0
      .eslintignore
  3. 287 0
      .eslintrc.js
  4. 25 0
      .gitignore
  5. 3 0
      Dockerfile
  6. 11 0
      README.md
  7. 63 0
      babel.config.js
  8. 26 0
      nginx.conf
  9. 115 0
      package.json
  10. 22 0
      postcss.config.js
  11. 23 0
      public/index.html
  12. 7 0
      sitemap.json
  13. 60 0
      src/App.vue
  14. 133 0
      src/app.css
  15. 190 0
      src/components/tki-barcode/barcode.js
  16. 17 0
      src/components/tki-barcode/barcodes/Barcode.js
  17. 167 0
      src/components/tki-barcode/barcodes/CODE128/CODE128.js
  18. 42 0
      src/components/tki-barcode/barcodes/CODE128/CODE128A.js
  19. 42 0
      src/components/tki-barcode/barcodes/CODE128/CODE128B.js
  20. 42 0
      src/components/tki-barcode/barcodes/CODE128/CODE128C.js
  21. 41 0
      src/components/tki-barcode/barcodes/CODE128/CODE128_AUTO.js
  22. 73 0
      src/components/tki-barcode/barcodes/CODE128/auto.js
  23. 54 0
      src/components/tki-barcode/barcodes/CODE128/constants.js
  24. 29 0
      src/components/tki-barcode/barcodes/CODE128/index.js
  25. 104 0
      src/components/tki-barcode/barcodes/CODE39/index.js
  26. 92 0
      src/components/tki-barcode/barcodes/EAN_UPC/EAN.js
  27. 119 0
      src/components/tki-barcode/barcodes/EAN_UPC/EAN13.js
  28. 58 0
      src/components/tki-barcode/barcodes/EAN_UPC/EAN2.js
  29. 65 0
      src/components/tki-barcode/barcodes/EAN_UPC/EAN5.js
  30. 81 0
      src/components/tki-barcode/barcodes/EAN_UPC/EAN8.js
  31. 165 0
      src/components/tki-barcode/barcodes/EAN_UPC/UPC.js
  32. 185 0
      src/components/tki-barcode/barcodes/EAN_UPC/UPCE.js
  33. 30 0
      src/components/tki-barcode/barcodes/EAN_UPC/constants.js
  34. 27 0
      src/components/tki-barcode/barcodes/EAN_UPC/encoder.js
  35. 39 0
      src/components/tki-barcode/barcodes/EAN_UPC/index.js
  36. 55 0
      src/components/tki-barcode/barcodes/GenericBarcode/index.js
  37. 69 0
      src/components/tki-barcode/barcodes/ITF/ITF.js
  38. 55 0
      src/components/tki-barcode/barcodes/ITF/ITF14.js
  39. 9 0
      src/components/tki-barcode/barcodes/ITF/constants.js
  40. 19 0
      src/components/tki-barcode/barcodes/ITF/index.js
  41. 74 0
      src/components/tki-barcode/barcodes/MSI/MSI.js
  42. 33 0
      src/components/tki-barcode/barcodes/MSI/MSI10.js
  43. 35 0
      src/components/tki-barcode/barcodes/MSI/MSI1010.js
  44. 33 0
      src/components/tki-barcode/barcodes/MSI/MSI11.js
  45. 35 0
      src/components/tki-barcode/barcodes/MSI/MSI1110.js
  46. 29 0
      src/components/tki-barcode/barcodes/MSI/checksums.js
  47. 34 0
      src/components/tki-barcode/barcodes/MSI/index.js
  48. 92 0
      src/components/tki-barcode/barcodes/codabar/index.js
  49. 34 0
      src/components/tki-barcode/barcodes/index.js
  50. 73 0
      src/components/tki-barcode/barcodes/pharmacode/index.js
  51. 215 0
      src/components/tki-barcode/tki-barcode.vue
  52. 43 0
      src/main.js
  53. 86 0
      src/manifest.json
  54. 75 0
      src/pages.json
  55. 121 0
      src/pages/account-login/account-login.css
  56. 198 0
      src/pages/account-login/account-login.vue
  57. 129 0
      src/pages/business-code/business-code.css
  58. 87 0
      src/pages/business-code/business-code.vue
  59. 192 0
      src/pages/index/index.css
  60. 203 0
      src/pages/index/index.vue
  61. 718 0
      src/pages/order-detail/order-detail.css
  62. 667 0
      src/pages/order-detail/order-detail.vue
  63. 345 0
      src/pages/order-list/order-list.css
  64. 290 0
      src/pages/order-list/order-list.vue
  65. 40 0
      src/pages/pick-code/pick-code.css
  66. 57 0
      src/pages/pick-code/pick-code.vue
  67. 288 0
      src/pages/scan-pick/scan-pick.css
  68. 378 0
      src/pages/scan-pick/scan-pick.vue
  69. 115 0
      src/pages/self-mention-order/self-mention-order.css
  70. 108 0
      src/pages/self-mention-order/self-mention-order.vue
  71. 322 0
      src/pages/shop-adminsistration/shop-adminsistration.css
  72. 855 0
      src/pages/shop-adminsistration/shop-adminsistration.vue
  73. BIN
      src/static/images/icon/account-settings.png
  74. BIN
      src/static/images/icon/account-settings2.png
  75. BIN
      src/static/images/icon/activity-arr.png
  76. BIN
      src/static/images/icon/activity-bg.png
  77. BIN
      src/static/images/icon/add.png
  78. BIN
      src/static/images/icon/addr.png
  79. BIN
      src/static/images/icon/alipay.png
  80. BIN
      src/static/images/icon/applyAshop.png
  81. BIN
      src/static/images/icon/arrive-at-cash.png
  82. BIN
      src/static/images/icon/back-to-top.png
  83. BIN
      src/static/images/icon/banner.png
  84. BIN
      src/static/images/icon/bg1.png
  85. BIN
      src/static/images/icon/car-new.png
  86. BIN
      src/static/images/icon/car.png
  87. BIN
      src/static/images/icon/chat.png
  88. BIN
      src/static/images/icon/chongzhi.png
  89. BIN
      src/static/images/icon/clear-his.png
  90. BIN
      src/static/images/icon/close.png
  91. BIN
      src/static/images/icon/close2.png
  92. BIN
      src/static/images/icon/coupon-banner.png
  93. BIN
      src/static/images/icon/coupon-bg.png
  94. BIN
      src/static/images/icon/coupon-ot.png
  95. BIN
      src/static/images/icon/coupon-received.png
  96. BIN
      src/static/images/icon/coupon-robbed.png
  97. BIN
      src/static/images/icon/coupon-used.png
  98. BIN
      src/static/images/icon/customer-service.png
  99. BIN
      src/static/images/icon/default-avatar.png
  100. BIN
      src/static/images/icon/delive-dot.png

+ 9 - 0
.editorconfig

@@ -0,0 +1,9 @@
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true

+ 12 - 0
.eslintignore

@@ -0,0 +1,12 @@
+build/*.js
+src/assets
+src/components/tki-barcode
+src/js_sdk
+src/utils/jwx
+src/components/feng-parse
+src/components/tki-qrcode
+src/components/tki-barcode
+public
+dist
+src/utils/big.min.js
+src/utils/wxqrcode.js

+ 287 - 0
.eslintrc.js

@@ -0,0 +1,287 @@
+module.exports = {
+  root: true,
+  parserOptions: {
+    ecmaVersion: 2020,
+    sourceType: 'module'
+  },
+  env: {
+    browser: true,
+    node: true,
+    es6: true
+  },
+  extends: ['plugin:vue/recommended', 'eslint:recommended'],
+  globals: {
+    uni: true,
+    getApp: true,
+    wx: true,
+    ROUTES: true,
+    getCurrentPages: true,
+    plus: true
+  },
+  parser: 'vue-eslint-parser', // 关于vue语法的
+  // add your custom rules here
+  // it is base on https://github.com/vuejs/eslint-config-vue
+  rules: {
+    'vue/max-attributes-per-line': [
+      2,
+      {
+        singleline: 10,
+        multiline: {
+          max: 1,
+          allowFirstLine: false
+        }
+      }
+    ],
+    'vue/singleline-html-element-content-newline': 'off',
+    'vue/multiline-html-element-content-newline': 'off',
+    'vue/no-parsing-error': 'off',
+    'vue/name-property-casing': ['error', 'PascalCase'],
+    'vue/no-v-html': 'off',
+    'vue/attribute-hyphenation': 'off',
+    'accessor-pairs': 2,
+    'no-dupe-keys': 2, // 条件编译可能会用到
+    'arrow-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'block-spacing': [2, 'always'],
+    'brace-style': [
+      2,
+      '1tbs',
+      {
+        allowSingleLine: true
+      }
+    ],
+    camelcase: [
+      0,
+      {
+        properties: 'always'
+      }
+    ],
+    'comma-dangle': [2, 'never'],
+    'comma-spacing': [
+      2,
+      {
+        before: false,
+        after: true
+      }
+    ],
+    'comma-style': [2, 'last'],
+    'constructor-super': 2,
+    curly: [2, 'multi-line'],
+    'dot-location': [2, 'property'],
+    'eol-last': 2,
+    eqeqeq: ['warn', 'always', { null: 'ignore' }],
+    'generator-star-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'handle-callback-err': [2, '^(err|error)$'],
+    indent: [
+      2,
+      2,
+      {
+        SwitchCase: 1
+      }
+    ],
+    'jsx-quotes': [2, 'prefer-single'],
+    'key-spacing': [
+      2,
+      {
+        beforeColon: false,
+        afterColon: true
+      }
+    ],
+    'keyword-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'new-cap': [
+      2,
+      {
+        newIsCap: true,
+        capIsNew: false
+      }
+    ],
+    'new-parens': 2,
+    'no-array-constructor': 2,
+    'no-caller': 2,
+    'no-console': 'off',
+    'no-class-assign': 2,
+    'no-cond-assign': 2,
+    'no-const-assign': 2,
+    'no-control-regex': 0,
+    'no-delete-var': 2,
+    'no-dupe-args': 2,
+    'no-dupe-class-members': 2,
+    'no-duplicate-case': 2,
+    'no-empty-character-class': 2,
+    'no-empty-pattern': 2,
+    'no-eval': 2,
+    'no-ex-assign': 2,
+    'no-extend-native': 2,
+    'no-extra-bind': 2,
+    'no-extra-boolean-cast': 2,
+    'no-extra-parens': [2, 'functions'],
+    'no-fallthrough': 2,
+    'no-floating-decimal': 2,
+    'no-func-assign': 2,
+    'no-implied-eval': 2,
+    'no-inner-declarations': [2, 'functions'],
+    'no-invalid-regexp': 2,
+    'no-irregular-whitespace': 2,
+    'no-iterator': 2,
+    'no-label-var': 2,
+    'no-labels': [
+      2,
+      {
+        allowLoop: false,
+        allowSwitch: false
+      }
+    ],
+    'no-lone-blocks': 2,
+    'no-mixed-spaces-and-tabs': 2,
+    'no-multi-spaces': 2,
+    'no-multi-str': 2,
+    'no-multiple-empty-lines': [
+      2,
+      {
+        max: 1
+      }
+    ],
+    'no-native-reassign': 2,
+    'no-negated-in-lhs': 2,
+    'no-new-object': 2,
+    'no-new-require': 2,
+    'no-new-symbol': 2,
+    'no-new-wrappers': 2,
+    'no-obj-calls': 2,
+    'no-octal': 2,
+    'no-octal-escape': 2,
+    'no-path-concat': 2,
+    'no-proto': 2,
+    'no-redeclare': 2,
+    'no-regex-spaces': 2,
+    'no-return-assign': [2, 'except-parens'],
+    'no-self-assign': 2,
+    'no-self-compare': 2,
+    'no-sequences': 2,
+    'no-shadow-restricted-names': 2,
+    'no-spaced-func': 2,
+    'no-sparse-arrays': 2,
+    'no-this-before-super': 2,
+    'no-throw-literal': 2,
+    'no-trailing-spaces': 2,
+    'no-undef': 2,
+    'no-undef-init': 2,
+    'no-unexpected-multiline': 2,
+    'no-unmodified-loop-condition': 2,
+    'no-unneeded-ternary': [
+      2,
+      {
+        defaultAssignment: false
+      }
+    ],
+    'no-unreachable': 2,
+    'no-unsafe-finally': 2,
+    'no-unused-vars': [
+      2,
+      {
+        vars: 'all',
+        args: 'none'
+      }
+    ],
+    'no-useless-call': 2,
+    'no-useless-computed-key': 2,
+    'no-useless-constructor': 2,
+    'no-useless-escape': 0,
+    'no-whitespace-before-property': 2,
+    'no-with': 2,
+    'one-var': [
+      2,
+      {
+        initialized: 'never'
+      }
+    ],
+    'operator-linebreak': [
+      2,
+      'after',
+      {
+        overrides: {
+          '?': 'before',
+          ':': 'before'
+        }
+      }
+    ],
+    'padded-blocks': [2, 'never'],
+    quotes: [
+      2,
+      'single',
+      {
+        avoidEscape: true,
+        allowTemplateLiterals: true
+      }
+    ],
+    semi: [2, 'never'],
+    'semi-spacing': [
+      2,
+      {
+        before: false,
+        after: true
+      }
+    ],
+    'space-before-blocks': [2, 'always'],
+    'space-before-function-paren': [2, 'never'],
+    'space-in-parens': [2, 'never'],
+    'space-infix-ops': 2,
+    'space-unary-ops': [
+      2,
+      {
+        words: true,
+        nonwords: false
+      }
+    ],
+    'spaced-comment': [
+      2,
+      'always',
+      {
+        markers: [
+          'global',
+          'globals',
+          'eslint',
+          'eslint-disable',
+          '*package',
+          '!',
+          ','
+        ]
+      }
+    ],
+    'template-curly-spacing': [2, 'never'],
+    'use-isnan': 2,
+    'valid-typeof': 2,
+    'wrap-iife': [2, 'any'],
+    'yield-star-spacing': [2, 'both'],
+    yoda: [2, 'never'],
+    'prefer-const': 2,
+    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
+    'object-curly-spacing': [
+      2,
+      'always',
+      {
+        objectsInObjects: false
+      }
+    ],
+    'array-bracket-spacing': [2, 'never'],
+    // 强制 function 块最多允许的的语句数量
+    'max-statements': ['error', 80, { ignoreTopLevelFunctions: false }]
+  }
+}

+ 25 - 0
.gitignore

@@ -0,0 +1,25 @@
+.DS_Store
+node_modules/
+unpackage/
+dist/
+
+# 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
+.hbuilderx
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw*
+package-lock.json

+ 3 - 0
Dockerfile

@@ -0,0 +1,3 @@
+FROM nginx:1.20
+COPY ./dist/build/h5 /usr/share/nginx/html/h5/station
+COPY ./nginx.conf /etc/nginx/conf.d

+ 11 - 0
README.md

@@ -0,0 +1,11 @@
+## 协议和授权
+
+`mall4s` 并非一个开源软件,作者保留全部的权利。 擅自窃用,即属严重侵权行为,与盗窃无异。产生的一切任何后果责任由侵权者自负。
+
+## 商业使用
+
+商用请联系 **广州蓝海创新科技有限公司** 获取授权,否则产生的一切任何后果责任由侵权者自负。
+
+## 🚫禁止
+
+将本项目的部分或全部代码和资源进行任何形式的再发行(上传GitHub、Gitee等任何公开发行的地方)

+ 63 - 0
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
+}

+ 26 - 0
nginx.conf

@@ -0,0 +1,26 @@
+server {
+    listen 80;
+    server_name h5.mall4j.com;
+
+    location /station {
+        try_files $uri $uri/ /station/;
+        root /usr/share/nginx/html/h5;
+        index index.html;
+
+        #### kill cache
+        add_header Last-Modified $date_gmt;
+        add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
+        if_modified_since off;
+        expires off;
+        etag off;
+    }
+
+    error_page 404 /404.html;
+        location = /404-light.html {
+    }
+
+    error_page 500 502 503 504 /50x.html;
+        location = /50x.html {
+    }
+}
+

+ 115 - 0
package.json

@@ -0,0 +1,115 @@
+{
+  "name": "mall4s",
+  "version": "0.1.0",
+  "private": true,
+  "scripts": {
+    "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: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: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",
+    "lint": "eslint --ext .js,.vue src",
+    "lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue src"
+  },
+  "dependencies": {
+    "@dcloudio/uni-app-plus": "^2.0.1-33920220208001",
+    "@dcloudio/uni-h5": "^2.0.1-33920220208001",
+    "@dcloudio/uni-helper-json": "*",
+    "@dcloudio/uni-i18n": "^2.0.1-33920220208001",
+    "@dcloudio/uni-mp-360": "^2.0.1-33920220208001",
+    "@dcloudio/uni-mp-alipay": "^2.0.1-33920220208001",
+    "@dcloudio/uni-mp-baidu": "^2.0.1-33920220208001",
+    "@dcloudio/uni-mp-jd": "^2.0.1-33920220208001",
+    "@dcloudio/uni-mp-kuaishou": "^2.0.1-33920220208001",
+    "@dcloudio/uni-mp-lark": "^2.0.1-33920220208001",
+    "@dcloudio/uni-mp-qq": "^2.0.1-33920220208001",
+    "@dcloudio/uni-mp-toutiao": "^2.0.1-33920220208001",
+    "@dcloudio/uni-mp-vue": "^2.0.1-33920220208001",
+    "@dcloudio/uni-mp-weixin": "^2.0.1-33920220208001",
+    "@dcloudio/uni-quickapp-native": "^2.0.1-33920220208001",
+    "@dcloudio/uni-quickapp-webview": "^2.0.1-33920220208001",
+    "@dcloudio/uni-stat": "^2.0.1-33920220208001",
+    "@vue/shared": "^3.0.0",
+    "core-js": "^3.6.5",
+    "crypto-js": "^4.1.1",
+    "eslint": "7.32.0",
+    "eslint-config-airbnb": "19.0.4",
+    "eslint-config-standard": "16.0.3",
+    "eslint-plugin-html": "6.1.2",
+    "eslint-plugin-import": "2.25.3",
+    "eslint-plugin-node": "11.1.0",
+    "eslint-plugin-promise": "4.3.1",
+    "eslint-plugin-standard": "5.0.0",
+    "eslint-plugin-vue": "7.13.0",
+    "flyio": "^0.6.2",
+    "regenerator-runtime": "^0.12.1",
+    "vue": "^2.6.11",
+    "vuex": "^3.2.0"
+  },
+  "devDependencies": {
+    "@babel/runtime": "~7.12.0",
+    "@dcloudio/types": "*",
+    "@dcloudio/uni-automator": "^2.0.1-33920220208001",
+    "@dcloudio/uni-cli-i18n": "^2.0.1-33920220208001",
+    "@dcloudio/uni-cli-shared": "^2.0.1-33920220208001",
+    "@dcloudio/uni-migration": "^2.0.1-33920220208001",
+    "@dcloudio/uni-template-compiler": "^2.0.1-33920220208001",
+    "@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.1-33920220208001",
+    "@dcloudio/vue-cli-plugin-uni": "^2.0.1-33920220208001",
+    "@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.1-33920220208001",
+    "@dcloudio/webpack-uni-mp-loader": "^2.0.1-33920220208001",
+    "@dcloudio/webpack-uni-pages-loader": "^2.0.1-33920220208001",
+    "@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",
+    "vue-template-compiler": "^2.6.11"
+  },
+  "browserslist": [
+    "Android >= 4.4",
+    "ios >= 9"
+  ],
+  "uni-app": {
+    "scripts": {}
+  }
+}

+ 22 - 0
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')
+  ]
+}

+ 23 - 0
public/index.html

@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+    <head>
+        <meta charset="utf-8">
+				<meta name="referrer" content="same-origin">
+        <meta http-equiv="X-UA-Compatible" content="IE=edge">
+        <title>
+            <%= htmlWebpackPlugin.options.title %>
+        </title>
+        <script>
+            var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
+            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
+        </script>
+        <link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
+    </head>
+    <body>
+        <noscript>
+            <strong>Please enable JavaScript to continue.</strong>
+        </noscript>
+        <div id="app"></div>
+        <!-- built files will be auto injected -->
+    </body>
+</html>

+ 7 - 0
sitemap.json

@@ -0,0 +1,7 @@
+{
+  "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+  "rules": [{
+  "action": "allow",
+  "page": "*"
+  }]
+}

+ 60 - 0
src/App.vue

@@ -0,0 +1,60 @@
+<script>
+// app.js
+var http = require('./utils/http.js')
+var util = require('./utils/util.js')
+export default {
+  onLaunch: function() {
+    // #ifdef H5
+    uni.getSystemInfo({
+      success: function(res) {
+        // 客户端平台,值域为:ios、android
+        if (res.platform == 'ios') {
+          uni.setStorageSync('iosUrl', window.location.href.split('#')[0])
+        }
+      }
+    })
+    // #endif
+  },
+  onShow: function() {
+    // 判断浏览器环境
+    var ua = navigator.userAgent.toLowerCase()
+    if (ua.search(/MicroMessenger/i) > -1 && !uni.getStorageSync('appType')) {
+      // 微信环境
+      uni.setStorageSync('appType', 2)
+      http.mpAuthLogin()
+    }
+    const state = util.getUrlKey('state')
+    const code = util.getUrlKey('code')
+    if ((state == 'needCode' || state == 'unNeedCode') && code) {
+      let path = window.location.href
+      if (path.indexOf('code=') > 0 && path.indexOf('&state=unNeedCode') > -1) {
+        http.mpLogin(null, code)
+        path = path.substring(0, path.indexOf('code=') - 1)
+        history.replaceState({}, '', path)
+      }
+    }
+  },
+  globalData: {
+    // 定义全局请求队列
+    requestQueue: [],
+    // 是否正在进行登陆
+    isLanding: false
+  },
+  onHide: function() { }
+}
+</script>
+
+<style>
+/*每个页面公共css */
+@import "./app.css";
+
+/* 隐藏头部 */
+uni-page-head {
+  display: none;
+}
+
+/* 轮播图指示点 */
+uni-swiper .uni-swiper-dots-horizontal {
+  bottom: 20px !important;
+}
+</style>

+ 133 - 0
src/app.css

@@ -0,0 +1,133 @@
+/**app.wxss**/
+.container {
+  height: 100%;
+  box-sizing: border-box;
+  color: #333;
+  font-family: helvetica,'Heiti SC',PingFangSC-Light;
+} 
+.price{
+  font-family: Arial;
+  display: inline-block;
+  color: #e43130;
+ }
+
+
+/* 清除浮动 */
+.clearfix::after {
+  content: '';
+  display: block;
+  clear: both;
+  height:0;
+  visibility: hidden;
+}
+/* /清除浮动 */
+
+
+/* 价格数字显示不同大小 */
+
+.symbol {
+  font-size: 24rpx;
+}
+
+.big-num {
+  font-size: 32rpx;
+}
+
+.small-num {
+  font-size: 24rpx;
+}
+
+
+/* 
+*改变checkbox样式
+*自定义样式
+*/
+/* reg	  */
+uni-checkbox-group { 
+	width: 100% !important; 
+}
+uni-checkbox-group uni-label{ 
+	width: 33% !important; 
+	display: inline-block; 
+	margin-bottom: 20rpx; 
+}
+/*checkbox 选项框大小  */
+uni-checkbox .uni-checkbox-input{ 
+	width: 32rpx !important; 
+	height: 32rpx !important; 
+	border-radius: 50%!important;
+}
+/*checkbox选中后样式  */
+uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked{ 
+	background: #e43130; 
+	border: 1px solid transparent !important;
+}
+/*checkbox选中后图标样式  */
+uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked::before{
+	display: inline-block;
+	width: 20rpx;
+	height: 20rpx;  
+	line-height: 20rpx;
+	text-align: center;
+	font-size: 20rpx;
+	color: #fff;
+	background: transparent;
+	transform: translate(-50%, -50%) scale(1);
+	-webkit-transform: translate(-50%, -50%) scale(1);
+}
+uni-image {
+  display: block;
+}
+
+
+/* 
+*改变radio样式
+*自定义样式
+*/
+/* 未选中的 背景样式 */
+uni-radio .uni-radio-input{ 
+	height: 36rpx; 
+	width: 36rpx;
+	border-radius: 50%;
+	background: transparent;
+	box-sizing: border-box;
+ }
+/* 选中后的 背景样式 */
+uni-radio .uni-radio-input.uni-radio-input-checked{
+   border: none !important;
+   background: #e43130 !important;
+}
+/* 选中后的 对勾样式 */
+uni-radio .uni-radio-input.uni-radio-input-checked::before{
+   border-radius: 50%;
+   width: 32rpx; 
+   height: 32rpx;
+   line-height: 32rpx;
+   text-align: center;
+   font-size: 20rpx; 
+   color:#fff;
+   background: #e43130;
+   border-radius: 50%;
+   transform: translate(-50%, -50%) scale(1);
+   -webkit-transform: translate(-50%, -50%) scale(1);
+}
+
+
+/* 底部按钮兼容 iPhone X以上 */
+@media screen and (width: 375px) and (height: 812px){
+    .container {
+        padding-bottom: 34px;
+    }
+}
+
+@media screen and (width: 414px) and (height: 736px){
+    .container {
+        padding-bottom: 34px;
+    }
+} 
+
+.fixed-index {
+		position: fixed !important;
+		top: 0;
+		left: 0;
+}

+ 190 - 0
src/components/tki-barcode/barcode.js

@@ -0,0 +1,190 @@
+const barcodes = require('./barcodes/index.js')['default'];
+let barcode = {};
+(function () {
+    // 初始化
+    barcode = function (cont, ctxid, options, ctxsize, result) {
+        let ops = {}, newOptions, encodings, globaContext, ctx, globaCtxid, cbCanvasSize, cbResult;
+        globaCtxid = ctxid
+        cbCanvasSize = ctxsize
+        cbResult = result
+        newOptions = Object.assign(ops, options);
+        // 修成margin
+        fixMargin(newOptions)
+        // 处理options 数据
+        if (newOptions.text == '' || cont == '') {
+            return false
+        }
+        // 获取ctx
+        globaContext = cont
+        ctx = uni.createCanvasContext(globaCtxid, globaContext)
+        // 获取编码数据
+        encodings = new barcodes[newOptions.format.toUpperCase()](newOptions.text, newOptions).encode()
+        let fixencodings = fixEncodings(encodings, newOptions)
+        // 返回canvas实际大小
+        cbCanvasSize({ width: fixencodings.width, height: fixencodings.height })
+        // 绘制canvas
+        setTimeout(() => {
+            drawCanvas.render(newOptions, fixencodings)
+        }, 50);
+        // 绘制canvas
+        let drawCanvas = {
+            render(options, encoding) {
+                this.prepare(options, encoding)
+                encoding.encodings.forEach((v, i) => {
+                    this.barcode(options, v)
+                    this.text(options, v)
+                    this.move(v)
+                });
+                this.draw(options, encoding)
+            },
+            barcode(options, encoding) {
+                let binary = encoding.data;
+                let yFrom;
+                if (options.textPosition == "top") {
+                    yFrom = options.marginTop + options.fontSize + options.textMargin;
+                } else {
+                    yFrom = options.marginTop;
+                }
+                // 绘制条码
+                ctx.fillStyle = options.lineColor;
+                for (let b = 0; b < binary.length; b++) {
+                    let x = b * options.width + encoding.barcodePadding;
+                    let height = options.height
+                    if (encoding.options) {
+                        if (encoding.options.height != undefined) {
+                            height = encoding.options.height
+                        }
+                    }
+                    if (binary[b] === "1") {
+                        ctx.fillRect(x, yFrom, options.width, height);
+                    } else if (binary[b]) {
+                        ctx.fillRect(x, yFrom, options.width, height * binary[b]);
+                    }
+                }
+            },
+            text(options, encoding) {
+                if (options.displayValue) {
+                    let x, y, align, size;
+                    if (options.textPosition == "top") {
+                        y = options.marginTop + options.fontSize;
+                    } else {
+                        y = options.height + options.textMargin + options.marginTop + options.fontSize;
+                    }
+                    if (encoding.options) {
+                        if (encoding.options.textAlign != undefined) {
+                            align = encoding.options.textAlign
+                        }
+                        if (encoding.options.fontSize != undefined) {
+                            size = encoding.options.fontSize
+                        }
+                    } else {
+                        align = options.textAlign
+                        size = options.fontSize
+                    }
+                    ctx.setFontSize(size)
+                    if (align == "left" || encoding.barcodePadding > 0) {
+                        x = 0;
+                        ctx.setTextAlign('left')
+                    } else if (align == "right") {
+                        x = encoding.width - 1;
+                        ctx.setTextAlign('right')
+                    }
+                    else {
+                        x = encoding.width / 2;
+                        ctx.setTextAlign('center');
+                    }
+                    ctx.fillStyle = options.fontColor;
+                    if (encoding.text != undefined) {
+                        ctx.fillText(encoding.text, x, y);
+                    }
+                }
+            },
+            move(encoding) {
+                ctx.translate(encoding.width, 0);
+            },
+            prepare(options, encoding) {
+                // 绘制背景
+                if (options.background) {
+                    ctx.fillStyle = options.background;
+                    ctx.fillRect(0, 0, encoding.width, encoding.height);
+                }
+                ctx.translate(options.marginLeft, 0);
+            },
+            draw(options, encoding) {
+                ctx.draw(false, () => {
+                    this.toImgs(options, encoding)
+                })
+            },
+            toImgs(options, encoding) {
+                setTimeout(() => {
+                    uni.canvasToTempFilePath({
+                        width: encoding.width,
+                        height: encoding.height,
+                        destWidth: encoding.width,
+                        destHeight: encoding.height,
+                        canvasId: globaCtxid,
+                        fileType: 'png',
+                        success: function (res) {
+                            cbResult(res.tempFilePath)
+                        },
+                        fail: function (res) {
+                            cbResult(res)
+                        },
+                        complete: function () {
+                            // uni.hideLoading();
+                        },
+                    }, globaContext);
+                }, options.text.length + 100);
+            }
+        }
+        // 混入canvas数据
+        function fixEncodings(encoding, options) {
+            let encodingArr = [], width = options.marginLeft + options.marginRight, height;
+            if (!Array.isArray(encoding)) {
+                encodingArr[0] = JSON.parse(JSON.stringify(encoding))
+            } else {
+                encodingArr = [...encoding]
+            }
+            encodingArr.forEach((v, i) => {
+                // 获取文本宽度
+                let textWidth = ctx.measureText(encodingArr[i].text ? encodingArr[i].text : '').width;
+                // 获取条形码宽度
+                let barcodeWidth = encodingArr[i].data.length * options.width;
+                // 获取内边距
+                let barcodePadding = 0;
+                if (options.displayValue && barcodeWidth < textWidth) {
+                    if (options.textAlign == "center") {
+                        barcodePadding = Math.floor((textWidth - barcodeWidth) / 2);
+                    } else if (options.textAlign == "left") {
+                        barcodePadding = 0;
+                    } else if (options.textAlign == "right") {
+                        barcodePadding = Math.floor(textWidth - barcodeWidth);
+                    }
+                }
+                // 混入encodingArr[i]
+                encodingArr[i].barcodePadding = barcodePadding
+                encodingArr[i].width = Math.ceil(Math.max(textWidth, barcodeWidth))
+                width += encodingArr[i].width
+                if (encodingArr[i].options) {
+                    if (encodingArr[i].options.height != undefined) {
+                        encodingArr[i].height = encodingArr[i].options.height + (options.displayValue && (encodingArr[i].text ? encodingArr[i].text : '').length > 0 ? options.fontSize + options.textMargin : 0) + options.marginTop + options.marginBottom;
+                    } else {
+                        encodingArr[i].height = height = options.height + (options.displayValue && (encodingArr[i].text ? encodingArr[i].text : '').length > 0 ? options.fontSize + options.textMargin : 0) + options.marginTop + options.marginBottom;
+                    }
+                } else {
+                    encodingArr[i].height = height = options.height + (options.displayValue && (encodingArr[i].text ? encodingArr[i].text : '').length > 0 ? options.fontSize + options.textMargin : 0) + options.marginTop + options.marginBottom;
+                }
+            });
+            return { encodings: encodingArr, width, height };
+        }
+        // 修正Margin
+        function fixMargin(options) {
+            options.marginTop = options.marginTop == undefined ? options.margin : options.marginTop;
+            options.marginBottom = options.marginBottom == undefined ? options.margin : options.marginBottom;
+            options.marginRight = options.marginRight == undefined ? options.margin : options.marginRight;
+            options.marginLeft = options.marginLeft == undefined ? options.margin : options.marginLeft;
+        }
+    };
+})()
+
+export default barcode

+ 17 - 0
src/components/tki-barcode/barcodes/Barcode.js

@@ -0,0 +1,17 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var Barcode = function Barcode(data, options) {
+	_classCallCheck(this, Barcode);
+
+	this.data = data;
+	this.text = options.text || data;
+	this.options = options;
+};
+
+exports.default = Barcode;

+ 167 - 0
src/components/tki-barcode/barcodes/CODE128/CODE128.js

@@ -0,0 +1,167 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _Barcode2 = require('../Barcode.js');
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+var _constants = require('./constants');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+// This is the master class,
+// it does require the start code to be included in the string
+var CODE128 = function (_Barcode) {
+	_inherits(CODE128, _Barcode);
+
+	function CODE128(data, options) {
+		_classCallCheck(this, CODE128);
+
+		// Get array of ascii codes from data
+		var _this = _possibleConstructorReturn(this, (CODE128.__proto__ || Object.getPrototypeOf(CODE128)).call(this, data.substring(1), options));
+
+		_this.bytes = data.split('').map(function (char) {
+			return char.charCodeAt(0);
+		});
+		return _this;
+	}
+
+	_createClass(CODE128, [{
+		key: 'valid',
+		value: function valid() {
+			// ASCII value ranges 0-127, 200-211
+			return (/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)
+			);
+		}
+
+		// The public encoding function
+
+	}, {
+		key: 'encode',
+		value: function encode() {
+			var bytes = this.bytes;
+			// Remove the start code from the bytes and set its index
+			var startIndex = bytes.shift() - 105;
+			// Get start set by index
+			var startSet = _constants.SET_BY_CODE[startIndex];
+
+			if (startSet === undefined) {
+				throw new RangeError('The encoding does not start with a start character.');
+			}
+
+			if (this.shouldEncodeAsEan128() === true) {
+				bytes.unshift(_constants.FNC1);
+			}
+
+			// Start encode with the right type
+			var encodingResult = CODE128.next(bytes, 1, startSet);
+
+			return {
+				text: this.text === this.data ? this.text.replace(/[^\x20-\x7E]/g, '') : this.text,
+				data:
+				// Add the start bits
+				CODE128.getBar(startIndex) +
+				// Add the encoded bits
+				encodingResult.result +
+				// Add the checksum
+				CODE128.getBar((encodingResult.checksum + startIndex) % _constants.MODULO) +
+				// Add the end bits
+				CODE128.getBar(_constants.STOP)
+			};
+		}
+
+		// GS1-128/EAN-128
+
+	}, {
+		key: 'shouldEncodeAsEan128',
+		value: function shouldEncodeAsEan128() {
+			var isEAN128 = this.options.ean128 || false;
+			if (typeof isEAN128 === 'string') {
+				isEAN128 = isEAN128.toLowerCase() === 'true';
+			}
+			return isEAN128;
+		}
+
+		// Get a bar symbol by index
+
+	}], [{
+		key: 'getBar',
+		value: function getBar(index) {
+			return _constants.BARS[index] ? _constants.BARS[index].toString() : '';
+		}
+
+		// Correct an index by a set and shift it from the bytes array
+
+	}, {
+		key: 'correctIndex',
+		value: function correctIndex(bytes, set) {
+			if (set === _constants.SET_A) {
+				var charCode = bytes.shift();
+				return charCode < 32 ? charCode + 64 : charCode - 32;
+			} else if (set === _constants.SET_B) {
+				return bytes.shift() - 32;
+			} else {
+				return (bytes.shift() - 48) * 10 + bytes.shift() - 48;
+			}
+		}
+	}, {
+		key: 'next',
+		value: function next(bytes, pos, set) {
+			if (!bytes.length) {
+				return { result: '', checksum: 0 };
+			}
+
+			var nextCode = void 0,
+			    index = void 0;
+
+			// Special characters
+			if (bytes[0] >= 200) {
+				index = bytes.shift() - 105;
+				var nextSet = _constants.SWAP[index];
+
+				// Swap to other set
+				if (nextSet !== undefined) {
+					nextCode = CODE128.next(bytes, pos + 1, nextSet);
+				}
+				// Continue on current set but encode a special character
+				else {
+						// Shift
+						if ((set === _constants.SET_A || set === _constants.SET_B) && index === _constants.SHIFT) {
+							// Convert the next character so that is encoded correctly
+							bytes[0] = set === _constants.SET_A ? bytes[0] > 95 ? bytes[0] - 96 : bytes[0] : bytes[0] < 32 ? bytes[0] + 96 : bytes[0];
+						}
+						nextCode = CODE128.next(bytes, pos + 1, set);
+					}
+			}
+			// Continue encoding
+			else {
+					index = CODE128.correctIndex(bytes, set);
+					nextCode = CODE128.next(bytes, pos + 1, set);
+				}
+
+			// Get the correct binary encoding and calculate the weight
+			var enc = CODE128.getBar(index);
+			var weight = index * pos;
+
+			return {
+				result: enc + nextCode.result,
+				checksum: weight + nextCode.checksum
+			};
+		}
+	}]);
+
+	return CODE128;
+}(_Barcode3.default);
+
+exports.default = CODE128;

+ 42 - 0
src/components/tki-barcode/barcodes/CODE128/CODE128A.js

@@ -0,0 +1,42 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _CODE2 = require('./CODE128.js');
+
+var _CODE3 = _interopRequireDefault(_CODE2);
+
+var _constants = require('./constants');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var CODE128A = function (_CODE) {
+	_inherits(CODE128A, _CODE);
+
+	function CODE128A(string, options) {
+		_classCallCheck(this, CODE128A);
+
+		return _possibleConstructorReturn(this, (CODE128A.__proto__ || Object.getPrototypeOf(CODE128A)).call(this, _constants.A_START_CHAR + string, options));
+	}
+
+	_createClass(CODE128A, [{
+		key: 'valid',
+		value: function valid() {
+			return new RegExp('^' + _constants.A_CHARS + '+$').test(this.data);
+		}
+	}]);
+
+	return CODE128A;
+}(_CODE3.default);
+
+exports.default = CODE128A;

+ 42 - 0
src/components/tki-barcode/barcodes/CODE128/CODE128B.js

@@ -0,0 +1,42 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _CODE2 = require('./CODE128.js');
+
+var _CODE3 = _interopRequireDefault(_CODE2);
+
+var _constants = require('./constants');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var CODE128B = function (_CODE) {
+	_inherits(CODE128B, _CODE);
+
+	function CODE128B(string, options) {
+		_classCallCheck(this, CODE128B);
+
+		return _possibleConstructorReturn(this, (CODE128B.__proto__ || Object.getPrototypeOf(CODE128B)).call(this, _constants.B_START_CHAR + string, options));
+	}
+
+	_createClass(CODE128B, [{
+		key: 'valid',
+		value: function valid() {
+			return new RegExp('^' + _constants.B_CHARS + '+$').test(this.data);
+		}
+	}]);
+
+	return CODE128B;
+}(_CODE3.default);
+
+exports.default = CODE128B;

+ 42 - 0
src/components/tki-barcode/barcodes/CODE128/CODE128C.js

@@ -0,0 +1,42 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _CODE2 = require('./CODE128.js');
+
+var _CODE3 = _interopRequireDefault(_CODE2);
+
+var _constants = require('./constants');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var CODE128C = function (_CODE) {
+	_inherits(CODE128C, _CODE);
+
+	function CODE128C(string, options) {
+		_classCallCheck(this, CODE128C);
+
+		return _possibleConstructorReturn(this, (CODE128C.__proto__ || Object.getPrototypeOf(CODE128C)).call(this, _constants.C_START_CHAR + string, options));
+	}
+
+	_createClass(CODE128C, [{
+		key: 'valid',
+		value: function valid() {
+			return new RegExp('^' + _constants.C_CHARS + '+$').test(this.data);
+		}
+	}]);
+
+	return CODE128C;
+}(_CODE3.default);
+
+exports.default = CODE128C;

+ 41 - 0
src/components/tki-barcode/barcodes/CODE128/CODE128_AUTO.js

@@ -0,0 +1,41 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _CODE2 = require('./CODE128');
+
+var _CODE3 = _interopRequireDefault(_CODE2);
+
+var _auto = require('./auto');
+
+var _auto2 = _interopRequireDefault(_auto);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var CODE128AUTO = function (_CODE) {
+	_inherits(CODE128AUTO, _CODE);
+
+	function CODE128AUTO(data, options) {
+		_classCallCheck(this, CODE128AUTO);
+
+		// ASCII value ranges 0-127, 200-211
+		if (/^[\x00-\x7F\xC8-\xD3]+$/.test(data)) {
+			var _this = _possibleConstructorReturn(this, (CODE128AUTO.__proto__ || Object.getPrototypeOf(CODE128AUTO)).call(this, (0, _auto2.default)(data), options));
+		} else {
+			var _this = _possibleConstructorReturn(this, (CODE128AUTO.__proto__ || Object.getPrototypeOf(CODE128AUTO)).call(this, data, options));
+		}
+		return _possibleConstructorReturn(_this);
+	}
+
+	return CODE128AUTO;
+}(_CODE3.default);
+
+exports.default = CODE128AUTO;

+ 73 - 0
src/components/tki-barcode/barcodes/CODE128/auto.js

@@ -0,0 +1,73 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _constants = require('./constants');
+
+// Match Set functions
+var matchSetALength = function matchSetALength(string) {
+	return string.match(new RegExp('^' + _constants.A_CHARS + '*'))[0].length;
+};
+var matchSetBLength = function matchSetBLength(string) {
+	return string.match(new RegExp('^' + _constants.B_CHARS + '*'))[0].length;
+};
+var matchSetC = function matchSetC(string) {
+	return string.match(new RegExp('^' + _constants.C_CHARS + '*'))[0];
+};
+
+// CODE128A or CODE128B
+function autoSelectFromAB(string, isA) {
+	var ranges = isA ? _constants.A_CHARS : _constants.B_CHARS;
+	var untilC = string.match(new RegExp('^(' + ranges + '+?)(([0-9]{2}){2,})([^0-9]|$)'));
+
+	if (untilC) {
+		return untilC[1] + String.fromCharCode(204) + autoSelectFromC(string.substring(untilC[1].length));
+	}
+
+	var chars = string.match(new RegExp('^' + ranges + '+'))[0];
+
+	if (chars.length === string.length) {
+		return string;
+	}
+
+	return chars + String.fromCharCode(isA ? 205 : 206) + autoSelectFromAB(string.substring(chars.length), !isA);
+}
+
+// CODE128C
+function autoSelectFromC(string) {
+	var cMatch = matchSetC(string);
+	var length = cMatch.length;
+
+	if (length === string.length) {
+		return string;
+	}
+
+	string = string.substring(length);
+
+	// Select A/B depending on the longest match
+	var isA = matchSetALength(string) >= matchSetBLength(string);
+	return cMatch + String.fromCharCode(isA ? 206 : 205) + autoSelectFromAB(string, isA);
+}
+
+// Detect Code Set (A, B or C) and format the string
+
+exports.default = function (string) {
+	var newString = void 0;
+	var cLength = matchSetC(string).length;
+
+	// Select 128C if the string start with enough digits
+	if (cLength >= 2) {
+		newString = _constants.C_START_CHAR + autoSelectFromC(string);
+	} else {
+		// Select A/B depending on the longest match
+		var isA = matchSetALength(string) > matchSetBLength(string);
+		newString = (isA ? _constants.A_START_CHAR : _constants.B_START_CHAR) + autoSelectFromAB(string, isA);
+	}
+
+	return newString.replace(/[\xCD\xCE]([^])[\xCD\xCE]/, // Any sequence between 205 and 206 characters
+	function (match, char) {
+		return String.fromCharCode(203) + char;
+	});
+};

+ 54 - 0
src/components/tki-barcode/barcodes/CODE128/constants.js

@@ -0,0 +1,54 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _SET_BY_CODE;
+
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+
+// constants for internal usage
+var SET_A = exports.SET_A = 0;
+var SET_B = exports.SET_B = 1;
+var SET_C = exports.SET_C = 2;
+
+// Special characters
+var SHIFT = exports.SHIFT = 98;
+var START_A = exports.START_A = 103;
+var START_B = exports.START_B = 104;
+var START_C = exports.START_C = 105;
+var MODULO = exports.MODULO = 103;
+var STOP = exports.STOP = 106;
+var FNC1 = exports.FNC1 = 207;
+
+// Get set by start code
+var SET_BY_CODE = exports.SET_BY_CODE = (_SET_BY_CODE = {}, _defineProperty(_SET_BY_CODE, START_A, SET_A), _defineProperty(_SET_BY_CODE, START_B, SET_B), _defineProperty(_SET_BY_CODE, START_C, SET_C), _SET_BY_CODE);
+
+// Get next set by code
+var SWAP = exports.SWAP = {
+	101: SET_A,
+	100: SET_B,
+	99: SET_C
+};
+
+var A_START_CHAR = exports.A_START_CHAR = String.fromCharCode(208); // START_A + 105
+var B_START_CHAR = exports.B_START_CHAR = String.fromCharCode(209); // START_B + 105
+var C_START_CHAR = exports.C_START_CHAR = String.fromCharCode(210); // START_C + 105
+
+// 128A (Code Set A)
+// ASCII characters 00 to 95 (0–9, A–Z and control codes), special characters, and FNC 1–4
+var A_CHARS = exports.A_CHARS = "[\x00-\x5F\xC8-\xCF]";
+
+// 128B (Code Set B)
+// ASCII characters 32 to 127 (0–9, A–Z, a–z), special characters, and FNC 1–4
+var B_CHARS = exports.B_CHARS = "[\x20-\x7F\xC8-\xCF]";
+
+// 128C (Code Set C)
+// 00–99 (encodes two digits with a single code point) and FNC1
+var C_CHARS = exports.C_CHARS = "(\xCF*[0-9]{2}\xCF*)";
+
+// CODE128 includes 107 symbols:
+// 103 data symbols, 3 start symbols (A, B and C), and 1 stop symbol (the last one)
+// Each symbol consist of three black bars (1) and three white spaces (0).
+var BARS = exports.BARS = [11011001100, 11001101100, 11001100110, 10010011000, 10010001100, 10001001100, 10011001000, 10011000100, 10001100100, 11001001000, 11001000100, 11000100100, 10110011100, 10011011100, 10011001110, 10111001100, 10011101100, 10011100110, 11001110010, 11001011100, 11001001110, 11011100100, 11001110100, 11101101110, 11101001100, 11100101100, 11100100110, 11101100100, 11100110100, 11100110010, 11011011000, 11011000110, 11000110110, 10100011000, 10001011000, 10001000110, 10110001000, 10001101000, 10001100010, 11010001000, 11000101000, 11000100010, 10110111000, 10110001110, 10001101110, 10111011000, 10111000110, 10001110110, 11101110110, 11010001110, 11000101110, 11011101000, 11011100010, 11011101110, 11101011000, 11101000110, 11100010110, 11101101000, 11101100010, 11100011010, 11101111010, 11001000010, 11110001010, 10100110000, 10100001100, 10010110000, 10010000110, 10000101100, 10000100110, 10110010000, 10110000100, 10011010000, 10011000010, 10000110100, 10000110010, 11000010010, 11001010000, 11110111010, 11000010100, 10001111010, 10100111100, 10010111100, 10010011110, 10111100100, 10011110100, 10011110010, 11110100100, 11110010100, 11110010010, 11011011110, 11011110110, 11110110110, 10101111000, 10100011110, 10001011110, 10111101000, 10111100010, 11110101000, 11110100010, 10111011110, 10111101110, 11101011110, 11110101110, 11010000100, 11010010000, 11010011100, 1100011101011];

+ 29 - 0
src/components/tki-barcode/barcodes/CODE128/index.js

@@ -0,0 +1,29 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.CODE128C = exports.CODE128B = exports.CODE128A = exports.CODE128 = undefined;
+
+var _CODE128_AUTO = require('./CODE128_AUTO.js');
+
+var _CODE128_AUTO2 = _interopRequireDefault(_CODE128_AUTO);
+
+var _CODE128A = require('./CODE128A.js');
+
+var _CODE128A2 = _interopRequireDefault(_CODE128A);
+
+var _CODE128B = require('./CODE128B.js');
+
+var _CODE128B2 = _interopRequireDefault(_CODE128B);
+
+var _CODE128C = require('./CODE128C.js');
+
+var _CODE128C2 = _interopRequireDefault(_CODE128C);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+exports.CODE128 = _CODE128_AUTO2.default;
+exports.CODE128A = _CODE128A2.default;
+exports.CODE128B = _CODE128B2.default;
+exports.CODE128C = _CODE128C2.default;

+ 104 - 0
src/components/tki-barcode/barcodes/CODE39/index.js

@@ -0,0 +1,104 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+exports.CODE39 = undefined;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _Barcode2 = require("../Barcode.js");
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
+// https://en.wikipedia.org/wiki/Code_39#Encoding
+
+var CODE39 = function (_Barcode) {
+	_inherits(CODE39, _Barcode);
+
+	function CODE39(data, options) {
+		_classCallCheck(this, CODE39);
+
+		data = data.toUpperCase();
+
+		// Calculate mod43 checksum if enabled
+		if (options.mod43) {
+			data += getCharacter(mod43checksum(data));
+		}
+
+		return _possibleConstructorReturn(this, (CODE39.__proto__ || Object.getPrototypeOf(CODE39)).call(this, data, options));
+	}
+
+	_createClass(CODE39, [{
+		key: "encode",
+		value: function encode() {
+			// First character is always a *
+			var result = getEncoding("*");
+
+			// Take every character and add the binary representation to the result
+			for (var i = 0; i < this.data.length; i++) {
+				result += getEncoding(this.data[i]) + "0";
+			}
+
+			// Last character is always a *
+			result += getEncoding("*");
+			return {
+				data: result,
+				text: this.text
+			};
+		}
+	}, {
+		key: "valid",
+		value: function valid() {
+			return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/) !== -1;
+		}
+	}]);
+
+	return CODE39;
+}(_Barcode3.default);
+
+// All characters. The position in the array is the (checksum) value
+
+
+var characters = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "-", ".", " ", "$", "/", "+", "%", "*"];
+
+// The decimal representation of the characters, is converted to the
+// corresponding binary with the getEncoding function
+var encodings = [20957, 29783, 23639, 30485, 20951, 29813, 23669, 20855, 29789, 23645, 29975, 23831, 30533, 22295, 30149, 24005, 21623, 29981, 23837, 22301, 30023, 23879, 30545, 22343, 30161, 24017, 21959, 30065, 23921, 22385, 29015, 18263, 29141, 17879, 29045, 18293, 17783, 29021, 18269, 17477, 17489, 17681, 20753, 35770];
+
+// Get the binary representation of a character by converting the encodings
+// from decimal to binary
+function getEncoding(character) {
+	return getBinary(characterValue(character));
+}
+
+function getBinary(characterValue) {
+	return encodings[characterValue].toString(2);
+}
+
+function getCharacter(characterValue) {
+	return characters[characterValue];
+}
+
+function characterValue(character) {
+	return characters.indexOf(character);
+}
+
+function mod43checksum(data) {
+	var checksum = 0;
+	for (var i = 0; i < data.length; i++) {
+		checksum += characterValue(data[i]);
+	}
+
+	checksum = checksum % 43;
+	return checksum;
+}
+
+exports.CODE39 = CODE39;

+ 92 - 0
src/components/tki-barcode/barcodes/EAN_UPC/EAN.js

@@ -0,0 +1,92 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _constants = require('./constants');
+
+var _encoder = require('./encoder');
+
+var _encoder2 = _interopRequireDefault(_encoder);
+
+var _Barcode2 = require('../Barcode');
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+// Base class for EAN8 & EAN13
+var EAN = function (_Barcode) {
+	_inherits(EAN, _Barcode);
+
+	function EAN(data, options) {
+		_classCallCheck(this, EAN);
+
+		// Make sure the font is not bigger than the space between the guard bars
+		var _this = _possibleConstructorReturn(this, (EAN.__proto__ || Object.getPrototypeOf(EAN)).call(this, data, options));
+
+		_this.fontSize = !options.flat && options.fontSize > options.width * 10 ? options.width * 10 : options.fontSize;
+
+		// Make the guard bars go down half the way of the text
+		_this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin;
+		return _this;
+	}
+
+	_createClass(EAN, [{
+		key: 'encode',
+		value: function encode() {
+			return this.options.flat ? this.encodeFlat() : this.encodeGuarded();
+		}
+	}, {
+		key: 'leftText',
+		value: function leftText(from, to) {
+			return this.text.substr(from, to);
+		}
+	}, {
+		key: 'leftEncode',
+		value: function leftEncode(data, structure) {
+			return (0, _encoder2.default)(data, structure);
+		}
+	}, {
+		key: 'rightText',
+		value: function rightText(from, to) {
+			return this.text.substr(from, to);
+		}
+	}, {
+		key: 'rightEncode',
+		value: function rightEncode(data, structure) {
+			return (0, _encoder2.default)(data, structure);
+		}
+	}, {
+		key: 'encodeGuarded',
+		value: function encodeGuarded() {
+			var textOptions = { fontSize: this.fontSize };
+			var guardOptions = { height: this.guardHeight };
+
+			return [{ data: _constants.SIDE_BIN, options: guardOptions }, { data: this.leftEncode(), text: this.leftText(), options: textOptions }, { data: _constants.MIDDLE_BIN, options: guardOptions }, { data: this.rightEncode(), text: this.rightText(), options: textOptions }, { data: _constants.SIDE_BIN, options: guardOptions }];
+		}
+	}, {
+		key: 'encodeFlat',
+		value: function encodeFlat() {
+			var data = [_constants.SIDE_BIN, this.leftEncode(), _constants.MIDDLE_BIN, this.rightEncode(), _constants.SIDE_BIN];
+
+			return {
+				data: data.join(''),
+				text: this.text
+			};
+		}
+	}]);
+
+	return EAN;
+}(_Barcode3.default);
+
+exports.default = EAN;

+ 119 - 0
src/components/tki-barcode/barcodes/EAN_UPC/EAN13.js

@@ -0,0 +1,119 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
+
+var _constants = require('./constants');
+
+var _EAN2 = require('./EAN');
+
+var _EAN3 = _interopRequireDefault(_EAN2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
+// https://en.wikipedia.org/wiki/International_Article_Number_(EAN)#Binary_encoding_of_data_digits_into_EAN-13_barcode
+
+// Calculate the checksum digit
+// https://en.wikipedia.org/wiki/International_Article_Number_(EAN)#Calculation_of_checksum_digit
+var checksum = function checksum(number) {
+	var res = number.substr(0, 12).split('').map(function (n) {
+		return +n;
+	}).reduce(function (sum, a, idx) {
+		return idx % 2 ? sum + a * 3 : sum + a;
+	}, 0);
+
+	return (10 - res % 10) % 10;
+};
+
+var EAN13 = function (_EAN) {
+	_inherits(EAN13, _EAN);
+
+	function EAN13(data, options) {
+		_classCallCheck(this, EAN13);
+
+		// Add checksum if it does not exist
+		if (data.search(/^[0-9]{12}$/) !== -1) {
+			data += checksum(data);
+		}
+
+		// Adds a last character to the end of the barcode
+		var _this = _possibleConstructorReturn(this, (EAN13.__proto__ || Object.getPrototypeOf(EAN13)).call(this, data, options));
+
+		_this.lastChar = options.lastChar;
+		return _this;
+	}
+
+	_createClass(EAN13, [{
+		key: 'valid',
+		value: function valid() {
+			return this.data.search(/^[0-9]{13}$/) !== -1 && +this.data[12] === checksum(this.data);
+		}
+	}, {
+		key: 'leftText',
+		value: function leftText() {
+			return _get(EAN13.prototype.__proto__ || Object.getPrototypeOf(EAN13.prototype), 'leftText', this).call(this, 1, 6);
+		}
+	}, {
+		key: 'leftEncode',
+		value: function leftEncode() {
+			var data = this.data.substr(1, 6);
+			var structure = _constants.EAN13_STRUCTURE[this.data[0]];
+			return _get(EAN13.prototype.__proto__ || Object.getPrototypeOf(EAN13.prototype), 'leftEncode', this).call(this, data, structure);
+		}
+	}, {
+		key: 'rightText',
+		value: function rightText() {
+			return _get(EAN13.prototype.__proto__ || Object.getPrototypeOf(EAN13.prototype), 'rightText', this).call(this, 7, 6);
+		}
+	}, {
+		key: 'rightEncode',
+		value: function rightEncode() {
+			var data = this.data.substr(7, 6);
+			return _get(EAN13.prototype.__proto__ || Object.getPrototypeOf(EAN13.prototype), 'rightEncode', this).call(this, data, 'RRRRRR');
+		}
+
+		// The "standard" way of printing EAN13 barcodes with guard bars
+
+	}, {
+		key: 'encodeGuarded',
+		value: function encodeGuarded() {
+			var data = _get(EAN13.prototype.__proto__ || Object.getPrototypeOf(EAN13.prototype), 'encodeGuarded', this).call(this);
+
+			// Extend data with left digit & last character
+			if (this.options.displayValue) {
+				data.unshift({
+					data: '000000000000',
+					text: this.text.substr(0, 1),
+					options: { textAlign: 'left', fontSize: this.fontSize }
+				});
+
+				if (this.options.lastChar) {
+					data.push({
+						data: '00'
+					});
+					data.push({
+						data: '00000',
+						text: this.options.lastChar,
+						options: { fontSize: this.fontSize }
+					});
+				}
+			}
+
+			return data;
+		}
+	}]);
+
+	return EAN13;
+}(_EAN3.default);
+
+exports.default = EAN13;

+ 58 - 0
src/components/tki-barcode/barcodes/EAN_UPC/EAN2.js

@@ -0,0 +1,58 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _constants = require('./constants');
+
+var _encoder = require('./encoder');
+
+var _encoder2 = _interopRequireDefault(_encoder);
+
+var _Barcode2 = require('../Barcode');
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
+// https://en.wikipedia.org/wiki/EAN_2#Encoding
+
+var EAN2 = function (_Barcode) {
+	_inherits(EAN2, _Barcode);
+
+	function EAN2(data, options) {
+		_classCallCheck(this, EAN2);
+
+		return _possibleConstructorReturn(this, (EAN2.__proto__ || Object.getPrototypeOf(EAN2)).call(this, data, options));
+	}
+
+	_createClass(EAN2, [{
+		key: 'valid',
+		value: function valid() {
+			return this.data.search(/^[0-9]{2}$/) !== -1;
+		}
+	}, {
+		key: 'encode',
+		value: function encode() {
+			// Choose the structure based on the number mod 4
+			var structure = _constants.EAN2_STRUCTURE[parseInt(this.data) % 4];
+			return {
+				// Start bits + Encode the two digits with 01 in between
+				data: '1011' + (0, _encoder2.default)(this.data, structure, '01'),
+				text: this.text
+			};
+		}
+	}]);
+
+	return EAN2;
+}(_Barcode3.default);
+
+exports.default = EAN2;

+ 65 - 0
src/components/tki-barcode/barcodes/EAN_UPC/EAN5.js

@@ -0,0 +1,65 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _constants = require('./constants');
+
+var _encoder = require('./encoder');
+
+var _encoder2 = _interopRequireDefault(_encoder);
+
+var _Barcode2 = require('../Barcode');
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
+// https://en.wikipedia.org/wiki/EAN_5#Encoding
+
+var checksum = function checksum(data) {
+	var result = data.split('').map(function (n) {
+		return +n;
+	}).reduce(function (sum, a, idx) {
+		return idx % 2 ? sum + a * 9 : sum + a * 3;
+	}, 0);
+	return result % 10;
+};
+
+var EAN5 = function (_Barcode) {
+	_inherits(EAN5, _Barcode);
+
+	function EAN5(data, options) {
+		_classCallCheck(this, EAN5);
+
+		return _possibleConstructorReturn(this, (EAN5.__proto__ || Object.getPrototypeOf(EAN5)).call(this, data, options));
+	}
+
+	_createClass(EAN5, [{
+		key: 'valid',
+		value: function valid() {
+			return this.data.search(/^[0-9]{5}$/) !== -1;
+		}
+	}, {
+		key: 'encode',
+		value: function encode() {
+			var structure = _constants.EAN5_STRUCTURE[checksum(this.data)];
+			return {
+				data: '1011' + (0, _encoder2.default)(this.data, structure, '01'),
+				text: this.text
+			};
+		}
+	}]);
+
+	return EAN5;
+}(_Barcode3.default);
+
+exports.default = EAN5;

+ 81 - 0
src/components/tki-barcode/barcodes/EAN_UPC/EAN8.js

@@ -0,0 +1,81 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
+
+var _EAN2 = require('./EAN');
+
+var _EAN3 = _interopRequireDefault(_EAN2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
+// http://www.barcodeisland.com/ean8.phtml
+
+// Calculate the checksum digit
+var checksum = function checksum(number) {
+	var res = number.substr(0, 7).split('').map(function (n) {
+		return +n;
+	}).reduce(function (sum, a, idx) {
+		return idx % 2 ? sum + a : sum + a * 3;
+	}, 0);
+
+	return (10 - res % 10) % 10;
+};
+
+var EAN8 = function (_EAN) {
+	_inherits(EAN8, _EAN);
+
+	function EAN8(data, options) {
+		_classCallCheck(this, EAN8);
+
+		// Add checksum if it does not exist
+		if (data.search(/^[0-9]{7}$/) !== -1) {
+			data += checksum(data);
+		}
+
+		return _possibleConstructorReturn(this, (EAN8.__proto__ || Object.getPrototypeOf(EAN8)).call(this, data, options));
+	}
+
+	_createClass(EAN8, [{
+		key: 'valid',
+		value: function valid() {
+			return this.data.search(/^[0-9]{8}$/) !== -1 && +this.data[7] === checksum(this.data);
+		}
+	}, {
+		key: 'leftText',
+		value: function leftText() {
+			return _get(EAN8.prototype.__proto__ || Object.getPrototypeOf(EAN8.prototype), 'leftText', this).call(this, 0, 4);
+		}
+	}, {
+		key: 'leftEncode',
+		value: function leftEncode() {
+			var data = this.data.substr(0, 4);
+			return _get(EAN8.prototype.__proto__ || Object.getPrototypeOf(EAN8.prototype), 'leftEncode', this).call(this, data, 'LLLL');
+		}
+	}, {
+		key: 'rightText',
+		value: function rightText() {
+			return _get(EAN8.prototype.__proto__ || Object.getPrototypeOf(EAN8.prototype), 'rightText', this).call(this, 4, 4);
+		}
+	}, {
+		key: 'rightEncode',
+		value: function rightEncode() {
+			var data = this.data.substr(4, 4);
+			return _get(EAN8.prototype.__proto__ || Object.getPrototypeOf(EAN8.prototype), 'rightEncode', this).call(this, data, 'RRRR');
+		}
+	}]);
+
+	return EAN8;
+}(_EAN3.default);
+
+exports.default = EAN8;

+ 165 - 0
src/components/tki-barcode/barcodes/EAN_UPC/UPC.js

@@ -0,0 +1,165 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+exports.checksum = checksum;
+
+var _encoder = require("./encoder");
+
+var _encoder2 = _interopRequireDefault(_encoder);
+
+var _Barcode2 = require("../Barcode.js");
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
+// https://en.wikipedia.org/wiki/Universal_Product_Code#Encoding
+
+var UPC = function (_Barcode) {
+	_inherits(UPC, _Barcode);
+
+	function UPC(data, options) {
+		_classCallCheck(this, UPC);
+
+		// Add checksum if it does not exist
+		if (data.search(/^[0-9]{11}$/) !== -1) {
+			data += checksum(data);
+		}
+
+		var _this = _possibleConstructorReturn(this, (UPC.__proto__ || Object.getPrototypeOf(UPC)).call(this, data, options));
+
+		_this.displayValue = options.displayValue;
+
+		// Make sure the font is not bigger than the space between the guard bars
+		if (options.fontSize > options.width * 10) {
+			_this.fontSize = options.width * 10;
+		} else {
+			_this.fontSize = options.fontSize;
+		}
+
+		// Make the guard bars go down half the way of the text
+		_this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin;
+		return _this;
+	}
+
+	_createClass(UPC, [{
+		key: "valid",
+		value: function valid() {
+			return this.data.search(/^[0-9]{12}$/) !== -1 && this.data[11] == checksum(this.data);
+		}
+	}, {
+		key: "encode",
+		value: function encode() {
+			if (this.options.flat) {
+				return this.flatEncoding();
+			} else {
+				return this.guardedEncoding();
+			}
+		}
+	}, {
+		key: "flatEncoding",
+		value: function flatEncoding() {
+			var result = "";
+
+			result += "101";
+			result += (0, _encoder2.default)(this.data.substr(0, 6), "LLLLLL");
+			result += "01010";
+			result += (0, _encoder2.default)(this.data.substr(6, 6), "RRRRRR");
+			result += "101";
+
+			return {
+				data: result,
+				text: this.text
+			};
+		}
+	}, {
+		key: "guardedEncoding",
+		value: function guardedEncoding() {
+			var result = [];
+
+			// Add the first digit
+			if (this.displayValue) {
+				result.push({
+					data: "00000000",
+					text: this.text.substr(0, 1),
+					options: { textAlign: "left", fontSize: this.fontSize }
+				});
+			}
+
+			// Add the guard bars
+			result.push({
+				data: "101" + (0, _encoder2.default)(this.data[0], "L"),
+				options: { height: this.guardHeight }
+			});
+
+			// Add the left side
+			result.push({
+				data: (0, _encoder2.default)(this.data.substr(1, 5), "LLLLL"),
+				text: this.text.substr(1, 5),
+				options: { fontSize: this.fontSize }
+			});
+
+			// Add the middle bits
+			result.push({
+				data: "01010",
+				options: { height: this.guardHeight }
+			});
+
+			// Add the right side
+			result.push({
+				data: (0, _encoder2.default)(this.data.substr(6, 5), "RRRRR"),
+				text: this.text.substr(6, 5),
+				options: { fontSize: this.fontSize }
+			});
+
+			// Add the end bits
+			result.push({
+				data: (0, _encoder2.default)(this.data[11], "R") + "101",
+				options: { height: this.guardHeight }
+			});
+
+			// Add the last digit
+			if (this.displayValue) {
+				result.push({
+					data: "00000000",
+					text: this.text.substr(11, 1),
+					options: { textAlign: "right", fontSize: this.fontSize }
+				});
+			}
+
+			return result;
+		}
+	}]);
+
+	return UPC;
+}(_Barcode3.default);
+
+// Calulate the checksum digit
+// https://en.wikipedia.org/wiki/International_Article_Number_(EAN)#Calculation_of_checksum_digit
+
+
+function checksum(number) {
+	var result = 0;
+
+	var i;
+	for (i = 1; i < 11; i += 2) {
+		result += parseInt(number[i]);
+	}
+	for (i = 0; i < 11; i += 2) {
+		result += parseInt(number[i]) * 3;
+	}
+
+	return (10 - result % 10) % 10;
+}
+
+exports.default = UPC;

+ 185 - 0
src/components/tki-barcode/barcodes/EAN_UPC/UPCE.js

@@ -0,0 +1,185 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _encoder = require('./encoder');
+
+var _encoder2 = _interopRequireDefault(_encoder);
+
+var _Barcode2 = require('../Barcode.js');
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+var _UPC = require('./UPC.js');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
+// https://en.wikipedia.org/wiki/Universal_Product_Code#Encoding
+//
+// UPC-E documentation:
+// https://en.wikipedia.org/wiki/Universal_Product_Code#UPC-E
+
+var EXPANSIONS = ["XX00000XXX", "XX10000XXX", "XX20000XXX", "XXX00000XX", "XXXX00000X", "XXXXX00005", "XXXXX00006", "XXXXX00007", "XXXXX00008", "XXXXX00009"];
+
+var PARITIES = [["EEEOOO", "OOOEEE"], ["EEOEOO", "OOEOEE"], ["EEOOEO", "OOEEOE"], ["EEOOOE", "OOEEEO"], ["EOEEOO", "OEOOEE"], ["EOOEEO", "OEEOOE"], ["EOOOEE", "OEEEOO"], ["EOEOEO", "OEOEOE"], ["EOEOOE", "OEOEEO"], ["EOOEOE", "OEEOEO"]];
+
+var UPCE = function (_Barcode) {
+	_inherits(UPCE, _Barcode);
+
+	function UPCE(data, options) {
+		_classCallCheck(this, UPCE);
+
+		var _this = _possibleConstructorReturn(this, (UPCE.__proto__ || Object.getPrototypeOf(UPCE)).call(this, data, options));
+		// Code may be 6 or 8 digits;
+		// A 7 digit code is ambiguous as to whether the extra digit
+		// is a UPC-A check or number system digit.
+
+
+		_this.isValid = false;
+		if (data.search(/^[0-9]{6}$/) !== -1) {
+			_this.middleDigits = data;
+			_this.upcA = expandToUPCA(data, "0");
+			_this.text = options.text || '' + _this.upcA[0] + data + _this.upcA[_this.upcA.length - 1];
+			_this.isValid = true;
+		} else if (data.search(/^[01][0-9]{7}$/) !== -1) {
+			_this.middleDigits = data.substring(1, data.length - 1);
+			_this.upcA = expandToUPCA(_this.middleDigits, data[0]);
+
+			if (_this.upcA[_this.upcA.length - 1] === data[data.length - 1]) {
+				_this.isValid = true;
+			} else {
+				// checksum mismatch
+				return _possibleConstructorReturn(_this);
+			}
+		} else {
+			return _possibleConstructorReturn(_this);
+		}
+
+		_this.displayValue = options.displayValue;
+
+		// Make sure the font is not bigger than the space between the guard bars
+		if (options.fontSize > options.width * 10) {
+			_this.fontSize = options.width * 10;
+		} else {
+			_this.fontSize = options.fontSize;
+		}
+
+		// Make the guard bars go down half the way of the text
+		_this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin;
+		return _this;
+	}
+
+	_createClass(UPCE, [{
+		key: 'valid',
+		value: function valid() {
+			return this.isValid;
+		}
+	}, {
+		key: 'encode',
+		value: function encode() {
+			if (this.options.flat) {
+				return this.flatEncoding();
+			} else {
+				return this.guardedEncoding();
+			}
+		}
+	}, {
+		key: 'flatEncoding',
+		value: function flatEncoding() {
+			var result = "";
+
+			result += "101";
+			result += this.encodeMiddleDigits();
+			result += "010101";
+
+			return {
+				data: result,
+				text: this.text
+			};
+		}
+	}, {
+		key: 'guardedEncoding',
+		value: function guardedEncoding() {
+			var result = [];
+
+			// Add the UPC-A number system digit beneath the quiet zone
+			if (this.displayValue) {
+				result.push({
+					data: "00000000",
+					text: this.text[0],
+					options: { textAlign: "left", fontSize: this.fontSize }
+				});
+			}
+
+			// Add the guard bars
+			result.push({
+				data: "101",
+				options: { height: this.guardHeight }
+			});
+
+			// Add the 6 UPC-E digits
+			result.push({
+				data: this.encodeMiddleDigits(),
+				text: this.text.substring(1, 7),
+				options: { fontSize: this.fontSize }
+			});
+
+			// Add the end bits
+			result.push({
+				data: "010101",
+				options: { height: this.guardHeight }
+			});
+
+			// Add the UPC-A check digit beneath the quiet zone
+			if (this.displayValue) {
+				result.push({
+					data: "00000000",
+					text: this.text[7],
+					options: { textAlign: "right", fontSize: this.fontSize }
+				});
+			}
+
+			return result;
+		}
+	}, {
+		key: 'encodeMiddleDigits',
+		value: function encodeMiddleDigits() {
+			var numberSystem = this.upcA[0];
+			var checkDigit = this.upcA[this.upcA.length - 1];
+			var parity = PARITIES[parseInt(checkDigit)][parseInt(numberSystem)];
+			return (0, _encoder2.default)(this.middleDigits, parity);
+		}
+	}]);
+
+	return UPCE;
+}(_Barcode3.default);
+
+function expandToUPCA(middleDigits, numberSystem) {
+	var lastUpcE = parseInt(middleDigits[middleDigits.length - 1]);
+	var expansion = EXPANSIONS[lastUpcE];
+
+	var result = "";
+	var digitIndex = 0;
+	for (var i = 0; i < expansion.length; i++) {
+		var c = expansion[i];
+		if (c === 'X') {
+			result += middleDigits[digitIndex++];
+		} else {
+			result += c;
+		}
+	}
+
+	result = '' + numberSystem + result;
+	return '' + result + (0, _UPC.checksum)(result);
+}
+
+exports.default = UPCE;

+ 30 - 0
src/components/tki-barcode/barcodes/EAN_UPC/constants.js

@@ -0,0 +1,30 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+// Standard start end and middle bits
+var SIDE_BIN = exports.SIDE_BIN = '101';
+var MIDDLE_BIN = exports.MIDDLE_BIN = '01010';
+
+var BINARIES = exports.BINARIES = {
+	'L': [// The L (left) type of encoding
+	'0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011'],
+	'G': [// The G type of encoding
+	'0100111', '0110011', '0011011', '0100001', '0011101', '0111001', '0000101', '0010001', '0001001', '0010111'],
+	'R': [// The R (right) type of encoding
+	'1110010', '1100110', '1101100', '1000010', '1011100', '1001110', '1010000', '1000100', '1001000', '1110100'],
+	'O': [// The O (odd) encoding for UPC-E
+	'0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011'],
+	'E': [// The E (even) encoding for UPC-E
+	'0100111', '0110011', '0011011', '0100001', '0011101', '0111001', '0000101', '0010001', '0001001', '0010111']
+};
+
+// Define the EAN-2 structure
+var EAN2_STRUCTURE = exports.EAN2_STRUCTURE = ['LL', 'LG', 'GL', 'GG'];
+
+// Define the EAN-5 structure
+var EAN5_STRUCTURE = exports.EAN5_STRUCTURE = ['GGLLL', 'GLGLL', 'GLLGL', 'GLLLG', 'LGGLL', 'LLGGL', 'LLLGG', 'LGLGL', 'LGLLG', 'LLGLG'];
+
+// Define the EAN-13 structure
+var EAN13_STRUCTURE = exports.EAN13_STRUCTURE = ['LLLLLL', 'LLGLGG', 'LLGGLG', 'LLGGGL', 'LGLLGG', 'LGGLLG', 'LGGGLL', 'LGLGLG', 'LGLGGL', 'LGGLGL'];

+ 27 - 0
src/components/tki-barcode/barcodes/EAN_UPC/encoder.js

@@ -0,0 +1,27 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _constants = require('./constants');
+
+// Encode data string
+var encode = function encode(data, structure, separator) {
+	var encoded = data.split('').map(function (val, idx) {
+		return _constants.BINARIES[structure[idx]];
+	}).map(function (val, idx) {
+		return val ? val[data[idx]] : '';
+	});
+
+	if (separator) {
+		var last = data.length - 1;
+		encoded = encoded.map(function (val, idx) {
+			return idx < last ? val + separator : val;
+		});
+	}
+
+	return encoded.join('');
+};
+
+exports.default = encode;

+ 39 - 0
src/components/tki-barcode/barcodes/EAN_UPC/index.js

@@ -0,0 +1,39 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.UPCE = exports.UPC = exports.EAN2 = exports.EAN5 = exports.EAN8 = exports.EAN13 = undefined;
+
+var _EAN = require('./EAN13.js');
+
+var _EAN2 = _interopRequireDefault(_EAN);
+
+var _EAN3 = require('./EAN8.js');
+
+var _EAN4 = _interopRequireDefault(_EAN3);
+
+var _EAN5 = require('./EAN5.js');
+
+var _EAN6 = _interopRequireDefault(_EAN5);
+
+var _EAN7 = require('./EAN2.js');
+
+var _EAN8 = _interopRequireDefault(_EAN7);
+
+var _UPC = require('./UPC.js');
+
+var _UPC2 = _interopRequireDefault(_UPC);
+
+var _UPCE = require('./UPCE.js');
+
+var _UPCE2 = _interopRequireDefault(_UPCE);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+exports.EAN13 = _EAN2.default;
+exports.EAN8 = _EAN4.default;
+exports.EAN5 = _EAN6.default;
+exports.EAN2 = _EAN8.default;
+exports.UPC = _UPC2.default;
+exports.UPCE = _UPCE2.default;

+ 55 - 0
src/components/tki-barcode/barcodes/GenericBarcode/index.js

@@ -0,0 +1,55 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+exports.GenericBarcode = undefined;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _Barcode2 = require("../Barcode.js");
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var GenericBarcode = function (_Barcode) {
+	_inherits(GenericBarcode, _Barcode);
+
+	function GenericBarcode(data, options) {
+		_classCallCheck(this, GenericBarcode);
+
+		return _possibleConstructorReturn(this, (GenericBarcode.__proto__ || Object.getPrototypeOf(GenericBarcode)).call(this, data, options)); // Sets this.data and this.text
+	}
+
+	// Return the corresponding binary numbers for the data provided
+
+
+	_createClass(GenericBarcode, [{
+		key: "encode",
+		value: function encode() {
+			return {
+				data: "10101010101010101010101010101010101010101",
+				text: this.text
+			};
+		}
+
+		// Resturn true/false if the string provided is valid for this encoder
+
+	}, {
+		key: "valid",
+		value: function valid() {
+			return true;
+		}
+	}]);
+
+	return GenericBarcode;
+}(_Barcode3.default);
+
+exports.GenericBarcode = GenericBarcode;

+ 69 - 0
src/components/tki-barcode/barcodes/ITF/ITF.js

@@ -0,0 +1,69 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _constants = require('./constants');
+
+var _Barcode2 = require('../Barcode');
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var ITF = function (_Barcode) {
+	_inherits(ITF, _Barcode);
+
+	function ITF() {
+		_classCallCheck(this, ITF);
+
+		return _possibleConstructorReturn(this, (ITF.__proto__ || Object.getPrototypeOf(ITF)).apply(this, arguments));
+	}
+
+	_createClass(ITF, [{
+		key: 'valid',
+		value: function valid() {
+			return this.data.search(/^([0-9]{2})+$/) !== -1;
+		}
+	}, {
+		key: 'encode',
+		value: function encode() {
+			var _this2 = this;
+
+			// Calculate all the digit pairs
+			var encoded = this.data.match(/.{2}/g).map(function (pair) {
+				return _this2.encodePair(pair);
+			}).join('');
+
+			return {
+				data: _constants.START_BIN + encoded + _constants.END_BIN,
+				text: this.text
+			};
+		}
+
+		// Calculate the data of a number pair
+
+	}, {
+		key: 'encodePair',
+		value: function encodePair(pair) {
+			var second = _constants.BINARIES[pair[1]];
+
+			return _constants.BINARIES[pair[0]].split('').map(function (first, idx) {
+				return (first === '1' ? '111' : '1') + (second[idx] === '1' ? '000' : '0');
+			}).join('');
+		}
+	}]);
+
+	return ITF;
+}(_Barcode3.default);
+
+exports.default = ITF;

+ 55 - 0
src/components/tki-barcode/barcodes/ITF/ITF14.js

@@ -0,0 +1,55 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _ITF2 = require('./ITF');
+
+var _ITF3 = _interopRequireDefault(_ITF2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+// Calculate the checksum digit
+var checksum = function checksum(data) {
+	var res = data.substr(0, 13).split('').map(function (num) {
+		return parseInt(num, 10);
+	}).reduce(function (sum, n, idx) {
+		return sum + n * (3 - idx % 2 * 2);
+	}, 0);
+
+	return Math.ceil(res / 10) * 10 - res;
+};
+
+var ITF14 = function (_ITF) {
+	_inherits(ITF14, _ITF);
+
+	function ITF14(data, options) {
+		_classCallCheck(this, ITF14);
+
+		// Add checksum if it does not exist
+		if (data.search(/^[0-9]{13}$/) !== -1) {
+			data += checksum(data);
+		}
+		return _possibleConstructorReturn(this, (ITF14.__proto__ || Object.getPrototypeOf(ITF14)).call(this, data, options));
+	}
+
+	_createClass(ITF14, [{
+		key: 'valid',
+		value: function valid() {
+			return this.data.search(/^[0-9]{14}$/) !== -1 && +this.data[13] === checksum(this.data);
+		}
+	}]);
+
+	return ITF14;
+}(_ITF3.default);
+
+exports.default = ITF14;

+ 9 - 0
src/components/tki-barcode/barcodes/ITF/constants.js

@@ -0,0 +1,9 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+var START_BIN = exports.START_BIN = '1010';
+var END_BIN = exports.END_BIN = '11101';
+
+var BINARIES = exports.BINARIES = ['00110', '10001', '01001', '11000', '00101', '10100', '01100', '00011', '10010', '01010'];

+ 19 - 0
src/components/tki-barcode/barcodes/ITF/index.js

@@ -0,0 +1,19 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.ITF14 = exports.ITF = undefined;
+
+var _ITF = require('./ITF');
+
+var _ITF2 = _interopRequireDefault(_ITF);
+
+var _ITF3 = require('./ITF14');
+
+var _ITF4 = _interopRequireDefault(_ITF3);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+exports.ITF = _ITF2.default;
+exports.ITF14 = _ITF4.default;

+ 74 - 0
src/components/tki-barcode/barcodes/MSI/MSI.js

@@ -0,0 +1,74 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _Barcode2 = require("../Barcode.js");
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation
+// https://en.wikipedia.org/wiki/MSI_Barcode#Character_set_and_binary_lookup
+
+var MSI = function (_Barcode) {
+	_inherits(MSI, _Barcode);
+
+	function MSI(data, options) {
+		_classCallCheck(this, MSI);
+
+		return _possibleConstructorReturn(this, (MSI.__proto__ || Object.getPrototypeOf(MSI)).call(this, data, options));
+	}
+
+	_createClass(MSI, [{
+		key: "encode",
+		value: function encode() {
+			// Start bits
+			var ret = "110";
+
+			for (var i = 0; i < this.data.length; i++) {
+				// Convert the character to binary (always 4 binary digits)
+				var digit = parseInt(this.data[i]);
+				var bin = digit.toString(2);
+				bin = addZeroes(bin, 4 - bin.length);
+
+				// Add 100 for every zero and 110 for every 1
+				for (var b = 0; b < bin.length; b++) {
+					ret += bin[b] == "0" ? "100" : "110";
+				}
+			}
+
+			// End bits
+			ret += "1001";
+
+			return {
+				data: ret,
+				text: this.text
+			};
+		}
+	}, {
+		key: "valid",
+		value: function valid() {
+			return this.data.search(/^[0-9]+$/) !== -1;
+		}
+	}]);
+
+	return MSI;
+}(_Barcode3.default);
+
+function addZeroes(number, n) {
+	for (var i = 0; i < n; i++) {
+		number = "0" + number;
+	}
+	return number;
+}
+
+exports.default = MSI;

+ 33 - 0
src/components/tki-barcode/barcodes/MSI/MSI10.js

@@ -0,0 +1,33 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _MSI2 = require('./MSI.js');
+
+var _MSI3 = _interopRequireDefault(_MSI2);
+
+var _checksums = require('./checksums.js');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var MSI10 = function (_MSI) {
+	_inherits(MSI10, _MSI);
+
+	function MSI10(data, options) {
+		_classCallCheck(this, MSI10);
+
+		return _possibleConstructorReturn(this, (MSI10.__proto__ || Object.getPrototypeOf(MSI10)).call(this, data + (0, _checksums.mod10)(data), options));
+	}
+
+	return MSI10;
+}(_MSI3.default);
+
+exports.default = MSI10;

+ 35 - 0
src/components/tki-barcode/barcodes/MSI/MSI1010.js

@@ -0,0 +1,35 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _MSI2 = require('./MSI.js');
+
+var _MSI3 = _interopRequireDefault(_MSI2);
+
+var _checksums = require('./checksums.js');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var MSI1010 = function (_MSI) {
+	_inherits(MSI1010, _MSI);
+
+	function MSI1010(data, options) {
+		_classCallCheck(this, MSI1010);
+
+		data += (0, _checksums.mod10)(data);
+		data += (0, _checksums.mod10)(data);
+		return _possibleConstructorReturn(this, (MSI1010.__proto__ || Object.getPrototypeOf(MSI1010)).call(this, data, options));
+	}
+
+	return MSI1010;
+}(_MSI3.default);
+
+exports.default = MSI1010;

+ 33 - 0
src/components/tki-barcode/barcodes/MSI/MSI11.js

@@ -0,0 +1,33 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _MSI2 = require('./MSI.js');
+
+var _MSI3 = _interopRequireDefault(_MSI2);
+
+var _checksums = require('./checksums.js');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var MSI11 = function (_MSI) {
+	_inherits(MSI11, _MSI);
+
+	function MSI11(data, options) {
+		_classCallCheck(this, MSI11);
+
+		return _possibleConstructorReturn(this, (MSI11.__proto__ || Object.getPrototypeOf(MSI11)).call(this, data + (0, _checksums.mod11)(data), options));
+	}
+
+	return MSI11;
+}(_MSI3.default);
+
+exports.default = MSI11;

+ 35 - 0
src/components/tki-barcode/barcodes/MSI/MSI1110.js

@@ -0,0 +1,35 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _MSI2 = require('./MSI.js');
+
+var _MSI3 = _interopRequireDefault(_MSI2);
+
+var _checksums = require('./checksums.js');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var MSI1110 = function (_MSI) {
+	_inherits(MSI1110, _MSI);
+
+	function MSI1110(data, options) {
+		_classCallCheck(this, MSI1110);
+
+		data += (0, _checksums.mod11)(data);
+		data += (0, _checksums.mod10)(data);
+		return _possibleConstructorReturn(this, (MSI1110.__proto__ || Object.getPrototypeOf(MSI1110)).call(this, data, options));
+	}
+
+	return MSI1110;
+}(_MSI3.default);
+
+exports.default = MSI1110;

+ 29 - 0
src/components/tki-barcode/barcodes/MSI/checksums.js

@@ -0,0 +1,29 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+exports.mod10 = mod10;
+exports.mod11 = mod11;
+function mod10(number) {
+	var sum = 0;
+	for (var i = 0; i < number.length; i++) {
+		var n = parseInt(number[i]);
+		if ((i + number.length) % 2 === 0) {
+			sum += n;
+		} else {
+			sum += n * 2 % 10 + Math.floor(n * 2 / 10);
+		}
+	}
+	return (10 - sum % 10) % 10;
+}
+
+function mod11(number) {
+	var sum = 0;
+	var weights = [2, 3, 4, 5, 6, 7];
+	for (var i = 0; i < number.length; i++) {
+		var n = parseInt(number[number.length - 1 - i]);
+		sum += weights[i % weights.length] * n;
+	}
+	return (11 - sum % 11) % 11;
+}

+ 34 - 0
src/components/tki-barcode/barcodes/MSI/index.js

@@ -0,0 +1,34 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.MSI1110 = exports.MSI1010 = exports.MSI11 = exports.MSI10 = exports.MSI = undefined;
+
+var _MSI = require('./MSI.js');
+
+var _MSI2 = _interopRequireDefault(_MSI);
+
+var _MSI3 = require('./MSI10.js');
+
+var _MSI4 = _interopRequireDefault(_MSI3);
+
+var _MSI5 = require('./MSI11.js');
+
+var _MSI6 = _interopRequireDefault(_MSI5);
+
+var _MSI7 = require('./MSI1010.js');
+
+var _MSI8 = _interopRequireDefault(_MSI7);
+
+var _MSI9 = require('./MSI1110.js');
+
+var _MSI10 = _interopRequireDefault(_MSI9);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+exports.MSI = _MSI2.default;
+exports.MSI10 = _MSI4.default;
+exports.MSI11 = _MSI6.default;
+exports.MSI1010 = _MSI8.default;
+exports.MSI1110 = _MSI10.default;

+ 92 - 0
src/components/tki-barcode/barcodes/codabar/index.js

@@ -0,0 +1,92 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+exports.codabar = undefined;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _Barcode2 = require("../Barcode.js");
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding specification:
+// http://www.barcodeisland.com/codabar.phtml
+
+var codabar = function (_Barcode) {
+	_inherits(codabar, _Barcode);
+
+	function codabar(data, options) {
+		_classCallCheck(this, codabar);
+
+		if (data.search(/^[0-9\-\$\:\.\+\/]+$/) === 0) {
+			data = "A" + data + "A";
+		}
+
+		var _this = _possibleConstructorReturn(this, (codabar.__proto__ || Object.getPrototypeOf(codabar)).call(this, data.toUpperCase(), options));
+
+		_this.text = _this.options.text || _this.text.replace(/[A-D]/g, '');
+		return _this;
+	}
+
+	_createClass(codabar, [{
+		key: "valid",
+		value: function valid() {
+			return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/) !== -1;
+		}
+	}, {
+		key: "encode",
+		value: function encode() {
+			var result = [];
+			var encodings = this.getEncodings();
+			for (var i = 0; i < this.data.length; i++) {
+				result.push(encodings[this.data.charAt(i)]);
+				// for all characters except the last, append a narrow-space ("0")
+				if (i !== this.data.length - 1) {
+					result.push("0");
+				}
+			}
+			return {
+				text: this.text,
+				data: result.join('')
+			};
+		}
+	}, {
+		key: "getEncodings",
+		value: function getEncodings() {
+			return {
+				"0": "101010011",
+				"1": "101011001",
+				"2": "101001011",
+				"3": "110010101",
+				"4": "101101001",
+				"5": "110101001",
+				"6": "100101011",
+				"7": "100101101",
+				"8": "100110101",
+				"9": "110100101",
+				"-": "101001101",
+				"$": "101100101",
+				":": "1101011011",
+				"/": "1101101011",
+				".": "1101101101",
+				"+": "101100110011",
+				"A": "1011001001",
+				"B": "1001001011",
+				"C": "1010010011",
+				"D": "1010011001"
+			};
+		}
+	}]);
+
+	return codabar;
+}(_Barcode3.default);
+
+exports.codabar = codabar;

+ 34 - 0
src/components/tki-barcode/barcodes/index.js

@@ -0,0 +1,34 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+
+var _CODE = require('./CODE39/');
+
+var _CODE2 = require('./CODE128/');
+
+var _EAN_UPC = require('./EAN_UPC/');
+
+var _ITF = require('./ITF/');
+
+var _MSI = require('./MSI/');
+
+var _pharmacode = require('./pharmacode/');
+
+var _codabar = require('./codabar');
+
+var _GenericBarcode = require('./GenericBarcode/');
+
+exports.default = {
+	CODE39: _CODE.CODE39,
+	CODE128: _CODE2.CODE128, CODE128A: _CODE2.CODE128A, CODE128B: _CODE2.CODE128B, CODE128C: _CODE2.CODE128C,
+	EAN13: _EAN_UPC.EAN13, EAN8: _EAN_UPC.EAN8, EAN5: _EAN_UPC.EAN5, EAN2: _EAN_UPC.EAN2, 
+	UPC: _EAN_UPC.UPC, UPCE: _EAN_UPC.UPCE,
+	ITF14: _ITF.ITF14,
+	ITF: _ITF.ITF,
+	MSI: _MSI.MSI, MSI10: _MSI.MSI10, MSI11: _MSI.MSI11, MSI1010: _MSI.MSI1010, MSI1110: _MSI.MSI1110,
+	PHARMACODE: _pharmacode.pharmacode,
+	CODABAR: _codabar.codabar,
+	GENERICBARCODE: _GenericBarcode.GenericBarcode
+};

+ 73 - 0
src/components/tki-barcode/barcodes/pharmacode/index.js

@@ -0,0 +1,73 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+	value: true
+});
+exports.pharmacode = undefined;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _Barcode2 = require("../Barcode.js");
+
+var _Barcode3 = _interopRequireDefault(_Barcode2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation
+// http://www.gomaro.ch/ftproot/Laetus_PHARMA-CODE.pdf
+
+var pharmacode = function (_Barcode) {
+	_inherits(pharmacode, _Barcode);
+
+	function pharmacode(data, options) {
+		_classCallCheck(this, pharmacode);
+
+		var _this = _possibleConstructorReturn(this, (pharmacode.__proto__ || Object.getPrototypeOf(pharmacode)).call(this, data, options));
+
+		_this.number = parseInt(data, 10);
+		return _this;
+	}
+
+	_createClass(pharmacode, [{
+		key: "encode",
+		value: function encode() {
+			var z = this.number;
+			var result = "";
+
+			// http://i.imgur.com/RMm4UDJ.png
+			// (source: http://www.gomaro.ch/ftproot/Laetus_PHARMA-CODE.pdf, page: 34)
+			while (!isNaN(z) && z != 0) {
+				if (z % 2 === 0) {
+					// Even
+					result = "11100" + result;
+					z = (z - 2) / 2;
+				} else {
+					// Odd
+					result = "100" + result;
+					z = (z - 1) / 2;
+				}
+			}
+
+			// Remove the two last zeroes
+			result = result.slice(0, -2);
+
+			return {
+				data: result,
+				text: this.text
+			};
+		}
+	}, {
+		key: "valid",
+		value: function valid() {
+			return this.number >= 3 && this.number <= 131070;
+		}
+	}]);
+
+	return pharmacode;
+}(_Barcode3.default);
+
+exports.pharmacode = pharmacode;

+ 215 - 0
src/components/tki-barcode/tki-barcode.vue

@@ -0,0 +1,215 @@
+<template xlang="wxml" minapp="mpvue">
+  <view class="tki-barcode">
+    <!-- #ifndef MP-ALIPAY -->
+    <canvas
+      class="tki-barcode-canvas"
+      :canvas-id="cid"
+      :style="{width:canvasWidth+'px',height:canvasHeight+'px'}"
+    />
+    <!-- #endif -->
+    <!-- #ifdef MP-ALIPAY -->
+    <canvas
+      v-if="val === '' || defaultOpations.text === val"
+      :id="cid"
+      :width="canvasWidth"
+      :height="canvasHeight"
+      class="tki-barcode-canvas"
+    />
+    <!-- #endif -->
+    <image
+      v-show="show"
+      :src="result"
+      :style="{width:canvasWidth+'px',height:canvasHeight+'px',margin:'0 auto'}"
+    />
+  </view>
+</template>
+
+<script>
+// const barcode = require('./barcode.js');
+import barCode from "./barcode.js"
+const opations = {
+  // format: "CODE128",//选择要使用的条形码类型 微信支持的条码类型有 code128\code39\ena13\ean8\upc\itf14\
+  width: 4,//设置条之间的宽度
+  height: 120,//高度
+  displayValue: true,//是否在条形码下方显示文字
+  // text: "1234567890",//覆盖显示的文本
+  textAlign: "center",//设置文本的水平对齐方式
+  textPosition: "bottom",//设置文本的垂直位置
+  textMargin: 0,//设置条形码和文本之间的间距
+  fontSize: 24,//设置文本的大小
+  fontColor: "#000000",//设置文本的颜色
+  lineColor: "#000000",//设置条形码的颜色
+  background: "#FFFFFF",//设置条形码的背景色
+  margin: 0,//设置条形码周围的空白边距
+  marginTop: undefined,//设置条形码周围的上边距
+  marginBottom: undefined,//设置条形码周围的下边距
+  marginLeft: undefined,//设置条形码周围的左边距
+  marginRight: undefined,//设置条形码周围的右边距
+}
+export default {
+  name: "tkiBarcode",
+  props: {
+    show: {
+      type: Boolean,
+      default: true
+    },
+    cid: {
+      type: String,
+      default: 'tki-barcode-canvas'
+    },
+    unit: {
+      type: String,
+      default: 'upx'
+    },
+    val: {
+      type: String,
+      default: ''
+    },
+    format: {
+      type: String,
+      default: 'CODE128'
+    },
+    opations: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    },
+    onval: {
+      type: Boolean,
+      default: false
+    },
+    loadMake: {
+      type: Boolean,
+      default: true
+    },
+  },
+  data () {
+    return {
+      result: '',
+      canvasWidth: 0,
+      canvasHeight: 0,
+      defaultOpations: Object.assign({}, opations)
+    }
+  },
+  onUnload: function () {
+  },
+  methods: {
+    _makeCode () {
+      let that = this
+      // 合并参数
+      Object.assign(this.defaultOpations, this.opations)
+      if (that.unit == "upx") {
+				/* if (that.defaultOpations.width) {
+					that.defaultOpations.width = uni.upx2px(that.defaultOpations.width)
+				} */
+        if (that.defaultOpations.height) {
+          that.defaultOpations.height = uni.upx2px(that.defaultOpations.height)
+        }
+        if (that.defaultOpations.fontSize) {
+          that.defaultOpations.fontSize = uni.upx2px(that.defaultOpations.fontSize)
+        }
+      }
+      if (that._empty(that.defaultOpations.text)) {
+        that.defaultOpations.text = that.val
+      }
+      if (that._empty(that.defaultOpations.format)) {
+        that.defaultOpations.format = that.format
+      }
+      // console.log(JSON.stringify(that.defaultOpations))
+      this.$nextTick(() => {
+        setTimeout(() => {
+          new barCode(that, that.cid, that.defaultOpations,
+            function (res) { // 生成条形码款高回调
+              that.canvasWidth = res.width
+              that.canvasHeight = res.height
+            },
+            function (res) { // 生成条形码的回调
+              // 返回值
+              that._result(res)
+              // 重置默认参数
+              that.defaultOpations = opations
+            },
+          );
+        }, 100)
+      })
+    },
+    _clearCode () {
+      this._result('')
+    },
+    _saveCode () {
+      let that = this;
+      if (this.result != "") {
+        uni.saveImageToPhotosAlbum({
+          filePath: that.result,
+          success: function () {
+            uni.showToast({
+              title: '条形码保存成功',
+              icon: 'success',
+              duration: 2000
+            });
+          }
+        });
+      }
+    },
+    _result (res) {
+      this.result = res;
+      this.$emit('result', res)
+    },
+    _empty (v) {
+      let tp = typeof v,
+        rt = false;
+      if (tp == "number" && String(v) == "") {
+        rt = true
+      } else if (tp == "undefined") {
+        rt = true
+      } else if (tp == "object") {
+        if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
+      } else if (tp == "string") {
+        if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
+      } else if (tp == "function") {
+        rt = false
+      }
+      return rt
+    }
+  },
+  watch: {
+    val (n, o) {
+      this.defaultOpations.text = n
+      if (this.onval) {
+        if (n != o && !this._empty(n)) {
+          this._makeCode()
+        }
+      }
+    },
+    opations: {
+      handler (n, o) {
+        if (this.onval) {
+          if (!this._empty(n)) {
+            this._makeCode()
+          }
+        }
+      },
+      deep: true
+    }
+  },
+  mounted () {
+    if (this.loadMake) {
+      if (!this._empty(this.val)) {
+        this._makeCode()
+      }
+    }
+  },
+}
+</script>
+<style>
+.tki-barcode {
+  position: relative;
+}
+.tki-barcode-canvas {
+  position: fixed;
+  top: -99999upx;
+  left: -99999upx;
+  z-index: -99999;
+}
+</style>

+ 43 - 0
src/main.js

@@ -0,0 +1,43 @@
+import Vue from 'vue'
+import App from './App'
+import wechat from './utils/wechat.js'
+
+// #ifdef H5
+if (wechat.isWechat()) {
+  Vue.prototype.$wechat = wechat
+}
+// #endif
+Vue.config.productionTip = false
+
+Vue.mixin({
+  methods: {
+    setData: function(obj, callback) {
+      const that = this
+      let keys = []
+      let val, data
+      Object.keys(obj).forEach(function(key) {
+        keys = key.split('.')
+        val = obj[key]
+        data = that.$data
+        keys.forEach(function(key2, index) {
+          if (index + 1 == keys.length) {
+            that.$set(data, key2, val)
+          } else {
+            if (!data[key2]) {
+              that.$set(data, key2, {})
+            }
+          }
+          data = data[key2]
+        })
+      })
+      callback && callback()
+    }
+  }
+})
+
+App.mpType = 'app'
+
+const app = new Vue({
+  ...App
+})
+app.$mount()

+ 86 - 0
src/manifest.json

@@ -0,0 +1,86 @@
+{
+    "name" : "yamiduodianpushangcheng",
+    "appid" : "",
+    "description" : "",
+    "versionName" : "1.0.0",
+    "versionCode" : "100",
+    "transformPx" : false,
+    "app-plus" : {
+        "usingComponents" : true,
+        "nvueCompiler" : "uni-app",
+        "compilerVersion" : 3,
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true,
+            "waiting" : true,
+            "autoclose" : true,
+            "delay" : 0
+        },
+        "modules" : {},
+        "distribute" : {
+            "android" : {
+                "permissions" : [
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ]
+            },
+            "ios" : {},
+            "sdkConfigs" : {}
+        }
+    },
+    "quickapp" : {},
+    "mp-weixin" : {
+        "appid" : "wx102833aea7f4efa4",
+        "setting" : {
+            "urlCheck" : false
+        },
+        "usingComponents" : true,
+        "permission" : {
+            "scope.userLocation" : {
+                "desc" : "你的位置信息将用于小程序位置接口的效果展示"
+            }
+        }
+    },
+    "mp-alipay" : {
+        "usingComponents" : true
+    },
+    "mp-baidu" : {
+        "usingComponents" : true
+    },
+    "mp-toutiao" : {
+        "usingComponents" : true
+    },
+    "h5" : {
+        "title" : "首页",
+        "domain" : "h5.mall4j.com",
+        "router" : {
+            "base" : "/station/",
+            "mode" : "history"
+        },
+        "template" : "index.html",
+        "devServer": {
+            "port": 80,
+            "disableHostCheck": true
+        }
+    }
+		
+}

+ 75 - 0
src/pages.json

@@ -0,0 +1,75 @@
+{
+	"pages": [ // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+		{
+			"path": "pages/index/index",
+			"style": {
+				"navigationBarTitleText": "首页"
+			}
+		},
+		{
+			"path": "pages/account-login/account-login",
+			"style": {
+				"navigationBarTitleText": "登录"
+			}
+		},
+		{
+			"path": "pages/self-mention-order/self-mention-order",
+			"style": {
+				"navigationBarTitleText": "核销到店自提订单"
+			}
+		},
+		{
+			"path": "pages/order-list/order-list",
+			"style": {
+				"backgroundTextStyle": "light",
+				"navigationBarTitleText": "订单列表"
+			}
+		},
+		{
+			"path": "pages/order-detail/order-detail",
+			"style": {
+				"backgroundTextStyle": "light",
+				"navigationBarTitleText": "订单详情"
+			}
+		},
+		{
+			"path": "pages/shop-adminsistration/shop-adminsistration",
+			"style": {
+				"backgroundTextStyle": "light",
+				"navigationBarTitleText": "店铺管理"
+			}
+		},
+		{
+			"path": "pages/scan-pick/scan-pick",
+			"style": {
+				"backgroundTextStyle": "light",
+				"navigationBarTitleText": "核销订单"
+			}
+		},
+		{
+			"path": "pages/business-code/business-code",
+			"style": {
+				"backgroundTextStyle": "light",
+				"navigationBarTitleText": "商家码"
+			}
+		},
+		{
+			"path": "pages/pick-code/pick-code",
+			"style": {
+				"backgroundTextStyle": "light",
+				"navigationBarTitleText": "核销码核销"
+			}
+		}
+	],
+	"permission": {
+		"scope.userLocation": {
+			"desc": "位置信息"
+		}
+	},
+	"globalStyle": {
+		"navigationBarTextStyle": "black",
+		"navigationBarTitleText": "亚米商城门店端",
+		"navigationBarBackgroundColor": "#F8F8F8",
+		"backgroundColor": "#F8F8F8"
+	}
+}

+ 121 - 0
src/pages/account-login/account-login.css

@@ -0,0 +1,121 @@
+page{
+  background: #fff;
+  height: 100%;
+}
+.con{
+  padding-top: 100rpx;
+}
+.logo {
+  display: flex;
+  justify-content: center;
+  height: 150rpx;
+  margin-bottom: 8%;
+}
+.logo image {
+  display: block;
+  width: 100%;
+  height: 100%;
+}
+.login-form{
+  width: 90%;
+  margin: 0 auto;
+  margin-bottom: 20%;
+}
+.authorized-btn {
+  width: 90%;
+  margin: 0 auto;
+  text-align: center;
+  background-color: #0ab906;
+  border: 1rpx solid #0ab906;
+  color: #fff;
+  border-radius: 6rpx;
+  font-size: 26rpx;
+  padding: 8rpx;
+  margin-top: 80rpx;
+}
+.to-idx-btn{
+	width: 90%;
+	margin: 0 auto;
+	text-align: center;
+	background-color: #eeeeee;
+	color: #333;
+	border-radius: 6rpx;
+	font-size: 26rpx;
+	padding: 8rpx;
+	margin-top: 30rpx;
+}
+.form-title {
+  width: 100%;
+  margin-bottom: 50rpx;
+  font-size: 32rpx;
+  text-align: center;
+  color: #00a0e9;
+}
+.item {
+	display: block;
+	margin-bottom: 30rpx;
+}
+.account{
+  display: flex;
+  background: #f8f8f8;
+  padding: 15rpx;
+  box-sizing: border-box;
+  font-size: 26rpx;
+  align-items: center;
+}
+.account input{
+  padding-left: 20rpx;
+  width:75%;
+}
+.inp-palcehoder{
+  font-size: 26rpx;
+}
+.account input.int-yzm {
+  width: 410rpx;
+  padding-right: 10rpx;
+  box-sizing: border-box;
+}
+.input-btn {
+  width: 152rpx;
+  font-size: 26rpx;
+  color: #00a0ea;
+  text-align: center;
+}
+
+button::after{
+  border: 0 !important;
+}
+
+/* 找回密码&去注册 */
+.operate {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+}
+.forgot-password,
+.to-register {
+	font-size: 28rpx;
+	color: #00AAFF;
+}
+
+/* 错误提示 */
+.error .error-text {
+	display: block;
+	width: 100%;
+	font-size: 28rpx;
+	color: #e43130;
+  text-align: left;
+  margin-top: 10rpx;
+}
+.error .error-text .warning-icon {
+  display: inline-block;;
+  color: #fff;
+  width: 26rpx;
+  height: 26rpx;
+  line-height: 26rpx;
+  background: #e43130;
+  border-radius: 50%;
+  text-align: center;
+  margin-right: 12rpx;
+  font-size: 22rpx;
+}

+ 198 - 0
src/pages/account-login/account-login.vue

@@ -0,0 +1,198 @@
+<template>
+  <view class="con">
+    <view class="logo">
+      <image :src="stationLoginLogoImg" mode="heightFix" @tap="toIndex" />
+    </view>
+    <!-- 登录 -->
+    <view v-if="!isForgetPassword" class="login-form">
+      <view :class="['item',errorTips==1 && !isForgetPassword? 'error':'']">
+        <view class="account">
+          <text class="input-item">账号</text>
+          <input type="text" data-type="account" placeholder-class="inp-palcehoder" placeholder="请输入账号" @input="getInputVal">
+        </view>
+        <view v-if="errorTips==1 && !isForgetPassword" class="error-text"><text class="warning-icon">!</text>账号不能为空</view>
+      </view>
+      <view :class="['item',errorTips==2? 'error':'']">
+        <view class="account">
+          <text class="input-item">密码</text>
+          <input type="password" data-type="password" placeholder-class="inp-palcehoder" placeholder="请输入密码" @input="getInputVal">
+        </view>
+        <view v-if="errorTips==2" class="error-text"><text class="warning-icon">!</text>请输入密码</view>
+      </view>
+    </view>
+
+    <view v-if="!isForgetPassword">
+      <button class="authorized-btn" @tap="login">登录</button>
+    </view>
+  </view>
+</template>
+
+<script>
+var http = require('../../utils/http')
+import { encrypt } from '@/utils/crypto'
+
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+      principal: '',
+      credentials: '',
+      isForgetPassword: false, // 是否修改密码
+      isPersonalCenter: false, // 是否从个人中心页面跳转过来
+      stationLoginLogoImg: '',
+      errorTips: 0 // 错误提示
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function(options) {
+    if (options.isForgetPassword) {
+      this.isForgetPassword = options.isForgetPassword
+    }
+    if (options.isPersonalCenter) {
+      this.isPersonalCenter = options.isPersonalCenter
+    }
+    this.getUniWebConfig()
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function() {},
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function() {},
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function() {},
+
+  /**
+		 * 生命周期函数--监听页面卸载
+		 */
+  onUnload: function() {},
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function() {},
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function() {},
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function() {},
+
+  methods: {
+
+    /**
+     * 初始加载数据
+     */
+    getUniWebConfig: function() {
+      var params = {
+        url: '/webConfig/getStationWebConfig',
+        method: 'GET',
+        data: {},
+        callBack: res => {
+          this.setData({
+            stationLoginLogoImg: res.stationLoginLogoImg
+          })
+          uni.setStorageSync('stationLoginLogoImg', this.stationLoginLogoImg)
+        }
+      }
+      http.request(params)
+    },
+    /**
+     * 输入框的值
+     */
+    getInputVal: function(e) {
+      const type = e.currentTarget.dataset.type
+      if (type == 'account') {
+        this.setData({
+          principal: e.detail.value
+        })
+      } else if (type == 'password') {
+        this.setData({
+          credentials: e.detail.value
+        })
+      }
+    },
+
+    /**
+     * 登录
+     */
+    login() {
+      if (!this.principal) {
+        this.setData({
+          errorTips: 1
+        })
+        return
+      } else if (this.credentials.length == 0) {
+        this.setData({
+          errorTips: 2
+        })
+        return
+      } else {
+        this.setData({
+          errorTips: 0
+        })
+        var params = {
+          url: '/stationLogin',
+          method: 'POST',
+          data: {
+            userName: this.principal,
+            passWord: encrypt(this.credentials),
+            tempUid: uni.getStorageSync('sTempUid')
+          },
+          callBack: res => {
+            http.loginSuccess(res, () => {
+              uni.showToast({
+                title: '登录成功!',
+                icon: 'none',
+                complete() {
+                  uni.reLaunch({
+                    url: '/pages/index/index'
+                  })
+                }
+              })
+            })
+          }
+        }
+        http.request(params)
+      }
+    },
+
+    /**
+     * 修改密码(登录页修改密码按钮)
+     */
+    forgotPassword() {
+      this.setData({
+        isForgetPassword: true
+      })
+    },
+
+    /**
+     * 回到首页
+     */
+    toIndex() {
+      wx.navigateTo({
+        url: '/pages/index/index'
+      })
+    }
+
+  }
+}
+</script>
+<style>
+	@import "./account-login.css";
+</style>

+ 129 - 0
src/pages/business-code/business-code.css

@@ -0,0 +1,129 @@
+page {
+  background: #f4f4f4;
+}
+
+image {
+  width: 100%;
+  height: 100%;
+}
+
+.delivery-certificate {
+  margin: 30rpx;
+  padding: 30rpx;
+  background: #fff;
+  font-size: 24rpx;
+  border-radius: 10rpx;
+  box-shadow: 0 0 6rpx rgba(0,0,0,0.05);
+}
+
+.delivery-certificate .item {
+  position: relative;
+  border-bottom: 2rpx dashed #ddd;
+}
+
+.delivery-certificate .item::before,
+.delivery-certificate .item::after {
+  position: absolute;
+  bottom: -20rpx;
+  display: block;
+  width: 40rpx;
+  height: 40rpx;
+  border-radius: 50%;
+  background: #f4f4f4;
+  content: " ";
+  font-size: 0;
+}
+
+.delivery-certificate .item::before {
+  left: -56rpx;
+}
+
+.delivery-certificate .item::after {
+  right: -56rpx;
+}
+
+.delivery-certificate .address-box {
+  padding-bottom: 30rpx;
+}
+.delivery-certificate .address-box .name {
+  font-size: 28rpx;
+  display: flex;
+  align-items: center;
+  margin-bottom: 20rpx;
+  font-weight: 600;
+}
+
+.delivery-certificate .address-box .name .self-icon {
+  padding: 2rpx 6rpx;
+  line-height: 1;
+  color: #e43130;
+  border: 2rpx solid #e43130;
+  font-size: 20rpx;
+  margin-left: 10rpx;
+  border-radius: 4rpx;
+  font-weight: 400;
+}
+
+.delivery-certificate .address-box .a-item {
+  margin-bottom: 10rpx;
+  display: flex;
+}
+
+.delivery-certificate .address-box .a-item .img {
+  width: 24rpx;
+  height: 24rpx;
+  font-size: 0;
+  margin-right: 10rpx;
+  margin-top: 4rpx;
+}
+
+.delivery-certificate .address-box .a-item .text {
+  flex: 1;
+}
+
+.delivery-certificate .code-det {
+  padding: 40rpx 0;
+}
+
+.delivery-certificate .code-det .bar-code {
+  font-size: 0;
+  margin: auto;
+  width: 610rpx;
+  height: 150rpx;
+}
+
+.delivery-certificate .code-det .code-number {
+  margin-top: 20rpx;
+  text-align: center;
+}
+
+.delivery-certificate .code-det .code {
+  width: 300rpx;
+  height: 300rpx;
+  margin: 40rpx auto 0;
+}
+
+.delivery-certificate .btn-box {
+  margin-top: 30rpx;
+  display: flex;
+  justify-content: center;
+}
+
+.btn {
+  width: auto;
+  text-align: center;
+  /* height: 70rpx; */
+  /* line-height: 70rpx; */
+	font-size: 26rpx;
+  font-weight: bold;
+  border-radius: 70rpx;
+}
+
+.code .qrcode-img{
+	display: block;
+	width: 100%;
+	height: 100%;
+}
+
+
+

+ 87 - 0
src/pages/business-code/business-code.vue

@@ -0,0 +1,87 @@
+<template>
+  <view class="container">
+    <view class="delivery-certificate">
+      <view class="address-box item">
+        <view class="btn">商家码</view>
+      </view>
+      <view class="code-det item">
+        <view class="bar-code">
+          <tki-barcode
+            ref="barcode"
+            onval
+            :val="stationId"
+            :load-make="true"
+            :opations="barOpations"
+          />
+        </view>
+        <!-- <view class="code-number">自提点id:{{stationId}}</view> -->
+        <view class="code">
+          <image :src="stationQrCode" />
+        </view>
+      </view>
+      <view class="btn-box">
+        扫码一键核销
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import tkiBarcode from '@/components/tki-barcode/tki-barcode'
+const Qr = require('../../utils/wxqrcode.js')
+const http = require('../../utils/http.js')
+
+export default {
+  components: {
+    tkiBarcode
+  },
+  data() {
+    return {
+      shopId: '', // 店铺id
+      stationId: '', // 自提点id
+      stationQrCode: '', // 自提点id码
+      barOpations: {
+        height: 150,
+        displayValue: false
+      }
+    }
+  },
+  /**
+	 * 生命周期函数--监听页面加载
+	 */
+  onLoad: function(options) {
+    this.getBusCodeInf()
+  },
+  methods: {
+    /* 请求自提点码信息 */
+    getBusCodeInf: function() {
+      uni.showLoading()
+      var param = {
+        url: '/p/station/getCode',
+        method: 'GET',
+        data: {},
+        callBack: res => {
+          const shopId = res.split('#station#')[0]
+          const stationId = res.split('#station#')[1]
+          this.shopId = shopId
+          this.stationId = stationId
+          // 请求到自提点码信息,执行生成二维码函数
+          setTimeout(() => {
+            this.getQrcode()
+          }, 50)
+          uni.hideLoading()
+        }
+      }
+      http.request(param)
+    },
+    /* 生成二维码 */
+    getQrcode: function() {
+      this.stationQrCode = Qr.createQrCodeImg(this.stationId)
+    }
+  }
+}
+</script>
+
+<style>
+@import "./business-code.css";
+</style>

+ 192 - 0
src/pages/index/index.css

@@ -0,0 +1,192 @@
+/* 照片默认样式 */
+image {
+  display: block;
+  width: 100%;
+  height: 100%;
+}
+
+/* 自提点信息or业绩 */
+.shop-data {
+  display: block;
+  width: 100%;
+  height: auto;
+  min-height: 640rpx;
+  box-sizing: border-box;
+  color: #fff;
+}
+.bg {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 351px;
+  z-index: -1;
+}
+/* 自提点信息 */
+.data-top {
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	font-size: 15px;
+  padding: 10px;
+}
+.shop-info {
+  display: flex;
+  align-items: center;
+	width: 100%;
+}
+.shop-info .shop-icon {
+  display: block;
+  width: 120rpx;
+  height: 120rpx;
+	border-radius: 60rpx;
+	margin-right: 20rpx;
+	overflow: hidden;
+}
+.shop-info .shop-name{
+	width: auto;
+	max-width: 400rpx;
+	word-break: break-all;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	display: -webkit-box;
+	-webkit-line-clamp: 2;
+	-webkit-box-orient: vertical;
+}
+.switch-num{
+	display: flex;
+	align-items: center;
+  margin-left: auto;
+}
+.search {
+  display: flex;
+  align-items: center;
+  width: 45%;
+  height: 35px;
+  background: rgba(255,255,255,.2);
+  border-radius: 60px;
+  box-sizing: border-box;
+  padding: 8px 10px;
+}
+.search-icon {
+  display: block;
+  width: 20px;
+  height: 15px;
+  padding-right: 5px;
+}
+/* 业绩信息 */
+.achievement {
+  margin-top: 15px;
+  padding: 10px;
+  font-size: 15px;
+  min-height: 510rpx;
+}
+.a-title {
+  display: flex;
+  align-items: center;
+}
+.a-title .tit {
+  font-size: 15px;
+  padding-right: 30px;
+}
+.a-edit {
+  display: flex;
+  align-items: center;
+  font-size: 14px;
+}
+.a-edit .edit-icon {
+  display: block;
+  width: 14px;
+  height: 14px;
+  padding-left: 5px;
+}
+.data-table {
+  margin: 20px 0;
+}
+.data-table .data-line {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.data-table .data-line:first-child {
+  min-height: 156rpx;
+  padding-bottom: 5px;
+  border-bottom: 1px solid rgba(255,255,255,.2);
+  margin-bottom: 20px;
+}
+.data-table .data-line .data-block {
+  position: relative;
+  flex: 1;
+  flex-wrap: wrap;
+  text-align: center;
+}
+.data-table .data-line .dividing::before,
+.data-table .data-line .dividing::after {
+  display: block;
+  content: '';
+  position: absolute;
+  bottom: 15px;
+  width: 1px;
+  height: 26px;
+  background: rgba(255, 255, 255, .2);
+}
+.dividing::before {
+  left: 0;
+}
+.dividing::after {
+  right: 0;
+}
+.data-table .data-line .data-block .data-tit {
+  font-size: 12px;
+  padding-bottom: 15px;
+}
+.data-table .data-line .data-block .data-cont {
+  font-size: 20px;
+  font-weight: bold;
+  margin-bottom: 15px;
+  padding: 0 5px;
+  max-width: 110px;
+  word-break: break-word;
+  /* box-sizing: border-box;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis; */
+}
+.data-cont::after {
+  width: 1px;
+  height: 20px;
+  background: rgba(255, 255, 255, .2);
+}
+/* /自提点信息or业绩 */
+
+/* 常用应用 */
+.commom-app {
+  margin-top: 40px;
+}
+.commom-tit {
+  font-size: 15px;
+  font-weight: bold;
+  padding-bottom: 20px;
+  border-bottom: 1px solid #eee;
+  margin: 0 15px ;
+  margin-bottom: 25px;
+}
+.app-list {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.app-item {
+  width: 30%;
+  text-align: center;
+  font-size: 13px;
+}
+.app-item > image {
+  display: inline-block;
+  width: 50px;
+  height: 50px;
+  text-align: center;
+  margin-bottom: 15px;
+}
+/* /常用应用 */
+

+ 203 - 0
src/pages/index/index.vue

@@ -0,0 +1,203 @@
+<template>
+  <view class="my-shop-wrapper">
+    <view class="shop-data">
+      <view class="bg">
+        <image src="/static/images/icon/my-shop-bg.png" />
+      </view>
+      <!-- 自提点信息 -->
+      <view class="data-top">
+        <view class="shop-info">
+          <view v-if="imgPath" class="shop-icon"><image :src="imgUrl" /></view>
+          <view class="shop-name">{{ stationName }}</view>
+          <view class="switch-num" @tap="switchNum">
+            <image src="/static/images/icon/switch.png" style="width: 32rpx;height: 32rpx" />
+            <view>切换账号</view>
+          </view>
+        </view>
+      </view>
+      <!-- 日/月业绩信息 -->
+      <view class="achievement">
+        <view class="a-title">
+          <view class="tit">本店业绩</view>
+        </view>
+        <view class="data-table">
+          <view class="data-line">
+            <view class="data-block">
+              <view class="data-tit">(日)支付订单数</view>
+              <view class="data-cont">{{ dayTurnover.payOrderNumber }}</view>
+            </view>
+            <view class="data-block dividing">
+              <view class="data-tit">支付金额(元)</view>
+              <view class="data-cont">{{ dayTurnover.payAmount }}</view>
+            </view>
+            <view class="data-block">
+              <view class="data-tit">客单价(元)</view>
+              <view class="data-cont">{{ dayTurnover.customerUnitPrice }}</view>
+            </view>
+          </view>
+          <view class="data-line">
+            <view class="data-block">
+              <view class="data-tit">(月)支付订单数</view>
+              <view class="data-cont">{{ monthTurnover.payOrderNumber }}</view>
+            </view>
+            <view class="data-block dividing">
+              <view class="data-tit">支付金额(元)</view>
+              <view class="data-cont">{{ monthTurnover.payAmount }}</view>
+            </view>
+            <view class="data-block">
+              <view class="data-tit">客单价(元)</view>
+              <view class="data-cont">{{ monthTurnover.customerUnitPrice }}</view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <!-- 常见应用 -->
+    <view class="commom-app">
+      <view class="commom-tit">常见应用</view>
+      <view class="app-list">
+        <view class="app-item" @tap="toShopAdministration">
+          <image src="/static/images/icon/ms-shop-manage.png" />
+          <view class="app-name">店铺管理</view>
+        </view>
+        <view class="app-item" @tap="toOrderAdministration">
+          <image src="/static/images/icon/ms-order.png" />
+          <view class="app-name">订单管理</view>
+        </view>
+        <view class="app-item" @tap="scanCode">
+          <image src="/static/images/icon/ms-scan.png" />
+          <view class="app-name">验证核销</view>
+        </view>
+        <view class="app-item" @tap="toBusinessCode">
+          <image src="/static/images/icon/ms-code.png" />
+          <view class="app-name">商家码</view>
+        </view>
+        <view class="app-item" @tap="toPinkCode">
+          <image src="/static/images/icon/pickCode.png" />
+          <view class="app-name">核销码</view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import Wechat from '../../utils/wechat.js'
+const util = require('../../utils/util.js')
+const http = require('../../utils/http.js')
+const config = require('../../utils/config.js')
+
+export default {
+  data() {
+    return {
+      stationName: '',		 // 自提点名称
+      imgUrl: '',					 // 自提点logo
+      imgPath: '',				 // 自提点logo的path
+      dayTurnover: [],		 // 日营业额
+      monthTurnover: []		 // 月营业额
+    }
+  },
+  /**
+	 * 生命周期函数--监听页面加载
+	 */
+  onShow: function() {
+    this.getIndexData()
+  },
+  methods: {
+    /* 自提点首页数据 */
+    getIndexData: function() {
+      uni.showLoading()
+      const param = {
+        url: '/p/station/getStationIndexInfo',
+        method: 'GET',
+        data: {},
+        callBack: res => {
+          // 自提点信息赋值
+          this.stationName = res.stationName
+          this.imgPath = res.pic
+          this.imgUrl = config.picDomain + res.pic
+          for (var i = 0; i < res.stationSalesDtoList.length; i++) {
+            const salesType = res.stationSalesDtoList[i].salesType
+            if (salesType == 1) {
+              this.dayTurnover = res.stationSalesDtoList[i]
+            } else if (salesType == 2) {
+              this.monthTurnover = res.stationSalesDtoList[i]
+            }
+          }
+          uni.hideLoading()
+        }
+      }
+      http.request(param)
+    },
+    /* 切换账号 */
+    switchNum: function() {
+      // 清除登录缓存
+      uni.removeStorageSync('stationLoginResult')
+      uni.removeStorageSync('stationToken')
+      uni.removeStorageSync('stationHadLogin')
+      uni.redirectTo({
+        url: '/pages/account-login/account-login'
+      })
+    },
+    /* 跳转店铺管理页 */
+    toShopAdministration: function() {
+      uni.navigateTo({
+        url: '/pages/shop-adminsistration/shop-adminsistration'
+      })
+    },
+    /* 跳转订单管理页 */
+    toOrderAdministration: function() {
+      uni.navigateTo({
+        url: '/pages/order-list/order-list'
+      })
+    },
+    /* 跳转商家码页 */
+    toBusinessCode: function() {
+      uni.navigateTo({
+        url: '/pages/business-code/business-code'
+        // url: '/pages/scan-pick/scan-pick'
+      })
+    },
+    /* 跳转提货码取件页 */
+    toPinkCode: function() {
+      uni.navigateTo({
+        url: '/pages/pick-code/pick-code'
+      })
+    },
+    /* 唤醒扫码功能 */
+    scanCode: util.debounce(function() {
+      // #ifdef H5
+      if (!Wechat.isWechat()) {
+        uni.showToast({
+          title: '请在微信浏览器打开!',
+          icon: 'none'
+        })
+        return
+      }
+      Wechat.scanQRCode((codeStr) => {
+        let code = ''
+        // 处理扫码结果
+        if (codeStr.indexOf(',') > -1) {
+          code = codeStr.split(',')[1]
+        } else {
+          code = codeStr
+        }
+        // 扫码后跳转核销页面
+        uni.navigateTo({
+          url: '/pages/scan-pick/scan-pick?pickCode=' + code + '&pageType=1'
+        })
+      }, () => {
+        uni.showToast({
+          title: '唤起扫码失败,请稍后重试',
+          icon: 'none'
+        })
+      })
+      // #endif
+    }, 1000)
+  }
+}
+</script>
+
+<style>
+@import "./index.css";
+</style>

+ 718 - 0
src/pages/order-detail/order-detail.css

@@ -0,0 +1,718 @@
+/* pages/order-detail/order-detail.wxss */
+
+page {
+  background: #f4f4f4;
+}
+
+image {
+  width: 100%;
+  height: 100%;
+}
+
+.order-detail {
+  margin-bottom: 132rpx;
+}
+
+/*  地址  */
+/* .order-detail .delivery-addr {
+  padding: 20rpx 30rpx;
+  background: #fff;
+}
+.order-detail .delivery-addr .user-info {
+  line-height: 48rpx;
+  word-wrap: break-word;
+  word-break: break-all;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+}
+.order-detail .delivery-addr .user-info .item {
+  font-size: 28rpx;
+  margin-right: 30rpx;
+  vertical-align: top;
+  display: inline-block;
+}
+.order-detail .delivery-addr .addr {
+  font-size: 28rpx;
+  line-height: 36rpx;
+  color: #777777;
+} */
+
+
+/* 订单状态 */
+.order-detail .order-status {
+  position: relative;
+  padding: 30rpx 20rpx;
+  background: #fff;
+}
+
+.order-detail .order-status .status-bg {
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 168rpx;
+  font-size: 0;
+}
+
+.order-detail .order-status .status-text {
+  font-size: 36rpx;
+  font-weight: 600;
+  color: #fff;
+  margin: 26rpx 30rpx 24rpx;
+  position: relative;
+}
+
+.order-detail .order-status .step {
+  position: relative;
+  display: flex;
+  align-items: center;
+  margin-top: 50rpx;
+}
+
+.order-detail .order-status .step .item {
+  flex: 1;
+}
+
+.order-detail .order-status .step .item .select {
+  width: 12rpx;
+  height: 12rpx;
+  border: 16rpx solid #fff;
+  background: #999;
+  margin: auto;
+  border-radius: 50%;
+  position: relative;
+}
+
+.order-detail .order-status .step .item .des {
+  font-size: 24rpx;
+  margin-top: 10rpx;
+  text-align: center;
+}
+
+.order-detail .order-status .step .item.active .select {
+  background: #e43130;
+  width: 32rpx;
+  height: 32rpx;
+  border: 6rpx solid #fff;
+  color: #fff;
+}
+
+.order-detail .order-status .step .item.active .select::after {
+  content: '\EA08';
+  font: 20rpx/1 uni;
+  position: absolute;
+  left: 50%;
+  top: 50%;
+  transform: translate(-50%, -50%);
+}
+
+.order-detail .order-status .step .item.active .des {
+  color: #e43130;
+}
+
+/* 配送地址 */
+.order-detail .address-box {
+  margin-top: 20rpx;
+  background: #fff;
+  padding: 30rpx 30rpx 30rpx 70rpx;
+  position: relative;
+}
+
+.order-detail .address-box .img {
+  position: absolute;
+  left: 30rpx;
+  top: 36rpx;
+  width: 28rpx;
+  height: 28rpx;
+  font-size: 0;
+}
+
+.order-detail .address-box .user-info {
+  display: flex;
+  align-items: baseline;
+  font-weight: 600;
+  font-size: 28rpx;
+}
+
+.order-detail .address-box .user-info .phone {
+  font-family: arial;
+  margin-left: 30rpx;
+}
+
+.order-detail .address-box .address-detail {
+  font-size: 24rpx;
+  color: #999;
+  margin-top: 10rpx;
+}
+
+/* 自提地址 */
+.order-detail .delivery-certificate {
+  margin-top: 20rpx;
+  background: #fff;
+  padding: 0 30rpx 30rpx;
+}
+
+.order-detail .delivery-certificate .tit {
+  font-size: 28rpx;
+  font-weight: 600;
+  padding: 30rpx 0;
+}
+
+.order-detail .delivery-certificate .address {
+  display: flex;
+}
+
+.order-detail .delivery-certificate .address .text {
+  flex: 1;
+  font-size: 24rpx;
+  color: #999;
+}
+
+.order-detail .delivery-certificate .address .icon-box {
+  display: flex;
+  align-items: center;
+}
+
+.order-detail .delivery-certificate .address .icon-box .icon {
+  width: 28rpx;
+  height: 28rpx;
+  font-size: 0;
+  padding: 0 20rpx;
+}
+
+.order-detail .delivery-certificate .address .icon-box .icon.bl {
+  border-left: 2rpx solid #eee;
+}
+
+.order-detail .delivery-certificate .code-box {
+  margin-top: 30rpx;
+  padding: 30rpx 20rpx;
+  box-shadow: 0 0 8rpx rgba(0, 0, 0, 0.1);
+  display: flex;
+  align-items: center;
+  font-size: 24rpx;
+  border-radius: 10rpx;
+}
+
+.order-detail .delivery-certificate .code-det {
+  position: relative;
+}
+
+.order-detail .delivery-certificate .code-det::after {
+  position: absolute;
+  right: 30rpx;
+  top: 50%;
+  display: block;
+  width: 12rpx;
+  height: 12rpx;
+  content: " ";
+  font-size: 0;
+  border-top: 2rpx solid #333;
+  border-right: 2rpx solid #333;
+  transform: rotate(45deg) translateY(-50%);
+}
+
+.order-detail .delivery-certificate .code-box.no-code {
+  padding: 0;
+  box-shadow: none;
+}
+
+.order-detail .delivery-certificate .code-box .code {
+  width: 140rpx;
+  height: 140rpx;
+  font-size: 0;
+  margin-right: 16rpx;
+}
+
+.order-detail .delivery-certificate .code-box .text-box {
+  flex: 1;
+}
+
+.order-detail .delivery-certificate .code-box .text-box .item {
+  display: flex;
+  line-height: 48rpx;
+}
+
+.order-detail .delivery-certificate .code-box .text-box .item .i-lable {
+  color: #999;
+  text-align: justify;
+  width: 61px;
+  height: 48rpx;
+  overflow: hidden;
+}
+
+.order-detail .delivery-certificate .code-box .text-box .item .i-lable::after {
+  content: " ";
+  display: inline-block;
+  padding-left: 100%;
+}
+
+.order-detail .delivery-certificate .code-box .text-box .item .fw {
+  font-weight: 600;
+}
+
+.order-detail .delivery-certificate .code-box .text-box .item .i-text {
+  flex: 1;
+}
+
+/* 商品列表 */
+.prod-item {
+  background: #fff;
+  margin-top: 20rpx;
+  font-size: 24rpx;
+  padding: 0 30rpx;
+}
+
+.prod-item .shop-box {
+  padding: 24rpx 0;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.prod-item .shop-box .refund-sts {
+  color: #e43130;
+}
+
+.prod-item .shop-icon {
+  width: 24rpx;
+  height: 24rpx;
+  margin-right: 10rpx;
+}
+
+.prod-item .shop-name {
+  flex: 1;
+  font-weight: 600;
+}
+
+.prod-item .prod-box {
+  padding: 30rpx 0;
+  border-top: 2rpx solid #eee;
+}
+.prod-item .item-cont {
+  position: relative;
+  display: flex;
+}
+
+.prod-item .item-cont .prod-pic {
+  font-size: 0;
+  width: 180rpx;
+  height: 180rpx;
+}
+
+.prod-item .item-cont .prod-info {
+  flex: 1;
+  margin-left: 20rpx;
+  position: relative;
+}
+
+.prod-item .item-cont .prod-info .prodname {
+  display: flex;
+  align-items: flex-start;
+}
+
+.prod-item .item-cont .prod-info .prodname .a-icon {
+  margin-right: 10rpx;
+  font-size: 20rpx;
+  color: #fff;
+  background: #e43130;
+  padding: 4rpx 10rpx;
+  border-radius: 4rpx;
+  line-height: 20rpx;
+  margin-top: 4rpx;
+}
+
+.prod-item .item-cont .prod-info .prodname .text {
+  line-height: 36rpx;
+  max-height: 72rpx;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+  text-overflow: ellipsis;
+  word-break: break-all;
+}
+
+.prod-item .item-cont .prod-info .sku-name {
+  margin-top: 10rpx;
+  color: #999;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+  text-overflow: ellipsis;
+  word-break: break-all;
+}
+
+.prod-item .price-nums {
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  width: 100%;
+  display: flex;
+  align-items: baseline;
+}
+
+.prod-item .price-nums .prodprice {
+  color: #e43130;
+  margin-right: 10rpx;
+}
+
+.prod-item .price-nums .number {
+  color: #999;
+}
+
+.prod-item .apply-refund-btn {
+  position: absolute;
+  right: 0;
+  bottom: 28rpx;
+  font-size: 24rpx;
+  padding: 6rpx 20rpx;
+  color: #e43130;
+  border: 2rpx solid #e43130;
+  border-radius: 30rpx;
+}
+
+/* 订单信息 */
+.order-msg {
+  background: #fff;
+  margin-top: 20rpx;
+  font-size: 24rpx;
+  padding: 0 30rpx;
+}
+
+.order-msg .msg-item {
+  padding: 20rpx 0;
+  border-top: 2rpx solid #eee;
+}
+
+.order-msg .msg-item:first-child {
+  border: 0;
+}
+
+.order-msg .msg-item .item {
+  position: relative;
+  display: flex;
+  /* align-items: center; */
+  padding: 10rpx 0;
+}
+
+.order-msg .msg-item .item .item-tit {
+  color: #999;
+}
+
+.order-msg .msg-item .item .item-txt {
+  flex: 1;
+}
+.order-msg .msg-item .item .remarks-tit {
+  width: 120rpx;
+}
+
+.order-msg .msg-item .item .remarks-txt {
+	width: 400rpx;
+	word-wrap: break-word;
+	word-break: break-all;
+	overflow: hidden;
+	line-height: 38rpx;
+}
+
+.order-msg.payment .msg-item .item .item-txt {
+  text-align: right;
+}
+
+.order-msg.payment .msg-item .item .item-txt .gray {
+  color: #333;
+}
+
+.order-msg .msg-item .item .copy-btn {
+  display: block;
+  margin-left: 20rpx;
+  border: 2rpx solid #bbb;
+  padding: 6rpx 24rpx;
+  border-radius: 50rpx;
+  font-size: 24rpx;
+}
+
+
+/* 底部栏 */
+.order-detail-footer {
+  position: fixed;
+  bottom: 0;
+  width: 100%;
+  background: #fff;
+  display: flex;
+  justify-content: flex-end;
+  padding: 20rpx 0;
+  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
+}
+
+.order-detail-footer .refund-full {
+  font-size: 28rpx;
+  border-radius: 50rpx;
+  border: 2rpx solid #e43130;
+  margin-right: 20rpx;
+  background: #fff;
+  height: 70rpx;
+  line-height: 70rpx;
+  box-sizing: border-box;
+  padding: 0 30rpx;
+  color: #e43130;
+}
+
+.order-detail-footer .group-det {
+  font-size: 28rpx;
+  border-radius: 50rpx;
+  border: 2rpx solid #ddd;
+  margin-right: 20rpx;
+  background: #fff;
+  height: 70rpx;
+  line-height: 70rpx;
+  box-sizing: border-box;
+  padding: 0 30rpx;
+}
+
+.code .qrcode-img{
+	display: block;
+	width: 100%;
+	height: 100%;
+}
+
+/* 全部留言(虚拟商品) */
+.order-msg .msg-item .item.all-msg {
+  position: relative;
+}
+.order-msg .msg-item .item.all-msg .item-txt {
+  word-break: break-word;
+  display: grid;
+  line-height: 1.5em;
+}
+.order-msg .msg-item .item.all-msg .item-txt.pd {
+  padding-right: 32rpx;
+}
+.order-msg .msg-item .item.all-msg .more-msg::after{
+	position: absolute;
+	right: 8rpx;
+	top: 45%;
+	display: block;
+	width: 14rpx;
+	height: 14rpx;
+	border: 2rpx solid #666;
+	border-width: 2rpx 2rpx 0 0;
+	content: " ";
+	font-size: 0;
+	transform: rotate(45deg) translateY(-50%);
+}
+/* 查看留言弹窗 */
+.popup-hide {
+	position: fixed;
+	top: 0;
+	bottom: 0;
+	left: 0;
+	right: 0;
+	z-index: 999;
+	background-color: rgba(0, 0, 0, 0.3);
+}
+.popup-box {
+	position: absolute;
+	bottom: 0;
+	width: 100%;
+	height: 80%;
+	overflow: hidden;
+	background-color: #fff;
+	border-radius: 10rpx 10rpx 0 0;
+}
+.popup-hide .con-tit {
+	display: flex;
+	justify-content: space-around;
+	align-items: center;
+	font-size: 28rpx;
+	font-weight: bold;
+	padding: 30rpx;
+}
+.popup-hide .con-tit .sure {
+	font-size: 0;
+	width: 32rpx;
+	height: 32rpx;
+}
+.popup-hide .con-tit .sure image {
+	width: 100%;
+	height: 100%;
+}
+.popup-hide .con-tit .tit-text {
+	flex: 1;
+	text-align: center;
+}
+.close {
+	color: #666;
+	font-size: 32rpx;
+}
+.close::before {
+	content: "\2715";
+}
+.popup-hide .virtual-goods-msg-pop {
+	height: auto;
+}
+.popup-hide .virtual-goods-msg-pop .con-tit .tit-text {
+	text-align: left;
+}
+.popup-hide .virtual-goods-msg-pop .msg-pop-con .msg-list {
+	padding: 20rpx 30rpx;
+	margin-bottom: 140rpx;
+}
+.popup-hide .virtual-goods-msg-pop .msg-pop-con .msg-item {
+	display: flex;
+	margin-bottom: 30rpx;
+}
+.popup-hide .virtual-goods-msg-pop .msg-pop-con .item-con {
+	font-size: 24rpx;
+	word-wrap: break-word;
+	word-break: break-word;
+}
+.popup-hide .virtual-goods-msg-pop .msg-pop-con .item-con.weak {
+	color: #999999;
+	margin-right: 20rpx;
+	width: 180rpx;
+	min-width: 180rpx;
+}
+.popup-hide .virtual-goods-msg-pop .msg-pop-con .pop-foot {
+	position: absolute;
+	bottom: 0;
+	width: 100%;
+	text-align: center;
+	padding: 0 20rpx;
+	margin-bottom: 30rpx;
+	margin-top: 20rpx;
+	box-sizing: border-box;
+	background: #fff;
+}
+.popup-hide .virtual-goods-msg-pop .msg-pop-con .pop-foot .foot-btn {
+	font-size: 26rpx;
+	color: #fff;
+	width: 100%;
+	background: #E43130;
+	border-radius: 140rpx;
+	padding: 20rpx 0;
+	box-sizing: border-box;
+}
+/* / 全部留言(虚拟商品) */
+
+/* 券码情况(虚拟商品) */
+.order-msg.voucher-code-con .msg-item.voucher-code-list {
+  max-height: 470rpx;
+  overflow-y: auto;
+  box-sizing: border-box;
+  padding-right: 10rpx;
+}
+.order-msg.voucher-code-con .msg-item .item {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  width: 100%;
+  padding: 0;
+}
+.order-msg.voucher-code-con .msg-item .item.used .tips {
+  margin-right: 8rpx;
+  height: 40rpx;
+  line-height: 40rpx;
+}
+.order-msg.voucher-code-con .msg-item .item:not(:last-child) {
+  margin-bottom: 16rpx;
+}
+.order-msg.voucher-code-con .msg-item .item .item-left .txt.flex-item {
+  display: flex;
+  /* align-items: flex-start; */
+}
+.order-msg.voucher-code-con .msg-item .item .item-left .txt.flex-item .lf {
+  white-space: nowrap;
+  line-height: 1.5em;
+}
+.order-msg.voucher-code-con .msg-item .item .item-left .txt.flex-item .rg {
+  line-height: 1.5em;
+}
+.order-msg.voucher-code-con .msg-item .item .item-right {
+  display: block;
+  width: 40rpx;
+  height: 40rpx;
+  margin-right: 18rpx;
+}
+.order-msg.voucher-code-con .msg-item .item .item-right image {
+  width: 100%;
+  height: 100%;
+}
+.order-msg.voucher-code-con .msg-item .item .txt:not(:last-child) {
+  margin-bottom: 10rpx;
+}
+.order-msg.voucher-code-con .msg-item .item .txt.strong {
+  font-weight: bold;
+}
+.order-msg.voucher-code-con .msg-item .item .txt.weak {
+  color: #999;
+}
+.order-msg.voucher-code-con .msg-item .item .tips {
+  color: #999;
+}
+.order-msg.voucher-code-con .msg-item .item.used .code-row .code {
+  text-decoration: line-through;
+  color: #999;
+}
+.order-msg.voucher-code-con .msg-item .item .copy-btn2 {
+  background: #F7F8FA;
+  padding: 4rpx 20rpx;
+  border-radius: 60rpx;
+  font-size: 24rpx;
+}
+/* / 券码情况(虚拟商品) */
+
+
+/* 赠品 */
+.prod-item .gift-prods {
+  margin-left: 200rpx;
+  margin-top: 30rpx;
+}
+.prod-item .gift-prods .gift-item {
+  display: block;
+  width: 100%;
+  color: #333;
+}
+.prod-item .gift-prods .gift-item:not(:last-child) {
+  margin-bottom: 12rpx;
+}
+.prod-item .gift-prods .gift-item .name,
+.prod-item .gift-prods .gift-item .num {
+  display: inline-block;
+  vertical-align: middle;
+  box-sizing: border-box;
+}
+.prod-item .gift-prods .gift-item .name {
+  width: 90%;
+  padding-right: 10rpx;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+/* .prod-item .gift-prods .gift-item::after {
+  content: '';
+  display: inline-block;
+  width: 12rpx;
+  height: 12rpx;
+  border-top: 2rpx solid #333333;
+  border-right: 2rpx solid #333333;
+  -webkit-transform: rotate(45deg);
+  transform: rotate(45deg);
+  vertical-align: middle;
+} */
+.prod-item .sku-name .gift-icon {
+  display: inline-block;
+  margin-right: 10rpx;
+  color: #fff;
+  font-size: 24rpx;
+  background: #e43130;
+  padding: 6rpx;
+  border-radius: 6rpx;
+  line-height: 1em;
+  box-sizing: border-box;
+}
+/*  / 赠品 */

+ 667 - 0
src/pages/order-detail/order-detail.vue

@@ -0,0 +1,667 @@
+<template>
+  <!--pages/order-detail/order-detail.wxml-->
+
+  <view class="container">
+    <view class="order-detail">
+      <!-- 订单状态 -->
+      <view class="order-status">
+        <view class="status-bg"><image src="/static/images/icon/status-bg.png" /></view>
+        <view class="status-text">{{ ['','等待买家支付','等待商家发货','等待买家收货','订单已完成','订单已完成','订单已取消','正在拼团中'][status] }}</view>
+        <view class="step">
+          <view :class="['item',status==2 || (orderMold == 1 && status == 3) || (status == 6 && orderItemDtos[0].refundSn) || status==4 || status==5 ? 'active' : '']">
+            <view class="select" />
+            <view class="des">买家付款</view>
+          </view>
+          <!-- <view :class="['item',(dvyType == 2 && status==2) || (dvyType != 2 && status==3)?'active':'']">
+          <view class="select"></view>
+          <view class="des">商家发货</view>
+        </view> -->
+          <view v-if="dvyType == 2" :class="['item',status==3 || status==4 || status==5 ? 'active' : '']">
+            <view class="select" />
+            <view class="des">买家提货</view>
+          </view>
+          <view :class="['item',status==4||status==5?'active':'']">
+            <view class="select" />
+            <view class="des">交易完成</view>
+          </view>
+        </view>
+      </view>
+
+      <!-- 配送地址 -->
+      <!-- <view class="address-box" v-if="dvyType == 1 && userAddrDto">
+      <view class="img"><image src="/static/images/icon/addr.png"></image></view>
+      <view class="user-info">
+        <view class="name">{{userAddrDto.receiver}}</view>
+        <view class="phone">{{userAddrDto.mobile}}</view>
+      </view>
+      <view class="address-detail">{{userAddrDto.province}}{{userAddrDto.city}}{{userAddrDto.area}}{{userAddrDto.area}}{{userAddrDto.addr}}</view>
+    </view> -->
+
+      <!-- 自提地址 -->
+      <!-- <view class="delivery-certificate" v-if="dvyType == 2">
+      <view class="tit">提货凭证</view>
+      <view class="address">
+        <view class="text">{{stationAddress}}</view>
+        <view class="icon-box">
+          <view class="icon" @tap="callStation"><image src="/static/images/icon/phone.png"></image></view>
+          <view class="icon bl" @tap="openMap"><image src="/static/images/icon/addr.png"></image></view>
+        </view>
+      </view>
+      <view class="code-box no-code" v-if="status == 1">
+        <view class="text-box">
+          <view class="item">
+            <view class="i-lable">提 货 码:</view>
+            <view class="i-text fw">{{stationCode?stationCode:'暂无提货码'}}</view>
+          </view>
+          <view class="item">
+            <view class="i-lable">提 货 人:</view>
+            <view class="i-text">{{stationUserName+' '+stationUserMobile}}</view>
+          </view>
+        </view>
+      </view>
+      <view class="code-box code-det" @tap="viewCertificate"  v-if="status == 2">
+        <view class="code">
+          <image :src="stationQrCode"></image>
+        </view>
+        <view class="text-box">
+          <view class="item">
+            <view class="i-lable">提 货 码:</view>
+            <view class="i-text fw">{{stationCode}}</view>
+          </view>
+          <view class="item">
+            <view class="i-lable">提 货 人:</view>
+            <view class="i-text">{{stationUserName+' '+stationUserMobile}}</view>
+          </view>
+          <view class="item">
+            <view class="i-lable">预约时间:</view>
+            <view class="i-text">{{stationTime}}</view>
+          </view>
+        </view>
+      </view>
+    </view> -->
+
+      <!-- 商品信息 -->
+      <view class="prod-item">
+        <!-- 店铺 -->
+        <view class="shop-box">
+          <view class="shop-icon"><image src="/static/images/icon/shop.png" /></view>
+          <view class="shop-name">{{ shopName }}</view>
+          <view v-if="refundStatus !=0" class="refund-sts">
+            <!-- refundStatus 订单退款状态 1.申请退款 2.退款完成 3.部分退款完成 4.退款失败 -->
+            <text>({{ ['','退款中','退款完成','部分退款','退款关闭'][refundStatus] }})</text>
+          </view>
+        </view>
+        <!-- /店铺 -->
+        <view v-for="(item, prodId) in prodList" :key="prodId" class="prod-box">
+          <view class="item-cont" :data-prodid="item.prodId" @tap="toProdPage">
+            <view class="prod-pic">
+              <image :src="item.pic.indexOf('http') === -1 ? picDomain + item.pic : item.pic" />
+            </view>
+            <!-- 拼团商品展示icon -->
+            <view class="prod-info">
+              <view class="prodname">
+                <view v-if="orderType" class="a-icon">{{ ['','拼团','秒杀','积分'][orderType] }}</view>
+                <view class="text">{{ item.prodName }}</view>
+              </view>
+              <view class="sku-name">
+                <text
+                  v-if="orderItemDtos.length === 1 && item.giveawayOrderItemId"
+                  class="gift-icon"
+                >赠品</text>
+                <text>{{ item.skuName }}</text>
+              </view>
+              <view class="price-nums">
+                <!-- <view class="prodprice"><text v-if="item.price" class="symbol">¥</text>
+                <text v-if="item.price" class="big-num">{{wxs.parsePrice(item.price)[0]}}</text>
+                <text v-if="item.price" class="small-num">.{{wxs.parsePrice(item.price)[1]}}</text>
+                <text v-if="item.price && orderType==3" class="small-num">+</text>
+                <text class="small-num" v-if="orderType==3">{{item.useScore}} 积分</text>
+              </view> -->
+                <view class="number">
+                  <text>{{ orderMold == 1 ? totalNum : item.prodCount }}</text>件
+                </view>
+              </view>
+            </view>
+          </view>
+          <!-- 赠品:多个商品时展示 -->
+          <view v-if="orderItemDtos.length > 1 && item.giveawayList && item.giveawayList.length" class="gift-prods">
+            <view
+              v-for="giftItem in item.giveawayList"
+              :key="giftItem.orderItemId"
+              class="gift-item"
+              @tap="toProdDetail(giftItem.prodId)"
+            >
+              <text class="name">【赠品】{{ giftItem.prodName }}</text>
+              <text class="num">×{{ giftItem.prodCount }}</text>
+            </view>
+          </view>
+        </view>
+      </view>
+
+      <!-- 订单信息 -->
+      <view class="order-msg">
+        <view class="msg-item">
+          <view class="item">
+            <text class="item-tit">订单编号:</text>
+            <text class="item-txt">{{ orderNumber }}</text>
+            <!--  #ifdef  APP-PLUS -->
+            <text class="copy-btn" @tap="copyBtn">复制</text>
+          <!--  #endif -->
+          </view>
+          <view class="item">
+            <text class="item-tit">下单时间:</text>
+            <text class="item-txt">{{ createTime }}</text>
+          </view>
+        </view>
+        <view class="msg-item">
+          <view v-if="payType !== null" class="item">
+            <text class="item-tit">支付方式:</text>
+            <text class="item-txt">{{ ['积分支付','微信支付','支付宝支付','微信支付','微信支付','微信支付','支付宝支付','支付宝支付','微信支付','余额支付','PayPal支付'][payType] }}</text>
+          </view>
+          <view class="item">
+            <text class="item-tit">配送方式:</text>
+            <text class="item-txt">{{ ['','卖家配送','到店自提','无需快递'][dvyType] }}</text>
+          </view>
+          <!-- 全部留言(虚拟商品) -->
+          <view v-if="orderMold === 1 && virtualRemarkList.length >= 0" class="item all-msg" @tap="showViewMsgPopup">
+            <view class="item-tit">全部留言:</view>
+            <view class="item-txt" :class="{'pd': isExtraLong}"><span v-for="(item, index) in virtualRemarkList" :key="index">{{ item[0] }}&nbsp;&nbsp;&nbsp;&nbsp;{{ item[1] }}</span></view>
+            <view v-if="isExtraLong" class="more-msg" />
+          </view>
+        </view>
+        <view v-if="remarks" class="msg-item">
+          <view class="item">
+            <text class="item-tit remarks-tit">订单备注:</text>
+            <text class="item-txt remarks-txt">{{ remarks }}</text>
+          </view>
+        </view>
+      </view>
+
+      <!-- 虚拟商品-券码情况 -->
+      <view
+        v-if="orderMold === 1"
+        class="order-msg voucher-code-con"
+      >
+        <view class="msg-item">
+          <view class="item">
+            <view class="item-left">
+              <view class="txt strong">已使用({{ totalNum }}张)</view>
+              <view class="txt weak flex-item">
+                <view class="lf">有效期限:</view>
+                <view class="rg">
+                  <text v-if="writeOffStart && !writeOffEnd">购买后长期有效</text>
+                  <text v-if="writeOffStart && writeOffEnd">{{ writeOffStart }} 至 {{ writeOffEnd }}</text>
+                </view>
+              </view>
+              <view class="txt weak flex-item">
+                <view class="lf">核销次数:</view>
+                <view class="rg">
+                  <text v-if="writeOffNum === -1">多次核销</text>
+                  <text v-if="writeOffNum === 1">单次核销</text>
+                  <text v-if="writeOffNum === 0">无需核销</text>
+                </view>
+              </view>
+            </view>
+          </view>
+        </view>
+        <!-- 券码列表 -->
+        <view v-if="virtualInfoList && virtualInfoList.length" class="msg-item voucher-code-list">
+          <view v-for="(item, index) in virtualInfoList" :key="index" class="item" :class="{'used': item.isWriteOff === 1}">
+            <view v-if="item.isWriteOff === 1" class="code-row">
+              券码<text v-if="virtualInfoList.length > 1">{{ index+1 }}</text>:<text class="code">{{ item.writeOffCode }}</text>
+            </view>
+            <view v-if="item.isWriteOff === 1" class="tips">已使用</view>
+          </view>
+        </view>
+      </view>
+
+      <view class="order-msg payment">
+        <view class="msg-item">
+          <view class="item">
+            <view class="item-tit">商品总额:</view>
+            <view class="item-txt">¥{{ wxs.parsePrice(productTotalAmount)[0] }}.{{ wxs.parsePrice(productTotalAmount)[1] }}</view>
+          </view>
+          <view v-if="transfee" class="item">
+            <view class="item-tit">运费:</view>
+            <view class="item-txt">¥{{ wxs.parsePrice(transfee)[0] }}.{{ wxs.parsePrice(transfee)[1] }}</view>
+          </view>
+          <view v-if="reduceAmount" class="item">
+            <view class="item-tit"><text v-if="orderType && orderType!=3" class="item-tit">{{ orderType==1?'团购':'秒杀' }}</text>优惠:</view>
+            <view class="item-txt">-¥{{ wxs.parsePrice(reduceAmount)[0] }}.{{ wxs.parsePrice(reduceAmount)[1] }}</view>
+          </view>
+          <view class="item price">
+            <view class="item-txt">
+              <!-- <text class="gray">订单总额:</text>
+            <text class="symbol" v-if="actualTotal">¥</text>
+            <text class="big-num" v-if="actualTotal">{{wxs.parsePrice(actualTotal)[0]}}</text>
+            <text class="small-num" v-if="actualTotal">.{{wxs.parsePrice(actualTotal)[1]}}</text>
+            <text class="small-num" v-if="actualTotal && orderType==3">+</text>
+            <text class="small-num" v-if="orderType==3">{{orderItemDtos[0].useScore}} 积分</text> -->
+              <text class="gray">订单总额:</text>
+              <text v-if="actualTotal && actualTotal > 0" class="symbol">¥</text>
+              <text v-if="actualTotal && actualTotal > 0" class="big-num">{{ wxs.parsePrice(actualTotal)[0] }}</text>
+              <text v-if="actualTotal && actualTotal > 0 || actualTotal > 0" class="small-num">.{{ wxs.parsePrice(actualTotal)[1] }}</text>
+              <text v-if="(actualTotal && actualTotal > 0) && (orderType==3 || orderScore > 0)" class="small-num">+</text>
+              <text v-if="orderType==3 || orderScore > 0" class="big-num">{{ orderScore }} <text class="small-num">积分</text></text>
+            </view>
+          </view>
+        </view>
+      </view>
+
+    <!-- 团购底部 -->
+    <!-- <view class="order-detail-footer" v-if="orderType==1&& status>1">
+      <view class="group-det" @tap="toGroupDetails" :data-ordernumber="orderNumber">查看团购详情</view>
+    </view> -->
+
+    </view>
+
+    <!-- 查看留言(虚拟商品) -->
+    <view class="popup-hide" :hidden="!showViewMsg">
+      <view class="popup-box virtual-goods-msg-pop">
+        <view class="con-tit">
+          <view class="tit-text">查看留言</view>
+          <view class="close" @tap="closeMsgPopup" />
+        </view>
+        <view class="msg-pop-con">
+          <view class="msg-list">
+            <view v-for="(item, index) in virtualRemark" :key="index" class="msg-item">
+              <view class="item-con weak">{{ item.name }}</view>
+              <view class="item-con">{{ item.value }}</view>
+            </view>
+          </view>
+          <view class="pop-foot">
+            <view class="foot-btn" @tap="closeMsgPopup">我知道了</view>
+          </view>
+        </view>
+      </view>
+    </view>
+
+  </view>
+</template>
+
+<script module="wxs" lang="wxs" src="../../wxs/number.wxs"></script>
+
+<script>
+// pages/order-detail/order-detail.js
+var http = require("../../utils/http.js")
+// var qrCode = require("../../utils/weapp-qrcode.js")
+import config from "../../utils/config.js";
+
+export default {
+  data() {
+    return {
+      //图片地址
+      picDomain: config.picDomain,
+      orderItemDtos: [],
+      remarks: "",
+      actualTotal: 0,
+      userAddrDto: null,
+      orderNumber: "",
+			orderScore: 0, // 整单使用积分
+      createTime: "",
+      status: 0, // 订单状态 0全部 1待支付 2待发货 3待收货 4待评价 5已完成 6已取消 7拼团中
+      productTotalAmount: '',
+      transfee: '',
+      reduceAmount: '',
+      prodid: '',
+      orderType: 0,
+      shopName: '',
+      //店铺名称
+      canRefund: false,
+      // 能否退款
+      canAllRefund: false, // 能否增单退款
+      isLastProd: false,  //最后一款商品
+      irrevocable: false,  //不可撤销
+      sum: [],  //本单已申请单个退款的商品数组
+      dvyType: 1, //配送类型 1:快递 2:自提 3:无需快递
+
+      id: 0, // 自提信息id
+      stationAddress: '', // 自提点的地址
+      stationCode: '', // 提货码
+      stationId: 0, // 自提点id
+      stationPhone: '', // 自提点的联系电话
+      stationTime: '', // 自提时间(用户下单时选择)
+      stationUserMobile: '', // 自提人的手机
+      stationUserName: '', // 自提人的名字
+      stationQrCode: '', // 提货码二维码
+      stationName: '', // 自提点名称
+      payType: '', // 支付方式
+
+      // 虚拟商品
+      orderMold: '', // 订单类型 1虚拟商品
+      virtualRemark: [], // 留言
+      virtualRemarkList: [],
+      virtualInfoList: [], // 券码
+      writeOffNum: 0,
+      writeOffStart: null,
+      writeOffEnd: null,
+      isExtraLong: false, // 虚拟商品留言是否超长
+      showViewMsg: false, // 查看全部留言弹窗
+      totalNum: null, // 已核销的商品总件数
+
+      // 商品列表
+      prodList: [],
+      // 退款状态
+      refundStatus: 0
+    };
+  },
+
+  components: {},
+  props: {},
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.loadOrderDetail(options.orderNum);
+    this.refundStatus = options.refundStatus
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {},
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {},
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {},
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {},
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {},
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {},
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {},
+  methods: {
+    //跳转商品详情页
+    toProdPage: function (e) {
+      var prodid = e.currentTarget.dataset.prodid;
+
+      if (this.orderType == 3) {
+        console.log('积分商品');
+        wx.navigateTo({
+          url: '/pages/convertProdDet/convertProdDet?prodid=' + prodid
+        });
+      } else {
+        wx.navigateTo({
+          url: '/pages/prod/prod?prodid=' + prodid
+        });
+      }
+    },
+
+    /**
+     * 加载订单数据
+     */
+    loadOrderDetail: function (orderNum) {
+      wx.showLoading(); //加载订单详情
+
+      var params = {
+        url: "/p/myOrder/orderDetail",
+        method: "GET",
+        data: {
+          orderNumber: orderNum
+        },
+        callBack: res => {
+          wx.hideLoading();
+          this.setData({
+            orderNumber: orderNum,
+            actualTotal: res.actualTotal,
+            //实际支付总额(商品总额+运费)
+            userAddrDto: res.userAddrDto,
+            remarks: res.remarks,
+            orderItemDtos: res.orderItemDtos,
+            createTime: res.createTime,
+            status: res.status,
+            productTotalAmount: res.total,
+            //所有商品总额
+            transfee: res.transfee,
+            //运费
+            reduceAmount: res.reduceAmount,
+            orderType: res.orderType,
+						orderScore: res.orderScore, // 整单使用积分
+            shopName: res.shopName,
+            canRefund: res.canRefund,
+            canAllRefund: res.canAllRefund,
+            dvyType: res.dvyType, // 配送类型 1:快递 2:自提 3:无需快递
+            payType: res.payType, // 支付方式
+            orderMold: res.orderMold, // 订单类型 1虚拟商品
+            virtualInfoList: res.virtualInfoList, // 券码
+            virtualRemark: res.virtualRemark ? JSON.parse(res.virtualRemark) : [], // 留言
+            writeOffNum: res.writeOffNum, // 核销次数 -1多次 0无需核销 1单次核销
+            writeOffStart: res.writeOffStart, // 核销有效期开始时间
+            writeOffEnd: res.writeOffEnd, // 核销有效期结束时间(仅有开始时间没有结束时间标识长期有效)
+            totalNum: res.totalNum
+          });
+
+          if(res.dvyType == 2) {
+            this.loadStationDetail(orderNum)
+          }
+
+          // 虚拟商品留言处理
+          this.handlevirtualRemark()
+
+          this.prodList = res.orderItemDtos
+          // 赠品:单个商品时
+          if (res.orderItemDtos.length === 1 &&
+             res.orderItemDtos[0].giveawayList &&
+             res.orderItemDtos[0].giveawayList.length) {
+            this.prodList = [...res.orderItemDtos, ...res.orderItemDtos[0].giveawayList]
+          }
+          console.log('prodList:', this.prodList)
+          console.log('orderItemDtos:', this.orderItemDtos)
+
+        },
+        errCallBack: err => {
+          console.log('err:', err)
+					uni.hideLoading()
+					this.requestPageError = true
+					uni.showModal({
+						title: '提示',
+						content: err.data,
+						showCancel: false,
+						confirmText: '确定',
+						success: (err) => {
+							if (err.confirm) {
+								uni.redirectTo({
+									url: '/pages/order-list/order-list'
+								})
+							}
+						}
+					})
+				}
+      };
+      http.request(params);
+    },
+
+    /**
+     * 加载订单详情自提信息
+     */
+    loadStationDetail: function (orderNum) {
+      wx.showLoading(); //加载订单详情
+      var params = {
+        url: "/p/myStationOrder/stationDetail",
+        method: "GET",
+        data: {
+          orderNumber: orderNum
+        },
+        callBack: (res) => {
+          wx.hideLoading();
+          this.id = res.id, // 自提信息id
+          this.stationAddress = res.stationAddress, // 自提点的地址
+          this.stationCode = res.stationCode, // 提货码
+          this.stationId = res.stationId, // 自提点id
+          this.stationPhone = res. stationPhone, // 自提点的联系电话
+          this.stationTime = res.stationTime, // 自提时间(用户下单时选择)
+          this.stationUserMobile = res.stationUserMobile, // 自提人的手机
+          this.stationUserName = res.stationUserName, // 自提人的名字
+          this.stationName = res.stationName // 自提点名称
+          // this.getQrcode(this.stationCode)
+        }
+      };
+      http.request(params);
+    },
+
+    // 虚拟商品-留言列表处理
+    handlevirtualRemark() {
+      if (this.virtualRemark && this.virtualRemark.length) {
+        // 过滤掉没有填写的留言
+        this.virtualRemark = this.virtualRemark.filter(el => el.value)
+        let virtualRemarkList = []
+        let virtualRemarks = []
+        // 如果留言总数大于3条,先展示前一条(完整留言在弹窗中展示)
+        if (this.virtualRemark.length > 3) {
+          const list = JSON.parse(JSON.stringify(this.virtualRemark))
+          virtualRemarks = list.splice(0, 1)
+          this.isExtraLong = true
+        } else {
+          virtualRemarks = this.virtualRemark
+          this.isExtraLong = false
+        }
+        // 全部留言拼接
+        virtualRemarks.forEach((el, index) => {
+          // if (index < virtualRemarks.length - 1) {
+          //   virtualRemarkList = virtualRemarkList + el.name + ' ' + el.value + ','
+          // } else {
+          //   virtualRemarkList = virtualRemarkList + el.name + ' ' + el.value
+          // }
+          virtualRemarkList.push([el.name, el.value])
+        })
+        if (this.isExtraLong) {
+          this.virtualRemarkList = virtualRemarkList.push('......')
+        } else {
+          this.virtualRemarkList = virtualRemarkList
+        }
+      }
+    },
+
+    // 查看留言弹窗
+    showViewMsgPopup: function() {
+      if (this.isExtraLong) {
+        this.showViewMsg = true
+      }
+    },
+    closeMsgPopup: function() {
+      this.showViewMsg = false
+    },
+
+    /**
+     * 拨打自提点电话
+     */
+    // callStation: function() {
+    //   uni.makePhoneCall({
+    //     // 手机号
+    //     phoneNumber: this.stationPhone,
+    //     // 成功回调
+    //     success: (res) => {
+    //       console.log('调用成功!')
+    //     },
+    //     // 失败回调
+    //     fail: (res) => {
+    //       console.log('调用失败!')
+    //     }
+    //   });
+    // },
+
+    /**
+     * 打开地图
+     */
+    // openMap: function (latitude,longitude,name) {
+    //   console.log('打开地图')
+    //   uni.getLocation({
+    //     // type: 'gcj02', //返回可以用于uni.openLocation的经纬度
+    //     success: (res) => {
+    //       console.log('成功res',res)
+    //       uni.openLocation({
+    //           latitude: res.latitude,
+    //           longitude: res.longitude,
+    //           success: function () {
+    //             console.log('success');
+    //           }
+    //       });
+    //     },
+    //     fail: () => {
+    //       console.log('fail')
+    //     }
+    //   });
+    // },
+
+    /**
+     * 生成二维码
+     */
+    // getQrcode: function(stationCode) {
+    //   this.stationQrCode = Qr.createQrCodeImg(stationCode)
+    // },
+
+    /* 生成二维码 */
+		// getQrcode: function (stationCode) {
+		// 	new qrCode('orderQrcode', {
+		// 		text: "pages/self-mention-order/self-mention-order?pickCode=" + stationCode,
+		// 		width: 70,
+		// 		height: 70,
+		// 		colorDark: "#333333",
+		// 		colorLight: "#FFFFFF",
+		// 		correctLevel: qrCode.CorrectLevel.H
+		// 	})
+		// },
+
+    // #ifdef  APP-PLUS
+      /**
+       * 一键复制事件
+       */
+      // 设置系统剪贴板的内容。
+      copyBtn () {
+        // 除了h5以外都可用的复制方法
+        uni.setClipboardData({
+          data: this.orderNumber,
+          success: function () {
+            wx.showToast({
+              title: '复制成功',
+              icon: 'none',
+              duration: 1000
+            })
+          }
+        });
+      },
+    // #endif
+
+    // 查看提货凭证
+    // viewCertificate() {
+    //   var cont = {
+    //     stationCode: this.stationCode, // 提货码
+    //     stationAddress: this.stationAddress, // 自提点的地址
+    //     stationPhone: this.stationPhone, // 自提点的联系电话
+    //     stationTime: this.stationTime, // 自提时间(用户下单时选择)
+    //     orderNumber: this.orderNumber, // 订单编号
+    //     stationName: this.stationName
+    //   }
+    //   uni.setStorageSync('stationCont', cont)
+    //   uni.navigateTo({
+    //     url: '/pages/deliveryCertificate/deliveryCertificate'
+    //   })
+    // },
+
+  }
+};
+</script>
+<style>
+@import "./order-detail.css";
+</style>

+ 345 - 0
src/pages/order-list/order-list.css

@@ -0,0 +1,345 @@
+/* pages/order-list/order-list.wxss */
+
+page {
+  background-color: #f4f4f4;
+  color: #333;
+}
+
+/* 头部菜单 */
+.order-tit {
+  position: fixed;
+  top: 0;
+  display: flex;
+  justify-content: space-around;
+  z-index: 999;
+  width: 100%;
+  height: 88rpx;
+  line-height: 88rpx;
+  background-color: #fff;
+}
+
+.order-tit text {
+  display: block;
+  font-size: 24rpx;
+  text-align: center;
+}
+
+.order-tit text.on {
+  border-bottom: 4rpx solid #e43130;
+  color: #e43130;
+  font-weight: 600;
+}
+
+/*  end 头部菜单 */
+
+.main {
+  margin-top: 108rpx;
+}
+
+/* 商品列表 */
+
+.prod-item {
+  background-color: #fff;
+  margin-bottom: 20rpx;
+  font-size: 28rpx;
+}
+
+/* 店铺 */
+.shop-box {
+  padding: 20rpx;
+  border-bottom: 2rpx solid #f2f2f2;
+  display: flex;
+  align-items: center;
+}
+
+.shop-icon {
+  width: 24rpx;
+  height: 24rpx;
+  margin-right: 10rpx;
+  font-size: 0;
+}
+
+.shop-icon > image {
+  width: 100%;
+  height: 100%;
+}
+
+.shop-name {
+  font-size: 24rpx;
+  font-weight: 600;
+  position: relative;
+  padding-right: 16rpx;
+}
+
+.prod-item .order-num {
+  padding: 20rpx;
+  font-size: 24rpx;
+  display: flex;
+  align-items: center;
+}
+
+.order-num > text {
+  flex: 1;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 1;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.order-state {
+  color: #999999;
+  display: flex;
+  align-items: center;
+}
+
+.order-state.red {
+  color: #e43130;
+}
+
+.prod-item .order-num .clear-btn {
+  width: 28rpx;
+  height: 28rpx;
+  font-size: 0;
+  margin-left: 42rpx;
+  position: relative;
+}
+
+.prod-item .order-num .clear-btn::after {
+  content: " ";
+  display: block;
+  position: absolute;
+  left: -20rpx;
+  top: 0rpx;
+  width: 2rpx;
+  height: 32rpx;
+  background: #eee;
+}
+
+.prod-item .order-num .clear-btn .clear-list-btn {
+  width: 100%;
+  height: 100%;
+}
+
+.prod-item .item-cont {
+  display: flex;
+  align-items: center;
+  padding: 20rpx;
+  display: -webkit-flex;
+  display: -webkit-box;
+  display: -moz-box;
+  display: -ms-flexbox;
+  background: #f7f7f7;
+  position: relative;
+}
+
+.prod-item .item-cont .categories {
+  white-space: nowrap;
+}
+
+.prod-item .item-cont .prod-pic {
+  position: relative;
+  display: inline-block;
+  font-size: 0;
+  width: 160rpx;
+  height: 160rpx;
+  background: #fff;
+  margin-right: 20rpx;
+}
+
+.prod-item .item-cont .prod-pic image {
+  width: 100%;
+  height: 100%;
+}
+
+.spell-group-order {
+  position: absolute;
+  display: block;
+  top: 0;
+  left: 0;
+  width: 60rpx;
+  height: 30rpx;
+}
+
+.prod-item .item-cont .prod-info {
+  font-size: 24rpx;
+  position: relative;
+  height: 160rpx;
+  -webkit-flex: 1;
+  -ms-flex: 1;
+  -webkit-box-flex: 1;
+  -moz-box-flex: 1;
+  flex: 1;
+}
+
+.prod-item .item-cont .prod-info .prodname {
+  line-height: 34rpx;
+  max-height: 68rpx;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.prod-item .item-cont .prod-info .tag {
+    display: inline-block;
+    font-size: 24rpx;
+    color: #e43130;
+    border: 1px solid #e43130;
+    padding: 4rpx 8rpx;
+    line-height: 1em;
+    margin-right: 8rpx;
+}
+
+.prod-item .item-cont .prod-info .prod-info-cont {
+  margin-top: 10rpx;
+  color: #999;
+  font-size: 24rpx;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 1;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.prod-item .price-nums {
+  position: absolute;
+  bottom: 0;
+  width: 100%;
+  display: flex;
+  align-items: baseline;
+  line-height: 32rpx;
+}
+
+.prod-item .price-nums .prodprice {
+	flex: 1;
+}
+
+.prod-item .price-nums .prodcount {
+  color: #999;
+  font-family: arial;
+  margin-right: 10rpx;
+}
+
+.prod-item .total-num {
+  display: flex;
+  align-items: center;
+  padding: 20rpx;
+  position: relative;
+}
+
+.prod-item  .total-num .spell-group-icon {
+  margin-right: 10rpx;
+  padding: 4rpx 18rpx;
+  color: #fff;
+  border-radius: 20rpx;
+  font-size: 20rpx;
+  color: #e43130;
+  border: 2rpx solid #e43130;
+}
+
+.prod-item .total-num .right {
+  flex: 1;
+  display: flex;
+  justify-content: flex-end;
+  align-items: baseline;
+  font-size: 24rpx;
+}
+
+.prod-item .total-num .right .prodcount {
+  margin-right: 20rpx;
+}
+
+.prod-item .prod-foot {
+  padding: 20rpx;
+  border-top: 2rpx solid #eee;
+}
+
+.prod-item  .prod-foot .total {
+  font-size: 24rpx;
+  margin-bottom: 20rpx;
+  padding-bottom: 20rpx;
+  border-bottom: 2rpx solid #eee;
+}
+
+.other-button-hover {
+  background-color: blue;
+}
+
+.button-hover {
+  background-color: #e43130;
+}
+
+/** 添加自定义button点击态样式类**/
+
+.button-hover {
+  background-color: blue;
+}
+
+.btn {
+	display: flex;
+	justify-content: flex-end;
+	align-items: center;
+}
+
+.button {
+  display: inline-block;
+  margin-left: 10px;
+  font-size: 24rpx;
+  background: #fff;
+  padding: 10rpx 30rpx;
+  border-radius: 80rpx;
+  border: 2rpx solid #ddd;
+}
+
+.button.warn {
+  color: #e43130;
+  border-color: #e43130;
+}
+
+/* end 商品列表 */
+
+
+/* 根据状态显示不同的颜色 */
+
+.order-state .order-sts.red {
+  color: #e43130;
+}
+
+.order-state .order-sts {
+  color: #333;
+}
+
+/* 加载完成 */
+.loadall {
+  margin: 20rpx 0;
+  line-height: 2em;
+  font-size: 24rpx;
+  color: #aaa;
+  text-align: center;
+}
+
+/* 列表为空 */
+.empty {
+  padding-top: 200rpx;
+  text-align: cneter;
+}
+.empty-icon {
+  display: block;
+  width: 80rpx;
+  height: 80rpx;
+  margin: 0 auto;
+  margin-bottom: 20rpx;
+}
+.empty-icon > image {
+  display: block;
+  width: 100%;
+  height: 100%;
+}
+.empty-text {
+  font-size: 28rpx;
+  text-align: center;
+  color: #999;
+  line-height: 40rpx;
+}

+ 290 - 0
src/pages/order-list/order-list.vue

@@ -0,0 +1,290 @@
+<template>
+  <!-- pages/order-list/order-list.wxml -->
+  <view class="container">
+    <!-- 头部菜单 -->
+    <view class="order-tit">
+      <text data-sts="0" :class="sts==0?'on':''" @tap="onStsTap">全部</text>
+      <text data-sts="1" :class="sts==1?'on':''" @tap="onStsTap">待付款</text>
+      <text data-sts="2" :class="sts==2?'on':''" @tap="onStsTap">待发货</text>
+      <text data-sts="3" :class="sts==3?'on':''" @tap="onStsTap">待收货</text>
+      <text data-sts="5" :class="sts==5?'on':''" @tap="onStsTap">已完成</text>
+    </view>
+    <!-- end 头部菜单 -->
+    <view class="main">
+      <!-- <view class="empty" wx:if="{{list.length==0}}">这里还没有相关订单~</view> -->
+      <!-- 订单列表 -->
+      <block v-for="(item, orderNumber) in list" :key="orderNumber">
+        <view class="prod-item">
+          <!-- 店铺 -->
+          <view class="shop-box">
+            <view class="shop-icon">
+              <image src="/static/images/icon/shop.png" />
+            </view>
+            <view class="shop-name">{{ item.shopName }}</view>
+          </view>
+          <!-- 订单编号 -->
+          <view class="order-num">
+            <text>订单编号:{{ item.orderNumber }}</text>
+            <view class="order-state">
+              <text :class="['order-sts' , {red: (item.status < 5) }]">{{ ['','待付款','待发货','待收货','待评价','已完成','已取消','拼团中'][item.status] }}</text>
+            </view>
+            <view v-if="item.refundStatus" class="order-state red">
+              <!-- refundStatus 订单退款状态 1.申请退款 2.退款完成 3.部分退款完成 4.退款失败 -->
+              <text>({{ ['','退款中','退款完成','部分退款','退款关闭'][item.refundStatus] }})</text>
+            </view>
+          </view>
+          <!-- 商品列表 -->
+          <!-- 一个订单单个商品的显示 -->
+          <block v-if="item.orderItemDtos.length==1">
+            <block v-for="(prod, prodId) in item.orderItemDtos" :key="prodId">
+              <view class="item-cont" @tap="toOrderDetailPage(item.orderNumber, item.refundStatus)">
+                <view class="prod-pic">
+                  <image :src="prod.pic" />
+                </view>
+                <view class="prod-info">
+                  <view class="prodname">{{ prod.prodName }}</view>
+                  <view class="prod-info-cont">{{ prod.skuName }}</view>
+                  <view class="price-nums">
+                    <text class="prodprice">
+                      <text v-if="prod.price" class="symbol">¥</text>
+                      <text v-if="prod.price" class="big-num">{{ wxs.parsePrice(prod.price)[0] }}</text>
+                      <text v-if="prod.price" class="small-num">.{{ wxs.parsePrice(prod.price)[1] }}</text>
+                      <text v-if="prod.price && item.orderType==3" class="small-num" decode="true">&emsp;+&emsp;</text>
+                      <text v-if="prod.useScore && item.orderType==3" class="small-num">{{ prod.useScore }} 积分</text>
+                    </text>
+                    <text class="prodcount">× {{ prod.prodCount }}</text>
+                  </view>
+                </view>
+              </view>
+            </block>
+          </block>
+          <!-- 一个订单多个商品时的显示 -->
+          <block v-else>
+            <view class="item-cont" @tap="toOrderDetailPage(item.orderNumber, item.refundStatus)">
+              <scroll-view scroll-x="true" scroll-left="0" scroll-with-animation="false" class="categories">
+                <block v-for="(prod, prodId) in item.orderItemDtos" :key="prodId">
+                  <view class="prod-pic">
+                    <image :src="prod.pic" />
+                  </view>
+                </block>
+              </scroll-view>
+            </view>
+          </block>
+          <view class="total-num">
+            <view v-if="item.orderType" class="spell-group-icon">
+              <!-- orderType 订单类型(0普通订单 1团购订单 2秒杀订单) -->
+              {{ ['','拼团','秒杀','积分'][item.orderType] }}
+            </view>
+            <view v-if="item.orderMold == 1" class="spell-group-icon">虚拟</view>
+            <!-- <view class="spell-group-icon">自提</view> -->
+            <view class="right">
+              <view class="prodcount">共 {{ item.productNums }} 件商品</view>
+              <view class="prodprice">合计:
+                <text v-if="item.actualTotal" class="symbol">¥</text>
+                <text v-if="item.actualTotal" class="big-num">{{ wxs.parsePrice(item.actualTotal)[0] }}</text>
+                <text v-if="item.actualTotal" class="small-num">.{{ wxs.parsePrice(item.actualTotal)[1] }}</text>
+                <text v-if="(item.actualTotal && item.actualTotal > 0) && (item.orderType==3 || item.orderToataluseScore > 0)" class="small-num">+</text>
+                <text v-if="item.orderType==3 || item.orderToataluseScore > 0" class="small-num">{{ item.orderToataluseScore }} 积分</text>
+              </view>
+            </view>
+          </view>
+        <!-- end 商品列表 -->
+        <!-- <view class="prod-foot" v-if="item.status == 1 || item.status == 2 || item.status == 3 || item.status==5 || (item.status==5 && item.orderItemDtos[0].commSts==0)"> -->
+        <!-- <view class="prod-foot" v-if="item.status == 2"> -->
+          <!-- <view class="btn"> -->
+          <!-- <text v-if="item.status==2" class="button warn" @tap="pickGood" :data-ordernum="item.orderNumber" hover-class="none">提货</text> -->
+          <!-- </view> -->
+        <!-- </view> -->
+        </view>
+      </block>
+    </view>
+
+    <!-- 到底了~ -->
+    <view v-if="list.length > 10 && loadAll" class="loadall">已加载全部数据</view>
+
+    <!-- 空 -->
+    <view v-if="!list.length" class="empty">
+      <view class="empty-icon">
+        <image src="/static/images/icon/empty.png" />
+      </view>
+      <view class="empty-text">这里还没有相关订单~</view>
+    </view>
+
+  </view>
+<!-- end 订单列表 -->
+</template>
+
+<script module="wxs" lang="wxs" src="../../wxs/number.wxs"></script>
+
+<script>
+var http = require("../../utils/http.js");
+var config = require("../../utils/config.js");
+export default {
+  data() {
+    return {
+      list: [],
+      current: 1,
+      pages: 0,
+      sts: 0,
+      endTime: '',  //订单过期时间
+      loadAll: false // 已加载全部
+    };
+  },
+
+  components: {},
+  props: {},
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    if (options.sts) {
+      this.setData({
+        sts: options.sts
+      });
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    this.loadOrderData(this.sts, 1);
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {},
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {},
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {},
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {},
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+    if (this.current < this.pages) {
+			this.loadOrderData(this.sts, this.current + 1);
+		} else {
+			this.setData({
+				loadAll: true
+			})
+		}
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {},
+  methods: {
+    /**
+     * 加载订单数据
+     */
+    loadOrderData: function (sts, current) {
+      var ths = this;
+      wx.showLoading(); //加载订单列表
+
+      var params = {
+        url: "/p/station/orderListByStatus",
+        method: "GET",
+        data: {
+          current: current,
+          size: 10,
+          status: sts
+        },
+        callBack: function (res) {
+					res.records.forEach(order=> {
+						order.orderToataluseScore = 0
+						order.orderItemDtos.forEach(orderItem=> {
+							if (orderItem.useScore) {
+								order.orderToataluseScore += orderItem.useScore
+							}
+						})
+					})
+          var list = [];
+					if (res.current == 1) {
+						list = res.records;
+					} else {
+						list = ths.list.concat(res.records)
+					}
+					ths.setData({
+						list: list,
+						pages: res.pages,
+						current: res.current,
+					});
+          wx.hideLoading();
+        },
+      };
+      http.request(params);
+    },
+
+    /**
+     * 状态点击事件
+     */
+    onStsTap: function (e) {
+      var sts = e.currentTarget.dataset.sts;
+      this.setData({
+        sts: sts
+      });
+      this.loadOrderData(sts, 1);
+    },
+
+		/**
+     * 跳转提货页面
+     */
+		pickGood: function (e) {
+			let orderNum = e.currentTarget.dataset.ordernum
+			let ths = this
+			wx.showModal({
+        title: '',
+        content: '确认取货?',
+        confirmColor: "#3e62ad",
+        cancelColor: "#3e62ad",
+        cancelText: '否',
+        confirmText: '是',
+        success(res) {
+          if (res.confirm) {
+						wx.showLoading()
+						var param = {
+							url: "/p/station/orderStationByOrderNumber",
+							method: "PUT",
+							data: this.orderNumber,
+							callBack: res => {
+								ths.loadOrderData(ths.sts, 1)
+								wx.hideLoading()
+							}
+						}
+						http.request(param)
+          } else if (res.cancel) {}
+        }
+			})
+		},
+
+    /**
+     * 查看订单详情
+     */
+    toOrderDetailPage: function (orderNum, refundStatus) {
+      let sts = refundStatus ? refundStatus : 0
+      wx.navigateTo({
+        url: '/pages/order-detail/order-detail?orderNum=' + orderNum + '&refundStatus=' + sts
+      })
+    }
+  }
+};
+</script>
+<style>
+@import "./order-list.css";
+</style>

+ 40 - 0
src/pages/pick-code/pick-code.css

@@ -0,0 +1,40 @@
+page{
+	overflow: hidden;
+}
+
+.con-wrapper{
+	width: 500rpx;
+	margin: 0 auto;
+	margin-top: 45%;
+}
+.con-wrapper .title{
+	width: 500rpx;
+	font-size: 40rpx;
+	text-align: center;
+}
+.con-wrapper .inp-wrapper{
+	display: flex;
+	align-items: center;
+	width: 100%;
+	height: 100rpx;
+	margin-top: 50rpx;
+	border: 1rpx solid #fd6227;
+	border-radius: 15rpx;
+	overflow: hidden;
+}
+.con-wrapper .input{
+	width: 370rpx;
+	height: 100rpx;
+	padding: 0 15rpx;
+}
+.con-wrapper .sub-btn{
+	flex: 1;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 100rpx;
+	height: 100rpx;
+	font-size: 30rpx;
+	color: #fff;
+	background-color: #fd6227;
+}

+ 57 - 0
src/pages/pick-code/pick-code.vue

@@ -0,0 +1,57 @@
+<template>
+  <view class="con-wrapper">
+    <view class="title">输入核销码</view>
+    <view class="inp-wrapper">
+      <input class="input" :value="code" placeholder="请输入核销码" @input="pinkCodeInp">
+      <view class="sub-btn" @tap="toScanPick">确定</view>
+    </view>
+  </view>
+</template>
+
+<script>
+const util = require('../../utils/util.js')
+
+export default {
+  data() {
+    return {
+      code: ''
+    }
+  },
+  /**
+	 * 生命周期函数--监听页面加载
+	 */
+  onShow: function() {
+  },
+  methods: {
+    /* 跳转到取件页面 */
+    toScanPick: function() {
+      if (this.code == '') {
+        wx.showToast({
+          title: '请输入核销码',
+          icon: 'none'
+        })
+      } else if (!util.checkIsNum(this.code)) {
+        this.code = ''
+        wx.showToast({
+          title: '请输入正确的核销码',
+          icon: 'none'
+        })
+      } else {
+        const code = this.code
+        // 扫码后跳转核销页面
+        uni.navigateTo({
+          url: '/pages/scan-pick/scan-pick?pickCode=' + code + '&pageType=2'
+        })
+      }
+    },
+    // 获取提货码
+    pinkCodeInp: function(e) {
+      this.code = e.detail.value
+    }
+  }
+}
+</script>
+
+<style>
+@import "./pick-code.css";
+</style>

+ 288 - 0
src/pages/scan-pick/scan-pick.css

@@ -0,0 +1,288 @@
+page{
+	background-color: #f8f8f8;
+}
+.scan-pick {
+	display: block;
+	padding-bottom: 30rpx;
+	box-sizing: border-box;
+}
+
+/* 提货人信息 */
+.personal-inf{
+	display: flex;
+	align-items: center; 			
+	width: 690rpx;
+	font-size: 28rpx;
+	background-color: #fff;
+	border-radius: 10rpx;
+	margin: 0 auto;
+	margin-top: 30rpx;
+}
+.personal-inf-wrapper{
+	padding: 30rpx 0;
+}
+.personal-inf .line{
+	display: flex;
+	align-items: top;
+}
+.personal-inf .line:not(:last-child) {
+	margin-bottom: 30rpx;
+}
+.personal-inf .line view{
+	display: inline-block;
+}
+.personal-inf .line .title{
+	/* width: 164rpx; */
+	white-space:nowrap;
+	color: #999;
+	padding-right: 15rpx;
+	margin-left: 30rpx;
+}
+.personal-inf .line .title .threeWord{
+	padding: 0 29rpx;
+}
+.personal-inf .line .title .fourWord{
+	padding: 0 9rpx;
+}
+.personal-inf .line .detail{
+	width: 460rpx;
+	word-wrap: break-word;
+	word-break: normal;
+	color: 333;
+}
+/* /提货人信息 */
+
+/* 商品详情 */
+.commodity-inf{
+	width: 690rpx;
+	background-color: #fff;
+	border-radius: 10rpx;
+	margin: 0 auto;
+	margin-top: 30rpx;
+}
+.commodity-inf-wrapper{
+	padding: 0 30rpx;
+}
+.commodity-inf .title{
+	display: flex;
+	align-items: center;
+	width: 100%;
+	height: 80rpx;
+	border-bottom: 3rpx solid #eee;
+}
+.commodity-inf .icon{
+	display: inline-block;
+	width: 30rpx;
+	height: 30rpx;
+	margin-right: 15rpx;
+}
+.commodity-inf .icon>image{
+	width: 100%;
+	height: 100%;
+}
+.commodity-inf .font{
+	display: inline-block;
+	font-size: 28rpx;
+	font-weight: 550;
+	padding-right: 16rpx;
+}
+.prod-box{
+	display: block;
+}
+.item-cont {
+	border-bottom: 3rpx solid #eee;
+}
+.prod-detail{
+	display: flex;
+	align-items: center; 			
+	width: 100%;
+	height: 220rpx;
+}
+.prod-detail .prod-img{
+	display: inline-block;
+	width: 175rpx;
+	height: 175rpx;
+	margin-right: 20rpx;
+}
+.prod-detail .prod-img image{
+	width: 175rpx;
+	height: 175rpx;
+}
+.prod-detail .prod-inf{
+	display: inline-block;
+	font-size: 25rpx;
+	width: 100%;
+}
+.prod-detail .prod-inf .prod-title{
+	line-height: 19px;
+	max-height: 39px;
+	overflow: hidden;
+	display: -webkit-box;
+	-webkit-line-clamp: 2;
+	-webkit-box-orient: vertical;
+	text-overflow: ellipsis;
+	word-break: break-all;
+	color: #333;
+	font-size: 26rpx;
+	font-weight: 549;
+}
+.prod-detail .prod-inf .brief{
+	font-size: 23rpx;
+	color: #999;
+	padding: 15rpx 0;
+}
+.prod-detail .prod-inf .brief .gift-icon{
+	display: inline-block;
+	padding: 8rpx;
+	border-radius: 6rpx;
+	background: #e43130;
+	color: #fff;
+	margin-right: 8rpx;
+	line-height: 1em;
+}
+.prod-detail .prod-inf .price{
+	font-size: 31rpx;
+	font-weight: 520;
+	color: #e43130;
+}
+.prod-detail .prod-inf .num{
+	/* float: right; */
+	font-size: 30rpx;
+	color: #999;
+}
+/* 赠品 */
+.item-cont .gift-prods {
+  margin-left: 200rpx;
+  margin-top: 10rpx;
+	margin-bottom: 30rpx;
+	font-size: 24rpx;
+}
+.item-cont .gift-prods .gift-item {
+  display: block;
+  width: 100%;
+  color: #333;
+}
+.item-cont .gift-prods .gift-item {
+  margin-bottom: 10rpx;
+}
+.item-cont .gift-prods .gift-item .name,
+.item-cont .gift-prods .gift-item .num {
+  display: inline-block;
+  vertical-align: middle;
+  padding-right: 10rpx;
+  box-sizing: border-box;
+}
+.item-cont .gift-prods .gift-item .name {
+  width: 90%;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+/* .item-cont .gift-prods .gift-item::after {
+  content: '';
+  display: inline-block;
+  width: 12rpx;
+  height: 12rpx;
+  border-top: 2rpx solid #333333;
+  border-right: 2rpx solid #333333;
+  -webkit-transform: rotate(45deg);
+  transform: rotate(45deg);
+  vertical-align: middle;
+} */
+/* / 赠品 */
+.commodity-inf .total{
+	display: block;
+	padding: 30rpx 0;
+	text-align: right;
+	font-size: 28rpx;
+	box-sizing: border-box;
+}
+.red{
+	color: #e43130;
+}
+/* /商品详情 */
+
+/* 订单备注 */
+.order-remarks{
+	display: flex;
+	/* align-items: center; */
+	width: 690rpx;
+	/* height: 120rpx; */
+	padding: 20rpx 0;
+	font-size: 28rpx;
+	background-color: #fff;
+	border-radius: 10rpx;
+	margin: 0 auto;
+	margin-top: 20rpx;
+}
+.order-remarks .remarks-title{
+	font-size: 28rpx;
+	/* line-height: 30rpx; */
+	color: #999;
+	margin-left: 30rpx;
+	width: 140rpx;
+}
+.order-remarks .remarks-txt{
+	width: 500rpx;
+	word-wrap: break-word;
+	word-break: break-all;
+	overflow: hidden;
+}
+/* /订单备注 */
+
+/* 虚拟商品 */
+.virtual-goods-code {
+	display: block;
+	width: 690rpx;
+	padding: 20rpx 30rpx;
+	box-sizing: border-box;
+	font-size: 28rpx;
+	background-color: #fff;
+	border-radius: 10rpx;
+	margin: 0 auto;
+	margin-top: 20rpx;
+}
+.virtual-goods-code .code-tit {
+	margin-bottom: 20rpx;
+}
+.virtual-goods-code .code-list.code-box  {
+	max-height: 1000rpx;
+	overflow-y: auto;
+}
+.virtual-goods-code .code-list.code-box .code-item {
+	font-size: 26rpx;
+}
+.virtual-goods-code .code-list:not(:last-child) {
+	border-bottom: 1px solid #eee;
+	padding-bottom: 10rpx;
+	margin-bottom: 20rpx;
+}
+.virtual-goods-code .code-list .code-item {
+	margin-bottom: 16rpx;
+	font-size: 24rpx;
+}
+.virtual-goods-code .code-list .date {
+	display: flex;
+	align-items: flex-start;
+}
+.virtual-goods-code .code-list .date .lf {
+	white-space: nowrap;
+}
+.virtual-goods-code .weak {
+	color: #999;
+}
+/* 虚拟商品 / */
+
+/* 取件按键 */
+.pick-btn{
+	width: 690rpx;
+	height: 80rpx;
+	line-height: 80rpx;
+	font-size: 30rpx;
+	color: #fff;
+	background: #126AD7;
+	text-align: center;
+	border-radius: 10rpx;
+	margin: 100rpx auto;
+}
+/* /取件按键 */

+ 378 - 0
src/pages/scan-pick/scan-pick.vue

@@ -0,0 +1,378 @@
+<template>
+  <view class="scan-pick">
+    <!-- 提货人信息 -->
+    <view v-if="isSelfPickup && (stationAddress || stationTime || stationUserName || stationUserMobile)" class="personal-inf">
+      <view class="personal-inf-wrapper">
+        <view class="pick-addr line">
+          <view class="title">提<text class="fourWord">货</text><text class="fourWord">地</text>点:</view>
+          <view class="detail">{{ stationAddress }}</view>
+        </view>
+        <view class="pick-time line">
+          <view class="title">提<text class="fourWord">货</text><text class="fourWord">时</text>间:</view>
+          <view class="detail">{{ stationTime }}</view>
+        </view>
+        <view class="pick-people line">
+          <view class="title">提<text class="threeWord">货</text>人:</view>
+          <view class="detail">{{ stationUserName }}</view>
+        </view>
+        <view class="pick-people line">
+          <view class="title">提货人号码:</view>
+          <view class="detail">{{ stationUserMobile }}</view>
+        </view>
+      </view>
+    </view>
+    <!-- 商品信息 -->
+    <view v-if="orderList && orderList.length" class="commodity-inf">
+      <view class="commodity-inf-wrapper">
+        <view class="title">
+          <!-- <view class="icon"><image src=""></image></view> -->
+          <view class="icon">
+            <image src="/static/images/icon/shop.png" />
+          </view>
+          <view class="font">{{ shopName }}</view>
+        </view>
+        <view class="prod-box">
+          <view v-for="(item, key) in orderList" :key="key" class="item-cont">
+            <view class="prod-detail">
+              <view class="prod-img"><image :src="item.pic" /></view>
+              <view class="prod-inf">
+                <view class="prod-title">{{ item.prodName }}</view>
+                <view class="brief">
+                  <text v-if="orderItemDtos.length === 1 && item.giveawayOrderItemId" class="gift-icon">赠品</text>
+                  <text class="sku-name">{{ item.skuName }}</text>
+                </view>
+                <view>
+                  <!-- <text class="price">¥{{item.price}}</text> -->
+                  <text class="num">×{{ item.prodCount }}</text>
+                </view>
+              </view>
+            </view>
+            <!-- 赠品:多个商品时展示 -->
+            <view v-if="orderItemDtos.length > 1 && item.giveawayList && item.giveawayList.length" class="gift-prods">
+              <view
+                v-for="giftItem in item.giveawayList"
+                :key="giftItem.orderItemId"
+                class="gift-item"
+              >
+                <text class="name">【赠品】{{ giftItem.prodName }}</text>
+                <text class="num">×{{ giftItem.prodCount }}</text>
+              </view>
+            </view>
+            <!-- / 赠品 -->
+          </view>
+        </view>
+        <view class="total-box">
+          <view class="total">
+            <text>共{{ productNums }}件商品,合计:</text>
+            <text v-if="actualTotal" class="red">¥{{ actualTotal }}</text><text v-if="useScore&&actualTotal">+</text><text v-if="useScore" class="red">{{ useScore }} 积分</text>
+          </view>
+        </view>
+      </view>
+    </view>
+    <!-- 券码列表(虚拟商品核销) -->
+    <view v-if="!isSelfPickup && orderVirtualInfoList.length" class="virtual-goods-code">
+      <view class="code-tit">即将核销({{ orderVirtualInfoList.length }}张)</view>
+      <view class="code-list">
+        <view class="code-item date weak">
+          <view class="lf">有效期限:</view>
+          <view class="rg">
+            <text v-if="writeOffStart && !writeOffEnd">永久有效</text>
+            <text v-if="writeOffStart && writeOffEnd">{{ writeOffStart }} 至 {{ writeOffEnd }}</text>
+          </view>
+        </view>
+        <view class="code-item date weak">
+          <view class="lf">核销次数:</view>
+          <view class="rg">
+            <text v-if="writeOffNum === -1">多次核销</text>
+            <text v-if="writeOffNum === 1">单次核销</text>
+            <text v-if="writeOffNum === 0">无需核销</text>
+          </view>
+        </view>
+      </view>
+      <view class="code-list code-box">
+        <view v-for="(item,index) in orderVirtualInfoList" :key="index" class="code-item">
+          券码<text v-if="orderVirtualInfoList.length > 1">{{ index+1 }}</text>:
+          <text>{{ item.writeOffCode }}</text>
+        </view>
+      </view>
+    </view>
+    <!-- 全部留言(虚拟商品核销) -->
+    <view v-if="!isSelfPickup && virtualRemark && virtualRemark.length" class="virtual-goods-code">
+      <view class="code-tit">全部留言</view>
+      <view class="code-list">
+        <view v-for="(item,index) in virtualRemark" :key="index" class="code-item weak">
+          {{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;{{ item.value }}
+        </view>
+      </view>
+    </view>
+    <!-- 订单备注 -->
+    <view v-if="remarks" class="order-remarks">
+      <text class="remarks-title">订单备注:</text>
+      <text class="remarks-txt">{{ remarks }}</text>
+    </view>
+    <!-- 提货按钮 -->
+    <view v-if="!requestPageError" class="pick-btn" @tap="pickGood">
+      {{ isSelfPickup ? '确认取件' : '确认核销' }}
+    </view>
+  </view>
+</template>
+
+<script>
+const http = require('../../utils/http.js')
+
+export default {
+  data() {
+    return {
+      pickCode: '',							// 提货码
+      shopName: '',							// 店铺名称
+      status: '',								// 订单状态	1:待付款 2:待发货 3:待收货 4:待评价 5:成功 6:失败
+      orderNumber: '',					// 订单号
+      stationUserName: '',			// 提货人名字
+      stationUserMobile: '', // 提货人号码
+      stationTime: '',					// 提货时间
+      stationAddress: '',				// 提货地点
+      productNums: 0,						// 订单商品总件数
+      actualTotal: 0,						// 订单总价
+      useScore: 0, // 积分
+      orderList: [],						// 订单的商品列表
+      remarks: '',							// 订单备注
+      orderType: 0, // 订单类型(0普通订单 1团购订单 2秒杀订单)
+
+      pageType: 1, // 1扫码 2手动输入核销码
+
+      // 是否自提
+      isSelfPickup: true,
+
+      // 虚拟商品
+      orderVirtualInfoList: [],
+      // 虚拟商品-全部留言
+      virtualRemark: [],
+      // 核销有效期
+      writeOffStart: null,
+      writeOffEnd: null,
+      // 核销次数 -1多次 1单次 0无需
+      writeOffNum: 0,
+
+      // 是否成功请求页面数据
+      requestPageError: true,
+
+      timer: '',
+
+      orderItemDtos: []
+    }
+  },
+  /* 生命周期函数--监听页面加载 */
+  onLoad: function(options) {
+    // 拿到扫码得到的提货码
+    const pickCode = options.pickCode
+    if (pickCode) {
+      this.setData({
+        pickCode
+      })
+    }
+    // 进入页面类型:1扫码进入 2输入核销码进入
+    this.pageType = Number(options.pageType)
+  },
+  /* 生命周期函数--监听页面显示 */
+  onShow: function() {
+    this.getPickGoodInf()
+  },
+  methods: {
+    /**
+		 * 获取核销码信息
+		 */
+    getPickGoodInf() {
+      uni.showLoading()
+      var param = {
+        url: '/p/station/getStationOrderByCode',
+        method: 'GET',
+        data:	{
+          code: this.pickCode
+        },
+        callBack: res => {
+          console.log(res)
+          if (Object.keys(res).length > 0) {
+            // 自提
+            if (res.orderSelfStationDto) {
+              this.setData({
+                stationUserName: res.orderSelfStationDto.stationUserName,
+                stationUserMobile: res.orderSelfStationDto.stationUserMobile,
+                stationAddress: res.orderSelfStationDto.stationAddress,
+                stationTime: res.orderSelfStationDto.stationTime
+              })
+              this.isSelfPickup = true
+            }
+            // 虚拟商品核销
+            if (res.orderVirtualInfoList) {
+              this.isSelfPickup = false
+              this.setData({
+                orderVirtualInfoList: res.orderVirtualInfoList,
+                virtualRemark: res.virtualRemark ? JSON.parse(res.virtualRemark) : [],
+                writeOffStart: res.writeOffStart,
+                writeOffEnd: res.writeOffEnd,
+                writeOffNum: parseInt(res.writeOffNum)
+              })
+              if (this.virtualRemark && this.virtualRemark.length) {
+                this.virtualRemark = this.virtualRemark.filter(el => el.value)
+              }
+              // 处理从输入核销码页面输入订单号进入的情况
+              if (!this.orderVirtualInfoList.find(el => el.writeOffCode == this.pickCode) &&
+									this.pickCode == res.orderNumber &&
+									this.pageType == 2) {
+                this.pageType = 1
+              }
+            }
+            this.setData({
+              shopName: res.shopName,
+              status: res.status,
+              orderNumber: res.orderNumber,
+              productNums: res.productNums,
+              actualTotal: res.actualTotal,
+              orderItemDtos: res.orderItemDtos,
+              remarks: res.remarks,
+              orderType: res.orderType,
+              useScore: res.orderItemDtos[0].useScore
+            })
+            this.requestPageError = false
+
+            this.orderList = res.orderItemDtos
+            // 处理单个商品时,有赠品的商品列表
+            if (res.orderItemDtos &&
+                res.orderItemDtos.length === 1 &&
+								res.orderItemDtos[0].giveawayList &&
+								res.orderItemDtos[0].giveawayList.length
+            ) {
+              this.orderList = [...res.orderItemDtos, ...res.orderItemDtos[0].giveawayList]
+            }
+          } else {
+            this.requestPageError = true
+            uni.showModal({
+              title: '提示',
+              content: '没有该货物信息,请确认登录账号是否正确',
+              showCancel: false,
+              confirmText: '确定',
+              success: (res) => {
+                if (res.confirm) {
+                  uni.redirectTo({
+                    url: '/pages/index/index'
+                  })
+                }
+              }
+            })
+          }
+          uni.hideLoading()
+        },
+        errCallBack: res => {
+          uni.hideLoading()
+          this.requestPageError = true
+          uni.showModal({
+            title: '提示',
+            content: '该核销码没有对应的订单',
+            showCancel: false,
+            confirmText: '确定',
+            success: (res) => {
+              if (res.confirm) {
+                uni.redirectTo({
+                  url: '/pages/index/index'
+                })
+              }
+            }
+          })
+        }
+      }
+      http.request(param)
+    },
+
+    /**
+		 * 确认核销
+		 */
+    pickGood: function() {
+      if (this.requestPageError) {
+        return
+      }
+      const isSelfPickup = this.isSelfPickup
+      const status = this.status
+      let title = ''
+      // 1、自提商品购买后取货前状态是status==2
+      // 2、虚拟商品购买后核销前状态是status==3(确认收货即状态5已完成,未核销的券码仍然可以核销)
+      if ((isSelfPickup && status == 2) || (!isSelfPickup && (status == 3 || status == 5))) {
+        const url = isSelfPickup ? '/p/station/orderStationByOrderNumber' : '/p/station/orderWriteOffByOrderNumber'
+        const code = isSelfPickup ? this.orderNumber : { orderNumber: this.orderNumber }
+        // 虚拟商品输入核销码核销单个券码时再传writeOffCode,扫码进入无需传writeOffCode
+        if (this.pageType == 2 && !isSelfPickup) { code.writeOffCode = this.pickCode }
+        var param = {
+          url: url,
+          method: 'PUT',
+          data: code,
+          callBack: res => {
+            uni.showToast({
+              title: isSelfPickup ? '取件成功' : '核销成功',
+              icon: 'success'
+            })
+            this.timer = setTimeout(() => {
+              uni.redirectTo({
+                url: '/pages/index/index'
+              })
+            }, 800)
+            uni.hideLoading()
+          },
+          errCallBack: err => {
+            console.log('失败err:', err)
+            uni.showToast({
+              title: err.data,
+              icon: 'none'
+            })
+            uni.hideLoading()
+          }
+        }
+        uni.showModal({
+          title: '提示',
+          content: isSelfPickup ? '是否确认取件' : '是否确认核销',
+          cancelText: '取消',
+          confirmText: '确定',
+          success: (res) => {
+            if (res.confirm) {
+              uni.showLoading()
+              http.request(param)
+            }
+          }
+        })
+      } else {
+        if (status == 1) {
+          title = isSelfPickup ? '订单待支付,请支付后再来取货' : '订单待支付,请先完成支付'
+        } else if ((isSelfPickup && (status == 3 || status == 5)) || status == 4) {
+          title = isSelfPickup ? '订单已取货' : '订单已核销'
+        } else if (status == 6) {
+          title = '订单已取消'
+        } else if (status == 7) {
+          title = '订单未成团,不支持核销'
+        }
+        uni.showModal({
+          title: '提示',
+          content: title,
+          showCancel: false,
+          confirmText: '确定',
+          success: (res) => {
+            if (res.confirm) {
+              uni.redirectTo({
+                url: '/pages/index/index'
+              })
+            }
+          }
+        })
+      }
+    }
+  },
+
+  onUnload() {
+    if (this.timer) {
+      clearTimeout(this.timer)
+      this.timer = null
+    }
+  }
+}
+</script>
+
+<style>
+		@import "./scan-pick.css";
+</style>

+ 115 - 0
src/pages/self-mention-order/self-mention-order.css

@@ -0,0 +1,115 @@
+image {
+  display: block;
+  width: 100%;
+  height: 100%;
+}
+.self-delivery-order {
+  position: fixed;
+  top: 0;
+  bottom:0; 
+  left: 0;
+  display: block;
+  width: 100%;
+  height: 100%;
+  background: #f8f8f8;
+  box-sizing: border-box;
+  padding: 20px;
+  overflow-y:scroll;
+  overflow-x:hidden; 
+}
+.layout-block {
+  background: #fff;
+  border-radius: 10px;
+  margin-bottom: 15px;
+  padding: 10px 15px;
+}
+.block-line {
+  margin: 15px 0;
+  font-size: 14px;
+}
+.line-left {
+  display: inline-block;
+  color: #999;
+  width: 26%;
+  text-align: justify;
+  vertical-align: top;
+}
+.line-right {
+  display: inline-block;
+  width: 74%;
+}
+.order-prod-info .shop-info {
+  display: flex;
+  align-items: center;
+  justify-content: flex-start;
+  padding-bottom: 10px;
+  border-bottom: 1px solid #eee;
+}
+.order-prod-info .shop-info image {
+  display: block;
+  width: 18px;
+  height: 18px;
+  margin-right: 6px;
+}
+.order-prod-info .shop-info .shop-name {
+  font-size: 15px;
+}
+.order-prod-info .block-line {
+  display: flex;
+  align-items: center;
+}
+.order-prod-info .line-left image {
+  width: 100%;
+  height: 80px;
+  background: #ddd;
+}
+.order-prod-info .line-right {
+  margin-left: 10px;
+}
+.order-prod-info .line-right .prod-name {
+  overflow : hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+  margin-bottom: 5px;
+}
+.order-prod-info .line-right .prod-sku {
+  font-size: 13px;
+  color: #888;
+  margin-bottom: 5px;
+  overflow : hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+}
+.order-prod-info .line-right .prod-num {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.order-prod-info .line-right .prod-num .prod-price {
+  color: #e43130;
+  font-size: 16px;
+}
+.order-prod-info .line-right .prod-num .symbol {
+  font-size: 13px;
+}
+.order-prod-info .line-right .prod-num .prod-qua {
+  color: #888;
+}
+.order-prod-info .bottom-total {
+  font-size: 14px;
+  padding-top: 15px;
+  border-top: 1px solid #eee;
+  text-align: right;
+  padding-bottom: 5px;
+}
+.order-prod-info .bottom-total .red-pri {
+  color: #e43130;
+}
+.order-remarks.layout-block .block-line {
+  display: block;
+  margin: 10px 0;
+}

+ 108 - 0
src/pages/self-mention-order/self-mention-order.vue

@@ -0,0 +1,108 @@
+<template>
+  <view class="self-delivery-order">
+    <!-- 订单信息 -->
+    <view class="order-info layout-block">
+      <view class="block-line">
+        <view class="line-left">提货地点:</view>
+        <view class="line-right">广东省广州市番禺区青蓝街22号国家数字基地B栋</view>
+      </view>
+      <view class="block-line">
+        <view class="line-left">提货时间:</view>
+        <view class="line-right">2020年05月19日 17:00-18:00</view>
+      </view>
+      <view class="block-line">
+        <view class="line-left">提货人:</view>
+        <view class="line-right">石榴姐 12345678910</view>
+      </view>
+      <view class="block-line">
+        <view class="line-left">支付方式:</view>
+        <view class="line-right">微信支付</view>
+      </view>
+    </view>
+    <!-- 订单商品信息 -->
+    <view class="order-prod-info layout-block">
+      <view class="shop-info">
+        <image src="/static/images/icon/shop.png" />
+        <view class="shop-name">亚米官方旗舰店</view>
+      </view>
+      <view v-for="(item,index) in prodList" :key="index" class="block-line">
+        <view class="line-left">
+          <image src="" />
+        </view>
+        <view class="line-right">
+          <view class="prod-name">{{ item.prodName }}</view>
+          <view class="prod-sku">{{ item.prodSku }}</view>
+          <view class="prod-num">
+            <view class="prod-price"><text class="symbol">¥</text>{{ item.price }}</view>
+            <view class="prod-qua">×{{ item.num }}</view>
+          </view>
+        </view>
+      </view>
+      <view class="bottom-total">共1件商品,合计:<text class="red-pri">¥355.00</text></view>
+    </view>
+    <!-- 订单备注 -->
+    <view class="order-remarks layout-block">
+      <view class="block-line">
+        <view class="line-left">订单备注:</view>
+        <view class="line-right">暂无备注留言</view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script module="wxs" lang="wxs" src="../../wxs/number.wxs"></script>
+
+<script>
+var http = require("../../utils/http.js");
+var config = require("../../utils/config.js");
+
+export default {
+  data () {
+    return {
+      prodList: [
+        {
+          prodName: '【全新上市】纪梵希绒雾柔焦棒隐匿毛孔抑制油光细腻哑光妆效',
+          prodSku:'绒雾柔焦棒',
+          price: '355.00',
+          num: '1'
+        },
+        {
+          prodName: '【全新上市】纪梵希绒雾柔焦棒隐匿毛孔抑制油光细腻哑光妆效',
+          prodSku:'绒雾柔焦棒',
+          price: '355.00',
+          num: '1'
+        },
+        {
+          prodName: '【全新上市】纪梵希绒雾柔焦棒隐匿毛孔抑制油光细腻哑光妆效',
+          prodSku:'绒雾柔焦棒',
+          price: '355.00',
+          num: '1'
+        },
+        {
+          prodName: '【全新上市】纪梵希绒雾柔焦棒隐匿毛孔抑制油光细腻哑光妆效',
+          prodSku:'绒雾柔焦棒',
+          price: '355.00',
+          num: '1'
+        },
+      ]
+    };
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  methods: {
+
+  }
+
+}
+
+</script>
+
+<style>
+@import "./self-mention-order.css";
+</style>

+ 322 - 0
src/pages/shop-adminsistration/shop-adminsistration.css

@@ -0,0 +1,322 @@
+/* pages/openAShop/openAShop.wxss */
+image {
+  width: 100%;
+  height: 100%;
+}
+.red {
+  color: red;
+}
+
+.modify-for-station-information {
+  width: 100%;
+  height: 100%;
+  overflow: auto;
+}
+.msg-box {
+  display: block;
+  background: #fff;
+  margin-bottom: 15rpx;
+  width: 100%;
+  height: 100%;
+}
+.msg-tit {
+  padding: 20rpx;
+  border-bottom: 1rpx solid #f2f2f2;
+}
+.shop-icon {
+  display: inline-block;
+  width: 40rpx;
+  height: 40rpx;
+  margin-right: 15rpx;
+  vertical-align: middle;
+}
+.shop-icon > image {
+  display: block;
+  width: 100%;
+  height: 100%;
+}
+.shop-msg-tit {
+  display: inline-block;
+  font-size: 32rpx;
+  font-weight: bold;
+  vertical-align: middle;
+}
+.msg-cont-box {
+  font-size: 30rpx;
+  padding: 25rpx 0;
+  margin: 0 20rpx;
+  border-bottom: 1rpx solid #f2f2f2;
+	display: flex;
+}
+.cont-txt {
+	display: inline-block;
+	width: 150rpx;
+	text-align: right;
+	vertical-align: middle;
+	margin: auto 0;
+	margin-right: 40rpx;
+}
+.cont-int {
+  display: inline-block;
+  vertical-align: middle;
+  width: 70%;
+}
+.cont-left{
+	display: inline-block;
+	width: 100rpx;
+	height: 60rpx;
+	vertical-align: middle;
+	padding: 0 15rpx;
+	border: 1rpx solid #d8dbe2;
+	/* margin-right: 20rpx; */
+}
+.cont-right{
+	display: inline-block;
+	width: 220rpx;
+	height: 60rpx;
+	vertical-align: middle;
+	padding: 0 15rpx;
+	border: 1rpx solid #d8dbe2;
+}
+.num-line{
+	display: inline-block;
+	width: 30rpx;
+	height: 2rpx;
+	vertical-align: middle;
+	background-color: #606266;
+	margin: 30rpx 10rpx;
+}
+.picker-section{
+	display: inline-block;
+	font-size: 25rpx;
+	vertical-align: middle;
+	margin-top: 2rpx;
+}
+.picker-section .station-time{
+	display: inline-block;
+	width: 150rpx;
+	color: red;
+	margin-left: 8rpx;
+}
+.picker-section .inter-time{
+	width: 500rpx;
+	font-size: 30rpx;
+}
+.cont-day{
+	display: inline-block;
+	width: 60rpx;
+	height: 60rpx;
+	vertical-align: middle;
+	text-align: center;
+	border-bottom: 1rpx solid #d8dbe2;
+}
+.text-day{
+	font-size: 18rpx;
+}
+.station-status{
+	display: inline-block;
+}
+.station-status .right-radio{
+	margin-left: 50rpx;
+}
+.align-top {
+  vertical-align: top;
+}
+.cont-textarea {
+  box-sizing: border-box;
+  vertical-align: top;
+  line-height: 1.5em;
+  border: 1rpx solid #ececec;
+  border-radius: 8rpx;
+  padding: 10rpx 15rpx;
+}
+
+/* 地址 */
+.addr {
+  position: relative;
+}
+.pca {
+  display: inline-block;
+  width: 70%;
+  /* padding: 0 20rpx; */
+  vertical-align: middle;
+}
+.arrow {
+  position: absolute;
+  right: 20rpx;
+  top: 50%;
+  transform: translateY(-50%);
+  width: 25rpx;
+  height: 25rpx;
+}
+.arrow image {
+  width: 100%;
+  height: 100%;
+  vertical-align: top;
+}
+.animation-element-wrapper {
+  display: flex;
+  position: fixed;
+  left: 0;
+  top: 0;
+  height: 100%;
+  width: 100%;
+  background-color: rgba(0, 0, 0, 0.6);
+  z-index: 999;
+}
+.animation-element {
+  display: flex;
+  position: fixed;
+  width: 100%;
+  height: 470rpx;
+  bottom: 0;
+  background-color: rgba(255, 255, 255, 1);
+}
+.right-bt {
+  right: 20rpx;
+  top: 20rpx;
+  position: absolute;
+  width: 80rpx !important;
+}
+.line {
+  display: block;
+  position: fixed;
+  height: 2rpx;
+  width: 100%;
+  margin-top: 89rpx;
+  background-color: #eee;
+}
+picker-view {
+  background-color: white;
+  padding: 0;
+  width: 100%;
+  height: 380rpx;
+  bottom: 0;
+  position: fixed;
+}
+picker-view-column view {
+  vertical-align: middle;
+  font-size: 28rpx;
+  line-height: 28rpx;
+  height: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+
+/* 经纬度 */
+.show-location {
+  display: inline-block;
+  vertical-align: middle;
+  font-size: 30rpx;
+  line-height: 1.5em;
+  width: 45%;
+	margin-top: 2rpx;
+}
+.map {
+  float: right;
+  color:#ffffff;
+  background: #e43130;
+  font-size: 25rpx;
+  line-height: 40rpx;
+	height: 40rpx;
+  padding: 10rpx 20rpx;
+  border-radius: 8rpx;
+	margin-top: 16rpx;
+  /* margin-right: 20rpx; */
+  vertical-align: middle;
+}
+/* 清除浮动 */
+.clearfix::after {
+  display: block;
+  height: 0;
+  overflow: hidden;
+  content: '';
+  clear: both;
+}
+
+
+/* 上传 */
+.upload-files {
+  display: inline-block;
+  vertical-align: top;
+}
+.upload-tips {
+  font-size: 26rpx;
+  color: #888888;
+  line-height: 2em;
+  margin-bottom: 15rpx;
+}
+/* 预览 */
+.preview-img-box {
+  position: relative;
+  width: 120rpx;
+  height: 120rpx;
+  display: inline-block;
+  margin-bottom: 15rpx;
+  background: #eee;
+}
+.preview-logo{
+  width: 120rpx;
+  height: 120rpx;
+}
+image.preview-img {
+  width: 100%;
+  height: 100%;
+}
+.preview-img-del {
+  position: absolute;
+  top: -5rpx;
+  right: -5rpx;
+  width: 28rpx;
+  height: 28rpx;
+}
+.card-upload {
+  display: inline-block;
+  margin-right: 50rpx;
+}
+.card-txt {
+  font-size: 24rpx;
+  text-align: center;
+  color: #777;
+}
+.upload-icon {
+  display: inline-block;
+  width: 120rpx;
+  height: 120rpx;
+  line-height: 110rpx;
+  text-align: center;
+  border: 1rpx solid #e0e0e0;
+  vertical-align: top;
+  font-size: 90rpx;
+  color: #ddd;
+  margin-bottom: 15rpx;
+}
+
+/* 提交申请 */
+.apply-btn {
+  padding: 100rpx 30rpx 150rpx 30rpx;
+}
+.btn {
+  font-size: 30rpx;
+  text-align: center;
+  background: #e43130;
+  padding-top: 20rpx;
+  padding-bottom: 20rpx;
+  color: #fff;
+  border-radius: 8rpx;
+}
+.foot-tips {
+  font-size: 28rpx;
+  color: #aaa;
+  /* padding: 0 20rpx; */
+  line-height: 1.5em;
+  margin-top: 20rpx;
+}
+.audit-remark{
+  font-size: 26rpx;
+  background: #ffffcd;
+  color:#333;
+  padding:20rpx;
+}

+ 855 - 0
src/pages/shop-adminsistration/shop-adminsistration.vue

@@ -0,0 +1,855 @@
+<template>
+  <view class="modify-for-station-information">
+    <form class="msg-box">
+      <view class="msg-tit">
+        <view class="shop-icon">
+          <image src="/static/images/icon/shop-icon.png" />
+        </view>
+        <view class="shop-msg-tit">店铺管理</view>
+      </view>
+      <!-- 自提点名称 -->
+      <view class="msg-cont-box">
+        <label class="cont-txt">自提点名称</label>
+        <input type="text" class="cont-int" :value="stationName" maxlength="50" placeholder="输入自提点名称" @input="bindStationNameInt"></input>
+      </view>
+      <!-- 自提点图片 -->
+      <view class="msg-cont-box">
+        <label class="cont-txt">自提点图片</label>
+        <!-- 上传文件 -->
+        <view class="upload-files align-top">
+          <!-- 预览图片 -->
+          <view v-if="logoImg.path" class="preview-img-box preview-logo">
+            <image class="preview-img" :src="logoImg.url" mode="aspectFill" />
+            <!-- 删除 -->
+            <image class="preview-img-del" data-type="logoImg" src="/static/images/icon/close2.png" @tap="removeImage" />
+          </view>
+          <!-- 上传 -->
+          <view v-if="!logoImg.path " class="upload-icon upload-logo" data-type="logoImg" @tap="getUploadImg">+</view>
+        </view>
+        <!-- 上传文件end -->
+      </view>
+      <!-- /自提点图片 -->
+      <!-- 状态 -->
+      <view class="msg-cont-box">
+        <label class="cont-txt">状态</label>
+        <radio-group class="station-status">
+          <label class="radio">
+            <radio :checked="stationStatus===1" @tap="statusChange(1)" />营业
+          </label>
+          <label class="radio right-radio">
+            <radio :checked="stationStatus===0" @tap="statusChange(0)" />关闭
+          </label>
+        </radio-group>
+      </view>
+      <!-- 电话号码 -->
+      <view class="msg-cont-box">
+        <label class="cont-txt">电话号码</label>
+        <input type="number" placeholder="区号" :value="stationOwnerAreaCode" class="cont-left" maxlength="5" @input="bindStationOwnerAreaCodeInt"></input>
+        <view class="num-line" />
+        <input type="number" placeholder="电话/手机号码" :value="stationOwnerPhoneValue" class="cont-right" maxlength="11" @input="bindStationOwnerPhoneInt"></input>
+      </view>
+      <!-- 营业时间 -->
+      <view class="msg-cont-box">
+        <label class="cont-txt">营业时间</label>
+        <view class="picker-section">
+          <picker mode="time" :value="stationStartTime" @change="bindStartTimeChange">
+            <view class="picker">
+              开始<text class="station-time">{{ stationStartTime }}</text>
+            </view>
+          </picker>
+        </view>
+        <view class="picker-section">
+          <picker mode="time" :start="stationStartTime" @change="bindEndTimeChange">
+            <view class="picker">
+              结束<text class="station-time">{{ stationEndTime }}</text>
+            </view>
+          </picker>
+        </view>
+      </view>
+      <!-- 时间间隔 -->
+      <view class="msg-cont-box">
+        <label class="cont-txt">时间间隔</label>
+        <view class="picker-section">
+          <picker mode="selector" class="inter-time" :range="interTimeList" @change="bindInterTimeChange">
+            <view class="picker">
+              {{ interTimeList[interValue-1] }}
+            </view>
+          </picker>
+        </view>
+      </view>
+      <!-- 提货时间 -->
+      <view class="msg-cont-box">
+        <label class="cont-txt">提货时间</label>
+        <view class="">
+          <input type="text" class="cont-day" :value="pickGoodStartTime" @input="bindPickGoodStartTime"></input>
+          <text class="text-day">天后开始提货,开始提货</text>
+          <input type="text" class="cont-day" :value="pickGoodEndTime" @input="bindPickGoodEndTime"></input>
+          <text class="text-day">天后结束提货</text>
+        </view>
+      </view>
+      <!-- 店铺地址 -->
+      <view class="msg-cont-box addr" @tap="translate">
+        <label class="cont-txt">所在地区</label>
+        <!-- 展示 -->
+        <view class="pca">{{ province }} {{ city }} {{ area }}</view>
+        <view class="arrow">
+          <image src="/static/images/icon/more.png" />
+        </view>
+        <!-- 弹框 -->
+        <view class="animation-element-wrapper" :animation="animation" :style="'visibility:' + (show ? 'visible':'hidden')" @tap.stop="hiddenFloatView">
+          <view class="animation-element" @tap.stop="nono">
+            <text class="right-bt" @tap.stop="hiddenFloatView">确定</text>
+            <view class="line" />
+            <picker-view indicator-style="height: 50rpx;" :value="value" @change="bindChange" @tap.stop="nono">
+              <!--省-->
+              <picker-view-column>
+                <view v-for="(item, index) in provArray" :key="index">{{ item.areaName }}</view>
+              </picker-view-column>
+              <!--地级市-->
+              <picker-view-column>
+                <view v-for="(item, index) in cityArray" :key="index">{{ item.areaName }}</view>
+              </picker-view-column>
+              <!--区县-->
+              <picker-view-column>
+                <view v-for="(item, index) in areaArray" :key="index">{{ item.areaName }}</view>
+              </picker-view-column>
+            </picker-view>
+          </view>
+        </view>
+      </view>
+      <!-- 详细地址 -->
+      <view class="msg-cont-box">
+        <label class="cont-txt">详细地址</label>
+        <input type="text" :value="stationAddrValue" class="cont-int" placeholder="填写详细地址" @input="bindStationAddrInt"></input>
+      </view>
+      <!-- 经纬度(调用微信地图获取) -->
+      <view class="msg-cont-box wx-map clearfix">
+        <view class="cont-txt">地理位置</view>
+        <view v-if="latitude" class="show-location">
+          <view>{{ '纬度:' + latitude }}</view>
+          <view>{{ '经度:' + longitude }}</view>
+        </view>
+        <view class="map" @tap="chooseLocation">点击获取位置</view>
+      </view>
+    </form>
+    <!-- 提交申请 -->
+    <view class="apply-btn">
+      <view class="btn" @tap="submitApply">提交修改</view>
+    </view>
+  </view>
+</template>
+
+<script>
+var http = require('../../utils/http.js')
+var config = require('../../utils/config.js')
+var util = require('../../utils/util.js')
+var index = [18, 0, 0]
+var t = 0
+var show = false
+var moveY = 200
+
+export default {
+  data() {
+    return {
+      stationId: 0,									// 自提点Id
+      stationStatus: 1,							// 自提点状态  0:关闭 1:营业
+      stationName: '',							// 自提点名称
+      logoImg: {},									// 自提点logo
+      stationOwnerAreaCode: '', // 电话区号
+      stationOwnerPhoneValue: '', // 电话/手机号码
+      stationStartTime: '',					// 开始营业时间
+      stationEndTime: '',						// 打烊的时间
+      pickGoodStartTime: '',				// 提货开始时间
+      pickGoodEndTime: '',					// 提货结束时间
+      interValue: 1,
+      interTime: '',
+      interTimeList: [],						// 时间间隔几种方式
+      value: [0, 0, 0],
+      provinceId: 0,
+      cityId: 0,
+      areaId: 0,
+      provArray: [],
+      cityArray: [],
+      areaArray: [],
+      province: '',
+      city: '',
+      area: '',
+      stationAddrValue: '',					// 详细地址
+      latitude: '',									// 经度
+      longitude: '',								// 纬度
+      mapAddress: '',
+      // 地图定位详细地址
+      mapAddrName: '',
+      // 地图上的地址名称
+      shopNameValue: '',
+      // 店铺名字
+      shopDescribeValue: '',
+      // 店铺描述
+      shopAddrValue: '',
+      // 详细地址
+      shopOwnerValue: '',
+      // 店主姓名
+      shopOwnerPhoneValue: '',
+      // 店主联系电话
+      auditRemarks: '',
+      animation: '',
+      show: ''
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function(options) {
+    this.initCityData(this.provinceId, this.cityId, this.areaId)		// 获取省市区列表
+    this.assigInterTimeList()																				// 时间间隔下拉框列表赋值
+    this.getStationInfo()																						// 获取自提点信息
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function() {
+    // 底部弹框动画
+    this.animation = wx.createAnimation({
+      transformOrigin: '50% 50%',
+      duration: 0,
+      timingFunction: 'ease',
+      delay: 0
+    })
+    this.animation.translateY(200 + 'vh').step()
+    this.setData({
+      animation: this.animation.export(),
+      show: show
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function() {},
+
+  methods: {
+    /* 自提点信息 */
+    getStationInfo: function() {
+      wx.showLoading()
+      var param = {
+        url: '/p/station/info',
+        method: 'GET',
+        data: {},
+        callBack: res => {
+          const timeDate = JSON.parse(res.timeDate)
+          const interval = timeDate.interval ? timeDate.interval : 1
+          const stationStartTime = util.formatTime(timeDate.shopTime[0]).split(' ')[1]					// 切割返回的营业时间
+          const stationEndTime = util.formatTime(timeDate.shopTime[1]).split(' ')[1]						// 切割返回的打烊时间
+          this.stationId = res.stationId
+          this.stationName = res.stationName
+          this.logoImg.url = config.picDomain + res.pic
+          this.logoImg.path = res.pic
+          this.stationStatus = res.status
+          this.stationOwnerAreaCode = res.phonePrefix
+          this.stationOwnerPhoneValue = res.phone
+          this.interValue = interval
+          this.stationStartTime = stationStartTime
+          this.stationEndTime = stationEndTime
+          this.pickGoodStartTime = timeDate.stationStartTime
+          this.pickGoodEndTime = timeDate.stationEndTime
+          this.provinceId = res.provinceId
+          this.cityId = res.cityId
+          this.areaId = res.areaId
+          this.province = res.province
+          this.city = res.city
+          this.area = res.area
+          this.stationAddrValue = res.addr
+          this.latitude = res.lat
+          this.longitude = res.lng
+
+          wx.hideLoading()
+        }
+      }
+      http.request(param)
+    },
+
+    /* 改变自提点状态 */
+    statusChange: function(v) {
+      const stationStatus = v
+      this.setData({
+        stationStatus
+      })
+    },
+
+    /**
+		 *	给时间间隔下拉框列表赋值
+		 */
+    assigInterTimeList: function() {
+      const interTimeList = ['天', '上下午晚上(12和18点为分界点)', '小时', '半小时']
+      this.setData({
+        interTimeList
+      })
+    },
+
+    /**
+     * 请求接口传数据
+     */
+    submitApply: function() {
+      if (this.stationName.trim().length < 2) {
+        wx.showToast({
+          title: '请输入至少两位数字字母汉字组成的自提点名称',
+          icon: 'none'
+        })
+      // } else if (!this.logoImg.url) {
+      //   wx.showToast({
+      //     title: '请上传自提点图片',
+      //     icon: "none"
+      //   })
+      // } else if (this.stationOwnerAreaCode.trim().length < 3) {
+      //   wx.showToast({
+      //     title: '请输入正确的固话区号',
+      //     icon: "none"
+      //   })
+      } else if (this.stationOwnerPhoneValue.trim().length == 0) {
+        wx.showToast({
+          title: '请输入电话号码',
+          icon: 'none'
+        })
+      } else if (!this.stationStartTime || !this.stationEndTime) {
+        wx.showToast({
+          title: '请选择营业时间',
+          icon: 'none'
+        })
+      } else if (this.stationStartTime == this.stationEndTime) {
+        uni.showToast({
+          title: '开始时间不能等于结束时间',
+          icon: 'none'
+        })
+      } else if (!util.checkIsNum(this.pickGoodStartTime) || !util.checkIsNum(this.pickGoodEndTime)) {
+        wx.showToast({
+          title: '请输入正确的提货时间',
+          icon: 'none'
+        })
+      } else if (this.pickGoodStartTime < 0 || this.pickGoodStartTime > 7) {
+        wx.showToast({
+          title: '自提开始时间只能为0-7天',
+          icon: 'none'
+        })
+      } else if (this.pickGoodEndTime < 1 || this.pickGoodEndTime > 7) {
+        wx.showToast({
+          title: '自提结束时间只能为1-7天',
+          icon: 'none'
+        })
+      } else if (!this.province && !this.city && !this.area) {
+        wx.showToast({
+          title: '请选择所在地区',
+          icon: 'none'
+        })
+      } else if (this.stationAddrValue.trim().length < 2) {
+        wx.showToast({
+          title: '请输入正确的详细地址:不得少于2字',
+          icon: 'none'
+        })
+      } else if (this.latitude == '' && this.longitude == '') {
+        wx.showToast({
+          title: '请选择地理位置',
+          icon: 'none'
+        })
+      } else {
+        let timeDate = {}
+        timeDate.shopTime = []
+        timeDate.stationStartTime = this.pickGoodStartTime
+        timeDate.stationEndTime = this.pickGoodEndTime
+        // 获取当前时间的年月日
+        const date = new Date()
+        const fragTime = util.formatTime(date.getTime()).split(' ')[0]
+        timeDate.interval = this.interValue
+        timeDate.shopTime[0] = util.dateToTimestamp(fragTime + ' ' + this.stationStartTime)
+        timeDate.shopTime[1] = util.dateToTimestamp(fragTime + ' ' + this.stationEndTime)
+        timeDate = JSON.stringify(timeDate)
+
+        uni.showLoading()
+        var params = {
+          url: '/p/station/update',
+          method: 'PUT',
+          data: {
+            stationId: this.stationId,
+            stationName: this.stationName,
+            pic: this.logoImg.path || '',
+            status: this.stationStatus,
+            phonePrefix: this.stationOwnerAreaCode,
+            phone: this.stationOwnerPhoneValue,
+            timeDate: timeDate,
+            provinceId: this.provinceId,
+            cityId: this.cityId,
+            areaId: this.areaId,
+            province: this.province,
+            city: this.city,
+            area: this.area,
+            addr: this.stationAddrValue,
+            lat: this.latitude,
+            lng: this.longitude
+          },
+          callBack: function(res) {
+            uni.hideLoading()
+            uni.showToast({
+              title: '修改成功',
+              icon: 'success'
+            })
+            setTimeout(() => {
+              uni.redirectTo({
+                url: '/pages/index/index'
+              })
+            }, 1500)
+          }
+        }
+        http.request(params)
+      }
+    },
+
+    getAuditMsg() {
+      http.request({
+        url: '/p/shop/shopAudit',
+        method: 'GET',
+        data: {},
+        callBack: res => {
+          this.setData({
+            auditRemarks: res.remarks
+          })
+        }
+      })
+    },
+
+    /**
+     * 获取经纬度
+     */
+    chooseLocation: function(e) {
+      var that = this
+      wx.chooseLocation({
+        success: function(res) {
+          console.log('succes1')
+          console.log(res)
+          that.setMapData(res)
+        },
+        fail: function() {
+          wx.getSetting({
+            success(res) {
+              if (!res.authSetting['scope.userLocation']) {
+                console.log('f1')
+                wx.authorize({
+                  scope: 'scope.userLocation',
+
+                  success() {
+                    wx.chooseLocation({
+                      success: function(res) {
+                        that.setMapData(res)
+                      }
+                    })
+                    console.log('success2')
+                  },
+
+                  fail() {
+                    wx.showToast({
+                      title: '请在「右上角」 - 「关于」 - 「右上角」 - 「设置」授予获取位置信息的权限',
+                      icon: 'none'
+                    })
+                  }
+
+                })
+              }
+            }
+
+          })
+        }
+      })
+    },
+
+    setMapData(res) {
+      var latitude = res.latitude
+      var longitude = res.longitude
+      var address = res.address
+      var name = res.name
+      console.log('经度:' + latitude, '纬度:' + longitude, '详细地址:' + address)
+      this.setData({
+        latitude: latitude,
+        longitude: longitude,
+        mapAddress: address,
+        mapAddrName: name
+      })
+    },
+
+    /**
+     * 获取input数据
+     */
+
+    // 获取自提点名称
+    bindStationNameInt: function(e) {
+      this.setData({
+        stationName: e.detail.value
+      })
+    },
+    // 获取区号
+    bindStationOwnerAreaCodeInt: function(e) {
+      this.setData({
+        stationOwnerAreaCode: e.detail.value
+      })
+    },
+    // 获取电话/手机号码
+    bindStationOwnerPhoneInt: function(e) {
+      this.setData({
+        stationOwnerPhoneValue: e.detail.value
+      })
+    },
+    // 获取营业开始时间
+    bindStartTimeChange: function(e) {
+      console.log('picker发送选择改变,携带值为', e.detail.value)
+      const stationStartTime = e.detail.value + ':00'
+      this.setData({
+        stationStartTime,
+        stationEndTime: ''
+      })
+    },
+    // 获取营业结束时间
+    bindEndTimeChange: function(e) {
+      console.log('picker发送选择改变,携带值为', e.detail.value)
+      const stationEndTime = e.detail.value + ':00'
+      this.setData({
+        stationEndTime
+      })
+    },
+    // 获取时间间隔
+    bindInterTimeChange: function(e) {
+      console.log('picker发送选择改变,携带值为', e.detail.value)
+      const idx = e.detail.value
+      this.setData({
+        interValue: idx + 1,
+        interTime: this.interTimeList[idx]
+      })
+    },
+    // 获取开始提货时间
+    bindPickGoodStartTime: function(e) {
+      this.setData({
+        pickGoodStartTime: e.detail.value
+      })
+    },
+    // 获取结束提货时间
+    bindPickGoodEndTime: function(e) {
+      this.setData({
+        pickGoodEndTime: e.detail.value
+      })
+    },
+    // 详细地址
+    bindStationAddrInt: function(e) {
+      this.setData({
+        stationAddrValue: e.detail.value
+      })
+    },
+    bindShopDescribeInt: function(e) {
+      this.setData({
+        shopDescribeValue: e.detail.value
+      })
+    },
+    bindShopAddrInt: function(e) {
+      this.setData({
+        shopAddrValue: e.detail.value
+      })
+    },
+    bindShopOwnerInt: function(e) {
+      this.setData({
+        shopOwnerValue: e.detail.value
+      })
+    },
+    bindShopOwnerPhoneInt: function(e) {
+      this.setData({
+        shopOwnerPhoneValue: e.detail.value
+      })
+    },
+
+    /**
+     * 上传图片
+     */
+    getUploadImg: function(e) {
+      const type = e.target.dataset.type
+      console.log(type)
+      var ths = this
+      wx.chooseImage({
+        count: 1, // 默认9
+        sizeType: ['compressed'],
+        sourceType: ['album', 'camera'],
+        success: function(res) {
+          // 图片的本地临时文件路径列表
+          var tempFilePaths = res.tempFilePaths
+          wx.showLoading({
+            mask: true
+          })
+          var params = {
+            url: '/p/file/upload',
+            filePath: tempFilePaths[0],
+            name: 'file',
+            callBack: function(res2) {
+              wx.hideLoading()
+              var img = {}
+              img.path = JSON.parse(res2).filePath
+              img.url = JSON.parse(res2).resourcesUrl + JSON.parse(res2).filePath
+
+              if (type == 'bussLicenImg') {
+                ths.setData({
+                  bussLicenImg: img
+                })
+              } else if (type == 'logoImg') {
+                ths.setData({
+                  logoImg: img
+                })
+              } else if (type == 'idcardFrontImg') {
+                ths.setData({
+                  idcardFrontImg: img
+                })
+              } else if (type == 'idcardBackImg') {
+                ths.setData({
+                  idcardBackImg: img
+                })
+              }
+            }
+          }
+          http.upload(params)
+        }
+      })
+    },
+
+    /**
+     * 删除图片
+     */
+    removeImage: function(e) {
+      const type = e.target.dataset.type
+
+      if (type == 'logoImg') {
+        this.setData({
+          logoImg: {}
+        })
+      } else if (type == 'idcardFrontImg') {
+        this.setData({
+          idcardFrontImg: {}
+        })
+      } else if (type == 'idcardBackImg') {
+        this.setData({
+          idcardBackImg: {}
+        })
+      } else if (type == 'bussLicenImg') {
+        this.setData({
+          bussLicenImg: {}
+        })
+      }
+
+      console.log('删除图片')
+    },
+
+    /**
+     * 获取省市区
+     */
+    initCityData: function(provinceId, cityId, areaId) {
+      var ths = this
+      wx.showLoading()
+      var params = {
+        url: '/p/area/listByPid',
+        method: 'GET',
+        data: {
+          pid: 0
+        },
+        callBack: function(res) {
+          // console.log(res)
+          ths.setData({
+            provArray: res
+          })
+
+          if (provinceId) {
+            for (var index in res) {
+              if (res[index].areaId == provinceId) {
+                ths.setData({
+                  value: [index, ths.value[1], ths.value[2]]
+                })
+              }
+            }
+          }
+
+          ths.getCityArray(provinceId || res[0].areaId, cityId, areaId)
+          wx.hideLoading()
+        }
+      }
+      http.request(params)
+    },
+
+    /**
+     * 滑动事件
+     */
+    bindChange: function(e) {
+      var ths = this
+      var val = e.detail.value // 判断滑动的是第几个column
+      // 若省份column做了滑动则定位到地级市和区县第一位
+
+      if (index[0] != val[0]) {
+        val[1] = 0
+        val[2] = 0 // 更新数据
+
+        ths.getCityArray(this.provArray[val[0]].areaId) // 获取地级市数据
+      } else {
+        // 若省份column未做滑动,地级市做了滑动则定位区县第一位
+        if (index[1] != val[1]) {
+          val[2] = 0 // 更新数据
+
+          ths.getAreaArray(this.cityArray[val[1]].areaId) // 获取区县数据
+        }
+      }
+
+      index = val
+      this.setData({
+        value: [val[0], val[1], val[2]]
+      })
+      ths.setData({
+        province: ths.provArray[ths.value[0]].areaName,
+        city: ths.cityArray[ths.value[1]].areaName,
+        area: ths.areaArray[ths.value[2]].areaName,
+        provinceId: ths.provArray[ths.value[0]].areaId,
+        cityId: ths.cityArray[ths.value[1]].areaId,
+        areaId: ths.areaArray[ths.value[2]].areaId
+      })
+    },
+
+    /**
+     * 根据省份ID获取 城市数据
+     */
+    getCityArray: function(provinceId, cityId, areaId) {
+      var ths = this
+      var params = {
+        url: '/p/area/listByPid',
+        method: 'GET',
+        data: {
+          pid: provinceId
+        },
+        callBack: function(res) {
+          // console.log(res)
+          ths.setData({
+            cityArray: res
+          })
+
+          if (cityId) {
+            for (var index in res) {
+              if (res[index].areaId == cityId) {
+                ths.setData({
+                  value: [ths.value[0], index, ths.value[2]]
+                })
+              }
+            }
+          }
+
+          ths.getAreaArray(cityId || res[0].areaId, areaId)
+          wx.hideLoading()
+        }
+      }
+      http.request(params)
+    },
+
+    /**
+     * 根据城市ID获取 区数据
+     */
+    getAreaArray: function(cityId, areaId) {
+      var ths = this
+      var params = {
+        url: '/p/area/listByPid',
+        method: 'GET',
+        data: {
+          pid: cityId
+        },
+        callBack: function(res) {
+          // console.log(res)
+          ths.setData({
+            areaArray: res
+          })
+
+          if (areaId) {
+            for (var _index in res) {
+              if (res[_index].areaId == areaId) {
+                ths.setData({
+                  value: [ths.value[0], ths.value[1], _index]
+                })
+              }
+            }
+            index = ths.value
+            // ths.setData({
+            //   province: ths.province,
+            //   city: ths.city,
+            //   area: ths.area,
+            //   provinceId: ths.provinceId,
+            //   cityId: ths.cityId,
+            //   areaId: ths.areaId
+            // });
+          } else {
+            // ths.setData({
+            //   province: ths.provArray[ths.value[0]].areaName,
+            //   city: ths.cityArray[ths.value[1]].areaName,
+            //   area: ths.areaArray[ths.value[2]].areaName,
+            //   provinceId: ths.provArray[ths.value[0]].areaId,
+            //   cityId: ths.cityArray[ths.value[1]].areaId,
+            //   areaId: ths.areaArray[ths.value[2]].areaId
+            // });
+          }
+
+          wx.hideLoading()
+        }
+      }
+      http.request(params)
+    },
+
+    /**
+     * 移动按钮点击事件
+     */
+    translate: function(e) {
+      // this.initCityData(this.provinceId, this.cityId, this.areaId)
+      if (t == 0) {
+        moveY = 0
+        show = false
+        t = 1
+      } else {
+        moveY = 200
+        show = true
+        t = 0
+      }
+
+      this.setData({
+        show: true
+      }) // this.animation.translate(arr[0], arr[1]).step();
+
+      this.animationEvents(this, moveY, show)
+    },
+
+    /**
+     * 隐藏弹窗浮层
+     */
+    hiddenFloatView(e) {
+      // console.log(e);
+      moveY = 200
+      show = true
+      t = 0
+      this.animationEvents(this, moveY, show)
+    },
+
+    /**
+     * 动画事件
+     */
+    animationEvents: function(that, moveY, show) {
+      // console.log("moveY:" + moveY + "\nshow:" + show);
+      that.animation = wx.createAnimation({
+        transformOrigin: '50% 50%',
+        duration: 400,
+        timingFunction: 'ease',
+        delay: 0
+      })
+      that.animation.translateY(moveY + 'vh').step()
+      that.setData({
+        animation: that.animation.export()
+      })
+    }
+  }
+}
+</script>
+
+<style>
+@import "./shop-adminsistration.css";
+</style>
+

BIN
src/static/images/icon/account-settings.png


BIN
src/static/images/icon/account-settings2.png


BIN
src/static/images/icon/activity-arr.png


BIN
src/static/images/icon/activity-bg.png


BIN
src/static/images/icon/add.png


BIN
src/static/images/icon/addr.png


BIN
src/static/images/icon/alipay.png


BIN
src/static/images/icon/applyAshop.png


BIN
src/static/images/icon/arrive-at-cash.png


BIN
src/static/images/icon/back-to-top.png


BIN
src/static/images/icon/banner.png


BIN
src/static/images/icon/bg1.png


BIN
src/static/images/icon/car-new.png


BIN
src/static/images/icon/car.png


BIN
src/static/images/icon/chat.png


BIN
src/static/images/icon/chongzhi.png


BIN
src/static/images/icon/clear-his.png


BIN
src/static/images/icon/close.png


BIN
src/static/images/icon/close2.png


BIN
src/static/images/icon/coupon-banner.png


BIN
src/static/images/icon/coupon-bg.png


BIN
src/static/images/icon/coupon-ot.png


BIN
src/static/images/icon/coupon-received.png


BIN
src/static/images/icon/coupon-robbed.png


BIN
src/static/images/icon/coupon-used.png


BIN
src/static/images/icon/customer-service.png


BIN
src/static/images/icon/default-avatar.png


BIN
src/static/images/icon/delive-dot.png


Some files were not shown because too many files changed in this diff