Commit 6b873133 by 严立

LL - toast,dialog组件替换完成。

parent 976728d8
import mui from './component/m-init.js' import mui from './component/m-init.js'
import iBase64 from './npm/base64.js' import iBase64 from './npm/base64.js'
import iMiment from './npm/miment.js' import iMiment from './npm/miment.js'
import iUtils from './utils/utils.js' import iUtils from './utils/utils.js'
import iRule from './utils/rule/rule.js' import iRule from './utils/rule/rule.js'
import iRequest from './utils/request/corvus.js'
import iEnvironmental from './environmental.js' import iEnvironmental from './environmental.js'
App({ App({
...@@ -56,9 +56,6 @@ App({ ...@@ -56,9 +56,6 @@ App({
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
this.globalData.appStatus = Boolean(Number(funcResponse[0].value)) this.globalData.appStatus = Boolean(Number(funcResponse[0].value))
// 测试数据
this.globalData.appStatus = true
console.log(this.globalData.appStatus)
} }
}) })
}, },
...@@ -416,16 +413,25 @@ App({ ...@@ -416,16 +413,25 @@ App({
}, },
// s3 新增函数 // s3 新增函数
pageScroll: function (funcEvent, funcPage) { request: function (funcOption) {
// 优化滚动事件触发频率 return iRequest(funcOption)
let funcNow = new Date().getTime() },
if (funcNow - this.scrollTimestamp < 40) return
this.scrollTimestamp = funcNow
pageScroll: function (funcEvent, funcPage) {
// 滚动触发函数
function execute () {
funcPage.setData({ funcPage.setData({
navScroll: funcEvent.scrollTop navScroll: funcEvent.scrollTop
}) })
if (funcPage.eventPageScroll) funcPage.eventPageScroll(funcEvent) if (funcPage.eventPageScroll) funcPage.eventPageScroll(funcEvent)
}
// 优化滚动事件触发频率,funcFrequency 毫秒内只会触发一次。
let funcFrequency = 25
clearTimeout(this.scrollTimestamp)
this.scrollTimestamp = setTimeout(() => {
execute()
clearTimeout(this.scrollTimestamp)
}, funcFrequency)
}, },
}) })
\ No newline at end of file
...@@ -24,7 +24,6 @@ Component({ ...@@ -24,7 +24,6 @@ Component({
value: '' value: ''
}, },
// 样式索引,如果不想使用变换效果,传值 -1 即可。
styleIndex: { styleIndex: {
type: Number, type: Number,
value: 0 value: 0
...@@ -40,7 +39,7 @@ Component({ ...@@ -40,7 +39,7 @@ Component({
// 滚动达到多少时进行样式替换。 // 滚动达到多少时进行样式替换。
changeHeight: { changeHeight: {
type: String, type: String,
value: '50rpx' value: '100rpx'
}, },
iconBack: { iconBack: {
...@@ -98,12 +97,20 @@ Component({ ...@@ -98,12 +97,20 @@ Component({
}, },
}, },
pageLifetimes: {
show: function () {
this.computeNavHeight()
},
},
// 属性监听 // 属性监听
observers: { observers: {
'scrollHeight': function (funcValue) { 'scrollHeight': function (funcValue) {
if (this.data.styleIndex === -1) return
this.eventScroll(funcValue) this.eventScroll(funcValue)
}, },
'styleIndex': function(funcValue) {
this.setNavStyle(funcValue)
},
}, },
// 自定方法 // 自定方法
...@@ -279,6 +286,35 @@ Component({ ...@@ -279,6 +286,35 @@ Component({
}, },
/** /**
* 计算当前页面导航栏高度
* @function
* @param
* @returns
*/
computeNavHeight: function () {
// 导航栏没有 logo 的场景,使用系统高度。
if (this.data.currentStyle.logo === '') {
wx.setStorageSync('navHeight', this.data.currentStyle.statusHeight + this.data.currentStyle.titleHeight)
return
}
// 导航栏拥有 logo 的场景,需要判断 logo 是否超出原有导航栏高度。
let funcLogoFillTop = 0
let funcLogoFillHeight = 0
let funcRegExp = this.data.logoFillCss.match(/(?<=top: )[0-9.]+/g)
if (funcRegExp) funcLogoFillTop = Number(funcRegExp[0])
funcRegExp = this.data.logoFillCss.match(/(?<=height: )[0-9.]+/g)
if (funcRegExp) funcLogoFillHeight = Number(funcRegExp[0])
if (funcLogoFillTop === 0) {
wx.setStorageSync('navHeight', this.data.currentStyle.statusHeight + this.data.currentStyle.titleHeight)
} else {
wx.setStorageSync('navHeight', funcLogoFillTop + funcLogoFillHeight)
}
},
/**
* 返回按钮事件 * 返回按钮事件
* @function * @function
* @param * @param
...@@ -289,7 +325,6 @@ Component({ ...@@ -289,7 +325,6 @@ Component({
let funcPageLength = getCurrentPages().length let funcPageLength = getCurrentPages().length
if (funcPageLength > 1) wx.navigateBack({ delta: 1 }) if (funcPageLength > 1) wx.navigateBack({ delta: 1 })
this.triggerEvent('navBack', { back: 1 }) this.triggerEvent('navBack', { back: 1 })
console.log('onBack')
}, },
/** /**
......
<m-nav titleText="动态详情" scrollHeight="{{navScroll}}" changeHeight="10rpx"></m-nav> <m-nav titleText="动态详情" styleIndex="{{1}}"></m-nav>
<view class="container"> <view class="container">
<view class="title row con-s"> <view class="title row con-s">
......
import iPoint from './js/point.js' import iPoint from './js/point.js'
let App = getApp() let App = getApp()
let logicData = { let logicData = {
option: {} option: {}
} }
...@@ -14,6 +12,7 @@ Page({ ...@@ -14,6 +12,7 @@ Page({
mapCss: '', mapCss: '',
arrowCss: '', arrowCss: '',
cssPoint: 'font-size: ' + 24 * wx.getStorageSync('unitProportion') + 'px;',
pointDetail: './image/card/01.png', pointDetail: './image/card/01.png',
winPointDetail: false, winPointDetail: false,
pointInfo: iPoint, pointInfo: iPoint,
......
...@@ -16,12 +16,16 @@ ...@@ -16,12 +16,16 @@
<!-- 默认样式 --> <!-- 默认样式 -->
<image class="point-info-arrow" src="./image/icon/point-arrow-inactive.png" style="{{arrowCss}}" hidden="{{item.isActive}}"></image> <image class="point-info-arrow" src="./image/icon/point-arrow-inactive.png" style="{{arrowCss}}" hidden="{{item.isActive}}"></image>
<image class="icon-inactive" src="{{item.icon}}" style="{{pointIconCss}}" hidden="{{item.isActive}}"></image> <image class="icon-inactive" src="{{item.icon}}" style="{{pointIconCss}}" hidden="{{item.isActive}}"></image>
<button class="button-inactive" hidden="{{item.isActive}}">{{item.name}}</button> <button class="button-inactive row ac" hidden="{{item.isActive}}">
<text style="{{cssPoint}}">{{item.name}}</text>
</button>
<!-- 选择样式 --> <!-- 选择样式 -->
<image class="point-info-arrow" src="./image/icon/point-arrow-active.png" style="{{arrowCss}}" hidden="{{!item.isActive}}"></image> <image class="point-info-arrow" src="./image/icon/point-arrow-active.png" style="{{arrowCss}}" hidden="{{!item.isActive}}"></image>
<image class="icon-active" src="{{item.icon}}" style="{{pointIconCss}}" hidden="{{!item.isActive}}"></image> <image class="icon-active" src="{{item.icon}}" style="{{pointIconCss}}" hidden="{{!item.isActive}}"></image>
<button class="button-active" hidden="{{!item.isActive}}">{{item.name}}</button> <button class="button-active row ac" hidden="{{!item.isActive}}">
<text style="{{cssPoint}}">{{item.name}}</text>
</button>
</view> </view>
</block> </block>
</view> </view>
......
...@@ -50,13 +50,15 @@ ...@@ -50,13 +50,15 @@
color: #000000; color: #000000;
} }
.point-info {
overflow: hidden;
}
.point-info button { .point-info button {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 10px;
} }
/* 景点详情卡片 */ /* 景点详情卡片 */
......
<m-nav scrollHeight="{{navScroll}}" changeHeight="650rpx" styleIndex="{{4}}" isOccupy="{{false}}"></m-nav> <m-nav scrollHeight="{{navScroll}}" changeHeight="650rpx" styleIndex="{{4}}" isOccupy="{{false}}"></m-nav>
<view class="container"> <view class="container">
<view id="banner" class="banner"> <view class="banner">
<swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="onSwiperChange"> <swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="eventSwiperChange">
<block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item class="banner-swiper-item" data-item="{{item}}" bindtap="bannerClick"> <swiper-item class="banner-swiper-item" data-item="{{item}}" bindtap="onBanner">
<image class="banner-swiper-image" src="{{item.img}}"></image> <image class="banner-swiper-image" src="{{item.cover}}"></image>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
...@@ -17,37 +17,40 @@ ...@@ -17,37 +17,40 @@
<view class="banner-wave"> <view class="banner-wave">
<image src="/image/ornament-0.png" mode="widthFix"></image> <image src="/image/ornament-0.png" mode="widthFix"></image>
</view> </view>
<view class="banner-notice login-notice row align-c" bindtap="onLogin" wx:if="{{!isLogin}}">
<view class="row align-c">
<image src="/image/wechat.png"></image>
<image src="./image/login.png"></image>
</view> </view>
<view class="row con-b align-c">
<view class="notice-bar row con-e" bind:tap="noticClick"> <view class="location-container">
<text>消费积分 业主特权</text> <!-- 微信登录 -->
<view class="sign-in row ac" bindtap="onSignIn" wx:if="{{!isLogin}}">
<view class="row ac">
<image class="sign-in-icon" src="/image/wechat.png"></image>
<image class="sign-in-title" src="./image/login.png"></image>
</view> </view>
<image class="banner-image" src="{{imageBase + 'more-g.png'}}" bindtap="onNotice"></image> <view class="row cb ac">
<text class="sign-in-content">消费积分 业主特权</text>
<image class="arrow-more" src="{{imageBase + 'more-g.png'}}"></image>
</view> </view>
</view> </view>
<!-- 最新动态 -->
<view class="notice row ac"> <view class="notice row ac">
<view class="row ac" bindtap="onNotice"> <view class="row ac">
<image class="notice-icon" src="./image/inform.png"></image> <image class="notice-icon" src="./image/inform.png"></image>
<image class="notice-title" src="./image/title-news.png"></image> <image class="notice-title" src="./image/title-news.png"></image>
</view> </view>
<view class="row cb ac"> <view class="row cb ac">
<swiper vertical="{{true}}"> <swiper vertical="{{true}}">
<swiper-item class="row ac" wx:for="{{noticeTitles}}" wx:for-item="item" wx:for-index="index" wx:key="index"> <block wx:for="{{notice}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<text data-item="{{item}}" bindtap="onNoticeDetail">{{item}}</text> <swiper-item class="row ac">
<text data-item="{{item}}" bindtap="onNoticeDetail">{{item.title}}</text>
</swiper-item> </swiper-item>
</block>
</swiper> </swiper>
<image class="arrow-more" src="{{imageBase + 'more-g.png'}}" bindtap="onNotice"></image> <image class="arrow-more" src="{{imageBase + 'more-g.png'}}" bindtap="onNoticeList"></image>
</view>
</view> </view>
</view> </view>
<view class="detail {{!isLogin ? 'login-detail' : ''}}"> <view class="detail">
<!-- 预约公告 --> <!-- 预约公告 -->
<view class="night row con-b" bindtap="onAppointmentInto"> <view class="night row con-b" bindtap="onAppointmentInto">
<image src="{{resourcesBase + 'home/into.png'}}" mode="aspectFit"></image> <image src="{{resourcesBase + 'home/into.png'}}" mode="aspectFit"></image>
...@@ -78,9 +81,10 @@ ...@@ -78,9 +81,10 @@
</view> </view>
</view> </view>
<view class="footer"> <view class="history">
<block wx:for="{{footerImage}}" wx:key="brandId"> <block wx:for="{{history}}" wx:key="brandId">
<image src="{{item.cover}}" bindtap="onToHistory" data-index="{{index}}"></image> <image src="{{item.cover}}" bindtap="onToHistory" data-index="{{index}}"></image>
</block> </block>
</view> </view>
</view>
</view> </view>
\ No newline at end of file
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
.banner { .banner {
z-index: 1;
position: relative; position: relative;
width: 750rpx; width: 750rpx;
height: 870rpx; height: 870rpx;
...@@ -51,16 +50,56 @@ ...@@ -51,16 +50,56 @@
height: 150rpx; height: 150rpx;
} }
/* 最新动态 */ /* 主页内容与 banner 元素重合 */
.notice { .location-container {
z-index: 3; z-index: 3;
position: relative; position: relative;
top: 620rpx; top: -90rpx;
left: 40rpx; margin-bottom: -90rpx;
}
/* 微信登录 */
.sign-in {
z-index: 3;
width: 670rpx; width: 670rpx;
height: 108rpx; height: 108rpx;
margin-bottom: 40rpx; margin: 0 40rpx 40rpx 40rpx;
padding: 0 32rpx;
box-shadow: 0px 16rpx 48rpx 0 rgba(0, 0, 0, .05);
border-radius: 4rpx;
background: #FFFFFF;
}
.sign-in-icon {
width: 40rpx;
height: 40rpx;
margin-right: 12rpx;
}
.sign-in-title {
width: 122rpx;
height: 30rpx;
margin-left: 2rpx;
}
.sign-in-content {
width: 382rpx;
height: 36rpx;
margin-right: 16rpx;
text-align: right;
font-size: 26rpx;
font-weight: 400;
line-height: 36rpx;
color: #8A8C8F;
}
/* 最新动态 */
.notice {
z-index: 3;
width: 670rpx;
height: 108rpx;
margin: 0 40rpx 40rpx 40rpx;
padding: 0 32rpx; padding: 0 32rpx;
box-shadow: 0px 16rpx 48rpx 0 rgba(0, 0, 0, .05); box-shadow: 0px 16rpx 48rpx 0 rgba(0, 0, 0, .05);
border-radius: 4rpx; border-radius: 4rpx;
...@@ -95,14 +134,9 @@ ...@@ -95,14 +134,9 @@
} }
.detail { .detail {
margin-top: 60rpx;
padding: 0 40rpx; padding: 0 40rpx;
} }
.login-detail {
margin-top: 208rpx;
}
.detail-item { .detail-item {
margin-top: 58rpx; margin-top: 58rpx;
} }
...@@ -309,16 +343,16 @@ ...@@ -309,16 +343,16 @@
background: #808080; background: #808080;
} }
.footer { .history {
margin-top: 88rpx; margin-top: 88rpx;
} }
.footer image { .history image {
display: block; display: block;
width: 750rpx; width: 750rpx;
height: 1148rpx; height: 1148rpx;
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
.footer image:last-child { .history image:last-child {
margin-bottom: 0rpx; margin-bottom: 0rpx;
} }
\ No newline at end of file
<m-toast></m-toast> <m-toast></m-toast>
<m-nav titleText="夜间入园预约" scrollHeight="{{navScroll}}" changeHeight="10rpx" styleIndex="{{2}}" isOccupy="{{false}}"></m-nav> <m-nav titleText="夜间入园预约" scrollHeight="{{navScroll}}" styleIndex="{{2}}" isOccupy="{{false}}"></m-nav>
<view class="appointment-complete row con-c align-c" wx:if="{{appointmentComplete}}"> <view class="appointment-complete row con-c align-c" wx:if="{{appointmentComplete}}">
<view class="appointment-complete-tip"> <view class="appointment-complete-tip">
......
let App = getApp() let App = getApp()
Page({ Page({
data: { data: {
appStatus: App.globalData.appStatus, appStatus: App.globalData.appStatus,
...@@ -290,6 +289,8 @@ Page({ ...@@ -290,6 +289,8 @@ Page({
setUserInfo: function () { setUserInfo: function () {
let funcUserInfo = wx.getStorageSync('userInfo') let funcUserInfo = wx.getStorageSync('userInfo')
console.log(funcUserInfo)
// 已为登录状态 // 已为登录状态
if (funcUserInfo.isSignIn) { if (funcUserInfo.isSignIn) {
funcUserInfo.phone = this.toHide(funcUserInfo.phone) funcUserInfo.phone = this.toHide(funcUserInfo.phone)
......
<m-nav wx:if="userInfo.userType === 0" titleText="我的" scrollHeight="{{navScroll}}" styleIndex="{{0}}" isOccupy="{{false}}" iconBack=""></m-nav> <m-nav titleText="我的" scrollHeight="{{navScroll}}" styleIndex="{{userInfo.userType === 0 ? 0 : 2}}" isOccupy="{{false}}" iconBack=""></m-nav>
<m-nav wx:if="userInfo.userType === 1" titleText="我的" scrollHeight="{{navScroll}}" styleIndex="{{2}}" isOccupy="{{false}}" iconBack=""></m-nav>
<view class="container con-s"> <view class="container con-s">
<view class="mine" wx:if="{{type !== 1}}"> <view class="mine" wx:if="{{type !== 1}}">
......
...@@ -5,7 +5,7 @@ Page({ ...@@ -5,7 +5,7 @@ Page({
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase, resourcesBase: App.globalData.appResourcesBase,
navScroll: 0,
option: {}, option: {},
// 弹出控制 // 弹出控制
...@@ -32,6 +32,8 @@ Page({ ...@@ -32,6 +32,8 @@ Page({
isBlack: false, isBlack: false,
cssTabContentTop: wx.getStorageSync('navHeight'),
sideHeight: 550, sideHeight: 550,
winSide: true, winSide: true,
...@@ -555,6 +557,12 @@ Page({ ...@@ -555,6 +557,12 @@ Page({
'isMore': false, 'isMore': false,
'isDetail': false, 'isDetail': false,
} }
// 没有评论也没有图片,使用默认文本。
if (funcItem.content === '' && funcItem.userAlbum.length === 0) {
funcItem.content = '此用户没有填写评价。'
}
funcItem.star = Math.floor((funcItem.scoreService + funcItem.scoreCommodity + funcItem.scoreEnvironmental) / 3) funcItem.star = Math.floor((funcItem.scoreService + funcItem.scoreCommodity + funcItem.scoreEnvironmental) / 3)
funcList.push(funcItem) funcList.push(funcItem)
} }
...@@ -566,7 +574,6 @@ Page({ ...@@ -566,7 +574,6 @@ Page({
const funcQuery = wx.createSelectorQuery() const funcQuery = wx.createSelectorQuery()
funcQuery.selectAll('.evaluate-item-content-mark').boundingClientRect() funcQuery.selectAll('.evaluate-item-content-mark').boundingClientRect()
funcQuery.exec((response) => { funcQuery.exec((response) => {
console.log(response)
let funcContentHeight = 88 * wx.getStorageSync('unitProportion') let funcContentHeight = 88 * wx.getStorageSync('unitProportion')
let funcEvaluate = this.data.detailEvaluate let funcEvaluate = this.data.detailEvaluate
...@@ -580,9 +587,6 @@ Page({ ...@@ -580,9 +587,6 @@ Page({
this.setData({ this.setData({
detailEvaluate: funcEvaluate detailEvaluate: funcEvaluate
}) })
console.log('funcEvaluate')
console.log(funcEvaluate)
}) })
} }
}) })
...@@ -717,7 +721,8 @@ Page({ ...@@ -717,7 +721,8 @@ Page({
* @param {object} - funcEvent * @param {object} - funcEvent
* @returns * @returns
*/ */
setSideButton: function(funcEvent) { eventPageScroll: function(funcEvent) {
// 右侧返回顶部按钮控制
if (funcEvent.scrollTop >= this.data.sideHeight) { if (funcEvent.scrollTop >= this.data.sideHeight) {
if (this.data.winSide) { if (this.data.winSide) {
this.setData({ this.setData({
......
...@@ -166,11 +166,11 @@ ...@@ -166,11 +166,11 @@
</view> </view>
<!-- 简介,评价 --> <!-- 简介,评价 -->
<view class="selection-content row"> <view class="tab-content row" style="{{ 'top: ' + cssTabContentTop + 'px;'}}">
<view class="row align-c {{contentType === 'detail' ? 'selection-content-item-active' : 'selection-content-item'}}" data-type="detail" bindtap="onSelectionContent"> <view class="tab-content-item row align-c {{contentType === 'detail' ? 'tab-content-active' : ''}}" data-type="detail" bindtap="onSelectionContent">
<text>简介</text> <text>简介</text>
</view> </view>
<view class="row align-c {{contentType === 'evaluate' ? 'selection-content-item-active' : 'selection-content-item'}}" data-type="evaluate" bindtap="onSelectionContent"> <view class="tab-content-item row align-c {{contentType === 'evaluate' ? 'tab-content-active' : ''}}" data-type="evaluate" bindtap="onSelectionContent">
<text>评价</text> <text>评价</text>
</view> </view>
</view> </view>
...@@ -224,24 +224,16 @@ ...@@ -224,24 +224,16 @@
</view> </view>
</view> </view>
<!-- 评论隐藏样式 --> <!-- 评论 -->
<view class="evaluate-item-content" wx:if="{{!item.isDetail}}"> <view class="{{!item.isDetail ? 'evaluate-item-content' : 'evaluate-item-content-whole'}}" hidden="{{!item.content}}">
<view>
<text class="evaluate-item-content-mark">{{item.content}}</text> <text class="evaluate-item-content-mark">{{item.content}}</text>
</view> </view>
<view wx:if="{{item.isMore}}" class="evaluate-item-content-more row con-e align-e" data-item="{{item}}" data-index="{{index}}" bindtap="onEvaluateMore">
<text>全文</text>
</view>
</view>
<!-- 评论展开样式 --> <view wx:if="{{!item.isDetail && item.isMore && item.content}}" class="evaluate-item-content-more row ac" data-item="{{item}}" data-index="{{index}}" bindtap="onEvaluateMore">
<view class="evaluate-item-content-whole" wx:if="{{item.isDetail}}"> <text>全文</text>
<view>
<text>{{item.content}}</text>
</view>
</view> </view>
<view class="evaluate-item-album"> <view class="evaluate-item-album" wx:if="{{item.userAlbum.length}}">
<block wx:for="{{item.userAlbum}}" wx:for-index="indexAlbum" wx:for-item="itemAlbum" wx:key="indexAlbum"> <block wx:for="{{item.userAlbum}}" wx:for-index="indexAlbum" wx:for-item="itemAlbum" wx:key="indexAlbum">
<image wx:if="{{indexAlbum < 4}}" src="{{itemAlbum}}" data-index="{{indexAlbum}}" data-item="{{item}}" bindtap="onEvaluateAlbum"></image> <image wx:if="{{indexAlbum < 4}}" src="{{itemAlbum}}" data-index="{{indexAlbum}}" data-item="{{item}}" bindtap="onEvaluateAlbum"></image>
</block> </block>
...@@ -373,16 +365,12 @@ ...@@ -373,16 +365,12 @@
</view> </view>
</view> </view>
<!-- <view class="movie-footer">
<image src="/image/movie-bottom.png"></image>
</view> -->
<!-- 简介,评价 --> <!-- 简介,评价 -->
<view class="selection-content movie-border row"> <view class="tab-content movie-border row">
<view class="row align-c {{contentType === 'detail' ? 'selection-content-item-active-movie' : 'selection-content-item'}}" data-type="detail" bindtap="onSelectionContent"> <view class="tab-content-item row align-c {{contentType === 'detail' ? 'tab-content-active-movie' : ''}}" data-type="detail" bindtap="onSelectionContent">
<text>简介</text> <text>简介</text>
</view> </view>
<view class="row align-c {{contentType === 'evaluate' ? 'selection-content-item-active-movie' : 'selection-content-item'}}" data-type="evaluate" bindtap="onSelectionContent"> <view class="tab-content-item row align-c {{contentType === 'evaluate' ? 'tab-content-active-movie' : ''}}" data-type="evaluate" bindtap="onSelectionContent">
<text>评价</text> <text>评价</text>
</view> </view>
</view> </view>
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
} }
.banner { .banner {
z-index: 1;
position: relative; position: relative;
width: 750rpx; width: 750rpx;
height: 800rpx; height: 800rpx;
...@@ -26,7 +25,7 @@ ...@@ -26,7 +25,7 @@
} }
.banner-wave { .banner-wave {
z-index: 2; z-index: 1;
position: relative; position: relative;
top: 740rpx; top: 740rpx;
left: 0; left: 0;
...@@ -68,8 +67,8 @@ ...@@ -68,8 +67,8 @@
} }
/* 立即报名 */ /* 立即报名 */
.operation { .operation {
z-index: 3;
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 0; bottom: 0;
...@@ -122,7 +121,6 @@ ...@@ -122,7 +121,6 @@
} }
/* 二期整理样式 */ /* 二期整理样式 */
.commodity-movie { .commodity-movie {
position: relative; position: relative;
} }
...@@ -164,7 +162,8 @@ ...@@ -164,7 +162,8 @@
} }
.movie-border { .movie-border {
border-bottom: 0.5px #3a3a40 solid !important; background: #1C1C25 !important;
border-bottom: 1px #3a3a40 solid !important;
} }
.commodity-other image { .commodity-other image {
...@@ -525,7 +524,7 @@ ...@@ -525,7 +524,7 @@
/* 分享弹窗 */ /* 分享弹窗 */
.container-share { .container-share {
z-index: 1; z-index: 7;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
...@@ -582,16 +581,20 @@ ...@@ -582,16 +581,20 @@
} }
/* 简介,评论 */ /* 简介,评论 */
.tab-content {
.selection-content { z-index: 2;
position: sticky;
top: 64px;
left: 0;
width: 750rpx; width: 750rpx;
height: 64rpx; height: 64rpx;
margin-top: 80rpx; margin-top: 80rpx;
padding: 0 40rpx; padding: 0 40rpx;
border-bottom: 0.5px #e2e7ef solid; border-bottom: 0.5px #e2e7ef solid;
background: #FFFFFF;
} }
.selection-content-item { .tab-content-item {
width: 60rpx; width: 60rpx;
height: 64rpx; height: 64rpx;
margin-right: 64rpx; margin-right: 64rpx;
...@@ -601,7 +604,7 @@ ...@@ -601,7 +604,7 @@
color: #656e7b; color: #656e7b;
} }
.selection-content-item-active { .tab-content-active {
width: 60rpx; width: 60rpx;
height: 64rpx; height: 64rpx;
margin-right: 64rpx; margin-right: 64rpx;
...@@ -612,7 +615,7 @@ ...@@ -612,7 +615,7 @@
color: #15191f; color: #15191f;
} }
.selection-content-item-active-movie { .tab-content-active-movie {
width: 60rpx; width: 60rpx;
height: 64rpx; height: 64rpx;
margin-right: 64rpx; margin-right: 64rpx;
...@@ -684,7 +687,7 @@ ...@@ -684,7 +687,7 @@
.evaluate-item { .evaluate-item {
position: relative; position: relative;
width: 670rpx; width: 670rpx;
min-height: 292rpx; min-height: 204rpx;
margin: 48rpx 40rpx 0 40rpx; margin: 48rpx 40rpx 0 40rpx;
border-bottom: 0.5px solid #e2e7ef; border-bottom: 0.5px solid #e2e7ef;
} }
...@@ -754,7 +757,6 @@ ...@@ -754,7 +757,6 @@
display: -webkit-box; display: -webkit-box;
position: relative; position: relative;
width: 670rpx; width: 670rpx;
min-height: 88rpx;
max-height: 132rpx; max-height: 132rpx;
margin-top: 32rpx; margin-top: 32rpx;
font-size: 26rpx; font-size: 26rpx;
...@@ -778,13 +780,8 @@ ...@@ -778,13 +780,8 @@
} }
.evaluate-item-content-more { .evaluate-item-content-more {
position: absolute;
bottom: 0;
right: 18rpx;
width: 106rpx;
height: 44rpx; height: 44rpx;
background: #fff; margin-top: 8rpx;
text-align: right;
font-size: 26rpx; font-size: 26rpx;
font-weight: 400; font-weight: 400;
line-height: 32rpx; line-height: 32rpx;
...@@ -795,12 +792,12 @@ ...@@ -795,12 +792,12 @@
bottom: 0; bottom: 0;
right: 18rpx; right: 18rpx;
width: 106rpx; width: 106rpx;
height: 44rpx; height: 26rpx;
background: #1c1c25; background: #1c1c25;
text-align: right; text-align: right;
font-size: 26rpx; font-size: 26rpx;
font-weight: 400; font-weight: 400;
line-height: 44rpx; line-height: 26rpx;
} }
.evaluate-item-content-more text { .evaluate-item-content-more text {
...@@ -813,7 +810,7 @@ ...@@ -813,7 +810,7 @@
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
padding: 32rpx 0 48rpx 0; margin: 32rpx 0 48rpx 0;
border-bottom: 0.5px #e2e7ef solid; border-bottom: 0.5px #e2e7ef solid;
} }
...@@ -853,7 +850,7 @@ ...@@ -853,7 +850,7 @@
/* 评论相册样式 */ /* 评论相册样式 */
.full-screen-album { .full-screen-album {
z-index: 9; z-index: 7;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
...@@ -873,7 +870,6 @@ ...@@ -873,7 +870,6 @@
} }
/* 价格样式 */ /* 价格样式 */
.detail-price-discount { .detail-price-discount {
width: 90rpx; width: 90rpx;
height: 36rpx; height: 36rpx;
......
<m-nav titleText="{{navTitle}}" scrollHeight="{{navScroll}}" changeHeight="10rpx" styleIndex="{{1}}"></m-nav> <m-nav titleText="{{navTitle}}" scrollHeight="{{navScroll}}" styleIndex="{{1}}"></m-nav>
<view class="container"> <view class="container">
<view class="detail"> <view class="detail">
......
import iOption from '../option.js' import iOption from './option.js'
import iInterceptors from './interceptors.js' import interceptor from './interceptor.js'
/** /**
* Corvus * 检查传参格式,数值有效性。
* @constructor * @function
* @param {object} option - { base: '', method: 'post', header: {}, timeout: 10000, dataType: '', responseType: ''} * @param {object} - funcEvent
* @return * @returns
*/ */
function Corvus (option) { function inspectOption (funcOption) {
let This = this // 配置参数必须是对象类型。
// 默认配置参数 if (Object.prototype.toString.call(funcOption) !== '[object Object]') {
This.option = { console.log('[request] "option" is invalid!')
base: iOption.baseUrl,
method: 'post',
header: { 'content-type': 'application/json' },
timeout: 5000,
dataType: 'json',
responseType: 'text'
}
if (Object.prototype.toString.call(option) === '[object Object]') {
This.option = Object.assign(This.option, option)
}
// 对实例参数做正确性校验
// 请求方式存在,且为post或者get之一,则设置。
if (This.option.method !== 'post' && This.option.method !== 'get') {
console.log('[corvus] "method" is invalid!')
return return
} }
// 请求头部存在,且不为空对象,则设置 // 请求方式必须是post或者get之一
if (Object.prototype.toString.call(This.option.header) !== '[object Object]') { if (funcOption.method && ['get', 'post'].indexOf(funcOption.method) >= 0) {
console.log('[Corvus] "header" is invalid!') console.log('[request] "method" is invalid!')
return return
} }
// 基础路径存在,则设置 // 请求头部必须是对象类型
if (!This.option.base || Object.prototype.toString.call(This.option.base) !== '[object String]') { if (funcOption.header && Object.prototype.toString.call(funcOption.header) !== '[object Object]') {
console.log('[corvus] "baseURL" is invalid!') console.log('[request] "header" is invalid!')
return return
} }
} }
Corvus.prototype.request = function (option) { function request (funcOption) {
let This = this if (inspectOption(funcOption)) return
option = Object.assign(JSON.parse(JSON.stringify(This.option)), option)
option = iInterceptors.request(option) // { 'Content-Type': 'application/x-www-form-urlencoded;' }
let funcPromise = new Promise(function (funcResolve, funcReject) { // { 'Content-Type': 'multipart/form-data;' }
// { 'Content-Type': 'application/json;' }
// { 'Content-Type': 'text/plain;' }
let funcDefaultOption = {
base: iOption.baseUrl,
method: 'post',
header: { 'content-type': 'application/json' },
timeout: 5000,
dataType: 'json',
responseType: 'text'
}
// 合并默认配置
funcOption = Object.assign(funcDefaultOption, funcOption)
// 请求之前修改配置
funcOption = interceptor.request(funcOption)
let funcPromise = new Promise((funcResolve, funcReject) => {
wx.request({ wx.request({
url: option.base + option.url, url: funcOption.base + funcOption.url,
header: option.header, header: funcOption.header,
method: option.method, method: funcOption.method,
data: option.params, data: funcOption.params,
success: function (funcResult) { success: (funcResponse) => {
if (iInterceptors.response(option, funcResult)) { // 网络请求成功
funcResolve(funcResult) let funcInterceptor = interceptor.response(funcOption, funcResponse)
if (funcInterceptor.success) {
funcResolve(funcInterceptor.response)
} else {
funcReject(funcInterceptor.response)
} }
}, },
fail: function (funcResult) { fail: (funcResponse) => {
iInterceptors.response(option, funcResult) // 网络请求失败
funcReject('[axios] "request end!') interceptor.response(funcOption, funcResponse)
funcReject('[request] "request end!')
}, },
}) })
}) })
return funcPromise return funcPromise
} }
export default new Corvus() export default request
\ No newline at end of file \ No newline at end of file
/**
* xmlHttpResqust 表头设置函数
* @function
* @param {object} funXmlHttpRequest
* @param {string} funType - 发送数据类型标识
* @returns
*/
let output = function (funType) {
switch (funType) {
case 'form':
return { 'Content-Type': 'application/x-www-form-urlencoded;' }
case 'formData':
return { 'Content-Type': 'multipart/form-data;' }
case 'json':
return { 'Content-Type': 'application/json;' }
default:
return { 'Content-Type': 'text/plain;' }
}
}
export default output
\ No newline at end of file
...@@ -2,8 +2,7 @@ import iMd5 from '../md5.js' ...@@ -2,8 +2,7 @@ import iMd5 from '../md5.js'
let Output = { let Output = {
/** /**
* 请求拦截器。对请求进行配置修改或者拦截。 * 请求拦截器,对请求进行配置修改或者拦截。
* 此处为全局拦截器,所有实例对象均会触发。实例的自定义拦截逻辑需要在interceptors.request函数中定义。
* @function * @function
* @param {object} option - 请求的url以及params * @param {object} option - 请求的url以及params
* @returns {object || boolean} * @returns {object || boolean}
...@@ -30,58 +29,49 @@ let Output = { ...@@ -30,58 +29,49 @@ let Output = {
/** /**
* 响应拦截器。对响应数据做统一处理。 * 响应拦截器。对响应数据做统一处理。
* 此处为全局拦截器,所有实例对象均会触发。实例的自定义拦截逻辑需要在interceptors.response函数中定义。
* @function * @function
* @param {object} funResult - 响应回来的数据 * @param {object} funResult - 响应回来的数据
* @returns {object || undefined} * @returns {object || undefined}
*/ */
response: function (funcOption, funcResult) { response: function (funcOption, funcResponse) {
// console.log('■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■')
// console.log('api: ', funcOption.url)
// console.log('params: ', funcOption.params)
// console.log('status: ', funcResponse.statusCode)
// console.log('data: ', funcResponse.data ? funcResponse.data : funcResponse)
// console.log('■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■')
// 请求错误处理
if (funcResponse.errMsg === 'request:fail ') {
return false
}
console.log('api: ', funcOption.url) // 服务器错误处理
console.log('params: ', funcOption.params) if (funcResponse.statusCode === 504) {
console.log('status: ', funcResult.statusCode) return false
console.log('data: ', funcResult.data ? funcResult.data : funcResult) }
console.log('■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■')
return
console.log('funcResult', funcResult) // 请求正常
// 此处可以根据后台返回数据,格式化返回数据。
if (funcResponse.statusCode === 200) {
switch (funcResponse.data.code) {
case 101:
let App = getApp() break
if (funcResult.errMsg === 'request:fail ') { case 200:
wx.hideLoading() return {
App.imState.mutations({ success: true,
stateWinTip: true, response: {
stateTipContent: '哎呀,好像没网了,请检查网络。' code: funcResponse.data.code,
}) data: funcResponse.data.data,
return false message: funcResponse.data.msg
} }
if (funcOption.url !== 'api/app/weixin/v1/pay/findStatus' && funcOption.url !== 'api/app/weixin/v1/pay/findStatus') {
wx.hideLoading()
} }
if (funcResult.statusCode === 504) { break
App.imState.mutations({
stateWinTip: true,
stateTipContent: '服务器错误'
})
return false
} }
if (funcResult.data.code === 101) {
App.imState.mutations({
stateWinTip: true,
stateTipContent: '登录失效,请重新登录'
})
let funcTimer = setTimeout(function () {
clearTimeout(funcTimer)
wx.redirectTo({
url: '../sign-in/sign-in'
})
}, 2000)
return false
} }
return true return true
}, },
} }
......
const output = {
// 测试环境
baseUrl: 'https://sm-web2.meiqicloud.com/api/',
// 正式环境
// baseUrl: 'https://xsslc.cndrealty.com/',
}
export default output
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment