@ -0,0 +1,2 @@
|
||||
registry=https://registry.npm.taobao.org/
|
||||
sass_binary_site="https://npm.taobao.org/mirrors/node-sass"
|
@ -0,0 +1,12 @@
|
||||
FROM node:12.13.1
|
||||
WORKDIR /workload
|
||||
|
||||
COPY nuxt.config.js /workload/nuxt.config.js
|
||||
COPY package.json /workload/package.json
|
||||
COPY .nuxt /workload/.nuxt
|
||||
|
||||
RUN npm config set registry https://registry.npm.taobao.org \
|
||||
&& npm install
|
||||
|
||||
EXPOSE 3000
|
||||
CMD npm run start
|
@ -0,0 +1,54 @@
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
labels:
|
||||
app: $IMAGES
|
||||
name: $IMAGES
|
||||
namespace: yanxuan
|
||||
spec:
|
||||
progressDeadlineSeconds: 600
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: $IMAGES
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxUnavailable: 25%
|
||||
maxSurge: 25%
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: $IMAGES
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: aliyun-docker-hub
|
||||
containers:
|
||||
- image: '$REGISTRY/$DOCKERHUB_NAMESPACE/$IMAGES:$BUILD_NUMBER'
|
||||
name: app
|
||||
ports:
|
||||
- containerPort: $JAR_PORD
|
||||
protocol: TCP
|
||||
resources:
|
||||
limits:
|
||||
cpu: '0.5'
|
||||
memory: 500Mi
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
terminationGracePeriodSeconds: 30
|
||||
---
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: $IMAGES
|
||||
namespace: yanxuan
|
||||
spec:
|
||||
ports:
|
||||
- port: 3000
|
||||
protocol: TCP
|
||||
targetPort: 3000
|
||||
selector:
|
||||
app: $IMAGES
|
||||
type: ClusterIP
|
@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<div class="goods-item" @click="onItem">
|
||||
<img class="goods-item__img" :src="item.mainPicture" alt="商品图片" />
|
||||
<div class="goods-item__title">
|
||||
<span class="goods-item__title-label" v-if="isLabel(item.labelList)">
|
||||
{{ getLabel(item.labelList) }}
|
||||
</span>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
<div class="goods-item__price">
|
||||
<UiMoney :money="item.startingPrice"></UiMoney>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import UiMoney from "@/components/UiMoney.vue";
|
||||
export default {
|
||||
name: "GoodsItem",
|
||||
componetns: { UiMoney },
|
||||
props: {
|
||||
item: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
isLabel(arr) {
|
||||
return arr.some((item) => item.code);
|
||||
},
|
||||
getLabel(arr) {
|
||||
let str = "";
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i].code != "miaosha") {
|
||||
str = arr[i].text;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return str;
|
||||
},
|
||||
onItem() {
|
||||
this.$router.push({
|
||||
path: "/goods/detail/" + this.item.id,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.goods-item {
|
||||
width: 232px;
|
||||
height: 340px;
|
||||
cursor: pointer;
|
||||
background: #ffffff;
|
||||
|
||||
&__img {
|
||||
width: 232px;
|
||||
height: 232px;
|
||||
}
|
||||
&__title {
|
||||
width: 200px;
|
||||
height: 45px;
|
||||
margin: 17px auto 10px;
|
||||
font-size: 14px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
&-label {
|
||||
display: inline-block;
|
||||
padding: 4px 8px;
|
||||
background: rgba(255, 135, 91, 0.1);
|
||||
font-size: 12px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #ff875b;
|
||||
text-align: center;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
&__price {
|
||||
width: 200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<div class="sort-item" @click="onSort">
|
||||
<span class="sort-item-txt">{{ sortText }}</span>
|
||||
<div class="sort-img-box">
|
||||
<img
|
||||
v-if="sortType === 0 || sortType === 1"
|
||||
src="~/static/images/goods/sort-t1.png"
|
||||
alt="sort"
|
||||
/>
|
||||
<img
|
||||
v-if="sortType === 2"
|
||||
src="~/static/images/goods/sort-t2.png"
|
||||
alt="sort"
|
||||
/>
|
||||
<img
|
||||
v-if="sortType === 0 || sortType === 2"
|
||||
src="~/static/images/goods/sort-b1.png"
|
||||
alt="sort"
|
||||
/>
|
||||
<img
|
||||
v-if="sortType === 1"
|
||||
src="~/static/images/goods/sort-b2.png"
|
||||
alt="sort"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "SortItem",
|
||||
props: {
|
||||
sortText: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
/*
|
||||
0:未选中
|
||||
1:desc
|
||||
2:asc
|
||||
*/
|
||||
sortType: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
onSort() {
|
||||
this.$emit("onSort");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.sort-item {
|
||||
margin-right: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
.sort-item-txt {
|
||||
margin-right: 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
.sort-img-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
img {
|
||||
width: 6px;
|
||||
height: 3px;
|
||||
margin: 3px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,5 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import Element from 'element-ui'
|
||||
import locale from 'element-ui/lib/locale/lang/en'
|
||||
import locale from 'element-ui/lib/locale/lang/zh-CN'
|
||||
|
||||
Vue.use(Element, { locale })
|
||||
|
@ -0,0 +1,17 @@
|
||||
import Vue from "vue";
|
||||
import { TOKEN_KEY } from "@/constants";
|
||||
|
||||
const injectOptions = {
|
||||
// 是否需要登录拦截
|
||||
$isLoginValidate() {
|
||||
if (this.$cookies.get(TOKEN_KEY)) {
|
||||
return true;
|
||||
}
|
||||
this.$store.commit("setLoginVisible", true);
|
||||
return false;
|
||||
},
|
||||
};
|
||||
|
||||
for (let key in injectOptions) {
|
||||
Vue.prototype[key] = injectOptions[key];
|
||||
}
|
After Width: | Height: | Size: 369 B |
After Width: | Height: | Size: 374 B |
After Width: | Height: | Size: 375 B |
After Width: | Height: | Size: 134 B |
After Width: | Height: | Size: 133 B |
After Width: | Height: | Size: 135 B |
After Width: | Height: | Size: 135 B |
After Width: | Height: | Size: 706 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 7.7 KiB |