Skip to content

Commit

Permalink
Merge commit 'd26b206188ff9e5de659870e5f4e8b2d24d8f02f'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhetengbiji committed Sep 23, 2019
2 parents 039e9c7 + d26b206 commit a858386
Show file tree
Hide file tree
Showing 35 changed files with 211 additions and 123 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"message": "chore(release): publish %s"
}
},
"version": "2.0.0-23020190919001"
"version": "2.0.0-23220190921001"
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "uniapp-js-framework",
"version": "0.0.1",
"scripts": {
"scripts": {
"build:service:legacy": "npm run lint && rollup -c build/rollup.config.service.js",
"lint": "eslint --fix --config package.json --ext .js --ext .vue --ignore-path .eslintignore build src",
"lint:cli": "eslint --fix --config package.json --ignore-path .eslintignore packages/uni-cli-shared packages/uni-template-compiler \"packages/vue-cli-*/**/*.js\" \"packages/webpack-uni-*/**/*.js\"",
"dev:h5": "npm run lint && cross-env NODE_ENV=production UNI_WATCH=true UNI_PLATFORM=h5 node build/build.js",
"build:h5": "npm run lint && cross-env NODE_ENV=production UNI_WATCH=false UNI_PLATFORM=h5 node build/build.js",
"build:h5": "npm run lint && cross-env NODE_ENV=production UNI_WATCH=false UNI_PLATFORM=h5 node build/build.js",
"build:h5:ui": "cross-env NODE_ENV=production UNI_WATCH=false UNI_PLATFORM=h5 UNI_UI=true node build/build.js",
"build:app-plus": "cross-env UNI_PLATFORM=app-plus rollup -c build/rollup.config.mp.js",
"build:app:all": "npm run lint && npm run build:app:nvue && npm run build:app:legacy",
Expand All @@ -22,7 +22,7 @@
"test:cli": "cross-env NODE_ENV=test jest",
"test:unit": "cross-env NODE_ENV=test UNI_PLATFORM=h5 mocha-webpack --require tests/unit/setup.js --webpack-config build/webpack.config.test.js tests/unit/**/*.spec.js",
"release": "npm run lint:cli && lerna publish --force-publish=*",
"release:alpha": "npm run lint:cli && lerna publish --force-publish=* --npm-tag=alpha",
"release:alpha": "npm run lint:cli && lerna publish --force-publish=* --npm-tag=alpha",
"release:next": "npm run lint:cli && lerna publish --force-publish=* --npm-tag=next"
},
"dependencies": {
Expand Down Expand Up @@ -63,6 +63,7 @@
"rollup-plugin-commonjs": "^10.0.1",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.1.0",
"shell-exec": "^1.0.2",
"strip-json-comments": "^2.0.1",
"vue": "^2.6.8",
"vue-router": "^3.0.1",
Expand Down
8 changes: 6 additions & 2 deletions packages/uni-app-plus-nvue/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2647,8 +2647,12 @@ var serviceContext = (function () {
header: {
type: Object,
validator (value, params) {
params.header = value || {};
params.header['content-type'] = params.header['content-type'] || 'application/json';
const header = params.header = value || {};
if (params.method !== method.GET) {
if (!Object.keys(header).find(key => key.toLowerCase() === 'content-type')) {
header['Content-Type'] = 'application/json';
}
}
}
},
dataType: {
Expand Down
4 changes: 2 additions & 2 deletions packages/uni-app-plus-nvue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-app-plus-nvue",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "uni-app app-plus-nvue",
"main": "dist/index.js",
"repository": {
Expand All @@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
4 changes: 2 additions & 2 deletions packages/uni-app-plus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-app-plus",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "uni-app app-plus",
"main": "dist/index.js",
"repository": {
Expand All @@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
4 changes: 2 additions & 2 deletions packages/uni-cli-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-cli-shared",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "uni-cli-shared",
"main": "lib/index.js",
"repository": {
Expand All @@ -20,5 +20,5 @@
"hash-sum": "^1.0.2",
"strip-json-comments": "^2.0.1"
},
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
4 changes: 2 additions & 2 deletions packages/uni-h5-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-h5-ui",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "uni-app h5 ui",
"main": "dist/index.umd.min.js",
"repository": {
Expand All @@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
2 changes: 1 addition & 1 deletion packages/uni-h5/dist/index.umd.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/uni-h5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-h5",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "uni-app h5",
"main": "dist/index.umd.min.js",
"repository": {
Expand All @@ -18,5 +18,5 @@
"intersection-observer": "^0.7.0",
"safe-area-insets": "^1.4.1"
},
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
4 changes: 2 additions & 2 deletions packages/uni-mp-alipay/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-mp-alipay",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "uni-app mp-alipay",
"main": "dist/index.js",
"repository": {
Expand All @@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
4 changes: 2 additions & 2 deletions packages/uni-mp-baidu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-mp-baidu",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "uni-app mp-baidu",
"main": "dist/index.js",
"repository": {
Expand All @@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
4 changes: 2 additions & 2 deletions packages/uni-mp-qq/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-mp-qq",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "uni-app mp-qq",
"main": "dist/index.js",
"repository": {
Expand All @@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
50 changes: 37 additions & 13 deletions packages/uni-mp-toutiao/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1376,21 +1376,45 @@ function isPage () {

function initRefs (vm) {
const mpInstance = vm.$scope;
mpInstance.selectAllComponents('.vue-ref', (components) => {
components.forEach(component => {
const ref = component.dataset.ref;
vm.$refs[ref] = component.$vm || component;
});
});
mpInstance.selectAllComponents('.vue-ref-in-for', (forComponents) => {
forComponents.forEach(component => {
const ref = component.dataset.ref;
if (!vm.$refs[ref]) {
vm.$refs[ref] = [];
/* eslint-disable no-undef */
const minorVersion = parseInt(tt.getSystemInfoSync().SDKVersion.split('.')[1]);
if (minorVersion > 16) {
Object.defineProperty(vm, '$refs', {
get () {
const $refs = {};
const components = mpInstance.selectAllComponents('.vue-ref');
components.forEach(component => {
const ref = component.dataset.ref;
$refs[ref] = component.$vm || component;
});
const forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
forComponents.forEach(component => {
const ref = component.dataset.ref;
if (!$refs[ref]) {
$refs[ref] = [];
}
$refs[ref].push(component.$vm || component);
});
return $refs
}
vm.$refs[ref].push(component.$vm || component);
});
});
} else {
mpInstance.selectAllComponents('.vue-ref', (components) => {
components.forEach(component => {
const ref = component.dataset.ref;
vm.$refs[ref] = component.$vm || component;
});
});
mpInstance.selectAllComponents('.vue-ref-in-for', (forComponents) => {
forComponents.forEach(component => {
const ref = component.dataset.ref;
if (!vm.$refs[ref]) {
vm.$refs[ref] = [];
}
vm.$refs[ref].push(component.$vm || component);
});
});
}
}

const instances = Object.create(null);
Expand Down
4 changes: 2 additions & 2 deletions packages/uni-mp-toutiao/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-mp-toutiao",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "uni-app mp-toutiao",
"main": "dist/index.js",
"repository": {
Expand All @@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
4 changes: 2 additions & 2 deletions packages/uni-mp-weixin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-mp-weixin",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "uni-app mp-weixin",
"main": "dist/index.js",
"repository": {
Expand All @@ -13,5 +13,5 @@
},
"author": "fxy060608",
"license": "Apache-2.0",
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
20 changes: 11 additions & 9 deletions packages/uni-stat/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -652,12 +652,9 @@ class Util {
// }
},
fail: (e) => {
// if (process.env.NODE_ENV === 'development') {
// console.log('stat request fail', e);
// }
if (++this._retry < 3) {
setTimeout(() => {
this.request(data);
this._sendRequest(optionsData);
}, 1000);
}
}
Expand Down Expand Up @@ -836,7 +833,15 @@ const lifecycle = {
stat.ready(this);
},
onLoad(options) {
stat.load(options, this);
stat.load(options, this);
// 重写分享,获取分享上报事件
if (this.$scope && this.$scope.onShareAppMessage) {
let oldShareAppMessage = this.$scope.onShareAppMessage;
this.$scope.onShareAppMessage = function(options) {
stat.interceptShare(false);
return oldShareAppMessage.call(this, options)
};
}
},
onShow() {
isHide = false;
Expand All @@ -855,17 +860,14 @@ const lifecycle = {
},
onError(e) {
stat.error(e);
},
onShareAppMessage() {
stat.interceptShare(false);
}
};

function main() {
const Vue = require('vue');
if (process.env.NODE_ENV === 'development') {
uni.report = function(type, options) {};
}else{
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
Expand Down
4 changes: 2 additions & 2 deletions packages/uni-stat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-stat",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "",
"main": "dist/index.js",
"repository": {
Expand Down Expand Up @@ -34,5 +34,5 @@
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-uglify": "^6.0.2"
},
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
15 changes: 10 additions & 5 deletions packages/uni-stat/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ const lifecycle = {
stat.ready(this);
},
onLoad(options) {
stat.load(options, this);
stat.load(options, this);
// 重写分享,获取分享上报事件
if (this.$scope && this.$scope.onShareAppMessage) {
let oldShareAppMessage = this.$scope.onShareAppMessage;
this.$scope.onShareAppMessage = function(options) {
stat.interceptShare(false);
return oldShareAppMessage.call(this, options)
}
}
},
onShow() {
isHide = false
Expand All @@ -28,17 +36,14 @@ const lifecycle = {
},
onError(e) {
stat.error(e)
},
onShareAppMessage() {
stat.interceptShare(false)
}
}

function main() {
const Vue = require('vue');
if (process.env.NODE_ENV === 'development') {
uni.report = function(type, options) {};
}else{
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
Expand Down
5 changes: 1 addition & 4 deletions packages/uni-stat/src/stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,9 @@ class Util {
// }
},
fail: (e) => {
// if (process.env.NODE_ENV === 'development') {
// console.log('stat request fail', e);
// }
if (++this._retry < 3) {
setTimeout(() => {
this.request(data);
this._sendRequest(optionsData);
}, 1000);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/uni-template-compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dcloudio/uni-template-compiler",
"version": "2.0.0-23020190919001",
"version": "2.0.0-23220190921001",
"description": "uni-template-compiler",
"main": "lib/index.js",
"repository": {
Expand All @@ -22,5 +22,5 @@
"@babel/types": "^7.3.3",
"vue-template-compiler": "^2.6.10"
},
"gitHead": "0fac47b62d100213ce48c29dd9d0a335f8a00264"
"gitHead": "a9dfc1e2b7a5608e010228c06a040b8f267aace2"
}
Loading

0 comments on commit a858386

Please sign in to comment.