├── src ├── page │ ├── home │ │ ├── index │ │ │ ├── style.less │ │ │ ├── template.html │ │ │ ├── route.js │ │ │ └── value.js │ │ ├── member │ │ │ ├── style.less │ │ │ ├── template.html │ │ │ └── route.js │ │ ├── value.js │ │ ├── template.html │ │ ├── route.js │ │ └── style.less │ ├── user-sign-in │ │ ├── style.less │ │ ├── value.js │ │ ├── route.js │ │ └── template.html │ ├── user-bind-mobile │ │ ├── style.less │ │ ├── value.js │ │ ├── template.html │ │ └── route.js │ └── app │ │ ├── value.js │ │ ├── template.html │ │ ├── index.js │ │ └── style.less ├── vuex │ ├── store.js │ ├── mutation-types.js │ ├── modules │ │ └── app.js │ └── actions.js ├── lib │ ├── ddApiConfig.js │ ├── vue-dd-plugin.js │ ├── vue-bb-plugin.js │ └── zepto.js ├── index.html └── main.js ├── .gitignore ├── dd ├── styles.7d3cc497.css.map ├── user-sign-in.7d3cc497.js ├── user-bind-mobile.7d3cc497.js ├── index.html ├── user-sign-in.7d3cc497.js.map ├── user-bind-mobile.7d3cc497.js.map ├── web_app.7d3cc497.js ├── home.7d3cc497.js └── member.7d3cc497.js ├── env.js ├── README.md ├── gulpfile.js ├── package.json ├── webpack.prod.config.js ├── webpack.dev.config.js └── webpack.base.config.js /src/page/home/index/style.less: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/page/user-sign-in/style.less: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/page/user-bind-mobile/style.less: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | node_modules 3 | env.js -------------------------------------------------------------------------------- /src/page/user-sign-in/value.js: -------------------------------------------------------------------------------- 1 | let value = { 2 | 3 | } 4 | 5 | export default value; -------------------------------------------------------------------------------- /dd/styles.7d3cc497.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"styles.7d3cc497.css","sourceRoot":""} -------------------------------------------------------------------------------- /src/page/home/member/style.less: -------------------------------------------------------------------------------- 1 | .member-avatar { 2 | width: 100px; 3 | height: 100px; 4 | border-radius: 50%; 5 | border: 4px solid #ececec; 6 | } -------------------------------------------------------------------------------- /env.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const env = { 3 | 4 | BASE_PATH : '/dd', 5 | 6 | API_HOST : 'http://116.236.230.131:55002' 7 | } 8 | 9 | export default env; -------------------------------------------------------------------------------- /src/page/app/value.js: -------------------------------------------------------------------------------- 1 | let value = { 2 | routerTransition: { 3 | forward: 'slideRL', 4 | back: 'slideLR' 5 | } 6 | } 7 | 8 | export default value; -------------------------------------------------------------------------------- /src/page/user-bind-mobile/value.js: -------------------------------------------------------------------------------- 1 | let value = { 2 | phone : '', 3 | verification_code : '', 4 | sms_number : 0, 5 | 6 | showToast : false, 7 | toastText : '', 8 | } 9 | 10 | export default value; -------------------------------------------------------------------------------- /src/vuex/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | import app from './modules/app' 5 | 6 | Vue.use(Vuex) 7 | 8 | 9 | export default new Vuex.Store({ 10 | modules: { 11 | app 12 | } 13 | }) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-dd-bb 2 | vue写的钉钉微应用demo 3 | 4 | * 系统功能变更记录,格式:“### V+大功能版本号+小功能版本号+bug版本号”。 5 | * 大功能:指一个新的功能模块。 6 | * 小功能:指功能模块的优化。 7 | * bug:指功能模块的线上bug修复。 8 | 9 | ### 安装 10 | * npm install webpack@1.14.0 -g 11 | * npm install 12 | * npm run dev 13 | * 把 `/dd`目录 部署到钉钉指定的阿里云服务器上 14 | * 在钉钉后台把微应用链接设置为上一步的网址上 15 | * 在钉钉测试客户端打开微应用 -------------------------------------------------------------------------------- /src/page/app/template.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | dd.config配置失败 7 | 8 | 9 | 免登陆code获取失败 10 | 11 |
-------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 2 | // gulp是前端开发过程中对代码进行构建的工具,是自动化项目的构建利器 3 | var gulp = require('gulp'); 4 | 5 | var webpack = require('gulp-webpack'); 6 | 7 | var webpack_dev_config = require('./webpack.dev.config'); 8 | gulp.task('dev',[], function() { 9 | return gulp 10 | .src('.') 11 | .pipe(webpack(webpack_dev_config)) 12 | .pipe(gulp.dest('dd'));//用于配置文件发布路径,如CDN或本地服务器//文件输出目录 13 | }); -------------------------------------------------------------------------------- /src/page/home/value.js: -------------------------------------------------------------------------------- 1 | let value = { 2 | myCity : { 3 | province_id : 0, 4 | province_name : '', 5 | city_id : 0, 6 | city_name : '上海' 7 | }, 8 | 9 | myCarInfo : { 10 | brand_id : 0, 11 | brand_name : '', 12 | series_id : 0, 13 | series_name: '', 14 | type_id : 0, 15 | type_name : '' 16 | }, 17 | } 18 | 19 | export default value; -------------------------------------------------------------------------------- /src/vuex/mutation-types.js: -------------------------------------------------------------------------------- 1 | 2 | export const UPDATE_LOADING = 'UPDATE_LOADING'; //路由加载 3 | 4 | export const UPDATE_DIRECTION = 'UPDATE_DIRECTION'; //更新路由跳转动画 5 | 6 | export const DDCONFIG_SUCCESS = 'DDCONFIG_SUCCESS'; //钉钉配置成功 7 | 8 | export const DDCONFIG_ERROR = 'DDCONFIG_ERROR'; //钉钉配置失败 9 | 10 | export const UPDATE_CODE = 'UPDATE_CODE'; //更新免登录CODE 11 | 12 | export const LOGIN_SUCCESS = 'LOGIN_SUCCESS'; //免登录成功 13 | 14 | export const LOGIN_ERROR = 'LOGIN_ERROR'; //免登录失败 -------------------------------------------------------------------------------- /src/page/home/index/template.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 7 |
8 | 签到 9 |
10 | 11 |
12 |
13 |
-------------------------------------------------------------------------------- /src/page/user-sign-in/route.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import Vue from 'vue' 3 | import Tpl from './template.html' 4 | import Value from './value' 5 | import './style.less' 6 | 7 | let Index = Vue.extend({ 8 | template : Tpl, 9 | components : { 10 | 11 | }, 12 | ready : function(){ 13 | this.callJsApi('biz.navigation.setTitle',{title:'签到'}); 14 | }, 15 | data : ()=>{ 16 | return Value 17 | }, 18 | methods: { 19 | 20 | }, 21 | computed : { 22 | 23 | }, 24 | route : { 25 | 26 | } 27 | }) 28 | 29 | export default Index -------------------------------------------------------------------------------- /src/page/home/member/template.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |

5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

17 | 18 |

19 |
-------------------------------------------------------------------------------- /src/page/user-bind-mobile/template.html: -------------------------------------------------------------------------------- 1 |
2 |
为保障账号安全,请勿向他人透露账号信息
3 | 4 | 5 | 6 | 7 |
8 | {{sms_text}} 9 |
10 |
11 |
12 | 13 | 14 | 绑定 15 | 16 |
-------------------------------------------------------------------------------- /src/page/user-sign-in/template.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
图文组合列表
4 |
5 |
6 | 13 |
14 |
15 |
16 |
-------------------------------------------------------------------------------- /src/page/home/template.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 班步 11 | 12 | 13 | 14 | 首页 15 | 16 | 17 | 18 | 个人 19 | 20 | 21 | 22 |
-------------------------------------------------------------------------------- /src/page/user-bind-mobile/route.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import Vue from 'vue' 3 | import Tpl from './template.html' 4 | import Value from './value' 5 | import './style.less' 6 | 7 | let Index = Vue.extend({ 8 | template : Tpl, 9 | ready : function(){ 10 | this.callJsApi('biz.navigation.setTitle',{title:'员工绑定'}); 11 | }, 12 | data : ()=>{ 13 | return Value 14 | }, 15 | methods: { 16 | sendSms(){ 17 | this.sms_number = 60; 18 | let interval = setInterval(()=>{ 19 | this.sms_number --; 20 | if(this.sms_number == 0){ 21 | clearInterval(interval) 22 | } 23 | },1e3) 24 | 25 | }, 26 | bindPhone(){ 27 | 28 | } 29 | }, 30 | computed : { 31 | sms_text(){ 32 | if(this.sms_number == 0){ 33 | return '获取验证码' 34 | }else{ 35 | return this.sms_number + '秒后再次获取' 36 | } 37 | } 38 | } 39 | }) 40 | 41 | export default Index -------------------------------------------------------------------------------- /src/page/home/index/route.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import Vue from 'vue' 3 | import Tpl from './template.html' 4 | import Value from './value' 5 | // import './style.less' 6 | 7 | import Scroller from 'vux/dist/components/scroller' 8 | import Flexbox from 'vux/dist/components/flexbox' 9 | import FlexboxItem from 'vux/dist/components/flexbox-item' 10 | import XImg from 'vux/dist/components/x-img' 11 | import Alert from 'vux/dist/components/alert' 12 | import Swiper from 'vux/dist/components/swiper' 13 | import SwiperItem from 'vux/dist/components/swiper-item' 14 | 15 | let Index = Vue.extend({ 16 | template : Tpl, 17 | components : { 18 | Scroller, 19 | Flexbox, 20 | FlexboxItem, 21 | XImg, 22 | Alert, 23 | Swiper, 24 | SwiperItem, 25 | }, 26 | ready : function(){ //做浏览器判断 和 兼容 27 | this.callJsApi('biz.navigation.setTitle',{title:'首页'}); 28 | }, 29 | data : ()=>{ 30 | return Value 31 | }, 32 | methods: { 33 | 34 | }, 35 | computed : { 36 | 37 | }, 38 | route : { 39 | 40 | } 41 | }) 42 | 43 | export default Index -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dd.banbu.com", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "build": "", 7 | "dev": "rm -rf ./dd && gulp dev" 8 | }, 9 | "dependencies": { 10 | "axios": "^0.15.3", 11 | "fastclick": "^1.0.6", 12 | "q": "^1.4.1", 13 | "vue": "^1.0.24", 14 | "vue-router": "^0.7.13", 15 | "vuex": "^0.8.2", 16 | "vuex-router-sync": "^2.1.0", 17 | "vux": "^0.1.3" 18 | }, 19 | "devDependencies": { 20 | "autoprefixer": "^6.3.6", 21 | "babel-cli": "^6.9.0", 22 | "babel-core": "^6.0.0", 23 | "babel-loader": "^6.0.0", 24 | "babel-preset-es2015": "^6.0.0", 25 | "babel-preset-stage-3": "^6.0.0", 26 | "css-loader": "^0.23.1", 27 | "extract-text-webpack-plugin": "^1.0.1", 28 | "gulp": "^3.9.1", 29 | "gulp-webpack": "^1.5.0", 30 | "html-webpack-plugin": "^2.8.2", 31 | "less": "^2.6.0", 32 | "less-loader": "^2.2.2", 33 | "postcss-loader": "^0.9.1", 34 | "precss": "^1.4.0", 35 | "raw-loader": "^0.5.1", 36 | "style-loader": "^0.13.0", 37 | "url-loader": "^0.5.7", 38 | "webpack": "^1.4.13", 39 | "webpack-dev-middleware": "^1.2.0" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /webpack.prod.config.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack') 2 | var config = require('./webpack.base.config') 3 | var HtmlWebpackPlugin = require('html-webpack-plugin') 4 | var ExtractTextPlugin = require("extract-text-webpack-plugin"); 5 | 6 | config.output.filename = '[name].[hash:8].js' 7 | config.output.chunkFilename = '[name].[hash:8].js' 8 | 9 | config.plugins = (config.plugins || []).concat([ 10 | new webpack.DefinePlugin({ 11 | 'process.env': { 12 | NODE_ENV: '"production"' 13 | } 14 | }), 15 | //开发时css不打包到一个文件中,方便调试 16 | new ExtractTextPlugin("styles.[hash:8].css",{allChunks: true}), 17 | new webpack.optimize.CommonsChunkPlugin({ 18 | name: "vendor", 19 | filename: "[name].[hash:8].js", 20 | minChunks: Infinity, 21 | }), 22 | new webpack.optimize.UglifyJsPlugin({ 23 | compressor: { 24 | warnings: false 25 | } 26 | }), 27 | new HtmlWebpackPlugin({ 28 | name:'index', 29 | template: './src/index.html', 30 | filename: 'index.html', 31 | inject: 'body', 32 | chunks: ['vendor', 'web_app'], 33 | minify:{ //压缩HTML文件 34 | removeComments:true, //移除HTML中的注释 35 | collapseWhitespace:false //删除空白符与换行符 36 | } 37 | }) 38 | ]) 39 | 40 | module.exports = config -------------------------------------------------------------------------------- /src/vuex/modules/app.js: -------------------------------------------------------------------------------- 1 | import { 2 | UPDATE_LOADING, 3 | UPDATE_DIRECTION, 4 | DDCONFIG_SUCCESS, 5 | DDCONFIG_ERROR, 6 | UPDATE_CODE, 7 | LOGIN_SUCCESS, 8 | LOGIN_ERROR, 9 | UPDATE_SYS_LEVEL 10 | } from '../mutation-types' 11 | 12 | const state = { 13 | isLoading: false, //路由加载标志位 14 | direction: 'forward', //路由动画变量 15 | 16 | ddConfig: null, 17 | ddConfigStatus: null, 18 | code: null, 19 | 20 | user: null 21 | } 22 | 23 | const mutations = { 24 | [UPDATE_LOADING] (state, status) { 25 | state.isLoading = status 26 | }, 27 | [UPDATE_DIRECTION] (state, direction) { 28 | state.direction = direction 29 | }, 30 | [DDCONFIG_SUCCESS] (state, config) { 31 | state.ddConfig = config; 32 | state.ddConfigStatus = true; 33 | }, 34 | [DDCONFIG_ERROR] (state, config) { 35 | state.ddConfig = null; 36 | state.ddConfigStatus = false; 37 | }, 38 | [UPDATE_CODE] (state, code) { 39 | state.code = code 40 | }, 41 | [LOGIN_SUCCESS] (state, user) { 42 | state.user = user 43 | }, 44 | [LOGIN_ERROR] (state, user) { 45 | state.user = false 46 | }, 47 | } 48 | 49 | export default { 50 | state, 51 | mutations 52 | } -------------------------------------------------------------------------------- /webpack.dev.config.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack') 2 | var config = require('./webpack.base.config') 3 | var HtmlWebpackPlugin = require('html-webpack-plugin') 4 | var ExtractTextPlugin = require("extract-text-webpack-plugin"); 5 | 6 | config.devtool = 'source-map' 7 | 8 | config.output.filename = '[name].[hash:8].js' 9 | config.output.chunkFilename = '[name].[hash:8].js' 10 | 11 | 12 | config.plugins = (config.plugins || []).concat([ 13 | new webpack.DefinePlugin({ 14 | 'process.env': { 15 | NODE_ENV: '"dev"' 16 | } 17 | }), 18 | //开发时css不打包到一个文件中,方便调试 19 | new ExtractTextPlugin("styles.[hash:8].css",{allChunks: true}), 20 | new webpack.optimize.CommonsChunkPlugin({ 21 | name: "vendor", 22 | filename: "[name].[hash:8].js", 23 | minChunks: Infinity, 24 | }), 25 | new webpack.optimize.UglifyJsPlugin({ 26 | compressor: { 27 | warnings: false 28 | } 29 | }), 30 | new HtmlWebpackPlugin({ 31 | name:'index', 32 | template: './src/index.html', 33 | filename: 'index.html', 34 | inject: 'body', 35 | chunks: ['vendor', 'web_app'], 36 | minify:{ //压缩HTML文件 37 | removeComments:true, //移除HTML中的注释 38 | collapseWhitespace:false //删除空白符与换行符 39 | } 40 | }) 41 | ]) 42 | 43 | module.exports = config -------------------------------------------------------------------------------- /src/page/home/route.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import Vue from 'vue' 3 | import Tpl from './template.html' 4 | import Value from './value' 5 | import './style.less' 6 | 7 | import store from '../../vuex/store' 8 | 9 | import Tabbar from 'vux/dist/components/tabbar' 10 | import TabbarItem from 'vux/dist/components/tabbar-item' 11 | 12 | let Index = Vue.extend({ 13 | template : Tpl, 14 | components : { 15 | Tabbar, 16 | TabbarItem 17 | }, 18 | store: store, 19 | vuex: { 20 | getters: { 21 | route: (state) => state.route, 22 | isLoading: (state) => state.app.isLoading, 23 | direction: (state) => state.app.direction 24 | } 25 | }, 26 | data : ()=>{ 27 | return Value 28 | }, 29 | methods: { 30 | selected(path){ 31 | let realPath = '' 32 | let index = this.route.path.indexOf('?'); 33 | if(index > 0){ 34 | realPath = this.route.path.substr(0,index) 35 | }else{ 36 | realPath = this.route.path 37 | } 38 | if(realPath == path){ 39 | return true 40 | }else{ 41 | return false 42 | } 43 | } 44 | }, 45 | computed : { 46 | } 47 | }) 48 | 49 | export default Index -------------------------------------------------------------------------------- /dd/user-sign-in.7d3cc497.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([5],{74:function(e,i,l){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(i,"__esModule",{value:!0});var a=l(31),t=n(a),s=l(75),d=n(s),c=l(76),u=n(c);l(77);var _=t.default.extend({template:d.default,components:{},ready:function(){this.callJsApi("biz.navigation.setTitle",{title:"签到"})},data:function(){return u.default},methods:{},computed:{},route:{}});i.default=_},75:function(e,i){e.exports='
\n
\n
图文组合列表
\n
\n
\n \n
\n
\n
\n
'},76:function(e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var l={};i.default=l},77:function(e,i){}}); 2 | //# sourceMappingURL=user-sign-in.7d3cc497.js.map -------------------------------------------------------------------------------- /webpack.base.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var webpack = require('webpack') 3 | var ExtractTextPlugin = require("extract-text-webpack-plugin"); 4 | var precss = require('precss'); 5 | var autoprefixer = require('autoprefixer'); 6 | 7 | 8 | module.exports = { 9 | 10 | entry: { 11 | web_app:"./src/main", 12 | //公共库 13 | vendor : [ 14 | 'q', 15 | 'axios', 16 | './env', 17 | 'vue', 18 | 'vue-router', 19 | 'vuex', 20 | 'vuex-router-sync', 21 | 'vux', 22 | 'fastclick', 23 | ] 24 | }, 25 | 26 | output: { 27 | filename: '[name].[chunkhash:8].js', 28 | chunkFilename: '[name].[chunkhash:8].js', 29 | publicPath: './' 30 | }, 31 | 32 | module: { 33 | loaders: [ 34 | { test: /\.js$/, 35 | exclude: /node_modules/, 36 | loader: 'babel' , 37 | query: { 38 | cacheDirectory: true, 39 | presets: ['es2015','stage-3'] 40 | } 41 | }, 42 | { test: /\.html$/, loader: 'raw' }, 43 | { test: /\.css/, loader: ExtractTextPlugin.extract("style-loader", "css-loader") }, 44 | { test: /\.less$/, loader: ExtractTextPlugin.extract("style-loader","css-loader!postcss-loader!less-loader") }, 45 | {test: /\.(jpg|png)$/, loader: "url?limit=8192"}, 46 | ] 47 | }, 48 | postcss: function () { 49 | return [ 50 | precss, 51 | autoprefixer({ browsers: ['iOS 7', '> 1%', 'last 4 versions'] }) 52 | ]; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /dd/user-bind-mobile.7d3cc497.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([6],{78:function(e,n,t){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var u=t(31),i=s(u),r=t(79),o=s(r),a=t(80),c=s(a);t(81);var d=i.default.extend({template:o.default,ready:function(){this.callJsApi("biz.navigation.setTitle",{title:"员工绑定"})},data:function(){return c.default},methods:{sendSms:function(){var e=this;this.sms_number=60;var n=setInterval(function(){e.sms_number--,0==e.sms_number&&clearInterval(n)},1e3)},bindPhone:function(){}},computed:{sms_text:function(){return 0==this.sms_number?"获取验证码":this.sms_number+"秒后再次获取"}}});n.default=d},79:function(e,n){e.exports='
\n
为保障账号安全,请勿向他人透露账号信息
\n \n \n \n \n
\n {{sms_text}}\n
\n
\n
\n\n \n 绑定\n \n
'},80:function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t={phone:"",verification_code:"",sms_number:0,showToast:!1,toastText:""};n.default=t},81:function(e,n){}}); 2 | //# sourceMappingURL=user-bind-mobile.7d3cc497.js.map -------------------------------------------------------------------------------- /src/page/app/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import Vue from 'vue' 3 | import Tpl from './template.html' 4 | import Value from './value' 5 | import './style.less' 6 | 7 | import store from '../../vuex/store' 8 | import {getRequestAuthCode} from '../../vuex/actions' 9 | 10 | let Index = Vue.extend({ 11 | template : Tpl, 12 | store: store, 13 | vuex: { 14 | getters: { 15 | route: (state) => state.route, 16 | isLoading: (state) => state.app.isLoading, 17 | direction: (state) => state.app.direction, 18 | ddConfig: (state) => state.app.ddConfig, 19 | ddConfigStatus: (state) => state.app.ddConfigStatus, 20 | code: (state) => state.app.code, 21 | userInfo: (state) => state.app.user, 22 | }, 23 | actions: { 24 | getRequestAuthCode 25 | } 26 | }, 27 | watch: { 28 | ddConfigStatus: function (val, oldVal) { 29 | if(val === true){ 30 | this.getRequestAuthCode(this.ddConfig.corpId); 31 | } 32 | }, 33 | userInfo: function (val, oldVal) { 34 | if(val && val.mobile == ''){ 35 | this.$router.go(this.base_path+'/user/bind') 36 | } 37 | } 38 | }, 39 | ready : function(){ 40 | console.log('APP ready 应该只执行一次'); 41 | }, 42 | data : ()=>{ 43 | return Value 44 | }, 45 | methods: { 46 | 47 | }, 48 | computed : { 49 | showConfigErrorDialog(){ 50 | return this.ddConfigStatus === false; 51 | }, 52 | showCodeErrorDialog(){ 53 | return this.code === false; 54 | } 55 | } 56 | }) 57 | 58 | export default Index -------------------------------------------------------------------------------- /src/vuex/actions.js: -------------------------------------------------------------------------------- 1 | import * as mutations from './mutation-types' 2 | import env from '../../env' 3 | import jsapi from '../lib/ddApiConfig' 4 | import axios from 'axios' 5 | 6 | export function getRequestAuthCode({ dispatch, state }, corpId) { 7 | 8 | if(!window.ability || window.ability < jsapi['runtime.permission.requestAuthCode']){ 9 | console.warn('容器版本过低,不支持 runtime.permission.requestAuthCode') 10 | return; 11 | } 12 | 13 | dd.runtime.permission.requestAuthCode({ 14 | corpId : state.app.ddConfig.corpId || corpId, 15 | onSuccess : function(result) { 16 | dispatch(mutations.UPDATE_CODE,result.code) 17 | 18 | getUserInfo({ dispatch, state },result.code) 19 | 20 | console.log('获取到了免登陆code=>'+result.code) 21 | }, 22 | onFail : function(err) { 23 | dispatch(mutations.UPDATE_CODE,false) 24 | console.log('获取免登陆code失败') 25 | } 26 | }); 27 | } 28 | 29 | export function getUserInfo({dispatch, state}, code) { 30 | axios.get(env.API_HOST+'/user/getUserinfo', { 31 | params: { 32 | code: code, 33 | corpId: state.app.ddConfig.corpId, 34 | suiteKey: window.getParamByName('suiteKey') 35 | }, 36 | timeout: 5000, 37 | }).then(function (response) { 38 | if(response.status == 200 && response.data.code == 200){ 39 | let user = response.data.result; 40 | dispatch(mutations.LOGIN_SUCCESS, user); 41 | dispatch(mutations.UPDATE_SYS_LEVEL, user.sys_level); 42 | }else{ 43 | dispatch(mutations.LOGIN_ERROR,false) 44 | } 45 | }).catch(function (err) { 46 | dispatch(mutations.LOGIN_ERROR,false) 47 | }); 48 | } -------------------------------------------------------------------------------- /src/lib/ddApiConfig.js: -------------------------------------------------------------------------------- 1 | export default { 2 | 'biz.util.open': { 3 | 'chat': 0, 4 | 'call': 0, 5 | 'profile': 0, 6 | 'contactAdd': 4, 7 | 'friendAdd': 4, 8 | }, 9 | 10 | 'device.accelerometer.watchShake': 0, 11 | 'device.accelerometer.clearShake': 0, 12 | 'device.notification.vibrate': 0, 13 | 'biz.contact.choose': 0, 14 | 'biz.navigation.setLeft': 0, 15 | 'biz.navigation.setTitle': 0, 16 | 'biz.navigation.setRight': 0, 17 | 'biz.navigation.back': 0, 18 | 'device.notification.alert': 0, 19 | 'device.notification.confirm': 0, 20 | 'device.notification.prompt': 0, 21 | 'biz.util.share': 0, 22 | 'biz.util.ut': 0, 23 | 'biz.util.datepicker': 0, 24 | 'biz.util.timepicker': 0, 25 | 26 | 'runtime.info': 1, 27 | 'device.geolocation.get': 1, 28 | 'device.notification.toast': 1, 29 | 'device.notification.showPreloader': 1, 30 | 'device.notification.hidePreloader': 1, 31 | 'biz.util.uploadImage': 1, 32 | 'biz.util.previewImage': 1, 33 | 34 | 'device.connection.getNetworkType': 2, 35 | 'biz.util.qrcode': 2, 36 | 'device.notification.actionSheet': 2, 37 | 'ui.input.plain': 2, 38 | 39 | 'biz.ding.post': 3, 40 | 'biz.telephone.call': 3, 41 | 'biz.chat.chooseConversation': 3, 42 | 43 | 'biz.contact.createGroup': 4, 44 | 'biz.util.datetimepicker': 4, 45 | 46 | 'biz.util.chosen': 5, 47 | 'device.base.getUUID': 5, 48 | 'device.base.getInterface': 5, 49 | 'device.launcher.checkInstalledApps': 5, 50 | 'device.launcher.launchApp': 5, 51 | 'runtime.permission.requestAuthCode': 5, 52 | 'runtime.permission.requestJsApis': 5, 53 | 'ui.pullToRefresh.enable': 5, 54 | 'ui.pullToRefresh.stop': 5, 55 | 'ui.pullToRefresh.disable': 5, 56 | 'ui.webViewBounce.disable': 5, 57 | 'ui.webViewBounce.enable': 5, 58 | } -------------------------------------------------------------------------------- /src/page/home/member/route.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import Vue from 'vue' 3 | import Tpl from './template.html' 4 | import './style.less' 5 | // import WalletService from './service' 6 | 7 | import {config} from '../../../../env' 8 | 9 | import Group from 'vux/dist/components/group' 10 | import Cell from 'vux/dist/components/cell' 11 | import Blur from 'vux/dist/components/blur' 12 | import Popup from 'vux/dist/components/popup' 13 | import Qrcode from 'vux/dist/components/qrcode' 14 | import Alert from 'vux/dist/components/alert' 15 | 16 | let Index = Vue.extend({ 17 | 18 | template : Tpl, 19 | components : { 20 | Group, 21 | Cell, 22 | Blur, 23 | Popup, 24 | Qrcode, 25 | Alert, 26 | }, 27 | vuex: { 28 | getters: { 29 | route: (state) => state.route, 30 | userInfo: (state) => state.app.user || {}, 31 | }, 32 | }, 33 | ready : function(){ 34 | this.callJsApi('biz.navigation.setTitle',{title:'个人'}); 35 | }, 36 | data : ()=>{ 37 | return { 38 | img_url: '' 39 | } 40 | }, 41 | events : { 42 | 43 | }, 44 | methods: { 45 | uploadImg(){ 46 | this.callJsApi('biz.util.uploadImage',{ 47 | multiple: false, //是否多选,默认false 48 | }).then((data)=>{ 49 | this.img_url = data[0]; 50 | }) 51 | } 52 | }, 53 | computed : { 54 | filterAvatar(){ 55 | return this.userInfo && this.userInfo.avatar && this.userInfo.avatar !='' 56 | ? this.userInfo.avatar 57 | : 'http://img5.imgtn.bdimg.com/it/u=1457102793,1407747410&fm=23&gp=0.jpg' 58 | } 59 | }, 60 | route : { 61 | data : function(transition){ 62 | transition.next() 63 | } 64 | } 65 | }) 66 | 67 | export default Index -------------------------------------------------------------------------------- /src/lib/vue-dd-plugin.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | import Q from 'q' 3 | import jsapi from './ddApiConfig' 4 | const ddPlugin = {}; 5 | 6 | var getMethod = function(method, ns) { 7 | var arr = method.split('.'); 8 | var namespace = ns || dd; 9 | for (var i = 0, k = arr.length; i < k; i++) { 10 | if (i === k - 1) { 11 | return namespace[arr[i]]; 12 | } 13 | if (typeof namespace[arr[i]] == 'undefined') { 14 | namespace[arr[i]] = {}; 15 | } 16 | namespace = namespace[arr[i]]; 17 | } 18 | }; 19 | 20 | ddPlugin.install = function (Vue, option) { 21 | var dd = window.dd; 22 | 23 | if(dd){ 24 | 25 | Vue.prototype.callJsApi = function (method, param = {}) { 26 | return Q.Promise((success, error)=>{ 27 | if(!window.ability || window.ability < jsapi[method]){ 28 | console.warn('容器版本过低,不支持 '+ method) 29 | return error({errCode: 404, msg: '容器版本过低,不支持'+method}) 30 | } 31 | 32 | param.onSuccess = function(result) { 33 | process.env.NODE_ENV !== 'production' && console.log(method, '调用成功,success', result) 34 | success(result) 35 | }; 36 | param.onFail = function(result) { 37 | process.env.NODE_ENV !== 'production' && console.warn(method, '调用失败,fail', result) 38 | error(result) 39 | }; 40 | getMethod(method)(param); 41 | }) 42 | 43 | } 44 | 45 | }else{ 46 | console.error('dd没有定义') 47 | } 48 | }; 49 | 50 | (function (Plugin) { 51 | if(typeof module === 'object' && typeof module.exports === 'object'){ 52 | module.exports = Plugin; 53 | }else{ 54 | if(window.bb){ 55 | window.bb['ddPlugin'] = Plugin; 56 | }else{ 57 | window.bb = { 58 | ddPlugin:Plugin 59 | } 60 | } 61 | } 62 | })(ddPlugin); 63 | -------------------------------------------------------------------------------- /src/page/home/style.less: -------------------------------------------------------------------------------- 1 | @color-zong : #B0A498; 2 | @color-org : #F78C40; 3 | .icon-czl-home,.icon-faxian,.icon-jifen,.icon-member{ 4 | width: 1.2rem; 5 | background-repeat: no-repeat; 6 | background-size: cover; 7 | } 8 | //.weui_tabbar_item.weui_bar_item_on{ 9 | // .weui_tabbar_label{ 10 | // color: #888; 11 | // } 12 | //} 13 | .weui_tabbar_item.weui_bar_item_on { 14 | background: rgba(176, 164, 152, .1); 15 | 16 | img.icon-index{ 17 | content:url('http://7te93u.com1.z0.glb.clouddn.com/gj/index_on.png'); 18 | } 19 | img.icon-wenda{ 20 | content:url('http://7te93u.com1.z0.glb.clouddn.com/gj/wenda_on.png'); 21 | } 22 | img.icon-order{ 23 | content:url('http://7te93u.com1.z0.glb.clouddn.com/gj/order_on.png'); 24 | } 25 | img.icon-member{ 26 | content:url('http://7te93u.com1.z0.glb.clouddn.com/gj/member_on.png'); 27 | } 28 | .weui_tabbar_label{ 29 | color: @color-org; 30 | } 31 | } 32 | 33 | //home 34 | .banner-box{ 35 | position: relative; 36 | padding-top: 44%; 37 | overflow: hidden; 38 | } 39 | .banner-btn{ 40 | position: absolute; 41 | bottom: .5rem; 42 | background: rgba(255,255,255,.7); 43 | left: .5rem; 44 | padding: .1rem .3rem; 45 | border-radius: 2px; 46 | } 47 | .banner-img{ 48 | position: absolute; 49 | top:0; 50 | } 51 | 52 | .yuyue-box{ 53 | padding: .5rem 0 .2rem 0; 54 | background: #fff; 55 | } 56 | .yuyue-img{ 57 | width: 3rem; 58 | height: 3rem; 59 | border-radius: 50%; 60 | background: #888; 61 | } 62 | .yuyue-text{ 63 | font-size: 14px; 64 | } 65 | 66 | .fuwu-box{ 67 | color: #fff; 68 | background: @color-zong; 69 | 70 | p{ 71 | padding: .1rem 0 .1rem .5rem; 72 | font-size: 16px; 73 | } 74 | } 75 | 76 | .ximg { 77 | width: 100%; 78 | height: auto; 79 | } 80 | .ximg-error { 81 | 82 | } 83 | .ximg-error:after { 84 | content: '加载失败'; 85 | color: red; 86 | } 87 | 88 | //wenda 89 | .btn-tiwen{ 90 | width: 4rem; 91 | height: 4rem; 92 | margin: 0 auto; 93 | font-size: .8rem; 94 | font-weight: bold; 95 | background: #4DAF7C; 96 | border-radius: 50%; 97 | color: #fff; 98 | } -------------------------------------------------------------------------------- /src/page/home/index/value.js: -------------------------------------------------------------------------------- 1 | let value = { 2 | 3 | showToast : false, 4 | list : [ 5 | // 'http://7te93u.com1.z0.glb.clouddn.com/gj/d1.jpg', 6 | // 'http://7te93u.com1.z0.glb.clouddn.com/gj/d2.jpg', 7 | // 'http://7te93u.com1.z0.glb.clouddn.com/gj/d3.jpg', 8 | // 'http://7te93u.com1.z0.glb.clouddn.com/gj/d4.jpg', 9 | // 'http://7xl1vx.com2.z0.glb.qiniucdn.com/1469081752823', 10 | // 'http://7te93u.com1.z0.glb.clouddn.com/gj/d6.jpg', 11 | // 'http://7te93u.com1.z0.glb.clouddn.com/gj/d7.jpg', 12 | 'http://7te93u.com1.z0.glb.clouddn.com/gj/d8.jpg', 13 | ], 14 | 15 | height : window.innerHeight-55 + 'px', 16 | 17 | random_img_url : 'data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==', 18 | 19 | showGuanZhuQrcode : false, 20 | 21 | descText : [ 22 | // '张江园区总工会联合“车知了”推出爱车关怀管家服务', 23 | // '论用车生活中“老司机”的重要性:', 24 | '“老司机”,帮我介绍个靠谱的维修店吧', 25 | '“老司机”,4S店告诉我要换这个换那个,到底要不要换啊?', 26 | '“老司机”,我换这些东西要这么多钱,有没有被宰啊?', 27 | '“老司机”,我刚刚跟人蹭了下车,到底是谁的责任啊,我是先报警还是先找保险啊?出险怎么处理啊?', 28 | '“老司机”,车子违章被扣了15分,怎么办啊?', 29 | '“老司机”,我想买个车,有没有推荐的啊?', 30 | '“老司机”,车子要年检了,怎么弄啊?', 31 | '“老司机”,怎么样买保险省钱啊?', 32 | '其实,你的内心是崩溃的,你更希望的是“老司机”马上出现在你的身边帮你解决问题,而车知了管家,就是你身边专家级的“老司机”', 33 | ], 34 | descText2 : [ 35 | ' 1. 服务介绍:', 36 | '车知了管家服务是上海车米网络科技有限公司推出的专业技师上门陪同/代办服务(汽车保养、维修、美容装潢、事故处理、车务代办、违章处理、购车服务等。)', 37 | '2. 预约方式:', 38 | '扫张江园区总工会专属二维码,注册预约,立减10-20元', 39 | '也可以直接注册输入张江园区总工会专属邀请码:979898', 40 | 41 | '4.服务费用:', 42 | '注:我们只收取服务费,维修费用根据店面的发票或者收据,由车知了管家先行垫付,交车时由车主确认无误后支付。', 43 | ], 44 | feeTable : { 45 | th : ['服务项目','原价','工会价格'], 46 | tr : [ 47 | ['汽车保养、维修、美容装潢','199元','89元'], 48 | ['违章处理、车检等车务代办','199元','89元'], 49 | ['购车服务、事故处理','399元','169元'] 50 | ] 51 | }, 52 | descText3 : [ 53 | '服务过程中,车知了管家全程参与监督,对项目配件和服务提供全程保障,避免出现过度保养和使用假配件的情况发生。', 54 | '如果在服务过程中由车知了管家出现的违章,一律由本公司负责。', 55 | '如遇意外交通事故发生,若属车知了管家违章行为造成,相应赔偿由车知了管家承担。若属于他方车辆主要责任,车知了管家不负责赔偿损失,但可以免费协助交警调查及保险理赔。', 56 | '服务期间所有车辆均享有车知了管家购买的200万意外险。', 57 | '用户可以指定到4S店或者维修店服务,车知了与4S店或者维修店不存在利益关系,100%保障了用户利益;如用户没有指定店面,车知了管家可以根据用户需求帮找合适服务店面,最终选择哪个店面服务由用户自主决定。', 58 | '车知了管家提供售后保障,如因为车知了管家服务导致出现问题,车知了提供先行赔付保障。' 59 | ], 60 | } 61 | 62 | export default value; -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 班步 11 | 12 | 13 | 14 | 15 |
16 |
17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 |
35 | 36 |
37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/page/app/style.less: -------------------------------------------------------------------------------- 1 | 2 | html, body { 3 | height: 100%; 4 | width: 100%; 5 | overflow-x: hidden; 6 | } 7 | body { 8 | background-color: #fbf9fe; 9 | } 10 | /* v-r-transition, default is {forward: 'forward', back: 'back'}*/ 11 | .forward-enter, .forward-leave { 12 | transform: translate3d(-100%, 0, 0); 13 | } 14 | .back-enter, .back-leave { 15 | transform: translate3d(100%, 0, 0); 16 | } 17 | .demo-icon-22 { 18 | font-family: 'vux-demo'; 19 | font-size: 22px; 20 | color: #888; 21 | } 22 | .weui_tabbar.vux-demo-tabbar { 23 | backdrop-filter: blur(10px); 24 | background-color: none; 25 | background: rgba(247, 247, 250, 0.5); 26 | } 27 | .vux-demo-tabbar .weui_bar_item_on .demo-icon-22 { 28 | color: #F70968; 29 | } 30 | .vux-demo-tabbar .weui_tabbar_item.weui_bar_item_on .weui_tabbar_label { 31 | color: #35495e; 32 | } 33 | .vux-demo-tabbar .weui_tabbar_item.weui_bar_item_on .vux-demo-tabbar-icon-home { 34 | color: rgb(53, 73, 94); 35 | } 36 | .demo-icon-22:before { 37 | content: attr(icon); 38 | } 39 | .vux-demo-tabbar-component { 40 | background-color: #F70968; 41 | color: #fff; 42 | border-radius: 7px; 43 | padding: 0 4px; 44 | line-height: 14px; 45 | } 46 | .weui_tabbar_icon + .weui_tabbar_label { 47 | margin-top: 0!important; 48 | } 49 | .vux-demo-header-box { 50 | z-index: 100; 51 | position: absolute; 52 | width: 100%; 53 | left: 0; 54 | top: 0; 55 | } 56 | .weui_tab_bd { 57 | padding-top: 46px; 58 | } 59 | /** 60 | * vue-router transition 61 | */ 62 | .vux-pop-out-transition, 63 | .vux-pop-in-transition { 64 | width: 100%; 65 | animation-duration: 0.5s; 66 | animation-fill-mode: both; 67 | backface-visibility: hidden; 68 | } 69 | .vux-pop-out-enter, 70 | .vux-pop-out-leave, 71 | .vux-pop-in-enter, 72 | .vux-pop-in-leave { 73 | will-change: transform; 74 | height: 100%; 75 | position: absolute; 76 | left: 0; 77 | } 78 | .vux-pop-out-enter { 79 | animation-name: popInLeft; 80 | } 81 | .vux-pop-out-leave { 82 | animation-name: popOutRight; 83 | } 84 | .vux-pop-in-enter { 85 | perspective: 1000; 86 | animation-name: popInRight; 87 | } 88 | .vux-pop-in-leave { 89 | animation-name: popOutLeft; 90 | } 91 | @keyframes popInLeft { 92 | from { 93 | transform: translate3d(-100%, 0, 0); 94 | } 95 | to { 96 | transform: translate3d(0, 0, 0); 97 | } 98 | } 99 | @keyframes popOutLeft { 100 | from { 101 | transform: translate3d(0, 0, 0); 102 | } 103 | to { 104 | transform: translate3d(-100%, 0, 0); 105 | } 106 | } 107 | @keyframes popInRight { 108 | from { 109 | transform: translate3d(100%, 0, 0); 110 | } 111 | to { 112 | transform: translate3d(0, 0, 0); 113 | } 114 | } 115 | @keyframes popOutRight { 116 | from { 117 | transform: translate3d(0, 0, 0); 118 | } 119 | to { 120 | transform: translate3d(100%, 0, 0); 121 | } 122 | } -------------------------------------------------------------------------------- /dd/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 班步 11 | 12 | 13 | 14 | 15 |
16 |
17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 |
35 | 36 |
37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/lib/vue-bb-plugin.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | import env from '../../env' 3 | 4 | const bbPlugin = {}; 5 | bbPlugin.install = function (Vue, option) { 6 | 7 | // 设置cookie 8 | Vue.cookie = function (key, value, options) { 9 | var days, time, result, decode; 10 | 11 | if (arguments.length > 1 && String(value) !== "[object Object]") { 12 | // Enforce object 13 | options = $.extend({}, options) 14 | 15 | if (value === null || value === undefined) options.expires = -1 16 | 17 | if (typeof options.expires === 'number') { 18 | days = (options.expires * 24 * 60 * 60 * 1000) 19 | time = options.expires = new Date() 20 | 21 | time.setTime(time.getTime() + days) 22 | } 23 | 24 | value = String(value) 25 | 26 | return (document.cookie = [ 27 | encodeURIComponent(key), '=', 28 | options.raw ? value : (value), 29 | options.expires ? '; expires=' + options.expires.toUTCString() : '', 30 | '; path=/', 31 | options.domain ? '; domain=' + options.domain : '', 32 | options.secure ? '; secure' : '' 33 | ].join('')) 34 | } 35 | 36 | // Key and possibly options given, get cookie 37 | options = value || {} 38 | 39 | decode = options.raw ? function (s) { return s } : decodeURIComponent 40 | 41 | return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null 42 | }; 43 | 44 | Vue.prototype.base_path = env.BASE_PATH; 45 | 46 | // 简单封装本地存储 47 | Vue.prototype.localStorage = { 48 | getItem : function(key){ 49 | if (typeof localStorage === 'object') { 50 | try { 51 | return JSON.parse(localStorage.getItem(key)); 52 | } catch (e) { 53 | alert('请关闭[无痕浏览]模式后再试!'); 54 | } 55 | } 56 | }, 57 | setItem : function(key,value){ 58 | if (typeof localStorage === 'object') { 59 | try { 60 | return localStorage.setItem(key,JSON.stringify(value)); 61 | } catch (e) { 62 | alert('请关闭[无痕浏览]模式后再试!'); 63 | } 64 | } 65 | }, 66 | removeItem : function(key){ 67 | if (typeof localStorage === 'object') { 68 | try { 69 | return localStorage.removeItem(key); 70 | } catch (e) { 71 | alert('请关闭[无痕浏览]模式后再试!'); 72 | } 73 | } 74 | }, 75 | getUseSize : function(){ 76 | if (typeof localStorage === 'object') { 77 | try { 78 | return JSON.stringify(localStorage).length; 79 | } catch (e) { 80 | alert('请关闭[无痕浏览]模式后再试!'); 81 | } 82 | } 83 | } 84 | }; 85 | 86 | Date.prototype.Format = function (fmt) { //author: meizz 87 | var o = { 88 | "M+": this.getMonth() + 1, //月份 89 | "d+": this.getDate(), //日 90 | "H+": this.getHours(), //小时 91 | "m+": this.getMinutes(), //分 92 | "s+": this.getSeconds(), //秒 93 | "q+": Math.floor((this.getMonth() + 3) / 3), //季度 94 | "S": this.getMilliseconds() //毫秒 95 | }; 96 | if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); 97 | for (var k in o) 98 | if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); 99 | return fmt; 100 | } 101 | 102 | 103 | }; 104 | 105 | (function (Plugin) { 106 | if(typeof module === 'object' && typeof module.exports === 'object'){ 107 | module.exports = Plugin; 108 | }else{ 109 | if(window.bb){ 110 | window.bb['bbPlugin'] = Plugin; 111 | }else{ 112 | window.bb = { 113 | bbPlugin:Plugin 114 | } 115 | } 116 | } 117 | })(bbPlugin); -------------------------------------------------------------------------------- /dd/user-sign-in.7d3cc497.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///user-sign-in.7d3cc497.js","webpack:///./src/page/user-sign-in/route.js","webpack:///./src/page/user-sign-in/template.html","webpack:///./src/page/user-sign-in/value.js"],"names":["webpackJsonp","74","module","exports","__webpack_require__","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","_vue","_vue2","_template","_template2","_value","_value2","Index","extend","template","components","ready","this","callJsApi","title","data","methods","computed","route","75","76","77"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAASC,EAAQC,EAASC,GCHhC,YDyBC,SAASC,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,QAASF,GAlBvFG,OAAOC,eAAeP,EAAS,cAC3BQ,OAAO,GCPZ,IAAAC,GAAAR,EAAA,IDYKS,EAAQR,EAAuBO,GCXpCE,EAAAV,EAAA,IDeKW,EAAaV,EAAuBS,GCdzCE,EAAAZ,EAAA,IDkBKa,EAAUZ,EAAuBW,ECjBtCZ,GAAA,GAEA,IAAIc,GAAQL,EAAAL,QAAIW,QACZC,mBACAC,cAGAC,MAAQ,WACJC,KAAKC,UAAU,2BAA2BC,MAAM,QAEpDC,KAAO,WACH,MAAAT,GAAAT,SAEJmB,WAGAC,YAGAC,UDkBH1B,GAAQK,QCbMU,GDiBTY,GACA,SAAS5B,EAAQC,GE9CvBD,EAAAC,QAAA,gyBFoDM4B,GACA,SAAS7B,EAAQC,GAEtB,YAEAM,QAAOC,eAAeP,EAAS,cAC7BQ,OAAO,GG1DV,IAAIA,KH8DHR,GAAQK,QG1DMG,GH8DTqB,GACA,SAAS9B,EAAQC","file":"user-sign-in.7d3cc497.js","sourcesContent":["webpackJsonp([5],{\n\n/***/ 74:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _vue = __webpack_require__(31);\n\t\n\tvar _vue2 = _interopRequireDefault(_vue);\n\t\n\tvar _template = __webpack_require__(75);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _value = __webpack_require__(76);\n\t\n\tvar _value2 = _interopRequireDefault(_value);\n\t\n\t__webpack_require__(77);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar Index = _vue2.default.extend({\n\t template: _template2.default,\n\t components: {},\n\t ready: function ready() {\n\t this.callJsApi('biz.navigation.setTitle', { title: '签到' });\n\t },\n\t data: function data() {\n\t return _value2.default;\n\t },\n\t methods: {},\n\t computed: {},\n\t route: {}\n\t});\n\t\n\texports.default = Index;\n\n/***/ },\n\n/***/ 75:\n/***/ function(module, exports) {\n\n\tmodule.exports = \"
\\n
\\n
图文组合列表
\\n
\\n
\\n \\n
\\n
\\n
\\n
\"\n\n/***/ },\n\n/***/ 76:\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar value = {};\n\t\n\texports.default = value;\n\n/***/ },\n\n/***/ 77:\n/***/ function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ }\n\n});\n\n\n// WEBPACK FOOTER //\n// user-sign-in.7d3cc497.js","'use strict';\nimport Vue from 'vue'\nimport Tpl from './template.html'\nimport Value from './value'\nimport './style.less'\n\nlet Index = Vue.extend({\n template : Tpl,\n components : {\n\n },\n ready : function(){\n this.callJsApi('biz.navigation.setTitle',{title:'签到'});\n },\n data : ()=>{\n return Value\n },\n methods: {\n\n },\n computed : {\n\n },\n route : {\n\n }\n})\n\nexport default Index\n\n\n// WEBPACK FOOTER //\n// ./src/page/user-sign-in/route.js","module.exports = \"
\\n
\\n
图文组合列表
\\n
\\n
\\n \\n
\\n
\\n
\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/page/user-sign-in/template.html\n// module id = 75\n// module chunks = 5","let value = {\n\n}\n\nexport default value;\n\n\n// WEBPACK FOOTER //\n// ./src/page/user-sign-in/value.js"],"sourceRoot":""} -------------------------------------------------------------------------------- /dd/user-bind-mobile.7d3cc497.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///user-bind-mobile.7d3cc497.js","webpack:///./src/page/user-bind-mobile/route.js","webpack:///./src/page/user-bind-mobile/template.html","webpack:///./src/page/user-bind-mobile/value.js"],"names":["webpackJsonp","78","module","exports","__webpack_require__","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","_vue","_vue2","_template","_template2","_value","_value2","Index","extend","template","ready","this","callJsApi","title","data","methods","sendSms","_this","sms_number","interval","setInterval","clearInterval","bindPhone","computed","sms_text","79","80","phone","verification_code","showToast","toastText","81"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAASC,EAAQC,EAASC,GCHhC,YDyBC,SAASC,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,QAASF,GAlBvFG,OAAOC,eAAeP,EAAS,cAC3BQ,OAAO,GCPZ,IAAAC,GAAAR,EAAA,IDYKS,EAAQR,EAAuBO,GCXpCE,EAAAV,EAAA,IDeKW,EAAaV,EAAuBS,GCdzCE,EAAAZ,EAAA,IDkBKa,EAAUZ,EAAuBW,ECjBtCZ,GAAA,GAEA,IAAIc,GAAQL,EAAAL,QAAIW,QACZC,mBACAC,MAAQ,WACJC,KAAKC,UAAU,2BAA2BC,MAAM,UAEpDC,KAAO,WACH,MAAAR,GAAAT,SAEJkB,SACIC,QADK,WACI,GAAAC,GAAAN,IACLA,MAAKO,WAAa,EAClB,IAAIC,GAAWC,YAAY,WACvBH,EAAKC,aACiB,GAAnBD,EAAKC,YACJG,cAAcF,IAEpB,MAGNG,UAXK,cAeTC,UACIC,SADO,WAEH,MAAsB,IAAnBb,KAAKO,WACG,QAEAP,KAAKO,WAAa,YD0BxC1B,GAAQK,QCpBMU,GDwBTkB,GACA,SAASlC,EAAQC,GEjEvBD,EAAAC,QAAA,0nBFuEMkC,GACA,SAASnC,EAAQC,GAEtB,YAEAM,QAAOC,eAAeP,EAAS,cAC3BQ,OAAO,GG7EZ,IAAIA,IACA2B,MAAQ,GACRC,kBAAoB,GACpBV,WAAa,EAEbW,WAAY,EACZC,UAAY,GHkFftC,GAAQK,QG/EMG,GHmFT+B,GACA,SAASxC,EAAQC","file":"user-bind-mobile.7d3cc497.js","sourcesContent":["webpackJsonp([6],{\n\n/***/ 78:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _vue = __webpack_require__(31);\n\t\n\tvar _vue2 = _interopRequireDefault(_vue);\n\t\n\tvar _template = __webpack_require__(79);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _value = __webpack_require__(80);\n\t\n\tvar _value2 = _interopRequireDefault(_value);\n\t\n\t__webpack_require__(81);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar Index = _vue2.default.extend({\n\t template: _template2.default,\n\t ready: function ready() {\n\t this.callJsApi('biz.navigation.setTitle', { title: '员工绑定' });\n\t },\n\t data: function data() {\n\t return _value2.default;\n\t },\n\t methods: {\n\t sendSms: function sendSms() {\n\t var _this = this;\n\t\n\t this.sms_number = 60;\n\t var interval = setInterval(function () {\n\t _this.sms_number--;\n\t if (_this.sms_number == 0) {\n\t clearInterval(interval);\n\t }\n\t }, 1e3);\n\t },\n\t bindPhone: function bindPhone() {}\n\t },\n\t computed: {\n\t sms_text: function sms_text() {\n\t if (this.sms_number == 0) {\n\t return '获取验证码';\n\t } else {\n\t return this.sms_number + '秒后再次获取';\n\t }\n\t }\n\t }\n\t});\n\t\n\texports.default = Index;\n\n/***/ },\n\n/***/ 79:\n/***/ function(module, exports) {\n\n\tmodule.exports = \"
\\n
为保障账号安全,请勿向他人透露账号信息
\\n \\n \\n \\n \\n
\\n 0\\\">{{sms_text}}\\n
\\n
\\n
\\n\\n \\n 绑定\\n \\n
\"\n\n/***/ },\n\n/***/ 80:\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar value = {\n\t phone: '',\n\t verification_code: '',\n\t sms_number: 0,\n\t\n\t showToast: false,\n\t toastText: ''\n\t};\n\t\n\texports.default = value;\n\n/***/ },\n\n/***/ 81:\n/***/ function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ }\n\n});\n\n\n// WEBPACK FOOTER //\n// user-bind-mobile.7d3cc497.js","'use strict';\nimport Vue from 'vue'\nimport Tpl from './template.html'\nimport Value from './value'\nimport './style.less'\n\nlet Index = Vue.extend({\n template : Tpl,\n ready : function(){\n this.callJsApi('biz.navigation.setTitle',{title:'员工绑定'});\n },\n data : ()=>{\n return Value\n },\n methods: {\n sendSms(){\n this.sms_number = 60;\n let interval = setInterval(()=>{\n this.sms_number --;\n if(this.sms_number == 0){\n clearInterval(interval)\n }\n },1e3)\n\n },\n bindPhone(){\n\n }\n },\n computed : {\n sms_text(){\n if(this.sms_number == 0){\n return '获取验证码'\n }else{\n return this.sms_number + '秒后再次获取'\n }\n }\n }\n})\n\nexport default Index\n\n\n// WEBPACK FOOTER //\n// ./src/page/user-bind-mobile/route.js","module.exports = \"
\\n
为保障账号安全,请勿向他人透露账号信息
\\n \\n \\n \\n \\n
\\n 0\\\">{{sms_text}}\\n
\\n
\\n
\\n\\n \\n 绑定\\n \\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/page/user-bind-mobile/template.html\n// module id = 79\n// module chunks = 6","let value = {\n phone : '',\n verification_code : '',\n sms_number : 0,\n\n showToast : false,\n toastText : '',\n}\n\nexport default value;\n\n\n// WEBPACK FOOTER //\n// ./src/page/user-bind-mobile/value.js"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Q from 'q' 2 | import axios from 'axios' 3 | import Vue from 'vue' 4 | import Router from 'vue-router' 5 | import 'vux/dist/vux.css' 6 | import * as vux from 'vux' 7 | import { sync } from 'vuex-router-sync' 8 | import store from './vuex/store' 9 | import FastClick from 'fastclick' 10 | import env from '../env' 11 | import bbPlugin from './lib/vue-bb-plugin' 12 | import ddPlugin from './lib/vue-dd-plugin' 13 | import App from './page/app/index' 14 | 15 | window.getParamByName = function(name) { 16 | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 17 | var r = window.location.search.substr(1).match(reg); 18 | if (r != null) return unescape(r[2]); return null; 19 | }; 20 | let dd = window.dd; 21 | const commit = store.commit || store.dispatch; 22 | 23 | console.log(process.env.NODE_ENV) 24 | Vue.config.debug = process.env.NODE_ENV !== 'production'; 25 | Vue.config.devtools = process.env.NODE_ENV !== 'production'; 26 | 27 | Vue.component('alert',vux.Alert) 28 | Vue.component('loading',vux.Loading) 29 | Vue.component('group',vux.Group) 30 | Vue.component('x-input',vux.XInput) 31 | Vue.component('x-button',vux.XButton) 32 | 33 | let ddConfig = null; 34 | 35 | getConfig() 36 | .then((data)=>{ 37 | ddConfig = data; 38 | dd.config(ddConfig); 39 | }) 40 | // .then(ddIsReady) 41 | // .then(initVue) 42 | // .then(()=>{ 43 | // document.querySelector('#init-loading').remove(); 44 | // console.log('init vue 完成') 45 | // setTimeout(()=>{ 46 | // if(ddConfig != null){ 47 | // commit('DDCONFIG_SUCCESS', ddConfig) 48 | // }else{ 49 | // commit('DDCONFIG_ERROR', false); 50 | // } 51 | // },300) 52 | // }) 53 | .catch((err)=>{ 54 | alert(JSON.stringify(err)); 55 | }) 56 | .finally(()=>{ 57 | //开发环境 58 | ddIsReady() 59 | .then(initVue) 60 | .then(()=>{ 61 | document.querySelector('#init-loading').remove(); 62 | console.log('init vue 完成') 63 | setTimeout(()=>{ 64 | if(ddConfig != null){ 65 | commit('DDCONFIG_SUCCESS', ddConfig) 66 | }else{ 67 | commit('DDCONFIG_ERROR', false); 68 | } 69 | },300) 70 | }) 71 | }) 72 | 73 | 74 | function getConfig() { 75 | return Q.Promise((success, error)=>{ 76 | axios.get(env.API_HOST+'/auth/getConfig', { 77 | params: { 78 | corpid: getParamByName('corpid')||'ding1b56d2f4ba72e91635c2f4657eb6378f', 79 | appid: getParamByName('appid')||'2545', 80 | suitekey: getParamByName('suiteKey')||'suiteiyfdj0dfixywzqwg', 81 | paramUrl: document.URL 82 | }, 83 | timeout: 2000, 84 | }).then(function (response) { 85 | if(response.status == 200 && response.data.code == 200){ 86 | let res = response.data.result; 87 | let ddConfig = { 88 | agentId: res.agentId, // 必填,微应用ID 89 | corpId: res.corpId,//必填,企业ID 90 | timeStamp: res.timeStamp, // 必填,生成签名的时间戳 91 | nonceStr: res.nonceStr, // 必填,生成签名的随机串 92 | signature: res.signature, // 必填,签名 93 | type:0, //选填。0表示微应用的jsapi,1表示服务窗的jsapi。不填默认为0。该参数从dingtalk.js的0.8.3版本开始支持 94 | jsApiList : [ 95 | 'runtime.info', 96 | 'runtime.permission.requestAuthCode', 97 | 'runtime.permission.requestOperateAuthCode', //反馈式操作临时授权码 98 | 99 | 'biz.alipay.pay', 100 | 'biz.contact.choose', 101 | 'biz.contact.complexChoose', 102 | 'biz.contact.complexPicker', 103 | 'biz.contact.createGroup', 104 | 'biz.customContact.choose', 105 | 'biz.customContact.multipleChoose', 106 | 'biz.ding.post', 107 | 'biz.map.locate', 108 | 'biz.map.view', 109 | 'biz.util.openLink', 110 | 'biz.util.open', 111 | 'biz.util.share', 112 | 'biz.util.ut', 113 | 'biz.util.uploadImage', 114 | 'biz.util.previewImage', 115 | 'biz.util.datepicker', 116 | 'biz.util.timepicker', 117 | 'biz.util.datetimepicker', 118 | 'biz.util.chosen', 119 | 'biz.util.encrypt', 120 | 'biz.util.decrypt', 121 | 'biz.chat.pickConversation', 122 | 'biz.telephone.call', 123 | 'biz.navigation.setLeft', 124 | 'biz.navigation.setTitle', 125 | 'biz.navigation.setIcon', 126 | 'biz.navigation.close', 127 | 'biz.navigation.setRight', 128 | 'biz.navigation.setMenu', 129 | 'biz.user.get', 130 | 131 | 'ui.progressBar.setColors', 132 | 133 | 'device.base.getInterface', 134 | 'device.connection.getNetworkType', 135 | 'device.launcher.checkInstalledApps', 136 | 'device.launcher.launchApp', 137 | 'device.notification.confirm', 138 | 'device.notification.alert', 139 | 'device.notification.prompt', 140 | 'device.notification.showPreloader', 141 | 'device.notification.hidePreloader', 142 | 'device.notification.toast', 143 | 'device.notification.actionSheet', 144 | 'device.notification.modal', 145 | 'device.geolocation.get', 146 | 147 | 148 | ] // 必填,需要使用的jsapi列表,注意:不要带dd。 149 | } 150 | success(ddConfig) 151 | }else{ 152 | error({errCode:-2,msg:'接口请求失败'}) 153 | } 154 | }).catch(function (err) { 155 | error({errCode:-2,msg:'接口请求失败'}) 156 | }); 157 | }) 158 | 159 | } 160 | 161 | function ddIsReady() { 162 | return Q.Promise((success, error)=>{ 163 | let timeout = setTimeout(()=>{ 164 | error({errCode:-1,msg:'dd.ready初始化超时'}); 165 | },2000) 166 | dd.ready(function(){ 167 | console.log('初始化钉钉'); 168 | clearTimeout(timeout) 169 | 170 | //设置返回按钮 171 | dd.biz.navigation.setLeft({ 172 | show: true,//控制按钮显示, true 显示, false 隐藏, 默认true 173 | control: true,//是否控制点击事件,true 控制,false 不控制, 默认false 174 | showIcon: true,//是否显示icon,true 显示, false 不显示,默认true; 注:具体UI以客户端为准 175 | text: '返回',//控制显示文本,空字符串表示显示默认文本 176 | onSuccess : function(result) { 177 | //如果control为true,则onSuccess将在发生按钮点击事件被回调 178 | console.log('点击了返回按钮'); 179 | window.history.back(); 180 | }, 181 | onFail : function(err) {} 182 | }); 183 | //获取容器信息 184 | dd.runtime.info({ 185 | onSuccess: function(result) { 186 | window.ability = parseInt(result.ability.replace(/\./g,'')); 187 | console.log('容器版本为'+window.ability) 188 | }, 189 | onFail : function(err) {} 190 | }) 191 | 192 | success(true) 193 | }); 194 | dd.error(function(err){ 195 | clearTimeout(timeout) 196 | /** 197 | { 198 | message:"错误信息",//message信息会展示出钉钉服务端生成签名使用的参数,请和您生成签名的参数作对比,找出错误的参数 199 | errorCode:"错误码" 200 | } 201 | **/ 202 | console.error('dd error: ' + JSON.stringify(err)); 203 | error({errCode:-1,msg:'dd.error配置信息不对'}) 204 | }); 205 | }) 206 | } 207 | 208 | function initVue() { 209 | return Q.Promise((success, error)=>{ 210 | 211 | Vue.use(Router) 212 | Vue.use(bbPlugin) 213 | Vue.use(ddPlugin) 214 | 215 | let router = new Router({ 216 | transitionOnLoad: false 217 | }) 218 | router.map({ 219 | [env.BASE_PATH] : { 220 | component: function(resolve){ 221 | require.ensure([], function() { 222 | let route = require('./page/home/route').default; 223 | resolve(route); 224 | },'home') 225 | }, 226 | subRoutes: { 227 | '/': { 228 | component: function (resolve) { 229 | require.ensure([], function () { 230 | let route = require('./page/home/index/route').default; 231 | resolve(route); 232 | },'index') 233 | } 234 | }, 235 | '/member' : { 236 | component: function(resolve){ 237 | require.ensure([], function() { 238 | let route = require('./page/home/member/route').default; 239 | resolve(route); 240 | },'member') 241 | } 242 | }, 243 | // '/banbu' : { 244 | // component: function(resolve){ 245 | // require.ensure([], function() { 246 | // let route = require('./states/index/wenda/route').default; 247 | // resolve(route); 248 | // },'wenda') 249 | // } 250 | // }, 251 | } 252 | }, 253 | [env.BASE_PATH+'/user/sign_in'] : { 254 | component: function (resolve) { 255 | require.ensure([], function () { 256 | let route = require('./page/user-sign-in/route').default; 257 | resolve(route); 258 | }, 'user-sign-in') 259 | } 260 | }, 261 | [env.BASE_PATH+'/user/bind'] : { 262 | component: function (resolve) { 263 | require.ensure([], function () { 264 | let route = require('./page/user-bind-mobile/route').default; 265 | resolve(route); 266 | }, 'user-bind-mobile') 267 | } 268 | } 269 | }); 270 | router.redirect({ 271 | '*': env.BASE_PATH 272 | }); 273 | let history = window.sessionStorage 274 | history.clear() 275 | let historyCount = history.getItem('count') * 1 || 0 276 | history.setItem('/', 0) 277 | 278 | router.beforeEach(({ to, from, next }) => { 279 | const toIndex = history.getItem(to.path) 280 | const fromIndex = history.getItem(from.path) 281 | if (toIndex) { 282 | if (toIndex > fromIndex || !fromIndex) { 283 | commit('UPDATE_DIRECTION', 'forward') 284 | } else { 285 | commit('UPDATE_DIRECTION', 'reverse') 286 | } 287 | } else { 288 | ++historyCount 289 | history.setItem('count', historyCount) 290 | to.path !== '/' && history.setItem(to.path, historyCount) 291 | commit('UPDATE_DIRECTION', 'forward') 292 | } 293 | commit('UPDATE_LOADING', true) 294 | 295 | 296 | setTimeout(()=>{ 297 | try { 298 | //设置右侧按钮 299 | dd.biz.navigation.setRight({ 300 | show: false,//控制按钮显示, true 显示, false 隐藏, 默认true 301 | }); 302 | }catch (err){ 303 | console.error(err); 304 | } 305 | 306 | next(); 307 | }, 10) 308 | }) 309 | router.afterEach(() => { 310 | commit('UPDATE_LOADING', false) 311 | }) 312 | sync(store, router) 313 | router.start(App, '#app') 314 | 315 | FastClick.attach(document.body) 316 | 317 | success() 318 | }) 319 | } 320 | 321 | -------------------------------------------------------------------------------- /dd/web_app.7d3cc497.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([1],[function(e,t,o){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function u(){return d.default.Promise(function(e,t){f.default.get(E.default.API_HOST+"/auth/getConfig",{params:{corpid:getParamByName("corpid")||"ding1b56d2f4ba72e91635c2f4657eb6378f",appid:getParamByName("appid")||"2545",suitekey:getParamByName("suiteKey")||"suiteiyfdj0dfixywzqwg",paramUrl:document.URL},timeout:2e3}).then(function(o){if(200==o.status&&200==o.data.code){var n=o.data.result,i={agentId:n.agentId,corpId:n.corpId,timeStamp:n.timeStamp,nonceStr:n.nonceStr,signature:n.signature,type:0,jsApiList:["runtime.info","runtime.permission.requestAuthCode","runtime.permission.requestOperateAuthCode","biz.alipay.pay","biz.contact.choose","biz.contact.complexChoose","biz.contact.complexPicker","biz.contact.createGroup","biz.customContact.choose","biz.customContact.multipleChoose","biz.ding.post","biz.map.locate","biz.map.view","biz.util.openLink","biz.util.open","biz.util.share","biz.util.ut","biz.util.uploadImage","biz.util.previewImage","biz.util.datepicker","biz.util.timepicker","biz.util.datetimepicker","biz.util.chosen","biz.util.encrypt","biz.util.decrypt","biz.chat.pickConversation","biz.telephone.call","biz.navigation.setLeft","biz.navigation.setTitle","biz.navigation.setIcon","biz.navigation.close","biz.navigation.setRight","biz.navigation.setMenu","biz.user.get","ui.progressBar.setColors","device.base.getInterface","device.connection.getNetworkType","device.launcher.checkInstalledApps","device.launcher.launchApp","device.notification.confirm","device.notification.alert","device.notification.prompt","device.notification.showPreloader","device.notification.hidePreloader","device.notification.toast","device.notification.actionSheet","device.notification.modal","device.geolocation.get"]};e(i)}else t({errCode:-2,msg:"接口请求失败"})}).catch(function(e){t({errCode:-2,msg:"接口请求失败"})})})}function a(){return d.default.Promise(function(e,t){var o=setTimeout(function(){t({errCode:-1,msg:"dd.ready初始化超时"})},2e3);T.ready(function(){console.log("初始化钉钉"),clearTimeout(o),T.biz.navigation.setLeft({show:!0,control:!0,showIcon:!0,text:"返回",onSuccess:function(e){console.log("点击了返回按钮"),window.history.back()},onFail:function(e){}}),T.runtime.info({onSuccess:function(e){window.ability=parseInt(e.ability.replace(/\./g,"")),console.log("容器版本为"+window.ability)},onFail:function(e){}}),e(!0)}),T.error(function(e){clearTimeout(o),console.error("dd error: "+JSON.stringify(e)),t({errCode:-1,msg:"dd.error配置信息不对"})})})}function c(){return d.default.Promise(function(e,t){var n;g.default.use(m.default),g.default.use(D.default),g.default.use(R.default);var i=new m.default({transitionOnLoad:!1});i.map((n={},r(n,E.default.BASE_PATH,{component:function(e){o.e(2,function(){var t=o(50).default;e(t)})},subRoutes:{"/":{component:function(e){o.e(3,function(){var t=o(56).default;e(t)})}},"/member":{component:function(e){o.e(4,function(){var t=o(66).default;e(t)})}}}}),r(n,E.default.BASE_PATH+"/user/sign_in",{component:function(e){o.e(5,function(){var t=o(74).default;e(t)})}}),r(n,E.default.BASE_PATH+"/user/bind",{component:function(e){o.e(6,function(){var t=o(78).default;e(t)})}}),n)),i.redirect({"*":E.default.BASE_PATH});var u=window.sessionStorage;u.clear();var a=1*u.getItem("count")||0;u.setItem("/",0),i.beforeEach(function(e){var t=e.to,o=e.from,n=e.next,i=u.getItem(t.path),r=u.getItem(o.path);i?i>r||!r?N("UPDATE_DIRECTION","forward"):N("UPDATE_DIRECTION","reverse"):(++a,u.setItem("count",a),"/"!==t.path&&u.setItem(t.path,a),N("UPDATE_DIRECTION","forward")),N("UPDATE_LOADING",!0),setTimeout(function(){try{T.biz.navigation.setRight({show:!1})}catch(e){console.error(e)}n()},10)}),i.afterEach(function(){N("UPDATE_LOADING",!1)}),(0,y.sync)(w.default,i),i.start(z.default,"#app"),I.default.attach(document.body),e()})}var l=o(1),d=i(l),s=o(5),f=i(s),p=o(31),g=i(p),b=o(32),m=i(b);o(37);var h=o(35),v=n(h),y=o(34),S=o(38),w=i(S),C=o(36),I=i(C),_=o(30),E=i(_),O=o(41),D=i(O),P=o(43),R=i(P),A=o(45),z=i(A);window.getParamByName=function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),o=window.location.search.substr(1).match(t);return null!=o?unescape(o[2]):null};var T=window.dd,N=w.default.commit||w.default.dispatch;console.log("dev"),g.default.config.debug=!0,g.default.config.devtools=!0,g.default.component("alert",v.Alert),g.default.component("loading",v.Loading),g.default.component("group",v.Group),g.default.component("x-input",v.XInput),g.default.component("x-button",v.XButton);var U=null;u().then(function(e){U=e,T.config(U)}).catch(function(e){alert(JSON.stringify(e))}).finally(function(){a().then(c).then(function(){document.querySelector("#init-loading").remove(),console.log("init vue 完成"),setTimeout(function(){null!=U?N("DDCONFIG_SUCCESS",U):N("DDCONFIG_ERROR",!1)},300)})})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=o(31),r=n(i),u=o(33),a=n(u),c=o(39),l=n(c);r.default.use(a.default),t.default=new a.default.Store({modules:{app:l.default}})},function(e,t,o){"use strict";function n(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}Object.defineProperty(t,"__esModule",{value:!0});var i,r=o(40),u={isLoading:!1,direction:"forward",ddConfig:null,ddConfigStatus:null,code:null,user:null},a=(i={},n(i,r.UPDATE_LOADING,function(e,t){e.isLoading=t}),n(i,r.UPDATE_DIRECTION,function(e,t){e.direction=t}),n(i,r.DDCONFIG_SUCCESS,function(e,t){e.ddConfig=t,e.ddConfigStatus=!0}),n(i,r.DDCONFIG_ERROR,function(e,t){e.ddConfig=null,e.ddConfigStatus=!1}),n(i,r.UPDATE_CODE,function(e,t){e.code=t}),n(i,r.LOGIN_SUCCESS,function(e,t){e.user=t}),n(i,r.LOGIN_ERROR,function(e,t){e.user=!1}),i);t.default={state:u,mutations:a}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.UPDATE_LOADING="UPDATE_LOADING",t.UPDATE_DIRECTION="UPDATE_DIRECTION",t.DDCONFIG_SUCCESS="DDCONFIG_SUCCESS",t.DDCONFIG_ERROR="DDCONFIG_ERROR",t.UPDATE_CODE="UPDATE_CODE",t.LOGIN_SUCCESS="LOGIN_SUCCESS",t.LOGIN_ERROR="LOGIN_ERROR"},function(e,t,o){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=o(30),r=t(i),u={};u.install=function(e,t){e.cookie=function(e,t,o){var n,i,r,u;return arguments.length>1&&"[object Object]"!==String(t)?(o=$.extend({},o),null!==t&&void 0!==t||(o.expires=-1),"number"==typeof o.expires&&(n=24*o.expires*60*60*1e3,i=o.expires=new Date,i.setTime(i.getTime()+n)),t=String(t),document.cookie=[encodeURIComponent(e),"=",o.raw?t:t,o.expires?"; expires="+o.expires.toUTCString():"","; path=/",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")):(o=t||{},u=o.raw?function(e){return e}:decodeURIComponent,(r=new RegExp("(?:^|; )"+encodeURIComponent(e)+"=([^;]*)").exec(document.cookie))?u(r[1]):null)},e.prototype.base_path=r.default.BASE_PATH,e.prototype.localStorage={getItem:function(e){if("object"===("undefined"==typeof localStorage?"undefined":n(localStorage)))try{return JSON.parse(localStorage.getItem(e))}catch(e){alert("请关闭[无痕浏览]模式后再试!")}},setItem:function(e,t){if("object"===("undefined"==typeof localStorage?"undefined":n(localStorage)))try{return localStorage.setItem(e,JSON.stringify(t))}catch(e){alert("请关闭[无痕浏览]模式后再试!")}},removeItem:function(e){if("object"===("undefined"==typeof localStorage?"undefined":n(localStorage)))try{return localStorage.removeItem(e)}catch(e){alert("请关闭[无痕浏览]模式后再试!")}},getUseSize:function(){if("object"===("undefined"==typeof localStorage?"undefined":n(localStorage)))try{return JSON.stringify(localStorage).length}catch(e){alert("请关闭[无痕浏览]模式后再试!")}}},Date.prototype.Format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"H+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(var o in t)new RegExp("("+o+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[o]:("00"+t[o]).substr((""+t[o]).length)));return e}},function(t){"object"===n(e)&&"object"===n(e.exports)?e.exports=t:window.bb?window.bb.bbPlugin=t:window.bb={bbPlugin:t}}(u)}).call(t,o(42)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,o){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=o(1),r=t(i),u=o(44),a=t(u),c={},l=function(e,t){for(var o=e.split("."),n=t||dd,i=0,r=o.length;i1&&void 0!==arguments[1]?arguments[1]:{};return r.default.Promise(function(o,n){return!window.ability||window.ability\n \n\n \n \n dd.config配置失败\n \n \n 免登陆code获取失败\n \n'},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={routerTransition:{forward:"slideRL",back:"slideLR"}};t.default=o},function(e,t){},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function r(e,t){var o=e.dispatch,n=e.state;return!window.ability||window.ability"+e.code)},onFail:function(e){o(c.UPDATE_CODE,!1),console.log("获取免登陆code失败")}})}function u(e,t){var o=e.dispatch,n=e.state;g.default.get(d.default.API_HOST+"/user/getUserinfo",{params:{code:t,corpId:n.app.ddConfig.corpId,suiteKey:window.getParamByName("suiteKey")},timeout:5e3}).then(function(e){if(200==e.status&&200==e.data.code){var t=e.data.result;o(c.LOGIN_SUCCESS,t),o(c.UPDATE_SYS_LEVEL,t.sys_level)}else o(c.LOGIN_ERROR,!1)}).catch(function(e){o(c.LOGIN_ERROR,!1)})}Object.defineProperty(t,"__esModule",{value:!0}),t.getRequestAuthCode=r,t.getUserInfo=u;var a=o(40),c=i(a),l=o(30),d=n(l),s=o(44),f=n(s),p=o(5),g=n(p)}]); 2 | //# sourceMappingURL=web_app.7d3cc497.js.map -------------------------------------------------------------------------------- /dd/home.7d3cc497.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([2],{50:function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var o=e(31),i=r(o),u=e(51),c=r(u),s=e(52),f=r(s);e(53);var a=e(38),l=r(a),p=e(54),d=r(p),h=e(55),v=r(h),y=i.default.extend({template:c.default,components:{Tabbar:d.default,TabbarItem:v.default},store:l.default,vuex:{getters:{route:function(t){return t.route},isLoading:function(t){return t.app.isLoading},direction:function(t){return t.app.direction}}},data:function(){return f.default},methods:{selected:function(t){var n="",e=this.route.path.indexOf("?");return n=e>0?this.route.path.substr(0,e):this.route.path,n==t}},computed:{}});n.default=y},51:function(t,n){t.exports='
\n\n \n\n \n\n \n \n \n 班步\n \n \n \n 首页\n \n \n \n 个人\n \n \n\n
'},52:function(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var e={myCity:{province_id:0,province_name:"",city_id:0,city_name:"上海"},myCarInfo:{brand_id:0,brand_name:"",series_id:0,series_name:"",type_id:0,type_name:""}};n.default=e},53:function(t,n){},54:function(t,n,e){/*! 2 | * Vux v0.1.3 (https://vux.li) 3 | * Licensed under the MIT license 4 | */ 5 | !function(n,e){t.exports=e()}(this,function(){return function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){t.exports=e(5)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(2);n.default={mixins:[r.parentMixin],props:{iconClass:String}}},function(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var e={ready:function(){this.updateIndex()},methods:{updateIndex:function(){if(this.$children){this.number=this.$children.length;for(var t=this.$children,n=0;n-1&&(this.$children[n].selected=!1),this.$children[t].selected=!0}},data:function(){return{number:this.$children.length}}},r={props:{selected:{type:Boolean,default:!1}},ready:function(){this.$parent.updateIndex()},beforeDestroy:function(){var t=this.$parent;this.$nextTick(function(){t.updateIndex()})},methods:{onItemClick:function(){this.selected=!0,this.$parent.index=this.index,this.$emit("on-item-click")}},watch:{selected:function(t){t&&(this.$parent.index=this.index)}},data:function(){return{index:-1}}};n.parentMixin=e,n.childMixin=r},function(t,n){},function(t,n){t.exports="
"},function(t,n,e){var r,o;e(3),r=e(1),o=e(4),t.exports=r||{},t.exports.__esModule&&(t.exports=t.exports.default),o&&(("function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports).template=o)}])})},55:function(t,n,e){/*! 6 | * Vux v0.1.3 (https://vux.li) 7 | * Licensed under the MIT license 8 | */ 9 | !function(n,e){t.exports=e()}(this,function(){return function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){t.exports=e(77)},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n,e){var r=e(52),o=e(15);t.exports=function(t){return r(o(t))}},function(t,n,e){t.exports=!e(9)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(6),o=e(12);t.exports=e(4)?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var r=e(8),o=e(30),i=e(24),u=Object.defineProperty;n.f=e(4)?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(22)("wks"),o=e(13),i=e(1).Symbol,u="function"==typeof i,c=t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))};c.store=r},function(t,n,e){var r=e(10);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,e){var r=e(35),o=e(16);t.exports=Object.keys||function(t){return r(t,o)}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n){t.exports={}},function(t,n){t.exports=!0},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,e){var r=e(6).f,o=e(2),i=e(7)("toStringTag");t.exports=function(t,n,e){t&&!o(t=e?t:t.prototype,i)&&r(t,i,{configurable:!0,value:n})}},function(t,n,e){var r=e(22)("keys"),o=e(13);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,n,e){var r=e(1),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n,e){var r=e(10);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n,e){var r=e(1),o=e(14),i=e(18),u=e(26),c=e(6).f;t.exports=function(t){var n=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},function(t,n,e){n.f=e(7)},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n,e){var r=e(10),o=e(1).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n,e){var r=e(1),o=e(14),i=e(49),u=e(5),c="prototype",s=function(t,n,e){var f,a,l,p=t&s.F,d=t&s.G,h=t&s.S,v=t&s.P,y=t&s.B,x=t&s.W,b=d?o:o[n]||(o[n]={}),m=b[c],g=d?r:h?r[n]:(r[n]||{})[c];d&&(e=n);for(f in e)a=!p&&g&&void 0!==g[f],a&&f in b||(l=a?g[f]:e[f],b[f]=d&&"function"!=typeof g[f]?e[f]:y&&a?i(l,r):x&&g[f]==l?function(t){var n=function(n,e,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,r)}return t.apply(this,arguments)};return n[c]=t[c],n}(l):v&&"function"==typeof l?i(Function.call,l):l,v&&((b.virtual||(b.virtual={}))[f]=l,t&s.R&&m&&!m[f]&&u(m,f,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,n,e){t.exports=!e(4)&&!e(9)(function(){return 7!=Object.defineProperty(e(28)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){"use strict";var r=e(18),o=e(29),i=e(36),u=e(5),c=e(2),s=e(17),f=e(54),a=e(20),l=e(61),p=e(7)("iterator"),d=!([].keys&&"next"in[].keys()),h="@@iterator",v="keys",y="values",x=function(){return this};t.exports=function(t,n,e,b,m,g,_){f(e,n,b);var w,O,S,j=function(t){if(!d&&t in E)return E[t];switch(t){case v:return function(){return new e(this,t)};case y:return function(){return new e(this,t)}}return function(){return new e(this,t)}},M=n+" Iterator",P=m==y,k=!1,E=t.prototype,$=E[p]||E[h]||m&&E[m],I=$||j(m),T=m?P?j("entries"):I:void 0,C="Array"==n?E.entries||$:$;if(C&&(S=l(C.call(new t)),S!==Object.prototype&&(a(S,M,!0),r||c(S,p)||u(S,p,x))),P&&$&&$.name!==y&&(k=!0,I=function(){return $.call(this)}),r&&!_||!d&&!k&&E[p]||u(E,p,I),s[n]=I,s[M]=x,m)if(w={values:P?I:j(y),keys:g?I:j(v),entries:T},_)for(O in w)O in E||i(E,O,w[O]);else o(o.P+o.F*(d||k),n,w);return w}},function(t,n,e){var r=e(8),o=e(58),i=e(16),u=e(21)("IE_PROTO"),c=function(){},s="prototype",f=function(){var t,n=e(28)("iframe"),r=i.length,o=">";for(n.style.display="none",e(51).appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write("