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

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

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

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

@ -4,36 +4,39 @@
<u-tabs lineWidth="50" lineHeight="2" :scrollable="false" :list="list" lineColor="#EF9525" <u-tabs lineWidth="50" lineHeight="2" :scrollable="false" :list="list" lineColor="#EF9525"
:is-scroll="false" :current="current" @change="handleChange"></u-tabs> :is-scroll="false" :current="current" @change="handleChange"></u-tabs>
</view> </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"> <block v-for="(item,index) in listOrder" :key="index">
<view class="orderBox"> <view class="orderBox" @click="toinfo(item.id)">
<view class="orderBoxTitle flex-row"> <view class="orderBoxTitle flex-row">
<text class="orderBoxTitleTxt">{{item.isteam?"团队预约":"个人预约"}}</text> <text class="orderBoxTitleTxt">{{item.type==1?"团队预约":"个人预约"}}</text>
<view class="orderBoxStatus">待参观</view> <view class="orderBoxStatus" :class="{'cancel':item.status==0}">{{item.status_name}}</view>
</view> </view>
<view class="orderBoxInfo flex-col"> <view class="orderBoxInfo flex-col">
<view class="orderBoxInfoRow flex-row" style="margin-bottom: 20rpx;"> <view class="orderBoxInfoRow flex-row" style="margin-bottom: 20rpx;">
<text class="iconfont icon-youkexuzhi"></text> <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>
<view class="orderBoxInfoRow flex-row"> <view class="orderBoxInfoRow flex-row">
<text class="iconfont icon-iconfontgerenzhongxin"></text> <text class="iconfont icon-iconfontgerenzhongxin"></text>
<text class="orderBoxInfoRowTxt">联系人王小华 13355634563</text> <text class="orderBoxInfoRowTxt">联系人{{item.leader}} {{item.mobile}}</text>
</view> </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="iconfont icon-danwei"></text>
<text class="orderBoxInfoRowTxt">单位名称王小华 13355634563</text> <text class="orderBoxInfoRowTxt">单位名称{{item.unit}}</text>
</view> </view>
</view> </view>
<view class="orderBoxTime"> <view class="orderBoxTime">
<text>下单时间5月03日 09:30</text> <text>下单时间{{item.created_at}}</text>
</view> </view>
<view class="orderBoxFooter flex-row flex_end"> <view class="orderBoxFooter flex-row flex_end">
<view class="fbtn" @click="tobook()" style="margin-right: 23rpx;">查看详情</view> <view class="fbtn" @click.stop="toinfo(item.id)" style="margin-right: 23rpx;">查看详情</view>
<view class="fbtn cancel">取消</view> <view class="fbtn cancel" @click.stop="tocancel(item.id)">取消</view>
</view> </view>
</view> </view>
</block> </block>
@ -50,31 +53,79 @@
flex: 1 flex: 1
}, },
list: [{ list: [{
name: '全部' name: '全部',
idx: ""
}, { }, {
name: '待参观' name: '待参观',
idx: "1"
}, { }, {
name: '已参观' name: '已参观',
idx: "2"
}], }],
current: 0, current: 0,
listOrder: [{ isloading: true,
isteam: true listOrder: []
},
{
isteam: false
}
]
} }
}, },
onShow() {
this.loadOrder();
},
methods: { methods: {
handleChange() { handleChange(e) {
this.current = e.index;
this.loadOrder();
}, },
tobook(){ toinfo(id) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/order/visitorderinfo" 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; color: #351C1B;
} }
.cancelstatus {
background: #828282;
}
.orderBoxStatus { .orderBoxStatus {
background: #EF9525; background: #EF9525;
border-top-right-radius: 16rpx; border-top-right-radius: 16rpx;

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

Loading…
Cancel
Save