Browse Source

Merge branch 'master' of ssh://8.134.10.79:222/Leadfyy.co/ec.uniapp-master

master
邓平艺 4 years ago
parent
commit
4a7db6b256
  1. 14
      common/styles/iconfont.css
  2. 2
      pages/index/index/index.vue
  3. 127
      pages/index/list/monthlyList.vue
  4. 23
      pages/shop/shopdetail.vue

14
common/styles/iconfont.css

@ -1,8 +1,8 @@
@font-face {
font-family: "lf-iconfont"; /* Project id 2779107 */
src: url('//at.alicdn.com/t/font_2779107_6h2ufg0uxnx.woff2?t=1632991726658') format('woff2'),
url('//at.alicdn.com/t/font_2779107_6h2ufg0uxnx.woff?t=1632991726658') format('woff'),
url('//at.alicdn.com/t/font_2779107_6h2ufg0uxnx.ttf?t=1632991726658') format('truetype');
src: url('//at.alicdn.com/t/font_2779107_d2jv9auseui.woff2?t=1633937660899') format('woff2'),
url('//at.alicdn.com/t/font_2779107_d2jv9auseui.woff?t=1633937660899') format('woff'),
url('//at.alicdn.com/t/font_2779107_d2jv9auseui.ttf?t=1633937660899') format('truetype');
}
.lf-iconfont {
@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-xiangshang_shouqi:before {
content: "\e797";
}
.icon-xiangxia_shousuo:before {
content: "\e798";
}
.icon-kefufenxiermaikefu:before {
content: "\e889";
}

2
pages/index/index/index.vue

@ -44,7 +44,7 @@
<lf-seckill :list="item.value" :title="item.title"></lf-seckill>
</view>
<!-- 广告活动模块根据旧版魔方修改,三张图 -->
<view v-if="item.name == 'micro_page_componet_cube' && item.value && item.value.length && item.type == '3_2'">
<view v-if="item.name == 'micro_page_componet_cube' && item.value && item.value.length && (item.type == '3_1' || item.type == '3_2' || item.type == '3_3')">
<lf-multi-column-ad :cube-data="item.value"></lf-multi-column-ad>
</view>
<!-- 首页发现推荐模块 -->

127
pages/index/list/monthlyList.vue

@ -2,31 +2,39 @@
<view>
<lf-nav :showIcon="true" bgColor="transparent" :spreadOut="false"></lf-nav>
<view class="head">
<image class="img" mode="widthFix" src="https://picsum.photos/200/300?grayscale"></image>
<view class="title">热销榜单</view>
<image class="img" mode="aspectFill" :src="activity_content.topic.image"></image>
<view class="title">{{activity_content.topic.name}}</view>
</view>
<view class="content">
<view class="card" v-for="(item, index) in 7" :key="index" @click="$url('/pages/shop/goodsdetail?id='+ item.id)">
<view class="goods-img">
<image class="img" src="https://picsum.photos/200/300"></image>
<view class="ranking">
<view class="top">{{ item+1 }}</view>
<view class="down"></view>
</view>
</view>
<view class="goods-info">
<view>
<view class="lf-line-2 title">SK-II秋日宠粉体验套装</view>
<view class="desc">月销量324</view>
</view>
<view class="lf-row-between">
<view class="price">
<text>¥888</text>
<scroll-view :style="{height: autoHeight}" :scroll-y="true" :refresher-enabled="true"
:refresher-triggered="isRefresher" @scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh">
<view class="content">
<view class="card" v-for="(item, index) in list" :key="index" @click="$url('/pages/shop/goodsdetail?id='+ item.goods.id)">
<view class="goods-img">
<image class="img" :src="item.goods.img"></image>
<!-- <view class="ranking">
<view class="top">{{ item+1 }}</view>
<view class="down"></view>
</view> -->
</view>
<view class="goods-info">
<view>
<view class="lf-line-2 title">{{item.goods.name}}</view>
<view class="desc">月销量{{item.goods.sale_count}}</view>
</view>
<view class="lf-row-between">
<view class="price">
<text>¥{{item.goods.sell_price}}</text>
</view>
</view>
</view>
</view>
<!-- 空数据的情况 -->
<view class="loading-more">
<text v-if="list.length != 0" :class="{'loading-more-text': loadingClass}">{{ loadingText }}</text>
<lf-nocontent src="/static/images/empty.png" v-else></lf-nocontent>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
@ -34,14 +42,83 @@
export default {
data(){
return {
page: 1,
topic_id: 1,
activity_content: '',
list: [],
isPage: true,
loadingClass: true,
loadingText: '正在加载中',
scrollH: 0,
nav_height: 0,
isRefresher: true,
}
},
onLoad(){
let info = uni.getSystemInfoSync();
this.scrollH = info.screenHeight;
this.getActivityList();
},
computed: {
autoHeight() {
return `calc(${this.scrollH}px - ${this.nav_height}px - 430rpx)`;
}
},
methods: {
//
onScrolltolower() {
if (this.isPage) {
this.page = this.page + 1;
this.getActivityList();
}
},
//
refreshFn(options) {
this.page = 1;
this.isPage = true;
this.loadingClass = true;
this.list = []
this.loadingText = '正在加载中';
this.getActivityList(options);
},
// scroll-view
onRefresherrefresh() {
this.isRefresher = true;
this.refreshFn({
type: 'scrollRefresh'
});
},
getActivityList(options = {}){
this.$http.get({
api: 'api/topic/list',
data: {
topic_id: this.topic_id,
page: this.page
},
header: {
Authorization: this.$cookieStorage.get('user_token')
}
}).then(res => {
this.activity_content = res.data.data
console.log('====',res.data.data)
let isPage = this.page < res.data.data.goods.total ? true : false;
this.isPage = isPage;
if (!isPage) {
this.loadingClass = false;
this.loadingText = '没有更多数据啦~';
}
if (options.type == 'pageRefresh') {
uni.stopPullDownRefresh();
} else if (options.type == 'scrollRefresh') {
this.isRefresher = false;
}
if (this.page == 1) {
this.list = res.data.data.goods.data;
} else {
this.list.push(...res.data.data.goods.data);
}
})
},
}
}
</script>
@ -69,7 +146,7 @@
display: flex;
justify-content: center;
align-items: center;
font-size: 100rpx;
font-size: 60rpx;
color: #FFFFFF;
font-weight: bold;
font-family: '楷体';

23
pages/shop/shopdetail.vue

@ -79,8 +79,12 @@
<u-icon name="search" class="search-icon"></u-icon>
<input class="rom-search" v-model="search_val" @confirm="search" type="text" placeholder="请输入商品名称" />
</view>
<view class="special_tab">
<view class="special_tab" style="position: relative;">
<u-tabs :list="tab_list" active-color="#15716E" inactive-color='#777777' :is-scroll="true" :current="current" @change="tabChange"></u-tabs>
<view style="position: absolute;right: 30rpx;top: 20rpx;display: flex;flex-direction: column;z-index: 9999;" @click="changeSort()">
<u-icon name="arrow-up" style="font-size: 20rpx;" :class="sort=='desc'?'':'lf-special-green'"></u-icon>
<u-icon name="arrow-down" style="font-size: 20rpx;" :class="sort=='desc'?'lf-special-green':''"></u-icon>
</view>
</view>
<swiper :style="{height: '800rpx', width: '750rpx'}" :current="current" @change="swiperChange">
<swiper-item v-for="(tabItem, tabIndex) in tab_list" :key="tabIndex">
@ -119,7 +123,8 @@
brand_id: 0,
detail: {},
search_val: '',
is_collect: false
is_collect: false,
sort: 'desc'
}
},
onLoad(options){
@ -127,6 +132,14 @@
this.getShopDetail();
},
methods: {
changeSort(sort) {
if(this.sort == 'desc') {
this.sort = 'asc';
}else {
this.sort = 'desc';
}
this.getData();
},
//
switchCollect(){
let userInfo = this.$cookieStorage.get('user_token') || {};
@ -212,7 +225,8 @@
},
getData() {
let par = {
brand_id: this.brand_id
brand_id: this.brand_id,
sort: this.sort
}
let orderBy = ['','sale_count','updated_at','sell_price'][this.current];
if(orderBy){
@ -308,6 +322,9 @@
</style>
<style lang="scss" scoped>
.lf-special-green {
color: #15716E!important;
}
.search-icon {
position: relative;
bottom: 0;

Loading…
Cancel
Save