|
@@ -1,18 +1,21 @@
|
|
<template>
|
|
<template>
|
|
<view class="container">
|
|
<view class="container">
|
|
- <view class="tui-shop__info">
|
|
|
|
- <image :src="storeDetail.store_logo" class="tui-logo"></image>
|
|
|
|
- <view class="tui-shop__desc">
|
|
|
|
- <view class="tui-shop__name">
|
|
|
|
- <text>{{storeDetail.title}}</text>
|
|
|
|
- </view>
|
|
|
|
- <view class="tui-shop__rate" @tap="storeopenLocation">
|
|
|
|
- <!--<view class="tui-rate__box"><tui-rate :current="5" :score="0.6" disabled :size="12"></tui-rate></view>-->
|
|
|
|
- <view class="tui-shop__address">{{storeDetail.address}}<image src="/static/images/map.png" class="map-img"> </image><text
|
|
|
|
- style="color: #fff;">导航到这里</text></view>
|
|
|
|
|
|
+ <view class="tui-header">
|
|
|
|
+ <view class="tui-shop__info">
|
|
|
|
+ <image :src="storeDetail.store_logo" class="tui-logo"></image>
|
|
|
|
+ <view class="tui-shop__desc">
|
|
|
|
+ <view class="tui-shop__name">
|
|
|
|
+ <text>{{storeDetail.title}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="tui-shoprate" @tap="storeopenLocation">
|
|
|
|
+ <!--<view class="tui-rate__box"><tui-rate :current="5" :score="0.6" disabled :size="12"></tui-rate></view>-->
|
|
|
|
+ <view class="tui-shop__address">{{storeDetail.address}}
|
|
|
|
+ <image src="/static/images/map.png" class="map-img"> </image><text
|
|
|
|
+ style="color: #fff;">导航到这里</text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <!--
|
|
|
|
|
|
+ <!--
|
|
<view class="tui-btn__follow">
|
|
<view class="tui-btn__follow">
|
|
<tui-button :size="24" width="116rpx" height="48rpx" shape="circle" type="danger">
|
|
<tui-button :size="24" width="116rpx" height="48rpx" shape="circle" type="danger">
|
|
<tui-icon name="like" color="#fff" :size="24" unit="rpx"></tui-icon>
|
|
<tui-icon name="like" color="#fff" :size="24" unit="rpx"></tui-icon>
|
|
@@ -20,47 +23,75 @@
|
|
</tui-button>
|
|
</tui-button>
|
|
<tui-button :size="24" width="116rpx" height="48rpx" shape="circle" type="white" disabled>已关注</tui-button>
|
|
<tui-button :size="24" width="116rpx" height="48rpx" shape="circle" type="white" disabled>已关注</tui-button>
|
|
</view>-->
|
|
</view>-->
|
|
|
|
+ </view>
|
|
|
|
+ <tui-tabs @change="change" :currentTab="current" :tabs="tabs" itemWidth="33%" backgroundColor="#5796fd"
|
|
|
|
+ color="rgba(255,255,255,.7)" selectedColor="#fff" sliderBgColor="#fff" bottom="8rpx" unlined :size="30"
|
|
|
|
+ :sliderWidth="60"></tui-tabs>
|
|
</view>
|
|
</view>
|
|
- <tui-tabs @change="change" :currentTab="current" :tabs="tabs" itemWidth="33%" backgroundColor="#5796fd"
|
|
|
|
- color="rgba(255,255,255,.7)" selectedColor="#fff" sliderBgColor="#fff" bottom="8rpx" unlined :size="30"
|
|
|
|
- :sliderWidth="60"></tui-tabs>
|
|
|
|
- <!--=======推荐 start=======-->
|
|
|
|
- <view class="tui-items__1 tui-padding" v-if="current == 0">
|
|
|
|
- <block v-if="is_recommendgoods==1">
|
|
|
|
- <view class="tui-ranking__header">
|
|
|
|
- <view class="tui-ranking__title">平台推荐</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="tui-ranking__list">
|
|
|
|
- <view class="tui-ranking__item" @tap="detail(item.id)" v-for="(item, index) in recommendgoods"
|
|
|
|
- v-if="index<3" :key="index">
|
|
|
|
- <image :src="item.pic"></image>
|
|
|
|
- <view class="tui-ranking__gtitle">{{ item.name }}</view>
|
|
|
|
- <view class="tui-sale-price">¥{{ item.price }}</view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </block>
|
|
|
|
-
|
|
|
|
- <view class="tui-recommend__title">服务/商品</view>
|
|
|
|
- <view class="tui-recommend__item" @tap="detail(item.id)" v-for="(item, index) in goodsList" :key="index">
|
|
|
|
- <image :src="item.pic" class="tui-rg__img" mode="widthFix"></image>
|
|
|
|
- <view class="tui-recommend__right">
|
|
|
|
- <view class="tui-rg__title">
|
|
|
|
- {{ item.name }}
|
|
|
|
|
|
+
|
|
|
|
+ <view class="tui-body">
|
|
|
|
+ <view class="tui-items__1 tui-padding" v-if="current == 0">
|
|
|
|
+ <!--=======猜你喜欢 start=======-->
|
|
|
|
+ <block v-if="is_recommendgoods==1 && Category.length<1">
|
|
|
|
+ <view class="tui-ranking__header">
|
|
|
|
+ <view class="tui-ranking__title">猜你喜欢</view>
|
|
</view>
|
|
</view>
|
|
- <view class="tui-sale-price">¥{{ item.price }}</view>
|
|
|
|
- <view v-if="item.sale_count>1" class="tui-rg__interested">
|
|
|
|
- <tui-icon name="like" :size="26" unit="rpx" color="#EB0909"></tui-icon>
|
|
|
|
- <text class="tui-interested__num">{{ item.sale_count }}人购买</text>
|
|
|
|
|
|
+ <view class="tui-ranking__list">
|
|
|
|
+ <view class="tui-ranking__item" @tap="toDetailsTap" v-for="(item, index) in recommendgoods"
|
|
|
|
+ :data-id="item.id" v-if="index<3" :key="index">
|
|
|
|
+ <image :src="item.pic"></image>
|
|
|
|
+ <view class="tui-ranking__gtitle">{{ item.name }}</view>
|
|
|
|
+ <view class="tui-sale-price">¥{{ item.price }}</view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </block>
|
|
|
|
+ <!--=======猜你喜欢 end=======-->
|
|
|
|
+ <block v-if="Category.length>0">
|
|
|
|
+ <scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-into-view="scrollViewId"
|
|
|
|
+ :style="{ height: height + 'px', top: top + 'px' }">
|
|
|
|
+ <view :id="`id_${index}`" v-for="(item, index) in Category" :key="item.id" class="tab-bar-item"
|
|
|
|
+ :class="[currentTab == index ? 'active' : '']" :data-current="index"
|
|
|
|
+ @tap="swichNav(item.id,index)">
|
|
|
|
+ <text>{{ item.title }}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </scroll-view>
|
|
|
|
+ <scroll-view @scrolltolower="tolower" scroll-y class="right-box" :scroll-into-view="floorNum"
|
|
|
|
+ :style="{ height: height + 'px', top: top + 'px' }" @scroll="mainScroll">
|
|
|
|
+ <view class="page-view" id="scroll-panel">
|
|
|
|
+ <view class="class-box">
|
|
|
|
+ <view class="class-item main-item" :id="'b'+item.id" v-if="Category.length>0"
|
|
|
|
+ v-for="(item, index) in Category" :key="index">
|
|
|
|
+ <view class="class-name">{{ item.title }}</view>
|
|
|
|
+ <view class="g-container">
|
|
|
|
+ <view class="g-box" v-for="(goods, i1) in item.goodslist" :key="i2"
|
|
|
|
+ @tap="toDetailsTap" :data-id="goods.id">
|
|
|
|
+ <image :src="goods.image" class="g-image" mode="widthFix" />
|
|
|
|
+ <view class="g-title">{{ goods.name }}</view>
|
|
|
|
+ <view class="price" style="color:red;">¥{{goods.price}}
|
|
|
|
+ <block v-if="goods.ptype==2 && goods.quantity_unit">
|
|
|
|
+ <text v-if="goods.time_amount > 0"
|
|
|
|
+ class="f-24">/{{goods.time_amount}}{{goods.quantity_unit}}</text>
|
|
|
|
+ <text v-else class="f-24"><text
|
|
|
|
+ v-if="goods.is_times && goods.timesmum">/{{goods.timesmum}}</text>{{goods.quantity_unit}}</text>
|
|
|
|
+ </block>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="fill-last" :style="{ 'height':fillHeight + 'px' }"></view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view :style='"height:"+(height-300)+"rpx;"' v-if="number<15"></view>
|
|
|
|
+ </scroll-view>
|
|
|
|
+ </block>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <!--=======推荐 end=======-->
|
|
|
|
- <!--=======活动 start=======-->
|
|
|
|
- <view class="tui-items__3 tui-padding" v-if="current == 1">
|
|
|
|
- <view class="tui-activity__box">
|
|
|
|
- <view class="tui-activity__title">用户评价</view>
|
|
|
|
- <!--
|
|
|
|
|
|
+
|
|
|
|
+ <!--=======用户评价 start=======-->
|
|
|
|
+ <view class="tui-items__3 tui-padding" v-if="current == 1">
|
|
|
|
+ <view class="tui-activity__box">
|
|
|
|
+ <view class="tui-activity__title">用户评价</view>
|
|
|
|
+ <!--
|
|
<view class="tui-activity__item" @tap="detail" v-for="(item, index) in 12" :key="index">
|
|
<view class="tui-activity__item" @tap="detail" v-for="(item, index) in 12" :key="index">
|
|
<image :src="`/static/images/product/${index % 2 == 0 ? 4 : 3}.jpg`"></image>
|
|
<image :src="`/static/images/product/${index % 2 == 0 ? 4 : 3}.jpg`"></image>
|
|
<view class="tui-activity__right">
|
|
<view class="tui-activity__right">
|
|
@@ -81,84 +112,83 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>-->
|
|
</view>-->
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <!--=======活动 end=======-->
|
|
|
|
- <!--=======新品 start=======-->
|
|
|
|
- <view class="tui-items__4" v-if="current == 2">
|
|
|
|
- <view class="tui-score__bg"></view>
|
|
|
|
- <view class="tui-info__box">
|
|
|
|
- <view class="tui-score__box tui-common__box">
|
|
|
|
- <view class="tui-flex__center">
|
|
|
|
- <text>店铺星级</text>
|
|
|
|
- <view class="tui-rate__box">
|
|
|
|
- <tui-rate :current="5" :score="0.6" disabled :size="12"></tui-rate>
|
|
|
|
|
|
+ <!--=======用户评价 end=======-->
|
|
|
|
+ <!--=======店铺 start=======-->
|
|
|
|
+ <view class="tui-items__4" v-if="current == 2">
|
|
|
|
+ <view class="tui-score__bg"></view>
|
|
|
|
+ <view class="tui-info__box">
|
|
|
|
+ <view class="tui-score__box tui-common__box">
|
|
|
|
+ <view class="tui-flex__center">
|
|
|
|
+ <text>店铺星级</text>
|
|
|
|
+ <view class="tui-rate__box">
|
|
|
|
+ <tui-rate :current="5" :score="0.6" disabled :size="12"></tui-rate>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <view class="tui-flex__center">
|
|
|
|
- <text>用户评价</text>
|
|
|
|
- <view class="tui-score tui-color__red">
|
|
|
|
- <text>9.90分</text>
|
|
|
|
- <text>高</text>
|
|
|
|
|
|
+ <view class="tui-flex__center">
|
|
|
|
+ <text>用户评价</text>
|
|
|
|
+ <view class="tui-score tui-color__red">
|
|
|
|
+ <text>9.90分</text>
|
|
|
|
+ <text>高</text>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <view class="tui-flex__center">
|
|
|
|
- <text>专业程度</text>
|
|
|
|
- <view class="tui-score tui-color__red">
|
|
|
|
- <text>9.99分</text>
|
|
|
|
- <text>高</text>
|
|
|
|
|
|
+ <view class="tui-flex__center">
|
|
|
|
+ <text>专业程度</text>
|
|
|
|
+ <view class="tui-score tui-color__red">
|
|
|
|
+ <text>9.99分</text>
|
|
|
|
+ <text>高</text>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <view class="tui-flex__center">
|
|
|
|
- <text>服务态度</text>
|
|
|
|
- <view class="tui-score tui-color__green">
|
|
|
|
- <text>8.95分</text>
|
|
|
|
- <text>低</text>
|
|
|
|
|
|
+ <view class="tui-flex__center">
|
|
|
|
+ <text>服务态度</text>
|
|
|
|
+ <view class="tui-score tui-color__green">
|
|
|
|
+ <text>8.95分</text>
|
|
|
|
+ <text>低</text>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <view class="tui-common__box tui-top__20">
|
|
|
|
- <!--<tui-list-cell arrow>证照信息</tui-list-cell>-->
|
|
|
|
- <tui-list-cell arrow unlined @click="qrcode">店铺二维码</tui-list-cell>
|
|
|
|
- </view>
|
|
|
|
- <view class="tui-common__box tui-top__20">
|
|
|
|
- <tui-list-cell :hover="false">
|
|
|
|
- <view class="tui-flex">
|
|
|
|
- <text class="tui-text__shrink">店铺简介</text>
|
|
|
|
- <text class="tui-sub__info">{{storeDetail.content}}</text>
|
|
|
|
- </view>
|
|
|
|
- </tui-list-cell>
|
|
|
|
- <tui-list-cell :hover="false">
|
|
|
|
- <view class="tui-flex">
|
|
|
|
- <text class="tui-text__shrink">地址</text>
|
|
|
|
- <text class="tui-sub__info">{{storeDetail.province_name}}{{storeDetail.city_name}}{{storeDetail.district_name}}<br />{{storeDetail.address}}</text>
|
|
|
|
- </view>
|
|
|
|
- </tui-list-cell>
|
|
|
|
- <tui-list-cell :hover="false" unlined>
|
|
|
|
- <view class="tui-flex">
|
|
|
|
- <text class="tui-text__shrink">开店时间</text>
|
|
|
|
- <text class="tui-sub__info">{{storeDetail.create_time}}</text>
|
|
|
|
- </view>
|
|
|
|
- </tui-list-cell>
|
|
|
|
|
|
+ <view class="tui-common__box tui-top__20">
|
|
|
|
+ <!--<tui-list-cell arrow>证照信息</tui-list-cell>-->
|
|
|
|
+ <tui-list-cell arrow unlined @click="qrcode">店铺二维码</tui-list-cell>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="tui-common__box tui-top__20">
|
|
|
|
+ <tui-list-cell :hover="false">
|
|
|
|
+ <view class="tui-flex">
|
|
|
|
+ <text class="tui-text__shrink">店铺简介</text>
|
|
|
|
+ <text class="tui-sub__info">{{storeDetail.content}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </tui-list-cell>
|
|
|
|
+ <tui-list-cell :hover="false">
|
|
|
|
+ <view class="tui-flex">
|
|
|
|
+ <text class="tui-text__shrink">地址</text>
|
|
|
|
+ <text
|
|
|
|
+ class="tui-sub__info">{{storeDetail.province_name}}{{storeDetail.city_name}}{{storeDetail.district_name}}<br />{{storeDetail.address}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </tui-list-cell>
|
|
|
|
+ <tui-list-cell :hover="false" unlined>
|
|
|
|
+ <view class="tui-flex">
|
|
|
|
+ <text class="tui-text__shrink">开店时间</text>
|
|
|
|
+ <text class="tui-sub__info">{{storeDetail.create_time}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </tui-list-cell>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ <!--=======店铺 end=======-->
|
|
|
|
+ <!--=======二维码 start=======-->
|
|
|
|
+ <tui-modal custom :show="modalShow" backgroundColor="transparent" padding="0" @cancel="hideModal">
|
|
|
|
+ <view class="tui-poster__box" :style="{marginTop:height+'px'}">
|
|
|
|
+ <image src="/static/images/mall/icon_popup_closed.png" class="tui-close__img" @tap.stop="hideModal">
|
|
|
|
+ </image>
|
|
|
|
+ <image :src="qrcodeImg" v-if="qrcodeImg" class="tui-poster__img"></image>
|
|
|
|
+ <tui-button type="danger" width="460rpx" height="80rpx" shape="circle" @click="savePic">保存图片
|
|
|
|
+ </tui-button>
|
|
|
|
+ <view class="tui-share__tips">保存二维图片到手机相册后,分享到您的圈子</view>
|
|
|
|
+ </view>
|
|
|
|
+ </tui-modal>
|
|
|
|
+ <!--=======二维码 end=======-->
|
|
</view>
|
|
</view>
|
|
- <!--=======新品 end=======-->
|
|
|
|
- <!--=======二维码 start=======-->
|
|
|
|
- <tui-modal custom :show="modalShow" backgroundColor="transparent" padding="0" @cancel="hideModal">
|
|
|
|
- <view class="tui-poster__box" :style="{marginTop:height+'px'}">
|
|
|
|
- <image src="/static/images/mall/icon_popup_closed.png" class="tui-close__img" @tap.stop="hideModal">
|
|
|
|
- </image>
|
|
|
|
- <image :src="qrcodeImg" v-if="qrcodeImg" class="tui-poster__img"></image>
|
|
|
|
- <tui-button type="danger" width="460rpx" height="80rpx" shape="circle" @click="savePic">保存图片
|
|
|
|
- </tui-button>
|
|
|
|
- <view class="tui-share__tips">保存二维图片到手机相册后,分享到您的圈子</view>
|
|
|
|
- </view>
|
|
|
|
- </tui-modal>
|
|
|
|
- <!--=======二维码 end=======-->
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -168,8 +198,6 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
uid: '',
|
|
uid: '',
|
|
- width: 350,
|
|
|
|
- height: 64,
|
|
|
|
modalShow: false,
|
|
modalShow: false,
|
|
qrcodeImg: '',
|
|
qrcodeImg: '',
|
|
statusBarHeight: 20,
|
|
statusBarHeight: 20,
|
|
@@ -183,17 +211,39 @@
|
|
name: '商家简介'
|
|
name: '商家简介'
|
|
}
|
|
}
|
|
],
|
|
],
|
|
- is_recommendgoods:'',
|
|
|
|
|
|
+ is_recommendgoods: '',
|
|
storeDetail: {},
|
|
storeDetail: {},
|
|
current: 0,
|
|
current: 0,
|
|
recommendgoods: [],
|
|
recommendgoods: [],
|
|
rankingTab: 0,
|
|
rankingTab: 0,
|
|
- goodsList: []
|
|
|
|
|
|
+ scrollViewId: "id_0",
|
|
|
|
+ height: 0, //scroll-view高度
|
|
|
|
+ top: 0,
|
|
|
|
+ Category: [],
|
|
|
|
+ currentTab: 0, //预设当前项的值
|
|
|
|
+ floorNum: '',
|
|
|
|
+ number: "",
|
|
|
|
+ scrollViewId: "id_0",
|
|
|
|
+ scrollHeight: 400,
|
|
|
|
+ scrollTopSize: 0,
|
|
|
|
+ fillHeight: 0, // 填充高度,用于最后一项低于滚动区域时使用
|
|
|
|
+ topArr: [], // 左侧列表元素
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onLoad: function(e) {
|
|
onLoad: function(e) {
|
|
const _this = this;
|
|
const _this = this;
|
|
-
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ uni.getSystemInfo({
|
|
|
|
+ success: res => {
|
|
|
|
+ let header = 182;
|
|
|
|
+ let top = 0;
|
|
|
|
+ console.log(res.windowHeight);
|
|
|
|
+ this.height = res.windowHeight - uni.upx2px(header);
|
|
|
|
+ this.top = top + uni.upx2px(header);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }, 50);
|
|
|
|
+
|
|
if (e && e.scene) {
|
|
if (e && e.scene) {
|
|
const scene = decodeURIComponent(e.scene) // 处理扫码进商品详情页面的逻辑
|
|
const scene = decodeURIComponent(e.scene) // 处理扫码进商品详情页面的逻辑
|
|
if (scene) {
|
|
if (scene) {
|
|
@@ -203,7 +253,7 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (e.reid) {
|
|
if (e.reid) {
|
|
uni.setStorageSync('reid', e.reid)
|
|
uni.setStorageSync('reid', e.reid)
|
|
}
|
|
}
|
|
@@ -222,28 +272,24 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ this.getCategoryall(e.id);
|
|
this.getStoreDetail(e.id);
|
|
this.getStoreDetail(e.id);
|
|
|
|
+
|
|
_this.$request.get('Goods.recommend').then(res => {
|
|
_this.$request.get('Goods.recommend').then(res => {
|
|
if (res.errno == 0) {
|
|
if (res.errno == 0) {
|
|
_this.recommendgoods = res.data;
|
|
_this.recommendgoods = res.data;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- _this.$request.post('Goods.index',{sid:e.id}).then(res => {
|
|
|
|
- if (res.errno == 0) {
|
|
|
|
- _this.goodsList = res.data.data;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getStoreDetail(sId) {
|
|
getStoreDetail(sId) {
|
|
const _this = this;
|
|
const _this = this;
|
|
_this.$request.get('store.detail', {
|
|
_this.$request.get('store.detail', {
|
|
- id: sId
|
|
|
|
|
|
+ id: sId
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.errno == 0) {
|
|
if (res.errno == 0) {
|
|
_this.storeDetail = res.data
|
|
_this.storeDetail = res.data
|
|
- if(_this.storeDetail.storeconfig){
|
|
|
|
|
|
+ if (_this.storeDetail.storeconfig) {
|
|
_this.is_recommendgoods = _this.storeDetail.storeconfig.is_recommendgoods
|
|
_this.is_recommendgoods = _this.storeDetail.storeconfig.is_recommendgoods
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -261,7 +307,24 @@
|
|
console.log('fail');
|
|
console.log('fail');
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ getCategoryall: function(sId) {
|
|
|
|
+ let _this = this;
|
|
|
|
+ this.$request.get('store.goodslist', {
|
|
|
|
+ sid: sId,
|
|
|
|
+ showLoading: true
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.errno == 0) {
|
|
|
|
+ _this.Category = res.data;
|
|
|
|
+ _this.categoryId = _this.Category[0].id;
|
|
|
|
+ setTimeout(function() {
|
|
|
|
+ _this.infoScroll();
|
|
|
|
+ _this.getElementTop();
|
|
|
|
+ }, 500)
|
|
|
|
+ console.info("services---request---getsonList--右侧二级三级分类成功")
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
initHeader(e) {
|
|
initHeader(e) {
|
|
this.width = Number(e.left);
|
|
this.width = Number(e.left);
|
|
@@ -275,6 +338,11 @@
|
|
detail(id) {
|
|
detail(id) {
|
|
this.tui.href('/pages/goodsDetail/goodsDetail?id=' + id);
|
|
this.tui.href('/pages/goodsDetail/goodsDetail?id=' + id);
|
|
},
|
|
},
|
|
|
|
+ toDetailsTap: function(e) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: "/pages/goodsDetail/goodsDetail?id=" + e.currentTarget.dataset.id
|
|
|
|
+ });
|
|
|
|
+ },
|
|
async qrcode() {
|
|
async qrcode() {
|
|
const _this = this;
|
|
const _this = this;
|
|
if (this.qrcodeImg) {
|
|
if (this.qrcodeImg) {
|
|
@@ -291,7 +359,7 @@
|
|
is_hyaline: true,
|
|
is_hyaline: true,
|
|
expireHours: 1
|
|
expireHours: 1
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
//console.log(qrdata);
|
|
//console.log(qrdata);
|
|
|
|
|
|
if (qrdata.errno == 0) {
|
|
if (qrdata.errno == 0) {
|
|
@@ -300,7 +368,7 @@
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.modalShow = true;
|
|
this.modalShow = true;
|
|
}, 60);
|
|
}, 60);
|
|
-
|
|
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
this.tui.toast('生成二维图片失败,请稍后再试');
|
|
this.tui.toast('生成二维图片失败,请稍后再试');
|
|
@@ -316,15 +384,106 @@
|
|
urls: [this.qrcodeImg]
|
|
urls: [this.qrcodeImg]
|
|
});
|
|
});
|
|
// #endif
|
|
// #endif
|
|
-
|
|
|
|
|
|
+
|
|
// #ifndef H5
|
|
// #ifndef H5
|
|
this.sam.saveImage(this.qrcodeImg);
|
|
this.sam.saveImage(this.qrcodeImg);
|
|
//console.log(this.qrcodeImg);
|
|
//console.log(this.qrcodeImg);
|
|
// #endif
|
|
// #endif
|
|
-
|
|
|
|
|
|
+
|
|
this.hideModal();
|
|
this.hideModal();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 点击标题切换当前页时改变样式
|
|
|
|
+ swichNav: function(Categoryid, e) {
|
|
|
|
+ let cur = e;
|
|
|
|
+ if (this.currentTab == cur) {
|
|
|
|
+ return false;
|
|
|
|
+ } else {
|
|
|
|
+ this.currentTab = cur;
|
|
|
|
+ this.checkCor();
|
|
|
|
+ }
|
|
|
|
+ this.floorNum = 'b' + Categoryid;
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ /* 获取元素顶部信息 */
|
|
|
|
+ getElementTop() {
|
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
|
+ let view = uni.createSelectorQuery().selectAll('.main-item');
|
|
|
|
+ view.boundingClientRect(data => {
|
|
|
|
+ resolve(data);
|
|
|
|
+ }).exec();
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ console.log('res', res);
|
|
|
|
+ let topArr = res.map((item) => {
|
|
|
|
+ return item.top - this.scrollTopSize; /* 减去滚动容器距离顶部的距离 */
|
|
|
|
+ });
|
|
|
|
+ this.topArr = topArr;
|
|
|
|
+ /* 获取最后一项的高度,设置填充高度。判断和填充时做了 +-20 的操作,是为了滚动时更好的定位 */
|
|
|
|
+ let last = res[res.length - 1].height;
|
|
|
|
+ if (last - 20 < this.scrollHeight) {
|
|
|
|
+ this.fillHeight = this.scrollHeight - last + 20;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /* 主区域滚动监听 */
|
|
|
|
+ mainScroll(e) {
|
|
|
|
+ // 节流方法
|
|
|
|
+ clearTimeout(this.mainThrottle);
|
|
|
|
+ this.mainThrottle = setTimeout(() => {
|
|
|
|
+ scrollFn();
|
|
|
|
+ }, 10);
|
|
|
|
+ let scrollFn = () => {
|
|
|
|
+ let top = e.detail.scrollTop;
|
|
|
|
+ let index = 0;
|
|
|
|
+ /* 查找当前滚动距离 */
|
|
|
|
+ this.topArr.forEach((item, id) => {
|
|
|
|
+ /*
|
|
|
|
+ console.log('------------**');
|
|
|
|
+ console.log(top);
|
|
|
|
+ console.log('------------');
|
|
|
|
+ console.log(item);
|
|
|
|
+ console.log('------------+++');
|
|
|
|
+ console.log(id);
|
|
|
|
+ */
|
|
|
|
+ if ((top + 100) >= item) {
|
|
|
|
+ index = id;
|
|
|
|
+ this.currentTab = (index < 0 ? 0 : index);
|
|
|
|
+ //console.log(index);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //判断当前滚动超过一屏时,设置tab标题滚动条。
|
|
|
|
+ checkCor: function() {
|
|
|
|
+ if (this.currentTab > 6) {
|
|
|
|
+ this.scrollViewId = `id_${this.currentTab - 2}`;
|
|
|
|
+ } else {
|
|
|
|
+ this.scrollViewId = `id_0`;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ infoScroll: function() {
|
|
|
|
+ let _this = this;
|
|
|
|
+ let len = _this.Category.length;
|
|
|
|
+ if (_this.Category[len - 1].son) {
|
|
|
|
+ this.number = _this.Category[len - 1].son.length;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ /* 初始化滚动区域 */
|
|
|
|
+ initScrollView() {
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ let view = uni.createSelectorQuery().select('#scroll-panel');
|
|
|
|
+ view.boundingClientRect(res => {
|
|
|
|
+ this.scrollTopSize = res.top;
|
|
|
|
+ this.scrollHeight = res.height;
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ resolve();
|
|
|
|
+ });
|
|
|
|
+ }).exec();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ tolower: function() {
|
|
|
|
+
|
|
|
|
+ }
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
@@ -343,7 +502,7 @@
|
|
path: "/pages/store_details/store_details?id=" + _this.storeDetail.id + "&reid=" + _this.uid,
|
|
path: "/pages/store_details/store_details?id=" + _this.storeDetail.id + "&reid=" + _this.uid,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
onShareTimeline(res) { //分享到朋友圈
|
|
onShareTimeline(res) { //分享到朋友圈
|
|
return {}
|
|
return {}
|
|
},
|
|
},
|
|
@@ -353,10 +512,20 @@
|
|
<style>
|
|
<style>
|
|
.tui-header {
|
|
.tui-header {
|
|
width: 100%;
|
|
width: 100%;
|
|
- display: flex;
|
|
|
|
|
|
+ height: 182rpx;
|
|
|
|
+ background-color: #5796fd;
|
|
align-items: center;
|
|
align-items: center;
|
|
- padding: 0 8rpx;
|
|
|
|
|
|
+ padding: 0;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
|
+ position: fixed;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ left: 0;
|
|
|
|
+ top: 0;
|
|
|
|
+ z-index: 999;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tui-body {
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
.tui-back__box {
|
|
.tui-back__box {
|
|
@@ -378,8 +547,13 @@
|
|
|
|
|
|
.tui-shop__info {
|
|
.tui-shop__info {
|
|
width: 100%;
|
|
width: 100%;
|
|
|
|
+ height: 103rpx;
|
|
|
|
+ overflow: hidden;
|
|
background-color: #5796fd;
|
|
background-color: #5796fd;
|
|
- padding: 0 25rpx 16rpx;
|
|
|
|
|
|
+ padding-top: 0;
|
|
|
|
+ padding-left: 25rpx;
|
|
|
|
+ padding-right: 25rpx;
|
|
|
|
+ padding-bottom: 0;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
@@ -396,16 +570,16 @@
|
|
}
|
|
}
|
|
|
|
|
|
.tui-shop__name {
|
|
.tui-shop__name {
|
|
- width: 440rpx;
|
|
|
|
font-size: 30rpx;
|
|
font-size: 30rpx;
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
- padding-bottom: 6rpx;
|
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
}
|
|
}
|
|
|
|
|
|
- .tui-shop__rate {
|
|
|
|
|
|
+ .tui-shoprate {
|
|
|
|
+ padding: 0;
|
|
|
|
+ margin: 0;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
}
|
|
}
|
|
@@ -421,9 +595,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
.tui-shop__address {
|
|
.tui-shop__address {
|
|
- font-size: 30rpx;
|
|
|
|
- transform: scale(0.8);
|
|
|
|
- transform-origin: 0 center;
|
|
|
|
|
|
+ font-size: 24rpx;
|
|
}
|
|
}
|
|
|
|
|
|
.tui-shop__follow {
|
|
.tui-shop__follow {
|
|
@@ -801,8 +973,9 @@
|
|
padding-left: 40rpx;
|
|
padding-left: 40rpx;
|
|
word-break: break-all;
|
|
word-break: break-all;
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
.map-img {
|
|
.map-img {
|
|
width: 50rpx;
|
|
width: 50rpx;
|
|
height: 50rpx;
|
|
height: 50rpx;
|
|
@@ -811,7 +984,8 @@
|
|
margin-top: -30rpx;
|
|
margin-top: -30rpx;
|
|
margin-bottom: -10rpx;
|
|
margin-bottom: -10rpx;
|
|
}
|
|
}
|
|
- /*二维码modal弹层*/
|
|
|
|
|
|
+
|
|
|
|
+ /*二维码modal弹层*/
|
|
.tui-poster__box {
|
|
.tui-poster__box {
|
|
width: 100%;
|
|
width: 100%;
|
|
position: relative;
|
|
position: relative;
|
|
@@ -820,7 +994,7 @@
|
|
align-items: center;
|
|
align-items: center;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
.tui-close__img {
|
|
.tui-close__img {
|
|
width: 48rpx;
|
|
width: 48rpx;
|
|
height: 48rpx;
|
|
height: 48rpx;
|
|
@@ -828,14 +1002,14 @@
|
|
right: 0;
|
|
right: 0;
|
|
top: -60rpx;
|
|
top: -60rpx;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
.tui-poster__img {
|
|
.tui-poster__img {
|
|
width: 560rpx;
|
|
width: 560rpx;
|
|
height: 560rpx;
|
|
height: 560rpx;
|
|
border-radius: 20rpx;
|
|
border-radius: 20rpx;
|
|
margin-bottom: 40rpx;
|
|
margin-bottom: 40rpx;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
.tui-share__tips {
|
|
.tui-share__tips {
|
|
font-size: 24rpx;
|
|
font-size: 24rpx;
|
|
transform: scale(0.8);
|
|
transform: scale(0.8);
|
|
@@ -843,4 +1017,212 @@
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
padding-top: 12rpx;
|
|
padding-top: 12rpx;
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+
|
|
|
|
+ /* 左侧导航布局 start*/
|
|
|
|
+
|
|
|
|
+ /* 隐藏scroll-view滚动条*/
|
|
|
|
+
|
|
|
|
+ ::-webkit-scrollbar {
|
|
|
|
+ width: 0;
|
|
|
|
+ height: 0;
|
|
|
|
+ color: transparent;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tui-searchbox {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 92rpx;
|
|
|
|
+ padding: 0 30rpx;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ background: #fff;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ position: fixed;
|
|
|
|
+ left: 0;
|
|
|
|
+ top: 0;
|
|
|
|
+ z-index: 100;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tui-searchbox::after {
|
|
|
|
+ content: '';
|
|
|
|
+ position: absolute;
|
|
|
|
+ border-bottom: 1rpx solid #d2d2d2;
|
|
|
|
+ -webkit-transform: scaleY(0.5);
|
|
|
|
+ transform: scaleY(0.5);
|
|
|
|
+ bottom: 0;
|
|
|
|
+ right: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tui-search-input {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 60rpx;
|
|
|
|
+ background: #f1f1f1;
|
|
|
|
+ border-radius: 30rpx;
|
|
|
|
+ font-size: 26rpx;
|
|
|
|
+ color: #999;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tui-search-text {
|
|
|
|
+ padding-left: 16rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tab-view {
|
|
|
|
+ /* height: 100%; */
|
|
|
|
+ background: #f6f6f6;
|
|
|
|
+ width: 200rpx;
|
|
|
|
+ position: fixed;
|
|
|
|
+ left: 0;
|
|
|
|
+ z-index: 10;
|
|
|
|
+ padding-bottom: 100rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tab-bar-item {
|
|
|
|
+ width: 200rpx;
|
|
|
|
+ height: 110rpx;
|
|
|
|
+ background: #f6f6f6;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ font-size: 26rpx;
|
|
|
|
+ color: #444;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .active {
|
|
|
|
+ position: relative;
|
|
|
|
+ color: #000;
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ background: #fcfcfc;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .active::before {
|
|
|
|
+ content: '';
|
|
|
|
+ position: absolute;
|
|
|
|
+ border-left: 8rpx solid #e41f19;
|
|
|
|
+ height: 30rpx;
|
|
|
|
+ left: 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* 左侧导航布局 end*/
|
|
|
|
+
|
|
|
|
+ .right-box {
|
|
|
|
+ width: 100%;
|
|
|
|
+ position: fixed;
|
|
|
|
+ padding-left: 220rpx;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ left: 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .page-view {
|
|
|
|
+ width: 100%;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ padding-top: 20rpx;
|
|
|
|
+ padding-right: 20rpx;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding-bottom: env(safe-area-inset-bottom);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .class-box {
|
|
|
|
+ padding-top: 10rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .class-item {
|
|
|
|
+ background: #fff;
|
|
|
|
+ width: 100%;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding: 20rpx;
|
|
|
|
+ margin-bottom: 20rpx;
|
|
|
|
+ border-radius: 12rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .class-name {
|
|
|
|
+ font-size: 26rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .g-container {
|
|
|
|
+ /* padding-top: 20rpx; */
|
|
|
|
+ display: flex;
|
|
|
|
+ display: -webkit-flex;
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .g-box {
|
|
|
|
+ width: 48%;
|
|
|
|
+ margin-left: 1%;
|
|
|
|
+ margin-right: 1%;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding-top: 40rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .price {
|
|
|
|
+ font-weight: normal;
|
|
|
|
+ font-size: 36rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .c-image {
|
|
|
|
+ width: 120rpx;
|
|
|
|
+ height: 120rpx;
|
|
|
|
+ border-radius: 12rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .g-image {
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .g-title {
|
|
|
|
+ font-size: 22rpx;
|
|
|
|
+ padding-right: 8rpx;
|
|
|
|
+ padding-left: 8rpx;
|
|
|
|
+ word-break: break-all;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ display: -webkit-box;
|
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .goods-item {
|
|
|
|
+ width: 96%;
|
|
|
|
+ height: 150rpx;
|
|
|
|
+ display: flex;
|
|
|
|
+ padding-left: 5px;
|
|
|
|
+ padding-right: 5px;
|
|
|
|
+ padding-top: 12px;
|
|
|
|
+ padding-bottom: 12px;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ margin-left: 20rpx;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
+ border-bottom: 1rpx dotted #f2f2f2;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .goods-pic {
|
|
|
|
+ width: 80px;
|
|
|
|
+ height: 80px;
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .goods-info {
|
|
|
|
+ display: flex;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ padding: 6px 5px 0px 5px;
|
|
|
|
+ height: 70px;
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .fill-last {
|
|
|
|
+ height: 0;
|
|
|
|
+ width: 100%;
|
|
|
|
+ background: none;
|
|
|
|
+ }
|
|
|
|
+</style>
|