123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- <template>
- <view class="container">
- <view class="content">
- <view class="title">
- <text>HI,车主</text>
- </view>
- <view class="tip">
- <text>
- 您还没未拥有车辆。
- </text>
- </view>
- <view class="itemTitleBox flex">
- <view class="itemTitle">
- 附近商家
- </view>
- <view class="tager flex" @click="navTo('/pages/index/shopTab')">
- <text>切换</text>
- <image class="itemIcon" src="../../../static/icon/next1.png" mode="widthFix"></image>
- </view>
- </view>
- <view class="shopContent flex">
- <view class="shoplogo">
- <image class="logo" :src="shopDetail.image" mode="scaleToFill"></image>
- </view>
- <view class="shopDetail">
- <view class="shopName clamp">
- {{shopDetail.name}}
- </view>
- <view class="shopDetailText">
- {{shopDetail.detailed_address}}
- </view>
- </view>
- </view>
- <view class="itemTitleBox flex">
- <view class="itemTitle">
- 国标系列
- </view>
- <view class="tager flex" @click="navTo('/pages/shop/shopIndex?id='+shopDetail.id+'&type=1')">
- <text>全部</text>
- <image class="itemIcon" src="/static/icon/next1.png" mode="widthFix"></image>
- </view>
- </view>
- <view class="flex cartList">
- <view class="itemBox" v-for="(item,index) in cartList" @click="navTo('/pages/product/product?id='+item.id)" :key='index'>
- <view class="imgBox">
- <image class="imageItem" :src="item.image" mode="scaleToFill"></image>
- </view>
- <view class="itemDetaile">
- <view class="cartName">
- <view class="clamp2 ">
- {{item.store_name}}
- </view>
- </view>
- <view class="maney clamp">
- <text class="greenText font-size-base">¥{{item.price}}</text>
- <text class="lign font-size-sm">{{item.sales|getNum}}+付款</text>
- </view>
- </view>
- </view>
- </view>
- <view class="itemTitleBox flex">
- <view class="itemTitle">
- 电摩系列
- </view>
- <view class="tager flex" @click="navTo('/pages/shop/shopIndex?id='+shopDetail.id+'&type=2')">
- <text>全部</text>
- <image class="itemIcon" src="../../../static/icon/next1.png" mode="widthFix"></image>
- </view>
- </view>
- <view class="flex cartList">
- <view class="itemBox" v-for="(item,index) in carTwoList" :key='index' @click="navTo('/pages/product/product?id='+item.id)">
- <view class="imgBox">
- <image class="imageItem" :src="item.image" mode="scaleToFill"></image>
- </view>
- <view class="itemDetaile">
- <view class="cartName">
- <view class="clamp2 ">
- {{item.store_name}}
- </view>
- </view>
- <view class="maney clamp">
- <text class="greenText font-size-base">¥{{item.price}}</text>
- <text class="lign font-size-sm">{{item.sales|getNum}}+付款</text>
- </view>
- </view>
- </view>
- </view>
- <view class="itemTitleBox flex">
- <view class="itemTitle">
- 电轻摩系列
- </view>
- <view class="tager flex" @click="navTo('/pages/shop/shopIndex?id='+shopDetail.id)+'&type=3'">
- <text>全部</text>
- <image class="itemIcon" src="../../../static/icon/next1.png" mode="widthFix"></image>
- </view>
- </view>
- <view class="flex cartList">
- <view class="itemBox" v-for="(item,index) in carTreeList" :key='index' @click="navTo('/pages/product/product?id='+item.id)">
- <view class="imgBox">
- <image class="imageItem" :src="item.image" mode="scaleToFill"></image>
- </view>
- <view class="itemDetaile">
- <view class="cartName">
- <view class="clamp2 ">
- {{item.store_name}}
- </view>
- </view>
- <view class="maney clamp">
- <text class="greenText font-size-base">¥{{item.price}}</text>
- <text class="lign font-size-sm">{{item.sales|getNum}}+付款</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState,
- } from 'vuex';
- import {
- getProducts,
- } from '@/api/product.js';
- export default {
- data() {
- return {
- cartList: [], //国标系列电动车
- carTwoList: [], //电摩系列电动车
- carTreeList: [], //电摩系列电动车
- };
- },
- computed: {
- ...mapState('shop', ['shopDetail'])
- },
- filters: {
- getNum(num) {
- if (num) {
- // 转为字符串
- num += '';
- let nu = num.slice(0, 1);
- for (let i = 0; i < num.length - 1; i++) {
- nu += 0
- }
- return nu
- } else {
- return 0
- }
- }
- },
- methods: {
- init() {
- // 查询国标
- this.getProducts(2, 'salesOrder').then((data) => {
- this.cartList = data;
- })
- // 查询电车
- this.getProducts(5, 'salesOrder').then((data) => {
- this.carTwoList = data;
- })
- // 查询电轻摩
- this.getProducts(6, 'salesOrder').then((data) => {
- this.carTreeList = data;
- })
- },
- // 获取门店车辆信息
- getProducts(sid, type) {
- let data = {
- sid: sid,
- page: 1,
- limit: 10,
- store_id: this.shopDetail.id,
- is_car: 1
- }
- // 保存查询分类
- data[type] = 1
- return new Promise((ok, erro) => {
- getProducts(data).then(({
- data
- }) => {
- ok(data)
- }).catch((e) => {
- erro(e)
- })
- })
- },
- navTo(url) {
- uni.navigateTo({
- url: url
- })
- }
- },
- };
- </script>
- <style lang="scss">
- $paddingJg:40rpx;
- .container{
- /* #ifdef APP */
- padding-top: calc(105rpx + var(--status-bar-height));
- /* #endif */
- /* #ifdef H5 || MP */
- padding-top: 105rpx;
- /* #endif */
- }
- .content {
- .greenText {
- color: $color-green;
- }
- .title {
- font-size: 48rpx;
- padding: 0 $paddingJg;
- padding-top: 60rpx;
- }
- .tip {
- font-size: 22rpx;
- color: $font-color-light;
- margin: 20rpx 0;
- padding: 0 $paddingJg;
- }
- .shopContent {
- color: $font-color-white;
- background-color: $base-color;
- border-radius: 20rpx;
- height: 160rpx;
- padding: 20rpx;
- margin: 0 $paddingJg;
- margin-bottom: 20rpx;
- .shoplogo {
- flex-shrink: 0;
- background-color: $font-color-white;
- width: 120rpx;
- height: 120rpx;
- border-radius: 20rpx;
- .logo {
- height: 100%;
- width: 100%;
- }
- }
- .shopDetail {
- padding-left: 30rpx;
- flex-grow: 1;
- .shopName {
- margin-bottom: 25rpx;
- font-size: 36rpx;
- }
- .shopDetailText {
- font-size: 22rpx;
- }
- }
- }
- .cartList {
- flex-wrap: wrap;
- margin: 0 $paddingJg;
- overflow: hidden;
- .itemBox {
- width: 310rpx;
- min-height: 460rpx;
- background-color: $font-color-white;
- border-radius: 20rpx;
- box-shadow: 0px 0px 10px 0px rgba(226, 226, 226, 0.35);
- margin-bottom: 30rpx;
- overflow: hidden;
- .imgBox {
- line-height: 0;
- .imageItem {
- width: 310rpx;
- height: 310rpx;
- }
- }
- .itemDetaile {
- padding: 10rpx 20rpx;
- .cartName {
- line-height: 1.5;
- font-size: 28rpx;
- color: $font-color-base;
- font-weight: 400;
- min-height: 90rpx;
- }
- .maney {
- line-height: 1;
- .lign {
- margin-left: 20rpx;
- color: $font-color-light;
- }
- }
- }
- }
- }
- }
- </style>
|