Authored by 肖亚东

地图入口动画以及事件处理

Component({
/**
* 组件的属性列表
*/
properties: {
bottom: {
type: Number,
value: 0
}
},
/**
* 组件的初始数据
*/
data: {
appearShow: true,
},
ready: function() {
setTimeout(() => {
this.setData({
appearShow: false,
})
}, 1500);
},
/**
* 组件的方法列表
*/
methods: {
jump(event) {
this.triggerEvent('jumpMap');
}
}
})
... ...
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
... ...
<image class="map-appear" style="bottom:{{bottom}}rpx;" catchtap="jump" src="{{appearShow ? '../../static/images/appear.gif' : '../../static/images/shake.gif'}}"></image>
... ...
.map-appear {
width: 100rpx;
height: 100rpx;
position: fixed;
right: 30rpx;
}
.map-shake {
width: 100rpx;
height: 100rpx;
position: fixed;
right: 30rpx;
}
... ...
... ... @@ -4,12 +4,14 @@
// export const APP_REPORT_HOST = 'https://app.yoho.cn/collect/v3';
// export const LOG_EVENT_HOST = 'https://analysis.yohobuy.com/yas_mobile';
// export const ACTIVITY_HOST = 'https://action.yoho.cn';
// export const YOHOOD_HOST = 'https://www.yohood.cn';
// *********测试3环境*********
export const API_HOST = 'http://api-test3.dev.yohocorp.com';
export const SERVICE_HOST = 'http://api-test3.dev.yohocorp.com';
export const ACTIVITY_HOST = 'http://192.168.102.49:6006';
export const YOHOOD_HOST = 'http://yohood.test.yoho.cn';
... ...
... ... @@ -17,6 +17,7 @@ Page({
scrollToView: '',
floatViewTop: 70,
alphanetTop: 240,
showFloatView: false,
brandsList: [],
... ... @@ -97,7 +98,7 @@ Page({
wx.createSelectorQuery().selectAll(query).boundingClientRect(function (res) {
if(res && !that.data.showFloatView) {
var floatViewTop = res[0].top / pixelRatio - 12;
var floatViewTop = res[0].top / pixelRatio - that.data.alphanetTop - 18;
that.setData({
scrollToView: ap,
floatViewTop,
... ... @@ -125,6 +126,12 @@ Page({
},
jumpMap() {
wx.navigateTo({
url: `../webview/webview?url=https://activity.yoho.cn/feature/507.html?share_id=2647`,
})
},
})
function data_letter_sort(data) {
... ...
{
"navigationBarTitleText": "参展品牌",
"usingComponents": {
"brandSearch": "/pages/brands/brandSearch"
"brandSearch": "/pages/brands/brandSearch",
"map-animation": "/components/map-animation/index"
}
}
\ No newline at end of file
... ...
... ... @@ -24,7 +24,7 @@
</scroll-view>
<view class="alphanet-selector" data-id="selector" catchtouchstart="handlerAlphaTap" catchtouchmove="handlerMove">
<view class="alphanet-selector" style="top:{{alphanetTop}}rpx;}};" data-id="selector" catchtouchstart="handlerAlphaTap" catchtouchmove="handlerMove">
<view class="float-view" style="top:{{floatViewTop}}rpx;display:{{showFloatView?'':'none'}};">
<image class="bubble" src="../../static/images/bubble@3x.png">
<view class="float-letter">{{scrollToView}}</view>
... ... @@ -34,4 +34,7 @@
{{item.letter}}
</view>
</view>
<map-animation bottom="100" bind:jumpMap="jumpMap"></map-animation>
</block>
... ...
... ... @@ -58,23 +58,15 @@
.alphanet-selector {
position: fixed;
top: 0px;
bottom: 0px;
right: 0;
display: flex;
flex-direction: column;
align-items: flex-end;
justify-content: center;
z-index: 100;
box-sizing: border-box;
margin-right: 14rpx;
right: 13rpx;
height: 728rpx;
}
.selector-one {
display: flex;
justify-content: center;
align-items: center;
padding: 6rpx 12rpx;
font-weight: normal;
font-style: normal;
font-stretch: normal;
... ... @@ -82,7 +74,6 @@
font-family: PingFang-SC-Medium;
font-size: 20rpx;
color: #444444;
letter-spacing: 0.79px;
line-height: 28rpx;
}
... ... @@ -97,7 +88,7 @@
height: 72rpx;
text-align: center;
position: absolute;
right: 70rpx;
right: 50rpx;
}
.bubble {
position: absolute;
... ...
... ... @@ -40,6 +40,12 @@ Page({
}
},
jumpMap() {
wx.navigateTo({
url: `../webview/webview?url=https://activity.yoho.cn/feature/507.html?share_id=2647`,
})
},
onHide: function() {
//Do some when page hide.
... ...
... ... @@ -3,6 +3,7 @@
"enablePullDownRefresh": true,
"usingComponents": {
"schedule-item": "/components/schedule-item/index",
"slide-bar": "/components/slide-bar/index"
"slide-bar": "/components/slide-bar/index",
"map-animation": "/components/map-animation/index"
}
}
\ No newline at end of file
... ...
... ... @@ -13,4 +13,5 @@
<schedule-item data="{{item}}"></schedule-item>
</block>
<map-animation bottom="40" bind:jumpMap="jumpMap"></map-animation>
</view>
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@
"minified": true,
"newFeature": true,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"checkInvalidKey": true,
"checkSiteMap": true,
... ...