提交 9c77d5a2 编写于 作者: Q qiang

Merge branch 'dev' into alpha

......@@ -2,7 +2,8 @@ const base = [
'base64ToArrayBuffer',
'arrayBufferToBase64',
'addInterceptor',
'removeInterceptor'
'removeInterceptor',
'interceptors'
]
const network = [
......@@ -242,7 +243,7 @@ const third = [
const ad = [
'createRewardedVideoAd',
'createFullScreenVideoAd',
'createInterstitialAd',
'createInterstitialAd',
'createInteractiveAd'
]
......
......@@ -410,7 +410,7 @@ export default {
complete && complete()
})
},
getTemp(isTemp = true) {
getTemp (isTemp = true) {
/* eslint-disable no-undef */
let db = uniCloud.database()
......@@ -471,7 +471,7 @@ export default {
return db
},
setResult(result) {
setResult (result) {
if (result.code === 0) {
this._execLoadDataSuccess(result)
} else {
......@@ -505,12 +505,12 @@ export default {
this._execLoadDataFail(err, callback)
})
},
_execLoadDataSuccess(result, callback, clear) {
_execLoadDataSuccess (result, callback, clear) {
const {
data,
count
} = result
this._isEnded = data.length < this.pageSize
this._isEnded = count != undefined ? (this.paginationInternal.current * this.paginationInternal.size >= count) : (data.length < this.pageSize)
this.hasMore = !this._isEnded
const data2 = this.getone ? (data.length ? data[0] : undefined) : data
......@@ -532,7 +532,7 @@ export default {
}
}
},
_execLoadDataFail(err, callback) {
_execLoadDataFail (err, callback) {
this.errorMessage = err
callback && callback()
this.$emit(events.error, err)
......
此差异已折叠。
......@@ -49,12 +49,20 @@ const tags = {
'video',
'view',
'web-view',
'editor',
'editor'
],
// 支付宝小程序平台独有组件
'mp-alipay': [
'lifestyle',
'life-follow'
'life-follow',
'contact-button',
'spread',
'error-view',
'poster',
'cashier',
'ix-grid',
'ix-native-grid',
'ix-native-list'
]
}
......
......@@ -83,7 +83,9 @@ module.exports = (api, options) => {
})
}
const args = require('minimist')(process.argv.slice(2))
module.exports.defaultModes = {
'uni-serve': 'development',
'uni-build': process.env.NODE_ENV
}
'uni-serve': args.mode || 'development',
'uni-build': args.mode || process.env.NODE_ENV
}
......@@ -105,7 +105,7 @@ function queue (hooks, data) {
}
if (res === false) {
return {
then () {}
then () { }
}
}
}
......@@ -153,15 +153,15 @@ function getApiInterceptorHooks (method) {
if (hook !== 'returnValue') {
interceptor[hook] = globalInterceptors[hook].slice()
}
})
const scopedInterceptor = scopedInterceptors[method]
if (scopedInterceptor) {
Object.keys(scopedInterceptor).forEach(hook => {
if (hook !== 'returnValue') {
interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook])
}
})
}
})
const scopedInterceptor = scopedInterceptors[method]
if (scopedInterceptor) {
Object.keys(scopedInterceptor).forEach(hook => {
if (hook !== 'returnValue') {
interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook])
}
})
}
return interceptor
}
......@@ -185,10 +185,14 @@ export const promiseInterceptor = {
if (!isPromise(res)) {
return res
}
return res.then(res => {
return res[1]
}).catch(res => {
return res[0]
return new Promise((resolve, reject) => {
res.then(res => {
if (res[0]) {
reject(res[0])
} else {
resolve(res[1])
}
})
})
}
}
}
......@@ -10,4 +10,4 @@ export {
export const interceptors = {
promiseInterceptor
}
}
......@@ -24,11 +24,11 @@ export function chooseVideo ({
const errorCallback = warpPlusErrorCallback(callbackId, 'chooseVideo', 'cancel')
function successCallback (tempFilePath = '') {
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(tempFilePath)}`
const filename = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(tempFilePath)}`
const compressVideo = compressed ? new Promise((resolve) => {
plus.zip.compressVideo({
src: tempFilePath,
dst
filename
}, ({ tempFilePath }) => {
resolve(tempFilePath)
}, () => {
......
<template>
<uni-page-head :uni-page-head-type="type">
<div
<div
:style="{transitionDuration:duration,transitionTimingFunction:timingFunc,backgroundColor:bgColor,color:textColor}"
:class="headClass"
class="uni-page-head"
:class="headClass"
class="uni-page-head"
>
<div class="uni-page-head-hd">
<div
v-show="backButton"
class="uni-page-head-btn"
@click="_back"
<div
v-show="backButton"
class="uni-page-head-btn"
@click="_back"
>
<i
:style="{color:color,fontSize:'27px'}"
class="uni-btn-icon"
<i
:style="{color:color,fontSize:'27px'}"
class="uni-btn-icon"
>&#xe601;</i>
</div>
<template v-for="(btn,index) in btns">
<div
v-if="btn.float === 'left'"
:key="index"
<div
v-if="btn.float === 'left'"
:key="index"
:style="{backgroundColor: type==='transparent'?btn.background:'transparent',width:btn.width}"
:badge-text="btn.badgeText"
:badge-text="btn.badgeText"
:class="{'uni-page-head-btn-red-dot':btn.redDot||btn.badgeText,'uni-page-head-btn-select':btn.select}"
class="uni-page-head-btn"
class="uni-page-head-btn"
>
<i
:style="_formatBtnStyle(btn)"
class="uni-btn-icon"
@click="_onBtnClick(index)"
v-html="_formatBtnFontText(btn)"
<i
:style="_formatBtnStyle(btn)"
class="uni-btn-icon"
@click="_onBtnClick(index)"
v-html="_formatBtnFontText(btn)"
/>
</div>
</template>
</div>
<div
v-if="!searchInput"
class="uni-page-head-bd"
<div
v-if="!searchInput"
class="uni-page-head-bd"
>
<div
:style="{fontSize:titleSize,opacity:type==='transparent'?0:1}"
class="uni-page-head__title"
<div
:style="{fontSize:titleSize,opacity:type==='transparent'?0:1}"
class="uni-page-head__title"
>
<i
v-if="loading"
class="uni-loading"
<i
v-if="loading"
class="uni-loading"
/>
<img
v-if="titleImage!==''"
:src="titleImage"
class="uni-page-head__title_image"
<img
v-if="titleImage!==''"
:src="titleImage"
class="uni-page-head__title_image"
>
<template v-else>
{{ titleText }}
</template>
</div>
</div>
<div
v-if="searchInput"
<div
v-if="searchInput"
:style="{'border-radius':searchInput.borderRadius,'background-color':searchInput.backgroundColor}"
class="uni-page-head-search"
class="uni-page-head-search"
>
<div
:style="{color:searchInput.placeholderColor}"
:class="[`uni-page-head-search-placeholder-${focus || text ? 'left' : searchInput.align}`]"
class="uni-page-head-search-placeholder"
v-text="text || composing ? '' : searchInput.placeholder"
<div
:style="{color:searchInput.placeholderColor}"
:class="[`uni-page-head-search-placeholder-${focus || showPlaceholder ? 'left' : searchInput.align}`]"
class="uni-page-head-search-placeholder"
v-text="showPlaceholder || composing ? '' : searchInput.placeholder"
/>
<v-uni-input
ref="input"
v-model="text"
:focus="searchInput.autoFocus"
:disabled="searchInput.disabled"
<v-uni-input
ref="input"
v-model="text"
:focus="searchInput.autoFocus"
:disabled="searchInput.disabled"
:style="{color:searchInput.color}"
:placeholder-style="`color:${searchInput.placeholderColor}`"
class="uni-page-head-search-input"
:placeholder-style="`color:${searchInput.placeholderColor}`"
class="uni-page-head-search-input"
confirm-type="search"
@focus="_focus"
@blur="_blur"
@update:value="_input"
@focus="_focus"
@blur="_blur"
@update:value="_input"
/>
<i
v-if="text"
class="uni-icon-clear"
@click="_clearInput"
>&#xea0f;</i>
</div>
<div class="uni-page-head-ft">
<template v-for="(btn,index) in btns">
<div
v-if="btn.float !== 'left'"
:key="index"
<div
v-if="btn.float !== 'left'"
:key="index"
:style="{backgroundColor: type==='transparent'?btn.background:'transparent',width:btn.width}"
:badge-text="btn.badgeText"
:badge-text="btn.badgeText"
:class="{'uni-page-head-btn-red-dot':btn.redDot||btn.badgeText,'uni-page-head-btn-select':btn.select}"
class="uni-page-head-btn"
class="uni-page-head-btn"
>
<i
:style="_formatBtnStyle(btn)"
class="uni-btn-icon"
@click="_onBtnClick(index)"
v-html="_formatBtnFontText(btn)"
<i
:style="_formatBtnStyle(btn)"
class="uni-btn-icon"
@click="_onBtnClick(index)"
v-html="_formatBtnFontText(btn)"
/>
</div>
</template>
</div>
</div>
<div
v-if="type!=='transparent'&&type!=='float'"
:class="{'uni-placeholder-titlePenetrate': titlePenetrate}"
class="uni-placeholder"
<div
v-if="type!=='transparent'&&type!=='float'"
:class="{'uni-placeholder-titlePenetrate': titlePenetrate}"
class="uni-placeholder"
/>
</uni-page-head>
</template>
......@@ -346,6 +351,11 @@
uni-page-head .uni-page-head-shadow-yellow::after {
background-image: url("https://cdn.dcloud.net.cn/img/shadow-yellow.png");
}
uni-page-head .uni-icon-clear {
align-self: center;
padding-right: 5px;
}
</style>
<script>
import appendCss from 'uni-platform/helpers/append-css'
......@@ -441,7 +451,8 @@ export default {
return {
focus: false,
text: '',
composing: false
composing: false,
showPlaceholder: false
}
},
computed: {
......@@ -496,6 +507,9 @@ export default {
input.$watch('composing', val => {
this.composing = val
})
input.$watch('valueSync', val => {
this.showPlaceholder = !!val
})
if (this.searchInput.disabled) {
input.$el.addEventListener('click', () => {
UniServiceJSBridge.emit('onNavigationBarSearchInputClicked', '')
......@@ -567,7 +581,11 @@ export default {
UniServiceJSBridge.emit('onNavigationBarSearchInputChanged', {
text
})
},
_clearInput () {
this.text = ''
this._input(this.text)
}
}
}
</script>
</script>
/**
* 用于延迟调用 setData
* 在 setData 真实调用的时机需执行 fixSetDataEnd
* @param {*} mpInstance
* @param {*} mpInstance
*/
export function fixSetDataStart (mpInstance) {
const setData = mpInstance.setData
......@@ -27,7 +27,7 @@ export function fixSetDataStart (mpInstance) {
}
/**
* 恢复真实的 setData 方法
* @param {*} mpInstance
* @param {*} mpInstance
*/
export function fixSetDataEnd (mpInstance) {
if (mpInstance.__fixInitData) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册