Selaa lähdekoodia

feat: 去掉 hbuilder 依赖,基础重构

Basil 3 vuotta sitten
commit
61667a92b2
100 muutettua tiedostoa jossa 56695 lisäystä ja 0 poistoa
  1. 21 0
      .gitignore
  2. 19 0
      README.md
  3. 81 0
      babel.config.js
  4. 9 0
      jsconfig.json
  5. 38692 0
      package-lock.json
  6. 112 0
      package.json
  7. 27 0
      postcss.config.js
  8. 10 0
      shime-uni.d.ts
  9. 4 0
      shime-vue.d.ts
  10. 581 0
      src/App.vue
  11. 181 0
      src/api/activity.js
  12. 130 0
      src/api/admin.js
  13. 510 0
      src/api/api.js
  14. 29 0
      src/api/dacang.js
  15. 290 0
      src/api/order.js
  16. 96 0
      src/api/public.js
  17. 476 0
      src/api/store.js
  18. 804 0
      src/api/user.js
  19. 87 0
      src/api/xinban.js
  20. 184 0
      src/colorui/animation.css
  21. 89 0
      src/colorui/components/cu-custom.vue
  22. 1226 0
      src/colorui/icon.css
  23. 3941 0
      src/colorui/main.css
  24. 1 0
      src/common/amap-wx.js
  25. 29 0
      src/common/api/index.js
  26. 178 0
      src/common/api/request.js
  27. 42 0
      src/common/api/url.js
  28. 96 0
      src/common/config.js
  29. 70 0
      src/common/filter/index.js
  30. 29 0
      src/common/function/debounce.js
  31. 22 0
      src/common/function/deepClone.js
  32. 32 0
      src/common/function/throttle.js
  33. 52 0
      src/common/function/timeFormat.js
  34. 47 0
      src/common/function/timeFrom.js
  35. 185 0
      src/common/mixin/biological.js
  36. 49 0
      src/common/mixin/floor.js
  37. 39 0
      src/common/mixin/index.js
  38. 99 0
      src/common/mixin/paging_list.js
  39. 1463 0
      src/common/uni.css
  40. 16 0
      src/common/utils/index.js
  41. 51 0
      src/common/utils/message.js
  42. 77 0
      src/common/utils/richText.js
  43. 61 0
      src/common/utils/router.js
  44. 70 0
      src/common/utils/upload-file-to-oss.js
  45. 70 0
      src/common/utils/upload-file-to-qiniu.js
  46. 58 0
      src/common/utils/upload-image.js
  47. 211 0
      src/common/utils/utils.js
  48. 93 0
      src/common/utils/validate.js
  49. 168 0
      src/components/Authorize.vue
  50. 204 0
      src/components/Commodity.vue
  51. 138 0
      src/components/ben-share/ben-share.vue
  52. 157 0
      src/components/ben-share/ben-share1.vue
  53. 121 0
      src/components/countDown/index.vue
  54. 168 0
      src/components/couponWindow/index.vue
  55. 36 0
      src/components/emptyPage.vue
  56. 143 0
      src/components/goodList/index.vue
  57. 488 0
      src/components/lb-picker/README.md
  58. 392 0
      src/components/lb-picker/index.vue
  59. 93 0
      src/components/lb-picker/mixins/index.js
  60. 135 0
      src/components/lb-picker/pickers/multi-selector-picker.vue
  61. 113 0
      src/components/lb-picker/pickers/selector-picker.vue
  62. 116 0
      src/components/lb-picker/pickers/unlinked-selector-picker.vue
  63. 40 0
      src/components/lb-picker/style/picker-item.scss
  64. 176 0
      src/components/lb-picker/style/picker.scss
  65. 121 0
      src/components/lb-picker/utils.js
  66. 135 0
      src/components/orderGoods/index.vue
  67. 226 0
      src/components/payment/index.vue
  68. 110 0
      src/components/promotionGood/index.vue
  69. 202 0
      src/components/recommend/index.vue
  70. 192 0
      src/components/tabNav.vue
  71. 224 0
      src/components/uni-nav-bar/uni-nav-bar.vue
  72. 9 0
      src/components/uni-popup/config.json
  73. 86 0
      src/components/uni-popup/readme.md
  74. 212 0
      src/components/uni-popup/uni-popup.vue
  75. 208 0
      src/components/uni-popup/uni-popup_nobg.vue
  76. 204 0
      src/components/volunteer-navtabs.vue
  77. 42 0
      src/config/app.js
  78. 32 0
      src/config/cache.js
  79. 77 0
      src/config/richText.js
  80. 8 0
      src/config/socket.js
  81. 81 0
      src/config/validate.js
  82. 14 0
      src/lang/index.js
  83. 8 0
      src/lang/rank/product-rank/rank-detail.js
  84. 8 0
      src/lang/rank/product-rank/rank-list.js
  85. 8 0
      src/lang/tab/cart/cart-page.js
  86. 8 0
      src/lang/tab/cate/cate-three.js
  87. 1 0
      src/libs/amap-wx.js
  88. 91 0
      src/libs/chat.js
  89. 1 0
      src/libs/day.js
  90. 117 0
      src/libs/login.js
  91. BIN
      src/libs/media-release.aar
  92. 19 0
      src/libs/order.js
  93. 141 0
      src/libs/routine.js
  94. 7 0
      src/libs/style.components.scss
  95. 263 0
      src/libs/wechat.js
  96. BIN
      src/libs/weex_videoplayer-release.aar
  97. 88 0
      src/main.js
  98. 298 0
      src/manifest.json
  99. 27 0
      src/mixins/SendVerifyCode.js
  100. 0 0
      src/pages.json

+ 21 - 0
.gitignore

@@ -0,0 +1,21 @@
1
+# Logs
2
+logs
3
+*.log
4
+npm-debug.log*
5
+yarn-debug.log*
6
+yarn-error.log*
7
+pnpm-debug.log*
8
+lerna-debug.log*
9
+
10
+node_modules
11
+.DS_Store
12
+dist
13
+*.local
14
+
15
+# Editor directories and files
16
+.idea
17
+*.suo
18
+*.ntvs*
19
+*.njsproj
20
+*.sln
21
+*.sw?

+ 19 - 0
README.md

@@ -0,0 +1,19 @@
1
+# cx-tdba_weapp
2
+
3
+## Project setup
4
+```
5
+yarn install
6
+```
7
+
8
+### Compiles and hot-reloads for development
9
+```
10
+yarn serve
11
+```
12
+
13
+### Compiles and minifies for production
14
+```
15
+yarn build
16
+```
17
+
18
+### Customize configuration
19
+See [Configuration Reference](https://cli.vuejs.org/config/).

+ 81 - 0
babel.config.js

@@ -0,0 +1,81 @@
1
+const webpack = require('webpack')
2
+const plugins = []
3
+
4
+if (process.env.UNI_OPT_TREESHAKINGNG) {
5
+  plugins.push(require('@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js'))
6
+}
7
+
8
+if (
9
+  (
10
+    process.env.UNI_PLATFORM === 'app-plus' &&
11
+    process.env.UNI_USING_V8
12
+  ) ||
13
+  (
14
+    process.env.UNI_PLATFORM === 'h5' &&
15
+    process.env.UNI_H5_BROWSER === 'builtin'
16
+  )
17
+) {
18
+  const path = require('path')
19
+
20
+  const isWin = /^win/.test(process.platform)
21
+
22
+  const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
23
+
24
+  const input = normalizePath(process.env.UNI_INPUT_DIR)
25
+  try {
26
+    plugins.push([
27
+      require('@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console'),
28
+      {
29
+        file (file) {
30
+          file = normalizePath(file)
31
+          if (file.indexOf(input) === 0) {
32
+            return path.relative(input, file)
33
+          }
34
+          return false
35
+        }
36
+      }
37
+    ])
38
+  } catch (e) { }
39
+}
40
+
41
+process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui']
42
+process.UNI_LIBRARIES.forEach(libraryName => {
43
+  plugins.push([
44
+    'import',
45
+    {
46
+      'libraryName': libraryName,
47
+      'customName': (name) => {
48
+        return `${libraryName}/lib/${name}/${name}`
49
+      }
50
+    }
51
+  ])
52
+})
53
+
54
+if (process.env.UNI_PLATFORM !== 'h5') {
55
+  plugins.push('@babel/plugin-transform-runtime')
56
+}
57
+
58
+const config = {
59
+  presets: [
60
+    [
61
+      '@vue/app',
62
+      {
63
+        modules: webpack.version[0] > 4 ? 'auto' : 'commonjs',
64
+        useBuiltIns: process.env.UNI_PLATFORM === 'h5' ? 'usage' : 'entry'
65
+      }
66
+    ]
67
+  ],
68
+  plugins
69
+}
70
+
71
+const UNI_H5_TEST = '**/@dcloudio/uni-h5/dist/index.umd.min.js'
72
+if (process.env.NODE_ENV === 'production') {
73
+  config.overrides = [{
74
+    test: UNI_H5_TEST,
75
+    compact: true,
76
+  }]
77
+} else {
78
+  config.ignore = [UNI_H5_TEST]
79
+}
80
+
81
+module.exports = config

+ 9 - 0
jsconfig.json

@@ -0,0 +1,9 @@
1
+{
2
+  "compilerOptions": {
3
+    "types": [
4
+      "@dcloudio/types",
5
+      "miniprogram-api-typings",
6
+      "mini-types"
7
+    ]
8
+  }
9
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 38692 - 0
package-lock.json


+ 112 - 0
package.json

@@ -0,0 +1,112 @@
1
+{
2
+  "name": "cx-tdba_weapp",
3
+  "version": "0.1.0",
4
+  "private": true,
5
+  "scripts": {
6
+    "serve": "npm run dev:h5",
7
+    "build": "npm run build:h5",
8
+    "build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
9
+    "build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
10
+    "build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build",
11
+    "build:mp-360": "cross-env NODE_ENV=production UNI_PLATFORM=mp-360 vue-cli-service uni-build",
12
+    "build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build",
13
+    "build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build",
14
+    "build:mp-jd": "cross-env NODE_ENV=production UNI_PLATFORM=mp-jd vue-cli-service uni-build",
15
+    "build:mp-kuaishou": "cross-env NODE_ENV=production UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build",
16
+    "build:mp-lark": "cross-env NODE_ENV=production UNI_PLATFORM=mp-lark vue-cli-service uni-build",
17
+    "build:mp-qq": "cross-env NODE_ENV=production UNI_PLATFORM=mp-qq vue-cli-service uni-build",
18
+    "build:mp-toutiao": "cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build",
19
+    "build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build",
20
+    "build:mp-xhs": "cross-env NODE_ENV=production UNI_PLATFORM=mp-xhs vue-cli-service uni-build",
21
+    "build:quickapp-native": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-native vue-cli-service uni-build",
22
+    "build:quickapp-webview": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview vue-cli-service uni-build",
23
+    "build:quickapp-webview-huawei": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build",
24
+    "build:quickapp-webview-union": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build",
25
+    "dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",
26
+    "dev:custom": "cross-env NODE_ENV=development uniapp-cli custom",
27
+    "dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve",
28
+    "dev:mp-360": "cross-env NODE_ENV=development UNI_PLATFORM=mp-360 vue-cli-service uni-build --watch",
29
+    "dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch",
30
+    "dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch",
31
+    "dev:mp-jd": "cross-env NODE_ENV=development UNI_PLATFORM=mp-jd vue-cli-service uni-build --watch",
32
+    "dev:mp-kuaishou": "cross-env NODE_ENV=development UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build --watch",
33
+    "dev:mp-lark": "cross-env NODE_ENV=development UNI_PLATFORM=mp-lark vue-cli-service uni-build --watch",
34
+    "dev:mp-qq": "cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch",
35
+    "dev:mp-toutiao": "cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch",
36
+    "dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch",
37
+    "dev:mp-xhs": "cross-env NODE_ENV=development UNI_PLATFORM=mp-xhs vue-cli-service uni-build --watch",
38
+    "dev:quickapp-native": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-native vue-cli-service uni-build --watch",
39
+    "dev:quickapp-webview": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview vue-cli-service uni-build --watch",
40
+    "dev:quickapp-webview-huawei": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build --watch",
41
+    "dev:quickapp-webview-union": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build --watch",
42
+    "info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js",
43
+    "serve:quickapp-native": "node node_modules/@dcloudio/uni-quickapp-native/bin/serve.js",
44
+    "test:android": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=android jest -i",
45
+    "test:h5": "cross-env UNI_PLATFORM=h5 jest -i",
46
+    "test:ios": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=ios jest -i",
47
+    "test:mp-baidu": "cross-env UNI_PLATFORM=mp-baidu jest -i",
48
+    "test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"
49
+  },
50
+  "dependencies": {
51
+    "@dcloudio/uni-app": "^2.0.2-3080720230703001",
52
+    "@dcloudio/uni-app-plus": "^2.0.2-3080720230703001",
53
+    "@dcloudio/uni-h5": "^2.0.2-3080720230703001",
54
+    "@dcloudio/uni-i18n": "^2.0.2-3080720230703001",
55
+    "@dcloudio/uni-mp-360": "^2.0.2-3080720230703001",
56
+    "@dcloudio/uni-mp-alipay": "^2.0.2-3080720230703001",
57
+    "@dcloudio/uni-mp-baidu": "^2.0.2-3080720230703001",
58
+    "@dcloudio/uni-mp-jd": "^2.0.2-3080720230703001",
59
+    "@dcloudio/uni-mp-kuaishou": "^2.0.2-3080720230703001",
60
+    "@dcloudio/uni-mp-lark": "^2.0.2-3080720230703001",
61
+    "@dcloudio/uni-mp-qq": "^2.0.2-3080720230703001",
62
+    "@dcloudio/uni-mp-toutiao": "^2.0.2-3080720230703001",
63
+    "@dcloudio/uni-mp-vue": "^2.0.2-3080720230703001",
64
+    "@dcloudio/uni-mp-weixin": "^2.0.2-3080720230703001",
65
+    "@dcloudio/uni-mp-xhs": "^2.0.2-3080720230703001",
66
+    "@dcloudio/uni-quickapp-native": "^2.0.2-3080720230703001",
67
+    "@dcloudio/uni-quickapp-webview": "^2.0.2-3080720230703001",
68
+    "@dcloudio/uni-stacktracey": "^2.0.2-3080720230703001",
69
+    "@dcloudio/uni-stat": "^2.0.2-3080720230703001",
70
+    "@vue/shared": "^3.0.0",
71
+    "core-js": "^3.8.3",
72
+    "flyio": "^0.6.2",
73
+    "sass": "^1.63.6",
74
+    "sass-loader": "^13.3.2",
75
+    "uview-ui": "^1.8.3",
76
+    "vue": ">= 2.6.14 < 2.7",
77
+    "vue-i18n": "^8.22.2",
78
+    "vuex": "^3.2.0"
79
+  },
80
+  "devDependencies": {
81
+    "@dcloudio/types": "^3.3.2",
82
+    "@dcloudio/uni-automator": "^2.0.2-3080720230703001",
83
+    "@dcloudio/uni-cli-i18n": "^2.0.2-3080720230703001",
84
+    "@dcloudio/uni-cli-shared": "^2.0.2-3080720230703001",
85
+    "@dcloudio/uni-helper-json": "*",
86
+    "@dcloudio/uni-migration": "^2.0.2-3080720230703001",
87
+    "@dcloudio/uni-template-compiler": "^2.0.2-3080720230703001",
88
+    "@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.2-3080720230703001",
89
+    "@dcloudio/vue-cli-plugin-uni": "^2.0.2-3080720230703001",
90
+    "@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.2-3080720230703001",
91
+    "@dcloudio/webpack-uni-mp-loader": "^2.0.2-3080720230703001",
92
+    "@dcloudio/webpack-uni-pages-loader": "^2.0.2-3080720230703001",
93
+    "@vue/cli-plugin-babel": "~5.0.0",
94
+    "@vue/cli-service": "~5.0.0",
95
+    "babel-plugin-import": "^1.11.0",
96
+    "cross-env": "^7.0.2",
97
+    "jest": "^25.4.0",
98
+    "less": "^4.1.3",
99
+    "less-loader": "^11.1.3",
100
+    "mini-types": "*",
101
+    "miniprogram-api-typings": "*",
102
+    "postcss-comment": "^2.0.0",
103
+    "vue-template-compiler": ">= 2.6.14 < 2.7"
104
+  },
105
+  "browserslist": [
106
+    "Android >= 4.4",
107
+    "ios >= 9"
108
+  ],
109
+  "uni-app": {
110
+    "scripts": {}
111
+  }
112
+}

+ 27 - 0
postcss.config.js

@@ -0,0 +1,27 @@
1
+const path = require('path')
2
+const webpack = require('webpack')
3
+const config = {
4
+  parser: require('postcss-comment'),
5
+  plugins: [
6
+    require('postcss-import')({
7
+      resolve (id, basedir, importOptions) {
8
+        if (id.startsWith('~@/')) {
9
+          return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3))
10
+        } else if (id.startsWith('@/')) {
11
+          return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2))
12
+        } else if (id.startsWith('/') && !id.startsWith('//')) {
13
+          return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1))
14
+        }
15
+        return id
16
+      }
17
+    }),
18
+    require('autoprefixer')({
19
+      remove: process.env.UNI_PLATFORM !== 'h5'
20
+    }),
21
+    require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
22
+  ]
23
+}
24
+if (webpack.version[0] > 4) {
25
+  delete config.parser
26
+}
27
+module.exports = config

+ 10 - 0
shime-uni.d.ts

@@ -0,0 +1,10 @@
1
+import Vue from 'vue'
2
+declare module "vue/types/options" {
3
+  type Hooks = App.AppInstance & Page.PageInstance;
4
+  interface ComponentOptions<V extends Vue> extends Hooks {
5
+      /**
6
+       * 组件类型
7
+       */
8
+      mpType?: string;
9
+  }
10
+}

+ 4 - 0
shime-vue.d.ts

@@ -0,0 +1,4 @@
1
+declare module "*.vue" {
2
+  import Vue from 'vue'
3
+  export default Vue
4
+}

+ 581 - 0
src/App.vue

@@ -0,0 +1,581 @@
1
+<script>
2
+	import Vue from 'vue'
3
+	// import Voice from "@/js_sdk/QuShe-baiduYY/QS-baiduyy/QS-baiduyy.js"
4
+	import {
5
+		checkLogin
6
+	} from "./libs/login";
7
+	import {
8
+		HTTP_REQUEST_URL
9
+	} from './config/app';
10
+	import {
11
+		getconfig,
12
+		history
13
+	} from '@/api/public.js'
14
+	import {
15
+		commonEdition,
16
+		merchantList,
17
+		merchant
18
+	} from '@/api/user.js';
19
+	export default {
20
+		globalData: {
21
+			spid: 0,
22
+			code: 0,
23
+			isLogin: false,
24
+			userInfo: {},
25
+			MyMenus: [],
26
+			balance_func_status: 0, //余额开关
27
+			recharge_switch: 0, // 充值开关
28
+			store_user_min_recharge: 0, //最小充值
29
+			yue_pay_status: 0, //余额支付开关
30
+			site_logo: '', //首页logo
31
+			site_name: '', //名称
32
+			fid: '', //一级分类id
33
+			uid:'',
34
+			mews_all: '', // 消息中心
35
+		},
36
+		version: '', // app版本号
37
+		onLaunch: function(option) {
38
+			if(JSON.stringify(option.referrerInfo) != "{}"){
39
+				uni.setStorageSync('oids', option.referrerInfo.extraData.oid);
40
+				uni.setStorageSync('types', option.referrerInfo.extraData.type);
41
+			}
42
+			this.globalData.uid = this.$store.state.app.uid
43
+			let that = this;
44
+			merchantList().then(res => {
45
+				console.log(res)
46
+			});
47
+			
48
+			// let ads = '0.15'
49
+			// Voice('充值金额'+ads+'元');
50
+			// setInterval(this.setDataFrom,3000)
51
+			// #ifdef APP-PLUS
52
+			// this.setDataFrom()
53
+			
54
+			setInterval(this.setDataFrom,3000)
55
+			// #endif
56
+			// #ifdef MP
57
+			if (HTTP_REQUEST_URL == '') {
58
+				console.error(
59
+					"请配置根目录下的config.js文件中的 'HTTP_REQUEST_URL'\n\n请修改开发者工具中【详情】->【AppID】改为自己的Appid\n\n请前往后台【小程序】->【小程序配置】填写自己的 appId and AppSecret"
60
+				);
61
+				return false;
62
+			}
63
+			if (option.query.hasOwnProperty('scene')) {
64
+				switch (option.scene) {
65
+					//扫描小程序码
66
+					case 1047:
67
+						console.log(option,'val')
68
+						let val = that.$util.getUrlParams(decodeURIComponent(option.query.scene));
69
+						
70
+						that.globalData.code = val;
71
+						break;
72
+						//长按图片识别小程序码
73
+					case 1048:
74
+						that.globalData.code = option.query.scene;
75
+						break;
76
+						//手机相册选取小程序码
77
+					case 1049:
78
+						that.globalData.code = option.query.scene;
79
+						break;
80
+						//直接进入小程序
81
+					case 1001:
82
+						that.globalData.spid = option.query.scene;
83
+						break;
84
+				}
85
+			}
86
+			// #endif
87
+			// 获取导航高度;
88
+			uni.getSystemInfo({
89
+				success: function(res) {
90
+					that.globalData.navHeight = res.statusBarHeight * (750 / res.windowWidth) + 91;
91
+				}
92
+			});
93
+			// 获取配置
94
+			getconfig().then(res => {
95
+				this.globalData.balance_func_status = res.data.balance_func_status
96
+				this.globalData.recharge_switch = res.data.recharge_switch
97
+				this.globalData.site_logo = res.data.site_logo
98
+				this.globalData.site_name = res.data.site_name
99
+				this.globalData.store_user_min_recharge = res.data.store_user_min_recharge
100
+				this.globalData.yue_pay_status = res.data.yue_pay_status
101
+				this.globalData.sys_intention_agree = res.data.sys_intention_agree
102
+				this.globalData.mer_intention_open = res.data.mer_intention_open 
103
+				this.globalData.mews_all = res.data.mews_all
104
+				try {
105
+				  uni.setStorageSync('SUBSCRIBE_MESSAGE', res.data.tempid);
106
+				} catch (e) {
107
+				  // error
108
+				}
109
+				// #ifdef H5
110
+				this.setOpenShare(res.data);
111
+				// #endif
112
+			}).catch(err => {})
113
+			
114
+			/* 引入colorUI配置 */
115
+			// 读取系统信息,设置全局导航高度
116
+			uni.getSystemInfo({
117
+				success: function(e) {
118
+					// #ifndef MP
119
+					Vue.prototype.StatusBar = e.statusBarHeight;
120
+					if (e.platform == 'android') {
121
+						Vue.prototype.CustomBar = e.statusBarHeight + 50;
122
+					} else {
123
+						Vue.prototype.CustomBar = e.statusBarHeight + 45;
124
+					};
125
+					// #endif
126
+			
127
+					// #ifdef MP-WEIXIN
128
+					Vue.prototype.StatusBar = e.statusBarHeight;
129
+					let custom = wx.getMenuButtonBoundingClientRect();
130
+					Vue.prototype.Custom = custom;
131
+					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
132
+					// #endif		
133
+			
134
+					// #ifdef MP-ALIPAY
135
+					Vue.prototype.StatusBar = e.statusBarHeight;
136
+					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
137
+					// #endif
138
+          Vue.mixin({
139
+            data() {
140
+              return {
141
+                StatusBar: Vue.prototype.StatusBar,
142
+                CustomBar: Vue.prototype.CustomBar,
143
+				}
144
+            }
145
+			})
146
+        }
147
+      });
148
+			//#ifdef APP-PLUS
149
+			plus.runtime.getProperty(plus.runtime.appid, (inf) => {
150
+				this.version = inf.version;
151
+				// this.version = '1.1.20';
152
+				if (this.version) {
153
+					this.checkUpdate(); // 检查更新
154
+				}
155
+			});
156
+			
157
+			// 锁定屏幕显示方向为竖屏正方向
158
+			plus.screen.lockOrientation('portrait-primary');
159
+			// 推送服务
160
+			plus.push.addEventListener('click', () => {
161
+				plus.nativeUI.toast('提示消息');
162
+				this.pushCallback(message);
163
+			});
164
+			plus.push.addEventListener('receive', () => {
165
+				plus.nativeUI.toast('透传消息');
166
+				this.pushCallback(message);
167
+			});
168
+			// 加载本地字体
169
+			uni.loadFontFace({
170
+				family: 'PingFang SC',
171
+				source: `url(${plus.io.convertLocalFileSystemURL('_www/static/font/pingfang.ttf')})`,
172
+			})
173
+			// #endif
174
+			global.token && this.$store.dispatch('getCartList');
175
+		},
176
+		methods:{
177
+			//语音播报
178
+			setDataFrom(){
179
+				let token = uni.getStorageSync('LOGIN_STATUS_TOKEN')
180
+				if(!token){
181
+					return
182
+				}
183
+				merchantList().then(res => {
184
+					// console.log(res)
185
+					let arr = res.data.list
186
+					if(arr){
187
+						arr.map((item,index)=>{
188
+							if(item.is_broadcast==0){
189
+								Voice(item.broadcast)
190
+								merchant({
191
+									order_id:item.id
192
+								}).then(ress => {
193
+								})
194
+							}
195
+						})
196
+					}
197
+				});
198
+			},
199
+			// 检查更新
200
+			checkUpdate () {
201
+				console.log('开始检测')
202
+				let clientType = uni.getSystemInfoSync().platform // 判断客户端环境 -- ios 安卓
203
+				commonEdition ({
204
+					about: this.version, // 版本号
205
+					type: clientType == 'ios' ? 2 : 1, // 1安卓2ios
206
+				}).then(res => {
207
+					console.log(res)
208
+					if (res.status === 200) {
209
+						const iosLink = res.data.about_link_ios // ios下载链接
210
+						const androidLink = res.data.about_link_android // 安卓下载链接
211
+          				const latestId = clientType == 'ios' ? res.data.about_edition_ios : res.data.about_edition_android // 新版本
212
+						// 是否是最新版本
213
+						console.log(this.version , latestId)
214
+						if (this.version < latestId) {
215
+							let downloadLink = ''
216
+              				let ready = false
217
+							// 开始下载
218
+							if (clientType == 'android') {
219
+								console.log('anzhuo')
220
+								if (androidLink) {
221
+									downloadLink = androidLink
222
+									ready = true
223
+								} else { 
224
+									this.$util.Tips({
225
+										title: '下载地址是空的,无法继续'
226
+									});
227
+								}
228
+							} else {
229
+								console.log('ios')
230
+								if (iosLink) {
231
+									// 苹果(A):进行热更新(如果iosLink是wgt更新包的下载地址)判断文件名中是否含有.wgt
232
+									if (iosLink.match(RegExp(/.wgt/))) {
233
+										console.log('确认wgt热更新包')
234
+										downloadLink = iosLink
235
+										ready = true
236
+									} else {
237
+										console.log('苹果只支持.wgt强制更新')
238
+										plus.runtime.openURL(iosLink);  //  在浏览器打开链接去下载整包
239
+									}
240
+								} else { 
241
+									this.$util.Tips({
242
+										title: '下载地址是空的,无法继续'
243
+									});
244
+								}
245
+							}
246
+							// 开始下载-------------------------------------------------------
247
+							if (ready) {
248
+								uni.showToast({
249
+								    title: '发现新版本,后台自动更新中...',
250
+									icon:'none',
251
+								    duration: 2000
252
+								});
253
+								console.log('开始下载',downloadLink)
254
+								uni.downloadFile({
255
+									url: downloadLink,
256
+									success: (res) => {
257
+										console.log('打开下载文件',res)
258
+										if (res.statusCode === 200) {
259
+											uni.saveFile({
260
+											    tempFilePath: res.tempFilePath,
261
+											    success: (res) => {
262
+											        const packgePath = res.savedFilePath
263
+											        // 保存更新记录到stroage,下次启动app时安装更新
264
+											        // uni.setStorage({
265
+											        //     key: 'updated',
266
+											        //     data: {
267
+											        //         completed: false,
268
+											        //         packgePath: packgePath
269
+											        //     },
270
+											        //     success: () => {
271
+											        //         console.log('成功保存记录')
272
+											        //     }
273
+											        // })
274
+											        // 任务完成,关闭下载任务
275
+											        console.log('任务完成,关闭下载任务,下一次启动应用时将安装更新')
276
+													// 安装更新
277
+													plus.runtime.install(packgePath, {
278
+														force: true 
279
+													}, function() {
280
+														// 保存更新记录到stroage,方便下次启动app时删除安装包
281
+														plus.nativeUI.toast('更新成功');
282
+														if (packgePath.match(RegExp(/.wgt/))) {
283
+															uni.showModal({
284
+																title: '提示',
285
+																content: '应用将重启以完成更新',
286
+																showCancel: false,
287
+																complete: () => {
288
+																	// uni.setStorage({
289
+																	// 	key: 'updated',
290
+																	// 	data: {
291
+																	// 		completed: true,
292
+																	// 		packgePath: packgePath
293
+																	// 	},
294
+																	// 	success: res => {
295
+																	// 		console.log('成功保存更新记录');
296
+																	// 	}
297
+																	// });
298
+																	plus.runtime.restart();
299
+																}
300
+															});
301
+														}else{
302
+															plus.runtime.restart();	//重启
303
+														}
304
+													}, function(e) {
305
+														plus.nativeUI.toast('安装包下载失败,请去应用市场更新');
306
+													});
307
+											    }
308
+											})
309
+											
310
+											
311
+											
312
+											//这是之前的
313
+											// plus.runtime.install( // 安装
314
+											// 	res.tempFilePath, {
315
+											// 		force: true
316
+											// 	},
317
+											// 	function(res) {
318
+											// 		console.log('重启')
319
+											// 		plus.runtime.restart();
320
+											// 	}
321
+											// );
322
+										} else {
323
+											console.log('检测失败')
324
+										}
325
+									}
326
+								})
327
+							} else {
328
+								console.log('下载地址未准备,无法开启下载任务')
329
+							}
330
+						}
331
+					}
332
+				}).catch((err) => {
333
+					console.log(err)
334
+				})
335
+			},
336
+			// 微信分享;
337
+			setOpenShare: function(data) {
338
+				let that = this;
339
+				let href = location.href;
340
+				href =href.indexOf("?") === -1 ?href + "?spread=" + this.globalData.uid :href + "&spread=" + this.globalData.uid;
341
+				if (that.$wechat.isWeixin()) {
342
+					let configAppMessage = {
343
+						desc: data.share_info,
344
+						title: data.share_title,
345
+						link: href,
346
+						imgUrl: data.share_pic
347
+					};
348
+					that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
349
+			
350
+				}
351
+			},
352
+			// 推送回调
353
+			      pushCallback(message) {
354
+			        console.log("to do list", message);
355
+			      },
356
+			      // #ifdef APP-PLUS
357
+			      // 权限检查
358
+			      checkPermissions() {
359
+			        // #ifdef APP-PLUS
360
+			        if (plus.os.name == 'Android') { // 判断是Android
361
+			          var main = plus.android.runtimeMainActivity();
362
+			          var pkName = main.getPackageName();
363
+			          var uid = main.getApplicationInfo().plusGetAttribute("uid");
364
+			          var NotificationManagerCompat = plus.android.importClass("android.support.v4.app.NotificationManagerCompat");
365
+			          var areNotificationsEnabled = NotificationManagerCompat.from(main).areNotificationsEnabled();
366
+			          // 未开通‘允许通知’权限,则弹窗提醒开通,并点击确认后,跳转到系统设置页面进行设置
367
+			          if (!areNotificationsEnabled) {
368
+			            uni.showModal({
369
+			              title: '通知权限开启提醒',
370
+			              content: '您还没有开启通知权限,无法接受到消息通知,是否前往设置?',
371
+			              success: function(res) {
372
+			                if (res.confirm) {
373
+			                  var Intent = plus.android.importClass('android.content.Intent');
374
+			                  var Build = plus.android.importClass("android.os.Build");
375
+			                  //android 8.0引导
376
+			                  if (Build.VERSION.SDK_INT >= 26) {
377
+			                    var intent = new Intent('android.settings.APP_NOTIFICATION_SETTINGS');
378
+			                    intent.putExtra('android.provider.extra.APP_PACKAGE', pkName);
379
+			                  } else if (Build.VERSION.SDK_INT >= 21) { //android 5.0-7.0
380
+			                    var intent = new Intent('android.settings.APP_NOTIFICATION_SETTINGS');
381
+			                    intent.putExtra("app_package", pkName);
382
+			                    intent.putExtra("app_uid", uid);
383
+			                  } else { //(<21)其他--跳转到该应用管理的详情页
384
+			                    intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
385
+			                    var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
386
+			                    intent.setData(uri);
387
+			                  }
388
+			                  // 跳转到该应用的系统通知设置页
389
+			                  main.startActivity(intent);
390
+			                }
391
+			              }
392
+			            });
393
+			          }
394
+			        } else if (plus.os.name == 'iOS') { // 判断是ISO
395
+			          var isOn = undefined;
396
+			          var types = 0;
397
+			          var app = plus.ios.invoke('UIApplication', 'sharedApplication');
398
+			          var settings = plus.ios.invoke(app, 'currentUserNotificationSettings');
399
+			          if (settings) {
400
+			            types = settings.plusGetAttribute('types');
401
+			            plus.ios.deleteObject(settings);
402
+			          } else {
403
+			            types = plus.ios.invoke(app, 'enabledRemoteNotificationTypes');
404
+			          }
405
+			          plus.ios.deleteObject(app);
406
+			          isOn = (0 != types);
407
+			          if (isOn == false) {
408
+			            uni.showModal({
409
+			              title: '通知权限开启提醒',
410
+			              content: '您还没有开启通知权限,无法接受到消息通知,是否前往设置?',
411
+			              success: function(res) {
412
+			                if (res.confirm) {
413
+			                  var app = plus.ios.invoke('UIApplication', 'sharedApplication');
414
+			                  var setting = plus.ios.invoke('NSURL', 'URLWithString:', 'app-settings:');
415
+			                  plus.ios.invoke(app, 'openURL:', setting);
416
+			                  plus.ios.deleteObject(setting);
417
+			                  plus.ios.deleteObject(app);
418
+			                }
419
+			              }
420
+			            });
421
+			          }
422
+			        }
423
+			        // #endif
424
+			      },
425
+			      // 初始化 3D Touch
426
+			      init3DTouch() {
427
+			        this.$api.post(global.apiUrls.postHomeGrid, {
428
+			          typeid: 2
429
+			        }).then(res => {
430
+			          if (res.data.code == 1) {
431
+			            let list = res.data.data;
432
+			            const dcRichAlert = uni.requireNativePlugin('DCloud-RichAlert');
433
+			            if (dcRichAlert) {
434
+			              let _shortcut = '[';
435
+			              let len = list.length;
436
+			              list.forEach((item, index) => {
437
+			                _shortcut +=
438
+			                  `{"id":"${item.href}","describe":"${item.name}","icon":"${item.thumb}","shortlabel":"${item.name}","longlabel":"${item.name}"}`;
439
+			                if ((index + 1) != len) {
440
+			                  _shortcut += ','
441
+			                }
442
+			              })
443
+			              _shortcut += ']';
444
+			              dcRichAlert.show({
445
+			                shortcut: _shortcut
446
+			              }, result => {
447
+			                if (result.post === 'success') {
448
+			                  uni.navigateTo({
449
+			                    url: result.id
450
+			                  })
451
+			                }
452
+			              });
453
+			            }
454
+			          }
455
+			        });
456
+			      }
457
+			      // #endif
458
+		},
459
+		onShow: function() {
460
+			console.log('APP Show');
461
+			// #ifdef APP-PLUS
462
+			// 获取参数
463
+			const args = plus.runtime.arguments;
464
+			if (args) {
465
+				let params_str = args.split('?')[1];
466
+				if (params_str) {
467
+					let params = params_str.split('&').reduce(function(total, item) {
468
+						let arr = item.split('=');
469
+						total[arr[0]] = arr[1];
470
+						return total;
471
+					}, {});
472
+					console.log(params);
473
+					// params 参数: path 跳转路径 options 参数
474
+					uni.navigateTo({
475
+						url: `${params.path}?goods_id=${params.goods_id}&activity_id=${params.activity_id}&sku_id=${params.sku_id}&bargain_id=${params.bargain_id}`
476
+					})
477
+				}
478
+			}
479
+			// 快捷入口
480
+			// this.init3DTouch();
481
+			// #endif
482
+		},
483
+		onHide: function() {
484
+			//console.log('App Hide')
485
+		},
486
+		watch: {
487
+			// 记录H5和公众号
488
+			$route(n) {
489
+				if (this.$store.state.app.token) {
490
+					// 浏览记录
491
+					history({
492
+						page: n.path,
493
+					}).then(() => {});
494
+				}
495
+			},
496
+		}
497
+	}
498
+</script>
499
+
500
+<style lang="scss">
501
+	// @import './common/uni.css';
502
+	/*colorUi样式,请勿修改*/
503
+	// @import "uview-ui/index.scss";
504
+	@import 'colorui/main.css';
505
+	@import 'colorui/icon.css';
506
+	/* 自带css */
507
+	@import url("@/plugin/animate/animate.min.css");
508
+	@import 'static/css/base.css';
509
+	@import 'static/iconfont/iconfont.css';
510
+	@import 'static/css/guildford.css';
511
+	@import 'static/css/style.scss';
512
+	// /* #ifndef APP-PLUS-NVUE */
513
+	@import "./style/icon.css";
514
+	@import "./style/main.css";
515
+	@import "./style/animation.css";
516
+	@import "./style/iconfont.css";
517
+	// /* #endif */
518
+	/* 推广 */
519
+	.statisticsBgColor {
520
+		background: #f94032;
521
+		color: #FFFFFF;
522
+	}
523
+	/*  ===========我的资料============ start */
524
+ /* uni-actionshee    start */
525
+	.uni-actionsheet__menu .uni-actionsheet__cell{
526
+		color: #333333!important;
527
+	}
528
+	.uni-actionsheet__action .uni-actionsheet__cell{
529
+		color: #FF6464!important;
530
+	}
531
+	/* uni-actionshee end */
532
+	/*  picker start */
533
+
534
+	.uni-picker-container .uni-picker-action.uni-picker-action-confirm{
535
+		color: #FF6464;
536
+	}
537
+	/*  picker end */
538
+	/*  ===========我的资料============ end */
539
+
540
+	view {
541
+		box-sizing: border-box;
542
+	}
543
+	
544
+	.bg-color-red {
545
+		background-color: #e93323 !important;
546
+	}
547
+
548
+	.syspadding {
549
+		padding-top: var(--status-bar-height);
550
+	}
551
+
552
+	.flex {
553
+		display: flex;
554
+	}
555
+
556
+	.uni-scroll-view::-webkit-scrollbar {
557
+		/* 隐藏滚动条,但依旧具备可以滚动的功能 */
558
+		display: none
559
+	}
560
+
561
+	::-webkit-scrollbar {
562
+		width: 0;
563
+		height: 0;
564
+		color: transparent;
565
+	}
566
+	::-moz-scrollbar {
567
+		width: 0;
568
+		height: 0;
569
+		color: transparent;
570
+	}
571
+	
572
+	.empty-txt {
573
+		line-height: 100rpx;
574
+		font-size: 22rpx;
575
+		color: #999;
576
+		text-align: center;
577
+	}
578
+	.product-con .conter img{
579
+		display: block;
580
+	}
581
+</style>

+ 181 - 0
src/api/activity.js

@@ -0,0 +1,181 @@
1
+import request from "@/utils/request.js";
2
+/**
3
+ * 
4
+ * 所有活动接口 包括:拼团,砍价,秒杀
5
+ * 
6
+*/
7
+
8
+/**
9
+ * 拼团列表
10
+ * 
11
+*/
12
+export function getCombinationList(data) {
13
+  return request.get('combination/list', data,{noAuth:true});
14
+}
15
+
16
+/**
17
+ * 拼团详情
18
+ * 
19
+*/
20
+export function getCombinationDetail(id) {
21
+  return request.get('combination/detail/'+id);
22
+}
23
+
24
+/**
25
+ * 拼团 开团
26
+ */
27
+export function getCombinationPink(id) {
28
+  return request.get("combination/pink/" + id);
29
+}
30
+
31
+/**
32
+ * 拼团 取消开团
33
+ */
34
+export function postCombinationRemove(data) {
35
+  return request.post("combination/remove",data);
36
+}
37
+
38
+/**
39
+ * 砍价列表
40
+ */
41
+export function getBargainList(data) {
42
+  return request.get("bargain/list", data,{noAuth:true});
43
+}
44
+
45
+/**
46
+ * 
47
+ * 砍价列表(已参与)
48
+ * @param object data
49
+*/
50
+export function getBargainUserList(data){
51
+  return request.get('bargain/user/list',data);
52
+}
53
+
54
+
55
+/**
56
+ * 
57
+ * 取消砍价
58
+ * @param int bargainId
59
+*/
60
+export function bargainUserCancel(bargainId){
61
+  return request.post('bargain/user/cancel', { bargainId: bargainId})
62
+}
63
+
64
+/**
65
+ * 砍价产品详情
66
+ */
67
+export function getBargainDetail(id) {
68
+  return request.get("bargain/detail/" + id);
69
+}
70
+
71
+/**
72
+ * 砍价 开启砍价用户信息
73
+ */
74
+export function postBargainStartUser(data) {
75
+  return request.post("bargain/start/user", data);
76
+}
77
+
78
+/**
79
+ * 砍价开启
80
+ */
81
+export function postBargainStart(bargainId) {
82
+  return request.post("bargain/start", { bargainId: bargainId});
83
+}
84
+
85
+/**
86
+ * 砍价 帮助好友砍价
87
+ */
88
+export function postBargainHelp(data) {
89
+  return request.post("bargain/help", data);
90
+}
91
+
92
+/**
93
+ * 砍价 砍掉金额
94
+ */
95
+export function postBargainHelpPrice(data) {
96
+  return request.post("bargain/help/price", data);
97
+}
98
+
99
+/**
100
+ * 砍价 砍价帮
101
+ */
102
+export function postBargainHelpList(data) {
103
+  return request.post("bargain/help/list", data);
104
+}
105
+
106
+/**
107
+ * 砍价 砍价帮总人数、剩余金额、进度条、已经砍掉的价格
108
+ */
109
+export function postBargainHelpCount(data) {
110
+  return request.post("bargain/help/count", data);
111
+}
112
+
113
+/**
114
+ * 砍价 观看/分享/参与次数
115
+ */
116
+export function postBargainShare(bargainId) {
117
+  return request.post("bargain/share", { bargainId: bargainId});
118
+}
119
+
120
+
121
+/**
122
+ * 秒杀产品详情
123
+ * @param int id
124
+*/
125
+export function getSeckillDetail(id){
126
+  return request.get('store/product/seckill/detail/'+id);
127
+}
128
+
129
+/**
130
+ * 砍价海报
131
+ * @param object data
132
+ * 
133
+*/
134
+export function getBargainPoster(data){
135
+  return request.post('bargain/poster',data)
136
+}
137
+
138
+/**
139
+ * 拼团海报
140
+ * @param object data
141
+ * 
142
+*/
143
+export function getCombinationPoster(data){
144
+  return request.post('combination/poster',data)
145
+}
146
+
147
+/**
148
+ * 砍价取消
149
+ */
150
+export function getBargainUserCancel(data) {
151
+  return request.post("/bargain/user/cancel", data);
152
+}
153
+
154
+/**
155
+ * 获取秒杀小程序二维码
156
+ */
157
+export function seckillCode(id,data) {
158
+  return request.get("seckill/code/"+id,data);
159
+}
160
+
161
+/**
162
+ * 获取拼团小程序二维码
163
+ */
164
+export function scombinationCode(id) {
165
+  return request.get("combination/code/"+id);
166
+}
167
+/**
168
+ * 秒杀产品时间区间
169
+ * 
170
+*/
171
+export function getSeckillIndexTime(){
172
+  return request.get('store/product/seckill/select',{},{noAuth:true});
173
+}
174
+/**
175
+ * 秒杀产品列表
176
+ * @param int time
177
+ * @param object data
178
+*/
179
+export function getSeckillList(data){
180
+  return request.get('store/product/seckill/lst',data,{noAuth:true});
181
+}

+ 130 - 0
src/api/admin.js

@@ -0,0 +1,130 @@
1
+import request from "@/utils/request.js";
2
+
3
+/**
4
+ * 统计数据
5
+ */
6
+export function getStatisticsInfo() {
7
+  return request.get("admin/order/statistics", {}, { login: true });
8
+}
9
+/**
10
+ * 订单月统计
11
+ */
12
+export function getStatisticsMonth(where) {
13
+  return request.get("admin/order/data", where, { login: true });
14
+}
15
+/**
16
+ * 订单月统计
17
+ */
18
+export function getAdminOrderList(where) {
19
+  return request.get("admin/order/list", where, { login: true });
20
+}
21
+/**
22
+ * 订单改价
23
+ */
24
+export function setAdminOrderPrice(id,data) {
25
+  return request.post("admin/price/"+id, data, { login: true });
26
+}
27
+/**
28
+ * 订单备注
29
+ */
30
+export function setAdminOrderRemark(id,data) {
31
+  return request.post("admin/mark/" +id, data, { login: true });
32
+}
33
+/**
34
+ * 订单详情
35
+ */
36
+export function getAdminOrderDetail(orderId) {
37
+  return request.get("admin/order/" + orderId, {}, { login: true });
38
+}
39
+/**
40
+ * 订单发货信息获取
41
+ */
42
+export function getAdminOrderDelivery(orderId) {
43
+  return request.get( "admin/order/delivery/gain/" + orderId,{},{ login: true });
44
+}
45
+
46
+/**
47
+ * 订单发货保存
48
+ */
49
+export function setAdminOrderDelivery(id,data) {
50
+  return request.post("admin/delivery/"+ id, data, { login: true });
51
+}
52
+/**
53
+ * 订单统计图
54
+ */
55
+export function getStatisticsTime(data) {
56
+  return request.get("admin/order/time", data, { login: true });
57
+}
58
+/**
59
+ * 线下付款订单确认付款
60
+ */
61
+export function setOfflinePay(data) {
62
+  return request.post("admin/order/offline", data, { login: true });
63
+}
64
+/**
65
+ * 订单确认退款
66
+ */
67
+export function setOrderRefund(data) {
68
+  return request.post("admin/order/refund", data, { login: true });
69
+}
70
+
71
+/**
72
+ * 获取快递公司
73
+ * @returns {*}
74
+ */
75
+export function getLogistics() {
76
+  return request.get("logistics", {}, { login: false });
77
+}
78
+
79
+/**
80
+ * 订单核销
81
+ * @returns {*}
82
+ */
83
+export function orderVerific(code) {
84
+  return request.post("verifier/"+code);
85
+}
86
+
87
+/**
88
+ * 核销订单详情
89
+ * @returns {*}
90
+ */
91
+export function verifierOrder(code) {
92
+  return request.get("verifier/order/"+code);
93
+}
94
+
95
+/**
96
+ * 订单统计数
97
+ * @returns {*}
98
+ */
99
+export function orderStatistics() {
100
+  return request.get("admin/statistics");
101
+}
102
+/**
103
+ * 每日成交额
104
+ * @returns {*}
105
+ */
106
+export function orderPrice(where) {
107
+  return request.get("admin/order_price", where, { login: true });
108
+}
109
+/**
110
+ * 订单列表
111
+ * @returns {*}
112
+ */
113
+export function getOrderList(where) {
114
+  return request.get("admin/order_list", where, { login: true });
115
+}
116
+/**
117
+ * 营业额统计
118
+ * @returns {*}
119
+ */
120
+export function turnoverStatistics(where) {
121
+  return request.get("admin/pay_price", where, { login: true });
122
+}
123
+/**
124
+ * 订单统计
125
+ * @returns {*}
126
+ */
127
+export function orderNumberStatistics(where) {
128
+  return request.get("admin/pay_number", where, { login: true });
129
+}
130
+

+ 510 - 0
src/api/api.js

@@ -0,0 +1,510 @@
1
+import request from "@/utils/request.js";
2
+/**
3
+ * 公共接口 ,优惠券接口 , 行业此讯 , 手机号码注册
4
+ * 
5
+*/
6
+/*
7
+*/
8
+// 填写激活码
9
+export function codeStatus(data) {
10
+  return request.get("intention/code_status",data);
11
+}
12
+// 创建年费的订单
13
+export function annualCost(data) {
14
+  return request.post("order/create_annual_cost",data);
15
+}
16
+//判断有没有交年费
17
+export function nianfei(data) {
18
+  return request.get("intention/nianfei",data);
19
+}
20
+/**
21
+ * 获取城市信息县
22
+ */
23
+export function Newcreate() {
24
+  return request.get('system/city/new_lst', { }, { noAuth: true });
25
+}
26
+
27
+//体现数据
28
+export function amount(data){
29
+	return request.post("entropy/withdrawal_service",data)
30
+}
31
+// 排行榜
32
+export function rankingss(data){
33
+	return request.get("entropy/ranking_list",data)
34
+}
35
+//签到
36
+export function informations(data){
37
+	return request.get("entropy/zjky_signireward_record",data)
38
+}
39
+//获取签到信息
40
+export function informationgets(data){
41
+	return request.get("entropy/get_zjky_signireward_record",data)
42
+}
43
+export function hlep_wenGET(id) {
44
+  return request.get('article/lst/'+id,{ page:'1',mer_id:'290',limit:'20'},{noAuth:true});
45
+}
46
+export function gethlep_listGET() {
47
+  return request.get('article/category/lst/48',{},{noAuth:true});
48
+}
49
+//首页商品列表
50
+export function productlst(data) {
51
+  return request.get("entropy/product_lst",data);
52
+}
53
+// 订单养老金显示
54
+export function yanglaoList(data) {
55
+  return request.get("entropy/order_lst_yanglao",data);
56
+}
57
+// 商品分类
58
+export function categoryList(data) {
59
+  return request.get("entropy/category",data);
60
+}
61
+// 绑定微信小程序关系
62
+export function xcxBangding(data) {
63
+  return request.get("entropy/xcx_bangding",data);
64
+}
65
+// 绑定推荐关系
66
+export function bangding(data) {
67
+  return request.get("entropy/bangding",data);
68
+}
69
+export function appletAudit(data) {
70
+  return request.get("applet_audit",data);
71
+}
72
+// 绑定推荐关系的状态
73
+export function bangdingStatus(data) {
74
+  return request.get("entropy/bangding_status",data);
75
+}
76
+
77
+//我的分销商进去默认请求
78
+export function subordinate(data) {
79
+  return request.get("entropy/my_distributor",data);
80
+}
81
+//易商易物
82
+export function personals(data) {
83
+  return request.get("entropy/personals",data);
84
+}
85
+//我的团队
86
+export function MyGroups(type) {
87
+  return request.get("entropy/subordinate",type);
88
+}
89
+//团队订单
90
+export function groups(id) {
91
+  return request.get("entropy/order_lst",id);
92
+}
93
+// 我的订单
94
+export function myorders(data) {
95
+  return request.get( `entropy/my_order`,data);
96
+}
97
+// 支付订单年费
98
+export function payAnnual(data) {
99
+  return request.get("pay_annual_cost",data);
100
+}
101
+// 支付订单激活码
102
+export function payActivationCode(data) {
103
+  return request.get("pay_activation_code",data);
104
+}
105
+// 支付
106
+export function SxyPayWecha(data) {
107
+  return request.get("sxy_pay_wechat_mp",data);
108
+}
109
+
110
+// 提现明细
111
+export function submitDetails(data) {
112
+  return request.get("entropy/withdrawal_details",data);
113
+}
114
+
115
+//https://test.bjtdba.com/api/volunteer_list
116
+export function VolunteerList(data) {
117
+  return request.get("volunteer_list",data);
118
+}
119
+export function ShopToppong(id) {
120
+  return request.post("shop_toppong/" + id);
121
+}
122
+export function ShopFabulous(id) {
123
+  return request.post("shop_fabulous/" + id);
124
+}
125
+// 搜索历史
126
+export function historyList(data) {
127
+  return request.get("third_history",data);
128
+}
129
+// 拍照返回
130
+export function seachimg(data) {
131
+  return request.post("photo_search",data);
132
+}
133
+// 拍照删除照片
134
+export function deleteimg(data) {
135
+  return request.get("baiduAi/deleteimg?url="+data);
136
+}
137
+// 删除搜索历史
138
+export function delectList(keyword) {
139
+  return request.get("third_history_delete/"+keyword);
140
+}
141
+
142
+
143
+
144
+/*
145
+ * 获取商品分享二维码
146
+*/
147
+export function getgoodsimg(data) {
148
+  return request.get("product_share",data);
149
+}
150
+// 志愿者
151
+export function getVolunteer(keyword) {
152
+  return request.get("userVolunteer");
153
+}
154
+// 申请志愿者
155
+export function getchangeVolunteer() {
156
+  return request.get("changeVolunteer");
157
+}
158
+//志愿者页面分类
159
+export function getVolunteermercat() {
160
+  return request.get("store/merchant/mercat");
161
+}
162
+//志愿者页面搜索
163
+export function getVolunteersearch(data) {
164
+  return request.get("store/product/search_volunteer/lst",data);
165
+}
166
+/**
167
+ * 店铺分类
168
+ * 
169
+*/
170
+export function getshopCategoryList(){
171
+  return request.get('store/merchant/getmchcate',{},{noAuth:true})
172
+}
173
+/**
174
+ * 店铺列表
175
+ * 
176
+*/
177
+export function getstoreList(data){
178
+  return request.get('store/merchant/list',data,{noAuth:true})
179
+}
180
+/**
181
+ * 获取主页数据 无需授权
182
+ * 
183
+*/
184
+export function getIndexData()
185
+{
186
+  return request.get("common/home",{},{ noAuth : true});
187
+}
188
+
189
+/**
190
+ * 获取登录授权login
191
+ * 
192
+*/
193
+export function getLogo()
194
+{
195
+  return request.get('wechat/get_logo', {}, { noAuth : true});
196
+}
197
+
198
+
199
+/**
200
+ * 保存form_id
201
+ * @param string formId 
202
+ */
203
+export function setFormId(formId) {
204
+  return request.post("wechat/set_form_id", { formId: formId});
205
+}
206
+
207
+/**
208
+ * 新人领取优惠卷
209
+ * @param object data
210
+ * 
211
+*/
212
+export function setNewCouponReceive(data){
213
+  return request.post('coupon/receives',data);
214
+}
215
+
216
+
217
+/**
218
+ * 新人优惠券列表
219
+ * @param object data
220
+*/
221
+export function getNewCoupons(data){
222
+  return request.get('coupon/newlist',data)
223
+}
224
+/**
225
+ * 领取优惠卷
226
+ * @param int couponId
227
+ * 
228
+*/
229
+export function setCouponReceive(couponId){
230
+  return request.post('coupon/receive/'+couponId);
231
+}
232
+
233
+/**
234
+ * 商品优惠券列表
235
+ * @param object data
236
+*/
237
+export function getCoupons(data){
238
+  return request.get('coupon/product',data)
239
+}
240
+
241
+/**
242
+ * 商铺优惠券列表
243
+ * @param object data
244
+*/
245
+export function getShopCoupons(id){
246
+  return request.get('coupon/store/'+id)
247
+}
248
+
249
+/**
250
+ * 我的优惠券
251
+ * @param int types 0全部  1未使用 2已使用
252
+*/
253
+export function getUserCoupons(data){
254
+  return request.get('coupon/list',data)
255
+}
256
+/**
257
+ * 首页-领券中心
258
+ * @param object data
259
+ * 
260
+*/
261
+export function getCouponsCenter(data){
262
+  return request.get('coupon/newlist',data)
263
+}
264
+
265
+/**
266
+ * 文章分类列表
267
+ * 
268
+*/
269
+export function getArticleCategoryList(){
270
+  return request.get('article/category/lst',{},{noAuth:true})
271
+}
272
+
273
+/**
274
+ * 文章列表
275
+ * @param int cid
276
+ * 
277
+*/
278
+export function getArticleList1(data){
279
+  return request.get('information/list', data,{noAuth:true})
280
+}
281
+export function getArticleList(cid,data){
282
+  return request.get('article/lst/' + cid, data,{noAuth:true})
283
+}
284
+export function getproduct(data){
285
+  return request.get('newhome/nologin/product',data,{noAuth:true})
286
+}
287
+//大仓轮播
288
+export function bannerdacang(data){
289
+  return request.get('newhome/nologin/banner/da_cang',data,{noAuth:true})
290
+}
291
+//大仓列表
292
+export function dacangproductlst(data){
293
+  return request.get('dacang/nologin/da_cang_product_lst',data,{noAuth:true})
294
+}
295
+//大仓分类
296
+export function nologinclassify(data){
297
+  return request.get('dacang/nologin/classify',data,{noAuth:true})
298
+}
299
+
300
+/**
301
+ * 热点视频
302
+ * 
303
+*/
304
+export function getvideos(data){
305
+  return request.get('article/getvideos',data,{noAuth:true})
306
+}
307
+/**
308
+ * 文章 热门列表
309
+ * 
310
+*/
311
+export function getArticleHotList(){
312
+  return request.get('article/hot/list',{},{noAuth:true});
313
+}
314
+
315
+
316
+
317
+/**
318
+ * 文章 轮播列表
319
+ * 
320
+*/
321
+export function getArticleBannerList(){
322
+  return request.get('article/banner/list',{},{noAuth:true})
323
+}
324
+
325
+/**
326
+ * 文章详情
327
+ * @param int id 
328
+ * 
329
+*/
330
+export function getArticleDetails(id){
331
+  return request.get('article/detail/'+id,{},{noAuth:true});
332
+}
333
+
334
+/**
335
+ * 手机号+验证码登录接口
336
+ * @param object data
337
+*/
338
+export function loginMobile(data){
339
+  return request.post('login/mobile',data,{noAuth:true})
340
+}
341
+
342
+/**
343
+ * 获取短信KEY
344
+ * @param object phone
345
+*/
346
+export function verifyCode(){
347
+  return request.get('verify_code', {},{noAuth:true})
348
+}
349
+
350
+/**
351
+ * 验证码发送
352
+ * @param object phone
353
+*/
354
+export function registerVerify(phone, reset, key, code){
355
+  return request.post('auth/verify', { phone: phone, type: reset === undefined ? 'reset' : reset, key: key, code: code },{noAuth:true})
356
+}
357
+
358
+/**
359
+ * 手机号注册
360
+ * @param object data
361
+ * 
362
+*/
363
+export function phoneRegister(data){
364
+  return request.post('register',data,{noAuth:true});
365
+}
366
+
367
+/**
368
+ * 手机号修改密码
369
+ * @param object data
370
+ * 
371
+*/
372
+export function phoneRegisterReset(data){
373
+  return request.post('auth/reset',data,{noAuth:true})
374
+}
375
+
376
+/**
377
+ * 手机号+密码登录
378
+ * @param object data
379
+ * 
380
+*/
381
+export function phoneLogin(data){
382
+  return request.post('login',data,{noAuth:true})
383
+}
384
+
385
+/**
386
+ * 切换H5登录
387
+ * @param object data
388
+*/
389
+
390
+
391
+/*
392
+ * h5切换公众号登录
393
+ * */
394
+
395
+export function switchH5Login(data) {
396
+  return request.post("user/switch", data);
397
+}
398
+
399
+
400
+/**
401
+ * 绑定手机号
402
+ * 
403
+*/
404
+export function bindingPhone(data){
405
+  return request.post('user/binding',data);
406
+}
407
+/**
408
+ * 验证旧手机号
409
+ * 
410
+*/
411
+export function bindingPhone_verify(data){
412
+  return request.post('user/binding_verify',data);
413
+}
414
+/**
415
+ * 退出登錄
416
+ * 
417
+*/
418
+export function logout(){
419
+  return request.get('logout');
420
+}
421
+
422
+/**
423
+ * 获取订阅消息id
424
+ */
425
+export function getTemlIds()
426
+{
427
+  return request.get('wechat/teml_ids', {}, { noAuth:true});
428
+}
429
+
430
+/**
431
+ * 首页拼团数据
432
+ */
433
+export function pink()
434
+{
435
+  return request.get('pink', {}, { noAuth:true});
436
+}
437
+
438
+/**
439
+ * 获取城市信息
440
+ */
441
+export function getCity() {
442
+  return request.get('system/city/lst', { }, { noAuth: true });
443
+}
444
+
445
+/**
446
+ * 获取小程序直播列表
447
+ */
448
+export function getLiveList(page,limit) {
449
+  return request.get('wechat/live', { page, limit}, { noAuth: true });
450
+}
451
+/**
452
+ * 实名认证
453
+ */
454
+export function getaut() {
455
+  return request.get('user/add_certification', { }, { noAuth: true });
456
+}
457
+/**
458
+ * 实名认证
459
+ */
460
+export function submitRenzheng(user_name,mobile,user_card,card_positive,card_reverse) {
461
+  return request.get('user/add_certification',{user_name,mobile,user_card,card_positive,card_reverse},{noAuth:true});
462
+}
463
+
464
+/**
465
+ * 获取实名认证信息
466
+ */
467
+export function getRenzheng(type) {
468
+  return request.get('user/add_certification',{type},{noAuth:true});
469
+}
470
+
471
+/**
472
+ * 全民营销 - 申请服务商
473
+ */
474
+export function apply_agent(obj) {
475
+  return request.get('user/apply_agent',obj,{noAuth:true});
476
+}
477
+/**
478
+ * 帮助中心分类
479
+ */
480
+export function gethlep_list() {
481
+  return request.get('article/category/lst/19',{},{noAuth:true});
482
+}
483
+/**
484
+ * 帮助中心列表
485
+ */
486
+export function hlep_wen(id) {
487
+  return request.get('article/lst/'+id,{},{noAuth:true});
488
+}
489
+
490
+/**
491
+ * 帮助中心详情
492
+ */
493
+export function hlepdetail(id) {
494
+  return request.get('article/detail/'+id,{},{noAuth:true});
495
+}
496
+
497
+// 系统公告
498
+export function systemNoticeListApi(data) {
499
+  return request.get('notice/list',data,{noAuth:true});
500
+}
501
+
502
+// 公告详情
503
+export function systemNoticeDetail(id) {
504
+  return request.get('notice/detail/'+id,{},{noAuth:true});
505
+}
506
+
507
+// 首页-金刚区转链接
508
+export function changeLink(data) {
509
+  return request.get('user/change/link',data,{noAuth:true});
510
+}

+ 29 - 0
src/api/dacang.js

@@ -0,0 +1,29 @@
1
+import request from "@/utils/request.js";
2
+
3
+
4
+/**
5
+ * 大仓列表
6
+ * 
7
+*/
8
+export function GEtdacang_lst(data){
9
+	return request.get("store/product/dacang_lst",data)
10
+}
11
+/**
12
+ * 订单
13
+ * 
14
+*/
15
+export function Create(data){
16
+	return request.post("user/cart/create",data)
17
+}
18
+
19
+export function Gorder(id){
20
+	return request.get("order/check_group_order/"+id)
21
+}
22
+/**
23
+ * 大仓会员
24
+ * 
25
+*/
26
+export function UserVipInfo(data){
27
+	return request.get("warehouse/UserVipInfo",data)
28
+}
29
+

+ 290 - 0
src/api/order.js

@@ -0,0 +1,290 @@
1
+import request from "@/utils/request.js";
2
+
3
+/**
4
+ * 获取购物车列表
5
+ * @param numType boolean true 购物车数量,false=购物车产品数量
6
+ */
7
+export function getCartCounts() {
8
+  return request.get("user/cart/count");
9
+}
10
+export function orderall() {
11
+  return request.get("order/all");
12
+}
13
+
14
+/**
15
+ * 获取购物车列表
16
+ * 
17
+ */
18
+export function getCartList() {
19
+  return request.get("user/cart/lst");
20
+}
21
+
22
+/**
23
+ * 修改购物车数量
24
+ * @param int cartId  购物车id
25
+ * @param int number 修改数量
26
+ */
27
+export function changeCartNum(cartId, data) {
28
+  return request.post("user/cart/change/"+cartId,data);
29
+}
30
+/**
31
+ * 清除购物车
32
+ * @param object ids
33
+*/
34
+export function cartDel(data){
35
+  return request.post('user/cart/delete', data);
36
+}
37
+/**
38
+ * 订单列表
39
+ * @param object data
40
+*/
41
+export function getOrderList(data){
42
+  return request.get('order/list',data);
43
+}
44
+
45
+/**
46
+ * 订单产品信息
47
+ * @param string unique 
48
+*/
49
+export function orderProduct(data){
50
+  return request.get('reply/product', data);
51
+}
52
+
53
+/**
54
+ * 订单评价
55
+ * @param object data
56
+ * 
57
+*/
58
+export function orderComment(data){
59
+  return request.post('reply/reply',data);
60
+}
61
+
62
+/**
63
+ * 订单支付
64
+ * @param object data
65
+*/
66
+export function orderPay(id,data){
67
+  return request.post('order/pay/'+id,data);
68
+}
69
+//微信支付
70
+
71
+export function ordervxPay(id,data){
72
+  return request.post('sxy_pay_wechat_mp/'+id,data);
73
+}
74
+/**
75
+ * 申请服务商支付
76
+ * @param object data
77
+*/
78
+export function agentPay(data){
79
+  return request.post('agent/create',data);
80
+}
81
+
82
+/**
83
+ * 订单统计数据
84
+*/
85
+export function orderData(){
86
+  return request.get('order/number')
87
+}
88
+
89
+/**
90
+ * 订单取消
91
+ * @param string id
92
+ * 
93
+*/
94
+// export function orderCancel(id){
95
+//   return request.post('order/cancel',{id:id});
96
+// }
97
+
98
+/**
99
+ * 未支付订单取消
100
+ * @param string id
101
+ * 
102
+*/
103
+export function unOrderCancel(id, data){
104
+  return request.post('order/cancel/'+id, data);
105
+}
106
+/**
107
+ * 订单提醒发货
108
+ * @param string id
109
+ * 
110
+*/
111
+export function untixing(id){
112
+  return request.get('order/remind',id);
113
+}
114
+/**
115
+ * 删除已完成订单
116
+ * @param string uni
117
+ * 
118
+*/
119
+export function orderDel(uni){
120
+  return request.post('order/del',{uni:uni});
121
+}
122
+
123
+/**
124
+ * 订单详情
125
+ * @param string uni 
126
+*/
127
+export function getOrderDetail(uni){
128
+  return request.get('order/detail/'+uni);
129
+}
130
+
131
+/**
132
+ * 订单详情
133
+ * @param string uni 
134
+*/
135
+export function groupOrderDetail(uni){
136
+  return request.get('order/group_order_detail/'+uni);
137
+}
138
+
139
+// 支付状态订单
140
+export function getPayOrder(uni){
141
+  return request.get('order/status/'+uni);
142
+}
143
+
144
+/**
145
+ * 再次下单
146
+ * @param string uni
147
+ * 
148
+*/
149
+export function orderAgain(data){
150
+  return request.post('user/cart/again',data);
151
+}
152
+
153
+/**
154
+ * 订单收货
155
+ * @param string uni
156
+ * 
157
+*/
158
+export function orderTake(uni){
159
+  return request.post('order/take/'+uni);
160
+}
161
+
162
+/**
163
+ * 订单查询物流信息
164
+ * @returns {*}
165
+ */
166
+export function express(id) {
167
+  return request.post("order/express/" + id);
168
+}
169
+
170
+/**
171
+ * 获取退款理由
172
+ * 
173
+*/
174
+export function ordeRefundReason(){
175
+  return request.get('order/refund/reason');
176
+}
177
+
178
+/**
179
+ * 订单退款审核
180
+ * @param object data
181
+*/
182
+export function orderRefundVerify(data){
183
+  return request.post('order/refund/verify',data);
184
+}
185
+
186
+/**
187
+ * 订单确认获取订单详细信息
188
+ * @param string cartId
189
+*/
190
+export function orderConfirm(data){
191
+  return request.post('order/check', data);
192
+}
193
+
194
+/**
195
+ * 获取当前金额能使用的优惠卷
196
+ * @param string price
197
+ * 
198
+*/
199
+export function getCouponsOrderPrice(price, data){
200
+  return request.get('coupons/order/' + price, data)
201
+}
202
+
203
+
204
+
205
+/**
206
+ * 计算订单金额
207
+ * @param key
208
+ * @param data
209
+ * @returns {*}
210
+ */
211
+export function postOrderComputed(key, data) {
212
+  return request.post("/order/computed/" + key, data);
213
+}
214
+
215
+
216
+
217
+// 生成订单
218
+export function orderCreate(data) {
219
+	return request.post("order/create",data,{ noAuth : true });
220
+}
221
+
222
+// 未支付订单
223
+export function groupOrderList(data) {
224
+	return request.get("order/group_order_list",data,{ noAuth : true });
225
+}
226
+// 三方订单列表
227
+export function groupOrderLists(data) {
228
+	return request.get("user/third_order",data,{ noAuth : true });
229
+}
230
+
231
+
232
+// 批量退款列表
233
+export function refundBatch(id) {
234
+	return request.get("refund/batch_product/"+id,{ noAuth : true });
235
+}
236
+
237
+// 退款商品
238
+export function refundProduct(id,data) {
239
+	return request.get("refund/product/"+id,data,{ noAuth : true });
240
+}
241
+
242
+// 申请退款
243
+export function refundApply(id,data) {
244
+	return request.post("refund/apply/"+id,data,{ noAuth : true });
245
+}
246
+
247
+// 退款理由
248
+export function refundMessage() {
249
+	return request.get("common/refund_message",{ noAuth : true });
250
+}
251
+
252
+// 退款列表
253
+export function refundList(data) {
254
+	return request.get("refund/list",data,{ noAuth : true });
255
+}
256
+
257
+// 退款详情
258
+export function refundDetail(id) {
259
+	return request.get("refund/detail/"+id,{ noAuth : true });
260
+}
261
+
262
+// 物流列表
263
+export function expressList() {
264
+	return request.get("common/express");
265
+}
266
+
267
+// 退回商品提交
268
+export function refundBackGoods(id,data) {
269
+	return request.post("refund/back_goods/"+id,data,{ noAuth : true });
270
+}
271
+
272
+// 退款记录删除
273
+export function refundDel(id) {
274
+	return request.post("refund/del/"+id,{ noAuth : true });
275
+}
276
+
277
+// 退款记录删除
278
+export function refundExpress(id) {
279
+	return request.get("refund/express/"+id,{ noAuth : true });
280
+}
281
+
282
+// 核销二维码
283
+export function verifyCode(id) {
284
+	return request.get("order/verify_code/"+id);
285
+}
286
+
287
+// 订单搜索
288
+export function orderSearchApi(data) {
289
+	return request.get("order/search/order", data);
290
+}

+ 96 - 0
src/api/public.js

@@ -0,0 +1,96 @@
1
+import request from "@/utils/request.js";
2
+import wechat from "@/libs/wechat.js";
3
+
4
+/**
5
+ * 获取微信sdk配置
6
+ * @returns {*}
7
+ */
8
+export function getWechatConfig() {
9
+	return request.get(
10
+		"wechat/config", {
11
+			url: wechat.signLink()
12
+		}, {
13
+			noAuth: true
14
+		}
15
+	);
16
+}
17
+
18
+/**
19
+ * 获取微信sdk配置
20
+ * @returns {*}
21
+ */
22
+export function wechatAuth(code, spread, login_type) {
23
+	return request.get(
24
+		"auth/wechat", {
25
+			code,
26
+			spread,
27
+			login_type
28
+		}, {
29
+			noAuth: true
30
+		}
31
+	);
32
+}
33
+
34
+/**
35
+ * 获取登录授权login
36
+ * 
37
+ */
38
+export function getLogo() {
39
+	return request.get('wechat/get_logo', {}, {
40
+		noAuth: true
41
+	});
42
+}
43
+
44
+/**
45
+ * 小程序用户登录
46
+ * @param data object 小程序用户登录信息
47
+ */
48
+export function login(data) {
49
+	return request.post("auth/mp", data, {
50
+		noAuth: true
51
+	});
52
+}
53
+
54
+/**
55
+ * 分享
56
+ * @returns {*}
57
+ */
58
+export function getShare() {
59
+	return request.get("share", {}, {
60
+		noAuth: true
61
+	});
62
+}
63
+
64
+/**
65
+ * 获取关注海报
66
+ * @returns {*}
67
+ */
68
+export function follow() {
69
+	return request.get("wechat/follow", {}, {
70
+		noAuth: true
71
+	});
72
+}
73
+
74
+/**
75
+ * 获取图片base64
76
+ * @retins {*}
77
+ * */
78
+export function imageBase64(image, code) {
79
+	return request.post(
80
+		"common/base64", {
81
+			image: image,
82
+			code: code
83
+		}, {
84
+			noAuth: true
85
+		}
86
+	);
87
+}
88
+
89
+// 配置
90
+export function getconfig() {
91
+	return request.get("config",{},{noAuth: true});
92
+}
93
+// 浏览记录
94
+export function history(data) {
95
+	return request.get("user/history",data);
96
+}

+ 476 - 0
src/api/store.js

@@ -0,0 +1,476 @@
1
+import request from "@/utils/request.js";
2
+
3
+/**
4
+ * 获取产品详情
5
+ * @param int id
6
+ * 
7
+*/
8
+export function getProductDetail(id){
9
+  return request.get('store/product/detail/' + id, {}, { noAuth : true });
10
+}
11
+export function articleDetail(id){
12
+  return request.get('article/detail/' + id, {}, { noAuth : true });
13
+}
14
+/**
15
+ * 产品分享二维码 推广员
16
+ * @param int id
17
+*/
18
+// #ifndef MP
19
+export function getProductCode(id){
20
+  return request.get('store/product/qrcode/' + id, {type:'wechat'},{ noAuth : true });
21
+}
22
+// #endif
23
+// #ifdef MP
24
+export function getProductCode(id){
25
+  return request.get('store/product/qrcode/' + id, {type:'routine'},{ noAuth : true });
26
+}
27
+// #endif
28
+
29
+/**
30
+ * 添加收藏
31
+ * @param int id
32
+ * @param string category product=普通产品,product_seckill=秒杀产品
33
+*/
34
+export function collectAdd(data){
35
+  return request.post('user/relation/create', data);
36
+}
37
+
38
+/**
39
+ * 删除收藏产品
40
+ * @param int id
41
+ * @param string category product=普通产品,product_seckill=秒杀产品
42
+*/
43
+export function collectDel(data) {
44
+  return request.post('user/relation/delete', data);
45
+}
46
+
47
+/**
48
+ * 购车添加
49
+ * 
50
+*/
51
+export function postCartAdd(data) {
52
+  return request.post('user/cart/create', data);
53
+}
54
+
55
+/**
56
+ * 获取分类列表
57
+ * 
58
+*/
59
+export function getCategoryList(){
60
+  return request.get('store/product/category/lst', {}, { noAuth:true});
61
+}
62
+
63
+/**
64
+ * 获取产品列表
65
+ * @param object data
66
+*/
67
+export function getProductslist(data){
68
+  return request.get('store/product/lst',data,{noAuth:true});
69
+}
70
+
71
+/**
72
+ * 获取品牌列表
73
+ * @param object data
74
+*/
75
+export function getBrandlist(data){
76
+  return request.get('store/product/brand/lst',data,{noAuth:true});
77
+}
78
+
79
+
80
+/**
81
+ * 获取推荐产品
82
+ * 
83
+ */
84
+export function getProductHot(page,limit) {
85
+  return request.get("store/product/recommend/lst", { 
86
+    page: page === undefined ? 1 : page, 
87
+    limit:limit === undefined ? 10 :limit
88
+  },{noAuth:true});
89
+}
90
+/**
91
+ * 批量收藏
92
+ * 
93
+ * @param object id
94
+ * @param string category 
95
+*/
96
+export function collectAll(data) {
97
+  return request.post('user/relation/batch/create', data);
98
+}
99
+
100
+/**
101
+ * 首页产品的轮播图和产品信息
102
+ * @param int type 
103
+ * 
104
+*/
105
+export function getGroomList(type,data){
106
+  return request.get('store/product/hot/'+type,data,{noAuth:true});
107
+}
108
+
109
+/**
110
+ * 获取商品收藏列表
111
+ * @param object data
112
+*/
113
+export function getCollectUserList(data) {
114
+  return request.get('user/relation/product/lst', data)
115
+}
116
+
117
+
118
+/**
119
+ * 获取产品评论
120
+ * @param int id
121
+ * @param object data
122
+ * 
123
+*/
124
+export function getReplyList(id,data){
125
+  return request.get('store/product/reply/lst/'+id,data)
126
+}
127
+
128
+/**
129
+ * 产品评价数量和好评度
130
+ * @param int id
131
+*/
132
+export function getReplyConfig(id){
133
+  return request.get('reply/config/'+id);
134
+} 
135
+
136
+/**
137
+ * 获取搜索关键字获取
138
+ * 
139
+*/
140
+export function getSearchKeyword(){
141
+  return request.get('common/hot_keyword',{},{noAuth:true});
142
+}
143
+/**
144
+ * 门店列表
145
+ * @returns {*}
146
+ */
147
+export function merchantListApi(data) {
148
+  return request.get("store/merchant/list", data,{ noAuth : true });
149
+}
150
+
151
+/**
152
+ * 附近分类下的门店列表
153
+ * @returns {*}
154
+ */
155
+export function nearbyListApi(data) {
156
+  return request.get("store/merchant/mercatStore", data,{ noAuth : true });
157
+}
158
+/**
159
+ * 门店列表
160
+ * @returns {*}
161
+ */
162
+export function storeListApi(data) {
163
+  return request.get("store_list", data,{ noAuth : true });
164
+}
165
+
166
+/**
167
+ * 商户列表
168
+ * @returns {*}
169
+ */
170
+export function storeMerchantList(data) {
171
+  return request.get("store/merchant/lst", data,{ noAuth : true });
172
+}
173
+
174
+/**
175
+ * 获取商铺详情
176
+ * @param {Object} id 商铺id
177
+ * @param {Object} data 商铺数据
178
+ */
179
+export function getStoreDetail(id, data) {
180
+	return request.get("store/merchant/detail/" + id, data, { noAuth : true });
181
+}
182
+
183
+/**
184
+ * 获取商铺商品列表
185
+ * @param {Object} id 商铺 id
186
+ * @param {Object} data 商铺商品列表数据
187
+ */
188
+export function getStoreGoods(id, data) {
189
+	return request.get("store/merchant/product/lst/" + id, data, { noAuth : true });
190
+}
191
+
192
+/**
193
+ * 获取商铺分类的商品列表
194
+ */
195
+export function getStoreClassGoods(id, data) {
196
+	return request.get("store/merchant/product/lst/" + id, data, { noAuth : true });
197
+}
198
+/**
199
+ * 获取商铺分类列表
200
+ * @param {Object} id 商铺 id
201
+ * @param {Object} data
202
+ */
203
+export function getStoreCategory(id, data) {
204
+	return request.get("store/merchant/category/lst/" + id, data, { noAuth : true });
205
+}
206
+/**
207
+ * 获取附近分类数据 无需授权
208
+ * 
209
+*/
210
+export function getNearbyData()
211
+{
212
+  return request.get("store/merchant/mercat",{},{ noAuth : true});
213
+}
214
+/**
215
+ * 获取京东列表
216
+ * @param {Object} id 商铺 id
217
+ * @param {Object} data
218
+ */
219
+export function getStoreJD(data) {
220
+	return request.get("jd/list", data, { noAuth : true });
221
+}
222
+export function getStoreJDDetail(id,data) {
223
+	return request.get("jd/detail?skuId="+id, data, { noAuth : true });
224
+}
225
+
226
+/**
227
+ * 获取拼多多列表
228
+ * @param {Object} id 商铺 id
229
+ * @param {Object} data
230
+ */
231
+export function getStorePin(data) {
232
+	return request.get("pdd/list", data, { noAuth : true });
233
+}
234
+export function getStorePinDetail(id,data) {
235
+	return request.get("pdd/detail?goodsId="+id, data, { noAuth : true });
236
+}
237
+
238
+/**
239
+ * 获取唯品会列表
240
+ */
241
+export function getStoreVipshop(data) {
242
+	return request.get("vip/goods", data, { noAuth : true });
243
+}
244
+export function getStoreVipshopDetail(id,data) {
245
+	return request.get("vip/detail?goodsId="+id, data, { noAuth : true });
246
+}
247
+
248
+/**
249
+ * 获取苏宁列表
250
+ */
251
+export function getStoreSushop(data) {
252
+	return request.get("su/list", data, { noAuth : true });
253
+}
254
+export function getStoreSushopDetail(id,data) {
255
+	return request.get("su/detail/"+id, data, { noAuth : true });
256
+}
257
+
258
+/**
259
+ * 关注商铺
260
+ * @param {Object} type_id 商铺 id
261
+ */
262
+export function followStore(type_id) {
263
+	return request.post("user/relation/create", {type: 10, type_id: type_id});
264
+}
265
+
266
+/**
267
+ * 取消商铺关注
268
+ * @param {Object} type_id 商铺 id
269
+ */
270
+export function unfollowStore(type_id) {
271
+	return request.post("user/relation/delete", {type: 10, type_id: type_id});
272
+}
273
+
274
+/**
275
+ * 获取商铺优惠券
276
+ * @param {Object} id
277
+ */
278
+export function getStoreCoupon(id) {
279
+	return request.get("coupon/store/" + id, {},{ noAuth : true });
280
+}
281
+
282
+/**
283
+ * 我的关注
284
+ */
285
+export function getMerchantLst(data) {
286
+	return request.get("user/relation/merchant/lst",data, { noAuth : true });
287
+}
288
+/**
289
+ * 取消关注
290
+ */
291
+export function deleteRelationLst(data) {
292
+	return request.post("user/relation/delete",data);
293
+}
294
+/**
295
+ * 物流信息
296
+ */
297
+export function express(id) {
298
+	return request.post("ordero/express/"+id,{}, { noAuth : true });
299
+}
300
+
301
+/**
302
+ * 子集分类
303
+ * @returns {*}
304
+ */
305
+export function storeCategory(pid) {
306
+  return request.get("store/product/category", pid,{ noAuth : true });
307
+}
308
+
309
+/**
310
+ * 分销说明
311
+ * @returns {*}
312
+ */
313
+export function bagExplain() {
314
+  return request.get("store/product/bag/explain");
315
+}
316
+
317
+/**
318
+ * 分销礼包推荐列表
319
+ * @returns {*}
320
+ */
321
+export function bagRecommend() {
322
+  return request.get("store/product/bag/recommend");
323
+}
324
+
325
+/**
326
+ * 分销礼包列表
327
+ * @returns {*}
328
+ */
329
+export function productBag(data) {
330
+  return request.get("store/product/bag",data,{ noAuth : true });
331
+}
332
+
333
+/**
334
+ * 商铺二维码
335
+ * @returns {*}
336
+ */
337
+export function merchantQrcode(id) {
338
+  return request.get("store/merchant/qrcode/"+id,{},{ noAuth : true });
339
+}
340
+
341
+/**
342
+ * 推荐商品
343
+ * @returns {*}
344
+ */
345
+export function merchantProduct(id,data) {
346
+  return request.get("store/merchant/product/lst/"+id,data,{ noAuth : true });
347
+}
348
+
349
+/**
350
+ * 推荐商品banner
351
+ * @returns {*}
352
+ */
353
+export function getHotBanner(type) {
354
+  return request.get("common/hot_banner/"+type,{},{ noAuth : true });
355
+}
356
+
357
+/**
358
+ * 商户入驻表单
359
+ * @returns {*}
360
+ */
361
+export function create(data) {
362
+  return request.post("intention/create", data);
363
+}
364
+/**
365
+ * 商户配置
366
+ * @returns {*}
367
+ */
368
+export function merconfig() {
369
+  return request.get("merconfig", {});
370
+}
371
+/**
372
+ * 商户入驻短信验证码
373
+ * @returns {*}
374
+ */
375
+export function verify(data) {
376
+  return request.post("register/verify", data);
377
+}
378
+/**
379
+ * 获取秒杀商品详情
380
+ * @param int id
381
+ * 
382
+*/
383
+export function getSeckillProductDetail(id){
384
+  return request.get('store/product/seckill/detail/' + id, {}, { noAuth : true });
385
+}
386
+/**
387
+ * 秒杀商品列表
388
+ * @returns {*}
389
+ */
390
+export function spikeListApi() {
391
+  return request.get("store/product/seckill/lst",{},{ noAuth : true });
392
+}
393
+/**
394
+ * 直播推荐列表
395
+ * @returns {*}
396
+ */
397
+export function getLiveList() {
398
+  return request.get("broadcast/hot",{},{ noAuth : true });
399
+}
400
+/**
401
+ * 直播列表
402
+ * @returns {*}
403
+ */
404
+export function getBroadcastListApi(data) {
405
+  return request.get("broadcast/lst",data,{ noAuth : true });
406
+}
407
+
408
+/**
409
+ * 获取街道列表
410
+ * @returns {*}
411
+ */
412
+export function getStreetList(id) {
413
+  return request.get('city/street/' + id, {},{ noAuth : true });
414
+}
415
+/**
416
+ * 获取区域列表
417
+ * @returns {*}
418
+ */
419
+export function getAreaList(id) {
420
+  return request.get('city/area/' + id, {},{ noAuth : true });
421
+}
422
+
423
+/**
424
+ * 获取城市列表
425
+ * @returns {*}
426
+ */
427
+export function getCityList(id) {
428
+  return request.get('city/city/' + id, {},{ noAuth : true });
429
+}
430
+
431
+/**
432
+ * 获取省份列表
433
+ * @returns {*}
434
+ */
435
+export function getProvinceList() {
436
+  return request.get("city/province",{},{ noAuth : true });
437
+}
438
+
439
+// 淘宝商品列表
440
+export function getTBListApi(data) {
441
+  return request.get("tb/list", data, { noAuth : true });
442
+}
443
+
444
+// 淘宝渠道授权
445
+export function getTBqdApi(id) {
446
+  return request.get("tb/cps_link/"+id, {}, { noAuth : true });
447
+}
448
+
449
+// 淘宝商品详情
450
+export function getTBDetail(id) {
451
+	return request.get("tb/detail/"+id, {}, { noAuth : true });
452
+}
453
+
454
+// 首页金刚区 淘宝分类
455
+export function getTBClassApi() {
456
+	return request.get("tb/material", {}, { noAuth : true });
457
+}
458
+
459
+// 第三方平台筛选 - 京东
460
+export function getJdSearchApi(data) {
461
+	return request.get("jd/search", data, { noAuth : true });
462
+}
463
+// 第三方平台筛选 - 唯品会
464
+export function getVipSearchApi(data) {
465
+	return request.get("vip/search", data, { noAuth : true });
466
+}
467
+
468
+// 第三方平台筛选 - 拼多多
469
+export function getPddSearchApi(data) {
470
+	return request.get("pdd/search", data, { noAuth : true });
471
+}
472
+
473
+// 第三方平台筛选 - 苏宁易购
474
+export function getSuSearchApi(data) {
475
+	return request.get("su/search", data, { noAuth : true });
476
+}

+ 804 - 0
src/api/user.js

@@ -0,0 +1,804 @@
1
+import request from "@/utils/request.js";
2
+
3
+
4
+// 会员中心的提现
5
+export function entropy(data) {
6
+  return request.post('entropy/withdrawal', data);
7
+}
8
+/*
9
+
10
+获取滚动消息
11
+*/
12
+ export function getbulletin(){
13
+	 return request.get('roll_yanglaojin')
14
+ }
15
+ export function Anewcreate(data){
16
+   return request.post('user/address/new_create',data);
17
+ }
18
+ export function shareList(data){
19
+ 	 return request.get('product_share_list',data)
20
+ }
21
+ // 中健康养收益
22
+ export function myFansOrderLst(data) {
23
+   return request.get('entropy/personal/myFansOrderLst_new', data);
24
+ }
25
+/*
26
+ * 获取用户信息
27
+ * 
28
+*/
29
+export function getUserInfo(){
30
+  return request.get('user');
31
+}
32
+/**
33
+ * 获取同程token
34
+ * 
35
+*/
36
+export function tongchentoken(){
37
+  return request.get('tc/GetToken');
38
+}
39
+/**
40
+ * 我发布的资讯
41
+ * 
42
+*/
43
+export function getArticleUserList(data){
44
+  return request.get('information/userlist',data);
45
+}
46
+/**
47
+ * 发布资讯
48
+ * 
49
+*/
50
+export function addInformation(data){
51
+  return request.get('information/postinfo',data);
52
+}
53
+/**
54
+ * 删除资讯
55
+ * 
56
+*/
57
+export function deleteInformation(data){
58
+  return request.get('information/delinfo',data);
59
+}
60
+/**
61
+ * 评价管理
62
+ * 
63
+*/
64
+export function getCommentList(data){
65
+  return request.post('reply/list',data);
66
+}
67
+/**
68
+ * 评价管理-删除
69
+ * 
70
+*/
71
+export function delreplyApi(id){
72
+  return request.post('reply/delreply/' + id,{});
73
+}
74
+/**
75
+ * 评论列表
76
+ * 
77
+*/
78
+export function getComment(data){
79
+  return request.get('information/getcomment',data);
80
+}
81
+/**
82
+ * 发表评论
83
+ * 
84
+*/
85
+export function postComment(data){
86
+  return request.get('information/postcomment',data);
87
+}
88
+/**
89
+ * 点赞、取消
90
+ * 
91
+*/
92
+export function fabuLous(data){
93
+  return request.get('information/fabulous',data);
94
+}
95
+/**
96
+ * 举报
97
+ * 
98
+*/
99
+export function reportInform(data){
100
+  return request.get('information/report',data);
101
+}
102
+
103
+
104
+
105
+/**
106
+ * 设置用户分享
107
+ * 
108
+*/
109
+export function userShare(){
110
+  return request.post('user/share');
111
+}
112
+
113
+/**
114
+ * h5用户登录
115
+ * @param data object 用户账号密码
116
+ */
117
+export function loginH5(data) {
118
+  return request.post("auth/login", data, { noAuth : true });
119
+}
120
+
121
+//判断是否显示快捷登录
122
+export function getUserapp(data) {
123
+	return request.get('common/iOSExamineStatsu_api/'+data,'',{ noAuth : true })
124
+}
125
+/**
126
+ * h5用户手机号登录
127
+ * @param data object 用户手机号 也只能
128
+ */
129
+export function loginMobile(data) {
130
+  return request.post("auth/smslogin", data, { noAuth : true });
131
+}
132
+
133
+// 支付宝登录
134
+export function aliLoginApi(data){
135
+  return request.get('ali/check',data,{noAuth:true})
136
+}
137
+// 支付宝授权登录 - 获取信息
138
+export function aliSignApi(){
139
+  return request.get('ali/sign',{},{noAuth:true})
140
+}
141
+
142
+// 微信登录 - 验证
143
+export function wechatCheckApi(data){
144
+  return request.get('wechat/check',data,{noAuth:true})
145
+}
146
+export function vxuser(data){
147
+  return request.post('userMp/getUserUnionid ',data,{noAuth:true})
148
+}
149
+// 绑定手机号
150
+export function thirdBindingApi(data){
151
+  return request.get('third/binding',data,{noAuth:true})
152
+}
153
+
154
+// 验证手机是否注册
155
+export function phoneCheckApi(data){
156
+  return request.get('phone/check',data,{noAuth:true})
157
+}
158
+/**
159
+ * 验证码key
160
+ */
161
+export function getCodeApi() {
162
+  return request.get("verify_code", {}, { noAuth: true });
163
+}
164
+
165
+/**
166
+ * h5用户发送验证码
167
+ * @param data object 用户手机号
168
+ */
169
+export function registerVerify(data) {
170
+  return request.post("auth/verify", data, { noAuth : true });
171
+}
172
+
173
+/**
174
+ * h5用户手机号注册
175
+ * @param data object 用户手机号 验证码 密码
176
+ */
177
+export function register(data) {
178
+  return request.post("auth/register", data, { noAuth : true });
179
+}
180
+
181
+/**
182
+ * 用户手机号修改密码
183
+ * @param data object 用户手机号 验证码 密码
184
+ */
185
+export function registerReset(data) {
186
+  return request.post("auth/reset", data, { noAuth: true });
187
+}
188
+
189
+/**
190
+ * 获取用户中心菜单
191
+ *
192
+ */
193
+export function getMenuList() {
194
+  return request.get("common/menus");
195
+}
196
+/**
197
+ * 获取播报订单
198
+ *
199
+ */
200
+export function merchantList() {
201
+  return request.get("merchant/lst");
202
+}
203
+/**更改用户播报订单状态
204
+ * 
205
+ *
206
+ */
207
+export function merchant(data) {
208
+  return request.post('merchant/broadcast', data);
209
+}
210
+
211
+/*
212
+ * 签到用户信息
213
+ * */
214
+
215
+export function postSignUser(sign) {
216
+  return request.post("sign/user", sign);
217
+}
218
+/*
219
+ * 签到
220
+ * */
221
+export function userSignin(){
222
+  return request.get("user/sub_signin")
223
+}
224
+/**
225
+ * 获取签到配置
226
+ * 
227
+*/
228
+export function getSignConfig(){
229
+  return request.get('sign/config')
230
+}
231
+
232
+/**
233
+ * 获取签到列表
234
+ * @param object data
235
+*/
236
+export function getSignList(data){
237
+  return request.get('sign/list',data);
238
+}
239
+
240
+/**
241
+ * 用户签到
242
+*/
243
+export function setSignIntegral(){
244
+  return request.post('sign/integral')
245
+}
246
+/**
247
+ * 签到列表
248
+ * @param object data
249
+ * 
250
+*/
251
+export function getSignInList(data){
252
+  return request.get('user/get_signin',data)
253
+}
254
+
255
+/**
256
+ * 签到列表(年月)
257
+ * @param object data
258
+ * 
259
+*/
260
+export function getSignMonthList(data){
261
+  return request.get('sign/month',data)
262
+}
263
+
264
+/**
265
+ * 活动状态
266
+ * 
267
+*/
268
+export function userActivity(){
269
+  return request.get('user/activity');
270
+}
271
+
272
+/*
273
+ * 资金明细(types|0=全部,1=消费,2=充值,3=返佣)
274
+ * */
275
+export function getCommissionInfo(q, types) {
276
+  return request.get("user/bill", q);
277
+}
278
+
279
+
280
+/*
281
+ * 提现列表
282
+ * */
283
+export function extractLst(data) {
284
+  return request.get("user/extract/lst", data);
285
+}
286
+
287
+
288
+/*
289
+ * 积分记录
290
+ * */
291
+export function getIntegralList(q) {
292
+  return request.get("integral/list", q);
293
+}
294
+
295
+/**
296
+ * 获取分销海报图片
297
+ * 
298
+*/
299
+export function spreadBanner(){
300
+	//#ifdef H5 || APP-PLUS || MP
301
+	return request.get('user/spread_image',{type:'wechat'});
302
+	//#endif
303
+	//#ifdef MP
304
+	 // return request.get('user/spread_image',{type:'routine'});
305
+	//#endif
306
+
307
+}
308
+
309
+/**
310
+ *
311
+ * 获取推广用户一级和二级
312
+ * @param object data
313
+*/
314
+export function spreadPeople(data){
315
+  return request.get('user/spread_list',data);
316
+}
317
+
318
+/**
319
+ * 
320
+ * 推广佣金/提现总和
321
+ * @param int type
322
+*/
323
+export function spreadCount(type){
324
+  return request.get('spread/count/'+type);
325
+}
326
+
327
+/*
328
+ * 推广数据
329
+ * */
330
+export function getSpreadInfo() {
331
+  return request.get("/commission");
332
+}
333
+
334
+
335
+/**
336
+ * 
337
+ * 推广订单
338
+ * @param object data
339
+*/
340
+export function spreadOrder(data){
341
+  return request.get('user/spread_order',data);
342
+}
343
+
344
+/*
345
+ * 获取推广人排行
346
+ * */
347
+export function getRankList(data) {
348
+  return request.get("user/spread_top",data);
349
+}
350
+
351
+/*
352
+ * 获取佣金排名
353
+ * */
354
+export function getBrokerageRank(q) {
355
+  return request.get("user/brokerage_top", q);
356
+}
357
+
358
+/**
359
+ * 提现申请
360
+ * @param object data
361
+*/
362
+export function extractCash(data){
363
+  return request.post('user/extract/create',data)
364
+}
365
+
366
+/**
367
+ * 提现银行/提现最低金额
368
+ * 
369
+*/
370
+export function extractBank(){
371
+  return request.get('user/extract/banklst');
372
+}
373
+
374
+/**
375
+ * 会员等级列表
376
+ * 
377
+*/
378
+export function userLevelGrade(){
379
+  return request.get('user/level/grade');
380
+}
381
+
382
+/**
383
+ * 获取某个等级任务
384
+ * @param int id 任务id
385
+*/
386
+export function userLevelTask(id){
387
+  return request.get('user/level/task/'+id);
388
+}
389
+
390
+/**
391
+ * 检查用户是否可以成为会员
392
+ * 
393
+*/
394
+export function userLevelDetection(){
395
+  return request.get('user/level/detection');
396
+}
397
+/**
398
+ * 
399
+ * 地址列表
400
+ * @param object data
401
+*/
402
+export function getAdCouponList(data){
403
+  return request.get('user/coupons',data);
404
+}
405
+/**
406
+ * 
407
+ * 地址列表
408
+ * @param object data
409
+*/
410
+export function getAddressList(data){
411
+  return request.get('user/address/lst',data);
412
+}
413
+
414
+/**
415
+ * 设置默认地址
416
+ * @param int id
417
+*/
418
+export function setAddressDefault(id){
419
+  return request.post('user/address/update/'+id)
420
+}
421
+
422
+/**
423
+ * 修改 添加地址
424
+ * @param object data
425
+*/
426
+export function editAddress(data){
427
+  return request.post('user/address/create',data);
428
+}
429
+
430
+/**
431
+ * 删除地址
432
+ * @param int id
433
+ * 
434
+*/
435
+export function delAddress(id){
436
+  return request.post('user/address/delete/'+id)
437
+}
438
+
439
+/**
440
+ * 获取单个地址
441
+ * @param int id 
442
+*/
443
+export function getAddressDetail(id){
444
+  return request.get('user/address/detail/'+id);
445
+}
446
+
447
+/**
448
+ * 修改用户信息
449
+ * @param object
450
+*/
451
+export function userEdit(data){
452
+  return request.post('user/edit',data);
453
+}
454
+
455
+/*
456
+ * 退出登录
457
+ * */
458
+export function getLogout() {
459
+  return request.post("logout");
460
+}
461
+
462
+/**
463
+ * 佣金转入
464
+ * 
465
+*/
466
+export function rechargeBrokerage(data){
467
+  return request.post('user/recharge/brokerage',data)
468
+}
469
+
470
+/**
471
+ * 小程序充值
472
+ * 
473
+*/
474
+export function rechargeRoutine(data){
475
+  return request.post('recharge/routine',data)
476
+}
477
+/*
478
+ * 公众号充值
479
+ * */
480
+export function rechargeWechat(data) {
481
+  return request.post("user/recharge", data);
482
+}
483
+/**
484
+ * 获取默认地址
485
+ * 
486
+*/
487
+export function getAddressDefault(){
488
+  return request.get('address/default');
489
+}
490
+
491
+/**
492
+ * 充值金额选择
493
+ */
494
+export function getRechargeApi() {
495
+  return request.get("common/recharge_quota");
496
+}
497
+
498
+/**
499
+ * 登录记录
500
+ */
501
+export function setVisit(data)
502
+{
503
+  return request.post('user/set_visit', {...data}, { noAuth:true});
504
+}
505
+
506
+/**
507
+ * 客服列表
508
+ */
509
+export function serviceList() {
510
+  return request.get("service/list");
511
+}
512
+
513
+/**
514
+ * 客服获取客户列表
515
+ */
516
+export function serviceUserList() {
517
+  return request.get("service/user_list");
518
+}
519
+
520
+/**
521
+ * 用户获取聊天记录详情
522
+ */
523
+export function getChatRecord(to_uid, data) {
524
+  return request.get("service/history/" + to_uid, data);
525
+}
526
+
527
+/**
528
+ * 客服获取聊天记录详情
529
+ */
530
+export function getMerHistory(userid,mer_id, data) {
531
+  return request.get("service/mer_history/" + mer_id+'/'+userid, data);
532
+}
533
+
534
+
535
+
536
+
537
+/**
538
+ * 静默绑定推广人
539
+ * @param {Object} puid
540
+ */
541
+export function spread(puid)
542
+{
543
+	return request.post("user/spread",{puid:puid});
544
+}
545
+
546
+/**
547
+ * 反馈类型
548
+ */
549
+export function feedbackType() {
550
+  return request.get("common/feedback_type");
551
+}
552
+
553
+/**
554
+ * 提交反馈
555
+ */
556
+export function feedback(data) {
557
+  return request.post("user/feedback",{...data});
558
+}
559
+
560
+/**
561
+ * 反馈列表
562
+ */
563
+export function feedbackList(data) {
564
+  return request.get("user/feedback/list",data);
565
+}
566
+
567
+/**
568
+ * 反馈列表
569
+ */
570
+export function feedbackDetail(id) {
571
+  return request.get("user/feedback/detail/"+id);
572
+}
573
+
574
+/**
575
+ * 浏览记录
576
+ */
577
+export function historyList(data) {
578
+  return request.get("user/history",data);
579
+}
580
+
581
+/**
582
+ * 删除浏览记录
583
+ */
584
+export function historyDelete(id) {
585
+  return request.post("user/history/delete/"+id);
586
+}
587
+
588
+/**
589
+ * 佣金记录
590
+ */
591
+export function brokerage_list(id) {
592
+  return request.get("user/brokerage_list");
593
+}
594
+
595
+/**
596
+ * 佣金数据
597
+ */
598
+export function spreadInfo() {
599
+  return request.get("user/spread_info");
600
+}
601
+
602
+// 图片验证码
603
+export function getCaptcha() {
604
+  return request.get('captcha', { noAuth: true });
605
+}
606
+
607
+// 用户账户列表
608
+export function userAcc() {
609
+  return request.get('user/account', { noAuth: true });
610
+}
611
+
612
+// 用户账户列表
613
+export function withdraw(data) {
614
+  return request.post('user/extract/create', data);
615
+}
616
+// 绑定账号/编辑账号
617
+export function band_account(data) {
618
+  return request.post('user/extract/band_account', data);
619
+}
620
+// 获取账号信息
621
+export function get_band_account_info(data) {
622
+  return request.post('user/extract/get_band_account_info', data);
623
+}
624
+
625
+// 全民营销首页
626
+export function get_agent_info() {
627
+  return request.get('user/get_agent_info', {});
628
+}
629
+
630
+// 推广统计
631
+export function get_extension_info(obj) {
632
+  return request.get('user/get_extension_info', obj);
633
+}
634
+
635
+// 收益统计
636
+export function get_profit_info(obj) {
637
+  return request.get('user/get_profit_info', obj);
638
+}
639
+
640
+// 订单统计
641
+export function get_tuiguang_order(obj) {
642
+  return request.get('user/get_tuiguang_order', obj);
643
+}
644
+
645
+// 养老金
646
+export function get_yanglaojin(obj) {
647
+  return request.get('user/get_yanglao', obj);
648
+}
649
+
650
+//养老金记录
651
+export function get_yanglaojinAll(obj) {
652
+  return request.get('user/get_yanglao_statistics', obj);
653
+}
654
+
655
+// 养老金提现
656
+export function pensionWithdraw(obj) {
657
+  return request.post('user/extract/create', obj);
658
+}
659
+
660
+// 养老金提现记录
661
+export function pensionWithdrawRecords() {
662
+  return request.get('user/withdrawal');
663
+}
664
+// 电商订单记录
665
+export function pensionWithdrawthird(obj) {
666
+  return request.get('user/third_order',obj);
667
+}
668
+
669
+// 旧的电商接口
670
+export function pensionWithdrawthirds(obj) {
671
+  return request.post('third/all',obj);
672
+}
673
+
674
+// 养老金明细
675
+export function pensionRecords(obj) {
676
+  return request.get('user/yanglaolog',obj);
677
+}
678
+
679
+// 提现明细的详情
680
+export function withdrawDetails(obj) {
681
+  return request.get('user/withdrawal/detail', obj);
682
+}
683
+
684
+//攒金明细所有接口
685
+export function getCommissionAll(obj) {
686
+  return request.get('user/get_commission_all', obj);
687
+}
688
+
689
+//攒金明细分类接口
690
+export function getCommissionList(obj) {
691
+  return request.get('user/get_commission_list', obj);
692
+}
693
+
694
+//越攒越多总接口
695
+export function getComAll(obj) {
696
+  return request.get('user/get_com_all', obj);
697
+}
698
+
699
+//越攒越多分类接口
700
+export function getComList(obj) {
701
+  return request.get('user/get_com_list', obj);
702
+}
703
+
704
+// 返金明细的详情
705
+export function pensionDetails(id, obj) {
706
+  return request.get('user/yanglaodetail/'+id, obj);
707
+}
708
+
709
+// 商家是否可以申请
710
+export function businessesApply(){
711
+  return request.post('intention/detail')
712
+}
713
+
714
+// 查询未支付的服务商订单
715
+export function agencyOrders(){
716
+  return request.get('user/agent/pay_detail', {})
717
+}
718
+
719
+// 查询未支付的服务商订单状态
720
+export function agentStatus(){
721
+  return request.get('user/agent/isagent', {})
722
+}
723
+
724
+// 全民营销-提现记录
725
+export function get_agent_records(data) {
726
+  return request.get('user/withdrawal', data);
727
+}
728
+
729
+// 更换手机号-身份验证
730
+export function VerifyMobile(data) {
731
+  return request.get("checkAccount", data, { noAuth : true });
732
+}
733
+
734
+// 更换手机号-更换手机
735
+export function VerifyChangeMobile(data) {
736
+  return request.get("changeAccount", data, { noAuth : true });
737
+}
738
+
739
+// 提现配置信息
740
+export function withdrawalConfig() {
741
+  return request.get("withdrawal/config", {}, { noAuth : true });
742
+}
743
+
744
+// 我的积分-记录
745
+export function socreListApi(data) {
746
+  return request.get('socre/list', data, { noAuth : true });
747
+}
748
+
749
+// 修改用户资料
750
+export function userUpdateApi(data) {
751
+  return request.post('user/update/user', data, { noAuth : true });
752
+}
753
+
754
+// 关于我们
755
+export function aboutConfig(data) {
756
+  return request.get('about/config', data, { noAuth : true });
757
+}
758
+
759
+// 协议 
760
+export function protocolApi(data) {
761
+  return request.get('xieyi/detail', data, { noAuth : true });
762
+}
763
+
764
+// 扫描银行卡获取信息
765
+export function bankIdentifyApi(data) {
766
+  return request.get('bank/get', data, { noAuth : true });
767
+}
768
+
769
+// 添加银行卡
770
+export function bankCreateApi(data) {
771
+  return request.get('bank/create', data, { noAuth : true });
772
+}
773
+
774
+// 银行卡列表
775
+export function bankListApi() {
776
+  return request.get('bank/list', {}, { noAuth : true });
777
+}
778
+// 添加银行卡
779
+export function bankChangeApi(id, data) {
780
+  return request.get('bank/change/'+ id, data, { noAuth : true });
781
+}
782
+
783
+// 扫描营业执照获取信息
784
+export function getBusinessApi(data) {
785
+  return request.get('bank/business', data, { noAuth : true });
786
+}
787
+
788
+// 版本更新
789
+export function commonEdition(data) {
790
+  return request.get('common/edition', data, { noAuth : true });
791
+}
792
+
793
+// 申请服务商-配置
794
+export function agentConfigApi() {
795
+  return request.get("common/agent_config", {});
796
+}
797
+// 获取志愿者商品列表
798
+export function getvolunteer(data) {
799
+  return request.get("store/product/volunteer/lst",data,{noAuth :true});
800
+}
801
+// 获取志愿者详细信息
802
+export function getuserVolunteer(data) {
803
+  return request.get("userVolunteer");
804
+}

+ 87 - 0
src/api/xinban.js

@@ -0,0 +1,87 @@
1
+import request from "@/utils/request.js";
2
+
3
+
4
+// 首页
5
+export function Getnewhome(data) {
6
+  return request.get('newhome/nologin/product', data,{noAuth:true});
7
+}
8
+//每日免费商品
9
+export function Freeproduct(data) {
10
+  return request.get('newhome/nologin/free_product', data);
11
+}
12
+//大仓列表
13
+export function Dacanglst(data) {
14
+  return request.get('dacang/nologin/da_cang_lst', data);
15
+}
16
+//大仓商数据列表
17
+export function Dacangproductlst(data) {
18
+  return request.get('dacang/nologin/da_cang_product_lst', data);
19
+}
20
+//大仓介绍
21
+export function Introduce(data) {
22
+  return request.get('dacang/nologin/introduce/'+data);
23
+}
24
+//创建渠道商订单
25
+export function Createchannelorder(data) {
26
+  return request.post('order/create_channel_order',data);
27
+}
28
+//支付
29
+export function Paychannel(data) {
30
+  return request.get('pay_channel',data);
31
+}
32
+// 检查是否是渠道商
33
+export function Check(data) {
34
+  return request.get('dacang/Channel/check',data);
35
+}
36
+// 渠道商激活码
37
+export function Channelcode(data) {
38
+  return request.get('dacang/Channel/channel_code',data);
39
+}
40
+// 某个大仓商品列表
41
+export function Dchomeproduct(id,data) {
42
+  return request.get('dacang/nologin/dc_home_product/'+id,data);
43
+}
44
+//某个大仓商户
45
+export function Dchomemerchant(id) {
46
+  return request.get('dacang/nologin/dc_home_merchant/'+id);
47
+}
48
+//支付大仓列表
49
+export function Dacanglsts(data) {
50
+  return request.get('dacang/nologin/da_cang_lst',data);
51
+}
52
+// banner
53
+export function bannerdacang(data) {	
54
+  return request.get('newhome/nologin/banner/'+data,{},{ noAuth : true });
55
+}
56
+// 签到
57
+export function Getsgin(data) {	
58
+  return request.get('newhome/sgin',data);
59
+}
60
+// 签到列表
61
+export function Getsignlst(data) {	
62
+  return request.get('newhome/sign_lst',data);
63
+}
64
+//会员页面
65
+export function UserVipInfo(data) {	
66
+  return request.get('warehouse/UserVipInfo',data);
67
+}
68
+// 检查今天是否已经签到
69
+export function Getsigntoday(data) {	
70
+  return request.get('newhome/sign_today',data);
71
+}
72
+export function Postverify(data) {	
73
+  return request.post('auth/verify',data);
74
+}
75
+export function Postregister(data) {	
76
+  return request.post('auth/register',data);
77
+}
78
+// 秒杀商品
79
+export function getseckill(data) {	
80
+  return request.get('dacang/nologin/seckill',data);
81
+}
82
+// 检查商品是否是大仓商品
83
+export function ChenckproductisdaCang(data) {	
84
+  return request.get('dacang/chenckproduct_isdaCang/'+data);
85
+}
86
+
87
+

+ 184 - 0
src/colorui/animation.css

@@ -0,0 +1,184 @@
1
+/* 
2
+  Animation 微动画  
3
+  基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28
4
+ */
5
+
6
+/* css 滤镜 控制黑白底色gif的 */
7
+.gif-black{  
8
+  mix-blend-mode: screen;  
9
+}
10
+.gif-white{  
11
+  mix-blend-mode: multiply; 
12
+}
13
+
14
+
15
+/* Animation css */
16
+[class*=animation-] {
17
+    animation-duration: .5s;
18
+    animation-timing-function: ease-out;
19
+    animation-fill-mode: both
20
+}
21
+
22
+.animation-fade {
23
+    animation-name: fade;
24
+    animation-duration: .8s;
25
+    animation-timing-function: linear
26
+}
27
+
28
+.animation-scale-up {
29
+    animation-name: scale-up
30
+}
31
+
32
+.animation-scale-down {
33
+    animation-name: scale-down
34
+}
35
+
36
+.animation-slide-top {
37
+    animation-name: slide-top
38
+}
39
+
40
+.animation-slide-bottom {
41
+    animation-name: slide-bottom
42
+}
43
+
44
+.animation-slide-left {
45
+    animation-name: slide-left
46
+}
47
+
48
+.animation-slide-right {
49
+    animation-name: slide-right
50
+}
51
+
52
+.animation-shake {
53
+    animation-name: shake
54
+}
55
+
56
+.animation-reverse {
57
+    animation-direction: reverse
58
+}
59
+
60
+@keyframes fade {
61
+    0% {
62
+        opacity: 0
63
+    }
64
+
65
+    100% {
66
+        opacity: 1
67
+    }
68
+}
69
+
70
+@keyframes scale-up {
71
+    0% {
72
+        opacity: 0;
73
+        transform: scale(.2)
74
+    }
75
+
76
+    100% {
77
+        opacity: 1;
78
+        transform: scale(1)
79
+    }
80
+}
81
+
82
+@keyframes scale-down {
83
+    0% {
84
+        opacity: 0;
85
+        transform: scale(1.8)
86
+    }
87
+
88
+    100% {
89
+        opacity: 1;
90
+        transform: scale(1)
91
+    }
92
+}
93
+
94
+@keyframes slide-top {
95
+    0% {
96
+        opacity: 0;
97
+        transform: translateY(-100%)
98
+    }
99
+
100
+    100% {
101
+        opacity: 1;
102
+        transform: translateY(0)
103
+    }
104
+}
105
+
106
+@keyframes slide-bottom {
107
+    0% {
108
+        opacity: 0;
109
+        transform: translateY(100%)
110
+    }
111
+
112
+    100% {
113
+        opacity: 1;
114
+        transform: translateY(0)
115
+    }
116
+}
117
+
118
+@keyframes shake {
119
+
120
+    0%,
121
+    100% {
122
+        transform: translateX(0)
123
+    }
124
+
125
+    10% {
126
+        transform: translateX(-9px)
127
+    }
128
+
129
+    20% {
130
+        transform: translateX(8px)
131
+    }
132
+
133
+    30% {
134
+        transform: translateX(-7px)
135
+    }
136
+
137
+    40% {
138
+        transform: translateX(6px)
139
+    }
140
+
141
+    50% {
142
+        transform: translateX(-5px)
143
+    }
144
+
145
+    60% {
146
+        transform: translateX(4px)
147
+    }
148
+
149
+    70% {
150
+        transform: translateX(-3px)
151
+    }
152
+
153
+    80% {
154
+        transform: translateX(2px)
155
+    }
156
+
157
+    90% {
158
+        transform: translateX(-1px)
159
+    }
160
+}
161
+
162
+@keyframes slide-left {
163
+    0% {
164
+        opacity: 0;
165
+        transform: translateX(-100%)
166
+    }
167
+
168
+    100% {
169
+        opacity: 1;
170
+        transform: translateX(0)
171
+    }
172
+}
173
+
174
+@keyframes slide-right {
175
+    0% {
176
+        opacity: 0;
177
+        transform: translateX(100%)
178
+    }
179
+
180
+    100% {
181
+        opacity: 1;
182
+        transform: translateX(0)
183
+    }
184
+}

+ 89 - 0
src/colorui/components/cu-custom.vue

@@ -0,0 +1,89 @@
1
+<template>
2
+	<view>
3
+		<view class="cu-custom" :style="[{height: (isFixed?'0':CustomBar) + 'px'}]">
4
+			<view class="cu-bar fixed" :style="style" :class="[bgImage!=''?'none-bg text-white bg-img bg-colorful bg-seckill':'',bgColor]">
5
+				<view class="action" @tap="BackPage" v-if="isBack">
6
+					<text class="cuIcon-back"></text>
7
+					<slot name="backText"></slot>
8
+				</view>
9
+				<view class="action" v-if="isBackText">
10
+					<slot name="backText"></slot>
11
+				</view>
12
+				<view class="content" :style="[{top:StatusBar + 'px'}]">
13
+					<slot name="content"></slot>
14
+				</view>
15
+				<slot name="right"></slot>
16
+			</view>
17
+		</view>
18
+	</view>
19
+</template>
20
+
21
+<script>
22
+	export default {
23
+		data() {
24
+			return {
25
+				StatusBar: this.StatusBar,
26
+				CustomBar: this.CustomBar
27
+			};
28
+		},
29
+		name: 'cu-custom',
30
+		computed: {
31
+			style() {
32
+				var StatusBar= this.StatusBar;
33
+				var CustomBar= this.CustomBar;
34
+				var bgImage = this.bgImage;
35
+				var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
36
+				if (this.bgImage) {
37
+					style = `${style}background-image:url(${bgImage});`;
38
+				}
39
+				return style
40
+			}
41
+		},
42
+		props: {
43
+			bgColor: {		//作用在cu-bar上的类
44
+				type: String,
45
+				default: 'bg-gradual-theme'
46
+			},
47
+			isBack: {		//是否显示返回箭头和左边的文字
48
+				type: [Boolean, String],
49
+				default: false
50
+			},
51
+			isBackText: {	//开启显示左边的文字
52
+				type: [Boolean, String],
53
+				default: false
54
+			}, 
55
+			isFixed: {		//是否设置导航高度为 0
56
+				type: [Boolean, String],
57
+				default: false
58
+			},
59
+			bgImage: {		//导航背景图片
60
+				type: String,
61
+				default: ''
62
+			},
63
+		},
64
+		methods: {
65
+			BackPage() {
66
+				uni.navigateBack({
67
+					delta: 1
68
+				});
69
+			}
70
+		}
71
+	}
72
+</script>
73
+
74
+<style>
75
+
76
+.bg-gradual-theme{
77
+	background: linear-gradient(to right,#F9424C,#FB4B5E); 
78
+	color: #fff;
79
+}
80
+.bg-colorful{
81
+	width: 750rpx;
82
+	background: linear-gradient(40deg, #F97337 0%, #F94032 100%);
83
+	color: #fff;
84
+}
85
+.bg-seckill{
86
+	color: #fff;
87
+	background: linear-gradient(180deg, #FF607A 0%, #fb6079 100%);
88
+}
89
+</style>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1226 - 0
src/colorui/icon.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3941 - 0
src/colorui/main.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
src/common/amap-wx.js


+ 29 - 0
src/common/api/index.js

@@ -0,0 +1,29 @@
1
+import Request from './request'
2
+import {
3
+	HTTP_REQUEST_URL,
4
+	HEADER,
5
+	TOKENNAME
6
+} from '@/config/app';
7
+import { API_BASE_URL } from '../config.js'
8
+import store from '../../store/index.js';
9
+const http = new Request();
10
+
11
+http.setConfig((config) => {
12
+  config.baseUrl = API_BASE_URL;
13
+  return config
14
+})
15
+http.interceptor.request((config, cancel) => {
16
+  config.header = {
17
+    ...config.header,
18
+    'X-Token': 'Bearer ' + store.state.app.token
19
+  }
20
+  return config;
21
+})
22
+
23
+http.interceptor.response((response) => {
24
+  return response;
25
+})
26
+
27
+export {
28
+  http
29
+};

+ 178 - 0
src/common/api/request.js

@@ -0,0 +1,178 @@
1
+import {navigateToLogin} from '@/common/utils/utils.js';
2
+
3
+const TABS_URL = ['/pages/tab/tab01/index', '/pages/tab/tab02/index', '/pages/tab/tab03/index', '/pages/tab/tab04/index', '/pages/tab/tab05/index']
4
+export default class Request {
5
+  config = {
6
+    baseUrl: '',
7
+    header: {
8
+      'Content-Type': 'application/x-www-form-urlencoded',
9
+    },
10
+    method: 'GET',
11
+    dataType: 'json',
12
+    responseType: 'text',
13
+    success() {},
14
+    fail() {},
15
+    complete() {}
16
+  }
17
+
18
+  static posUrl(url) { /* 判断url是否为绝对路径 */
19
+    return /(http|https):\/\/([\w.]+\/?)\S*/.test(url)
20
+  }
21
+
22
+  interceptor = {
23
+    request: (f) => {
24
+      if (f) {
25
+        this.requestBeforeFun = f
26
+      }
27
+    },
28
+    response: (f) => {
29
+      if (f) {
30
+        this.requestComFun = f
31
+      }
32
+    }
33
+  }
34
+
35
+  static requestBeforeFun(config) {
36
+    return config
37
+  }
38
+
39
+  static requestComFun(response) {
40
+    return response
41
+  }
42
+
43
+  setConfig(f) {
44
+    this.config = f(this.config)
45
+    return this
46
+  }
47
+
48
+  request(options = {}) {
49
+    options.baseUrl = options.baseUrl || this.config.baseUrl
50
+    options.dataType = options.dataType || this.config.dataType
51
+    options.url = Request.posUrl(options.url) ? options.url : (options.baseUrl + options.url)
52
+    options.data = options.data || {}
53
+    options.header = options.header || this.config.header
54
+    options.method = options.method || this.config.method
55
+    if(options['Content-Type']) options.header['Content-Type'] = options['Content-Type']
56
+    // console.log(options)
57
+		return new Promise((resolve, reject) => {
58
+      let next = true
59
+      let _config = null
60
+      options.complete = (response) => {
61
+        let statusCode = response.statusCode
62
+        response.config = _config
63
+        response = this.requestComFun(response)
64
+        if (statusCode != 200) {
65
+          let errMessage = '';
66
+          switch (statusCode) {
67
+            case 400:
68
+              errMessage = '请求错误(400)';
69
+              break;
70
+            case 401:
71
+              errMessage = '未授权,请重新登录(401)';
72
+              uni.showToast({
73
+                title: '登录失效',
74
+                icon: 'none',
75
+                position: 'bottom',
76
+                duration: 1500
77
+              })
78
+              global.token = ''
79
+              global.userInfo = null
80
+              uni.removeStorageSync('USER_TOKEN')
81
+              uni.removeStorageSync('USER_INFO')
82
+              uni.$emit('appLoginOut', { msg: '用户退出登录了' })
83
+              let pages = getCurrentPages()
84
+              // 如果登陆失效 判断是否在底部栏页面 如果是则通知底部栏 如果不是则返回上一页
85
+              // 未判断完全,有底部栏页面应返回底部栏
86
+              if(pages.length > 1 && !TABS_URL.includes(pages[pages.length - 1]['route'])){
87
+                uni.navigateBack();
88
+              }
89
+              break;
90
+            case 403:
91
+              errMessage = '拒绝访问(403)';
92
+              break;
93
+            case 404:
94
+              errMessage = '请求出错(404)';
95
+              break;
96
+            case 408:
97
+              errMessage = '请求超时(408)';
98
+              break;
99
+            case 500:
100
+              errMessage = '服务器错误(500)';
101
+              break;
102
+            case 501:
103
+              errMessage = '服务未实现(501)';
104
+              break;
105
+            case 502:
106
+              errMessage = '网络错误(502)';
107
+              break;
108
+            case 503:
109
+              errMessage = '服务不可用(503)';
110
+              break;
111
+            case 504:
112
+              errMessage = '网络超时(504)';
113
+              break;
114
+            case 505:
115
+              errMessage = 'HTTP版本不受支持(505)';
116
+              break;
117
+            default:
118
+              errMessage = "连接出错(" + statusCode + ")!";
119
+              break;
120
+          }
121
+
122
+          if(statusCode != 401){
123
+            uni.showToast({
124
+              title: errMessage,
125
+              icon: 'none',
126
+              position: 'bottom',
127
+              duration: 1500
128
+            })
129
+            uni.$emit('netWorkError', { msg: '服务器太拥挤了~请您稍后重试' })
130
+          }
131
+          reject({statusCode, errMessage})
132
+        } else {
133
+          let _code = response.data.code;
134
+          if(_code == '-201' || _code == '-202' || _code == '-203'){
135
+            uni.showToast({
136
+              title: '登录失效 请重新登录',
137
+              icon: 'none',
138
+            })
139
+            global.token = ''
140
+            global.userInfo = null
141
+            uni.removeStorageSync('USER_TOKEN')
142
+            uni.removeStorageSync('USER_INFO')
143
+            navigateToLogin();
144
+          }else{
145
+            resolve(response)
146
+          }
147
+        }
148
+        uni.stopPullDownRefresh();
149
+      }
150
+      let cancel = (t = 'handle cancel') => {
151
+        let err = {
152
+          errMsg: t,
153
+          config: afC
154
+        }
155
+        reject(err)
156
+        next = false
157
+      }
158
+      let afC = { ...this.config, ...options }
159
+      _config = { ...afC, ...this.requestBeforeFun(afC, cancel) }
160
+      if (!next) return
161
+      uni.request(_config)
162
+    })
163
+  }
164
+
165
+  get(url, data, options = {}) {
166
+    options.url = url
167
+    options.data = data
168
+    options.method = 'GET'
169
+    return this.request(options)
170
+  }
171
+
172
+  post(url, data, options = {}) {
173
+    options.url = url
174
+    options.data = data
175
+    options.method = 'POST'
176
+    return this.request(options)
177
+  }
178
+}

+ 42 - 0
src/common/api/url.js

@@ -0,0 +1,42 @@
1
+export default {
2
+
3
+	/*===== 商户功能 Start =====*/
4
+	merchant: '/merchant/index', // 获取商户信息
5
+	report_form: '/merchant/report_form', // 统计接口
6
+	newest_data: '/merchant/newest_data', // 最新数据
7
+	branch_list: '/merchant/branch_list', // 分店列表
8
+	set_rebate: '/merchant/set_rebate', // 返金设置
9
+	add_recharge: '/merchant/add_recharge', // 添加/编辑优惠
10
+	recharge_list: '/merchant/recharge_list', // 优惠列表
11
+	del_recharge: '/merchant/del_recharge', // 删除一条优惠数据
12
+	staff_list: '/merchant/staff_list', // 员工列表
13
+	add_staff: '/merchant/add_staff', // 添加员工
14
+	edit_staff: '/merchant/edit_staff', // 员工编辑
15
+	get_staff_one: '/merchant/get_staff_one', // 员工详情
16
+	mer_user: '/merchant/mer_user', // 会员列表
17
+	mer_user_info: '/merchant/mer_user_info', // 会员详情
18
+	add_user: '/merchant/add_user', // 添加会员
19
+	del_staff: '/merchant/del_staff', // 删除员工
20
+	get_branch: '/merchant/get_branch', // 获取部门列表
21
+	add_branch: '/merchant/add_branch', // 添加部门
22
+	del_branch: '/merchant/del_branch', // 删除部门
23
+	branch_quanxian: '/merchant/branch_quanxian', // 权限列表
24
+	lock_count: '/merchant/lock_count', // 锁定奖励
25
+	count_price: '/merchant/count_price', // 余额奖励
26
+	msg_notice: '/merchant/msg_notice', // 消息通知
27
+	del_notice: '/merchant/del_notice', // 删除消息
28
+	tuijian: '/merchant/tuijian', // 推荐人管理
29
+	qrcode: '/store/merchant/qrcode/', // 商户收款码
30
+	payQrCode: '/store/merchant/payQrCode/', // 商户收款码(新)
31
+	statistical_chart: '/merchant/statistical_chart', // 折线图
32
+	getAccount: '/user/getAccount', // 获取账号绑定信息
33
+	updateAccount: '/user/updateAccount', // 更新绑定微信支付宝账号
34
+	getBranchCode: '/merchant/getBranchCode', // 获取支行名称
35
+	shopInfoEcho: '/intention/detail', // 店铺入驻信息回显
36
+	reduceMoney: '/merchant/reduce_money', // 会员管理 操作金额 减
37
+	businesscategory: '/city/businesscategory', // 经营类目列表
38
+	getGzcConfig: '/gzc/config', // 公证处视频
39
+	seeding:'/merchant/check_yx',//试播音响
40
+	yinx:'/merchant/bind_yx',//音响绑定
41
+	/*===== 商户功能 End =====*/
42
+}

+ 96 - 0
src/common/config.js

@@ -0,0 +1,96 @@
1
+const host = 'https://test.bjtdba.com'              // 项目中接口地址host (项目线上端口)
2
+export const WEBSOCKET = 'ws://app.bjtdba.com';
3
+
4
+// 本地临时端口号
5
+// const host = 'http://192.168.10.211:8001'         // 项目中接口地址host 沛东
6
+// const host = 'http://192.168.0.180:8080'          // 项目中接口地址host 广盛
7
+// const host = 'http://192.168.0.106:9527'         // 项目中接口地址host 杜鹏
8
+// const host = 'http://192.168.0.134:8888'          // 项目中接口地址host 陈辉
9
+//const host = 'http://192.168.0.135:8001'           // 项目中接口地址host 沛东
10
+export const IMGSOURCE = host;                            // 分享的H5地址
11
+
12
+
13
+export const IS_DEV = 1                              // 是否是开发环境 1 是 0 否
14
+export const PAGE_SIZE = 15                          // 分页配置 每页条数
15
+
16
+export const BASE_URL = `${host}`                    // 基础路径
17
+export const API_BASE_URL = `${host}/api`            // 接口请求基础路径
18
+export const UPLOAD_IMAGE_URL = `${host}/api/v1/5d5fa8984f0c2` // 图片上传接口路径 UploadImage方法依赖此配置
19
+export const UPLOAD_VIDEO_URL = `${host}/api/v1/5fc615f7da92b` // 视频上传上传接口路径
20
+
21
+export const IMG_BASE_URL = `${host}/upload/`        // 图片基础路径 公共filters assembleImgSrc依赖此配置
22
+// #ifdef APP-PLUS || H5
23
+export const LOGIN_PAGE_URL = '/pagesA/user/login/login-code'// 登录页面路由 request.js 依赖此配置 主要用于登录失效跳转
24
+// #endif
25
+// #ifdef MP-WEIXIN
26
+export const LOGIN_PAGE_URL = '/pagesA/user/login/auth-login'// 登录页面路由 request.js 依赖此配置 主要用于登录失效跳转
27
+// #endif
28
+
29
+const _platform = uni.getSystemInfoSync().platform;
30
+export const SYSTEM_CONFIG = {                                                            // 系统配置
31
+  logo: 'https://test.bjtdba.com/mp/images/logo.png',
32
+  appName: '模块化测试',
33
+  // #ifdef APP-PLUS
34
+  platform: _platform === 'android' ? 'Android' : 'IOS',
35
+  // #endif
36
+  // #ifdef H5
37
+  platform: 'Web',
38
+  // #endif
39
+  // #ifdef MP-WEIXIN
40
+  platform: 'Wechat',
41
+  // #endif
42
+  // #ifdef MP-ALIPAY
43
+  platform: 'Alipay',
44
+  // #endif
45
+  // #ifdef MP-BAIDU
46
+  platform: 'Baidu',
47
+  // #endif
48
+  // #ifdef MP-TOUTIAO
49
+  platform: 'ByteBounce',
50
+  // #endif
51
+  // #ifdef MP-360
52
+  platform: '360',
53
+  // #endif
54
+  // #ifdef QUICKAPP-WEBVIEW
55
+  platform: 'FastApp',
56
+  // #endif
57
+}
58
+
59
+export const needLoginPages = [
60
+  "/pagesA/user/address/address-list",
61
+  "/pagesA/user/address/address-add",
62
+  "/pagesA/index/setting/change-pay-password",
63
+  "/pagesA/index/setting/reset-pay-password",
64
+  "/pagesA/index/setting/change-password",
65
+  "/pagesA/service-mssage/message/message-list",
66
+  "/pagesA/user/user/info",
67
+  "/pagesA/user/user/avatar-cropping",
68
+  "/pagesA/index/setting/feedback",
69
+  "/pagesA/index/setting/my-feedback",
70
+  "/pagesA/index/setting/verify-oldphone",
71
+  "/pagesA/index/setting/change-newphone",
72
+  "/pagesA/user/wallet/my-wallet",
73
+  "/pagesA/user/wallet/consumer-detail",
74
+  "/pagesA/user/wallet/recharge",
75
+  "/pagesA/user/wallet/recharge-log",
76
+  "/pagesA/user/wallet/withdraw",
77
+  "/pagesA/user/wallet/withdraw-success",
78
+  "/pagesA/user/wallet/account-bind",
79
+  "/pagesA/user/wallet/alipay-bind",
80
+  "/pagesA/user/wallet/wechat-bind",
81
+  "/pagesA/user/user/my-favorites",
82
+  "/pagesA/user/user/my-footprint",
83
+  "/pagesA/order/afterorder/afterorder-apply",
84
+  "/pagesA/order/afterorder/afterorder-status-list",
85
+  "/pagesA/order/afterorder/afterorder-detail",
86
+  "/pagesA/order/afterorder/afterorder-sendback",
87
+  "/pagesA/order/order-process/confirm-order",
88
+  "/pagesA/order/order-process/pay-order",
89
+  "/pagesA/order/order-process/pay-success",
90
+  "/pagesA/order/order-process/choos_coupon",
91
+  "/pagesA/order/order-list/all-order",
92
+  "/pagesA/order/orderdetail/order-detail",
93
+  "/pagesA/order/orderdetail/express-delivery",
94
+  "/pagesA/order/evaluation/order-evaluation",
95
+  "/pagesA/news/article/article-favoriters"
96
+]

+ 70 - 0
src/common/filter/index.js

@@ -0,0 +1,70 @@
1
+import Vue from 'vue';
2
+import Dayjs from '@/libs/day.js';
3
+import store from '@/store/index.js';
4
+
5
+// 识别图片路径是否为全路径 若不是则进行拼接
6
+Vue.filter('assembleImgSrc', src => {
7
+  src = src || ''
8
+  if( src.indexOf('http://') != -1 || src.indexOf('https://') != -1 ){
9
+    return src
10
+  }
11
+  if( src.indexOf('/uploads/') != -1 || src.indexOf('/uploads/') != -1 ){
12
+    return BASE_URL + src
13
+  }else{
14
+    return IMG_BASE_URL + src
15
+  }
16
+});
17
+
18
+// 日期格式转换
19
+Vue.filter('formatDate', (date, format = 'YYYY-MM-DD hh:mm:ss') => {
20
+  return Dayjs(date).format(format)
21
+});
22
+
23
+// 格式化数字
24
+Vue.filter('formatNumber', (number,tag = 'w') => {
25
+  if (number >= 10000) {
26
+    return (Math.floor(number / 1000) / 10).toFixed(1) + tag;
27
+  } else {
28
+    return number;
29
+  }
30
+});
31
+
32
+// 格式化角标数字
33
+Vue.filter('formatTagNumber', number => {
34
+  if (number >= 100) {
35
+    return "99+";
36
+  } else {
37
+    return number;
38
+  }
39
+});
40
+
41
+// 过滤商品价格
42
+Vue.filter('filterGoodsPrice', function (value) {
43
+	if(!value) return '';
44
+	let isMember = store.getters.isMember; // 是否是会员
45
+	let isActivity = value.activity_type == undefined || value.activity_type == 0 ? false : true; // 是否是活动
46
+	let member_activity_price = value.member_activity_price ? value.member_activity_price : value.activity_price; //会员活动价
47
+	let activity_price = value.activity_price; // 活动价
48
+	let member_price = value.member_price ? value.member_price : value.shop_price; // 会员价
49
+	let shop_price = value.shop_price; // 售卖价
50
+	if(isActivity && isMember){
51
+		// console.log("会员活动价",member_activity_price);
52
+		return member_activity_price;
53
+	}else if(isActivity && !isMember){
54
+		// console.log("活动价",activity_price);
55
+		return activity_price;
56
+	}else if(!isActivity && isMember){
57
+		// console.log("会员价",member_price);
58
+		return member_price;
59
+	}else if(!isActivity && !isMember){
60
+		// console.log("普通价",shop_price);
61
+		return shop_price;
62
+	}
63
+	return '';
64
+})
65
+
66
+// 手机号脱敏
67
+Vue.filter('filterMobile',function(val){
68
+  if (!val) return "";
69
+  return val.substr(0, 3) + "****" + val.substr(-4);
70
+})

+ 29 - 0
src/common/function/debounce.js

@@ -0,0 +1,29 @@
1
+let timeout = null;
2
+
3
+/**
4
+ * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
5
+ * 
6
+ * @param {Function} func 要执行的回调函数 
7
+ * @param {Number} wait 延时的时间
8
+ * @param {Boolean} immediate 是否立即执行 
9
+ * @return null
10
+ */
11
+function debounce(func, wait = 500, immediate = false) {
12
+	// 清除定时器
13
+	if (timeout !== null) clearTimeout(timeout);
14
+	// 立即执行,此类情况一般用不到
15
+	if (immediate) {
16
+		var callNow = !timeout;
17
+		timeout = setTimeout(function() {
18
+			timeout = null;
19
+		}, wait);
20
+		if (callNow) typeof func === 'function' && func();
21
+	} else {
22
+		// 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
23
+		timeout = setTimeout(function() {
24
+			typeof func === 'function' && func();
25
+		}, wait);
26
+	}
27
+}
28
+
29
+export default debounce

+ 22 - 0
src/common/function/deepClone.js

@@ -0,0 +1,22 @@
1
+// 判断arr是否为一个数组,返回一个bool值
2
+function isArray (arr) {
3
+    return Object.prototype.toString.call(arr) === '[object Array]';
4
+}
5
+// 深度克隆
6
+function deepClone (obj) {
7
+	// 对常见的“非”值,直接返回原来值
8
+	if([null, undefined, NaN, false].includes(obj)) return obj;
9
+    if(typeof obj !== "object" && typeof obj !== 'function') {
10
+		//原始类型直接返回
11
+        return obj;
12
+    }
13
+    var o = isArray(obj) ? [] : {};
14
+    for(let i in obj) {
15
+        if(obj.hasOwnProperty(i)){
16
+            o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
17
+        }
18
+    }
19
+    return o;
20
+}
21
+
22
+export default deepClone;

+ 32 - 0
src/common/function/throttle.js

@@ -0,0 +1,32 @@
1
+let timer, flag;
2
+/**
3
+ * 节流原理:在一定时间内,只能触发一次
4
+ * 
5
+ * @param {Function} func 要执行的回调函数 
6
+ * @param {Number} wait 延时的时间
7
+ * @param {Boolean} immediate 是否立即执行
8
+ * @return null
9
+ */
10
+function throttle(func, wait = 500, immediate = true) {
11
+	if (immediate) {
12
+		if (!flag) {
13
+			flag = true;
14
+			// 如果是立即执行,则在wait毫秒内开始时执行
15
+			typeof func === 'function' && func();
16
+			timer = setTimeout(() => {
17
+				flag = false;
18
+			}, wait);
19
+		}
20
+	} else {
21
+		if (!flag) {
22
+			flag = true
23
+			// 如果是非立即执行,则在wait毫秒内的结束处执行
24
+			timer = setTimeout(() => {
25
+				flag = false
26
+				typeof func === 'function' && func();
27
+			}, wait);
28
+		}
29
+		
30
+	}
31
+};
32
+export default throttle

+ 52 - 0
src/common/function/timeFormat.js

@@ -0,0 +1,52 @@
1
+// padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
2
+// 所以这里做一个兼容polyfill的兼容处理
3
+if (!String.prototype.padStart) {
4
+	// 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
5
+	String.prototype.padStart = function(maxLength, fillString = ' ') {
6
+		if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
7
+			'fillString must be String')
8
+		let str = this
9
+		// 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
10
+		if (str.length >= maxLength) return String(str)
11
+
12
+		let fillLength = maxLength - str.length,
13
+			times = Math.ceil(fillLength / fillString.length)
14
+		while (times >>= 1) {
15
+			fillString += fillString
16
+			if (times === 1) {
17
+				fillString += fillString
18
+			}
19
+		}
20
+		return fillString.slice(0, fillLength) + str;
21
+	}
22
+}
23
+
24
+function timeFormat(timestamp = null, fmt = 'yyyy-mm-dd') {
25
+	// 其他更多是格式化有如下:
26
+	// yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
27
+	timestamp = parseInt(timestamp);
28
+	// 如果为null,则格式化当前时间
29
+	if (!timestamp) timestamp = Number(new Date());
30
+	// 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
31
+	if (timestamp.toString().length == 10) timestamp *= 1000;
32
+	let date = new Date(timestamp);
33
+	let ret;
34
+	let opt = {
35
+		"y+": date.getFullYear().toString(), // 年
36
+		"m+": (date.getMonth() + 1).toString(), // 月
37
+		"d+": date.getDate().toString(), // 日
38
+		"h+": date.getHours().toString(), // 时
39
+		"M+": date.getMinutes().toString(), // 分
40
+		"s+": date.getSeconds().toString() // 秒
41
+		// 有其他格式化字符需求可以继续添加,必须转化成字符串
42
+	};
43
+	for (let k in opt) {
44
+		ret = new RegExp("(" + k + ")").exec(fmt);
45
+		if (ret) {
46
+			fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
47
+		};
48
+	};
49
+	return fmt;
50
+}
51
+
52
+export default timeFormat

+ 47 - 0
src/common/function/timeFrom.js

@@ -0,0 +1,47 @@
1
+// import timeFormat from '../../libs/function/timeFormat.js';
2
+import timeFormat from './timeFormat.js';
3
+
4
+/**
5
+ * 时间戳转为多久之前
6
+ * @param String timestamp 时间戳
7
+ * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
8
+ * 如果为布尔值false,无论什么时间,都返回多久以前的格式
9
+ */
10
+function timeFrom(timestamp = null, format = 'yyyy-mm-dd') {
11
+	if (timestamp == null) timestamp = Number(new Date());
12
+	timestamp = parseInt(timestamp);
13
+	// 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
14
+	if (timestamp.toString().length == 10) timestamp *= 1000;
15
+	var timer = (new Date()).getTime() - timestamp;
16
+	timer = parseInt(timer / 1000);
17
+	// 如果小于5分钟,则返回"刚刚",其他以此类推
18
+	let tips = '';
19
+	switch (true) {
20
+		case timer < 300:
21
+			tips = '刚刚';
22
+			break;
23
+		case timer >= 300 && timer < 3600:
24
+			tips = parseInt(timer / 60) + '分钟前';
25
+			break;
26
+		case timer >= 3600 && timer < 86400:
27
+			tips = parseInt(timer / 3600) + '小时前';
28
+			break;
29
+		case timer >= 86400 && timer < 2592000:
30
+			tips = parseInt(timer / 86400) + '天前';
31
+			break;
32
+		default:
33
+			// 如果format为false,则无论什么时间戳,都显示xx之前
34
+			if(format === false) {
35
+				if(timer >= 2592000 && timer < 365 * 86400) {
36
+					tips = parseInt(timer / (86400 * 30)) + '个月前';
37
+				} else {
38
+					tips = parseInt(timer / (86400 * 365)) + '年前';
39
+				}
40
+			} else {
41
+				tips = timeFormat(timestamp, format);
42
+			}
43
+	}
44
+	return tips;
45
+}
46
+
47
+export default timeFrom;

+ 185 - 0
src/common/mixin/biological.js

@@ -0,0 +1,185 @@
1
+export default {
2
+  name: 'verifyAgain',
3
+  onShow() {
4
+    console.log('开始二次验证','用户token==>',this.$store.state.userInfo.user_token,'是否需要==>',this.$store.state.gestureAgain)
5
+    // 获取当前页面的URL
6
+    this.currentURL = this.$mp.page.route;
7
+    // 只有再用户登录 且 需要二次验证 的情况下判断才有意义
8
+    if (this.$store.state.userInfo.user_token && this.$store.state.gestureAgain) {
9
+      console.log('开始判断设备...==>',uni.getSystemInfoSync().platform)
10
+      if (uni.getSystemInfoSync().platform == "ios") {
11
+        this.appleORan == 1;
12
+        this.getingSupport(1);
13
+        console.log('设备为ios')
14
+      } else if (uni.getSystemInfoSync().platform === "android") {
15
+        this.appleORan == 0;
16
+        this.getingSupport(0);
17
+        console.log('设备为安卓')
18
+      } else {
19
+        this.appleORan == 0;
20
+        this.getingSupport(0);
21
+        console.log('设备未知,默认为安卓')
22
+      }
23
+    }
24
+  },
25
+  destroyed() {
26
+    // this.$store.commit('setGestureAgain',true);
27
+  },
28
+  data() {
29
+    return {
30
+      appleORan: null,  // 判断是苹果还是安卓(苹果:1;安卓:0;)
31
+      currentURL: null,  // 获取当前页面的URL
32
+    }
33
+  },
34
+  methods: {
35
+    // 获取支持的生物监测
36
+    getingSupport(type) {
37
+      console.log('appleORan==3')
38
+      let that = this;
39
+      // #ifdef H5
40
+      that.goingHandPassward();
41
+      // #endif
42
+      // #ifndef H5
43
+      uni.checkIsSupportSoterAuthentication({
44
+        success(res) {
45
+          // console.log("获取支持的生物监测成功==>", res.supportMode.indexOf("facial") != -1,that.appleORan == 1);
46
+          // 如果支持人脸识别,就优先人脸识别,否则就去指纹识别(人脸识别还需要判断是否是ios设备,如果不是,直接指纹。)
47
+          if (res.supportMode.indexOf("facial") != -1 && type == 1) {
48
+            console.log('进入人脸识别')
49
+            that.examineFaceID();
50
+          } else if (res.supportMode.indexOf("fingerPrint") != -1) {
51
+            console.log('进入指纹识别')
52
+            that.examineFingetprint();
53
+          } else {
54
+            that.goingHandPassward();
55
+          }
56
+        },
57
+        fail(err) {
58
+          console.log("获取支持的生物监测失败==>", err);
59
+          that.goingHandPassward();
60
+        },
61
+      });
62
+      // #endif
63
+    },
64
+    // 手势密码入口
65
+    goingHandPassward() {
66
+      // 如果保存的有密码那就是解锁模式,如果没有那就是设置模式
67
+      if (this.$store.state.userInfo.hand_password == '') {
68
+        console.log('跳转到设置手势密码')
69
+        uni.showToast({
70
+          title: '请先设置你的密码',
71
+          duration: 500,
72
+          icon: 'none'
73
+        });
74
+        this.$urouter.redirectTo({
75
+          url: '/pagesA/index/setting/gesturePassword',
76
+          params: {
77
+            "type": 2,
78
+          }
79
+        })
80
+      } else {
81
+        console.log('跳转到手势密码')
82
+        // 跳转到手势密码的页面时也到带上当前的页面路径
83
+        this.$urouter.redirectTo({
84
+          url: '/pages/index/setting/gesturePassword',
85
+          params: {
86
+            "type": 1,
87
+            "currentURL": this.currentURL
88
+          }
89
+        })
90
+      }
91
+    },
92
+    // 检查是否录入指纹
93
+    examineFingetprint() {
94
+      let that = this;
95
+      uni.checkIsSoterEnrolledInDevice({
96
+        checkAuthMode: "fingerPrint",
97
+        success(res) {
98
+          console.log("检查是否录入指纹==>", res);
99
+          // 如果没有录入指纹就跳转到设备的设置页面(不过应该用不到)
100
+          if (res.isEnrolled) {
101
+            that.startFingerprint();
102
+          }
103
+        },
104
+        fail(err) {
105
+          console.log(err);
106
+        },
107
+      });
108
+    },
109
+    // 检查是否录入faceID
110
+    examineFaceID() {
111
+      let that = this;
112
+      uni.checkIsSoterEnrolledInDevice({
113
+        checkAuthMode: "facial",
114
+        success(res) {
115
+          console.log("检查是否录入faceID", res);
116
+          // 检查是否录入人脸
117
+          if (res.isEnrolled) {
118
+            that.startFaceID();
119
+          }
120
+        },
121
+        fail(err) {
122
+          console.log(err);
123
+        },
124
+      });
125
+    },
126
+    // 开始指纹识别
127
+    startFingerprint() {
128
+      let that = this;
129
+      uni.startSoterAuthentication({
130
+        requestAuthModes: ["fingerPrint"],
131
+        challenge: "要携带的参数",
132
+        authContent: "请用指纹解锁",
133
+        success(res) {
134
+          that.$store.commit('setGestureAgain',false);
135
+          console.log("指纹识别成功==>", res);
136
+          // 如果识别成功就
137
+          uni.showToast({
138
+            title: "识别成功",
139
+            duration: 500,
140
+          });
141
+        },
142
+        fail(err) {
143
+          console.log(err);
144
+          uni.showToast({
145
+            title: '验证失败',
146
+            duration: 1000,
147
+            icon:'none'
148
+          });
149
+          setTimeout(() => {
150
+            that.$urouter.navigateBack()
151
+          },1000)
152
+        },
153
+      });
154
+    },
155
+    // 开始人脸识别
156
+    startFaceID() {
157
+      let that = this;
158
+      uni.startSoterAuthentication({
159
+        requestAuthModes: ["facial"],
160
+        challenge: "要携带的参数",
161
+        authContent: "请用FaceID解锁",
162
+        success(res) {
163
+          console.log("人脸识别成功==>", res);
164
+          that.$store.commit('setGestureAgain',false);
165
+          // 如果识别成功就
166
+          uni.showToast({
167
+            title: "识别成功",
168
+            duration: 500,
169
+          });
170
+        },
171
+        fail(err) {
172
+          console.log(err);
173
+          uni.showToast({
174
+            title: '验证失败',
175
+            duration: 1000,
176
+            icon:'none'
177
+          });
178
+          setTimeout(() => {
179
+            that.$urouter.navigateBack()
180
+          },1000)
181
+        },
182
+      });
183
+    },
184
+  },
185
+};

+ 49 - 0
src/common/mixin/floor.js

@@ -0,0 +1,49 @@
1
+export default {
2
+    data(){
3
+      return {
4
+        scrollInfo:[], // 页码滚动初始化
5
+        scrollSize:1,  // 滚动页码位置判断  
6
+      }
7
+    },
8
+      // 监听滚动传值
9
+      onPageScroll(res) {
10
+        let _this = this
11
+        _this.type = 1
12
+        this.$emit('gunShowPage', res)
13
+        // console.log('页面正在滚动',res.scrollTop)
14
+        var pageIndex =null ;
15
+        // scrollSize  所处的高度在哪个哪个页码的下标下   
16
+        // currentPage 当前页码
17
+          // 下滑页码改变时 记录页码增加时的高度,上拉页码改变时
18
+        if(this.currentPage > this.scrollSize){
19
+          this.scrollSize = this.currentPage
20
+          this.scrollInfo.push(res.scrollTop)
21
+          // console.log(this.scrollInfo)
22
+        }else if(this.currentPage < this.scrollSize){
23
+          this.scrollSize = this.currentPage
24
+          console.log(this.scrollInfo)
25
+        }
26
+        // 判断滚动条有历史记录的情况下 返回
27
+        if(this.scrollInfo[this.scrollSize-2] >res.scrollTop){
28
+          this.currentPage--
29
+          this.scrollSize = this.currentPage
30
+        }
31
+         // 判断滚动条在有历史记录的情况下 下滑
32
+        if(this.scrollInfo[this.currentPage-1] < res.scrollTop ){
33
+         this.currentPage++
34
+         this.scrollSize = this.currentPage
35
+        }
36
+        clearTimeout(this.timer)
37
+        this.timer = setTimeout(function () {
38
+          console.log('悬浮按钮状态切换', this.timer)
39
+          _this.type = 2
40
+        }, 800)
41
+        // console.log(this.model)
42
+        if (res.scrollTop > 50) {
43
+          this.isShow = true
44
+        } else {
45
+          this.isShow = false
46
+        }
47
+      }
48
+  }
49
+  

+ 39 - 0
src/common/mixin/index.js

@@ -0,0 +1,39 @@
1
+import Vue from 'vue';
2
+import { Router } from '@/common/utils/index.js';
3
+import { needLoginPages,IMGSOURCE } from '@/common/config.js';
4
+const router = new Router({ needLoginPages });
5
+
6
+Vue.mixin({
7
+	data(){
8
+		return {
9
+			IMGSOURCE
10
+		}
11
+	},
12
+  methods: {
13
+    // 页面跳转
14
+    handleJump(e) {
15
+		console.log(e,88888)
16
+      let target = e.currentTarget || e.target,
17
+        url = target.dataset.url || 'back',
18
+        type = target.dataset.type;
19
+      if (url == '' || url == '#') return;
20
+      switch (type) {
21
+        case 'SWITCH':
22
+          router.switchTab(url);
23
+          break;
24
+        case 'REDIRECT':
25
+          router.redirectTo(url);
26
+          break;
27
+        case 'RELAUNCH':
28
+          router.reLaunch(url);
29
+          break;
30
+        case 'BACK':
31
+          router.navigateBack();
32
+          break;
33
+        default:
34
+          router.navigateTo(url);
35
+          break;
36
+      }
37
+    }
38
+  }
39
+})

+ 99 - 0
src/common/mixin/paging_list.js

@@ -0,0 +1,99 @@
1
+export default {
2
+  data(){
3
+    return {
4
+      allowOnloadGetList: true,               // 是否允许页面onload生命周期进入后立马执行getlist
5
+      minixPagingListsApi: '',                // 接口地址
6
+      pageingListApiMethod: 'post',           // 接口请求方法
7
+      pagingListPage: 1,                      // 分页
8
+      pagingListAllowLoadMore: true,          // 允许加载更多
9
+      pagingListLoadedAll: false,             // 已加载全部数据
10
+      pagingListNoListData: false,            // 没有列表数据,
11
+      isOrder:false,                          // 订单页面
12
+      listData: [],
13
+      isLoadInit: false,                      // 初始化数据之后,若无数据再显示无数据图标
14
+    }
15
+  },
16
+
17
+  computed: {
18
+    listDataLength(){
19
+      return this.listData.length
20
+    }
21
+  },
22
+
23
+  // 下拉刷新
24
+  onPullDownRefresh() {
25
+    uni.stopPullDownRefresh();
26
+    if(this.allowOnloadGetList){
27
+      this.pagingListToggle(()=>{
28
+        // uni.stopPullDownRefresh();
29
+      });
30
+    }else{
31
+      // uni.stopPullDownRefresh();
32
+    }
33
+  },
34
+
35
+
36
+  onLoad(){
37
+    if(this.allowOnloadGetList) this.pagingListGetLists();
38
+  },
39
+
40
+  //上拉加载更多
41
+  onReachBottom() {
42
+    this.pagingListGetLists();
43
+  },
44
+
45
+  methods: {
46
+    // 列表切换
47
+    pagingListToggle(fn){
48
+      this.pagingListPage = 1
49
+      this.pagingListAllowLoadMore = true
50
+      this.pagingListLoadedAll = false
51
+      this.pagingListNoListData = false
52
+      this.listData = []
53
+      if(fn) this.pagingListGetLists(fn);
54
+      else this.pagingListGetLists();
55
+    },
56
+
57
+    // 获取列表数据
58
+    pagingListGetLists(fn){
59
+      console.log(this.pagingListLoadedAll)
60
+      if (!this.pagingListAllowLoadMore || this.pagingListLoadedAll || this.pagingListNoListData) return;
61
+      this.pagingListAllowLoadMore = false;
62
+      let postData = {
63
+        page: this.pagingListPage,
64
+        page_size: global.PAGE_SIZE
65
+      }
66
+      if(this.pagingListPostData) {
67
+        postData = Object.assign({},postData,this.pagingListPostData());
68
+      }
69
+       this.isShowLoading=true
70
+      this.$api[this.pageingListApiMethod](this.minixPagingListsApi, postData).then(res => {
71
+        console.log(res)
72
+        this.isShowLoading=false
73
+        if (res.data.code == 1) {
74
+          if(this.pagingListBeforeResponseData) res.data.data = this.pagingListBeforeResponseData(res);
75
+          let tempLists = res.data.data.data || res.data.data.list,
76
+            totalPage = res.data.data.last_page || 1,
77
+            listData = this.listData;
78
+          if(this.pagingListResponseData) tempLists = this.pagingListResponseData(tempLists);
79
+          this.listData.push(...tempLists);
80
+          this.pagingListAllowLoadMore = true;
81
+          if (this.pagingListPage >= totalPage) this.pagingListLoadedAll = true;
82
+          if (this.pagingListPage == 1 && this.listData.length == 0) this.pagingListNoListData = true;
83
+          this.pagingListPage = this.pagingListPage + 1;
84
+        } else {
85
+          this.pagingListAllowLoadMore = true;
86
+          this.pagingListLoadedAll = true;
87
+          if (this.pagingListPage == 1 && this.listData.length == 0) this.pagingListNoListData = true;
88
+        }
89
+        this.isLoadInit = true;
90
+        if (fn) fn();
91
+      }).catch(err => {
92
+        console.log(err);
93
+        this.isShowLoading=false
94
+        this.pagingListAllowLoadMore = true;
95
+        this.isLoadInit = true;
96
+      })
97
+    }
98
+  }
99
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1463 - 0
src/common/uni.css


+ 16 - 0
src/common/utils/index.js

@@ -0,0 +1,16 @@
1
+import Router from './router.js'
2
+import UploadImage from './upload-image.js'
3
+import UploadFileToQINIU from './upload-file-to-qiniu.js'
4
+import UploadFileToOSS from './upload-file-to-oss.js'
5
+import { message } from './message.js'
6
+import { validate } from './validate.js'
7
+
8
+
9
+export {
10
+  message,
11
+  validate,
12
+  UploadImage,
13
+  UploadFileToQINIU,
14
+  UploadFileToOSS,
15
+  Router
16
+}

+ 51 - 0
src/common/utils/message.js

@@ -0,0 +1,51 @@
1
+const message = {
2
+  success(params) {
3
+    if(typeof params === 'string') params = { content: params };
4
+    uni.showToast({
5
+      title: params.content || '操作成功~',
6
+      icon: 'success',
7
+      duration: params.duration || 1500,
8
+      success: params.resolve
9
+    })
10
+    return true
11
+  },
12
+
13
+  error(params) {
14
+    if(typeof params === 'string') params = { content: params };
15
+    uni.showToast({
16
+      title: params.content,
17
+      icon: 'error',
18
+      duration: params.duration || 1500,
19
+      success: params.resolve
20
+    })
21
+    return true
22
+  },
23
+
24
+  info(params) {
25
+    if(typeof params === 'string') params = { content: params };
26
+    uni.showToast({
27
+      title: params.content || '支付失败',
28
+      icon: 'none',
29
+      // position: 'bottom',
30
+      duration: params.duration || 1500,
31
+      success: params.resolve
32
+    })
33
+    return true
34
+  },
35
+
36
+  tips(params) {
37
+    if(typeof params === 'string') params = { content: params };
38
+    uni.showToast({
39
+      title: params.content || '支付失败',
40
+      icon: 'none',
41
+      // position: 'bottom',
42
+      duration: params.duration || 1500,
43
+      success: params.resolve
44
+    })
45
+    return true
46
+  }
47
+}
48
+
49
+export {
50
+  message
51
+};

+ 77 - 0
src/common/utils/richText.js

@@ -0,0 +1,77 @@
1
+/*
2
+graceUI rich-text 加强工具
3
+link : graceui.hcoder.net
4
+author : 5213606@qq.com 深海
5
+
6
+版权声明 : 
7
+GraceUI 的版权约束是不能转售或者将 GraceUI 直接发布到公开渠道!
8
+侵权必究,请遵守版权约定!
9
+*/
10
+
11
+// 正则变量
12
+var graceRichTextReg;
13
+
14
+// 批量替换的样式 [ 根据项目需求自行设置 ]
15
+var GRT = [
16
+	// div 样式
17
+	['div', "line-height:2em;width:auto;height:auto;"],
18
+	// h1 样式
19
+	['h1', "font-size:3em; line-height:1.5em;"],
20
+	// h2 样式
21
+	['h2', "font-size:2em; line-height:1.8em;"],
22
+	// h3 样式
23
+	['h3', "font-size:1.6em; line-height:2em;"],
24
+	// h4 样式
25
+	['h4', "font-size:1.2em; line-height:2em;"],
26
+	// h5 样式
27
+	['h5', "font-size:1em; line-height:2em;"],
28
+	// h6 样式
29
+	['h6', "font-size:0.9em; line-height:2em;"],
30
+	// p 样式
31
+	['p', "font-size:1em; line-height:2em;"],
32
+	// b 样式
33
+	['b', "font-size:1em; line-height:2em;"],
34
+	// strong 样式
35
+	['strong', "font-size:1em; line-height:2em;"],
36
+	// code 样式
37
+	['code', "font-size:1em; line-height:1.2em; background:#F6F7F8; padding:8px 2%; width:96%;"],
38
+	// img 样式
39
+	['img', "width:100%; display: block;"],
40
+	// blockquote
41
+	['blockquote', "font-size:1em; border-left:3px solid #D1D1D1; line-height:2em; border-radius:5px; background:#F6F7F8; padding:8px 2%;"],
42
+	// li 样式
43
+	['ul', "padding:5px 0; list-style:none; padding:0; margin:0;"],
44
+	['li', "line-height:1.5em; padding:5px 0; list-style:none; padding:0; margin:0; margin-top:10px;"],
45
+	// table
46
+	['table', "width:100%; border-left:1px solid #F2F3F4; border-top:1px solid #F2F3F4;"],
47
+	['th', "border-right:1px solid #F2F3F4; border-bottom:1px solid #F2F3F4;"],
48
+	['td', "border-right:1px solid #F2F3F4; border-bottom:1px solid #F2F3F4; padding-left:5px;"]
49
+];
50
+
51
+
52
+module.exports = {
53
+	format : function(html){
54
+		html = html.replace(/<pre.*pre>?/gis, function(word){
55
+			word =  word.replace(/[\n]/gi,'<br />');
56
+			word =  word.replace(/    /gi,'<span style="padding-left:2em;"></span>');
57
+			return word.replace(/[\t]/gi, '<span style="padding-left:2em;"></span>');
58
+		});
59
+		html = html.replace(/<pre/gi, '<p style="font-size:1em; margin:12px 0; line-height:1.2em; background:#F6F7F8; border-radius:5px; padding:8px 4%; width:92%;"');
60
+		html = html.replace(/<\/pre/gi,"</p");
61
+		for(let i = 0; i < GRT.length; i++){
62
+			graceRichTextReg = new RegExp('<'+GRT[i][0]+'>|<'+GRT[i][0]+' (.*?)>', 'gi');
63
+			html = html.replace(graceRichTextReg , function(word){
64
+				// 分析 dom 上是否带有 style=""
65
+				if(word.indexOf('style=') != -1){
66
+					var regIn = new RegExp('<' + GRT[i][0] + '(.*?)style="(.*?)"(.*?)(/?)>', 'gi');
67
+					return word.replace(regIn, '<'+ GRT[i][0] +'$1style="$2 ' + GRT[i][1] +'"$3$4>');
68
+				}else{
69
+					var regIn = new RegExp('<' + GRT[i][0] + '(.*?)(/?)>', 'gi');
70
+					return word.replace(regIn, '<'+ GRT[i][0] +'$1 style="' + GRT[i][1] +'$2">');
71
+				}
72
+			});
73
+		}
74
+		return html;
75
+	}
76
+	
77
+}

+ 61 - 0
src/common/utils/router.js

@@ -0,0 +1,61 @@
1
+import { LOGIN_PAGE_URL } from '../config.js'
2
+export default class Router {
3
+
4
+  needLoginPages = []
5
+
6
+  constructor(options){
7
+    if(options) this.needLoginPages = options.needLoginPages || [];
8
+
9
+  }
10
+  //此处可优化,必须要有params
11
+  splicingUrl(res){
12
+    return typeof res === 'string' ? res : res.url + '?' + Object.keys(res.params).map(item => `${item}=${res.params[item]}`).join('&')
13
+  }
14
+
15
+  testingNeedLogin(url){
16
+    return this.needLoginPages.findIndex(item => item == url || url.startsWith(item)) != -1
17
+  }
18
+
19
+  getNeedLoginPages(){
20
+    return this.needLoginPages
21
+  }
22
+ 
23
+  switchTab(url){
24
+    url = this.splicingUrl(url)
25
+    if(this.testingNeedLogin(url)){
26
+      if(global.token){
27
+        uni.switchTab({ url });
28
+      }else{
29
+        uni.navigateTo({ url: LOGIN_PAGE_URL })
30
+      }
31
+      return false;
32
+    }
33
+    uni.switchTab({ url });
34
+  }
35
+
36
+  redirectTo(url){
37
+    url = this.splicingUrl(url)
38
+    if(this.testingNeedLogin(url)){
39
+      uni.redirectTo({ url: global.token ? url : LOGIN_PAGE_URL });
40
+      return false;
41
+    }
42
+    uni.redirectTo({ url });
43
+  }
44
+
45
+  reLaunch(url){
46
+    uni.reLaunch({ url });
47
+  }
48
+
49
+  navigateBack(){
50
+    uni.navigateBack();
51
+  }
52
+
53
+  navigateTo(url){
54
+    url = this.splicingUrl(url)
55
+    if(this.testingNeedLogin(url)){
56
+      uni.navigateTo({ url: global.token ? url : LOGIN_PAGE_URL });
57
+      return false;
58
+    }
59
+    uni.navigateTo({ url });
60
+  }
61
+}

+ 70 - 0
src/common/utils/upload-file-to-oss.js

@@ -0,0 +1,70 @@
1
+import { message } from './message.js'
2
+import { http } from '@/common/api/index.js';
3
+
4
+export default class UploadFileToOSS {
5
+
6
+  /**
7
+   * [constructor description]
8
+   * @param  {[Array]} files [chooseImg选中的tempFilePaths、chooseVideo选中的rempFilePath]
9
+   * @param  {[Object]} json  [success每上传成功一张调用 complete全部上传完成调用]
10
+   * @return {[void]}       [description]
11
+   */
12
+
13
+  constructor(files, json) {
14
+    if (!Array.isArray(files)) {
15
+      throw new Error('Class UploadFileToOSS parameter must be an array');
16
+    }
17
+    this.data = [];
18
+    this.fn = json.success;
19
+    this.complete = json.complete;
20
+    this.files = files;
21
+    this.fileLen = this.files.length;
22
+    this.curIndex = 0;
23
+    uni.showLoading({
24
+      title: '上传中'
25
+    });
26
+    this.upload();
27
+  }
28
+
29
+  upload() {
30
+    http.get(global.apiUrls.queryAutograph).then(res => {
31
+      if (res.data.code == 1) {
32
+        let ossData = res.data.data;
33
+        uni.uploadFile({
34
+          url: ossData.host,
35
+          filePath: this.files[this.curIndex],
36
+          name: 'file',
37
+          formData: {
38
+            key: ossData.key,                                                   // 文件名
39
+            policy: ossData.policy,                                             // 后台获取超时时间
40
+            OSSAccessKeyId: ossData.OSSAccessKeyId,                             // 后台获取临时ID
41
+            success_action_status: ossData.success_action_status,               // 让服务端返回200,不然,默认会返回204
42
+            signature: ossData.signature                                        // 后台获取签名
43
+          },
44
+          success: res => {
45
+            console.log(res);
46
+            if(res.statusCode == 200){
47
+              this.data.push({
48
+                id: ossData.key,
49
+                path: ossData.host + '/' + ossData.key
50
+              });
51
+              if (this.fn) this.fn(this.data);
52
+            }else{
53
+              message.info('上传失败,请重试')
54
+            }
55
+          },
56
+          complete: () => {
57
+            this.curIndex ++;                                 // 当前文件执行完上传后,开始上传下一张
58
+            if (this.curIndex == this.fileLen) {              // 当文件传完时,停止调用
59
+              this.complete(this.data);
60
+              uni.hideLoading()
61
+            } else {                                          // 若文件还没有传完,则继续调用函数
62
+              this.upload();
63
+            }
64
+          }
65
+        });
66
+      }
67
+    })
68
+
69
+  }
70
+}

+ 70 - 0
src/common/utils/upload-file-to-qiniu.js

@@ -0,0 +1,70 @@
1
+import { message } from './message.js'
2
+import { http } from '@/common/api/index.js';
3
+
4
+export default class UploadFileToQINIU {
5
+  /**
6
+   * [constructor description]
7
+   * @param  {[Array]} files [chooseImg选中的tempFilePaths、chooseVideo选中的rempFilePath]
8
+   * @param  {[Object]} json  [success每上传成功一张调用 complete全部上传完成调用]
9
+   * @return {[void]}       [description]
10
+   */
11
+
12
+  constructor(files, json) {
13
+    if (!Array.isArray(files)) {
14
+      throw new Error('Class UploadFileToQINIU parameter must be an array');
15
+    }
16
+    this.data = [];
17
+    this.fn = json.success;
18
+    this.complete = json.complete;
19
+    this.files = files;
20
+    this.fileLen = this.files.length;
21
+    this.curIndex = 0;
22
+    uni.showLoading({
23
+      title: '上传中'
24
+    });
25
+    this.upload();
26
+  }
27
+
28
+  upload() {
29
+    http.post(global.apiUrls.postQINIUToken).then(res => {
30
+      console.log(res)
31
+      if (res.data.code == 1) {
32
+        let ossData = res.data.data;
33
+        uni.uploadFile({
34
+          url: 'https://up-z2.qiniup.com',            // 七牛云资源存储地区 默认华南地区
35
+          filePath: this.files[this.curIndex],
36
+          name: 'file',
37
+          formData: {
38
+            key: ossData.fileName,                    // 文件名
39
+            token: ossData.token,                     // token
40
+          },
41
+          success: res => {
42
+            console.log(res);
43
+            if(res.statusCode == 200){
44
+              let videoInfo = JSON.parse(res.data)
45
+              console.log(videoInfo)
46
+              this.data.push({
47
+                id: videoInfo.key,
48
+                path: ossData.baseUrl + videoInfo.key,
49
+                cover: ossData.baseUrl + videoInfo.key + '?vframe/jpg/offset/0'
50
+              });
51
+              if (this.fn) this.fn(this.data);
52
+            }else{
53
+              message.info('视频上传失败,请重试')
54
+            }
55
+          },
56
+          complete: () => {
57
+            this.curIndex ++;                           // 当前文件执行完上传后,开始上传下一张
58
+            if (this.curIndex == this.fileLen) {        // 当文件传完时,停止调用
59
+              this.complete(this.data);
60
+              uni.hideLoading()
61
+            } else {                                    // 若文件还没有传完,则继续调用函数
62
+              this.upload();
63
+            }
64
+          }
65
+        });
66
+      }
67
+    })
68
+
69
+  }
70
+}

+ 58 - 0
src/common/utils/upload-image.js

@@ -0,0 +1,58 @@
1
+import { UPLOAD_IMAGE_URL } from '../config.js'
2
+import { message } from './message.js'
3
+
4
+export default class UploadImg {
5
+  /**
6
+   * [constructor description]
7
+   * @param  {[Array]} files [chooseImg选中的tempFilePaths]
8
+   * @param  {[Object]} json  [success每上传成功一张调用 complete全部上传完成调用]
9
+   * @return {[void]}       [description]
10
+   */
11
+  constructor(files, json) {
12
+    if (!Array.isArray(files)) {
13
+      throw new Error('Class UploadImg parameter must be an array');
14
+    }
15
+    let _this = this;
16
+    _this.data = [];
17
+    _this.fn = json.success;
18
+    _this.complete = json.complete;
19
+    _this.files = files;
20
+    _this.fileLen = _this.files.length;
21
+    _this.curIndex = 0;
22
+    uni.showLoading({
23
+      title: '上传中'
24
+    });
25
+    _this.upload();
26
+  }
27
+
28
+  upload() {
29
+    let _this = this;
30
+    uni.uploadFile({
31
+      url: UPLOAD_IMAGE_URL,
32
+      filePath: this.files[this.curIndex],
33
+      name: 'file',
34
+	  formData: {
35
+	    'module':'',
36
+	    'dir':''
37
+	  },
38
+      success: res => {
39
+        let data = JSON.parse(res.data);
40
+        if (data.code == 1) {
41
+          this.data.push(data.data[0]);
42
+          if (this.fn) this.fn(this.data);
43
+        } else {
44
+          message.info('图片上传失败,请重试')
45
+        }
46
+      },
47
+      complete: () => {
48
+        this.curIndex++;                                    // 这个图片执行完上传后,开始上传下一张
49
+        if (this.curIndex == this.fileLen) {                // 当图片传完时,停止调用
50
+          this.complete(this.data);
51
+          uni.hideLoading()
52
+        } else {                                            // 若图片还没有传完,则继续调用函数
53
+          this.upload();
54
+        }
55
+      }
56
+    });
57
+  }
58
+}

+ 211 - 0
src/common/utils/utils.js

@@ -0,0 +1,211 @@
1
+import { LOGIN_PAGE_URL } from '../config.js';
2
+import throttle from '../function/throttle.js';
3
+import debounce from '../function/debounce.js';
4
+import timeFormat from '../function/timeFormat.js';
5
+import timeFrom from '../function/timeFrom.js';
6
+import deepClone from '../function/deepClone.js';
7
+
8
+
9
+/**
10
+ * @description showModal 弹窗封装
11
+ * @param {Object} options = 参数同 uni-app 官方用法
12
+ * */
13
+function showModal(options){
14
+  // #ifndef APP-PLUS
15
+  uni.showModal(options);
16
+  // #endif
17
+  // #ifdef APP-PLUS
18
+  if(uni.getSystemInfoSync().platform === 'android'){
19
+    global.$showModal(options)
20
+    .then(res => {
21
+    	console.log('RES',res);
22
+    	//确认
23
+    }).catch(err => {
24
+    	//取消
25
+    	console.log('ERR',err);
26
+    })
27
+  }else{
28
+    uni.showModal(options);
29
+  }
30
+  // #endif
31
+}
32
+
33
+/**
34
+ * @description 验证登录权限,接受一个回调函数,登录则执行回调函数,非登录状态则跳转登录页
35
+ * @param {Function} cb = 回调函数
36
+ * */
37
+function actionAuth(cb) {
38
+  if (global.token) {
39
+    cb && cb();
40
+  } else {
41
+    navigateToLogin();
42
+  }
43
+}
44
+
45
+/**
46
+ * @description 判断是app端还是小程序端登录
47
+ * */
48
+function navigateToLogin() {
49
+  const pages = getCurrentPages();
50
+  if(pages.length != 0){
51
+  	  const lastPage = '/' + pages.pop().route;
52
+  	  let url = LOGIN_PAGE_URL;
53
+  	  if (lastPage == url) return;
54
+  	  uni.navigateTo({
55
+  	    url
56
+  	  });
57
+  }else{
58
+  	  uni.switchTab({
59
+  	  	url: '/pagesA/tab/home/shopindex'
60
+  	  })
61
+  }
62
+}
63
+
64
+/**
65
+ * @description 倒计时计算
66
+ * */
67
+function downTime(time) {
68
+  var days = parseInt(time / (1000 * 60 * 60 * 24));
69
+  var hours = parseInt(time / (1000 * 60 * 60) % 24);
70
+  var minutes = parseInt(time / (1000 * 60) % 60);
71
+  var seconds = parseInt(time / 1000 % 60);
72
+  return {
73
+    days,
74
+    hours: hours < 10 ? '0' + hours : hours,
75
+    minutes: minutes < 10 ? '0' + minutes : minutes,
76
+    seconds: seconds < 10 ? '0' + seconds : seconds,
77
+  }
78
+}
79
+
80
+/**
81
+ * @description 参数序列化
82
+ * */
83
+function serialize(data) {
84
+  let str = '';
85
+  Object.keys(data).forEach(key => {
86
+    str += key + '=' + data[key] + '&'
87
+  })
88
+  str = str.substr(0, str.length - 1);
89
+  return str;
90
+}
91
+
92
+
93
+/**
94
+ * @description 设置状态栏颜色
95
+ * @param {String} color dark or light
96
+ * @example this.$util.setNavigationBarColor('dark');
97
+ * */
98
+function setNavigationBarColor(color) {
99
+  if (color == 'dark') {
100
+    // #ifdef APP-PLUS
101
+    plus.navigator.setStatusBarStyle('dark');
102
+    // #endif
103
+    // #ifdef MP-WEIXIN
104
+    wx.setNavigationBarColor({
105
+      frontColor: '#000000',
106
+      backgroundColor: '#FFFFFF'
107
+    })
108
+    // #endif
109
+  } else if (color == 'light') {
110
+    // #ifdef APP-PLUS
111
+    plus.navigator.setStatusBarStyle('light');
112
+    // #endif
113
+    // #ifdef MP-WEIXIN
114
+    wx.setNavigationBarColor({
115
+      frontColor: '#FFFFFF',
116
+      backgroundColor: '#000000'
117
+    })
118
+    // #endif
119
+  }
120
+}
121
+
122
+/**
123
+ * base64图片缓存到本地,返回本地路径
124
+ * */
125
+function base64ToPath(base64) {
126
+  return new Promise(function(resolve, reject) {
127
+    if (typeof window === 'object' && 'document' in window) {
128
+      base64 = base64.split(',')
129
+      var type = base64[0].match(/:(.*?);/)[1]
130
+      var str = atob(base64[1])
131
+      var n = str.length
132
+      var array = new Uint8Array(n)
133
+      while (n--) {
134
+        array[n] = str.charCodeAt(n)
135
+      }
136
+      return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], {
137
+        type: type
138
+      })))
139
+    }
140
+    var extName = base64.match(/data\:\S+\/(\S+);/)
141
+    if (extName) {
142
+      extName = extName[1]
143
+    } else {
144
+      reject(new Error('base64 error'))
145
+    }
146
+    var fileName = Date.now() + '.' + extName
147
+    if (typeof plus === 'object') {
148
+      var bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now())
149
+      bitmap.loadBase64Data(base64, function() {
150
+        var filePath = '_doc/uniapp_temp/' + fileName
151
+        bitmap.save(filePath, {}, function() {
152
+          bitmap.clear()
153
+          resolve(filePath)
154
+        }, function(error) {
155
+          bitmap.clear()
156
+          reject(error)
157
+        })
158
+      }, function(error) {
159
+        bitmap.clear()
160
+        reject(error)
161
+      })
162
+      return
163
+    }
164
+    if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
165
+      var filePath = wx.env.USER_DATA_PATH + '/' + fileName
166
+      wx.getFileSystemManager().writeFile({
167
+        filePath: filePath,
168
+        data: base64.replace(/^data:\S+\/\S+;base64,/, ''),
169
+        encoding: 'base64',
170
+        success: function() {
171
+          resolve(filePath)
172
+        },
173
+        fail: function(error) {
174
+          reject(error)
175
+        }
176
+      })
177
+      return
178
+    }
179
+    reject(new Error('not support'))
180
+  })
181
+}
182
+
183
+
184
+// module.exports = {
185
+//   actionAuth,
186
+//   navigateToLogin,
187
+//   serialize,
188
+//   debounce,
189
+//   throttle,
190
+//   timeFormat,
191
+//   timeFrom,
192
+//   deepClone,
193
+//   downTime,
194
+//   setNavigationBarColor,
195
+//   base64ToPath,
196
+//   showModal,
197
+// }
198
+export {
199
+    actionAuth,
200
+  navigateToLogin,
201
+  serialize,
202
+  debounce,
203
+  throttle,
204
+  timeFormat,
205
+  timeFrom,
206
+  deepClone,
207
+  downTime,
208
+  setNavigationBarColor,
209
+  base64ToPath,
210
+  showModal,
211
+}

+ 93 - 0
src/common/utils/validate.js

@@ -0,0 +1,93 @@
1
+const validate = (value, vtype) => {
2
+  if ('require' === vtype) {
3
+    return !!value;
4
+  }
5
+  if ('phone' === vtype) {
6
+    return /^1[2-9]\d{9}$/.test(value);
7
+  }
8
+  // 验证码
9
+  if ('captcha' === vtype) {
10
+    return /^[0-9]{6}$/.test(value);
11
+  }
12
+  // 不知道干啥的
13
+  if ('isnumber' === vtype) {
14
+    return /^[0-9]{5,11}$/.test(value);
15
+  }
16
+  if ('isqq' === vtype) {
17
+    return /^[1-9][0-9]{4,10}$/.test(value);
18
+  }
19
+  // 身份证号码验证不准确
20
+  if ('idcard' === vtype) {
21
+    return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value);
22
+  }
23
+  if ('password' === vtype) {
24
+    return /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9a-zA-Z]{6,12}$/.test(value);
25
+  }
26
+  // 邀请码验证
27
+  if ('invitecode' === vtype) {
28
+    return /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9a-zA-Z]$/.test(value);
29
+  }
30
+  // 判断不准确 比如123.
31
+  if ('ismoney' === vtype) {
32
+    return /^(([1-9]\d*)|\d)(\.\d{1,2})?$/.test(value);
33
+  }
34
+  if ('email' === vtype) {
35
+    return /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);
36
+  }
37
+  if ('url' === vtype) {
38
+    return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value);
39
+  }
40
+  // 银行卡验证
41
+  if ('card' === vtype) {
42
+    let bankno = value;
43
+    let lastNum = bankno.substr(bankno.length - 1, 1); //取出最后一位(与luhm进行比较)
44
+    let first15Num = bankno.substr(0, bankno.length - 1); //前15或18位
45
+    let newArr = [];
46
+
47
+    // 前15或18位倒序存进数组
48
+    for (let i = first15Num.length - 1; i > -1; i--) newArr.push(first15Num.substr(i, 1));
49
+
50
+    let arrJiShu = []; // 奇数位*2的积 <9
51
+    let arrJiShu2 = []; // 奇数位*2的积 >9
52
+    let arrOuShu = []; // 偶数位数组
53
+    for (let j = 0; j < newArr.length; j++) {
54
+      if ((j + 1) % 2 == 1) { //奇数位
55
+        if (parseInt(newArr[j]) * 2 < 9) arrJiShu.push(parseInt(newArr[j]) * 2);
56
+        else arrJiShu2.push(parseInt(newArr[j]) * 2);
57
+      } else  arrOuShu.push(newArr[j]); // 偶数位
58
+    }
59
+
60
+    let jishu_child1 = []; //奇数位*2 >9 的分割之后的数组个位数
61
+    let jishu_child2 = []; //奇数位*2 >9 的分割之后的数组十位数
62
+    for (let h = 0; h < arrJiShu2.length; h++) {
63
+      jishu_child1.push(parseInt(arrJiShu2[h]) % 10);
64
+      jishu_child2.push(parseInt(arrJiShu2[h]) / 10);
65
+    }
66
+
67
+    let sumJiShu = 0; //奇数位*2 < 9 的数组之和
68
+    let sumOuShu = 0; //偶数位数组之和
69
+    let sumJiShuChild1 = 0; //奇数位*2 >9 的分割之后的数组个位数之和
70
+    let sumJiShuChild2 = 0; //奇数位*2 >9 的分割之后的数组十位数之和
71
+    let sumTotal = 0;
72
+
73
+    for (let m = 0; m < arrJiShu.length; m++) sumJiShu = sumJiShu + parseInt(arrJiShu[m]);
74
+    for (let n = 0; n < arrOuShu.length; n++) sumOuShu = sumOuShu + parseInt(arrOuShu[n]);
75
+
76
+    for (let p = 0; p < jishu_child1.length; p++) {
77
+      sumJiShuChild1 = sumJiShuChild1 + parseInt(jishu_child1[p]);
78
+      sumJiShuChild2 = sumJiShuChild2 + parseInt(jishu_child2[p]);
79
+    }
80
+
81
+    //计算总和
82
+    sumTotal = parseInt(sumJiShu) + parseInt(sumOuShu) + parseInt(sumJiShuChild1) + parseInt(sumJiShuChild2);
83
+
84
+    //计算Luhm值
85
+    let k = parseInt(sumTotal) % 10 == 0 ? 10 : parseInt(sumTotal) % 10;
86
+    let luhm = 10 - k;
87
+    return lastNum == luhm;
88
+  }
89
+}
90
+
91
+export {
92
+  validate
93
+};

+ 168 - 0
src/components/Authorize.vue

@@ -0,0 +1,168 @@
1
+<template>
2
+	<view>
3
+		<view class='Popup' v-if='isShowAuth'>
4
+			<view class="logo-auth">
5
+				 <image :src='logoUrl' mode="aspectFit"></image>
6
+			</view>
7
+		   <view class='title'>授权提醒</view>
8
+		   <view class='tip'>请授权头像等信息,以便为您提供更好的服务</view>
9
+		   <view class='bottom flex'>
10
+		      <view class='item' @click='close'>随便逛逛</view>
11
+			<!--  #ifdef APP-PLUS
12
+			  <button class='item grant' @click="setUserInfo">去授权</button>
13
+			#endif -->
14
+			  <!-- #ifdef MP -->
15
+			  <button class='item grant'  type="primary" open-type="getUserInfo" lang="zh_CN" @getuserinfo="setUserInfo">去授权</button>
16
+			  <!-- #endif -->
17
+		  </view>
18
+		</view>
19
+		<view class='mask' v-if='isShowAuth' @click='close'></view>
20
+	</view>
21
+</template>
22
+
23
+<script>
24
+	const app = getApp();
25
+	import Cache from '../utils/cache';
26
+	import { getLogo } from '../api/public';
27
+	import { LOGO_URL } from '../config/cache';
28
+	import { mapGetters } from 'vuex';
29
+	import Routine from '../libs/routine';
30
+	
31
+	export default {
32
+		name:'Authorize',
33
+		props:{
34
+			isAuto:{
35
+				type:Boolean,
36
+				default:true
37
+			},
38
+			isGoIndex:{
39
+				type:Boolean,
40
+				default:true
41
+			},
42
+			isShowAuth:{
43
+				type:Boolean,
44
+				default:false
45
+			}
46
+		},
47
+		data(){
48
+			return {
49
+				logoUrl:''
50
+			}
51
+		},
52
+		computed:mapGetters(['isLogin','userInfo']),
53
+		watch:{
54
+			isLogin(n){
55
+				n === true && this.$emit('onLoadFun',this.userInfo);
56
+			}
57
+		},
58
+		created() {
59
+			this.getLogoUrl();
60
+			this.setAuthStatus();
61
+		},
62
+		methods:{
63
+			setAuthStatus(){
64
+				Routine.authorize().then(res=>{
65
+					
66
+					if(res.islogin === false)
67
+						this.setUserInfo();
68
+					else
69
+						this.$emit('onLoadFun',this.userInfo);
70
+				}).catch(res=>{
71
+					if (this.isAuto) 
72
+						this.$emit('authColse',true);
73
+				})
74
+			},
75
+			getUserInfo(code){
76
+				Routine.getUserInfo().then(res=>{
77
+					let userInfo = res.userInfo
78
+					userInfo.code = code;
79
+					userInfo.spread_spid = app.globalData.spid;//获取推广人ID
80
+					userInfo.spread_code = app.globalData.code;//获取推广人分享二维码ID
81
+					Routine.authUserInfo(userInfo).then(res=>{
82
+						uni.hideLoading();
83
+						this.$emit('authColse',false);
84
+						this.$emit('onLoadFun',this.userInfo);
85
+					}).catch(res=>{
86
+						uni.hideLoading();
87
+						uni.showToast({
88
+							title:res.msg,
89
+							icon:'none',
90
+							duration:2000
91
+						});
92
+					})
93
+				}).catch(res =>{
94
+					uni.hideLoading();
95
+				})
96
+			},
97
+			setUserInfo(){
98
+				uni.showLoading({title:'正在登录中'});
99
+				Routine.getCode().then(code=>{
100
+					console.log(code,'GGGGGGGGGGGGG');
101
+					uni.navigateTo({
102
+						url:"/pages/users/login/index?key=4"
103
+					})
104
+					this.getUserInfo(code);
105
+				}).catch(res=>{
106
+					uni.hideLoading();
107
+				})
108
+			},
109
+			getLogoUrl(){
110
+				this.logoUrl = app.globalData.site_logo
111
+				// let that = this;
112
+				// if (Cache.has(LOGO_URL)) {
113
+				// 	this.logoUrl = Cache.get(LOGO_URL);
114
+				// 	return;
115
+				// }
116
+				// getLogo().then(res=>{
117
+				// 	that.logoUrl = res.data.logo_url
118
+				// 	Cache.set(LOGO_URL,that.logoUrl);
119
+				// })
120
+			},
121
+			close(){
122
+				let pages = getCurrentPages(), currPage  = pages[pages.length - 1];
123
+				if(this.isGoIndex){
124
+					uni.switchTab({url:'/pages/index/index'});
125
+				} else {
126
+					this.$emit('authColse',false);
127
+				}
128
+				// if (currPage && currPage.isShowAuth != undefined){
129
+				// 	currPage.isShowAuth = true;
130
+				// }
131
+			},
132
+		}
133
+	}
134
+ </script> 
135
+
136
+ <style scoped lang='scss'>
137
+	.Popup{width:500rpx;background-color:#fff;position:fixed;top:50%;left:50%;margin-left:-250rpx;transform:translateY(-50%);z-index:320;}
138
+	.Popup{
139
+		.logo-auth{
140
+			z-index: -1;
141
+			position: absolute;
142
+			left: 50%;
143
+			top: 0%;
144
+			transform: translate(-50%,-50%);
145
+			width:150rpx;
146
+			height:150rpx;
147
+			display:flex;
148
+			align-items: center;
149
+			justify-content: center;
150
+			border: 8rpx solid #fff;
151
+			border-radius: 50%;
152
+			background: #fff;
153
+		}
154
+		image{
155
+				height: 42rpx;
156
+				margin-top: -54rpx;
157
+			}
158
+	}
159
+	
160
+	.Popup .title{font-size:28rpx;color:#000;text-align:center;margin-top: 30rpx}
161
+	.Popup .tip{font-size:22rpx;color:#555;padding:0 24rpx;margin-top:25rpx;}
162
+	.Popup .bottom .item{width:50%;height:80rpx;background-color:#eeeeee;text-align:center;line-height:80rpx;font-size:24rpx;color:#666;margin-top:54rpx;}
163
+	.Popup .bottom .item.on{width: 100%}
164
+	.flex{display:flex;}
165
+	.Popup .bottom .item.grant{font-size:28rpx;color:#fff;font-weight:bold;background-color:#e93323;border-radius:0;padding:0;}
166
+	.mask{position:fixed;top:0;right:0;left:0;bottom:0;background-color:rgba(0,0,0,0.65);z-index:310;}
167
+	
168
+</style>

+ 204 - 0
src/components/Commodity.vue

@@ -0,0 +1,204 @@
1
+<template>
2
+	<view>
3
+		<!-- {{reciveUserInfo}} -->
4
+		<view class="sticky-box">
5
+			<!-- 滑动区域 -->
6
+			<scroll-view class="scroll-view_H" style="width: 100%;" scroll-x="true" scroll-with-animation :scroll-left="tabsScrollLeft"
7
+			 @scroll="scroll">
8
+				<view  class="tab" id="tab_list">
9
+					
10
+					<view :class="{ 'active': listActive == -1,'tab__item':true}"
11
+					 :key="-1" @click="clickSort(-1,-1)">
12
+						全部
13
+					</view>
14
+					<view id="itemlist" :class="{ 'active': listActive == index,'tab__item':true}" v-for="(item, index) in listArr"
15
+					 :key="index" @click="clickSort(item.store_category_id,index)">
16
+						{{item.cate_name}}
17
+					</view>
18
+				</view>
19
+			
20
+			</scroll-view>
21
+			<!-- 全部按钮 -->
22
+			<!-- <view class="listAll">
23
+		        <image src="../../static/images/all_filter.png" style="width: 36rpx; height: 36rpx;" mode="aspectFill"></image>
24
+		        全部
25
+		    </view> -->
26
+		</view>
27
+	</view>
28
+</template>
29
+
30
+<script>
31
+	import {
32
+		categoryList,
33
+	} from "@/api/api.js";
34
+	export default {
35
+		props:['reciveUserInfo'],
36
+		data() {
37
+			return {
38
+				listArr: [],
39
+				listActive: -1, // 当前选中项
40
+				tabsScrollLeft: 0, // tabs当前偏移量
41
+				scrollLeft: 0,
42
+				lineStyle: {}, // 下划线位置--动态甲酸
43
+				duration: 0.2, // 下划线动画时长
44
+				itemId: ''
45
+			};
46
+		},
47
+		watch: {
48
+			listActive(newVal) {
49
+				// 监听当前选中项
50
+				this.setTabList()
51
+			}
52
+		},
53
+
54
+		mounted() {
55
+			this.getmercat();
56
+			// this.setTabList(); //计算css
57
+		},
58
+		created() {
59
+			console.log('接收的父传值',this.pendata);
60
+			//进入页面传入父组件的默认参数是0
61
+			this.$emit("gettabs", this.listActive)
62
+		},
63
+		methods: {
64
+			//志愿者分类
65
+			getmercat() {
66
+				categoryList({mer_id: uni.getStorageSync("tenantID")}).then(res => {
67
+					console.log(res);
68
+					this.listArr = res.data
69
+				})
70
+			},
71
+			//点击分类
72
+			clickSort(item, index) {
73
+				this.listActive = index
74
+				
75
+				this.itemId = item //获取当前点击的id
76
+				
77
+				this.$emit("gettabs", this.itemId) // 传给父组件的当前分类的id
78
+				// console.log('接收的父传值',this.pendata,'当前点击的是==', this.itemId);
79
+			},
80
+			// scroll-view滑动事件
81
+			scroll(e) {
82
+				this.scrollLeft = e.detail.scrollLeft;
83
+			},
84
+			//nexttick 是dom更新后
85
+			setTabList() {
86
+				this.$nextTick(() => {
87
+					this.setLine(); //计算下划线
88
+					this.scrollIntoView(); //计算tabs的位置
89
+				})
90
+			},
91
+			// 计算tabs位置
92
+			scrollIntoView() { // item滚动
93
+				let lineLeft = 0;
94
+				this.getElementData('#tab_list', (data) => {
95
+					// console.log(data[0],'data');
96
+					let list = data[0]
97
+					this.getElementData(`#itemlist`, (data) => {
98
+						// console.log(data,'data2');
99
+						let el = data[this.listActive]
100
+						// console.log(el,'elelelelel');
101
+						lineLeft = el.width / 2 + (-list.left) + el.left - list.width / 2 - this.scrollLeft
102
+						this.tabsScrollLeft = this.scrollLeft + lineLeft
103
+					})
104
+				})
105
+			},
106
+			//  计算下划线位置
107
+			setLine() {
108
+				let lineWidth = 0,
109
+					lineLeft = 0
110
+				this.getElementData(`#itemlist`, (data) => {
111
+					console.log(data, 'data132');
112
+					let el = data[this.listActive]
113
+					lineWidth = el.width / 2
114
+					// lineLeft = el.width * (this.currentIndex + 0.5)  // 此种只能针对每个item长度一致的
115
+					lineLeft = el.width / 2 + (-data[0].left) + el.left
116
+					this.lineStyle = {
117
+						width: `${lineWidth}px`,
118
+						transform: `translateX(${lineLeft}px) translateX(-50%)`,
119
+						transitionDuration: `${this.duration}s`
120
+					};
121
+				})
122
+			},
123
+			getElementData(el, callback) {
124
+				uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
125
+					callback(data[0]);
126
+				});
127
+			},
128
+		},
129
+	}
130
+	// }
131
+</script>
132
+
133
+<style scoped lang="scss">
134
+	.sticky-box {
135
+		/* #ifndef APP-PLUS-NVUE */
136
+		display: flex;
137
+		position: -webkit-sticky;
138
+		/* #endif */
139
+		position: sticky;
140
+		top: var(--window-top);
141
+		// z-index: ;
142
+		flex-direction: row;
143
+		margin: 0px;
144
+		border-top: 1px #f9f9f9 solid;
145
+		border-bottom: 1px #f9f9f9 solid;
146
+		background: #fff;
147
+	}
148
+
149
+	.listAll {
150
+		width: 20%;
151
+		text-indent: 62rpx;
152
+		font-size: 30rpx;
153
+		border-left: 1px #eee solid;
154
+		margin: 1% 0;
155
+		padding: 5rpx;
156
+		position: relative;
157
+
158
+		image {
159
+			position: absolute;
160
+			left: 20rpx;
161
+			top: 8rpx;
162
+		}
163
+	}
164
+
165
+	.tab {
166
+		position: relative;
167
+		display: flex;
168
+		font-size: 28rpx;
169
+		padding-bottom: 10rpx;
170
+		white-space: nowrap;
171
+
172
+		&__item {
173
+			flex: 1;
174
+			padding: 0 20rpx;
175
+			text-align: center;
176
+			height: 60rpx;
177
+			line-height: 60rpx;
178
+			color: #666;
179
+
180
+			&.active {
181
+				color: #09C2C9;
182
+				border-bottom: 1px #09C2C9 solid;
183
+			}
184
+		}
185
+	}
186
+
187
+	.tab__line {
188
+		display: block;
189
+		height: 6rpx;
190
+		position: absolute;
191
+		bottom: 0;
192
+		left: 0;
193
+		z-index: 1;
194
+		border-radius: 3rpx;
195
+		position: relative;
196
+		background: #2FC6CD;
197
+	}
198
+
199
+	.scroll-view_H {
200
+		/* 文本不会换行,文本会在在同一行上继续,直到遇到 <br> 标签为止。 */
201
+		white-space: nowrap;
202
+		width: 100%;
203
+	}
204
+</style>

+ 138 - 0
src/components/ben-share/ben-share.vue

@@ -0,0 +1,138 @@
1
+<template>
2
+	<uni-popup ref="share" type="bottom" :maskClick="false">
3
+		<view class="wrap">
4
+			<view class="flex">
5
+				<view class="flex-sub text-center">分享到</view>
6
+				<view class="cuIcon-close" @tap.stop="closePopup"></view>
7
+			</view>
8
+			<view class="padding-tb border-top">
9
+				<view class="grid col-2">
10
+					<block v-for="(item,index) in shareList" :key="index">
11
+						<view class="flex flex-direction align-center justify-center" @tap.stop="share(item)">
12
+							<image class="block-85" :src="item.icon" mode="aspectFill"></image>
13
+							<view class="margin-top text-sm">{{item.title}}</view>
14
+						</view>
15
+					</block>
16
+				</view>
17
+			</view>
18
+		</view>
19
+	</uni-popup>
20
+</template>
21
+
22
+<script>
23
+	import uniPopup from "@/components/uni-popup/uni-popup.vue";
24
+	const share_list = [
25
+		{
26
+			title: '微信好友',
27
+			icon: 'http://app.yikeshangcheng.com/statis/images/share/weixin.png',
28
+			type: 'weixin',
29
+			scene: 'WXSceneSession'
30
+		},
31
+		{
32
+			title: '朋友圈',
33
+			icon:  'http://app.yikeshangcheng.com/statis/images/share/pengyouquan.png',
34
+			type: 'weixin',
35
+			scene: 'WXSenceTimeline'
36
+		}
37
+	];
38
+	export default {
39
+		components: { 
40
+			uniPopup
41
+		},
42
+		props: {
43
+			show: {
44
+				type: Boolean,
45
+				default(){
46
+					return false
47
+				}
48
+			},
49
+			info: {
50
+				type: Object,
51
+				default(){
52
+					return {}
53
+				}
54
+			}
55
+		},
56
+		data(){
57
+			return {
58
+				shareList: Object.freeze(share_list), // 服务供应商列表
59
+				provider: [], // 已配置的服务供应商
60
+			}
61
+		},
62
+		watch: {
63
+			show(val){
64
+				if(val){
65
+					this.$refs['share'].open();
66
+				}else{
67
+					this.$refs['share'].close();
68
+				}
69
+			}
70
+		},
71
+		methods: {
72
+			// 关闭弹窗
73
+			closePopup(){
74
+				this.$parent.shareShow = false;
75
+			},
76
+			// 获取服务商列表
77
+			getProvider(){
78
+				uni.getProvider({
79
+					service: "share",
80
+					success: (data) => {
81
+						this.provider = data.provider;
82
+					}
83
+				})
84
+			},
85
+			// 分享
86
+			share(item){
87
+				let _scene = '';
88
+				let _type = item.type;
89
+				if(_type === 'weixin'){
90
+					_scene = item.scene
91
+				}else if(_type === 'link'){
92
+					uni.setClipboardData({
93
+					    data: this.info.href,
94
+					    success: () => {
95
+							uni.showToast({
96
+								icon:'success',
97
+								title: '复制成功'
98
+							})
99
+							this.closePopup();
100
+					    }
101
+					});
102
+					return ;
103
+				}
104
+				uni.share({
105
+					provider: _type,
106
+					title: this.info.title,
107
+					scene: _scene,
108
+					href: this.info.href,
109
+				    imageUrl: this.info.imageUrl,
110
+					success: (res) => {
111
+						this.closePopup();
112
+				    },
113
+					fail: (err) => {
114
+						uni.showToast({
115
+							icon: 'none',
116
+							title: '分享失败,请检查是否安装了相应软件',
117
+						})
118
+					}
119
+				});
120
+			}
121
+		},
122
+		created() {
123
+			this.getProvider();
124
+		}
125
+	}
126
+</script>
127
+
128
+<style lang="scss">
129
+	.block-85{
130
+		width: 80upx;
131
+		height: 80upx;
132
+	}
133
+	.border-top{
134
+		padding-bottom: 200rpx;
135
+		margin-top: 32rpx;
136
+		border-top: 1rpx solid #eee;
137
+	}
138
+</style>

+ 157 - 0
src/components/ben-share/ben-share1.vue

@@ -0,0 +1,157 @@
1
+<template>
2
+	<uni-popup ref="share" type="bottom" :maskClick="false">
3
+		<view class="wrap">
4
+			<view class="flex">
5
+				<view class="flex-sub text-center">分享到</view>
6
+				<view class="cuIcon-close" @tap.stop="closePopup"></view>
7
+			</view>
8
+			<view class="padding-tb">
9
+				<view class="grid col-4">
10
+					<block v-for="(item,index) in shareList" :key="index">
11
+						<view class="height-200 flex flex-direction align-center justify-center" @tap.stop="share(item)">
12
+							<image class="block-85" :src="item.icon" mode="aspectFill"></image>
13
+							<view class="margin-top-xs text-sm">{{item.title}}</view>
14
+						</view>
15
+					</block>
16
+				</view>
17
+			</view>
18
+		</view>
19
+	</uni-popup>
20
+</template>
21
+
22
+<script>
23
+	import uniPopup from "@/components/uni-popup/uni-popup.vue";
24
+	const share_list = [
25
+		{
26
+			title: '微信好友',
27
+			icon: 'http://app.yikeshangcheng.com/statis/images/share/weixin.png',
28
+			type: 'weixin',
29
+			scene: 'WXSceneSession'
30
+		},
31
+		{
32
+			title: '朋友圈',
33
+			icon:  'http://app.yikeshangcheng.com/statis/images/share/pengyouquan.png',
34
+			type: 'weixin',
35
+			scene: 'WXSenceTimeline'
36
+		},
37
+		// {
38
+		// 	title: '新浪微博',
39
+		// 	icon: require('http://app.yikeshangcheng.com/statis/images/share/weibo.png'),
40
+		// 	type: 'sinaweibo',
41
+		// },
42
+		// {
43
+		// 	title: 'QQ好友',
44
+		// 	icon: require('http://app.yikeshangcheng.com/statis/images/share/qq.png'),
45
+		// 	type: 'qq'
46
+		// },
47
+		// {
48
+		// 	title: 'QQ空间',
49
+		// 	icon: require('http://app.yikeshangcheng.com/statis/images/share/kongjian.png'),
50
+		// 	type: 'qq'
51
+		// },
52
+		// {
53
+		// 	title: '复制链接',
54
+		// 	icon: require('http://app.yikeshangcheng.com/statis/images/share/copy.png'),
55
+		// 	type: 'link'
56
+		// }
57
+	];
58
+	export default {
59
+		components: {
60
+			uniPopup
61
+		},
62
+		props: {
63
+			show: {
64
+				type: Boolean,
65
+				default(){
66
+					return false
67
+				}
68
+			},
69
+			info: {
70
+				type: Object,
71
+				default(){
72
+					return {}
73
+				}
74
+			}
75
+		},
76
+		data(){
77
+			return {
78
+				shareList: Object.freeze(share_list), // 服务供应商列表
79
+				provider: [], // 已配置的服务供应商
80
+			}
81
+		},
82
+		watch: {
83
+			show(val){
84
+				if(val){
85
+					this.$refs['share'].open();
86
+				}else{
87
+					this.$refs['share'].close();
88
+				}
89
+			}
90
+		},
91
+		methods: {
92
+			// 关闭弹窗
93
+			closePopup(){
94
+				this.$emit('callback');
95
+			},
96
+			// 获取服务商列表
97
+			getProvider(){
98
+				uni.getProvider({
99
+					service: "share",
100
+					success: (data) => {
101
+						this.provider = data.provider;
102
+					}
103
+				})
104
+			},
105
+			// 分享
106
+			share(item){
107
+				let _scene = '';
108
+				let _type = item.type;
109
+				if(_type === 'weixin'){
110
+					_scene = item.scene
111
+				}else if(_type === 'link'){
112
+					uni.setClipboardData({
113
+					    data: this.info.href,
114
+					    success: () => {
115
+							uni.showToast({
116
+								icon:'success',
117
+								title: '复制成功'
118
+							})
119
+							this.closePopup();
120
+					    }
121
+					});
122
+					return ;
123
+				}
124
+				uni.share({
125
+					provider: _type,
126
+					// title: this.info.title,
127
+					scene: _scene,
128
+					type: 2,
129
+					// href: this.info.href,
130
+				    imageUrl: this.info.imageUrl,
131
+					success: (res) => {
132
+						this.closePopup();
133
+				    },
134
+					fail: (err) => {
135
+						uni.showToast({
136
+							icon: 'none',
137
+							title: '分享失败,请检查是否安装了相应软件',
138
+						})
139
+					}
140
+				});
141
+			}
142
+		},
143
+		created() {
144
+			this.getProvider();
145
+		}
146
+	}
147
+</script>
148
+
149
+<style lang="scss">
150
+	.block-85{
151
+		width: 85upx;
152
+		height: 85upx;
153
+	}
154
+	.height-200{
155
+		height: 200upx;
156
+	}
157
+</style>

+ 121 - 0
src/components/countDown/index.vue

@@ -0,0 +1,121 @@
1
+<template>
2
+	<view class="time" :style="justifyLeft">
3
+		<text class="red" v-if="tipText">{{ tipText }}</text>
4
+		<text class="styleAll" v-if="isDay === true">{{ day }}</text>
5
+		<text class="timeTxt red" v-if="dayText">{{ dayText }}</text>
6
+		<text class="styleAll">{{ hour }}</text>
7
+		<text class="timeTxt red" v-if="hourText">{{ hourText }}</text>
8
+		<text class="styleAll">{{ minute }}</text>
9
+		<text class="timeTxt red" v-if="minuteText">{{ minuteText }}</text>
10
+		<text class="styleAll">{{ second }}</text>
11
+		<text class="timeTxt red" v-if="secondText">{{ secondText }}</text>
12
+	</view>
13
+</template>
14
+
15
+<script>
16
+	export default {
17
+		name: "countDown",
18
+		props: {
19
+			justifyLeft: {
20
+				type: String,
21
+				default: ""
22
+			},
23
+			//距离开始提示文字
24
+			tipText: {
25
+				type: String,
26
+				default: "倒计时"
27
+			},
28
+			dayText: {
29
+				type: String,
30
+				default: "天"
31
+			},
32
+			hourText: {
33
+				type: String,
34
+				default: "时"
35
+			},
36
+			minuteText: {
37
+				type: String,
38
+				default: "分"
39
+			},
40
+			secondText: {
41
+				type: String,
42
+				default: "秒"
43
+			},
44
+			datatime: {
45
+				type: Number,
46
+				default: 0
47
+			},
48
+			isDay: {
49
+				type: Boolean,
50
+				default: true
51
+			}
52
+		},
53
+		data: function() {
54
+			return {
55
+				day: "00",
56
+				hour: "00",
57
+				minute: "00",
58
+				second: "00"
59
+			};
60
+		},
61
+		created: function() {
62
+			this.show_time();
63
+		},
64
+		mounted: function() {},
65
+		methods: {
66
+			show_time: function() {
67
+				let that = this;
68
+
69
+				function runTime() {
70
+					//时间函数
71
+					let intDiff = that.datatime - Date.parse(new Date()) / 1000; //获取数据中的时间戳的时间差;
72
+					let day = 0,
73
+						hour = 0,
74
+						minute = 0,
75
+						second = 0;
76
+					if (intDiff > 0) {
77
+						//转换时间
78
+						if (that.isDay === true) {
79
+							day = Math.floor(intDiff / (60 * 60 * 24));
80
+						} else {
81
+							day = 0;
82
+						}
83
+						hour = Math.floor(intDiff / (60 * 60)) - day * 24;
84
+						minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60;
85
+						second =
86
+							Math.floor(intDiff) -
87
+							day * 24 * 60 * 60 -
88
+							hour * 60 * 60 -
89
+							minute * 60;
90
+						if (hour <= 9) hour = "0" + hour;
91
+						if (minute <= 9) minute = "0" + minute;
92
+						if (second <= 9) second = "0" + second;
93
+						that.day = day;
94
+						that.hour = hour;
95
+						that.minute = minute;
96
+						that.second = second;
97
+					} else {
98
+						that.day = "00";
99
+						that.hour = "00";
100
+						that.minute = "00";
101
+						that.second = "00";
102
+					}
103
+				}
104
+				runTime();
105
+				setInterval(runTime, 1000);
106
+			}
107
+		}
108
+	};
109
+</script>
110
+
111
+<style>
112
+	.time{
113
+		display: flex;
114
+		justify-content: center;
115
+		align-items: center;
116
+	} 
117
+	.red{
118
+		color: #FFFFFF;
119
+		margin: 0 4rpx;
120
+	}
121
+</style>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 168 - 0
src/components/couponWindow/index.vue


+ 36 - 0
src/components/emptyPage.vue

@@ -0,0 +1,36 @@
1
+<template>
2
+	<view class="empty-box">
3
+		<image src="https://test.bjtdba.com/mp/images/empty-box.png"></image>
4
+		<view class="txt">{{title}}</view>
5
+	</view>
6
+</template>
7
+
8
+<script>
9
+	export default{
10
+		props: {
11
+			title: {
12
+				type: String,
13
+				default: '暂无记录',
14
+			},
15
+		},
16
+	}
17
+	
18
+</script>
19
+
20
+<style lang="scss">
21
+	.empty-box{
22
+		display: flex;
23
+		flex-direction: column;
24
+		justify-content: center;
25
+		align-items: center;
26
+		margin-top: 200rpx;
27
+		image{
28
+			width: 414rpx;
29
+			height: 240rpx;
30
+		}
31
+		.txt{
32
+			font-size: 26rpx;
33
+			color: #999;
34
+		}
35
+	}
36
+</style>

+ 143 - 0
src/components/goodList/index.vue

@@ -0,0 +1,143 @@
1
+<template>
2
+	<view class='goodList'>
3
+		<block v-for="(item,index) in bastList" :key="index">
4
+			<view @click="goDetail(item)" class='item acea-row row-between-wrapper' hover-class="none">
5
+				<view class='pictrue'>
6
+					<image :src='item.image'></image>
7
+					<span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '1'">秒杀</span>
8
+					<span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '2'">砍价</span>
9
+					<span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '3'">拼团</span>
10
+				</view>
11
+				<view class='underline'>
12
+					<view class='text'>
13
+						<view class='line1'>{{item.store_name}}</view>
14
+						<view class='money font-color'>¥<text class='num'>{{item.price}}</text></view>
15
+						<view class='vip-money acea-row row-middle' v-if="item.vip_price && item.vip_price > 0">¥{{item.vip_price || 0}}
16
+							<!-- <image src='../../static/images/vip.png'></image><text class='num'>已售{{item.sales}}{{item.unit_name}}</text> -->
17
+						</view>
18
+						<view class='vip-money acea-row row-middle' v-else><text class='num'>已售{{item.sales}}{{item.unit_name}}</text></view>
19
+					</view>
20
+				</view>
21
+				<view class='iconfont icon-gouwuche cart-color acea-row row-center-wrapper'></view>
22
+			</view>
23
+		</block>
24
+	</view>
25
+</template>
26
+
27
+<script>
28
+	import {mapGetters} from "vuex";
29
+	import { goShopDetail } from '@/libs/order.js'
30
+	export default {
31
+		computed: mapGetters(['uid']),
32
+		props: {
33
+			status: {
34
+				type: Number,
35
+				default: 0,
36
+			},
37
+			bastList: {
38
+				type: Array,
39
+				default: function() {
40
+					return [];
41
+				}
42
+			}
43
+		},
44
+		data() {
45
+			return {
46
+
47
+			};
48
+		},
49
+		methods: {
50
+			goDetail(item){
51
+				goShopDetail(item,this.uid).then(res=>{
52
+					uni.navigateTo({
53
+						url:`/pages/goods_details/index?id=${item.product_id}`
54
+					})
55
+				})
56
+			}
57
+			
58
+		}
59
+	}
60
+</script>
61
+
62
+<style scoped lang='scss'>
63
+	.goodList .item {
64
+		position: relative;
65
+		padding-left: 30rpx;
66
+	}
67
+
68
+	.goodList .item .pictrue {
69
+		width: 180rpx;
70
+		height: 180rpx;
71
+		position: relative;
72
+	}
73
+
74
+	.goodList .item .pictrue image {
75
+		width: 100%;
76
+		height: 100%;
77
+		border-radius: 6rpx;
78
+	}
79
+
80
+	.goodList .item .pictrue .numPic {
81
+		position: absolute;
82
+		left: 7rpx;
83
+		top: 7rpx;
84
+		width: 50rpx;
85
+		height: 50rpx;
86
+		border-radius: 50%;
87
+	}
88
+
89
+	.goodList .item .underline {
90
+		padding: 30rpx 30rpx 30rpx 0;
91
+		border-bottom: 1px solid #f5f5f5;
92
+	}
93
+
94
+	.goodList .item:nth-last-child(1) .underline {
95
+		border-bottom: 0;
96
+	}
97
+
98
+	.goodList .item .text {
99
+		font-size: 30rpx;
100
+		color: #222;
101
+		width: 489rpx;
102
+	}
103
+
104
+	.goodList .item .text .money {
105
+		font-size: 26rpx;
106
+		font-weight: bold;
107
+		margin-top: 50rpx;
108
+	}
109
+
110
+	.goodList .item .text .money .num {
111
+		font-size: 34rpx;
112
+	}
113
+
114
+	.goodList .item .text .vip-money {
115
+		font-size: 24rpx;
116
+		color: #282828;
117
+		font-weight: bold;
118
+		margin-top: 15rpx;
119
+	}
120
+
121
+	.goodList .item .text .vip-money image {
122
+		width: 46rpx;
123
+		height: 21rpx;
124
+		margin-left: 5rpx;
125
+	}
126
+
127
+	.goodList .item .text .vip-money .num {
128
+		font-size: 22rpx;
129
+		color: #aaa;
130
+		font-weight: normal;
131
+		margin: -2rpx 0 0 22rpx;
132
+	}
133
+
134
+	.goodList .item .iconfont {
135
+		position: absolute;
136
+		right: 30rpx;
137
+		width: 50rpx;
138
+		height: 50rpx;
139
+		border-radius: 50%;
140
+		font-size: 30rpx;
141
+		bottom: 38rpx;
142
+	}
143
+</style>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 488 - 0
src/components/lb-picker/README.md


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 392 - 0
src/components/lb-picker/index.vue


+ 93 - 0
src/components/lb-picker/mixins/index.js

@@ -0,0 +1,93 @@
1
+import { getColumns, isObject, isFunction } from '../utils'
2
+export const commonMixin = {
3
+  data () {
4
+    return {
5
+      isConfirmChange: false,
6
+      indicatorStyle: `height: 34px`,
7
+      pressTimeout: null
8
+    }
9
+  },
10
+  created () {
11
+    this.init('init')
12
+  },
13
+  methods: {
14
+    init (changeType) {
15
+      if (this.list && this.list.length) {
16
+        const column = getColumns({
17
+          value: this.value,
18
+          list: this.list,
19
+          mode: this.mode,
20
+          props: this.props,
21
+          level: this.level
22
+        })
23
+        const { columns, value, item, index } = column
24
+        this.selectValue = value
25
+        this.selectItem = item
26
+        this.pickerColumns = columns
27
+        this.pickerValue = index
28
+        this.$emit('change', {
29
+          value: this.selectValue,
30
+          item: this.selectItem,
31
+          index: this.pickerValue,
32
+          change: changeType
33
+        })
34
+      }
35
+    },
36
+    touchstart (e) {
37
+      if (!this.pressEnable) return
38
+      clearTimeout(this.pressTimeout)
39
+      this.pressTimeout = setTimeout(() => {
40
+        let item = {}
41
+        let toastTitle = ''
42
+        // #ifdef APP-NVUE
43
+        item = e.target.dataset.item
44
+        // #endif
45
+
46
+        // #ifdef H5
47
+        item = JSON.parse(e.currentTarget.dataset.item)
48
+        // #endif
49
+
50
+        // #ifndef APP-NVUE || H5
51
+        item = e.currentTarget.dataset.item
52
+        // #endif
53
+
54
+        // #ifdef APP-PLUS || H5
55
+        toastTitle = this.getLabel(item)
56
+        // #endif
57
+
58
+        // #ifndef APP-PLUS || H5
59
+        toastTitle = item[this.props.label] || item
60
+        // #endif
61
+        uni.showToast({
62
+          title: toastTitle,
63
+          icon: 'none'
64
+        })
65
+      }, this.pressTime)
66
+    },
67
+    touchmove () {
68
+      if (!this.pressEnable) return
69
+      clearTimeout(this.pressTimeout)
70
+    },
71
+    touchend () {
72
+      if (!this.pressEnable) return
73
+      clearTimeout(this.pressTimeout)
74
+    },
75
+    getLabel (item, rowIndex, columnIndex) {
76
+      if (this.formatter && isFunction(this.formatter)) {
77
+        return this.formatter({ item, rowIndex, columnIndex })
78
+      } else {
79
+        return item[this.props.label] || item
80
+      }
81
+    }
82
+  },
83
+  watch: {
84
+    value () {
85
+      if (!this.isConfirmChange) {
86
+        this.init('value')
87
+      }
88
+    },
89
+    list () {
90
+      this.init('list')
91
+    }
92
+  }
93
+}

+ 135 - 0
src/components/lb-picker/pickers/multi-selector-picker.vue

@@ -0,0 +1,135 @@
1
+<template>
2
+  <view class="lb-multi-selector lb-picker-item"
3
+    :style="{ height: height }">
4
+    <picker-view :value="pickerValue"
5
+      :indicator-style="indicatorStyle"
6
+      :style="{ height: height }"
7
+      @change="handleChange">
8
+      <picker-view-column v-for="(column, index) in pickerColumns"
9
+        :key="index">
10
+        <!-- #ifdef H5 -->
11
+        <view v-for="(item, i) in column || []"
12
+          :class="[
13
+				    'lb-picker-column',
14
+				    item[props.value] === selectValue[index]
15
+				      ? 'lb-picker-column-active'
16
+				      : ''
17
+				  ]"
18
+          :key="i"
19
+          :data-item="pressEnable ? JSON.stringify(item) : ''"
20
+          @touchstart="touchstart"
21
+          @touchmove="touchmove"
22
+          @touchend="touchend">
23
+          <!-- #endif -->
24
+          <!-- #ifndef H5 -->
25
+          <view v-for="(item, i) in column || []"
26
+            :class="[
27
+            'lb-picker-column',
28
+            item[props.value] === selectValue[index]
29
+              ? 'lb-picker-column-active'
30
+              : ''
31
+          ]"
32
+            :key="i"
33
+            :data-item="item"
34
+            @touchstart="touchstart"
35
+            @touchmove="touchmove"
36
+            @touchend="touchend">
37
+            <!-- #endif -->
38
+            <!-- #ifdef APP-PLUS || H5 -->
39
+            <text :class="[
40
+              'lb-picker-column-label',
41
+              `lb-picker-column-label-${align}`
42
+            ]"
43
+              :style="[
44
+              item[props.value] === selectValue[index]
45
+              ? activeColumnStyle
46
+              : columnStyle
47
+            ]">{{ getLabel(item, i, index) }}</text>
48
+            <!-- #endif -->
49
+
50
+            <!-- #ifndef APP-PLUS || H5 -->
51
+            <text :class="[
52
+              'lb-picker-column-label',
53
+              `lb-picker-column-label-${align}`
54
+            ]">{{ item[props.label] || item }}</text>
55
+            <!-- #endif -->
56
+          </view>
57
+      </picker-view-column>
58
+    </picker-view>
59
+  </view>
60
+</template>
61
+
62
+<script>
63
+import { commonMixin } from '../mixins'
64
+export default {
65
+  props: {
66
+    value: Array,
67
+    list: Array,
68
+    mode: String,
69
+    props: Object,
70
+    level: Number,
71
+    visible: Boolean,
72
+    height: String,
73
+    columnStyle: Object,
74
+    activeColumnStyle: Object,
75
+    align: String,
76
+    pressEnable: Boolean,
77
+    pressTime: Number,
78
+    formatter: Function
79
+  },
80
+  mixins: [commonMixin],
81
+  data () {
82
+    return {
83
+      pickerValue: [],
84
+      pickerColumns: [],
85
+      selectValue: [],
86
+      selectItem: []
87
+    }
88
+  },
89
+  methods: {
90
+    handleChange (item) {
91
+      const pickerValue = item.detail.value
92
+      const columnIndex = pickerValue.findIndex(
93
+        (item, i) => item !== this.pickerValue[i]
94
+      )
95
+      const valueIndex = pickerValue[columnIndex]
96
+      this.setPickerChange(pickerValue, valueIndex, columnIndex)
97
+    },
98
+    setPickerChange (pickerValue, valueIndex, columnIndex) {
99
+      for (let i = 0; i < this.level; i++) {
100
+        if (i > columnIndex) {
101
+          pickerValue[i] = 0
102
+          const column =
103
+            this.pickerColumns[i - 1][valueIndex] ||
104
+            this.pickerColumns[i - 1][0]
105
+          this.$set(this.pickerColumns, i, column[this.props.children] || [])
106
+          valueIndex = 0
107
+        }
108
+        this.$set(this.pickerValue, i, pickerValue[i])
109
+        const selectItem = this.pickerColumns[i][pickerValue[i]]
110
+        if (selectItem) {
111
+          this.selectItem[i] = selectItem
112
+          this.selectValue[i] = selectItem[this.props.value]
113
+        } else {
114
+          const spliceNum = this.level - i
115
+          this.pickerValue.splice(i, spliceNum)
116
+          this.selectValue.splice(i, spliceNum)
117
+          this.selectItem.splice(i, spliceNum)
118
+          this.pickerColumns.splice(i, spliceNum)
119
+          break
120
+        }
121
+      }
122
+      this.$emit('change', {
123
+        value: this.selectValue,
124
+        item: this.selectItem,
125
+        index: this.pickerValue,
126
+        change: 'scroll'
127
+      })
128
+    }
129
+  }
130
+}
131
+</script>
132
+
133
+<style lang="scss" scoped>
134
+@import "../style/picker-item.scss";
135
+</style>

+ 113 - 0
src/components/lb-picker/pickers/selector-picker.vue

@@ -0,0 +1,113 @@
1
+<template>
2
+  <view class="lb-selector-picker lb-picker-item"
3
+    :style="{ height: height }">
4
+    <picker-view :value="pickerValue"
5
+      :style="{ height: height }"
6
+      :indicator-style="indicatorStyle"
7
+      @change="handleChange">
8
+      <picker-view-column>
9
+        <!-- #ifdef H5 -->
10
+        <view v-for="(item, i) in list"
11
+          :class="[
12
+				    'lb-picker-column',
13
+				    (item[props.value] || item) === selectValue
14
+				      ? 'lb-picker-column-active'
15
+				      : ''
16
+				  ]"
17
+          :key="i"
18
+          :data-item="pressEnable ? JSON.stringify(item) : ''"
19
+          @touchstart="touchstart"
20
+          @touchmove="touchmove"
21
+          @touchend="touchend">
22
+          <!-- #endif -->
23
+          <!-- #ifndef H5 -->
24
+          <view v-for="(item, i) in list"
25
+            :class="[
26
+            'lb-picker-column',
27
+            (item[props.value] || item) === selectValue
28
+              ? 'lb-picker-column-active'
29
+              : ''
30
+          ]"
31
+            :key="i"
32
+            :data-item="item"
33
+            @touchstart="touchstart"
34
+            @touchmove="touchmove"
35
+            @touchend="touchend">
36
+            <!-- #endif -->
37
+            <!-- #ifdef APP-PLUS || H5 -->
38
+            <text :class="[
39
+              'lb-picker-column-label',
40
+              `lb-picker-column-label-${align}`
41
+            ]"
42
+              :style="[
43
+              (item[props.value] || item) === selectValue
44
+                ? activeColumnStyle
45
+                : columnStyle
46
+            ]">{{ getLabel(item, i, 0) }}</text>
47
+            <!-- #endif -->
48
+
49
+            <!-- #ifndef APP-PLUS || H5 -->
50
+            <text :class="[
51
+              'lb-picker-column-label',
52
+              `lb-picker-column-label-${align}`
53
+            ]">{{ item[props.label] || item }}</text>
54
+            <!-- #endif -->
55
+          </view>
56
+      </picker-view-column>
57
+    </picker-view>
58
+  </view>
59
+</template>
60
+
61
+<script>
62
+import { isObject } from '../utils'
63
+import { commonMixin } from '../mixins'
64
+export default {
65
+  props: {
66
+    value: [String, Number],
67
+    list: Array,
68
+    mode: String,
69
+    props: Object,
70
+    visible: Boolean,
71
+    height: String,
72
+    columnStyle: Object,
73
+    activeColumnStyle: Object,
74
+    align: String,
75
+    pressEnable: Boolean,
76
+    pressTime: Number,
77
+    formatter: Function
78
+  },
79
+  mixins: [commonMixin],
80
+  data () {
81
+    return {
82
+      pickerValue: [],
83
+      selectValue: '',
84
+      selectItem: null
85
+    }
86
+  },
87
+  computed: {
88
+    isH5 () {
89
+      return false
90
+    }
91
+  },
92
+  methods: {
93
+    handleChange (item) {
94
+      const index = item.detail.value[0] || 0
95
+      this.selectItem = this.list[index]
96
+      this.selectValue = isObject(this.selectItem)
97
+        ? this.selectItem[this.props.value]
98
+        : this.selectItem
99
+      this.pickerValue = item.detail.value
100
+      this.$emit('change', {
101
+        value: this.selectValue,
102
+        item: this.selectItem,
103
+        index: index,
104
+        change: 'scroll'
105
+      })
106
+    }
107
+  }
108
+}
109
+</script>
110
+
111
+<style lang="scss" scoped>
112
+@import "../style/picker-item.scss";
113
+</style>

+ 116 - 0
src/components/lb-picker/pickers/unlinked-selector-picker.vue

@@ -0,0 +1,116 @@
1
+<template>
2
+  <view class="lb-selector-picker lb-picker-item"
3
+    :style="{ height: height }">
4
+    <picker-view :value="pickerValue"
5
+      :indicator-style="indicatorStyle"
6
+      :style="{ height: height }"
7
+      @change="handleChange">
8
+      <picker-view-column v-for="(column, index) in pickerColumns"
9
+        :key="index">
10
+        <!-- #ifdef H5 -->
11
+        <view v-for="(item, i) in column || []"
12
+          :class="[
13
+				    'lb-picker-column',
14
+				    (item[props.value] || item) === selectValue[index]
15
+				      ? 'lb-picker-column-active'
16
+				      : ''
17
+				  ]"
18
+          :key="i"
19
+          :data-item="pressEnable ? JSON.stringify(item) : ''"
20
+          @touchstart="touchstart"
21
+          @touchmove="touchmove"
22
+          @touchend="touchend">
23
+          <!-- #endif -->
24
+          <!-- #ifndef H5 -->
25
+          <view v-for="(item, i) in column || []"
26
+            :class="[
27
+            'lb-picker-column',
28
+            (item[props.value] || item) === selectValue[index]
29
+              ? 'lb-picker-column-active'
30
+              : ''
31
+          ]"
32
+            :key="i"
33
+            :data-item="item"
34
+            @touchstart="touchstart"
35
+            @touchmove="touchmove"
36
+            @touchend="touchend">
37
+            <!-- #endif -->
38
+            <!-- #ifdef APP-PLUS || H5 -->
39
+            <text :class="[
40
+              'lb-picker-column-label',
41
+              `lb-picker-column-label-${align}`
42
+            ]"
43
+              :style="[
44
+              (item[props.value] || item) === selectValue[index]
45
+              ? activeColumnStyle
46
+              : columnStyle
47
+            ]">{{ getLabel(item, i, index) }}</text>
48
+            <!-- #endif -->
49
+
50
+            <!-- #ifndef APP-PLUS || H5 -->
51
+            <text :class="[
52
+              'lb-picker-column-label',
53
+              `lb-picker-column-label-${align}`
54
+            ]">{{ item[props.label] || item }}</text>
55
+            <!-- #endif -->
56
+          </view>
57
+      </picker-view-column>
58
+    </picker-view>
59
+  </view>
60
+</template>
61
+
62
+<script>
63
+import { isObject } from '../utils'
64
+import { commonMixin } from '../mixins'
65
+export default {
66
+  props: {
67
+    value: Array,
68
+    list: Array,
69
+    mode: String,
70
+    props: Object,
71
+    visible: Boolean,
72
+    height: String,
73
+    columnStyle: Object,
74
+    activeColumnStyle: Object,
75
+    align: String,
76
+    pressEnable: Boolean,
77
+    pressTime: Number,
78
+    formatter: Function
79
+  },
80
+  mixins: [commonMixin],
81
+  data () {
82
+    return {
83
+      pickerValue: [],
84
+      pickerColumns: [],
85
+      selectValue: [],
86
+      selectItem: []
87
+    }
88
+  },
89
+  methods: {
90
+    handleChange (item) {
91
+      const pickerValue = item.detail.value
92
+      const columnIndex = pickerValue.findIndex((item, i) => item !== this.pickerValue[i])
93
+      if (columnIndex > -1) {
94
+        const valueIndex = pickerValue[columnIndex]
95
+        const columnItem = this.list[columnIndex][valueIndex]
96
+        const valueItem = isObject(columnItem)
97
+          ? columnItem[this.props.value]
98
+          : columnItem
99
+        this.pickerValue = pickerValue
100
+        this.$set(this.selectValue, columnIndex, valueItem)
101
+        this.$set(this.selectItem, columnIndex, columnItem)
102
+        this.$emit('change', {
103
+          value: this.selectValue,
104
+          item: this.selectItem,
105
+          index: this.pickerValue,
106
+          change: 'scroll'
107
+        })
108
+      }
109
+    }
110
+  }
111
+}
112
+</script>
113
+
114
+<style lang="scss" scoped>
115
+@import "../style/picker-item.scss";
116
+</style>

+ 40 - 0
src/components/lb-picker/style/picker-item.scss

@@ -0,0 +1,40 @@
1
+.lb-picker-column {
2
+  height: 34px;
3
+  padding: 0 10px;
4
+  /* #ifndef APP-NVUE */
5
+  display: flex;
6
+  box-sizing: border-box;
7
+  white-space: nowrap;
8
+  overflow: hidden;
9
+  /* #endif */
10
+  flex-direction: row;
11
+  align-items: center;
12
+}
13
+
14
+.lb-picker-column-label {
15
+  font-size: 16px;
16
+  text-align: center;
17
+  flex: 1;
18
+  /* #ifdef APP-NVUE */
19
+  lines: 1;
20
+  /* #endif */
21
+  text-overflow: ellipsis;
22
+  transition-property: color;
23
+  transition-duration: 0.3s;
24
+  /* #ifndef APP-NVUE */
25
+  overflow: hidden;
26
+  white-space: nowrap;
27
+  /* #endif */
28
+}
29
+
30
+.lb-picker-column-label-left {
31
+  text-align: left;
32
+}
33
+
34
+.lb-picker-column-label-center {
35
+  text-align: center;
36
+}
37
+
38
+.lb-picker-column-label-right {
39
+  text-align: right;
40
+}

+ 176 - 0
src/components/lb-picker/style/picker.scss

@@ -0,0 +1,176 @@
1
+.lb-picker {
2
+	position: relative;
3
+}
4
+
5
+.lb-picker-mask {
6
+	background-color: rgba(0, 0, 0, 0.0);
7
+	position: fixed;
8
+	top: 0;
9
+	right: 0;
10
+	left: 0;
11
+	bottom: 0;
12
+}
13
+
14
+.lb-picker-mask-animation {
15
+	transition-property: background-color;
16
+	transition-duration: 0.3s;
17
+}
18
+
19
+.lb-picker-container {
20
+	position: relative;
21
+}
22
+
23
+.lb-picker-container-fixed {
24
+	position: fixed;
25
+	left: 0;
26
+	right: 0;
27
+	bottom: 0;
28
+	transform: translateY(100%);
29
+	/* #ifndef APP-NVUE */
30
+	overflow: hidden;
31
+	/* #endif */
32
+}
33
+
34
+.lb-picker-container-animation {
35
+	transition-property: transform;
36
+	transition-duration: 0.3s;
37
+}
38
+
39
+.lb-picker-container-show {
40
+	transform: translateY(0);
41
+}
42
+
43
+.lb-picker-header {
44
+	position: relative;
45
+	background-color: #fff;
46
+	/* #ifdef APP-NVUE */
47
+	border-bottom-width: 1px;
48
+	border-bottom-style: solid;
49
+	border-bottom-color: #e5e5e5;
50
+	border-top-width: 1px;
51
+	border-top-style: solid;
52
+	border-top-color: #e5e5e5;
53
+	/* #endif */
54
+	/* #ifndef APP-NVUE */
55
+	box-sizing: border-box;
56
+	/* #endif */
57
+
58
+}
59
+
60
+/* #ifndef APP-NVUE */
61
+.lb-picker-header::before {
62
+	content: "";
63
+	position: absolute;
64
+	left: 0;
65
+	top: 0;
66
+	right: 0;
67
+	height: 1px;
68
+	clear: both;
69
+	border-bottom: 1px solid #e5e5e5;
70
+	color: #e5e5e5;
71
+	transform-origin: 0 100%;
72
+	transform: scaleY(0.5);
73
+}
74
+
75
+.lb-picker-header::after {
76
+	content: "";
77
+	position: absolute;
78
+	left: 0;
79
+	bottom: 0;
80
+	right: 0;
81
+	height: 1px;
82
+	clear: both;
83
+	border-bottom: 1px solid #e5e5e5;
84
+	color: #e5e5e5;
85
+	transform-origin: 0 100%;
86
+	transform: scaleY(0.5);
87
+}
88
+
89
+/* #endif */
90
+
91
+.lb-picker-header-actions {
92
+	height: 45px;
93
+	/* #ifndef APP-NVUE */
94
+	box-sizing: border-box;
95
+	display: flex;
96
+	/* #endif */
97
+	flex-direction: row;
98
+	justify-content: space-between;
99
+	flex-wrap: nowrap;
100
+}
101
+
102
+.lb-picker-action {
103
+	padding-left: 10px;
104
+	padding-right: 10px;
105
+	/* #ifndef APP-NVUE */
106
+	display: flex;
107
+	/* #endif */
108
+	flex-direction: row;
109
+	align-items: center;
110
+	justify-content: center;
111
+}
112
+
113
+.lb-picker-action-cancel-text {
114
+	font-size: 16px;
115
+}
116
+
117
+.lb-picker-action-confirm-text {
118
+	font-size: 16px;
119
+}
120
+
121
+.lb-picker-content {
122
+	position: relative;
123
+	background-color: #fff;
124
+}
125
+
126
+/* #ifndef APP-PLUS */
127
+.lb-picker-content-safe-buttom {
128
+	padding-bottom: 0;
129
+	padding-bottom: constant(safe-area-inset-bottom);
130
+	padding-bottom: env(safe-area-inset-bottom);
131
+}
132
+
133
+/* #endif */
134
+
135
+.lb-picker-content-main {
136
+	position: relative;
137
+	/* #ifndef APP-NVUE */
138
+	display: flex;
139
+	/* #endif */
140
+	justify-content: center;
141
+	flex-direction: column;
142
+}
143
+
144
+.lb-picker-loading,
145
+.lb-picker-empty {
146
+	/* #ifndef APP-NVUE */
147
+	display: flex;
148
+	/* #endif */
149
+	justify-content: center;
150
+	align-items: center;
151
+}
152
+
153
+.lb-picker-empty-text {
154
+	font-size: 16px;
155
+}
156
+
157
+.lb-picker-loading-img {
158
+	width: 25px;
159
+	height: 25px;
160
+	/* #ifndef APP-NVUE */
161
+	animation: rotating 2s linear infinite;
162
+	/* #endif */
163
+}
164
+
165
+/* #ifndef APP-NVUE */
166
+@keyframes rotating {
167
+	0% {
168
+		transform: rotate(0deg)
169
+	}
170
+
171
+	100% {
172
+		transform: rotate(1turn)
173
+	}
174
+}
175
+
176
+/* #endif */

+ 121 - 0
src/components/lb-picker/utils.js

@@ -0,0 +1,121 @@
1
+/**
2
+ * 判断是否是对象
3
+ *
4
+ * @export
5
+ * @param {*} val
6
+ * @returns true/false
7
+ */
8
+export function isObject (val) {
9
+  return Object.prototype.toString.call(val) === '[object Object]'
10
+}
11
+
12
+/**
13
+ * 判断是否是Function
14
+ *
15
+ * @export
16
+ * @param {*} val
17
+ * @returns true/false
18
+ */
19
+export function isFunction (val) {
20
+  return Object.prototype.toString.call(val) === '[object Function]'
21
+}
22
+
23
+/**
24
+ * 根据value获取columns信息
25
+ *
26
+ * @export
27
+ * @param {*} { value, list, mode, props, level }
28
+ * @param {number} [type=2] 查询不到value数据返回数据类型 1空值null 2默认第一个选项
29
+ * @returns
30
+ */
31
+export function getColumns ({ value, list, mode, props, level }, type = 2) {
32
+  let pickerValue = []
33
+  let pickerColumns = []
34
+  let selectValue = []
35
+  let selectItem = []
36
+  let columnsInfo = null
37
+  switch (mode) {
38
+    case 'selector':
39
+      let index = list.findIndex(item => {
40
+        return isObject(item) ? item[props.value] === value : item === value
41
+      })
42
+      if (index === -1 && type === 1) {
43
+        columnsInfo = null
44
+      } else {
45
+        index = index > -1 ? index : 0
46
+        selectItem = list[index]
47
+        selectValue = isObject(selectItem)
48
+          ? selectItem[props.value]
49
+          : selectItem
50
+        pickerColumns = list
51
+        pickerValue = [index]
52
+        columnsInfo = {
53
+          index: pickerValue,
54
+          value: selectValue,
55
+          item: selectItem,
56
+          columns: pickerColumns
57
+        }
58
+      }
59
+      break
60
+    case 'multiSelector':
61
+      const setPickerItems = (data = [], index = 0) => {
62
+        if (!data.length) return
63
+        const defaultValue = value || []
64
+        if (index < level) {
65
+          const value = defaultValue[index] || ''
66
+          let i = data.findIndex(item => item[props.value] === value)
67
+          if (i === -1 && type === 1) return
68
+          i = i > -1 ? i : 0
69
+          pickerValue[index] = i
70
+          pickerColumns[index] = data
71
+          if (data[i]) {
72
+            selectValue[index] = data[i][props.value]
73
+            selectItem[index] = data[i]
74
+            setPickerItems(data[i][props.children] || [], index + 1)
75
+          }
76
+        }
77
+      }
78
+      setPickerItems(list)
79
+      if (!selectValue.length && type === 1) {
80
+        columnsInfo = null
81
+      } else {
82
+        columnsInfo = {
83
+          index: pickerValue,
84
+          value: selectValue,
85
+          item: selectItem,
86
+          columns: pickerColumns
87
+        }
88
+      }
89
+      break
90
+    case 'unlinkedSelector':
91
+      list.forEach((item, i) => {
92
+        let index = item.findIndex(item => {
93
+          return isObject(item)
94
+            ? item[props.value] === value[i]
95
+            : item === value[i]
96
+        })
97
+        if (index === -1 && type === 1) return
98
+        index = index > -1 ? index : 0
99
+        const columnItem = list[i][index]
100
+        const valueItem = isObject(columnItem)
101
+          ? columnItem[props.value]
102
+          : columnItem
103
+        pickerValue[i] = index
104
+        selectValue[i] = valueItem
105
+        selectItem[i] = columnItem
106
+      })
107
+      pickerColumns = list
108
+      if (!selectValue.length && type === 1) {
109
+        columnsInfo = null
110
+      } else {
111
+        columnsInfo = {
112
+          index: pickerValue,
113
+          value: selectValue,
114
+          item: selectItem,
115
+          columns: pickerColumns
116
+        }
117
+      }
118
+      break
119
+  }
120
+  return columnsInfo
121
+}

+ 135 - 0
src/components/orderGoods/index.vue

@@ -0,0 +1,135 @@
1
+<template>
2
+	<view class="orderGoods">
3
+		<view class='goodWrapper'>
4
+			<view class='item acea-row row-between-wrapper' v-for="(item,index) in cartInfo" :key="index">
5
+				<view class='pictrue' @click="jumpCon(item.product_id)">
6
+					<image :src='item.cart_info.product.image' ></image>
7
+				</view>
8
+				<view class='text flex flex-direction justify-between'>
9
+					<view class='flex justify-between'>
10
+						<view class='name line2'>{{item.cart_info.product.store_name}}</view>
11
+						<view>
12
+							<view class='money' >¥{{item.cart_info.productAttr.price}}</view>
13
+							<view class='num'>x {{item.product_num}}</view>
14
+						</view>
15
+					</view>
16
+					<view class='attr line1' v-if="item.cart_info.productAttr.sku">{{item.cart_info.productAttr.sku}}</view>
17
+					<!-- <view class="right-btn-box">
18
+						<view class="btn-item" v-if="item.is_refund ==0" @click.stop="refund(item)">申请售后</view>
19
+						<view class="btn-item err" v-if="item.is_refund ==1">退款中</view>
20
+						<view class='btn-item err' v-if="item.is_refund >1">已退款</view>
21
+						<view class='btn-item' v-if='item.is_reply==0 && evaluate==2' @click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
22
+						<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
23
+					</view> -->
24
+				</view>
25
+			</view>
26
+		</view>
27
+	</view>
28
+</template>
29
+
30
+<script>
31
+	import {
32
+		openOrderRefundSubscribe
33
+	} from '@/utils/SubscribeMessage.js';
34
+	export default {
35
+		props: {
36
+			evaluate: {
37
+				type: Number,
38
+				default: 0,
39
+			},
40
+			cartInfo: {
41
+				type: Array,
42
+				default: function() {
43
+					return [];
44
+				}
45
+			},
46
+			orderId: {
47
+				type: String,
48
+				default: '',
49
+			},
50
+			jump: {
51
+				type: Boolean,
52
+				default: false,
53
+			}
54
+		},
55
+		data() {
56
+			return {
57
+				totalNmu:''
58
+			};
59
+		},
60
+		watch:{
61
+			cartInfo:function(nVal,oVal){
62
+				let num = 0
63
+				nVal.forEach((item,index)=>{
64
+					num += item.cart_num
65
+				})
66
+				this.totalNmu = num
67
+			}
68
+		},
69
+		mounted() {
70
+		},
71
+		methods: {
72
+			evaluateTap:function(unique,orderId){
73
+				uni.navigateTo({
74
+					url:`/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}`
75
+				})
76
+			},
77
+			jumpCon:function(id){
78
+				if(this.jump){
79
+					uni.navigateTo({
80
+						url: `/pages/goods_details/index?id=${id}`
81
+					})
82
+				}
83
+			},
84
+			// 退款
85
+			refund(item){
86
+				if(this.evaluate == 0){
87
+					
88
+					uni.navigateTo({
89
+						url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1'
90
+					})
91
+				}else{
92
+					uni.navigateTo({
93
+						url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id
94
+					})
95
+				}
96
+			}
97
+		}
98
+	}
99
+</script>
100
+
101
+<style scoped lang="scss">
102
+	.orderGoods {
103
+		background-color: #fff;
104
+	}
105
+
106
+	.right-btn-box{
107
+		position: absolute;
108
+		right: 0;
109
+		bottom: 0;
110
+		display: flex;
111
+		align-items: center;
112
+		justify-content: flex-end;
113
+		.btn-item{
114
+			display: flex;
115
+			align-items: center;
116
+			justify-content: center;
117
+			width:140rpx;
118
+			height:46rpx;
119
+			margin-left: 20rpx;
120
+			border:1px solid rgba(187,187,187,1);
121
+			border-radius:23rpx;
122
+			font-size: 24rpx;
123
+			color: #282828;
124
+			&.on{
125
+				background:rgba(220,220,220,1);
126
+				border-color: rgba(220,220,220,1);
127
+			}
128
+			&.err{
129
+				background:rgba(247,247,247,1);
130
+				border-color: rgba(247,247,247,1);
131
+				color: #AAAAAA;
132
+			}
133
+		}
134
+	}
135
+</style>

+ 226 - 0
src/components/payment/index.vue

@@ -0,0 +1,226 @@
1
+<template>
2
+	<view>
3
+		<view class="payment" :class="pay_close ? 'on' : ''">
4
+			<view class="title acea-row row-center-wrapper">
5
+				选择付款方式<text class="iconfont icon-guanbi" @click='close'></text>
6
+			</view>
7
+			<view class="item acea-row row-between-wrapper" @click='goPay(item.name)' v-for="(item,index) in payMode"
8
+			 :key="index" v>
9
+				<view class="left acea-row row-between-wrapper">
10
+					<view class="iconfont" :class="item.icon"></view>
11
+					<view class="text">
12
+					{{item.name}}
13
+					</view>
14
+				</view>
15
+				<view class="iconfont icon-xiangyou"></view>
16
+			</view>
17
+		</view>
18
+		<view class="mask" @click='close' v-if="pay_close"></view>
19
+	</view>
20
+</template>
21
+
22
+<script>
23
+	import {
24
+		orderPay
25
+	} from '@/api/order.js';
26
+	export default {
27
+		props: {
28
+			
29
+			pay_close: {
30
+				type: Boolean,
31
+				default: false,
32
+			},
33
+			order_id: {
34
+				type: String,
35
+				default: ''
36
+			},
37
+			totalPrice: {
38
+				type: String,
39
+				default: '0'
40
+			}
41
+		},
42
+		data() {
43
+			return {
44
+				// payMode:[
45
+				// 	{name:'微信',icon:require('@/static/images/zhi.png')},
46
+				// 	{name:'支付宝',icon:require('@/static/images/zhi.png')},
47
+				// 	], 
48
+					status:'vx'
49
+			};
50
+		},
51
+		onLoad() {
52
+			
53
+			console.log('res');
54
+			this.getPlus();
55
+		},
56
+		methods: {
57
+			//跳转小程序
58
+			getPlus() {
59
+				//获取当前显示的webview
60
+				var pages = getCurrentPages()
61
+				var page = pages[pages.length - 1]
62
+				var currentWebview = page.$getAppWebview()
63
+				//调用H5+APP的扩展API
64
+				var shares = null;
65
+				let that = this
66
+				var pusher = plus.share.getServices(function(s) {
67
+					shares = {};
68
+					for (var i in s) {
69
+						var t = s[i];
70
+						shares[t.id] = t;
71
+					}
72
+					that.sweixin = shares['weixin'];
73
+				}, function(e) {
74
+					console.log("获取分享服务列表失败:" + e.message);
75
+				});
76
+				//放入当前的webview
77
+				currentWebview.append(pusher);
78
+			},
79
+			close: function() {
80
+				this.$emit('onChangeFun', {
81
+					action: 'payClose'
82
+				});
83
+			},
84
+			goPay: function(e) {
85
+				console.log(this.order_id,'qweqweqweqwewq')
86
+				this.getPlus();
87
+				let type = e;
88
+				var order_id =	uni.getStorageSync('order_id')
89
+				
90
+				if (type == '微信') {
91
+					console.log(this.status,'||',order_id);
92
+					this.sweixin.launchMiniProgram({
93
+						id: 'gh_d9e58585791b', 
94
+						// path: 'pagesA/oderPay/oderPay?oid=' + order_id + '&type=' + this.status,
95
+						path: 'pagesA/oderPay/oderPay?oid=' + this.order_id + '&type=' + this.status,
96
+						type: 0, 
97
+					})
98
+					uni.redirectTo({
99
+						url:'/pages/users/order_confirm/index'
100
+					})
101
+				} else {
102
+					uni.request({
103
+						method: 'GET',
104
+						url: 'https://test.bjtdba.com/api/sxy_pay_wechat_mp',
105
+						data: {
106
+							oid: order_id,
107
+							type: type
108
+						},
109
+						header: {},
110
+						success: (res) => {
111
+							if (res.statusCode == 200) {
112
+								if (res.data.data.redirectUrl != '') {
113
+									let authUrl =`alipays://platformapi/startapp?appId=20000067&url=${encodeURIComponent(res.data.data.redirectUrl)}`;
114
+									console.log(authUrl);
115
+									if (uni.getSystemInfoSync().platform == "ios") {
116
+										authUrl =
117
+											`alipay://platformapi/startapp?appId=20000067&url=${encodeURIComponent(res.data.data.redirectUrl)}`;
118
+									}
119
+									plus.runtime.openURL(authUrl, function(res) {
120
+										console.log(res);
121
+										uni.showToast({
122
+											icon: "none",
123
+											title: "请安装支付宝之后再进行支付!",
124
+										});
125
+									});
126
+								}
127
+							}
128
+						}
129
+					})
130
+				}
131
+			}
132
+		}
133
+	}
134
+</script>
135
+
136
+<style scoped lang="scss">
137
+	.payment {
138
+		position: fixed;
139
+		bottom: 0;
140
+		left: 0;
141
+		width: 100%;
142
+		border-radius: 16rpx 16rpx 0 0;
143
+		background-color: #fff;
144
+		padding-bottom: 60rpx;
145
+		z-index: 99;
146
+		transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
147
+		transform: translate3d(0, 100%, 0);
148
+	}
149
+
150
+	.payment.on {
151
+		transform: translate3d(0, 0, 0);
152
+	}
153
+
154
+	.payment .title {
155
+		text-align: center;
156
+		height: 123rpx;
157
+		font-size: 32rpx;
158
+		color: #282828;
159
+		font-weight: bold;
160
+		padding-right: 30rpx;
161
+		margin-left: 30rpx;
162
+		position: relative;
163
+		border-bottom: 1rpx solid #eee;
164
+	}
165
+
166
+	.payment .title .iconfont {
167
+		position: absolute;
168
+		right: 30rpx;
169
+		top: 50%;
170
+		transform: translateY(-50%);
171
+		font-size: 43rpx;
172
+		color: #8a8a8a;
173
+		font-weight: normal;
174
+	}
175
+
176
+	.payment .item {
177
+		border-bottom: 1rpx solid #eee;
178
+		height: 130rpx;
179
+		margin-left: 30rpx;
180
+		padding-right: 30rpx;
181
+	}
182
+
183
+	.payment .item .left {
184
+		width: 610rpx;
185
+	}
186
+
187
+	.payment .item .left .text {
188
+		width: 540rpx;
189
+	}
190
+
191
+	.payment .item .left .text .name {
192
+		font-size: 32rpx;
193
+		color: #282828;
194
+	}
195
+
196
+	.payment .item .left .text .info {
197
+		font-size: 24rpx;
198
+		color: #999;
199
+	}
200
+
201
+	.payment .item .left .text .info .money {
202
+		color: #ff9900;
203
+	}
204
+
205
+	.payment .item .left .iconfont {
206
+		font-size: 45rpx;
207
+		color: #09bb07;
208
+	}
209
+
210
+	.payment .item .left .iconfont.icon-zhifubao {
211
+		color: #00aaea;
212
+	}
213
+
214
+	.payment .item .left .iconfont.icon-yuezhifu {
215
+		color: #ff9900;
216
+	}
217
+
218
+	.payment .item .left .iconfont.icon-yuezhifu1 {
219
+		color: #eb6623;
220
+	}
221
+
222
+	.payment .item .iconfont {
223
+		font-size: 0.3rpx;
224
+		color: #999;
225
+	}
226
+</style>

+ 110 - 0
src/components/promotionGood/index.vue

@@ -0,0 +1,110 @@
1
+<template>
2
+	<view class='promotionGood'>
3
+		<block v-for="(item,index) in benefit" :key="index">
4
+			<view class='item acea-row row-between-wrapper' @tap="goDetail(item)" hover-class="none">
5
+				<view class='pictrue'>
6
+					<image :src='item.image'></image>
7
+					<span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '1'">秒杀</span>
8
+					<span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '2'">砍价</span>
9
+					<span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '3'">拼团</span>
10
+				</view>
11
+				<view class='text'>
12
+					<view class='name line1'>{{item.store_name}}</view>
13
+					<view class='sp-money acea-row'>
14
+						<view class='moneyCon'>促销价: ¥<text class='num'>{{item.price}}</text></view>
15
+					</view>
16
+					<view class='acea-row row-between-wrapper'>
17
+						<view class='money'>日常价:¥{{item.ot_price}}</view>
18
+						<view>仅剩:{{item.stock}}{{item.unit_name}}</view>
19
+					</view>
20
+				</view>
21
+			</view>
22
+		</block>
23
+	</view>
24
+</template>
25
+<script>
26
+	import {mapGetters} from "vuex";
27
+	import { goShopDetail } from '@/libs/order.js'
28
+	export default {
29
+		computed: mapGetters(['uid']),
30
+		props: {
31
+			benefit: {
32
+				type: Array,
33
+				default: function() {
34
+					return [];
35
+				}
36
+			}
37
+		},
38
+		data() {
39
+			return {
40
+
41
+			};
42
+		},
43
+		methods: {
44
+			goDetail(item){
45
+				goShopDetail(item,this.uid).then(res=>{
46
+					uni.navigateTo({
47
+						url:`/pages/goods_details/index?id=${item.id}`
48
+					})
49
+				})
50
+			}
51
+		}
52
+	}
53
+</script>
54
+
55
+<style scoped lang='scss'>
56
+	.promotionGood {
57
+		padding: 0 30rpx;
58
+	}
59
+
60
+	.promotionGood .item {
61
+		border-bottom: 1rpx solid #eee;
62
+		height: 250rpx;
63
+	}
64
+
65
+	.promotionGood .item .pictrue {
66
+		position: relative;
67
+		width: 188rpx;
68
+		height: 188rpx;
69
+	}
70
+
71
+	.promotionGood .item .pictrue image {
72
+		width: 100%;
73
+		height: 100%;
74
+		border-radius: 8rpx;
75
+	}
76
+
77
+	.promotionGood .item .text {
78
+		font-size: 24rpx;
79
+		color: #999;
80
+		width: 472rpx;
81
+	}
82
+
83
+	.promotionGood .item .text .name {
84
+		font-size: 30rpx;
85
+		color: #333;
86
+	}
87
+
88
+	.promotionGood .item .text .sp-money {
89
+		margin: 34rpx 0 20rpx 0;
90
+	}
91
+
92
+	.promotionGood .item .text .sp-money .moneyCon {
93
+		padding: 0 18rpx;
94
+		background-color: red;
95
+		height: 46rpx;
96
+		line-height: 46rpx;
97
+		background-image: linear-gradient(to right, #ff6248 0%, #ff3e1e 100%);
98
+		font-size: 20rpx;
99
+		color: #fff;
100
+		border-radius: 24rpx 3rpx 24rpx 3rpx;
101
+	}
102
+
103
+	.promotionGood .item .text .sp-money .moneyCon .num {
104
+		font-size: 24rpx;
105
+	}
106
+
107
+	.promotionGood .item .text .money {
108
+		text-decoration: line-through;
109
+	}
110
+</style>

+ 202 - 0
src/components/recommend/index.vue

@@ -0,0 +1,202 @@
1
+<template>
2
+	<view class='recommend'>
3
+		<!-- <view class='title acea-row row-center-wrapper'>
4
+			<text class='iconfont icon-zhuangshixian'></text>
5
+			<text class='name'>热门推荐</text>
6
+			<text class='iconfont icon-zhuangshixian lefticon'></text>
7
+		</view> -->
8
+		<view class="common-hd" v-if="likeType === 0">
9
+			<image src="https://test.bjtdba.com/mp/images/icon-like.png" mode="widthFix" class="type_title"></image>
10
+			<!-- <view class="title">猜你喜欢</view> -->
11
+		</view>
12
+		<view v-if="likeType === 1" class="yourlike">你可能还想买</view>
13
+		<view v-if="likeType === 2" class="yourlike">经常浏览</view>
14
+		<view class='recommendList acea-row row-between-wrapper' :class="indexP?'on':''">
15
+			<view class='item' v-for="(item,index) in hostProduct" :key="index" hover-class='none' @tap="goDetail(item)">
16
+				<view class='pictrue'>
17
+					<image :src='item.image'></image>
18
+					<span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '1'">秒杀</span>
19
+					<span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '2'">砍价</span>
20
+					<span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '3'">拼团</span>
21
+				</view>
22
+				<view class="text">
23
+					<view class='prod_name line2'>{{item.store_name}}</view>
24
+					<!-- <view class="tips text-bottom line2">{{item.keyword}}</view> -->
25
+					<view class="acea-row row-middle">
26
+						<view class='money font-color'>¥<text class='num'>{{item.price}}</text></view>
27
+						<!-- <text class="tips">单件¥20.00</text> -->
28
+					</view>
29
+					<view class="acea-row row-middle">
30
+					<text class="font-smaller smaller-btn font-color-white bg-color1 set-btn">送养老金¥{{item.yanglao}}</text>
31
+					</view>
32
+				</view>
33
+			</view>
34
+		</view>
35
+	</view>
36
+</template>
37
+
38
+<script>
39
+	import {mapGetters} from "vuex";
40
+	import { goShopDetail } from '@/libs/order.js'
41
+	export default {
42
+	computed: mapGetters(['uid']),
43
+		props: {
44
+			hostProduct: {
45
+				type: Array,
46
+				default: function() {
47
+					return [];
48
+				}
49
+			},
50
+			indexP:{
51
+				type: Boolean,
52
+				default: false
53
+			},
54
+			//猜你喜欢 0,1=订单的你可能还想买
55
+			likeType: {
56
+				type: Number,
57
+				default: 0,
58
+			},
59
+		},
60
+		data() {
61
+			return {
62
+
63
+			};
64
+		},
65
+
66
+		methods: {
67
+			goDetail(item){
68
+				goShopDetail(item,this.uid).then(res=>{
69
+					uni.navigateTo({
70
+						url:`/pages/goods_details/index?id=${item.product_id}`
71
+					})
72
+				})
73
+			}
74
+		}
75
+	}
76
+</script>
77
+
78
+<style scoped lang="scss">
79
+	.common-hd {
80
+		display: flex;
81
+		align-items: center;
82
+        padding-bottom: 30rpx;
83
+	
84
+		.title {
85
+			padding: 0 80rpx;
86
+			font-size: 34rpx;
87
+			color: $theme-color;
88
+			font-weight: bold;
89
+			// background-image: url("~@/static/images/index-title.png");
90
+			background-repeat: no-repeat;
91
+			background-size: 100% auto;
92
+			background-position: left center;
93
+		}
94
+	}
95
+	// .recommend {
96
+	// 	background-color: #fff;
97
+	// }
98
+
99
+	// .recommend .title {
100
+	// 	height: 135rpx;
101
+	// 	font-size: 28rpx;
102
+	// 	color: #282828;
103
+	// }
104
+
105
+	// .recommend .title .name {
106
+	// 	margin: 0 28rpx;
107
+	// }
108
+
109
+	// .recommend .title .iconfont {
110
+	// 	font-size: 170rpx;
111
+	// 	color: #454545;
112
+	// }
113
+
114
+	// .recommend .title .iconfont.lefticon {
115
+	// 	transform: rotate(180deg);
116
+	// }
117
+
118
+	.recommend .recommendList {
119
+		padding: 0 20rpx;
120
+	}
121
+	
122
+	.recommend .recommendList.on{
123
+		padding: 0;
124
+	}
125
+
126
+	.recommend .recommendList .item {
127
+		width: 330rpx;
128
+		margin-bottom: 30rpx;
129
+		background-color: #fff;
130
+		border-radius: 16rpx;
131
+		padding-bottom: 20rpx;
132
+	}
133
+	
134
+	.recommend .recommendList .item .text{
135
+		padding: 0 20rpx;
136
+		height: 240rpx;
137
+	}
138
+	
139
+	.recommend .recommendList .item .coupon{
140
+		background:rgba(255,248,247,1);
141
+		border:1px solid rgba(233,51,35,1);
142
+		border-radius:4rpx;
143
+		font-size:20rpx;
144
+		margin-left: 18rpx;
145
+		padding: 1rpx 4rpx;
146
+	}
147
+
148
+	.recommend .recommendList .item .pictrue {
149
+		position: relative;
150
+		width: 100%;
151
+		height: 345rpx;
152
+	}
153
+
154
+	.recommend .recommendList .item .pictrue image {
155
+		width: 100%;
156
+		height: 100%;
157
+		border-radius: 16rpx 16rpx 0 0;
158
+	}
159
+
160
+	.recommend .recommendList .item .prod_name {
161
+		font-size: 28rpx;
162
+		color: #282828;
163
+		margin: 20rpx 0 10rpx 0;
164
+        min-height:80rpx;
165
+	}
166
+
167
+	.recommend .recommendList .item .money {
168
+		font-size: 20rpx;
169
+		font-weight: bold;
170
+	}
171
+
172
+	.recommend .recommendList .item .money .num {
173
+		font-size: 34rpx;
174
+	}
175
+	.recommend .set-btn{
176
+		margin-bottom: 10rpx;
177
+	}
178
+	.integral_bg{
179
+		background: #FFDFDF;
180
+	}
181
+	.yourlike{
182
+		color: #333;
183
+		font-size: 32rpx;
184
+		margin: 40rpx 0 32rpx;
185
+		position: relative;
186
+		padding-left: 24rpx;
187
+		
188
+		&:before{
189
+			content: '';
190
+			display: inline-block;
191
+			width: 8rpx;
192
+			height: 36rpx;
193
+			background: linear-gradient(180deg, #F94032 0%, #FFEB67 100%);
194
+			opacity: 1;
195
+			border-radius: 4rpx;
196
+			position: absolute;
197
+			left: 0;
198
+			top: 50%;
199
+			transform: translateY(-50%);
200
+		}
201
+	}
202
+</style>

+ 192 - 0
src/components/tabNav.vue

@@ -0,0 +1,192 @@
1
+<template>
2
+	<view class="navTabBox">
3
+		<view class="longTab">
4
+			<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;" scroll-with-animation :scroll-left="tabLeft" show-scrollbar="true">
5
+				<view class="longItem" :style='"width:"+isWidth+"px"' :data-index="index" :class="index===tabClick?'click':''" v-for="(item,index) in tabTitle" :key="index" :id="'id'+index" @click="longClick(index,item.store_category_id,item.pid)">{{item.cate_name}}</view>
6
+				<view class="underlineBox" :style='"transform:translateX("+isLeft+"px);width:"+isWidth+"px"'>
7
+					<view class="underline bg-color-red"></view>
8
+				</view>
9
+			</scroll-view>
10
+		</view>
11
+	<!-- 	<view class="child-box" v-if="tabClick>0 && tabTitle[tabClick].children.length>0">
12
+			<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;align-items: center; height: 100%;" scroll-with-animation :scroll-left="tabLeft" show-scrollbar="false">
13
+				<view class="wrapper">
14
+					<view v-for="(item,index) in tabTitle[tabClick].children" class="child-item" :class="{on:index == childIndex}" @click="childTab(tabClick,index)">
15
+						<image :src="item.pic" mode=""></image>
16
+						<view class="txt">{{item.cate_name}}</view>
17
+					</view>
18
+				</view>
19
+			</scroll-view>
20
+		</view> -->
21
+	</view>
22
+</template>
23
+
24
+<script>
25
+	let app = getApp();
26
+	export default {
27
+		name: 'navTab',
28
+		props: {
29
+			tabTitle: {
30
+				type: Array,
31
+				default: []
32
+			}
33
+
34
+		},
35
+		data() {
36
+			return {
37
+				tabClick: 0, //导航栏被点击
38
+				isLeft: 0, //导航栏下划线位置
39
+				isWidth: 0, //每个导航栏占位
40
+				tabLeft:0,
41
+				swiperIndex:0,
42
+				childIndex:0,
43
+				childID:0
44
+			};
45
+		},
46
+		created() {
47
+			
48
+			var that = this
49
+			// 获取设备宽度
50
+			uni.getSystemInfo({
51
+				success(e) {
52
+					that.isWidth = e.windowWidth / 5 
53
+				}
54
+			})
55
+		},
56
+		methods: {
57
+			// 导航栏点击
58
+			longClick(index,id,fid){
59
+				app.globalData.fid = fid;
60
+				this.childIndex = 0;
61
+				if(this.tabTitle.length>5){
62
+					var tempIndex = index - 2;
63
+					tempIndex = tempIndex<=0 ? 0 : tempIndex;
64
+					this.tabLeft = (index-2) * this.isWidth //设置下划线位置
65
+				}
66
+				this.tabClick = index //设置导航点击了哪一个
67
+				this.isLeft = index * this.isWidth //设置下划线位置
68
+				
69
+				// let obj = {
70
+				// 	type:'big',  //大标题
71
+				// 	index:index
72
+				// }
73
+				let obj = {
74
+					index:index,
75
+					pid:id//自己的id
76
+				}
77
+				
78
+				this.parentEmit(obj);
79
+				
80
+				// this.$parent.currentTab = index //设置swiper的第几页
81
+			},
82
+			// 导航子类点击
83
+			// childTab(tabClick,index){
84
+			// 	this.childIndex = index
85
+			// 	let obj = {
86
+			// 		parentIndex:tabClick,
87
+			// 		childIndex:index,
88
+			// 		type:'small' //小标题
89
+			// 	}
90
+			// 	this.parentEmit(obj)
91
+			// }
92
+			parentEmit(obj){
93
+				this.$emit('changeTab', obj);
94
+			}
95
+		}
96
+	}
97
+</script>
98
+
99
+<style lang="scss">
100
+	.navTabBox {
101
+		width: 100%;
102
+		color: rgba(255, 255, 255, 1);
103
+		.click {
104
+			color: white;
105
+		}
106
+		.longTab {
107
+			width: 100%;
108
+			/* #ifdef H5 */
109
+			padding-bottom: 20rpx;
110
+			/* #endif */
111
+			/* #ifdef MP */
112
+			padding-top: 12rpx;
113
+			padding-bottom: 12rpx;
114
+			/* #endif */
115
+			.longItem{ 
116
+				height: 50upx; 
117
+				display: inline-block;
118
+				line-height: 50upx;
119
+				text-align: center;
120
+				font-size: 28rpx;
121
+				color: #333333;
122
+				&.click{
123
+					font-weight: bold;
124
+					font-size: 30rpx;
125
+					color: #E93323;
126
+				}
127
+			}
128
+			.underlineBox {
129
+				height: 3px;
130
+				width: 20%;
131
+				display: flex;
132
+				align-content: center;
133
+				justify-content: center;
134
+				transition: .5s;
135
+				.underline {
136
+					width: 33rpx;
137
+					height: 4rpx;
138
+				}
139
+			}
140
+		}
141
+	}
142
+	.child-box{
143
+		width: 100%;
144
+		position: relative;
145
+		// height: 152rpx;
146
+		background-color: #fff;
147
+		/* #ifdef H5 */
148
+		box-shadow: 0 2px 5px 1px rgba(0, 0, 0, 0.02);
149
+		/* #endif */
150
+		/* #ifdef MP */
151
+		box-shadow: 0 2rpx 3rpx 1rpx #f9f9f9;
152
+		/* #endif */
153
+		
154
+		.wrapper{
155
+			display: flex;
156
+			align-items: center;
157
+			padding: 20rpx 0;
158
+			background: #fff;
159
+			/* #ifdef H5 */
160
+			//box-shadow: 0 2px 5px 1px rgba(0, 0, 0, 0.06);
161
+			/* #endif */
162
+		}
163
+		.child-item{
164
+			flex-shrink: 0;
165
+			width:140rpx;
166
+			display: flex;
167
+			flex-direction: column;
168
+			align-items: center;
169
+			justify-content: center;
170
+			margin-left: 10rpx;
171
+			image{
172
+				width: 90rpx;
173
+				height: 90rpx;
174
+				border-radius: 50%;
175
+			}
176
+			.txt{
177
+				font-size: 24rpx;
178
+				color: #282828;
179
+				text-align: center;
180
+				margin-top: 10rpx;
181
+			}
182
+			&.on{
183
+				image{
184
+					border: 1px solid $theme-color-opacity;
185
+				}
186
+				.txt{
187
+					color: $theme-color;
188
+				}
189
+			}
190
+		}
191
+	}
192
+</style>

+ 224 - 0
src/components/uni-nav-bar/uni-nav-bar.vue

@@ -0,0 +1,224 @@
1
+<template>
2
+	<view class="uni-navbar">
3
+		<view :class="{ 'uni-navbar--fixed': fixed, 'uni-navbar--shadow': shadow, 'uni-navbar--border': border }" :style="{ 'background-color': backgroundColor }"
4
+		 class="uni-navbar__content">
5
+			<uni-status-bar v-if="statusBar" />
6
+			<view :style="{ color: color,backgroundColor: backgroundColor }" class="uni-navbar__header uni-navbar__content_view">
7
+				<view @tap="onClickLeft" class="uni-navbar__header-btns uni-navbar__header-btns-left uni-navbar__content_view">
8
+					<view class="uni-navbar__content_view" v-if="leftIcon.length">
9
+						<uni-icons :color="color" :type="leftIcon" size="24" />
10
+					</view>
11
+					<view :class="{ 'uni-navbar-btn-icon-left': !leftIcon.length }" class="uni-navbar-btn-text uni-navbar__content_view"
12
+					 v-if="leftText.length">
13
+						<text :style="{ color: color, fontSize: '14px' }">{{ leftText }}</text>
14
+					</view>
15
+					<slot name="left" />
16
+				</view>
17
+				<view class="uni-navbar__header-container uni-navbar__content_view">
18
+					<view class="uni-navbar__header-container-inner uni-navbar__content_view" v-if="title.length">
19
+						<text class="uni-nav-bar-text" :style="{color: color }">{{ title }}</text>
20
+					</view>
21
+					<!-- 标题插槽 -->
22
+					<slot />
23
+				</view>
24
+				<view :class="title.length ? 'uni-navbar__header-btns-right' : ''" @tap="onClickRight" class="uni-navbar__header-btns uni-navbar__content_view">
25
+					<view class="uni-navbar__content_view" v-if="rightIcon.length">
26
+						<uni-icons :color="color" :type="rightIcon" size="24" />
27
+					</view>
28
+					<!-- 优先显示图标 -->
29
+					<view class="uni-navbar-btn-text uni-navbar__content_view" v-if="rightText.length && !rightIcon.length">
30
+						<text class="uni-nav-bar-right-text">{{ rightText }}</text>
31
+					</view>
32
+					<slot name="right" />
33
+				</view>
34
+			</view>
35
+		</view>
36
+		<view class="uni-navbar__placeholder" v-if="fixed">
37
+			<uni-status-bar v-if="statusBar" />
38
+			<view class="uni-navbar__placeholder-view" />
39
+		</view>
40
+	</view>
41
+</template>
42
+
43
+<script>
44
+	import uniStatusBar from "../uni-status-bar/uni-status-bar.vue";
45
+	import uniIcons from "../uni-icons/uni-icons.vue";
46
+
47
+	export default {
48
+		name: "UniNavBar",
49
+		components: {
50
+			uniStatusBar,
51
+			uniIcons
52
+		},
53
+		props: {
54
+			title: {
55
+				type: String,
56
+				default: ""
57
+			},
58
+			leftText: {
59
+				type: String,
60
+				default: ""
61
+			},
62
+			rightText: {
63
+				type: String,
64
+				default: ""
65
+			},
66
+			leftIcon: {
67
+				type: String,
68
+				default: ""
69
+			},
70
+			rightIcon: {
71
+				type: String,
72
+				default: ""
73
+			},
74
+			fixed: {
75
+				type: [Boolean, String],
76
+				default: false
77
+			},
78
+			color: {
79
+				type: String,
80
+				default: "#000000"
81
+			},
82
+			backgroundColor: {
83
+				type: String,
84
+				default: "#FFFFFF"
85
+			},
86
+			statusBar: {
87
+				type: [Boolean, String],
88
+				default: false
89
+			},
90
+			shadow: {
91
+				type: [String, Boolean],
92
+				default: false
93
+			},
94
+			border: {
95
+				type: [String, Boolean],
96
+				default: true
97
+			}
98
+		},
99
+        mounted() {
100
+          if(uni.report && this.title !== '') {
101
+              uni.report('title', this.title)
102
+          }
103
+        },
104
+		methods: {
105
+			onClickLeft() {
106
+				this.$emit("clickLeft");
107
+			},
108
+			onClickRight() {
109
+				this.$emit("clickRight");
110
+			}
111
+		}
112
+	};
113
+</script>
114
+
115
+<style lang="scss" scoped>
116
+	$nav-height: 44px;
117
+	.uni-nav-bar-text {
118
+		/* #ifdef APP-PLUS */
119
+		font-size: 34rpx;
120
+		/* #endif */
121
+		/* #ifndef APP-PLUS */
122
+		font-size: $uni-font-size-lg;
123
+		/* #endif */
124
+	}
125
+	.uni-nav-bar-right-text {
126
+		font-size: $uni-font-size-base;
127
+	}
128
+
129
+	.uni-navbar {
130
+		width: 750rpx;
131
+	}
132
+
133
+	.uni-navbar__content {
134
+		position: relative;
135
+		width: 750rpx;
136
+		background-color: $uni-bg-color;
137
+		overflow: hidden;
138
+	}
139
+
140
+	.uni-navbar__content_view {
141
+		/* #ifndef APP-NVUE */
142
+		display: flex;
143
+		/* #endif */
144
+		align-items: center;
145
+		flex-direction: row;
146
+		// background-color: #FFFFFF;
147
+	}
148
+
149
+	.uni-navbar__header {
150
+		/* #ifndef APP-NVUE */
151
+		display: flex;
152
+		/* #endif */
153
+		flex-direction: row;
154
+		width: 750rpx;
155
+		height: $nav-height;
156
+		line-height: $nav-height;
157
+		font-size: 16px;
158
+		// background-color: #ffffff;
159
+	}
160
+
161
+	.uni-navbar__header-btns {
162
+		/* #ifndef APP-NVUE */
163
+		display: flex;
164
+		/* #endif */
165
+		flex-wrap: nowrap;
166
+		width: 120rpx;
167
+		padding: 0 6px;
168
+		justify-content: center;
169
+		align-items: center;
170
+	}
171
+
172
+	.uni-navbar__header-btns-left {
173
+		/* #ifndef APP-NVUE */
174
+		display: flex;
175
+		/* #endif */
176
+		width: 150rpx;
177
+		justify-content: flex-start;
178
+	}
179
+
180
+	.uni-navbar__header-btns-right {
181
+		/* #ifndef APP-NVUE */
182
+		display: flex;
183
+		/* #endif */
184
+		width: 150rpx;
185
+		padding-right: 30rpx;
186
+		justify-content: flex-end;
187
+	}
188
+
189
+	.uni-navbar__header-container {
190
+		flex: 1;
191
+	}
192
+
193
+	.uni-navbar__header-container-inner {
194
+		/* #ifndef APP-NVUE */
195
+		display: flex;
196
+		/* #endif */
197
+		flex: 1;
198
+		align-items: center;
199
+		justify-content: center;
200
+		font-size: $uni-font-size-base;
201
+	}
202
+
203
+
204
+	.uni-navbar__placeholder-view {
205
+		height: $nav-height;
206
+	}
207
+
208
+	.uni-navbar--fixed {
209
+		position: fixed;
210
+		z-index: 998;
211
+	}
212
+
213
+	.uni-navbar--shadow {
214
+		/* #ifndef APP-NVUE */
215
+		box-shadow: 0 1px 6px #ccc;
216
+		/* #endif */
217
+	}
218
+
219
+	.uni-navbar--border {
220
+		border-bottom-width: 1rpx;
221
+		border-bottom-style: solid;
222
+		border-bottom-color: $uni-border-color;
223
+	}
224
+</style>

+ 9 - 0
src/components/uni-popup/config.json

@@ -0,0 +1,9 @@
1
+{
2
+	"id":"329",
3
+	"name":"PopUp",
4
+	"desc":"弹出层",
5
+	"url":"popup",
6
+	"edition":"1.1.3",
7
+	"path":"https://ext.dcloud.net.cn/plugin?id=329",
8
+	"update_log":"- 新增 打开关闭弹窗的回调事件"
9
+}

+ 86 - 0
src/components/uni-popup/readme.md

@@ -0,0 +1,86 @@
1
+## Popup 弹出层
2
+
3
+弹出层组件,为了解决遮罩弹层的问题。组件名:``uni-popup``,代码块: uPopup。
4
+
5
+
6
+**使用方式:**
7
+
8
+在 ``script`` 中引用组件 
9
+
10
+```javascript
11
+import uniPopup from "@/components/uni-popup/uni-popup.vue"
12
+export default {
13
+    components: {uniPopup}
14
+}
15
+```
16
+
17
+**基本用法**
18
+
19
+```html
20
+<uni-popup ref="popup" type="bottom">底部弹出 Popup</uni-popup>
21
+```
22
+
23
+**属性说明:**
24
+
25
+|  属性名	|    类型	| 默认值| 说明															|
26
+| ---		| ---		| ---	| ---															|
27
+| animation	| Boolean	|true	| 是否开启动画													|
28
+| type		| String	|center	| 弹出方式,可选值:top(顶部),center(居中),bottom(底部)	|
29
+| show		| Boolean	|false	| 显示弹窗	|
30
+| custom	| Boolean	|false	| 是否自定义内容												|
31
+| maskClick	| Boolean	|true	| 蒙版点击是否关闭弹窗											|
32
+| change	| function	|true	| 打开关闭弹窗触发											|
33
+
34
+
35
+**方法说明:**
36
+通过 `ref` 获取组件方法
37
+
38
+|方法称名	|说明		|
39
+|---		|----		|
40
+|open		|打开弹出层	|
41
+|close		|关闭弹出层	|
42
+
43
+```html
44
+<view>
45
+	<button @click="openPopup">打开弹出层</button>
46
+	<uni-popup ref="popup" type="center">
47
+		弹出层示例
48
+		<button @click="closePopup">关闭弹出层</button>
49
+	</uni-popup>
50
+</view>
51
+```
52
+
53
+```javascript
54
+export default {
55
+	methods:{
56
+		openPopup(){
57
+			this.$refs.popup.open()
58
+		},
59
+		closePopup(){
60
+			this.$refs.popup.close()
61
+		}
62
+	}
63
+}
64
+```
65
+
66
+Tips 
67
+- show 的作用与 open() 效果一致 ,在使用中显示弹窗二者只能选择其一。如果使用 show 显示弹窗,那么关闭弹窗时,应将 show 置为 false
68
+
69
+### 更新日志
70
+**1.1.3**
71
+- 新增 打开关闭弹窗的回调事件
72
+
73
+**1.1.2**
74
+- 新增 显示弹窗属性
75
+- 修复 h5 取消导航栏,顶部空白问题
76
+
77
+**1.1.1**
78
+- 修复 图片不显示的问题
79
+
80
+**1.1.0**
81
+- 新增 动画效果
82
+- 修复 示例底部弹出样式错乱的 bug
83
+- 优化 代码重构 可完全自定义内容
84
+
85
+**1.0.0**
86
+- 初始化项目

+ 212 - 0
src/components/uni-popup/uni-popup.vue

@@ -0,0 +1,212 @@
1
+<template>
2
+  <view
3
+    v-if="showPopup"
4
+    class="uni-popup"
5
+	@touchmove.stop.prevent="">
6
+    <view
7
+      :class="[ani, animation ? 'ani' : '', !custom ? 'uni-custom' : '']"
8
+      class="uni-popup__mask"
9
+      @click="close(true)" />
10
+    <view
11
+      :class="[type, ani, animation ? 'ani' : '', !custom ? 'uni-custom' : '']"
12
+      class="uni-popup__wrapper"
13
+      @click="close(true)">
14
+      <view
15
+        class="uni-popup__wrapper-box"
16
+        @click.stop="clear">
17
+        <slot />
18
+      </view>
19
+    </view>
20
+  </view>
21
+</template>
22
+
23
+<script>
24
+export default {
25
+  name: 'UniPopup',
26
+  props: {
27
+    // 开启动画
28
+    animation: {
29
+      type: Boolean,
30
+      default: true
31
+    },
32
+    // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层,
33
+    type: {
34
+      type: String,
35
+      default: 'center'
36
+    },
37
+    // 是否开启自定义
38
+    custom: {
39
+      type: Boolean,
40
+      default: false
41
+    },
42
+    // maskClick
43
+    maskClick: {
44
+      type: Boolean,
45
+      default: true
46
+    },
47
+    show: {
48
+      type: Boolean,
49
+      default: true
50
+    }
51
+  },
52
+  data () {
53
+    return {
54
+      ani: '',
55
+      showPopup: false
56
+    }
57
+  },
58
+  watch: {
59
+    show (newValue) {
60
+      if (newValue) {
61
+        this.open()
62
+      } else {
63
+        this.close()
64
+      }
65
+    }
66
+  },
67
+  created () {},
68
+  methods: {
69
+    clear () {},
70
+    open () {
71
+      this.$emit('change', {
72
+        show: true
73
+      })
74
+      this.showPopup = true
75
+      this.$nextTick(() => {
76
+        setTimeout(() => {
77
+          this.ani = 'uni-' + this.type
78
+        }, 30)
79
+      })
80
+    },
81
+    close (type) {
82
+      if (!this.maskClick && type) return
83
+      this.$emit('change', {
84
+        show: false
85
+      })
86
+      this.ani = ''
87
+      this.$nextTick(() => {
88
+        setTimeout(() => {
89
+          this.showPopup = false
90
+        }, 300)
91
+      })
92
+    }
93
+  }
94
+}
95
+</script>
96
+<style lang="scss">
97
+.uni-popup {
98
+  position: fixed;
99
+  /*  #ifdef  H5  */
100
+  top: 0px;
101
+  // top: 50px;
102
+  /*  #endif  */
103
+  /*  #ifndef  H5  */
104
+  top: 0px;
105
+  /*  #endif  */
106
+  bottom: 0;
107
+  left: 0;
108
+  right: 0;
109
+  z-index: 99999;
110
+  overflow: hidden;
111
+
112
+  &__mask {
113
+    position: absolute;
114
+    top: 0;
115
+    bottom: 0;
116
+    left: 0;
117
+    right: 0;
118
+    z-index: 998;
119
+    background: rgba(0, 0, 0, 0.4);
120
+    opacity: 0;
121
+
122
+    &.ani {
123
+      transition: all 0.3s;
124
+    }
125
+
126
+    &.uni-top,
127
+    &.uni-bottom,
128
+    &.uni-center {
129
+      opacity: 1;
130
+    }
131
+  }
132
+
133
+  &__wrapper {
134
+    position: absolute;
135
+    z-index: 999;
136
+    box-sizing: border-box;
137
+
138
+    &.ani {
139
+      transition: all 0.3s;
140
+    }
141
+
142
+    &.top {
143
+      top: 0;
144
+      left: 0;
145
+      width: 100%;
146
+      transform: translateY(-100%);
147
+    }
148
+
149
+    &.bottom {
150
+      bottom: 0;
151
+      left: 0;
152
+      width: 100%;
153
+      transform: translateY(100%);
154
+    }
155
+    &.right {
156
+      bottom: 0;
157
+      left: 0;
158
+      width: 70%;
159
+      transform: translateY(100%);
160
+    }
161
+    &.center {
162
+      width: 100%;
163
+      height: 100%;
164
+      display: flex;
165
+      justify-content: center;
166
+      align-items: center;
167
+      transform: scale(1.2);
168
+      opacity: 0;
169
+    }
170
+
171
+    &-box {
172
+      position: relative;
173
+      box-sizing: border-box;
174
+    }
175
+
176
+    &.uni-custom {
177
+      & .uni-popup__wrapper-box {
178
+				border-radius: 20upx 20upx 0 0;
179
+        padding: 30upx;
180
+        background: #fff;
181
+      }
182
+
183
+      &.center {
184
+        & .uni-popup__wrapper-box {
185
+          position: relative;
186
+          max-width: 80%;
187
+          max-height: 80%;
188
+          overflow-y: scroll;
189
+        }
190
+      }
191
+      &.top,
192
+      &.bottom {
193
+        & .uni-popup__wrapper-box {
194
+          width: 100%;
195
+          max-height: 1000upx;
196
+          // overflow-y: scroll;
197
+        }
198
+      }
199
+    }
200
+
201
+    &.uni-top,
202
+    &.uni-bottom {
203
+      transform: translateY(0);
204
+    }
205
+
206
+    &.uni-center {
207
+      transform: scale(1);
208
+      opacity: 1;
209
+    }
210
+  }
211
+}
212
+</style>

+ 208 - 0
src/components/uni-popup/uni-popup_nobg.vue

@@ -0,0 +1,208 @@
1
+<template>
2
+  <view
3
+    v-if="showPopup"
4
+    class="uni-popup"
5
+	@touchmove.stop.prevent="">
6
+    <view
7
+      :class="[ani, animation ? 'ani' : '', !custom ? 'uni-custom' : '']"
8
+      class="uni-popup__mask"
9
+      @click="close(true)" />
10
+    <view
11
+      :class="[type, ani, animation ? 'ani' : '', !custom ? 'uni-custom' : '']"
12
+      class="uni-popup__wrapper"
13
+      @click="close(true)">
14
+      <view
15
+        class="uni-popup__wrapper-box"
16
+        @click.stop="clear">
17
+        <slot />
18
+      </view>
19
+    </view>
20
+  </view>
21
+</template>
22
+
23
+<script>
24
+export default {
25
+  name: 'UniPopup',
26
+  props: {
27
+    // 开启动画
28
+    animation: {
29
+      type: Boolean,
30
+      default: true
31
+    },
32
+    // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
33
+    type: {
34
+      type: String,
35
+      default: 'center'
36
+    },
37
+    // 是否开启自定义
38
+    custom: {
39
+      type: Boolean,
40
+      default: false
41
+    },
42
+    // maskClick
43
+    maskClick: {
44
+      type: Boolean,
45
+      default: true
46
+    },
47
+    show: {
48
+      type: Boolean,
49
+      default: true
50
+    }
51
+  },
52
+  data () {
53
+    return {
54
+      ani: '',
55
+      showPopup: false
56
+    }
57
+  },
58
+  watch: {
59
+    show (newValue) {
60
+      if (newValue) {
61
+        this.open()
62
+      } else {
63
+        this.close()
64
+      }
65
+    }
66
+  },
67
+  created () {},
68
+  methods: {
69
+    clear () {},
70
+    open () {
71
+      this.$emit('change', {
72
+        show: true
73
+      })
74
+      this.showPopup = true
75
+      this.$nextTick(() => {
76
+        setTimeout(() => {
77
+          this.ani = 'uni-' + this.type
78
+        }, 30)
79
+      })
80
+    },
81
+    close (type) {
82
+      if (!this.maskClick && type) return
83
+      this.$emit('change', {
84
+        show: false
85
+      })
86
+      this.ani = ''
87
+      this.$nextTick(() => {
88
+        setTimeout(() => {
89
+          this.showPopup = false
90
+        }, 300)
91
+      })
92
+    }
93
+  }
94
+}
95
+</script>
96
+<style lang="scss">
97
+.uni-popup {
98
+  position: fixed;
99
+  /*  #ifdef  H5  */
100
+  top: 0px;
101
+  // top: 50px;
102
+  /*  #endif  */
103
+  /*  #ifndef  H5  */
104
+  top: 0px;
105
+  /*  #endif  */
106
+  bottom: 0;
107
+  left: 0;
108
+  right: 0;
109
+  z-index: 99999;
110
+  overflow: hidden;
111
+
112
+  &__mask {
113
+    position: absolute;
114
+    top: 0;
115
+    bottom: 0;
116
+    left: 0;
117
+    right: 0;
118
+    z-index: 998;
119
+    background: rgba(0, 0, 0, 0.4);
120
+    opacity: 0;
121
+
122
+    &.ani {
123
+      transition: all 0.3s;
124
+    }
125
+
126
+    &.uni-top,
127
+    &.uni-bottom,
128
+    &.uni-center {
129
+      opacity: 1;
130
+    }
131
+  }
132
+
133
+  &__wrapper {
134
+    position: absolute;
135
+    z-index: 999;
136
+    box-sizing: border-box;
137
+
138
+    &.ani {
139
+      transition: all 0.3s;
140
+    }
141
+
142
+    &.top {
143
+      top: 0;
144
+      left: 0;
145
+      width: 100%;
146
+      transform: translateY(-100%);
147
+    }
148
+
149
+    &.bottom {
150
+      bottom: 0;
151
+      left: 0;
152
+      width: 100%;
153
+      transform: translateY(100%);
154
+    }
155
+
156
+    &.center {
157
+      width: 100%;
158
+      height: 100%;
159
+      display: flex;
160
+      justify-content: center;
161
+      align-items: center;
162
+      transform: scale(1.2);
163
+      opacity: 0;
164
+    }
165
+
166
+    &-box {
167
+      position: relative;
168
+      box-sizing: border-box;
169
+    }
170
+
171
+    &.uni-custom {
172
+      & .uni-popup__wrapper-box {
173
+		border-radius: 20upx 20upx 0 0;
174
+        padding: 30upx;
175
+        // background: #fff;
176
+      }
177
+
178
+      &.center {
179
+        & .uni-popup__wrapper-box {
180
+          position: relative;
181
+          max-width: 80%;
182
+          max-height: 80%;
183
+          overflow-y: scroll;
184
+        }
185
+      }
186
+
187
+      &.top,
188
+      &.bottom {
189
+        & .uni-popup__wrapper-box {
190
+          width: 100%;
191
+          max-height: 1000upx;
192
+          // overflow-y: scroll;
193
+        }
194
+      }
195
+    }
196
+
197
+    &.uni-top,
198
+    &.uni-bottom {
199
+      transform: translateY(0);
200
+    }
201
+
202
+    &.uni-center {
203
+      transform: scale(1);
204
+      opacity: 1;
205
+    }
206
+  }
207
+}
208
+</style>

+ 204 - 0
src/components/volunteer-navtabs.vue

@@ -0,0 +1,204 @@
1
+<template>
2
+	<view>
3
+		<!-- {{reciveUserInfo}} -->
4
+		<view class="sticky-box">
5
+			<!-- 滑动区域 -->
6
+			<scroll-view class="scroll-view_H" style="width: 100%;" scroll-x="true" scroll-with-animation :scroll-left="tabsScrollLeft"
7
+			 @scroll="scroll">
8
+				<view  class="tab" id="tab_list">
9
+					
10
+					<view :class="{ 'active': listActive == -1,'tab__item':true}"
11
+					 :key="-1" @click="clickSort(-1,-1)">
12
+						全部
13
+					</view>
14
+					<view id="itemlist" :class="{ 'active': listActive == index,'tab__item':true}" v-for="(item, index) in listArr"
15
+					 :key="index" @click="clickSort(item.merchant_category_id,index)">
16
+						{{item.category_name}}
17
+					</view>
18
+				</view>
19
+			
20
+			</scroll-view>
21
+			<!-- 全部按钮 -->
22
+			<!-- <view class="listAll">
23
+		        <image src="../../static/images/all_filter.png" style="width: 36rpx; height: 36rpx;" mode="aspectFill"></image>
24
+		        全部
25
+		    </view> -->
26
+		</view>
27
+	</view>
28
+</template>
29
+
30
+<script>
31
+	import {
32
+		getVolunteermercat,
33
+	} from "@/api/api.js";
34
+	export default {
35
+		props:['reciveUserInfo'],
36
+		data() {
37
+			return {
38
+				listArr: [],
39
+				listActive: -1, // 当前选中项
40
+				tabsScrollLeft: 0, // tabs当前偏移量
41
+				scrollLeft: 0,
42
+				lineStyle: {}, // 下划线位置--动态甲酸
43
+				duration: 0.2, // 下划线动画时长
44
+				itemId: ''
45
+			};
46
+		},
47
+		watch: {
48
+			listActive(newVal) {
49
+				// 监听当前选中项
50
+				this.setTabList()
51
+			}
52
+		},
53
+
54
+		mounted() {
55
+			this.getmercat();
56
+			// this.setTabList(); //计算css
57
+		},
58
+		created() {
59
+			console.log('接收的父传值',this.pendata);
60
+			//进入页面传入父组件的默认参数是0
61
+			this.$emit("gettabs", this.listActive)
62
+		},
63
+		methods: {
64
+			//志愿者分类
65
+			getmercat() {
66
+				getVolunteermercat().then(res => {
67
+					console.log(res);
68
+					this.listArr = res.data.list
69
+				})
70
+			},
71
+			//点击分类
72
+			clickSort(item, index) {
73
+				this.listActive = index
74
+				
75
+				this.itemId = item //获取当前点击的id
76
+				
77
+				this.$emit("gettabs", this.itemId) // 传给父组件的当前分类的id
78
+				console.log('接收的父传值',this.pendata,'当前点击的是==', this.itemId);
79
+			},
80
+			// scroll-view滑动事件
81
+			scroll(e) {
82
+				this.scrollLeft = e.detail.scrollLeft;
83
+			},
84
+			//nexttick 是dom更新后
85
+			setTabList() {
86
+				this.$nextTick(() => {
87
+					this.setLine(); //计算下划线
88
+					this.scrollIntoView(); //计算tabs的位置
89
+				})
90
+			},
91
+			// 计算tabs位置
92
+			scrollIntoView() { // item滚动
93
+				let lineLeft = 0;
94
+				this.getElementData('#tab_list', (data) => {
95
+					// console.log(data[0],'data');
96
+					let list = data[0]
97
+					this.getElementData(`#itemlist`, (data) => {
98
+						// console.log(data,'data2');
99
+						let el = data[this.listActive]
100
+						// console.log(el,'elelelelel');
101
+						lineLeft = el.width / 2 + (-list.left) + el.left - list.width / 2 - this.scrollLeft
102
+						this.tabsScrollLeft = this.scrollLeft + lineLeft
103
+					})
104
+				})
105
+			},
106
+			//  计算下划线位置
107
+			setLine() {
108
+				let lineWidth = 0,
109
+					lineLeft = 0
110
+				this.getElementData(`#itemlist`, (data) => {
111
+					console.log(data, 'data132');
112
+					let el = data[this.listActive]
113
+					lineWidth = el.width / 2
114
+					// lineLeft = el.width * (this.currentIndex + 0.5)  // 此种只能针对每个item长度一致的
115
+					lineLeft = el.width / 2 + (-data[0].left) + el.left
116
+					this.lineStyle = {
117
+						width: `${lineWidth}px`,
118
+						transform: `translateX(${lineLeft}px) translateX(-50%)`,
119
+						transitionDuration: `${this.duration}s`
120
+					};
121
+				})
122
+			},
123
+			getElementData(el, callback) {
124
+				uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
125
+					callback(data[0]);
126
+				});
127
+			},
128
+		},
129
+	}
130
+	// }
131
+</script>
132
+
133
+<style scoped lang="scss">
134
+	.sticky-box {
135
+		/* #ifndef APP-PLUS-NVUE */
136
+		display: flex;
137
+		position: -webkit-sticky;
138
+		/* #endif */
139
+		position: sticky;
140
+		top: var(--window-top);
141
+		z-index: 99;
142
+		flex-direction: row;
143
+		margin: 0px;
144
+		border-top: 1px #f9f9f9 solid;
145
+		border-bottom: 1px #f9f9f9 solid;
146
+		background: #fff;
147
+	}
148
+
149
+	.listAll {
150
+		width: 20%;
151
+		text-indent: 62rpx;
152
+		font-size: 30rpx;
153
+		border-left: 1px #eee solid;
154
+		margin: 1% 0;
155
+		padding: 5rpx;
156
+		position: relative;
157
+
158
+		image {
159
+			position: absolute;
160
+			left: 20rpx;
161
+			top: 8rpx;
162
+		}
163
+	}
164
+
165
+	.tab {
166
+		position: relative;
167
+		display: flex;
168
+		font-size: 28rpx;
169
+		padding-bottom: 10rpx;
170
+		white-space: nowrap;
171
+
172
+		&__item {
173
+			flex: 1;
174
+			padding: 0 20rpx;
175
+			text-align: center;
176
+			height: 60rpx;
177
+			line-height: 60rpx;
178
+			color: #666;
179
+
180
+			&.active {
181
+				color: #09C2C9;
182
+				border-bottom: 1px #09C2C9 solid;
183
+			}
184
+		}
185
+	}
186
+
187
+	.tab__line {
188
+		display: block;
189
+		height: 6rpx;
190
+		position: absolute;
191
+		bottom: 0;
192
+		left: 0;
193
+		z-index: 1;
194
+		border-radius: 3rpx;
195
+		position: relative;
196
+		background: #2FC6CD;
197
+	}
198
+
199
+	.scroll-view_H {
200
+		/* 文本不会换行,文本会在在同一行上继续,直到遇到 <br> 标签为止。 */
201
+		white-space: nowrap;
202
+		width: 100%;
203
+	}
204
+</style>

+ 42 - 0
src/config/app.js

@@ -0,0 +1,42 @@
1
+// #ifdef H5
2
+let VUE_APP_WS_URL = `ws://${location.hostname}?type=user`
3
+// #endif
4
+
5
+// 网络接口修改此字符 小程序域名要求https
6
+
7
+// let httpApi = 'https://mer1.crmeb.net'
8
+let httpApi = 'https://test.bjtdba.com'
9
+// let httpApi = 'https://test.bjtdba.com'
10
+// <<<<<<< HEAD
11
+// =======
12
+// let httpApi = 'https://test.bjtdba.com'
13
+// >>>>>>> f98f09c787590318f93818f83bea1dbdb229a99f
14
+
15
+
16
+// let httpApi = 'http://192.168.1.77:8324'
17
+
18
+
19
+// 聊天接口修改此字符 小程序聊天要求wss 例如:wss://mer.crmeb.net
20
+let wsApi = ''
21
+
22
+module.exports = {
23
+	// 请求域名 格式: https://您的域名
24
+	// HTTP_REQUEST_URL: httpApi,
25
+	HTTP_REQUEST_URL: httpApi,
26
+	VUE_APP_WS_URL: `${wsApi}?type=user`,
27
+
28
+	// #ifdef H5
29
+	//H5接口是浏览器地址
30
+	HTTP_REQUEST_URL: httpApi ||  window.location.protocol + "//" + window.location.host,
31
+	// 聊天长连接地址
32
+	VUE_APP_WS_URL:  wsApi?  `${wsApi}?type=user` : VUE_APP_WS_URL,
33
+	// #endif
34
+
35
+	HEADER: {
36
+		'content-type': 'application/json'
37
+	},
38
+	// 回话密钥名称 请勿修改此配置
39
+	TOKENNAME: 'X-Token',
40
+	// 缓存时间 0 永久
41
+	EXPIRE: 0,
42
+};

+ 32 - 0
src/config/cache.js

@@ -0,0 +1,32 @@
1
+module.exports = {
2
+	//token
3
+	LOGIN_STATUS: 'LOGIN_STATUS_TOKEN',
4
+	// uid
5
+	UID:'UID',
6
+	//�û�
7
+	USER_INFO: 'USER_INFO',
8
+	//token�����¼�
9
+	EXPIRES_TIME: 'EXPIRES_TIME',
10
+	//�Ƿ���Ȩ
11
+	WX_AUTH: 'WX_AUTH',
12
+	//���ں���Ȩcode
13
+	STATE_KEY: 'wx_authorize_state',
14
+	//�û�����
15
+	LOGINTYPE: 'loginType',
16
+	//���ں���ת����
17
+	BACK_URL: 'login_back_url',
18
+	// ����code
19
+	STATE_R_KEY: 'roution_authorize_state',
20
+	//��ȨlogoС����
21
+	LOGO_URL: 'LOGO_URL',
22
+	//模板缓存
23
+	SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE',
24
+
25
+	TIPS_KEY: 'TIPS_KEY',
26
+
27
+	SPREAD: 'spread',
28
+	//缓存经度
29
+	CACHE_LONGITUDE: 'LONGITUDE',
30
+	//缓存纬度
31
+	CACHE_LATITUDE: 'LATITUDE',
32
+}

+ 77 - 0
src/config/richText.js

@@ -0,0 +1,77 @@
1
+/*
2
+graceUI rich-text 加强工具
3
+link : graceui.hcoder.net
4
+author : 5213606@qq.com 深海
5
+
6
+版权声明 : 
7
+GraceUI 的版权约束是不能转售或者将 GraceUI 直接发布到公开渠道!
8
+侵权必究,请遵守版权约定!
9
+*/
10
+
11
+// 正则变量
12
+var graceRichTextReg;
13
+
14
+// 批量替换的样式 [ 根据项目需求自行设置 ]
15
+var GRT = [
16
+	// div 样式
17
+	['div', ""],
18
+	// h1 样式
19
+	['h1', "font-size:3em; line-height:1.5em;"],
20
+	// h2 样式
21
+	['h2', "font-size:2em; line-height:1.8em;"],
22
+	// h3 样式
23
+	['h3', "font-size:1.6em; line-height:2em;"],
24
+	// h4 样式
25
+	['h4', "font-size:1.2em; line-height:2em;"],
26
+	// h5 样式
27
+	['h5', "font-size:1em; line-height:2em;"],
28
+	// h6 样式
29
+	['h6', "font-size:0.9em; line-height:2em;"],
30
+	// p 样式
31
+	['p', ""],
32
+	// b 样式
33
+	['b', "font-size:1em; line-height:2em;"],
34
+	// strong 样式
35
+	['strong', "font-size:1em; line-height:2em;"],
36
+	// code 样式
37
+	['code', "font-size:1em; line-height:1.2em; background:#F6F7F8; padding:8px 2%; width:96%;"],
38
+	// img 样式
39
+	['img', "width:100%;margin: -5px 0;"],
40
+	// blockquote
41
+	['blockquote', "font-size:1em; border-left:3px solid #D1D1D1; line-height:2em; border-radius:5px; background:#F6F7F8; padding:8px 2%;"],
42
+	// li 样式
43
+	['ul', "padding:5px 0; list-style:none; padding:0; margin:0;"],
44
+	['li', "line-height:1.5em; padding:5px 0; list-style:none; padding:0; margin:0; margin-top:10px;"],
45
+	// table
46
+	['table', "width:100%; border-left:1px solid #F2F3F4; border-top:1px solid #F2F3F4;"],
47
+	['th', "border-right:1px solid #F2F3F4; border-bottom:1px solid #F2F3F4;"],
48
+	['td', "border-right:1px solid #F2F3F4; border-bottom:1px solid #F2F3F4; padding-left:5px;"]
49
+];
50
+
51
+
52
+module.exports = {
53
+	format : function(html){
54
+		html = html.replace(/<pre.*pre>?/gis, function(word){
55
+			word =  word.replace(/[\n]/gi,'<br />');
56
+			word =  word.replace(/    /gi,'<span style="padding-left:2em;"></span>');
57
+			return word.replace(/[\t]/gi, '<span style="padding-left:2em;"></span>');
58
+		});
59
+		html = html.replace(/<pre/gi, '<p style="font-size:1em; margin:12px 0; line-height:1.2em; background:#F6F7F8; border-radius:5px; padding:8px 4%; width:92%;"');
60
+		html = html.replace(/<\/pre/gi,"</p");
61
+		for(let i = 0; i < GRT.length; i++){
62
+			graceRichTextReg = new RegExp('<'+GRT[i][0]+'>|<'+GRT[i][0]+' (.*?)>', 'gi');
63
+			html = html.replace(graceRichTextReg , function(word){
64
+				// 分析 dom 上是否带有 style=""
65
+				if(word.indexOf('style=') != -1){
66
+					var regIn = new RegExp('<' + GRT[i][0] + '(.*?)style="(.*?)"(.*?)(/?)>', 'gi');
67
+					return word.replace(regIn, '<'+ GRT[i][0] +'$1style="$2 ' + GRT[i][1] +'"$3$4>');
68
+				}else{
69
+					var regIn = new RegExp('<' + GRT[i][0] + '(.*?)(/?)>', 'gi');
70
+					return word.replace(regIn, '<'+ GRT[i][0] +'$1 style="' + GRT[i][1] +'$2">');
71
+				}
72
+			});
73
+		}
74
+		return html;
75
+	}
76
+	
77
+}

+ 8 - 0
src/config/socket.js

@@ -0,0 +1,8 @@
1
+module.exports = {
2
+  // Socket链接 暂不做配置
3
+  WSS_SERVER_URL:'',
4
+  // Socket调试模式
5
+  SERVER_DEBUG:true,
6
+  // 心跳间隔
7
+  PINGINTERVAL:3000
8
+}

+ 81 - 0
src/config/validate.js

@@ -0,0 +1,81 @@
1
+const validate = (value, vtype) => {
2
+  if ('require' === vtype) {
3
+    return !!value;
4
+  }
5
+  if ('phone' === vtype) {
6
+    return /^1[2-9]\d{9}$/.test(value);
7
+  }
8
+  if ('captcha' === vtype) {
9
+    return /^[0-9]{6}$/.test(value);
10
+  }
11
+  if ('isnumber' === vtype) {
12
+    return /^[0-9]{5,11}$/.test(value);
13
+  }
14
+  if ('idcard' === vtype) {
15
+    return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value);
16
+  }
17
+  if ('password' === vtype) {
18
+    return /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9a-zA-Z]{6,12}$/.test(value);
19
+  }
20
+  if ('ismoney' === vtype) {
21
+    return /^(([1-9]\d*)|\d)(\.\d{1,2})?$/.test(value);
22
+  }
23
+  if ('email' === vtype) {
24
+    return /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);
25
+  }
26
+  if ('url' === vtype) {
27
+    return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value);
28
+  }
29
+  if ('card' === vtype) {
30
+    let bankno = value;
31
+    let lastNum = bankno.substr(bankno.length - 1, 1); //取出最后一位(与luhm进行比较)
32
+    let first15Num = bankno.substr(0, bankno.length - 1); //前15或18位
33
+    let newArr = [];
34
+
35
+    // 前15或18位倒序存进数组
36
+    for (let i = first15Num.length - 1; i > -1; i--) newArr.push(first15Num.substr(i, 1));
37
+
38
+    let arrJiShu = []; // 奇数位*2的积 <9
39
+    let arrJiShu2 = []; // 奇数位*2的积 >9
40
+    let arrOuShu = []; // 偶数位数组
41
+    for (let j = 0; j < newArr.length; j++) {
42
+      if ((j + 1) % 2 == 1) { //奇数位
43
+        if (parseInt(newArr[j]) * 2 < 9) arrJiShu.push(parseInt(newArr[j]) * 2);
44
+        else arrJiShu2.push(parseInt(newArr[j]) * 2);
45
+      } else  arrOuShu.push(newArr[j]); // 偶数位
46
+    }
47
+
48
+    let jishu_child1 = []; //奇数位*2 >9 的分割之后的数组个位数
49
+    let jishu_child2 = []; //奇数位*2 >9 的分割之后的数组十位数
50
+    for (let h = 0; h < arrJiShu2.length; h++) {
51
+      jishu_child1.push(parseInt(arrJiShu2[h]) % 10);
52
+      jishu_child2.push(parseInt(arrJiShu2[h]) / 10);
53
+    }
54
+
55
+    let sumJiShu = 0; //奇数位*2 < 9 的数组之和
56
+    let sumOuShu = 0; //偶数位数组之和
57
+    let sumJiShuChild1 = 0; //奇数位*2 >9 的分割之后的数组个位数之和
58
+    let sumJiShuChild2 = 0; //奇数位*2 >9 的分割之后的数组十位数之和
59
+    let sumTotal = 0;
60
+
61
+    for (let m = 0; m < arrJiShu.length; m++) sumJiShu = sumJiShu + parseInt(arrJiShu[m]);
62
+    for (let n = 0; n < arrOuShu.length; n++) sumOuShu = sumOuShu + parseInt(arrOuShu[n]);
63
+
64
+    for (let p = 0; p < jishu_child1.length; p++) {
65
+      sumJiShuChild1 = sumJiShuChild1 + parseInt(jishu_child1[p]);
66
+      sumJiShuChild2 = sumJiShuChild2 + parseInt(jishu_child2[p]);
67
+    }
68
+
69
+    //计算总和
70
+    sumTotal = parseInt(sumJiShu) + parseInt(sumOuShu) + parseInt(sumJiShuChild1) + parseInt(sumJiShuChild2);
71
+
72
+    //计算Luhm值
73
+    let k = parseInt(sumTotal) % 10 == 0 ? 10 : parseInt(sumTotal) % 10;
74
+    let luhm = 10 - k;
75
+    return lastNum == luhm;
76
+  }
77
+}
78
+
79
+export {
80
+  validate
81
+};

+ 14 - 0
src/lang/index.js

@@ -0,0 +1,14 @@
1
+/**
2
+ * @description 批量导入目录及其子目录下的所有文件
3
+ * */
4
+
5
+const modulesFiles = require.context('./',true,/\.js$/);
6
+const modules = modulesFiles.keys().reduce((modules,modulePath) => {
7
+  const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/,'$1');
8
+  if(moduleName === 'index') return modules;
9
+  const value = modulesFiles(modulePath);
10
+  modules['zh'][moduleName] = value.default.zh;
11
+  modules['en'][moduleName] = value.default.en;
12
+  return modules;
13
+},{zh: {},en: {}});
14
+export default modules;

+ 8 - 0
src/lang/rank/product-rank/rank-detail.js

@@ -0,0 +1,8 @@
1
+export default {
2
+	zh: {
3
+	  title: '热卖榜单',
4
+	},
5
+	en: {
6
+	  title: 'Hot Rank',
7
+	},
8
+}

+ 8 - 0
src/lang/rank/product-rank/rank-list.js

@@ -0,0 +1,8 @@
1
+export default {
2
+  zh: {
3
+    title: '测试呢多语言哟',
4
+  },
5
+  en: {
6
+    title: 'Test Language HaHa',
7
+  },
8
+}

+ 8 - 0
src/lang/tab/cart/cart-page.js

@@ -0,0 +1,8 @@
1
+export default {
2
+	zh: {
3
+	  bili: '哔哩哔哩',
4
+	},
5
+	en: {
6
+	  bili: 'bilibili',
7
+	},
8
+}

+ 8 - 0
src/lang/tab/cate/cate-three.js

@@ -0,0 +1,8 @@
1
+export default {
2
+	zh: {
3
+	  recom: '推荐分类',
4
+	},
5
+	en: {
6
+	  recom: 'Recoment classify',
7
+	},
8
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
src/libs/amap-wx.js


+ 91 - 0
src/libs/chat.js

@@ -0,0 +1,91 @@
1
+import $store from "@/store";
2
+import {
3
+	HTTP_REQUEST_URL,
4
+	VUE_APP_WS_URL
5
+} from "@/config/app.js";
6
+let wsUrl = `ws://app.bjtdba.com?type=user&token=${$store.state.app.token}`
7
+const Socket = function() {
8
+	this.ws = uni.connectSocket({
9
+		// #ifdef H5
10
+		url:wss(wsUrl),
11
+		// #endif
12
+		// #ifdef MP
13
+		url:wsUrl,
14
+		// #endif
15
+		header: {
16
+			'content-type': 'application/json'
17
+		},
18
+		method: 'GET',
19
+		success: (res) => {
20
+			console.log(res, 'success');
21
+		}
22
+	});
23
+	this.ws.onOpen(this.onSocketOpen.bind(this))
24
+	this.ws.onError(this.onError.bind(this));
25
+	this.ws.onMessage(this.onMessage.bind(this))
26
+	this.ws.onClose(this.onClose.bind(this));
27
+	// this.ws.close(this.close.bind(this));
28
+};
29
+
30
+// #ifdef H5
31
+function wss(wsSocketUrl) {
32
+	let ishttps = document.location.protocol == 'https:';
33
+	if (ishttps) {
34
+		return wsSocketUrl.replace('ws:', 'wss:');
35
+	} else {
36
+		return wsSocketUrl.replace('wss:', 'ws:');
37
+	}
38
+}
39
+// #endif
40
+
41
+
42
+
43
+Socket.prototype = {
44
+	// close() {
45
+	//   clearInterval(this.timer);
46
+	//   this.ws.close();
47
+	// },
48
+	onSocketOpen: function(my) {
49
+		this.init();
50
+		uni.$emit("socket_open");
51
+	},
52
+	init: function() {
53
+		var that = this;
54
+		this.timer = setInterval(function() {
55
+			that.send({
56
+				type: "ping"
57
+			});
58
+		}, 10000);
59
+	},
60
+	send: function(data) {
61
+		let datas = JSON.stringify(data)
62
+		return uni.sendSocketMessage({
63
+			data: datas
64
+		});
65
+	},
66
+	onMessage: function(res) {
67
+		console.log(JSON.parse(res.data), 'onMessage')
68
+		const {
69
+			type,
70
+			data = {}
71
+		} = JSON.parse(res.data);
72
+		uni.$emit(type, data)
73
+	},
74
+
75
+	onClose: function() {
76
+		uni.closeSocket();
77
+		clearInterval(this.timer);
78
+		uni.$emit("socket_close");
79
+	},
80
+	onError: function(e) {
81
+		console.log(e);
82
+		uni.$emit("socket_error", e);
83
+	},
84
+	close: function() {
85
+		uni.closeSocket();
86
+	}
87
+};
88
+
89
+Socket.prototype.constructor = Socket;
90
+
91
+export default Socket;

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
src/libs/day.js


+ 117 - 0
src/libs/login.js

@@ -0,0 +1,117 @@
1
+import store from "../store";
2
+import Cache from '../utils/cache';
3
+// #ifdef H5 || APP-PLUS
4
+import { isWeixin } from "../utils";
5
+import auth from './wechat';
6
+// #endif
7
+
8
+import { LOGIN_STATUS, USER_INFO, EXPIRES_TIME, STATE_R_KEY} from './../config/cache';
9
+
10
+function prePage(){
11
+	let pages = getCurrentPages();
12
+	let prePage = pages[pages.length - 2];
13
+	// #ifdef H5
14
+	return prePage;
15
+	// #endif
16
+	//return prePage.$vm;
17
+}
18
+// 易熵易物
19
+export function easyToLogin(push, pathLogin) {
20
+	store.commit("LOGOUT");
21
+	let path = prePage();
22
+	if(path){
23
+		path = path.router;
24
+		if(path == undefined){
25
+			path = location.pathname;
26
+		}
27
+	}  
28
+		
29
+	else{
30
+		path = location.pathname;
31
+	} 
32
+		
33
+		
34
+	if(!pathLogin)
35
+		pathLogin = '/pages/users/login/index'
36
+	Cache.set('login_back_url',path);
37
+	// #ifdef H5 || APP-PLUS
38
+	// if (isWeixin()) {
39
+	// 	auth.oAuth();
40
+	// } else {
41
+		if (path !== pathLogin) {
42
+		 push ? uni.navigateTo({
43
+		 	url:'/pages/users/login/index'
44
+		 }) : uni.navigateTo({
45
+		 	url: '/pages/users/login/index'
46
+		 });
47
+		}
48
+	//}
49
+	// #endif
50
+	
51
+	// #ifdef MP 
52
+	
53
+	
54
+	// #endif
55
+}
56
+
57
+export function toLogin(push, pathLogin) {
58
+	store.commit("LOGOUT");
59
+	let path = prePage();
60
+	if(path){
61
+		path = path.router;
62
+		if(path == undefined){
63
+			path = location.pathname;
64
+		}
65
+	}  
66
+		// #ifdef H5
67
+	else{
68
+		path = location.pathname;
69
+	} 
70
+		// #endif
71
+		
72
+	if(!pathLogin)
73
+		pathLogin = '/pages/users/login/index'
74
+	Cache.set('login_back_url',path);
75
+	// #ifdef H5 || APP-PLUS
76
+	// if (isWeixin()) {
77
+	// 	auth.oAuth();
78
+	// } else {
79
+		if (path !== pathLogin) {
80
+		 push ? uni.navigateTo({
81
+		 	url:'/pages/users/login/index'
82
+		 }) : uni.navigateTo({
83
+		 	url: '/pages/users/login/index'
84
+		 });
85
+		}
86
+	//}
87
+	// #endif
88
+	
89
+	// #ifdef MP 
90
+	
91
+	
92
+	// #endif
93
+}
94
+
95
+
96
+export function checkLogin()
97
+{
98
+	let token = Cache.get(LOGIN_STATUS);
99
+	let expiresTime = Cache.get(EXPIRES_TIME);
100
+	let newTime = Math.round(new Date() / 1000);
101
+	if (expiresTime < newTime || !token){
102
+		uni.removeStorageSync('USERINFO')
103
+		Cache.clear(LOGIN_STATUS);
104
+		Cache.clear(EXPIRES_TIME);
105
+		Cache.clear(USER_INFO);
106
+		Cache.clear(STATE_R_KEY);
107
+		return false;
108
+	}else{
109
+		store.commit('UPDATE_LOGIN',token);
110
+		let userInfo = Cache.get(USER_INFO,true);
111
+		if(userInfo){
112
+			store.commit('UPDATE_USERINFO',userInfo);
113
+		}
114
+		return true;
115
+	}
116
+
117
+}

BIN
src/libs/media-release.aar


+ 19 - 0
src/libs/order.js

@@ -0,0 +1,19 @@
1
+export function goShopDetail(item,uid) {
2
+	return new Promise(resolve => {
3
+		if (item.activity && item.activity.type === "1") {
4
+			uni.navigateTo({
5
+				url: `/pages/activity/goods_seckill_details/index?id=${item.activity.id}&time=${item.activity.time}&status=1`
6
+			})
7
+		} else if (item.activity && item.activity.type === "2") {
8
+			uni.navigateTo({
9
+				url: `/pages/activity/goods_bargain_details/index?id=${item.activity.id}&bargain=${uid}`
10
+			})
11
+		} else if (item.activity && item.activity.type === "3") {
12
+			uni.navigateTo({
13
+				url: `/pages/activity/goods_combination_details/index?id=${item.activity.id}`
14
+			})
15
+		} else {
16
+			resolve(item);
17
+		}
18
+	});
19
+}

+ 141 - 0
src/libs/routine.js

@@ -0,0 +1,141 @@
1
+import store from '../store';
2
+import { checkLogin } from './login';
3
+import { login } from '../api/public';
4
+import Cache from '../utils/cache';
5
+import { STATE_R_KEY, USER_INFO, EXPIRES_TIME, LOGIN_STATUS} from './../config/cache';
6
+
7
+class Routine 
8
+{
9
+	
10
+	constructor() 
11
+	{
12
+	    this.scopeUserInfo = 'scope.userInfo';
13
+	}
14
+	
15
+	async getUserCode(){
16
+		let isAuth = await this.isAuth(), code = '' ;
17
+		if(isAuth)
18
+			code = await this.getCode();
19
+		return code;
20
+	}
21
+	
22
+	/**
23
+	 * 获取用户信息
24
+	 */
25
+	getUserInfo(){
26
+		let  that = this , code = this.getUserCode();
27
+		return new Promise( (resolve,reject) => {
28
+			uni.getUserInfo({
29
+				lang: 'zh_CN',
30
+				success(user) {
31
+					if(code) user.code = code;
32
+					resolve({userInfo:user,islogin:false});
33
+				},
34
+				fail(res){
35
+					reject(res);
36
+				}
37
+			})
38
+		})
39
+	}
40
+	
41
+	/**
42
+	 * 获取用户信息
43
+	 */
44
+	authorize()
45
+	{
46
+		let that = this;
47
+		return new Promise((resolve,reject)=>{
48
+			if(checkLogin())
49
+				return resolve({
50
+					userInfo:Cache.get(USER_INFO,true),
51
+					islogin:true,
52
+				});
53
+			uni.authorize({
54
+			    scope: that.scopeUserInfo,
55
+			    success() {
56
+					resolve({islogin:false});
57
+			    },
58
+				fail(res){
59
+					reject(res);
60
+				}
61
+			})
62
+		})
63
+	}
64
+	
65
+	async getCode(){
66
+		let provider = await this.getProvider();
67
+		return new Promise((resolve,reject)=>{
68
+			if(Cache.has(STATE_R_KEY)){
69
+				return resolve(Cache.get(STATE_R_KEY));
70
+			}
71
+			uni.login({
72
+				provider:provider,
73
+				success(res) {
74
+					if (res.code) Cache.set(STATE_R_KEY, res.code ,10800);
75
+					return resolve(res.code);
76
+				},
77
+				fail(){
78
+					return reject(null);
79
+				}
80
+			})
81
+		})
82
+	}
83
+	
84
+	/**
85
+	 * 获取服务供应商
86
+	 */
87
+	getProvider()
88
+	{
89
+		return new Promise((resolve,reject)=>{
90
+			uni.getProvider({
91
+				service:'oauth',
92
+				success(res) {
93
+					resolve(res.provider);
94
+				},
95
+				fail() {
96
+					resolve(false);
97
+				}
98
+			});
99
+		});
100
+	}
101
+	
102
+	/**
103
+	 * 是否授权
104
+	 */
105
+	isAuth(){
106
+		let that = this;
107
+		return new Promise((resolve,reject)=>{
108
+			uni.getSetting({
109
+				success(res) {
110
+					if (!res.authSetting[that.scopeUserInfo]) {
111
+						resolve(true)
112
+					} else {
113
+						resolve(true);
114
+					}
115
+				},
116
+				fail(){
117
+					 resolve(false);
118
+				}
119
+			});
120
+		});
121
+	}
122
+	
123
+	authUserInfo(data)
124
+	{
125
+		return new Promise((resolve, reject)=>{
126
+			login(data).then(res=>{
127
+				let time = res.data.expires_time - Cache.time();
128
+				store.commit('UPDATE_USERINFO', res.data.userInfo);
129
+				store.commit('LOGIN', {token:res.data.token, time:time});
130
+				store.commit('SETUID', res.data.userInfo.uid);
131
+				Cache.set(EXPIRES_TIME,res.data.expires_time,time);
132
+				Cache.set(USER_INFO,res.data.userInfo,time);
133
+				return resolve(res);
134
+			}).catch(res=>{
135
+				return reject(res);
136
+			})
137
+		})
138
+	}
139
+}
140
+
141
+export default new Routine();

+ 7 - 0
src/libs/style.components.scss

@@ -0,0 +1,7 @@
1
+// 定义混入指令,用于在非nvue环境下的flex定义,因为nvue没有display属性,会报错
2
+@mixin vue-flex($direction: row) {
3
+	/* #ifndef APP-NVUE */
4
+	display: flex;
5
+	flex-direction: $direction;
6
+	/* #endif */
7
+}

+ 263 - 0
src/libs/wechat.js

@@ -0,0 +1,263 @@
1
+// #ifdef H5
2
+import WechatJSSDK from "@/plugin/jweixin-module/index.js";
3
+
4
+
5
+import {
6
+	getWechatConfig,
7
+	wechatAuth
8
+} from "@/api/public";
9
+import {
10
+	WX_AUTH,
11
+	STATE_KEY,
12
+	LOGINTYPE,
13
+	BACK_URL
14
+} from '@/config/cache';
15
+import {
16
+	parseQuery
17
+} from '@/utils';
18
+import store from '@/store';
19
+import Cache from '@/utils/cache';
20
+
21
+class AuthWechat {
22
+
23
+	constructor() {
24
+		//微信实例化对象
25
+		this.instance = WechatJSSDK;
26
+		//是否实例化
27
+		this.status = false;
28
+
29
+		this.initConfig = {};
30
+
31
+	}
32
+	
33
+	isAndroid(){
34
+		let u = navigator.userAgent;
35
+		return u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
36
+	}
37
+	
38
+	signLink() {
39
+		if (typeof window.entryUrl === 'undefined' || window.entryUrl === '') {
40
+			  	window.entryUrl = location.href
41
+			}
42
+		return  /(Android)/i.test(navigator.userAgent) ? location.href : window.entryUrl;
43
+	}
44
+
45
+	/**
46
+	 * 初始化wechat(分享配置)
47
+	 */
48
+	wechat() {
49
+		return new Promise((resolve, reject) => {
50
+			// if (this.status && !this.isAndroid()) return resolve(this.instance);
51
+			getWechatConfig()
52
+				.then(res => {
53
+					this.instance.config(res.data);
54
+					this.initConfig = res.data;
55
+					this.status = true;
56
+					this.instance.ready(() => {
57
+						resolve(this.instance);
58
+					})
59
+				}).catch(err => {
60
+					console.log(err);
61
+					this.status = false;
62
+					reject(err);
63
+				});
64
+		});
65
+	}
66
+
67
+	/**
68
+	 * 验证是否初始化
69
+	 */
70
+	verifyInstance() {
71
+		let that = this;
72
+		return new Promise((resolve, reject) => {
73
+			if (that.instance === null && !that.status) {
74
+				that.wechat().then(res => {
75
+					resolve(that.instance);
76
+				}).catch(() => {
77
+					return reject();
78
+				})
79
+			} else {
80
+				return resolve(that.instance);
81
+			}
82
+		})
83
+	}
84
+	// 微信公众号的共享地址
85
+	openAddress() {
86
+		return new Promise((resolve, reject) => {
87
+			this.wechat().then(wx => {
88
+				this.toPromise(wx.openAddress).then(res => {
89
+					resolve(res);
90
+				}).catch(err => {
91
+					reject(err);
92
+				});
93
+			}).catch(err => {
94
+				reject(err);
95
+			})
96
+		});
97
+	}
98
+
99
+
100
+
101
+	/**
102
+	 * 微信支付
103
+	 * @param {Object} config
104
+	 */
105
+	pay(config) {
106
+		return new Promise((resolve, reject) => {
107
+			this.wechat().then((wx) => {
108
+				this.toPromise(wx.chooseWXPay, config).then(res => {
109
+					resolve(res);
110
+				}).catch(res => {
111
+					reject(res);
112
+				});
113
+			}).catch(res => {
114
+				reject(res);
115
+			});
116
+		});
117
+	}
118
+
119
+	toPromise(fn, config = {}) {
120
+		return new Promise((resolve, reject) => {
121
+			fn({
122
+				...config,
123
+				success(res) {
124
+					resolve(res);
125
+				},
126
+				fail(err) {
127
+					reject(err);
128
+				},
129
+				complete(err) {
130
+					reject(err);
131
+				},
132
+				cancel(err) {
133
+					reject(err);
134
+				}
135
+			});
136
+		});
137
+	}
138
+
139
+	/**
140
+	 * 自动去授权
141
+	 */
142
+	oAuth() {
143
+		if (uni.getStorageSync(WX_AUTH) && store.state.app.token) return;
144
+		const {
145
+			code
146
+		} = parseQuery();
147
+		if (!code) return this.toAuth();
148
+	}
149
+
150
+	clearAuthStatus() {
151
+
152
+	}
153
+
154
+	/**
155
+	 * 授权登录获取token
156
+	 * @param {Object} code
157
+	 */
158
+	auth(code) {
159
+		return new Promise((resolve, reject) => {
160
+			let loginType = Cache.get(LOGINTYPE);
161
+			wechatAuth(code, parseInt(Cache.get("spread")), loginType)
162
+				.then(({
163
+					data
164
+				}) => {
165
+					// let expires_time = data.exp.substring(0, 19);
166
+					// expires_time = expires_time.replace(/-/g, '/');
167
+					// expires_time = new Date(expires_time).getTime();
168
+					// let newTime = Math.round(new Date() / 1000);
169
+					store.commit("LOGIN", {
170
+						token: data.token,
171
+						time:data.exp
172
+					});
173
+					store.commit("SETUID", data.user.uid);
174
+					store.commit('UPDATE_USERINFO', data.user);
175
+					Cache.set(WX_AUTH, code);
176
+					Cache.clear(STATE_KEY);
177
+					loginType && Cache.clear(LOGINTYPE);
178
+					resolve();
179
+				})
180
+				.catch(reject);
181
+		});
182
+	}
183
+
184
+	/**
185
+	 * 获取跳转授权后的地址
186
+	 * @param {Object} appId
187
+	 */
188
+	getAuthUrl(appId) {
189
+		const redirect_uri = encodeURIComponent(
190
+			`${location.origin}/pages/auth/index?back_url=` +
191
+			encodeURIComponent(
192
+				encodeURIComponent(
193
+					uni.getStorageSync(BACK_URL) ?
194
+					uni.getStorageSync(BACK_URL) :
195
+					location.pathname + location.search
196
+				)
197
+			)
198
+		);
199
+		uni.removeStorageSync(BACK_URL);
200
+		const state = encodeURIComponent(
201
+			("" + Math.random()).split(".")[1] + "authorizestate"
202
+		);
203
+		uni.setStorageSync(STATE_KEY, state);
204
+		return `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=${state}#wechat_redirect`;
205
+	}
206
+
207
+	/**
208
+	 * 跳转自动登录
209
+	 */
210
+	toAuth() {
211
+		let that = this;
212
+		this.wechat().then(wx => {
213
+			location.href = this.getAuthUrl(that.initConfig.appId);
214
+		})
215
+	}
216
+
217
+	/**
218
+	 * 绑定事件
219
+	 * @param {Object} name 事件名
220
+	 * @param {Object} config 参数
221
+	 */
222
+	wechatEvevt(name, config) {
223
+		let that = this;
224
+		return new Promise((resolve, reject) => {
225
+			let configDefault = {
226
+				fail(res) {
227
+					console.log(res,11111);
228
+					if (that.instance) return reject({
229
+						is_ready: true,
230
+						wx: that.instance
231
+					});
232
+					that.verifyInstance().then(wx => {
233
+						return reject({
234
+							is_ready: true,
235
+							wx: wx
236
+						});
237
+					})
238
+				},
239
+				success(res) {
240
+					return resolve(res,2222);
241
+				}
242
+			};
243
+			Object.assign(configDefault, config);
244
+			that.wechat().then(wx => {
245
+				if (typeof name === 'object') {
246
+					name.forEach(item => {
247
+						wx[item] && wx[item](configDefault)
248
+					})
249
+				} else {
250
+					wx[name] && wx[name](configDefault)
251
+				}
252
+			})
253
+		});
254
+	}
255
+
256
+	isWeixin() {
257
+		return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1;
258
+	}
259
+
260
+}
261
+
262
+export default new AuthWechat();
263
+// #endif

BIN
src/libs/weex_videoplayer-release.aar


+ 88 - 0
src/main.js

@@ -0,0 +1,88 @@
1
+import Vue from 'vue'
2
+import App from './App'
3
+import store from './store'
4
+import apiUrls from '@/common/api/url.js'
5
+// import language from '@/lang/index.js';
6
+import Cache from './utils/cache'
7
+import { http } from '@/common/api/index.js';
8
+import { message, Router } from '@/common/utils/index.js';
9
+import { BASE_URL, IMG_BASE_URL, SYSTEM_CONFIG, PAGE_SIZE, VERSION_CODE, IS_DEV, needLoginPages } from '@/common/config.js';
10
+import util from 'utils/util'
11
+import utils from '@/common/utils/utils';
12
+import './common/filter/index.js';
13
+import './common/mixin/index.js';
14
+// import uView from "uview-ui";
15
+const router = new Router({ needLoginPages });
16
+Vue.prototype.$util = util;
17
+Vue.prototype.$Cache = Cache;
18
+Vue.prototype.$eventHub = new Vue();
19
+Vue.config.productionTip = false
20
+
21
+/* 引用全局组件 */
22
+import cuCustom from './colorui/components/cu-custom.vue'
23
+Vue.component('cu-custom',cuCustom)
24
+// Vue.use(uView);
25
+// #ifdef APP-PLUS
26
+import FuModal from './pagesB/components/fu-modal/fu-modal.js';
27
+Vue.use(FuModal);
28
+// #endif
29
+// #ifdef H5
30
+import { parseQuery } from "./utils";
31
+import Auth from './libs/wechat';
32
+import { SPREAD } from './config/cache';
33
+Vue.prototype.$wechat = Auth;
34
+let cookieName = "VCONSOLE",
35
+	query = parseQuery(),
36
+	urlSpread = query["spread"],
37
+	vconsole = query[cookieName.toLowerCase()],
38
+	md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", // MD5 加密开启vconsole模式
39
+	md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; // MD5 加密关闭vconsole模式
40
+
41
+if (urlSpread !== undefined) {
42
+	var spread = Cache.get(SPREAD);
43
+	urlSpread = parseInt(urlSpread);
44
+	if (!Number.isNaN(urlSpread) && spread !== urlSpread) {
45
+		Cache.set("spread", urlSpread || 0);
46
+	} else if (spread === 0 || typeof spread !== "number") {
47
+		Cache.set("spread", urlSpread || 0);
48
+	}
49
+}
50
+
51
+if (vconsole !== undefined) {
52
+  if (vconsole === md5UnCrmeb && Cache.has(cookieName))
53
+	  Cache.clear(cookieName);
54
+} else vconsole = Cache.get(cookieName);
55
+
56
+import VConsole from './pagesB/components/vconsole.min.js'
57
+
58
+if (vconsole !== undefined && vconsole === md5Crmeb) {
59
+	Cache.set(cookieName, md5Crmeb, 3600 * 24);
60
+	let vConsole = new VConsole();
61
+
62
+}
63
+// Auth.isWeixin() && Auth.oAuth();
64
+
65
+// #endif
66
+
67
+Vue.config.productionTip = false;
68
+Vue.prototype.$urouter = router;
69
+Vue.prototype.$api = http;
70
+Vue.prototype.$message = message;
71
+Vue.prototype.$utils = utils;
72
+Vue.prototype.$store = store;
73
+global.apiUrls = apiUrls;
74
+global.imgBaseUrl = IMG_BASE_URL;
75
+global.IS_DEV = IS_DEV;
76
+global.PAGE_SIZE = PAGE_SIZE;
77
+global.VERSION_CODE = VERSION_CODE;
78
+global.SYSTEM_CONFIG = SYSTEM_CONFIG;
79
+App.mpType = 'app'
80
+
81
+
82
+const app = new Vue({
83
+    ...App,
84
+	store,
85
+	Cache,
86
+})
87
+app.$mount();
88
+global.$showModal = app.$showModal;

+ 298 - 0
src/manifest.json

@@ -0,0 +1,298 @@
1
+{
2
+    "name" : "储蓄保",
3
+    "appid" : "__UNI__BCDA501",
4
+    "description" : "",
5
+    "versionName" : "2.2.28",
6
+    "versionCode" : 2228,
7
+    "transformPx" : false,
8
+    /* 5+App特有相关 */
9
+    "app-plus" : {
10
+        //prompt取值为template时有效,用于配置模板提示框上显示的内容  
11
+        "usingComponents" : true,
12
+        "nvueCompiler" : "uni-app",
13
+        "splashscreen" : {
14
+            "alwaysShowBeforeRender" : false,
15
+            "waiting" : false,
16
+            "autoclose" : true,
17
+            "delay" : 0
18
+        },
19
+        "compatible" : {
20
+            "ignoreVersion" : true
21
+        },
22
+        /* 模块配置 */
23
+        "modules" : {
24
+            "Payment" : {},
25
+            "Maps" : {},
26
+            "OAuth" : {},
27
+            "Push" : {},
28
+            "VideoPlayer" : {},
29
+            "Geolocation" : {},
30
+            "Share" : {}
31
+        },
32
+        /* 应用发布信息 */
33
+        "distribute" : {
34
+            /* android打包配置 */
35
+            "android" : {
36
+                "permissions" : [
37
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
38
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
39
+                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
40
+                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
41
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
42
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
43
+                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
44
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
45
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
46
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
47
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
48
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
49
+                    "<uses-permission android:name=\"android.permission.INTERNET\"/>",
50
+                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
51
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
52
+                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
53
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
54
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
55
+                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
56
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
57
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
58
+                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
59
+                    "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
60
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
61
+                ],
62
+                "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
63
+                "permissionPhoneState" : {
64
+                    "request" : "always",
65
+                    "prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。"
66
+                }
67
+            },
68
+            /* ios打包配置 */
69
+            "ios" : {
70
+                "urlschemewhitelist" : "tbopen,tmall",
71
+                "idfa" : false,
72
+                "privacyDescription" : {
73
+                    "NSPhotoLibraryUsageDescription" : "访问相册用于上传图片或者扫描二维码,是否允许打开相册?",
74
+                    "NSPhotoLibraryAddUsageDescription" : "访问相册用于设置头像或者扫描二维码,是否允许打开相册?",
75
+                    "NSCameraUsageDescription" : "访问相机用于设置头像或者扫描二维码,是否允许打开相机?",
76
+                    "NSMicrophoneUsageDescription" : "使用麦克风用于录音。是否允许打开麦克风?",
77
+                    "NSLocationWhenInUseUsageDescription" : "需要您的同意,才能访问当前位置,用于推荐附近商店,是否允许?",
78
+                    "NSLocationAlwaysUsageDescription" : "APP需要您的同意,才能持续访a问定位位置展示持续更新信息,如禁止将无法持续更新位置信息",
79
+                    "NSLocationAlwaysAndWhenInUseUsageDescription" : "需要您的同意,才能访问当前位a置,用于推荐附近商店,是否允许?",
80
+                    "NSCalendarsUsageDescription" : "需要您的同意,才能访问日历用于生日选择",
81
+                    "NSContactsUsageDescription" : "需要您同意才能获取的通信录拨打电话,是否允许?"
82
+                },
83
+                "urltypes" : [
84
+                    {
85
+                        // 随便写配合支付宝授权回调使用,跟传入参数一致
86
+                        "urlschemes" : [ "alipay123456789", "tbopen32452241" ]
87
+                    }
88
+                ]
89
+            },
90
+            /* SDK配置 */
91
+            "sdkConfigs" : {
92
+                "ad" : {},
93
+                "oauth" : {
94
+                    "weixin" : {
95
+                        "appid" : "wxbf753066ac8686ba",
96
+                        "appsecret" : "68943fc124568c4ab4c3f089b7cdf2aa",
97
+                        "UniversalLinks" : "https://test.bjtdba.com/"
98
+                    }
99
+                },
100
+                "payment" : {
101
+                    "alipay" : {
102
+                        "__platform__" : [ "ios", "android" ]
103
+                    }
104
+                },
105
+                "share" : {
106
+                    "weixin" : {
107
+                        "appid" : "wxbf753066ac8686ba",
108
+                        "UniversalLinks" : "https://test.bjtdba.com/"
109
+                    }
110
+                },
111
+                "geolocation" : {
112
+                    "amap" : {
113
+                        "__platform__" : [ "ios", "android" ],
114
+                        "appkey_ios" : "11152e826f2768d2e345e3a116f7e82b",
115
+                        "appkey_android" : "bdcda43883bcef7a6d180edaced87d61"
116
+                    }
117
+                },
118
+                "maps" : {
119
+                    "amap" : {
120
+                        "appkey_ios" : "11152e826f2768d2e345e3a116f7e82b",
121
+                        "appkey_android" : "bdcda43883bcef7a6d180edaced87d61"
122
+                    }
123
+                },
124
+                "push" : {}
125
+            },
126
+            "icons" : {
127
+                "android" : {
128
+                    "hdpi" : "unpackage/res/icons/72x72.png",
129
+                    "xhdpi" : "unpackage/res/icons/96x96.png",
130
+                    "xxhdpi" : "unpackage/res/icons/144x144.png",
131
+                    "xxxhdpi" : "unpackage/res/icons/192x192.png"
132
+                },
133
+                "ios" : {
134
+                    "appstore" : "unpackage/res/icons/1024x1024.png",
135
+                    "ipad" : {
136
+                        "app" : "unpackage/res/icons/76x76.png",
137
+                        "app@2x" : "unpackage/res/icons/152x152.png",
138
+                        "notification" : "unpackage/res/icons/20x20.png",
139
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
140
+                        "proapp@2x" : "unpackage/res/icons/167x167.png",
141
+                        "settings" : "unpackage/res/icons/29x29.png",
142
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
143
+                        "spotlight" : "unpackage/res/icons/40x40.png",
144
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png"
145
+                    },
146
+                    "iphone" : {
147
+                        "app@2x" : "unpackage/res/icons/120x120.png",
148
+                        "app@3x" : "unpackage/res/icons/180x180.png",
149
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
150
+                        "notification@3x" : "unpackage/res/icons/60x60.png",
151
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
152
+                        "settings@3x" : "unpackage/res/icons/87x87.png",
153
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png",
154
+                        "spotlight@3x" : "unpackage/res/icons/120x120.png"
155
+                    }
156
+                }
157
+            },
158
+            "splashscreen" : {
159
+                "iosStyle" : "common"
160
+            }
161
+        },
162
+        "nativePlugins" : {
163
+            "UZK-JDopen" : {
164
+                "ios_appsecret" : "1d53053eb4f747bdaed32f2b1108fcde",
165
+                "android_appkey" : "a2ad5078501e928b991cd8aaeb0446dc",
166
+                "ios_appkey" : "5180fe1f99f5658e3888ea3d156971f5",
167
+                "android_appsecret" : "fd8aab59e9b94d9e889cb22838c03f2a",
168
+                "__plugin_info__" : {
169
+                    "name" : "京东联盟SDK,呼起京东客户端(带返回按钮)",
170
+                    "description" : "京东联盟SDK,呼起京东客户端(带返回按钮)",
171
+                    "platforms" : "Android,iOS",
172
+                    "url" : "https://ext.dcloud.net.cn/plugin?id=908",
173
+                    "android_package_name" : "com.laolaixiang.bjtdba",
174
+                    "ios_bundle_id" : "com.laolaixiang.bjtdba",
175
+                    "isCloud" : true,
176
+                    "bought" : 1,
177
+                    "pid" : "908",
178
+                    "parameters" : {
179
+                        "ios_appsecret" : {
180
+                            "des" : "京东联盟苹果appsecret",
181
+                            "key" : "UZK-JDopen:appsecret",
182
+                            "value" : "${ios_appsecret}"
183
+                        },
184
+                        "android_appkey" : {
185
+                            "des" : "京东联盟安卓appkey",
186
+                            "key" : "uzkJDopen_appkey",
187
+                            "value" : "${android_appkey}"
188
+                        },
189
+                        "ios_appkey" : {
190
+                            "des" : "京东联盟苹果appkey",
191
+                            "key" : "UZK-JDopen:appkey",
192
+                            "value" : "${ios_appkey}"
193
+                        },
194
+                        "android_appsecret" : {
195
+                            "des" : "京东联盟安卓appsecret",
196
+                            "key" : "uzkJDopen_appsecret",
197
+                            "value" : "${android_appsecret}"
198
+                        }
199
+                    }
200
+                }
201
+            },
202
+            "PP-Alipay" : {
203
+                "__plugin_info__" : {
204
+                    "name" : "支付宝授权登录,支付宝,授权登录,使用简单,不冲突",
205
+                    "description" : "支付宝授权登录,有问题请联系作者",
206
+                    "platforms" : "Android,iOS",
207
+                    "url" : "https://ext.dcloud.net.cn/plugin?id=1411",
208
+                    "android_package_name" : "com.laolaixiang.bjtdba",
209
+                    "ios_bundle_id" : "com.laolaixiang.bjtdba",
210
+                    "isCloud" : true,
211
+                    "bought" : 1,
212
+                    "pid" : "1411",
213
+                    "parameters" : {}
214
+                }
215
+            },
216
+            "TAOBAOKE" : {
217
+                "__plugin_info__" : {
218
+                    "name" : "TAOBAOKE",
219
+                    "description" : "淘宝客插件",
220
+                    "platforms" : "Android,iOS",
221
+                    "url" : "",
222
+                    "android_package_name" : "",
223
+                    "ios_bundle_id" : "",
224
+                    "isCloud" : false,
225
+                    "bought" : -1,
226
+                    "pid" : "",
227
+                    "parameters" : {}
228
+                }
229
+            },
230
+            "UZK-Alibcsdk" : {
231
+                "__plugin_info__" : {
232
+                    "name" : "新版阿里百川SDK安卓4.0.0.15苹果4.0.1.6",
233
+                    "description" : "新增渠道授权(静默式),无需用户进行二次授权,即可获得用户的渠道ID。",
234
+                    "platforms" : "Android,iOS",
235
+                    "url" : "https://ext.dcloud.net.cn/plugin?id=873",
236
+                    "android_package_name" : "com.laolaixiang.bjtdba",
237
+                    "ios_bundle_id" : "com.laolaixiang.bjtdba",
238
+                    "isCloud" : true,
239
+                    "bought" : 1,
240
+                    "pid" : "873",
241
+                    "parameters" : {}
242
+                }
243
+            }
244
+        }
245
+    },
246
+    /* 快应用特有相关 */
247
+    "quickapp" : {},
248
+    /* 小程序特有相关 */
249
+    "mp-weixin" : {
250
+        // "navigateToMiniProgramAppIdList": [
251
+        // "wx91d27dbf599dff74"//京东购物
252
+        // ],
253
+        // 开启分包优化
254
+        "optimization" : {
255
+            "subPackages" : true
256
+        },
257
+        "appid" : "wxfb755febdb800f23",
258
+        "setting" : {
259
+            "urlCheck" : false,
260
+            "minified" : true,
261
+            "postcss" : false,
262
+            "es6" : true
263
+        },
264
+        "permission" : {
265
+            "scope.userLocation" : {
266
+                "desc" : "获取您的位置"
267
+            }
268
+        },
269
+        "usingComponents" : true
270
+    },
271
+    "mp-alipay" : {
272
+        "usingComponents" : true
273
+    },
274
+    "mp-baidu" : {
275
+        "usingComponents" : true
276
+    },
277
+    "mp-toutiao" : {
278
+        "usingComponents" : true
279
+    },
280
+    "h5" : {
281
+        "devServer" : {
282
+            "https" : false
283
+        },
284
+        "router" : {
285
+            "mode" : "history",
286
+            "base" : ""
287
+        },
288
+        "domain" : "",
289
+        "sdkConfigs" : {
290
+            "maps" : {
291
+                "qqmap" : {
292
+                    "key" : "NO7BZ-APDKP-UCBD7-VT7CX-R5UZK-JBF2W"
293
+                }
294
+            }
295
+        },
296
+        "title" : "储蓄保"
297
+    }
298
+}

+ 27 - 0
src/mixins/SendVerifyCode.js

@@ -0,0 +1,27 @@
1
+export default {
2
+  data() {
3
+    return {
4
+      disabled: false,
5
+      text: "获取验证码"
6
+    };
7
+  },
8
+  methods: {
9
+    sendCode() {
10
+      if (this.disabled) return;
11
+      this.disabled = true;
12
+      let n = 60;
13
+      this.text = "剩余 " + n + "s";
14
+      const run = setInterval(() => {
15
+        n = n - 1;
16
+        if (n < 0) {
17
+          clearInterval(run);
18
+        }
19
+        this.text = "剩余 " + n + "s";
20
+        if (this.text < "剩余 " + 0 + "s") {
21
+          this.disabled = false;
22
+          this.text = "重新获取";
23
+        }
24
+      }, 1000);
25
+    }
26
+  }
27
+};

+ 0 - 0
src/pages.json


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä