Browse Source

提交

master
chenkainan 11 months ago
parent
commit
15964cf315
  1. 48
      pages/index/index.vue
  2. 37
      static/css/base.css
  3. 106
      static/js/CommonFunction.js

48
pages/index/index.vue

@ -1,6 +1,21 @@
<template> <template>
<view class="content"> <view class="content">
<image src="https://static.ticket.sz-trip.com/tourGuide/images/index/topImg.png" class="topImg"></image>
<view class="title">
·快捷入口
</view>
<view class="flex-between">
<view class="nav-item flex-around">
立即核销
<image src="https://static.ticket.sz-trip.com/tourGuide/images/index/hexiao.png" mode=""></image>
</view>
<view class="nav-item flex-around">
查看订单
<image src="https://static.ticket.sz-trip.com/tourGuide/images/index/dingdan.png" mode=""></image>
</view>
</view>
</view> </view>
</template> </template>
@ -20,9 +35,40 @@
} }
</script> </script>
<style> <style lang="scss" scoped>
.content { .content {
background: #FFFFFF; background: #FFFFFF;
min-height: 100vh; min-height: 100vh;
padding: 40rpx 26rpx 100rpx;
}
.topImg {
width: 299.33rpx;
height: 70rpx;
display: flex;
margin: auto;
}
.title {
font-weight: bold;
font-size: 35rpx;
color: #000000;
margin: 68rpx 0 34rpx;
}
.nav-item {
font-weight: 500;
font-size: 32rpx;
color: #000000;
width: 338rpx;
height: 118rpx;
background: #F5F5F5;
border-radius: 20rpx;
padding: 0 15rpx;
image {
width: 80.67rpx;
height: 80.67rpx;
}
} }
</style> </style>

37
static/css/base.css

@ -62,6 +62,7 @@ view {
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.finished-text { .finished-text {
text-align: center; text-align: center;
font-size: 24upx; font-size: 24upx;
@ -69,3 +70,39 @@ view {
color: #999999; color: #999999;
} }
.flex{
display: flex;
}
.flex-shrink-0{
flex-shrink: 0;
}
.flex-1{
flex: 1;
}
.flex-wrap{
flex-wrap: wrap;
}
.w-full{
width: 100%;
}
.w-1rpx{
width: 1rpx;
}
.h-1rpx{
height: 1rpx;
}
.relative{
position: relative;
}
.absolute{
position: absolute;
}
.flex-items-center{
align-items: center;
}
.no-scrollbar::-webkit-scrollbar{
display: none;
}
.font-bold{
font-weight: bold;
}

106
static/js/CommonFunction.js

@ -59,3 +59,109 @@ Vue.prototype.IsMail = code => {
var pattern = /^\w+@[a-z0-9]+\.[a-z]+$/i; var pattern = /^\w+@[a-z0-9]+\.[a-z]+$/i;
return pattern.test(code); return pattern.test(code);
} }
// 图片显示判断
Vue.prototype.showImg = img => {
if(!img) return;
if (img.indexOf('https://') != -1 || img.indexOf('http://') != -1) {
return img;
} else {
return 'https://tlgz.sz-trip.com' + img;
}
}
// 获取经纬度
Vue.prototype.getLocation = () => {
uni.startLocationUpdate({
success: res => {
uni.onLocationChange(data => {
uni.setStorageSync('location', {
lat: data.latitude,
lon: data.longitude
});
})
}
})
}
// 金刚区头图
Vue.prototype.getHeadImg = type => {
return Vue.prototype.Post(
{
type,
},
'/api/public_service/getKumgangHeadImgList'
).then(res => {
return res.data[0].image
});
}
// 路由页面跳转
Vue.prototype.gotoPath = path => {
uni.navigateTo({
url: path
})
}
// 返回上一页
Vue.prototype.goBack = () => {
console.log(getCurrentPages())
var pages = getCurrentPages();
var page = pages[pages.length - 1];
if(page.route == 'subPackages/techan/techanList') {
uni.switchTab({
url: '/pages/index/index'
})
return;
}
getCurrentPages().length > 1 ? uni.navigateBack({}) : uni.switchTab({
url: '/pages/index/index'
})
}
// 打开地图
Vue.prototype.openLocation = (lat,lon) => {
uni.openLocation({
latitude: Number(lat),
longitude: Number(lon),
success: function () {
console.log('success');
}
});
}
// 拨打电话
Vue.prototype.clickPhone = (phone) => {
uni.makePhoneCall({
phoneNumber:phone
})
}
// 周几
Vue.prototype.ShowDateDay = day => {
let stateTxt = "";
switch (day) {
case 0:
stateTxt = '周日'
break;
case 1:
stateTxt = '周一'
break;
case 2:
stateTxt = '周二'
break;
case 3:
stateTxt = '周三'
break;
case 4:
stateTxt = '周四'
break;
case 5:
stateTxt = '周五'
break;
case 6:
stateTxt = '周六'
break;
}
return stateTxt
}
Loading…
Cancel
Save