diff --git a/App.vue b/App.vue index 8cda793..21b5f68 100644 --- a/App.vue +++ b/App.vue @@ -148,6 +148,10 @@ \ No newline at end of file diff --git a/subPackages/equityGoods/detail.vue b/subPackages/equityGoods/detail.vue new file mode 100644 index 0000000..4db8bb4 --- /dev/null +++ b/subPackages/equityGoods/detail.vue @@ -0,0 +1,706 @@ + + + + + diff --git a/uni_modules/uni-transition/components/uni-transition/createAnimation.js b/uni_modules/uni-transition/components/uni-transition/createAnimation.js index a9c8776..9eb2cbc 100644 --- a/uni_modules/uni-transition/components/uni-transition/createAnimation.js +++ b/uni_modules/uni-transition/components/uni-transition/createAnimation.js @@ -112,7 +112,9 @@ const animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'] animateTypes1.concat(animateTypes2, animateTypes3).forEach(type => { MPAnimation.prototype[type] = function(...args) { // #ifndef APP-NVUE - this.animation[type](...args) + if (this.animation && typeof this.animation[type] === 'function') { + this.animation[type](...args) + } // #endif // #ifdef APP-NVUE this._nvuePushAnimates(type, args) diff --git a/uni_modules/uni-transition/components/uni-transition/uni-transition.vue b/uni_modules/uni-transition/components/uni-transition/uni-transition.vue index 2078dd3..a721cf4 100644 --- a/uni_modules/uni-transition/components/uni-transition/uni-transition.vue +++ b/uni_modules/uni-transition/components/uni-transition/uni-transition.vue @@ -135,16 +135,20 @@ export default { if (!this.animation) return for (let i in obj) { try { - if(typeof obj[i] === 'object'){ - this.animation[i](...obj[i]) - }else{ - this.animation[i](obj[i]) + if (typeof this.animation[i] === 'function') { + if(typeof obj[i] === 'object'){ + this.animation[i](...obj[i]) + }else{ + this.animation[i](obj[i]) + } } } catch (e) { console.error(`方法 ${i} 不存在`) } } - this.animation.step(config) + if (this.animation && typeof this.animation.step === 'function') { + this.animation.step(config) + } return this }, /** @@ -152,7 +156,9 @@ export default { */ run(fn) { if (!this.animation) return - this.animation.run(fn) + if (typeof this.animation.run === 'function') { + this.animation.run(fn) + } }, // 开始过度动画 open() { @@ -169,8 +175,12 @@ export default { // TODO 定时器保证动画完全执行,目前有些问题,后面会取消定时器 this.timer = setTimeout(() => { this.animation = createAnimation(this.config, this) - this.tranfromInit(false).step() - this.animation.run() + if (this.animation) { + this.tranfromInit(false).step() + if (typeof this.animation.run === 'function') { + this.animation.run() + } + } this.$emit('change', { detail: this.isShow }) @@ -217,6 +227,7 @@ export default { }, // 处理内置组合动画 tranfromInit(type) { + if (!this.animation) return this let buildTranfrom = (type, mode) => { let aniNum = null if (mode === 'fade') { @@ -236,7 +247,10 @@ export default { aniNum = type ? '100%' : '0' } } - this.animation[this.animationMode()[mode]](aniNum) + let methodName = this.animationMode()[mode] + if (this.animation && typeof this.animation[methodName] === 'function') { + this.animation[methodName](aniNum) + } } if (typeof this.modeClass === 'string') { buildTranfrom(type, this.modeClass)