Compare commits
2 Commits
4d3ff75621
...
ff4f67e051
Author | SHA1 | Date | |
---|---|---|---|
|
ff4f67e051 | ||
|
f1d75c0cac |
10
app.js
10
app.js
@ -93,6 +93,11 @@ App({
|
||||
});
|
||||
}
|
||||
this.autoUpdate()
|
||||
|
||||
let getAccountInfoSync = wx.getAccountInfoSync();
|
||||
if (getAccountInfoSync.miniProgram.appId == "wx9c68fbf7886ea9c4") this.globalData.topTitle = "寄托香港租房"
|
||||
else this.globalData.topTitle = "寄托港校租房"
|
||||
|
||||
},
|
||||
onShow() {
|
||||
|
||||
@ -104,9 +109,11 @@ App({
|
||||
var data = wx.getMenuButtonBoundingClientRect()
|
||||
let totalTopHeight = data.bottom;
|
||||
let windowHeight = systemInfo.windowHeight,
|
||||
windowWidth = systemInfo.windowWidth,
|
||||
statusBarHeight = data.top;
|
||||
this.globalData.screen_data = {
|
||||
windowHeight: windowHeight,
|
||||
windowWidth: windowWidth,
|
||||
totalTopHeight: totalTopHeight + 6,
|
||||
statusBarHeight: statusBarHeight,
|
||||
titleBarHeight: data.height,
|
||||
@ -166,6 +173,7 @@ App({
|
||||
scancode_time: "",
|
||||
irentCouponBig: true,
|
||||
unreadMessagesState: false,
|
||||
firstWxParseImgLoaddState: false
|
||||
firstWxParseImgLoaddState: false,
|
||||
topTitle: "", // 寄托港校租房 寄托香港租房
|
||||
}
|
||||
})
|
2
app.json
2
app.json
@ -35,7 +35,7 @@
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationStyle": "custom"
|
||||
},
|
||||
"requiredPrivateInfos": ["chooseLocation","getLocation"],
|
||||
"requiredPrivateInfos": ["chooseLocation"],
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
"desc": "你的位置信息将用于小程序位置的获取"
|
||||
|
BIN
img/search-icon.png
Normal file
BIN
img/search-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
@ -11,7 +11,8 @@ Page({
|
||||
data: {
|
||||
uniqid: '',
|
||||
template: [],
|
||||
imgUrls: []
|
||||
imgUrls: [],
|
||||
topTitle: "",
|
||||
},
|
||||
|
||||
/**
|
||||
@ -22,14 +23,22 @@ Page({
|
||||
this.setData({
|
||||
uniqid: options.uniqid || "",
|
||||
})
|
||||
|
||||
this.getTopTitle()
|
||||
|
||||
this.get_config()
|
||||
},
|
||||
getTopTitle() {
|
||||
miucms.getTopTitle(this, app)
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
return {
|
||||
title: "寄托香港租房"
|
||||
// title: "寄托港校租房"
|
||||
title: app.globalData.topTitle
|
||||
}
|
||||
},
|
||||
get_config() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
<view class="container">
|
||||
<header-nav>寄托香港租房</header-nav>
|
||||
<!-- <header-nav>寄托港校租房</header-nav> -->
|
||||
<header-nav>{{ topTitle }}</header-nav>
|
||||
<block wx:for="{{ template }}" wx:key="index">
|
||||
<image class='head-img' bindtap='previewImg' data-img="{{ item.data.url }}" mode='widthFix' wx:if="{{ item['type']=='bigpicture' }}" src='{{ item.data.url }}'></image>
|
||||
<view class='content'>
|
||||
|
@ -297,19 +297,6 @@ Page({
|
||||
focusState: false,
|
||||
isAuthorization: 0,
|
||||
|
||||
change: false, // 当两个slider在最右端重合时,将change设置为true,从而隐藏slider2,才能继续操作slider1
|
||||
max: 10000, // 两个slider所能达到的最大值
|
||||
min: 0, // 两个slider所能取的最小值
|
||||
rate: 100, // slider的最大最小值之差和100(或1000)之间的比率
|
||||
slider1Max: 10000, // slider1的最大取值
|
||||
slider1Value: 0, // slider1的值
|
||||
slider2Value: 10000, // slider2的值
|
||||
slider2Min: 0, // slider2的最小取值
|
||||
slider1W: 100, // slider1的宽度
|
||||
slider2W: 0, // slider2的宽度
|
||||
leftSliderPriceWidthX: '0%',
|
||||
rightSliderPriceWidthX: '0%',
|
||||
|
||||
aboutRulesList: {}, // 关于发布的数据
|
||||
locationObj: {}, // 目标区域的数据
|
||||
propertyObj: {}, // 房屋类型的配置数据
|
||||
@ -337,71 +324,6 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
// 开始滑动
|
||||
changeStart: function (e) {
|
||||
var idx = parseInt(e.currentTarget.dataset.idx)
|
||||
let popUpdate = this.data.popUpdate
|
||||
if (idx === 1) {
|
||||
// dW是当前操作的slider所能占据的最大宽度百分数
|
||||
var dW = (popUpdate.slider2Value - popUpdate.min) / popUpdate.rate
|
||||
// var dW = (popUpdate.slider2Value - popUpdate.min) / 490
|
||||
this.setData({
|
||||
['popUpdate.slider1W']: dW,
|
||||
['popUpdate.slider2W']: 100 - dW,
|
||||
['popUpdate.slider1Max']: popUpdate.slider2Value,
|
||||
['popUpdate.slider2Min']: popUpdate.slider2Value,
|
||||
['popUpdate.change']: false
|
||||
})
|
||||
} else if (idx === 2) {
|
||||
var dw = (popUpdate.max - popUpdate.slider1Value) / popUpdate.rate
|
||||
// var dw = (popUpdate.max - popUpdate.slider1Value) / 490
|
||||
this.setData({
|
||||
['popUpdate.slider2W']: dw,
|
||||
['popUpdate.slider1W']: 100 - dw,
|
||||
['popUpdate.slider1Max']: popUpdate.slider1Value,
|
||||
['popUpdate.slider2Min']: popUpdate.slider1Value,
|
||||
['popUpdate.change']: false
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 正在滑动
|
||||
changing: function (e) {
|
||||
var idx = parseInt(e.currentTarget.dataset.idx)
|
||||
var value = e.detail.value
|
||||
let popUpdate = this.data.popUpdate
|
||||
let rightSliderPriceWidthX = 100 - (value / popUpdate.max * 100)
|
||||
let leftSliderPriceWidthX = value / popUpdate.max * 100
|
||||
|
||||
if (idx === 1) {
|
||||
this.setData({
|
||||
['popUpdate.slider1Value']: value,
|
||||
['popUpdate.leftSliderPriceWidthX']: leftSliderPriceWidthX + '%'
|
||||
})
|
||||
} else if (idx === 2) {
|
||||
this.setData({
|
||||
['popUpdate.slider2Value']: value,
|
||||
['popUpdate.rightSliderPriceWidthX']: rightSliderPriceWidthX + '%'
|
||||
})
|
||||
}
|
||||
|
||||
popUpdate.value = [popUpdate.slider1Value, popUpdate.slider2Value]
|
||||
|
||||
this.data.popUpdate = popUpdate
|
||||
this.data.newinfo[popUpdate.field] = popUpdate.value
|
||||
this.data.fieldinfoNew[popUpdate.field] = popUpdate
|
||||
|
||||
},
|
||||
changed: function (e) {
|
||||
let popUpdate = this.data.popUpdate
|
||||
if (popUpdate.slider1Value === popUpdate.slider2Value && popUpdate.slider2Value === popUpdate.max) {
|
||||
this.setData({
|
||||
['popUpdate.change']: true
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
@ -743,14 +665,6 @@ Page({
|
||||
let choicesnew = []
|
||||
choices.forEach((el, i) => {
|
||||
if (!el) return
|
||||
// if (this.data.types == 'edit' || this.data.types == 'edit1') {
|
||||
// // if (el.key == data.info[field]) locationtail = el.value
|
||||
// console.log("locationtail", locationtail);
|
||||
// if (el.key == [Math.trunc(data.info[field])]) {
|
||||
// locationhead = el.value
|
||||
// this.data.areaRegionIndex = el.key - 1
|
||||
// }
|
||||
// }
|
||||
|
||||
if (el.key % 1 == 0) {
|
||||
choicesnew[el.key - 1] = {
|
||||
@ -821,11 +735,6 @@ Page({
|
||||
|
||||
if (locationhead != "") data.info.location = `${locationhead}>>${locationtail}`
|
||||
|
||||
|
||||
// 将发布者身份 放到最前面
|
||||
// data.fieldinfo['status'] = [data.fieldinfo['identity'][1]] || []
|
||||
// data.fieldinfo['identity'].splice(1, 1)
|
||||
|
||||
this.setData({
|
||||
id: data.id,
|
||||
fieldinfo: data.fieldinfo,
|
||||
@ -1177,12 +1086,6 @@ Page({
|
||||
|
||||
},
|
||||
|
||||
wxParseTagATap: function (e) {
|
||||
var url = e.currentTarget.dataset.src;
|
||||
wx.navigateTo({
|
||||
url: url,
|
||||
})
|
||||
},
|
||||
// 有二级选项的提交
|
||||
submitMore(e) {
|
||||
this.data.info[e.currentTarget.dataset.name].value = e.detail.data;
|
||||
@ -1210,35 +1113,35 @@ Page({
|
||||
// 点击获取位置
|
||||
get_location: function () {
|
||||
let that = this;
|
||||
wx.getLocation({
|
||||
success: function (resget) {
|
||||
wx.chooseLocation({
|
||||
enableHighAccuracy: true,
|
||||
latitude: that.data.latitude || '22.297759',
|
||||
longitude: that.data.longitude || '114.179495',
|
||||
success: function (res) {
|
||||
that.data.info.address.value = res.address;
|
||||
that.setData({
|
||||
info: that.data.info,
|
||||
latitude: res.latitude,
|
||||
longitude: res.longitude
|
||||
})
|
||||
if (res.address) {
|
||||
// 如果能获取到address
|
||||
return false
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
},
|
||||
fail(res) {
|
||||
that.setData({
|
||||
isrefusedAuthLocation: 1
|
||||
})
|
||||
}
|
||||
})
|
||||
// wx.getLocation({
|
||||
// success: function (resget) {
|
||||
// wx.chooseLocation({
|
||||
// enableHighAccuracy: true,
|
||||
// latitude: that.data.latitude || '22.297759',
|
||||
// longitude: that.data.longitude || '114.179495',
|
||||
// success: function (res) {
|
||||
// that.data.info.address.value = res.address;
|
||||
// that.setData({
|
||||
// info: that.data.info,
|
||||
// latitude: res.latitude,
|
||||
// longitude: res.longitude
|
||||
// })
|
||||
// if (res.address) {
|
||||
// // 如果能获取到address
|
||||
// return false
|
||||
// }
|
||||
// },
|
||||
// fail(err) {
|
||||
// console.log(err);
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// fail(res) {
|
||||
// that.setData({
|
||||
// isrefusedAuthLocation: 1
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
},
|
||||
bindopensetting(res) {
|
||||
var status = res.detail.authSetting['scope.userLocation'],
|
||||
@ -1534,7 +1437,6 @@ Page({
|
||||
let popUpSubtitle = ""
|
||||
if (choices) {
|
||||
popUpSubtitle = value
|
||||
console.log("popUpSubtitle0", popUpSubtitle);
|
||||
popUpIs = this.data.popUpIs
|
||||
|
||||
let popUpStepState = this.data.popUpStepState
|
||||
@ -1642,12 +1544,8 @@ Page({
|
||||
[`newinfo.${popUpdate.field}`]: popUpdate['value']
|
||||
})
|
||||
|
||||
console.log("newinfo", this.data.newinfo);
|
||||
|
||||
}
|
||||
|
||||
// console.log("1popUpIs0", this.data.popUpdate);
|
||||
|
||||
this.setData({
|
||||
popUpSubtitle,
|
||||
popUpTitle,
|
||||
@ -2316,15 +2214,9 @@ Page({
|
||||
let popUpdate = this.data.fieldinfoNew[field]
|
||||
|
||||
if (field == "rent" && this.data.newinfo[field].length < 2) {
|
||||
// this.data.newinfo[field] = [estimatedValue[field].defaultMin, estimatedValue[field].defaultMax]
|
||||
// popUpdate['value'] = [estimatedValue[field].defaultMin, estimatedValue[field].defaultMax]
|
||||
// popUpdate['slider1Value'] = estimatedValue[field].defaultMin
|
||||
// popUpdate['slider2Value'] = estimatedValue[field].defaultMax
|
||||
|
||||
this.setData({
|
||||
[`nnewinfo${field}`]: popUpdate['value']
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if ((field == "floor" || field == "property" || field == 'sunshinearea') && this.data.newinfo[field].length == 0) {
|
||||
@ -2351,28 +2243,6 @@ Page({
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// for (const key in fieldinfo) {
|
||||
// console.log("fieldinfo", fieldinfo);
|
||||
|
||||
// fieldinfo[key].forEach((element, index) => {
|
||||
// if (element.field == field) {
|
||||
// this.data.aa.forEach(el => {
|
||||
// if (el.name == element.title) {
|
||||
// this.setData({
|
||||
// popUpIs: el.popUpIs,
|
||||
// popUpTitle: this.data.fieldinfo[key][index].title,
|
||||
// popUpdate: this.data.fieldinfoNew[this.data.fieldinfo[key][index].field],
|
||||
// step: index,
|
||||
// popUpit: key,
|
||||
// popUpStepState: el.popUpStepState
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
|
||||
// }
|
||||
},
|
||||
|
||||
// 检查输入的微信号是否是 wxid_ 开头的
|
||||
@ -2395,18 +2265,6 @@ Page({
|
||||
selector: `.clickInput${field}`,
|
||||
offsetTop: -200
|
||||
})
|
||||
|
||||
return
|
||||
for (const key in this.data.fieldinfo) {
|
||||
this.data.fieldinfo[key].forEach(el => {
|
||||
if (el.field == field) {
|
||||
wx.pageScrollTo({
|
||||
selector: `.clickInput${field}`,
|
||||
offsetTop: -200
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
bindfocusfocus() {
|
||||
@ -2458,7 +2316,6 @@ Page({
|
||||
// 房租预算和面积的 公共方法
|
||||
bindChangeRent(e) {
|
||||
let value = e.detail.value
|
||||
console.log(value, this.data.popUpdate);
|
||||
let popUpdate = this.data.popUpdate
|
||||
this.setData({
|
||||
[`newinfo.${popUpdate.field}`]: value,
|
||||
|
@ -1393,7 +1393,6 @@
|
||||
line-height: 130rpx;
|
||||
background-color: rgba(98, 177, 255, 0.145098039215686);
|
||||
width: 100%;
|
||||
/* border-radius: 50rpx; */
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
@ -1428,35 +1428,35 @@ Page({
|
||||
// 点击获取位置
|
||||
get_location: function () {
|
||||
let that = this;
|
||||
wx.getLocation({
|
||||
success: function (resget) {
|
||||
wx.chooseLocation({
|
||||
enableHighAccuracy: true,
|
||||
latitude: that.data.latitude || '22.297759',
|
||||
longitude: that.data.longitude || '114.179495',
|
||||
success: function (res) {
|
||||
that.data.info.address.value = res.address;
|
||||
that.setData({
|
||||
info: that.data.info,
|
||||
latitude: res.latitude,
|
||||
longitude: res.longitude
|
||||
})
|
||||
if (res.address) {
|
||||
// 如果能获取到address
|
||||
return false
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
},
|
||||
fail(res) {
|
||||
that.setData({
|
||||
isrefusedAuthLocation: 1
|
||||
})
|
||||
}
|
||||
})
|
||||
// wx.getLocation({
|
||||
// success: function (resget) {
|
||||
// wx.chooseLocation({
|
||||
// enableHighAccuracy: true,
|
||||
// latitude: that.data.latitude || '22.297759',
|
||||
// longitude: that.data.longitude || '114.179495',
|
||||
// success: function (res) {
|
||||
// that.data.info.address.value = res.address;
|
||||
// that.setData({
|
||||
// info: that.data.info,
|
||||
// latitude: res.latitude,
|
||||
// longitude: res.longitude
|
||||
// })
|
||||
// if (res.address) {
|
||||
// // 如果能获取到address
|
||||
// return false
|
||||
// }
|
||||
// },
|
||||
// fail(err) {
|
||||
// console.log(err);
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// fail(res) {
|
||||
// that.setData({
|
||||
// isrefusedAuthLocation: 1
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
|
||||
},
|
||||
bindopensetting(res) {
|
||||
|
@ -23,11 +23,7 @@ Page({
|
||||
unreadMessages: 0, // 底部我的图标 未读系统通知数量
|
||||
areaList: ['school', 'district', 'type'],
|
||||
areaTab: "school", // school district type
|
||||
areaObj: {
|
||||
'school': 0,
|
||||
'district': 1,
|
||||
'type': 2,
|
||||
},
|
||||
areaIndex: 0, // school district type
|
||||
|
||||
envVersionState: false, // 是否在开发环境
|
||||
images: "https://oss.gter.net/Zvt57TuJSUvkyhw-xG7Y2l-W-58oc3nqqsgFptxhXa6SWi2uePJ5Bg8cFLPIvsEG-4BUA27F7lfn5E55tXAL34gR30K6A7FxO7Sa1zx17l80NDI5", // 新公寓列表的图片链接 随时删除
|
||||
@ -53,6 +49,8 @@ Page({
|
||||
left: 436,
|
||||
}, ],
|
||||
tabValue: 0,
|
||||
swiperCurrent: 0, // 新轮播图 滚动的下标
|
||||
topTitle: "",
|
||||
},
|
||||
|
||||
/**
|
||||
@ -60,6 +58,7 @@ Page({
|
||||
*/
|
||||
timer: null,
|
||||
onLoad: function (options) {
|
||||
|
||||
wx.showLoading()
|
||||
this.get_config()
|
||||
|
||||
@ -67,7 +66,7 @@ Page({
|
||||
let envVersion = accountInfo.miniProgram.envVersion
|
||||
if (envVersion != 'develop') return
|
||||
this.setData({
|
||||
envVersionState: true
|
||||
envVersionState: true,
|
||||
})
|
||||
|
||||
},
|
||||
@ -95,17 +94,22 @@ Page({
|
||||
this.setData({
|
||||
initState: true
|
||||
})
|
||||
this.getTopTitle()
|
||||
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
that.get_config()
|
||||
}, 10)
|
||||
}
|
||||
},
|
||||
getTopTitle() {
|
||||
miucms.getTopTitle(this, app)
|
||||
},
|
||||
|
||||
// 新初始化数据
|
||||
getNewInit() {
|
||||
miucms.wxget(`${app.globalData.baseURL}/tenement/v2/api/home`).then(res => {
|
||||
let data = res.data
|
||||
console.log(data);
|
||||
|
||||
let {
|
||||
search,
|
||||
@ -116,8 +120,6 @@ Page({
|
||||
this.setData({
|
||||
...data
|
||||
})
|
||||
|
||||
console.log("tabs", this.data.tabs);
|
||||
})
|
||||
|
||||
},
|
||||
@ -168,7 +170,7 @@ Page({
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
return {
|
||||
title: "寄托香港租房"
|
||||
title: this.data.topTitle
|
||||
}
|
||||
},
|
||||
copy() {
|
||||
@ -227,6 +229,61 @@ Page({
|
||||
url,
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
// 新 轮播图 自动滑动事件,修改下标
|
||||
bindchangeSwiper(e) {
|
||||
let current = e.detail.current
|
||||
this.setData({
|
||||
swiperCurrent: current
|
||||
})
|
||||
},
|
||||
|
||||
// 新 轮播图 点击事件
|
||||
handleSwiper(e) {
|
||||
console.log(e);
|
||||
let {
|
||||
appid,
|
||||
url,
|
||||
statid
|
||||
} = e.currentTarget.dataset
|
||||
|
||||
miucms.request(app.globalData.config.FormidInsert, {
|
||||
session: wx.getStorageSync('session'),
|
||||
statid
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
})
|
||||
|
||||
// 判断跳转小程序
|
||||
if (appid) {
|
||||
wx.navigateToMiniProgram({
|
||||
appId: appid,
|
||||
path: url
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
// 判断是否是h5页面的
|
||||
if (url && url.indexOf('http') != -1) {
|
||||
wx.navigateTo({
|
||||
url: `/pages/webViewwebweb/index?url=${ url }`,
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
if (url) {
|
||||
wx.navigateTo({
|
||||
url: '/' + url,
|
||||
})
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
// 新 点击 搜索
|
||||
search(e) {
|
||||
let value = e.detail.value
|
||||
console.log(value);
|
||||
}
|
||||
|
||||
})
|
@ -1,17 +1,38 @@
|
||||
<view class="container" wx:if="{{ !loding }}">
|
||||
<header-nav inner-text="Some text" isIndexPage="index">寄托香港租房</header-nav>
|
||||
<!-- swiper -->
|
||||
<head-swiper attachment="{{ banner }}" isInner="1"></head-swiper>
|
||||
<view class="headSwiper">
|
||||
|
||||
|
||||
</view>
|
||||
<!-- <header-nav inner-text="Some text" isIndexPage="index">寄托港校租房</header-nav> -->
|
||||
<header-nav inner-text="Some text" isIndexPage="index">{{ topTitle }}</header-nav>
|
||||
|
||||
<!-- 新的 首页轮播图 -->
|
||||
<block wx:if="{{ envVersionState && true }}">
|
||||
<!-- 搜索框 -->
|
||||
<view class="search-box flexacenter">
|
||||
<image mode="widthFix" class="search-img" src="/img/search-icon.png"></image>
|
||||
<input class="search-input flex1" confirm-type="search" bindconfirm="search" placeholder="{{ search.placeholder }}" />
|
||||
</view>
|
||||
<view class="headSwiper">
|
||||
<swiper class='headSwiper-swiper' current="{{ swiperCurrent }}" autoplay="{{ true }}" circular interval="{{ 3000 }}" duration="{{ 1000 }}" bindchange="bindchangeSwiper">
|
||||
<block wx:for="{{ banner }}" wx:key="index">
|
||||
<swiper-item>
|
||||
<image class="headSwiper-img" mode="widthFix" bindtap="handleSwiper" data-appid="{{ item.appid }}" data-url="{{ item.url }}" src="{{ item.imageurl }}"></image>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
|
||||
<view class="indication-point flexacenter">
|
||||
<block wx:for="{{ banner }}" wx:key="index">
|
||||
<view class="indication-point-item {{ index == swiperCurrent ? 'pitch' : '' }}"></view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<head-swiper attachment="{{ banner }}" isInner="1"></head-swiper>
|
||||
<!-- 搜索 -->
|
||||
<navigator url="/pages/search/search" class="search-btn" hover-class="hover">
|
||||
<image class='searchbtn' src="../../img/search-6.png" />搜索房源或输入房源ID
|
||||
</navigator>
|
||||
</block>
|
||||
|
||||
<!-- 搜索 -->
|
||||
<navigator url="/pages/search/search" class="search-btn" hover-class="hover">
|
||||
<!-- <image class='searchbtn' src="../../img/search-6.png" />搜索房源 -->
|
||||
<image class='searchbtn' src="../../img/search-6.png" />搜索房源或输入房源ID
|
||||
</navigator>
|
||||
<!-- 分类 -->
|
||||
<view class="types-tab">
|
||||
<navigator class="item" url="/pages/personList/personList" hover-class="hover">
|
||||
@ -54,40 +75,40 @@
|
||||
</view>
|
||||
|
||||
<!-- 区域选择 新 -->
|
||||
<view class="area-selection" wx:if="{{ envVersionState && false }}">
|
||||
<view class="area-selection" wx:if="{{ envVersionState && true }}">
|
||||
<view class="head flexacenter shadow">
|
||||
<view class="head-item flexcenter flex1 {{ item == areaTab ? 'pitch' : '' }}" wx:for="{{ areaList }}" wx:key="index" bindtap="setValue" data-key="areaTab" data-value="{{ item }}">
|
||||
学校附近
|
||||
<view class="head-underline" wx:if="{{ item == areaTab }}"></view>
|
||||
<view class="head-item flexcenter flex1 {{ index == areaIndex ? 'pitch' : '' }}" wx:for="{{ combination }}" wx:key="index" bindtap="setValue" data-key="areaIndex" data-value="{{ index }}">
|
||||
{{ item.name }}
|
||||
<view class="head-underline" wx:if="{{ index == areaIndex }}"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="area-content shadow">
|
||||
<view class="area-data flexcenter">
|
||||
<image class="area-icon" mode="widthFix" src="/img/area-icon.png"></image>
|
||||
当前共有 <view class="area-amount">13298</view> 个房源
|
||||
当前共有 <view class="area-amount">{{ combination[areaIndex] && combination[areaIndex].num }}</view> 个房源
|
||||
</view>
|
||||
|
||||
<view wx:if="{{ areaTab == 'school' }}" class="area-list area-school flexflex">
|
||||
<view class="area-item flexcenter" wx:for="{{ 10 }}" wx:key="index">港岛</view>
|
||||
<view wx:if="{{ areaIndex == 0 }}" class="area-list area-school flexflex">
|
||||
<view class="area-item flexcenter" wx:for="{{ combination[areaIndex].where }}" wx:key="index" data-id="{{ item.id }}">{{ item.name }}</view>
|
||||
</view>
|
||||
<view wx:if="{{ areaTab == 'district' }}" class="area-list area-district flexflex">
|
||||
<view class="area-item flexcenter" wx:for="{{ 3 }}" wx:key="index">港岛</view>
|
||||
<view wx:if="{{ areaIndex == 1 }}" class="area-list area-district flexflex">
|
||||
<view class="area-item flexcenter" wx:for="{{ combination[areaIndex].where }}" wx:key="index" data-id="{{ item.id }}">{{ item.name }}</view>
|
||||
</view>
|
||||
|
||||
<block wx:if="{{ areaTab == 'type' }}">
|
||||
<view class="area-list area-type flexflex">
|
||||
<view class="area-type-name">合租</view>
|
||||
<block wx:if="{{ areaIndex == 2 }}">
|
||||
<view class="area-list area-type flexflex" wx:for="{{ combination[areaIndex].where }}" wx:for-item="ite">
|
||||
<view class="area-type-name">{{ ite.name }}</view>
|
||||
<view class="area-type-block flex1 flexflex">
|
||||
<view class="area-item flexcenter" wx:for="{{ 5 }}" wx:key="index">港岛</view>
|
||||
<view class="area-item flexcenter" wx:for="{{ ite.data }}" wx:for-item="it" wx:key="index">{{ it.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="area-list area-type flexflex">
|
||||
<!-- <view class="area-list area-type flexflex">
|
||||
<view class="area-type-name">合租</view>
|
||||
<view class="area-type-block flex1 flexflex">
|
||||
<view class="area-item flexcenter" wx:for="{{ 5 }}">港岛</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</block>
|
||||
|
||||
</view>
|
||||
@ -188,6 +209,10 @@
|
||||
<view class="general-tag flexcenter">整租</view>
|
||||
大学附近 | 中城浸教公大理公 两房一厅,设备齐全拎包入住
|
||||
</view>
|
||||
|
||||
<view class="label-list flexacenter">
|
||||
<view class="label-item">房间</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
@ -786,4 +786,63 @@
|
||||
color: #555555;
|
||||
display: inline-flex;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.headSwiper {
|
||||
width: 690rpx;
|
||||
margin: 0 auto 30rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.headSwiper .headSwiper-img {
|
||||
width: 690rpx;
|
||||
height: 292.5rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.headSwiper .indication-point {
|
||||
position: absolute;
|
||||
bottom: 15rpx;
|
||||
right: 15rpx;
|
||||
height: 18rpx;
|
||||
border-radius: 45rpx;
|
||||
background-color: rgba(255, 255, 255, 0.501960784313725);
|
||||
padding: 0 9rpx;
|
||||
}
|
||||
|
||||
.headSwiper .indication-point .indication-point-item {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
border: 1rpx solid #aaaaaa;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.headSwiper .indication-point .indication-point-item:not(:last-of-type) {
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.headSwiper .indication-point .indication-point-item.pitch {
|
||||
border: none;
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
width: 690rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 345rpx;
|
||||
border: 1rpx solid rgba(235, 235, 235, 1);
|
||||
margin: 0 auto 32rpx;
|
||||
background-color: #fff;
|
||||
|
||||
}
|
||||
|
||||
.search-box .search-img {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin: 0 22.5rpx;
|
||||
}
|
||||
|
||||
.search-box .search-input {
|
||||
height: 100%;
|
||||
}
|
@ -183,6 +183,12 @@ Page({
|
||||
return item * 1
|
||||
});
|
||||
let attachment = [];
|
||||
if (data.data.live && data.data.live.length > 0) {
|
||||
data.data.live.map(item => {
|
||||
item['islive'] = 1;
|
||||
attachment.push(item)
|
||||
})
|
||||
}
|
||||
if (data.data.video && data.data.video.length > 0) {
|
||||
data.data.video.map(item => {
|
||||
item['isvideo'] = 1;
|
||||
|
@ -31,7 +31,8 @@ Page({
|
||||
contact: {},
|
||||
loading: false,
|
||||
info: {
|
||||
subject: '寄托香港租房-学生公寓'
|
||||
// subject: `寄托港校租房-学生公寓`
|
||||
subject: `${app.globalData.topTitle}-学生公寓`
|
||||
},
|
||||
listTab: {},
|
||||
brands: {
|
||||
@ -60,7 +61,8 @@ Page({
|
||||
irenCouponReceive: null,
|
||||
irentCouponBig: true,
|
||||
hideCoupon: false,
|
||||
initState: false
|
||||
initState: false,
|
||||
topTitle: "",
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop > 1000 && !this.data.showTOTOP) {
|
||||
@ -112,8 +114,10 @@ Page({
|
||||
roomlistings: this.data.roomlistings,
|
||||
roomtype: this.data.roomtype,
|
||||
money: this.data.money,
|
||||
brands: this.data.brands
|
||||
brands: this.data.brands,
|
||||
// topTitle: app.globalData.topTitle
|
||||
})
|
||||
this.getTopTitle()
|
||||
screenWidth = wx.getSystemInfoSync().screenWidth;
|
||||
center_position = screenWidth / 2;
|
||||
this.setData({
|
||||
@ -122,6 +126,13 @@ Page({
|
||||
this.attachedIn()
|
||||
this.get_config()
|
||||
},
|
||||
getTopTitle() {
|
||||
miucms.getTopTitle(this, app)
|
||||
|
||||
this.setData({
|
||||
[`info.subject`]: `${app.globalData.topTitle}-学生公寓`
|
||||
})
|
||||
},
|
||||
attachedIn() {
|
||||
if (app.globalData.screen_data.totalTopHeight > 30) {
|
||||
this.data.screen_data = app.globalData.screen_data;
|
||||
@ -201,7 +212,8 @@ Page({
|
||||
}
|
||||
let that = this;
|
||||
let path = `/pages/irentList/irentList?school=${this.data.school}&brands=${this.data.brands.value}&roomtype=${this.data.roomtype.value}&roomlistings=${this.data.roomlistings.value}&money=${this.data.money.rent_min}~${this.data.money.rent_max}`;
|
||||
let title = this.data.school ? `寄托香港租房-${this.data.schoolObj[this.data.school]}附近公寓` : that.data.info.subject;
|
||||
// let title = this.data.school ? `寄托港校租房-${this.data.schoolObj[this.data.school]}附近公寓` : that.data.info.subject;
|
||||
let title = this.data.school ? `${ this.data.topTitle }-${this.data.schoolObj[this.data.school]}附近公寓` : that.data.info.subject;
|
||||
return {
|
||||
title,
|
||||
imageUrl: that.data.info.share_img,
|
||||
|
@ -2,7 +2,8 @@
|
||||
<import src="../common/common.wxml" />
|
||||
<view class="container">
|
||||
<to-top wx:if="{{ showTOTOP }}"></to-top>
|
||||
<header-nav inner-text="Some text">寄托香港租房</header-nav>
|
||||
<!-- <header-nav inner-text="Some text">寄托港校租房</header-nav> -->
|
||||
<header-nav inner-text="Some text">{{ topTitle }}</header-nav>
|
||||
<template is="irenCouponReceive" data="{{ irentCouponBig:irentCouponBig,hideCoupon:hideCoupon,irenCouponReceive:irenCouponReceive }}"></template>
|
||||
<view class='irent-list-box'>
|
||||
<head-swiper attachment="{{ imgUrls }}"></head-swiper>
|
||||
|
@ -163,14 +163,20 @@ Page({
|
||||
options: options || {},
|
||||
location: that.data.location,
|
||||
school: that.data.school,
|
||||
moreCondition: that.data.moreCondition
|
||||
moreCondition: that.data.moreCondition,
|
||||
// topTitle: app.globalData.topTitle
|
||||
})
|
||||
|
||||
this.getTopTitle()
|
||||
setTimeout(function () {
|
||||
that.get_config()
|
||||
}, 200)
|
||||
|
||||
},
|
||||
|
||||
getTopTitle() {
|
||||
miucms.getTopTitle(this, app)
|
||||
},
|
||||
|
||||
get_config() {
|
||||
var that = this;
|
||||
if (app.globalData.config && app.globalData.config.lists) {
|
||||
@ -241,12 +247,15 @@ Page({
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
var location = '';
|
||||
var title = '寄托香港租房-个人房源';
|
||||
// var title = '寄托港校租房-个人房源';
|
||||
var title = this.data.topTitle + '-个人房源';
|
||||
if (this.data.location.value.length > 0) {
|
||||
location = this.data.location.value.join(',');
|
||||
title = '寄托香港租房-' + this.data.location.data[Math.floor(this.data.location.value[0]) + ''] + '个人房源';
|
||||
// title = '寄托港校租房-' + this.data.location.data[Math.floor(this.data.location.value[0]) + ''] + '个人房源';
|
||||
title = this.data.topTitle + '-' + this.data.location.data[Math.floor(this.data.location.value[0]) + ''] + '个人房源';
|
||||
} else if (this.data.school.value) {
|
||||
title = '寄托香港租房-' + this.data.school.list[this.data.school.value + ''] + '附近个人房源';
|
||||
// title = '寄托港校租房-' + this.data.school.list[this.data.school.value + ''] + '附近个人房源';
|
||||
title = this.data.topTitle + '-' + this.data.school.list[this.data.school.value + ''] + '附近个人房源';
|
||||
}
|
||||
let path = `/pages/personList/personList?school=${this.data.school.value}&location=${location}`;
|
||||
|
||||
@ -685,6 +694,7 @@ Page({
|
||||
school,
|
||||
location
|
||||
} = e.detail;
|
||||
console.log(school, location, "00");
|
||||
this.data.school.value = school;
|
||||
this.data.location.value = location;
|
||||
this.setData({
|
||||
|
@ -3,7 +3,8 @@
|
||||
|
||||
<view class="container" wx:if="{{ !isloding }}">
|
||||
<to-top wx:if="{{ showTOTOP }}"></to-top>
|
||||
<header-nav haveSearch="true">寄托香港租房</header-nav>
|
||||
<!-- <header-nav haveSearch="true">寄托港校租房</header-nav> -->
|
||||
<header-nav haveSearch="true">{{ topTitle }}</header-nav>
|
||||
|
||||
<head-swiper attachment="{{ attachment }}"></head-swiper>
|
||||
<tab StudentapartmentNew="{{ StudentapartmentNew}}" page="personList" listTab="{{ listTab }}"></tab>
|
||||
|
@ -10,7 +10,7 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
isloding: true,
|
||||
StudentapartmentNew: null,//是否顯示new
|
||||
StudentapartmentNew: null, //是否顯示new
|
||||
showTOTOP: false,
|
||||
tid: '',
|
||||
uniqid: '0W4XS5SrvSHD',
|
||||
@ -25,9 +25,11 @@ Page({
|
||||
contact: {},
|
||||
loading: false,
|
||||
info: {
|
||||
subject: '寄托香港租房-14天房源'
|
||||
// subject: '寄托港校租房-14天房源'
|
||||
subject: `${ app.globalData.topTitle }-14天房源`
|
||||
},
|
||||
listTab: {}
|
||||
listTab: {},
|
||||
topTitle: "",
|
||||
},
|
||||
|
||||
/**
|
||||
@ -35,7 +37,22 @@ Page({
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
this.get_config()
|
||||
this.setData({
|
||||
topTitle: app.globalData.topTitle
|
||||
})
|
||||
|
||||
this.getTopTitle()
|
||||
},
|
||||
|
||||
getTopTitle() {
|
||||
miucms.getTopTitle(this, app)
|
||||
|
||||
this.setData({
|
||||
[`info.subject`]: `${ app.globalData.topTitle }-14天房源`
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop > 1000 && !this.data.showTOTOP) {
|
||||
this.setData({
|
||||
@ -48,8 +65,8 @@ Page({
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
this.setData({
|
||||
page: {
|
||||
@ -78,7 +95,7 @@ Page({
|
||||
}
|
||||
let that = this;
|
||||
return {
|
||||
title: '寄托香港租房-' + this.data.listTab.quarantineLists,
|
||||
title: this.data.topTitle + '-' + this.data.listTab.quarantineLists,
|
||||
imageUrl: that.data.info.share_img,
|
||||
success: function (res) {
|
||||
miucms.share(app, types)
|
||||
@ -103,7 +120,7 @@ Page({
|
||||
})
|
||||
this.get_content();
|
||||
this.getList();
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
@ -123,7 +140,9 @@ Page({
|
||||
loading: true
|
||||
})
|
||||
|
||||
miucms.request(app.globalData.config.studentapartment.quarantineLists, { page: this.data.page.next_page }).then(data => {
|
||||
miucms.request(app.globalData.config.studentapartment.quarantineLists, {
|
||||
page: this.data.page.next_page
|
||||
}).then(data => {
|
||||
if (data.extraparam) {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
@ -140,11 +159,11 @@ Page({
|
||||
}
|
||||
wx.hideLoading()
|
||||
|
||||
}).catch(res => { })
|
||||
}).catch(res => {})
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
get_content: function () {
|
||||
let that = this;
|
||||
var sendData = Object.assign({}, this.data.options, {
|
||||
@ -165,7 +184,7 @@ Page({
|
||||
})
|
||||
|
||||
}
|
||||
}).catch(res => { })
|
||||
}).catch(res => {})
|
||||
|
||||
},
|
||||
copy(e) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
<view class="container" wx:if="{{ !isloding }}">
|
||||
<to-top wx:if="{{ showTOTOP }}"></to-top>
|
||||
<header-nav haveSearch="true" >寄托香港租房</header-nav>
|
||||
<!-- <header-nav haveSearch="true" >寄托港校租房</header-nav> -->
|
||||
<header-nav haveSearch="true" >{{ topTitle }}</header-nav>
|
||||
|
||||
<view class='irent-list-box'>
|
||||
<head-swiper attachment="{{ imgUrls }}"></head-swiper>
|
||||
|
@ -188,9 +188,11 @@ Page({
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
let path = `/pages/restOfWorld/restOfWorld?name=${this.data.city.name}&cityid=${this.data.city.uniqid}&alias=${this.data.city.alias}`;
|
||||
var title = '寄托香港租房';
|
||||
// var title = '寄托港校租房';
|
||||
var title = app.globalData.topTitle;
|
||||
if (this.data.city.name) {
|
||||
title = '寄托香港租房 - ' + this.data.city.name
|
||||
// title = '寄托港校租房 - ' + this.data.city.name
|
||||
title = app.globalData.topTitle + ' - ' + this.data.city.name
|
||||
}
|
||||
return {
|
||||
path: path,
|
||||
|
@ -123,7 +123,8 @@ Page({
|
||||
let url = `/pages/search/search?kw=${that.data.kw}&tab=${that.data.tab}`;
|
||||
return {
|
||||
path: url,
|
||||
title: '寄托香港租房',
|
||||
// title: '寄托港校租房',
|
||||
title: app.globalData.topTitle,
|
||||
|
||||
}
|
||||
},
|
||||
|
@ -72,6 +72,7 @@ Page({
|
||||
raisePopupMessage: "", // 顶上去升起弹出框的文本
|
||||
initState: false,
|
||||
triggerRules: 0, // 触发规则状态 0 是未触发 1 是触发规则 1 2 是触发规则2
|
||||
topTitle: "",
|
||||
|
||||
},
|
||||
launchAppError(e) {
|
||||
@ -99,12 +100,19 @@ Page({
|
||||
tab: options.tab ? options.tab : 'fav',
|
||||
options: options || {},
|
||||
screen_data: app.globalData.screen_data,
|
||||
// topTitle: app.globalData.topTitle
|
||||
})
|
||||
|
||||
this.getTopTitle()
|
||||
|
||||
this.get_config();
|
||||
this.getNoticeNumber()
|
||||
},
|
||||
|
||||
getTopTitle() {
|
||||
miucms.getTopTitle(this, app)
|
||||
},
|
||||
|
||||
// 获取系统通知数量
|
||||
getNoticeNumber() {
|
||||
if (app.globalData.unreadMessagesState) return
|
||||
|
@ -2,7 +2,8 @@
|
||||
<import src="../../wxParse/wxParse.wxml" />
|
||||
<view class="container" wx:if="{{ !loding }}">
|
||||
<header-nav inner-text="Some text" isIndexPage="index" isMessageCount="{{ true }}" unreadMessages="{{ unreadMessages }}" bindunreadMessagesalter="unreadMessagesalter" bgcolor="transparent" position="{{ 'absolute' }}">
|
||||
<view>寄托香港租房</view>
|
||||
<!-- <view>寄托港校租房</view> -->
|
||||
<view>{{ topTitle }}</view>
|
||||
</header-nav>
|
||||
|
||||
<to-top wx:if="{{ showTOTOP }}"></to-top>
|
||||
|
@ -10,6 +10,7 @@ Page({
|
||||
screen_data: {},
|
||||
videoLength: 0,
|
||||
imgLength: 0,
|
||||
liveLength: 0,
|
||||
windowWidth: 0,
|
||||
swiperHeight: 320,
|
||||
attachment: [],
|
||||
@ -24,6 +25,7 @@ Page({
|
||||
current: 0,
|
||||
imgIndex: 0,
|
||||
videoIndex: 0,
|
||||
liveIndex: 0,
|
||||
tab: 'video',
|
||||
currentTime: 0,
|
||||
loop: false
|
||||
@ -42,6 +44,8 @@ Page({
|
||||
currentTime: options.currentTime || 0,
|
||||
loop: options.loop || false
|
||||
})
|
||||
|
||||
console.log("options", options.current);
|
||||
wx.getSystemInfo({
|
||||
success: function (res) {
|
||||
that.setData({
|
||||
@ -75,17 +79,40 @@ Page({
|
||||
calculateimgLength() {
|
||||
let that = this;
|
||||
this.data.attachment.forEach(item => {
|
||||
if (item.isvideo) {
|
||||
that.data.videoLength++;
|
||||
} else {
|
||||
that.data.imgLength++;
|
||||
}
|
||||
if (item.islive) that.data.liveLength++;
|
||||
else if (item.isvideo) that.data.videoLength++;
|
||||
else that.data.imgLength++;
|
||||
})
|
||||
this.setData({
|
||||
videoLength: this.data.videoLength,
|
||||
imgLength: this.data.imgLength
|
||||
imgLength: this.data.imgLength,
|
||||
liveLength: this.data.liveLength,
|
||||
})
|
||||
if (this.data.current >= this.data.videoLength) {
|
||||
|
||||
if (this.data.current >= this.data.videoLength + this.data.liveLength) {
|
||||
this.setData({
|
||||
tab: 'img',
|
||||
imgIndex: this.data.current + this.data.videoLength + this.data.liveLength
|
||||
})
|
||||
} else if (this.data.current >= this.data.liveLength) {
|
||||
this.setData({
|
||||
tab: 'video',
|
||||
videoIndex: this.data.current + this.data.liveLength
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
tab: 'live',
|
||||
liveIndex: this.data.current
|
||||
})
|
||||
}
|
||||
|
||||
return
|
||||
if (this.data.current >= this.data.videoLength + this.data.liveLength) {
|
||||
this.setData({
|
||||
tab: 'live',
|
||||
liveIndex: this.data.current - this.data.videoLength,
|
||||
})
|
||||
} else if (this.data.current >= this.data.videoLength) {
|
||||
this.setData({
|
||||
tab: 'img',
|
||||
imgIndex: this.data.current - this.data.videoLength,
|
||||
@ -99,17 +126,19 @@ Page({
|
||||
// 切换图片或视频
|
||||
changeTab(e) {
|
||||
let tab = e.currentTarget.dataset.tab;
|
||||
if (this.data.tab == tab) {
|
||||
return false
|
||||
}
|
||||
// this.data.tab = tab;
|
||||
if (this.data.tab == tab) return false
|
||||
|
||||
let current = 0
|
||||
if (tab == 'live') {} else if (tab == 'video') current = this.data.liveLength
|
||||
else current = this.data.liveLength + this.data.videoLength
|
||||
|
||||
this.setData({
|
||||
current: tab == 'img' ? this.data.videoLength : 0,
|
||||
// current: tab == 'img' ? this.data.videoLength : 0,
|
||||
current,
|
||||
imgIndex: 0,
|
||||
videoIndex: 0,
|
||||
tab
|
||||
})
|
||||
console.log('changetab,this.tab=', this.tab)
|
||||
},
|
||||
currentIndex: 0,
|
||||
bindchangeSwiper(e) {
|
||||
@ -120,6 +149,24 @@ Page({
|
||||
}
|
||||
|
||||
let current = e.detail.current;
|
||||
|
||||
let videoLength = this.data.videoLength
|
||||
let liveLength = this.data.liveLength
|
||||
|
||||
let tab = "img"
|
||||
if (current >= liveLength + videoLength) tab = "img"
|
||||
else if (current >= liveLength) tab = "video"
|
||||
else tab = "live"
|
||||
|
||||
this.setData({
|
||||
tab,
|
||||
current,
|
||||
})
|
||||
|
||||
|
||||
|
||||
return
|
||||
|
||||
this.currentIndex = current;
|
||||
if (e.detail.current >= this.data.videoLength) {
|
||||
// 显示视频
|
||||
|
@ -1,10 +1,11 @@
|
||||
<header-nav inner-text="Some text">
|
||||
|
||||
|
||||
{{ !frompage ? '视频' : (tab=='img' ? (imgIndex*1+1 + '/' + imgLength) : (videoIndex*1+1 + '/' + videoLength)) }}</header-nav>
|
||||
<!-- <header-nav inner-text="Some text"> {{ !frompage ? '视频' : (tab=='img' ? (imgIndex*1+1 + '/' + imgLength) : (videoIndex*1+1 + '/' + videoLength)) }}</header-nav> -->
|
||||
<header-nav inner-text="Some text" wx:if="{{ frompage }}">
|
||||
<block wx:if="{{ tab == 'img' }}">{{(current - videoLength - liveLength) + 1 + '/' + imgLength }} </block>
|
||||
<block wx:if="{{ tab == 'video' }}">{{ (current - liveLength) + 1 + '/' + videoLength }}</block>
|
||||
<block wx:if="{{ tab == 'live' }}">{{ current * 1 + 1 + '/' + liveLength }}</block>
|
||||
<!-- {{ tab=='img' ? (imgIndex*1+1 + '/' + imgLength) : (videoIndex*1+1 + '/' + videoLength }} -->
|
||||
</header-nav>
|
||||
<view class='video-box' wx:if="{{ !frompage }}">
|
||||
<!-- <image src="../../img/close.png" class='close' bindtap='close_video'></image> -->
|
||||
<!-- <video src="{{ src}}" loop="{{ loop }}" initial-time="{{ currentTime }}" custom-cache="{{false}}" autoplay='{{true}}'> -->
|
||||
<video src="{{ src}}" id="videobox" loop="{{ loop }}" initial-time="{{ currentTime }}" custom-cache="{{false}}" autoplay='{{false}}'>
|
||||
<cover-view bindtap="closePage" style="top:{{ screen_data.statusBarHeight -5 }}px;height:{{ screen_data.titleBarHeight +10 }}px;width:{{ screen_data.titleBarHeight +10 }}px" class="cover">
|
||||
<cover-view class="inner" style="height:{{ screen_data.titleBarHeight }}px;width:{{ screen_data.titleBarHeight }}px">
|
||||
@ -16,6 +17,7 @@
|
||||
|
||||
<view class="video-img-box" style="padding-top:{{screen_data.totalTopHeight}}px" wx:if="{{ frompage=='apartment' }}">
|
||||
<view class="tab">
|
||||
<view class="{{ tab=='live' ? 'item active':'item'}}" wx:if="{{ liveLength>0}}" data-tab="live" bindtap='changeTab'>live({{ liveLength }})</view>
|
||||
<view class="{{ tab=='video' ? 'item active':'item'}}" wx:if="{{ videoLength>0}}" data-tab="video" bindtap='changeTab'>视频({{ videoLength }})</view>
|
||||
<view class="{{ tab=='img' ? 'item active':'item'}}" wx:if="{{ imgLength>0}}" data-tab="img" bindtap='changeTab'>图片({{ imgLength }})</view>
|
||||
</view>
|
||||
@ -27,7 +29,7 @@
|
||||
<view class="img-box">
|
||||
<image wx:if="{{ !item.video }}" src="{{item.image }}" bindload='load' class="slide-image" mode="widthFix" />
|
||||
|
||||
<video src="{{ item.video }}" id="video{{ index }}" data-index="{{ index }}" wx:if="{{ item.video }}"></video>
|
||||
<video src="{{ item.video }}" id="video{{ index }}" data-index="{{ index }}" wx:if="{{ item.video }}"></video>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
|
@ -68,7 +68,8 @@ Page({
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
return {
|
||||
title:"寄托香港租房",
|
||||
// title:"寄托港校租房",
|
||||
title: app.globalData.topTitle,
|
||||
path: `/pages/webViewwebweb/index?url=${this.data.url}`
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,6 @@ Component({
|
||||
}else{
|
||||
// 直接将图片或者视频放大
|
||||
if (this.data.isvideo) {
|
||||
|
||||
wx.navigateTo({
|
||||
url: `/pages/video_show/video_show?loop=true&src=${this.properties.item.annex.url}`,
|
||||
})
|
||||
|
@ -92,6 +92,8 @@
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
|
||||
color: #E4C762;
|
||||
}
|
||||
|
||||
.fixfooter .plus .c .round {
|
||||
|
@ -31,9 +31,13 @@ Component({
|
||||
windowWidth: 0,
|
||||
imgUrl: [],
|
||||
heightArr: [],
|
||||
tab: 'video',
|
||||
tab: 'live', // live video img
|
||||
liveLength: 0,
|
||||
videoLength: 0,
|
||||
imgLength: 0,
|
||||
imgIndex: 0,
|
||||
videoIndex: 0,
|
||||
liveIndex: 0,
|
||||
video: '',
|
||||
screen_data: {}
|
||||
|
||||
@ -164,12 +168,15 @@ Component({
|
||||
// 切换图片或视频
|
||||
changeTab(e) {
|
||||
let tab = e.currentTarget.dataset.tab;
|
||||
if (this.data.tab == tab) {
|
||||
return false
|
||||
}
|
||||
// this.data.tab = tab;
|
||||
if (this.data.tab == tab) return false
|
||||
|
||||
let swiperCurrent = 0
|
||||
if (tab == 'img') swiperCurrent = this.data.liveLength + this.data.videoLength
|
||||
else if (tab == 'video') swiperCurrent = this.data.liveLength
|
||||
|
||||
this.setData({
|
||||
swiperCurrent: tab == 'img' ? this.data.videoLength : 0,
|
||||
// swiperCurrent: tab == 'img' ? this.data.videoLength : 0,
|
||||
swiperCurrent,
|
||||
current: tab == 'img' ? this.data.videoLength : 0,
|
||||
imgIndex: 0,
|
||||
videoIndex: 0,
|
||||
@ -180,33 +187,55 @@ Component({
|
||||
calculateimgLength() {
|
||||
let that = this;
|
||||
this.data.attachment.forEach(item => {
|
||||
if (item.isvideo) {
|
||||
that.data.videoLength++;
|
||||
} else {
|
||||
that.data.imgLength++;
|
||||
}
|
||||
if (item.islive) that.data.liveLength++;
|
||||
else if (item.isvideo) that.data.videoLength++;
|
||||
else that.data.imgLength++;
|
||||
})
|
||||
|
||||
this.setData({
|
||||
liveLength: this.data.liveLength,
|
||||
videoLength: this.data.videoLength,
|
||||
imgLength: this.data.imgLength
|
||||
})
|
||||
|
||||
if (this.data.current >= this.data.videoLength) {
|
||||
this.setData({
|
||||
tab: 'img',
|
||||
imgIndex: this.data.current - this.data.videoLength,
|
||||
|
||||
imgIndex: this.data.current + this.data.videoLength + this.data.liveLength
|
||||
})
|
||||
} else if (this.data.current >= this.data.liveLength) {
|
||||
this.setData({
|
||||
tab: 'video',
|
||||
videoIndex: this.data.current + this.data.liveLength
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
tab: 'video',
|
||||
videoIndex: this.data.current
|
||||
tab: 'live',
|
||||
liveIndex: this.data.current
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
bindchangeSwiper(e) {
|
||||
// console.log(e.detail.current, e.detail.source)
|
||||
let current = e.detail.current;
|
||||
if (e.detail.current >= this.data.videoLength) {
|
||||
let videoLength = this.data.videoLength
|
||||
let liveLength = this.data.liveLength
|
||||
|
||||
let tab = "img"
|
||||
if (current >= liveLength + videoLength) tab = "img"
|
||||
else if (current >= liveLength) tab = "video"
|
||||
else tab = "live"
|
||||
|
||||
this.setData({
|
||||
tab,
|
||||
current,
|
||||
})
|
||||
|
||||
|
||||
return
|
||||
if (current <= this.data.liveLength - 1) {
|
||||
console.log("ffff");
|
||||
} else if (e.detail.current >= this.data.videoLength) {
|
||||
// 显示视频
|
||||
if (this.data.tab == 'video') {
|
||||
this.setData({
|
||||
@ -234,8 +263,6 @@ Component({
|
||||
}
|
||||
this.setData({
|
||||
current: e.detail.current,
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
play(e) {
|
||||
|
@ -4,8 +4,8 @@
|
||||
<swiper-item>
|
||||
<form bindsubmit="send_form_id" report-submit='true' data-types="confirm" class='submit-form' data-statid="{{ item.statid }}" data-url='{{ item.url }}' data-appid="{{ item.appid }}">
|
||||
<view class="img-box">
|
||||
<image src="{{item.image || item.imageurl }}" data-index="{{ index }}" bindload='load' class="slide-image" mode="widthFix" bindtap='previewImg' />
|
||||
<view class="play" catchtap="play" data-video="{{ item.video }}" wx:if="{{ item.isvideo==1 }}">
|
||||
<image src="{{item.image || item.imageurl }}" data-index="{{ index }}" bindload='load' class="slide-image" mode="widthFix" bindtap='previewImg' />
|
||||
<view class="play" catchtap="play" data-video="{{ item.video }}" wx:if="{{ item.isvideo==1 || item.islive==1 }}">
|
||||
<image src="/img/play.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
@ -22,15 +22,24 @@
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block wx:if="{{ pages=='apartmentDetail'}}">
|
||||
<view class="text">{{ tab=='img' ? (imgIndex*1+1 + '/' + imgLength) : (videoIndex*1+1 + '/' + videoLength) }}</view>
|
||||
<view class="tab" wx:if="{{ videoLength>0&& imgLength>0}}">
|
||||
<view class="{{tab=='video' ? 'item active':'item'}}" data-tab="video" bindtap='changeTab'>
|
||||
<block wx:if="{{ pages=='apartmentDetail' }}">
|
||||
<!-- <view class="text">{{ tab=='img' ? (imgIndex*1+1 + '/' + imgLength) : (videoIndex*1+1 + '/' + videoLength) }}</view> {{ tab }} -->
|
||||
<view class="text" wx:if="{{ tab == 'img' }}">{{ (current - videoLength - liveLength) + 1 + '/' + imgLength }}</view>
|
||||
<view class="text" wx:if="{{ tab == 'video' }}">{{ (current - liveLength) + 1 + '/' + videoLength }}</view>
|
||||
<view class="text" wx:if="{{ tab == 'live' }}">{{ current + 1 + '/' + liveLength }}</view>
|
||||
<!-- <view class="tab" wx:if="{{ videoLength>0&& imgLength>0}}"> -->
|
||||
<view class="tab" wx:if="{{ (videoLength>0&& imgLength>0) || (liveLength>0&& imgLength>0) || (liveLength>0&& videoLength>0) }}">
|
||||
<view wx:if="{{ liveLength > 0 }}" class="{{ tab=='live' ? 'item active':'item'}}" data-tab="live" bindtap='changeTab'>
|
||||
<view class="inner">
|
||||
<view class="texts">直播</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{ videoLength > 0 }}" class="{{tab=='video' ? 'item active':'item'}}" data-tab="video" bindtap='changeTab'>
|
||||
<view class="inner">
|
||||
<view class="texts">视频</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="{{tab=='img' ? 'item active':'item'}}" data-tab="img" bindtap='changeTab'>
|
||||
<view wx:if="{{ imgLength > 0 }}" class="{{tab=='img' ? 'item active':'item'}}" data-tab="img" bindtap='changeTab'>
|
||||
<view class="inner">
|
||||
<view class="texts">图片</view>
|
||||
</view>
|
||||
|
@ -122,7 +122,7 @@
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
display: flex;
|
||||
width: 200rpx;
|
||||
/* width: 200rpx; */
|
||||
height: 80rpx;
|
||||
align-items: center;
|
||||
}
|
||||
@ -141,18 +141,27 @@
|
||||
font-size: 22rpx;
|
||||
|
||||
}
|
||||
.tab .item:nth-child(1),.tab .item:nth-child(1) .inner{
|
||||
|
||||
.tab .item:first-of-type .inner {
|
||||
border-radius: 20rpx 0 0 20rpx;
|
||||
}
|
||||
|
||||
.tab .item:last-of-type .inner {
|
||||
border-radius: 0 20rpx 20rpx 0;
|
||||
}
|
||||
|
||||
/* .tab .item:nth-child(1),.tab .item:nth-child(1) .inner{
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.tab .item:nth-child(2),.tab .item:nth-child(2) .inner{
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.tab .item:nth-child(1) .inner{
|
||||
} */
|
||||
/* .tab .item:nth-child(1) .inner{
|
||||
border-radius: 20rpx 0 0 20rpx;
|
||||
}
|
||||
.tab .item:nth-child(2) .inner{
|
||||
border-radius: 0 20rpx 20rpx 0;
|
||||
}
|
||||
} */
|
||||
.tab .item .texts{
|
||||
display: inline-flex;
|
||||
flex: 1;
|
||||
|
@ -381,6 +381,20 @@ function clickAD(id) {
|
||||
}).then(res => {})
|
||||
}
|
||||
|
||||
function getTopTitle(that, app) {
|
||||
let topTitle = app.globalData.topTitle
|
||||
if (topTitle) {
|
||||
that.setData({
|
||||
topTitle: app.globalData.topTitle
|
||||
})
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
that.getTopTitle()
|
||||
}, 300)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
initial: initial,
|
||||
share: share,
|
||||
@ -393,6 +407,7 @@ module.exports = {
|
||||
closeAD,
|
||||
clickAD,
|
||||
count,
|
||||
getTopTitle,
|
||||
https: function (url, data, success, fail) {
|
||||
wx.request({
|
||||
url: url,
|
||||
|
Loading…
x
Reference in New Issue
Block a user