Commit 8d7e2d89 authored by 程新智's avatar 程新智 👽

优化tabbar

parent 41e5bbb1
No preview for this file type
<template>
<view class="weui-tabbar" :class="extClass">
<view @click="tabChange(index)" v-for="(item, index) in list" :key="index" class="weui-tabbar__item" :class="[{'weui-bar__item_on':index === current},{'flexd__icon':index===2}]">
<view style="position: relative;display:inline-block;"><image :src="current === index ? item.selectedIconPath : item.iconPath" class="weui-tabbar__icon"></image></view>
<view class="weui-tabbar__label">{{ item.text }}</view>
</view>
</view>
</template>
<script>
export default {
props: {
list: {
type: Array,
default: function() {
return []
}
}
},
data() {
return {
extClass: '',
current: 0
};
},
methods: {
tabChange(index) {
if (index === this.current) {
return;
}
this.current = index;
this.$emit('tabChange',index)
}
}
};
</script>
<style lang="scss" scoped >
.weui-tabbar {
display: flex;
position: relative;
z-index: 500;
background-color: #ffffff;
box-shadow: 0px 8rpx 19rpx 2rpx rgba(215, 215, 215, 0.21);
}
.flexd__icon{
width: 100upx;
position: relative;
top: -40rpx;
left: 0;
right: 0;
text-align: center;
margin: 0 auto;
background: url('../../static/tarbar/index31.png') center center no-repeat;
background-size: contain;
width: 74rpx;
height: 74rpx;
}
.weui-tabbar:before {
content: ' ';
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
// border-top: 1rpx solid rgba(0, 0, 0, 0.1);
color: rgba(0, 0, 0, 0.1);
}
.weui-tabbar__item {
display: block;
flex: 1;
padding: 8px 0 4px;
padding-bottom: calc(8px + constant(safe-area-inset-bottom));
padding-bottom: calc(8px + env(safe-area-inset-bottom));
font-size: 0;
color: rgba(0, 0, 0, 0.5);
text-align: center;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.weui-tabbar__item:first-child {
padding-left: constant(safe-area-inset-left);
padding-left: env(safe-area-inset-left);
}
.weui-tabbar__item:last-child {
padding-right: constant(safe-area-inset-right);
padding-right: env(safe-area-inset-right);
}
.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,
.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon > i,
.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label {
color: rgba(225, 37, 27, 1);
}
.weui-tabbar__icon {
display: inline-block;
width: 46rpx;
height: 46rpx;
margin-bottom: 2px;
}
i.weui-tabbar__icon,
.weui-tabbar__icon > i {
font-size: 24px;
color: rgba(0, 0, 0, 0.5);
}
.weui-tabbar__icon image {
width: 100%;
height: 100%;
}
.weui-tabbar__label {
color: #333;
font-size: 10px;
line-height: 1.4;
}
</style>
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
"navigationBarTitleText": "登录" "navigationBarTitleText": "登录"
} }
}, },
{
"path": "pages/main",
"style": {
"navigationBarTitleText": "首页"
}
},
{ {
"path": "pages/binding/binding", "path": "pages/binding/binding",
"style": { "style": {
......
No preview for this file type
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
// }); // });
//跳转到首页 //跳转到首页
uni.navigateTo({ uni.navigateTo({
url: '/pagesA/pages/index/index' url: '/pages/main'
}); });
} else { } else {
uni.showToast({ uni.showToast({
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
</view> --> </view> -->
<view v-if="isCanUse2"> <view v-if="isCanUse2">
<view> <view>
<button class="login__btn" v-if="!checked" @click="" hover-class="none" type='primary' <button class="login__btn" v-if="!checked" hover-class="none" type='primary'
@click="checkLogin"> @click="checkLogin">
微信一键登录 微信一键登录
</button> </button>
<button class="login__btn" v-if="checked" @click="" hover-class="none" type='primary' <button class="login__btn" v-if="checked" hover-class="none" type='primary'
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"> open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
微信一键登录 微信一键登录
</button> </button>
...@@ -176,7 +176,7 @@ export default { ...@@ -176,7 +176,7 @@ export default {
uni.reLaunch({ //信息更新成功后跳转到小程序首页 uni.reLaunch({ //信息更新成功后跳转到小程序首页
//todo 京东账号绑定界面暂缓 //todo 京东账号绑定界面暂缓
//url: '/pages/binding/binding' //url: '/pages/binding/binding'
url: '/pagesA/pages/index/index' url: '/pages/main'
}) })
// uni.navigateTo({ // uni.navigateTo({
......
<template>
<view class="appCotent">
<view class="index-content">
<u-swiper :radius="0" :height="210" :list="list5" circular :autoplay="false">
<view slot="indicator" class="indicator">
<view class="indicator__dot" v-for="(item, index) in list5" :key="index" :class="[index === current && 'indicator__dot--active']">
</view>
</view>
</u-swiper>
<u-gap bgColor="transparent" height="15"></u-gap>
<div class="content__code">
<div class="code__img">
<image :src="freeCode.mainImgUrl" class="code__img"></image>
</div>
<div class="code__money">
<div class="money__title">
<text>{{freeCode.title}}</text>
</div>
<div class="code__tips">
<text>绑定京东账号,仅需支付邮费</text>
</div>
<div class="money__num">
<text class="num__one">¥0.00</text>
<text class="num__two">{{freeCode.originalPrice/100}}</text>
</div>
</div>
<div class="code__get" @click="getPrice">
<div>
立即
</div>
<div>
领取
</div>
</div>
</div>
<u-gap bgColor="transparent" height="15"></u-gap>
<div class="index__item3">
<image src="@/static/index/index23.png"></image>
</div>
<u-gap bgColor="transparent" height="15"></u-gap>
<div class="index__item3-1">
<image src="@/static/index/index14.png"></image>
</div>
<u-gap bgColor="transparent" height="15"></u-gap>
<div class="index__item4">
<image src="@/static/index/index20.png"></image>
</div>
<u-gap bgColor="transparent" height="15"></u-gap>
<div class="index__item5">
<image src="@/static/index/index8.png"></image>
</div>
<u-gap bgColor="transparent" height="60"></u-gap>
</view>
</view>
</template>
<script>
export default {
data() {
return {
current: 0,
balance: "0.00",
list5: [],
//免费挪车码
freeCode: {},
};
},
methods: {
getPrice() {
uni.showToast({
title: "您的免费领取次数已用完",
icon: 'none',
duration: 2000,
});
//跳转到领取优惠卷页面
uni.navigateTo({
url: '/pagesA/pages/index/getPrice?orderId=' + this.freeCode.id
});
},
getMoveCode() {
let opts = {
url: '/app/mall/free/code',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.freeCode = res.data.data
}
})
},
getRotationList() {
let opts = {
url: '/app/index/carouse/1',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
let data = []
data = res.data.data
let imgList = []
data.forEach(e => {
imgList.push(e.imageUrl)
})
this.list5 = imgList
}
})
},
},
created() {
this.getMoveCode()
this.getRotationList()
},
onReady: function () {
uni.setNavigationBarTitle({
title: '首页'
});
}
};
</script>
<style lang="scss">
.index-content {
background-color: #f9f9f9;
height: 100%;
.index__item3 {
width: 100%;
height: 356rpx;
image {
width: 100%;
height: 356rpx;
}
}
.index__item3-1 {
width: 100%;
height: 711rpx;
image {
width: 100%;
height: 711rpx;
}
}
.index__item4 {
width: 100%;
height: 646rpx;
image {
width: 100%;
height: 646rpx;
}
}
.index__item5 {
width: 100%;
height: 1289rpx;
image {
width: 100%;
height: 1289rpx;
}
}
.content__code {
padding: 28rpx;
box-sizing: border-box;
width: 630rpx;
height: 220rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.16);
border-radius: 10rpx 40rpx 10rpx 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-left: 30rpx;
position: relative;
.code__img {
width: 160rpx;
height: 160rpx;
background: #3699ff;
border-radius: 10rpx;
}
.code__money {
margin: 0 20rpx;
.money__title {
font-size: 36rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
line-height: 42rpx;
.code__tips {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
line-height: 42rpx;
}
}
.money__num {
.num__one {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #e1251b;
line-height: 42rpx;
}
.num__two {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
line-height: 42rpx;
position: relative;
}
.num__two::before {
content: '';
width: 100%;
height: 1rpx;
background: #999;
position: absolute;
bottom: 16rpx;
left: 8rpx;
}
}
}
.code__get {
position: absolute;
right: -60rpx;
width: 90rpx;
height: 90rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
padding-top: 4rpx;
box-sizing: border-box;
text-align: center;
background: url("@/static/index/index26.png") no-repeat;
background-size: contain;
}
}
/deep/ .u-swiper__indicator {
right: 0 !important;
}
/deep/ .u-swiper {
border-radius: 0 0 0 100rpx !important;
}
.indicator {
@include flex(row);
justify-content: center;
&__dot {
height: 20rpx;
width: 20rpx;
border-radius: 100%;
background-color: rgba(255, 255, 255, 0.35);
margin: 0 10rpx;
transition: background-color 0.3s;
&--active {
background-color: #e1251b;
}
}
}
.indicator-num {
padding: 4rpx 0;
background-color: rgba(0, 0, 0, 0.35);
border-radius: 100%;
width: 35px;
@include flex;
justify-content: center;
&__text {
color: #ffffff;
font-size: 24rpx;
}
}
}
</style>
<template>
<view class="main_content">
<index v-if="tab=='index'"></index>
<moveCar v-if="tab=='moveCar'"></moveCar>
<shop v-if="tab=='shop'"></shop>
<personal v-if="tab=='personal'"></personal>
<u-gap bgColor="transparent" height="055"></u-gap>
<view class="tabbar">
<v-tabbar :list="tabbar" style="position:fixed;bottom:0;width:100%;left:0;right:0;" @tabChange="tabChange"></v-tabbar>
</view>
</view>
</template>
<script>
import {
mapState
} from 'vuex';
import tabbar from '@/common/hans-tabbar/hans-tabbar'
import index from './home'
import moveCar from './moveCar'
import shop from './shop'
import personal from './personal'
export default {
components: {
index,
moveCar,
personal,
shop,
'v-tabbar': tabbar
},
data() {
return {
tab: "index",
}
},
computed: {
...mapState({
tabbarTextColor: "tabbarTextColor",
tabbarTextActiveColor: "tabbarTextActiveColor",
tabbar: "tabbar"
})
},
onShow: function () {},
methods: {
tabChange(index) {
switch (index) {
case 0:
this.tab = 'index'
break;
case 1:
this.tab = 'moveCar'
break;
case 2:
uni.scanCode({
success: function (res) {
let path = res.path
if(path) {
let xcxIndexPath = uni.getStorageSync('xcxIndexPath')
console.info(xcxIndexPath);
if(xcxIndexPath) {
xcxIndexPath = path.replace(xcxIndexPath, '').replace("?", '')
if(xcxIndexPath.indexOf('scene') >= 0 ) {
let scene = xcxIndexPath.replace('scene=', '')
let param = {code : scene}
let opts = { url: '/app/index/check/move/code', method: 'post' }
console.log(param);
that.http.httpTokenRequest(opts, param).then(res => {
console.info(res)
if (res.data.code == 200) {
if(res.data.data.bindFlag) {
that.gotoMoveCar(scene)
} else {
that.gotoBindMoveCar(scene)
}
}
})
}
}
} else {
uni.showToast({
title:'扫码失败',
icon:'none',
})
}
}
});
break;
case 3:
this.tab = 'shop'
break;
case 4:
this.tab = 'personal'
break;
}
this.$forceUpdate();
},
},
onLoad() {}
}
</script>
<style lang="scss" scoped>
.main_content {
height: 100%;
overflow: hidden;
}
</style>
<template>
<view class="appCotent">
<view class="moveCar">
<div class="move_car__content">
<div class="menu__top" @click="goUrl({
url: '/pagesB/pages/move-car/loveCar',
})">
<div>
<image src="@/static/move-car/move-car1.png" />
</div>
<div>
爱车管理
</div>
</div>
<div class="menu__list">
<div class="list__items" v-for="(vo,inx) in items" :key="inx" @click="goUrl(vo)">
<div>
<image :src="vo.icon" />
</div>
<div>
{{vo.title}}
</div>
</div>
</div>
</div>
</view>
</view>
</template>
<script>
export default {
data() {
return {
items: [{
icon: require("@/static/move-car/move-car6.png"),
url: "/pagesB/pages/move-car/oneMoveCar",
title: "扫一扫联系车主"
},
{
icon: require("@/static/move-car/move-car3.png"),
url: "/pagesB/pages/move-car/myCall",
title: "我的呼叫记录"
}, {
icon: require("@/static/move-car/move-car2.png"),
url: "/pagesB/pages/move-car/myMoveCar",
title: "我的挪车牌"
}, {
icon: require("@/static/move-car/move-car4.png"),
url: "/pagesB/pages/move-car/myRecord",
title: "我的挪车记录"
},
]
}
},
methods: {
goUrl(vo) {
const that = this
if (vo.title != "扫一扫联系车主") {
uni.navigateTo({
url: vo.url
})
} else {
//跳转绑定页面
// uni.navigateTo({
// url: vo.url
// })
//扫码
uni.scanCode({
success: function (res) {
let path = res.path
if (path) {
let xcxIndexPath = uni.getStorageSync('xcxIndexPath')
if (xcxIndexPath) {
xcxIndexPath = path.replace(xcxIndexPath, '').replace("?", '')
if (xcxIndexPath.indexOf('scene') >= 0) {
let scene = xcxIndexPath.replace('scene=', '')
let param = {
code: scene
}
let opts = {
url: '/app/index/check/move/code',
method: 'post'
}
that.http.httpTokenRequest(opts, param).then(res => {
console.info(res)
if (res.data.code == 200) {
if (res.data.data.bindFlag) {
that.gotoMoveCar(scene)
} else {
that.gotoBindMoveCar(scene)
}
}
})
}
}
} else {
uni.showToast({
title: '扫码失败',
icon: 'none',
})
}
}
});
}
},
//跳转到挪车页面
gotoMoveCar(s) {
let that = this;
uni.navigateTo({
url: '/pagesB/pages/move-car/oneMoveCar?scene=' + s
});
},
//跳转到绑定页面
gotoBindMoveCar(s) {
let that = this;
uni.navigateTo({
url: '/pagesB/pages/move-car/scan?moveCode=' + s
});
},
},
onReady: function () {
uni.setNavigationBarTitle({
title: '我要挪车'
});
}
};
</script>
<style lang="scss">
.moveCar {
.move_car__content {
padding: 40rpx;
.menu__top {
height: 220rpx;
background: #FFFFFF;
border: 1rpx solid #EFE7E7;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.16);
border-radius: 20rpx;
margin-bottom: 30rpx;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 45rpx 0;
>div {
width: 100%;
text-align: center;
}
>div:nth-of-type(1) {
image {
width: 58rpx;
height: 50rpx;
}
}
>div:nth-of-type(2) {
font-size: 40rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
line-height: 42rpx;
}
}
.menu__list {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.list__items {
width: 325rpx;
height: 220rpx;
background: #FFFFFF;
border: 1rpx solid #EFE7E7;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.16);
border-radius: 20rpx;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 45rpx 0;
margin-bottom: 30rpx;
>div {
width: 100%;
text-align: center;
}
>div:nth-of-type(1) {
image {
width: 58rpx;
height: 58rpx;
}
}
>div:nth-of-type(2) {
font-size: 40rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
line-height: 42rpx;
}
}
.list__items:nth-of-type(2) {
>div:nth-of-type(1) {
image {
width: 55rpx;
height: 58rpx;
}
}
}
.list__items:nth-of-type(3) {
>div:nth-of-type(1) {
image {
width: 58rpx;
height: 58rpx;
}
}
}
.list__items:nth-of-type(4) {
>div:nth-of-type(1) {
image {
width: 54rpx;
height: 58rpx;
}
}
}
}
}
}
</style>
This diff is collapsed.
<template>
<view class="appCotent">
<view>
<view class="shop">
<div class="my__search" @click='goSearch'>
<u-search placeholder="搜搜你最想知道的" :showAction='false' bgColor='#ffffff' v-model="keyword"></u-search>
</div>
<div class="shop__swiper">
<view class="u-demo-block">
<u-swiper :list="list3" previousMargin="30" nextMargin="30" circular :autoplay="false" height='150' radius="5" bgColor="#ffffff"></u-swiper>
</view>
</div>
<div class="view__content">
<div class="view__title">超低价养车好物</div>
<div class="shop__list2">
<div class="shop__item2" v-for="(vo,inx) in mallList" :key="inx" @click="goDetail(vo.id)">
<div class="item2__img">
<image :src="getImage(vo.mainImgUrl)" />
</div>
<div class="item2__title">{{vo.title}}</div>
<div class="item2__price">{{vo.currentPrice/100}}</div>
</div>
</div>
</div>
<div class="shop__list__one">
<div class="view__title">车主精选 养车必备</div>
<scroll-list ref="list" :option="option" @load="load">
<div class="list__one__items">
<div class="one__item" v-for="(vo,inx) in boutiqueMallList" :key="inx" @click="goDetail(vo.id)">
<div class="one__item__img">
<image :src="getImage(vo.mainImgUrl)" />
</div>
<div class="one__item__title">
{{vo.title}}
</div>
<div class="one__item__price">
{{vo.currentPrice/100}}<span class="num__two">{{vo.originalPrice/100}}</span>
</div>
</div>
</div>
</scroll-list>
</div>
</view>
<u-gap bgColor="transparent" height="60"></u-gap>
</view>
</view>
</template>
<script>
export default {
data() {
return {
option: {
size: 10,
auto: true
},
keyword: '',
list3: [
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
],
//普通商品列表
mallList: [],
//精品商品
boutiqueMallList: [],
}
},
methods: {
// 加载数据
load(paging) {
setTimeout(() => {
let opts = {
url: '/app/mall/list?pageSize=' + paging.size + '&pageNum=' + paging.page,
method: 'get'
};
this.http.httpTokenRequest(opts, {
classification: "2"
}).then(res => {
if (res.data.code == 200) {
let list = res.data.data.rows
this.boutiqueMallList = [...this.boutiqueMallList, ...list];
// 加载成功 参数对象{list: 当前列表,total: 数据总长度(后端查询的total)}
this.$refs.list.loadSuccess({
list: this.boutiqueMallList,
total: res.data.data.total
});
// 加载失败
// this.$refs.list.loadFail()
}
})
}, this.$u.random(100, 1000));
},
goSearch() {
uni.navigateTo({
url: '/pagesC/pages/shop/search'
})
},
goDetail(id) {
uni.navigateTo({
url: '/pagesC/pages/shop/detail?id=' + id
})
},
getMallList() {
let opts = {
url: '/app/mall/list',
method: 'get'
};
this.http.httpTokenRequest(opts, {
classification: "1"
}).then(res => {
if (res.data.code == 200) {
this.mallList = res.data.data.rows
}
})
},
getBoutiqueMallList() {
let opts = {
url: '/app/mall/list',
method: 'get'
};
this.http.httpTokenRequest(opts, {
classification: "2"
}).then(res => {
if (res.data.code == 200) {
this.boutiqueMallList = res.data.data.rows
}
})
},
getImage(imageUrl) {
return imageUrl;
},
getRotationList() {
let opts = {
url: '/app/index/carouse/2',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
let data = []
data = res.data.data
let imgList = []
data.forEach(e => {
imgList.push(e.imageUrl)
})
this.list3 = imgList
}
})
},
},
onReady: function () {
uni.setNavigationBarTitle({
title: '精选商城'
});
},
mounted() {
this.getMallList()
this.getRotationList()
//this.getBoutiqueMallList()
}
};
</script>
<style lang="scss" scoped>
.shop {
height: 100%;
.shop__list__one {
padding: 0 30rpx;
background: #f9f9f9;
.list__one__items {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
.one__item {
width: 48%;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.2);
border-radius: 20rpx;
margin-bottom: 30rpx;
.one__item__img {
width: 100%;
height: 320rpx;
background: #FFD4D4;
border-radius: 20rpx;
image {
width: 100%;
height: 100%;
border-radius: 20rpx;
}
}
.one__item__title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin: 20rpx 0;
text-indent: 20rpx;
margin-bottom: 10rpx;
}
.one__item__price {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #E1251B;
text-indent: 20rpx;
padding-bottom: 20rpx;
span {
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
}
}
}
}
}
.my__search {
padding: 30rpx;
}
.view__title {
font-size: 38rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
position: relative;
z-index: 999;
margin-bottom: 30rpx;
}
.view__title::before {
content: "";
width: 76rpx;
height: 14rpx;
display: inline-block;
background: url('@/static/move-car/love-car1.png') no-repeat;
background-size: contain;
position: absolute;
bottom: 7rpx;
z-index: -1;
}
.shop__swiper {
margin-bottom: 30rpx;
}
.view__content {
padding: 40rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.2);
border-radius: 20rpx;
margin-bottom: 40rpx;
.shop__list2 {
display: flex;
align-items: center;
justify-content: space-between;
.shop__item2 {
width: 25%;
.item2__img {
margin-bottom: 20rpx;
text-align: center;
width: 145rpx;
height: 145rpx;
image {
width: 145rpx;
height: 145rpx;
}
}
.item2__title {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
line-height: 42rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.item2__price {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #E1251B;
line-height: 42rpx;
}
}
}
}
}
</style>
<template> <template>
<view class="appCotent"> <view class="appCotent">
<view class="index-content"> <view class="index-content">
<custom-tarbar :selected="0"></custom-tarbar>
<u-swiper :radius="0" :height="210" :list="list5" circular :autoplay="false"> <u-swiper :radius="0" :height="210" :list="list5" circular :autoplay="false">
<view slot="indicator" class="indicator"> <view slot="indicator" class="indicator">
<view class="indicator__dot" v-for="(item, index) in list5" :key="index" :class="[index === current && 'indicator__dot--active']"> <view class="indicator__dot" v-for="(item, index) in list5" :key="index" :class="[index === current && 'indicator__dot--active']">
...@@ -56,11 +55,7 @@ ...@@ -56,11 +55,7 @@
</template> </template>
<script> <script>
import customTarbar from "@/common/wxcomponents/custom-tarbar/custom-tarbar.vue";
export default { export default {
components: {
"custom-tarbar": customTarbar,
},
data() { data() {
return { return {
current: 0, current: 0,
......
<template>
<view class="main_content">
<index v-if="tab=='index'"></index>
<moveCar v-if="tab=='moveCar'"></moveCar>
<shop v-if="tab=='shop'"></shop>
<personal v-if="tab=='personal'"></personal>
<view class="tabbar">
<v-tabbar :list="tabbar" style="position:fixed;bottom:0;width:100%;left:0;right:0;" @tabChange="tabChange"></v-tabbar>
</view>
</view>
</template>
<script>
import {
mapState
} from 'vuex';
import tabbar from '@/common/hans-tabbar/hans-tabbar'
import index from './index'
import moveCar from '../../../pagesB/pages/move-car/index.vue'
import shop from '../../../pagesC/pages/shop/index.vue'
import personal from '../../../pagesD/pages/personal/index.vue'
export default {
components: {
index,
moveCar,
personal,
shop,
'v-tabbar': tabbar
},
data() {
return {
tab: "shop",
}
},
computed: {
...mapState({
tabbarTextColor: "tabbarTextColor",
tabbarTextActiveColor: "tabbarTextActiveColor",
tabbar: "tabbar"
})
},
onShow: function () {},
methods: {
tabChange(index) {
console.log(index);
switch (index) {
case 0:
this.tab = 'index'
break;
case 1:
this.tab = 'moveCar'
break;
case 2:
this.tab = 'moveCar'
break;
case 3:
this.tab = 'shop'
break;
}
},
},
onLoad() {}
}
</script>
<style lang="scss" scoped>
.main_content {
height: 100%;
overflow: hidden;
}
</style>
<template> <template>
<view class="appCotent"> <view class="appCotent">
<view class="moveCar"> <view class="moveCar">
<custom-tarbar :selected="1"></custom-tarbar>
<div class="move_car__content"> <div class="move_car__content">
<div class="menu__top" @click="goUrl({ <div class="menu__top" @click="goUrl({
...@@ -32,11 +31,7 @@ url: '/pagesB/pages/move-car/loveCar', ...@@ -32,11 +31,7 @@ url: '/pagesB/pages/move-car/loveCar',
</template> </template>
<script> <script>
import customTarbar from '@/common/wxcomponents/custom-tarbar/custom-tarbar.vue';
export default { export default {
components: {
'custom-tarbar': customTarbar
},
data() { data() {
return { return {
items: [{ items: [{
...@@ -62,7 +57,7 @@ export default { ...@@ -62,7 +57,7 @@ export default {
}, },
methods: { methods: {
goUrl(vo) { goUrl(vo) {
const that = this const that = this
if (vo.title != "扫一扫联系车主") { if (vo.title != "扫一扫联系车主") {
uni.navigateTo({ uni.navigateTo({
url: vo.url url: vo.url
...@@ -73,53 +68,58 @@ export default { ...@@ -73,53 +68,58 @@ export default {
// url: vo.url // url: vo.url
// }) // })
//扫码 //扫码
uni.scanCode({ uni.scanCode({
success: function (res) { success: function (res) {
let path = res.path let path = res.path
if(path) { if (path) {
let xcxIndexPath = uni.getStorageSync('xcxIndexPath') let xcxIndexPath = uni.getStorageSync('xcxIndexPath')
if(xcxIndexPath) { if (xcxIndexPath) {
xcxIndexPath = path.replace(xcxIndexPath, '').replace("?", '') xcxIndexPath = path.replace(xcxIndexPath, '').replace("?", '')
if(xcxIndexPath.indexOf('scene') >= 0 ) { if (xcxIndexPath.indexOf('scene') >= 0) {
let scene = xcxIndexPath.replace('scene=', '') let scene = xcxIndexPath.replace('scene=', '')
let param = {code : scene} let param = {
let opts = { url: '/app/index/check/move/code', method: 'post' } code: scene
}
that.http.httpTokenRequest(opts, param).then(res => { let opts = {
console.info(res) url: '/app/index/check/move/code',
if (res.data.code == 200) { method: 'post'
if(res.data.data.bindFlag) { }
that.gotoMoveCar(scene)
} else { that.http.httpTokenRequest(opts, param).then(res => {
that.gotoBindMoveCar(scene) console.info(res)
if (res.data.code == 200) {
if (res.data.data.bindFlag) {
that.gotoMoveCar(scene)
} else {
that.gotoBindMoveCar(scene)
}
}
})
}
} }
} } else {
}) uni.showToast({
} title: '扫码失败',
icon: 'none',
})
}
} }
} else { });
uni.showToast({
title:'扫码失败',
icon:'none',
})
}
}
});
} }
}, },
//跳转到挪车页面 //跳转到挪车页面
gotoMoveCar(s) { gotoMoveCar(s) {
let that = this; let that = this;
uni.navigateTo({ uni.navigateTo({
url: '/pagesB/pages/move-car/oneMoveCar?scene=' + s url: '/pagesB/pages/move-car/oneMoveCar?scene=' + s
}); });
}, },
//跳转到绑定页面 //跳转到绑定页面
gotoBindMoveCar(s) { gotoBindMoveCar(s) {
let that = this; let that = this;
uni.navigateTo({ uni.navigateTo({
url: '/pagesB/pages/move-car/scan?moveCode=' + s url: '/pagesB/pages/move-car/scan?moveCode=' + s
}); });
}, },
}, },
......
<template> <template>
<view class="appCotent"> <view class="appCotent">
<view> <view>
<custom-tarbar :selected="3"></custom-tarbar>
<view class="shop"> <view class="shop">
<div class="my__search" @click='goSearch'> <div class="my__search" @click='goSearch'>
<u-search placeholder="搜搜你最想知道的" :showAction='false' bgColor='#ffffff' v-model="keyword"></u-search> <u-search placeholder="搜搜你最想知道的" :showAction='false' bgColor='#ffffff' v-model="keyword"></u-search>
...@@ -51,11 +50,7 @@ ...@@ -51,11 +50,7 @@
</template> </template>
<script> <script>
import customTarbar from '@/common/wxcomponents/custom-tarbar/custom-tarbar.vue';
export default { export default {
components: {
'custom-tarbar': customTarbar
},
data() { data() {
return { return {
option: { option: {
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
}, },
goGhome() { goGhome() {
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/pages/shop/index' url: '/pages/main'
}) })
} }
}, },
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
<template> <template>
<view class="appCotent"> <view class="appCotent">
<view class="content"> <view class="content">
<custom-tarbar :selected="4"></custom-tarbar>
<view class="personal"> <view class="personal">
<div class="ps__bg"> <div class="ps__bg">
<div class="ps__title"></div> <div class="ps__title"></div>
...@@ -62,11 +61,7 @@ ...@@ -62,11 +61,7 @@
</template> </template>
<script> <script>
import customTarbar from '@/common/wxcomponents/custom-tarbar/custom-tarbar.vue';
export default { export default {
components: {
'custom-tarbar': customTarbar
},
data() { data() {
return { return {
menu: [{ menu: [{
......
...@@ -6,6 +6,55 @@ const store = new Vuex.Store({ ...@@ -6,6 +6,55 @@ const store = new Vuex.Store({
state: { state: {
token: "", token: "",
selectedCar: {}, selectedCar: {},
tabbar: [
// {
// text: "首页",
// iconPath: require("@/static/image/home.png"),
// selectedIconPath: require("@/static/image/home2.png"),
// },
// {
// text: "我的",
// iconPath: require("@/static/image/user1.png"),
// selectedIconPath: require("@/static/image/user.png"),
// },
{
pagePath: '/pagesA/pages/index/index',
iconPath: '/static/tarbar/index22.png',
selectedIconPath: '/static/tarbar/index5.png',
text: '首页'
},
{
pagePath: '/pagesB/pages/move-car/index',
iconPath: '/static/tarbar/index17.png',
selectedIconPath: '/static/tarbar/index24.png',
text: '我要挪车'
},
{
pagePath: '/pagesC/pages/releaseBtn/releaseBtn',
iconPath: '',
selectedIconPath: '/static/tarbar/index31.png'
},
{
pagePath: '/pagesC/pages/shop/index',
iconPath: '/static/tarbar/index2.png',
selectedIconPath: '/static/tarbar/index21.png',
text: '精选商城'
},
{
pagePath: '/pagesD/pages/personal/index',
iconPath: '/static/tarbar/index11.png',
selectedIconPath: '/static/tarbar/index23.png',
text: '我的'
},
],
tabbarTextColor: "rgba(102, 102, 102, 1)",
tabbarTextActiveColor: "rgba(225, 37, 27, 1)",
},
mutations: {
SET_TABBAR(state, tabbar) {
state.tabbar = tabbar || [];
},
}, },
actions: {}, actions: {},
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment