|
@@ -10,15 +10,15 @@
|
|
|
<!-- <div ref="testdiv" class="dragLayer" :class="testdiv" :style="{top: topSize + 'rpx' }"
|
|
<!-- <div ref="testdiv" class="dragLayer" :class="testdiv" :style="{top: topSize + 'rpx' }"
|
|
|
@touchstart="handleTouchStart" @touchend="handleTouchEnd" @touchmove="handleTouchMove"> -->
|
|
@touchstart="handleTouchStart" @touchend="handleTouchEnd" @touchmove="handleTouchMove"> -->
|
|
|
<view :v-show="popupShow" :style="{ height: popupHeight + 'px' }">
|
|
<view :v-show="popupShow" :style="{ height: popupHeight + 'px' }">
|
|
|
- <uni-list>
|
|
|
|
|
- <uni-list :border="true">
|
|
|
|
|
- <!-- 右侧带角标 -->
|
|
|
|
|
- <uni-list-chat title="uni-app" avatar="https://web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png"
|
|
|
|
|
- note="您收到一条新的消息" time="2020-02-02 20:20" badge-text="12"></uni-list-chat>
|
|
|
|
|
- </uni-list-chat>
|
|
|
|
|
- </uni-list>
|
|
|
|
|
|
|
+ <uni-list v-for="(item, index) in players" :key="index" :border="true">
|
|
|
|
|
+ <!-- 右侧带角标 -->
|
|
|
|
|
+ <!-- <uni-list-chat :title="item.name" avatar="https://web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png"
|
|
|
|
|
+ note="您收到一条新的消息" time="2020-02-02 20:20" badge-text="12"></uni-list-chat> -->
|
|
|
|
|
+ <uni-list-item :title="item.name + ' 打点数: ' + item.effectivenum + ' / ' + item.totalcontrolnum + ' 距离: ' + item.distance + '米 配速: ' + item.pace"
|
|
|
|
|
+ :note="'平均心率: ' + item.avghr + ' 最大心率: ' + item.maxhr + ' CAL: ' + item.calorie + ' Ck: ' + item.ck + ' Ei: ' + item.ei">
|
|
|
|
|
+ </uni-list-item>
|
|
|
</uni-list>
|
|
</uni-list>
|
|
|
- <!-- </div> -->
|
|
|
|
|
|
|
+ <!-- </div> -->
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 普通弹窗 -->
|
|
<!-- 普通弹窗 -->
|
|
@@ -47,12 +47,15 @@
|
|
|
components: {},
|
|
components: {},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- windowInfo: null,
|
|
|
|
|
|
|
+ interval: null,
|
|
|
|
|
+
|
|
|
|
|
+ systemInfo: null,
|
|
|
|
|
+ deviceOrientation: 'portrait', // 设备方向(竖屏 portrait | 横屏 landscape)
|
|
|
mapHeight: 0,
|
|
mapHeight: 0,
|
|
|
- popupHeight: 300,
|
|
|
|
|
|
|
+ popupHeight: 100,
|
|
|
popupType: 'bottom',
|
|
popupType: 'bottom',
|
|
|
popupShow: false,
|
|
popupShow: false,
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
actionId: 2,
|
|
actionId: 2,
|
|
|
actionDetail: {},
|
|
actionDetail: {},
|
|
|
mapUrl: null,
|
|
mapUrl: null,
|
|
@@ -126,47 +129,47 @@
|
|
|
],
|
|
],
|
|
|
players: [{
|
|
players: [{
|
|
|
id: 1,
|
|
id: 1,
|
|
|
- nickName: '小鱼儿',
|
|
|
|
|
|
|
+ name: '小鱼儿',
|
|
|
phone: '13105310001',
|
|
phone: '13105310001',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
id: 2,
|
|
id: 2,
|
|
|
- nickName: '花无缺',
|
|
|
|
|
|
|
+ name: '花无缺',
|
|
|
phone: '13105310002',
|
|
phone: '13105310002',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
id: 3,
|
|
id: 3,
|
|
|
- nickName: '李大嘴',
|
|
|
|
|
|
|
+ name: '李大嘴',
|
|
|
phone: '13105310003',
|
|
phone: '13105310003',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
id: 4,
|
|
id: 4,
|
|
|
- nickName: '叶南天',
|
|
|
|
|
|
|
+ name: '叶南天',
|
|
|
phone: '13105310004',
|
|
phone: '13105310004',
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
players_position: [{
|
|
players_position: [{
|
|
|
id: 1,
|
|
id: 1,
|
|
|
- lat: 36.671357,
|
|
|
|
|
- lng: 117.127925
|
|
|
|
|
|
|
+ latitude: 36.671357,
|
|
|
|
|
+ longitude: 117.127925
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
id: 2,
|
|
id: 2,
|
|
|
- lat: 36.671657,
|
|
|
|
|
- lng: 117.125925
|
|
|
|
|
|
|
+ latitude: 36.671657,
|
|
|
|
|
+ longitude: 117.125925
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
id: 3,
|
|
id: 3,
|
|
|
- lat: 36.672257,
|
|
|
|
|
- lng: 117.128925
|
|
|
|
|
|
|
+ latitude: 36.672257,
|
|
|
|
|
+ longitude: 117.128925
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
id: 4,
|
|
id: 4,
|
|
|
- lat: 36.670433,
|
|
|
|
|
- lng: 117.127873
|
|
|
|
|
|
|
+ latitude: 36.670433,
|
|
|
|
|
+ longitude: 117.127873
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// fab: {
|
|
// fab: {
|
|
|
// horizontal: 'left',
|
|
// horizontal: 'left',
|
|
|
// vertical: 'bottom',
|
|
// vertical: 'bottom',
|
|
@@ -202,83 +205,196 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {},
|
|
computed: {},
|
|
|
- mounted() {
|
|
|
|
|
- // this.handleDrawMap()
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ mounted() {},
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
- this.getToActionDetail(this.actionId)
|
|
|
|
|
|
|
+ this.loadData(this.actionId)
|
|
|
},
|
|
},
|
|
|
onReady() {
|
|
onReady() {
|
|
|
this.layoutInit()
|
|
this.layoutInit()
|
|
|
},
|
|
},
|
|
|
|
|
+ onShow() {
|
|
|
|
|
+ console.log('[onShow]')
|
|
|
|
|
+ uni.onWindowResize(res => {
|
|
|
|
|
+ console.log('[onWindowResize]', res)
|
|
|
|
|
+ this.deviceOrientation = res.deviceOrientation
|
|
|
|
|
+ console.log('[onWindowResize] deviceOrientation', this.deviceOrientation)
|
|
|
|
|
+
|
|
|
|
|
+ this.layoutInit()
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
|
// console.log("beforeDestroy")
|
|
// console.log("beforeDestroy")
|
|
|
|
|
+ clearInterval(this.interval)
|
|
|
leafletHelper.free()
|
|
leafletHelper.free()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 布局初始化 设置地图高度
|
|
// 布局初始化 设置地图高度
|
|
|
layoutInit() {
|
|
layoutInit() {
|
|
|
- this.windowInfo = uni.getWindowInfo()
|
|
|
|
|
- console.log('[layoutInit] windowInfo', this.windowInfo)
|
|
|
|
|
- this.mapHeight = this.windowInfo.windowHeight
|
|
|
|
|
|
|
+ this.systemInfo = uni.getSystemInfoSync()
|
|
|
|
|
+ console.log('[layoutInit] systemInfo', this.systemInfo)
|
|
|
|
|
+ this.deviceOrientation = this.systemInfo.deviceOrientation
|
|
|
|
|
+ this.mapHeight = this.systemInfo.windowHeight
|
|
|
},
|
|
},
|
|
|
popupToggle() {
|
|
popupToggle() {
|
|
|
this.popupShow = !this.popupShow
|
|
this.popupShow = !this.popupShow
|
|
|
- if (this.popupShow) {
|
|
|
|
|
- this.mapHeight = this.windowInfo.windowHeight - this.popupHeight
|
|
|
|
|
- } else {
|
|
|
|
|
- this.mapHeight = this.windowInfo.windowHeight
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (this.deviceOrientation == 'portrait') { // 竖屏
|
|
|
|
|
+ console.log('[popupToggle] 竖屏')
|
|
|
|
|
+ if (this.popupShow) {
|
|
|
|
|
+ this.mapHeight = this.systemInfo.windowHeight - this.popupHeight
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.mapHeight = this.systemInfo.windowHeight
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (this.deviceOrientation == 'landscape') { // 横屏
|
|
|
|
|
+ console.log('[popupToggle] 横屏')
|
|
|
|
|
+ if (this.popupShow) {
|
|
|
|
|
+ this.mapHeight = this.systemInfo.windowHeight - this.popupHeight
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.mapHeight = this.systemInfo.windowHeight
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ async loadData() {
|
|
|
|
|
+ this.actionDetail = await this.getToActionDetail(this.actionId)
|
|
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
|
|
+ title: this.actionDetail.name
|
|
|
|
|
+ });
|
|
|
|
|
+ // console.log(this.actionDetail)
|
|
|
|
|
+
|
|
|
|
|
+ this.initMap()
|
|
|
|
|
+ this.handleMapDrawRoute()
|
|
|
|
|
+
|
|
|
|
|
+ if (this.interval != null) {
|
|
|
|
|
+ clearInterval(this.interval)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ that.players = await that.getToUsersInGameDetail(that.actionId)
|
|
|
|
|
+ // console.log('players', that.players)
|
|
|
|
|
+ leafletHelper.global.setPlayers(this.players)
|
|
|
|
|
+
|
|
|
|
|
+ that.players_position = await that.getToUsersInGameGpsQuery(that.actionId)
|
|
|
|
|
+ leafletHelper.global.setPlayersPosition(this.players_position)
|
|
|
|
|
+
|
|
|
|
|
+ that.handleMapDrawPlayer()
|
|
|
|
|
+
|
|
|
|
|
+ this.interval = setInterval(async function() {
|
|
|
|
|
+
|
|
|
|
|
+ that.players_position = await that.getToUsersInGameGpsQuery(that.actionId)
|
|
|
|
|
+ // leafletHelper.global.setPlayers(that.players)
|
|
|
|
|
+ leafletHelper.global.setPlayersPosition(that.players_position)
|
|
|
|
|
+
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+
|
|
|
|
|
+ // await mapHelper.handleMapInfo(this, this.mapInfo)
|
|
|
|
|
+ this.handleMapToggle()
|
|
|
},
|
|
},
|
|
|
|
|
+ //场控端_活动详情
|
|
|
async getToActionDetail(actId) {
|
|
async getToActionDetail(actId) {
|
|
|
try {
|
|
try {
|
|
|
- // 创建请求参数并赋值
|
|
|
|
|
- var request = new IdRequest()
|
|
|
|
|
- request.setId(actId)
|
|
|
|
|
- // 调用客户端相应的grpc方法,发送grpc请求,并接受后台发送回来的返回值
|
|
|
|
|
- this.$client.toActionDetail(request, {}, async (err, response) => {
|
|
|
|
|
- if (err) {
|
|
|
|
|
- console.log(`[toActionDetail] err: code = ${err.code}` +
|
|
|
|
|
- `, message = "${err.message}"`)
|
|
|
|
|
- } else {
|
|
|
|
|
- let res = response.toObject()
|
|
|
|
|
- console.log('[toActionDetail]', res)
|
|
|
|
|
- this.actionDetail = res
|
|
|
|
|
-
|
|
|
|
|
- uni.setNavigationBarTitle({
|
|
|
|
|
- title: this.actionDetail.name
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // await mapHelper.handleMapInfo(this, this.mapInfo)
|
|
|
|
|
- this.handleDrawMap()
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ // 创建请求参数并赋值
|
|
|
|
|
+ var request = new IdRequest()
|
|
|
|
|
+ request.setId(actId)
|
|
|
|
|
+ // 调用客户端相应的grpc方法,发送grpc请求,并接受后台发送回来的返回值
|
|
|
|
|
+ this.$client.toActionDetail(request, {}, (err, response) => {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ console.log(`[toActionDetail] err: code = ${err.code}` +
|
|
|
|
|
+ `, message = "${err.message}"`)
|
|
|
|
|
+ reject(err)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let res = response.toObject()
|
|
|
|
|
+ console.log('[toActionDetail]', res)
|
|
|
|
|
+ resolve(res)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
- console.log('[getShopMap] err', e)
|
|
|
|
|
|
|
+ console.log('[getToActionDetail] err', e)
|
|
|
|
|
+ reject(e)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- handleDrawMap() {
|
|
|
|
|
|
|
+ //场控端_正在进行中所有用户实时信息
|
|
|
|
|
+ async getToUsersInGameDetail(actId) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ // 创建请求参数并赋值
|
|
|
|
|
+ var request = new IdRequest()
|
|
|
|
|
+ request.setId(actId)
|
|
|
|
|
+ // 调用客户端相应的grpc方法,发送grpc请求,并接受后台发送回来的返回值
|
|
|
|
|
+ this.$client.toUsersInGameDetail(request, {}, (err, response) => {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ console.log(`[toUsersInGameDetail] err: code = ${err.code}` +
|
|
|
|
|
+ `, message = "${err.message}"`)
|
|
|
|
|
+ reject(err)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let res = response.toObject()
|
|
|
|
|
+ // console.log('[toUsersInGameDetail]', res)
|
|
|
|
|
+ resolve(res.usersList)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.log('[getToUsersInGameDetail] err', e)
|
|
|
|
|
+ reject(e)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ //场控端_正在进行中所有用户实时gps查询
|
|
|
|
|
+ async getToUsersInGameGpsQuery(actId) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ // 创建请求参数并赋值
|
|
|
|
|
+ var request = new IdRequest()
|
|
|
|
|
+ request.setId(actId)
|
|
|
|
|
+ // 调用客户端相应的grpc方法,发送grpc请求,并接受后台发送回来的返回值
|
|
|
|
|
+ this.$client.toUsersInGameGpsQuery(request, {}, (err, response) => {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ console.log(`[toUsersInGameGpsQuery] err: code = ${err.code}` +
|
|
|
|
|
+ `, message = "${err.message}"`)
|
|
|
|
|
+ reject(err)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let res = response.toObject()
|
|
|
|
|
+ // console.log('[toUsersInGameGpsQuery]', res)
|
|
|
|
|
+ resolve(res.gpsinfoList)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.log('[getToUsersInGameGpsQuery] err', e)
|
|
|
|
|
+ reject(e)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ initMap() {
|
|
|
// leafletHelper.init(this, 'map', [36.67175772119628, 117.12792580603369], 17)
|
|
// leafletHelper.init(this, 'map', [36.67175772119628, 117.12792580603369], 17)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// const mapid = this.actionDetail.mapinfo.lid
|
|
// const mapid = this.actionDetail.mapinfo.lid
|
|
|
const mapurl = this.actionDetail.mapinfo.mapurl
|
|
const mapurl = this.actionDetail.mapinfo.mapurl
|
|
|
const centPoint = [this.actionDetail.mapinfo.centerlatitude, this.actionDetail.mapinfo.centerlongitude]
|
|
const centPoint = [this.actionDetail.mapinfo.centerlatitude, this.actionDetail.mapinfo.centerlongitude]
|
|
|
const zoomNum = this.actionDetail.mapinfo.defscale
|
|
const zoomNum = this.actionDetail.mapinfo.defscale
|
|
|
leafletHelper.init(this, 'map', centPoint, zoomNum)
|
|
leafletHelper.init(this, 'map', centPoint, zoomNum)
|
|
|
- leafletHelper.global.setCheckPoints(this.checkPoints)
|
|
|
|
|
- leafletHelper.global.setPlayers(this.players)
|
|
|
|
|
- leafletHelper.global.setPlayersPosition(this.players_position)
|
|
|
|
|
leafletHelper.addMapLayer(mapurl)
|
|
leafletHelper.addMapLayer(mapurl)
|
|
|
|
|
+ },
|
|
|
|
|
+ handleMapDrawRoute() {
|
|
|
|
|
+ // leafletHelper.global.setCheckPoints(this.checkPoints)
|
|
|
|
|
+ leafletHelper.global.setRoutes(this.actionDetail.routesList)
|
|
|
|
|
|
|
|
- leafletHelper.checkPoint.drawAllCheckPoints()
|
|
|
|
|
- leafletHelper.checkPoint.drawPath()
|
|
|
|
|
|
|
+ // leafletHelper.checkPoint.drawAllCheckPoints()
|
|
|
|
|
+ // leafletHelper.checkPoint.drawPath()
|
|
|
|
|
+ leafletHelper.route.drawAllRoutes()
|
|
|
|
|
+ leafletHelper.route.drawAllPath()
|
|
|
|
|
+ },
|
|
|
|
|
+ handleMapDrawPlayer() {
|
|
|
|
|
+ // leafletHelper.global.setPlayers(this.players)
|
|
|
|
|
+ // leafletHelper.global.setPlayersPosition(this.players_position)
|
|
|
|
|
|
|
|
leafletHelper.player.drawAllPlayers()
|
|
leafletHelper.player.drawAllPlayers()
|
|
|
// leafletHelper.player.drawOneTrail(1, 10000, true)
|
|
// leafletHelper.player.drawOneTrail(1, 10000, true)
|
|
|
// leafletHelper.player.drawOneTrail(2, 0, false)
|
|
// leafletHelper.player.drawOneTrail(2, 0, false)
|
|
|
leafletHelper.player.drawAllTrails(5000)
|
|
leafletHelper.player.drawAllTrails(5000)
|
|
|
-
|
|
|
|
|
- leafletHelper.checkPoint.toggle(true)
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ handleMapToggle() {
|
|
|
|
|
+ // leafletHelper.checkPoint.toggle(true)
|
|
|
|
|
+ leafletHelper.route.toggle(true)
|
|
|
leafletHelper.player.togglePlayer(true)
|
|
leafletHelper.player.togglePlayer(true)
|
|
|
leafletHelper.player.toggleTooltip(true)
|
|
leafletHelper.player.toggleTooltip(true)
|
|
|
leafletHelper.player.toggleTrail(true)
|
|
leafletHelper.player.toggleTrail(true)
|
|
@@ -318,129 +434,6 @@
|
|
|
onPopupChange(e) {
|
|
onPopupChange(e) {
|
|
|
console.log('[onPopupChange] 当前模式:' + e.type + ', 状态:' + e.show);
|
|
console.log('[onPopupChange] 当前模式:' + e.type + ', 状态:' + e.show);
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- // ========================================================= //
|
|
|
|
|
-
|
|
|
|
|
- // getEl: function(el) {
|
|
|
|
|
- // if (typeof el === 'string' || typeof el === 'number') return el;
|
|
|
|
|
- // return el instanceof HTMLElement ? el : el.$el;
|
|
|
|
|
- // },
|
|
|
|
|
-
|
|
|
|
|
- // // 获取角度
|
|
|
|
|
- // getAngle(angx, angy) {
|
|
|
|
|
- // return Math.atan2(angy, angx) * 180 / Math.PI;
|
|
|
|
|
- // },
|
|
|
|
|
-
|
|
|
|
|
- // // 根据起点终点返回方向 1向上 2向下 3向左 4向右 0未滑动
|
|
|
|
|
- // getDirection(startx, starty, endx, endy) {
|
|
|
|
|
- // var angx = endx - startx;
|
|
|
|
|
- // var angy = endy - starty;
|
|
|
|
|
- // var result = 0;
|
|
|
|
|
- // //如果滑动距离太短
|
|
|
|
|
- // if (Math.abs(angx) < 2 && Math.abs(angy) < 2) {
|
|
|
|
|
- // return result;
|
|
|
|
|
- // }
|
|
|
|
|
- // var angle = this.getAngle(angx, angy);
|
|
|
|
|
- // if (angle >= -135 && angle <= -45) {
|
|
|
|
|
- // result = 1;
|
|
|
|
|
- // } else if (angle > 45 && angle < 135) {
|
|
|
|
|
- // result = 2;
|
|
|
|
|
- // } else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
|
|
|
|
|
- // result = 3;
|
|
|
|
|
- // } else if (angle >= -45 && angle <= 45) {
|
|
|
|
|
- // result = 4;
|
|
|
|
|
- // }
|
|
|
|
|
- // return result;
|
|
|
|
|
- // },
|
|
|
|
|
-
|
|
|
|
|
- // // 手势滑动开始
|
|
|
|
|
- // handleTouchStart(e) {
|
|
|
|
|
- // this.startx = e.changedTouches[0].pageX;
|
|
|
|
|
- // this.starty = e.changedTouches[0].pageY;
|
|
|
|
|
- // },
|
|
|
|
|
-
|
|
|
|
|
- // // 手势滑动结束
|
|
|
|
|
- // handleTouchEnd(e) {
|
|
|
|
|
- // var endx, endy;
|
|
|
|
|
- // endx = e.changedTouches[0].pageX;
|
|
|
|
|
- // endy = e.changedTouches[0].pageY;
|
|
|
|
|
- // var direction = this.getDirection(this.startx, this.starty, endx, endy);
|
|
|
|
|
- // switch (direction) {
|
|
|
|
|
- // // 未滑动!
|
|
|
|
|
- // case 0:
|
|
|
|
|
- // break;
|
|
|
|
|
- // // 向上滑动
|
|
|
|
|
- // case 1:
|
|
|
|
|
- // if (!this.isTop) {
|
|
|
|
|
- // this.goTop();
|
|
|
|
|
- // this.isTop = true
|
|
|
|
|
- // this.scrollable = true
|
|
|
|
|
- // }
|
|
|
|
|
- // break;
|
|
|
|
|
- // // 向下滑动
|
|
|
|
|
- // case 2:
|
|
|
|
|
- // if (this.isTop && this.contentOffsetY == 0) {
|
|
|
|
|
- // this.goBottom();
|
|
|
|
|
- // this.isTop = false
|
|
|
|
|
- // this.scrollable = false
|
|
|
|
|
- // }
|
|
|
|
|
- // break;
|
|
|
|
|
- // // 向左
|
|
|
|
|
- // case 3:
|
|
|
|
|
- // break;
|
|
|
|
|
-
|
|
|
|
|
- // // 向右
|
|
|
|
|
- // case 4:
|
|
|
|
|
- // break;
|
|
|
|
|
- // default:
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // },
|
|
|
|
|
-
|
|
|
|
|
- // handleTouchMove(e) {},
|
|
|
|
|
-
|
|
|
|
|
- // // 上滑操作
|
|
|
|
|
- // goTop() {
|
|
|
|
|
- // console.log("上滑操作")
|
|
|
|
|
- // let box = this.getEl(this.$refs.testdiv);
|
|
|
|
|
- // let topHeight = this.topHeight
|
|
|
|
|
- // // Binding.bind({
|
|
|
|
|
- // // eventType: 'timing',
|
|
|
|
|
- // // exitExpression: {
|
|
|
|
|
- // // origin: 't>800'
|
|
|
|
|
- // // },
|
|
|
|
|
- // // props: [{
|
|
|
|
|
- // // element: box,
|
|
|
|
|
- // // property: 'transform.translateY',
|
|
|
|
|
- // // expression: {
|
|
|
|
|
- // // origin: "easeOutQuint(t, 0, - " + topHeight + ", 800)"
|
|
|
|
|
- // // }
|
|
|
|
|
- // // }]
|
|
|
|
|
- // // });
|
|
|
|
|
- // },
|
|
|
|
|
-
|
|
|
|
|
- // // 下滑操作
|
|
|
|
|
- // goBottom() {
|
|
|
|
|
- // console.log("下滑操作")
|
|
|
|
|
- // let box = this.getEl(this.$refs.testdiv);
|
|
|
|
|
- // let topHeight = this.topHeight
|
|
|
|
|
- // // Binding.bind({
|
|
|
|
|
- // // eventType: 'timing',
|
|
|
|
|
- // // exitExpression: {
|
|
|
|
|
- // // origin: 't>800'
|
|
|
|
|
- // // },
|
|
|
|
|
- // // props: [{
|
|
|
|
|
- // // element: box,
|
|
|
|
|
- // // property: 'transform.translateY',
|
|
|
|
|
- // // expression: {
|
|
|
|
|
- // // origin: "easeOutQuint(t, - " + topHeight + ", " + topHeight + ", 800)"
|
|
|
|
|
- // // }
|
|
|
|
|
- // // }, ]
|
|
|
|
|
- // // });
|
|
|
|
|
- // // setTimeout(() => {
|
|
|
|
|
- // // this.refreshing = false
|
|
|
|
|
- // // }, 100)
|
|
|
|
|
- // },
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|