Compare commits
12 Commits
master
...
pre-releas
Author | SHA1 | Date | |
---|---|---|---|
![]() |
991f55a47d | ||
![]() |
011fcbc2e4 | ||
![]() |
50409cd8c4 | ||
![]() |
b0ccfc9f29 | ||
6478239fc2 | |||
![]() |
df16e85df9 | ||
![]() |
50787f1df9 | ||
![]() |
fb98086acd | ||
![]() |
728f3c0611 | ||
![]() |
1669b9be74 | ||
![]() |
a3c032b3e4 | ||
![]() |
86df2a2950 |
@ -64,27 +64,36 @@
|
|||||||
|
|
||||||
<!-- tab导航 -->
|
<!-- tab导航 -->
|
||||||
<view class="tabs" v-if="showTab" :style="{top:'calc(98rpx + var(--status-bar-height))'}">
|
<view class="tabs" v-if="showTab" :style="{top:'calc(98rpx + var(--status-bar-height))'}">
|
||||||
|
<view class="tabs-wrap">
|
||||||
<block v-for="(item,indx) in tabsArr" :key="indx">
|
<block v-for="(item,indx) in tabsArr" :key="indx">
|
||||||
<view v-if="indx>0" style="width: 3rpx;height: 36rpx;background-color: #ccc;"></view>
|
<view v-if="indx>0" style="width: 3rpx;height: 36rpx;background-color: #ccc;"></view>
|
||||||
<view :class="{'tabs-item-active':item.val==currTabs}" class="tabs-item" @click="changeTab(item.val)">
|
<view :class="{'tabs-item-active':item.val==currTabs}" class="tabs-item"
|
||||||
|
@click="changeTab(item.val)">
|
||||||
<view class="tabs-item-main">{{item.name}}</view>
|
<view class="tabs-item-main">{{item.name}}</view>
|
||||||
<view class="tabs-item-sub">{{item.desc}}</view>
|
<view class="tabs-item-sub">{{item.desc}}</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="loadingicon acea-row row-center-wrapper tabs-loading"
|
||||||
<view class='recommendList' :class="indexP?'on':''">
|
:style="{height:((!hostProduct || hostProduct.length == 0 || loading) && isShow)?'80rpx':'0rpx'}"
|
||||||
<view class="loadingicon acea-row row-center-wrapper"
|
|
||||||
v-if="!hostProduct || hostProduct.length == 0 || loading">
|
v-if="!hostProduct || hostProduct.length == 0 || loading">
|
||||||
<text class="loading iconfont icon-jiazai loading-flex"></text>
|
<text class="loading iconfont icon-jiazai loading-flex"></text>
|
||||||
{{ hotTitle }}
|
{{ hotTitle }}
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class='recommendList' :class="indexP?'on':''">
|
||||||
|
<!-- <view class="loadingicon acea-row row-center-wrapper"
|
||||||
|
v-if="!hostProduct || hostProduct.length == 0 || loading">
|
||||||
|
<text class="loading iconfont icon-jiazai loading-flex"></text>
|
||||||
|
{{ hotTitle }}
|
||||||
|
</view> -->
|
||||||
<WaterfallsFlow v-if="hostProduct.length>0" :wfList='hostProduct' @itemTap="goDetail" :type="0"
|
<WaterfallsFlow v-if="hostProduct.length>0" :wfList='hostProduct' @itemTap="goDetail" :type="0"
|
||||||
:sale_type="sale_type" />
|
:sale_type="sale_type" />
|
||||||
<view class='pictrue' v-if="!loading && hostProduct.length==0">
|
<!-- <view class='pictrue' v-if="!loading && hostProduct.length==0">
|
||||||
<image :src="`${domain}/static/images/noCart.png`"></image>
|
<image :src="`${domain}/static/images/noCart.png`"></image>
|
||||||
<view>暂无商品,看点别的吧</view>
|
<view>暂无商品,看点别的吧</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -171,11 +180,22 @@
|
|||||||
}],
|
}],
|
||||||
currTabs: 1,
|
currTabs: 1,
|
||||||
list: [],
|
list: [],
|
||||||
tabsTop: ''
|
tabsTop: '',
|
||||||
|
isShow: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getArticleList();
|
this.getArticleList();
|
||||||
|
uni.$on('scroll', res => {
|
||||||
|
|
||||||
|
uni.$u.debounce(() => {
|
||||||
|
if (res && res.scrollTop > this.tabsTop) {
|
||||||
|
this.isShow = false;
|
||||||
|
} else {
|
||||||
|
this.isShow = true;
|
||||||
|
}
|
||||||
|
}, 500)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -197,18 +217,19 @@
|
|||||||
limit: 10
|
limit: 10
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.list = res.data.list;
|
this.list = res.data.list;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.getDom(this, '.tabs', res => {
|
this.$util.getDom(this, '.tabs', res => {
|
||||||
|
console.log(res.top);
|
||||||
|
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
this.tabsTop = res.top + 10;
|
this.tabsTop = res.top;
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
this.tabsTop = res.top;
|
this.tabsTop = res.top;
|
||||||
// #endif
|
// #endif
|
||||||
})
|
})
|
||||||
}, 300)
|
}, 1000)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goDetail(item) {
|
goDetail(item) {
|
||||||
@ -236,6 +257,11 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.topLoading {
|
||||||
|
position: sticky;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
.common-hd {
|
.common-hd {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -306,13 +332,19 @@
|
|||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 900;
|
z-index: 900;
|
||||||
background: #fff;
|
margin: 0 -20rpx 10rpx;
|
||||||
padding-bottom: 20rpx;
|
|
||||||
|
.tabs-wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 0 -20rpx 10rpx;
|
height: 110rpx;
|
||||||
padding-top: 20rpx;
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs-loading {
|
||||||
|
height: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.tabs-item {
|
.tabs-item {
|
||||||
width: 23%;
|
width: 23%;
|
||||||
@ -350,7 +382,6 @@
|
|||||||
|
|
||||||
.recommend .recommendList {
|
.recommend .recommendList {
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
min-height: 100rpx;
|
|
||||||
min-height: calc(100vh - 82rpx - var(--status-bar-height));
|
min-height: calc(100vh - 82rpx - var(--status-bar-height));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,8 +16,8 @@ let openPlantGrass = '-openPlantGrass-'
|
|||||||
let httpSix, httpApi;
|
let httpSix, httpApi;
|
||||||
|
|
||||||
// const env = 'dev'; // 开发
|
// const env = 'dev'; // 开发
|
||||||
// const env = 'prod'; // 生产
|
const env = 'prod'; // 生产
|
||||||
const env = 'prew'; // 预上线
|
// const env = 'prew'; // 预上线
|
||||||
|
|
||||||
switch (env) {
|
switch (env) {
|
||||||
case 'prod':
|
case 'prod':
|
||||||
@ -77,4 +77,5 @@ module.exports = {
|
|||||||
TOKENNAME: 'X-Token',
|
TOKENNAME: 'X-Token',
|
||||||
// 缓存时间 0 永久
|
// 缓存时间 0 永久
|
||||||
EXPIRE: 0,
|
EXPIRE: 0,
|
||||||
|
AUTH_EXPIRE_TIME: 20 * 1000 //秒
|
||||||
};
|
};
|
@ -2,8 +2,8 @@
|
|||||||
"name" : "惠农生活",
|
"name" : "惠农生活",
|
||||||
"appid" : "__UNI__3A527D1",
|
"appid" : "__UNI__3A527D1",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName": "2.0.53",
|
"versionName" : "2.0.26",
|
||||||
"versionCode": 2053,
|
"versionCode" : 2026,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
}, {
|
}, {
|
||||||
"path": "pages/whole_sale/index",
|
"path": "pages/whole_sale/index",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationBarTitleText": "批发",
|
"navigationBarTitleText": "批发",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
@ -388,14 +388,14 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "里海云仓",
|
"navigationBarTitleText": "里海云仓",
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "market/market",
|
"path": "market/market",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "供销云市场",
|
"navigationBarTitleText": "供销云市场",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -403,7 +403,7 @@
|
|||||||
"path": "specialty/specialty",
|
"path": "specialty/specialty",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "名优特产",
|
"navigationBarTitleText": "名优特产",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="broadcast_details_picBox_no noPad">
|
<div class="broadcast_details_picBox_no noPad">
|
||||||
<div class="broadcast_details_pic">
|
<div class="broadcast_details_pic">
|
||||||
¥{{ item.product.price }}
|
¥{{ saleType == 1? item.product.price :item.product.wholesale_price}}
|
||||||
</div>
|
</div>
|
||||||
<div class="broadcast_details_tit_no line1">
|
<div class="broadcast_details_tit_no line1">
|
||||||
{{item.product.store_name}}
|
{{item.product.store_name}}
|
||||||
@ -271,7 +271,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="broadcast_details_picBox_no noPad">
|
<div class="broadcast_details_picBox_no noPad">
|
||||||
<div class="broadcast_details_pic">
|
<div class="broadcast_details_pic">
|
||||||
¥{{ item.product.price }}
|
¥{{ saleType == 1? item.product.price :item.product.wholesale_price}}
|
||||||
</div>
|
</div>
|
||||||
<div class="broadcast_details_tit_no line1">
|
<div class="broadcast_details_tit_no line1">
|
||||||
{{item.product.store_name}}
|
{{item.product.store_name}}
|
||||||
@ -459,7 +459,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="broadcast_details_picBox_no noPad">
|
<div class="broadcast_details_picBox_no noPad">
|
||||||
<div class="broadcast_details_pic">
|
<div class="broadcast_details_pic">
|
||||||
¥{{ item.product.price }}
|
¥{{ saleType == 1? item.product.price :item.product.wholesale_price}}
|
||||||
</div>
|
</div>
|
||||||
<div class="broadcast_details_tit_no line1">
|
<div class="broadcast_details_tit_no line1">
|
||||||
{{item.product.store_name}}
|
{{item.product.store_name}}
|
||||||
@ -612,7 +612,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="broadcast_details_picBox_no noPad">
|
<div class="broadcast_details_picBox_no noPad">
|
||||||
<div class="broadcast_details_pic">
|
<div class="broadcast_details_pic">
|
||||||
¥{{ item.product.price }}
|
¥{{ saleType == 1? item.product.price :item.product.wholesale_price}}
|
||||||
</div>
|
</div>
|
||||||
<div class="broadcast_details_tit_no line1">
|
<div class="broadcast_details_tit_no line1">
|
||||||
{{item.product.store_name}}
|
{{item.product.store_name}}
|
||||||
@ -718,7 +718,7 @@
|
|||||||
<div class="broadcast_details_tit">{{productInfo.store_name}}</div>
|
<div class="broadcast_details_tit">{{productInfo.store_name}}</div>
|
||||||
<div class="acea-row row-between product_price">
|
<div class="acea-row row-between product_price">
|
||||||
<div class="broadcast_details_pic p-color">
|
<div class="broadcast_details_pic p-color">
|
||||||
¥{{ productInfo.price}}
|
¥{{ saleType == 1 ? productInfo.price :productInfo.wholesale_price}}
|
||||||
</div>
|
</div>
|
||||||
<div class="broadcast_details_btn product_btn" @click="sendProduct">发送商品</div>
|
<div class="broadcast_details_btn product_btn" @click="sendProduct">发送商品</div>
|
||||||
</div>
|
</div>
|
||||||
@ -957,7 +957,8 @@
|
|||||||
httpUrl: '',
|
httpUrl: '',
|
||||||
press: false,
|
press: false,
|
||||||
index: 0,
|
index: 0,
|
||||||
j: 0
|
j: 0,
|
||||||
|
saleType: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -983,8 +984,9 @@
|
|||||||
this.combinationId = parseInt(option.combinationId) || 0;
|
this.combinationId = parseInt(option.combinationId) || 0;
|
||||||
this.orderId = option.order_id || ""
|
this.orderId = option.order_id || ""
|
||||||
this.mer_id = option.mer_id || 0
|
this.mer_id = option.mer_id || 0
|
||||||
this.refund_order_id = option.refund_order_id || 0
|
this.refund_order_id = option.refund_order_id || 0;
|
||||||
this.userId = option.userId || 0
|
this.userId = option.userId || 0;
|
||||||
|
this.saleType = option.sale_type || '';
|
||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
self.windowH = res.windowHeight
|
self.windowH = res.windowHeight
|
||||||
@ -1006,6 +1008,10 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
var isWholeSale = this.$store.state.app.userInfo?.mer_info?.wholesale
|
||||||
|
console.log(isWholeSale);
|
||||||
|
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
this.httpUrl = `${HTTP_REQUEST_URL}/static/look.png`;
|
this.httpUrl = `${HTTP_REQUEST_URL}/static/look.png`;
|
||||||
@ -1452,7 +1458,8 @@
|
|||||||
sendProduct() {
|
sendProduct() {
|
||||||
consultApi({
|
consultApi({
|
||||||
user_id: this.toUid,
|
user_id: this.toUid,
|
||||||
product_id: this.productId
|
product_id: this.productId,
|
||||||
|
sale_type: this.saleType
|
||||||
})
|
})
|
||||||
if (this.presellId || this.combinationId) {
|
if (this.presellId || this.combinationId) {
|
||||||
if (this.presellId) {
|
if (this.presellId) {
|
||||||
|
@ -1,3 +1,292 @@
|
|||||||
|
<template>
|
||||||
|
<view class="wholeSale" @touchstart="onTouchStart" @touchmove="onTouchMove">
|
||||||
|
<!-- 顶部 -->
|
||||||
|
<view class="wholeSale-header">
|
||||||
|
<!-- 适配不同机 -->
|
||||||
|
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
|
||||||
|
<view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;">
|
||||||
|
<view style="display: flex;font-weight: bold;font-size: 32rpx;"><u-icon style="margin-right: 20rpx;"
|
||||||
|
name="arrow-left" size="20" color="#fff" @click="navBack"></u-icon>里海云仓</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view :style="{height:'calc(' +wrapHeight+ 'rpx + 92rpx + var(--status-bar-height))'}"></view>
|
||||||
|
|
||||||
|
<!-- 分类区域 -->
|
||||||
|
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
|
||||||
|
<view class="wholeSale-nav">
|
||||||
|
<view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}`)"
|
||||||
|
hover-class="none" class="search_content flex_a_c_j_sb">
|
||||||
|
<view class="flex_a_c search_content_wrap">
|
||||||
|
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
|
||||||
|
<input type="text" placeholder="搜索商品名称" :value="where.keyword"
|
||||||
|
placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品大分类 -->
|
||||||
|
<view class="category">
|
||||||
|
<scroll-view scroll-x="true" :scroll-into-view="scrollIndex">
|
||||||
|
<view class="category-wrap">
|
||||||
|
<block v-for="(item,index) in store_category" :key="index">
|
||||||
|
<view class="category-item" :id="'scroll' + index"
|
||||||
|
:class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
|
||||||
|
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx"
|
||||||
|
shape="circle">
|
||||||
|
<template v-slot:loading>
|
||||||
|
<u-loading-icon color="#999" size="15" />
|
||||||
|
</template>
|
||||||
|
</u--image>
|
||||||
|
<text class="category-item-text">{{item.cate_name}}</text>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
<view class="category-all" v-if="store_category.length > 0" @click="onAllCategory">
|
||||||
|
<view style="margin-bottom: 10rpx;">全部</view>
|
||||||
|
<u-icon name="list"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品小分类 -->
|
||||||
|
<view class="cate" v-if="store_category_children.length>1">
|
||||||
|
<scroll-view scroll-x="true">
|
||||||
|
<view class="cate-wrap">
|
||||||
|
<block v-for="(item,index) in store_category_children" :key="index">
|
||||||
|
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}"
|
||||||
|
@click="changeChildrenCate(index)">
|
||||||
|
<text>{{item.cate_name}}</text>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 内容 -->
|
||||||
|
<view class="wholeSale-con">
|
||||||
|
<!-- 流水瀑布 -->
|
||||||
|
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
|
||||||
|
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 弹框大分类 -->
|
||||||
|
<uni-popup ref="popup" type="top" border-radius="10px 10px 0 0" z-index="1000">
|
||||||
|
<view class="popup-wrap">
|
||||||
|
<view style="height: var(--status-bar-height);"></view>
|
||||||
|
<view class="popup-wrap-title">分类</view>
|
||||||
|
<view class="popup-wrap-category">
|
||||||
|
<view class="popup-wrap-category-wrap">
|
||||||
|
<block v-for="(item,index) in store_category" :key="index">
|
||||||
|
<view class="popup-wrap-category-item"
|
||||||
|
:class="{'popup-wrap-category-item-active': index==cate_change}"
|
||||||
|
@click="changeCate(index)">
|
||||||
|
<u--image class="popup-wrap-category-item-img" width="108rpx" :src="item.pic"
|
||||||
|
height="108rpx" shape="circle">
|
||||||
|
<template v-slot:loading>
|
||||||
|
<u-loading-icon color="#999" size="15" />
|
||||||
|
</template>
|
||||||
|
</u--image>
|
||||||
|
<text class="popup-wrap-category-item-text">{{item.cate_name}}</text>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
goShopDetail
|
||||||
|
} from '@/libs/order.js'
|
||||||
|
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
|
||||||
|
import {
|
||||||
|
getStoreCategory,
|
||||||
|
getProductslist
|
||||||
|
} from "@/api/store.js"
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
WaterfallsFlow
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
hostProduct: [],
|
||||||
|
store_category: [], //商品大分类
|
||||||
|
store_category_children: [], //商品小分类
|
||||||
|
cate_change: 0,
|
||||||
|
cate_change_children: 0,
|
||||||
|
isLoading: 0,
|
||||||
|
isScroll: false,
|
||||||
|
where: {
|
||||||
|
page: 1,
|
||||||
|
limit: 20,
|
||||||
|
mer_type: 1, //1-里海云仓, 2-云市场, 3-名优特产
|
||||||
|
cate_pid: '',
|
||||||
|
keyword: '',
|
||||||
|
deduction_rate: '', //抵扣比例
|
||||||
|
rand: 1
|
||||||
|
},
|
||||||
|
wrapHeight: 300,
|
||||||
|
touchstarty: 0,
|
||||||
|
scrollIndex: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.getStoreCategory();
|
||||||
|
this.getProductslist(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
onPageScroll() {
|
||||||
|
uni.$emit('scroll');
|
||||||
|
},
|
||||||
|
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.getProductslist(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
onReachBottom() {
|
||||||
|
this.getProductslist();
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
// 开始滑动
|
||||||
|
onTouchStart(e) {
|
||||||
|
this.touchstarty = e.touches[0].clientY;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 开始移动
|
||||||
|
onTouchMove(e) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
let deltaY = e.changedTouches[0].clientY - this.touchstarty;
|
||||||
|
if (deltaY <= 0) {
|
||||||
|
console.log("上滑")
|
||||||
|
this.wrapHeight = 0;
|
||||||
|
} else {
|
||||||
|
console.log('下滑');
|
||||||
|
if (this.where.cate_pid) this.wrapHeight = 360;
|
||||||
|
else this.wrapHeight = 300;
|
||||||
|
}
|
||||||
|
this.$forceUpdate();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onAllCategory() {
|
||||||
|
this.$refs.popup.open();
|
||||||
|
},
|
||||||
|
|
||||||
|
navTo(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: url,
|
||||||
|
success: () => {
|
||||||
|
uni.$once('searchValue', (e) => {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.where.keyword = e;
|
||||||
|
this.getProductslist(true);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
changeCate(e) {
|
||||||
|
this.cate_change = e;
|
||||||
|
this.store_category_children = [];
|
||||||
|
if (this.store_category[e].children) this.store_category_children = [...this.store_category[e].children];
|
||||||
|
this.store_category_children.unshift({
|
||||||
|
cate_name: '全部',
|
||||||
|
store_category_id: ''
|
||||||
|
})
|
||||||
|
this.cate_change_children = 0;
|
||||||
|
this.where.cate_pid = this.store_category[e].store_category_id;
|
||||||
|
this.getProductslist(true);
|
||||||
|
|
||||||
|
if (this.where.cate_pid) this.wrapHeight = 360;
|
||||||
|
else this.wrapHeight = 300;
|
||||||
|
|
||||||
|
// scrollView 滚动到对应选择的分类
|
||||||
|
this.scrollIndex = 'scroll' + e;
|
||||||
|
|
||||||
|
this.$refs.popup && this.$refs.popup.close();
|
||||||
|
},
|
||||||
|
|
||||||
|
changeChildrenCate(e) {
|
||||||
|
this.cate_change_children = e;
|
||||||
|
this.where.cate_pid = this.store_category_children[e].store_category_id;
|
||||||
|
if (e == 0) this.where.cate_pid = this.store_category[this.cate_change]
|
||||||
|
.store_category_id; // 如若选中全部, 则取父级id
|
||||||
|
this.getProductslist(true);
|
||||||
|
},
|
||||||
|
getStoreCategory() {
|
||||||
|
getStoreCategory(259).then(res => {
|
||||||
|
this.store_category = [{
|
||||||
|
cate_name: '全部',
|
||||||
|
pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0bc7a202404021652194310.png',
|
||||||
|
store_category_id: ''
|
||||||
|
}, ...res.data];
|
||||||
|
this.store_category_children = this.store_category[0].children || [];
|
||||||
|
this.store_category_children.unshift({
|
||||||
|
cate_name: '全部',
|
||||||
|
store_category_id: ''
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getProductslist(reLoad = false) {
|
||||||
|
if (reLoad) {
|
||||||
|
this.where.page = 1;
|
||||||
|
this.hostProduct = [];
|
||||||
|
this.isLoading = 0;
|
||||||
|
}
|
||||||
|
if (this.isLoading == -1) return;
|
||||||
|
|
||||||
|
this.isLoading = 1;
|
||||||
|
getProductslist(this.where).then(res => {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
this.where.limit = res.data.limit
|
||||||
|
this.where.page = res.data.page
|
||||||
|
this.hostProduct = [...this.hostProduct, ...res.data.list];
|
||||||
|
this.isLoading = 0;
|
||||||
|
if (res.data.list.length < this.where.limit) {
|
||||||
|
this.isLoading = -1;
|
||||||
|
}
|
||||||
|
this.where.page++;
|
||||||
|
}).catch(err => {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
goDetail(item) {
|
||||||
|
goShopDetail(item, this.uid).then(res => {
|
||||||
|
if (this.isLogin) {
|
||||||
|
initiateAssistApi(item.activity_id).then(res => {
|
||||||
|
let id = res.data.product_assist_set_id;
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/activity/assist_detail/index?id=' + id
|
||||||
|
});
|
||||||
|
}).catch((err) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
toLogin();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
navBack() {
|
||||||
|
uni.navigateBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
page {
|
page {
|
||||||
background-color: #f8fafb !important;
|
background-color: #f8fafb !important;
|
||||||
@ -7,26 +296,28 @@
|
|||||||
background-color: #f8fafb !important;
|
background-color: #f8fafb !important;
|
||||||
|
|
||||||
.wholeSale-header {
|
.wholeSale-header {
|
||||||
position: sticky;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 9;
|
z-index: 98;
|
||||||
|
width: 100%;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
background-color: #40AE36;
|
background-color: #40AE36;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wholeSale-section {
|
.wholeSale-section {
|
||||||
position: sticky;
|
position: fixed;
|
||||||
top: calc(82rpx + var(--status-bar-height));
|
z-index: 97;
|
||||||
|
width: 100%;
|
||||||
|
top: calc(80rpx + var(--status-bar-height));
|
||||||
padding: 0rpx 20rpx;
|
padding: 0rpx 20rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
transition: height .5s;
|
transition: height .5s;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-bottom: 20rpx;
|
|
||||||
|
|
||||||
.wholeSale-nav {
|
.wholeSale-nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding-bottom: 20rpx;
|
padding: 20rpx 0;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
@ -124,17 +415,16 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
height: 100%;
|
height: 101%;
|
||||||
background-color: #f3f3f3;
|
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 4rpx;
|
|
||||||
width: 70rpx;
|
width: 70rpx;
|
||||||
color: #919191;
|
color: #919191;
|
||||||
|
box-shadow: 0px 0px 60rpx #c5c5c5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,293 +528,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<template>
|
|
||||||
<view class="wholeSale">
|
|
||||||
<!-- 顶部 -->
|
|
||||||
<view class="wholeSale-header">
|
|
||||||
<!-- 适配不同机 -->
|
|
||||||
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
|
|
||||||
<view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;">
|
|
||||||
<view style="display: flex;font-weight: bold;font-size: 32rpx;"><u-icon style="margin-right: 20rpx;"
|
|
||||||
name="arrow-left" size="20" color="#fff" @click="navBack"></u-icon>里海云仓</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 分类区域 -->
|
|
||||||
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
|
|
||||||
<view class="wholeSale-nav">
|
|
||||||
<view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}`)"
|
|
||||||
hover-class="none" class="search_content flex_a_c_j_sb">
|
|
||||||
<view class="flex_a_c search_content_wrap">
|
|
||||||
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
|
|
||||||
<input type="text" placeholder="搜索商品名称" :value="where.keyword"
|
|
||||||
placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 商品大分类 -->
|
|
||||||
<view class="category">
|
|
||||||
<scroll-view scroll-x="true">
|
|
||||||
<view class="category-wrap">
|
|
||||||
<block v-for="(item,index) in store_category" :key="index">
|
|
||||||
<view class="category-item" :class="{'category-item-active': index==cate_change}"
|
|
||||||
@click="changeCate(index)">
|
|
||||||
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx"
|
|
||||||
shape="circle">
|
|
||||||
<template v-slot:loading>
|
|
||||||
<u-loading-icon color="#999" size="15" />
|
|
||||||
</template>
|
|
||||||
</u--image>
|
|
||||||
<text class="category-item-text">{{item.cate_name}}</text>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
|
|
||||||
<view class="category-all" v-if="store_category.length > 0" @click="onAllCategory">
|
|
||||||
<view style="margin-bottom: 20rpx;">全部</view>
|
|
||||||
<u-icon name="list"></u-icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 商品小分类 -->
|
|
||||||
<view class="cate" v-if="store_category_children.length>1">
|
|
||||||
<scroll-view scroll-x="true">
|
|
||||||
<view class="cate-wrap">
|
|
||||||
<block v-for="(item,index) in store_category_children" :key="index">
|
|
||||||
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}"
|
|
||||||
@click="changeChildrenCate(index)">
|
|
||||||
<text>{{item.cate_name}}</text>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 内容 -->
|
|
||||||
<view class="wholeSale-con"
|
|
||||||
:style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx '+(isShowSmall?' - 48rpx':'')+')'}">
|
|
||||||
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
|
|
||||||
:refresher-enabled="true" :refresher-triggered="isTriggered" @refresherpulling="onPulling"
|
|
||||||
@refresherrefresh="onRefresh" :refresher-threshold="45" :scroll-anchoring='true'>
|
|
||||||
<view>
|
|
||||||
<!-- 流水瀑布 -->
|
|
||||||
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
|
|
||||||
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 弹框大分类 -->
|
|
||||||
<uni-popup ref="popup" type="top" border-radius="10px 10px 0 0" z-index="1000">
|
|
||||||
<view class="popup-wrap">
|
|
||||||
<view style="height: var(--status-bar-height);"></view>
|
|
||||||
<view class="popup-wrap-title">分类</view>
|
|
||||||
<view class="popup-wrap-category">
|
|
||||||
<view class="popup-wrap-category-wrap">
|
|
||||||
<block v-for="(item,index) in store_category" :key="index">
|
|
||||||
<view class="popup-wrap-category-item" :class="{'category-item-active': index==cate_change}"
|
|
||||||
@click="changeCate(index)">
|
|
||||||
<u--image class="popup-wrap-category-item-img" width="108rpx" :src="item.pic"
|
|
||||||
height="108rpx" shape="circle">
|
|
||||||
<template v-slot:loading>
|
|
||||||
<u-loading-icon color="#999" size="15" />
|
|
||||||
</template>
|
|
||||||
</u--image>
|
|
||||||
<text class="popup-wrap-category-item-text">{{item.cate_name}}</text>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</uni-popup>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
goShopDetail
|
|
||||||
} from '@/libs/order.js'
|
|
||||||
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
|
|
||||||
import {
|
|
||||||
getStoreCategory,
|
|
||||||
getProductslist
|
|
||||||
} from "@/api/store.js"
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
WaterfallsFlow
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
hostProduct: [],
|
|
||||||
store_category: [], //商品大分类
|
|
||||||
store_category_children: [], //商品小分类
|
|
||||||
cate_change: 0,
|
|
||||||
cate_change_children: 0,
|
|
||||||
isLoading: 0,
|
|
||||||
where: {
|
|
||||||
page: 1,
|
|
||||||
limit: 20,
|
|
||||||
mer_type: 1, //1-里海云仓, 2-云市场, 3-名优特产
|
|
||||||
cate_pid: '',
|
|
||||||
keyword: '',
|
|
||||||
deduction_rate: '', //抵扣比例
|
|
||||||
rand: 1
|
|
||||||
},
|
|
||||||
wrapHeight: 300,
|
|
||||||
isShowSmall: false,
|
|
||||||
scrollTop: 0,
|
|
||||||
isTriggered: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(option) {
|
|
||||||
this.getStoreCategory();
|
|
||||||
this.getProductslist(true);
|
|
||||||
},
|
|
||||||
|
|
||||||
onPageScroll(e) {
|
|
||||||
uni.$emit('scroll');
|
|
||||||
},
|
|
||||||
|
|
||||||
watch: {
|
|
||||||
'where.cate_pid'(newVal, oldVal) {
|
|
||||||
if (newVal && !oldVal) {
|
|
||||||
this.wrapHeight = 300 + 48;
|
|
||||||
this.isShowSmall = true;
|
|
||||||
}
|
|
||||||
if (!newVal && oldVal) {
|
|
||||||
this.wrapHeight = 300;
|
|
||||||
this.isShowSmall = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 下拉加载
|
|
||||||
onPulling() {
|
|
||||||
if (!this.isTriggered) {
|
|
||||||
this.isTriggered = true;
|
|
||||||
this.getProductslist(true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onRefresh(e) {
|
|
||||||
this.isTriggered = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
onScrollBottom(e) {
|
|
||||||
this.getProductslist();
|
|
||||||
},
|
|
||||||
|
|
||||||
onAllCategory() {
|
|
||||||
this.$refs.popup.open();
|
|
||||||
},
|
|
||||||
|
|
||||||
onScroll(e) {
|
|
||||||
if (this.scrollTop > e.target.scrollTop) { //上拉
|
|
||||||
this.wrapHeight = 300;
|
|
||||||
if (this.where.cate_pid) this.wrapHeight = this.wrapHeight + 48;
|
|
||||||
} else {
|
|
||||||
this.wrapHeight = 0;
|
|
||||||
}
|
|
||||||
this.scrollTop = e.target.scrollTop;
|
|
||||||
},
|
|
||||||
|
|
||||||
navTo(url) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: url,
|
|
||||||
success: () => {
|
|
||||||
uni.$once('searchValue', (e) => {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.where.keyword = e;
|
|
||||||
this.getProductslist(true);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
navBack() {
|
|
||||||
uni.navigateBack();
|
|
||||||
},
|
|
||||||
|
|
||||||
changeCate(e) {
|
|
||||||
this.cate_change = e;
|
|
||||||
this.store_category_children = [];
|
|
||||||
if (this.store_category[e].children) this.store_category_children = [...this.store_category[e].children];
|
|
||||||
this.store_category_children.unshift({
|
|
||||||
cate_name: '全部',
|
|
||||||
store_category_id: ''
|
|
||||||
})
|
|
||||||
this.cate_change_children = 0;
|
|
||||||
this.where.cate_pid = this.store_category[e].store_category_id;
|
|
||||||
this.getProductslist(true);
|
|
||||||
|
|
||||||
this.$refs.popup && this.$refs.popup.close();
|
|
||||||
},
|
|
||||||
|
|
||||||
changeChildrenCate(e) {
|
|
||||||
this.cate_change_children = e;
|
|
||||||
this.where.cate_pid = this.store_category_children[e].store_category_id;
|
|
||||||
if (e == 0) this.where.cate_pid = this.store_category[this.cate_change]
|
|
||||||
.store_category_id; // 如若选中全部, 则取父级id
|
|
||||||
this.getProductslist(true);
|
|
||||||
},
|
|
||||||
getStoreCategory() {
|
|
||||||
getStoreCategory(259).then(res => {
|
|
||||||
this.store_category = [{
|
|
||||||
cate_name: '全部',
|
|
||||||
pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0bc7a202404021652194310.png',
|
|
||||||
store_category_id: ''
|
|
||||||
}, ...res.data];
|
|
||||||
this.store_category_children = this.store_category[0].children || [];
|
|
||||||
this.store_category_children.unshift({
|
|
||||||
cate_name: '全部',
|
|
||||||
store_category_id: ''
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getProductslist(reLoad = false) {
|
|
||||||
if (reLoad) {
|
|
||||||
this.where.page = 1;
|
|
||||||
this.hostProduct = [];
|
|
||||||
this.isLoading = 0;
|
|
||||||
}
|
|
||||||
if (this.isLoading == -1) return;
|
|
||||||
this.isLoading = 1;
|
|
||||||
|
|
||||||
getProductslist(this.where).then(res => {
|
|
||||||
this.where.limit = res.data.limit
|
|
||||||
this.where.page = res.data.page
|
|
||||||
this.isTriggered = false;
|
|
||||||
this.hostProduct = [...this.hostProduct, ...res.data.list];
|
|
||||||
this.isLoading = 0;
|
|
||||||
if (res.data.list.length < this.where.limit) this.isLoading = -1;
|
|
||||||
this.where.page++;
|
|
||||||
}).catch(err => {
|
|
||||||
this.isTriggered = false;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
goDetail(item) {
|
|
||||||
goShopDetail(item, this.uid).then(res => {
|
|
||||||
if (this.isLogin) {
|
|
||||||
initiateAssistApi(item.activity_id).then(res => {
|
|
||||||
let id = res.data.product_assist_set_id;
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/activity/assist_detail/index?id=' + id
|
|
||||||
});
|
|
||||||
}).catch((err) => {
|
|
||||||
uni.showToast({
|
|
||||||
title: err,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
toLogin();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wholeSale">
|
<view class="wholeSale" @touchstart="onTouchStart" @touchmove="onTouchMove">
|
||||||
|
|
||||||
<!-- 适配不同机 -->
|
<!-- 适配不同机 -->
|
||||||
<view class="wholeSale-header">
|
<view class="wholeSale-header">
|
||||||
@ -26,6 +26,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view :style="{height:'calc(' + wrapHeight + 'rpx + 92rpx + var(--status-bar-height))'}"></view>
|
||||||
|
|
||||||
<!-- 分类区域 -->
|
<!-- 分类区域 -->
|
||||||
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
|
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
|
||||||
<view class="wholeSale-nav">
|
<view class="wholeSale-nav">
|
||||||
@ -42,11 +44,11 @@
|
|||||||
|
|
||||||
<!-- 商品大分类 -->
|
<!-- 商品大分类 -->
|
||||||
<view class="category">
|
<view class="category">
|
||||||
<scroll-view scroll-x="true">
|
<scroll-view scroll-x="true" :scroll-into-view="scrollIndex">
|
||||||
<view class="category-wrap">
|
<view class="category-wrap">
|
||||||
<block v-for="(item,index) in store_category" :key="index">
|
<block v-for="(item,index) in store_category" :key="index">
|
||||||
<view class="category-item" :class="{'category-item-active': index==cate_change}"
|
<view class="category-item" :id="'scroll' + index"
|
||||||
@click="changeCate(index)">
|
:class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
|
||||||
<u--image class="category-item-img" width="108rpx" :src="item.background"
|
<u--image class="category-item-img" width="108rpx" :src="item.background"
|
||||||
height="108rpx" shape="circle">
|
height="108rpx" shape="circle">
|
||||||
<template v-slot:loading>
|
<template v-slot:loading>
|
||||||
@ -67,10 +69,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<view class="goods_list" :style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx)'}">
|
<view class="goods_list">
|
||||||
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
|
|
||||||
:refresher-enabled="true" :refresher-triggered="isTriggered" @refresherpulling="onPulling"
|
|
||||||
@refresherrefresh="onRefresh" :refresher-threshold="45" :scroll-anchoring='true'>
|
|
||||||
<view class="goods" v-for="(item, index) in goodsList" :key="index" @click="goStore(item.mer_id)">
|
<view class="goods" v-for="(item, index) in goodsList" :key="index" @click="goStore(item.mer_id)">
|
||||||
<view class="avatar">
|
<view class="avatar">
|
||||||
<u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill">
|
<u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill">
|
||||||
@ -82,8 +81,7 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="content-head">
|
<view class="content-head">
|
||||||
<view class="title">{{item.mer_name}}</view>
|
<view class="title">{{item.mer_name}}</view>
|
||||||
<text style="font-size: 21.03rpx;color: #aaa;"
|
<text style="font-size: 21.03rpx;color: #aaa;" v-if="item.sales>=100">月销{{item.sales}}</text>
|
||||||
v-if="item.sales>=100">月销{{item.sales}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="content-two">
|
<view class="content-two">
|
||||||
<view class="score">
|
<view class="score">
|
||||||
@ -115,7 +113,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
|
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
|
||||||
</scroll-view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 弹框大分类 -->
|
<!-- 弹框大分类 -->
|
||||||
@ -181,6 +178,7 @@
|
|||||||
cate_change: 0,
|
cate_change: 0,
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
isLoading: 0,
|
isLoading: 0,
|
||||||
|
isScroll: false,
|
||||||
isShowAddress: false,
|
isShowAddress: false,
|
||||||
street: '定位中',
|
street: '定位中',
|
||||||
where: {
|
where: {
|
||||||
@ -193,8 +191,8 @@
|
|||||||
location: ''
|
location: ''
|
||||||
},
|
},
|
||||||
wrapHeight: 300,
|
wrapHeight: 300,
|
||||||
scrollTop: 0,
|
touchstarty: 0,
|
||||||
isTriggered: false
|
scrollIndex: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -206,6 +204,19 @@
|
|||||||
hide_mer_status: '',
|
hide_mer_status: '',
|
||||||
}, mapGetters(['viewColor', 'keyColor'])),
|
}, mapGetters(['viewColor', 'keyColor'])),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onPageScroll() {
|
||||||
|
uni.$emit('scroll');
|
||||||
|
},
|
||||||
|
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.storeMerchantList(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
onReachBottom() {
|
||||||
|
this.storeMerchantList();
|
||||||
|
},
|
||||||
|
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
let getAddress = uni.getStorageSync('getAddress');
|
let getAddress = uni.getStorageSync('getAddress');
|
||||||
let closeShow = uni.getStorageSync('closeShow');
|
let closeShow = uni.getStorageSync('closeShow');
|
||||||
@ -221,39 +232,33 @@
|
|||||||
this.merClassifly();
|
this.merClassifly();
|
||||||
this.storeMerchantList();
|
this.storeMerchantList();
|
||||||
},
|
},
|
||||||
onPageScroll() {
|
|
||||||
uni.$emit('scroll');
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 下拉加载
|
|
||||||
onPulling() {
|
// 开始滑动
|
||||||
if (!this.isTriggered) {
|
onTouchStart(e) {
|
||||||
this.isTriggered = true;
|
this.touchstarty = e.touches[0].clientY;
|
||||||
this.storeMerchantList(true);
|
},
|
||||||
|
|
||||||
|
// 开始移动
|
||||||
|
onTouchMove(e) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
let deltaY = e.changedTouches[0].clientY - this.touchstarty;
|
||||||
|
if (deltaY <= 0) {
|
||||||
|
console.log("上滑")
|
||||||
|
this.wrapHeight = 0;
|
||||||
|
} else {
|
||||||
|
console.log('下滑');
|
||||||
|
this.wrapHeight = 300;
|
||||||
}
|
}
|
||||||
},
|
this.$forceUpdate();
|
||||||
|
})
|
||||||
onRefresh(e) {
|
|
||||||
this.isTriggered = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
onScrollBottom(e) {
|
|
||||||
this.storeMerchantList();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onAllCategory() {
|
onAllCategory() {
|
||||||
this.$refs.popup.open();
|
this.$refs.popup.open();
|
||||||
},
|
},
|
||||||
|
|
||||||
onScroll(e) {
|
|
||||||
if (this.scrollTop > e.target.scrollTop) { //上拉
|
|
||||||
this.wrapHeight = 300;
|
|
||||||
} else {
|
|
||||||
this.wrapHeight = 0;
|
|
||||||
}
|
|
||||||
this.scrollTop = e.target.scrollTop;
|
|
||||||
},
|
|
||||||
|
|
||||||
navTo(url) {
|
navTo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url,
|
url: url,
|
||||||
@ -276,15 +281,20 @@
|
|||||||
this.where.merchant_category_id = this.store_category[e].merchant_category_id;
|
this.where.merchant_category_id = this.store_category[e].merchant_category_id;
|
||||||
this.storeMerchantList(true);
|
this.storeMerchantList(true);
|
||||||
|
|
||||||
|
// scrollView 滚动到对应选择的分类
|
||||||
|
this.scrollIndex = 'scroll' + e;
|
||||||
|
|
||||||
this.$refs.popup && this.$refs.popup.close();
|
this.$refs.popup && this.$refs.popup.close();
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
|
|
||||||
// 进店
|
// 进店
|
||||||
goStore(id) {
|
goStore(id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/store/home/index?id=${id}`
|
url: `/pages/store/home/index?id=${id}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
merClassifly() {
|
merClassifly() {
|
||||||
merClassifly().then(res => {
|
merClassifly().then(res => {
|
||||||
this.store_category = [{
|
this.store_category = [{
|
||||||
@ -294,6 +304,7 @@
|
|||||||
}, ...res.data];
|
}, ...res.data];
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
storeMerchantList(reLoad = false) {
|
storeMerchantList(reLoad = false) {
|
||||||
if (reLoad) {
|
if (reLoad) {
|
||||||
this.where.page = 1;
|
this.where.page = 1;
|
||||||
@ -303,19 +314,21 @@
|
|||||||
if (this.isLoading == -1) return;
|
if (this.isLoading == -1) return;
|
||||||
this.isLoading = 1;
|
this.isLoading = 1;
|
||||||
storeMerchantList(this.where).then(res => {
|
storeMerchantList(this.where).then(res => {
|
||||||
this.isTriggered = false;
|
uni.stopPullDownRefresh();
|
||||||
this.goodsList = [...this.goodsList, ...res.data.list];
|
this.goodsList = [...this.goodsList, ...res.data.list];
|
||||||
this.isLoading = 0;
|
this.isLoading = 0;
|
||||||
if (res.data.list.length < this.where.limit) this.isLoading = -1;
|
if (res.data.list.length < this.where.limit) this.isLoading = -1;
|
||||||
this.where.page++;
|
this.where.page++;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.isTriggered = false;
|
uni.stopPullDownRefresh();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
closeShowAddress() {
|
closeShowAddress() {
|
||||||
this.isShowAddress = false;
|
this.isShowAddress = false;
|
||||||
uni.setStorageSync('closeShow', true);
|
uni.setStorageSync('closeShow', true);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选择位置
|
// 选择位置
|
||||||
changeMap() {
|
changeMap() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -347,6 +360,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getLocation() {
|
getLocation() {
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'gcj02',
|
type: 'gcj02',
|
||||||
@ -403,7 +417,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -421,33 +435,33 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.wholeSale-header {
|
.wholeSale-header {
|
||||||
position: sticky;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 90;
|
z-index: 90;
|
||||||
margin-bottom: 20rpx;
|
width: 100%;
|
||||||
background-color: #40AE36;
|
background-color: #40AE36;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wholeSale-section {
|
.wholeSale-section {
|
||||||
position: sticky;
|
position: fixed;
|
||||||
top: calc(82rpx + var(--status-bar-height));
|
z-index: 10;
|
||||||
|
top: calc(80rpx + var(--status-bar-height));
|
||||||
|
width: 100%;
|
||||||
padding: 0rpx 20rpx;
|
padding: 0rpx 20rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
transition: height .5s;
|
transition: height .5s;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-bottom: 20rpx;
|
|
||||||
|
|
||||||
.wholeSale-nav {
|
.wholeSale-nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 40rpx;
|
padding: 20rpx 0;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search_content {
|
.search_content {
|
||||||
// margin-bottom: 40rpx;
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
padding: 2px 2px 2px 21.05rpx;
|
padding: 2px 2px 2px 21.05rpx;
|
||||||
@ -540,16 +554,15 @@
|
|||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: #f3f3f3;
|
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 4rpx;
|
|
||||||
width: 70rpx;
|
width: 70rpx;
|
||||||
color: #919191;
|
color: #919191;
|
||||||
|
box-shadow: 0px 0px 60rpx #c5c5c5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wholeSale">
|
<view class="wholeSale" @touchstart="onTouchStart" @touchmove="onTouchMove">
|
||||||
<!-- 适配不同机 -->
|
<!-- 适配不同机 -->
|
||||||
<view class="wholeSale-header">
|
<view class="wholeSale-header">
|
||||||
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
|
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
|
||||||
@ -9,6 +9,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view :style="{height:'calc(' + wrapHeight + 'rpx + 92rpx + var(--status-bar-height))'}"></view>
|
||||||
|
|
||||||
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
|
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
|
||||||
<view class="wholeSale-nav">
|
<view class="wholeSale-nav">
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
@ -24,11 +26,11 @@
|
|||||||
|
|
||||||
<!-- 商品大分类 -->
|
<!-- 商品大分类 -->
|
||||||
<view class="category">
|
<view class="category">
|
||||||
<scroll-view scroll-x="true">
|
<scroll-view scroll-x="true" :scroll-into-view="scrollIndex">
|
||||||
<view class="category-wrap">
|
<view class="category-wrap">
|
||||||
<block v-for="(item,index) in store_category" :key="index">
|
<block v-for="(item,index) in store_category" :key="index">
|
||||||
<view class="category-item" :class="{'category-item-active': index==cate_change}"
|
<view class="category-item" :id="'scroll' + index"
|
||||||
@click="changeCate(index)">
|
:class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
|
||||||
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx"
|
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx"
|
||||||
shape="circle">
|
shape="circle">
|
||||||
<template v-slot:loading>
|
<template v-slot:loading>
|
||||||
@ -63,17 +65,11 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<view class="wholeSale-con" :style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx )'}">
|
<view class="wholeSale-con">
|
||||||
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
|
|
||||||
:refresher-enabled="true" :refresher-triggered="isTriggered" @refresherpulling="onPulling"
|
|
||||||
@refresherrefresh="onRefresh" :refresher-threshold="45" :scroll-anchoring='true'>
|
|
||||||
<view>
|
|
||||||
<!-- 流水瀑布 -->
|
<!-- 流水瀑布 -->
|
||||||
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
|
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
|
||||||
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
|
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 弹框大分类 -->
|
<!-- 弹框大分类 -->
|
||||||
<uni-popup ref="popup" type="top" border-radius="10px 10px 0 0" z-index="1000">
|
<uni-popup ref="popup" type="top" border-radius="10px 10px 0 0" z-index="1000">
|
||||||
@ -123,6 +119,7 @@
|
|||||||
cate_change: 0,
|
cate_change: 0,
|
||||||
cate_change_children: 0,
|
cate_change_children: 0,
|
||||||
isLoading: 0,
|
isLoading: 0,
|
||||||
|
isScroll: false,
|
||||||
where: {
|
where: {
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
@ -132,46 +129,53 @@
|
|||||||
sale_type: 1, //1-零售, 2-批发
|
sale_type: 1, //1-零售, 2-批发
|
||||||
},
|
},
|
||||||
wrapHeight: 300,
|
wrapHeight: 300,
|
||||||
scrollTop: 0,
|
touchstarty: 0,
|
||||||
isTriggered: true
|
scrollIndex: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onPageScroll() {
|
||||||
|
uni.$emit('scroll');
|
||||||
|
},
|
||||||
|
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.getProductslist(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
onReachBottom() {
|
||||||
|
this.getProductslist();
|
||||||
|
},
|
||||||
|
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.getCategoryIndexList();
|
this.getCategoryIndexList();
|
||||||
this.getProductslist(true);
|
this.getProductslist(true);
|
||||||
},
|
},
|
||||||
onPageScroll() {
|
|
||||||
uni.$emit('scroll');
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 下拉加载
|
// 开始滑动
|
||||||
onPulling() {
|
onTouchStart(e) {
|
||||||
if (!this.isTriggered) {
|
this.touchstarty = e.touches[0].clientY;
|
||||||
this.isTriggered = true;
|
|
||||||
this.getProductslist(true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onRefresh(e) {
|
|
||||||
this.isTriggered = true;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onScrollBottom(e) {
|
// 开始移动
|
||||||
this.getProductslist();
|
onTouchMove(e) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
let deltaY = e.changedTouches[0].clientY - this.touchstarty;
|
||||||
|
if (deltaY <= 0) {
|
||||||
|
console.log("上滑")
|
||||||
|
this.wrapHeight = 0;
|
||||||
|
} else {
|
||||||
|
console.log('下滑');
|
||||||
|
this.wrapHeight = 300;
|
||||||
|
}
|
||||||
|
this.$forceUpdate();
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onAllCategory() {
|
onAllCategory() {
|
||||||
this.$refs.popup.open();
|
this.$refs.popup.open();
|
||||||
},
|
},
|
||||||
|
|
||||||
onScroll(e) {
|
|
||||||
if (this.scrollTop > e.target.scrollTop) { //上拉
|
|
||||||
this.wrapHeight = 300;
|
|
||||||
} else {
|
|
||||||
this.wrapHeight = 0;
|
|
||||||
}
|
|
||||||
this.scrollTop = e.target.scrollTop;
|
|
||||||
},
|
|
||||||
|
|
||||||
navTo(url) {
|
navTo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url,
|
url: url,
|
||||||
@ -203,6 +207,9 @@
|
|||||||
this.where.cate_pid = this.store_category[e].store_category_id;
|
this.where.cate_pid = this.store_category[e].store_category_id;
|
||||||
this.getProductslist(true);
|
this.getProductslist(true);
|
||||||
|
|
||||||
|
// scrollView 滚动到对应选择的分类
|
||||||
|
this.scrollIndex = 'scroll' + e;
|
||||||
|
|
||||||
this.$refs.popup && this.$refs.popup.close();
|
this.$refs.popup && this.$refs.popup.close();
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
@ -241,13 +248,13 @@
|
|||||||
if (this.isLoading == -1) return;
|
if (this.isLoading == -1) return;
|
||||||
this.isLoading = 1;
|
this.isLoading = 1;
|
||||||
getProductslist(this.where).then(res => {
|
getProductslist(this.where).then(res => {
|
||||||
this.isTriggered = false;
|
uni.stopPullDownRefresh();
|
||||||
this.hostProduct = [...this.hostProduct, ...res.data.list];
|
this.hostProduct = [...this.hostProduct, ...res.data.list];
|
||||||
this.where.page++;
|
this.where.page++;
|
||||||
this.isLoading = 0;
|
this.isLoading = 0;
|
||||||
if (res.data.list.length < this.where.limit) this.isLoading = -1;
|
if (res.data.list.length < this.where.limit) this.isLoading = -1;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.isTriggered = false;
|
uni.stopPullDownRefresh();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goDetail(item) {
|
goDetail(item) {
|
||||||
@ -282,27 +289,27 @@
|
|||||||
.wholeSale {
|
.wholeSale {
|
||||||
|
|
||||||
.wholeSale-header {
|
.wholeSale-header {
|
||||||
position: sticky;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 90;
|
z-index: 90;
|
||||||
|
width: 100%;
|
||||||
background-color: #40AE36;
|
background-color: #40AE36;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wholeSale-section {
|
.wholeSale-section {
|
||||||
position: sticky;
|
position: fixed;
|
||||||
top: calc(82rpx + var(--status-bar-height));
|
top: calc(80rpx + var(--status-bar-height));
|
||||||
|
width: 100%;
|
||||||
padding: 0rpx 20rpx;
|
padding: 0rpx 20rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
transition: height .5s;
|
transition: height .5s;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-bottom: 20rpx;
|
z-index: 89;
|
||||||
padding-top: 20rpx;
|
|
||||||
z-index: 20;
|
|
||||||
|
|
||||||
.wholeSale-nav {
|
.wholeSale-nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 40rpx;
|
padding: 20rpx 0;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
@ -401,16 +408,15 @@
|
|||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: #f3f3f3;
|
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 4rpx;
|
|
||||||
width: 70rpx;
|
width: 70rpx;
|
||||||
color: #919191;
|
color: #919191;
|
||||||
|
box-shadow: 0px 0px 60rpx #c5c5c5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -893,9 +893,7 @@
|
|||||||
getConfig() {
|
getConfig() {
|
||||||
let self = this
|
let self = this
|
||||||
// 获取配置
|
// 获取配置
|
||||||
getconfig().then(res => {
|
getconfig().then(res => {}).catch(err => {})
|
||||||
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
},
|
||||||
/**到货通知*/
|
/**到货通知*/
|
||||||
arrivalNotice() {
|
arrivalNotice() {
|
||||||
@ -1504,7 +1502,7 @@
|
|||||||
toLogin()
|
toLogin()
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/chat/customer_list/chat?mer_id=${that.storeInfo.mer_id}&uid=${that.uid}&productId=${that.id}`
|
url: `/pages/chat/customer_list/chat?mer_id=${that.storeInfo.mer_id}&uid=${that.uid}&productId=${that.id}&sale_type=${that.sale_type}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -69,7 +69,11 @@
|
|||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
import {
|
import {
|
||||||
getGeocoder
|
getGeocoder
|
||||||
} from "@/api/store.js"
|
} from "@/api/store.js";
|
||||||
|
import {
|
||||||
|
AUTH_EXPIRE_TIME
|
||||||
|
} from "@/config/app.js";
|
||||||
|
import permission from '@/utils/permission';
|
||||||
export default {
|
export default {
|
||||||
name: 'homeComb',
|
name: 'homeComb',
|
||||||
props: {
|
props: {
|
||||||
@ -135,7 +139,7 @@
|
|||||||
isCategory: false,
|
isCategory: false,
|
||||||
swiperTop: 0,
|
swiperTop: 0,
|
||||||
isFixed: true,
|
isFixed: true,
|
||||||
street: ''
|
street: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -230,9 +234,43 @@
|
|||||||
methods: {
|
methods: {
|
||||||
async scanQRcode() {
|
async scanQRcode() {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
let result = await this.$store.dispatch("permission/requestPermissions",
|
let result = await this.$store.dispatch("permission/requestPermissions", 'CAMERA');
|
||||||
'CAMERA')
|
console.log('权限状态:' + result);
|
||||||
|
if (result != -1) {
|
||||||
|
console.log('允许设置...');
|
||||||
|
uni.removeStorageSync('expireTimeCamera');
|
||||||
|
} else {
|
||||||
|
const expireTime = uni.getStorageSync('expireTimeCamera');
|
||||||
|
console.log('过期时间:' + expireTime);
|
||||||
|
if (expireTime) {
|
||||||
|
if ((expireTime + AUTH_EXPIRE_TIME) < +new Date()) {
|
||||||
|
console.log('时间过期了....')
|
||||||
|
uni.removeStorageSync('expireTimeCamera');
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '操作权限已被拒绝,请手动前往设置',
|
||||||
|
confirmText: "立即设置",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
permission.gotoAppSetting();
|
||||||
|
} else {
|
||||||
|
// 设置过期时间
|
||||||
|
console.log('重置过期时间');
|
||||||
|
uni.setStorageSync('expireTimeCamera', +new Date());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('时间还没过期....');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 设置一个过期时间
|
||||||
|
uni.setStorageSync('expireTimeCamera', +new Date());
|
||||||
|
}
|
||||||
|
}
|
||||||
if (result !== 1) return;
|
if (result !== 1) return;
|
||||||
|
// 授权成功移除
|
||||||
|
uni.removeStorageSync('expireTimeCamera');
|
||||||
// #endif
|
// #endif
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
id="home">
|
id="home">
|
||||||
<skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
|
<skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
|
||||||
bgcolor="transparent"></skeleton>
|
bgcolor="transparent"></skeleton>
|
||||||
|
|
||||||
<view v-if="!errorNetwork"
|
<view v-if="!errorNetwork"
|
||||||
:style="{visibility: showSkeleton ? 'hidden' : 'visible', pointerEvents: preview ? 'none' : 'auto'}">
|
:style="{visibility: showSkeleton ? 'hidden' : 'visible', pointerEvents: preview ? 'none' : 'auto'}">
|
||||||
<view class="page-index skeleton" :class="{ bgf: navIndex > 0 }">
|
<view class="page-index skeleton" :class="{ bgf: navIndex > 0 }">
|
||||||
@ -399,6 +400,7 @@
|
|||||||
import {
|
import {
|
||||||
showTab
|
showTab
|
||||||
} from "@/utils/showTab.js";
|
} from "@/utils/showTab.js";
|
||||||
|
import permission from '../../utils/permission';
|
||||||
export default {
|
export default {
|
||||||
computed: configMap({
|
computed: configMap({
|
||||||
hide_mer_status: 0,
|
hide_mer_status: 0,
|
||||||
@ -576,7 +578,7 @@
|
|||||||
this.isScrolled = false
|
this.isScrolled = false
|
||||||
}
|
}
|
||||||
// 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
|
// 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
|
||||||
uni.$emit('scroll');
|
uni.$emit('scroll', e);
|
||||||
|
|
||||||
if (e.scrollTop >= 100) {
|
if (e.scrollTop >= 100) {
|
||||||
uni.setTabBarItem({
|
uni.setTabBarItem({
|
||||||
@ -625,7 +627,7 @@
|
|||||||
let curRoute = routes[routes.length - 1].route //获取当前页面路由
|
let curRoute = routes[routes.length - 1].route //获取当前页面路由
|
||||||
this.activeRouter = '/' + curRoute
|
this.activeRouter = '/' + curRoute
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
async onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
this._options = options;
|
this._options = options;
|
||||||
this.diyId = options.diyId || 0;
|
this.diyId = options.diyId || 0;
|
||||||
@ -642,6 +644,16 @@
|
|||||||
})
|
})
|
||||||
that.pageLoad(options);
|
that.pageLoad(options);
|
||||||
this.$store.dispatch('INIT_CONFIG');
|
this.$store.dispatch('INIT_CONFIG');
|
||||||
|
|
||||||
|
// let result = await this.$store.dispatch("permission/requestPermissions",
|
||||||
|
// 'ACCESS_FINE_LOCATION')
|
||||||
|
|
||||||
|
|
||||||
|
// console.log(result)
|
||||||
|
|
||||||
|
|
||||||
|
// permission.gotoAppSetting();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
@ -662,6 +674,7 @@
|
|||||||
that.isScrolled = res[0].top <= -60
|
that.isScrolled = res[0].top <= -60
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
this.isIndexClick = false;
|
this.isIndexClick = false;
|
||||||
|
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
<view>
|
<view>
|
||||||
<view class='newsList'>
|
<view class='newsList'>
|
||||||
<view class='swiper' v-if="imgUrls.length > 0" style="background-color: #fff;">
|
<view class='swiper' v-if="imgUrls.length > 0" style="background-color: #fff;">
|
||||||
<swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
|
<swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval"
|
||||||
indicator-color="rgba(102,102,102,0.3)" indicator-active-color="#666">
|
:duration="duration" indicator-color="rgba(102,102,102,0.3)" indicator-active-color="#666">
|
||||||
<block v-for="(item,index) in imgUrls" :key="index">
|
<block v-for="(item,index) in imgUrls" :key="index">
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
<navigator :url="'/pages/news_details/index?id='+item.id">
|
<navigator :url="'/pages/news_details/index?id='+item.id">
|
||||||
@ -13,10 +13,13 @@
|
|||||||
</block>
|
</block>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
<view class='nav' v-if="navList.length > 0" style="background-color: #fff;margin-top: 0;padding-top: 30rpx;">
|
<view class='nav' v-if="navList.length > 0"
|
||||||
<scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft" style="width:auto;overflow:hidden;">
|
style="background-color: #fff;margin-top: 0;padding-top: 30rpx;">
|
||||||
|
<scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft"
|
||||||
|
style="width:auto;overflow:hidden;">
|
||||||
<block v-for="(item,index) in navList" :key="index">
|
<block v-for="(item,index) in navList" :key="index">
|
||||||
<view class='item' :class='active==item.article_category_id?"on":""' @click='tabSelect(item.article_category_id)'>
|
<view class='item' :class='active==item.article_category_id?"on":""'
|
||||||
|
@click='tabSelect(item.article_category_id)'>
|
||||||
<view>{{item.title}}</view>
|
<view>{{item.title}}</view>
|
||||||
<view class='line bg-color' v-if="active==item.article_category_id"></view>
|
<view class='line bg-color' v-if="active==item.article_category_id"></view>
|
||||||
</view>
|
</view>
|
||||||
@ -25,22 +28,27 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class='list'>
|
<view class='list'>
|
||||||
<block v-for="(item,index) in articleList" :key="index">
|
<block v-for="(item,index) in articleList" :key="index">
|
||||||
<navigator :url='"/pages/news_details/index?id="+item.article_id' hover-class='none' class='item acea-row row-between-wrapper my-card'
|
<navigator :url='"/pages/news_details/index?id="+item.article_id' hover-class='none'
|
||||||
:class="{'my-card0': index==0}">
|
class='item acea-row row-between-wrapper my-card' :class="{'my-card0': index==0}">
|
||||||
<block v-if="index==0">
|
<block v-if="index==0">
|
||||||
<image lazy-load style="width: 100%;height: 100%;" :src='item.image_input' mode="aspectFill"></image>
|
<image lazy-load style="width: 100%;height: 100%;" :src='item.image_input'
|
||||||
|
mode="aspectFill"></image>
|
||||||
<view class="bottom-text">
|
<view class="bottom-text">
|
||||||
<view class='name line2'>{{item.title}}</view>
|
<view class='name line2'>{{item.title}}</view>
|
||||||
<view style="color: #C4C4C4;font-size: 24rpx;padding-top: 10rpx;">{{URLdate(item.create_time)}}</view>
|
<view style="color: #C4C4C4;font-size: 24rpx;padding-top: 10rpx;">
|
||||||
|
{{URLdate(item.create_time)}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<view class='text acea-row row-column-between' style="height: 100%;width: 550rpx;">
|
<view class='text'
|
||||||
|
style="height: 100%;width: 550rpx;display: flex;flex-direction: column;justify-content: space-between;">
|
||||||
<view class='name line2'>{{item.title}}</view>
|
<view class='name line2'>{{item.title}}</view>
|
||||||
<view>{{URLdate(item.create_time)}}</view>
|
<view>{{URLdate(item.create_time)}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='pictrue'>
|
<view class='pictrue'>
|
||||||
<image lazy-load style="width: 100%;height: 100%;" :src='item.image_input' mode="aspectFill"></image>
|
<image lazy-load style="width: 100%;height: 100%;" :src='item.image_input'
|
||||||
|
mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</navigator>
|
</navigator>
|
||||||
@ -53,7 +61,6 @@
|
|||||||
<view class="txt">暂无新闻信息~</view>
|
<view class="txt">暂无新闻信息~</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <home></home> -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -109,8 +116,7 @@
|
|||||||
if (options.type) {
|
if (options.type) {
|
||||||
this.active = options.type;
|
this.active = options.type;
|
||||||
this.getCidArticle();
|
this.getCidArticle();
|
||||||
}
|
} else this.getArticleCate();
|
||||||
else this.getArticleCate();
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 页面上拉触底事件的处理函数
|
* 页面上拉触底事件的处理函数
|
||||||
@ -190,22 +196,26 @@
|
|||||||
page {
|
page {
|
||||||
background-color: #f8f9fa !important;
|
background-color: #f8f9fa !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .swiper {
|
.newsList .swiper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .swiper swiper {
|
.newsList .swiper swiper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 365rpx;
|
height: 365rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .swiper .slide-image {
|
.newsList .swiper .slide-image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 335rpx;
|
height: 335rpx;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
.newsList .swiper .wx-swiper-dot {
|
.newsList .swiper .wx-swiper-dot {
|
||||||
width: 12rpx !important;
|
width: 12rpx !important;
|
||||||
@ -214,9 +224,11 @@
|
|||||||
transform: rotate(-45deg);
|
transform: rotate(-45deg);
|
||||||
transform-origin: 0 100%;
|
transform-origin: 0 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .swiper .wx-swiper-dot~.wx-swiper-dot {
|
.newsList .swiper .wx-swiper-dot~.wx-swiper-dot {
|
||||||
margin-left: 5rpx;
|
margin-left: 5rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .swiper .wx-swiper-dots.wx-swiper-dots-horizontal {
|
.newsList .swiper .wx-swiper-dots.wx-swiper-dots-horizontal {
|
||||||
margin-bottom: -15rpx;
|
margin-bottom: -15rpx;
|
||||||
}
|
}
|
||||||
@ -230,12 +242,15 @@
|
|||||||
transform: rotate(-45deg);
|
transform: rotate(-45deg);
|
||||||
transform-origin: 0 100%;
|
transform-origin: 0 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .swiper .uni-swiper-dot~.uni-swiper-dot {
|
.newsList .swiper .uni-swiper-dot~.uni-swiper-dot {
|
||||||
margin-left: 5rpx;
|
margin-left: 5rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .swiper .uni-swiper-dots.uni-swiper-dots-horizontal {
|
.newsList .swiper .uni-swiper-dots.uni-swiper-dots-horizontal {
|
||||||
margin-bottom: -15rpx;
|
margin-bottom: -15rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
.newsList .nav {
|
.newsList .nav {
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
@ -244,6 +259,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-top: 43rpx;
|
margin-top: 43rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .nav .item {
|
.newsList .nav .item {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
@ -256,12 +272,15 @@
|
|||||||
padding-bottom: 20rpx;
|
padding-bottom: 20rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .nav .item.on {
|
.newsList .nav .item.on {
|
||||||
color: #282828;
|
color: #282828;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .nav .item~.item {
|
.newsList .nav .item~.item {
|
||||||
margin-left: 46rpx;
|
margin-left: 46rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .nav .item .line {
|
.newsList .nav .item .line {
|
||||||
width: 24rpx;
|
width: 24rpx;
|
||||||
height: 4rpx;
|
height: 4rpx;
|
||||||
@ -272,69 +291,83 @@
|
|||||||
left: 50%;
|
left: 50%;
|
||||||
margin-left: -12rpx;
|
margin-left: -12rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .list .item {
|
.newsList .list .item {
|
||||||
margin: 0 30rpx;
|
margin: 0 30rpx;
|
||||||
border-bottom: 1px solid #f0f0f0;
|
border-bottom: 1px solid #f0f0f0;
|
||||||
padding: 35rpx 0;
|
padding: 35rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .list .item .pictrue {
|
.newsList .list .item .pictrue {
|
||||||
width: 250rpx;
|
width: 250rpx;
|
||||||
height: 156rpx;
|
height: 156rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .list .item .pictrue image {
|
.newsList .list .item .pictrue image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .list .item .text {
|
.newsList .list .item .text {
|
||||||
width: 420rpx;
|
width: 420rpx;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .list .item .text .name {
|
.newsList .list .item .text .name {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .list .item .picList .pictrue {
|
.newsList .list .item .picList .pictrue {
|
||||||
width: 335rpx;
|
width: 335rpx;
|
||||||
height: 210rpx;
|
height: 210rpx;
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .list .item .picList.on .pictrue {
|
.newsList .list .item .picList.on .pictrue {
|
||||||
width: 217rpx;
|
width: 217rpx;
|
||||||
height: 136rpx;
|
height: 136rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .list .item .picList .pictrue image {
|
.newsList .list .item .picList .pictrue image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newsList .list .item .time {
|
.newsList .list .item .time {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
margin-top: 22rpx;
|
margin-top: 22rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noCommodity {
|
.noCommodity {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-box {
|
.empty-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 200rpx;
|
margin-top: 200rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 414rpx;
|
width: 414rpx;
|
||||||
height: 240rpx;
|
height: 240rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.txt {
|
.txt {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-card {
|
.my-card {
|
||||||
background-color: #fff !important;
|
background-color: #fff !important;
|
||||||
margin: 20rpx !important;
|
margin: 20rpx !important;
|
||||||
@ -342,15 +375,18 @@
|
|||||||
border-radius: 20rpx !important;
|
border-radius: 20rpx !important;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
height: 160rpx !important;
|
height: 160rpx !important;
|
||||||
|
|
||||||
.pictrue {
|
.pictrue {
|
||||||
height: 116rpx !important;
|
height: 116rpx !important;
|
||||||
width: 116rpx !important;
|
width: 116rpx !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-card0 {
|
.my-card0 {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
height: 478rpx !important;
|
height: 478rpx !important;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.bottom-text {
|
.bottom-text {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
<view class="line1" style="max-width: 260rpx;">
|
<view class="line1" style="max-width: 260rpx;">
|
||||||
<text class="money-price">¥{{goods.productAttr.price}}</text>
|
<text class="money-price">¥{{goods.productAttr.price}}</text>
|
||||||
<text
|
<text
|
||||||
class="money-unit">/{{goods.productAttr.sku || goods.product.unit_name}}</text>
|
class="money-unit">/{{goods.product.unit_name || goods.product.unit_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -516,6 +516,8 @@
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
tabActive: function(value, old) {
|
tabActive: function(value, old) {
|
||||||
|
if (!value || !old) return;
|
||||||
|
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case 1:
|
case 1:
|
||||||
if (this.goods.length == 0 && this.isCoupon == 0) {
|
if (this.goods.length == 0 && this.isCoupon == 0) {
|
||||||
@ -605,6 +607,7 @@
|
|||||||
this.getMerClassifly();
|
this.getMerClassifly();
|
||||||
|
|
||||||
// 购物车
|
// 购物车
|
||||||
|
if (this.isLogin)
|
||||||
this.getCart();
|
this.getCart();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -197,18 +197,21 @@
|
|||||||
电话认证
|
电话认证
|
||||||
</view>
|
</view>
|
||||||
<view class="card-cont">
|
<view class="card-cont">
|
||||||
<view class="card-cont-li">
|
<view class="card-cont-li" style="justify-content: flex-start;">
|
||||||
联系电话 {{formData.phone}}
|
<text style="margin-right: 30rpx;width:120rpx;">联系电话</text>
|
||||||
|
<text>{{formData.phone}}</text>
|
||||||
</view>
|
</view>
|
||||||
<u-line style="margin: 28rpx 0;"></u-line>
|
<u-line style="margin: 28rpx 0;"></u-line>
|
||||||
<view class="card-cont-li">
|
<view class="card-cont-li">
|
||||||
<view class="" style="flex: 4;display: flex;align-items: center;">
|
<view class="" style="flex: 4;display: flex;align-items: center;">
|
||||||
验证码 <u--input style="margin-left: 40rpx;" border="none" v-model="formData.code">
|
<text
|
||||||
|
style="text-align-last: justify;width:108rpx;margin-right:40rpx;">验证码</text>
|
||||||
|
<u--input border="none" v-model="formData.code" placeholder="请输入验证码">
|
||||||
</u--input>
|
</u--input>
|
||||||
</view>
|
</view>
|
||||||
<view class="" style="flex: 1;">
|
<view class="" style="flex: 1;">
|
||||||
<u-button @click="handleVerify" type="success" shape="circle" :plain="true"
|
<u-button @click="handleVerify" type="success" shape="circle" :plain="true"
|
||||||
:text="text"></u-button>
|
:text="text" style="height: 60rpx;"></u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -258,7 +261,7 @@
|
|||||||
<text style="color: #35BD3E;" @click="getConfig">《入驻协议》</text>
|
<text style="color: #35BD3E;" @click="getConfig">《入驻协议》</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="submit-btn" v-if='step!=3'>
|
<view class="submit-btn" v-if='step!=3'>
|
||||||
<u-button text="添加店铺" @click="submit" shape='circle'
|
<u-button :text="step==1?'添加店铺':'资质认证'" @click="submit" shape='circle'
|
||||||
color=" linear-gradient( 132deg, #38BE41 0%, #20B128 100%)"></u-button>
|
color=" linear-gradient( 132deg, #38BE41 0%, #20B128 100%)"></u-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<image src="@/static/images/logo1.png" />
|
<image src="@/static/images/logo1.png" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="" style="margin-top: 10rpx;" v-if='formItem==2'>
|
<view class="" style="margin-top: 10rpx;" v-if='formItem==2'>
|
||||||
<view style="text-align: center;font-size: 36rpx;color: #20B128;font-weight: 700;">
|
<view style="text-align: center;font-size: 36rpx;color: #20B128;font-weight: 700;">
|
||||||
重置密码
|
重置密码
|
||||||
@ -16,6 +17,7 @@
|
|||||||
请输入手机号码和验证码找回密码、重置
|
请输入手机号码和验证码找回密码、重置
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="whiteBg" v-if="formItem == 0">
|
<view class="whiteBg" v-if="formItem == 0">
|
||||||
<view class="logon" style="display: flex;align-items: center;justify-content: center;"
|
<view class="logon" style="display: flex;align-items: center;justify-content: center;"
|
||||||
@click="wxLogin">
|
@click="wxLogin">
|
||||||
@ -31,6 +33,7 @@
|
|||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="whiteBg" v-else-if="formItem === 1">
|
<view class="whiteBg" v-else-if="formItem === 1">
|
||||||
<view class="title acea-row row-center-wrapper">
|
<view class="title acea-row row-center-wrapper">
|
||||||
<view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList"
|
<view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList"
|
||||||
@ -165,7 +168,7 @@
|
|||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer-btn" v-if="formItem==2">
|
<view class="footer-btn" v-if="formItem==2 && isInstallWx">
|
||||||
<view class="login-type-btn" :class="{actLoginType:formItem==0}" style="margin-right: 70rpx;">
|
<view class="login-type-btn" :class="{actLoginType:formItem==0}" style="margin-right: 70rpx;">
|
||||||
<text v-if='formItem == 1||formItem==2' @click="formItem = 0">微信快捷登录</text>
|
<text v-if='formItem == 1||formItem==2' @click="formItem = 0">微信快捷登录</text>
|
||||||
<text v-else @click="appOneClcik">本机一键登录</text>
|
<text v-else @click="appOneClcik">本机一键登录</text>
|
||||||
@ -176,6 +179,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="bottom"></view>
|
<view class="bottom"></view>
|
||||||
<view class="settlementAgreement" v-if="showAgreement">
|
<view class="settlementAgreement" v-if="showAgreement">
|
||||||
<view class="setAgCount">
|
<view class="setAgCount">
|
||||||
@ -188,7 +192,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<view class="footer-btns" v-if="formItem !=2">
|
<view class="footer-btns" v-if="formItem !=2 && isInstallWx">
|
||||||
<view class="login-type-btn" :class="{actLoginType:formItem==0}" style="margin-right: 70rpx;">
|
<view class="login-type-btn" :class="{actLoginType:formItem==0}" style="margin-right: 70rpx;">
|
||||||
<text v-if='formItem == 1||formItem==2' @click="formItem = 0">微信快捷登录</text>
|
<text v-if='formItem == 1||formItem==2' @click="formItem = 0">微信快捷登录</text>
|
||||||
<text v-else @click="appOneClcik">本机一键登录</text>
|
<text v-else @click="appOneClcik">本机一键登录</text>
|
||||||
@ -198,6 +202,12 @@
|
|||||||
<text v-else @click="appOneClcik">本机一键登录</text>
|
<text v-else @click="appOneClcik">本机一键登录</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="footer-btns" v-if="!isInstallWx">
|
||||||
|
<view class="login-type-btn actLoginType" style="margin: 0 auto;">
|
||||||
|
<text @click="appOneClcik">{{formItem == 2?'更多登录方式':'本机一键登录'}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
<form report-submit='true' v-if="auth_token">
|
<form report-submit='true' v-if="auth_token">
|
||||||
@ -240,6 +250,7 @@
|
|||||||
</form>
|
</form>
|
||||||
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
|
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
|
||||||
ref="verify"></Verify>
|
ref="verify"></Verify>
|
||||||
|
|
||||||
<!-- tips弹窗 -->
|
<!-- tips弹窗 -->
|
||||||
<u-overlay :show="showTips">
|
<u-overlay :show="showTips">
|
||||||
<view class="tips">
|
<view class="tips">
|
||||||
@ -286,8 +297,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-overlay>
|
</u-overlay>
|
||||||
<!-- tips结束 -->
|
<!-- tips结束 -->
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -405,7 +414,8 @@
|
|||||||
keyLock: true,
|
keyLock: true,
|
||||||
auth_token: '',
|
auth_token: '',
|
||||||
codeVal: '',
|
codeVal: '',
|
||||||
copyright: {}
|
copyright: {},
|
||||||
|
isInstallWx: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: configMap(['login_logo'], mapGetters(['viewColor'])),
|
computed: configMap(['login_logo'], mapGetters(['viewColor'])),
|
||||||
@ -431,9 +441,25 @@
|
|||||||
});
|
});
|
||||||
this.getVersion();
|
this.getVersion();
|
||||||
},
|
},
|
||||||
mounted: function() {
|
|
||||||
|
|
||||||
|
onShow() {
|
||||||
|
// #ifdef APP
|
||||||
|
//判断是否安装微信
|
||||||
|
if (plus.runtime.isApplicationExist({
|
||||||
|
pname: 'com.tencent.mm',
|
||||||
|
action: 'weixin://'
|
||||||
|
})) {
|
||||||
|
// 安装微信
|
||||||
|
this.isInstallWx = true;
|
||||||
|
this.formItem = 0;
|
||||||
|
} else {
|
||||||
|
// 未安装
|
||||||
|
this.isInstallWx = false;
|
||||||
|
this.formItem = 1;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
onReady() {
|
onReady() {
|
||||||
let that = this
|
let that = this
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
@ -1358,6 +1384,9 @@
|
|||||||
},
|
},
|
||||||
// app手机号一键登录
|
// app手机号一键登录
|
||||||
appOneClcik() {
|
appOneClcik() {
|
||||||
|
|
||||||
|
if (this.formItem == 2) return this.formItem = 1;
|
||||||
|
|
||||||
let that = this
|
let that = this
|
||||||
uni.preLogin({
|
uni.preLogin({
|
||||||
provider: 'univerify',
|
provider: 'univerify',
|
||||||
@ -1382,22 +1411,9 @@
|
|||||||
title: '登录失败,请稍后再试'
|
title: '登录失败,请稍后再试'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
// uniCloud.callFunction({
|
|
||||||
// name: 'oneClickLoginFn',
|
|
||||||
// data: {
|
|
||||||
// 'access_token': res.authResult
|
|
||||||
// .access_token,
|
|
||||||
// 'openid': res.authResult.openid
|
|
||||||
// }
|
|
||||||
// }).then(res => {
|
|
||||||
// console.log(res, '登录成功后的res')
|
|
||||||
// }).catch(err => {
|
|
||||||
// console.log(err, 'ererre')
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
fail(res) { // 登录失败
|
fail(res) { // 登录失败
|
||||||
console.log(res.errCode)
|
uni.closeAuthView()
|
||||||
console.log(res.errMsg)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -355,10 +355,15 @@
|
|||||||
<text
|
<text
|
||||||
style="font-size: 22rpx;background-color: #ecfaed;color: #40ae36;border-radius: 40rpx;padding: 5rpx 10rpx;">
|
style="font-size: 22rpx;background-color: #ecfaed;color: #40ae36;border-radius: 40rpx;padding: 5rpx 10rpx;">
|
||||||
{{(item.merchant && item.merchant.cloud_warehouse) || ''}}</text>
|
{{(item.merchant && item.merchant.cloud_warehouse) || ''}}</text>
|
||||||
|
|
||||||
<view style="margin-top: 10rpx;" class="t-color">
|
<view style="margin-top: 10rpx;" class="t-color">
|
||||||
{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}
|
{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}
|
||||||
</view>
|
</view>
|
||||||
|
<view>
|
||||||
|
{{goods.cart_info.productAttr.sku}}
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class='money' v-if="item.activity_type == 3">
|
<view class='money' v-if="item.activity_type == 3">
|
||||||
<view v-if="goods.cart_info.productAssistAttr">
|
<view v-if="goods.cart_info.productAssistAttr">
|
||||||
¥{{goods.cart_info.productAssistAttr.assist_price}}</view>
|
¥{{goods.cart_info.productAssistAttr.assist_price}}</view>
|
||||||
|
@ -66,12 +66,11 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
<view :style="viewColor">
|
<view :style="viewColor" style="position: relative;z-index: 1000000;background-color: #fff;">
|
||||||
<form @submit="formSubmit" report-submit='true'>
|
<form @submit="formSubmit" report-submit='true'>
|
||||||
<view class='addAddress'>
|
<view class='addAddress'>
|
||||||
<view class='list'>
|
<view class='list'>
|
||||||
|
<view v-if="userAddress && userAddress.detail != ''" class="sel_addr_update-wrap">
|
||||||
<view v-if="userAddress.detail != ''" class="sel_addr_update-wrap">
|
|
||||||
<view class="sel_addr_update">
|
<view class="sel_addr_update">
|
||||||
<view class="sel_addr_wrap-l">
|
<view class="sel_addr_wrap-l">
|
||||||
<view class="sel_addr_wrap-l-addr line1">{{userAddress.detail}}</view>
|
<view class="sel_addr_wrap-l-addr line1">{{userAddress.detail}}</view>
|
||||||
@ -170,6 +169,10 @@
|
|||||||
getGeocoder
|
getGeocoder
|
||||||
} from '@/api/store.js';
|
} from '@/api/store.js';
|
||||||
import authorize from '@/components/Authorize';
|
import authorize from '@/components/Authorize';
|
||||||
|
import permission from '@/utils/permission';
|
||||||
|
import {
|
||||||
|
AUTH_EXPIRE_TIME
|
||||||
|
} from "@/config/app.js"
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
areaWindow,
|
areaWindow,
|
||||||
@ -205,7 +208,7 @@
|
|||||||
longitude: '',
|
longitude: '',
|
||||||
detail: '', //四川省泸州市龙马潭区龙门大道15号
|
detail: '', //四川省泸州市龙马潭区龙门大道15号
|
||||||
location: '', // 经纬度
|
location: '', // 经纬度
|
||||||
|
timer: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -233,11 +236,18 @@
|
|||||||
this.isShowAuth = true
|
this.isShowAuth = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
// if (this.timer) clearInterval(this.timer);
|
||||||
|
// this.timer = setInterval(() => {
|
||||||
|
// console.log(new Date().getSeconds())
|
||||||
|
// }, 1000)
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
// 选择地址
|
// 选择地址
|
||||||
handleToChoose() {
|
async handleToChoose() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/select_address_n/select_address_n",
|
url: "/pages/select_address_n/select_address_n",
|
||||||
@ -251,15 +261,78 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifndef H5
|
// #ifndef H5
|
||||||
|
let result = await that.$store.dispatch("permission/requestPermissions", 'ACCESS_FINE_LOCATION');
|
||||||
|
console.log('权限状态:' + result);
|
||||||
|
if (result != -1) {
|
||||||
|
console.log('允许设置...');
|
||||||
|
uni.removeStorageSync('expireTime');
|
||||||
|
const isOpen = permission.isOpenGps();
|
||||||
|
if (isOpen) {
|
||||||
|
that.getLocation();
|
||||||
|
} else {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '您未开启GPS定位,可能导致不能获取准确定位,是否继续',
|
||||||
|
confirmText: "继续",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
that.getLocation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const expireTime = uni.getStorageSync('expireTime');
|
||||||
|
console.log('过期时间:' + expireTime);
|
||||||
|
if (expireTime) {
|
||||||
|
if ((expireTime + AUTH_EXPIRE_TIME) < +new Date()) {
|
||||||
|
console.log('时间过期了....')
|
||||||
|
uni.removeStorageSync('expireTime');
|
||||||
|
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '操作权限已被拒绝,请手动前往设置',
|
||||||
|
confirmText: "立即设置",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
permission.gotoAppSetting();
|
||||||
|
} else {
|
||||||
|
// 设置过期时间
|
||||||
|
console.log('重置过期时间');
|
||||||
|
uni.setStorageSync('expireTime', +new Date());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('时间还没过期....');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 设置一个过期时间
|
||||||
|
uni.setStorageSync('expireTime', +new Date());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
|
||||||
|
// 打开地图选择地址
|
||||||
|
getLocation() {
|
||||||
|
let that = this;
|
||||||
uni.chooseLocation({
|
uni.chooseLocation({
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
that.userAddress.detail = res.name
|
that.userAddress.detail =
|
||||||
that.userAddress.address_detail = res.address;
|
res.name
|
||||||
that.location = `${res.latitude},${res.longitude}`;;
|
that.userAddress
|
||||||
|
.address_detail = res
|
||||||
|
.address;
|
||||||
|
that.location =
|
||||||
|
`${res.latitude},${res.longitude}`;;
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
console.log(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// #endif
|
|
||||||
},
|
},
|
||||||
|
|
||||||
OnChangeAddress(address) {
|
OnChangeAddress(address) {
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wholeSale">
|
<view class="wholeSale" @touchstart="onTouchStart" @touchmove="onTouchMove">
|
||||||
<!-- 顶部 -->
|
<!-- 顶部 -->
|
||||||
<view class="wholeSale-header">
|
<view class="wholeSale-header">
|
||||||
<view class="wholeSale-header-wrap">
|
|
||||||
<!-- 适配不同机 -->
|
<!-- 适配不同机 -->
|
||||||
<view style="height: var(--status-bar-height);"></view>
|
<view style="height: var(--status-bar-height);"></view>
|
||||||
|
|
||||||
@ -19,9 +18,12 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 占位 -->
|
||||||
|
<view :style="{height:'calc(' + wrapHeight + 'rpx + 108rpx + var(--status-bar-height))'}"></view>
|
||||||
|
|
||||||
<view class="wholeSale-header-search-wrap" :style="{height:wrapHeight + 'rpx'}">
|
<view class="wholeSale-header-search-wrap" :style="{height:wrapHeight + 'rpx'}">
|
||||||
<u-subsection v-if="tabsCurr==2" :list="subList" @change="changeSub" :current="subCurr"
|
<u-subsection v-if="tabsCurr==2" :list="subList" @change="changeSub" :current="subCurr" mode="subsection"
|
||||||
mode="subsection" activeColor="#40ae36" fontSize="14" style="margin-bottom: 24rpx;"></u-subsection>
|
activeColor="#40ae36" fontSize="14" style="margin-top: 20rpx;"></u-subsection>
|
||||||
|
|
||||||
<view class="wholeSale-nav">
|
<view class="wholeSale-nav">
|
||||||
<view
|
<view
|
||||||
@ -39,14 +41,14 @@
|
|||||||
|
|
||||||
<!-- 商品大分类 -->
|
<!-- 商品大分类 -->
|
||||||
<view class="category">
|
<view class="category">
|
||||||
<scroll-view scroll-x="true">
|
<scroll-view scroll-x="true" :scroll-into-view="scrollIndex">
|
||||||
<view class="category-wrap">
|
<view class="category-wrap">
|
||||||
<block v-for="(item,index) in store_category" :key="index">
|
<block v-for="(item,index) in store_category" :key="index">
|
||||||
<view class="category-item" :class="{'category-item-active': index==cate_change}"
|
<view class="category-item" :id="'scroll' + index"
|
||||||
@click="changeCate(index)">
|
:class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
|
||||||
<block v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)">
|
<block v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)">
|
||||||
<u--image class="category-item-img" width="108rpx" :src="item.pic"
|
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx"
|
||||||
height="108rpx" shape="circle">
|
shape="circle">
|
||||||
<template v-slot:loading>
|
<template v-slot:loading>
|
||||||
<u-loading-icon color="#999" size="15" />
|
<u-loading-icon color="#999" size="15" />
|
||||||
</template>
|
</template>
|
||||||
@ -88,8 +90,7 @@
|
|||||||
|
|
||||||
<!-- 综合查询 -->
|
<!-- 综合查询 -->
|
||||||
<view class="comprehensive" v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)">
|
<view class="comprehensive" v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)">
|
||||||
<view class="comprehensive-price" :class="{'comp-color': orderCurr==1}"
|
<view class="comprehensive-price" :class="{'comp-color': orderCurr==1}" @click="toOrder('price', 1)">
|
||||||
@click="toOrder('price', 1)">
|
|
||||||
<text>价格</text>
|
<text>价格</text>
|
||||||
<image v-if="orderCurr==1" style="width: 15rpx;height: 21rpx;"
|
<image v-if="orderCurr==1" style="width: 15rpx;height: 21rpx;"
|
||||||
:src="where.order == 'price_asc' ? domain+'/static/diy/up'+keyColor+'.png' : domain+'/static/diy/down'+keyColor+'.png'">
|
:src="where.order == 'price_asc' ? domain+'/static/diy/up'+keyColor+'.png' : domain+'/static/diy/down'+keyColor+'.png'">
|
||||||
@ -104,7 +105,8 @@
|
|||||||
@click="toOrder('', 3)">
|
@click="toOrder('', 3)">
|
||||||
<text>综合</text>
|
<text>综合</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="comprehensive-discount" v-else @click="deduction_rate=!deduction_rate;">
|
|
||||||
|
<view class="comprehensive-discount" v-else @click="onChangeDeductionRate">
|
||||||
<text>抵扣</text>
|
<text>抵扣</text>
|
||||||
<image class="loudou" src="@/static/new_define/loudou.png"></image>
|
<image class="loudou" src="@/static/new_define/loudou.png"></image>
|
||||||
</view>
|
</view>
|
||||||
@ -134,17 +136,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<view class="wholeSale-con"
|
<view class="wholeSale-con">
|
||||||
:style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx '+(isShowSmall?' - 48rpx':'')+')'}">
|
|
||||||
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
|
|
||||||
:refresher-enabled="true" :refresher-triggered="isTriggered" @refresherpulling="onPulling"
|
|
||||||
@refresherrefresh="onRefresh" :refresher-threshold="45" :scroll-anchoring='true'>
|
|
||||||
<!-- 流水瀑布 -->
|
<!-- 流水瀑布 -->
|
||||||
<WaterfallsFlow v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)" :wfList='hostProduct'
|
<WaterfallsFlow v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)" :wfList='hostProduct' @itemTap="goDetail"
|
||||||
@itemTap="goDetail" :type="0" :sale_type="2" />
|
:type="0" :sale_type="2" />
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<view class="goods_list" v-else>
|
<view class="goods_list" v-else>
|
||||||
@ -183,8 +180,7 @@
|
|||||||
<text> {{item.service_phone}}</text>
|
<text> {{item.service_phone}}</text>
|
||||||
<u--image style="margin-left: 28rpx;" v-if="item.mer_take_time" :showLoading="true"
|
<u--image style="margin-left: 28rpx;" v-if="item.mer_take_time" :showLoading="true"
|
||||||
src="/static/images/GXSC/SJ.png" width="33.85rpx" height="33.85rpx"></u--image>
|
src="/static/images/GXSC/SJ.png" width="33.85rpx" height="33.85rpx"></u--image>
|
||||||
<text
|
<text v-if="item.mer_take_time">{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
|
||||||
v-if="item.mer_take_time">{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="content-two">
|
<view class="content-two">
|
||||||
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
|
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
|
||||||
@ -201,7 +197,6 @@
|
|||||||
<image :src="`${domain}/static/images/noCart.png`"></image>
|
<image :src="`${domain}/static/images/noCart.png`"></image>
|
||||||
<view>暂无商品,看点别的吧</view>
|
<view>暂无商品,看点别的吧</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 弹框大分类 -->
|
<!-- 弹框大分类 -->
|
||||||
@ -320,10 +315,9 @@
|
|||||||
bigTypeDomInfo: null,
|
bigTypeDomInfo: null,
|
||||||
smallTypeDomInfo: null,
|
smallTypeDomInfo: null,
|
||||||
categoryWrapHeight: 0,
|
categoryWrapHeight: 0,
|
||||||
wrapHeight: 332,
|
wrapHeight: 360,
|
||||||
isShowSmall: false,
|
touchstarty: 0,
|
||||||
scrollTop: 0,
|
scrollIndex: ''
|
||||||
isTriggered: false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -366,54 +360,54 @@
|
|||||||
index: 1,
|
index: 1,
|
||||||
text: "批发",
|
text: "批发",
|
||||||
selectedIconPath: "/static/tabbar_icon/b-a.png"
|
selectedIconPath: "/static/tabbar_icon/b-a.png"
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
// watch: {
|
||||||
'where.cate_pid'(newVal, oldVal) {
|
// 'where.cate_pid'(newVal, oldVal) {
|
||||||
if (newVal && !oldVal) {
|
// if (newVal && !oldVal) {
|
||||||
this.wrapHeight = this.tabsCurr == 2 ? 400 : (332 + 48);
|
// this.isShowSmall = true;
|
||||||
this.isShowSmall = true;
|
// }
|
||||||
}
|
// if (!newVal && oldVal) {
|
||||||
if (!newVal && oldVal) {
|
// this.isShowSmall = false;
|
||||||
this.wrapHeight = this.tabsCurr == 2 ? 400 : 332;
|
// }
|
||||||
this.isShowSmall = false;
|
// }
|
||||||
}
|
// },
|
||||||
}
|
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.initData(true, true);
|
||||||
|
},
|
||||||
|
|
||||||
|
onReachBottom() {
|
||||||
|
this.initData(false, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
// 开始滑动
|
||||||
|
onTouchStart(e) {
|
||||||
|
this.touchstarty = e.touches[0].clientY;
|
||||||
|
},
|
||||||
|
|
||||||
// 下拉加载
|
// 开始移动
|
||||||
onPulling() {
|
onTouchMove(e) {
|
||||||
if (!this.isTriggered) {
|
this.$nextTick(() => {
|
||||||
this.isTriggered = true;
|
let deltaY = e.changedTouches[0].clientY - this.touchstarty;
|
||||||
this.initData(true, true);
|
if (deltaY <= 0) {
|
||||||
|
console.log("上滑")
|
||||||
|
this.wrapHeight = 0;
|
||||||
|
} else {
|
||||||
|
console.log('下滑');
|
||||||
|
this.getHeight();
|
||||||
}
|
}
|
||||||
},
|
this.$forceUpdate();
|
||||||
onRefresh(e) {
|
})
|
||||||
this.isTriggered = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
onScrollBottom(e) {
|
|
||||||
this.initData(false, true);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onAllCategory() {
|
onAllCategory() {
|
||||||
this.$refs.popup.open();
|
this.$refs.popup.open();
|
||||||
},
|
},
|
||||||
|
|
||||||
onScroll(e) {
|
|
||||||
if (this.scrollTop >= e.target.scrollTop) { //上拉
|
|
||||||
this.wrapHeight = this.tabsCurr == 2 ? 400 : 332;
|
|
||||||
if (this.where.cate_pid) this.wrapHeight = this.wrapHeight + 48;
|
|
||||||
} else {
|
|
||||||
this.wrapHeight = 0;
|
|
||||||
}
|
|
||||||
this.scrollTop = e.target.scrollTop;
|
|
||||||
},
|
|
||||||
|
|
||||||
initData(re = false, stop = false) {
|
initData(re = false, stop = false) {
|
||||||
if (!stop) this.getStoreCategory();
|
if (!stop) this.getStoreCategory();
|
||||||
if (this.tabsCurr == 2 && this.subCurr == 1) this.storeMerchantList(re, stop);
|
if (this.tabsCurr == 2 && this.subCurr == 1) this.storeMerchantList(re, stop);
|
||||||
@ -435,6 +429,7 @@
|
|||||||
this.cate_change = 0;
|
this.cate_change = 0;
|
||||||
this.cate_change_children = 0;
|
this.cate_change_children = 0;
|
||||||
this.initData(true);
|
this.initData(true);
|
||||||
|
this.getHeight()
|
||||||
},
|
},
|
||||||
toOrder(type, index = -1) {
|
toOrder(type, index = -1) {
|
||||||
if (this.where.order == type) {
|
if (this.where.order == type) {
|
||||||
@ -484,9 +479,58 @@
|
|||||||
this.cate_change = 0;
|
this.cate_change = 0;
|
||||||
this.cate_change_children = 0;
|
this.cate_change_children = 0;
|
||||||
if (this.tabsCurr != 2 || (this.tabsCurr == 2 && this.subCurr != 1)) this.where.mer_type = e;
|
if (this.tabsCurr != 2 || (this.tabsCurr == 2 && this.subCurr != 1)) this.where.mer_type = e;
|
||||||
this.wrapHeight = this.tabsCurr == 2 ? 400 : this.where.cate_pid ? (332 + 48) : 332;
|
|
||||||
|
this.getHeight();
|
||||||
this.initData(true);
|
this.initData(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 高度判断
|
||||||
|
getHeight() {
|
||||||
|
|
||||||
|
console.log(this.store_category_children);
|
||||||
|
|
||||||
|
if (this.tabsCurr == 1) {
|
||||||
|
|
||||||
|
if (this.where.cate_pid) {
|
||||||
|
if (this.deduction_rate) {
|
||||||
|
this.wrapHeight = 460;
|
||||||
|
} else {
|
||||||
|
this.wrapHeight = 410;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this.deduction_rate) {
|
||||||
|
this.wrapHeight = 410;
|
||||||
|
} else {
|
||||||
|
this.wrapHeight = 360;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if (this.store_category_children.length > 1 && this.deduction_rate) {
|
||||||
|
// this.wrapHeight = 460;
|
||||||
|
// } else if (this.store_category_children.length == 1 || !this.deduction_rate) {
|
||||||
|
// this.wrapHeight = 410;
|
||||||
|
// } else {
|
||||||
|
// if (this.cate_change || this.deduction_rate) {
|
||||||
|
// this.wrapHeight = 410;
|
||||||
|
// } else {
|
||||||
|
// this.wrapHeight = 360;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
} else if (this.tabsCurr == 2) {
|
||||||
|
if (this.subCurr == 1) {
|
||||||
|
this.wrapHeight = 400;
|
||||||
|
} else {
|
||||||
|
this.wrapHeight = 440;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.wrapHeight = 360;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onChangeDeductionRate() {
|
||||||
|
this.deduction_rate = !this.deduction_rate;
|
||||||
|
this.getHeight()
|
||||||
|
},
|
||||||
|
|
||||||
changeCate(e) {
|
changeCate(e) {
|
||||||
this.cate_change = e;
|
this.cate_change = e;
|
||||||
this.store_category_children = [];
|
this.store_category_children = [];
|
||||||
@ -507,8 +551,14 @@
|
|||||||
this.where.cate_pid = this.store_category[e].store_category_id;
|
this.where.cate_pid = this.store_category[e].store_category_id;
|
||||||
this.where.cate_id = "";
|
this.where.cate_id = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getProductslist(true);
|
this.getProductslist(true);
|
||||||
|
|
||||||
|
this.getHeight();
|
||||||
|
|
||||||
|
// scrollView 滚动到对应选择的分类
|
||||||
|
this.scrollIndex = 'scroll' + e;
|
||||||
|
|
||||||
// 关闭popup
|
// 关闭popup
|
||||||
this.$refs.popup && this.$refs.popup.close();
|
this.$refs.popup && this.$refs.popup.close();
|
||||||
},
|
},
|
||||||
@ -564,9 +614,9 @@
|
|||||||
if (this.where.order) this.where.rand = 0;
|
if (this.where.order) this.where.rand = 0;
|
||||||
else this.where.rand = 1;
|
else this.where.rand = 1;
|
||||||
getProductslist(this.where, true).then(res => {
|
getProductslist(this.where, true).then(res => {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
this.where.limit = res.data.limit
|
this.where.limit = res.data.limit
|
||||||
this.where.page = res.data.page
|
this.where.page = res.data.page
|
||||||
this.isTriggered = false;
|
|
||||||
if (reLoad) this.hostProduct = [];
|
if (reLoad) this.hostProduct = [];
|
||||||
this.hostProduct = [...this.hostProduct, ...res.data.list];
|
this.hostProduct = [...this.hostProduct, ...res.data.list];
|
||||||
this.isLoading = 0;
|
this.isLoading = 0;
|
||||||
@ -583,7 +633,6 @@
|
|||||||
if (this.isLoading == -1) return;
|
if (this.isLoading == -1) return;
|
||||||
this.isLoading = 1;
|
this.isLoading = 1;
|
||||||
storeMerchantList(this.where).then(res => {
|
storeMerchantList(this.where).then(res => {
|
||||||
this.isTriggered = false;
|
|
||||||
this.shopList = [...this.shopList, ...res.data.list];
|
this.shopList = [...this.shopList, ...res.data.list];
|
||||||
this.isLoading = 0;
|
this.isLoading = 0;
|
||||||
if (res.data.list.length < this.where.limit) this.isLoading = -1;
|
if (res.data.list.length < this.where.limit) this.isLoading = -1;
|
||||||
@ -627,23 +676,11 @@
|
|||||||
|
|
||||||
.wholeSale {
|
.wholeSale {
|
||||||
.wholeSale-header {
|
.wholeSale-header {
|
||||||
position: sticky;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 90;
|
z-index: 90;
|
||||||
margin-bottom: 20rpx;
|
|
||||||
|
|
||||||
.wholeSale-header-wrap {
|
|
||||||
background-color: #40AE36;
|
background-color: #40AE36;
|
||||||
}
|
width: 100%;
|
||||||
|
|
||||||
.wholeSale-header-search-wrap {
|
|
||||||
position: sticky;
|
|
||||||
top: calc(82rpx + var(--status-bar-height));
|
|
||||||
transition: height .5s;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 30rpx 20rpx 0;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.scrollview {
|
.scrollview {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -678,12 +715,27 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wholeSale-header-search-wrap {
|
||||||
|
position: fixed;
|
||||||
|
top: calc(98rpx + var(--status-bar-height));
|
||||||
|
z-index: 89;
|
||||||
|
width: 100%;
|
||||||
|
transition: height .5s;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0rpx 20rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
.wholeSale-con {
|
.wholeSale-con {
|
||||||
|
position: relative;
|
||||||
|
z-index: index;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wholeSale-nav {
|
||||||
|
padding: 20rpx 0;
|
||||||
|
|
||||||
.search_content {
|
.search_content {
|
||||||
margin-bottom: 40rpx;
|
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
padding: 2px 2px 2px 21.05rpx;
|
padding: 2px 2px 2px 21.05rpx;
|
||||||
border-radius: 80rpx;
|
border-radius: 80rpx;
|
||||||
@ -716,6 +768,7 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.category {
|
.category {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -774,23 +827,22 @@
|
|||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: #f3f3f3;
|
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 4rpx;
|
|
||||||
width: 70rpx;
|
width: 70rpx;
|
||||||
color: #919191;
|
color: #919191;
|
||||||
|
box-shadow: 0px 0px 60rpx #c5c5c5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cate {
|
.cate {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-bottom: 30rpx;
|
// margin-bottom: 30rpx;
|
||||||
|
|
||||||
.cate-wrap {
|
.cate-wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -883,7 +935,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20rpx 50rpx;
|
padding: 10rpx 50rpx;
|
||||||
|
|
||||||
[class^=comprehensive-] {
|
[class^=comprehensive-] {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -127,16 +127,16 @@ const actions = {
|
|||||||
commit(state.mapping[permissionID].methods, false)
|
commit(state.mapping[permissionID].methods, false)
|
||||||
} else {
|
} else {
|
||||||
commit(state.mapping[permissionID].methods, true)
|
commit(state.mapping[permissionID].methods, true)
|
||||||
uni.showModal({
|
// uni.showModal({
|
||||||
title: '提示',
|
// title: '提示',
|
||||||
content: '操作权限已被拒绝,请手动前往设置',
|
// content: '操作权限已被拒绝,请手动前往设置',
|
||||||
confirmText: "立即设置",
|
// confirmText: "立即设置",
|
||||||
success: (res) => {
|
// success: (res) => {
|
||||||
if (res.confirm) {
|
// if (res.confirm) {
|
||||||
dispatch('gotoAppPermissionSetting')
|
// dispatch('gotoAppPermissionSetting')
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
if (viewObj) viewObj.close()
|
if (viewObj) viewObj.close()
|
||||||
resolve(result);
|
resolve(result);
|
||||||
|
@ -241,13 +241,22 @@ function gotoAppPermissionSetting() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isOpenGps() {
|
||||||
|
var context = plus.android.importClass("android.content.Context");
|
||||||
|
var locationManager = plus.android.importClass("android.location.LocationManager");
|
||||||
|
var main = plus.android.runtimeMainActivity();
|
||||||
|
var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
||||||
|
return mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
|
||||||
|
}
|
||||||
|
|
||||||
const permission = {
|
const permission = {
|
||||||
get isIOS() {
|
get isIOS() {
|
||||||
return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getSystemInfoSync().platform === 'ios')
|
return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getSystemInfoSync().platform === 'ios')
|
||||||
},
|
},
|
||||||
requestIOS: requestIOS,
|
requestIOS: requestIOS,
|
||||||
requestAndroid: requestAndroid,
|
requestAndroid: requestAndroid,
|
||||||
gotoAppSetting: gotoAppPermissionSetting
|
gotoAppSetting: gotoAppPermissionSetting,
|
||||||
|
isOpenGps
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = permission
|
module.exports = permission
|
@ -33,6 +33,30 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/*判断app授权是否超时
|
||||||
|
key:授权值
|
||||||
|
time:过期时间
|
||||||
|
*/
|
||||||
|
isOverTime: (key, time) => {
|
||||||
|
let FLAG = false;
|
||||||
|
const AUTH_TYPE = uni.getStorageSync(key);
|
||||||
|
// 当前时间
|
||||||
|
const CURR_TIME = +new Date();
|
||||||
|
|
||||||
|
if (!AUTH_TYPE) {
|
||||||
|
uni.setStorageSync(key, time + CURR_TIME);
|
||||||
|
FLAG = false;
|
||||||
|
} else {
|
||||||
|
// 判断两天时间是否过期
|
||||||
|
if (CURR_TIME < AUTH_TYPE) { //未过期
|
||||||
|
FLAG = false;
|
||||||
|
} else {
|
||||||
|
FLAG = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FLAG;
|
||||||
|
},
|
||||||
|
|
||||||
//复制
|
//复制
|
||||||
uniCopy: ({
|
uniCopy: ({
|
||||||
content,
|
content,
|
||||||
@ -865,6 +889,8 @@ export default {
|
|||||||
if (typeof list != 'object') return [];
|
if (typeof list != 'object') return [];
|
||||||
if (sp === undefined) sp = [];
|
if (sp === undefined) sp = [];
|
||||||
for (var i = 0; i < list.length; i++) {
|
for (var i = 0; i < list.length; i++) {
|
||||||
|
let product = sp.find(item => item.product_id == list[i].product_id);
|
||||||
|
if (!product)
|
||||||
sp.push(list[i]);
|
sp.push(list[i]);
|
||||||
}
|
}
|
||||||
return sp;
|
return sp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user