2023-02-22

业务功能完善
This commit is contained in:
2023-02-22 19:58:07 +08:00
parent 190466c9c6
commit 515ae22389
53 changed files with 4148 additions and 1338 deletions

View File

@@ -28,10 +28,10 @@
<image src="/static/shwz_icon.png"></image>
<text>生活物资</text>
</view>
<view class="cate-item" @click="navToTabPage('../../pagesA/product/groupList')">
<!-- <view class="cate-item" @click="navToTabPage('../../pagesA/product/groupList')">
<image src="/static/temp/fabfa-dropbox.png"></image>
<text>拼团特价</text>
</view>
</view> -->
<view class="cate-item" @click="navToTabPage('/pagesU/notice/subjectList')">
<image src="/static/njfw_icon.png"></image>
<text>农机服务</text>
@@ -65,7 +65,7 @@
</view> -->
<!-- 秒杀楼层 https://s.click.taobao.com/Wds7c1w -->
<view class="seckill-section m-t"
<!-- <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;">
@@ -93,7 +93,7 @@
</view>
</scroll-view>
</view>
</view>
</view> -->
<!-- <view class="f-header m-t" @click="navToTabPage('../../pagesC/store/storeList')">
<image src="/static/temp/nav1.png"></image>
<view class="tit-box">
@@ -112,9 +112,10 @@
</view> -->
<!-- 优惠券 https://s.click.taobao.com/OPh3c1w -->
<coupon v-for="(item, index) in couponList" :key="index" v-bind:item="item" theme="#ff0000"></coupon>
<coupon v-for="(item, index) in couponList" :key="index" v-bind:item="item" theme="#ff0000" ref="SubComponent"
@callParentMethod="callParentMethod"></coupon>
<!-- 团购楼层 -->
<!-- 团购楼层
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/groupList')"
v-if="groupHotGoodsList.length > 0">
<image src="/static/temp/h1.png"></image>
@@ -144,10 +145,10 @@
</view>
</swiper-item>
</swiper>
</view>
</view> -->
<!-- 分类推荐楼层 -->
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list')" v-if="false">
<!-- <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>
@@ -172,7 +173,7 @@
</view>
</view>
</scroll-view>
</view>
</view> -->
<!-- 新品推荐 -->
<view v-if='homeNewProductList && homeNewProductList.length>0' class="f-header m-t"
@@ -193,7 +194,7 @@
<text class="title clamp">{{ item.productName }}</text>
<view>
<text class="price">惠农价¥{{ item.price }}</text>
<!-- <text class="m-price"> 县区商超价¥{{ item.price }}</text> -->
<text class="m-price">市场价¥{{ item.originalPrice }}</text>
</view>
@@ -219,17 +220,19 @@
<text class="title clamp">{{ item.productName }}</text>
<view>
<text class="price">惠农价¥{{ item.price }}</text>
<!-- <text class="m-price">县区商超价¥{{ item.price }}</text> -->
<text class="m-price">市场价¥{{ item.originalPrice }}</text>
</view>
</view>
</view>
<!-- 新品上市 -->
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list')">
<!-- <view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list')"> -->
<view class="f-header m-t" @click="navToTabPage('../../pagesA/product/list?isFenxiao=1')">
<image src="/static/temp/h1.png"></image>
<view class="tit-box">
<text class="tit">新品上市</text>
<text class="tit">商品列表</text>
</view>
<text class="yticon icon-you"></text>
</view>
@@ -241,11 +244,14 @@
<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>
<text class="price">惠农价¥{{ item.price }}</text>
<text class="m-price">市场价¥{{ item.originalPrice }}</text>
</view>
</view>
<uni-load-more :status="loadingType"></uni-load-more>
</view>
<uni-load-more :status="loadingType"></uni-load-more>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>
@@ -355,6 +361,20 @@
},
},
methods: {
clickParentMethod() {
console.log('clickParentMethod')
this.$refs.SubComponent.callSubMethod()
},
callParentMethod(val) {
console.log('callParentMethod: ' + val)
// 默认去遍历list集合将集合中的每个元素传入到function的item里
var index = this.couponList.findIndex(function(item) {
return item.id == val.id;
})
this.couponList.splice(index, 1);
},
async sysInfoMethod() {
let params = {};
let list = this.$db.get('sysInfo')
@@ -435,10 +455,10 @@
async loadData() {
this.getBanner();
this.getHotGoodsList();
// this.getHotGoodsList();
//this.getFlashPromotion();
this.getCouponList();
this.getStoreList();
// this.getStoreList();
this.homeNewProduct();
this.homeRecommendProduct();
@@ -532,9 +552,16 @@
} else {
this.loadingType = 'more';
}
// let params = {
// pageNum: this.pageNum
// };
let params = {
pageNum: this.pageNum
};
pageNum: this.pageNum,
productCategoryId: "",
type: 1,
productAttributeCategoryId: ""
};;
let list = await Api.apiCall('get', Api.goods.goodsList, params);
let goodsList = list.records;
@@ -1038,10 +1065,9 @@
}
.m-price {
font-size: $font-sm + 2upx;
text-decoration: line-through;
font-size: $font-sm;
color: $font-color-light;
margin-left: 8upx;
margin-left: 10upx;
}
}
}
@@ -1140,10 +1166,9 @@
}
.m-price {
font-size: $font-sm + 2upx;
text-decoration: line-through;
font-size: $font-sm;
color: $font-color-light;
margin-left: 8upx;
margin-left: 10upx;
}
.pro-box {
@@ -1207,16 +1232,15 @@
}
.price {
font-size: 18px;
font-size: 16px;
color: $uni-color-primary;
line-height: 1;
}
.m-price {
font-size: $font-sm + 2upx;
text-decoration: line-through;
font-size: $font-sm;
color: $font-color-light;
margin-left: 8upx;
margin-left: 10upx;
}
.coupon_box {

View File

@@ -0,0 +1,98 @@
<template>
<view class="container">
<view class="introduce-section">
<text class="title">{{ info.params }}</text>
<view class="bot-row">
<text>{{ info.code }}</text>
<text>{{ info.ctime | formatCreateTime }}</text>
</view>
</view>
<view class="c-list">
<text >{{ info.content }}</text>
</view>
</view>
</template>
<script>
import Api from '@/common/api';
import {
formatDate
} from '@/common/date';
export default {
data() {
return {
info: {
}
};
},
async onLoad() {
// 别问我啥意思。这是官方文档提供的
this.page = this.getOpenerEventChannel();
// 你可以在这里直接接受,这里不是$on
this.page.on('sendTestValue', (data) => {
// 这是data 就是上个页面传递的对象了
console.log("消息", data)
this.info = data.info
})
},
filters: {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'MM-dd')
},
},
methods: {
}
};
</script>
<style lang="scss">
page {
background: $page-color-base;
}
/* 标题简介 */
.introduce-section {
background: #fff;
padding: 20upx 30upx;
.title {
font-size: 32upx;
color: $font-color-dark;
height: 50upx;
line-height: 50upx;
}
.bot-row {
display: flex;
align-items: center;
height: 50upx;
font-size: $font-sm;
color: $font-color-light;
text {
flex: 1;
}
}
}
.c-list {
display: flex;
margin-top: 10px;
height: 850px;
padding: 10rpx;
background-color: #fff;
}
</style>

View File

@@ -0,0 +1,296 @@
<template>
<view class="content">
<view class="goods-list">
<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
<view class="listcard" @click="navToDetailPage(item)">
<view class="listcard-image">
<image :src="item.code=='交易物流'?pic1:pic2" mode="aspectFill"></image>
</view>
<view class="listcard-content">
<view class="listcard-content_title">
<text>{{item.code}}</text>
<text class="text2">{{item.ctime | formatCreateTime }}</text>
</view>
<text class="listcard-content_title_text">{{item.params}}</text>
</view>
</view>
</view>
</view>
<!-- <uni-load-more :status="loadingType"></uni-load-more> -->
</view>
</template>
<script>
import Api from '@/common/api';
import {
formatDate
} from '@/common/date';
export default {
data() {
return {
pageNum: 1,
pic2: "https://desk-fd.zol-img.com.cn/t_s960x600c5/g1/M0B/03/06/ChMljl402K6IOTZbAARWayFg6S4AAQJPwFhuRIABFaD752.jpg",
pic1: "https://ts1.cn.mm.bing.net/th/id/R-C.2ce48cd4a70b48403a56e9ea8c710355?rik=tU9CL%2fR0TMLEYA&riu=http%3a%2f%2fwww.kutoo8.com%2fupload%2fimage%2f63051471%2f4_1920x1080.jpg&ehk=wZm6BwD%2b8TIDXmqxTntxftDP8IzjD8g3hhI6bEwdb54%3d&risl=&pid=ImgRaw&r=0",
goodsList: [
// {
// title: "交易物流",
// pic: "https://desk-fd.zol-img.com.cn/t_s960x600c5/g1/M0B/03/06/ChMljl402K6IOTZbAARWayFg6S4AAQJPwFhuRIABFaD752.jpg",
// createTime: "02-12",
// content: "您的订单商品已经到取货点请在7日内取出。",
// },
// {
// title: "云链助手",
// pic: "https://ts1.cn.mm.bing.net/th/id/R-C.2ce48cd4a70b48403a56e9ea8c710355?rik=tU9CL%2fR0TMLEYA&riu=http%3a%2f%2fwww.kutoo8.com%2fupload%2fimage%2f63051471%2f4_1920x1080.jpg&ehk=wZm6BwD%2b8TIDXmqxTntxftDP8IzjD8g3hhI6bEwdb54%3d&risl=&pid=ImgRaw&r=0",
// createTime: "01-10",
// content: "春天已经至,已到施肥时间。",
// }
]
};
},
onLoad(options) {
// #ifdef H5
this.headerTop = document.getElementsByTagName('uni-page-head')[0].offsetHeight + 'px';
// #endif
// this.loadData();
},
onShow() {
this.loadData();
},
onPageScroll(e) {
//兼容iOS端下拉时顶部漂移
// if (e.scrollTop >= 0) {
// this.headerPosition = 'fixed';
// } else {
// this.headerPosition = 'absolute';
// }
},
//下拉刷新
onPullDownRefresh() {
this.pageNum = this.pageNum + 1;
this.loadData('refresh');
},
//加载更多
onReachBottom() {
this.pageNum = this.pageNum + 1;
this.loadData();
},
filters: {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'MM-dd')
},
},
methods: {
//加载商品 ,带下拉刷新和上滑加载
async loadData(type = 'add', loading) {
//没有更多直接返回
if (type === 'add') {
if (this.loadingType === 'nomore') {
return;
}
this.loadingType = 'loading';
} else {
this.loadingType = 'more';
}
let params = {};
let list = await Api.apiCall('get', Api.member.mesList, params);
console.log("消息列表", list)
this.goodsList = list;
// let goodsList = await this.$api.json('goodsList');
// if (type === 'refresh') {
// this.goodsList = [];
// }
// this.goodsList = this.goodsList.concat(goodsList);
//判断是否还有下一页有是more 没有是nomore(测试数据判断大于20就没有了)
this.loadingType = this.goodsList.length > list.total ? 'nomore' : 'more';
if (type === 'refresh') {
if (loading == 1) {
uni.hideLoading();
} else {
uni.stopPullDownRefresh();
}
}
},
//详情
navToDetailPage(item) {
console.log("消息>>>>", item)
//测试数据没有写id用title代替
// let id = item.id;
uni.navigateTo({
url: '/pages/index/messageDetail',
// 版本2.8.9+ 支持
success: (res) => {
// 和上面其实没差什么,但是这种方式是可以的 这里不是$emit
res.eventChannel.emit('sendTestValue', {
info: item
})
}
});
},
stopPrevent() {}
}
};
</script>
<style lang="scss">
page,
.content {
background: $page-color-base;
}
.listcard {
display: flex;
align-items: center;
padding: 10px;
margin: 15px;
border-radius: 5px;
box-shadow: 0 0 5px 1px rgba($color:#000000, $alpha:0.1);
box-sizing: border-box;
.listcard-image {
flex-shrink: 0;
width: 50px;
height: 50px;
border-radius: 5px;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.listcard-content {
display: flex;
flex-direction: column;
padding-left: 10px;
width: 100%;
justify-content: space-between;
.listcard-content_title {
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 14px;
color: #333;
font-weight: 400;
line-height: 1.2;
position: relative;
text {
font-size: 22px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.text2 {
color: #999;
font-size: 18px;
}
}
.listcard-content_title_text {
margin-top: 5px;
font-size: 18px;
color: #999;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.listcard-content_des {
display: flex;
justify-content: space-between;
font-size: 12px;
.listcard-content_des-label {
display: flex;
.listcard-content_des-label-item {
padding: 0 5px;
margin-right: 5px;
border-radius: 15px;
color: #f00;
border: 1px #f00 solid;
}
}
.listcard-content_des-browe {
color: #999;
font-size: 15px;
line-height: 1.5;
}
}
}
&.mode-column {
.list-content {
width: 100%;
padding-left: 0;
}
.listcard-image {
display: flex;
margin-top: 10px;
width: 100%;
height: 80px;
.listcard-image_item {
margin-left: 10px;
width: 100%;
border-radius: 5px;
overflow: hidden;
&:first-child {
margin-left: 0;
}
image {
width: 100%;
height: 100%;
}
}
}
.listcard-content_des {
margin-top: 10px;
}
}
&.mode-image {
flex-direction: column;
.listcard-image {
width: 100%;
height: 100px;
}
.listcard-content {
padding-left: 0;
margin-top: 10px;
.listcard-content_des {
display: flex;
align-items: center;
margin-top: 10px;
}
}
}
}
</style>

View File

@@ -100,7 +100,7 @@
<!--<list-cell icon="icon-share" iconColor="#9789f7" title="分享" tips="邀请好友赢10万大礼"></list-cell>
<list-cell icon="icon-pinglun-copy" iconColor="#ee883b" title="晒单" tips="晒单抢红包"></list-cell>-->
<list-cell icon="icon-shoucang_xuanzhongzhuangtai" iconColor="#54b4ef" title="我的收藏" @eventClick="navTo('../../pagesU/user/collect')"></list-cell>
<list-cell
<!-- <list-cell
icon="icon-share cgtt"
iconColor="#0e68d7"
v-if="!userDetailInfo.storeId"
@@ -128,7 +128,7 @@
v-if="userDetailInfo.roomNums"
title="社区主页"
@eventClick="navTo('../../pagesA/build/community')"
></list-cell>
></list-cell> -->
<!-- <list-cell
icon="icon-pinglun-copy"
iconColor="#0e68d7"