删除冗余组件,修改搜索商品样式

master
lemon橪 2021-10-13 18:01:09 +08:00
parent 4c47a1249f
commit fd37087c43
14 changed files with 117 additions and 1558 deletions

View File

@ -1,20 +1,21 @@
<template>
<view class="serach">
<view class="left-box" @tap="onClickLeft">
<uni-icons style="line-height:70rpx" type="back" size="24" />
<u-icon name="arrow-left" size="40" color="#666"></u-icon>
</view>
<view class="content" :style="{ 'border-radius': radius + 'px' }">
<!-- HM修改 增加进入输入状态的点击范围 -->
<view class="content-box" :class="{ center: mode === 2 }">
<u-icon name="search" size="32" style="padding:0 15rpx;"></u-icon>
<!-- HM修改 增加placeholder input confirm-type confirm-->
<input style="width:100%; " :placeholder="placeholder" placeholder-class="placeholder-color" @input="inputChange" confirm-type="search" @confirm="triggerConfirm" class="input"
<input style="width:100%; " :placeholder="placeholder" placeholder-class="placeholder-color"
@input="inputChange" confirm-type="search" @confirm="triggerConfirm" class="input"
:class="{ center: !active && mode === 2 }" :focus="isFocus" v-model="inputVal" @focus="focus" @blur="blur" />
<u-icon name="close" v-if="isDelShow" style="padding:0 30rpx;" @click="clear"></u-icon>
</view>
<view v-show="(active && show && button === 'inside') || (isDelShow && button === 'inside')" class="serachBtn" @click="search"></view>
</view>
<view v-if="button === 'outside'" class="button" :class="{ active: show || active }">
<view class="button active" >
<view v-if="isShowSeachGoods !=true" class="button-item">
<div @click="out()"></div>
</view>
@ -28,14 +29,7 @@
</template>
<script>
import uniStatusBar from "../uni-status-bar/uni-status-bar.vue";
import uniIcons from "../uni-icons/uni-icons.vue";
export default {
components: {
uniStatusBar,
uniIcons,
},
props: {
mode: {
value: Number,
@ -50,15 +44,6 @@ export default {
type: String,
default: "",
},
button: {
value: String,
default: "outside",
},
//
show: {
value: Boolean,
default: true,
},
// 60
radius: {
value: String,
@ -131,7 +116,6 @@ export default {
this.$emit("input", "");
//this.$emit('search', '');//HM
},
/**
* 回退到上一级
@ -145,7 +129,7 @@ export default {
*/
search() {
if (!this.inputVal) {
if (!this.show && this.searchName == "取消") {
if (this.searchName == "取消") {
uni.hideKeyboard();
this.isFocus = false;
this.active = false;
@ -175,6 +159,9 @@ export default {
font-size: $uni-font-size-base;
.left-box {
display: flex;
align-items: center;
justify-content: center;
width: 15%;
/* #ifndef APP-NVUE */
text-align: center;
@ -225,19 +212,6 @@ export default {
}
}
}
.serachBtn {
height: 100%;
flex-shrink: 0;
padding: 0 30rpx;
//HM
background: linear-gradient(to right, grey, grey);
//background: $uni-color-success;
line-height: 60rpx;
color: #eee;
//border-left: 1px #ccc solid; //HM
transition: all 0.3s;
}
}
.button {

View File

@ -1,241 +0,0 @@
<template>
<div class="dropdown-item">
<!-- selected -->
<view class="dropdown-item__selected" @click="changePopup">
<slot name="title" v-if="$slots.title"></slot>
<block v-else>
<view class="selected__name">
{{title ? title : selectItem.text}}
</view>
<!-- <view class="selected__icon"
:class="showClass === 'show'? 'up' : 'down'"
>
<span class="iconfont">&#xe851;</span>
</view> -->
</block>
</view>
<view class="dropdown-item__content" :style="{top: contentTop + 'px'}" v-if="showList">
<!-- dropdown -->
<view :class="['list', showClass]">
<slot v-if="$slots.default"></slot>
<block v-else>
<view class="list__option" v-for="(item, index) in list" :key="index" @click="choose(item)">
<view>{{item.text}}</view>
<icon v-if="item.value === value" type="success_no_circle" size="26" />
</view>
</block>
</view>
<!-- dropdown-mask -->
<!-- @touchmove 禁止滑动 -->
<view @touchmove.stop.prevent="moveHandle" :class="['dropdown-mask', showClass]" v-if="showList" @click="closePopup"></view>
</view>
</div>
</template>
<script>
export default {
components: {},
props: {
value: [Number, String, Object],
list: {
type: Array,
default: () => {
return []
}
},
title: [Number, String],
contentTopReduse: {
type: Number,
default: 0
}
},
data() {
return {
showList: "",
showClass: '',
selectItem: {},
contentTop: 0
}
},
watch: {},
mounted() {
this.showList = this.active;
this.selectItem = this.list[this.value];
// document.addEventListener('click', e => {
// //this.$el
// if (!this.$el.contains(e.target)) {
// console.log('change');
// this.close()
// }
// });
},
methods: {
//
moveHandle() {},
choose(item) {
this.selectItem = item
this.$emit('input', item.value)
this.closePopup()
},
changePopup() {
if (this.showList) {
this.closePopup()
} else {
this.openPopup()
}
},
openPopup() {
// this.$parent -> dropdown-menu
this.$parent.$emit('close')
this.showList = true
this.$nextTick(() => {
this.getElementData('.dropdown-item__selected', (data) => {
this.contentTop = data[0].bottom - this.contentTopReduse;
this.showClass = 'show'
})
})
},
closePopup() {
this.showClass = ''
setTimeout(() => {
this.showList = false
}, 300)
},
close() {
this.showClass = ''
this.showList = false
},
getElementData(el, callback) {
uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
callback(data[0]);
});
}
}
}
</script>
<style lang="scss">
@font-face {
font-family: 'iconfont';
/* project id 1564327 */
src: url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.eot');
src: url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.eot?#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.woff2') format('woff2'),
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.woff') format('woff'),
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.ttf') format('truetype'),
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.svg#iconfont') format('svg');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 28rpx;
font-style: normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
.line {
position: absolute;
height: 3px;
width: 100px;
background: #1abc9c;
}
.dropdown-item {
position: relative;
&__selected {
position: relative;
display: flex;
align-items: center;
background: transparent;
// padding: 10rpx;
box-sizing: border-box;
justify-content: center;
.selected__name {
font-size: 32rpx;
white-space: nowrap;
position: relative;
}
.selected__icon {
margin-left: 8rpx;
&.down {
transition: transform .3s;
transform: rotateZ(0);
}
&.up {
transition: transform .3s;
transform: rotateZ(-180deg);
}
}
}
&__content {
position: fixed;
left: 0;
right: 0;
overflow: hidden;
top: 0;
bottom: 0;
z-index: 10;
.list {
max-height: 400px;
overflow-y: auto;
position: absolute;
left: 0;
right: 0;
z-index: 3;
background: #fff;
transform: translateY(-100%);
transition: all .3s;
&.show {
transform: translateY(0);
}
&__option {
font-size: 32rpx;
padding: 26rpx 28rpx;
display: flex;
justify-content: space-between;
&:not(:last-child) {
border-bottom: 1rpx solid #DDDDDD;
}
}
}
.dropdown-mask {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
transition: all .3s;
z-index: 2;
&.show {
background: rgba(0, 0, 0, 0.5);
}
}
}
&:not(:last-child):after {
content: ' ';
position: absolute;
width: 2rpx;
top: 36rpx;
bottom: 36rpx;
right: 0;
background: $uni-border-color;
}
}
</style>

View File

@ -1,35 +0,0 @@
<template>
<div class="dropdown-menu">
<slot></slot>
</div>
</template>
<script>
export default {
data() {
return {
}
},
mounted() {
this.$on('close', this.closeDropdown)
},
methods: {
closeDropdown() {
this.$children.forEach(item =>{
item.close();
})
}
}
}
</script>
<style lang="scss">
.dropdown-menu {
display: flex;
overflow: auto;
white-space: nowrap;
}
dropdown-item {
flex: 1;
}
</style>

View File

@ -1,132 +0,0 @@
export default {
"pulldown": "\ue588",
"refreshempty": "\ue461",
"back": "\ue471",
"forward": "\ue470",
"more": "\ue507",
"more-filled": "\ue537",
"scan": "\ue612",
"qq": "\ue264",
"weibo": "\ue260",
"weixin": "\ue261",
"pengyouquan": "\ue262",
"loop": "\ue565",
"refresh": "\ue407",
"refresh-filled": "\ue437",
"arrowthindown": "\ue585",
"arrowthinleft": "\ue586",
"arrowthinright": "\ue587",
"arrowthinup": "\ue584",
"undo-filled": "\ue7d6",
"undo": "\ue406",
"redo": "\ue405",
"redo-filled": "\ue7d9",
"bars": "\ue563",
"chatboxes": "\ue203",
"camera": "\ue301",
"chatboxes-filled": "\ue233",
"camera-filled": "\ue7ef",
"cart-filled": "\ue7f4",
"cart": "\ue7f5",
"checkbox-filled": "\ue442",
"checkbox": "\ue7fa",
"arrowleft": "\ue582",
"arrowdown": "\ue581",
"arrowright": "\ue583",
"smallcircle-filled": "\ue801",
"arrowup": "\ue580",
"circle": "\ue411",
"eye-filled": "\ue568",
"eye-slash-filled": "\ue822",
"eye-slash": "\ue823",
"eye": "\ue824",
"flag-filled": "\ue825",
"flag": "\ue508",
"gear-filled": "\ue532",
"reload": "\ue462",
"gear": "\ue502",
"hand-thumbsdown-filled": "\ue83b",
"hand-thumbsdown": "\ue83c",
"hand-thumbsup-filled": "\ue83d",
"heart-filled": "\ue83e",
"hand-thumbsup": "\ue83f",
"heart": "\ue840",
"home": "\ue500",
"info": "\ue504",
"home-filled": "\ue530",
"info-filled": "\ue534",
"circle-filled": "\ue441",
"chat-filled": "\ue847",
"chat": "\ue263",
"mail-open-filled": "\ue84d",
"email-filled": "\ue231",
"mail-open": "\ue84e",
"email": "\ue201",
"checkmarkempty": "\ue472",
"list": "\ue562",
"locked-filled": "\ue856",
"locked": "\ue506",
"map-filled": "\ue85c",
"map-pin": "\ue85e",
"map-pin-ellipse": "\ue864",
"map": "\ue364",
"minus-filled": "\ue440",
"mic-filled": "\ue332",
"minus": "\ue410",
"micoff": "\ue360",
"mic": "\ue302",
"clear": "\ue434",
"smallcircle": "\ue868",
"close": "\ue404",
"closeempty": "\ue460",
"paperclip": "\ue567",
"paperplane": "\ue503",
"paperplane-filled": "\ue86e",
"person-filled": "\ue131",
"contact-filled": "\ue130",
"person": "\ue101",
"contact": "\ue100",
"images-filled": "\ue87a",
"phone": "\ue200",
"images": "\ue87b",
"image": "\ue363",
"image-filled": "\ue877",
"location-filled": "\ue333",
"location": "\ue303",
"plus-filled": "\ue439",
"plus": "\ue409",
"plusempty": "\ue468",
"help-filled": "\ue535",
"help": "\ue505",
"navigate-filled": "\ue884",
"navigate": "\ue501",
"mic-slash-filled": "\ue892",
"search": "\ue466",
"settings": "\ue560",
"sound": "\ue590",
"sound-filled": "\ue8a1",
"spinner-cycle": "\ue465",
"download-filled": "\ue8a4",
"personadd-filled": "\ue132",
"videocam-filled": "\ue8af",
"personadd": "\ue102",
"upload": "\ue402",
"upload-filled": "\ue8b1",
"starhalf": "\ue463",
"star-filled": "\ue438",
"star": "\ue408",
"trash": "\ue401",
"phone-filled": "\ue230",
"compose": "\ue400",
"videocam": "\ue300",
"trash-filled": "\ue8dc",
"download": "\ue403",
"chatbubble-filled": "\ue232",
"chatbubble": "\ue202",
"cloud-download": "\ue8e4",
"cloud-upload-filled": "\ue8e5",
"cloud-upload": "\ue8e6",
"cloud-download-filled": "\ue8e9",
"headphones":"\ue8bf",
"store":"\ue609"
}

File diff suppressed because one or more lines are too long

View File

@ -1,25 +0,0 @@
<template>
<view :style="{ height: statusBarHeight }" class="uni-status-bar">
<slot />
</view>
</template>
<script>
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
export default {
name: 'UniStatusBar',
data() {
return {
statusBarHeight: statusBarHeight
}
}
}
</script>
<style lang="scss" scoped>
.uni-status-bar {
width: 750rpx;
height: 20px;
// height: var(--status-bar-height);
}
</style>

View File

@ -40,9 +40,16 @@
"style": {
"navigationBarTitleText": "搜索",
"navigationStyle": "custom",
"app-plus": {
//app
"scrollIndicator": "none"
"scrollIndicator": "none",
"bottom": "0",
"contentAdjust": "false",
"bounce": "none",
"safearea": {
"bottom": "none"
}
}
}
}, {
@ -443,14 +450,7 @@
{
"root": "pages/promotion",
"pages": [{
"path": "sale",
"style": {
"navigationBarTitleText": "特惠推荐",
"navigationStyle": "custom"
}
}, {
"pages": [ {
"path": "seckill",
"style": {
"navigationBarTitleText": "限时抢购",
@ -473,13 +473,6 @@
"bounce": "none"
}
}
}, {
"path": "recommend",
"style": {
"navigationBarTitleText": "人气推荐",
"navigationStyle": "custom"
}
},{
"path": "lives",
"style": {
@ -718,7 +711,7 @@
]
}
],
"globalStyle": {
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "Lili商城",
"titleColor": "#303133",

View File

@ -2,7 +2,7 @@
<div class="feedBack">
<div class="feedBack-box">
<h4>猜你想问</h4>
<div class="feedBack-item" @click="handleClick(index)" v-for="(item,index) in list" :key="index">
<div class="feedBack-item" :class="{'active':feedBack.type == item.value }" @click="handleClick(index)" v-for="(item,index) in list" :key="index">
{{item.text}}
</div>
</div>
@ -130,6 +130,10 @@ export default {
margin: 0 auto;
border-radius: 100px;
}
.active{
color: $light-color !important;
font-weight: bold;
}
.feedBack {
padding-bottom: 100rpx;
}

View File

@ -35,13 +35,6 @@
}
}
}
/deep/ .u-row {
// #ifdef MP-WEIXIN
padding: 0 5%;
// #endif
}
.status_bar {
height: var(--status-bar-height);
background: #fff !important;
@ -121,7 +114,7 @@ page {
font-size: 24rpx;
}
.flex {
margin: 30rpx 0;
flex-wrap: wrap;
align-items: center;
> .sort-brand-item {
@ -138,47 +131,36 @@ page {
height: 100vh;
overflow: hidden;
}
.storeSellerBox {
// #ifndef MP-WEIXIN
padding: 16rpx !important;
// #endif
}
.goodsClass {
padding: 0 20rpx;
/deep/ .u-row {
}
}
.index-nav-arrow:last-child {
margin-top: -22rpx;
}
.line1-store-name{
font-size: 24rpx;
color: #999;
}
.to-store{
font-size: 24rpx;
color: #333;
margin-left: 10rpx;
}
.img {
width: 26rpx;
height: 26rpx;
}
.goodsRow {
/deep/ .u-row {
// #ifdef MP-WEIXIN
padding: 0%;
background: #fff;
// padding: 16rpx;
border-radius: 0.4em;
margin: 0 !important;
// #endif
}
.goods-row {
background: #fff;
border-radius: 0.4em;
margin: 20rpx 0;
// #ifdef MP-WEIXIN
margin: 10rpx 0;
// #endif
padding: 0 16rpx;
width: 100%;
padding: 16rpx;
>.goods-col{
display: flex;
>.goods-img{
flex: 4;
}
>.goods-detail{
flex: 7;
}
}
}
.add1 {
@ -192,21 +174,14 @@ page {
border-bottom: 1px solid #eeeeee;
}
.logimg {
width: 40rpx;
height: 40rpx;
vertical-align: middle;
}
.clamp3 {
padding-top: 30rpx;
margin-bottom: 10rpx;
font-size: 28rpx;
color: #333333;
font-weight: 400;
display: -webkit-box;
line-height: 40rpx;
height: 80rpx;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2 !important;
@ -217,25 +192,12 @@ page {
}
}
.switchType1 {
width: 50%;
overflow: hidden;
text-align: center;
> .img {
width: 182rpx;
height: 200rpx;
}
}
.imgGoods {
width: 182rpx;
height: 200rpx;
}
view {
display: block;
}
.storeSellerName {
.store-seller-name {
color: #666;
overflow: hidden;
@ -248,7 +210,7 @@ view {
}
}
.countConfig {
.count-config {
padding: 10rpx 0;
color: #666;
display: flex;
@ -635,16 +597,15 @@ view {
overflow: hidden;
}
.countConfig,
.storeSellerName {
.count-config,
.store-seller-name {
font-size: $font-sm;
}
.textHidden {
.text-hidden {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}

View File

@ -82,53 +82,49 @@
<div v-if="isSWitch">
<scroll-view :style="{ height: goodsHeight }" enableBackToTop="true" lower-threshold="250"
@scrolltolower="loadmore()" scroll-with-animation scroll-y class="scoll-page">
<div class="goodsClass">
<u-row v-for="(item, index) in goodsList" :key="index" class="goodsRow">
<u-col :span="4" @click.native="navigateToDetailPage(item)" class="switchType1">
<u-image width="182rpx" height="200rpx" class="imgGoods" :src="item.content.thumbnail">
<u-loading slot="loading"></u-loading>
</u-image>
</u-col>
<u-col :span="8" @click.native="navigateToDetailPage(item)" class="switchType2">
<div class="title clamp3" style="">{{ item.content.goodsName }}</div>
<view class="price-box">
<div class="price" v-if="item.content.price!=undefined">
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
<div class="goods-class">
<div v-for="(item, index) in goodsList" :key="index" class="goods-row">
<div class="flex goods-col">
<div class="goods-img" @click="navigateToDetailPage(item)">
<u-image width="230rpx" height="230rpx" :src="item.content.thumbnail">
<u-loading slot="loading"></u-loading>
</u-image>
</div>
<div class="goods-detail">
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.content.price!=undefined">
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
formatPrice(item.content.price )[1]
}}
</div>
</view>
<div class="promotion" @click="navigateToDetailPage(item)">
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
<span v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1"></span>
<span v-if="promotionItem.indexOf('SECKILL') != -1"></span>
</div>
</div>
</view>
<div class="promotion">
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
<div style="overflow: hidden" @click="navigateToDetailPage(item)" class="count-config">
<span style="float: left; font-size: 22rpx">已售 {{ item.content.buyCount || '0' }}</span>
<span style="float: right; font-size: 22rpx">{{ item.content.commentNum || '0' }}条评论</span>
</div>
<div style="overflow: hidden" @click="navigateToStoreDetailPage(item)" class="count-config">
<div class="text-hidden">
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" text="自营"
type="error" />
<span class="line1-store-name">{{ item.content.storeName }}</span>
<span class="to-store">进店<u-icon size="24" name="arrow-right" color="#666"></u-icon></span>
</div>
<span>
<u-icon name="arrow-right" color="#c5c5c5"></u-icon>
</span>
</div>
</div>
</div>
<span v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1"></span>
<span v-if="promotionItem.indexOf('SECKILL') != -1"></span>
</div>
</div>
<div style="overflow: hidden" class="countConfig">
<span style="float: left; font-size: 22rpx">已售 {{ item.buyCount || '0' }}</span>
<span style="float: right; font-size: 22rpx">{{ item.commentNum || '0' }}条评论</span>
</div>
</u-col>
<u-col :span="12" class="storeSellerBox">
<div class="storeSellerName" @click="clickTostore()">
<div class="textHidden">
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" text="自营"
type="error" />
<span style="
color: #333333;
font-size: 28rpx;
padding-left: 17rpx;
">{{ item.storeName }}</span>
</div>
<span>
<u-icon name="arrow-right" color="#c5c5c5"></u-icon>
</span>
</div>
</u-col>
</u-row>
</div>
</div>
<uni-load-more :status="loadingType" @loadmore="loadmore()"></uni-load-more>
</scroll-view>
@ -153,36 +149,33 @@
<scroll-view :style="{ height: goodsHeight }" scroll-anchoring enableBackToTop="true"
@scrolltolower="loadmore()" scroll-with-animation scroll-y lower-threshold="250" class="scoll-page">
<view class="goods-list">
<view v-for="(item, index) in goodsList" :key="index" class="goods-item"
@click="navigateToDetailPage(item)">
<view class="image-wrapper">
<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
<view class="image-wrapper" @click="navigateToDetailPage(item)">
<image :src="item.content.thumbnail" mode="aspectFill"></image>
</view>
<view class="goods-detail">
<div class="title clamp">{{ item.content.goodsName }}</div>
<view class="price-box">
<div class="title clamp" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.content.price!=undefined">
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
formatPrice(item.content.price )[1]
}}
</div>
</view>
<div class="promotion">
<div class="promotion" @click="navigateToDetailPage(item)">
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
<span v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1"></span>
<span v-if="promotionItem.indexOf('SECKILL') != -1"></span>
</div>
</div>
<div class="countConfig">
<div class="count-config" @click="navigateToDetailPage(item)">
<span>已售 {{ item.content.buyCount || "0" }}</span>
<span>{{ item.content.commentNum || "0" }}条评论</span>
</div>
<div class="storeSellerName">
<div class="textHidden">
<div class="store-seller-name" @click="navigateToStoreDetailPage(item)">
<div class="text-hidden">
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" text="自营"
type="error" />
<span>{{ item.content.storeName || "暂无" }}</span>
@ -275,6 +268,7 @@
</view>
</view>
</u-popup>
<u-back-top :scroll-top="scrollTop"></u-back-top>
</view>
</template>
@ -287,6 +281,7 @@ import storage from "@/utils/storage";
export default {
data() {
return {
scrollTop: 0,
loadIndex: 10,
oldKeywordIndex: "",
selectedWay: {
@ -345,9 +340,13 @@ export default {
routerVal: "",
};
},
onPageScroll(e) {
console.log(e)
this.scrollTop = e.scrollTop;
},
onLoad(val) {
this.init();
// this.initSortGoods();
// this.initSortGoods();
//
this.routerVal = val;
@ -367,7 +366,6 @@ export default {
this.isShowSeachGoods = true;
}
this.loadData();
},
components: {
mSearch,
@ -546,11 +544,18 @@ export default {
delta: 1,
});
},
//
navigateToDetailPage(item) {
uni.navigateTo({
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
});
},
//
navigateToStoreDetailPage(item) {
uni.navigateTo({
url: `/pages/product/shopPage?id=${item.content.storeId}`,
});
},
loadmore() {
this.params.pageNumber++;
this.loadData();

View File

@ -34,7 +34,7 @@
<view class="select-title">退货</view>
<view class="select-sub-title">
退回收到的商品
<uni-icons color="#BABABA" type="arrowright"></uni-icons>
<u-icon name="arrow-right" color="#bababa"></u-icon>
</view>
</view>
</view>
@ -46,7 +46,7 @@
<view class="select-title">退款</view>
<view class="select-sub-title">
退款商品返还金额
<uni-icons color="#BABABA" type="arrowright"></uni-icons>
<u-icon name="arrow-right" color="#bababa"></u-icon>
</view>
</view>
</view>
@ -55,13 +55,8 @@
</template>
<script>
import UniIcons from "@/components/uni-icons/uni-icons.vue";
import { getAfterSaleInfo } from "@/api/after-sale";
export default {
components: {
UniIcons,
},
data() {
return {
sn: "",

View File

@ -28,7 +28,7 @@
logs[0].message
}}</view>
</view>
<uni-icons type="arrowright" style="margin-right: 5px"></uni-icons>
<u-icon name="arrow-right" style="margin-right: 5px" size="30" color="#999"></u-icon>
</view>
</view>
<view class="goods-info">
@ -201,12 +201,7 @@ import {
getAfterSaleLog,
getAfterSaleReason,
} from "@/api/after-sale.js";
import UniIcons from "@/components/uni-icons/uni-icons.vue";
export default {
components: {
UniIcons,
},
data() {
return {
reason: "", //

View File

@ -1,617 +0,0 @@
<template>
<view class="recommend" :style="styleWay">
<view class="status_bar">
<!-- 这里是状态栏 -->
</view>
<view class="prohibition" style="overscroll-behavior: unset;">
<view class="header" :style="'height:' + header.height + 'px;'">
<view class="left">
<u-icon @click="goMainPage" size="40" name="arrow-left"></u-icon>
</view>
{{ title }}
<view @click="goCart" class="right"><text class="alifont icon-gouwuche1" style="font-size: 40rpx;"></text></view>
</view>
</view>
<view class="recommend-head" :style="'margin-top:' + header.height + 'px;'">
<image src="/pages/floor/imgs/recommend/head-sample.png" mode="aspectFill"></image>
</view>
<view class="index-navs">
<ms-dropdown-item class="index-nav" :class="{ 'index-nav-active': nav == 1 }" v-model="sortType" @click.native="handledropdown(1)"
:hasSlot="true" :title="sortType || '综合排序'" ref="dropdownItem1">
<view class="dropdown-item-content">
<view class="dropdown-list" :class="{ 'dropdown-list-active': sortType == '综合排序' }" @click="setSortType('综合排序')"></view>
<view class="dropdown-list" :class="{ 'dropdown-list-active': sortType == '新品排序' }" @click="setSortType('新品排序')"></view>
</view>
</ms-dropdown-item>
<view class="index-nav-divider"></view>
<view class="index-nav" :class="{ 'index-nav-active': nav == 3 }" @click="setNav(3)">
销量
<view class="index-nav-arrows">
<view class="index-nav-arrow">
<image class="img" src="/static/index/arrow-up-1.png" v-if="sale === 'asc'" mode="aspectFit"></image>
<image class="img" src="/static/index/arrow-up.png" v-else mode="aspectFit"></image>
</view>
<view class="index-nav-arrow">
<image class="img" src="/static/index/arrow-down.png" v-if="sale === 'dec'" mode="aspectFit"></image>
<image class="img" src="/static/index/arrow-down-1.png" v-else mode="aspectFit"></image>
</view>
</view>
</view>
<view class="index-nav-divider"></view>
<view class="index-nav" :class="{ 'index-nav-active': nav == 4 }" @click="setNav(4)">
价格
<view class="index-nav-arrows">
<view class="index-nav-arrow">
<image class="img" src="/static/index/arrow-up-1.png" v-if="price === 'asc'" mode="aspectFit"></image>
<image class="img" src="/static/index/arrow-up.png" v-else mode="aspectFit"></image>
</view>
<view class="index-nav-arrow">
<image class="img" src="/static/index/arrow-down.png" v-if="price === 'dec'" mode="aspectFit"></image>
<image class="img" src="/static/index/arrow-down-1.png" v-else mode="aspectFit"></image>
</view>
</view>
</view>
<view class="index-nav-divider"></view>
<ms-dropdown-item class="index-nav" :class="{ 'index-nav-active': nav == 2 }" @click.native="handledropdown(2)"
v-model="current_tag" :hasSlot="true" :title="current_tag || '分类'" ref="dropdownItem2">
<view class="dropdown-tags">
<view class="dropdown-tag" :class="{ 'dropdown-tag-active': current_tag == item }" @click="setTags(item)" v-for="(item, index) in tags">{{ item }}</view>
<view class="dropdown-tag cancel-btn" @click="setTags('分类')"></view>
</view>
</ms-dropdown-item>
</view>
<view class="index-items">
<view class="index-item" v-for="(item, index) in goods" :key="index">
<view class="index-item-img" @click="toProduct(item.goods_id)">
<image :src="item.thumbnail" mode="aspectFill"></image>
<view class="index-item-title">{{ item.goodsName }}</view>
<view class="index-item-price">
¥{{ item.price | unitPrice }}
<!-- ¥{{ item.price | unitPrice }}{{ item.point ? '+' + item.point + '积分' : '' }} -->
<span class="tipsMkt">¥{{ item.mktprice }}</span>
</view>
<view class="index-item-title-desc">
<view>已售 {{ item.buy_count }}</view>
<view>好评率 {{ item.grade }}%</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import msDropdownItem from '@/components/ms-dropdown/dropdown-item.vue';
import {
getTagGoods
} from '@/api/goods.js';
import storage from '@/utils/storage.js';
export default {
components: {
msDropdownItem
},
data() {
return {
styleWay: {
'height': "100%",
'overflow': 'auto',
},
style_flag: false,
header: {
top: 0,
height: 40
},
originalGoods: [],
oldOriginalGoods: [],
//
sortData: [],
goods: [],
title: '',
mark: 'hot',
nav: 1,
sale: '',
price: '',
sortType: '',
tags: [],
current_tag: '',
typeSort1: true,
typeSort2: false,
};
},
async onLoad(options) {
if (options.title) {
this.title = options.title;
}
if (options.mark) {
this.mark = options.mark;
}
let response = await getTagGoods(-1, this.mark, 9999);
this.originalGoods = response.data;
this.reRank();
this.initCategory();
},
onNavigationBarButtonTap() {
uni.switchTab({
url: '/pages/tabbar/cart/cartList'
});
},
methods: {
handledropdown(val) {
if (!this.style_flag) {
this.styleWay = {
'overflow': "hidden",
'height': "100vh"
}
} else {
this.styleWay = {
'overflow': "auto",
'height': "100%"
}
}
this.style_flag = !this.style_flag
//
if (!val) {
this.$refs.dropdownItem2.closePopup()
this.$refs.dropdownItem1.closePopup()
}
this.sale = '';
this.price = '';
// 1
if (val == 1) {
this.nav = 1
this.$refs.dropdownItem2.closePopup()
} else {
this.nav = 2
this.$refs.dropdownItem1.closePopup()
}
},
async getData() {
let response = await getTagGoods(-1, this.mark, 9999);
this.originalGoods = response.data;
this.reRank();
this.initCategory();
},
toProduct(goods_id) {
uni.navigateTo({
url: '/pages/product/goods?id=' + goods_id
});
},
goMainPage() {
uni.navigateBack()
},
goCart() {
let obj = {
from: 'recommend',
id: ''
};
storage.setCartBackbtn(obj);
uni.switchTab({
url: '/pages/tabbar/cart/cartList'
});
},
//
saleSort(type) {
type == 'asc' ? this.originalGoods.sort(this.sortAsc('buy_count')) : this.originalGoods.sort(this.sortDec(
'buy_count'));
},
//
priceSort(type) {
type == 'asc' ? this.originalGoods.sort(this.sortAsc('price')) : this.originalGoods.sort(this.sortDec('price'));
},
//
cateSort(type) {
this.sortData = [];
// this.originalGoods =[]
for (let i = 0; i < this.originalGoods.length; i++) {
if (this.originalGoods[i].category_name == type) {
this.sortData.push(this.originalGoods[i]);
}
}
this.goods = this.sortData;
},
//
sortDec(prop) {
return function(obj1, obj2) {
var val1 = obj1[prop];
var val2 = obj2[prop];
if (val1 < val2) {
return 1;
} else if (val1 > val2) {
return -1;
} else {
return 0;
}
};
},
//
sortAsc(prop) {
return function(obj1, obj2) {
var val1 = obj1[prop];
var val2 = obj2[prop];
if (val1 < val2) {
return -1;
} else if (val1 > val2) {
return 1;
} else {
return 0;
}
};
},
setNav(type) {
this.handledropdown();
this.nav = type;
if (type == 3) {
//
this.typeSort1 ? this.setSort('sale', 'dec') : this.setSort('sale', 'asc');
this.typeSort1 = !this.typeSort1;
} else if (type == 4) {
//
this.typeSort2 ? this.setSort('price', 'asc') : this.setSort('price', 'dec');
this.typeSort2 = !this.typeSort2;
}
},
setSort(key, type) {
this.handledropdown();
if (key === 'sale') {
this.nav = 3;
this.saleSort(type);
this.$set(this, 'price', '');
}
if (key === 'price') {
this.nav = 4;
this.priceSort(type);
this.$set(this, 'sale', '');
}
if (this[key] === type) {
this.$set(this, key, '');
} else {
this.$set(this, key, type);
}
},
//
setSortType(value) {
this.nav = 1;
this.sortType = value;
//
if (value == '新品排序') {
this.originalGoods.sort(this.sortDec('goods_id'));
} else {
this.getData();
}
this.$refs.dropdownItem1.closePopup();
},
setTags(value) {
this.current_tag = value;
this.$refs.dropdownItem2.closePopup();
if (value === '分类') {
this.nav = 1;
this.reRank();
} else {
this.nav = 2;
this.cateSort(value);
}
},
initCategory() {
let goods = this.goods;
let result = [];
for (var i = 0; i < goods.length; i++) {
result.push(goods[i].category_name);
}
this.tags = this.unique(result);
},
unique(arr) {
for (var i = 0; i < arr.length; i++) {
for (var j = i + 1; j < arr.length; j++) {
if (arr[i] == arr[j]) {
//splice
arr.splice(j, 1);
j--;
}
}
}
return arr;
},
reRank() {
this.goods = this.originalGoods;
}
}
};
</script>
<style lang="less" scoped>
.index {
padding-top: var(--status-bar-height);
}
.prohibition {
position: fixed;
width: 100%;
z-index: 100;
top: var(--status-bar-height);
}
.status_bar {
position: fixed;
top: 0px;
height: var(--status-bar-height);
width: 100%;
background: #1abc9c;
z-index: 100;
}
.header {
background: #1abc9c;
position: relative;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
font-size: 34rpx;
height: 80rpx;
.left,
.right {
position: absolute;
width: max-content;
height: max-content;
top: 0;
bottom: 0;
margin: auto;
}
.left {
float: left;
top: 0;
bottom: 0;
left: 20rpx;
}
.right {
float: right;
right: 20rpx;
}
}
.tipsMkt {
float: right;
color: #c0c4cc;
text-decoration: line-through;
margin-right: 20rpx;
font-size: 24rpx;
line-height: 40rpx;
}
.img {
width: 13px !important;
height: 13px !important;
}
.recommend {
width: 100%;
padding-top: var(--status-bar-height);
}
.recommend-head {
image {
width: 3710 rpx;
height: 280 rpx;
}
}
.index-navs {
height: 80 rpx;
padding: 0 52 rpx;
background-color: #f7f7f7;
display: -webkit-box;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: space-between;
}
.index-nav {
color: #999;
font-size: 28 rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
&-active {
color: #1abc9c;
font-weight: 700;
.index-nav-desc {
color: #1abc9c;
}
}
}
.index-nav-desc {
margin-top: 8 rpx;
font-size: 22 rpx;
color: #999;
}
.index-nav-divider {
height: 64 rpx;
border-left: 1px solid #dddcdf;
}
.index-items {
margin-top: 20 rpx;
padding-left: 20 rpx;
background-color: #f7f7f7;
display: -webkit-box;
display: -webkit-flex;
display: flex;
align-items: center;
flex-wrap: wrap;
}
.index-item {
width: 346 rpx;
background-color: #fff;
margin: 0 18 rpx 20 rpx 0;
border-radius: 16 rpx;
box-sizing: border-box;
overflow: hidden;
}
.index-item-img {
image {
width: 346 rpx;
height: 320 rpx;
border-radius: 8rpx 8rpx 0 0;
}
}
.index-item-title {
font-size: 26 rpx;
color: #333333;
padding: 10 rpx 0 0 20 rpx;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.index-item-title-desc {
font-size: 25 rpx;
color: #c0c4cc;
margin: 10rpx 20rpx;
display: flex;
justify-content: space-between;
}
.index-item-price {
overflow: hidden;
font-size: 110 rpx;
color: #ff5a10;
padding: 20 rpx 0 0 20 rpx;
}
.index-nav-arrows {
margin-top: 4 rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.index-nav-arrow {
image {
width: 32 rpx;
height: 32 rpx;
}
}
.index-nav-arrow:last-child {
margin-top: - 14 rpx;
}
.index-nav-arrow:first-child {
margin-bottom: - 14 rpx;
}
.dropdown-list {
width: 100%;
height: 88 rpx;
padding-left: 40 rpx;
font-size: 110 rpx;
color: #999;
font-weight: normal;
display: -webkit-box;
display: -webkit-flex;
display: flex;
align-items: center;
&-active {
color: #1abc9c;
}
}
.dropdown-tags {
padding: 110 rpx;
box-sizing: border-box;
display: -webkit-box;
display: -webkit-flex;
display: flex;
align-items: center;
flex-wrap: wrap;
z-index: 9;
}
.dropdown-tag {
// width: 710 rpx;
padding: 10rpx 20rpx;
height: 60 rpx;
margin: 0 22 rpx 22 rpx 0;
border-radius: 60 rpx;
background-color: #f9f9f9;
font-size: 110 rpx;
color: #999;
display: -webkit-box;
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
&-active {
background-color: #fff;
border: 1px solid #ed4743;
color: #ed4743;
}
}
.cancel-btn {
background-color: #e4e1e6;
}
</style>

View File

@ -1,251 +0,0 @@
<template>
<view class="sale">
<view class="status_bar">
<!-- 这里是状态栏 -->
</view>
<view class="prohibition" :style="'overscroll-behavior: unset;height:' + header.height + 'px;'">
<view class="header">
<view class="left">
<u-icon @click="goMainPage()" size="40" name="arrow-left"></u-icon>
</view>
特惠推荐
<view @click="goCart" class="right"><text class="alifont icon-gouwuche1"
style="font-size: 40rpx;"></text></view>
</view>
</view>
<view class="sale-head">
<image :style="'margin-top:' + header.height + 'px;'" src="/pages/floor/imgs/recommend/head-sample.png"
mode="aspectFill"></image>
</view>
<view class="sale-title">
<view>今日特惠</view>
</view>
<view class="sale-items">
<view class="sale-item" v-for="item in goods" @click="navigateTo(item)">
<view class="sale-item-img">
<image :src="item.thumbnail" mode="aspectFill"></image>
</view>
<view class="sale-item-content">
<view class="sale-item-title">
{{ item.name }}
<view class="sale-item-title-desc">{{ item.category }}</view>
</view>
<view class="sale-item-price">
<text class="sale-item-price-now">¥{{ item.price | unitPrice }}
<!-- <text v-if="item.point">+{{ item.point || 0 }}</text> -->
</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
getPlateformTagGoods
} from '@/api/goods.js';
import storage from '@/utils/storage.js';
export default {
data() {
return {
header: {
top: 0,
height: 40
},
goods: [],
tag_id: 1,
loadStatus: 'more'
};
},
async onLoad(options) {
if (options.title) {
uni.setNavigationBarTitle({
title: options.title
});
}
let response = await getPlateformTagGoods(this.tag_id);
this.goods = response.data;
},
onBackPress() {
},
methods: {
//
navigateTo(item) {
uni.navigateTo({
url: '/pages/product/goods?id=' + item.goods_id
});
},
goCart() {
//
let obj = {
from: 'sale',
id: ''
};
storage.setCartBackbtn(obj);
uni.preloadPage({
url: '/pages/tabbar/cart/cartList'
});
},
goMainPage() {
//退
uni.switchTab({
url: '/pages/tabbar/home/index'
});
}
}
};
</script>
<style lang="less" scoped>
.sale {
width: 100%;
min-height: 100vh;
background-color: #f7f7f7;
}
.index {
padding-top: var(--status-bar-height);
}
.prohibition {
position: fixed;
width: 100%;
z-index: 100;
top: var(--status-bar-height);
}
.status_bar {
position: fixed;
top: 0px;
height: var(--status-bar-height);
width: 100%;
background: #1abc9c;
z-index: 100;
}
.header {
background: #1abc9c;
position: relative;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
font-size: 34rpx;
height: 80rpx;
.left,
.right {
position: absolute;
width: max-content;
height: max-content;
top: 0;
bottom: 0;
margin: auto;
}
.left {
float: left;
top: 0;
bottom: 0;
left: 20rpx;
}
.right {
float: right;
right: 20rpx;
}
}
.sale-head {
padding-top: var(--status-bar-height);
image {
width: 750 rpx;
height: 280 rpx;
border-radius: 0px;
}
margin-bottom: 20 rpx;
}
.sale-title {
width: 710 rpx;
height: 100 rpx;
margin: 0 auto;
font-size: 28 rpx;
color: #666;
border-radius: 14 rpx 14 rpx 0 0;
background-color: #f1f1f1;
display: -webkit-box;
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
justify-content: start;
view {
margin-left: 40 rpx;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC-Regular;
font-weight: 400;
}
}
.sale-items {
display: -webkit-box;
display: -webkit-flex;
display: flex;
align-items: center;
flex-direction: column;
margin: 0 20rpx;
background-color: #fff;
}
.sale-item {
width: 710 rpx;
padding: 0 20rpx;
height: 180 rpx;
border-bottom: 1px solid #eeeeee;
// position: relative;
display: -webkit-box;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: start;
}
.sale-item-img {
margin-right: 20 rpx;
image {
width: 124 rpx;
height: 124 rpx;
border-radius: 8 rpx;
}
}
.sale-item-content {
line-height: 1.5em;
}
.sale-item-title {
font-size: 28 rpx;
color: #333;
}
.sale-item-title-desc {
font-size: 25 rpx;
color: #ccc;
}
.sale-item-price-now {
font-size: 28 rpx;
color: #ff5a10;
margin: 0;
}
</style>