| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <template>
- <div class="content">
- <lucency-header :lang="lang" page-key="product" :is-phone="isPhone" />
- <item-banner :title="productTypeText" :sub-title="productTypeSubText"></item-banner>
- <big-title>{{productDetail.name}}</big-title>
- <div class="conBox product-view">
- <div class="left">
- <div class="imgView">
- <img v-show="productDetail.image" :src="`/public/${productDetail.image}`" alt=""/>
- </div>
- <div class="concatUs">
- <!-- 联系销售 -->
- <span class="chunk">联系购买</span>
- <div class="imgView">
- <img src="/image/wechat.jpg" alt="">
- </div>
- </div>
- </div>
- <div class="right">
- <div class="remark">
- {{productDetail.remark}}
- </div>
- <div class="detail" v-html="productDetail.detail">
- </div>
- </div>
- </div>
- <!-- 更多数据页面 -->
- <div class="conBox product-detail">
- <q-tab></q-tab>
- </div>
- <!-- 页脚 -->
- <default-footer :lang="lang"/>
- <site-bar wechat-src="/image/wechat.jpg"></site-bar>
- </div>
- </template>
- <script>
- import axios from "axios";
- import langMap from "~/map/langMap";
- import { getTypeText,getTypeSubText, pTypes} from "~/map/productMap";
- import handle from "~/until/handle";
- import {unescape} from "~/until/unescapeHtml";
- import qTab from "../../../components/qTab";
- import DefaultFooter from "../../../components/footer/defaultFooter";
- import LucencyHeader from "../../../components/header/lucencyHeader";
- import ItemBanner from "../../../components/banner/itemBanner";
- import {isMediaView} from "@/until/mediaView";
- import {apiMap, baseUrl} from "~/map/apiMap";
- import BigTitle from "~/components/public/bigTitle.vue";
- export default {
- name: "itemIndex",
- components: {BigTitle, ItemBanner, LucencyHeader, DefaultFooter, qTab},
- props:['uLang','pType', 'pInfo'],
- data(){
- return {
- langType: langMap.lang,
- lang: this.uLang?this.uLang:langMap.lang.cn,
- productId: null,
- types: pTypes,
- type: '',
- productTypeText: getTypeText(this.pType),
- productTypeSubText: getTypeSubText(this.pType),
- productDetail: {},
- isPhone: false,
- }
- },
- beforeMount() {
- console.log(this.pInfo);
- this.productDetail = this.pInfo;
- console.log(this.productDetail.detail)
- console.log(this.productDetail.image)
- this.productDetail.detail = unescape(this.productDetail.detail);
- },
- mounted() {
- console.log(this.pType);
- console.log(this.type);
- this.isPhone = isMediaView(0,1024);
- this.type = this.pType;
- },
- methods:{
- getLangText(str) {
- return langMap.getText(this.lang, str);
- },
- getAbbrText(str) {
- return langMap.getAbbrText(this.lang, str);
- },
- async loadProductDetail(){
- let err,res;
- let url = apiMap.productInfo.path;
- url += `/${this.productId}`
- [err,res] = await handle(this.$axios.get(url));
- if(err){
- console.error(err);
- return alert(err.message);
- }
- let result = res.data;
- if(result.code === 1){
- this.productDetail = result.data;
- console.log(this.productDetail.detail)
- this.productDetail.detail = unescape(this.productDetail.detail);
- console.log(this.productDetail.detail)
- }else{
- console.log('not match result');
- console.log(result);
- return alert('加载产品失败!!!');
- }
- },
- }
- }
- </script>
- <style scoped>
- .big-title {
- margin: 5px auto;
- justify-content: left;
- }
- .product-view{
- height: auto;
- min-height: 680px;
- /*width: 100%;*/
- border-top: 1px solid #dedede;
- display: flex;
- }
- .product-view .left{
- width: 320px;
- height: auto;
- }
- .product-view .left .imgView{
- width: 300px;
- height: 300px;
- margin: 10px;
- position: relative;
- }
- .product-view .left .imgView img{
- display: block;
- width: 100%;
- height: 100%;
- }
- .product-view .right{
- width: calc(100% - 320px);
- height: auto;
- }
- .product-view .right .remark{
- padding: 10px 5px;
- border-left: 1px solid #b6b6b6;
- margin-top: 5px;
- box-sizing: border-box;
- }
- .product-view .left .concatUs{
- width: 100%;
- height: auto;
- border-top: 1px solid gray;
- }
- .product-view .left .concatUs .chunk{
- width: 90%;
- margin: 5px auto;
- display: flex;
- padding: 5px 15px;
- justify-content: center;
- font-size: 1.4rem;
- border-radius: 3px;
- box-shadow: 0 0 5px gainsboro;
- cursor: pointer;
- }
- .product-view .left .concatUs .chunk:hover{
- background-color: skyblue;
- color: white;
- }
- .product-detail{
- margin-top: 20px;
- border-top: 1px solid gainsboro;
- }
- .tab-header{
- display: flex;
- }
- .tab-header .header-title{
- }
- </style>
|