[报单模块添加及筛选条件,及权证管理模块没有报单兼容插件]

This commit is contained in:
2021-10-28 16:48:12 +08:00
parent 58ec38837a
commit 46279dd3d8
6 changed files with 789 additions and 585 deletions

70
App.vue
View File

@@ -1,36 +1,44 @@
<script> <script>
export default { export default {
onLaunch() { onLaunch() {
// if (typeof WeixinJSBridge == 'object' && typeof WeixinJSBridge.invoke == 'function') { //#ifdef H5
// handleFontSize() if (typeof WeixinJSBridge == 'object' && typeof WeixinJSBridge.invoke == 'function') {
// } else { handleFontSize()
// document.addEventListener('WeixinJSBridgeReady', handleFontSize, false); } else {
// } document.addEventListener('WeixinJSBridgeReady', handleFontSize, false);
// function handleFontSize() { }
// // 设置网页字体为默认大小
// WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 }) function handleFontSize() {
// // 重写设置网页字体大小的事件 // 设置网页字体为默认大小
// WeixinJSBridge.on('menu:setfont', function() { WeixinJSBridge.invoke('setFontSizeCallback', {
// WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 }) fontSize: 0
// }) })
// } // 重写设置网页字体大小的事件
}, WeixinJSBridge.on('menu:setfont', function() {
onShow() { WeixinJSBridge.invoke('setFontSizeCallback', {
console.log('App Show'); fontSize: 0
}, })
onHide() { })
console.log('App Hide'); }
}, //#endif
globalData: { },
mainColor: 'white' onShow() {
} console.log('App Show');
}; },
onHide() {
console.log('App Hide');
},
globalData: {
mainColor: 'white'
}
};
</script> </script>
<style lang="scss"> <style lang="scss">
@import 'uview-ui/index.scss'; @import 'uview-ui/index.scss';
page {
background: #f5f5f5; page {
-webkit-text-size-adjust: 100% !important; background: #f5f5f5;
} -webkit-text-size-adjust: 100% !important;
}
</style> </style>

View File

@@ -1,4 +1,3 @@
<template> <template>
<view class="goods--list"> <view class="goods--list">
<block v-if="list.length > 0"> <block v-if="list.length > 0">
@@ -6,8 +5,18 @@
<view class="cover"> <view class="cover">
<image class="cover--src" :src="item.cover" mode="aspectFill" /> <image class="cover--src" :src="item.cover" mode="aspectFill" />
</view> </view>
<template v-if='notag === ""'>
<span class='is_self'
v-if='item.specal_tags.is_self'>{{item.specal_tags.is_self}}</span>
</template>
<view class="content"> <view class="content">
<view class="title">{{item.name}}</view> <view class="title">
<template v-if='notag === ""'>
<span class='is_allow_values'
v-if='item.specal_tags.is_allow_values'>{{item.specal_tags.is_allow_values}}</span>
</template>
{{item.name}}
</view>
<view class="content-flex"> <view class="content-flex">
<view class="price eb" v-if="priceType === 'EB'"> <view class="price eb" v-if="priceType === 'EB'">
{{item.price}}<text>易币</text> {{item.price}}<text>易币</text>
@@ -34,52 +43,73 @@
</template> </template>
<script> <script>
export default { export default {
name : 'goodsList', name: 'goodsList',
props : { props: {
// 数据列表 notag: {
list: { type: String,
type : Array, default: ''
default : () => { },
return new Array // 数据列表
list: {
type: Array,
default: () => {
return new Array
}
},
// 价格类型
priceType: {
type: String,
default: 'EB'
},
// 列表空提示
toast: {
type: String,
default: '暂无商品数据 -_-!'
} }
}, },
// 价格类型 methods: {
priceType: { goods(e) {
type : String, this.$emit('on-goods', e)
default : 'EB' }
},
// 列表空提示
toast : {
type : String,
default : '暂无商品数据 -_-!'
} }
}, };
methods:{
goods(e){
this.$emit('on-goods', e)
}
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.goods--list{ .goods--list {
padding: calc(#{$padding} - 10rpx); padding: calc(#{$padding} - 10rpx);
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.goods--item{
.goods--item {
background: white; background: white;
box-sizing: border-box; box-sizing: border-box;
width: calc(50% - 20rpx); width: calc(50% - 20rpx);
margin: 10rpx; margin: 10rpx;
border-radius: $radius/2; border-radius: $radius/2;
overflow: hidden; overflow: hidden;
.cover{ position: relative;
.is_self {
position: absolute;
top: 0;
right: 20rpx;
background-image: linear-gradient(to bottom, #ee4c47, #9e312f);
// background-color: #ee4c47;
box-shadow: 0 4rpx 10rpx 2rpx rgba($color: #000, $alpha: .3);
color: #fff;
font-size: 26;
padding: 2rpx 20rpx 10rpx 20rpx;
border-radius: 0 0 50rpx 50rpx;
}
.cover {
position: relative; position: relative;
width: 100%; width: 100%;
padding-top: 100%; padding-top: 100%;
.cover--src{
.cover--src {
position: absolute; position: absolute;
height: 100%; height: 100%;
width: 100%; width: 100%;
@@ -87,34 +117,50 @@ export default {
left: 0; left: 0;
} }
} }
.content{
.content {
padding: $padding/2; padding: $padding/2;
.title{
.title {
font-size: $title-size-lg; font-size: $title-size-lg;
line-height: 40rpx; line-height: 40rpx;
height: 80rpx; height: 80rpx;
text-align: justify; text-align: justify;
@extend .ellipsis; @extend .ellipsis;
.is_allow_values {
color: #fff;
background-image: linear-gradient(to left, $main-color, $mian-color-light);
padding: 2rpx 14rpx;
font-size: 20rpx;
text-align: center;
border-radius: 30rpx;
margin-right: 20rpx;
}
} }
.content-flex{
.content-flex {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding-top: $padding/2; padding-top: $padding/2;
.price{
.price {
width: 50%; width: 50%;
color: $text-price; color: $text-price;
font-weight: bold; font-weight: bold;
font-size: $title-size; font-size: $title-size;
@extend .nowrap; @extend .nowrap;
text{
text {
font-size: $title-size-sm; font-size: $title-size-sm;
font-weight: normal; font-weight: normal;
padding-left: $padding/4; padding-left: $padding/4;
line-height: 50rpx; line-height: 50rpx;
} }
} }
.sales{
.sales {
width: 50%; width: 50%;
font-size: $title-size-sm; font-size: $title-size-sm;
color: $text-gray; color: $text-gray;
@@ -126,8 +172,9 @@ export default {
} }
} }
} }
// 数据空 // 数据空
.goods--null{ .goods--null {
width: 100%; width: 100%;
padding: 200rpx 0; padding: 200rpx 0;
text-align: center; text-align: center;

View File

@@ -100,7 +100,7 @@
<swiper class="banner-swiper" indicator-color="#e93340" indicator-active-color="#f8f8f8" <swiper class="banner-swiper" indicator-color="#e93340" indicator-active-color="#f8f8f8"
indicator-dots autoplay> indicator-dots autoplay>
<swiper-item v-for="(item, index) in banners" :key="index"> <swiper-item v-for="(item, index) in banners" :key="index">
<image class="cover" :src="item.cover" mode="aspectFill"></image> <image class="cover" :src="item.cover" mode="aspectFill" @click="swiperClick(item.url)" />
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
@@ -126,8 +126,12 @@
<view class="goods-push" v-if="JSON.stringify(position) != '{}'"> <view class="goods-push" v-if="JSON.stringify(position) != '{}'">
<view class="itme item-mian" @click="onGoods(position.one)"> <view class="itme item-mian" @click="onGoods(position.one)">
<image class="cover" :src="position.one.cover" mode="aspectFill"></image> <image class="cover" :src="position.one.cover" mode="aspectFill"></image>
<view class="title">{{position.one.name}}</view> <view class="title">
<span class='is_allow_values' v-if='position.one.specal_tags.is_allow_values'>{{position.one.specal_tags.is_allow_values}}</span>
{{position.one.name}}
</view>
<view class="price"><text>¥</text>{{position.one.original_price}}</view> <view class="price"><text>¥</text>{{position.one.original_price}}</view>
<span class='is_self' v-if='position.one.specal_tags.is_self'>{{position.one.specal_tags.is_self}}</span>
</view> </view>
<view class="itme"> <view class="itme">
<view class="itme-list" v-for="(item, index) in position.two" :key="index" @click="onGoods(item)"> <view class="itme-list" v-for="(item, index) in position.two" :key="index" @click="onGoods(item)">
@@ -196,6 +200,9 @@
import goodsList from '@/components/goods-list/goods-list' import goodsList from '@/components/goods-list/goods-list'
import industryList from '@/components/industry-list/industry-list' import industryList from '@/components/industry-list/industry-list'
import userAuth from '@/public/userAuth' import userAuth from '@/public/userAuth'
import {
config
} from '@/apis/index.js'
export default { export default {
comments: { comments: {
goodsList, goodsList,
@@ -236,7 +243,8 @@
busList: [], busList: [],
busPage: 1, busPage: 1,
// 分页 // 分页
pageStatus: '' pageStatus: '',
imgUrl: config.apiUrls
}; };
}, },
created() { created() {
@@ -269,6 +277,14 @@
break break
} }
}, },
// 点击轮播图
swiperClick(url) {
if (url === 'goBaoDanList') {
uni.navigateTo({
url: 'pages/goods/lists?type=baodan'
})
}
},
// 领取,更多优惠券 // 领取,更多优惠券
onCoupons(type, id, index) { onCoupons(type, id, index) {
let token = this.$store.getters.getToken let token = this.$store.getters.getToken
@@ -341,6 +357,10 @@
mall().then(res => { mall().then(res => {
this.classify = res.categories.slice(0, 9) this.classify = res.categories.slice(0, 9)
this.banners = res.banners this.banners = res.banners
this.banners = [...this.banners, {
cover: config.apiUrls + 'images/baodan-banner.png',
url: 'goBaoDanList'
}]
this.coupons = res.coupons this.coupons = res.coupons
this.position = res.positions this.position = res.positions
}).catch(err => { }).catch(err => {
@@ -470,6 +490,8 @@
margin: $margin/2; margin: $margin/2;
width: calc(20% - #{$margin}); width: calc(20% - #{$margin});
text-align: center; text-align: center;
position: relative;
.cover { .cover {
width: 98rpx; width: 98rpx;
@@ -482,6 +504,15 @@
line-height: 40rpx; line-height: 40rpx;
font-size: $title-size-sm; font-size: $title-size-sm;
color: $text-gray; color: $text-gray;
.is_allow_values {
color: #fff;
background-image: linear-gradient(to left,$main-color,$mian-color-light);
padding: 2rpx 14rpx;
font-size: 20rpx;
text-align: center;
border-radius: 30rpx;
margin-right: 20rpx;
}
} }
} }
} }
@@ -506,12 +537,34 @@
text-align: center; text-align: center;
border-right: solid 1rpx $border-color; border-right: solid 1rpx $border-color;
@extend .vertical; @extend .vertical;
position: relative;
.is_self {
position: absolute;
top: 14rpx;
right: 20rpx;
background-image: linear-gradient(to bottom, #ee4c47, #9e312f);
// background-color: #ee4c47;
box-shadow: 0 4rpx 10rpx 2rpx rgba($color: #000, $alpha: .3);
color: #fff;
font-size: 26;
padding: 2rpx 20rpx 10rpx 20rpx;
border-radius: 0 0 50rpx 50rpx;
}
.title { .title {
font-weight: bold; font-weight: bold;
font-size: $title-size; font-size: $title-size;
@extend .nowrap; @extend .nowrap;
line-height: 50rpx; line-height: 50rpx;
.is_allow_values {
color: #fff;
background-image: linear-gradient(to left,$main-color,$mian-color-light);
padding: 2rpx 14rpx;
font-size: 20rpx;
text-align: center;
border-radius: 30rpx;
margin-right: 20rpx;
}
} }
.price { .price {
@@ -527,9 +580,9 @@
} }
.cover { .cover {
margin-bottom: 30rpx; margin-bottom: 20rpx;
width: 220rpx; width: 320rpx;
height: 280rpx; height: 300rpx;
vertical-align: top; vertical-align: top;
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
<template> <template>
<view class="Goods-LISTS"> <view class="Goods-LISTS">
<!-- <image :src="`${config.apiUrls}images/baodan-banner.png`" mode="widthFix" /> -->
<view class="tabs"> <view class="tabs">
<view class="tabs-item" :class="{'show': tabIndex == 0}" @click="onTabs" data-index="0">最新</view> <view class="tabs-item" :class="{'show': tabIndex == 0}" @click="onTabs" data-index="0">最新</view>
<view class="tabs-item" :class="{'show': tabIndex == 1}" @click="onTabs" data-index="1"> <view class="tabs-item" :class="{'show': tabIndex == 1}" @click="onTabs" data-index="1">
@@ -19,6 +20,9 @@
list list
} from '@/apis/interfaces/goods' } from '@/apis/interfaces/goods'
import goodsList from '@/components/goods-list/goods-list' import goodsList from '@/components/goods-list/goods-list'
import {
config
} from '@/apis/index.js'
export default { export default {
name: 'Goods-LISTS', name: 'Goods-LISTS',
data() { data() {
@@ -28,6 +32,7 @@
goods: [], goods: [],
page: 1, page: 1,
has_more: true, has_more: true,
isBaoDan: false, // 是否是报单默认有id不是报单无id是报单
}; };
}, },
onReachBottom() { onReachBottom() {
@@ -44,6 +49,14 @@
created() { created() {
this.getList() this.getList()
}, },
onShow() {
if (this.$Route.query.type === 'baodan') {
this.isBaoDan = true
uni.setNavigationBarTitle({
title: '报单商品'
})
}
},
methods: { methods: {
onTabs(e) { onTabs(e) {
let index = e.target.dataset.index let index = e.target.dataset.index
@@ -58,7 +71,7 @@
onGoods(e) { onGoods(e) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/goods/details?id='+e.goods_id url: '/pages/goods/details?id=' + e.goods_id
}) })
// this.$Router.push({ // this.$Router.push({
// name: 'goodsDetails', // name: 'goodsDetails',
@@ -72,8 +85,11 @@
order_by: this.tabIndex == 1 ? this.marketType : '', order_by: this.tabIndex == 1 ? this.marketType : '',
page: this.page page: this.page
} }
if (this.$Route.query.type) { if (this.$Route.query.type === 'id') {
data.category_id = this.$Route.query.id data.category_id = this.$Route.query.id
} else if (this.$Route.query.type === 'baodan') {
// 报单加个条件筛选
data.is_allow_values = 1
} else { } else {
data.category_cid = this.$Route.query.id data.category_cid = this.$Route.query.id
} }

View File

@@ -8,7 +8,7 @@
<view class="item" :class="{'show': status == '3'}" @click="onTabs('3')">已驳回</view> <view class="item" :class="{'show': status == '3'}" @click="onTabs('3')">已驳回</view>
</view> </view>
<!-- 优选商品 --> <!-- 优选商品 -->
<goodsList :list="goods" priceType="CNY" :status='status' toast="暂无产品权证"> <goodsList :list="goods" priceType="CNY" :status='status' toast="暂无产品权证" notag='has'>
<template v-slot:statistics="goods"> <template v-slot:statistics="goods">
<view>库存{{goods.value.stock}}</view> <view>库存{{goods.value.stock}}</view>
</template> </template>