Commit 180bf2b7 authored by Xuguangxing's avatar Xuguangxing

feat: init

parent ae2f9363
Pipeline #1134 failed with stages
This source diff could not be displayed because it is too large. You can view the blob instead.
import config from '@/config';
import { saDeviceId } from '@/service/sa.service';
import http from '@/service/httpDecorator';
const { talosHost } = config;
export default {
// 猜你喜欢-(商品详情页)
recommendLike: async function() {
// return http.get(talosHost + '/vcc/xyqb/recommend/like');
return http.get(`${talosHost}/vcc/xyqb/recommend/goods-list`, {
customHeader: {
scDeviceId: await saDeviceId()
}
});
}
};
import config from '@/config';
import http from '@/service/httpDecorator';
const { talosHost } = config;
export default {
// 查询商品sku详情
detailInfo: params => {
return http.get(`${talosHost}/api/kdsp/sku-info/detail/query`, { params });
},
// 详情图片
getDetailPic: url => {
return http.get(url, { strategy: 'default', hideLoading: 1, skip: 1, hideToast: 1 });
},
// 商品详情地址列表
addrList(data) {
return http.get(`${talosHost}/api/kdsp/addr/receiver/list`, data, {
hideLoading: true
});
}
};
/*
* @Description:
* @Date: 2021-03-31 19:59:17
* @LastEditors: gzw
* @LastEditTime: 2021-03-31 19:59:17
*/
/* /*
* @Description: * @Description:
* @Date: 2021-03-31 19:59:12 * @Date: 2021-03-31 19:59:12
* @LastEditors: gzw * @LastEditors: gzw
* @LastEditTime: 2021-03-31 19:59:13 * @LastEditTime: 2021-08-03 16:53:39
*/ */
let protocol = window.location.protocol; const protocol = window.location.protocol;
const qiniuHost = protocol + '//kdspstatic.q-gp.com/';
let payHost = protocol + '//mapi-qa.liangkebang.net/pay'; const shenceHost = 'https://bn.xyqb.com/sa?project=default'; // 测试地址
let shenceHost = 'https://bn.xyqb.com/sa?project=default'; // 测试地址 const talosHost = 'https://talos-tob.liangkebang.net';
let talosHost = 'https://talos-vcc2.liangkebang.net'; // 电商分期测试环境服务地址 const faceHost = 'https://auth-tob.liangkebang.net';
let operatorHost = 'https://operator.liangkebang.com'; const kdspHost = 'https://kdsp-api-tob.liangkebang.net';
const VCC_CHANNEL = '';
const TERMINAL = 'H5';
const VERSION = '7.9.00';
// const talosHost = protocol + '//talos.xyqb.com';
export default { export default {
faceHost,
talosHost, talosHost,
operatorHost,
payHost,
test: true, test: true,
shenceHost shenceHost,
qiniuHost,
VCC_CHANNEL,
TERMINAL,
VERSION,
kdspHost
}; };
import production from './production.config'; import production from './prod.config';
import env from './env.config'; import env from './env.config';
export default process.env.NODE_ENV === 'production' ? production : env; export default process.env.NODE_ENV === 'production' ? production : env;
const protocol = window.location.protocol; const protocol = window.location.protocol;
const talosHost = protocol + '//talos.xyqb.com'; const talosHost = protocol + '//talos.xyqb.com';
const operatorHost = protocol + '//auth.quantgroup.cn'; const qiniuHost = protocol + '//kdspstatic.q-gp.com/';
// const payHost = protocol + '//mapi.q-gp.com/pay';
const payHost = protocol + '//payapi.xyqb.com';
const shenceHost = 'https://bn.xyqb.com/sa?project=production'; const shenceHost = 'https://bn.xyqb.com/sa?project=production';
const faceHost = 'https://auth.quantgroup.cn';
const VCC_CHANNEL = '';
const TERMINAL = 'H5';
const VERSION = '7.9.00';
const kdspHost = 'https://kdsp-api.q-gp.com';
export default { export default {
// apiHost, // apiHost,
faceHost,
test: false, test: false,
shenceHost, shenceHost,
talosHost, talosHost,
payHost, VCC_CHANNEL,
operatorHost TERMINAL,
VERSION,
qiniuHost,
kdspHost
}; };
/*
* @Description: 根据商品来源匹配
* @Date: 2021-04-26 17:47:15
* @LastEditors: gzw
* @LastEditTime: 2021-07-19 15:12:34
*/
// const aliRule =
// '?x-oss-process=image/resize,l_180,s_180,m_mfit/quality,q_70/interlace,1';
const rules = [
{
name: 'qiniu',
reg: 'kdspstatic',
rule: [
'?imageMogr2/thumbnail/220x220/quality/75/interlace/1', // png 需要改尺寸
'?imageMogr2/thumbnail/360x360/quality/75/interlace/1'
]
},
{
name: 'jd',
reg: '360buyimg',
rule: ['!q75.dpg', '!q75.dpg'],
resize: [
{ from: 'jfs', to: 's220x220_jfs' },
{ from: 'jfs', to: 's360x360_jfs' }
]
},
{
name: 'tencent',
reg: 'img.lkbang',
rule: [
'?imageMogr2/thumbnail/220x220/quality/75/interlace/1',
'?imageMogr2/thumbnail/360x360/quality/75/interlace/1'
]
}
];
export default function Img2Thumb(url, level = 0) {
if (!url) return '';
url = url.replace('http://', 'https://');
if (url.indexOf('imageMogr2') > -1 || url.indexOf('.dpg') > -1) return url;
let rule = '';
for (let idx = 0; idx < rules.length; idx++) {
const item = rules[idx];
if (url.indexOf(item.reg) > -1) {
rule = item;
break;
}
}
if (!rule) return url;
if (rule.resize) url = url.replace(rule.resize[level].from, rule.resize[level].to);
return url + rule.rule[level];
}
...@@ -11,6 +11,7 @@ import Bridge from '@qg/js-bridge'; ...@@ -11,6 +11,7 @@ import Bridge from '@qg/js-bridge';
import Raven from 'raven-js'; import Raven from 'raven-js';
import RavenVue from 'raven-js/plugins/vue'; import RavenVue from 'raven-js/plugins/vue';
import { release } from '../.sentryclirc'; import { release } from '../.sentryclirc';
import lazyload from '@qg/cherry-ui/src/lazyload/index';
if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production') { if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production') {
Raven.config('//21779c2dcb594299bdc803c5560cfecd@sentry.q-gp.com/60', { Raven.config('//21779c2dcb594299bdc803c5560cfecd@sentry.q-gp.com/60', {
release, release,
...@@ -22,7 +23,7 @@ if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production') ...@@ -22,7 +23,7 @@ if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production')
Vue.prototype.util = new Bridge(); Vue.prototype.util = new Bridge();
saService.init(router); saService.init(router);
Vue.use(lazyload);
Vue.config.productionTip = false; Vue.config.productionTip = false;
new Vue({ new Vue({
......
module.exports = [
{
path: '/groupBuy/skuInfo',
name: 'groupBuySkuInfo',
component: () => import('../views/goodsDetail/index.vue'),
meta: { title: '组团0元购' }
}
];
const groupBuy = require('./groupBuy');
export default [ export default [
{ {
path: '/', path: '/',
redirect: '/error' redirect: '/error'
}, },
{ ...groupBuy,
path: '/demo',
alias: ['/demo-page'],
name: 'demo-page',
back: false,
meta: {
title: 'DEMO',
has: {
header: true,
footer: true
}
},
component: () => import('../views/demo')
},
{ {
path: '/error', path: '/error',
name: 'error', name: 'error',
......
...@@ -7,6 +7,8 @@ import { ...@@ -7,6 +7,8 @@ import {
Icon, Icon,
Cell, Cell,
CellGroup, CellGroup,
Radio,
RadioGroup,
Row, Row,
Col, Col,
Dialog, Dialog,
...@@ -24,7 +26,36 @@ import { ...@@ -24,7 +26,36 @@ import {
Form, Form,
Sticky, Sticky,
Tab, Tab,
Tabs Tabs,
Empty,
Swipe,
SwipeItem,
Tabbar,
TabbarItem,
BackTop,
Stepper,
AddressEdit,
SubmitBar,
CouponList,
Switch,
AddressList,
Collapse,
CollapseItem,
Uploader,
IndexList,
IndexListItem,
Tag,
ActionSheet,
Steps,
Step,
Notify,
CountDown,
PwdField,
AuthcodeField,
Skeleton,
Card,
Progress,
GoodsAction
} from '@qg/cherry-ui'; } from '@qg/cherry-ui';
import DialogFn from '@qg/cherry-ui/src/dialog/func'; import DialogFn from '@qg/cherry-ui/src/dialog/func';
// import "@qg/cherry-ui/dist/cherry.css"; // import "@qg/cherry-ui/dist/cherry.css";
...@@ -33,6 +64,8 @@ Vue.use(Button); ...@@ -33,6 +64,8 @@ Vue.use(Button);
Vue.use(Image); Vue.use(Image);
Vue.use(Cell); Vue.use(Cell);
Vue.use(CellGroup); Vue.use(CellGroup);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(Row); Vue.use(Row);
Vue.use(Col); Vue.use(Col);
Vue.use(Popup); Vue.use(Popup);
...@@ -46,12 +79,40 @@ Vue.use(Form); ...@@ -46,12 +79,40 @@ Vue.use(Form);
Vue.use(Icon); Vue.use(Icon);
Vue.use(Sticky); Vue.use(Sticky);
Vue.use(Overlay); Vue.use(Overlay);
Vue.use(Form);
Vue.use(CardList); Vue.use(CardList);
Vue.use(Loading); Vue.use(Loading);
Vue.use(List); Vue.use(List);
Vue.use(Tab); Vue.use(Tab);
Vue.use(Tabs); Vue.use(Tabs);
Vue.use(Empty);
Vue.use(Swipe);
Vue.use(SwipeItem);
Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(Stepper);
Vue.use(BackTop);
Vue.use(AddressEdit);
Vue.use(SubmitBar);
Vue.use(CouponList);
Vue.use(Switch);
Vue.use(AddressList);
Vue.use(Collapse);
Vue.use(CollapseItem);
Vue.use(Uploader);
Vue.use(IndexList);
Vue.use(IndexListItem);
Vue.use(Tag);
Vue.use(ActionSheet);
Vue.use(Steps);
Vue.use(Step);
Vue.use(Notify);
Vue.use(CountDown);
Vue.use(PwdField);
Vue.use(AuthcodeField);
Vue.use(Skeleton);
Vue.use(Card);
Vue.use(Progress);
Vue.use(GoodsAction);
// const _proto = Vue.prototype; // const _proto = Vue.prototype;
// const proto = Object.create(_proto); // const proto = Object.create(_proto);
......
import HttpRequest from '@qg/ui-request'; import HttpRequest from '@qg/ui-request';
import { Toast } from '@qg/cherry-ui'; import { Toast } from '@qg/cherry-ui';
import store from '@/store'; import store from '@/store';
import { appVersion } from '@/service/validation.service';
const http = new HttpRequest( const http = new HttpRequest(
{}, {},
{}, {
headers: {
'x-user-terminal': 'H5',
version: appVersion || '7900'
}
},
function(msg) { function(msg) {
Toast(msg); Toast(msg);
}, },
function(loadingState) { function(loadingState) {
store.dispatch('change_loading', loadingState); store.dispatch('change_loading', loadingState);
} }
); ).getInstance();
export default http; export default http;
@font-face {font-family: "iconfont";
src: url('//at.alicdn.com/t/font_2314957_lrxu41665e.eot?t=1618230221038'); /* IE9 */
src: url('//at.alicdn.com/t/font_2314957_lrxu41665e.eot?t=1618230221038#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAABhYAAsAAAAAL/AAABgIAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCIGArIDLklATYCJAOBSAtmAAQgBYRtB4RYG1snRUaGjQO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LK2fUDVz41TdsE+1ncafT/3s1LM//ZIRBHtzvJpoKbtMEK1X/YG+JeBXE+n4B7nGPLPf7OzFbzEj09hGPfuDiDOOaTBvdvuHKZEpTCe0sgki5WG7dV6HsbE0KK1eYggI1DOOrlqvkUUyN3WhHff/B+Q1CeCAvt57/QOxKi6+sbexi2B8K+RIfeXFuzrzDkSQHaPUZWRgvBFklJ5uYhTvpk6QJTZCAmfxYCsMzUUVNuytQ9+bBaW0knZ86JFPAYUUUUwJ8d8tb3yQIEmKdNN209l8sVytN9vd/nA8PTu/uLy6vrm9u394fHp+eX17d1+JZd3TJa+ZWu5vrXGtHI92VgMwTq8N8k1FkZj9OsWMM2Cmi9aObZ3QyWyIudXOJqq4LgkydiWQ0N2yDLXrVmbCUMNCIuRThAUb2226dMh9mJbU6kSo3CWyIJGyVwwjnE15ZSEWqIn9Kuu5Omb3LmH1jXnc5LwisA060IAUclpFFuy3tHG4UosLxvw/dzD/x5Z67CwMyOBefHMBzvlm2GJD6lz5MHTqL2qzFmu9DcfkA7N0LhJBb9+3hQ1o/2I/dRDT/EypDahLC1Pip5my6BKjs13eRrYJZ4EW/R6aNV0MDMfSwslLLOvs0MwkpQAAAA==') format('woff2'),
url('//at.alicdn.com/t/font_2314957_lrxu41665e.woff?t=1618230221038') format('woff'),
url('//at.alicdn.com/t/font_2314957_lrxu41665e.ttf?t=1618230221038') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('//at.alicdn.com/t/font_2314957_lrxu41665e.svg?t=1618230221038#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-sort-down-round:before {
content: "\e74d";
}
.icon-sort-up-round:before {
content: "\e641";
}
.icon-share:before {
content: "\e63e";
}
.icon-yuan:before {
content: "\e63f";
}
.icon-setting-line:before {
content: "\e640";
}
.icon-arrow:before {
content: "\e612";
}
.icon-arrow-left:before {
content: "\e613";
}
.icon-minus:before {
content: "\e614";
}
.icon-close-plane:before {
content: "\e615";
}
.icon-photo-plane:before {
content: "\e616";
}
.icon-arrow-up:before {
content: "\e617";
}
.icon-trash:before {
content: "\e618";
}
.icon-tianjia:before {
content: "\e619";
}
.icon-sort-up:before {
content: "\e61a";
}
.icon-setting-plane:before {
content: "\e61b";
}
.icon-plus:before {
content: "\e61c";
}
.icon-top:before {
content: "\e61d";
}
.icon-location-plane:before {
content: "\e61e";
}
.icon-arrow-down:before {
content: "\e61f";
}
.icon-cart-card:before {
content: "\e620";
}
.icon-sort-down:before {
content: "\e621";
}
.icon-info-plane:before {
content: "\e622";
}
.icon-info-line:before {
content: "\e623";
}
.icon-search:before {
content: "\e624";
}
.icon-home-plane:before {
content: "\e625";
}
.icon-user-plane:before {
content: "\e626";
}
.icon-location-line:before {
content: "\e627";
}
.icon-weinxin:before {
content: "\e628";
}
.icon-qrcode:before {
content: "\e629";
}
.icon-camera-line:before {
content: "\e62a";
}
.icon-warning-line:before {
content: "\e62b";
}
.icon-cart-line:before {
content: "\e62c";
}
.icon-found-plane:before {
content: "\e62d";
}
.icon-success:before {
content: "\e62e";
}
.icon-warning-plane:before {
content: "\e62f";
}
.icon-home:before {
content: "\e630";
}
.icon-loading:before {
content: "\e631";
}
.icon-checked:before {
content: "\e632";
}
.icon-fail:before {
content: "\e633";
}
.icon-volume:before {
content: "\e634";
}
.icon-close-line:before {
content: "\e635";
}
.icon-user:before {
content: "\e636";
}
.icon-photo-line:before {
content: "\e637";
}
.icon-circle:before {
content: "\e638";
}
.icon-close:before {
content: "\e639";
}
.icon-found-line:before {
content: "\e63a";
}
.icon-home-line:before {
content: "\e63b";
}
.icon-customer:before {
content: "\e63c";
}
.icon-cart-plane:before {
content: "\e63d";
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
@import 'var.less'; @import 'var.less';
@import 'mixins.less'; @import 'mixins.less';
@import 'iconfont.less'; @import 'iconfont.less';
@import 'icon.less';
html, html,
body, body,
#app { #app {
...@@ -18,6 +18,13 @@ body { ...@@ -18,6 +18,13 @@ body {
font-family: @font-family; font-family: @font-family;
background-color: @background-color; background-color: @background-color;
} }
button{
border:0;
}
.tel {
color: #5371E0;
font-size: 12px;
}
.page { .page {
background-size: contain; background-size: contain;
background-color: @background-color; background-color: @background-color;
...@@ -88,6 +95,12 @@ strong { ...@@ -88,6 +95,12 @@ strong {
min-height: calc(100% - @nav-bar-height); min-height: calc(100% - @nav-bar-height);
} }
} }
.has-tab-bar {
.app {
height: calc(100% - @tab-bar-height);
min-height: calc(100% - @tab-bar-height);
}
}
.cr-dialog--confirm, .cr-dialog--confirm:active { .cr-dialog--confirm, .cr-dialog--confirm:active {
color: @red; color: @red;
} }
...@@ -101,4 +114,16 @@ strong { ...@@ -101,4 +114,16 @@ strong {
right: 0; right: 0;
border-bottom: 0.026667rem solid #f2f3f5; border-bottom: 0.026667rem solid #f2f3f5;
transform: scaleY(0.5); transform: scaleY(0.5);
}
.ellipsis{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
}
.cr-dialog--header {
padding: @padding-xl;
&--isolated {
padding-bottom: 0;
}
} }
\ No newline at end of file
...@@ -7,3 +7,44 @@ ...@@ -7,3 +7,44 @@
margin-bottom: constant(safe-area-inset-bottom); margin-bottom: constant(safe-area-inset-bottom);
margin-bottom: env(safe-area-inset-bottom); margin-bottom: env(safe-area-inset-bottom);
} }
.countdown-mixin(@txtColor, @bgColor, @colonColor, @txtSize, @txtWeight) {
.cr-count-down {
font-size: 10px;
span {
box-sizing: border-box;
display: inline-block;
text-align: center;
height: @txtSize;
line-height: @txtSize+1;
font-weight: @txtWeight;
}
}
.block {
background-color: @bgColor;
color: @txtColor;
border-radius: 3.2px;
width: @txtSize;
}
.colon {
color: @colonColor;
width: 12px;
margin: 0 2px;
}
}
.through-line-mixin(@color) {
position: relative;
&:after {
content: ' ';
display: block;
position: absolute;
top: 0;
bottom: 0;
left: -5%;
margin: auto;
width: 110%;
height: 1px;
background-color: @color;
}
}
\ No newline at end of file
// 覆盖cherry-ui样式 // 覆盖cherry-ui样式
@import "./var.less"; @import "./var.less";
@button-border-width: 0; @button-border-width: 1px;
@button-default-height: 37px; @button-default-height: 37px;
@button-default-line-height: 37px; @button-default-line-height: 37px;
@button-default-font-size: 16px; @button-default-font-size: 16px;
@button-default-color: @gray-4;
@button-default-border-color: @gray-4;
@button-primary-color: @white; @button-primary-color: @white;
@button-primary-background-color: @gradient-red; @button-primary-background-color: @gradient-red;
@button-danger-background-color: @red; @button-danger-background-color: @red;
@button-danger-border-color: @red; @button-danger-border-color: @red;
@button-large-height: 48px; @button-large-height: 48px;
@button-large-line-height: 48px; @button-large-line-height: 48px;
@image-placeholder-text-color: @gray-4;
@field-error-message-color: @red-dark; @field-error-message-color: @red-dark;
@field-error-message-font-size: 12px; @field-error-message-font-size: 12px;
@field-error-placeholder-color: @red-dark; @field-error-placeholder-color: @red-dark;
@index-list-bar-font-size: 11px;
@checkbox-icon-border: @border-width-base solid @gray-2; @checkbox-icon-border: @border-width-base solid @gray-2;
@checkbox-label-color: @text-color; @checkbox-label-color: @text-color;
@checkbox-checked-color: @white; @checkbox-checked-color: @white;
...@@ -30,16 +32,19 @@ ...@@ -30,16 +32,19 @@
@cell-icon-size: 16px; @cell-icon-size: 16px;
@field-label-width: 75px; @field-label-width: 75px;
@dialog-width: 290px;
@dialog-font-size: 14px;
@dialog-border-radius: @border-radius-lg; @dialog-border-radius: @border-radius-lg;
@dialog-message-font-size: 16px; @dialog-has-title-message-text-color: @text-grey;
@dialog-has-title-message-text-color: @text-color;
@dialog-confirm-button-text-color: @red;
@navbar-default-height: @nav-bar-height; @navbar-default-height: @nav-bar-height;
@picker-toolbar-padding: @padding-unit - 2 @padding-md; @picker-toolbar-padding: @padding-unit - 2 @padding-md;
@picker-font-size: 14px; @picker-font-size: 14px;
@loading-color: @white; @empty-description-color: @gray-4;
@loading-text-color: @white;
\ No newline at end of file @tabs-nav-background-color: @background-color;
@list-text-color: @gray-4;
@index-list-title-color: @gray-5;
@back-top-txt-color: @gray-5;
\ No newline at end of file
// page Colors
@page-color-base: #F7F8FA;
// Color Palette // Color Palette
@black: #333333; @black: #333333;
@white: #fff; @white: #fff;
...@@ -6,16 +9,27 @@ ...@@ -6,16 +9,27 @@
@gray-3: #c8c9cc; @gray-3: #c8c9cc;
@gray-4: #999999; @gray-4: #999999;
@gray-5: #666666; @gray-5: #666666;
@gray-6: #f8f8f8;
@gray-7: #D8D8D8;
@red: #ec1500; @red: #ec1500;
@red-light: #ec3333; @red-light: #ec3333;
@red-dark: #ee0a24; @red-dark: #ee0a24;
@orange: #faab0c; @orange: #faab0c;
@red-btn:#FF5D00;
@grey-border: #f2f3f5; @grey-border: #f2f3f5;
// Gradient Colors // Gradient Colors
@gradient-red: linear-gradient(269deg, #ff5d00 12%, #ff1900 86%); @gradient-red: linear-gradient(269deg, #ff5d00 12%, #ff1900 86%);
@gradient-pink: linear-gradient(180deg, #fff7f0 0%, #ffe4dc 100%); @gradient-pink: linear-gradient(180deg, #fff7f0 0%, #ffe4dc 100%);
@primary-bg: {
background-image: linear-gradient(269deg, #FF4B00 12%, #FF7705 86%);
background-image: linear-gradient(269deg, #FF5D00 12%, #FF1900 86%);
}
@cherry-color-error: #dd524d;
@text-color-red:#E81800;
@text-color-light: #FF5A4B;
// Component Colors // Component Colors
@text-color: @black; @text-color: @black;
@text-grey: @gray-4; @text-grey: @gray-4;
...@@ -37,16 +51,23 @@ ...@@ -37,16 +51,23 @@
// Padding // Padding
@padding-unit: 4px; @padding-unit: 4px;
@padding-x: @padding-unit + 2;
@padding-xs: @padding-unit * 2; @padding-xs: @padding-unit * 2;
@padding-sm: @padding-unit * 3; @padding-sm: @padding-unit * 3;
@padding-md: @padding-unit * 4; @padding-md: @padding-unit * 4;
@padding-lg: @padding-unit * 5; @padding-lg: @padding-unit * 5;
@padding-xl: @padding-unit * 8; @padding-xl: @padding-unit * 8;
@padding-sd: @padding-xs + 4;
@font-color-disabled: #C0C4CC;
@font-color-dark: #333333;
@font-color-light: #909399;
@font-color-red: #F23E33;
// Font // Font
@font-size-list: 10,11, 12, 13, 14, 16, 17, 18, 20, 26, 28, 30, 52; @font-size-list: 10,11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28, 30, 52, 40;
.generate-text(12); .generate-text(15);
.generate-text(@n, @i: 1) when (@i =< @n) { .generate-text(@n, @i: 1) when (@i =< @n) {
@font: extract(@font-size-list, @i); @font: extract(@font-size-list, @i);
.text-@{font} { .text-@{font} {
...@@ -70,4 +91,41 @@ ...@@ -70,4 +91,41 @@
@ios-bottom-height: 60px; @ios-bottom-height: 60px;
// 页面顶部header高度 // 页面顶部header高度
@nav-bar-height: 48px; @nav-bar-height: 48px;
\ No newline at end of file
@tab-bar-height: 50px;
/* 页面左右间距 */
@page-row-spacing: 15px;
/* 行为相关颜色 */
@color-primary:#fa436a;
// 灰色
// 主要操作按钮背景色
@background-primary: linear-gradient(269deg, #ff5d00 12%, #ff1900 86%);
@background-coupon: linear-gradient(270deg, #F76B1C 0%, #FFC049 100%);
/*文字颜色*/
@font-color-dark: #333333;
@font-color-base: #606266;
@font-color-light: #909399;
@font-color-disabled: #C0C4CC;
@font-color-spec: #4399fc;
@font-color-search: #EC1500;
@font-color-red: #F23E33;
// @font-color-red: #EC3333;
@font-color-red: #F23E33;
// 边框
@border-sm: 2rpx;
@border-md: 4rpx;
@border-gray: #999;
@border-red: #EC1500;
/* 边框颜色 */
@border-color-dark: #DCDFE6;
@border-color-base: #E4E7ED;
@border-color-light: #EBEEF5;
@border-color-search: #EC1500;
@import '../../style/var.less';
.page {
padding: @page-padding-lg @page-padding-lg 0;
height: calc(100% - @page-padding-lg);
}
.banner {
position: relative;
display: flex;
justify-content: center;
background-image: @gradient-red;
background-repeat: no-repeat;
margin: -1 * @page-padding-lg -1 * @page-padding-lg 48px -1 * @page-padding-lg;
padding: @padding-md @padding-lg 0;
}
.card {
&__icon {
height: 200px;
width: 200px;
margin: 0 auto;
display: block;
}
&__info {
padding: 20px 0;
color: #fff;
font-size: 28px;
text-align: center;
}
}
<template>
<div class="page">
<div class="banner">
<div class="card">
<p class="card__info">{{ list.length }}</p>
</div>
</div>
<svg-icon icon-class="ufo" class="card__icon" />
</div>
</template>
<script>
import demoApi from '@/api/demo.auth';
export default {
data() {
return {
list: []
};
},
mounted() {
this.getList();
},
methods: {
async getList() {
const res = await demoApi.recommendLike();
this.list = res;
}
}
};
</script>
<style lang="less" src="./index.less" scoped></style>
<template>
<div class="goods-detail">
<div class="goods-detail-info">
<div class="Gd-info-title">产品信息</div>
<div v-for="(item, index) in skuDetailList" :key="index" class="Gd-info-content">
<span>{{ item.attsName }}</span>
<span>{{ item.attsValue }}</span>
</div>
<!-- todo 产品信息不全,需要处理 -->
<!-- <div v-if="skuDetailList.length" class="Gd-info-all" @click="goInfo">
<span>查看全部</span>
<span class="iconfont icon-arrow" />
</div> -->
</div>
</div>
</template>
<script>
export default {
props: {
skuDetailList: {
type: Array,
default: () => []
},
skuDetailAtts: {
type: Array,
default: () => []
}
},
methods: {
goInfo() {
this.$router.push({
name: 'info',
params: { data: this.skuDetailAtts }
});
}
}
};
</script>
<style lang="less" scoped>
.goods-detail {
background: @white;
padding: 0 @padding-sm - 2;
margin-bottom: @padding-sm - 4;
&-imgs {
width: 100%;
}
&-info {
.Gd-info-title {
padding: @padding-sm + 4 0 @padding-unit;
.text-18();
color: @black;
font-weight: bold;
}
.Gd-info-content {
display: flex;
padding: @padding-unit + 4 0 @padding-sm;
span {
.text-12();
&:first-child {
width: 62px;
margin-right: @padding-xl - 4;
color: @gray-4;
}
&:last-child {
flex: 1;
color: @gray-5;
}
}
}
.Gd-info-all {
display: flex;
justify-content: center;
align-items: center;
padding: @padding-unit + 4 0 @padding-sm;
width: 100%;
.text-12();
color: @gray-5;
span {
&:first-child {
margin-right: @padding-x;
}
&:last-child {
.text-12();
color: @gray-4;
}
}
}
}
}
</style>
<template>
<div class="cell">
<div class="cell-left">
<span class="cell-left-title">{{ title }}</span>
<div class="cell-left-content" :class="{ wrap: wrap }">
<slot>{{ content }}</slot>
</div>
</div>
<span v-if="!noArrows" class="cell-right iconfont icon-arrow" />
</div>
</template>
<script>
export default {
name: 'GoodsCell',
props: {
title: {
type: String,
default: ''
},
content: {
type: String,
default: ''
},
wrap: {
type: Boolean,
default: false
},
noArrows: {
type: Boolean,
default: false
}
}
};
</script>
<style lang="less" scoped>
.cell {
display: flex;
justify-content: space-between;
align-items: center;
height: 35px;
background: #fff;
&-left {
display: flex;
.text-13();
&-title {
color: @gray-4;
}
&-content {
display: flex;
flex-wrap: nowrap;
align-items: center;
color: @black;
margin-left: 10px;
// max-width: 550px;
&.wrap {
flex-wrap: wrap;
}
}
}
&-right {
color: @gray-3;
.text-12();
}
}
</style>
// @import "../../style/var.less";
@{deep} .cr-button--default {
color: inherit;
}
.btn-absolute{
position: absolute;
bottom: 16px;
}
.goods-bottom-buy {
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
width: 335px;
height: 40px;
.text-14();
font-weight: bold;
border-radius: @padding-lg;
color: @white;
background-image: @gradient-red;
&.disabled {
opacity: 0.7;
}
}
.goods-popup{
height: auto !important;
}
// 弹出框头部
.popup-head{
border-radius: 20px 20px 0 0;
.popup-title {
.text-16();
font-weight: @font-weight-bold;
color: @black;
text-align: center;
padding: 10px 0
}
}
.goods {
padding-bottom: 60px;
&-container {
height: calc(100% - 60px);
font-size: 16px;
&-lose {
&-container {
background: #fff;
padding: 45px 15px;
text-align: center;
img {
width: 150px;
}
}
}
}
&-carousel {
position: relative;
width: 100%;
height: 375px;
&-swiper {
height: 100%;
&-item {
width: 100%;
height: 100%;
&-img {
width: 100%;
height: 100%;
}
}
}
.custom-indicator {
position: absolute;
right: 10px;
bottom: 13px;
padding: 2px 5px;
font-size: 12px;
background-color: #000;
opacity: 0.4;
color: #fff;
border-radius: 10px;
}
}
&-info {
padding: 0 @padding-sd;
background: @white;
margin-bottom: @padding-sm - 4;
&-price {
padding: @padding-x 0;
display: flex;
justify-content: space-between;
align-items: center;
min-height: 44px;
.Gi-price {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.Gi-price-left {
span {
color: @red-light;
&:nth-child(1) {
line-height: 16rpx;
.text-18();
font-weight: bold;
}
&:nth-child(2) {
margin-right: @padding-xs;
font-size: 30px;
line-height: 14px;
font-weight: bold;
}
&:nth-child(3) {
text-decoration: line-through;
.text-14();
color: @gray-4;
}
}
}
.Gi-price-right {
bottom: 0;
.text-13();
color: @gray-4;
}
}
}
&-name {
.text-16();
color: @black;
font-weight: bold;
padding-bottom: @padding-x;
}
}
&-sale {
padding: 5px 10px;
background: @white;
margin-bottom: 10px;
&-button {
box-sizing: content-box;
margin-right: 5px;
width: 35px;
height: 15px;
border-radius: 3px;
line-height: 15px;
text-align: center;
border: 1px solid @border-color-search;
font-size: 12px;
color: @font-color-search;
}
&-content {
width: 259px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 13px;
color: #333;
}
&-active{
border-top:1px solid @grey-border;
}
}
&-param {
padding: 0 @padding-sm - 2;
background: @white;
margin-bottom: @padding-sm - 4;
&-text {
max-width: 225px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
&-area {
span {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
&:nth-child(1) {
.text-16();
color: @red;
margin-right: 2px;
}
&.noAddr {
color: @gray-4;
}
}
}
&-service {
span {
&:after {
margin: 0 10px;
content: '';
height: 22px;
vertical-align: middle;
}
&:last-child {
&:after {
height: 0;
}
}
}
}
}
&-popup {
margin: @padding-md + 4 @padding-lg;
height: 71vh;
position: relative;
&-selected {
display: flex;
align-items: flex-end;
margin-bottom: @padding-xl - 4;
img {
width: 100px;
height: 100px;
border-radius: @border-radius-sm;
}
.Gp-selected-right {
display: flex;
flex-direction: column;
padding-left: @padding-sd;
align-items: flex-start;
.Gps-right-header {
display: flex;
align-items: center;
margin-bottom: @padding-sd;
.Gpsr-header-price {
margin-right: @padding-x;
line-height: 0;
span {
color: @red-light;
font-weight: @font-weight-bold;
&:first-child {
.text-12();
}
&:last-child {
.text-18();
}
}
}
.Gpsr-header-discount {
.text-12();
color: @gray-4;
span {
&:last-child {
text-decoration: line-through;
}
}
}
}
.Gps-right-selected {
.text-13();
color: @black;
display: inline-block;
}
}
}
&-param {
display: flex;
flex-direction: column;
margin-bottom: @padding-lg;
.Gp-param-name {
margin-bottom: @padding-xs + 2;
.text-13();
color: @gray-4;
display: inherit;
}
.Gp-param-list {
display: flex;
flex-wrap: wrap;
span {
display: flex;
align-items: center;
justify-content: center;
margin-right: @padding-sd;
padding: 0 @padding-md - 2;
background: @gray-1;
border-radius: @border-radius-sm / 2;
height: 26px;
.text-13();
color: @black;
margin-bottom: @padding-xs;
}
.Gpp-list-selected {
border: 1px solid @red;
background: pink;
color: @red;
}
.Gpp-list-disabled {
color: @gray-4;
}
}
}
&-num {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 100px;
&-limit {
position: absolute;
right: 0;
top: 27.5px;
.text-14();
color: @red;
width: 90px;
text-align: right;
}
.Gp-num-name {
.text-13();
color: @gray-4;
}
.Gp-num-step{
width: auto;
display: flex;
button{
background-color:#F7F7F7 !important;
}
}
}
&-button {
button{
position: fixed;
left: 20px;
right: 20px;
bottom: 0;
padding: @padding-md 0;
display: flex;
justify-content: space-between;
align-items: center;
}
}
}
&-area {
height: 65vh;
overflow: scroll;
padding: @padding-md @padding-lg;
&-item {
display: flex;
align-items: center;
margin-bottom: @padding-lg;
span {
.text-13();
color: @gray-4;
&:first-child {
width: 20px;
height: 20px;
line-height: 20px;
.text-16();
}
&:second-child {
flex: 1;
}
}
&_selected {
span {
&:first-child {
color: @red;
}
&.secondText {
color: @black;
font-weight: @font-weight-bold;
}
}
}
}
&-none {
display: inline-block;
width: 100%;
line-height: 65vh;
.text-13();
color: @gray-5;
text-align: center;
}
&-button {
display: flex;
justify-content: center;
}
}
&-divider {
display:flex;
align-items:center;
justify-content: center;
margin: 15px 0;
width: 100%;
font-size: 12px;
color: #999;
text-align: center;
&:before, &:after{
display: inline-block;
content: '';
width: 50px;
height: 0;
border-top: 1px solid #D8D8D8;
margin-right: 5px;
}
&:after{
margin-left: 5px;
margin-right: 0;
}
}
&-list{
padding: 0 @padding-sm - 2 60px;
}
&-buoy {
position: fixed;
right: 10px;
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
background: #fff;
border-radius: 25px;
border: 1px solid #EBEBEB;
// box-shadow: rgba(0, 0, 0, 0.4);
}
&-share {
bottom: 122.5px;
// position: absolute;
img {
width: 45px;
height: 45px;
position: absolute;
&::after {
border: none;
}
}
button {
border: none;
background: transparent;
display: flex;
justify-content: center;
// position: relative;
&::after {
border: none;
}
}
}
&-like {
bottom: 175px;
img {
width: 45px;
height: 45px;
position: absolute;
&::after {
border: none;
}
}
}
&-top{
position: fixed;
bottom: 69px;
right: 10px;
width: 45px ;
height: 45px;
margin-bottom: 0
}
}
<template>
<div class="goods" style="height: 100%">
<!-- 主体 -->
<div v-if="!isLose" class="goods-container">
<!-- 轮播图 -->
<div class="goods-carousel">
<cr-swipe class="goods-swiper" @change="onChange">
<cr-swipe-item v-for="(item, index) in imgList" :key="index" class="goods-carousel-item">
<img :src="item | Img2Thumb" style="width: 100%" />
</cr-swipe-item>
<template #indicator>
<div class="custom-indicator">{{ swiperCurrent + 1 }}/{{ imgList.length }}</div>
</template>
</cr-swipe>
</div>
<!-- 商品名称/价格 -->
<div class="goods-info">
<div class="goods-info-price">
<div class="Gi-price">
<div v-if="detailInfo.salePrice" class="Gi-price-left">
<span>¥</span>
<span>{{ detailInfo.salePrice || '' }}</span>
<span v-if="detailInfo.marketPrice">¥{{ detailInfo.marketPrice || '' }}</span>
</div>
<span class="Gi-price-right">销量:{{ detailInfo.saleCount || '' }}</span>
</div>
</div>
<div class="goods-info-name">{{ detailInfo.skuName || name.goodsName }}</div>
</div>
<div class="goods-param">
<!-- 商品已选 -->
<goods-cell title="已选" @click.native="handleParamsClick('sku', '')">
<span class="goods-param-text">
<span v-for="(item, index) in specSelected" :key="index">{{ item.attsValue }}</span>
</span>
<span v-if="specSelected.length">&nbsp;</span>
<span>{{ selectedGoods.skuNum }}件</span>
</goods-cell>
<!-- 收货地址 -->
<goods-cell
class="goods-param-area"
title="送至"
@click.native="handleParamsClick('area', '配送至')"
>
<span
class="iconfont icon-location-line"
:class="{ noAddr: !selectedAddress.addrFullName }"
/>
<span>{{ selectedAddress.addrFullName || '添加收货地址' }}</span>
</goods-cell>
</div>
<span
v-if="skuDetailList.length || detailImgList.length"
id="goodDetail"
class="goods-divider"
>宝贝详情</span
>
<div v-if="skuDetailList.length" class="goods-detail">
<detail-info-area :sku-detail-list="skuDetailList" :sku-detail-atts="skuDetailAtts" />
</div>
<div class="goods-detail-imgs">
<cr-image
v-for="(item, index) in detailImgList"
:key="index"
lazy-load
width=""
height=""
style="width: 100%; height: auto; display: block"
:src="item"
/>
</div>
</div>
<!-- 商品失效 -->
<div v-if="isLose" class="goods-container goods-container-lose">
<div class="goods-container-lose-container">
<img class="noImg" mode="widthFix" src="https://img.lkbang.net/xcx/lose.png" />
<div>您查找的商品失效了!</div>
</div>
</div>
<cr-popup v-model="show" class="popup-head" closeable position="bottom">
<div class="popup-title">{{ currentPopupName }}</div>
<div v-if="currentPopupType === 'sku'" class="goods-popup">
<div class="goods-popup-selected">
<img :src="detailInfo.imageUrl" />
<div class="Gp-selected-right">
<div class="Gps-right-header">
<div class="Gpsr-header-price">
<span>¥</span>
<span>{{ detailInfo.salePrice }}</span>
</div>
<div v-if="detailInfo.marketPrice" class="Gpsr-header-discount">
<span>原价:</span>
<span>¥{{ detailInfo.marketPrice }}</span>
</div>
</div>
<div v-if="specSelected.length" class="Gps-right-selected">
已选:
<span v-for="(sItem, sIndex) in specSelected" :key="sIndex">
{{ sItem.attsValue }}
</span>
</div>
</div>
</div>
<div v-for="(item, index) in specList" :key="index" class="goods-popup-param">
<span class="Gp-param-name">{{ item.attsName }}</span>
<div class="Gp-param-list">
<span
v-for="(childItem, childIndex) in specChildList"
v-show="childItem.attsCode === item.attsCode"
:key="childIndex"
:disabled="childItem.disabled"
:class="{
'Gpp-list-selected': childItem.isSelected && !childItem.disabled,
'Gpp-list-disabled': childItem.disabled
}"
@click="selectSpec(childIndex, childItem)"
>
{{ childItem.attsValue }}
</span>
</div>
</div>
<div class="goods-popup-num">
<span class="Gp-num-name">购买数量:</span>
<cr-stepper
v-model="selectedGoods.skuNum"
class="Gp-num-step"
:min="minCount"
:max="detailInfo.activityLimitCount || detailInfo.limitCount"
disable-input
/>
<div v-if="detailInfo.activityLimitCount" class="goods-popup-num-limit">
仅限购买{{ detailInfo.activityLimitCount }}件
</div>
</div>
<div class="goods-area-button">
<button class="goods-bottom-buy" @click="toOrder">立即购买</button>
</div>
</div>
<div v-if="currentPopupType === 'area'" class="goods-area">
<div v-if="addressList && addressList.length">
<div
v-for="(item, index) in addressList"
:key="index"
class="goods-area-item "
:class="{
'goods-area-item_selected': item.addrReceiverId === selectedAddress.addrReceiverId
}"
@click="changeAddress(item)"
>
<span class="iconfont icon-location-line" />
<span class="secondText">{{ item.addrFullName }}</span>
</div>
</div>
<span v-else class="goods-area-none">暂未添加地址哦~</span>
<div class="goods-area-button" @click="addAddress">
<button class="goods-bottom-buy btn-absolute">添加新地址</button>
</div>
</div>
</cr-popup>
</div>
</template>
<script>
import goods from '@/api/groupBuy';
import goodsCell from './components/goodsCell';
import detailInfoArea from './components/detailInfo.vue';
import Img2Thumb from '@/filters/img2Thumb.filter';
export default {
// eslint-disable-next-line vue/name-property-casing
name: 'goodDetail',
components: {
detailInfoArea,
goodsCell
// tipModal
},
filters: {
Img2Thumb
},
data() {
return {
flag: false,
isLose: false, // 商品是否已经失效
detailParam: {
skuNo: '',
receiverId: '',
count: 1
},
specSelected: [],
detailInfo: {},
labelList: [], // 服务标签
imgList: [],
detailImgList: [], // 商品详情图像展示
selectedGoods: {
skuNum: 1,
skuId: ''
},
skuDetailAtts: [],
addressList: [],
selectedAddress: {},
specList: [],
specChildList: [],
swiperCurrent: 0,
popupSwitch: true,
vccChannel: '',
sonVccChannel: '',
// showBackBtn: navBarLeftBtns,
currentPopupType: '',
currentPopupName: '',
show: false,
hasLogin: false,
name: {},
clientHeight: 0
};
},
computed: {
skuDetailList() {
let arr = [];
this.skuDetailAtts &&
this.skuDetailAtts.forEach(item => {
arr = arr.concat(item.groupAtts);
});
if (arr <= 5) {
return arr;
}
return arr.slice(0, 5);
},
title() {
return this.isLose ? '猜你喜欢' : '你可能还喜欢';
},
minCount() {
return this.detailInfo.stock ? 1 : 0;
}
},
created() {
this.hasLogin = window.localStorage.getItem('vccToken') != 'null' ? true : false;
this.detailParam = { ...this.$route.query };
this.name = this.$route.params;
this.imgList = [this.name.goodsimg];
this.init(this.detailParam);
},
mounted() {
// todo 曝光埋点
},
methods: {
onChange(index) {
this.swiperCurrent = index;
},
// ka渠道逻辑
goVccOrDetail() {
if (!this.hasLogin) {
this.$router.push({ name: 'login' });
return;
}
this.toOrder();
},
async init(detailParam) {
const [res] = await goods.detailInfo(detailParam);
this.imgList = res.imageList || [];
this.detailInfo = res;
try {
const detailImages = await goods.getDetailPic(this.detailInfo.detailUrl);
// const imgReg = new RegExp('(?<=src=").[^"]*', 'g');
// this.detailImgList = (detailImages || '').match(imgReg);
let imgReg = /<img.*?(?:>|\/>)/gi;
// eslint-disable-next-line no-useless-escape
let srcReg = /src=[\'"]?([^\'"]*)[\'"]?/i;
let arr = (detailImages || '').match(imgReg);
let srcArr = [];
for (let i = 0; i < arr.length; i++) {
let src = arr[i].match(srcReg)[1].replace('http://', 'https://');
srcArr.push(src);
}
this.detailImgList = srcArr;
} catch (error) {
console.error(error);
}
this.selectedGoods.skuId = this.detailInfo.skuNo;
if (res.stock === 0) {
this.detailInfo.limitCount = 1;
this.detailInfo.activityLimitCount = 0;
this.$toast('库存不足!');
}
this.skuDetailAtts = res.skuDetailAtts;
this.selectedAddress = res.receiverInfo || {};
this.specList = res.skuAtts || [];
let li = [];
this.specList.forEach(item => {
item.attsValues.forEach(i => {
i.attsCode = item.attsCode;
if (i.isSelected) {
this.specSelected.push(i);
}
});
li = li.concat(item.attsValues);
});
this.specChildList = li;
// // 收货地址
// this.getAddr();
//选择的商品规格
this.getSelectedSkuNo(this.specSelected);
},
async getAddr() {
if (!this.hasLogin) {
this.$router.push({ name: 'login' });
return;
}
const [addressInfo] = await goods.addrList();
if (addressInfo) {
this.addressList = (addressInfo && addressInfo.addrReceiverList) || [];
this.flag = true;
this.show = true;
} else {
this.addAddress();
}
},
addAddress() {
if (!this.hasLogin) {
this.$router.push({ name: 'login' });
return;
}
this.show = false;
this.$router.push({ name: 'addressManage' });
},
toOrder() {
if (!this.hasLogin) {
this.$router.push({ name: 'login' });
return;
}
if (this.detailInfo.stock === 0) {
this.$toast('库存不足!');
return;
}
this.show = false;
if (this.isLose) {
this.$toast('商品已失效');
return;
}
const order = {
addrReceiverId: this.selectedAddress.addrReceiverId || '',
selectedSkuList: [
{
skuId: this.selectedGoods.skuId,
skuNum: this.selectedGoods.skuNum,
skuSource: this.detailInfo.skuSource
}
],
defaultUseCoupon: true,
defaultUseFreightFeeCoupon: true,
defaultUseCashCoupon: true,
defaultUseActivityCoupon: true,
couponActivityUseIdList: []
};
window.localStorage.setItem('orderData', order);
window.localStorage.removeItem('addressList');
},
changeAddress(address) {
// 选取规格需要清空,init会重新赋值
this.specSelected = [];
this.detailParam = {
count: this.selectedGoods.skuNum,
skuNo: this.selectedGoods.skuId,
receiverId: address.addrReceiverId
};
this.show = false;
this.init(this.detailParam);
},
// 选择商品规格
getSelectedSkuNo(specSelected) {
if (!specSelected || !specSelected.length) {
this.selectedGoods.skuId = this.detailInfo.skuNo;
return;
}
let list = JSON.parse(JSON.stringify(specSelected));
const skuNoList = [];
list.map(item => {
skuNoList.push(item.skuNos);
});
let baseList = skuNoList.shift();
let finalList = baseList;
baseList.forEach(item => {
const index = finalList.indexOf(item);
skuNoList.forEach(i => {
if (i.indexOf(item) === -1) {
finalList.splice(index, 1);
}
});
});
this.selectedGoods.skuId = finalList.pop();
},
//选择规格
selectSpec(index, sku) {
if (sku.isSelected || sku.disabled) {
return;
}
let list = this.specChildList;
list.forEach(item => {
this.$set(item, 'disabled', true);
if (item.attsCode === sku.attsCode) {
this.$set(item, 'isSelected', false);
}
item.skuNos.forEach(i => {
if (sku.skuNos.indexOf(i) !== -1 || item.attsCode === sku.attsCode) {
this.$set(item, 'disabled', false);
}
});
if (item.disabled) {
item.isSelected = false;
}
});
this.$set(list[index], 'isSelected', true);
this.specSelected = [];
list.forEach(item => {
if (item.isSelected === true) {
this.specSelected.push(item);
}
});
this.getSelectedSkuNo(this.specSelected);
},
swiperChange(e) {
this.swiperCurrent = e.detail.current;
},
handleParamsClick(eventType, name) {
this.currentPopupType = eventType;
this.currentPopupName = name;
switch (eventType) {
case 'sku':
this.skuPopup();
break;
case 'area':
this.areaPopup();
break;
case 'coupon':
this.show = true;
break;
case 'service':
this.show = true;
break;
default:
break;
}
},
skuPopup() {
if (this.detailInfo.stock === 0) {
this.$toast('库存不足!');
return;
}
this.show = true;
},
areaPopup() {
if (!this.hasLogin) {
this.$router.push({ name: 'login' });
return;
}
this.getAddr();
}
}
};
</script>
<style lang="less" src="./index.less" scoped></style>
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment