Browse Source

博物馆

master
caichunsheng 4 years ago
parent
commit
f7847d1167
  1. 9
      pages/index/index.js
  2. 14
      pages/index/index.wxml
  3. 29
      pages/list/comments/index.js
  4. 3
      pages/list/comments/index.wxml
  5. 11
      pages/list/comments/index.wxss

9
pages/index/index.js

@ -461,7 +461,6 @@ Page({
bannerClick: function (e) {
if (this.data.isTest) return;
let item = e.currentTarget.dataset.item;
console.log(item)
this.pagePoint({
event: "banner_click",
type: 'banner'
@ -543,6 +542,14 @@ Page({
return;
},
//博物馆跳转 直接跳君到苏州H5
goH5:function(e){
console.log(e.currentTarget.dataset.path);
app.globalData.weburl ='https://m.cloud.sz-trip.com/' + e.currentTarget.dataset.path;
wx.navigateTo({
url: "/pages/pbService/web/index"
})
},
bannerClick2: function (e) {
let item = e.currentTarget.dataset.item;
if (item.action == 'href') {

14
pages/index/index.wxml

@ -159,15 +159,25 @@
<image src="https://static.ticket.sz-trip.com/xcxImages/index/newpb2.png" mode="widthFix"></image>
<view>非遗传承</view>
</view>
<view bindtap="gotoPath" data-event="culture_search_click" data-title="文物查询"
<!-- <view bindtap="gotoPath" data-event="culture_search_click" data-title="文物查询"
data-path="/pages/pbService/wwcx/index" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/newpb3.png" mode="widthFix"></image>
<view>文物查询</view>
</view> -->
<view bindtap="goH5" data-title="文化场馆查询"
data-path="Museum" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/uploads/20220907/9fb0bc6ed4ba61b198b1928985d1645d.png" mode="widthFix"></image>
<view>文化场馆查询</view>
</view>
<view bindtap="gotoPath" data-event="museum_search_click" data-title="博物馆查询"
<!-- <view bindtap="gotoPath" data-event="museum_search_click" data-title="博物馆查询"
data-path="/pages/pbService/museum/index" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/xcxImages/index/newpb6.png" mode="widthFix"></image>
<view>博物馆查询</view>
</view> -->
<view bindtap="goH5" data-title="数字博物馆"
data-path="BwsInfo" class="pbservice-item">
<image src="https://static.ticket.sz-trip.com/uploads/20220907/d50f492083b419b9b538de274423084c.png" mode="widthFix"></image>
<view>数字博物馆</view>
</view>
<view bindtap="gotoUrl" data-title="数字文物"
data-url="https://foxnut-gffcu6t2.pai.tcloudbase.com/suzhouguobao/index.html#/" class="pbservice-item">

29
pages/list/comments/index.js

@ -23,7 +23,6 @@ Page({
})
}
else if(options.sceneid){
console.log(options.index);
this.setData({
sceneid:options.sceneid,
index:options.index,
@ -42,8 +41,7 @@ Page({
if(this.data.sceneid){
service = "scene/get_comment"
}
commonApi._post(service,data).then(res=>{
console.log(res)
commonApi.user_post(service,data).then(res=>{
// this.setData({
// total:res.data.total,
// list:list.concat(res.data.list)
@ -72,16 +70,37 @@ Page({
})
},
imgsc:function(e){
console.log(e);
var src = e.currentTarget.dataset.img;//获取data-src
var imgList = e.currentTarget.dataset.list;//获取data-list
console.log(src)
//图片预览
wx.previewImage({
current: src, // 当前显示图片的http链接
urls: imgList // 需要预览的图片http链接列表
})
},
zan:function(e){
let item = e.currentTarget.dataset.item;//获取data-src
let index = e.currentTarget.dataset.index;//获取data-src
let arr = this.data.list
let url = "scene/comment_star"; //点
if (item.is_star == 1) {
url = "scene/comment_cancel_star"; //取消
}
commonApi.user_post(url,{comment_id: item.id}).then(res=>{
if (res) {
if (item.is_star == 1) {
arr[index].is_star = 0
}else{
arr[index].is_star = 1
}
this.setData({
list:arr
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

3
pages/list/comments/index.wxml

@ -1,7 +1,7 @@
<!--pages/list/comments/index.wxml-->
<title title="评论"></title>
<view class="comment-title">全部评论</view>
<view class="comment-item" wx:for="{{list}}">
<view class="comment-item" wx:for="{{list}}" wx:for-index="index">
<view class="comment-top">
<image src="{{item.user.avatar}}" mode="aspectFill"></image>
<view class="author-info">
@ -19,6 +19,7 @@
<view wx:if="{{item.img_list}}">
<image class="imgs" wx:for="{{item.img_list}}" wx:for-item="Goods" mode="scaleToFill" data-img="{{Goods}}" data-list="{{item.img_list}}" src="{{Goods}}" bindtap="imgsc"></image>
</view>
<view bindtap="zan" data-item="{{item}}" data-index="{{index}}" class="iconfont icon-zan{{item.is_star==1?' active':''}}"></view>
</view>
<view wx:if="{{list.length==0}}" class="common-empty" style="z-index:-1">

11
pages/list/comments/index.wxss

@ -9,9 +9,10 @@
}
.comment-item {
margin: 0 25rpx;
padding: 30rpx 0;
padding: 30rpx 0 40rpx 0;
margin-top: 10rpx;
border-bottom: 1rpx solid #d9d9d9;
}
.comment-top {
display: flex;
@ -71,4 +72,12 @@
color: #666;
margin-left:20rpx ;
font-size: 24rpx;
}
.iconfont.icon-zan{
float: right;
font-size: 46rpx;
color: #999999;
}
.icon-zan.active {
color: red;
}
Loading…
Cancel
Save