提交 6a0751a0 编写于 作者: Q qiang

Merge branch 'dev' into alpha

......@@ -1207,7 +1207,8 @@ uni-app 2.5.5+ 在 [WXS](?id=wxs) 的基础上扩展了 renderjs,以 vue 组
* view 层和 service 层通讯方式与 [WXS](?id=wxs) 一致
* 观测更新的数据在 view 层可以直接访问到
* 不要直接引用大型类库,推荐通过动态创建 script 方式引用
* view 层的页面引用资源的路径相对于根目录计算,例如:./static/test.js
* view 层的页面引用资源的路径相对于根目录计算,例如:./static/test.js
* 目前仅支持内联使用
## 致谢
......
......@@ -2328,7 +2328,7 @@ var serviceContext = (function () {
} else if (res.errMsg.indexOf(':cancel') !== -1) {
res.errMsg = apiName + ':cancel';
} else if (res.errMsg.indexOf(':fail') !== -1) {
res.errMsg = apiName + ':fail';
res.errMsg = apiName + ':fail' + res.errMsg.substr(res.errMsg.indexOf(' '));
}
const errMsg = res.errMsg;
......@@ -6275,7 +6275,7 @@ var serviceContext = (function () {
requestTaskId,
state: 'fail',
statusCode,
errMsg: 'abort'
errMsg: 'abort statusCode:' + statusCode
});
}
});
......
......@@ -6693,7 +6693,12 @@ function parseDataset(attrs) {
var dataset = Object.create(null);
Object.keys(attrs).forEach(function (name) {
if (name.indexOf('data-') === 0) {
dataset[camelize(name.replace('data-', ''))] = JSON.parse(attrs[name]);
var camelizeName = camelize(name.replace('data-', ''));
try {
dataset[camelizeName] = JSON.parse(attrs[name]);
} catch (e) {
dataset[camelizeName] = attrs[name];
}
}
});
return dataset
......
......@@ -566,7 +566,8 @@ module.exports = {
orderedValues: false,
mergeLonghand: false,
mergeRules: false,
cssDeclarationSorter: false,
cssDeclarationSorter: false,
uniqueSelectors: false, // 标签排序影响头条小程序
discardComments: false,
discardDuplicates: false // 条件编译会导致重复
}
......
......@@ -92,7 +92,7 @@ module.exports = function generateJson (compilation) {
for (let name of jsonFileMap.keys()) {
const jsonObj = JSON.parse(jsonFileMap.get(name))
if (process.env.UNI_PLATFORM === 'app-plus') { // App平台默认增加usingComponents,激活__wxAppCode__
jsonObj.usingComponents = {}
jsonObj.usingComponents = jsonObj.usingComponents || {}
}
// customUsingComponents
if (jsonObj.customUsingComponents && Object.keys(jsonObj.customUsingComponents).length) {
......@@ -187,4 +187,4 @@ module.exports = function generateJson (compilation) {
require('@dcloudio/uni-cli-shared/lib/cache').store()
}, 50)
}
}
}
......@@ -164,7 +164,7 @@ function createApiCallback (apiName, params = {}, extras = {}) {
} else if (res.errMsg.indexOf(':cancel') !== -1) {
res.errMsg = apiName + ':cancel'
} else if (res.errMsg.indexOf(':fail') !== -1) {
res.errMsg = apiName + ':fail'
res.errMsg = apiName + ':fail' + res.errMsg.substr(res.errMsg.indexOf(' '))
}
const errMsg = res.errMsg
......
......@@ -282,10 +282,12 @@ uni-input[hidden] {
.uni-input-wrapper,
.uni-input-form {
display: block;
display: flex;
position: relative;
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
}
.uni-input-placeholder,
......@@ -295,15 +297,15 @@ uni-input[hidden] {
.uni-input-placeholder {
position: absolute;
top: 50%;
top: auto !important;
left: 0;
transform: translateY(-50%);
color: gray;
overflow: hidden;
text-overflow: clip;
white-space: pre;
word-break: keep-all;
pointer-events: none;
line-height: inherit;
}
.uni-input-input {
......
......@@ -102,7 +102,7 @@ export function createRequestTaskById (requestTaskId, {
requestTaskId,
state: 'fail',
statusCode,
errMsg: 'abort'
errMsg: 'abort statusCode:' + statusCode
})
}
})
......
......@@ -13,6 +13,35 @@ import {
} from 'uni-mixins'
import native from '../../mixins/native'
const _adDataCache = {}
function getAdData (adpid, adWidth, onsuccess, onerror) {
const key = adpid + '-' + adWidth
const adDataList = _adDataCache[key]
if (adDataList && adDataList.length > 0) {
onsuccess(adDataList.splice(0, 1)[0])
return
}
plus.ad.getAds(
{
adpid: adpid,
count: 10,
width: adWidth
},
(res) => {
const list = res.ads
onsuccess(list.splice(0, 1)[0])
_adDataCache[key] = adDataList ? adDataList.concat(list) : list
},
(err) => {
onerror({
errCode: err.code,
errMsg: err.message
})
}
)
}
const methods = [
'draw'
]
......@@ -135,19 +164,10 @@ export default {
}
},
_loadData (adpid) {
plus.ad.getAds({
adpid: adpid || this.adpid,
count: 1,
width: this.position.width
},
(res) => {
this._fillData(res.ads[0])
},
(err) => {
this.$trigger('error', {}, {
errCode: err.code,
errMsg: err.message
})
getAdData(adpid || this.adpid, this.position.width, (data) => {
this._fillData(data)
}, (err) => {
this.$trigger('error', err)
})
},
_fillData (data) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册