反馈修改-0723

master
Lee-1203 2022-07-23 09:04:40 +08:00
parent ec4219a998
commit 60235e338d
37 changed files with 502 additions and 435 deletions

View File

@ -233,7 +233,9 @@ page {background-color: #eaeaea;}
.news-list-bg{
padding: 10rpx 30rpx;
}
.news-list-bg.all-width{
padding: 10rpx 0;
}
/* 分类列表 */
.company-top{
width: 100%;
@ -723,68 +725,6 @@ page {background-color: #eaeaea;}
text-align: center;
}
/* 套件列表 */
.kit-list .kit-item{
background-color: #FFFFFF;
margin-top: 30rpx;
padding: 25rpx 30rpx;
}
.kit-list .kit-item:first-child{
margin-top: 20rpx;
}
.kit-item .kit-title{
font-size: 30rpx;
line-height: 1.8;
color: #000000;
margin-top: 10rpx;
font-weight: bold;
}
.kit-item .kit-compose{
font-size: 24rpx;
line-height: 1.8;
color: #999999;
}
.kit-item .kit-img{
height: 450rpx;
border-radius: 10rpx;
margin: 22rpx 0;
overflow: hidden;
}
.kit-item .kit-img image{
width: 100%;
min-height: 450rpx;
}
.kit-item .compose-list-bg{
overflow-x: auto;
}
.kit-item .compose-list-bg::-webkit-scrollbar{
width: 0;
height: 0;
}
.kit-item .compose-list{
width: auto;
flex-wrap: nowrap;
}
.compose-list .compose-item{
width: 270rpx;
margin-right: 22rpx;
border-radius: 10rpx;
overflow: hidden;
}
.compose-list .compose-item:last-child{
margin-right: 0;
}
.compose-list .compose-item image{
width: 100%;
min-height: 176rpx;
}
.compose-list .compose-item .compose-title{
font-size: 24rpx;
line-height: 1.8;
margin-top: 16rpx;
text-align: center;
}
/* 套件简介 */
.kit-summary{
padding-bottom: 50rpx;

View File

@ -1,5 +1,28 @@
<template>
<view class="pull-list">
<!-- 套件列表 -->
<view class="kit-list" v-if="isKit">
<view class="kit-item" @tap.stop="toDetail(item.id)" v-for="(item,index) in list" :key="index">
<view class="kit-title">{{item.title}}</view>
<view class="kit-compose">
<text>{{item.subtitle}}</text>
</view>
<view class="kit-img">
<image :src="item.src" mode="widthFix"></image>
</view>
<view class="compose-list-bg">
<view class="compose-list flex" v-if="item.series.length>0" :style="{width:item.series.length*270-22+'rpx'}">
<view class="compose-item" v-for="(item1,index1) in item.series" :key="index1">
<view class="compose-img">
<image :src="item1.cover" mode="widthFix"></image>
</view>
<view class="compose-title clips1">{{item1.name}}</view>
</view>
</view>
</view>
</view>
</view>
<!-- 商品&文章列表 -->
<view class="pull-list" :class="isShop?'pull-list-shop':''" v-else>
<view class="pull-item" :class="isShop?'pull-item-shop':''" v-for="(item,index) in list" :key="index" @tap.stop="toDetail(item.id)">
<view class="img"><image :src="item.src" mode="widthFix"></image></view>
<view class="item-bg flex">
@ -31,6 +54,10 @@
isShop:{
type:Boolean,
default: false
},
isKit:{
type:Boolean,
default: false
}
},
data(){
@ -62,6 +89,7 @@
</script>
<style scoped>
/* 商品&文章列表 */
.pull-list {
display: flex;
flex-wrap: wrap;
@ -123,7 +151,10 @@
line-height: 2;
color: #FFFFFF;
}
.pull-list .pull-item-shop{
.pull-list-shop{
align-items: flex-start;
}
.pull-item-shop{
width: calc(50% - 14rpx);
height: auto;
}
@ -141,6 +172,7 @@
position: static;
}
.pull-item-shop .title {
height: 78rpx;
padding: 15rpx 20rpx 0;
margin-bottom: 15rpx;
font-size: 24rpx;
@ -148,4 +180,71 @@
color: #000;
-webkit-line-clamp: 2;
}
/* 套件列表 */
.kit-list .kit-item{
background-color: #FFFFFF;
margin-top: 30rpx;
padding: 25rpx 30rpx;
}
.kit-list .kit-item:first-child{
margin-top: 20rpx;
}
.kit-item .kit-title{
font-size: 30rpx;
line-height: 1.8;
color: #000000;
margin-top: 10rpx;
font-weight: bold;
}
.kit-item .kit-compose{
font-size: 24rpx;
line-height: 1.8;
color: #999999;
}
.kit-item .kit-img{
height: 450rpx;
border-radius: 10rpx;
margin: 22rpx 0;
overflow: hidden;
}
.kit-item .kit-img image{
width: 100%;
min-height: 450rpx;
}
.kit-item .compose-list-bg{
overflow-x: auto;
}
.kit-item .compose-list-bg::-webkit-scrollbar{
width: 0;
height: 0;
}
.kit-item .compose-list{
width: auto;
flex-wrap: nowrap;
}
.compose-list .compose-item{
width: 270rpx;
margin-right: 22rpx;
border-radius: 10rpx;
overflow: hidden;
}
.compose-list .compose-item:last-child{
margin-right: 0;
}
.compose-list .compose-item .compose-img{
width: 100%;
height: 176rpx;
border-radius: 10rpx;
overflow: hidden;
}
.compose-list .compose-item image{
width: 100%;
min-height: 176rpx;
}
.compose-list .compose-item .compose-title{
font-size: 24rpx;
line-height: 1.8;
margin-top: 16rpx;
text-align: center;
}
</style>

View File

@ -2,28 +2,7 @@
<view class="pad-b150">
<status-nav :ifReturn="false" navBarTitle="套件" :marginBottom="20"></status-nav>
<!-- 套件列表 -->
<view class="kit-list">
<view class="kit-item" @tap.stop="toDetail(item.id)" v-for="(item,index) in kitList" :key="index" v-if="isLoading">
<view class="kit-title">{{item.name}}</view>
<view class="kit-compose">
<text v-for="(item1,index1) in item.series" :key="index1">{{item1.name}}</text>
<!-- <text>组合</text> -->
</view>
<view class="kit-img">
<image :src="item.cover" mode="widthFix"></image>
</view>
<view class="compose-list-bg">
<view class="compose-list flex" v-if="item.series.length>0" :style="{width:item.series.length*270-22+'rpx'}">
<view class="compose-item" v-for="(item2,index2) in item.series" :key="index2">
<view class="compose-img">
<image :src="item2.cover" mode="widthFix"></image>
</view>
<view class="compose-title clips1">{{item2.name}}</view>
</view>
</view>
</view>
</view>
</view>
<pull-list :list="kitList" :isKit="true" @toDetail="toDetail"></pull-list>
<!-- 暂无更多内容 -->
<view class="more-txt" v-if="totalAll == total"></view>
<!-- 购物车btn -->
@ -36,6 +15,7 @@
<script>
import statusNav from '@/components/status-navs/status-nav';
import enterCart from '@/components/enter-cart/enter-cart.vue';
import pullList from '@/components/pull-list/pull-list.vue';
//
import footTab from '@/components/foot-tab/foot-tab.vue';
import {getCartNum,userInfoEv} from '@/jsFile/public-api.js';
@ -44,6 +24,7 @@
components:{
statusNav,
enterCart,
pullList,
footTab
},
data() {
@ -127,8 +108,9 @@
res.data.list.forEach(item=>{
let obj = {
id:item.id,
cover:item.cover,
name:item.name,
src:item.cover,
title:item.name,
subtitle:item.subtitle,
series:item.series
}
newArr.push(obj);
@ -145,7 +127,7 @@
//
toDetail(id) {
uni.navigateTo({
url:'/pages/tabbar/kit/detail?id='+id
url:`/pages/tabbar/kit/detail?id=${id.id}`
})
},
}

View File

@ -376,7 +376,6 @@
closeEv(){
this.isVip = false;
this.myName = '';
this.myPhone = '';
this.inviteeName = '';
this.inviteeCode = '';
this.flag = true;

View File

@ -182,7 +182,7 @@
},
//
collectionEv(id){
console.log(id,12121)
if(this.currentIndex == 0){
let params = {
id:id.id,
@ -191,6 +191,7 @@
this.$requst.post('/api/spu/un-record',params).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('取消收藏成功');
this.collectionList=[];
this.getCollectionList();
}
})
@ -203,6 +204,7 @@
this.$requst.post('/api/archives/un-record',params).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('取消收藏成功');
this.collectionList=[];
this.getCollectionList();
}
})

View File

@ -24,8 +24,8 @@
</view>
<view class="search-keyword" v-if="total !== 0"><text>{{keywords}}</text>(<text>{{total}}</text>)</view>
<!-- 列表 -->
<view class="news-list-bg">
<pull-list :list="searchList" :isShop="isShop" @toDetail="toDetail"></pull-list>
<view class="news-list-bg" :class="isKit?'all-width':''">
<pull-list :list="searchList" :isShop="isShop" :isKit="isKit" @toDetail="toDetail"></pull-list>
</view>
<!-- 暂无更多内容 -->
<view class="more-txt more-txt-other" v-if="totalAll == total"></view>
@ -50,6 +50,7 @@
searchList:[], //&
navTabList:[ //
{name:'产品'},
{name:'套件'},
{name:'资讯'},
],
currentIndex:0, //
@ -61,6 +62,7 @@
historyData:[], //
keyword:'',//
keywords:'', //
isKit:false, //
}
},
computed:{
@ -70,148 +72,115 @@
},
onLoad(op) {
this.keywords = op.keyword;
this.getSearchList(this.keywords);
this.getHistory();
this.getSearchList(this.currentIndex);
this.getHistory(this.currentIndex);
},
onReachBottom(e) {
if(this.searchList.length<this.total){
this.page++;
this.getSearchList();
this.getSearchList(this.currentIndex);
}
},
methods: {
//
chooseEv(type){
if(type == 0){
this.isShop = true;
}
if(type == 1){
if(type == 2){
this.isShop = false;
this.isKit =false;
}else if(type == 1){
this.isShop = false;
this.isKit =true;
}else{
this.isShop = true;
this.isKit =false;
}
if(this.currentIndex !== type){
this.page = 1;
this.currentIndex = type;
this.getSearchList();
this.getHistory();
this.getSearchList(this.currentIndex);
this.getHistory(this.currentIndex);
}
},
//
getHistory(){
if(this.currentIndex == 0){
this.$requst.get('/api/index/keyword-history',{type:'spu'}).then(res=>{
if(res.code == 0){
let newArr = [];
res.data.forEach(item=>{
let obj = {
keyword:item.keyword,
}
newArr.push(obj)
})
this.historyData = newArr;
}
})
}
if(this.currentIndex == 1){
this.$requst.get('/api/index/keyword-history',{type:'article'}).then(res=>{
if(res.code == 0){
let newArr = [];
res.data.forEach(item=>{
let obj = {
keyword:item.keyword,
}
newArr.push(obj)
})
this.historyData = newArr;
}
})
}
getHistory(index){
let historyType = ['spu','spu','article'];
this.$requst.get('/api/index/keyword-history',{type:historyType[index]}).then(res=>{
if(res.code == 0){
let newArr = [];
res.data.forEach(item=>{
let obj = {
keyword:item.keyword,
}
newArr.push(obj)
})
this.historyData = newArr;
}
})
},
//
toSearch(){
if(this.keyword !== ''){
this.keywords = this.keyword;
this.getSearchList();
this.getHistory();
}
},
//
changeKeyword(keyword){
this.keywords =keyword;
this.getSearchList();
this.getHistory();
},
//
clearHistory(){
if(this.currentIndex == 0){
this.$requst.get('/api/index/clear-keyword-history',{type:'spu'}).then(res=>{
if(res.code == 0){
this.historyData = [];
}
})
}
if(this.currentIndex == 1){
this.$requst.get('/api/index/clear-keyword-history',{type:'article'}).then(res=>{
if(res.code == 0){
this.historyData = [];
}
})
this.getSearchList(this.currentIndex);
this.getHistory(this.currentIndex);
}
},
//
changeKeyword(keyword){
this.keywords =keyword;
this.getSearchList(this.currentIndex);
this.getHistory(this.currentIndex);
},
//
clearHistory(){
let historyType = ['spu','spu','article'];
this.$requst.get('/api/index/clear-keyword-history',{type:historyType[this.currentIndex]}).then(res=>{
if(res.code == 0){
this.historyData = [];
}
})
},
//
getSearchList(){
let params = {
keyword:this.keywords
}
getSearchList(index){
uni.showLoading({
title: '加载中'
});
if(this.currentIndex == 0){
this.$requst.get('/api/spu/list',params).then(res=>{
if(res.code == 0){
this.total = res.data.total;
let newArr = [];
res.data.list.forEach(item=>{
let obj = {
id:item.id,
src:item.cover,
title:item.name,
time:'',
}
newArr.push(obj)
})
this.searchList = newArr;
this.keyword = '';
if(this.searchList.length == this.total){
this.totalAll = this.total;
let params = [
{keyword:this.keywords,is_series:0},
{keyword:this.keywords,is_series:1},
{keyword:this.keywords}
];
let searchApi = ['/api/spu/list','/api/spu/series','/api/archives/list'];
this.$requst.get(searchApi[index],params[index]).then(res=>{
if(res.code == 0){
this.total = res.data.total;
let newArr = [];
res.data.list.forEach(item=>{
let obj = {
id:item.id,
src:item.cover,
title:item.name?item.name:item.title,
subtitle:item.subtitle?item.subtitle:'',
time:item.published_at?this.dateFormat(item.published_at.replace(/-/g,'/')):'',
series:item.series?item.series:''
}
newArr.push(obj)
})
this.searchList = newArr;
this.keyword = '';
if(this.searchList.length == this.total){
this.totalAll = this.total;
}
})
}
if(this.currentIndex == 1){
this.$requst.get('/api/archives/list',params).then(res=>{
if(res.code == 0){
this.total = res.data.total;
let newArr = [];
res.data.list.forEach(item=>{
let obj = {
id:item.id,
src:item.cover,
title:item.title,
time:this.dateFormat(item.published_at)
}
newArr.push(obj)
})
this.searchList = newArr;
this.keyword = '';
if(this.searchList.length == this.total){
this.totalAll = this.total;
}
}
})
}
}
})
uni.hideLoading();
},
//
dateFormat (dateData) {
var date = new Date(dateData)
@ -223,18 +192,13 @@
const time = y + '.' + m + '.' + d
return time
},
//
toDetail(id){
if(this.currentIndex == 0){
uni.navigateTo({
url:`/pagesA/shop/detail?id=${id.id}&source=shop`
})
}
if(this.currentIndex == 1){
uni.navigateTo({
url:`/pages/tabbar/news/detail?id=${id.id}`
})
}
let detailUrl=[`/pagesA/shop/detail?id=${id.id}&source=shop`,`/pages/tabbar/kit/detail?id=${id.id}`,`/pages/tabbar/news/detail?id=${id.id}`];
uni.navigateTo({
url:detailUrl[this.currentIndex]
})
},
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -795,6 +795,9 @@ page {background-color: #eaeaea;}
.news-list-bg{
padding: 10rpx 30rpx;
}
.news-list-bg.all-width{
padding: 10rpx 0;
}
/* 分类列表 */
.company-top{
@ -1278,68 +1281,6 @@ page {background-color: #eaeaea;}
text-align: center;
}
/* 套件列表 */
.kit-list .kit-item{
background-color: #FFFFFF;
margin-top: 30rpx;
padding: 25rpx 30rpx;
}
.kit-list .kit-item:first-child{
margin-top: 20rpx;
}
.kit-item .kit-title{
font-size: 30rpx;
line-height: 1.8;
color: #000000;
margin-top: 10rpx;
font-weight: bold;
}
.kit-item .kit-compose{
font-size: 24rpx;
line-height: 1.8;
color: #999999;
}
.kit-item .kit-img{
height: 450rpx;
border-radius: 10rpx;
margin: 22rpx 0;
overflow: hidden;
}
.kit-item .kit-img image{
width: 100%;
min-height: 450rpx;
}
.kit-item .compose-list-bg{
overflow-x: auto;
}
.kit-item .compose-list-bg::-webkit-scrollbar{
width: 0;
height: 0;
}
.kit-item .compose-list{
width: auto;
flex-wrap: nowrap;
}
.compose-list .compose-item{
width: 270rpx;
margin-right: 22rpx;
border-radius: 10rpx;
overflow: hidden;
}
.compose-list .compose-item:last-child{
margin-right: 0;
}
.compose-list .compose-item image{
width: 100%;
min-height: 176rpx;
}
.compose-list .compose-item .compose-title{
font-size: 24rpx;
line-height: 1.8;
margin-top: 16rpx;
text-align: center;
}
/* 套件简介 */
.kit-summary{
padding-bottom: 50rpx;

View File

@ -130,6 +130,29 @@ Object.defineProperty(exports, "__esModule", { value: true });exports.default =
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var _default2 =
{
name: 'pull-list',
@ -145,6 +168,10 @@ var _default2 =
default: 0 },
isShop: {
type: Boolean,
default: false },
isKit: {
type: Boolean,
default: false } },

View File

@ -1 +1 @@
<view class="pull-list data-v-1c523212"><block wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['toDetail',['$0'],[[['list','',index,'id']]]]]]]}}" class="{{['pull-item','data-v-1c523212',isShop?'pull-item-shop':'']}}" catchtap="__e"><view class="img data-v-1c523212"><image src="{{item.src}}" mode="widthFix" class="data-v-1c523212"></image></view><view class="item-bg flex data-v-1c523212"><block wx:if="{{!isShop}}"><view class="time data-v-1c523212">{{"发布时间:"+item.time}}</view></block><view class="title clips1 data-v-1c523212">{{item.title}}</view></view><block wx:if="{{collection==1}}"><view data-event-opts="{{[['tap',[['collectionEv',['$0'],[[['list','',index,'id']]]]]]]}}" class="collection-sign data-v-1c523212" catchtap="__e"><image src="/static/public/icon-collection.png" mode="widthFix" class="data-v-1c523212"></image><text class="data-v-1c523212">已收藏</text></view></block></view></block></view>
<block wx:if="{{isKit}}"><view class="kit-list data-v-1c523212"><block wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['toDetail',['$0'],[[['list','',index,'id']]]]]]]}}" class="kit-item data-v-1c523212" catchtap="__e"><view class="kit-title data-v-1c523212">{{item.title}}</view><view class="kit-compose data-v-1c523212"><text class="data-v-1c523212">{{item.subtitle}}</text></view><view class="kit-img data-v-1c523212"><image src="{{item.src}}" mode="widthFix" class="data-v-1c523212"></image></view><view class="compose-list-bg data-v-1c523212"><block wx:if="{{item.series.length>0}}"><view class="compose-list flex data-v-1c523212" style="{{'width:'+(item.series.length*270-22+'rpx')+';'}}"><block wx:for="{{item.series}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="compose-item data-v-1c523212"><view class="compose-img data-v-1c523212"><image src="{{item1.cover}}" mode="widthFix" class="data-v-1c523212"></image></view><view class="compose-title clips1 data-v-1c523212">{{item1.name}}</view></view></block></view></block></view></view></block></view></block><block wx:else><view class="{{['pull-list','data-v-1c523212',isShop?'pull-list-shop':'']}}"><block wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['toDetail',['$0'],[[['list','',index,'id']]]]]]]}}" class="{{['pull-item','data-v-1c523212',isShop?'pull-item-shop':'']}}" catchtap="__e"><view class="img data-v-1c523212"><image src="{{item.src}}" mode="widthFix" class="data-v-1c523212"></image></view><view class="item-bg flex data-v-1c523212"><block wx:if="{{!isShop}}"><view class="time data-v-1c523212">{{"发布时间:"+item.time}}</view></block><view class="title clips1 data-v-1c523212">{{item.title}}</view></view><block wx:if="{{collection==1}}"><view data-event-opts="{{[['tap',[['collectionEv',['$0'],[[['list','',index,'id']]]]]]]}}" class="collection-sign data-v-1c523212" catchtap="__e"><image src="/static/public/icon-collection.png" mode="widthFix" class="data-v-1c523212"></image><text class="data-v-1c523212">已收藏</text></view></block></view></block></view></block>

View File

@ -1,4 +1,95 @@
/* 商品&文章列表 */
.pull-list.data-v-1c523212 {
display: flex;
flex-wrap: wrap;
@ -55,7 +146,10 @@
line-height: 2;
color: #FFFFFF;
}
.pull-list .pull-item-shop.data-v-1c523212{
.pull-list-shop.data-v-1c523212{
align-items: flex-start;
}
.pull-item-shop.data-v-1c523212{
width: calc(50% - 14rpx);
height: auto;
}
@ -73,6 +167,7 @@
position: static;
}
.pull-item-shop .title.data-v-1c523212 {
height: 78rpx;
padding: 15rpx 20rpx 0;
margin-bottom: 15rpx;
font-size: 24rpx;
@ -80,4 +175,71 @@
color: #000;
-webkit-line-clamp: 2;
}
/* 套件列表 */
.kit-list .kit-item.data-v-1c523212{
background-color: #FFFFFF;
margin-top: 30rpx;
padding: 25rpx 30rpx;
}
.kit-list .kit-item.data-v-1c523212:first-child{
margin-top: 20rpx;
}
.kit-item .kit-title.data-v-1c523212{
font-size: 30rpx;
line-height: 1.8;
color: #000000;
margin-top: 10rpx;
font-weight: bold;
}
.kit-item .kit-compose.data-v-1c523212{
font-size: 24rpx;
line-height: 1.8;
color: #999999;
}
.kit-item .kit-img.data-v-1c523212{
height: 450rpx;
border-radius: 10rpx;
margin: 22rpx 0;
overflow: hidden;
}
.kit-item .kit-img image.data-v-1c523212{
width: 100%;
min-height: 450rpx;
}
.kit-item .compose-list-bg.data-v-1c523212{
overflow-x: auto;
}
.kit-item .compose-list-bg.data-v-1c523212::-webkit-scrollbar{
width: 0;
height: 0;
}
.kit-item .compose-list.data-v-1c523212{
width: auto;
flex-wrap: nowrap;
}
.compose-list .compose-item.data-v-1c523212{
width: 270rpx;
margin-right: 22rpx;
border-radius: 10rpx;
overflow: hidden;
}
.compose-list .compose-item.data-v-1c523212:last-child{
margin-right: 0;
}
.compose-list .compose-item .compose-img.data-v-1c523212{
width: 100%;
height: 176rpx;
border-radius: 10rpx;
overflow: hidden;
}
.compose-list .compose-item image.data-v-1c523212{
width: 100%;
min-height: 176rpx;
}
.compose-list .compose-item .compose-title.data-v-1c523212{
font-size: 24rpx;
line-height: 1.8;
margin-top: 16rpx;
text-align: center;
}

View File

@ -95,6 +95,9 @@ __webpack_require__.r(__webpack_exports__);
var components
try {
components = {
pullList: function() {
return __webpack_require__.e(/*! import() | components/pull-list/pull-list */ "components/pull-list/pull-list").then(__webpack_require__.bind(null, /*! @/components/pull-list/pull-list.vue */ 187))
},
enterCart: function() {
return __webpack_require__.e(/*! import() | components/enter-cart/enter-cart */ "components/enter-cart/enter-cart").then(__webpack_require__.bind(null, /*! @/components/enter-cart/enter-cart.vue */ 194))
},
@ -175,33 +178,14 @@ __webpack_require__.r(__webpack_exports__);
var _publicApi = __webpack_require__(/*! @/jsFile/public-api.js */ 9);
var _vuex = __webpack_require__(/*! vuex */ 12);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}var statusNav = function statusNav() {__webpack_require__.e(/*! require.ensure | components/status-navs/status-nav */ "components/status-navs/status-nav").then((function () {return resolve(__webpack_require__(/*! @/components/status-navs/status-nav */ 208));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var enterCart = function enterCart() {__webpack_require__.e(/*! require.ensure | components/enter-cart/enter-cart */ "components/enter-cart/enter-cart").then((function () {return resolve(__webpack_require__(/*! @/components/enter-cart/enter-cart.vue */ 194));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var footTab = function footTab() {__webpack_require__.e(/*! require.ensure | components/foot-tab/foot-tab */ "components/foot-tab/foot-tab").then((function () {return resolve(__webpack_require__(/*! @/components/foot-tab/foot-tab.vue */ 201));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);}; //引入mapState
var _vuex = __webpack_require__(/*! vuex */ 12);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}var statusNav = function statusNav() {__webpack_require__.e(/*! require.ensure | components/status-navs/status-nav */ "components/status-navs/status-nav").then((function () {return resolve(__webpack_require__(/*! @/components/status-navs/status-nav */ 208));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var enterCart = function enterCart() {__webpack_require__.e(/*! require.ensure | components/enter-cart/enter-cart */ "components/enter-cart/enter-cart").then((function () {return resolve(__webpack_require__(/*! @/components/enter-cart/enter-cart.vue */ 194));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var pullList = function pullList() {__webpack_require__.e(/*! require.ensure | components/pull-list/pull-list */ "components/pull-list/pull-list").then((function () {return resolve(__webpack_require__(/*! @/components/pull-list/pull-list.vue */ 187));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var footTab = function footTab() {__webpack_require__.e(/*! require.ensure | components/foot-tab/foot-tab */ "components/foot-tab/foot-tab").then((function () {return resolve(__webpack_require__(/*! @/components/foot-tab/foot-tab.vue */ 201));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);}; //引入mapState
var _default = {
components: {
statusNav: statusNav,
enterCart: enterCart,
pullList: pullList,
footTab: footTab },
data: function data() {
@ -285,8 +269,9 @@ var _default = {
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
cover: item.cover,
name: item.name,
src: item.cover,
title: item.name,
subtitle: item.subtitle,
series: item.series };
newArr.push(obj);
@ -303,7 +288,7 @@ var _default = {
// 跳转详情页
toDetail: function toDetail(id) {
uni.navigateTo({
url: '/pages/tabbar/kit/detail?id=' + id });
url: "/pages/tabbar/kit/detail?id=".concat(id.id) });
} } };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))

View File

@ -2,6 +2,7 @@
"navigationBarTitleText": "套件",
"enablePullDownRefresh": false,
"usingComponents": {
"pull-list": "/components/pull-list/pull-list",
"enter-cart": "/components/enter-cart/enter-cart",
"foot-tab": "/components/foot-tab/foot-tab",
"status-nav": "/components/status-navs/status-nav"

View File

@ -1 +1 @@
<view class="pad-b150"><status-nav vue-id="2b600381-1" ifReturn="{{false}}" navBarTitle="套件" marginBottom="{{20}}" bind:__l="__l"></status-nav><view class="kit-list"><block wx:for="{{kitList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><block wx:if="{{isLoading}}"><view data-event-opts="{{[['tap',[['toDetail',['$0'],[[['kitList','',index,'id']]]]]]]}}" class="kit-item" catchtap="__e"><view class="kit-title">{{item.name}}</view><view class="kit-compose"><block wx:for="{{item.series}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><text>{{item1.name}}</text></block></view><view class="kit-img"><image src="{{item.cover}}" mode="widthFix"></image></view><view class="compose-list-bg"><block wx:if="{{item.series.length>0}}"><view class="compose-list flex" style="{{'width:'+(item.series.length*270-22+'rpx')+';'}}"><block wx:for="{{item.series}}" wx:for-item="item2" wx:for-index="index2" wx:key="index2"><view class="compose-item"><view class="compose-img"><image src="{{item2.cover}}" mode="widthFix"></image></view><view class="compose-title clips1">{{item2.name}}</view></view></block></view></block></view></view></block></block></view><block wx:if="{{totalAll==total}}"><view class="more-txt">暂无更多内容</view></block><enter-cart vue-id="2b600381-2" bind:__l="__l"></enter-cart><foot-tab vue-id="2b600381-3" current="2" bind:__l="__l"></foot-tab></view>
<view class="pad-b150"><status-nav vue-id="2b600381-1" ifReturn="{{false}}" navBarTitle="套件" marginBottom="{{20}}" bind:__l="__l"></status-nav><pull-list vue-id="2b600381-2" list="{{kitList}}" isKit="{{true}}" data-event-opts="{{[['^toDetail',[['toDetail']]]]}}" bind:toDetail="__e" bind:__l="__l"></pull-list><block wx:if="{{totalAll==total}}"><view class="more-txt">暂无更多内容</view></block><enter-cart vue-id="2b600381-3" bind:__l="__l"></enter-cart><foot-tab vue-id="2b600381-4" current="2" bind:__l="__l"></foot-tab></view>

View File

@ -552,7 +552,6 @@ var _default = {
closeEv: function closeEv() {
this.isVip = false;
this.myName = '';
this.myPhone = '';
this.inviteeName = '';
this.inviteeCode = '';
this.flag = true;

View File

@ -340,7 +340,7 @@ var _default = {
},
//收藏
collectionEv: function collectionEv(id) {var _this3 = this;
console.log(id, 12121);
if (this.currentIndex == 0) {
var params = {
id: id.id,
@ -349,6 +349,7 @@ var _default = {
this.$requst.post('/api/spu/un-record', params).then(function (res) {
if (res.code == 0) {
_this3.$toolAll.tools.showToast('取消收藏成功');
_this3.collectionList = [];
_this3.getCollectionList();
}
});
@ -361,6 +362,7 @@ var _default = {
this.$requst.post('/api/archives/un-record', _params).then(function (res) {
if (res.code == 0) {
_this3.$toolAll.tools.showToast('取消收藏成功');
_this3.collectionList = [];
_this3.getCollectionList();
}
});

View File

@ -208,6 +208,7 @@ var _default = {
searchList: [], //解答&资讯列表
navTabList: [//导航列表
{ name: '产品' },
{ name: '套件' },
{ name: '资讯' }],
currentIndex: 0, //当前位置
@ -218,7 +219,8 @@ var _default = {
totalAll: -1, //判断总数
historyData: [], //历史搜索列表
keyword: '', //搜索关键词
keywords: '' //历史关键词
keywords: '', //历史关键词
isKit: false //是否套件
};
},
computed: _objectSpread({},
@ -228,148 +230,115 @@ var _default = {
onLoad: function onLoad(op) {
this.keywords = op.keyword;
this.getSearchList(this.keywords);
this.getHistory();
this.getSearchList(this.currentIndex);
this.getHistory(this.currentIndex);
},
onReachBottom: function onReachBottom(e) {
if (this.searchList.length < this.total) {
this.page++;
this.getSearchList();
this.getSearchList(this.currentIndex);
}
},
methods: {
// 切换事件
chooseEv: function chooseEv(type) {
if (type == 0) {
this.isShop = true;
}
if (type == 1) {
if (type == 2) {
this.isShop = false;
this.isKit = false;
} else if (type == 1) {
this.isShop = false;
this.isKit = true;
} else {
this.isShop = true;
this.isKit = false;
}
if (this.currentIndex !== type) {
this.page = 1;
this.currentIndex = type;
this.getSearchList();
this.getHistory();
this.getSearchList(this.currentIndex);
this.getHistory(this.currentIndex);
}
},
// 获取历史搜索结果
getHistory: function getHistory() {var _this = this;
if (this.currentIndex == 0) {
this.$requst.get('/api/index/keyword-history', { type: 'spu' }).then(function (res) {
if (res.code == 0) {
var newArr = [];
res.data.forEach(function (item) {
var obj = {
keyword: item.keyword };
getHistory: function getHistory(index) {var _this = this;
var historyType = ['spu', 'spu', 'article'];
this.$requst.get('/api/index/keyword-history', { type: historyType[index] }).then(function (res) {
if (res.code == 0) {
var newArr = [];
res.data.forEach(function (item) {
var obj = {
keyword: item.keyword };
newArr.push(obj);
});
_this.historyData = newArr;
}
});
}
if (this.currentIndex == 1) {
this.$requst.get('/api/index/keyword-history', { type: 'article' }).then(function (res) {
if (res.code == 0) {
var newArr = [];
res.data.forEach(function (item) {
var obj = {
keyword: item.keyword };
newArr.push(obj);
});
_this.historyData = newArr;
}
});
}
newArr.push(obj);
});
_this.historyData = newArr;
}
});
},
//搜索
toSearch: function toSearch() {
if (this.keyword !== '') {
this.keywords = this.keyword;
this.getSearchList();
this.getHistory();
this.getSearchList(this.currentIndex);
this.getHistory(this.currentIndex);
}
},
// 选择历史搜索
changeKeyword: function changeKeyword(keyword) {
this.keywords = keyword;
this.getSearchList();
this.getHistory();
this.getSearchList(this.currentIndex);
this.getHistory(this.currentIndex);
},
// 清空历史搜索
clearHistory: function clearHistory() {var _this2 = this;
if (this.currentIndex == 0) {
this.$requst.get('/api/index/clear-keyword-history', { type: 'spu' }).then(function (res) {
if (res.code == 0) {
_this2.historyData = [];
}
});
}
if (this.currentIndex == 1) {
this.$requst.get('/api/index/clear-keyword-history', { type: 'article' }).then(function (res) {
if (res.code == 0) {
_this2.historyData = [];
}
});
}
var historyType = ['spu', 'spu', 'article'];
this.$requst.get('/api/index/clear-keyword-history', { type: historyType[this.currentIndex] }).then(function (res) {
if (res.code == 0) {
_this2.historyData = [];
}
});
},
// 获取搜索结果
getSearchList: function getSearchList() {var _this3 = this;
var params = {
keyword: this.keywords };
getSearchList: function getSearchList(index) {var _this3 = this;
uni.showLoading({
title: '加载中' });
if (this.currentIndex == 0) {
this.$requst.get('/api/spu/list', params).then(function (res) {
if (res.code == 0) {
_this3.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
src: item.cover,
title: item.name,
time: '' };
var params = [
{ keyword: this.keywords, is_series: 0 },
{ keyword: this.keywords, is_series: 1 },
{ keyword: this.keywords }];
newArr.push(obj);
});
_this3.searchList = newArr;
_this3.keyword = '';
if (_this3.searchList.length == _this3.total) {
_this3.totalAll = _this3.total;
}
}
});
}
if (this.currentIndex == 1) {
this.$requst.get('/api/archives/list', params).then(function (res) {
if (res.code == 0) {
_this3.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
src: item.cover,
title: item.title,
time: _this3.dateFormat(item.published_at) };
var searchApi = ['/api/spu/list', '/api/spu/series', '/api/archives/list'];
this.$requst.get(searchApi[index], params[index]).then(function (res) {
if (res.code == 0) {
_this3.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
src: item.cover,
title: item.name ? item.name : item.title,
subtitle: item.subtitle ? item.subtitle : '',
time: item.published_at ? _this3.dateFormat(item.published_at.replace(/-/g, '/')) : '',
series: item.series ? item.series : '' };
newArr.push(obj);
});
_this3.searchList = newArr;
_this3.keyword = '';
if (_this3.searchList.length == _this3.total) {
_this3.totalAll = _this3.total;
}
newArr.push(obj);
});
_this3.searchList = newArr;
_this3.keyword = '';
if (_this3.searchList.length == _this3.total) {
_this3.totalAll = _this3.total;
}
});
}
}
});
uni.hideLoading();
},
// 时间格式转换
dateFormat: function dateFormat(dateData) {
var date = new Date(dateData);
@ -381,18 +350,13 @@ var _default = {
var time = y + '.' + m + '.' + d;
return time;
},
// 跳转详情页
toDetail: function toDetail(id) {
if (this.currentIndex == 0) {
uni.navigateTo({
url: "/pagesA/shop/detail?id=".concat(id.id, "&source=shop") });
var detailUrl = ["/pagesA/shop/detail?id=".concat(id.id, "&source=shop"), "/pages/tabbar/kit/detail?id=".concat(id.id), "/pages/tabbar/news/detail?id=".concat(id.id)];
uni.navigateTo({
url: detailUrl[this.currentIndex] });
}
if (this.currentIndex == 1) {
uni.navigateTo({
url: "/pages/tabbar/news/detail?id=".concat(id.id) });
}
} } };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))

View File

@ -1 +1 @@
<view><status-nav vue-id="56ee474c-1" ifReturn="{{true}}" navBarTitle="搜索" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="search-bg" style="padding-bottom:0rpx;"><view class="search flex"><image class="search-img" src="/static/public/icon-search.png" mode="widthFix"></image><input class="search-input" type="text" placeholder="请输入关键词" placeholder-style="color: #666666" data-event-opts="{{[['input',[['__set_model',['','keyword','$event',[]]]]]]}}" value="{{keyword}}" bindinput="__e"/><view class="search-line"></view><view data-event-opts="{{[['tap',[['toSearch',['$event']]]]]}}" class="search-btn flex" bindtap="__e">搜索</view></view></view><view class="nav-list-bg" style="{{'top:'+(newTop+'px')+';'}}"><nav-tab vue-id="56ee474c-2" list="{{navTabList}}" type="radio" data-event-opts="{{[['^chooseEv',[['chooseEv']]]]}}" bind:chooseEv="__e" bind:__l="__l"></nav-tab></view><block wx:if="{{historyData.length>0&&total==0}}"><view class="search-history flex"><view class="title flex"><text>历史搜索</text><image class="search-img" src="/static/public/icon-clear.png" mode="widthFix" data-event-opts="{{[['tap',[['clearHistory',['$event']]]]]}}" bindtap="__e"></image></view><block wx:for="{{historyData}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['changeKeyword',['$0'],[[['historyData','',index,'keyword']]]]]]]}}" class="item clips1" bindtap="__e">{{item.keyword}}</view></block></view></block><block wx:if="{{total!==0}}"><view class="search-keyword">关键词:<text>{{keywords}}</text>(<text>{{total}}</text>)</view></block><view class="news-list-bg"><pull-list vue-id="56ee474c-3" list="{{searchList}}" isShop="{{isShop}}" data-event-opts="{{[['^toDetail',[['toDetail']]]]}}" bind:toDetail="__e" bind:__l="__l"></pull-list></view><block wx:if="{{totalAll==total}}"><view class="more-txt more-txt-other">暂无更多内容</view></block></view>
<view><status-nav vue-id="56ee474c-1" ifReturn="{{true}}" navBarTitle="搜索" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="search-bg" style="padding-bottom:0rpx;"><view class="search flex"><image class="search-img" src="/static/public/icon-search.png" mode="widthFix"></image><input class="search-input" type="text" placeholder="请输入关键词" placeholder-style="color: #666666" data-event-opts="{{[['input',[['__set_model',['','keyword','$event',[]]]]]]}}" value="{{keyword}}" bindinput="__e"/><view class="search-line"></view><view data-event-opts="{{[['tap',[['toSearch',['$event']]]]]}}" class="search-btn flex" bindtap="__e">搜索</view></view></view><view class="nav-list-bg" style="{{'top:'+(newTop+'px')+';'}}"><nav-tab vue-id="56ee474c-2" list="{{navTabList}}" type="radio" data-event-opts="{{[['^chooseEv',[['chooseEv']]]]}}" bind:chooseEv="__e" bind:__l="__l"></nav-tab></view><block wx:if="{{historyData.length>0&&total==0}}"><view class="search-history flex"><view class="title flex"><text>历史搜索</text><image class="search-img" src="/static/public/icon-clear.png" mode="widthFix" data-event-opts="{{[['tap',[['clearHistory',['$event']]]]]}}" bindtap="__e"></image></view><block wx:for="{{historyData}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['changeKeyword',['$0'],[[['historyData','',index,'keyword']]]]]]]}}" class="item clips1" bindtap="__e">{{item.keyword}}</view></block></view></block><block wx:if="{{total!==0}}"><view class="search-keyword">关键词:<text>{{keywords}}</text>(<text>{{total}}</text>)</view></block><view class="{{['news-list-bg',isKit?'all-width':'']}}"><pull-list vue-id="56ee474c-3" list="{{searchList}}" isShop="{{isShop}}" isKit="{{isKit}}" data-event-opts="{{[['^toDetail',[['toDetail']]]]}}" bind:toDetail="__e" bind:__l="__l"></pull-list></view><block wx:if="{{totalAll==total}}"><view class="more-txt more-txt-other">暂无更多内容</view></block></view>