|
@@ -1,1187 +1,1226 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <view class="page-index" :class="{'bgf':navIndex >0}">
|
|
|
- <!-- #ifdef H5 -->
|
|
|
- <view class="header">
|
|
|
- <view class="serch-wrapper flex">
|
|
|
- <view class="logo">
|
|
|
- <image :src="logoUrl" mode="" />
|
|
|
+ <view class="map-box" v-if="!deviceCode">
|
|
|
+
|
|
|
+ <!-- <view class="mp-header">
|
|
|
+ <view class="sys-head" :style="'height:'+(statusBarHeight)+'px;'"></view>
|
|
|
+ <view class="serch-box" :style="{height:barHeight+'px'}">
|
|
|
+ <view class="serch-wrapper flex" @click="goEquList">
|
|
|
+ <image class="logo" src='/static/img/addequ.png' mode="" />
|
|
|
+ <view class="name">奶奶</view>
|
|
|
+ <image class="arrow" src="/static/img/arrow.png" mode=""></image>
|
|
|
</view>
|
|
|
- <navigator url="/pages/goods_search/index" class="input" hover-class="none">
|
|
|
- <text class="iconfont icon-xiazai5" /> 搜索商品
|
|
|
- </navigator>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <!-- #endif -->
|
|
|
- <!-- #ifdef MP -->
|
|
|
- <view class="mp-header">
|
|
|
- <view class="sys-head" :style="{ height: statusBarHeight }"></view>
|
|
|
- <view class="serch-box" style="height: 40px;">
|
|
|
- <view class="serch-wrapper flex">
|
|
|
- <view class="logo">
|
|
|
- <image :src="logoUrl" mode=""></image>
|
|
|
- </view>
|
|
|
- <navigator url="/pages/goods_search/index" class="input" hover-class="none"><text
|
|
|
- class="iconfont icon-xiazai5"></text>
|
|
|
- 搜索商品</navigator>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
+ <map id='map' :latitude="latitude" :longitude="longitude" :markers="covers" :polyline="polyline"
|
|
|
+ :scale="scale">
|
|
|
+ </map>
|
|
|
+ <view class="top-input" v-if="!deviceId">
|
|
|
+ <image src="../../static/img/noneEqu.png" mode=""></image>
|
|
|
+ <view class="btn-box" @click="goEquList">
|
|
|
+ <view class="btn">添加设备</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <!-- #endif -->
|
|
|
- <!-- 首页展示 -->
|
|
|
- <view class="page_content" :style="'margin-top:'+(marTop)+'px;'" v-if="navIndex === 0">
|
|
|
- <view class="mp-bg"></view>
|
|
|
- <!-- banner 轮播图 -->
|
|
|
- <view class="swiper" v-if="slideShows.length">
|
|
|
- <swiper indicator-dots="true" :autoplay="true" :circular="circular" :interval="interval"
|
|
|
- :duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
|
|
|
- <block v-for="(item,index) in slideShows" :key="index">
|
|
|
- <swiper-item>
|
|
|
- <navigator :url='item.url' class='slide-navigator acea-row row-between-wrapper'
|
|
|
- hover-class='none'>
|
|
|
- <image :src="item.picUrl" class="slide-image" lazy-load></image>
|
|
|
- </navigator>
|
|
|
- </swiper-item>
|
|
|
- </block>
|
|
|
- </swiper>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 新闻简报 -->
|
|
|
- <view class='notice acea-row row-middle row-between' v-if="scrollingNews.length">
|
|
|
- <view class="pic">
|
|
|
- <image src="/static/images/xinjian.png" />
|
|
|
- </view>
|
|
|
- <text class='line'>|</text>
|
|
|
- <view class='swipers'>
|
|
|
- <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500"
|
|
|
- vertical="true" circular="true">
|
|
|
- <block v-for="(item,index) in scrollingNews" :key='index'>
|
|
|
- <swiper-item>
|
|
|
- <navigator class='item' :url='item.url' hover-class='none'>
|
|
|
- <view class='line1'>{{ item.name }}</view>
|
|
|
- </navigator>
|
|
|
- </swiper-item>
|
|
|
- </block>
|
|
|
- </swiper>
|
|
|
- </view>
|
|
|
- <view class="iconfont icon-xiangyou" />
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- menu 菜单 -->
|
|
|
- <view class='nav acea-row' v-if="menus.length">
|
|
|
- <block v-for="(item,index) in menus" :key="index">
|
|
|
- <navigator class='item' v-if="item.show === '1'" :url='item.url' open-type='switchTab'
|
|
|
- hover-class='none'>
|
|
|
- <view class='pictrue'>
|
|
|
- <image :src='item.picUrl'></image>
|
|
|
- </view>
|
|
|
- <view class="menu-txt">{{item.name}}</view>
|
|
|
- </navigator>
|
|
|
- <navigator class='item' v-else :url='item.url' hover-class='none'>
|
|
|
- <view class='pictrue'>
|
|
|
- <image :src='item.picUrl'></image>
|
|
|
+ <view class="info-box" v-if="deviceId" @click="goBindPage">
|
|
|
+ <view class="scroll-view_H">
|
|
|
+ <scroll-view class="scroll-view-content" scroll-x @scroll="scroll" scroll-left="0">
|
|
|
+ <view id="demo1" class="scroll-view-item_H uni-bg-red" @click="toHeartRate">
|
|
|
+ <image class="bg-image" src="../../static/img/heart.png" mode=""></image>
|
|
|
+ <view class="text-wrapper">
|
|
|
+ <view class="text-overlay black">
|
|
|
+ <view class="top-box">
|
|
|
+ <view class="top-left">
|
|
|
+ <view class="english">Heart rate</view>
|
|
|
+ <view class="chinese">心率</view>
|
|
|
+ </view>
|
|
|
+ <image class="top-right"
|
|
|
+ src="https://app.tjzhxx.cn:11443/image/enterprise_icon.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ <view class="under-box">
|
|
|
+ <view class="under-left">
|
|
|
+ <view class="number">98</view>
|
|
|
+ <view class="unit">bpm</view>
|
|
|
+ </view>
|
|
|
+ <view class="under-right">
|
|
|
+ <view class="range">75~96 bpm</view>
|
|
|
+ <view class="range-word">平局区间</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="menu-txt">{{item.name}}</view>
|
|
|
- </navigator>
|
|
|
- </block>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 优惠券 -->
|
|
|
- <view class="couponIndex" v-if="couponList.length>0">
|
|
|
- <view class="acea-row" style="height: 100%;">
|
|
|
- <view class="titBox">
|
|
|
- <view class="tit1">领取优惠券</view>
|
|
|
- <view class="tit2">福利大礼包,省了又省</view>
|
|
|
- <navigator class='item' url='/pages/users/user_get_coupon/index' hover-class='none'>
|
|
|
- <view class="tit3">查看全部 <text class="iconfont icon-xiangyou"></text></view>
|
|
|
- </navigator>
|
|
|
</view>
|
|
|
- <view class="listBox acea-row">
|
|
|
- <view class="list" :class='item.canTake ? "listActive" : "listHui"'
|
|
|
- v-for="(item, index) in couponList" :key="index">
|
|
|
- <view class="tit line1" :class='item.canTake ? "titActive" : "pricehui"'>{{ item.name }}</view>
|
|
|
- <view class="price" :class='item.canTake ? "icon-color" : "pricehui"'>
|
|
|
- <text v-if="item.discountType === 1">{{ fen2yuan(item.discountPrice) }} 元</text>
|
|
|
- <text v-else>{{ (item.discountPercent / 10.0).toFixed(1) }} 折</text>
|
|
|
- </view>
|
|
|
- <view class="ling icon-color" v-if="item.canTake"
|
|
|
- @click="getCoupon(item.id,index)">领取</view>
|
|
|
- <view class="ling pricehui fonthui" v-else>已领取</view>
|
|
|
- <view class="priceM">满{{ fen2yuan(item.usePrice) }}元可用</view>
|
|
|
+ <view id="demo2" class="scroll-view-item_H uni-bg-green">
|
|
|
+ <image class="bg-image" src="../../static/img/sleep.png" mode=""></image>
|
|
|
+ <view class="text-wrapper white">
|
|
|
+ <view class="text-overlay">
|
|
|
+ <view class="top-box">
|
|
|
+ <view class="top-left">
|
|
|
+ <view class="english">Sleep log</view>
|
|
|
+ <view class="chinese">睡眠</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="under-box">
|
|
|
+ <view class="under-left white">
|
|
|
+ <view class="number">5h</view>
|
|
|
+ <view class="unit">28 min</view>
|
|
|
+ </view>
|
|
|
+ <view class="under-left white">
|
|
|
+ <view class="number">66%</view>
|
|
|
+ <view class="unit">深睡</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 营销活动 -->
|
|
|
- <a_seckill />
|
|
|
- <b_combination />
|
|
|
- <c_bargain />
|
|
|
-
|
|
|
- <!-- 首页推荐 -->
|
|
|
- <view class="sticky-box" :style="'top:'+(marTop)+'px;'">
|
|
|
- <scroll-view class="scroll-view_H" style="width: 100%;" scroll-x="true" scroll-with-animation
|
|
|
- :scroll-left="tabsScrollLeft" @scroll="scroll">
|
|
|
- <view class="tab nav-bd" id="tab_list">
|
|
|
- <view id="tab_item" :class="{ 'active': listActive === index}" class="item"
|
|
|
- v-for="(item, index) in productRecommends" :key="index" @click="ProductNavTab(item,index)">
|
|
|
- <view class="txt">{{item.name}}</view>
|
|
|
- <view class="label">{{item.tag}}</view>
|
|
|
+ <view id="demo3" class="scroll-view-item_H uni-bg-blue">
|
|
|
+ <image class="bg-image" src="../../static/img/breathe.png" mode=""></image>
|
|
|
+ <view class="text-wrapper white">
|
|
|
+ <view class="text-overlay">
|
|
|
+ <view class="top-box">
|
|
|
+ <view class="top-left">
|
|
|
+ <view class="english">Breathe log</view>
|
|
|
+ <view class="chinese">呼吸</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="under-box">
|
|
|
+ <view class="under-left white">
|
|
|
+ <view class="number">21次</view>
|
|
|
+ <view class="unit">最高</view>
|
|
|
+ </view>
|
|
|
+ <view class="under-left white">
|
|
|
+ <view class="number">17次</view>
|
|
|
+ <view class="unit">平均呼吸</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
- <!-- 首发新品 -->
|
|
|
- <view class="index-product-wrapper" :class="iSshowH?'on':''">
|
|
|
- <view class="list-box animated" :class='tempArr.length > 0?"fadeIn on":""'>
|
|
|
- <view class="item" v-for="(item,index) in tempArr" :key="index" @click="goDetail(item)">
|
|
|
- <view class="pictrue">
|
|
|
- <span class="pictrue_log pictrue_log_class"
|
|
|
- v-if="item.activityList && item.activityList[0] && item.activityList[0].type === 1">秒杀</span>
|
|
|
- <span class="pictrue_log pictrue_log_class"
|
|
|
- v-if="item.activityList && item.activityList[0] && item.activityList[0].type === 2">砍价</span>
|
|
|
- <span class="pictrue_log pictrue_log_class"
|
|
|
- v-if="item.activityList && item.activityList[0] && item.activityList[0].type === 3">拼团</span>
|
|
|
- <image :src="item.picUrl" mode="" />
|
|
|
- </view>
|
|
|
- <view class="text-info">
|
|
|
- <view class="title line1">{{ item.name }}</view>
|
|
|
- <view class="old-price"><text>¥{{ fen2yuan(item.marketPrice) }}</text></view>
|
|
|
- <view class="price">
|
|
|
- <text>¥</text>{{ fen2yuan(item.price) }}
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class='loadingicon acea-row row-center-wrapper' v-if="goodScroll">
|
|
|
- <text class='loading iconfont icon-jiazai' :hidden='!loading' />
|
|
|
- </view>
|
|
|
- <view class="mores-txt flex" v-if="!goodScroll">
|
|
|
- <text>我是有底线的</text>
|
|
|
- </view>
|
|
|
+ <view class="sos-btn">
|
|
|
+ <image src="../../static/img/sos.png" mode=""></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view class="icon-box-right" v-if="showBtn">
|
|
|
+ <image src="/static/image/calendarIcon.png" mode="" @click="showDayPicker = true"></image>
|
|
|
+ </view>
|
|
|
+ <van-loading class="loading" v-if="showLoading" type="spinner" color="#000" />
|
|
|
+ </view>
|
|
|
+ <view class="" v-if="deviceCode">
|
|
|
+ <web-view :src="h5url"></web-view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <!-- </page-container> -->
|
|
|
+ <van-popup :show="showDayPicker" position="bottom">
|
|
|
+ <van-datetime-picker @cancel="showDayPicker=false" @confirm="onConfirm" :value="currentDay" type="date" />
|
|
|
+ <!-- :min-date="minDate" -->
|
|
|
+ </van-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
-<script>
|
|
|
- import Cache from '../../utils/cache';
|
|
|
- const statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
|
|
- let app = getApp();
|
|
|
- import a_seckill from './components/a_seckill';
|
|
|
- import b_combination from './components/b_combination';
|
|
|
- import c_bargain from './components/c_bargain';
|
|
|
- import goodList from '@/components/goodList';
|
|
|
- import { goShopDetail } from '@/libs/order.js'
|
|
|
- import { mapGetters } from "vuex";
|
|
|
- import countDown from '@/components/countDown';
|
|
|
- import recommend from '@/components/recommend';
|
|
|
- import { silenceBindingSpread } from '@/utils';
|
|
|
- import Loading from '@/components/Loading/index.vue';
|
|
|
- import * as ProductSpuApi from '@/api/product/spu.js';
|
|
|
- import * as PromotionActivityApi from '@/api/promotion/activity.js';
|
|
|
- import * as CouponApi from '@/api/promotion/coupon.js';
|
|
|
- import * as DecorateApi from '@/api/promotion/decorate.js';
|
|
|
- import * as ProductUtil from '@/utils/product.js';
|
|
|
- import * as Util from '@/utils/util.js';
|
|
|
|
|
|
+<script>
|
|
|
+ // import AMapLoader from "@amap/amap-jsapi-loader";
|
|
|
+ import {
|
|
|
+ toLogin
|
|
|
+ } from '@/libs/login.js';
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from "vuex";
|
|
|
+ import * as hrApi from '@/api/sleep/index.js';
|
|
|
+ // import * as infoApi from '@/api/info/index.js';
|
|
|
+ // import dayjs from "@/plugin/dayjs/dayjs.min.js";
|
|
|
+ const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
|
|
|
+ const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
|
|
+ // 获取导航栏高度
|
|
|
+ const barHeight = menuButtonInfo.height + (menuButtonInfo.top - statusBarHeight) * 2
|
|
|
export default {
|
|
|
- computed: mapGetters(['isLogin', 'uid']),
|
|
|
- components: {
|
|
|
- goodList,
|
|
|
- countDown,
|
|
|
- a_seckill,
|
|
|
- b_combination,
|
|
|
- c_bargain,
|
|
|
- recommend,
|
|
|
- Loading
|
|
|
- },
|
|
|
+ computed: mapGetters(['deviceCode', 'isLogin']),
|
|
|
data() {
|
|
|
return {
|
|
|
statusBarHeight: statusBarHeight,
|
|
|
- navIndex: 0,
|
|
|
- navTop: [],
|
|
|
- marTop: 0,
|
|
|
- configApi: {}, // 分享类容配置
|
|
|
- tabsScrollLeft: 0, // tabs 当前偏移量
|
|
|
- scrollLeft: 0,
|
|
|
-
|
|
|
- slideShows: [], // 轮播图
|
|
|
- circular: true,
|
|
|
- interval: 3000,
|
|
|
- duration: 500,
|
|
|
- menus: [], // 菜单
|
|
|
- scrollingNews: [], // 新闻简报
|
|
|
- indicatorDots: false,
|
|
|
- autoplay: true,
|
|
|
- couponList: [], // 优惠劵列表
|
|
|
- productRecommends: [], // 商品推荐
|
|
|
-
|
|
|
- site_name: '首页', // 首页 title
|
|
|
- logoUrl: "",
|
|
|
-
|
|
|
- // ========== 精品推荐 ===========
|
|
|
- goodScroll: true, // 精品推荐开关
|
|
|
- listActive: 0, // 当前选中项
|
|
|
- goodType: 1, //精品推荐 Type
|
|
|
- params: { //精品推荐分页
|
|
|
- page: 1,
|
|
|
- limit: 10,
|
|
|
- },
|
|
|
- loading: false,
|
|
|
- tempArr: [], // 精品推荐临时数组
|
|
|
- iSshowH: false,
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- listActive(newVal) { // 监听当前选中项
|
|
|
- this.setTabList()
|
|
|
+ barHeight: barHeight,
|
|
|
+ showPage: false,
|
|
|
+ aaa: [117.662369, 39.032391],
|
|
|
+ showInfo: true,
|
|
|
+ map: null,
|
|
|
+ windowHeight: 0,
|
|
|
+ mapHeight: 0,
|
|
|
+ timer: null,
|
|
|
+ showDayPicker: false, //日
|
|
|
+ dateTime: '',
|
|
|
+ navigationBarTitle: '定位',
|
|
|
+ currentDay: new Date().getTime(),
|
|
|
+ showLoading: false,
|
|
|
+
|
|
|
+ isDisabled: false,
|
|
|
+ isStart: false,
|
|
|
+ playIndex: 1,
|
|
|
+ showBtn: false, //展示右边日历按钮
|
|
|
+ scale: 13,
|
|
|
+ id: 0, // 使用 marker点击事件 需要填写id
|
|
|
+ title: 'map',
|
|
|
+ latitude: 39.0313466,
|
|
|
+ longitude: 117.6637305,
|
|
|
+ // latitude: '',
|
|
|
+ // longitude: '',
|
|
|
+ // deviceCode: '',
|
|
|
+ onlineForce: false,
|
|
|
+ onlineStatus: false,
|
|
|
+ gpsUpdateTime: '',
|
|
|
+ addressDesc: '',
|
|
|
+ // 标记点
|
|
|
+ // covers: [{
|
|
|
+ // id: 1,
|
|
|
+ // width: 42,
|
|
|
+ // height: 47,
|
|
|
+ // // rotate: 270,
|
|
|
+ // // latitude: '',
|
|
|
+ // // longitude: '',
|
|
|
+ // latitude: 39.0313466,
|
|
|
+ // longitude: 117.6637305,
|
|
|
+ // iconPath: "https://app.tjzhxx.cn:11443/image/enterprise_icon.png",
|
|
|
+ // // callout: {
|
|
|
+ // // content: "陕A·88888", // 车牌信息
|
|
|
+ // // display: "ALWAYS",
|
|
|
+ // // fontWeight: "bold",
|
|
|
+ // // color: "#5A7BEE", //文本颜色
|
|
|
+ // // fontSize: "12px",
|
|
|
+ // // bgColor: "#ffffff", //背景色
|
|
|
+ // // padding: 5, //文本边缘留白
|
|
|
+ // // textAlign: "center",
|
|
|
+ // // },
|
|
|
+ // // anchor: {
|
|
|
+ // // x: 0.5,
|
|
|
+ // // y: 0.5,
|
|
|
+ // // }
|
|
|
+ // },
|
|
|
+ // // 找到当前数据得id,在这个数据得前面造出一个没有id得json,用作北京图片,前提是经纬度一样
|
|
|
+ // {
|
|
|
+ // id: 2,
|
|
|
+ // width: 47,
|
|
|
+ // height: 49,
|
|
|
+ // latitude: 39.037,
|
|
|
+ // longitude: 117.660,
|
|
|
+ // iconPath: "https://app.tjzhxx.cn:11443/image/gender_man.png",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // // id: 3,
|
|
|
+ // width: 40,
|
|
|
+ // height: 45,
|
|
|
+ // latitude: 39.037,
|
|
|
+ // longitude: 117.660,
|
|
|
+ // iconPath: "https://app.tjzhxx.cn:11443/image/enterprise_icon.png",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // id: 3,
|
|
|
+ // width: 42,
|
|
|
+ // height: 47,
|
|
|
+ // latitude: 39.052,
|
|
|
+ // longitude: 117.657,
|
|
|
+ // iconPath: "https://app.tjzhxx.cn:11443/image/enterprise_icon.png",
|
|
|
+ // },
|
|
|
+
|
|
|
+ // ],
|
|
|
+ covers:[],
|
|
|
+
|
|
|
+ // 线
|
|
|
+ polyline: [],
|
|
|
+
|
|
|
+ // 坐标数据
|
|
|
+ coordinates: [{
|
|
|
+ id: 1,
|
|
|
+ latitude: 23.098994,
|
|
|
+ longitude: 113.322520,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ latitude: 23.097994,
|
|
|
+ longitude: 113.323520,
|
|
|
+ // iconPath: '/image/location.png',
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ ],
|
|
|
+ coordinate: [], //坐标数据
|
|
|
+
|
|
|
+ posi: { // 汽车定位点的数据,后面只用改latitude、longitude即可
|
|
|
+ id: 1,
|
|
|
+ width: 32,
|
|
|
+ height: 32,
|
|
|
+ latitude: 0,
|
|
|
+ longitude: 0,
|
|
|
+ iconPath: "/static/image/positonimg.png",
|
|
|
+ callout: {
|
|
|
+ content: "陕A·85Q1Q", // 车牌信息
|
|
|
+ display: "BYCLICK",
|
|
|
+ fontWeight: "bold",
|
|
|
+ color: "#5A7BEE", //文本颜色
|
|
|
+ fontSize: "12px",
|
|
|
+ bgColor: "#ffffff", //背景色
|
|
|
+ padding: 5, //文本边缘留白
|
|
|
+ textAlign: "center",
|
|
|
+ },
|
|
|
+ anchor: {
|
|
|
+ x: 0.5,
|
|
|
+ y: 0.5,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ h5url:''
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.setTabList()
|
|
|
+ beforeCreate() {
|
|
|
+ console.log('我只行啊')
|
|
|
+ uni.setStorageSync('useSleep', true);
|
|
|
},
|
|
|
- onLoad() {
|
|
|
- // wx.login({
|
|
|
- // success (res) {
|
|
|
- // if (res.code) {
|
|
|
- // console.log(res.code, '======== code 编号 =======')
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
-
|
|
|
- var that = this;
|
|
|
- // 获取系统信息
|
|
|
+ onReady() {
|
|
|
+ // 创建map对象
|
|
|
+ this.map = uni.createMapContext('map');
|
|
|
+ // 获取屏幕高度
|
|
|
uni.getSystemInfo({
|
|
|
- success(res) {
|
|
|
- that.$store.commit("SYSTEM_PLATFORM", res.platform);
|
|
|
- }
|
|
|
- });
|
|
|
- uni.getLocation({
|
|
|
- type: 'gcj02',
|
|
|
- altitude: true,
|
|
|
- geocode: true,
|
|
|
- success: function(res) {
|
|
|
- try {
|
|
|
- uni.setStorageSync('user_latitude', res.latitude);
|
|
|
- uni.setStorageSync('user_longitude', res.longitude);
|
|
|
- } catch {}
|
|
|
+ success: res => {
|
|
|
+ this.windowHeight = res.windowHeight;
|
|
|
}
|
|
|
});
|
|
|
- this.isLogin && silenceBindingSpread();
|
|
|
- this.getIndexConfig();
|
|
|
},
|
|
|
onShow() {
|
|
|
- uni.setNavigationBarTitle({
|
|
|
- title: this.site_name
|
|
|
+ // this.initAmap();
|
|
|
+ this.getLocationInfo()
|
|
|
+ // this.getHrdata()
|
|
|
+ console.log(this.deviceCode,'deviceCodedeviceCode')
|
|
|
+ if(this.deviceCode){
|
|
|
+ this.geth5Url()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onPageUnload: function() {
|
|
|
+
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 0
|
|
|
})
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ let that =this
|
|
|
+
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'wgs84',
|
|
|
+ success: function (res) {
|
|
|
+ console.log(res,'我是定位接口得返回数据')
|
|
|
+ console.log('当前位置的经度:' + res.longitude);
|
|
|
+ console.log('当前位置的纬度:' + res.latitude);
|
|
|
+ },
|
|
|
+ fail: function (error) {
|
|
|
+ console.log('获取位置信息失败:', error.errMsg);
|
|
|
+ // 或者将错误信息显示在页面上
|
|
|
+ // this.errorMessage = '获取位置信息失败: ' + error.errMsg;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ onHide: function() {
|
|
|
+ uni.setStorageSync('useSleep', false);
|
|
|
+ },
|
|
|
+
|
|
|
+ mounted() {
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
- // scroll-view滑动事件
|
|
|
- scroll(e) {
|
|
|
- this.scrollLeft = e.detail.scrollLeft;
|
|
|
+ geth5Url(){
|
|
|
+ hrApi.geth5url({sn:this.deviceCode}).then(res=>{
|
|
|
+ console.log(res,777)
|
|
|
+ this.h5url=res.data.httpsURL
|
|
|
+ // this.$set("this.h5url",res.data.httpsURL)
|
|
|
+ })
|
|
|
},
|
|
|
- setTabList() {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.scrollIntoView()
|
|
|
+ getHrdata(){
|
|
|
+ hrApi.getHrInfo({sn:"B1E507CD076164C7",date:"2024-06-30"}).then(res=>{
|
|
|
+ console.log('我是首页得心率数据',res)
|
|
|
})
|
|
|
},
|
|
|
- // 计算tabs位置
|
|
|
- scrollIntoView() { // item滚动
|
|
|
- let lineLeft = 0;
|
|
|
- this.getElementData('#tab_list', (data) => {
|
|
|
- let list = data[0]
|
|
|
- this.getElementData(`#tab_item`, (data) => {
|
|
|
- let el = data[this.listActive]
|
|
|
- if (el) {
|
|
|
- lineLeft = el.width / 2 + (-list.left) + el.left - list.width / 2 - this.scrollLeft
|
|
|
- this.tabsScrollLeft = this.scrollLeft + lineLeft
|
|
|
- }
|
|
|
- })
|
|
|
+ toHeartRate() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/index/condition/heart_rate/index'
|
|
|
})
|
|
|
},
|
|
|
- getElementData(el, callback) {
|
|
|
- uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
|
|
|
- callback(data[0]);
|
|
|
- });
|
|
|
+ goEquList() {
|
|
|
+ if (!this.isLogin) {
|
|
|
+ toLogin();
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log('点击了')
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/equ_list/index',
|
|
|
+ })
|
|
|
},
|
|
|
- // 首页数据
|
|
|
- getIndexConfig: function() {
|
|
|
- let that = this;
|
|
|
- DecorateApi.getDecorateComponentListByPage(1).then(res => {
|
|
|
- // TODO 芋艿:暂时写死
|
|
|
- uni.setNavigationBarTitle({
|
|
|
- title: '首页'
|
|
|
+ beforeleave() {
|
|
|
+ console.log('出发了');
|
|
|
+ this.showPage = false
|
|
|
+ //判断是上一个页面进入(返回),还是直接进入这个页面(回首页)
|
|
|
+ let pages = getCurrentPages()
|
|
|
+ console.log(pages.length, 5555);
|
|
|
+
|
|
|
+ pages.length = 2
|
|
|
+ console.log(pages.length, 6666);
|
|
|
+ console.log(this.showBtn, '轨迹');
|
|
|
+ console.log(!this.showBtn, '定位');
|
|
|
+ if (pages.length == 2 && this.showBtn) {
|
|
|
+ this.showPage = true
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/index/map/index'
|
|
|
})
|
|
|
- this.$set(this, "logoUrl", 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png');
|
|
|
- this.$set(this, "site_name", '首页');
|
|
|
- // #ifdef H5
|
|
|
- this.$store.commit("SET_CHATURL", 'https://cschat.antcloud.com.cn/index.htm?tntInstId=jm7_c46J&scene=SCE01197657');
|
|
|
- Cache.set('chatUrl', 'https://cschat.antcloud.com.cn/index.htm?tntInstId=jm7_c46J&scene=SCE01197657');
|
|
|
- // #endif
|
|
|
-
|
|
|
- // 轮播图
|
|
|
- const slideShow = res.data.find(item => item.code === 'slide-show');
|
|
|
- if (slideShow) {
|
|
|
- this.$set(this, "slideShows", JSON.parse(slideShow.value));
|
|
|
- }
|
|
|
- // 菜单
|
|
|
- const menu = res.data.find(item => item.code === 'menu');
|
|
|
- if (menu) {
|
|
|
- this.$set(this, "menus", JSON.parse(menu.value));
|
|
|
- }
|
|
|
- // 滚动新闻
|
|
|
- const scrollingNews = res.data.find(item => item.code === 'scrolling-news');
|
|
|
- if (scrollingNews) {
|
|
|
- this.$set(this, "scrollingNews", JSON.parse(scrollingNews.value));
|
|
|
- }
|
|
|
- // 商品推荐
|
|
|
- const productRecommend = res.data.find(item => item.code === 'product-recommend');
|
|
|
- if (productRecommend) {
|
|
|
- this.$set(this, "productRecommends", JSON.parse(productRecommend.value));
|
|
|
- if (this.productRecommends.length > 0) {
|
|
|
- this.goodType = this.productRecommends[0].type
|
|
|
- this.getGroomList();
|
|
|
- }
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ this.showPage = true
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/index/index'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onConfirm(e) {
|
|
|
+ this.dateTime = this.formatDate(e.detail)
|
|
|
+ this.showDayPicker = false
|
|
|
+ this.initAmap(3)
|
|
|
+ },
|
|
|
+ getLocationInfo() {
|
|
|
+ this.showLoading = true
|
|
|
+
|
|
|
+ return
|
|
|
+ infoApi.getLocationInfo({
|
|
|
+ deviceId: this.deviceId
|
|
|
+ }).then(res => {
|
|
|
+ this.showLoading = false
|
|
|
+ this.latitude = res.data.lat
|
|
|
+ this.longitude = res.data.lng
|
|
|
+ this.covers[0].latitude = res.data.lat
|
|
|
+ this.covers[0].longitude = res.data.lng
|
|
|
+ this.deviceCode = res.data.deviceCode
|
|
|
+ this.onlineForce = res.data.onlineForce
|
|
|
+ this.onlineStatus = res.data.onlineStatus
|
|
|
+ this.gpsUpdateTime = this.formaTime(res.data.gpsUpdateTime)
|
|
|
+ this.addressDesc = res.data.addressDesc
|
|
|
})
|
|
|
- // 获得分享配置
|
|
|
- this.shareApi();
|
|
|
- // 获得优惠劵列表
|
|
|
- this.getcouponList();
|
|
|
},
|
|
|
-
|
|
|
- shareApi: function() {
|
|
|
- // TODO 芋艿:写死
|
|
|
- const configApi = {
|
|
|
- "title": "芋道商城",
|
|
|
- "synopsis": "芋道商城,好用!",
|
|
|
- "img": "https://static.iocoder.cn/ruoyi-vue-pro-logo.png"
|
|
|
- }
|
|
|
- this.$set(this, 'configApi', configApi);
|
|
|
- // #ifdef H5
|
|
|
- this.setOpenShare(configApi);
|
|
|
- // #endif
|
|
|
+ formaTime: function(date) {
|
|
|
+ return dayjs(date).format("YYYY-MM-DD HH:mm:ss");
|
|
|
},
|
|
|
- // 微信分享;
|
|
|
- setOpenShare: function(data) {
|
|
|
- let that = this;
|
|
|
- if (that.$wechat.isWeixin()) {
|
|
|
- let configAppMessage = {
|
|
|
- desc: data.synopsis,
|
|
|
- title: data.title,
|
|
|
- link: location.href,
|
|
|
- imgUrl: data.img
|
|
|
- };
|
|
|
- that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
|
|
|
- }
|
|
|
+ formatDate: function(date) {
|
|
|
+ return dayjs(date).format("YYYY-MM-DD");
|
|
|
},
|
|
|
-
|
|
|
- // ========== 优惠劵 ===========
|
|
|
- /**
|
|
|
- * 获得优惠劵列表
|
|
|
- */
|
|
|
- getcouponList() {
|
|
|
- CouponApi.getCouponTemplateList({ count: 2 }).then(res => {
|
|
|
- this.$set(this, 'couponList', res.data);
|
|
|
- }).catch(err => {
|
|
|
- return this.$util.Tips({
|
|
|
- title: err
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- /**
|
|
|
- * 领取优惠劵
|
|
|
- */
|
|
|
- getCoupon: function(id, index) {
|
|
|
- CouponApi.takeCoupon(id).then(res => {
|
|
|
- // 设置已领取,即不能再领取
|
|
|
- this.$set(this.couponList[index], 'canTake', res.data !== true);
|
|
|
- this.$util.Tips({
|
|
|
- title: '领取成功'
|
|
|
- });
|
|
|
- }).catch(err => {
|
|
|
- return this.$util.Tips({
|
|
|
- title: err
|
|
|
- });
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- // ========== 精品推荐 ===========
|
|
|
- /**
|
|
|
- * 首发新品切换
|
|
|
- */
|
|
|
- ProductNavTab(item, index) {
|
|
|
- this.listActive = index
|
|
|
- this.goodType = item.type
|
|
|
- this.listActive = index
|
|
|
- this.tempArr = []
|
|
|
- this.params.page = 1
|
|
|
- this.goodScroll = true
|
|
|
- this.getGroomList(true)
|
|
|
- },
|
|
|
- /**
|
|
|
- * 商品精品推荐
|
|
|
- */
|
|
|
- getGroomList(onloadH) {
|
|
|
- if (!this.goodScroll) {
|
|
|
- return
|
|
|
- }
|
|
|
- if (onloadH) {
|
|
|
- this.iSshowH = true
|
|
|
- }
|
|
|
- this.loading = true
|
|
|
- ProductSpuApi.getSpuPage({
|
|
|
- recommendType: this.goodType,
|
|
|
- pageNo: this.params.page,
|
|
|
- pageSize: this.params.limit
|
|
|
- }).then(res => {
|
|
|
- const good_list = res.data.list;
|
|
|
- this.iSshowH = false
|
|
|
- this.loading = false
|
|
|
- this.goodScroll = good_list.length >= this.params.limit
|
|
|
- this.params.page++
|
|
|
-
|
|
|
- // 设置营销活动
|
|
|
- const spuIds = good_list.map(item => item.id);
|
|
|
- if (spuIds.length > 0) {
|
|
|
- PromotionActivityApi.getActivityListBySpuIds(spuIds).then(res => {
|
|
|
- ProductUtil.setActivityList(good_list, res.data);
|
|
|
- this.tempArr = this.tempArr.concat(good_list); // 放在此处,避免 Vue 监控不到数组里的元素变化
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
+ goFenceList() {
|
|
|
+ let center = `${this.longitude},${this.latitude}`
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/index/map/fencelist?center=${center}`,
|
|
|
+ });
|
|
|
},
|
|
|
- /**
|
|
|
- * 前往商品详情
|
|
|
- */
|
|
|
- goDetail(item) {
|
|
|
- goShopDetail(item, this.uid).then(res => {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/goods_details/index?id=${item.id}`
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- fen2yuan(price) {
|
|
|
- return Util.fen2yuan(price)
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * 用户点击右上角分享
|
|
|
- */
|
|
|
- // #ifdef MP
|
|
|
- onShareAppMessage: function() {
|
|
|
- return {
|
|
|
- title: this.configApi.title,
|
|
|
- imageUrl: this.configApi.img,
|
|
|
- desc: this.configApi.synopsis,
|
|
|
- path: '/pages/index/index'
|
|
|
- };
|
|
|
- },
|
|
|
- // #endif
|
|
|
- onReachBottom() {
|
|
|
- if (this.navIndex === 0) {
|
|
|
- // 首页加载更多
|
|
|
- if (this.params.page !== 1) {
|
|
|
- this.getGroomList();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-</script>
|
|
|
-<style>
|
|
|
- page {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- height: 100%;
|
|
|
- /* #ifdef H5 */
|
|
|
- background-color: #fff;
|
|
|
- /* #endif */
|
|
|
+ goBindPage() {
|
|
|
|
|
|
- }
|
|
|
-</style>
|
|
|
-<style lang="scss">
|
|
|
- .notice{
|
|
|
- width: 100%;
|
|
|
- height: 70rpx;
|
|
|
- border-radius: 10rpx;
|
|
|
- background-color: #fff;
|
|
|
- margin-bottom: 25rpx;
|
|
|
- line-height: 70rpx;
|
|
|
- padding: 0 14rpx;
|
|
|
- .line {
|
|
|
- color: #CCCCCC;
|
|
|
- }
|
|
|
- .pic{
|
|
|
- width: 130rpx;
|
|
|
- height: 36rpx;
|
|
|
- image{
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- display: block !important;
|
|
|
- }
|
|
|
- }
|
|
|
- .swipers {
|
|
|
- height: 100%;
|
|
|
- width: 444rpx;
|
|
|
- overflow: hidden;
|
|
|
- swiper {
|
|
|
- height: 100%;
|
|
|
- width: 100%;
|
|
|
- overflow: hidden;
|
|
|
- font-size: 22rpx;
|
|
|
- color: #333333;
|
|
|
- }
|
|
|
- }
|
|
|
- .iconfont {
|
|
|
- color: #999999;
|
|
|
- font-size: 20rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- .couponIndex {
|
|
|
- width: auto;
|
|
|
- height: 238rpx;
|
|
|
- background-image: url('~@/static/images/yhjsy.png');
|
|
|
- background-size: 100% 100%;
|
|
|
- padding-left: 42rpx;
|
|
|
- margin-bottom: 30rpx;
|
|
|
-
|
|
|
- .titBox {
|
|
|
- padding: 47rpx 0;
|
|
|
- text-align: center;
|
|
|
- height: 100%;
|
|
|
-
|
|
|
- .tit1 {
|
|
|
- color: #FFEBD2;
|
|
|
- font-size: 34rpx;
|
|
|
- font-weight: 600;
|
|
|
- }
|
|
|
-
|
|
|
- .tit2 {
|
|
|
- color: #FFEBD2;
|
|
|
- font-size: 22rpx;
|
|
|
- margin:10rpx 0 26rpx 0;
|
|
|
- }
|
|
|
-
|
|
|
- .tit3 {
|
|
|
- color: #FFDAAF;
|
|
|
- font-size: 24rpx;
|
|
|
- .iconfont {
|
|
|
- font-size: 20rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .listBox {
|
|
|
- padding: 14rpx 0;
|
|
|
-
|
|
|
- .listActive {
|
|
|
- background-image: url('~@/static/images/lingyhj.png');
|
|
|
- background-size: 100% 100%;
|
|
|
- }
|
|
|
-
|
|
|
- .listHui {
|
|
|
- background-image: url('~@/static/images/weiling.png');
|
|
|
- background-size: 100% 100%;
|
|
|
- }
|
|
|
-
|
|
|
- .list {
|
|
|
- width: 170rpx;
|
|
|
- height: 210rpx;
|
|
|
- padding: 16rpx 0;
|
|
|
- text-align: center;
|
|
|
- margin-left: 24rpx;
|
|
|
-
|
|
|
- .tit {
|
|
|
- font-size: 18rpx;
|
|
|
- padding: 0 26rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .titActive {
|
|
|
- color: #C99959;
|
|
|
- }
|
|
|
+ },
|
|
|
+ formatDate: function(date) {
|
|
|
+ return dayjs(date).format("YYYY-MM-DD");
|
|
|
+ },
|
|
|
|
|
|
- .price {
|
|
|
- font-size: 46rpx;
|
|
|
- font-weight: 900;
|
|
|
- margin-top: 4rpx;
|
|
|
+ initAmap(type) {
|
|
|
+ let _this = this;
|
|
|
+ // _this.addMarkers()
|
|
|
+ if (type === 2) {
|
|
|
+ this.showLoading = true
|
|
|
+ infoApi.refreshLocation({
|
|
|
+ deviceId: this.deviceId
|
|
|
+ }).then(res => {
|
|
|
+ this.showLoading = false
|
|
|
+ this.latitude = res.data.lat
|
|
|
+ this.longitude = res.data.lng
|
|
|
+ this.covers[0].latitude = res.data.lat
|
|
|
+ this.covers[0].longitude = res.data.lng
|
|
|
+ this.gpsUpdateTime = this.formaTime(res.data.gpsUpdateTime)
|
|
|
+ this.addressDesc = res.data.addressDesc
|
|
|
+ })
|
|
|
}
|
|
|
+ if (type === 3) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/index/map/driving'
|
|
|
+ })
|
|
|
+ // return
|
|
|
+ // this.showBtn = true
|
|
|
+ // this.scale = 18
|
|
|
+ // wx.setNavigationBarTitle({
|
|
|
+ // title: "轨迹"
|
|
|
+ // })
|
|
|
+ // // this.onLoad()//重新调方法 改标题,有问题
|
|
|
+ // this.dateTime = this.dateTime ? this.dateTime : this.formatDate(new Date())
|
|
|
+ // let params = {
|
|
|
+ // deviceId: this.deviceId,
|
|
|
+ // dateTime: this.dateTime,
|
|
|
+ // // deviceId:this.deviceId,
|
|
|
+ // // dateTime:this.formatDate(new Date())
|
|
|
+ // }
|
|
|
+ // infoApi.getLocationLocus(params).then(res => {
|
|
|
+ // if (res.code === 0 && res.data.length) {
|
|
|
+ // this.coordinate = res.data.map(item => {
|
|
|
+ // console.log('11111');
|
|
|
+ // return {
|
|
|
+ // latitude: item.lat,
|
|
|
+ // longitude: item.lng,
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // _this.polyline = [{
|
|
|
+ // points: this.coordinate,
|
|
|
+ // color: '#F35546',
|
|
|
+ // width: 4,
|
|
|
+ // dottedLine: false,
|
|
|
+ // }];
|
|
|
+ // // TODO 找相关api,将轨迹缩放到合适比例,将起点终点放上图标
|
|
|
+ // _this.map.translateMarker({
|
|
|
+ // markerId: 1,
|
|
|
+ // fail(e) {
|
|
|
+ // // 轨迹回放失败
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // _this.polyline = [{
|
|
|
+ // points: [],
|
|
|
+ // color: '#F35546',
|
|
|
+ // width: 4,
|
|
|
+ // dottedLine: false,
|
|
|
+ // }];
|
|
|
+ // this.$util.Tips({
|
|
|
+ // title: `${this.dateTime}暂无轨迹数据`,
|
|
|
+ // }, () => {
|
|
|
+
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+
|
|
|
+ // })
|
|
|
|
|
|
- .pricehui {
|
|
|
- color: #B2B2B2;
|
|
|
- }
|
|
|
- .fonthui{
|
|
|
- background-color: #F5F5F5 !important;
|
|
|
- }
|
|
|
- .yuan {
|
|
|
- font-size: 24rpx;
|
|
|
}
|
|
|
|
|
|
- .ling {
|
|
|
- font-size: 24rpx;
|
|
|
- margin-top: 9.5rpx;
|
|
|
- width: 102rpx;
|
|
|
- height: 36rpx;
|
|
|
- line-height: 36rpx;
|
|
|
- background-color: #FFE5C7;
|
|
|
- border-radius: 28rpx;
|
|
|
- margin: auto;
|
|
|
- }
|
|
|
+ },
|
|
|
+ // start() {
|
|
|
+ // this.isStart = true;
|
|
|
+ // this.isDisabled = true;
|
|
|
+ // let data = this.coordinate;
|
|
|
+ // let len = data.length;
|
|
|
+ // let datai = data[this.playIndex];
|
|
|
+ // let _this = this;
|
|
|
+
|
|
|
+ // _this.map.translateMarker({
|
|
|
+ // markerId: 1,
|
|
|
+ // autoRotate: true,
|
|
|
+ // destination: {
|
|
|
+ // longitude: datai.longitude, // 车辆即将移动到的下一个点的经度
|
|
|
+ // latitude: datai.latitude, // 车辆即将移动到的下一个点的纬度
|
|
|
+ // },
|
|
|
+ // duration: 700,
|
|
|
+ // complete: function() {
|
|
|
+ // _this.playIndex++;
|
|
|
+ // if (_this.playIndex < len) {
|
|
|
+ // _this.start(_this.playIndex, data);
|
|
|
+ // } else {
|
|
|
+ // console.log('okokok');
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '播放完成',
|
|
|
+ // duration: 1400,
|
|
|
+ // icon: 'none'
|
|
|
+ // });
|
|
|
+ // _this.playIndex = 0;
|
|
|
+ // _this.isStart = false;
|
|
|
+ // _this.isDisabled = false;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // animationEnd: function() {
|
|
|
+ // // 轨迹回放完成 处理H5端
|
|
|
+ // _this.playIndex++;
|
|
|
+ // if (_this.playIndex < len) {
|
|
|
+ // _this.start(_this.playIndex, data);
|
|
|
+ // } else {
|
|
|
+ // console.log('okokok');
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '播放完成',
|
|
|
+ // duration: 1400,
|
|
|
+ // icon: 'none'
|
|
|
+ // });
|
|
|
+ // _this.playIndex = 0;
|
|
|
+ // _this.isStart = false;
|
|
|
+ // _this.isDisabled = false;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // fail(e) {
|
|
|
+ // // 轨迹回放失败
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+
|
|
|
+ // addMarkers() {
|
|
|
+ // let _this = this;
|
|
|
+ // const positions = [{
|
|
|
+ // latitude: 23.099994,
|
|
|
+ // longitude: 113.324520,
|
|
|
+ // }, {
|
|
|
+ // latitude: 23.099994,
|
|
|
+ // longitude: 113.322520,
|
|
|
+ // }, {
|
|
|
+ // latitude: 23.099994,
|
|
|
+ // longitude: 113.326520,
|
|
|
+ // }, {
|
|
|
+ // latitude: 23.096994,
|
|
|
+ // longitude: 113.329520,
|
|
|
+ // }]
|
|
|
+
|
|
|
+ // const markers = []
|
|
|
+
|
|
|
+ // positions.forEach((p, i) => {
|
|
|
+ // console.log(i)
|
|
|
+ // markers.push(
|
|
|
+ // Object.assign({}, {
|
|
|
+ // id: i + 1,
|
|
|
+ // iconPath: "http://cdn.zhoukaiwen.com/car.png",
|
|
|
+ // width: 50,
|
|
|
+ // height: 50,
|
|
|
+ // joinCluster: true, // 指定了该参数才会参与聚合
|
|
|
+ // label: {
|
|
|
+ // width: 50,
|
|
|
+ // height: 30,
|
|
|
+ // borderWidth: 1,
|
|
|
+ // borderRadius: 10,
|
|
|
+ // bgColor: '#ffffff',
|
|
|
+ // content: `label ${i + 1}`
|
|
|
+ // }
|
|
|
+ // }, p)
|
|
|
+ // )
|
|
|
+ // })
|
|
|
+ // _this.map.addMarkers({
|
|
|
+ // markers,
|
|
|
+ // clear: false,
|
|
|
+ // complete(res) {
|
|
|
+ // console.log('addMarkers', res)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ initmap(type) {
|
|
|
+ AMapLoader.load({
|
|
|
+ // key: '2d7215a1d0f8893f2417d134af7c3798',
|
|
|
+ key: 'c968deab485d6e688e7c68689722ffb4',
|
|
|
+ version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
|
|
+ plugins: [
|
|
|
+ 'AMap.Autocomplete',
|
|
|
+ 'AMap.PlaceSearch',
|
|
|
+ 'AMap.Scale',
|
|
|
+ 'AMap.OverView',
|
|
|
+ 'AMap.ToolBar',
|
|
|
+ 'AMap.MapType',
|
|
|
+ 'AMap.PolyEditor',
|
|
|
+ 'AMap.CircleEditor',
|
|
|
+ 'MarkerClusterer',
|
|
|
+ 'AMap.Geocoder'
|
|
|
+ ]
|
|
|
|
|
|
- .priceM {
|
|
|
- color: #FFDAAF;
|
|
|
- font-size: 22rpx;
|
|
|
- margin-top: 14rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ })
|
|
|
+ .then((AMap) => {
|
|
|
+ console.log('AMap', AMap)
|
|
|
+ // 地图初始化
|
|
|
+ // Map构造函数第一个传参的map为初始化地图的容器的id,第二个传参是配置对象
|
|
|
+ var map = new AMap.Map('amap', {
|
|
|
+ zoom: 15, //显示的缩放级别
|
|
|
+ // zooms: [2, 30], //地图显示的缩放级别范围, 默认为 [2, 20] ,取值范围 [2 ~ 30]
|
|
|
+ // center: [108.954239, 34.265472], //todo 中心点坐标
|
|
|
+ mapStyle: 'amap://styles/macaron', //todo 地图样式
|
|
|
+ resizeEnable: true //是否监控地图容器尺寸变化
|
|
|
+ });
|
|
|
+ /** 定位 */
|
|
|
+ let marker = new AMap.Marker();
|
|
|
+ if (this.aaa.length) {
|
|
|
+ map.setCenter(this.aaa);
|
|
|
+ map.add(marker);
|
|
|
+ marker.setPosition(this.aaa);
|
|
|
+ }
|
|
|
|
|
|
- .sticky-box {
|
|
|
- /* #ifndef APP-PLUS-NVUE */
|
|
|
- display: flex;
|
|
|
- position: -webkit-sticky;
|
|
|
- /* #endif */
|
|
|
- position: sticky;
|
|
|
- /* #ifdef H5*/
|
|
|
- top: var(--window-top);
|
|
|
- /* #endif */
|
|
|
-
|
|
|
- z-index: 99;
|
|
|
- flex-direction: row;
|
|
|
- margin: 0px;
|
|
|
- background: #f5f5f5;
|
|
|
- padding: 30rpx 0;
|
|
|
- }
|
|
|
+ /** 轨迹 */
|
|
|
+ if (type === 3) {
|
|
|
+ this.showInfo = false
|
|
|
+ console.log('进来');
|
|
|
+ map.clearMap();
|
|
|
+ marker?.hide()
|
|
|
+ const historyList = [{
|
|
|
+ "lat": 39.91055750509886,
|
|
|
+ "lng": 116.4036806180665,
|
|
|
+ "gpsTime": "2023-10-08 13:47:14",
|
|
|
+ "gpsId": 867605051108718,
|
|
|
+ "compensate": null
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "lat": 39.910380195191074,
|
|
|
+ "lng": 116.74977990361894,
|
|
|
+ "gpsTime": "2023-10-08 14:08:14",
|
|
|
+ "gpsId": 867605051108718,
|
|
|
+ "compensate": null
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "lat": 39.91055750509886,
|
|
|
+ "lng": 116.4036806180665,
|
|
|
+ "gpsTime": "2023-10-08 14:26:00",
|
|
|
+ "gpsId": 867605051108718,
|
|
|
+ "compensate": null
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "lat": 39.91055750509886,
|
|
|
+ "lng": 116.4036806180665,
|
|
|
+ "gpsTime": "2023-10-08 14:27:00",
|
|
|
+ "gpsId": 867605051108718,
|
|
|
+ "compensate": null
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "lat": 39.91055750509886,
|
|
|
+ "lng": 116.4036806180665,
|
|
|
+ "gpsTime": "2023-10-08 14:30:00",
|
|
|
+ "gpsId": 867605051108718,
|
|
|
+ "compensate": null
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "lat": 39.910557505765034,
|
|
|
+ "lng": 116.40368361866521,
|
|
|
+ "gpsTime": "2023-10-08 14:31:00",
|
|
|
+ "gpsId": 867605051108718,
|
|
|
+ "compensate": null
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "lat": 39.032391,
|
|
|
+ "lng": 117.662369,
|
|
|
+ "gpsTime": "2023-10-08 19:10:00",
|
|
|
+ "gpsId": 867605051108718,
|
|
|
+ "compensate": null
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ AMap.plugin('AMap.Driving', function() {
|
|
|
+ if (historyList.length >= 2) {
|
|
|
+ var drivingOption = {
|
|
|
+ policy: AMap.DrivingPolicy
|
|
|
+ .LEAST_TIME, // 其它policy参数请参考 https://lbs.amap.com/api/javascript-api/reference/route-search#m_DrivingPolicy
|
|
|
+ ferry: 1, // 是否可以使用轮渡
|
|
|
+ province: '京', // 车牌省份的汉字缩写
|
|
|
+ }
|
|
|
+ // 构造路线导航类
|
|
|
+ var driving = new AMap.Driving(drivingOption)
|
|
|
+
|
|
|
+ // 根据起终点经纬度规划驾车导航路线
|
|
|
+ driving.search(new AMap.LngLat(historyList[0].lng, historyList[0]
|
|
|
+ .lat),
|
|
|
+ new AMap.LngLat(historyList[historyList.length - 1].lng,
|
|
|
+ historyList[historyList.length - 1].lat),
|
|
|
+ function(status, result) {
|
|
|
+ if (status === 'complete') {
|
|
|
+ if (result.routes && result.routes.length) {
|
|
|
+ console.log(result.routes, 'result.routes');
|
|
|
+ // 绘制第一条路线,也可以按需求绘制其它几条路线
|
|
|
+ drawRoute(result.routes[0])
|
|
|
+ console.log('绘制驾车路线完成')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('获取驾车数据失败:' + result)
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ function drawRoute(route) {
|
|
|
+ var path = parseRouteToPath(route)
|
|
|
+
|
|
|
+ var startMarker = new AMap.Marker({
|
|
|
+ position: path[0],
|
|
|
+ icon: 'https://webapi.amap.com/theme/v1.3/markers/n/start.png',
|
|
|
+ map: map
|
|
|
+ })
|
|
|
+
|
|
|
+ var endMarker = new AMap.Marker({
|
|
|
+ position: path[path.length - 1],
|
|
|
+ icon: 'https://webapi.amap.com/theme/v1.3/markers/n/end.png',
|
|
|
+ map: map
|
|
|
+ })
|
|
|
+
|
|
|
+ var routeLine = new AMap.Polyline({
|
|
|
+ path: path,
|
|
|
+ isOutline: true,
|
|
|
+ outlineColor: '#ffeeee',
|
|
|
+ borderWeight: 2,
|
|
|
+ strokeWeight: 5,
|
|
|
+ strokeOpacity: 0.9,
|
|
|
+ strokeColor: '#F35546',
|
|
|
+ lineJoin: 'round'
|
|
|
+ })
|
|
|
+
|
|
|
+ map.add(routeLine);
|
|
|
+
|
|
|
+ // 调整视野达到最佳显示区域
|
|
|
+ map.setFitView([startMarker, endMarker, routeLine])
|
|
|
+ }
|
|
|
+
|
|
|
+ // 解析DrivingRoute对象,构造成AMap.Polyline的path参数需要的格式
|
|
|
+ // DrivingResult对象结构参考文档 https://lbs.amap.com/api/javascript-api/reference/route-search#m_DriveRoute
|
|
|
+ function parseRouteToPath(route) {
|
|
|
+ var path = []
|
|
|
+
|
|
|
+ for (var i = 0, l = route.steps.length; i < l; i++) {
|
|
|
+ var step = route.steps[i]
|
|
|
+
|
|
|
+ for (var j = 0, n = step.path.length; j < n; j++) {
|
|
|
+ path.push(step.path[j])
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return path
|
|
|
+ }
|
|
|
|
|
|
- .listAll {
|
|
|
- width: 20%;
|
|
|
- text-indent: 62rpx;
|
|
|
- font-size: 30rpx;
|
|
|
- border-left: 1px #eee solid;
|
|
|
- margin: 1% 0;
|
|
|
- padding: 5rpx;
|
|
|
- position: relative;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- image {
|
|
|
- position: absolute;
|
|
|
- left: 20rpx;
|
|
|
- top: 8rpx;
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ console.error(e) //加载错误提示
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
+</script>
|
|
|
|
|
|
- .tab {
|
|
|
+<style lang="scss">
|
|
|
+ .map-box {
|
|
|
+ z-index: 888;
|
|
|
+ width: 100%;
|
|
|
+ height: 100vh;
|
|
|
position: relative;
|
|
|
- display: flex;
|
|
|
- font-size: 28rpx;
|
|
|
- white-space: nowrap;
|
|
|
-
|
|
|
- &__item {
|
|
|
- flex: 1;
|
|
|
- padding: 0 20rpx;
|
|
|
- text-align: center;
|
|
|
- height: 60rpx;
|
|
|
- line-height: 60rpx;
|
|
|
- color: #666;
|
|
|
|
|
|
- &.active {
|
|
|
- color: #09C2C9;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .tab__line {
|
|
|
- display: block;
|
|
|
- height: 6rpx;
|
|
|
- position: absolute;
|
|
|
- bottom: 0;
|
|
|
- left: 0;
|
|
|
- z-index: 1;
|
|
|
- border-radius: 3rpx;
|
|
|
- position: relative;
|
|
|
- background: #2FC6CD;
|
|
|
- }
|
|
|
+ .mp-header {
|
|
|
+ z-index: 999;
|
|
|
+ position: fixed;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 100%;
|
|
|
+ /* #ifdef H5 */
|
|
|
+ padding-bottom: 20rpx;
|
|
|
|
|
|
- .scroll-view_H {
|
|
|
- /* 文本不会换行,文本会在在同一行上继续,直到遇到 <br> 标签为止。 */
|
|
|
- white-space: nowrap;
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
+ /* #endif */
|
|
|
+ // background-color: $theme-color;
|
|
|
+ .serch-box {
|
|
|
+ height: 100%;
|
|
|
+ width: 210rpx;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 35rpx;
|
|
|
+ // margin: 33rpx 0 0 30rpx;
|
|
|
+ margin: 0 0 0 30rpx;
|
|
|
+
|
|
|
+ .serch-wrapper {
|
|
|
+ height: 100%;
|
|
|
+ align-items: center;
|
|
|
+ padding: 19rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
|
+ image {
|
|
|
+ width: 118rpx;
|
|
|
+ height: 42rpx;
|
|
|
+ }
|
|
|
|
|
|
- .privacy-wrapper {
|
|
|
- z-index: 999;
|
|
|
- position: fixed;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- background: #7F7F7F;
|
|
|
+ .logo {
|
|
|
+ width: 32rpx;
|
|
|
+ height: 32rpx;
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
|
|
|
- .privacy-box {
|
|
|
- position: absolute;
|
|
|
- left: 50%;
|
|
|
- top: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- width: 560rpx;
|
|
|
- padding: 50rpx 45rpx 0;
|
|
|
- background: #fff;
|
|
|
- border-radius: 20rpx;
|
|
|
-
|
|
|
- .title {
|
|
|
- text-align: center;
|
|
|
- font-size: 32rpx;
|
|
|
- text-align: center;
|
|
|
- color: #333;
|
|
|
- font-weight: 700;
|
|
|
- }
|
|
|
+ .arrow {
|
|
|
+ width: 48rpx;
|
|
|
+ height: 48rpx;
|
|
|
+ }
|
|
|
|
|
|
- .content {
|
|
|
- margin-top: 20rpx;
|
|
|
- line-height: 1.5;
|
|
|
- font-size: 26rpx;
|
|
|
- color: #666;
|
|
|
- text-indent: 54rpx;
|
|
|
+ .name {
|
|
|
+ flex: 1;
|
|
|
+ text-align: center;
|
|
|
+ color: #7C7C7C;
|
|
|
+ font-size: 36rpx;
|
|
|
+ margin: 0 13rpx 0 18rpx;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
|
|
|
- i {
|
|
|
- font-style: normal;
|
|
|
- color: $theme-color;
|
|
|
+ .input {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ /* #ifdef MP */
|
|
|
+ width: 305rpx;
|
|
|
+ /* #endif */
|
|
|
+ height: 50rpx;
|
|
|
+ padding: 0 0 0 30rpx;
|
|
|
+ background: rgba(247, 247, 247, 1);
|
|
|
+ border: 1px solid rgba(241, 241, 241, 1);
|
|
|
+ border-radius: 29rpx;
|
|
|
+ color: #BBBBBB;
|
|
|
+ font-size: 28rpx;
|
|
|
+
|
|
|
+ .iconfont {
|
|
|
+ margin-right: 20rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .btn-box {
|
|
|
- margin-top: 40rpx;
|
|
|
- text-align: center;
|
|
|
- font-size: 30rpx;
|
|
|
-
|
|
|
- .btn-item {
|
|
|
- height: 82rpx;
|
|
|
- line-height: 82rpx;
|
|
|
- background: linear-gradient(90deg, #F67A38 0%, #F11B09 100%);
|
|
|
- color: #fff;
|
|
|
- border-radius: 41rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .btn {
|
|
|
- padding: 30rpx 0;
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .page-index {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- min-height: 100%;
|
|
|
- background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
|
|
|
-
|
|
|
- .header {
|
|
|
+ #map {
|
|
|
width: 100%;
|
|
|
- background-color: $theme-color;
|
|
|
- padding: 28rpx 30rpx;
|
|
|
-
|
|
|
- .serch-wrapper {
|
|
|
- align-items: center;
|
|
|
-
|
|
|
-
|
|
|
- .logo {
|
|
|
- width: 118rpx;
|
|
|
- height: 42rpx;
|
|
|
- margin-right: 24rpx;
|
|
|
- }
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
|
|
|
- image {
|
|
|
- width: 118rpx;
|
|
|
- height: 42rpx;
|
|
|
- }
|
|
|
+ ::v-deep .uni-image[src^="https://app.tjzhxx.cn:11443/"] {
|
|
|
+ border: 2px solid red;
|
|
|
+ /* 添加2px宽的红色边框 */
|
|
|
+ border-radius: 50%;
|
|
|
+ /* 可选,设置为圆形边框 */
|
|
|
+ }
|
|
|
|
|
|
- .input {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- width: 546rpx;
|
|
|
- height: 58rpx;
|
|
|
- padding: 0 0 0 30rpx;
|
|
|
- background: rgba(247, 247, 247, 1);
|
|
|
- border: 1px solid rgba(241, 241, 241, 1);
|
|
|
- border-radius: 29rpx;
|
|
|
- color: #BBBBBB;
|
|
|
- font-size: 26rpx;
|
|
|
-
|
|
|
- .iconfont {
|
|
|
- margin-right: 20rpx;
|
|
|
- font-size: 26rpx;
|
|
|
- color: #666666;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ .custom-marker {
|
|
|
+ position: relative;
|
|
|
+ width: 42px;
|
|
|
+ /* 根据您的标记点图标宽度调整 */
|
|
|
+ height: 47px;
|
|
|
+ /* 根据您的标记点图标高度调整 */
|
|
|
+ }
|
|
|
|
|
|
- .tabNav {
|
|
|
- padding-top: 24rpx;
|
|
|
- }
|
|
|
+ .custom-marker img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ /* 在这里添加您需要的自定义CSS样式 */
|
|
|
+ border: 1rpx solid red;
|
|
|
}
|
|
|
|
|
|
- /* #ifdef MP */
|
|
|
- .mp-header {
|
|
|
+ .loading {
|
|
|
z-index: 999;
|
|
|
- position: fixed;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
width: 100%;
|
|
|
- /* #ifdef H5 */
|
|
|
- padding-bottom: 20rpx;
|
|
|
- /* #endif */
|
|
|
- background-color: $theme-color;
|
|
|
-
|
|
|
- .serch-wrapper {
|
|
|
- height: 100%;
|
|
|
- align-items: center;
|
|
|
- padding: 0 50rpx 0 53rpx;
|
|
|
-
|
|
|
- image {
|
|
|
- width: 118rpx;
|
|
|
- height: 42rpx;
|
|
|
- margin-right: 30rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .input {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- /* #ifdef MP */
|
|
|
- width: 305rpx;
|
|
|
- /* #endif */
|
|
|
- height: 50rpx;
|
|
|
- padding: 0 0 0 30rpx;
|
|
|
- background: rgba(247, 247, 247, 1);
|
|
|
- border: 1px solid rgba(241, 241, 241, 1);
|
|
|
- border-radius: 29rpx;
|
|
|
- color: #BBBBBB;
|
|
|
- font-size: 28rpx;
|
|
|
-
|
|
|
- .iconfont {
|
|
|
- margin-right: 20rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ top: 30%;
|
|
|
+ // left:50%;
|
|
|
+ position: absolute;
|
|
|
}
|
|
|
|
|
|
- /* #endif */
|
|
|
-
|
|
|
- .page_content {
|
|
|
- background-color: #f5f5f5;
|
|
|
- /* #ifdef H5 */
|
|
|
- // margin-top: 20rpx !important;
|
|
|
- /* #endif */
|
|
|
- padding: 0 30rpx;
|
|
|
+ .top-input::before {
|
|
|
+ content: "";
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: #FF0000;
|
|
|
+ opacity: 0.1;
|
|
|
+ filter: blur(50px);
|
|
|
+ z-index: 66;
|
|
|
+ pointer-events: none;
|
|
|
+ }
|
|
|
|
|
|
- .swiper {
|
|
|
- position: relative;
|
|
|
+ .top-input {
|
|
|
+ width: 70%;
|
|
|
+ height: 45%;
|
|
|
+ top: 20%;
|
|
|
+ left: 15%;
|
|
|
+ text-align: center;
|
|
|
+ position: absolute;
|
|
|
+ box-sizing: border-box;
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #000000;
|
|
|
+ // border: 1rpx solid red;
|
|
|
+ padding: 119rpx 90rpx;
|
|
|
+
|
|
|
+ image {
|
|
|
width: 100%;
|
|
|
- height: 280rpx;
|
|
|
- margin: 0 auto;
|
|
|
- border-radius: 10rpx;
|
|
|
- overflow: hidden;
|
|
|
- margin-bottom: 25rpx;
|
|
|
- /* #ifdef MP */
|
|
|
- z-index: 10;
|
|
|
- margin-top: 20rpx;
|
|
|
-
|
|
|
- /* #endif */
|
|
|
- swiper,
|
|
|
- .swiper-item,
|
|
|
- image {
|
|
|
- width: 100%;
|
|
|
- height: 280rpx;
|
|
|
- border-radius: 10rpx;
|
|
|
- }
|
|
|
+ height: 368rpx;
|
|
|
}
|
|
|
|
|
|
- .nav {
|
|
|
- padding-bottom: 26rpx;
|
|
|
- background: #fff;
|
|
|
- opacity: 1;
|
|
|
- border-radius: 14rpx;
|
|
|
+ .btn-box {
|
|
|
+ z-index: 999;
|
|
|
width: 100%;
|
|
|
- margin-bottom: 30rpx;
|
|
|
-
|
|
|
- .item {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- width: 20%;
|
|
|
- margin-top: 30rpx;
|
|
|
-
|
|
|
- image {
|
|
|
- width: 82rpx;
|
|
|
- height: 82rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- .nav-bd {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
+ justify-content: center;
|
|
|
|
|
|
- .item {
|
|
|
+ .btn {
|
|
|
+ background: rgba(255, 247, 247, 0.3);
|
|
|
+ border-radius: 35rpx;
|
|
|
+ border: 3rpx solid #EC3534;
|
|
|
+ margin-top: 42rpx;
|
|
|
+ width: 236rpx;
|
|
|
+ height: 70rpx;
|
|
|
display: flex;
|
|
|
- flex-direction: column;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 36rpx;
|
|
|
+ color: #EC3534;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .txt {
|
|
|
- font-size: 32rpx;
|
|
|
- color: #282828;
|
|
|
- }
|
|
|
-
|
|
|
- .label {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- width: 124rpx;
|
|
|
- height: 32rpx;
|
|
|
- margin-top: 5rpx;
|
|
|
- font-size: 24rpx;
|
|
|
- color: #999;
|
|
|
- }
|
|
|
+ // .top-input {
|
|
|
+ // width: 70%;
|
|
|
+ // height: 45%;
|
|
|
+ // top: 20%;
|
|
|
+ // left: 15%;
|
|
|
+ // text-align: center;
|
|
|
+ // position: absolute;
|
|
|
+ // box-sizing: border-box;
|
|
|
+ // font-size: 32rpx;
|
|
|
+ // font-weight: 500;
|
|
|
+ // color: #000000;
|
|
|
+ // border: 1rpx solid red;
|
|
|
+ // background: #FF0000;
|
|
|
+ // opacity: 0.4;
|
|
|
+ // filter: blur(50px);
|
|
|
+ // padding:119rpx 90rpx;
|
|
|
+ // image{
|
|
|
+ // width: 100%;
|
|
|
+ // height: 368rpx;
|
|
|
+ // }
|
|
|
+ // .btn-box{
|
|
|
+ // width: 100%;
|
|
|
+ // display: flex;
|
|
|
+ // align-items: center;
|
|
|
+ // justify-content: center;
|
|
|
+ // .btn{
|
|
|
+ // background: rgba(255,247,247,0.3);
|
|
|
+ // border-radius: 35rpx;
|
|
|
+ // border: 3rpx solid #EC3534;
|
|
|
+ // margin-top: 42rpx;
|
|
|
+ // width: 236rpx;
|
|
|
+ // height: 70rpx;
|
|
|
+ // display: flex;
|
|
|
+ // align-items: center;
|
|
|
+ // justify-content: center;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }
|
|
|
+
|
|
|
+ .info-box {
|
|
|
+ width: 100%;
|
|
|
+ height: 40%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ flex-direction: column;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 75rpx;
|
|
|
+ z-index: 1000;
|
|
|
+ // background-color: #fff;
|
|
|
+ padding: 0 30rpx 0;
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #000000;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .scroll-view_H {
|
|
|
+ width: 100%;
|
|
|
+ height: 80%;
|
|
|
+
|
|
|
+ /* 设置适当的高度 */
|
|
|
+ .scroll-view-content {
|
|
|
+ height: 100%;
|
|
|
+ white-space: nowrap;
|
|
|
+ font-size: 0;
|
|
|
+ overflow-x: auto;
|
|
|
+
|
|
|
+ .scroll-view-item_H {
|
|
|
+ width: 50%;
|
|
|
+ height: 100%;
|
|
|
+ display: inline-block;
|
|
|
+ font-size: 16px;
|
|
|
+ margin-right: 15rpx;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .bg-image {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ object-fit: cover;
|
|
|
+ }
|
|
|
|
|
|
- &.active {
|
|
|
- color: $theme-color;
|
|
|
+ .text-wrapper {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ padding: 60rpx 30rpx 0;
|
|
|
+ }
|
|
|
|
|
|
- .txt {
|
|
|
- color: $theme-color;
|
|
|
+ .black {
|
|
|
+ color: #2D2D2D;
|
|
|
}
|
|
|
|
|
|
- .label {
|
|
|
- background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
|
|
|
- border-radius: 16rpx;
|
|
|
+ .white {
|
|
|
color: #fff;
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .index-product-wrapper {
|
|
|
- margin-bottom: 110rpx;
|
|
|
-
|
|
|
- &.on {
|
|
|
- min-height: 1500rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .list-box {
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- justify-content: space-between;
|
|
|
-
|
|
|
- .item {
|
|
|
- width: 335rpx;
|
|
|
- margin-bottom: 20rpx;
|
|
|
- background-color: #fff;
|
|
|
- border-radius: 10rpx;
|
|
|
- overflow: hidden;
|
|
|
|
|
|
- image {
|
|
|
+ .text-overlay {
|
|
|
+ // color: white;
|
|
|
+ font-size: 16px;
|
|
|
width: 100%;
|
|
|
- height: 330rpx;
|
|
|
- }
|
|
|
+ overflow: hidden;
|
|
|
|
|
|
- .text-info {
|
|
|
- padding: 10rpx 20rpx 15rpx;
|
|
|
+ .top-box {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
|
|
|
- .title {
|
|
|
- color: #222222;
|
|
|
- }
|
|
|
+ .top-left {
|
|
|
+ .english {
|
|
|
+ font-size: 24rpx;
|
|
|
+ }
|
|
|
|
|
|
- .old-price {
|
|
|
- margin-top: 8rpx;
|
|
|
- font-size: 26rpx;
|
|
|
- color: #AAAAAA;
|
|
|
- text-decoration: line-through;
|
|
|
+ .chinese {
|
|
|
+ font-size: 32rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- text {
|
|
|
- margin-right: 2px;
|
|
|
- font-size: 20rpx;
|
|
|
+ .top-right {
|
|
|
+ width: 76rpx;
|
|
|
+ height: 76rpx;
|
|
|
+ border-radius: 50%;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .price {
|
|
|
+ .under-box {
|
|
|
+ margin-top: 8rpx;
|
|
|
display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
align-items: flex-end;
|
|
|
- color: $theme-color;
|
|
|
- font-size: 34rpx;
|
|
|
- font-weight: 800;
|
|
|
-
|
|
|
- text {
|
|
|
- padding-bottom: 4rpx;
|
|
|
- font-size: 24rpx;
|
|
|
- font-weight: 800;
|
|
|
+
|
|
|
+ .under-left {
|
|
|
+ color: #EC3534;
|
|
|
+
|
|
|
+ .number {
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+
|
|
|
+ .unit {
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- .txt {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- width: 28rpx;
|
|
|
- height: 28rpx;
|
|
|
- margin-left: 15rpx;
|
|
|
- margin-bottom: 10rpx;
|
|
|
- border: 1px solid $theme-color;
|
|
|
- border-radius: 4rpx;
|
|
|
- font-size: 22rpx;
|
|
|
- font-weight: normal;
|
|
|
+ .under-right {
|
|
|
+ font-weight: 500;
|
|
|
+
|
|
|
+ .range {
|
|
|
+ font-size: 24rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .range-word {
|
|
|
+ font-size: 24rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .white {
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- &.on {
|
|
|
- display: flex;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- .productList {
|
|
|
- /* #ifdef H5 */
|
|
|
- padding-bottom: 140rpx;
|
|
|
- /* #endif */
|
|
|
- }
|
|
|
+ .sos-btn {
|
|
|
+ width: 100%;
|
|
|
+ height: 140rpx;
|
|
|
|
|
|
- .productList .list {
|
|
|
- padding: 0 20rpx;
|
|
|
- }
|
|
|
+ image {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .productList .list.on {
|
|
|
- background-color: #fff;
|
|
|
- border-top: 1px solid #f6f6f6;
|
|
|
- }
|
|
|
|
|
|
- .productList .list .item {
|
|
|
- width: 345rpx;
|
|
|
- margin-top: 20rpx;
|
|
|
- background-color: #fff;
|
|
|
- border-radius: 10rpx;
|
|
|
- }
|
|
|
|
|
|
- .productList .list .item.on {
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- border-bottom: 1rpx solid #f6f6f6;
|
|
|
- padding: 30rpx 0;
|
|
|
- margin: 0;
|
|
|
- }
|
|
|
|
|
|
- .productList .list .item .pictrue {
|
|
|
- position: relative;
|
|
|
- width: 100%;
|
|
|
- height: 345rpx;
|
|
|
- }
|
|
|
|
|
|
- .productList .list .item .pictrue.on {
|
|
|
- width: 180rpx;
|
|
|
- height: 180rpx;
|
|
|
- }
|
|
|
|
|
|
- .productList .list .item .pictrue image {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- border-radius: 20rpx 20rpx 0 0;
|
|
|
- }
|
|
|
-
|
|
|
- .productList .list .item .pictrue image.on {
|
|
|
- border-radius: 6rpx;
|
|
|
- }
|
|
|
|
|
|
- .productList .list .item .text {
|
|
|
- padding: 20rpx 17rpx 26rpx 17rpx;
|
|
|
- font-size: 30rpx;
|
|
|
- color: #222;
|
|
|
- }
|
|
|
|
|
|
- .productList .list .item .text.on {
|
|
|
- width: 508rpx;
|
|
|
- padding: 0 0 0 22rpx;
|
|
|
- }
|
|
|
|
|
|
- .productList .list .item .text .money {
|
|
|
- font-size: 26rpx;
|
|
|
- font-weight: bold;
|
|
|
- margin-top: 8rpx;
|
|
|
- }
|
|
|
+ .code {
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
|
|
|
- .productList .list .item .text .money.on {
|
|
|
- margin-top: 50rpx;
|
|
|
- }
|
|
|
+ .time {
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #999999;
|
|
|
+ margin: 10rpx 0 16rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
|
|
|
- .productList .list .item .text .money .num {
|
|
|
- font-size: 34rpx;
|
|
|
- }
|
|
|
+ .online-box {
|
|
|
+ margin-right: 25rpx;
|
|
|
+ width: 55rpx;
|
|
|
+ height: 30rpx;
|
|
|
|
|
|
- .productList .list .item .text .vip {
|
|
|
- font-size: 22rpx;
|
|
|
- color: #aaa;
|
|
|
- margin-top: 7rpx;
|
|
|
- }
|
|
|
+ image {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .productList .list .item .text .vip.on {
|
|
|
- margin-top: 12rpx;
|
|
|
- }
|
|
|
+ .position {
|
|
|
+ // margin-top: 16rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .productList .list .item .text .vip .vip-money {
|
|
|
- font-size: 24rpx;
|
|
|
- color: #282828;
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
+ .icon-box {
|
|
|
+ width: 10%;
|
|
|
+ height: 30%;
|
|
|
+ top: 20%;
|
|
|
+ position: absolute;
|
|
|
+ left: 5%;
|
|
|
+ display: flex;
|
|
|
+ background-color: #ECECEC;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ border-radius: 10rpx;
|
|
|
+
|
|
|
+ .img-box {
|
|
|
+ text-align: center;
|
|
|
+ height: 24.5%;
|
|
|
+ line-height: 130rpx;
|
|
|
+ background-color: #fff;
|
|
|
|
|
|
- .productList .list .item .text .vip .vip-money image {
|
|
|
- width: 46rpx;
|
|
|
- height: 21rpx;
|
|
|
- margin-left: 4rpx;
|
|
|
- }
|
|
|
+ image {
|
|
|
+ width: 42rpx;
|
|
|
+ height: 42rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .pictrue {
|
|
|
- position: relative;
|
|
|
- }
|
|
|
+ .first {
|
|
|
+ border-radius: 10rpx 10rpx 0 0;
|
|
|
+ }
|
|
|
|
|
|
- .fixed {
|
|
|
- z-index: 100;
|
|
|
- position: fixed;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
- background: linear-gradient(90deg, red 50%, #ff5400 100%);
|
|
|
+ .last {
|
|
|
+ border-radius: 0 0 10rpx 10rpx;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ image {
|
|
|
+ width: 42rpx;
|
|
|
+ height: 42rpx;
|
|
|
+ }
|
|
|
|
|
|
- .mores-txt {
|
|
|
- width: 100%;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- height: 70rpx;
|
|
|
- color: #999;
|
|
|
- font-size: 24rpx;
|
|
|
-
|
|
|
- .iconfont {
|
|
|
- margin-top: 2rpx;
|
|
|
- font-size: 20rpx;
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .menu-txt {
|
|
|
- font-size: 24rpx;
|
|
|
- color: #454545;
|
|
|
- }
|
|
|
-
|
|
|
- .mp-bg {
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- /* #ifdef H5 */
|
|
|
- top: 98rpx;
|
|
|
- /* #endif */
|
|
|
- width: 100%;
|
|
|
- height: 304rpx;
|
|
|
- background: linear-gradient(180deg, #E93323 0%, #F5F5F5 100%, #751A12 100%);
|
|
|
- // border-radius: 0 0 30rpx 30rpx;
|
|
|
+ .icon-box-right {
|
|
|
+ width: 10%;
|
|
|
+ height: 25%;
|
|
|
+ top: 10%;
|
|
|
+ position: absolute;
|
|
|
+ right: 5%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 70rpx;
|
|
|
+ height: 70rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|