Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
aa0acf14
authored
Sep 22, 2020
by
严立
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
LL - 评论功能
parent
05f095e5
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
340 additions
and
67 deletions
image/icon/fireworks-2.png
pages/commodity/project-detail/project-detail.js
pages/commodity/project-detail/project-detail.wxml
pages/commodity/project/project.js
pages/commodity/project/project.wxml
pages/home/guide/js/point.js
pages/pay/coupon-detail/coupon-detail.wxss
pages/pay/order-input/order-input.js
pages/play/service-detail/service-detail.js
pages/play/service-detail/service-detail.wxml
pages/play/service-detail/service-detail.wxss
pages/play/service-sell/service-sell.js
pages/play/service-sell/service-sell.wxml
image/icon/fireworks-2.png
0 → 100644
View file @
aa0acf14
6.63 KB
pages/commodity/project-detail/project-detail.js
View file @
aa0acf14
let
App
=
getApp
()
let
App
=
getApp
()
Page
({
let
logicData
=
{
pageScrollLock
:
false
,
pageScrollTimer
:
0
,
}
Page
({
data
:
{
data
:
{
imageBase
:
App
.
globalData
.
appImageBase
,
imageBase
:
App
.
globalData
.
appImageBase
,
resourcesBase
:
App
.
globalData
.
appResourcesBase
,
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
:
''
,
navbarTitle
:
''
,
banner
:
''
,
banner
:
''
,
bgColor
:
''
,
bgColor
:
''
,
buyText
:
''
,
buyText
:
''
,
unitText
:
''
,
unitText
:
''
,
shopInfo
:
{},
userInfo
:
{},
userInfo
:
{},
commodityList
:
[],
commodityList
:
[],
},
},
...
@@ -36,7 +57,7 @@ Page({
...
@@ -36,7 +57,7 @@ Page({
case
3
:
case
3
:
this
.
setData
({
this
.
setData
({
navbarTitle
:
'儿童营地'
,
navbarTitle
:
'儿童营地
入园购票
'
,
banner
:
'service/detail-banner-3.png'
,
banner
:
'service/detail-banner-3.png'
,
bgColor
:
'#F6DADA'
,
bgColor
:
'#F6DADA'
,
buyText
:
'购买门票'
,
buyText
:
'购买门票'
,
...
@@ -309,6 +330,11 @@ Page({
...
@@ -309,6 +330,11 @@ Page({
* @returns
* @returns
*/
*/
onBuy
:
function
(
event
)
{
onBuy
:
function
(
event
)
{
if
(
this
.
data
.
shopInfo
.
appId
===
7
)
{
this
.
onCommodityDetail
(
event
)
return
}
let
funcCommodityInfo
=
event
.
currentTarget
.
dataset
.
item
let
funcCommodityInfo
=
event
.
currentTarget
.
dataset
.
item
// 补充必要参数
// 补充必要参数
...
@@ -322,4 +348,20 @@ Page({
...
@@ -322,4 +348,20 @@ Page({
url
:
'/pages/pay/order-input/order-input?type='
+
funcCommodityInfo
.
typeId
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
pages/commodity/project-detail/project-detail.wxml
View file @
aa0acf14
<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="container con-s" style="background: {{bgColor}}">
<view class="background-img">
<view class="background-img">
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
</view>
</view>
<block wx:for="{{commodityList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<block wx:for="{{commodityList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="project-wrapper col" data-item="{{item}}" bindtap="on
CommodityDetail
">
<view class="project-wrapper col" data-item="{{item}}" bindtap="on
Buy
">
<view class="project-cover">
<view class="project-cover">
<image src="{{item.cover}}"></image>
<image src="{{item.cover}}"></image>
</view>
</view>
...
...
pages/commodity/project/project.js
View file @
aa0acf14
let
App
=
getApp
()
let
App
=
getApp
()
let
logicData
=
{
pageScrollLock
:
false
,
pageScrollTimer
:
0
,
}
Page
({
Page
({
data
:
{
data
:
{
imageBase
:
App
.
globalData
.
appImageBase
,
imageBase
:
App
.
globalData
.
appImageBase
,
resourcesBase
:
App
.
globalData
.
appResourcesBase
,
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
:
[],
banner
:
[],
bannerIndex
:
0
,
bannerIndex
:
0
,
...
@@ -29,48 +48,35 @@ Page({
...
@@ -29,48 +48,35 @@ Page({
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
this
.
queryBanner
()
for
(
let
i
=
0
,
l
=
this
.
data
.
shopAppId
.
length
;
i
<
l
;
i
++
)
{
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
)
this
.
queryPassCheck
(
this
.
data
.
shopAppId
[
i
].
appId
,
this
.
data
.
shopAppId
[
i
].
commodityType
,
i
)
}
}
},
},
queryBanner
:
function
(
funcShopAppId
,
funcIndex
)
{
queryBanner
:
function
()
{
let
funcType
=
''
switch
(
funcShopAppId
)
{
case
1
:
funcType
=
3
break
case
3
:
funcType
=
2
if
(
funcIndex
===
3
)
funcIndex
=
2
break
case
7
:
funcType
=
4
break
}
App
.
wxRequest
({
App
.
wxRequest
({
url
:
'/api/v1/banner/getOfficeByBanner'
,
url
:
'/api/v1/banner/getOfficeByBanner'
,
data
:
{
data
:
{
'smColumnId'
:
funcType
,
'smColumnId'
:
1
,
},
},
success
:
(
response
)
=>
{
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
let
funcResponse
=
response
.
data
let
funcBanner
=
this
.
data
.
banner
if
(
funcResponse
.
length
)
{
let
funcList
=
[]
funcBanner
[
funcIndex
]
=
funcResponse
[
0
].
img
for
(
let
i
=
0
,
l
=
funcResponse
.
length
;
i
<
l
;
i
++
)
{
}
else
{
let
funcItem
=
{
funcBanner
[
funcIndex
]
=
''
'id'
:
funcResponse
[
i
].
id
,
'cover'
:
funcResponse
[
i
].
img
}
funcList
.
push
(
funcItem
)
}
}
this
.
setData
({
this
.
setData
({
banner
:
func
Banner
banner
:
func
List
})
})
console
.
log
(
funcB
anner
)
console
.
log
(
this
.
data
.
b
anner
)
}
}
})
})
},
},
...
@@ -262,6 +268,22 @@ Page({
...
@@ -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 切换图片同步自定义标识组件
* banner 切换图片同步自定义标识组件
* @function
* @function
...
...
pages/commodity/project/project.wxml
View file @
aa0acf14
<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="container">
<view class="banner">
<view class="banner">
<swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="eventSwiperChange">
<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="bannerClick">
<image class="banner-swiper-image" src="{{item}}"></image>
<image class="banner-swiper-image" src="{{item
.cover
}}"></image>
</swiper-item>
</swiper-item>
</block>
</block>
</swiper>
</swiper>
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
</view>
</view>
<view class="commodity-list">
<view class="commodity-list">
<block wx:for="{{shopCommodityData[0]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<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">
<view class="commodity-cover">
<image src="{{item.cover}}"></image>
<image src="{{item.cover}}"></image>
</view>
</view>
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
</block>
</block>
<view class="commodity-price-operation row con-e align-c">
<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>
</view>
</view>
</view>
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
</view>
</view>
<view class="commodity-list">
<view class="commodity-list">
<block wx:for="{{shopCommodityData[1]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<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">
<view class="commodity-cover">
<image src="{{item.cover}}"></image>
<image src="{{item.cover}}"></image>
</view>
</view>
...
@@ -160,7 +160,7 @@
...
@@ -160,7 +160,7 @@
</block>
</block>
<view class="commodity-price-operation row con-e align-c">
<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>
</view>
</view>
</view>
...
@@ -176,7 +176,7 @@
...
@@ -176,7 +176,7 @@
</view>
</view>
<view class="commodity-list">
<view class="commodity-list">
<block wx:for="{{shopCommodityData[2]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<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">
<view class="commodity-cover">
<image src="{{item.cover}}"></image>
<image src="{{item.cover}}"></image>
</view>
</view>
...
@@ -226,14 +226,14 @@
...
@@ -226,14 +226,14 @@
</block>
</block>
<view class="commodity-price-operation row con-e align-c">
<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>
</view>
</view>
</view>
</block>
</block>
<block wx:for="{{shopCommodityData[3]}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<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">
<view class="commodity-cover">
<image src="{{item.cover}}"></image>
<image src="{{item.cover}}"></image>
</view>
</view>
...
@@ -283,7 +283,7 @@
...
@@ -283,7 +283,7 @@
</block>
</block>
<view class="commodity-price-operation row con-e align-c">
<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>
</view>
</view>
</view>
...
...
pages/home/guide/js/point.js
View file @
aa0acf14
...
@@ -110,7 +110,7 @@ let output = [
...
@@ -110,7 +110,7 @@ let output = [
},
{
},
{
x
:
2794
,
x
:
2794
,
y
:
600
,
y
:
600
,
id
:
''
,
id
:
3
,
name
:
'儿童营地'
,
name
:
'儿童营地'
,
icon
:
'./image/icon/13.png'
,
icon
:
'./image/icon/13.png'
,
card
:
'guide/card/13.png'
,
card
:
'guide/card/13.png'
,
...
...
pages/pay/coupon-detail/coupon-detail.wxss
View file @
aa0acf14
.container {
.container {
margin-top:
15
0rpx;
margin-top:
20
0rpx;
padding-bottom: 196rpx;
padding-bottom: 196rpx;
}
}
.list-wrapper {
.list-wrapper {
...
...
pages/pay/order-input/order-input.js
View file @
aa0acf14
...
@@ -874,6 +874,7 @@ Page({
...
@@ -874,6 +874,7 @@ Page({
},
},
success
:
(
response
)
=>
{
success
:
(
response
)
=>
{
if
(
/ 商品不存在/
.
test
(
response
.
data
.
msg
))
{
if
(
/ 商品不存在/
.
test
(
response
.
data
.
msg
))
{
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[])
wx
.
lin
.
showToast
({
wx
.
lin
.
showToast
({
title
:
'商品已下架,请重新下单。'
,
title
:
'商品已下架,请重新下单。'
,
icon
:
'error'
,
icon
:
'error'
,
...
@@ -887,6 +888,7 @@ Page({
...
@@ -887,6 +888,7 @@ Page({
}
}
if
(
/价格不一致/
.
test
(
response
.
data
.
msg
))
{
if
(
/价格不一致/
.
test
(
response
.
data
.
msg
))
{
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[])
wx
.
lin
.
showToast
({
wx
.
lin
.
showToast
({
title
:
'价格已变更,请重新下单。'
,
title
:
'价格已变更,请重新下单。'
,
icon
:
'error'
,
icon
:
'error'
,
...
...
pages/play/service-detail/service-detail.js
View file @
aa0acf14
...
@@ -9,6 +9,7 @@ let logicData = {
...
@@ -9,6 +9,7 @@ let logicData = {
Page
({
Page
({
data
:
{
data
:
{
imageBase
:
App
.
globalData
.
appImageBase
,
imageBase
:
App
.
globalData
.
appImageBase
,
resourcesBase
:
App
.
globalData
.
appResourcesBase
,
option
:
{},
option
:
{},
// 弹出控制
// 弹出控制
...
@@ -61,7 +62,7 @@ Page({
...
@@ -61,7 +62,7 @@ Page({
detailActivity
:
[],
// 活动
detailActivity
:
[],
// 活动
detailCommodity
:
[],
// 商品
detailCommodity
:
[],
// 商品
detailEvaluate
:
[],
// 评论
detailEvaluate
:
[],
// 评论
evaluateAlbum
:
[],
isBlack
:
false
,
isBlack
:
false
,
...
@@ -74,6 +75,7 @@ Page({
...
@@ -74,6 +75,7 @@ Page({
winActivity
:
false
,
// 近期活动
winActivity
:
false
,
// 近期活动
winCommodity
:
false
,
// 商品列表
winCommodity
:
false
,
// 商品列表
winCommodityMenu
:
false
,
winCommodityMenu
:
false
,
winEvaluateAlbum
:
false
,
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
...
@@ -149,7 +151,6 @@ Page({
...
@@ -149,7 +151,6 @@ Page({
* @returns
* @returns
*/
*/
queryDetail
:
function
(
funcAppId
)
{
queryDetail
:
function
(
funcAppId
)
{
let
that
=
this
let
funcIndex
=
0
let
funcIndex
=
0
// 预设数据
// 预设数据
let
funcDetail
=
[
let
funcDetail
=
[
...
@@ -313,7 +314,7 @@ Page({
...
@@ -313,7 +314,7 @@ Page({
// 查询景点信息
// 查询景点信息
App
.
wxRequest
({
App
.
wxRequest
({
url
:
'/api/v1/park/getList'
,
url
:
'/api/v1/park/getList'
,
success
:
function
(
res
)
{
success
:
(
res
)
=>
{
let
funcData
=
res
.
list
let
funcData
=
res
.
list
funcDetail
.
forEach
(
shop
=>
{
funcDetail
.
forEach
(
shop
=>
{
funcData
.
forEach
(
item
=>
{
funcData
.
forEach
(
item
=>
{
...
@@ -326,7 +327,7 @@ Page({
...
@@ -326,7 +327,7 @@ Page({
}
}
})
})
})
})
th
at
.
setData
({
th
is
.
setData
({
banner
:
funcDetail
[
funcIndex
].
banner
,
banner
:
funcDetail
[
funcIndex
].
banner
,
shareImage
:
funcDetail
[
funcIndex
].
shareImage
,
shareImage
:
funcDetail
[
funcIndex
].
shareImage
,
info
:
{
info
:
{
...
@@ -519,10 +520,70 @@ Page({
...
@@ -519,10 +520,70 @@ Page({
'pageSize'
:
'-1'
,
'pageSize'
:
'-1'
,
'officeId'
:
this
.
data
.
shopInfo
.
id
'officeId'
:
this
.
data
.
shopInfo
.
id
},
},
success
:
(
res
)
=>
{
success
:
(
response
)
=>
{
let
funcData
=
res
.
data
let
funcResponse
=
response
.
data
let
funcList
=
[]
for
(
let
i
=
0
,
l
=
funcResponse
.
list
.
length
;
i
<
l
;
i
++
)
{
let
funcItem
=
{
'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
)
}
this
.
setData
({
detailEvaluate
:
funcList
})
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
({
this
.
setData
({
detailEvaluate
:
funcData
.
list
detailEvaluate
:
funcEvaluate
})
})
})
}
}
})
})
...
@@ -711,4 +772,54 @@ Page({
...
@@ -711,4 +772,54 @@ Page({
url
:
'/pages/play/movie/movie'
,
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
pages/play/service-detail/service-detail.wxml
View file @
aa0acf14
<!-- 畅玩 - 商店详情 -->
<navigation class="navigation" titleText="{{info.title}}" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<navigation class="navigation" titleText="{{info.title}}" color="#ffffff" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<view class="container" wx:if="{{option.id !== '2'}}">
<view class="container" wx:if="{{option.id !== '2'}}">
<view id="banner" class="banner">
<view id="banner" class="banner">
...
@@ -79,6 +78,7 @@
...
@@ -79,6 +78,7 @@
<block wx:if="{{detailActivity.length === 0}}">
<block wx:if="{{detailActivity.length === 0}}">
<view class="commodity-card-item-nothing col con-c align-c">
<view class="commodity-card-item-nothing col con-c align-c">
<image src="{{imageBase + 'icon/fireworks-2.png'}}"></image>
<text>近期暂无活动安排</text>
<text>近期暂无活动安排</text>
</view>
</view>
</block>
</block>
...
@@ -166,19 +166,19 @@
...
@@ -166,19 +166,19 @@
<view class="evaluate-option-item row align-c">
<view class="evaluate-option-item row align-c">
<image src="{{imageBase + 'icon/evaluate-1.png'}}"></image>
<image src="{{imageBase + 'icon/evaluate-1.png'}}"></image>
<text>服务</text>
<text>服务</text>
<text>
0.5
</text>
<text>
{{officeServiceText}}
</text>
<text>分</text>
<text>分</text>
</view>
</view>
<view class="evaluate-option-item row align-c">
<view class="evaluate-option-item row align-c">
<image src="{{imageBase + 'icon/shop-1.png'}}"></image>
<image src="{{imageBase + 'icon/shop-1.png'}}"></image>
<text>产品</text>
<text>产品</text>
<text>
0.5
</text>
<text>
{{officeProductText}}
</text>
<text>分</text>
<text>分</text>
</view>
</view>
<view class="evaluate-option-item row align-c">
<view class="evaluate-option-item row align-c">
<image src="{{imageBase + 'icon/album-1.png'}}"></image>
<image src="{{imageBase + 'icon/album-1.png'}}"></image>
<text>环境</text>
<text>环境</text>
<text>
0.5
</text>
<text>
{{officeEnvironmentalText}}
</text>
<text>分</text>
<text>分</text>
</view>
</view>
</view>
</view>
...
@@ -187,35 +187,47 @@
...
@@ -187,35 +187,47 @@
<block wx:for="{{detailEvaluate}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<block wx:for="{{detailEvaluate}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="evaluate-item col">
<view class="evaluate-item col">
<view class="row">
<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">
<view class="evaluate-item-info-text row align-c">
<view class="evaluate-item-info-text row align-c">
<text>{{item.
n
ame}}</text>
<text>{{item.
userN
ame}}</text>
<text>业主</text>
<text>业主</text>
<text>{{item.date}}</text>
<text>{{item.date}}</text>
</view>
</view>
<view class="evaluate-item-info-star row align-c">
<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">
<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>
</block>
</view>
</view>
</view>
</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>
<text>{{item.content}}</text>
</view>
</view>
<
!-- <view class="evaluate-item-content-m
ore">
<
view class="evaluate-item-content-more" data-item="{{item}}" data-index="{{index}}" bindtap="onEvaluateM
ore">
<text>... </text>
<text>... </text>
<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>
<view class="evaluate-item-album">
<view class="evaluate-item-album">
<block wx:for="{{item.
imgUrls
}}" 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
src="{{itemAlbum}}" bindtap="onPreviewImage" data-index="{{index}}" data-url="{{itemAlbum}}
"></image>
<image
wx:if="{{indexAlbum < 4}}" src="{{itemAlbum}}" data-index="{{indexAlbum}}" data-item="{{item}}" bindtap="onEvaluateAlbum
"></image>
</block>
</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>
</view>
</view>
</block>
</block>
...
@@ -427,3 +439,14 @@
...
@@ -427,3 +439,14 @@
</button>
</button>
</view>
</view>
</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
pages/play/service-detail/service-detail.wxss
View file @
aa0acf14
...
@@ -238,6 +238,22 @@
...
@@ -238,6 +238,22 @@
background: #F5F6F8;
background: #F5F6F8;
}
}
.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 {
.commodity-card-item {
width: 562rpx;
width: 562rpx;
margin-right: 24rpx;
margin-right: 24rpx;
...
@@ -599,6 +615,7 @@
...
@@ -599,6 +615,7 @@
}
}
/* 评论详情 */
/* 评论详情 */
.evaluate-item {
.evaluate-item {
position: relative;
width: 670rpx;
width: 670rpx;
min-height: 292rpx;
min-height: 292rpx;
margin: 48rpx 40rpx 0 40rpx;
margin: 48rpx 40rpx 0 40rpx;
...
@@ -657,6 +674,7 @@
...
@@ -657,6 +674,7 @@
.evaluate-item-content {
.evaluate-item-content {
position: relative;
position: relative;
width: 670rpx;
width: 670rpx;
min-height: 88rpx;
max-height: 132rpx;
max-height: 132rpx;
margin-top: 32rpx;
margin-top: 32rpx;
overflow: hidden;
overflow: hidden;
...
@@ -667,6 +685,18 @@
...
@@ -667,6 +685,18 @@
color: #15191F;
color: #15191F;
}
}
.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 {
.evaluate-item-content-more {
position: absolute;
position: absolute;
bottom: 0;
bottom: 0;
...
@@ -690,6 +720,7 @@
...
@@ -690,6 +720,7 @@
}
}
.evaluate-item-album {
.evaluate-item-album {
position: relative;
display: flex;
display: flex;
flex-wrap: wrap;
flex-wrap: wrap;
flex-direction: row;
flex-direction: row;
...
@@ -712,7 +743,46 @@
...
@@ -712,7 +743,46 @@
.evaluate-item-album image:nth-child(4n) {
.evaluate-item-album image:nth-child(4n) {
margin-right: 0;
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%;
}
}
/* 价格样式 */
/* 价格样式 */
...
...
pages/play/service-sell/service-sell.js
View file @
aa0acf14
...
@@ -49,7 +49,7 @@ Page({
...
@@ -49,7 +49,7 @@ Page({
let
funcItem
=
{
let
funcItem
=
{
'name'
:
funcResponse
.
name
,
'name'
:
funcResponse
.
name
,
'time'
:
funcResponse
.
spaMins
,
'time'
:
funcResponse
.
spaMins
+
'mins'
,
'address'
:
'元养水韵SPA'
,
'address'
:
'元养水韵SPA'
,
'content'
:
funcResponse
.
particulars
,
'content'
:
funcResponse
.
particulars
,
...
...
pages/play/service-sell/service-sell.wxml
View file @
aa0acf14
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<view class="time-address-title">
<view class="time-address-title">
<text>时长</text>
<text>时长</text>
</view>
</view>
<view class="time-address">
<view class="time-address"
wx:if="{{serviceInfo.time}}"
>
<text>{{serviceInfo.time}}</text>
<text>{{serviceInfo.time}}</text>
</view>
</view>
</view>
</view>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment