Browse Source

2023-02-15

master
guoxing 2 years ago
parent
commit
a83172b297
  1. 386
      mallplusui-uniapp-app/pages/index/index.vue
  2. 6
      mallplusui-uniapp-app/pagesA/product/groupList.vue
  3. 14
      mallplusui-uniapp-app/pagesA/product/list.vue
  4. 6
      mallplusui-uniapp-app/pagesA/product/product.vue
  5. BIN
      mallplusui-uniapp-app/static/njfw_icon.png
  6. BIN
      mallplusui-uniapp-app/static/nywz_icon.png
  7. BIN
      mallplusui-uniapp-app/static/shwz_icon.png

386
mallplusui-uniapp-app/pages/index/index.vue

@ -1,60 +1,47 @@
<template>
<view class="container">
<!-- 小程序头部兼容 -->
<!-- #ifdef MP -->
<nav-bar>汇融云链</nav-bar>
<view class="MP-search" @click="search()" style=""><input class="MP-search-input" type="text" disabled="true"
placeholder="输入关键字搜索" /></view>
<!-- #endif -->
<!-- 头部轮播 -->
<!-- #ifdef MP -->
<view class="carousel-section" style="margin-top: 80upx;">
<!-- #endif -->
<!-- #ifndef MP -->
<view class="carousel-section">
<!-- #endif -->
<!-- 标题栏和状态栏占位符 -->
<view class="titleNview-placing"></view>
<!-- 背景色区域 -->
<view class="titleNview-background" :style="{ backgroundColor: titleNViewBackground }"></view>
<swiper class="carousel" circular @change="swiperChange">
<swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
@click="navToTabPage(item.url)">
<image :src="item.pic" />
</swiper-item>
</swiper>
<!-- 自定义swiper指示器 -->
<view class="swiper-dots">
<text class="num">{{ swiperCurrent + 1 }}</text>
<text class="sign">/</text>
<text class="num">{{ swiperLength }}</text>
</view>
<view class="carousel-section">
<!-- 标题栏和状态栏占位符 -->
<view class="titleNview-placing"></view>
<!-- 背景色区域 -->
<view class="titleNview-background" :style="{ backgroundColor: titleNViewBackground }"></view>
<swiper class="carousel" circular @change="swiperChange">
<swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
@click="navToTabPage(item.url)">
<image :src="item.pic" />
</swiper-item>
</swiper>
<!-- 自定义swiper指示器 -->
<view class="swiper-dots">
<text class="num">{{ swiperCurrent + 1 }}</text>
<text class="sign">/</text>
<text class="num">{{ swiperLength }}</text>
</view>
<!-- 分类 -->
<view class="cate-section">
<view class="cate-item" @click="navToTabPage('../../pagesA/product/list?isFenxiao=1')">
<image src="/static/temp//antFill-gift.png"></image>
<text>农业物资</text>
</view>
<view class="cate-item" @click="navToTabPage('../../pagesA/product/list?isVip=1')">
<image src="/static/temp/fasfausers.png"></image>
<text>生活物资</text>
</view>
<view class="cate-item" @click="navToTabPage('../../pagesA/product/groupList')">
<image src="/static/temp/fabfa-dropbox.png"></image>
<text>拼团特价</text>
</view>
<view class="cate-item" @click="navToTabPage('/pagesU/notice/subjectList')">
<image src="/static/temp/antFill-home.png"></image>
<text>农机服务</text>
</view>
<!-- <view class="cate-item" @click="navToTabPage('../../pagesA/build/communityList')">
</view>
<!-- 分类 -->
<view class="cate-section">
<view class="cate-item" @click="navToTabPage('../../pagesA/product/list?isFenxiao=1')">
<image src="/static/nywz_icon.png"></image>
<text>农业物资</text>
</view>
<view class="cate-item" @click="navToTabPage('../../pagesA/product/list?isVip=1')">
<image src="/static/shwz_icon.png"></image>
<text>生活物资</text>
</view>
<view class="cate-item" @click="navToTabPage('../../pagesA/product/groupList')">
<image src="/static/temp/fabfa-dropbox.png"></image>
<text>拼团特价</text>
</view>
<view class="cate-item" @click="navToTabPage('/pagesU/notice/subjectList')">
<image src="/static/njfw_icon.png"></image>
<text>农机服务</text>
</view>
<!-- <view class="cate-item" @click="navToTabPage('../../pagesA/build/communityList')">
<image src="/static/temp/antFill-home.png"></image>
<text>农村社区</text>
</view> -->
</view>
<!-- <view class="cate-section">
</view>
<!-- <view class="cate-section">
<view class="cate-item" @click="navToTabPage('../../pagesA/product/list?isFenxiao=1')">
<image src="/static/temp/fasfa-sitemap.png"></image>
<text>分销商品</text>
@ -77,37 +64,37 @@
</view>
</view> -->
<!-- 秒杀楼层 https://s.click.taobao.com/Wds7c1w -->
<view class="seckill-section m-t"
v-if="homeFlashPromotion.flashSessionInfoList && homeFlashPromotion.flashSessionInfoList.length > 0">
<view class="s-header">
<view class="" style="width: 80%;display: flex;flex-direction: row;align-items: center;">
<image class="s-img" src="/static/temp/secskill-img.jpg" mode="widthFix"
@click="navToDetailPageL('https://s.click.taobao.com/Wds7c1w')"></image>
<text class="tip" style="margin-left: 20upx;">{{ homeFlashPromotion.flashName }}</text>
<view class="s-header" style="width:35%;margin-left: 20upx;">
<text class="tip">{{ homeFlashPromotion.startTime || '18:00' }}</text>
<text class="tip">~</text>
<text class="tip">{{ homeFlashPromotion.endTime || '24:00' }}</text>
</view>
<!-- 秒杀楼层 https://s.click.taobao.com/Wds7c1w -->
<view class="seckill-section m-t"
v-if="homeFlashPromotion.flashSessionInfoList && homeFlashPromotion.flashSessionInfoList.length > 0">
<view class="s-header">
<view class="" style="width: 80%;display: flex;flex-direction: row;align-items: center;">
<image class="s-img" src="/static/temp/secskill-img.jpg" mode="widthFix"
@click="navToDetailPageL('https://s.click.taobao.com/Wds7c1w')"></image>
<text class="tip" style="margin-left: 20upx;">{{ homeFlashPromotion.flashName }}</text>
<view class="s-header" style="width:35%;margin-left: 20upx;">
<text class="tip">{{ homeFlashPromotion.startTime || '18:00' }}</text>
<text class="tip">~</text>
<text class="tip">{{ homeFlashPromotion.endTime || '24:00' }}</text>
</view>
<text class="yticon icon-you" @click="navToTabPage('/pages/index/secskill')"></text>
</view>
<view v-if="item2.productList && item2.productList.length > 0"
v-for="(item2, index2) in homeFlashPromotion.flashSessionInfoList" :key="index2">
<scroll-view class="floor-list" scroll-x>
<view class="scoll-wrapper">
<view v-for="(item, index) in item2.productList" :key="index" class="floor-item"
@click="navToSkillDetailPage(item)">
<image :src="item.productImg" mode="aspectFill"></image>
<text class="title clamp">{{ item.productName }}</text>
<text class="price">{{ item.flashPromotionPrice }}</text>
</view>
<text class="yticon icon-you" @click="navToTabPage('/pages/index/secskill')"></text>
</view>
<view v-if="item2.productList && item2.productList.length > 0"
v-for="(item2, index2) in homeFlashPromotion.flashSessionInfoList" :key="index2">
<scroll-view class="floor-list" scroll-x>
<view class="scoll-wrapper">
<view v-for="(item, index) in item2.productList" :key="index" class="floor-item"
@click="navToSkillDetailPage(item)">
<image :src="item.productImg" mode="aspectFill"></image>
<text class="title clamp">{{ item.productName }}</text>
<text class="price">{{ item.flashPromotionPrice }}</text>
</view>
</scroll-view>
</view>
</view>
</scroll-view>
</view>
<!-- <view class="f-header m-t" @click="navToTabPage('../../pagesC/store/storeList')">
</view>
<!-- <view class="f-header m-t" @click="navToTabPage('../../pagesC/store/storeList')">
<image src="/static/temp/nav1.png"></image>
<view class="tit-box">
<text class="tit">农店推荐</text>
@ -124,143 +111,142 @@
</view>
</view> -->
<!-- 优惠券 https://s.click.taobao.com/OPh3c1w -->
<coupon v-for="(item, index) in couponList" :key="index" v-bind:item="item" theme="#ff0000"></coupon>
<!-- 优惠券 https://s.click.taobao.com/OPh3c1w -->
<coupon v-for="(item, index) in couponList" :key="index" v-bind:item="item" theme="#ff0000"></coupon>
<!-- 团购楼层 -->
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/groupList')"
v-if="groupHotGoodsList.length > 0">
<image src="/static/temp/h1.png"></image>
<view class="tit-box">
<text class="tit">精品团购</text>
</view>
<text class="yticon icon-you"></text>
<!-- 团购楼层 -->
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/groupList')"
v-if="groupHotGoodsList.length > 0">
<image src="/static/temp/h1.png"></image>
<view class="tit-box">
<text class="tit">精品团购</text>
</view>
<view class="group-section" v-if="groupHotGoodsList.length > 0">
<swiper class="g-swiper" :duration="500">
<swiper-item class="g-swiper-item" v-for="(item, index) in groupHotGoodsList" :key="index"
v-if="index % 2 === 0" @click="navToGroupDetailPage(item)">
<view class="g-item left">
<image :src="item.goods.pic" mode="aspectFill"></image>
<view class="t-box">
<text class="title clamp">{{ item.goods.title }}</text>
<view class="price-box">
<text class="price">惠农团购价{{ item.groupPrice }}</text>
<text class="m-price">{{ item.goods.price }}</text>
</view>
<view class="pro-box">
<view class="progress-box"><progress percent="72" activeColor="#fa436a" active
stroke-width="6" /></view>
<text>{{ item.maxPeople }}人成团</text>
</view>
<text class="yticon icon-you"></text>
</view>
<view class="group-section" v-if="groupHotGoodsList.length > 0">
<swiper class="g-swiper" :duration="500">
<swiper-item class="g-swiper-item" v-for="(item, index) in groupHotGoodsList" :key="index"
v-if="index % 2 === 0" @click="navToGroupDetailPage(item)">
<view class="g-item left">
<image :src="item.goods.pic" mode="aspectFill"></image>
<view class="t-box">
<text class="title clamp">{{ item.goods.title }}</text>
<view class="price-box">
<text class="price">惠农团购价{{ item.groupPrice }}</text>
<text class="m-price">{{ item.goods.price }}</text>
</view>
<view class="pro-box">
<view class="progress-box"><progress percent="72" activeColor="#fa436a" active
stroke-width="6" /></view>
<text>{{ item.maxPeople }}人成团</text>
</view>
</view>
</swiper-item>
</swiper>
</view>
<!-- 分类推荐楼层 -->
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list')" v-if="false">
<image src="/static/temp/h1.png"></image>
<view class="tit-box">
<text class="tit">分类精选</text>
</view>
<text class="yticon icon-you"></text>
</view>
<view class="hot-floor" v-if="item1.goodsList.length > 0" v-for="(item1, index) in cat_list" :key="index">
<view class="floor-img-box">
<image class="floor-img" :src="item1.pic" mode="scaleToFill"></image>
</view>
<scroll-view class="floor-list" scroll-x>
<view class="scoll-wrapper">
<view v-for="(item, index) in item1.goodsList" :key="index" class="floor-item"
@click="navToDetailPage(item)">
<image :src="item.pic" mode="aspectFill"></image>
<text class="title clamp">{{ item.name }}</text>
<text class="price">{{ item.price }}</text>
</view>
<view class="more" @click="navToList()">
<text>查看全部</text>
<text>More+</text>
</view>
</view>
</scroll-view>
</view>
</swiper-item>
</swiper>
</view>
<!-- 新品推荐 -->
<view v-if='homeNewProductList && homeNewProductList.length>0' class="f-header m-t"
@click="navToTabPage('../../pagesA/product/list')">
<image src="/static/temp/h1.png"></image>
<view class="tit-box">
<text class="tit">新品推荐</text>
</view>
<text class="yticon icon-you"></text>
<!-- 分类推荐楼层 -->
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list')" v-if="false">
<image src="/static/temp/h1.png"></image>
<view class="tit-box">
<text class="tit">分类精选</text>
</view>
<view class="guess-section">
<view v-for="(item, index) in homeNewProductList" :key="index" class="guess-item"
@click="navToDetailPage1(item)">
<view class="image-wrapper">
<text class="yticon icon-you"></text>
</view>
<view class="hot-floor" v-if="item1.goodsList.length > 0" v-for="(item1, index) in cat_list" :key="index">
<view class="floor-img-box">
<image class="floor-img" :src="item1.pic" mode="scaleToFill"></image>
</view>
<scroll-view class="floor-list" scroll-x>
<view class="scoll-wrapper">
<view v-for="(item, index) in item1.goodsList" :key="index" class="floor-item"
@click="navToDetailPage(item)">
<image :src="item.pic" mode="aspectFill"></image>
<text class="title clamp">{{ item.name }}</text>
<text class="price">{{ item.price }}</text>
</view>
<text class="title clamp">{{ item.productName }}</text>
<view>
<text class="price">惠农价{{ item.price }}</text>
<text class="m-price"> 县区商超价{{ item.price }}</text>
<view class="more" @click="navToList()">
<text>查看全部</text>
<text>More+</text>
</view>
</view>
</scroll-view>
</view>
<!-- 新品推荐 -->
<view v-if='homeNewProductList && homeNewProductList.length>0' class="f-header m-t"
@click="navToTabPage('../../pagesA/product/list')">
<image src="/static/temp/h1.png"></image>
<view class="tit-box">
<text class="tit">新品推荐</text>
</view>
<!-- 人气推荐 -->
<view v-if='homeRecommendProductList && homeRecommendProductList.length>0' class="f-header m-t"
@click="navToTabPage('../../pagesA/product/list')">
<image src="/static/temp/h1.png"></image>
<view class="tit-box">
<text class="tit">人气推荐</text>
<text class="yticon icon-you"></text>
</view>
<view class="guess-section">
<view v-for="(item, index) in homeNewProductList" :key="index" class="guess-item"
@click="navToDetailPage1(item)">
<view class="image-wrapper">
<image :src="item.pic" mode="aspectFill"></image>
</view>
<text class="yticon icon-you"></text>
<text class="title clamp">{{ item.productName }}</text>
<view>
<text class="price">惠农价{{ item.price }}</text>
<!-- <text class="m-price"> 县区商超价{{ item.price }}</text> -->
</view>
</view>
<view class="guess-section">
<view v-for="(item, index) in homeRecommendProductList" :key="index" class="guess-item"
@click="navToDetailPage1(item)">
<view class="image-wrapper">
<image :src="item.pic" mode="aspectFill"></image>
</view>
<text class="title clamp">{{ item.name }}</text>
<view>
<text class="price">惠农价{{ item.price }}</text>
<text class="m-price">县区商超价{{ item.price }}</text>
</view>
</view>
<!-- 人气推荐 -->
<view v-if='homeRecommendProductList && homeRecommendProductList.length>0' class="f-header m-t"
@click="navToTabPage('../../pagesA/product/list')">
<image src="/static/temp/h1.png"></image>
<view class="tit-box">
<text class="tit">人气推荐</text>
</view>
<text class="yticon icon-you"></text>
</view>
<view class="guess-section">
<view v-for="(item, index) in homeRecommendProductList" :key="index" class="guess-item"
@click="navToDetailPage1(item)">
<view class="image-wrapper">
<image :src="item.pic" mode="aspectFill"></image>
</view>
<text class="title clamp">{{ item.productName }}</text>
<view>
<text class="price">惠农价{{ item.price }}</text>
<!-- <text class="m-price">县区商超价{{ item.price }}</text> -->
</view>
</view>
<!-- 新品上市 -->
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list')">
<image src="/static/temp/h1.png"></image>
<view class="tit-box">
<text class="tit">新品上市</text>
</view>
<text class="yticon icon-you"></text>
</view>
<!-- 新品上市 -->
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list')">
<image src="/static/temp/h1.png"></image>
<view class="tit-box">
<text class="tit">新品上市</text>
</view>
<text class="yticon icon-you"></text>
</view>
<view class="guess-section">
<view v-for="(item, index) in newProductList" :key="index" class="guess-item"
@click="navToDetailPage(item)">
<view class="image-wrapper">
<image :src="item.pic" mode="aspectFill"></image>
</view>
<text class="title clamp">{{ item.name }}</text>
<text class="label">{{ item.storeName }}</text>
<text class="price">惠农价{{ item.price }}</text>
<view class="guess-section">
<view v-for="(item, index) in newProductList" :key="index" class="guess-item"
@click="navToDetailPage(item)">
<view class="image-wrapper">
<image :src="item.pic" mode="aspectFill"></image>
</view>
<uni-load-more :status="loadingType"></uni-load-more>
<text class="title clamp">{{ item.name }}</text>
<!-- <text class="label">{{ item.storeName }}</text> -->
<text class="price">惠农价{{ item.price }}</text>
</view>
<!-- <mallplusCopyright></mallplusCopyright> -->
<uni-load-more :status="loadingType"></uni-load-more>
</view>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>
@ -314,6 +300,7 @@
this.getNewProductList();
},
onPullDownRefresh() {
console.log("onPullDownRefresh")
this.pageNum = this.pageNum + 1;
this.getNewProductList('refresh');
@ -446,6 +433,7 @@
* 加载首页数据
*/
async loadData() {
this.getBanner();
this.getHotGoodsList();
//this.getFlashPromotion();
@ -453,6 +441,18 @@
this.getStoreList();
this.homeNewProduct();
this.homeRecommendProduct();
uni.getSystemInfo({
success: res => {
console.log("屏幕宽度", res.windowWidth)
}
})
uni.createSelectorQuery().in(this).select(".carousel-section").boundingClientRect(data => {
console.log("屏幕宽度", data.height)
// {"id":"","dataset":{},"left":12,"right":308,"top":12,"bottom":315,"width":296,"height":303}
}).exec(function(res) {
// exec便
})
},
/**
@ -462,7 +462,7 @@
let params = {};
let groupHotGoodsList = await Api.apiCall('get', Api.index.homeNewProduct, params);
if (groupHotGoodsList) {
console.log("新品推荐》》》》》",groupHotGoodsList.records)
console.log("新品推荐》》》》》", groupHotGoodsList.records)
this.homeNewProductList = groupHotGoodsList.records;
}
@ -474,7 +474,7 @@
async homeRecommendProduct() {
let params = {};
let groupHotGoodsList = await Api.apiCall('get', Api.index.homeRecommendProduct, params);
console.log("人气推荐》》》》》",groupHotGoodsList.records)
console.log("人气推荐》》》》》", groupHotGoodsList.records)
this.homeRecommendProductList = groupHotGoodsList.records;
},
/**
@ -573,7 +573,7 @@
async getHotGoodsList() {
let params = {};
let groupHotGoodsList = await Api.apiCall('get', Api.goods.groupHotGoodsList, params);
console.log("团购信息》》》》》",groupHotGoodsList)
console.log("团购信息》》》》》", groupHotGoodsList)
this.groupHotGoodsList = groupHotGoodsList;
},

6
mallplusui-uniapp-app/pagesA/product/groupList.vue

@ -18,7 +18,7 @@
<text class="title clamp">{{ item.goods.name }}</text>
<view class="price-box">
<text class="price">{{ item.groupPrice }}</text>
<text>原价 {{ item.goods.price }}</text>
<!-- <text>原价 {{ item.goods.price }}</text> -->
</view>
</view>
</view>
@ -395,11 +395,11 @@ page,
color: $font-color-light;
}
.price {
font-size: $font-lg;
font-size: 26upx;
color: $uni-color-primary;
line-height: 1;
&:before {
content: '¥';
content: '惠农团购价¥';
font-size: 26upx;
}
}

14
mallplusui-uniapp-app/pagesA/product/list.vue

@ -19,18 +19,18 @@
<view v-for="(item, index) in goodsList" :key="index" class="goods-item" @click="navToDetailPage(item)">
<view class="image-wrapper"><image :src="item.pic" mode="aspectFill"></image></view>
<text class="title clamp">{{ item.name }}</text>
<view class="price-box" v-if="item.isFenxiao == 1">
<view class="price-box" >
<text class="price">{{ item.price }}</text>
<!-- <text>佣金 ¥{{ item.fenxiaoPrice }}</text> -->
</view>
<view class="price-box" v-if="item.isVip == 1">
<!-- <view class="price-box" v-if="item.isVip == 1">
<text class="price">会员价{{ item.vipPrice }}</text>
<text>商品价 ¥{{ item.price }}</text>
</view>
<view class="price-box" v-else-if="item.isFenxiao == 0 && item.isVip == 0">
</view> -->
<!-- <view class="price-box" v-else-if="item.isFenxiao == 0 && item.isVip == 0">
<text class="price">{{ item.price }}</text>
<text>已售 {{ item.sale }}</text>
</view>
</view> -->
</view>
</view>
<!-- 列表显示 -->
@ -457,12 +457,12 @@ page,
color: $font-color-light;
}
.price {
font-size: $font-lg;
font-size: 26upx;
color: $uni-color-primary;
line-height: 1;
&:before {
content: '惠农价¥';
font-size: $font-lg;
font-size: 26upx;
}
}
}

6
mallplusui-uniapp-app/pagesA/product/product.vue

@ -16,7 +16,7 @@
<text class="price" v-else-if="!goods.vipPrice">惠农价¥{{ goods.price }}</text>
<text class="m-price" v-if="!goods.vipPrice">县区商超价{{ goods.originalPrice }}</text>
<text class="m-price" v-else-if="goods.vipPrice && goods.vipPrice > 0">¥{{ goods.price }}</text>
<text class="price">优惠¥{{ goods.originalPrice- goods.price }}</text>
<text class="price">优惠¥{{ (goods.originalPrice- goods.price) | formatNumber}}</text>
<text class="coupon-tip" v-if="goods.memberRate && goods.memberRate != 10">会员折扣{{ goods.memberRate }}</text>
</view>
<view class="bot-row">
@ -376,6 +376,10 @@ export default {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss');
},
formatNumber(number) {
return new Number(number).toFixed(2);
}
},
methods: {

BIN
mallplusui-uniapp-app/static/njfw_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

BIN
mallplusui-uniapp-app/static/nywz_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
mallplusui-uniapp-app/static/shwz_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Loading…
Cancel
Save