Myth 5 years ago
parent
commit
92c18a968f
  1. 3
      app.js
  2. 3
      app.json
  3. 114
      pages/activity/graduate/index.js
  4. 3
      pages/activity/graduate/index.json
  5. 30
      pages/activity/graduate/index.wxml
  6. 132
      pages/activity/graduate/index.wxss
  7. 2
      pages/kj/his/index.wxml
  8. 77
      pages/kj/index.js
  9. 6
      pages/kj/index.wxml
  10. 21
      pages/kj/info/index.js
  11. 14
      pages/kj/info/index.wxml
  12. 131
      pages/kj/mine/index.js
  13. 4
      pages/kj/mine/index.json
  14. 39
      pages/kj/mine/index.wxml
  15. 117
      pages/kj/mine/index.wxss
  16. 122
      pages/map/index.js
  17. 33
      pages/map/index.wxml
  18. 140
      pages/map/index.wxss
  19. 19
      pages/order/postOrder/index.js
  20. 4
      pages/order/postOrder/index.wxml
  21. 44
      pages/pbService/appreciate/info/index.js
  22. 12
      pages/pbService/appreciate/info/index.wxml
  23. 13
      pages/pbService/appreciate/info/index.wxss
  24. 5
      pages/pbService/index.wxml
  25. 109
      pages/pbService/museum/index.js
  26. 5
      pages/pbService/museum/index.json
  27. 31
      pages/pbService/museum/index.wxml
  28. 114
      pages/pbService/museum/index.wxss
  29. 74
      pages/pbService/museum/info/index.js
  30. 5
      pages/pbService/museum/info/index.json
  31. 27
      pages/pbService/museum/info/index.wxml
  32. 45
      pages/pbService/museum/info/index.wxss
  33. 2
      project.config.json
  34. 6
      project.private.config.json
  35. 4
      utils/https.js
  36. 23
      utils/util.js

3
app.js

@ -99,6 +99,7 @@ App({
WEIXIN:"微信支付", WEIXIN:"微信支付",
JIANSHEYINHANG:"建行支付", JIANSHEYINHANG:"建行支付",
ZHIFUBAO:"支付宝支付" ZHIFUBAO:"支付宝支付"
} },
kjId:null
} }
}) })

3
app.json

@ -87,6 +87,8 @@
"pages/list/minitrip/index", "pages/list/minitrip/index",
"pages/list/oneday/index", "pages/list/oneday/index",
"pages/pbService/index", "pages/pbService/index",
"pages/pbService/museum/index",
"pages/pbService/museum/info/index",
"pages/pbService/PRpark/index", "pages/pbService/PRpark/index",
"pages/pbService/sceneComfort/index", "pages/pbService/sceneComfort/index",
"pages/pbService/gym/index", "pages/pbService/gym/index",
@ -113,6 +115,7 @@
"pages/ask/index", "pages/ask/index",
"pages/ask/info/index", "pages/ask/info/index",
"pages/ask/my/index", "pages/ask/my/index",
"pages/activity/graduate/index",
"pages/activity/year2020/index", "pages/activity/year2020/index",
"pages/activity/suyear/index", "pages/activity/suyear/index",
"pages/activity/spring2021/index", "pages/activity/spring2021/index",

114
pages/activity/graduate/index.js

@ -0,0 +1,114 @@
// pages/activity/graduate/index.js
import commonApi from "../../../utils/https/common"
import util from "../../../utils/util"
Page({
/**
* 页面的初始数据
*/
data: {
list:[[],[],[],[]]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let ajaxes = [],list = [];
wx.showLoading({
title: '加载中',
});
['62','63','64'].map(item=>{
ajaxes.push(commonApi._post("product/get_product_by_tag",{
tag_id: item,
offset: 0,
limit: 100
}))
});
ajaxes.push(commonApi._post("scene/get_scene_by_tag",{
tag_id: 30,
offset: 0,
limit: 100
}))
Promise.all(ajaxes).then(res=>{
res.map(item=>{
item.data.list.map(i=>{
i.display_tags = i.display_tags?i.display_tags.split(","):[];
i.display_tags = i.display_tags.slice(0,2);
})
list.push(item.data.list);
})
this.setData({
list:list
})
wx.hideLoading({})
})
},
gotoDetail:function(e){
let item = e.currentTarget.dataset.item;
util.gotoDetail(item)
},
scrollToBox:function(e){
let index = e.currentTarget.dataset.index;
const query=wx.createSelectorQuery(); //创建节点查询器
query.select("#box"+index).boundingClientRect() //选择toViewid获取位置信息
query.selectViewport().scrollOffset() //获取页面查询位置的
query.exec(function(res) {
console.log(res)
let scrollTop = res[0].top + res[1].scrollTop ;
wx.pageScrollTo({
scrollTop: scrollTop - 60,
duration: 200
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/activity/graduate/index.json

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

30
pages/activity/graduate/index.wxml

@ -0,0 +1,30 @@
<!--pages/activity/graduate/index.wxml-->
<view style="position:relative;min-height:100vh">
<image style="position:absolute;top:0;left:0" class="mainimg" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/activity/graduate/top.png" mode="widthFix"></image>
<view class="top-menus">
<view class="top-menu" bindtap="scrollToBox" data-index="1">好玩景点</view>
<view class="top-menu" bindtap="scrollToBox" data-index="2">一日游</view>
<view class="top-menu" bindtap="scrollToBox" data-index="3">文创特产</view>
<view class="top-menu" bindtap="scrollToBox" data-index="4">精选酒店</view>
</view>
<view style="height:650rpx"></view>
<view class="list" wx:for="{{list}}" id="box{{index+1}}">
<image class="titleimg" mode="widthFix" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/activity/graduate/title{{index+1}}.png"></image>
<view class="list-box">
<view class="item" wx:for="{{item}}" bindtap="gotoDetail" data-item="{{item}}">
<image class="mainimg" src="{{item.headimg}}" mode="aspectFill"></image>
<view class="title textOver">{{item.title}}</view>
<view class="product-tags">
<view class="product-tag textOver" wx:for="{{item.display_tags}}">{{item}}</view>
</view>
<view class="product-bottom">
<view class="price">¥<text>{{item.price/100}}</text></view>
<image mode="widthFix" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/activity/graduate/btn.png"></image>
</view>
</view>
</view>
</view>
<view style="height:80rpx"></view>
<image class="bottomtext" mode="widthFix" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/activity/graduate/bottom.png"></image>
<image class="bottombg" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/activity/graduate/bottombg.png" mode="widthFix"></image>
</view>

132
pages/activity/graduate/index.wxss

@ -0,0 +1,132 @@
/* pages/activity/graduate/index.wxss */
.mainimg {
display: block;
width: 100%;
}
page {
background: url(https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/activity/graduate/bg.png);
background-size: 100%;
background-repeat: repeat-y;
}
.top-menus {
display: flex;
align-items: center;
position: absolute;
justify-content: space-between;
left: 34rpx;
right: 34rpx;
top: 546rpx;
z-index: 1;
color: #fff;
line-height: 51rpx;
}
.top-menu {
width: 149rpx;
border-radius: 19rpx;
font-size: 26rpx;
flex-shrink: 0;
letter-spacing: 3rpx;
background: #308506;
text-align: center;
font-weight: lighter;
}
.list {
position: relative;
margin: 10rpx 27rpx;
border: solid 1rpx #7c9112;
padding: 8rpx;
border-radius: 16rpx;
z-index: 1;
margin-bottom: 40rpx;
}
.list-box {
border-radius: 16rpx;
background-color: #f6f0e4;
border: solid 3rpx #7c9112;
padding: 56rpx 30rpx;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.item .mainimg {
width: 286rpx;
height: 253rpx;
border-radius: 16rpx;
}
.item {
border-radius: 16rpx;
padding: 7rpx;
width: 286rpx;
border: 1rpx dashed;
color: #7c9112;
margin-top: 27rpx;
}
.titleimg {
position: absolute;
display: block;
width: 326rpx;
height: 67rpx;
left: 50%;
margin-left: -163rpx;
top: -28rpx;
}
.item .title {
font-size: 25rpx;
line-height: 38rpx;
letter-spacing: -2rpx;
color: #469115;
margin: 5rpx 10rpx;
}
.product-tags {
margin: 0 10rpx;
display: flex;
align-items: center;
margin-bottom: 10rpx;
height: 20rpx;
}
.product-tag {
line-height: 20rpx;
background-color: #b1c346;
padding: 0 15rpx;
font-size: 12rpx;
color: #495800;
margin-right: 8rpx;
}
.product-tags:last-child {
margin-right: 0;
}
.product-bottom {
display: flex;
justify-content: space-between;
margin: 0 10rpx;
padding-bottom: 6rpx;
color: #6ea21b;
font-size: 14rpx;
align-items: flex-end;
}
.product-bottom image {
width: 120rpx;
display: block;
flex-shrink: 0;
}
.product-bottom text {
font-size: 31rpx;
font-weight: 500;
line-height: 31rpx;
margin-left: 10rpx;
}
.bottombg {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
display: block;
z-index: 0;
}
.bottomtext {
position: absolute;
right: 0;
width: 439rpx;
bottom: 0;
z-index: 2;
}

2
pages/kj/his/index.wxml

@ -1,7 +1,7 @@
<!--pages/info/pddInfo/pddhis/index.wxml--> <!--pages/info/pddInfo/pddhis/index.wxml-->
<title title="帮砍记录"></title> <title title="帮砍记录"></title>
<view class="his-item" wx:for="{{list}}"> <view class="his-item" wx:for="{{list}}">
<image src="{{item.helpUserAvatar}}" mode="aspectFill"></image> <image src="{{item.avatar}}" mode="aspectFill"></image>
<view class="his-info"> <view class="his-info">
<view class="username">{{item.help_user_name}}</view> <view class="username">{{item.help_user_name}}</view>
<view class="his-time">{{item.created_time}}</view> <view class="his-time">{{item.created_time}}</view>

77
pages/kj/index.js

@ -1,5 +1,6 @@
// pages/user/pdd/index.js // pages/user/pdd/index.js
import productApi from "../../utils/https/common" import productApi from "../../utils/https/common"
import util from "../../utils/util"
let timer = null,app = getApp(); let timer = null,app = getApp();
Page({ Page({
@ -25,7 +26,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// this.getMine(); this.getMine();
productApi.user_post("activity.haggle/get_act_list",{limit:100,page:1}).then(res=>{ productApi.user_post("activity.haggle/get_act_list",{limit:100,page:1}).then(res=>{
this.setData({ this.setData({
menuList:res.data.data, menuList:res.data.data,
@ -60,73 +61,54 @@ Page({
this.getList() this.getList()
}, },
gotoDetail:function(e){ gotoDetail:function(e){
let data = e.currentTarget.dataset; let data = e.currentTarget.dataset,that = this;
if(data.index || data.index==0){ if(data.index || data.index==0){
let item = this.data.list[data.index]; let item = this.data.list[data.index];
console.log(item) console.log(item)
// 已砍成已下单 // 已砍成已下单
if(item.myOriginateFlag=='over' && item.isBuyed==1){ if(item.buy_status=='end'){
wx.showModal({ wx.showModal({
title:"提示", title:"提示",
content:"单个商品单账户只可参与一次,是否原价购买", content:"单个商品单账户只可参与一次,是否原价购买",
confirmColor:"#e14135", confirmColor:"#e14135",
success:function(res){ success:function(res){
if(res.confirm){ if(res.confirm){
wx.navigateTo({ that.gotoProduct(item.goods_id)
url: '/pages/info/'+(item.frontShowModel=='line'?'productInfo':'skuProductInfo')+'/index?id='+item.productId
})
} }
} }
}) })
return; return;
} }
// 已砍成未下单 // 已砍成未下单
if(item.myOriginateFlag=='over' && item.isBuyed!=1){ if(item.buy_status=='over'){
productApi._get('productfront/getProductInfo',{ app.globalData.kjId = item.buy_id;
productId:item.productId // todo
}).then(res=>{ util.goKjOrder(item).then(product=>{
if(!res.data){ app.globalData.couponInfo = null;
wx.showToast({ if(item.type=='post'){
title:"该产品不存在或已下架", app.globalData.postProduct = product;
icon:'none' wx.navigateTo({
}) url: '/pages/order/postOrder/index',
return;
}
let skuIndex = res.data.skuInfo.findIndex(skuItem=>skuItem.id==item.skuId);
if(skuIndex==-1) {
wx.showToast({
title:"该产品规格不存在",
icon:'none'
}) })
return;
} }
let sku = res.data.skuInfo[skuIndex]; else if(item.type=='ticket' || item.type=='scene'){
app.globalData.shoppingCart=[{ app.globalData.product = product;
baseInfo:res.data.baseInfo,
modelInfo:sku.modelInfo,
skuInfo:sku,
productNum:1
}]
app.globalData.discounts = 0;
// todo
app.globalData.kjOrderId = item.originateId || null
wx.navigateTo({ wx.navigateTo({
url: '/pages/order/index', url: '/pages/order/scene/index',
}) })
}
}) })
return; return;
} }
// 已售罄 // 已售罄
if(item.stock<=0){ if(item.act_stock<=0){
wx.showModal({ wx.showModal({
title:"提示", title:"提示",
content:"此商品已售罄,是否原价购买", content:"此商品已售罄,是否原价购买",
confirmColor:"#e14135", confirmColor:"#e14135",
success:function(res){ success:function(res){
if(res.confirm){ if(res.confirm){
wx.navigateTo({ that.gotoProduct(item.goods_id)
url: '/pages/info/'+(item.frontShowModel=='line'?'productInfo':'skuProductInfo')+'/index?id='+item.productId
})
} }
} }
}) })
@ -138,13 +120,24 @@ Page({
url:"info/index?id="+data.id+"&sid="+data.sid+"&aid="+data.aid url:"info/index?id="+data.id+"&sid="+data.sid+"&aid="+data.aid
}) })
}, },
gotoProduct:function(id){
productApi._post("product/get_product_detail",{
id:id
}).then(res=>{
util.gotoDetail(res.data)
})
},
getMine:function(){ getMine:function(){
productApi.user_post("kj/getMyKjIngProductsNeedAuth",{}).then(res=>{ productApi.user_post("order/my_haggle_list?status=1&limit=100&page=1",{
}).then(res=>{
this.setData({ this.setData({
mineList:this.data.showMoreFlag?res.data:res.data.slice(0,2), mineList:this.data.showMoreFlag?res.data.data:res.data.data.slice(0,2),
mineAllList:res.data mineAllList:res.data.data
}) })
this.setTime(); this.setTime();
if(timer){
clearInterval(timer);
}
timer = setInterval(()=>{ timer = setInterval(()=>{
this.setTime() this.setTime()
},1000) },1000)
@ -213,7 +206,7 @@ Page({
setTime:function(){ setTime:function(){
let mineList = this.data.mineList,now = new Date().getTime(); let mineList = this.data.mineList,now = new Date().getTime();
mineList.map(item=>{ mineList.map(item=>{
let overTime = new Date(item.overTime.replace(/-/g,'/')).getTime(); let overTime = new Date(item.over_time.replace(/-/g,'/')).getTime();
if(overTime<=now){ if(overTime<=now){
item.isOver=true; item.isOver=true;
} }

6
pages/kj/index.wxml

@ -6,13 +6,13 @@
</view> </view>
<view class="list" wx:if="{{type==1}}"> <view class="list" wx:if="{{type==1}}">
<view class="top-line-box">我参与的活动</view> <view class="top-line-box">我参与的活动</view>
<navigator class="item" wx:for="{{mineList}}" wx:key="id" url="/pages/info/pddInfo/index?userid={{item.originateUserId}}&id={{item.id}}"> <navigator class="item" wx:for="{{mineList}}" wx:key="id" url="info/index?userid={{item.user_id}}&id={{item.act_product_id}}">
<view class="item-top"> <view class="item-top">
<image src="{{item.headimg}}" mode="aspectFill"></image> <image src="{{item.headimg}}" mode="aspectFill"></image>
<view class="item-info"> <view class="item-info">
<view class="item-info-top"> <view class="item-info-top">
<view class="item-title">{{item.title+item.sku_name}}</view> <view class="item-title">{{item.title+item.sku_name}}</view>
<view class="item-price">¥{{item.kjMoney/100}}</view> <view class="item-price">¥{{item.kj_money/100}}</view>
</view> </view>
<view class="item-info-bottom"> <view class="item-info-bottom">
<view class="item-info-time" wx:if="{{item.isOver}}">已结束</view> <view class="item-info-time" wx:if="{{item.isOver}}">已结束</view>
@ -70,7 +70,7 @@
<view wx:if="{{item.showList.length>2}}" class="morebtn" bindtap="showMore" data-index="{{index}}">{{item.showMoreFlag?'点击收起':'点击查看更多'}}</view> <view wx:if="{{item.showList.length>2}}" class="morebtn" bindtap="showMore" data-index="{{index}}">{{item.showMoreFlag?'点击收起':'点击查看更多'}}</view>
<view wx:if="{{nextList.length==0}}" style="font-size:24rpx;color:#fff;text-align:center;line-height:100rpx">暂无活动</view> <view wx:if="{{nextList.length==0}}" style="font-size:24rpx;color:#fff;text-align:center;line-height:100rpx">暂无活动</view>
</view> </view>
<navigator url="/pages/user/pdd/index" class="mine-btn"> <navigator url="mine/index" class="mine-btn">
<view>我的</view> <view>我的</view>
<view>砍价</view> <view>砍价</view>
</navigator> </navigator>

21
pages/kj/info/index.js

@ -1,5 +1,6 @@
// pages/info/pddInfo/index.js // pages/info/pddInfo/index.js
import productApi from "../../../utils/https/common"; import productApi from "../../../utils/https/common";
import util from "../../../utils/util"
let app = getApp(); let app = getApp();
let timer = null; let timer = null;
Page({ Page({
@ -12,7 +13,7 @@ Page({
showRuleFlag:false, showRuleFlag:false,
kjId:null, kjId:null,
isKj:false,//是否是被邀请进来砍价的 本人去除 isKj:false,//是否是被邀请进来砍价的 本人去除
isFollow:false,//是否已经关注公众号 isFollow:true,//是否已经关注公众号
showShareFlag:false,//是否显示公众号的二维码 showShareFlag:false,//是否显示公众号的二维码
userInfo:null, userInfo:null,
helpList:[] helpList:[]
@ -125,6 +126,13 @@ Page({
}) })
}, },
gotoProduct:function(){
productApi._post('product/get_product_detail',{
id:this.data.info.detail.goods_id
}).then(res=>{
util.gotoDetail(res.data);
})
},
// 如果已经发起活动的话需要倒计时 // 如果已经发起活动的话需要倒计时
setTime(){ setTime(){
let info = this.data.info; let info = this.data.info;
@ -196,11 +204,6 @@ Page({
this.setTime() this.setTime()
},1000) },1000)
} }
productApi.user_post("wx/get_user_keep",{}).then(res=>{
this.setData({
isFollow:res.data.subscribe==1
})
})
}, },
/** /**
@ -212,7 +215,7 @@ Page({
}, },
// 详情和下单的第一步 // 详情和下单的第一步
gotoDetail:function(e){ gotoDetail:function(e){
let info = this.data.info.baseInfo || null,type=e.currentTarget.dataset.type; let info = this.data.info.detail || null,type=e?e.currentTarget.dataset.type:null;
if(!info) return; if(!info) return;
if(type=='fail'){ if(type=='fail'){
wx.showModal({ wx.showModal({
@ -221,13 +224,13 @@ Page({
confirmColor:"#E14135", confirmColor:"#E14135",
success:function(res){ success:function(res){
if(res.confirm){ if(res.confirm){
this.pushOrderData() this.gotoProduct()
} }
} }
}) })
} }
else { else {
this.pushOrderData() this.gotoProduct()
} }
}, },
// 真实的获取产品信息去下单 // 真实的获取产品信息去下单

14
pages/kj/info/index.wxml

@ -2,12 +2,12 @@
<title title="砍价详情"></title> <title title="砍价详情"></title>
<view class="content" wx:if="{{info}}"> <view class="content" wx:if="{{info}}">
<view class="top-info" wx:if="{{info.user_record && info.user_record.over_time && info.isOver}}"> <view class="top-info" wx:if="{{info.user_record && info.user_record.over_time && info.isOver}}">
<image src="{{info.user_record.user_avatar}}" mode="aspectFill"></image> <image src="{{info.user_record.avatar}}" mode="aspectFill"></image>
<view class="time-tip time-tip1">已结束</view> <view class="time-tip time-tip1" style="margin-left:0">已结束</view>
<view class="rule-box" bindtap="showRule">活动规则</view> <view class="rule-box" bindtap="showRule">活动规则</view>
</view> </view>
<view class="top-info" wx:elif="{{info.user_record && info.user_record.over_time}}"> <view class="top-info" wx:elif="{{info.user_record && info.user_record.over_time}}">
<image src="{{info.user_record.user_avatar}}" mode="aspectFill"></image> <image src="{{info.user_record.avatar}}" mode="aspectFill"></image>
<view class="time-box">{{info.h}}</view> <view class="time-box">{{info.h}}</view>
<view class="time-tip">:</view> <view class="time-tip">:</view>
<view class="time-box">{{info.m}}</view> <view class="time-box">{{info.m}}</view>
@ -16,7 +16,11 @@
<view class="time-tip time-tip1">后结束</view> <view class="time-tip time-tip1">后结束</view>
<view class="rule-box" bindtap="showRule">活动规则</view> <view class="rule-box" bindtap="showRule">活动规则</view>
</view> </view>
<view wx:else style="height:30rpx"></view> <view class="top-info" wx:else>
<image src="{{userInfo.avatar}}" mode="aspectFill"></image>
<view class="time-tip time-tip1" style="margin-left:0">{{userInfo.nickname}}</view>
<view class="rule-box" bindtap="showRule">活动规则</view>
</view>
<view class="info-box"> <view class="info-box">
<view class="info-tip">砍至0元可进行购买</view> <view class="info-tip">砍至0元可进行购买</view>
<image src="{{info.detail.headimg}}" mode="aspectFill"></image> <image src="{{info.detail.headimg}}" mode="aspectFill"></image>
@ -27,7 +31,7 @@
<view class="info-price">¥{{info.detail.kj_money/100}}</view> <view class="info-price">¥{{info.detail.kj_money/100}}</view>
</view> </view>
<view class="info-top-right"> <view class="info-top-right">
<navigator url="../{{info.baseInfo.frontShowModel=='line'?'p':(info.baseInfo.frontShowModel=='ctriphotel'?'hotelP':'skuP')}}roductInfo/index?id={{info.baseInfo.frontShowModel=='ctriphotel'?info.baseInfo.winesceneId:info.baseInfo.productId}}" class="info-more">查看详情 ></navigator> <view bindtap="gotoProduct" class="info-more">查看详情 ></view>
<view class="info-num">数量:1</view> <view class="info-num">数量:1</view>
</view> </view>
</view> </view>

131
pages/kj/mine/index.js

@ -1,20 +1,129 @@
// pages/kj/mine/index.js // pages/user/pdd/index.js
import productApi from "../../../utils/https/common";
import util from "../../../utils/util"
let timer = null,app = getApp();
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
type:1,
list:[],
page:1,
total:1
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.getList()
},
changeType:function(e){
let type = e.currentTarget.dataset.type;
if(this.data.type==type) return;
this.setData({
type:type,
total:1,
page:1,
list:[]
})
this.getList();
},
gotoDetail:function(e){
let data = e.currentTarget.dataset.item;
if(this.data.type==2 && data.flag!='expired'){
if(data.flag=='end'){
this.goOrder(e);
}
else {
this.goProduct(e)
}
return;
}
wx.navigateTo({
url:"../info/index?id="+data.act_product_id+"&userid="+data.user_id
})
},
getList:function(){
if(this.data.list.length>=this.data.total) return;
productApi.user_post("order/my_haggle_list?limit=10&page="+this.data.page+"&status="+this.data.type,{}).then(res=>{
this.setData({
list:this.data.list.concat(res.data.data),
page:this.data.page+1,
total:res.data.total
})
if(this.data.type==1){
this.setTime();
if(timer){
clearInterval(timer);
}
timer = setInterval(()=>{
this.setTime()
},1000)
}
})
},
setTime:function(){
let list = this.data.list,now = new Date().getTime();
list.map(item=>{
let overTime = item.over_time;
overTime = new Date(overTime.replace(/-/g,'/')).getTime();
if(overTime<=now){
item.isOver=true;
}
else {
let t = (overTime - now)/1000;
let h = Math.floor(t/(60*60));
t = t - h * 60*60;
let m = Math.floor(t/60),s=Math.floor(t-m*60);
if(h<10) {
h="0"+h;
}
if(m<10) {
m="0"+m;
}
if(s<10) {
s="0"+s;
}
item.timeText=[h,m,s].join(" : ");
}
})
this.setData({
list:list
})
},
goProduct:function(e){
let item = e.currentTarget.dataset.item;
console.log(item);
productApi._post('product/get_product_detail',{
id:item.goods_id
}).then(res=>{
util.gotoDetail(res.data);
})
},
goOrder:function(e){
productApi.user_post("order/query",{
order_id:e.currentTarget.dataset.item.order_id,
}).then(res=>{
util.gotoOrder(res.data)
})
},
gotoPdd:function(){
let page = getCurrentPages();
if(page[page.length-2] && page[page.length-2].route && page[page.length-2].route.indexOf('pages/kj/index')!=-1){
// 如果是从专题页列表来的 那么直接返回
wx.navigateBack({
delta: -1,
})
}
else {
wx.navigateTo({
url: '/pages/kj/index',
})
}
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
@ -26,14 +135,22 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
if(this.data.list.length>0){
this.setTime();
timer = setInterval(()=>{
this.setTime()
},1000)
}
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {
if(timer){
clearInterval(timer);
timer = null;
}
}, },
/** /**
@ -54,7 +171,7 @@ Page({
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
this.getList()
}, },
/** /**

4
pages/kj/mine/index.json

@ -1,3 +1,5 @@
{ {
"usingComponents": {} "usingComponents": {
"title":"/pages/component/TitleHeader"
}
} }

39
pages/kj/mine/index.wxml

@ -1,2 +1,37 @@
<!--pages/kj/mine/index.wxml--> <!--pages/user/pdd/index.wxml-->
<text>pages/kj/mine/index.wxml</text> <title title="我的砍价"></title>
<view class="top-menus">
<view class="top-menu{{type==1?' active':''}}" bindtap="changeType" data-type="1">进行中</view>
<view class="top-menu{{type==2?' active':''}}" bindtap="changeType" data-type="2">砍成记录</view>
</view>
<view class="list">
<view class="item" wx:for="{{list}}" bindtap="gotoDetail" data-item="{{item}}">
<view class="item-top">
<image src="{{item.headimg}}" mode="aspectFill"></image>
<view class="item-info">
<view class="item-info-top">
<view class="item-title">{{item.title+item.sku_name}}</view>
<view class="item-price">¥{{item.kj_money/100}}</view>
</view>
<view class="item-info-bottom" wx:if="{{type==1}}">
<view class="item-info-time" wx:if="{{item.isOver}}">已结束</view>
<view class="item-info-time" wx:else><text>{{item.timeText}}</text>后结束</view>
<view class="info-btn">继续砍价</view>
</view>
<view class="item-info-bottom" wx:else>
砍成日期:{{item.finish_time}}
</view>
</view>
</view>
<view class="item-bottom" wx:if="{{type==2 && item.flag!='expired'}}">
<view class="info-btn" wx:if="{{item.flag=='over'}}" catchtap="goProduct" data-item="{{item}}">前往下单</view>
<view class="info-btn info-btn-new" wx:else catchtap="goOrder" data-item="{{item}}">查看订单</view>
</view>
</view>
</view>
<view wx:if="{{list.length==0 && type==1 || type==2 && over.length==0}}" class="common-empty" style="z-index:-1">
<image style="width:200rpx" mode="widthFix" src="https://resources.jszhwlpt.com/4d86a34e-4772-4649-b57f-b54c2ad222dc.png"></image>
<view wx:if="{{type==1}}">您暂时还未参加砍价活动</view>
<view wx:if="{{type==2}}">您暂时还未砍价成功</view>
<view wx:if="{{type==1}}" class="empty-btn" bindtap="gotoPdd">立即前往</view>
</view>

117
pages/kj/mine/index.wxss

@ -1 +1,116 @@
/* pages/kj/mine/index.wxss */ .top-menus {
position: fixed;
left: 0;
right: 0;
height: 80rpx;
background: white;
display: flex;
justify-content: space-around;
align-items: center;
font-size: 30rpx;
line-height: 80rpx;
}
page {
background: #F2F2F2;
}
.top-menu.active {
color: #E14135;
position: relative;
font-weight: 500;
}
.top-menu.active::after {
content: "1";
font-size: 0;
width: 40rpx;
height: 6rpx;
background: linear-gradient(270deg, #E14135, #FF9124);
display: block;
border-radius: 3rpx;
position: absolute;
left: 50%;
margin-left: -20rpx;
bottom: 10rpx;
}
.title-header {
background: #fff !important;
}
.item {
margin: 20rpx 30rpx;
background: white;
border-radius: 20rpx;
font-size: 26rpx;
}
.item-top {
display: flex;
padding: 30rpx;
}
.item-top image {
width: 160rpx;
height: 160rpx;
display: block;
flex-shrink: 0;
}
.item-info {
margin-left: 30rpx;
color: #333333;
display: flex;
flex-direction: column;
justify-content: space-between;
flex: 1;
height: 160rpx;
width: 440rpx;
}
.item-info-top {
font-size: 30rpx;
}
.item-title {
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 6rpx;
}
.item-info-bottom {
display: flex;
justify-content: space-between;
align-items: center;
}
.item-info-bottom text {
color: #E14135;
}
.info-btn {
width: 160rpx;
text-align: center;
line-height: 50rpx;
height: 50rpx;
background: linear-gradient(0deg, #E14135, #FF9124);
border-radius: 25rpx;
color: #fff;
margin-left: 20rpx;
}
.list {
padding-top: 80rpx;
}
.item-bottom {
display: flex;
padding: 20rpx 30rpx;
border-top: 1rpx solid #d8d8d8;
justify-content: flex-end;
}
.info-btn-new {
background: #fff;
border: 2rpx solid;
color: #F34922;
box-sizing: border-box;
}
.empty-btn {
width: 240rpx;
height: 80rpx;
background: linear-gradient(0deg, #E14135, #FF9124);
border-radius: 40rpx;
line-height: 80rpx;
text-align: center;
color: #fff;
margin-top: 100rpx;
font-size: 30rpx;
}

122
pages/map/index.js

@ -25,7 +25,8 @@ Page({
menuIndex:-1, menuIndex:-1,
productList:[], productList:[],
productPage:1, productPage:1,
productTotal:1 productTotal:1,
timeList:{}
}, },
/** /**
@ -149,6 +150,18 @@ Page({
tenscenic_id:info.info.id, tenscenic_id:info.info.id,
page_no:1, page_no:1,
page_num:10 page_num:10
}),
commonApi._post("multimedia/media_list",{
tenscenic_id:info.info.id,
type:0,
page:1,
limit:10
}),
commonApi._post("multimedia/media_list",{
tenscenic_id:info.info.id,
type:1,
page:1,
limit:10
})] })]
Promise.all(ajaxes).then(res=>{ Promise.all(ajaxes).then(res=>{
let menus = [],menuIndex=-1; let menus = [],menuIndex=-1;
@ -172,6 +185,14 @@ Page({
if(menuIndex==-1) menuIndex = 4; if(menuIndex==-1) menuIndex = 4;
menus[4] = "攻略" menus[4] = "攻略"
} }
if(res[5].data.total>0){
if(menuIndex==-1) menuIndex = 4;
menus[5] = "讲解"
}
if(res[6].data.total>0){
if(menuIndex==-1) menuIndex = 4;
menus[6] = "视频"
}
this.setData({ this.setData({
menus:menus, menus:menus,
menuIndex:menuIndex menuIndex:menuIndex
@ -244,9 +265,27 @@ Page({
delete data.limit; delete data.limit;
service="travels/getList"; service="travels/getList";
break; break;
case "讲解":
service="multimedia/media_list";
data = {
tenscenic_id:data.tenscenic_id,
page:data.page_no,
limit:10,
type:0
}
break;
case "视频":
service="multimedia/media_list";
data = {
tenscenic_id:data.tenscenic_id,
page:data.page_no,
limit:10,
type:1
}
break;
} }
commonApi._post(service,data).then(res=>{ commonApi._post(service,data).then(res=>{
let list = res.data.list || res.data.rows; let list = res.data.list || res.data.rows || res.data.data;
list.map(item=>{ list.map(item=>{
item.display_tags = item.display_tags?item.display_tags.split(","):[]; item.display_tags = item.display_tags?item.display_tags.split(","):[];
item.display_tags = item.display_tags.slice(0,2); item.display_tags = item.display_tags.slice(0,2);
@ -260,15 +299,66 @@ Page({
} }
}) })
this.setData({ this.setData({
productTotal:res.data.productTotal, productTotal:res.data.productTotal || res.data.total,
productPage:this.data.productPage+1, productPage:this.data.productPage+1,
productList:this.data.productList.concat(list) productList:this.data.productList.concat(list)
}) })
if(menu=='讲解'){
// 获取音频长度
let timeList = this.data.timeList;
list.map(item=>{
this['audioCtx'+item.id] = wx.createInnerAudioContext("audio"+item.id);
this['audioCtx'+item.id].src = item.multimedia_url;
this['audioCtx'+item.id].onEnded(()=>{
let productList = this.data.productList;
let productIndex = productList.findIndex(i=>i.id==item.id);
productList[productIndex].play = false;
this.setData({
productList:productList
})
})
this['audioCtx'+item.id].onTimeUpdate((e)=>{
timeList['audio'+item.id].time = this.audioTimeInit(this['audioCtx'+item.id].currentTime);
timeList['audio'+item.id].width = this['audioCtx'+item.id].currentTime / this['audioCtx'+item.id].duration * 100;
this.setData({
timeList:timeList
})
})
this['audioCtx'+item.id].onCanplay(() => {
this['audioCtx'+item.id].duration //类似初始化-必须触发-不触发此函数延时也获取不到
      setTimeout( ()=>{
       //在这里就可以获取到大家梦寐以求的时长了
if(!timeList['audio'+item.id]){
timeList['audio'+item.id] = {};
}
        timeList['audio'+item.id].all_time=this.audioTimeInit(this['audioCtx'+item.id].duration);//延时获取长度 单位:秒
this.setData({
timeList:timeList
})
      }, 1000)  //这里设置延时1秒获取
    })
})
}
}) })
} }
}, },
audioTimeInit:function(second=0){
second = Math.round(second);
let min = Math.floor(second/60);
min = min<10?('0'+min):min;
second = second%60;
second = second<10?('0'+second):second;
return min+':'+second;
},
gotoDetailNew:function(e){ gotoDetailNew:function(e){
if(this.data.menus[this.data.menuIndex]=='讲解') return;
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
if(this.data.menus[this.data.menuIndex]=='视频') {
wx.navigateTo({
url: '/pages/pbService/appreciate/info/index?info='+encodeURIComponent(JSON.stringify(item)),
})
return;
}
util.gotoDetail(item); util.gotoDetail(item);
}, },
showImages:function(e){ showImages:function(e){
@ -361,6 +451,32 @@ Page({
this.setData(e.detail) this.setData(e.detail)
this.getList() this.getList()
}, },
// 讲解播放
startAuido:function(e){
let index = e.currentTarget.dataset.index,productList = this.data.productList;
productList[index].play = productList[index].play?false:true;
let audioCtx = this['audioCtx'+productList[index].id];
if(productList[index].play){
productList.map((item,i)=>{
if(item.play==true && index!=i){
item.play = false;
this['audioCtx'+item.id].pause()
}
})
audioCtx.play()
commonApi._post("multimedia/viewsInc",{
id:productList[index].id
}).then(res=>{
})
}
else {
audioCtx.pause()
}
this.setData({
productList:productList
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成

33
pages/map/index.wxml

@ -66,9 +66,38 @@
<view class="map-item-menus" wx:if="{{menus.length>0}}"> <view class="map-item-menus" wx:if="{{menus.length>0}}">
<view bindtap="changeMenu" wx:if="{{item}}" data-index="{{index}}" wx:for="{{menus}}" class="map-item-menu {{menuIndex==index?'active':''}}">{{item}}</view> <view bindtap="changeMenu" wx:if="{{item}}" data-index="{{index}}" wx:for="{{menus}}" class="map-item-menu {{menuIndex==index?'active':''}}">{{item}}</view>
</view> </view>
<view class="list"> <view class="list{{menus[menuIndex]=='视频'?' videolist':''}}">
<view wx:for="{{productList}}" bindtap="gotoDetailNew" data-item="{{item}}"> <view wx:for="{{productList}}" bindtap="gotoDetailNew" data-item="{{item}}">
<view wx:if="{{menus[menuIndex]!='攻略'}}" class="item"> <view class="video-item" wx:if="{{menus[menuIndex]=='视频'}}">
<image class="main-img" src="{{item.head_img}}" mode="aspectFill"></image>
<view class="video-title textOver2">{{item.title}}</view>
<view class="video-bottom">
<view class="iconfont icon-eye"></view>
<view style="margin-right:40rpx">{{item.views}}</view>
<view class="iconfont icon-zan"></view>
<view>{{item.like_number}}</view>
</view>
<view class="video-play-mask">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/map/videoplay.png" mode="aspectFill"></image>
</view>
</view>
<view wx:elif="{{menus[menuIndex]=='讲解'}}" class="audio-item">
<image src="{{item.head_img}}" class="mainimg" mode="aspectFill"></image>
<view class="audio-info">
<view class="audio-title textOver">{{item.title}}</view>
<view class="audio-bottom">
<view class="audio-time">{{timeList['audio'+item.id] && timeList['audio'+item.id].time?timeList['audio'+item.id].time:"00:00"}} / {{timeList['audio'+item.id]?timeList['audio'+item.id].all_time:"00:00"}}</view>
<view class="audio-new-bg">
<view style="left:{{timeList['audio'+item.id]?timeList['audio'+item.id].width:0}}%" class="audio-line"></view>
<image style="left:{{timeList['audio'+item.id]?timeList['audio'+item.id].width:0}}%" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/map/audiobtn.png" mode="aspectFill"></image>
</view>
<!-- <audio src="{{item.multimedia_url}}" id="audio{{item.id}}" loop></audio> -->
</view>
</view>
<image bindtap="startAuido" data-id="{{item.id}}" data-index="{{index}}" wx:if="{{!item.play}}" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/map/audioplay.png" mode="aspectFill" class="playimg"></image>
<image bindtap="startAuido" data-id="{{item.id}}" data-index="{{index}}" wx:else src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/map/audiostop.png" mode="aspectFill" class="playimg"></image>
</view>
<view wx:elif="{{menus[menuIndex]!='攻略'}}" class="item">
<image src="{{item.headimg}}" mode="aspectFill"></image> <image src="{{item.headimg}}" mode="aspectFill"></image>
<view class="right-info" style="display:flex;flex-direction:column;justify-content:space-between"> <view class="right-info" style="display:flex;flex-direction:column;justify-content:space-between">
<view> <view>

140
pages/map/index.wxss

@ -152,14 +152,14 @@
} }
.map-item1 { .map-item1 {
position: absolute; position: absolute;
left: 20rpx; left: 0rpx;
right: 20rpx; right: 0rpx;
height: 70%; height: 70%;
bottom: 0; bottom: 0;
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
background:white; background:white;
box-shadow: 0px 0px 9px 0px rgba(0, 0, 0, 0.2); box-shadow: 0px 0px 9px 0px rgba(0, 0, 0, 0.2);
padding: 0 25rpx; padding: 0 30rpx;
padding-top: 35rpx; padding-top: 35rpx;
overflow-y: auto; overflow-y: auto;
z-index: 100; z-index: 100;
@ -290,6 +290,11 @@
.list .item:last-child { .list .item:last-child {
border: none; border: none;
} }
.list.videolist {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.returnImg { .returnImg {
position: absolute; position: absolute;
display: block; display: block;
@ -328,3 +333,132 @@
flex-shrink: 0; flex-shrink: 0;
margin-right: 8rpx; margin-right: 8rpx;
} }
.audio-item {
padding: 30rpx;
height: 160rpx;
background: #EFF9F9;
border-radius: 11rpx;
display: flex;
justify-content: space-between;
position: relative;
margin: 30rpx auto;
}
.audio-item .mainimg {
width: 160rpx;
height: 160rpx;
flex-shrink: 0;
display: block;
border-radius: 50%;
margin-right: 30rpx;
}
.audio-info {
width: 450rpx;
flex: 1;
display: flex;
height: 160rpx;
flex-direction: column;
justify-content: space-between;
}
.audio-title {
color: #2F2F2F;
font-size: 33rpx;
}
.audio-bottom {
font-size: 20rpx;
color: #8D8D8D;
}
.audio-new-bg {
width: 450rpx;
height: 4rpx;
background: #70B4B7;
border-radius: 2rpx;
position: relative;
margin-top: 40rpx;
}
.audio-line {
border-radius: 2rpx;
background: #DBDBDB;
height: 4rpx;
position: absolute;
top: 0;
right: 0;
left: 0;
transition: all .1s;
}
.audio-new-bg image {
position: absolute;
width: 36rpx;
height: 36rpx;
display: block;
left: 0;
transition: all .1s;
top: 50%;
margin-top: -18rpx;
margin-left: -18rpx;
}
.playimg {
position: absolute;
right: 0;
bottom: 60rpx;
width: 97rpx;
height: 97rpx;
display: block;
}
.audio-info audio {
position: absolute;
left: 0;
top: 0;
width: 0;
height: 0;
}
.video-item {
padding: 14rpx;
background: #FFFFFF;
box-shadow: 0px 0px 11rpx 0px rgba(4, 0, 0, 0.14);
border-radius: 14rpx;
width: 309rpx;
margin: 30rpx 0;
position: relative;
}
.video-play-mask {
position: absolute;
left: 14rpx;
top: 14rpx;
right: 14rpx;
border-radius: 10rpx 10rpx 0px 0px;
background: rgba(0, 0, 0, 0.3);
display: flex;
justify-content: center;
align-items: center;
height: 214rpx;
z-index: 1;
}
.video-play-mask image {
width: 91rpx;
height: 90rpx;
display: block;
}
.video-item image.main-img {
display: block;
width: 309rpx;
border-radius: 10rpx 10rpx 0px 0px;
height: 214rpx;
margin-bottom: 10rpx;
}
.video-title {
font-size: 31rpx;
font-weight: bold;
color: #333;
line-height: 46rpx;
}
.video-bottom {
display: flex;
align-items: center;
color: #999999;
font-size: 20rpx;
margin-top: 20rpx;
}
.video-bottom .iconfont {
margin-right: 10rpx;
}

19
pages/order/postOrder/index.js

@ -13,7 +13,8 @@ Page({
address:null, address:null,
postFee:0, postFee:0,
coupon:null, coupon:null,
sku_id:'' sku_id:'',
kjId:null
}, },
/** /**
@ -21,15 +22,19 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
product:app.globalData.postProduct, from:options.from,
from:options.from kjId:app.globalData.kjId
}) })
let price = 0,sku_id=[]; let price = 0,sku_id=[];
app.globalData.postProduct.map(item=>{ app.globalData.postProduct.map(item=>{
if(app.globalData.kjId){
item.sku.price = 0;
}
price = price + item.sku.price * item.productNum; price = price + item.sku.price * item.productNum;
sku_id.push(item.sku.id) sku_id.push(item.sku.id)
}) })
this.setData({ this.setData({
product:app.globalData.postProduct,
showPrice:price, showPrice:price,
sku_id:sku_id.join(",") sku_id:sku_id.join(",")
}) })
@ -114,7 +119,8 @@ Page({
let data = { let data = {
source:"WECHATXCX", source:"WECHATXCX",
product_list:product_list, product_list:product_list,
coupon:this.data.coupon?this.data.coupon.id:null coupon:this.data.coupon?this.data.coupon.id:null,
originate_order_id:this.data.kjId
}; };
commonApi.user_post("order/create",{ commonApi.user_post("order/create",{
data:JSON.stringify(data) data:JSON.stringify(data)
@ -195,7 +201,10 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
this.setData({
kjId:null
});
app.globalData.kjId = null;
}, },
/** /**

4
pages/order/postOrder/index.wxml

@ -21,9 +21,9 @@
</view> </view>
<view class="box-title" wx:if="{{from!='cart'}}"> <view class="box-title" wx:if="{{from!='cart'}}">
<view style="flex:1">购票数量</view> <view style="flex:1">购票数量</view>
<view class="iconfont icon-sami-select" bindtap="minus" data-index="{{index}}"></view> <view wx:if="{{!kjId}}" class="iconfont icon-sami-select" bindtap="minus" data-index="{{index}}"></view>
<view class="number-box">{{item.productNum}}</view> <view class="number-box">{{item.productNum}}</view>
<view class="iconfont icon-add-select" bindtap="add" data-index="{{index}}"></view> <view wx:if="{{!kjId}}" class="iconfont icon-add-select" bindtap="add" data-index="{{index}}"></view>
</view> </view>
<view class="box-title"> <view class="box-title">
<view style="flex:1">运费</view> <view style="flex:1">运费</view>

44
pages/pbService/appreciate/info/index.js

@ -1,4 +1,5 @@
// pages/pbService/appreciate/info/index.js // pages/pbService/appreciate/info/index.js
import commonApi from "../../../../utils/https/common"
Page({ Page({
/** /**
@ -17,8 +18,51 @@ Page({
this.setData({ this.setData({
info:info info:info
}) })
if(info.multimedia_url){
commonApi._post("multimedia/viewsInc",{
id:info.id
}).then(res=>{
})
commonApi.user_post("multimedia/detail",{
id:info.id
}).then(res=>{
this.setData({
info:res.data
})
console.log(res)
})
}
console.log(info) console.log(info)
}, },
like:function(){
let info = this.data.info;
commonApi.user_post("multimedia/favorite",{
id:info.id
}).then(res=>{
if(res.code==1){
if(info.is_like==1){
wx.showToast({
title: '取消点赞成功',
icon:'success'
})
info.is_like=0;
info.like_number--;
}
else {
wx.showToast({
title: '点赞成功',
icon:'success'
})
info.is_like=1;
info.like_number++;
}
this.setData({
info:info
})
}
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成

12
pages/pbService/appreciate/info/index.wxml

@ -1,6 +1,12 @@
<!--pages/pbService/appreciate/info/index.wxml--> <!--pages/pbService/appreciate/info/index.wxml-->
<title title="鉴赏详情"></title> <title title="{{info.multimedia_url?'视频':'鉴赏'}}详情"></title>
<view wx:if="{{info}}"> <view wx:if="{{info}}">
<video style="width:100%;height:420rpx" src="{{info.VideoSrc}}" controls autoplay="{{false}}" object-fit='contain' poster="{{info.Cover}}"></video> <video style="width:100%;height:420rpx" src="{{info.VideoSrc || info.multimedia_url}}" controls autoplay="{{false}}" object-fit='contain' poster="{{info.Cover || info.head_img}}"></video>
<view class="name">{{info.Name}}</view> <view class="name">{{info.Name || info.title}}</view>
<view class="video-bottom" wx:if="{{info.multimedia_url}}">
<view class="iconfont icon-eye"></view>
<view style="margin-right:40rpx">{{info.views}}</view>
<view bindtap="like" class="iconfont icon-zan{{info.is_like==1?' active':''}}"></view>
<view bindtap="like">{{info.like_number}}</view>
</view>
</view> </view>

13
pages/pbService/appreciate/info/index.wxss

@ -4,3 +4,16 @@
color: #333; color: #333;
margin: 20rpx; margin: 20rpx;
} }
.video-bottom {
display: flex;
align-items: center;
color: #999999;
font-size: 20rpx;
margin: 20rpx;
}
.video-bottom .iconfont {
margin-right: 10rpx;
}
.icon-zan.active {
color: red;
}

5
pages/pbService/index.wxml

@ -81,6 +81,9 @@
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb16.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb16.png" mode="widthFix"></image>
<view>垃圾分类</view> <view>垃圾分类</view>
</view> </view>
<view class="pb-item" bindtap="gotoPath" data-path="/pages/pbService/museum/index">
<image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb19.png" mode="widthFix"></image>
<view>博物馆查询</view>
</view>
</view> </view>
</view> </view>

109
pages/pbService/museum/index.js

@ -0,0 +1,109 @@
// pages/pbService/museum/index.js
import commonApi from "../../../utils/https/common"
Page({
/**
* 页面的初始数据
*/
data: {
keywords:"",
realKeywords:"",
list:[],
type:1,
page_no:1,
total:1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getList()
},
getList:function(){
if(this.data.list.length>=this.data.total) return;
commonApi._post("pbservice/Museum/getMuseumsByType",{
page_no:this.data.page_no,
page_num:10,
search_key:this.data.realKeywords,
type:this.data.type
}).then(res=>{
this.setData({
total:res.data.total,
list:this.data.list.concat(res.data.rows),
page_no:this.data.page_no+1
})
})
},
changeKeyword:function(e){
this.setData({
keywords:e.detail.value
})
},
search:function(){
this.setData({
realKeywords:this.data.keywords,
list:[],
page_no:1,
total:1
})
this.getList();
},
changeType:function(e){
this.setData({
type:e.currentTarget.dataset.type,
list:[],
page_no:1,
total:1
})
this.getList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getList()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

5
pages/pbService/museum/index.json

@ -0,0 +1,5 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader"
}
}

31
pages/pbService/museum/index.wxml

@ -0,0 +1,31 @@
<!--pages/pbService/museum/index.wxml-->
<title title="博物馆查询"></title>
<view class="search-top-box">
<view class="search-box">
<view class="iconfont icon-sousuo"></view>
<input type="text" bindinput="changeKeyword" placeholder="请输入关键字查找" />
<view class="search-btn" bindtap="search">搜索</view>
</view>
<view class="search-menus">
<view class="search-menu {{type==1?'active':''}}" bindtap="changeType" data-type="1">博物馆</view>
<view class="search-menu {{type==2?'active':''}}" bindtap="changeType" data-type="2">陈列馆</view>
<view class="search-menu {{type==3?'active':''}}" bindtap="changeType" data-type="3">纪念馆</view>
<view class="search-menu {{type==4?'active':''}}" bindtap="changeType" data-type="4">美术馆</view>
</view>
</view>
<view style="height:180rpx"></view>
<navigator url="info/index?id={{item.id}}" class="item" wx:for="{{list}}">
<image src="{{item.headimg || '/images/place2.png'}}" mode="aspectFill"></image>
<view class="right-info">
<view class="textOver title">{{item.name}}</view>
<view class="icon-box textOver">
<view class="iconfont icon-dianhua1"></view>
<view class="textOver">{{item.phone}}</view>
</view>
<view class="icon-box textOver">
<view class="iconfont icon-location1"></view>
<view class="textOver">{{item.address}}</view>
</view>
</view>
</navigator>
<view class="nodata" wx:if="{{total==0}}">暂无数据</view>

114
pages/pbService/museum/index.wxss

@ -0,0 +1,114 @@
/* pages/pbService/museum/index.wxss */
page {
background: #EDEDED;
}
.search-top-box {
padding-top: 20rpx;
background: white;
position: fixed;
left: 0;
right: 0;
font-size: 26rpx;
}
.search-box {
display: flex;
margin: 0 30rpx;
justify-content: space-between;
height: 60rpx;
border-radius: 30rpx;
background: #ededed;
align-items: center;
padding-left: 20rpx;
}
.search-box .iconfont {
flex-shrink: 0;
}
.search-box input {
flex: 1;
width: 500rpx;
display: block;
margin: 0 20rpx;
}
.search-box .search-btn {
line-height: 40rpx;
width: 110rpx;
border-left: 1rpx solid #ccc;
text-align: center;
color: #0B898E;
}
.search-menus {
height: 95rpx;
margin: 0 30rpx;
margin-top: 5rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.search-menu {
position: relative;
line-height: 50rpx;
width: 25%;
text-align: center;
}
.search-menu.active {
color: #0B898E;
}
.search-menu.active::after {
content: "1";
font-size: 0;
display: block;
position: absolute;
left: 50%;
background: #0B898E;
height: 4rpx;
border-radius: 2rpx;
width: 30rpx;
margin-left: -15rpx;
bottom: 0;
}
.item {
display: flex;
width: 690rpx;
height: 200rpx;
background: #FFFFFF;
border-radius: 20rpx;
margin: 20rpx 30rpx;
overflow: hidden;
color: #888888;
font-size: 26rpx;
}
.item image {
width: 200rpx;
height: 200rpx;
display: block;
flex-shrink: 0;
margin-right: 20rpx;
}
.item .icon-box {
display: flex;
align-items: center;
height: 50rpx;
}
.item .right-info {
flex: 1;
width: 430rpx;
margin-top: 20rpx;
margin-right: 20rpx;
}
.item .title {
font-size: 30rpx;
font-weight: bold;
color: #333;
margin-bottom: 30rpx;
}
.item .iconfont {
color: #0B898E;
margin-right: 10rpx;
}
.nodata {
text-align: center;
margin-top: 50rpx;
line-height: 50rpx;
font-size: 26rpx;
color: #999;
}

74
pages/pbService/museum/info/index.js

@ -0,0 +1,74 @@
// pages/pbService/museum/info/index.js
import commonApi from "../../../../utils/https/common"
Page({
/**
* 页面的初始数据
*/
data: {
info:null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
commonApi._post("pbservice/Museum/getDetail",{
id:options.id
}).then(res=>{
res.data.listimg = res.data.listimg?res.data.listimg.split(","):[];
this.setData({
info:res.data
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

5
pages/pbService/museum/info/index.json

@ -0,0 +1,5 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader"
}
}

27
pages/pbService/museum/info/index.wxml

@ -0,0 +1,27 @@
<!--pages/pbService/museum/info/index.wxml-->
<wxs src="../../../../utils/filter.wxs" module="tool" />
<title title="详情"></title>
<view class="content" wx:if="{{info}}">
<swiper class="swiper">
<block wx:for="{{info.listimg}}" wx:key="*this">
<swiper-item>
<image src="{{item || '/images/place1.png'}}" mode="aspectFill" class="mainimg"></image>
</swiper-item>
</block>
</swiper>
<view class="title">{{info.name}}</view>
<view class="tips">
<view class="iconfont icon-dianhua"></view>
<view class="textOver">{{info.phone}}</view>
</view>
<view class="tips">
<view class="iconfont icon-location"></view>
<view class="textOver">{{info.address}}</view>
</view>
<view class="subtitle">场馆详情</view>
<rich-text nodes="{{tool.formateRichText(info.detail)}}"></rich-text>
<view class="subtitle">接待时间</view>
<rich-text nodes="{{tool.formateRichText(info.open_time)}}"></rich-text>
<view class="subtitle">交通路线</view>
<rich-text nodes="{{tool.formateRichText(info.route)}}"></rich-text>
</view>

45
pages/pbService/museum/info/index.wxss

@ -0,0 +1,45 @@
/* pages/pbService/museum/info/index.wxss */
.mainimg {
display: block;
width: 100%;
height: 300rpx;
}
.swiper {
width: 100%;
height: 300rpx;
margin-bottom: 30rpx;
}
.content {
padding: 20rpx;
color: #666666;
font-size: 28rpx;
}
page {
background: white;
}
.title {
font-size: 36rpx;
font-weight: bold;
color: #333;
margin-bottom: 10rpx;
}
.tips {
display: flex;
align-items: center;
height: 50rpx;
}
.tips .iconfont {
flex-shrink: 0;
margin-right: 10rpx;
color: #999;
}
.subtitle {
padding-left: 20rpx;
border-left: 6rpx solid #0F9095;
line-height: 30rpx;
color: #333;
font-size: 30rpx;
font-weight: bold;
margin-top: 40rpx;
margin-bottom: 20rpx;
}

2
project.config.json

@ -4,7 +4,7 @@
"ignore": [] "ignore": []
}, },
"setting": { "setting": {
"urlCheck": true, "urlCheck": false,
"es6": true, "es6": true,
"enhance": false, "enhance": false,
"postcss": true, "postcss": true,

6
project.private.config.json

@ -15,12 +15,12 @@
{ {
"name": "pages/kj/index", "name": "pages/kj/index",
"pathName": "pages/kj/index", "pathName": "pages/kj/index",
"query": "tid=59532104301613182765&type=ticket", "query": "id=203",
"scene": null "scene": null
}, },
{ {
"name": "pages/kj/info/index", "name": "pages/activity/graduate/index",
"pathName": "pages/kj/info/index", "pathName": "pages/activity/graduate/index",
"query": "id=5", "query": "id=5",
"scene": null "scene": null
}, },

4
utils/https.js

@ -1,8 +1,8 @@
var app = getApp(); var app = getApp();
import util from "../utils/util" import util from "../utils/util"
import userApi from "../utils/https/user.js"; import userApi from "../utils/https/user.js";
// const baseUrl = "https://js-tript-test.xmainc.com"; const baseUrl = "https://test.api.cloud.sz-trip.com/api/";
const baseUrl = "https://api.cloud.sz-trip.com/api/"; // const baseUrl = "https://api.cloud.sz-trip.com/api/";
const orders = ['','weight','distance','sale_number','sale_price','price']; const orders = ['','weight','distance','sale_number','sale_price','price'];
//封装GET请求 //封装GET请求
function _get(url,data) { function _get(url,data) {

23
utils/util.js

@ -1,4 +1,5 @@
var app = getApp() var app = getApp()
import commonApi from "./https/common"
const formatTime = date => { const formatTime = date => {
const year = date.getFullYear() const year = date.getFullYear()
const month = date.getMonth() + 1 const month = date.getMonth() + 1
@ -315,6 +316,25 @@ const gotoOrder = function(item){
return; return;
} }
} }
// 砍价的去下单
const goKjOrder = function(item) {
return new Promise((resolve,reject)=>{
commonApi._post("product/get_product_detail",{
id:item.goods_id
}).then(res=>{
let product = [{
product:res.data,
sku:res.data.sku.find(s=>s.id==item.sku_id),
productNum:1
}];
// 因为util里面不好改app.globalData的数据 但是下单是把产品信息先保存到globalData的 所以只能在页面内操作
// 购买 只能把产品信息回传过去 可能还要改 暂时先回传整个的
resolve(product);
}).catch(err=>{
reject(err)
})
})
}
module.exports = { module.exports = {
formatTime: formatTime, formatTime: formatTime,
formatNumber: formatNumber, formatNumber: formatNumber,
@ -327,5 +347,6 @@ module.exports = {
dateToText:dateToText, dateToText:dateToText,
gotoDetail:gotoDetail, gotoDetail:gotoDetail,
gotoOrder:gotoOrder, gotoOrder:gotoOrder,
orderMoreTime:orderMoreTime orderMoreTime:orderMoreTime,
goKjOrder:goKjOrder
} }

Loading…
Cancel
Save