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

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

34
App.vue
View File

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

View File

@@ -1,4 +1,3 @@
<template>
<view class="goods--list">
<block v-if="list.length > 0">
@@ -6,8 +5,18 @@
<view class="cover">
<image class="cover--src" :src="item.cover" mode="aspectFill" />
</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="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="price eb" v-if="priceType === 'EB'">
{{item.price}}<text>易币</text>
@@ -37,6 +46,10 @@
export default {
name: 'goodsList',
props: {
notag: {
type: String,
default: ''
},
// 数据列表
list: {
type: Array,
@@ -68,6 +81,7 @@ export default {
padding: calc(#{$padding} - 10rpx);
display: flex;
flex-wrap: wrap;
.goods--item {
background: white;
box-sizing: border-box;
@@ -75,10 +89,26 @@ export default {
margin: 10rpx;
border-radius: $radius/2;
overflow: hidden;
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;
width: 100%;
padding-top: 100%;
.cover--src {
position: absolute;
height: 100%;
@@ -87,26 +117,41 @@ export default {
left: 0;
}
}
.content {
padding: $padding/2;
.title {
font-size: $title-size-lg;
line-height: 40rpx;
height: 80rpx;
text-align: justify;
@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 {
width: 100%;
display: flex;
justify-content: space-between;
padding-top: $padding/2;
.price {
width: 50%;
color: $text-price;
font-weight: bold;
font-size: $title-size;
@extend .nowrap;
text {
font-size: $title-size-sm;
font-weight: normal;
@@ -114,6 +159,7 @@ export default {
line-height: 50rpx;
}
}
.sales {
width: 50%;
font-size: $title-size-sm;
@@ -126,6 +172,7 @@ export default {
}
}
}
// 数据空
.goods--null {
width: 100%;

View File

@@ -100,7 +100,7 @@
<swiper class="banner-swiper" indicator-color="#e93340" indicator-active-color="#f8f8f8"
indicator-dots autoplay>
<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>
</view>
@@ -126,8 +126,12 @@
<view class="goods-push" v-if="JSON.stringify(position) != '{}'">
<view class="itme item-mian" @click="onGoods(position.one)">
<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>
<span class='is_self' v-if='position.one.specal_tags.is_self'>{{position.one.specal_tags.is_self}}</span>
</view>
<view class="itme">
<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 industryList from '@/components/industry-list/industry-list'
import userAuth from '@/public/userAuth'
import {
config
} from '@/apis/index.js'
export default {
comments: {
goodsList,
@@ -236,7 +243,8 @@
busList: [],
busPage: 1,
// 分页
pageStatus: ''
pageStatus: '',
imgUrl: config.apiUrls
};
},
created() {
@@ -269,6 +277,14 @@
break
}
},
// 点击轮播图
swiperClick(url) {
if (url === 'goBaoDanList') {
uni.navigateTo({
url: 'pages/goods/lists?type=baodan'
})
}
},
// 领取,更多优惠券
onCoupons(type, id, index) {
let token = this.$store.getters.getToken
@@ -341,6 +357,10 @@
mall().then(res => {
this.classify = res.categories.slice(0, 9)
this.banners = res.banners
this.banners = [...this.banners, {
cover: config.apiUrls + 'images/baodan-banner.png',
url: 'goBaoDanList'
}]
this.coupons = res.coupons
this.position = res.positions
}).catch(err => {
@@ -470,6 +490,8 @@
margin: $margin/2;
width: calc(20% - #{$margin});
text-align: center;
position: relative;
.cover {
width: 98rpx;
@@ -482,6 +504,15 @@
line-height: 40rpx;
font-size: $title-size-sm;
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;
border-right: solid 1rpx $border-color;
@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 {
font-weight: bold;
font-size: $title-size;
@extend .nowrap;
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 {
@@ -527,9 +580,9 @@
}
.cover {
margin-bottom: 30rpx;
width: 220rpx;
height: 280rpx;
margin-bottom: 20rpx;
width: 320rpx;
height: 300rpx;
vertical-align: top;
}
}

View File

@@ -15,7 +15,7 @@
<view class="header">
<view class="flex-box">
<view class="price"><text></text>{{goodsObj.price.show}}</view>
<view class="sales">累计易{{goodsObj.sales}}</view>
<view class="sales">累计{{goodsObj.sales}}</view>
</view>
<view class="coupon" v-if="couponSee.length > 0" @click="couponsOpne">
<view class="coupon-list" v-for="(item, index) in couponSee" :key="index">
@@ -23,9 +23,15 @@
{{item.title}}
</view>
</view>
<view class="coupon-btn">领券<image class="coupon-btn-img" src="../../static/icons/goods_row.png" mode="aspectFill"></image></view>
<view class="coupon-btn">领券<image class="coupon-btn-img" src="../../static/icons/goods_row.png"
mode="aspectFill"></image>
</view>
</view>
<view class="title">
<view class="title-hot" v-if="goodsObj.specal_tags.is_allow_values">{{goodsObj.specal_tags.is_allow_values}}</view>
<view class="title-hot" v-if="goodsObj.specal_tags.is_self">{{goodsObj.specal_tags.is_self}}</view>
{{goodsObj.name}}
</view>
<view class="title"><view class="title-hot">热卖</view>{{goodsObj.name}}</view>
<!-- <view class="sub-title">{{goodsObj.description}}</view> -->
</view>
<!-- 商家信息 -->
@@ -34,28 +40,31 @@
<view class="store-cont">
<view class="store-title">{{goodsObj.shop.name}}</view>
<view class="rate">
<uni-rate
:readonly="true"
color="#ddd"
active-color="#c82626"
:value="goodsObj.company.star"
:size="14"
/>
<uni-rate :readonly="true" color="#ddd" active-color="#c82626" :value="goodsObj.company.star"
:size="14" />
</view>
<view class="openbtn" @click="onOpenWechat">进店<image class="openbtn-img"
src="../../static/icons/equity_arrow_right.png" mode="aspectFill"></image>
</view>
<view class="openbtn" @click="onOpenWechat">进店<image class="openbtn-img" src="../../static/icons/equity_arrow_right.png" mode="aspectFill"></image></view>
</view>
<view class="tooSee">
<view class="tooSee-label" @click="$Router.push({name: 'GoodsChain', params: {id: goodsObj.goods_id}})">
<view class="tooSee-label"
@click="$Router.push({name: 'GoodsChain', params: {id: goodsObj.goods_id}})">
区块链证书
<image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png" mode="aspectFill"></image>
<image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png"
mode="aspectFill"></image>
</view>
<view class="tooSee-label" @click="$Router.push({name: 'GoodsAttestation', params: {id: goodsObj.goods_id}})">
<view class="tooSee-label"
@click="$Router.push({name: 'GoodsAttestation', params: {id: goodsObj.goods_id}})">
商品认证
<image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png" mode="aspectFill"></image>
<image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png"
mode="aspectFill"></image>
</view>
<view class="tooSee-label" @click="$Router.push({name: 'GoodstracedTo', params: {id: goodsObj.goods_id}})">
<view class="tooSee-label"
@click="$Router.push({name: 'GoodstracedTo', params: {id: goodsObj.goods_id}})">
商品溯源
<image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png" mode="aspectFill"></image>
<image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png"
mode="aspectFill"></image>
</view>
</view>
</view>
@@ -73,8 +82,10 @@
<label class="title">服务</label>
<view class="goods-serve" @click="serveOpne">
<image class="goods-serve-img" src="../../static/icons/goods_buy.png" mode="aspectFill"></image>
<view class="nowrap goods-serve-name"><text v-for="(item, index) in goodsObj.services">{{item.name}}</text></view>
<image class="goods-serve-img" src="../../static/icons/goods_spot.png" mode="aspectFill"></image>
<view class="nowrap goods-serve-name"><text
v-for="(item, index) in goodsObj.services">{{item.name}}</text></view>
<image class="goods-serve-img" src="../../static/icons/goods_spot.png" mode="aspectFill">
</image>
</view>
</view>
</view>
@@ -173,7 +184,10 @@
</template>
<script>
import { goods, managesCoupons } from '@/apis/interfaces/goods'
import {
goods,
managesCoupons
} from '@/apis/interfaces/goods'
import userAuth from '@/public/userAuth'
export default {
data() {
@@ -295,6 +309,7 @@
padding-top: 100%;
}
// 轮播图
.goods-covers {
position: fixed;
@@ -303,18 +318,21 @@
z-index: 1;
width: 100%;
padding-top: 100%;
.swiper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.swiper-item {
width: 100%;
height: 100%;
}
}
}
// 商品详情
.goods-content {
position: relative;
@@ -323,16 +341,19 @@
border-radius: $radius $radius 0 0;
padding-bottom: calc((#{$padding} * 2) + (env(safe-area-inset-bottom) / 2) + 90rpx);
padding-bottom: calc((#{$padding} * 2) + (constant(safe-area-inset-bottom) / 2) + 90rpx);
// 详情
.header {
padding: 0 $padding $padding;
.title {
font-size: $title-size;
font-weight: bold;
line-height: 50rpx;
.title-hot {
display: inline-block;
background-color: #fee195;
background-image: linear-gradient(to left,#fee195,#fee195);
font-size: 24rpx;
border-radius: 50rpx;
padding: 0 10rpx;
@@ -341,25 +362,31 @@
margin: 6rpx 10rpx 0 0;
}
}
.sub-title {
line-height: 40rpx;
font-size: $title-size-sm;
color: $text-gray;
padding-bottom: $padding/3;
}
.flex-box {
display: flex;
justify-content: space-between;
line-height: 90rpx;
.price {
font-weight: bold;
color: $text-price;
font-size: $title-size + 14;
text {
font-size: 70%;
}
width: calc(60% - #{$padding});
}
.sales {
font-size: $title-size-sm;
color: $text-gray;
@@ -379,8 +406,10 @@
display: flex;
position: relative;
margin-bottom: $margin - 10;
.coupon-list {
font-size: 22rpx;
.coupon-label {
display: inline-block;
border: 1rpx solid #e998a1;
@@ -391,6 +420,7 @@
margin-right: $margin - 10;
}
}
.coupon-btn {
position: absolute;
right: $padding - 20;
@@ -399,6 +429,7 @@
font-size: 24rpx;
display: flex;
font-weight: 700;
.coupon-btn-img {
width: 22rpx;
height: 22rpx;
@@ -411,17 +442,21 @@
// 新增服务
.goods-serve {
display: flex;
.goods-serve-img {
width: 36rpx;
height: 36rpx;
margin-top: 26rpx;
}
.goods-serve-name {
margin: 0 30rpx 0 20rpx;
width: calc(100% - 122rpx);
text {
padding-right: $padding;
position: relative;
&:last-child {
padding-right: 0;
}
@@ -437,6 +472,7 @@
border-radius: $radius/2;
padding: $padding;
min-height: 220rpx;
.logo {
position: absolute;
left: $margin;
@@ -445,6 +481,7 @@
height: 98rpx;
border-radius: $radius/2;
}
.store-cont {
position: absolute;
width: 100%;
@@ -455,6 +492,7 @@
box-sizing: border-box;
height: 140rpx;
}
.tooSee {
position: absolute;
top: 150rpx;
@@ -462,6 +500,7 @@
font-size: 24rpx;
padding-left: $padding;
box-sizing: border-box;
.tooSee-label {
background-color: #fd683e;
border-radius: 8rpx 4rpx 4rpx 6rpx;
@@ -473,10 +512,13 @@
display: inline-block;
margin-right: $margin * 2;
position: relative;
&::after, &::before{
&::after,
&::before {
content: '';
position: absolute;
}
&::after {
right: -40rpx;
top: 0;
@@ -485,6 +527,7 @@
height: 100%;
border-radius: 4rpx 8rpx 8rpx 4rpx;
}
&::before {
right: -1rpx;
top: 5%;
@@ -493,19 +536,24 @@
z-index: 2;
box-sizing: border-box;
}
&:last-child {
margin: 0;
}
&:first-child {
background-color: #f2d7aa;
color: #362507;
}
&:first-child::after {
background-color: #f1d599;
}
&:first-child::before {
border-color: #fae2b9;
}
.tooSee-label-img {
position: absolute;
right: -34rpx;
@@ -514,11 +562,13 @@
height: 28rpx;
z-index: 9;
}
&:first-child .tooSee-label-img {
filter: brightness(.2)
}
}
}
.store-title {
font-size: $title-size-lg;
font-weight: bold;
@@ -526,6 +576,7 @@
color: $text-color;
margin-bottom: 10rpx;
}
// rate
.openbtn {
position: absolute;
@@ -538,6 +589,7 @@
font-size: $title-size-m;
margin-top: -30rpx;
display: flex;
.openbtn-img {
width: 32rpx;
height: 32rpx;
@@ -546,16 +598,19 @@
}
}
}
// 产品规格
.size {
margin-top: $margin;
border-top: solid 20rpx #F8F8F8;
border-bottom: solid 20rpx #F8F8F8;
.size-item {
position: relative;
padding: 0 $padding 0 ($padding + 100);
line-height: 90rpx;
font-size: $title-size-m;
&::after {
position: absolute;
left: $margin;
@@ -565,9 +620,11 @@
height: 1rpx;
background-color: $border-color;
}
&:last-child::after {
display: none;
}
.title {
position: absolute;
left: $margin;
@@ -576,6 +633,7 @@
}
}
}
// 产品详情
.product {
image {
@@ -584,6 +642,7 @@
}
}
}
// 立即购买
.footer {
padding: $padding;
@@ -594,6 +653,7 @@
width: 100%;
z-index: 99;
box-sizing: border-box;
.btn[size='default'] {
width: 100%;
height: 90rpx;
@@ -616,13 +676,16 @@
border-radius: 40rpx 40rpx 0 0;
padding: $padding;
box-sizing: border-box;
.coupons-header {
text-align: center;
position: relative;
margin-bottom: $margin*1.5;
.title {
font-weight: 700;
}
.close {
position: absolute;
right: 0;
@@ -632,17 +695,20 @@
height: 38rpx;
}
}
.coupons-cont {
.coupons-name {
color: #616065;
font-size: 30rpx;
}
.coupons-list {
border: 2rpx solid #d6b9be;
border-radius: 10rpx;
overflow: hidden;
position: relative;
margin-top: $margin;
// background-color: red;
.coupons-tips {
// background-color: #211e17;
@@ -656,12 +722,14 @@
left: 0;
top: 0;
z-index: 10;
.coupons-tips-text {
font-size: 24rpx;
transform: scale(.85);
display: block;
}
}
.coupons-left {
background-color: #fdedee;
color: #e1293f;
@@ -669,26 +737,32 @@
text-align: center;
padding: $padding - 10 0;
border-right: 2rpx dashed #eccdd4;
.coupon-left-img {
width: 180rpx;
height: 100rpx;
border-radius: 20rpx;
}
.coupons-number {
font-size: 40rpx;
font-weight: 600;
text {
font-size: 24rpx;
}
&.coupons-small {
font-size: 32rpx;
padding: 20rpx 0;
}
}
.coupons-full {
font-size: 24rpx;
}
}
.coupons-center {
position: absolute;
width: 100%;
@@ -697,12 +771,14 @@
padding: $padding - 10 130rpx 0 220rpx;
box-sizing: border-box;
font-size: 28rpx;
.coupons-time {
font-size: 24rpx;
margin-top: 10rpx;
color: #514c51;
}
}
.coupons-right {
position: absolute;
right: 20rpx;
@@ -714,6 +790,7 @@
border-radius: 80rpx;
font-size: 24rpx;
line-height: 52rpx;
&.coupons-right-active {
background-color: #adadad;
color: #FFFFFF;
@@ -721,6 +798,7 @@
}
}
}
.coupons-true {
background-image: linear-gradient(to right, #e1293f, #fd275d);
color: #FFFFFF;
@@ -735,10 +813,12 @@
.serve-label {
margin-top: $margin + 10;
font-size: 28rpx;
.serve-label-name {
font-weight: 700;
margin-bottom: $margin - 10;
}
.serve-label-text {
line-height: 44rpx;
}

View File

@@ -1,5 +1,6 @@
<template>
<view class="Goods-LISTS">
<!-- <image :src="`${config.apiUrls}images/baodan-banner.png`" mode="widthFix" /> -->
<view class="tabs">
<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">
@@ -19,6 +20,9 @@
list
} from '@/apis/interfaces/goods'
import goodsList from '@/components/goods-list/goods-list'
import {
config
} from '@/apis/index.js'
export default {
name: 'Goods-LISTS',
data() {
@@ -28,6 +32,7 @@
goods: [],
page: 1,
has_more: true,
isBaoDan: false, // 是否是报单默认有id不是报单无id是报单
};
},
onReachBottom() {
@@ -44,6 +49,14 @@
created() {
this.getList()
},
onShow() {
if (this.$Route.query.type === 'baodan') {
this.isBaoDan = true
uni.setNavigationBarTitle({
title: '报单商品'
})
}
},
methods: {
onTabs(e) {
let index = e.target.dataset.index
@@ -72,8 +85,11 @@
order_by: this.tabIndex == 1 ? this.marketType : '',
page: this.page
}
if (this.$Route.query.type) {
if (this.$Route.query.type === 'id') {
data.category_id = this.$Route.query.id
} else if (this.$Route.query.type === 'baodan') {
// 报单加个条件筛选
data.is_allow_values = 1
} else {
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>
<!-- 优选商品 -->
<goodsList :list="goods" priceType="CNY" :status='status' toast="暂无产品权证">
<goodsList :list="goods" priceType="CNY" :status='status' toast="暂无产品权证" notag='has'>
<template v-slot:statistics="goods">
<view>库存{{goods.value.stock}}</view>
</template>