刘翔宇-旅管家 4 years ago
parent c2b8e37ea9
commit d572a79338

@ -53,7 +53,12 @@
<style>
@import '@/static/css/common.css';
@import "@/static/css/iconfont.css";
/*每个页面公共css */
.flex_end {
display: flex;
justify-content: flex-end;
}
.mpopup {
margin-top: 60rpx;

@ -4,13 +4,14 @@
<view class="activityBox">
<view class="activityBox-top">
<!-- <image src="../../static/img/img_activity.jpg" style="width: 100%;height: 333rpx;"></image> -->
<swiper autoplay="true" :interval="4000" :duration="1000" :indicator-dots="true"
indicator-active-color="rgba(255, 255, 255, 0.7)" indicator-color="rgba(239, 149, 37, 1)" :current="topSwiperIndex" @change="topSwiperTab">
<swiper-item v-for="(item,index) in list.banners" :key="index">
<view class="swiper-item">
<image :src="item.upload.url" mode="aspectFill"></image>
</view>
</swiper-item>
<swiper autoplay="true" :interval="4000" :duration="1000" :indicator-dots="true"
indicator-active-color="rgba(255, 255, 255, 0.7)" indicator-color="rgba(239, 149, 37, 1)"
:current="topSwiperIndex" @change="topSwiperTab">
<swiper-item v-for="(item,index) in list.banners" :key="index">
<view class="swiper-item">
<image :src="item.upload.url" mode="aspectFill"></image>
</view>
</swiper-item>
</swiper>
</view>
<view class="activityBox-content flex-col">
@ -23,7 +24,7 @@
<view class="activityBox-row">
<text class="icon-shijian iconfont"></text>
<text>活动时间{{list.start_time}}-{{list.end_time.substring(11,list.end_time.length)}}</text>
<text>活动时间{{list.start_time||""}}-{{list.end_time.substring(11,list.end_time.length)}}</text>
</view>
<view class="activityBox-row">
@ -46,12 +47,12 @@
<view class="tomap">
<text class="icon-daohang1 iconfont" style="margin-right: 0;"></text>
</view>
</view>
<!-- <view class="activityBox-row flex-row align-center" style="margin-bottom: 0rpx;">
<text v-if="list.status==0"></text>
<text v-if="list.status==1">{{list.orders_count}}</text>
</view> -->
</view>
<!-- <view class="activityBox-row flex-row align-center" style="margin-bottom: 0rpx;">
<text v-if="list.status==0"></text>
<text v-if="list.status==1">{{list.orders_count}}</text>
</view> -->
</view>
</view>
@ -79,54 +80,54 @@
export default {
data() {
return {
id:"",
latitude:"",
longitude:"",
list:{},
id: "",
latitude: "",
longitude: "",
list: {},
topSwiperIndex: 0,
}
},
onLoad(options){
this.id=options.id;
this.latitude=options.latitude;
this.longitude=options.longitude;
this.loadActiveInfo()
},
onLoad(options) {
this.id = options.id;
this.latitude = options.latitude;
this.longitude = options.longitude;
this.loadActiveInfo()
},
methods: {
tobook(type) {
tobook(type) {
uni.navigateTo({
url: "book?type=" + type + "&activity_id="+this.id
url: "book?type=" + type + "&activity_id=" + this.id
})
},
loadActiveInfo(){
var that = this;
this.util.request({
api: '/api/mobile/activity/show',
data:{
id:that.id,
latitude:that.latitude,
longitude:that.longitude
},
utilSuccess: function(res) {
that.list = res;
wx.setStorage({
key: 'activityinfo',
data: res,
success: ()=> {
console.log('存储成功');
}
})
},
utilFail: function(res) {
}
})
},
topSwiperTab(e) {
var that = this;
this.topSwiperIndex = Number(e.target.current);
}
},
loadActiveInfo() {
var that = this;
this.util.request({
api: '/api/mobile/activity/show',
data: {
id: that.id,
latitude: that.latitude,
longitude: that.longitude
},
utilSuccess: function(res) {
that.list = res;
wx.setStorage({
key: 'activityinfo',
data: res,
success: () => {
console.log('存储成功');
}
})
},
utilFail: function(res) {
}
})
},
topSwiperTab(e) {
var that = this;
this.topSwiperIndex = Number(e.target.current);
}
}
}
</script>
@ -170,12 +171,14 @@
box-shadow: 2px 3px 10px 0px rgba(107, 94, 77, 0.3);
padding: 22rpx 25rpx;
box-sizing: border-box;
}
swiper{
height:333rpx
}
swiper image{
width:100%;
height:333rpx;
}
swiper {
height: 333rpx
}
swiper image {
width: 100%;
height: 333rpx;
}
</style>

@ -109,12 +109,13 @@
closeInfo() {
that.showAuthorization = false;
},
loadInfo(cb) {
var that = this;
this.util.getOpenidInfo(function(res) {
that.util.getUserInfo(function(r) {
cb(r);
}, true)
loadInfo(cb) {
var that = this;
this.util.getOpenidInfo(function(res) {
that.util.getUserInfo(function(r) {
that.info = r;
cb(r);
}, true)
}, true);
},

@ -4,36 +4,39 @@
<u-tabs lineWidth="50" lineHeight="2" :scrollable="false" :list="list" lineColor="#EF9525"
:is-scroll="false" :current="current" @change="handleChange"></u-tabs>
</view>
<view class="orderBoxList">
<u-empty mode="list" :marginTop="100" v-if="isloading&&listOrder.length==0" />
<view class="orderBoxList" v-else>
<block v-for="(item,index) in listOrder" :key="index">
<view class="orderBox">
<view class="orderBox" @click="toinfo(item.id)">
<view class="orderBoxTitle flex-row">
<text class="orderBoxTitleTxt">{{item.isteam?"团队预约":"个人预约"}}</text>
<view class="orderBoxStatus">待参观</view>
<text class="orderBoxTitleTxt">{{item.type==1?"团队预约":"个人预约"}}</text>
<view class="orderBoxStatus" :class="{'cancel':item.status==0}">{{item.status_name}}</view>
</view>
<view class="orderBoxInfo flex-col">
<view class="orderBoxInfoRow flex-row" style="margin-bottom: 20rpx;">
<text class="iconfont icon-youkexuzhi"></text>
<text class="orderBoxInfoRowTxt">订单信息5月06日 09:00-10:00  3位观众</text>
<text class="orderBoxInfoRowTxt">
订单信息{{$u.timeFormat(new Date(item.date), 'mm月dd日')}}
{{item.time}}{{item.details_count}}位观众</text>
</view>
<view class="orderBoxInfoRow flex-row">
<text class="iconfont icon-iconfontgerenzhongxin"></text>
<text class="orderBoxInfoRowTxt">联系人王小华 13355634563</text>
<text class="orderBoxInfoRowTxt">联系人{{item.leader}} {{item.mobile}}</text>
</view>
<view class="orderBoxInfoRow flex-row" v-if="item.isteam" style="margin-top: 20rpx;">
<view class="orderBoxInfoRow flex-row" v-if="item.type==1" style="margin-top: 20rpx;">
<text class="iconfont icon-danwei"></text>
<text class="orderBoxInfoRowTxt">单位名称王小华 13355634563</text>
<text class="orderBoxInfoRowTxt">单位名称{{item.unit}}</text>
</view>
</view>
<view class="orderBoxTime">
<text>下单时间5月03日 09:30</text>
<text>下单时间{{item.created_at}}</text>
</view>
<view class="orderBoxFooter flex-row flex_end">
<view class="fbtn" @click="tobook()" style="margin-right: 23rpx;">查看详情</view>
<view class="fbtn cancel">取消</view>
<view class="fbtn" @click.stop="toinfo(item.id)" style="margin-right: 23rpx;">查看详情</view>
<view class="fbtn cancel" @click.stop="tocancel(item.id)">取消</view>
</view>
</view>
</block>
@ -50,31 +53,79 @@
flex: 1
},
list: [{
name: '全部'
name: '全部',
idx: ""
}, {
name: '待参观'
name: '待参观',
idx: "1"
}, {
name: '已参观'
name: '已参观',
idx: "2"
}],
current: 0,
listOrder: [{
isteam: true
},
{
isteam: false
}
]
isloading: true,
listOrder: []
}
},
onShow() {
this.loadOrder();
},
methods: {
handleChange() {
},
tobook(){
uni.navigateTo({
url: "/pages/order/visitorderinfo"
})
handleChange(e) {
this.current = e.index;
this.loadOrder();
},
toinfo(id) {
uni.navigateTo({
url: "/pages/order/visitorderinfo?id=" + id
})
},
tocancel(id) {
var that = this;
uni.showModal({
title: '确认要取消预约?',
success: function(res) {
if (res.confirm) {
that.util.request({
api: '/api/mobile/visit/cancel-order',
data: {
id: id
},
utilSuccess: function(res) {
that.loadOrder()
},
utilFail: function(res) {
uni.showToast({
icon: "none",
title: res
})
}
})
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
loadOrder() {
var that = this;
this.util.request({
api: '/api/mobile/user/my-visit-order',
data: {
status: this.list[this.current].idx
},
utilSuccess: function(res) {
that.listOrder = res;
this.isloading = false;
},
utilFail: function(res) {
uni.showToast({
icon: "none",
title: res
})
}
})
}
}
}
@ -142,6 +193,10 @@
color: #351C1B;
}
.cancelstatus {
background: #828282;
}
.orderBoxStatus {
background: #EF9525;
border-top-right-radius: 16rpx;

@ -312,8 +312,8 @@
that.util.getUserInfo(function(r) {
that.user = r;
that.form.mobile = r.mobile;
}, true);
}, true);
},
methods: {
closeInfo() {
@ -445,7 +445,7 @@
filePath: tempFilePaths, //data
name: 'file', //
formData: { //formData
"token": uni.getStorageSync("userInfo").token
"token": uni.getStorageSync("userInfo_token").token
},
success(res) {
var jsonlist = JSON.parse(res.data)

Loading…
Cancel
Save