Commit c2acc8b4 by wjw

Merge branch 'master' of http://120.77.182.185/yanl/mini-shimao.git into master

# Conflicts:
#	pages/play/service-detail/service-detail.js
#	pages/play/service-detail/service-detail.wxml

Signed-off-by: wjw <364716925@qq.com>
parents 45cb8b11 749e8459
let App = getApp()
Page({
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '/image/back-w.png',
color: '#FFFFFF',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
},
scroll: '600rpx',
},
navigationScroll: 0,
navbarTitle: '',
banner: '',
bgColor: '',
buyText: '',
unitText: '',
shopInfo: {},
userInfo: {},
commodityList: [],
},
......@@ -36,7 +57,7 @@ Page({
case 3:
this.setData({
navbarTitle: '儿童营地',
navbarTitle: '儿童营地入园购票',
banner: 'service/detail-banner-3.png',
bgColor: '#F6DADA',
buyText: '购买门票',
......@@ -313,6 +334,11 @@ Page({
* @returns
*/
onBuy: function (event) {
if (this.data.shopInfo.appId === 7) {
this.onCommodityDetail(event)
return
}
let funcCommodityInfo = event.currentTarget.dataset.item
// 补充必要参数
......@@ -326,4 +352,20 @@ Page({
url: '/pages/pay/order-input/order-input?type=' + funcCommodityInfo.typeId
})
},
onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
},
})
\ No newline at end of file
<navigation class="navigation" titleText="{{navbarTitle}}" backIcon="/image/back.png"></navigation>
<navigation class="navigation" titleText="{{navbarTitle}}" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<view class="container con-s" style="background: {{bgColor}}">
<view class="background-img">
......@@ -6,7 +6,7 @@
</view>
<block wx:for="{{commodityList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="project-wrapper col" data-item="{{item}}" bindtap="onCommodityDetail">
<view class="project-wrapper col" data-item="{{item}}" bindtap="onBuy">
<view class="project-cover">
<image src="{{item.cover}}"></image>
</view>
......
let App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '/image/back-w.png',
color: '#FFFFFF',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
},
scroll: '600rpx',
},
navigationScroll: 0,
banner: [],
bannerIndex: 0,
......@@ -29,48 +48,35 @@ Page({
},
onLoad: function (options) {
this.queryBanner()
for (let i = 0, l = this.data.shopAppId.length; i < l; i++) {
this.queryBanner(this.data.shopAppId[i].appId, i)
this.queryPassCheck(this.data.shopAppId[i].appId, this.data.shopAppId[i].commodityType, i)
}
},
queryBanner: function (funcShopAppId, funcIndex) {
let funcType = ''
switch (funcShopAppId) {
case 1:
funcType = 3
break
case 3:
funcType = 2
if (funcIndex === 3) funcIndex = 2
break
case 7:
funcType = 4
break
}
queryBanner: function () {
App.wxRequest({
url: '/api/v1/banner/getOfficeByBanner',
data: {
'smColumnId': funcType,
'smColumnId': 1,
},
success: (response) => {
let funcResponse = response.data
let funcBanner = this.data.banner
if (funcResponse.length) {
funcBanner[funcIndex] = funcResponse[0].img
} else {
funcBanner[funcIndex] = ''
let funcList = []
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id,
'cover': funcResponse[i].img
}
funcList.push(funcItem)
}
this.setData({
banner: funcBanner
banner: funcList
})
console.log(funcBanner)
console.log(this.data.banner)
}
})
},
......@@ -262,6 +268,22 @@ Page({
})
},
onPageScroll: function (funcEvent) {
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
// 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
},
/**
* banner 切换图片同步自定义标识组件
* @function
......
<navigation class="navigation" titleText="所有项目服务" color="#FFFFFF" backIcon="/image/back-w.png"></navigation>
<navigation class="navigation" titleText="所有项目服务" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<view class="container">
<view class="banner">
<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">
<swiper-item class="banner-swiper-item" data-item="{{item}}" bindtap="bannerClick">
<image class="banner-swiper-image" src="{{item}}"></image>
<image class="banner-swiper-image" src="{{item.cover}}"></image>
</swiper-item>
</block>
</swiper>
......@@ -24,7 +24,7 @@
</view>
<view class="commodity-list">
<block wx:for="{{shopCommodityData[0]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="commodity-item row">
<view class="commodity-item row" data-index="{{0}}" data-itemindex="{{index}}" bindtap="onBuy">
<view class="commodity-cover">
<image src="{{item.cover}}"></image>
</view>
......@@ -74,7 +74,7 @@
</block>
<view class="commodity-price-operation row con-e align-c">
<button class="row con-c align-c" data-index="{{0}}" data-itemindex="{{index}}" bindtap="onBuy">购买门票</button>
<button class="row con-c align-c">购买门票</button>
</view>
</view>
</view>
......@@ -90,7 +90,7 @@
</view>
<view class="commodity-list">
<block wx:for="{{shopCommodityData[1]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="commodity-item row">
<view class="commodity-item row" data-index="{{1}}" data-itemindex="{{index}}" bindtap="onBuyService">
<view class="commodity-cover">
<image src="{{item.cover}}"></image>
</view>
......@@ -160,7 +160,7 @@
</block>
<view class="commodity-price-operation row con-e align-c">
<button class="row con-c align-c" data-index="{{1}}" data-itemindex="{{index}}" bindtap="onBuyService">查看服务</button>
<button class="row con-c align-c">查看服务</button>
</view>
</view>
</view>
......@@ -176,7 +176,7 @@
</view>
<view class="commodity-list">
<block wx:for="{{shopCommodityData[2]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="commodity-item row">
<view class="commodity-item row" data-index="{{2}}" data-itemindex="{{index}}" bindtap="onBuy">
<view class="commodity-cover">
<image src="{{item.cover}}"></image>
</view>
......@@ -226,14 +226,14 @@
</block>
<view class="commodity-price-operation row con-e align-c">
<button class="row con-c align-c" data-index="{{2}}" data-itemindex="{{index}}" bindtap="onBuy">购买门票</button>
<button class="row con-c align-c">购买门票</button>
</view>
</view>
</view>
</block>
<block wx:for="{{shopCommodityData[3]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="commodity-item row">
<view class="commodity-item row" data-index="{{3}}" data-itemindex="{{index}}" bindtap="onBuy">
<view class="commodity-cover">
<image src="{{item.cover}}"></image>
</view>
......@@ -283,7 +283,7 @@
</block>
<view class="commodity-price-operation row con-e align-c">
<button class="row con-c align-c" data-index="{{3}}" data-itemindex="{{index}}" bindtap="onBuy">购买门票</button>
<button class="row con-c align-c">购买门票</button>
</view>
</view>
</view>
......
......@@ -110,7 +110,7 @@ let output = [
}, {
x: 2794,
y: 600,
id: '',
id: 3,
name: '儿童营地',
icon: './image/icon/13.png',
card: 'guide/card/13.png',
......
// pages/hotelAccommodation/hotelAccommodation.js
const App = getApp()
Page({
/**
* 页面的初始数据
*/
......@@ -12,6 +11,9 @@ Page({
mobile: '',
num: '',
time: '',
tickerInfo: {},
isDoing: false,
isShowCancel: false
},
showHotline() {
......@@ -19,6 +21,65 @@ Page({
hotline: true
})
},
//取消预约
onCancel: function (event) {
let that = this
if (this.data.isDoing) return
wx.lin.showDialog({
type: "confirm",
title: "",
content: "是否确认取消预约",
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({
title: '处理中',
mask: true
})
this.setData({
isDoing: true
})
App.wxRequest({
url: '/api/v1/subscribe/cancelSubscribe',
data: {
'id': that.data.tickerInfo.id
},
success: (response) => {
wx.hideLoading()
that.setData({
isDoing: false
})
wx.lin.showToast({
image: '/image/success.png',
title: '取消成功',
})
setTimeout(() => {
let type = that.data.type
let tabType = 2
if (type == 0) {
//返回夜间入园预约列表
tabType = 1
} else {
// 返回看房预约
tabType = 2
}
wx.redirectTo({
url: '/pages/mine/appointment/appointment?tab=' + tabType,
})
}, 2000);
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
//客服热线拨打
call() {
wx.makePhoneCall({
......@@ -39,12 +100,23 @@ Page({
console.log('.............', options.detail)
let detail = JSON.parse(options.detail);
console.log(detail);
let yyDate = detail.subscribeDate ? Date.parse(detail.subscribeDate.replace(/-/, '/')) : 0
let nowStr=new Date().toLocaleString().substr(0,10)+" 00:00:00"
let now = Date.parse(nowStr)
console.log(yyDate, 'yyDateyyDateyyDateyyDateyyDate');
console.log(nowStr, 'nowStr');
console.log(now, 'now');
let isShowCancel = now <= yyDate
this.setData({
tickerInfo: detail,
type: detail.type,
name: detail.name,
mobile: detail.mobile,
num: detail.num,
time: detail.time,
isShowCancel
})
},
})
\ No newline at end of file
......@@ -35,12 +35,16 @@
</view>
<image src="http://sm-web.meiqicloud.com/userfiles/appResources/appointment/night/ornament-1.png" class="thanks"></image>
</view>
<view class="bottom-btns">
<view class="custom" bindtap="showHotline">客服咨询</view>
<view class="bottom-btns" wx:if="{{isShowCancel}}">
<view class="custom margin-right-20" bindtap="onCancel">取消预约</view>
<view class="custom" bindtap="showHotline">客服咨询</view>
</view>
<view wx:else class="custom" bindtap="showHotline">客服咨询</view>
</view>
</view>
<l-dialog />
<l-toast l-image-class="toast-image"></l-toast>
<!-- 客服热线 -->
<l-arc-popup show="{{hotline}}" arc-radius="30">
......
......@@ -126,4 +126,7 @@
.bottom-btns {
display: flex;
}
.margin-right-20{
margin-right: 20rpx;
}
\ No newline at end of file
......@@ -12,9 +12,11 @@ Page({
* 页面的初始数据
*/
data: {
isFinished: false,
option: {},
isDoing: false,
pageNo: 1,
pageSize: 10,
// 导航栏相关属性
navigationStyle: {
normal: {
......@@ -109,11 +111,12 @@ Page({
// 点击导航切换,默认是全部的
chageNav(e) {
let index = e.currentTarget.dataset.index
console.log(index, 'nav----------');
if (index === 0) {
this.setData({
pageNo: 1,
activityList: []
activityList: [],
isFinished: false
})
this.getActivity()
} else {
......@@ -247,15 +250,17 @@ Page({
},
// 我的活动
getActivity: function () {
if (this.data.isFinished) return
let that = this
wx.showLoading({
title: '加载中',
mask:true
})
App.wxRequest({
url: '/api/v1/activity/getMyActivityList',
data: {
activeState: '', //""全部 0 未开始 1进行中 2已结束
pageSize: '10',
pageSize: this.data.pageSize,
pageNo: this.data.pageNo,
type: '1'
},
......@@ -264,6 +269,11 @@ Page({
success: (res) => {},
})
let funcData = res.data.list
if (funcData.length < that.data.pageSize) {
that.setData({
isFinished: true
})
}
let tmpArr = []
funcData.forEach(item => {
let obj = {
......@@ -281,7 +291,7 @@ Page({
tmpArr.push(obj)
})
that.setData({
activityList: tmpArr
activityList: that.data.activityList.concat(tmpArr)
})
}
})
......@@ -301,6 +311,7 @@ Page({
let that = this
wx.showLoading({
title: '加载中',
mask:true
})
App.wxRequest({
url: '/api/v1/subscribe/getList',
......@@ -336,7 +347,7 @@ Page({
id: item.id,
mobile: item.mobile,
name: item.name,
subscribeDate: item.subscribeDate
}
tmpArr.push(obj)
})
......@@ -355,7 +366,6 @@ Page({
if (this.data.active == 0) {
this.getActivity()
}
},
// 导航栏返回事件。
......
......@@ -225,11 +225,11 @@
<view class="noActive" wx:if="{{data.length === 0 && active === 1}}">
<view class="noActive-title">暂无夜间入园预约</view>
<view class="noActive-rule">20:00后入园需要提前预约,每日限流200人</view>
<view class="noActive-botton" data-index="2" bindtap="goAppoint">去预约</view>
<view class="noActive-botton" data-index="1" bindtap="goAppoint">去预约</view>
</view>
<view class="noActive" wx:if="{{data.length === 0 && active === 2}}">
<view class="noActive-title">暂无看房预约</view>
<view class="noActive-botton" data-index="1" bindtap="goAppoint">去预约</view>
<view class="noActive-botton" data-index="2" bindtap="goAppoint">去预约</view>
</view>
<!-- 主题活动数据为空 -->
<view class="noActive" wx:if="{{activityList.length === 0 && active === 0}}">
......
......@@ -267,7 +267,7 @@ Page({
}
})
},
//活动预约统计
//获取活动预约统计
getCountEnrollSubscribe() {
let that = this
App.wxRequest({
......@@ -406,14 +406,14 @@ Page({
}
},
// 我的活动
// 获取我的活动
getMyActivityList() {
var that = this
App.wxRequest({
url: '/api/v1/activity/getMyActivityList',
data: {
activeState: '1',
pageSize: 2,
pageSize: -1,
pageNo: 1,
type: 1
},
......
......@@ -232,7 +232,8 @@
<view class="order-activity-icon-wrapper col align-c" data-type='0' bindtap="goAppointment">
<view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/yy_theme.png'}}"></image>
<view class="order-activity-badge {{ enrollSubscribeData.active > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.active}}">
<view class="order-activity-badge {{ enrollSubscribeData.active > 9 ? 'badge-widen' : ''}}"
wx:if="{{enrollSubscribeData.active}}">
{{enrollSubscribeData.active}}</view>
</view>
<text>主题活动</text>
......@@ -240,7 +241,8 @@
<view class="order-activity-icon-wrapper col align-c" data-type='1' bindtap="goAppointment">
<view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/yy_night.png'}}"></image>
<view class="order-activity-badge {{ enrollSubscribeData.garden > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.garden}}">
<view class="order-activity-badge {{ enrollSubscribeData.garden > 9 ? 'badge-widen' : ''}}"
wx:if="{{enrollSubscribeData.garden}}">
{{enrollSubscribeData.garden}}</view>
</view>
<text>夜间入园预约</text>
......@@ -248,7 +250,8 @@
<view class="order-activity-icon-wrapper col align-c" data-type='2' bindtap="goAppointment">
<view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/yy_house.png'}}"></image>
<view class="order-activity-badge {{ enrollSubscribeData.scanHouse > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.scanHouse}}">
<view class="order-activity-badge {{ enrollSubscribeData.scanHouse > 9 ? 'badge-widen' : ''}}"
wx:if="{{enrollSubscribeData.scanHouse}}">
{{enrollSubscribeData.scanHouse}}</view>
</view>
<text>看房预约</text>
......@@ -257,7 +260,8 @@
<!-- 预约卡片 -->
<view class="appintment">
<!-- 主题活动 -->
<view class="appointment-wrapper" wx:for="{{activityList}}" wx:key="*this" data-item="{{item}}" bindtap="onOrderDetail">
<view class="appointment-wrapper" wx:for="{{activityList}}" wx:key="*this" data-item="{{item}}"
bindtap="onOrderDetail">
<view class="appointment-time">{{item.activeTime}}</view>
<view class="appointment-activity-content row">
<view class="appointment-activity-img">
......@@ -314,8 +318,7 @@
</view> -->
</view>
<!-- more -->
<view class="more row align-c con-c" bindtap="onShowMoreActivity" wx:if="{{activityList.length>1}}">
<view class="more row align-c con-c" bindtap="onShowMoreActivity" wx:if="{{activityListBackup.length>2}}">
<text wx:if="{{!showMoreActivity}}">展开更多</text>
<text wx:else>收起</text>
<image wx:if="{{!showMoreActivity}}" src="{{imageBase + 'icon/arrow-b-2.png'}}"></image>
......
......@@ -77,8 +77,6 @@ Page({
queryOrder: function () {
// 数据全部加载完成不再执行
console.log(this.data.isFinished, '-----------------------------------this.data.isFinished');
if (this.data.isFinished) return
let that = this;
// let funcName = this.data.orderType[this.data.orderTypeActive].value
......@@ -88,6 +86,7 @@ Page({
})
wx.showLoading({
title: '加载中',
mask:true
})
App.wxRequest({
url: '/api/v1/order/getOrderList',
......
.container {
margin-top: 150rpx;
margin-top: 200rpx;
padding-bottom: 196rpx;
}
.list-wrapper {
......
......@@ -142,7 +142,7 @@
<view class="info-content col con-c">
<view class="info-content-item row">
<text class="info-content-item-label">报名活动</text>
<text class="info-content-item-title">儿童营地儿童营地儿童营地儿童营地儿童营地儿童营地</text>
<text class="info-content-item-title">{{orderInfo.commodity[0].name}}</text>
</view>
<view class="info-content-item row">
<text class="info-content-item-label">活动时间</text>
......@@ -150,15 +150,15 @@
</view>
<view class="info-content-item row">
<text class="info-content-item-label">活动地点</text>
<text class="info-content-item-describe">儿童营地</text>
<text class="info-content-item-describe">{{orderInfo.officeName}}</text>
</view>
<view class="info-content-item row">
<text class="info-content-item-label">订单信息</text>
<text class="info-content-item-tip">姓名</text>
<text class="info-content-item-tip">{{orderInfo.contactName}}</text>
</view>
<view class="info-content-item row">
<text class="info-content-item-label"></text>
<text class="info-content-item-tip">18030303030</text>
<text class="info-content-item-tip">{{orderInfo.contactPhone}}</text>
</view>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}">
</image>
......@@ -171,7 +171,7 @@
<image class="seal-long" src="{{resourcesBase+orderInfo.shopInfo.printUse}}"></image>
</view>
<view class="info-code col con-c align-c">
<text>{{'张门票可用'}}</text>
<text>{{orderInfo.commodity.length}}张门票可用</text>
<button bindtap="onFastScan" class="row con-c align-c">一键扫码</button>
<text>{{orderInfo.expireTime}}</text>
</view>
......@@ -281,7 +281,7 @@
<text
wx:if="{{orderInfo.state !== 0 && orderInfo.state !== -1}}">{{'付款时间:' + (orderInfo.tipTimePay?orderInfo.tipTimePay:'')}}</text>
<text
wx:if="{{orderInfo.state !== 0 && orderInfo.state !== -1}}">{{'获得积分:' + (orderInfo.tipIntegral?orderInfo.tipIntegral:'')}}</text>
wx:if="{{orderInfo.state !== 0 && orderInfo.state !== -1&&orderInfo.tipIntegral}}">{{'获得积分:' + (orderInfo.tipIntegral?orderInfo.tipIntegral:'')}}</text>
</view>
</view>
</view>
......
......@@ -874,6 +874,7 @@ Page({
},
success: (response) => {
if (/ 商品不存在/.test(response.data.msg)) {
wx.setStorageSync('shoppingCartBuffer', [])
wx.lin.showToast({
title: '商品已下架,请重新下单。',
icon: 'error',
......@@ -887,6 +888,7 @@ Page({
}
if (/价格不一致/.test(response.data.msg)) {
wx.setStorageSync('shoppingCartBuffer', [])
wx.lin.showToast({
title: '价格已变更,请重新下单。',
icon: 'error',
......
......@@ -9,7 +9,7 @@ let logicData = {
Page({
data: {
imageBase: App.globalData.appImageBase,
appResourcesBase: App.globalData.appResourcesBase,
resourcesBase: App.globalData.appResourcesBase,
option: {},
// 弹出控制
......@@ -62,7 +62,7 @@ Page({
detailActivity: [], // 活动
detailCommodity: [], // 商品
detailEvaluate: [], // 评论
evaluateAlbum: [],
isBlack: false,
......@@ -75,14 +75,7 @@ Page({
winActivity: false, // 近期活动
winCommodity: false, // 商品列表
winCommodityMenu: false,
officeService: 0,
officeServiceText: '5.0', // 门店服务评分
officeProduct: 0,
officeProductText: '5.0', // 门店产品评分
officeEnvironmental: 0,
officeEnvironmentalText: '5.0', // 门店环境评分
winEvaluateAlbum: false,
},
onLoad: function (options) {
......@@ -147,8 +140,7 @@ Page({
default:
this.queryCommodity()
}
// 查询评价
this.getOfficeAppraise()
this.getAppraise()
},
......@@ -159,7 +151,6 @@ Page({
* @returns
*/
queryDetail: function (funcAppId) {
let that = this
let funcIndex = 0
// 预设数据
let funcDetail = [
......@@ -323,7 +314,7 @@ Page({
// 查询景点信息
App.wxRequest({
url: '/api/v1/park/getList',
success: function(res) {
success: (res) => {
let funcData = res.list
funcDetail.forEach(shop => {
funcData.forEach(item => {
......@@ -336,7 +327,7 @@ Page({
}
})
})
that.setData({
this.setData({
banner: funcDetail[funcIndex].banner,
shareImage: funcDetail[funcIndex].shareImage,
info: {
......@@ -399,42 +390,8 @@ Page({
'officeId': this.data.shopInfo.id,
},
success: (response) => {
let funcResponse = response.data.list
let funcList = []
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'cover': funcResponse[i].cover,
'id': funcResponse[i].id,
'title': funcResponse[i].name,
'officeId': funcResponse[i].officeId,
'price': funcResponse[i].visitorPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse[i].visitorPrice), // 普通价文本格式
'priceSpecial': funcResponse[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].ownerPrice), // 业主价文本格式
'tags': funcResponse[i].tags,
'tagId': funcResponse[i].tagId,
'time': funcResponse[i].activeDate + ' ' + funcResponse[i].activeTime, // 活动时间
'priceType': 1,
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
funcList.push(funcItem)
}
this.setData({
winActivity: true,
detailActivity: funcList
winActivity: true
})
}
})
......@@ -457,8 +414,8 @@ Page({
'pageSize': 10,
},
success: (response) => {
let funcResponse = response.data
let funcCommodityList = []
let funcResponse = response.data
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id, // 商品标识
......@@ -556,73 +513,82 @@ Page({
* @returns
*/
getAppraise: function () {
let that = this
App.wxRequest({
url: '/api/v1/appraise/getList',
data: {
'pageNo': '1',
'pageSize': '-1',
'officeId': that.data.shopInfo.id
'officeId': this.data.shopInfo.id
},
success: (res) => {
let funcData = res.data.list
success: (response) => {
let funcResponse = response.data
let funcList = []
let officeServiceText = '0'
let officeProductText = '0'
let officeEnvironmentalText = '0'
console.log(JSON.stringify(funcData))
for (let i=0, l=funcData.length; i<l; i++) {
for (let i = 0, l = funcResponse.list.length; i< l; i++) {
let funcItem = {
'avatar': funcData[i].headImg, // 头像
'name': funcData[i].nickname,
'userType': funcData[i].userType,
'content': funcData[i].content, // 内容
'imgUrls': funcData[i].imgUrls, // 图片
'environmentalEvaluation': funcData[i].environmentalEvaluation, // 环境评分
'productEvaluation': funcData[i].productEvaluation, // 产品评分
'serviceEvaluation': funcData[i].serviceEvaluation, // 服务评分
'date': funcData[i].createDate, // 评价时间
'star': Math.floor((funcData[i].environmentalEvaluation + funcData[i].productEvaluation + funcData[i].serviceEvaluation) / 3)
'star': 4,
'scoreService': funcResponse.list[i].environmentalEvaluation, // 服务评价
'scoreCommodity': funcResponse.list[i].productEvaluation, // 商品评价
'scoreEnvironmental': funcResponse.list[i].environmentalEvaluation, // 环境评价
'userName': funcResponse.list[i].name,
'userAvatar': funcResponse.list[i].headImg,
'userType': funcResponse.list[i].userType,
'userAlbum': funcResponse.list[i].imgUrls, // 评论图册
'date': funcResponse.list[i].createDate,
'content': funcResponse.list[i].content,
'isMore': false,
}
funcItem = {
'isMore': false,
'star': 4,
'scoreService': 3,
'scoreCommodity': 2,
'scoreEnvironmental': 1,
'userName': '用户名称',
'userAvatar': 'https://gss3.bdstatic.com/84oSdTum2Q5BphGlnYG/timg?wapp&quality=80&size=b150_150&subsize=20480&cut_x=0&cut_w=0&cut_y=0&cut_h=0&sec=1369815402&srctrace&di=6a992d9158ef2273c2e9d0a77fbbbe88&wh_rate=null&src=http%3A%2F%2Ftiebapic.baidu.com%2Fforum%2Fpic%2Fitem%2F4d086e061d950a7be03653981dd162d9f2d3c96f.jpg',
'userType': 0,
'userAlbum': [
'https://dss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=975216563,2695721503&fm=111&gp=0.jpg',
'https://dss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2856846879,389279115&fm=26&gp=0.jpg',
'https://dss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2032511182,3555754069&fm=26&gp=0.jpg',
'https://dss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2032511182,3555754069&fm=26&gp=0.jpg',
'https://dss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2032511182,3555754069&fm=26&gp=0.jpg',
],
'date': '2020.02.09',
'content': '/sd12i301!@(#*)(#Updjs',
}
funcItem.star = Math.floor((funcItem.scoreService + funcItem.scoreCommodity + funcItem.scoreEnvironmental) / 3)
funcList.push(funcItem)
}
if (funcList.length === 0) {
officeServiceText = '5.0'
officeProductText = '5.0'
officeEnvironmentalText = '5.0'
that.setData({
officeServiceText,
officeProductText,
officeEnvironmentalText
})
}
that.setData({
detailEvaluate: funcList,
this.setData({
detailEvaluate: funcList
})
}
})
},
// 查询门店评分
getOfficeAppraise: function () {
let that = this
let officeId = wx.getStorageSync('shopInfoBuffer').id
App.wxRequest({
url: '/api/v1/appraise/getOfficeAppraise',
data: {
'officeId': officeId
},
success: function (response) {
let funcData = response.data
that.setData({
detailEvaluate: funcData.list,
officeServiceText: funcData.serviceEvaluation.toFixed(1),
officeProductText: funcData.productEvaluatio.toFixed(1),
officeEnvironmentalText: funcData.environmentalEvaluation.toFixed(1),
const funcQuery = wx.createSelectorQuery()
funcQuery.selectAll('.evaluate-item-content-mark').boundingClientRect()
funcQuery.exec((response) => {
let funcContentHeight = 88 * wx.getStorageSync('unitProportion')
let funcEvaluate = this.data.detailEvaluate
let funcTextHeight = response[0]
console.log(funcContentHeight)
console.log(funcTextHeight)
for (let i = 0, l = funcTextHeight.length; i < l; i++) {
if (funcContentHeight > funcTextHeight[i].height) {
funcEvaluate[i].isMore = true
}
}
this.setData({
detailEvaluate: funcEvaluate
})
})
}
})
},
onBuy: function (event) {
let id = event.currentTarget.dataset.id
wx.navigateTo({
......@@ -668,10 +634,10 @@ Page({
break
}
},
// 点击下方按钮
onContact: function () {
wx.navigateTo({
url: '/pages/commodity/project-detail/project-detail'
wx.makePhoneCall({
phoneNumber: this.data.info.contact
})
},
......@@ -783,7 +749,7 @@ Page({
* @param {object} - funcEvent
* @returns
*/
onAllActivity: function () {
onActivityAll: function () {
wx.navigateTo({
url: '/pages/play/activity/activity?fromPage=serviceDetail',
})
......@@ -806,4 +772,54 @@ Page({
url: '/pages/play/movie/movie',
})
},
/**
* 评论查看全部
* @function
* @param
* @returns
*/
onEvaluateMore: function (event) {
let funcItem = event.currentTarget.dataset.item
let funcIndex = event.currentTarget.dataset.index
let funcEvaluate = this.data.detailEvaluate
funcEvaluate[funcIndex].isMore = true
this.setData({
detailEvaluate: funcEvaluate
})
console.log(funcItem)
},
/**
* 评论查看相册
* @function
* @param
* @returns
*/
onEvaluateAlbum: function (event) {
console.log('onEvaluateAlbum')
let funcItem = event.currentTarget.dataset.item
let funcIndex = event.currentTarget.dataset.index
this.setData({
evaluateAlbum: funcItem.userAlbum,
evaluateAlbumActive: funcIndex,
winEvaluateAlbum: true
})
},
/**
* 评论相册隐藏
* @function
* @param
* @returns
*/
onHiddenEvaluateAlbum: function () {
this.setData({
winEvaluateAlbum: false
})
},
})
\ No newline at end of file
<!-- 畅玩 - 商店详情 -->
<navigation class="navigation" titleText="{{info.title}}" color="#ffffff" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<navigation class="navigation" titleText="{{info.title}}" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<view class="container" wx:if="{{option.id !== '2'}}">
<view id="banner" class="banner">
......@@ -50,7 +49,7 @@
<view class="commodity-card" wx:if="{{winActivity}}">
<view class="commodity-card-title row con-b align-e">
<text>近期活动</text>
<text bindtap="onAllActivity">查看全部</text>
<text bindtap="onActivityAll">查看全部</text>
</view>
<view class="commodity-card-list row">
<block wx:for="{{detailActivity}}" wx:for-index="index" wx:for-item="item" wx:key="index">
......@@ -65,22 +64,10 @@
<text>{{item.time}}</text>
</view>
<view class="commodity-card-item-operation row con-b align-c">
<view class="row align-c" wx:if="{{item.priceType === 1}}">
<text>活动价</text>
<text class="price-symbol">¥</text>
<text>{{item.priceSpecialText == '0' ? '免费' : item.priceSpecialText}}</text>
<text>{{item.priceText}}</text>
</view>
<view class="row align-c" wx:if="{{item.priceType === 2}}">
<view class="row align-c">
<text>业主价</text>
<text class="price-symbol">¥</text>
<text>{{item.priceSpecialText == '0' ? '免费' : item.priceSpecialText}}</text>
<text>{{item.priceText}}</text>
</view>
<view class="row align-c" wx:if="{{item.priceType === 3}}">
<text style="display: none"></text>
<text class="price-symbol">¥</text>
<text>{{item.priceText == '0' ? '免费' : item.priceText}}</text>
<text>免费</text>
<text>{{item.price}}</text>
</view>
<view>
<button class="row con-c align-c">报名</button>
......@@ -91,7 +78,7 @@
<block wx:if="{{detailActivity.length === 0}}">
<view class="commodity-card-item-nothing col con-c align-c">
<image src="{{appResourcesBase + 'service/nothing.png'}}"></image>
<image src="{{imageBase + 'icon/fireworks-2.png'}}"></image>
<text>近期暂无活动安排</text>
</view>
</block>
......@@ -121,6 +108,7 @@
<text class="detail-price-discount">活动价</text>
<text class="price-symbol">¥</text>
<text>{{item.priceDiscountText == '0' ? '免费' : item.priceDiscountText}}</text>
<text class="price-unit">/人</text>
<text>{{'¥' + item.priceText}}</text>
</view>
......@@ -129,6 +117,7 @@
<text class="detail-price-special">业主价</text>
<text class="price-symbol">¥</text>
<text>{{item.priceSpecialText == '0' ? '免费' : item.priceSpecialText}}</text>
<text class="price-unit">/人</text>
<text>{{'¥' + item.priceText}}</text>
</view>
......@@ -137,6 +126,8 @@
<text class="">业主价</text>
<text class="price-symbol">¥</text>
<text>{{item.priceText == '0' ? '免费' : item.priceText}}</text>
<text class="price-unit">/人</text>
<text></text>
</view>
<view>
<button class="row con-c align-c" data-item="{{item}}" bindtap="onBuy">购买</button>
......@@ -196,35 +187,47 @@
<block wx:for="{{detailEvaluate}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="evaluate-item col">
<view class="row">
<image class="evaluate-item-avatar" src="{{item}}" mode="widthFix"></image>
<image class="evaluate-item-avatar" src="{{item.userAvatar}}" mode="widthFix"></image>
<view class="evaluate-item-info">
<view class="evaluate-item-info-text row align-c">
<text>{{item.name}}</text>
<text>{{item.userName}}</text>
<text>业主</text>
<text>{{item.date}}</text>
</view>
<view class="evaluate-item-info-star row align-c">
<block wx:for="{{item.star}}" wx:for-index="indexStar" wx:for-item="itemStar" wx:key="indexStar">
<image src="{{imageBase + 'icon/star-1.png'}}"></image>
<image src="{{imageBase + 'icon/star-1.png'}}" data-item="{{item}}"></image>
</block>
</view>
</view>
</view>
<view class="evaluate-item-content">
<view>
<!-- 评论隐藏样式 -->
<view class="evaluate-item-content" wx:if="{{!item.isMore}}">
<view class="evaluate-item-content-mark">
<text>{{item.content}}</text>
</view>
<!-- <view class="evaluate-item-content-more">
<view class="evaluate-item-content-more" data-item="{{item}}" data-index="{{index}}" bindtap="onEvaluateMore">
<text>... </text>
<text>全文</text>
</view> -->
</view>
</view>
<!-- 评论展开样式 -->
<view class="evaluate-item-content-whole" wx:if="{{item.isMore}}">
<view>
<text>{{item.content}}</text>
</view>
</view>
<view class="evaluate-item-album">
<block wx:for="{{item.imgUrls}}" wx:for-index="indexAlbum" wx:for-item="itemAlbum" wx:key="indexAlbum">
<image src="{{itemAlbum}}" bindtap="onPreviewImage" data-index="{{index}}" data-url="{{itemAlbum}}"></image>
<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>
</block>
<view wx:if="{{item.userAlbum.length > 4}}" class="evaluate-item-album-more row con-c align-c" data-index="{{3}}" data-item="{{item}}" bindtap="onEvaluateAlbum">
<text>{{'+' + (item.userAlbum.length - 4)}}</text>
</view>
</view>
</view>
</block>
......@@ -435,4 +438,15 @@
<image src="{{imageBase + 'top.png'}}"></image>
</button>
</view>
</view>
<!-- 查看相册 -->
<view class="full-screen-album" wx:if="{{winEvaluateAlbum}}" bindtap="onHiddenEvaluateAlbum" >
<swiper circular current="{{evaluateAlbumActive}}" class="full-screen-album-swiper" duration="500">
<block wx:for="{{evaluateAlbum}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item class="album-item row con-c align-c">
<image class="album-image" src="{{item}}" mode="aspectFit"></image>
</swiper-item>
</block>
</swiper>
</view>
\ No newline at end of file
......@@ -251,6 +251,22 @@
font-weight: 600;
}
.commodity-card-item-nothing image {
display: block;
width: 96rpx;
height: 76rpx;
}
.commodity-card-item-nothing text {
width: 240rpx;
height: 42rpx;
margin-top: 40rpx;
font-size: 30rpx;
font-weight: 500;
line-height: 42rpx;
color: #959DA9;
}
.commodity-card-item {
width: 562rpx;
margin-right: 24rpx;
......@@ -606,6 +622,7 @@
}
/* 评论详情 */
.evaluate-item {
position: relative;
width: 670rpx;
min-height: 292rpx;
margin: 48rpx 40rpx 0 40rpx;
......@@ -673,6 +690,7 @@
display: -webkit-box;
position: relative;
width: 670rpx;
min-height: 88rpx;
max-height: 132rpx;
margin-top: 32rpx;
font-size: 26rpx;
......@@ -684,6 +702,18 @@
overflow: hidden;
}
.evaluate-item-content-whole {
position: relative;
width: 670rpx;
min-height: 132rpx;
margin-top: 32rpx;
font-size: 26rpx;
font-weight: 400;
line-height: 44rpx;
color: #15191F;
}
.evaluate-item-content-more {
position: absolute;
bottom: 0;
......@@ -707,6 +737,7 @@
}
.evaluate-item-album {
position: relative;
display: flex;
flex-wrap: wrap;
flex-direction: row;
......@@ -729,7 +760,46 @@
.evaluate-item-album image:nth-child(4n) {
margin-right: 0;
border: 1px red solid;
}
.evaluate-item-album-more {
position: absolute;
right: 0;
width: 160rpx;
height: 160rpx;
margin: 0 0 10rpx 0;
border-radius: 4px;
background: rgba(0, 0, 0, .4);
}
.evaluate-item-album-more text {
height: 53rpx;
font-size: 38rpx;
font-weight: 400;
line-height: 52rpx;
color: #FFFFFF;
}
/* 评论相册样式 */
.full-screen-album {
z-index: 2000;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #000000;
}
.full-screen-album-swiper,
.album-item {
width: 750rpx;
height: 100%;
}
.album-image {
width: 750rpx;
min-height: 100%;
}
/* 价格样式 */
......
......@@ -49,7 +49,7 @@ Page({
let funcItem = {
'name': funcResponse.name,
'time': funcResponse.spaMins,
'time': funcResponse.spaMins + 'mins',
'address': '元养水韵SPA',
'content': funcResponse.particulars,
......
......@@ -30,7 +30,7 @@
<view class="time-address-title">
<text>时长</text>
</view>
<view class="time-address">
<view class="time-address" wx:if="{{serviceInfo.time}}">
<text>{{serviceInfo.time}}</text>
</view>
</view>
......
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