哭哭哭

master
20300 2024-03-26 09:06:13 +08:00
parent ffe6fc9333
commit 28d23e6ca6
2 changed files with 62 additions and 21 deletions

View File

@ -9,8 +9,8 @@
<el-row :gutter="20" style="margin-top: 20px"> <el-row :gutter="20" style="margin-top: 20px">
<el-col :span="12"> <el-col :span="12">
<el-carousel trigger="click" height="400px"> <el-carousel trigger="click" height="400px">
<el-carousel-item v-for="item in 4" :key="item"> <el-carousel-item v-for="img in carouseImages" :key="img">
<h3 class="small">{{ item }}</h3> <el-image :src="img" style="width: 100%; height: 100%;"></el-image>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
<div style="margin-top: 20px;"> <div style="margin-top: 20px;">
@ -54,8 +54,9 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div> <div>
<el-statistic :value="like ? 521 : 520" title="品牌信息"> <el-statistic title="品牌信息">
<template slot="suffix"> <template slot="suffix">
{{projectDetail.brandInfo.nam}}
<span @click="like = !like" class="like"> <span @click="like = !like" class="like">
<i <i
class="el-icon-star-on" class="el-icon-star-on"
@ -64,7 +65,9 @@
></i> ></i>
<i class="el-icon-star-off" v-show="!like"></i> <i class="el-icon-star-off" v-show="!like"></i>
</span> </span>
</template> </template>
</el-statistic> </el-statistic>
</div> </div>
</el-col> </el-col>
@ -72,17 +75,17 @@
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<h1>商品名称</h1> <h1>{{projectDetail.projectInfo.name}}</h1>
<h3>商品规格内存-储存-颜色</h3> <h3>商品规格:{{abc}}</h3>
<h2 style="color: red">125</h2> <h2 style="color: red">{{formm.price}}</h2>
<el-form ref="form" :model="form" label-width="80px" style="margin-top: 110px"> <el-form ref="form" :model="formm" label-width="80px" style="margin-top: 110px">
<el-form-item v-for="(ruleAttr, index) in projectDetail.ruleAttrModelList" :label="ruleAttr.name"> <el-form-item v-for="(ruleAttr, index) in projectDetail.ruleAttrModelList" :label="ruleAttr.name">
<el-radio-group v-for="value in ruleAttr.valueList" v-model="form['rule'+index]"> <el-radio-group v-for="value in ruleAttr.valueList" v-model="formm['rule'+index]" @change="changeSku">
<el-radio :label="value" border>{{value}}</el-radio> <el-radio :label="value" border>{{value}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="规格2"> <el-form-item label="规格2">
<el-input-number v-model="form.num" :min="1" :max="10" label="描述文字"></el-input-number> <el-input-number v-model="formm.num" :min="1" :max="10" label="描述文字"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit"></el-button> <el-button type="primary" @click="onSubmit"></el-button>
@ -96,19 +99,16 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>商品详情</span> <span>商品详情</span>
</div> </div>
<el-descriptions title="分组1" :column="1"> <el-descriptions :title="attrGroup.groupName" v-for="attrGroup in projectDetail.attributeGroupList" :column="1">
<el-descriptions-item label="用户名">kooriookami</el-descriptions-item> <el-descriptions-item v-for="attr in attrGroup.attributeList"
<el-descriptions-item label="手机号">18100000000</el-descriptions-item> :label="attr.name">{{attrMap[attr.id]}}</el-descriptions-item>
<el-descriptions-item label="居住地">苏州市</el-descriptions-item>
<el-descriptions-item label="备注"> <el-descriptions-item label="备注">
<el-tag size="small">学校</el-tag> <el-tag size="small">学校</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="联系地址">江苏省苏州市吴中区吴中大道 1188 </el-descriptions-item> <el-descriptions-item label="联系地址">江苏省苏州市吴中区吴中大道 1188 </el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions title="其他属性" :column="1"> <el-descriptions title="其他属性" :column="1">
<el-descriptions-item label="用户名">kooriookami</el-descriptions-item> <el-descriptions-item v-for="ott in otherAttr" :label="ott.name">{{ott.value}}</el-descriptions-item>
<el-descriptions-item label="手机号">18100000000</el-descriptions-item>
<el-descriptions-item label="居住地">苏州市</el-descriptions-item>
</el-descriptions> </el-descriptions>
<editor v-model="editorValue" :read-only="true" > <editor v-model="editorValue" :read-only="true" >
@ -135,11 +135,17 @@ export default {
value1: 4154.564, value1: 4154.564,
value2: 1314, value2: 1314,
title: "销量人气", title: "销量人气",
form: { formm:{
num: 1 num: 1,
price: 0
}, },
form: [],
editorValue: "awejfoiajovhahrfhaowiejfoawijfeoiawjefoawjjogihao", editorValue: "awejfoiajovhahrfhaowiejfoawijfeoiawjefoawjjogihao",
projectDetail: {} projectDetail: {},
abc: "",
attrMap: {},
otherAttr: [],
carouseImages: []
} }
}, },
created() { created() {
@ -147,9 +153,44 @@ export default {
}, },
methods: { methods: {
initProjectDetailInfo(){ initProjectDetailInfo(){
getDetailInfo(2).then(response => { getDetailInfo(10).then(response => {
console.log("Response",response)
this.projectDetail = response.data; this.projectDetail = response.data;
for (let i = 0; i < this.projectDetail.productAttributeInfoList.length; i++) {
this.attrMap[this.projectDetail.productAttributeInfoList[i].attributeId] = this.projectDetail.productAttributeInfoList[i].value
this.projectDetail.attributeGroupList.forEach(attrGroup => {
let map = attrGroup.attributeList.map(attrs => attrs.id);
if (!map.includes(this.projectDetail.productAttributeInfoList[i].attributeId)){
this.otherAttr.push(this.projectDetail.productAttributeInfoList[i])
}
})
}
console.log("otherAttr",this.otherAttr)
this.initSku()
this.carouseImages = this.projectDetail.projectInfo.carouselImages.split(",")
}) })
},
changeSku() {
this.abc=""
for (let i = 0; i < this.projectDetail.ruleAttrModelList.length; i++) {
this.abc+=this.formm["rule"+i]+"-"
}
this.abc = this.abc.substring(0, this.abc.length - 1);
this.projectDetail.projectSkuInfoList.forEach(projectSku => {
if (projectSku.sku == this.abc){
this.formm.price = projectSku.price
}
})
},
initSku(){
for (let i = 0; i < this.projectDetail.ruleAttrModelList.length; i++) {
this.formm["rule"+i] = this.projectDetail.ruleAttrModelList[i].valueList[0]
}
this.changeSku()
},
onSubmit() {
} }
} }
} }

View File

@ -35,7 +35,7 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://10.1.123.97:8080`, target: `http://localhost:8080`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''