diff --git a/img/map-icon.png b/img/map-icon.png
new file mode 100644
index 0000000..e67ed4a
Binary files /dev/null and b/img/map-icon.png differ
diff --git a/pages/common/common.wxml b/pages/common/common.wxml
index 911cdbe..0013d81 100644
--- a/pages/common/common.wxml
+++ b/pages/common/common.wxml
@@ -470,4 +470,20 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/common/common.wxss b/pages/common/common.wxss
index 381df68..441c62e 100644
--- a/pages/common/common.wxss
+++ b/pages/common/common.wxss
@@ -609,4 +609,73 @@
color: #555555;
font-size: 27rpx;
margin-bottom: 24rpx;
+}
+
+.header-search {
+ padding: 20rpx 30rpx 48rpx;
+ font-size: 0;
+}
+
+.header-search form {
+ background: #fff;
+ width: 588rpx;
+ height: 84rpx;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ vertical-align: middle;
+ color: #333;
+ position: relative;
+ border-radius: 306rpx;
+ box-shadow: 0 0 12rpx rgba(0, 0, 0, 0.0784313725490196);
+}
+
+.header-search .search-icon {
+ width: 30rpx;
+ height: 30rpx;
+ vertical-align: sub;
+}
+
+.header-search input {
+ display: inline-flex;
+ height: 84rpx;
+ font-size: 28rpx;
+ padding: 0 10rpx;
+ box-sizing: border-box;
+ background-color: #fff;
+ text-align: left;
+}
+
+.header-search .clear {
+ position: absolute;
+ right: 0;
+ top: 50%;
+ padding: 30rpx;
+ transform: translateY(-50%);
+}
+
+.header-search .clear .clear-icon {
+ width: 30rpx;
+ height: 30rpx;
+}
+
+.header-search navigator {
+ font-size: 30rpx;
+ display: inline-block;
+ width: 80rpx;
+ text-align: right;
+ vertical-align: middle;
+}
+
+.header-search .map-btn {
+ width: 84rpx;
+ height: 84rpx;
+ border-radius: 232.5rpx;
+ background-color: #fff;
+ box-shadow: 0 0 12rpx rgba(0, 0, 0, 0.0784313725490196);
+ margin-left: 19.5rpx;
+}
+
+.header-search .map-btn .map-btn-icon {
+ width: 42rpx;
+ height: 42rpx;
}
\ No newline at end of file
diff --git a/pages/index/index.js b/pages/index/index.js
index 6c48d63..fc2afea 100644
--- a/pages/index/index.js
+++ b/pages/index/index.js
@@ -228,18 +228,9 @@ Page({
wx.navigateTo({
url,
})
-
},
- // 新 轮播图 自动滑动事件,修改下标
- bindchangeSwiper(e) {
- let current = e.detail.current
- this.setData({
- swiperCurrent: current
- })
- },
-
- // 新 轮播图 点击事件
+ // 新 瀑布流 点击事件
handleSwiper(e) {
let {
appid,
@@ -252,13 +243,12 @@ Page({
advtype,
} = e.currentTarget.dataset
- let requestUrl = advertisingtype == 'lazyloading' ? `${app.globalData.baseURL}/tenement/v2/api/ad/click` : app.globalData.config.FormidInsert
+ let requestUrl = `${app.globalData.baseURL}/tenement/v2/api/ad/click`
miucms.request(requestUrl, {
statid
}).then(res => {})
// 跳转视频号
- console.log(type,advtype);
if ((type == 5) || (type == 'adv' && advtype == "videofeed_5")) {
wx.openChannelsActivity({
finderUserName: finderusername,
@@ -644,20 +634,5 @@ Page({
}
},
- // 轮播图的加载事件
- loadHeadSwiper(e) {
- let ratio = app.globalData.screen_data['windowWidth'] / 750
- let originalWidth = e.detail.width;
- let originalHeight = e.detail.height;
- let height = originalHeight / originalWidth * 690 * ratio
-
- if (height > this.data.HeadSwiperHeight) {
- this.setData({
- HeadSwiperHeight: height
- })
- }
-
-
- },
})
\ No newline at end of file
diff --git a/pages/index/index.json b/pages/index/index.json
index 51f7442..7175646 100644
--- a/pages/index/index.json
+++ b/pages/index/index.json
@@ -1,14 +1,15 @@
{
- "navigationBarTitleText": "寄托租房",
- "enablePullDownRefresh": false,
- "usingComponents": {
- "header-nav": "../../template/headerNav/index",
- "filtrate-box": "../../template/filtrate/filtrate",
- "go-login": "../../template/goLogin/goLogin",
- "head-swiper": "../../template/headSwiper/headSwiper",
- "form-id": "../../template/formId/formId",
- "fix-footer": "../../template/fixFooter/fixFooter",
- "announcement-popup": "../../template/announcementPopup/announcementPopup",
- "to-top": "/template/toTop/toTop"
- }
+ "navigationBarTitleText": "寄托租房",
+ "enablePullDownRefresh": false,
+ "usingComponents": {
+ "header-nav": "../../template/headerNav/index",
+ "filtrate-box": "../../template/filtrate/filtrate",
+ "go-login": "../../template/goLogin/goLogin",
+ "head-swiper": "../../template/headSwiper/headSwiper",
+ "xin-head-swiper": "/template/xinHeadSwiper/xinHeadSwiper",
+ "form-id": "../../template/formId/formId",
+ "fix-footer": "../../template/fixFooter/fixFooter",
+ "announcement-popup": "../../template/announcementPopup/announcementPopup",
+ "to-top": "/template/toTop/toTop"
+ }
}
\ No newline at end of file
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
index a18f49a..ee0c00c 100644
--- a/pages/index/index.wxml
+++ b/pages/index/index.wxml
@@ -25,21 +25,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -211,7 +201,7 @@
-
+
@@ -271,7 +261,7 @@
-
+
diff --git a/pages/index/index.wxss b/pages/index/index.wxss
index b3670da..698cca6 100644
--- a/pages/index/index.wxss
+++ b/pages/index/index.wxss
@@ -986,56 +986,12 @@ page {
background-color: #fff;
}
-.headSwiper-swiper {
- position: relative;
-}
-
-.headSwiper {
- width: 690rpx;
- margin: 32rpx auto 30rpx;
- position: relative;
- border-radius: 20rpx;
-}
-
-.headSwiper .headSwiper-img {
- width: 690rpx;
- height: 292.5rpx;
- border-radius: 20rpx;
-}
-
-.headSwiper .indication-point {
- position: absolute;
- bottom: 20rpx;
- 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: 12rpx auto 0;
+ margin: 12rpx auto 32rpx;
background-color: #fff;
}
diff --git a/pages/personList/personList.js b/pages/personList/personList.js
index 7e572a8..49e8d0e 100644
--- a/pages/personList/personList.js
+++ b/pages/personList/personList.js
@@ -120,10 +120,22 @@ Page({
initState: false,
langs: {}, // 语言包数据
- isNewVersions: false,
+ operationsTop: false, // 操作栏 是否在顶部
+
+ isNewVersions: true,
},
onPageScroll(e) {
+ if (e.scrollTop > this.operationsHeight && !this.data.operationsTop) {
+ this.setData({
+ operationsTop: true
+ })
+ } else if (e.scrollTop <= this.operationsHeight && this.data.operationsTop) {
+ this.setData({
+ operationsTop: false
+ })
+ }
+
if (e.scrollTop > 1000 && !this.data.showTOTOP) {
this.setData({
showTOTOP: true
@@ -149,7 +161,6 @@ Page({
title: '加载中',
})
- this.getDtailsLangs() // 先全局吧
let that = this;
var location = [];
@@ -194,8 +205,12 @@ Page({
StudentapartmentNew: app.globalData.StudentapartmentNew,
listTab: app.globalData.listTab,
initState: true,
- isloding: false
+ isloding: false,
+ langs: app.globalData.langs,
})
+
+ app.globalData['langs'] ? '' : this.getDtailsLangs() // 先全局吧
+
this.getgroupSearch();
this.get_list();
this.getAd();
@@ -224,44 +239,50 @@ Page({
this.setData({
langs: data
})
- console.log(this.data.langs);
app.globalData['langs'] = data
})
},
// 专门梳理v4出现的 语音包 及 不同房源值的处理
- handleDetailData(item) {
- console.log("item", item);
- let tabList = []
-
+ handleDetailData(data) {
let langs = this.data.langs || {}
if (Object.keys(langs).length == 0) {
setTimeout(() => {
- this.handleDetailData()
+ this.handleDetailData(data)
}, 300)
} else {
+ data.forEach(ele => {
+ // 这个是将 详情键 替换语言包里的值
+ let list = ['type', 'rentalduration', 'intermediary', "property", "elevator", "sunshinearea", "gender"]
+ if (Array.isArray(ele['floor'])) list.push('floor') // 判断 楼层是否需要 替换值, 因为在求房源里是多个值
+ let differentNames = { // 需要替换的 键名
+ "intermediary": "intermediary_text"
+ }
+ list.forEach(element => {
+ if (ele[element] == -1) {} else if (ele[element] == 0) ele[differentNames[element] ? differentNames[element] : element] = '不限' // 当 值为 [0] 时为不限
+ else ele[differentNames[element] ? differentNames[element] : element] = langs[element][ele[element]]
+ })
+ let tabArr = ["gptype", "property", "elevator", "sunshinearea", "gender"]
+ let tabList = []
+ tabArr.forEach(el => {
+ if (ele[el] && ele[el] != -1) tabList.push(ele[el])
+ })
- let judgeArr = ['acreage', 'rent']
- judgeArr.forEach(element => {
- if (Array.isArray(item[element])) item[element] = item[element][0] + ' ~ ' + item[element][1]
+ ele['tabList'] = tabList
+
+ let location = langs.location // 遍历替换区域的值 所有房源
+ let pendingData = ele['location']
+ ele['location'] = `${location[Math.trunc(pendingData)]} > ${location[pendingData]}`
})
- // 这个是将 详情键 替换语言包里的值
- let list = ['type', 'rentalduration', 'intermediary']
- if (Array.isArray(item['floor'])) list.push('floor') // 判断 楼层是否需要 替换值, 因为在求房源里是多个值
- let differentNames = { // 需要替换的 键名
- "intermediary": "intermediary_text"
- }
- list.forEach(element => {
- if (item[element] == 0) item[differentNames[element] ? differentNames[element] : element] = '不限' // 当 值为 [0] 时为不限
- else item[differentNames[element] ? differentNames[element] : element] = langs[element][item[element]]
+ let lists = this.data.lists
+ lists = lists.concat(data)
+ this.setData({
+ lists
})
- let location = langs.location // 遍历替换区域的值 所有房源
- let pendingData = item['location']
- item['location'] = `${location[Math.trunc(pendingData)]} > ${location[pendingData]}`
- return item
+
}
},
@@ -445,6 +466,7 @@ Page({
'type': this.data.types.value,
location: that.data.location.value,
school: that.data.school.value,
+ // school: 309,
page: this.data.page,
// intermediarytype: 2,
intermediary: 0
@@ -463,16 +485,18 @@ Page({
}
data = data.data
if (isNewVersions) {
- data.data.forEach(element => {
- element = this.handleDetailData(element)
+ this.handleDetailData(data.data)
+ }
+
+ if (!isNewVersions) {
+ that.data.lists = that.data.lists.concat(data.data)
+ this.setData({
+ lists: that.data.lists,
})
}
- console.log("data123", data);
-
- that.data.lists = that.data.lists.concat(data.data)
that.setData({
- lists: that.data.lists,
+ // lists: that.data.lists,
page: data.page * data.limit >= data.count ? 0 : data.page + 1,
user: data.user,
loading: false,
@@ -795,7 +819,6 @@ Page({
gender: obj.gender,
leaseterm: obj.leaseterm,
publish: obj.publish,
-
}
this.setData({
selectGroupIndex: index,
@@ -823,11 +846,11 @@ Page({
miucms.closeAD(e.detail.id)
},
+ // 新筛选 的 整合中转
submitOperations(e) {
let {
type
} = e.detail
- console.log(type);
if (type == "rent") this.submitMoney(e)
if (type == "orderby") this.submitOrderby(e)
if (type == "types") this.submittype(e)
@@ -835,4 +858,23 @@ Page({
},
+ // 记录 轮播图的高度 // 随便计算 筛选的高度
+ // 筛选到顶部的高度
+ recordSwiperHeight(e) {
+ let swiperHeight = e.detail
+ let screen_data = this.data.screen_data
+ wx.createSelectorQuery().select("#list-operations").boundingClientRect((rect) => {
+ if (!rect) return
+ let top = rect.top - screen_data['totalTopHeight']
+ this.operationsHeight = top
+ }).exec()
+ },
+
+ // 公共跳转
+ publicJumps(e) {
+ let url = e.currentTarget.dataset.url
+ wx.navigateTo({
+ url,
+ })
+ },
})
\ No newline at end of file
diff --git a/pages/personList/personList.json b/pages/personList/personList.json
index 8e45d3c..17d2c29 100644
--- a/pages/personList/personList.json
+++ b/pages/personList/personList.json
@@ -16,6 +16,9 @@
"tab": "./tab/tab",
"announcement-popup": "/template/announcementPopup/announcementPopup",
"common-list": "/template/commonList/commonList",
- "list-operations": "/template/listOperations/listOperations"
- }
+ "list-operations": "/template/listOperations/listOperations",
+ "xin-head-swiper": "/template/xinHeadSwiper/xinHeadSwiper"
+ },
+ "navigationBarTextStyle": "black"
+
}
\ No newline at end of file
diff --git a/pages/personList/personList.wxml b/pages/personList/personList.wxml
index 4245b37..1725bcc 100644
--- a/pages/personList/personList.wxml
+++ b/pages/personList/personList.wxml
@@ -3,25 +3,35 @@
- {{ topTitle }}
-
-
-
-
+
+
+ {{ topTitle }}
+
+
+
+
+
+
+ {{ topTitle }}
+
+
+
+
+
-
+
{{ item['keyword'] }}
-
+
-
+
-
+
@@ -53,10 +63,7 @@
-
-
-
-
+
diff --git a/pages/personList/personList.wxss b/pages/personList/personList.wxss
index 323af70..2d2530a 100644
--- a/pages/personList/personList.wxss
+++ b/pages/personList/personList.wxss
@@ -1,4 +1,6 @@
/**index.wxss**/
+@import '/pages/common/common.wxss';
+
.bold {
font-weight: bold
}
@@ -463,4 +465,34 @@
.list {
/* background-color: rgba(246, 246, 246, 1); */
+}
+
+.new-list {
+ padding-top: 36rpx;
+ background-color: rgba(246, 246, 246, 1);
+ box-shadow: 0 0 12rpx rgba(0, 0, 0, 0.156862745098039);
+ border-radius: 60rpx 60rpx 0 0;
+ margin-top: 8rpx;
+ min-height: 600rpx;
+}
+
+.bj {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 900rpx;
+ background: linear-gradient(0deg, rgba(255, 255, 255, 1) 2%, rgba(176, 216, 255, 1) 115%);
+ z-index: -1;
+}
+
+.list-operations {
+ position: sticky;
+ z-index: 1000;
+}
+
+.list-operations.list-operations-top{
+ background-color: #fff;
+ border-bottom: 1rpx solid #ebebeb;
+
}
\ No newline at end of file
diff --git a/pages/personList/tab/tab.js b/pages/personList/tab/tab.js
index 2822e71..523de5d 100644
--- a/pages/personList/tab/tab.js
+++ b/pages/personList/tab/tab.js
@@ -7,13 +7,14 @@ Component({
StudentapartmentNew: Boolean,
page: String,
listTab: Object,
+ isNewVersions: Boolean
},
/**
* 组件的初始数据
*/
data: {
- isNewVersions: true,
+ // isNewVersions: true,
tabList: [{
name: "个人房源",
value: "personList",
diff --git a/pages/personList/tab/tab.wxml b/pages/personList/tab/tab.wxml
index 6651019..238112f 100644
--- a/pages/personList/tab/tab.wxml
+++ b/pages/personList/tab/tab.wxml
@@ -1,23 +1,23 @@
-
- {{ item.name }}
+
+ {{ item.name }}
-
-
- 个人房源
-
+
+
+ 个人房源
+
-
- {{ '中介房源' }}
-
-
-
- 学生公寓
-
-
+
+ 学生公寓
+
+
\ No newline at end of file
diff --git a/pages/personList/tab/tab.wxss b/pages/personList/tab/tab.wxss
index 3584e38..5146c59 100644
--- a/pages/personList/tab/tab.wxss
+++ b/pages/personList/tab/tab.wxss
@@ -110,6 +110,7 @@
justify-content: space-between;
font-size: 30rpx;
color: #000000;
+ margin-bottom: 15rpx;
}
diff --git a/pages/search/search.js b/pages/search/search.js
index e2589cd..3ab8029 100644
--- a/pages/search/search.js
+++ b/pages/search/search.js
@@ -3,427 +3,562 @@ var app = getApp()
var config = {};
var miucms = require('../../utils/miucms.js');
Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- isloding: true,
- showTOTOP: false,
- kw: '',
- log: [],
- hot: [],
- focus: false,
- list: [],
- search: false,
- loading: false,
- complete: false,
- status: 0,
- q: '',
- options: {},
- tab: 'hongkongrental',
- otherrental: {
- page: {
- next_page: 1
- },
- list: [],
- loading: false
- },
- hongkongrental: {
- page: {
- next_page: 1
- },
- list: [],
- loading: false
- },
- studentapartment: {
- page: {
- next_page: 1
- },
- list: [],
- loading: false
- }
- },
- onPageScroll(e) {
- if (e.scrollTop > 1000 && !this.data.showTOTOP) {
- this.setData({
- showTOTOP: true
- })
- } else if (e.scrollTop < 1000 && this.data.showTOTOP) {
- this.setData({
- showTOTOP: false
- })
- }
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- var that = this;
- this.setData({
- focus: options.kw ? false : true,
- kw: options.kw || '',
- tab: options.tab || 'hongkongrental'
- })
- this.get_config()
- wx.getStorage({
- key: 'searchHistoryList',
- success: function (res) {
- that.setData({
- log: res.data || []
- })
- },
- })
-
- },
- get_config() {
- var that = this;
- if (app.globalData.config.lists) {
- config = app.globalData.config;
-
- that.setData({
- status: app.globalData.status
- })
- that.get_content()
- if (that.data.kw.trim().length > 0) {
- that.submit()
- }
- } else {
- setTimeout(function () {
- that.get_config()
- }, 200)
- }
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- if (!app.globalData.config.lists) {
- return false
- }
- this.getDatas()
- },
- cancle() {
- var pages = getCurrentPages();
- if (pages.length == 1) {
- wx.reLaunch({
- url: `/pages/index/index`
- });
- } else {
- wx.navigateBack(); //返回上一页
- }
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- const that = this;
- let url = `/pages/search/search?kw=${that.data.kw}&tab=${that.data.tab}`;
- return {
- path: url,
- title: '寄托香港租房',
-
- }
- },
-
- input: function (e) {
- this.setData({
- kw: e.detail.value
- })
- },
- // 提交
- submit: function () {
- // this.data.kw = this.data.kw.trim();
- if (this.data.kw == '') {
- wx.showToast({
- title: '请输入内容~',
- icon: 'none'
- })
- return false
- }
- if (this.data.log.indexOf(this.data.kw) == -1) {
- // 未存在历史记录列表中
- this.data.log.unshift(this.data.kw)
- // 最多存10条内容
- if (this.data.log.length > 10) {
- this.data.log.length = 10
- }
- this.setData({
- log: this.data.log
- })
- wx.setStorage({
- key: 'searchHistoryList',
- data: this.data.log,
- })
- }
- this.clearAllData()
- this.clear_list()
- },
- // 清空历史记录
- clear_keywords: function () {
- let that = this;
- wx.showModal({
- title: '提示',
- content: '确定删除全部记录?',
- confirmColor: '#bc322f',
- success: function (res) {
- if (res.confirm === true) {
- if (!app.globalData.config || !app.globalData.config.lists) {
- return false
- }
- miucms.request(app.globalData.config.lists.removesearchlog, {}).then(data => {
-
- if (data.extraparam.mode == 'right') {
- that.setData({
- log: []
- })
- wx.setStorage({
- key: 'searchHistoryList',
- data: [],
- })
- }
- })
-
- }
- }
- })
-
- },
- // 获取热词
- get_content: function () {
- var that = this;
- var sendData = Object.assign({}, this.data.options, {
- session: wx.getStorageSync('session'),
- })
- miucms.request(app.globalData.config.lists.search, {}).then(data => {
- that.setData({
- hot: data.hot,
- isloding: false
- })
- }).catch(res => {})
-
- },
- // 点击热词或者历史记录item
- select_kw: function (e) {
- wx.pageScrollTo({
- scrollTop: 0,
- duration: 200,
- })
- var kw = e.currentTarget.dataset.kw;
- this.setData({
- kw: kw
- })
- this.clearAllData()
- app.globalData.kw = kw;
- this.clear_list()
- },
- clearAllData() {
- // 清空所有数据
- this.setData({
- otherrental: {
- page: {
- next_page: 1
- },
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ isloding: true,
+ showTOTOP: false,
+ kw: '',
+ log: [],
+ hot: [],
+ focus: false,
list: [],
- loading: false
- },
- hongkongrental: {
- page: {
- next_page: 1
- },
- list: [],
- loading: false
- },
- studentapartment: {
- page: {
- next_page: 1
- },
- list: [],
- loading: false
- }
- })
- },
- // 清空list
- clear_list: function () {
- let tab = this.data.tab;
- this.data[tab] = {
- page: {
- next_page: 1
- },
- list: [],
- loading: false
- }
- this.setTabData()
- this.searchKW()
- },
- // setData
- setTabData() {
- let tab = this.data.tab;
- switch (tab) {
- case 'otherrental':
- this.setData({
- otherrental: this.data.otherrental
- })
- break;
- case 'studentapartment':
- this.setData({
- studentapartment: this.data.studentapartment
- })
- break;
- case 'hongkongrental':
- this.setData({
- hongkongrental: this.data.hongkongrental
- })
- break;
- }
- },
- searchdata: '',
- // 搜索关键词
- searchKW: function () {
- var that = this;
- if (!app.globalData.config.search) {
- return false
- }
- this.setData({
- loading: true
- })
- console.log("this.data.kw", this.data.kw);
- miucms.request(app.globalData.config.search.global, {
- // miucms.request(`${app.globalData.baseURL}/tenement/housingresources/lists`, {
- 'keyword': this.data.kw
- }).then(data => {
- // console.log("data", data);
- if (data.code != 200) {
- wx.showToast({
- title: data.message,
- icon: 'none'
- })
-
- that.setData({
- loading: false,
- otherrental: {
- page: {
- next_page: 0
- },
- list: [],
- loading: false
- },
- hongkongrental: {
- page: {
- next_page: 0
- },
- list: [],
- loading: false
- },
- studentapartment: {
- page: {
- next_page: 0
- },
- list: [],
- loading: false
- }
- })
- return false
- }
- let count = data.data.count;
- this.searchdata = data.data.searchdata;
- for (let i in data.data.count) {
- if (data.data.count[i] == 0) {
- this.data[i].page.next_page = 0;
- } else {
- this.data[i].page.next_page = 1;
- }
- }
- this.setData({
- search: true,
- otherrental: this.data.otherrental,
- studentapartment: this.data.studentapartment,
- hongkongrental: this.data.hongkongrental,
+ search: false,
loading: false,
- kw: data.data.keyword
- })
- this.getDatas()
- }).catch(res => {})
+ complete: false,
+ status: 0,
+ q: '',
+ options: {},
+ // tab: 'hongkongrental',
+ tab: 'personal',
+ tabList: {
+ personal: "个人房源",
+ intermediary: "中介房源",
+ studentapartment: "学生公寓",
+ },
+ otherrental: {
+ page: {
+ next_page: 1
+ },
+ list: [],
+ loading: false
+ },
+ hongkongrental: {
+ page: {
+ next_page: 1
+ },
+ list: [],
+ loading: false
+ },
+ studentapartment: {
+ page: {
+ next_page: 1
+ },
+ list: [],
+ loading: false
+ },
+ screen_data: {},
- },
- // 清空
- clearKW() {
- this.setData({
- kw: '',
- focus: true
- })
- },
- // 更换tab
- changeTab(e) {
- this.setData({
- tab: e.currentTarget.dataset.tab
- })
- let tab = this.data.tab;
- if (!this.data[tab].page.next_page || this.data[tab].list.length > 0) {
- // 如果当前tab下数量为0 ,则不再加载
- return false;
- }
- this.getKWdata()
- },
- // 搜索相关tab关键词
- getDatas() {
- let tab = this.data.tab;
- if (!this.data[tab].page.next_page) {
- // 如果当前tab下数量为0 ,则不再加载
- return false;
- }
- this.getKWdata()
- },
- getKWdata() {
+ personal: {
+ data: [],
+ page: 1,
+ count: 0,
+ searchid: ""
+ },
+ intermediary: {
+ data: [],
+ page: 1,
+ count: 0,
+ searchid: ""
+ },
+ studentapartment: {
+ data: [],
+ page: 1,
+ count: 0,
+ searchid: ""
+ },
+ langs: {}, // 语言包数据
- let urlObj = {
- otherrental: app.globalData.config.search.otherrental,
- // hongkongrental: app.globalData.config.search.hongkongrental,
- hongkongrental: `${app.globalData.baseURL}/tenement/housingresources/lists`,
- studentapartment: app.globalData.config.search.studentapartment,
- }
- let tab = this.data.tab;
- let url = urlObj[tab];
- this.data[tab].loading = true;
- this.setTabData()
- miucms.request(url, {
- 'searchdata': this.searchdata,
- page: this.data[tab].page.next_page
- }).then(data => {
- // console.log(data);
- this.data[tab].list = this.data[tab].list.concat(data.data.data);
- this.data[tab].loading = false;
+ isNewVersions: true,
- if (data.data.data.length > 0) {
- this.data[tab].page.next_page += 1;
- } else {
- this.data[tab].page.next_page = 0;
- }
- this.setTabData()
- }).catch(res => {})
- },
- // 点击广告
- clickAD(e) {
- miucms.clickAD(e.detail.id)
- },
- // 关闭广告
- closeAD(e) {
- let index = e.currentTarget.dataset.index;
- let tab = e.currentTarget.dataset.tab;
+ },
+ onPageScroll(e) {
+ if (e.scrollTop > 1000 && !this.data.showTOTOP) {
+ this.setData({
+ showTOTOP: true
+ })
+ } else if (e.scrollTop < 1000 && this.data.showTOTOP) {
+ this.setData({
+ showTOTOP: false
+ })
+ }
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var that = this;
+ this.setData({
+ focus: options.kw ? false : true,
+ kw: options.kw || '',
+ // tab: options.tab || 'hongkongrental'
+ tab: options.tab || 'personal'
+ })
+ this.get_config()
+ wx.getStorage({
+ key: 'searchHistoryList',
+ success: function (res) {
+ that.setData({
+ log: res.data || []
+ })
+ },
+ })
- this.data[tab].list.splice(index, 1)
- if (tab == 'hongkongrental') {
- this.setData({
- hongkongrental: this.data.hongkongrental
- })
- } else {
- this.setData({
- otherrental: this.data.otherrental
- })
- }
+ },
+ get_config() {
+ var that = this;
+ if (app.globalData.config.lists) {
+ config = app.globalData.config;
+ that.setData({
+ status: app.globalData.status,
+ screen_data: app.globalData.screen_data,
+ langs: app.globalData.langs,
+ })
+ that.get_content()
+ app.globalData['langs'] ? '' : this.getDtailsLangs()
+
+ if (that.data.kw.trim().length > 0) that.submit()
+ } else {
+ setTimeout(function () {
+ that.get_config()
+ }, 200)
+ }
+ },
+
+ // 获取语言包 保存全局
+ getDtailsLangs() {
+ miucms.request(`${app.globalData.baseURL}/tenement/v2/api/details/langs`).then(res => {
+ if (res.code != 200) return
+ let data = res.data
+ this.setData({
+ langs: data
+ })
+ app.globalData['langs'] = data
+ })
+ },
+
+ // 专门梳理v4出现的 语音包 及 不同房源值的处理
+ handleDetailData(data) {
+ let langs = this.data.langs || {}
+ if (Object.keys(langs).length == 0) {
+ setTimeout(() => {
+ this.handleDetailData(data)
+ }, 300)
+ } else {
+ let tab = this.data.tab
+ data.forEach(ele => {
+ // 这个是将 详情键 替换语言包里的值
+ let list = ['type', 'rentalduration', 'intermediary', "property", "elevator", "sunshinearea", "gender"]
+ if (Array.isArray(ele['floor'])) list.push('floor') // 判断 楼层是否需要 替换值, 因为在求房源里是多个值
+ let differentNames = { // 需要替换的 键名
+ "intermediary": "intermediary_text"
+ }
+ list.forEach(element => {
+ if (ele[element] == -1) {} else if (ele[element] == 0) ele[differentNames[element] ? differentNames[element] : element] = '不限' // 当 值为 [0] 时为不限
+ else ele[differentNames[element] ? differentNames[element] : element] = langs[element][ele[element]]
+ })
+ let tabArr = ["gptype", "property", "elevator", "sunshinearea", "gender"]
+ let tabList = []
+ tabArr.forEach(el => {
+ if (ele[el] && ele[el] != -1) tabList.push(ele[el])
+ })
+ ele['tabList'] = tabList
+ let location = langs.location // 遍历替换区域的值 所有房源
+ let pendingData = ele['location']
+ ele['location'] = `${location[Math.trunc(pendingData)]} > ${location[pendingData]}`
+ })
+ let tabData = this.data[tab]["list"] || []
+ tabData = tabData.concat(data)
+ this.setData({
+ [`${tab}.list`]: tabData,
+ })
+
+ }
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ if (!app.globalData.config.lists) return false
+ this.getResultList()
+ },
+ cancle() {
+ var pages = getCurrentPages();
+ if (pages.length == 1) {
+ wx.reLaunch({
+ url: `/pages/index/index`
+ });
+ } else wx.navigateBack(); //返回上一页
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ const that = this;
+ let url = `/pages/search/search?kw=${that.data.kw}&tab=${that.data.tab}`;
+ return {
+ path: url,
+ title: app.globalData.topTitle,
+ }
+ },
+
+ input: function (e) {
+ this.setData({
+ kw: e.detail.value
+ })
+ },
+ // 提交
+ submit: function () {
+ // this.data.kw = this.data.kw.trim();
+ if (this.data.kw == '') {
+ wx.showToast({
+ title: '请输入内容~',
+ icon: 'none'
+ })
+ return false
+ }
+ if (this.data.log.indexOf(this.data.kw) == -1) {
+ // 未存在历史记录列表中
+ this.data.log.unshift(this.data.kw)
+ // 最多存10条内容
+ if (this.data.log.length > 10) {
+ this.data.log.length = 10
+ }
+ this.setData({
+ log: this.data.log
+ })
+ wx.setStorage({
+ key: 'searchHistoryList',
+ data: this.data.log,
+ })
+ }
+ this.clearAllData()
+ this.clear_list()
+ },
+ // 清空历史记录
+ clear_keywords: function () {
+ let that = this;
+ wx.showModal({
+ title: '提示',
+ content: '确定删除全部记录?',
+ confirmColor: '#bc322f',
+ success: function (res) {
+ if (res.confirm === true) {
+ if (!app.globalData.config || !app.globalData.config.lists) {
+ return false
+ }
+ miucms.request(app.globalData.config.lists.removesearchlog, {}).then(data => {
+
+ if (data.extraparam.mode == 'right') {
+ that.setData({
+ log: []
+ })
+ wx.setStorage({
+ key: 'searchHistoryList',
+ data: [],
+ })
+ }
+ })
+
+ }
+ }
+ })
+
+ },
+ // 获取热词
+ get_content: function () {
+ var that = this;
+ var sendData = Object.assign({}, this.data.options, {
+ session: wx.getStorageSync('session'),
+ })
+ miucms.request(app.globalData.config.lists.search, {}).then(data => {
+ that.setData({
+ hot: data.hot,
+ isloding: false
+ })
+ }).catch(res => {})
+
+ },
+ // 点击热词或者历史记录item
+ select_kw: function (e) {
+ wx.pageScrollTo({
+ scrollTop: 0,
+ duration: 200,
+ })
+ var kw = e.currentTarget.dataset.kw;
+ this.setData({
+ kw
+ })
+ this.clearAllData()
+ app.globalData.kw = kw;
+ this.clear_list()
+ },
+ clearAllData() {
+ // 清空所有数据
+ this.setData({
+ otherrental: {
+ page: {
+ next_page: 1
+ },
+ list: [],
+ loading: false
+ },
+ hongkongrental: {
+ page: {
+ next_page: 1
+ },
+ list: [],
+ loading: false
+ },
+ studentapartment: {
+ page: {
+ next_page: 1
+ },
+ list: [],
+ loading: false
+ }
+ })
+ },
+ // 清空list
+ clear_list: function () {
+ let tab = this.data.tab;
+ this.data[tab] = {
+ page: {
+ next_page: 1
+ },
+ list: [],
+ loading: false
+ }
+ this.setTabData()
+ this.searchKW()
+ },
+ setTabData() {
+ let tab = this.data.tab;
+ switch (tab) {
+ case 'otherrental':
+ this.setData({
+ otherrental: this.data.otherrental
+ })
+ break;
+ case 'studentapartment':
+ this.setData({
+ studentapartment: this.data.studentapartment
+ })
+ break;
+ case 'hongkongrental':
+ this.setData({
+ hongkongrental: this.data.hongkongrental
+ })
+ break;
+ }
+ },
+ searchdata: '',
+ // 搜索关键词
+ searchKW: function () {
+ var that = this;
+ if (!app.globalData.config.search) {
+ return false
+ }
+ this.setData({
+ loading: true
+ })
+ miucms.request(app.globalData.config.search.global, {
+ // miucms.request(`${app.globalData.baseURL}/tenement/housingresources/lists`, {
+ 'keyword': this.data.kw
+ }).then(data => {
+ // console.log("data", data);
+ if (data.code != 200) {
+ wx.showToast({
+ title: data.message,
+ icon: 'none'
+ })
+
+ that.setData({
+ loading: false,
+ otherrental: {
+ page: {
+ next_page: 0
+ },
+ list: [],
+ loading: false
+ },
+ hongkongrental: {
+ page: {
+ next_page: 0
+ },
+ list: [],
+ loading: false
+ },
+ studentapartment: {
+ page: {
+ next_page: 0
+ },
+ list: [],
+ loading: false
+ }
+ })
+ return false
+ }
+ let count = data.data.count;
+ this.searchdata = data.data.searchdata;
+ for (let i in data.data.count) {
+ if (data.data.count[i] == 0) {
+ this.data[i].page.next_page = 0;
+ } else {
+ this.data[i].page.next_page = 1;
+ }
+ }
+ this.setData({
+ search: true,
+ otherrental: this.data.otherrental,
+ studentapartment: this.data.studentapartment,
+ hongkongrental: this.data.hongkongrental,
+ loading: false,
+ kw: data.data.keyword
+ })
+ this.getDatas()
+ }).catch(res => {})
+
+ },
+
+ // 搜索初始化 新的 自动覆盖上面的
+ searchKW() {
+ miucms.wxget(`${app.globalData.baseURL}/tenement/v2/api/search`, {
+ 'keyword': this.data.kw
+ }).then(res => {
+ if (res.code != 200) return
+ let data = res.data
+ let {
+ personal,
+ intermediary,
+ studentapartment
+ } = data
+
+ this.setData({
+ ...data
+ })
+
+ console.log();
+
+ this.getResultList()
+ })
+ },
+
+ // 请求结果列表
+ getResultList() {
+ let tab = this.data.tab
+ let tabData = this.data[tab]
+ if (tabData['page'] == 0) return // 需要加一个请求中
+
+ console.log(tabData);
+ let searchid = tabData['searchid']
+ let url = tab == 'studentapartment' ? `${ app.globalData.baseURL }/tenement/apartment/filterConditions` : `${ app.globalData.baseURL }/tenement/v2/api/lists`
+ let requestData = {
+ searchid,
+ page: tabData['page'] || 1,
+ intermediary: 6
+ }
+
+ miucms.request(url, requestData).then(res => {
+ if (res.code != 200) return
+ let data = res.data
+ let concreteData = data.data
+ this.handleDetailData(concreteData)
+
+ // if (!tabData['list']) tabData['list'] = []
+ // tabData['list'].push(...concreteData)
+ tabData['page'] = data.page * data.limit >= data.count ? 0 : data.page + 1
+
+ this.setData({
+ search: true,
+ [tab]: tabData,
+ })
+
+ })
+ },
+
+ // 清空
+ clearKW() {
+ this.setData({
+ kw: '',
+ focus: true
+ })
+ },
+ // 更换tab
+ changeTab(e) {
+ console.log(e.currentTarget.dataset.tab, 0);
+ this.setData({
+ tab: e.currentTarget.dataset.tab
+ })
+ let tab = this.data.tab;
+ // 如果当前tab下数量为0 ,则不再加载
+ if (this.data[tab].page == 0 || this.data[tab].list) return false;
+
+ // this.getKWdata()
+ this.getResultList()
+ },
+ // 搜索相关tab关键词
+ getDatas() {
+ let tab = this.data.tab;
+ if (!this.data[tab].page.next_page) {
+ // 如果当前tab下数量为0 ,则不再加载
+ return false;
+ }
+ this.getKWdata()
+ },
+ getKWdata() {
+ let urlObj = {
+ otherrental: app.globalData.config.search.otherrental,
+ // hongkongrental: app.globalData.config.search.hongkongrental,
+ hongkongrental: `${app.globalData.baseURL}/tenement/housingresources/lists`,
+ studentapartment: app.globalData.config.search.studentapartment,
+ }
+ let tab = this.data.tab;
+ let url = urlObj[tab];
+ this.data[tab].loading = true;
+ this.setTabData()
+ miucms.request(url, {
+ 'searchdata': this.searchdata,
+ page: this.data[tab].page.next_page
+ }).then(data => {
+ // console.log(data);
+ this.data[tab].list = this.data[tab].list.concat(data.data.data);
+ this.data[tab].loading = false;
+
+ if (data.data.data.length > 0) {
+ this.data[tab].page.next_page += 1;
+ } else {
+ this.data[tab].page.next_page = 0;
+ }
+ this.setTabData()
+ }).catch(res => {})
+ },
+ // 点击广告
+ clickAD(e) {
+ miucms.clickAD(e.detail.id)
+ },
+ // 关闭广告
+ closeAD(e) {
+ let index = e.currentTarget.dataset.index;
+ let tab = e.currentTarget.dataset.tab;
+
+ this.data[tab].list.splice(index, 1)
+ if (tab == 'hongkongrental') {
+ this.setData({
+ hongkongrental: this.data.hongkongrental
+ })
+ } else {
+ this.setData({
+ otherrental: this.data.otherrental
+ })
+ }
+
+ miucms.closeAD(e.detail.id)
+ },
- miucms.closeAD(e.detail.id)
- }
})
\ No newline at end of file
diff --git a/pages/search/search.json b/pages/search/search.json
index 1d73251..c8d284a 100644
--- a/pages/search/search.json
+++ b/pages/search/search.json
@@ -1,11 +1,13 @@
{
- "navigationBarTitleText": "搜索",
- "enablePullDownRefresh": false,
- "usingComponents": {
- "header-nav": "../../template/headerNav/index",
- "brands-item":"../irentList/listItem/listItem",
- "to-top": "../../template/toTop/toTop",
- "ads": "../show/ads/ads",
- "house-item": "../restOfWorld/houseItem/houseItem"
- }
+ "navigationBarTitleText": "搜索",
+ "enablePullDownRefresh": false,
+ "usingComponents": {
+ "header-nav": "../../template/headerNav/index",
+ "brands-item": "../irentList/listItem/listItem",
+ "to-top": "../../template/toTop/toTop",
+ "ads": "../show/ads/ads",
+ "house-item": "../restOfWorld/houseItem/houseItem",
+ "list-operations": "/template/listOperations/listOperations",
+ "common-list": "/template/commonList/commonList"
+ }
}
\ No newline at end of file
diff --git a/pages/search/search.wxml b/pages/search/search.wxml
index 0500d9b..0451190 100644
--- a/pages/search/search.wxml
+++ b/pages/search/search.wxml
@@ -1,91 +1,107 @@
-
+
-
- 搜索
-
-
-
-
- 历史搜索
-
-
-
-
- {{ item }}
-
+
+ 搜索
+
+
+
+
+
+ 历史搜索
+
+
+
+
+
+ {{ item }}
+
+
+
+ 热门搜索
+
+ {{ item }}
+
+
-
-
- 热门搜索
-
-
- {{ item }}
-
-
-
-
-
- 个人房源
- 品牌公寓
-
-
- 求房源
-
-
-
-
-
-
-
+
+
+
+
+ 个人房源 {{ personal['count'] }}
+
+
+ 中介房源 {{ intermediary['count'] == 0 ? '' : intermediary['count'] }}
+
+
+ 品牌公寓 {{ studentapartment['count'] == 0 ? '' : studentapartment['count'] }}
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
- 没有找到相关信息
-
+
+
+ 没有找到相关信息
+
\ No newline at end of file
diff --git a/pages/search/search.wxss b/pages/search/search.wxss
index 54b93e8..f4c91a4 100644
--- a/pages/search/search.wxss
+++ b/pages/search/search.wxss
@@ -1,428 +1,361 @@
-/* pages/search/search.wxss */
-.header {
- border-bottom: 1px solid #f2f2f2;
- padding: 20rpx 20rpx;
- font-size: 0;
-}
+@import '/pages/common/common.wxss';
-.border-top20 {
- border-top: 10rpx solid #f2f2f2;
-}
-
-.header form {
- display: inline-block;
- background: #f2f2f2;
- width: calc(100% - 80rpx);
- height: 92rpx;
- line-height: 40rpx;
- padding: 25rpx 30rpx;
- border-radius: 8rpx;
- box-sizing: border-box;
- vertical-align: middle;
- color: #666;
- position: relative;
-}
-
-.header .search-btn {
- width: 32rpx;
- height: 32rpx;
- display: inline-block;
- vertical-align: middle;
-}
-
-.header input {
- display: inline-block;
- width: calc(100% - 82rpx);
- height: 40rpx;
- font-size: 28rpx;
- vertical-align: middle;
- padding: 0 10rpx;
- box-sizing: border-box;
-}
-
-.header .clear {
- position: absolute;
- right: 0;
- top: 50%;
- padding: 30rpx;
- transform: translateY(-50%);
-}
-
-.header .clear .close {
- width: 28rpx;
- height: 28rpx;
- border-radius: 50%;
- background: #c2c2c2;
- padding: 7rpx;
- text-align: center;
- display: flex;
- justify-content: center;
- align-items: center;
-
-}
-
-.header .clear .close image {
- width: 12rpx;
- height: 12rpx;
-}
-
-.header navigator {
- font-size: 30rpx;
- display: inline-block;
- width: 80rpx;
- text-align: right;
- vertical-align: middle;
-}
-
-.header .navigator {
- font-size: 30rpx;
- display: inline-block;
- width: 80rpx;
- text-align: right;
- vertical-align: middle;
+.container {
+ background-color: rgba(245, 245, 245, 1);
}
.keywords {
- padding: 40rpx 0rpx 0rpx;
+ padding: 40rpx 0rpx 0rpx;
}
.keywords .name {
- color: #ccc;
- padding-left: 20rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 30rpx;
+ font-size: 24rpx;
+ color: #7F7F7F;
+ padding-left: 20rpx;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 30rpx;
}
.keywords .label {
- margin: 0 20rpx 20rpx 0;
- background: #f2f2f2;
- line-height: 72rpx;
- border-radius: 10rpx;
- display: inline-block;
- padding: 0 36rpx;
- font-size: 26rpx;
- color: #666;
- word-break: break-word;
+ margin: 0 20rpx 20rpx 0;
+ background: #f2f2f2;
+ line-height: 72rpx;
+ border-radius: 10rpx;
+ display: inline-block;
+ padding: 0 36rpx;
+ font-size: 26rpx;
+ color: #000000;
+ word-break: break-word;
}
.history {
- padding-left: 0;
- border-bottom: 1px solid #e8e8e8;
- padding-bottom: 20rpx;
- padding-top: 28rpx;
+ padding-left: 0;
+ /* border-bottom: 1px solid #e8e8e8; */
+ padding-bottom: 20rpx;
+ padding-top: 28rpx;
}
.history .name {
- margin-bottom: 10rpx;
+ margin-bottom: 10rpx;
}
.history.keywords .label {
- /* background: transparent;
+ /* background: transparent;
padding: 0 20rpx;
line-height: 40rpx; */
}
.keywords .box {
- /* margin-right: -20rpx; */
- text-align: justify;
- font-size: 0;
- padding-left: 20rpx;
+ /* margin-right: -20rpx; */
+ text-align: justify;
+ font-size: 0;
+ padding-left: 20rpx;
}
.history.keywords .box {
- /* padding-left: 0; */
+ /* padding-left: 0; */
}
.keywords .del {
- display: inline-flex;
- padding: 20rpx;
+ display: inline-flex;
+ padding: 20rpx;
}
.keywords .del image {
- width: 26rpx;
- height: 26rpx;
+ width: 26rpx;
+ height: 26rpx;
}
.nocontent {
- text-align: center;
- font-size: 28rpx;
- color: #ccc;
- line-height: 60rpx;
+ text-align: center;
+ font-size: 28rpx;
+ color: #ccc;
+ line-height: 60rpx;
}
button {
- background: transparent;
- border: none;
- position: absolute;
- width: 32rpx;
- height: 32rpx;
- left: 30rpx;
- top: 25rpx;
- z-index: 100000;
- padding: 0;
+ background: transparent;
+ border: none;
+ position: absolute;
+ width: 32rpx;
+ height: 32rpx;
+ left: 30rpx;
+ top: 25rpx;
+ z-index: 100000;
+ padding: 0;
}
button::after {
- border: none;
- padding: 0;
- background: transparent;
+ border: none;
+ padding: 0;
+ background: transparent;
}
button:hover {
- background: transparent
+ background: transparent
}
.nocontent {
- text-align: center;
- font-size: 28rpx;
- color: #999;
- background: #f3f4f5;
- height: 640rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
+ text-align: center;
+ font-size: 28rpx;
+ color: #999;
+ background: #f3f4f5;
+ height: 640rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
}
.file {
- width: 158rpx;
- height: 110rpx;
- display: block;
- margin: 0 auto 8rpx;
+ width: 158rpx;
+ height: 110rpx;
+ display: block;
+ margin: 0 auto 8rpx;
}
.color-red {
- color: #C63E3A;
+ color: #C63E3A;
}
.getuserbtn {
- height: 100%;
- background: transparent;
- z-index: 1000;
- width: 100%;
- margin: 0;
- position: static;
+ height: 100%;
+ background: transparent;
+ z-index: 1000;
+ width: 100%;
+ margin: 0;
+ position: static;
}
.tab-box {
- display: flex;
- border-bottom: 1px solid #e8e8e8;
+ display: flex;
+ border-bottom: 1px solid #e8e8e8;
+ background-color: rgba(245, 245, 245, 1);
}
.tab-box .tab {
- display: inline-flex;
- flex: 1;
- justify-content: center;
+ display: inline-flex;
+ /* flex: 1; */
+ justify-content: center;
+
+ font-size: 30rpx;
+ padding: 0 30rpx;
}
.tab-box .text {
- position: relative;
- height: 106rpx;
- display: inline-flex;
- align-items: center;
+ position: relative;
+ /* height: 106rpx; */
+ display: inline-flex;
+ align-items: center;
+ padding: 12rpx 0;
+
+}
+
+.tab-box .active {
+ font-weight: 650;
+
}
.tab-box .active .text::after {
- content: "";
- display: block;
- position: absolute;
- left: 0;
- bottom: -4rpx;
- background-color: rgb(255, 192, 95);
- width: 100%;
- height: 7rpx;
- border-radius: 7rpx;
+ content: "";
+ display: block;
+ position: absolute;
+ left: 0;
+ bottom: -4rpx;
+ background-color: rgb(255, 192, 95);
+ width: 100%;
+ height: 7.5rpx;
+ border-radius: 7rpx;
}
.studentapartment {
- background: #f3f4f5;
- padding: 16rpx 30rpx;
- min-height: calc(100vh - 300rpx);
- box-sizing: border-box;
+ background: #f3f4f5;
+ padding: 16rpx 30rpx;
+ min-height: calc(100vh - 300rpx);
+ box-sizing: border-box;
}
.otherrental {
- background: #f3f4f5;
- padding: 16rpx 0rpx;
- min-height: calc(100vh - 300rpx);
- box-sizing: border-box;
+ background: #f3f4f5;
+ padding: 16rpx 0rpx;
+ min-height: calc(100vh - 300rpx);
+ box-sizing: border-box;
}
.otherrental-empty {
- background: #f3f4f5;
+ background: #f3f4f5;
}
.hongkongrental {
- background: #f3f4f5;
- padding: 16rpx 0rpx;
- min-height: calc(100vh - 300rpx);
- box-sizing: border-box;
+ background: #f3f4f5;
+ padding: 16rpx 0rpx;
+ min-height: calc(100vh - 300rpx);
+ box-sizing: border-box;
}
.hongkongrental .list {
- background: #fff;
+ background: #fff;
}
.personalList .region {
- height: 44rpx;
- padding: 0 18rpx;
- border-radius: 18rpx;
- background-color: #f2f2f2;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- font-size: 22rpx;
- color: #555555;
+ height: 44rpx;
+ padding: 0 18rpx;
+ border-radius: 18rpx;
+ background-color: #f2f2f2;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 22rpx;
+ color: #555555;
}
.personalList .tips {
- margin-top: 28rpx;
- color: #555555;
- font-size: 22rpx;
+ margin-top: 28rpx;
+ color: #555555;
+ font-size: 22rpx;
}
.personalList .footer {
- color: #343434;
+ color: #343434;
}
.personalList .money {
- margin-top: 32rpx;
- font-size: 26rpx;
- line-height: 26rpx;
+ margin-top: 32rpx;
+ font-size: 26rpx;
+ line-height: 26rpx;
}
.personalList {
- border-bottom: 15rpx solid #eee;
+ border-bottom: 15rpx solid #eee;
}
.personalList .footer {
- height: 90rpx;
- line-height: 90rpx;
- border-top: 2rpx dashed #d0d0d0;
- padding-left: 30rpx;
- padding-right: 30rpx;
- margin-top: 40rpx;
- align-items: center;
+ height: 90rpx;
+ line-height: 90rpx;
+ border-top: 2rpx dashed #d0d0d0;
+ padding-left: 30rpx;
+ padding-right: 30rpx;
+ margin-top: 40rpx;
+ align-items: center;
}
.personalList .submit-form {
- padding-left: 0;
- padding-right: 0;
- padding-bottom: 0;
- padding-top: 38rpx;
+ padding-left: 0;
+ padding-right: 0;
+ padding-bottom: 0;
+ padding-top: 38rpx;
}
.personalList .personalList-top {
- padding: 0 30rpx;
+ padding: 0 30rpx;
}
.personalList .personalList-avatar {
- width: 34rpx;
- height: 34rpx;
- border-radius: 50rpx;
+ width: 34rpx;
+ height: 34rpx;
+ border-radius: 50rpx;
}
.personalList .l {
- display: flex;
- align-items: center;
- height: 90rpx;
- line-height: 90rpx;
+ display: flex;
+ align-items: center;
+ height: 90rpx;
+ line-height: 90rpx;
}
.personalList .personalList-name {
- font-size: 28rpx;
- padding: 0 24rpx 0 20rpx;
+ font-size: 28rpx;
+ padding: 0 24rpx 0 20rpx;
}
-
-.personalList .authentication-icon {
- width: 125rpx;
- height: 34rpx;
- }
-
.personalList .agent {
- color: #343434;
- background-color: #fff;
- border: 2rpx solid #d3d3d3;
- display: flex;
- align-content: center;
+ color: #343434;
+ background-color: #fff;
+ border: 2rpx solid #d3d3d3;
+ display: flex;
+ align-content: center;
}
.personalList .footer-right {
- height: 36rpx;
- line-height: 36rpx;
- display: flex;
- align-items: center;
- padding: 0 18rpx;
- border-radius: 8rpx;
- background-color: #e8f4ff;
- color: #5eb1ff;
+ height: 36rpx;
+ line-height: 36rpx;
+ display: flex;
+ align-items: center;
+ padding: 0 18rpx;
+ border-radius: 8rpx;
+ background-color: #e8f4ff;
+ color: #5eb1ff;
}
.personalList .housingInfo {
- display: flex;
- align-items: center;
- justify-content: space-between;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
}
.personalList .housingSite {
- flex: 1;
+ flex: 1;
}
.personalList .housingMedia {
- width: 200rpx;
- height: 150rpx;
- margin-left: 10rpx;
- position: relative;
+ width: 200rpx;
+ height: 150rpx;
+ margin-left: 10rpx;
+ position: relative;
}
.personalList .housingMedia image {
- width: 200rpx;
- height: 150rpx;
- border-radius: 15rpx;
+ width: 200rpx;
+ height: 150rpx;
+ border-radius: 15rpx;
}
.personalList .orientation {
- width: 35rpx;
- height: 35rpx;
- margin-right: 10rpx;
+ width: 35rpx;
+ height: 35rpx;
+ margin-right: 10rpx;
}
.personalList .tips .i:not(:last-child):after {
- background-color: #555555;
+ background-color: #555555;
}
.personalList .title {
- font-weight: bold;
- line-height: 38rpx;
+ font-weight: bold;
+ line-height: 38rpx;
}
.personalList .housingVideo {
- width: 200rpx;
- height: 150rpx;
- margin-left: 10rpx;
- border-radius: 15rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- overflow: hidden;
+ width: 200rpx;
+ height: 150rpx;
+ margin-left: 10rpx;
+ border-radius: 15rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ overflow: hidden;
}
.personalList .housingVideo .playBtn-bj {
- position: absolute;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 200rpx;
- height: 150rpx;
- background: rgba(0, 0, 0, 0.5);
+ position: absolute;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 200rpx;
+ height: 150rpx;
+ background: rgba(0, 0, 0, 0.5);
}
.personalList .housingVideo .playBtn {
- width: 46rpx;
- height: 46rpx;
- border-radius: 50rpx;
+ width: 46rpx;
+ height: 46rpx;
+ border-radius: 50rpx;
+}
+
+.search-initial {
+ background-color: #fff;
+ min-height: 100vh;
}
\ No newline at end of file
diff --git a/template/commonList/commonList.wxml b/template/commonList/commonList.wxml
index 99a6bcd..9cf5b1d 100644
--- a/template/commonList/commonList.wxml
+++ b/template/commonList/commonList.wxml
@@ -12,7 +12,7 @@
- 合租
+ {{ item }}
diff --git a/template/headSwiper/headSwiper.js b/template/headSwiper/headSwiper.js
index f9cc7a6..a073da5 100644
--- a/template/headSwiper/headSwiper.js
+++ b/template/headSwiper/headSwiper.js
@@ -1,303 +1,302 @@
// template/headSwiper/headSwiper.js
var app = getApp()
Component({
- /**
- * 组件的属性列表
- */
- properties: {
- attachment: Array,
- isInner: Number,
- pages: String
- },
- observers: {
- attachment(e) {
- this.setHeightArr();
- this.calculateimgLength();
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- swiperHeight: 0,
- isIndexPage: true,
- indicatorDots: true,
- autoplay: false,
- interval: 3000,
- duration: 500,
- circular: true,
- current: 0,
- swiperCurrent: 0,
- windowWidth: 0,
- imgUrl: [],
- heightArr: [],
- tab: 'live', // live video img
- liveLength: 0,
- videoLength: 0,
- imgLength: 0,
- imgIndex: 0,
- videoIndex: 0,
- liveIndex: 0,
- video: '',
- screen_data: {}
-
- },
- lifetimes: {
- attached: function () {
- this.attachedIn()
- // this.setHeightArr()
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ attachment: Array,
+ isInner: Number,
+ pages: String
},
- },
- attached: function () {
- this.attachedIn()
- },
- /**
- * 组件的方法列表
- */
- methods: {
- attachedIn() {
- let that = this;
- wx.getSystemInfo({
- success: function (res) {
- that.setData({
- windowWidth: res.windowWidth,
- screen_data: app.globalData.screen_data,
- })
+ observers: {
+ attachment(e) {
+ this.setHeightArr();
+ this.calculateimgLength();
}
- })
},
- setHeightArr() {
- this.setData({
- heightArr: Array.from({
- length: this.properties.attachment.length
- }, item => {
- return 120
- })
- })
- },
-
- previewImg(e) {
- let that = this;
- let url = e.currentTarget.dataset.url;
- let appid = e.currentTarget.dataset.appid;
- let finderusername = e.currentTarget.dataset.finderusername;
- let feedid = e.currentTarget.dataset.feedid;
- let type = e.currentTarget.dataset.type;
-
-
- // 跳转视频号
- if (type == 5) {
- wx.openChannelsActivity({
- finderUserName: finderusername,
- feedId: feedid
- })
- return false
- }
-
- // 跳转直播
- if (type == 4) {
- wx.openChannelsLive({
- finderUserName: finderusername
- })
- return false
- }
-
- // 判断跳转小程序
- 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;
- }
-
- if (this.properties.pages == 'apartmentDetail') {
- wx.setStorageSync('attachment', this.properties.attachment)
- wx.navigateTo({
- url: `/pages/video_show/video_show?frompage=apartment¤t=${this.data.current}`
- });
- return false
- }
-
- if (this.data.imgUrl.length == 0) {
- let imgUrl = [];
- that.properties.attachment.map(item => {
- imgUrl.push(item.image)
- })
- that.setData({
- imgUrl: imgUrl
- })
- }
- wx.previewImage({
- current: that.data.imgUrl[that.data.current], // 当前显示图片的http链接
- urls: that.data.imgUrl // 需要预览的图片http链接列表
- })
- },
- load(e) {
- if (this.data.swiperHeight > 0) {
- return false
- }
- let index = e.currentTarget.dataset.index;
- this.setData({
- swiperHeight: this.data.windowWidth * e.detail.height / e.detail.width
- })
- return false;
- this.data.heightArr[index] = this.data.windowWidth * e.detail.height / e.detail.width
- this.setData({
- heightArr: this.data.heightArr
- })
- // console.log(this.data.heightArr)
- },
- send_form_id: function (e) {
- let {
- statid,
- url,
- type
- } = e.currentTarget.dataset;
- this.previewImg(e)
- // return false;
- wx.request({
- url: app.globalData.config.FormidInsert,
- data: {
- session: wx.getStorageSync('session'),
- formid: e.detail.formId,
- statid
- },
- method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
- header: app.globalData.header,
- success: function (res) {
- var data = app.return_data(res);
- }
- })
- },
- // 切换图片或视频
- changeTab(e) {
- let tab = e.currentTarget.dataset.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,
- current: tab == 'img' ? this.data.videoLength : 0,
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ swiperHeight: 0,
+ isIndexPage: true,
+ indicatorDots: true,
+ autoplay: false,
+ interval: 3000,
+ duration: 500,
+ circular: true,
+ current: 0,
+ swiperCurrent: 0,
+ windowWidth: 0,
+ imgUrl: [],
+ heightArr: [],
+ tab: 'live', // live video img
+ liveLength: 0,
+ videoLength: 0,
+ imgLength: 0,
imgIndex: 0,
videoIndex: 0,
- tab
- })
- },
- // 计算视频个数
- calculateimgLength() {
- let that = this;
- this.data.attachment.forEach(item => {
- 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 + 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
- })
- }
+ liveIndex: 0,
+ video: '',
+ screen_data: {}
},
- bindchangeSwiper(e) {
- let current = e.detail.current;
- let videoLength = this.data.videoLength
- let liveLength = this.data.liveLength
+ lifetimes: {
+ attached: function () {
+ this.attachedIn()
+ // this.setHeightArr()
+ },
+ },
+ attached: function () {
+ this.attachedIn()
+ },
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ attachedIn() {
+ let that = this;
+ wx.getSystemInfo({
+ success: function (res) {
+ that.setData({
+ windowWidth: res.windowWidth,
+ screen_data: app.globalData.screen_data,
+ })
+ }
+ })
+ },
+ setHeightArr() {
+ this.setData({
+ heightArr: Array.from({
+ length: this.properties.attachment.length
+ }, item => {
+ return 120
+ })
+ })
+ },
- let tab = "img"
- if (current >= liveLength + videoLength) tab = "img"
- else if (current >= liveLength) tab = "video"
- else tab = "live"
+ previewImg(e) {
+ let that = this;
+ let url = e.currentTarget.dataset.url;
+ let appid = e.currentTarget.dataset.appid;
+ let finderusername = e.currentTarget.dataset.finderusername;
+ let feedid = e.currentTarget.dataset.feedid;
+ let type = e.currentTarget.dataset.type;
- this.setData({
- tab,
- current,
- })
+ // 跳转视频号
+ if (type == 5) {
+ wx.openChannelsActivity({
+ finderUserName: finderusername,
+ feedId: feedid
+ })
+ return false
+ }
+
+ // 跳转直播
+ if (type == 4) {
+ wx.openChannelsLive({
+ finderUserName: finderusername
+ })
+ return false
+ }
+
+ // 判断跳转小程序
+ 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;
+ }
+
+ if (this.properties.pages == 'apartmentDetail') {
+ wx.setStorageSync('attachment', this.properties.attachment)
+ wx.navigateTo({
+ url: `/pages/video_show/video_show?frompage=apartment¤t=${this.data.current}`
+ });
+ return false
+ }
+
+ if (this.data.imgUrl.length == 0) {
+ let imgUrl = [];
+ that.properties.attachment.map(item => {
+ imgUrl.push(item.image)
+ })
+ that.setData({
+ imgUrl: imgUrl
+ })
+ }
+ wx.previewImage({
+ current: that.data.imgUrl[that.data.current], // 当前显示图片的http链接
+ urls: that.data.imgUrl // 需要预览的图片http链接列表
+ })
+ },
+ load(e) {
+ if (this.data.swiperHeight > 0) return false
+ let index = e.currentTarget.dataset.index;
+ let swiperHeight = this.data.windowWidth * e.detail.height / e.detail.width
+ this.setData({
+ swiperHeight
+ })
+ this.triggerEvent("recordSwiperHeight", swiperHeight)
+
+ return false;
+ this.data.heightArr[index] = this.data.windowWidth * e.detail.height / e.detail.width
+ this.setData({
+ heightArr: this.data.heightArr
+ })
+ // console.log(this.data.heightArr)
+ },
+ send_form_id: function (e) {
+ let {
+ statid,
+ url,
+ type
+ } = e.currentTarget.dataset;
+ this.previewImg(e)
+ wx.request({
+ url: app.globalData.config.FormidInsert,
+ data: {
+ session: wx.getStorageSync('session'),
+ formid: e.detail.formId,
+ statid
+ },
+ method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
+ header: app.globalData.header,
+ success: function (res) {
+ var data = app.return_data(res);
+ }
+ })
+ },
+ // 切换图片或视频
+ changeTab(e) {
+ let tab = e.currentTarget.dataset.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,
+ current: tab == 'img' ? this.data.videoLength : 0,
+ imgIndex: 0,
+ videoIndex: 0,
+ tab
+ })
+ },
+ // 计算视频个数
+ calculateimgLength() {
+ let that = this;
+ this.data.attachment.forEach(item => {
+ 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 + 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
+ })
+ }
+
+ },
+ bindchangeSwiper(e) {
+ 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
- if (current <= this.data.liveLength - 1) {
- console.log("ffff");
- } else if (e.detail.current >= this.data.videoLength) {
- // 显示视频
- if (this.data.tab == 'video') {
- this.setData({
- tab: 'img',
- imgIndex: 0,
- })
- } else {
- this.setData({
- imgIndex: current - this.data.videoLength
- })
+ 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({
+ tab: 'img',
+ imgIndex: 0,
+ })
+ } else {
+ this.setData({
+ imgIndex: current - this.data.videoLength
+ })
+ }
+ } else {
+ // 显示图片
+ if (this.data.tab == 'img') {
+ this.setData({
+ tab: 'video',
+ videoIndex: 0,
+
+ })
+ } else {
+ this.setData({
+ videoIndex: current
+ })
+ }
+ }
+ this.setData({
+ current: e.detail.current,
+ })
+ },
+ play(e) {
+ // this.setData({
+ // video:e.currentTarget.dataset.video
+ // })
+ wx.navigateTo({
+ url: '/pages/video_show/video_show?src=' + e.currentTarget.dataset.video,
+ })
+ },
+ closePage() {
+ this.setData({
+ video: ''
+ })
+ this.triggerEvent('close', {})
}
- } else {
- // 显示图片
- if (this.data.tab == 'img') {
- this.setData({
- tab: 'video',
- videoIndex: 0,
-
- })
- } else {
- this.setData({
- videoIndex: current
- })
- }
- }
- this.setData({
- current: e.detail.current,
- })
- },
- play(e) {
- // this.setData({
- // video:e.currentTarget.dataset.video
- // })
- wx.navigateTo({
- url: '/pages/video_show/video_show?src=' + e.currentTarget.dataset.video,
- })
- },
- closePage() {
- this.setData({
- video: ''
- })
- this.triggerEvent('close', {})
}
- }
})
\ No newline at end of file
diff --git a/template/listOperations/listOperations.wxml b/template/listOperations/listOperations.wxml
index cf5f96c..0e1efdb 100644
--- a/template/listOperations/listOperations.wxml
+++ b/template/listOperations/listOperations.wxml
@@ -29,7 +29,7 @@
-
+
{{ item.name }}
diff --git a/template/rangeBox/rangeBox.wxml b/template/rangeBox/rangeBox.wxml
index 6fc6dd7..e45a288 100644
--- a/template/rangeBox/rangeBox.wxml
+++ b/template/rangeBox/rangeBox.wxml
@@ -1,7 +1,6 @@
-
diff --git a/template/rangeBox/rangeBox.wxss b/template/rangeBox/rangeBox.wxss
index 29dd943..fa845ec 100644
--- a/template/rangeBox/rangeBox.wxss
+++ b/template/rangeBox/rangeBox.wxss
@@ -97,7 +97,7 @@
margin: 0 30rpx;
}
-input{
+.alert input{
display: inline-flex;
justify-content: center;
border-radius: 10rpx;
diff --git a/template/xinHeadSwiper/xinHeadSwiper.js b/template/xinHeadSwiper/xinHeadSwiper.js
new file mode 100644
index 0000000..aecf6fd
--- /dev/null
+++ b/template/xinHeadSwiper/xinHeadSwiper.js
@@ -0,0 +1,104 @@
+// template/xinHeadSwiper/xinHeadSwiper.js
+let app = getApp()
+var miucms = require('../../utils/miucms.js');
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ data: Array,
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ swiperCurrent: 0
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ // 轮播图的加载事件
+ loadHeadSwiper(e) {
+ let ratio = app.globalData.screen_data['windowWidth'] / 750
+ let originalWidth = e.detail.width;
+ let originalHeight = e.detail.height;
+ let height = originalHeight / originalWidth * 690 * ratio
+ if (height > this.data.HeadSwiperHeight) {
+ this.setData({
+ HeadSwiperHeight: height
+ })
+ }
+ },
+ // 新 轮播图 自动滑动事件,修改下标
+ bindchangeSwiper(e) {
+ let current = e.detail.current
+ this.setData({
+ swiperCurrent: current
+ })
+ },
+
+ // 新 轮播图 点击事件
+ handleSwiper(e) {
+ let {
+ appid,
+ url,
+ statid,
+ finderusername,
+ feedid,
+ type,
+ advertisingtype,
+ advtype,
+ } = e.currentTarget.dataset
+
+ let requestUrl = app.globalData.config.FormidInsert
+ miucms.request(requestUrl, {
+ statid
+ }).then(res => {})
+
+ // 跳转视频号
+ if ((type == 5) || (type == 'adv' && advtype == "videofeed_5")) {
+ wx.openChannelsActivity({
+ finderUserName: finderusername,
+ feedId: feedid
+ })
+ return false
+ }
+
+ // 跳转直播
+ if ((type == 4) || (type == 'adv' && advtype == "videofeed_4")) {
+ wx.openChannelsLive({
+ finderUserName: finderusername
+ })
+ return false
+ }
+
+ // 判断跳转小程序
+ 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;
+ }
+ },
+ }
+})
\ No newline at end of file
diff --git a/template/xinHeadSwiper/xinHeadSwiper.json b/template/xinHeadSwiper/xinHeadSwiper.json
new file mode 100644
index 0000000..7e37c03
--- /dev/null
+++ b/template/xinHeadSwiper/xinHeadSwiper.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/template/xinHeadSwiper/xinHeadSwiper.wxml b/template/xinHeadSwiper/xinHeadSwiper.wxml
new file mode 100644
index 0000000..083cc57
--- /dev/null
+++ b/template/xinHeadSwiper/xinHeadSwiper.wxml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/template/xinHeadSwiper/xinHeadSwiper.wxss b/template/xinHeadSwiper/xinHeadSwiper.wxss
new file mode 100644
index 0000000..e25e9ca
--- /dev/null
+++ b/template/xinHeadSwiper/xinHeadSwiper.wxss
@@ -0,0 +1,47 @@
+/* template/xinHeadSwiper/xinHeadSwiper.wxss */
+
+@import '/app.wxss';
+.headSwiper-swiper {
+ position: relative;
+}
+
+.headSwiper {
+ width: 690rpx;
+ /* margin: 32rpx auto 30rpx; */
+ margin: 0 auto;
+ position: relative;
+ border-radius: 20rpx;
+}
+
+.headSwiper .headSwiper-img {
+ width: 690rpx;
+ height: 292.5rpx;
+ border-radius: 20rpx;
+}
+
+.headSwiper .indication-point {
+ position: absolute;
+ bottom: 20rpx;
+ 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;
+}
\ No newline at end of file