This commit is contained in:
夜良king
2022-02-15 10:12:53 +08:00
82 changed files with 3324 additions and 2258 deletions

View File

@@ -51,6 +51,7 @@ export default {
list: [], // 优惠券列表
total: 0, // 优惠券总数
params: { // 请求参数
getType: 'FREE',
pageNumber: 1,
pageSize: 20
}
@@ -95,6 +96,7 @@ export default {
content: '<p>优惠券领取成功,可到我的优惠券页面查看</p>',
okText: '我的优惠券',
cancelText: '立即使用',
closable: true,
onOk: () => {
this.$router.push('/home/Coupons')
},

View File

@@ -68,14 +68,31 @@
已有<span>{{ item.content.commentNum || 0 }}</span
>人评价
</div>
<div class="goods-show-seller" >
<Tag class="goods-show-buyer" v-if="item.content.selfOperated" size="default" color="error">自营
<div class="goods-show-seller">
<Tag
class="goods-show-buyer"
v-if="item.content.selfOperated"
size="default"
color="error"
>自营
</Tag>
<div class="goods-show-right" >
<div class="goods-show-middle" v-if="goodsListType.content.goodsType == 'VIRTUAL_GOODS'">虚拟</div>
<div class="goods-show-middle" v-else-if="goodsListType.content.goodsType == 'PHYSICAL_GOODS'">实物</div>
<div class="goods-show-right">
<div
class="goods-show-middle"
v-if="goodsListType.content.goodsType == 'VIRTUAL_GOODS'"
>
虚拟
</div>
<div
class="goods-show-middle"
v-else-if="goodsListType.content.goodsType == 'PHYSICAL_GOODS'"
>
实物
</div>
</div>
<span class="text-bottom" style="color:#e4393c;">{{ item.content.storeName }}</span>
<span class="text-bottom" style="color: #e4393c">{{
item.content.storeName
}}</span>
</div>
</div>
</div>
@@ -98,134 +115,141 @@
</template>
<script>
import GoodsClassNav from '@/components/nav/GoodsClassNav';
import * as apiGoods from '@/api/goods';
import GoodsClassNav from "@/components/nav/GoodsClassNav";
import * as apiGoods from "@/api/goods";
export default {
name: 'GoodsList',
beforeRouteEnter (to, from, next) {
name: "GoodsList",
beforeRouteEnter(to, from, next) {
window.scrollTo(0, 0);
next();
},
data () {
data() {
return {
sortIndex: 0, // 排序状态
sortPriceIndex: false, // 判断价格升序还是降序
goodsTool: [ // 排序类型
{ title: '综合', en: '' },
{ title: '销量', en: 'buyCount' },
{ title: '评论数', en: 'commentNum' },
{ title: '新品', en: 'releaseTime' }
goodsTool: [
// 排序类型
{ title: "综合", en: "" },
{ title: "销量", en: "buyCount" },
{ title: "评论数", en: "commentNum" },
{ title: "新品", en: "releaseTime" },
],
goodsList: [], // 商品列表
loading: false, // 加载状态
goodsListType:"",
goodsListType: "",
total: 0, // 列表总数
params: { // 请求参数
params: {
// 请求参数
pageNumber: 0,
pageSize: 20,
categoryId: ''
}
categoryId: "",
},
};
},
watch: {
$route () {
const keyword = this.$route.query.keyword
this.handleSearch(keyword)
}
$route() {
const keyword = this.$route.query.keyword;
this.handleSearch(keyword);
},
},
methods: {
// 搜索
handleSearch (key) {
this.params.keyword = key
this.params.pageNumber = 0
this.getGoodsList()
handleSearch(key) {
this.params.keyword = key;
this.params.pageNumber = 0;
this.getGoodsList();
},
orderBy (data, index) {
orderBy(data, index) {
// 排序
this.sortIndex = index;
this.params.sort = data;
this.params.order = 'desc';
if (data === 'price') {
this.params.order = "desc";
if (data === "price") {
if (!this.sortPriceIndex) {
this.sortPriceIndex = 'asc';
this.sortPriceIndex = "asc";
} else {
this.sortPriceIndex === 'desc' ? (this.sortPriceIndex = 'asc') : (this.sortPriceIndex = 'desc');
this.sortPriceIndex === "desc"
? (this.sortPriceIndex = "asc")
: (this.sortPriceIndex = "desc");
}
this.params.order = this.sortPriceIndex
this.params.order = this.sortPriceIndex;
} else {
this.sortPriceIndex = false
this.sortPriceIndex = false;
}
this.getGoodsList();
},
goGoodsDetail (skuId, goodsId) {
goGoodsDetail(skuId, goodsId) {
// 跳转商品详情
let routeUrl = this.$router.resolve({
path: '/goodsDetail',
query: { skuId, goodsId }
path: "/goodsDetail",
query: { skuId, goodsId },
});
window.open(routeUrl.href, '_blank');
window.open(routeUrl.href, "_blank");
},
// 分页 修改页码
changePageNum (val) {
changePageNum(val) {
this.params.pageNumber = val;
this.getGoodsList();
},
// 分页 修改页数
changePageSize (val) {
changePageSize(val) {
this.params.pageNumber = 1;
this.params.pageSize = val;
this.getGoodsList();
},
// 获取商品列表
getGoodsList () {
getGoodsList() {
this.loading = true;
apiGoods.goodsList(this.params)
apiGoods
.goodsList(this.params)
.then((res) => {
this.loading = false;
if (res.success) {
this.goodsList = res.result.content;
this.total = res.result.totalElements;
for(var i = 0;i<this.goodsList.length; i++){
for (var i = 0; i < this.goodsList.length; i++) {
this.goodsListType = this.goodsList[i];
}
}
}).catch(() => {
})
.catch(() => {
this.loading = false;
});
},
getParams (val) {
getParams(val) {
// 筛选条件回显
Object.assign(this.params, val)
this.getGoodsList()
}
Object.assign(this.params, val);
this.getGoodsList();
},
},
created () {
created() {
if (this.$route.query.categoryId) {
let cateId = this.$route.query.categoryId.split(',')
Object.assign(this.params, this.$route.query)
this.params.categoryId = cateId[cateId.length - 1]
let cateId = this.$route.query.categoryId.split(",");
Object.assign(this.params, this.$route.query);
this.params.categoryId = cateId[cateId.length - 1];
} else {
Object.assign(this.params, this.$route.query)
Object.assign(this.params, this.$route.query);
}
this.getGoodsList()
this.getGoodsList();
},
components: {
GoodsClassNav
}
GoodsClassNav,
},
};
</script>
<style scoped lang="scss">
@import '../assets/styles/goodsList.scss';
.goods-show-info>.goods-show-seller>.goods-show-buyer{
height:16px;width:30px;
white-space: nowrap;
line-height:17px;
text-align: center;
padding:0 3px;
background-color:#E23A3A;
}
.goods-show-seller{
@import "../assets/styles/goodsList.scss";
.goods-show-info > .goods-show-seller > .goods-show-buyer {
height: 16px;
width: 30px;
white-space: nowrap;
line-height: 17px;
text-align: center;
padding: 0 3px;
background-color: #e23a3a;
}
.goods-show-seller {
// padding:3px 0;
vertical-align: middle;
}
@@ -235,8 +259,8 @@ export default {
min-width: 1000px;
position: relative;
}
.price-sort:hover{
color:#E23A3A;
.price-sort:hover {
color: #e23a3a;
}
.goods-box {
display: flex;
@@ -246,26 +270,26 @@ export default {
width: 200px;
border: 1px solid #ccc;
}
.goods-show-right{
width:35px;
height:17px;
.goods-show-right {
width: 35px;
height: 17px;
// vertical-align:middle;
overflow: hidden;
margin-top:1.5px;
margin-top: 1.5px;
margin-right: 5px;
line-height: 16px;
background:white;
border-radius:4px;
margin-bottom:5px;
float:left;
text-align:center;
border:1px solid rgba(112, 123, 187, 0.8);
color:rgba(112, 123, 187, 0.8);
background: white;
border-radius: 4px;
margin-bottom: 5px;
float: left;
text-align: center;
border: 1px solid rgba(112, 123, 187, 0.8);
color: rgba(112, 123, 187, 0.8);
}
.goods-show-middle:hover{
color:rgba(2, 15, 88, 0.6);
border:0.2px solid rgba(0, 13, 87, 0.6);
border-radius:4px;
.goods-show-middle:hover {
color: rgba(2, 15, 88, 0.6);
border: 0.2px solid rgba(0, 13, 87, 0.6);
border-radius: 4px;
line-height: 18px;
}
.item-as-title {

View File

@@ -0,0 +1,88 @@
<template>
<div class="box">
<div class="wrapper">
<div class="nav" @click="back">
<img src="@/assets/images/logo2.png" alt="" class="logo" />
<div class="title">{{ detail.title }}</div>
</div>
<div v-html="detail.content"></div>
</div>
</div>
</template>
<script>
import { articleDetail } from "@/api/common.js";
const config = require("@/config/index");
export default {
data() {
return {
config,
detail: "",
};
},
mounted() {
this.init();
},
methods: {
back() {
this.$router.push("/");
},
// 初始化文章
init() {
const id = this.$route.query.id;
articleDetail(id).then((res) => {
if (res.success) {
this.detail = res.result;
}
});
},
},
};
</script>
<style lang="scss" scoped>
.logo {
max-width: 200px;
}
.box {
min-height: 100vh;
width: 1200px;
overflow: hidden;
margin: 0 auto;
padding: 32px;
}
.wrapper {
width: 1200px;
min-height: 600px;
padding: 32px;
background: #fff;
}
.nav {
text-align: center;
font-size: 21px;
font-weight: bold;
}
.title {
text-align: center;
font-size: 21px;
margin: 20px 0;
}
// iphone
@media screen and (max-width: 767px) {
.box {
min-height: 100vh;
width: 100%;
padding: 0;
margin: 0 auto;
}
.wrapper {
width: 100%;
min-height: 600px;
padding: 0 16px;
background: #fff;
}
}
</style>

View File

@@ -48,7 +48,7 @@ export default {
nickName: [{required: true, message: '用户昵称不能为空'}, { max: 16, message: '用户昵称不能超过15个字符' }]
},
formItem: {}, // 表单数据
action: commonUrl + '/common/upload/file', // 上传接口
action: commonUrl + '/common/common/upload/file', // 上传接口
accessToken: {} // 验证token
}
},

View File

@@ -81,7 +81,7 @@ export default {
descriptionScore: 5
}, // 表单
visible: false, // 图片预览
action: commonUrl + '/common/upload/file', // 上传地址
action: commonUrl + '/common/common/upload/file', // 上传地址
accessToken: {}, // 验证token
previewImage: '', // 预览图片地址
loading: false // 提交加载状态

View File

@@ -9,7 +9,7 @@
class="width_300"
search
enter-button
v-model="params.keywords"
v-model="params.sn"
@on-search="getList"
placeholder="请输入订单号搜索"
/>
@@ -125,7 +125,7 @@ export default {
params: { // 请求参数
pageNumber: 1,
pageSize: 10,
keywords: '',
sn: '',
sort: 'createTime',
order: 'desc'
},

View File

@@ -117,7 +117,7 @@ export default {
num: 1
},
uploadList: [], // 上传列表
action: commonUrl + '/common/upload/file', // 上传地址
action: commonUrl + '/common/common/upload/file', // 上传地址
accessToken: {}, // 验证token
visible: false, // 图片预览
previewImage: '', // 预览图片url

View File

@@ -68,7 +68,7 @@ export default {
content: ''
}, // 表单
visible: false, // 图片预览
action: commonUrl + '/common/upload/file', // 上传地址
action: commonUrl + '/common/common/upload/file', // 上传地址
accessToken: {}, // 验证token
previewImage: '', // 图片地址
loading: false, // 加载状态

View File

@@ -313,8 +313,12 @@ export default {
let notSupArea = res.result.notSupportFreight;
this.selectedCoupon = {};
if (res.result.platformCoupon)
this.selectedCoupon.platformCoupon = res.result.platformCoupon;
Object.assign(this.selectedCoupon, res.result.storeCoupons);
this.selectedCoupon[res.result.platformCoupon.memberCoupon.id] = res.result.platformCoupon;
if (res.result.storeCoupons && Object.keys(res.result.storeCoupons)[0]) {
let storeMemberCouponsId = Object.keys(res.result.storeCoupons)[0];
let storeCouponId = res.result.storeCoupons[storeMemberCouponsId].memberCoupon.id;
this.selectedCoupon[storeCouponId] = res.result.storeCoupons[storeMemberCouponsId];
}
if (notSupArea) {
let content = [];
let title = "";
@@ -340,7 +344,7 @@ export default {
const couponKeys = Object.keys(this.selectedCoupon);
if (couponKeys.length) {
this.couponList.forEach((e) => {
if (e.id === this.selectedCoupon[couponKeys].memberCoupon.id) {
if (this.selectedCoupon[e.id] && e.id === this.selectedCoupon[e.id].memberCoupon.id) {
this.usedCouponId.push(e.id);
}
});

View File

@@ -205,7 +205,7 @@ export default {
},
data () {
return {
action: commonUrl + '/common/upload/file', // 上传地址
action: commonUrl + '/common/common/upload/file', // 上传地址
accessToken: {}, // 验证token
visible: false, // 预览图片
loading: false, // 加载状态

View File

@@ -129,7 +129,7 @@ export default {
return {
loading: false, // 加载状态
uploadLoading: false, // 上传加载状态
action: commonUrl + '/common/upload/file', // 上传地址
action: commonUrl + '/common/common/upload/file', // 上传地址
accessToken: {}, // 验证token
previewPicture: '', // 预览图片
address: '', // 回显地址