Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
S
shop-new
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
王天霸
shop-new
Commits
9fb20cbc
提交
9fb20cbc
authored
7月 09, 2021
作者:
huaxinzhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1
上级
500574a8
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
199 行增加
和
802 行删除
+199
-802
.env.development
.env.development
+1
-0
request.js
src/utils/request.js
+6
-6
goodsspecifications.vue
...views/system/goods/add/components/goodsspecifications.vue
+107
-0
guide.vue
src/views/system/goods/add/components/guide.vue
+0
-766
index.vue
src/views/system/goods/add/index.vue
+85
-30
没有找到文件。
.env.development
浏览文件 @
9fb20cbc
...
...
@@ -5,6 +5,7 @@ ENV = 'development'
VUE_APP_BASE_API = 'http://sjapi.jxhh.com'
# 开发环境
#VUE_APP_BASE_API = 'http://192.168.111.36:8200'
#VUE_APP_BASE_API = 'http://192.168.111.34:8200'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
src/utils/request.js
浏览文件 @
9fb20cbc
...
...
@@ -28,18 +28,18 @@ service.interceptors.request.use(config => {
// 响应拦截器
service
.
interceptors
.
response
.
use
(
res
=>
{
//
debugger
//debugger
let
code
=
res
.
data
.
code
if
(
res
.
data
.
code
!==
0
)
{
//
if(res.data.code !== 0) {
code
=
res
.
data
.
code
||
200
;
}
else
{
code
=
0
;
}
//
} else {
//
code = 0;
//
}
// 返回所有数据的统一处理
const
data
=
res
.
data
;
// 获取错误信息
const
message
=
errorCode
[
code
]
||
res
.
data
.
message
||
errorCode
[
'default'
];
const
message
=
errorCode
[
code
]
||
res
.
data
.
message
||
res
.
data
.
msg
||
errorCode
[
'default'
];
if
(
code
===
1
||
code
===
200
)
{
return
res
.
data
...
...
src/views/system/goods/add/components/goodsspecifications.vue
0 → 100644
浏览文件 @
9fb20cbc
<
template
>
<div
class=
"app-container"
>
<!--
<div
v-for=
"(item, index) in speData"
:key=
"index"
>
-->
<!--
<p>
-->
<!--
<span>
规格名称:
</span>
-->
<!--
<el-select
v-model=
"fuck"
placeholder=
"请选择"
>
-->
<!--
<el-option-->
<!-- v-for="item in cities"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!--
<span
style=
"float: right; color: #8492a6; font-size: 13px"
>
{{
item
.
value
}}
</span>
-->
<!--
</el-option>
-->
<!--
</el-select>
-->
<!--
</p>
-->
<!--
</div>
-->
<p>
<span>
规格名称:
</span>
<el-select
v-model=
"input3"
placeholder=
"请选择"
>
<el-option
v-for=
"(item,index) in cities"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
<el-button
style=
"float: bottom; color: #8492a6; font-size: 13px; padding: 10px 20px;"
v-if=
"index === cities.length-1"
@
click=
"fuck"
>
新增
</el-button>
</el-option>
</el-select>
</p>
</div>
</
template
>
<
script
>
import
descartes
from
"@/utils/dikaerjs.js"
;
import
{
UploadImg
}
from
'@/api/module/goods'
export
default
{
name
:
"GoodsSpecifications"
,
props
:
{
specificationsdata
:
{
type
:
Object
,
required
:
true
}
},
data
()
{
return
{
speData
:
[],
// 商品规格总数据
input3
:
''
,
cities
:
[{
value
:
'Beijing'
,
label
:
'北京'
},
{
value
:
'Shanghai'
,
label
:
'上海'
},{
value
:
''
,
label
:
''
}],
/**/
arrtdall
:[],
nopeimg
:
require
(
"@/assets/image/nopic100.jpg"
),
checked
:
false
,
type
:
""
,
imgname
:
""
,
indeximg
:
""
,
indexsimg
:
""
,
shopType
:
[],
shopTypes
:
[],
newList
:
[],
newData
:
[],
tableData7
:
[],
// 规格列表表格
goodsNowStock
:
""
,
jsPrice
:
""
,
//协议价
price
:
""
,
//指导价
scPrice
:
""
,
//市场价
weight
:
""
,
spanArr
:
[],
pos
:
""
,
spanArr1
:
[],
pos1
:
""
,
tablearr
:
[],
spanArrS
:
{
spanArr0
:
[],
spanArr1
:
[],
},
posS
:
{
pos0
:
""
,
pos1
:
""
,
},
};
},
components
:
{},
mounted
()
{},
watch
:{},
methods
:
{
fuck
()
{
this
.
cities
.
push
({
label
:
'哈哈'
,
value
:
"hh"
});
}
},
};
</
script
>
<
style
scoped
>
</
style
>
src/views/system/goods/add/components/guide.vue
deleted
100644 → 0
浏览文件 @
500574a8
差异被折叠。
点击展开。
src/views/system/goods/add/index.vue
浏览文件 @
9fb20cbc
...
...
@@ -24,16 +24,18 @@
</ul>
</div>
<div
class=
"floor-cont"
ref=
"scrollview"
>
<!-- 商品信息 -->
<div
class=
"floor-item"
>
<div
class=
"floor-item-box"
>
<p
class=
"card-header-title floor-item-box-title"
><span
class=
"blue-block-goods blue-block-goods-title"
></span>
商品信息
</p>
<Goodsinfomation
ref=
"goodsInfo"
:goodsinfodata=
'goodsinfodata'
/>
</div>
</div>
<!-- 商品规格 -->
<div
class=
"floor-item"
>
<div
class=
"floor-item-box"
>
<p
class=
"card-header-title floor-item-box-title"
><span
class=
"blue-block-goods blue-block-goods-title"
></span>
商品规格
</p>
<GoodsSpecifications
:specificationsdata=
"specificationsdata"
/>
</div>
</div>
...
...
@@ -73,10 +75,17 @@
<
script
>
import
{
getAreaList
}
from
'@/api/module/retreat/address'
;
import
Goodsinfomation
from
'./components/goodsinfomation'
import
Goodsaftersale
from
'./components/goodsaftersale'
// let TIMER = null;
import
Goodsinfomation
from
'./components/goodsinfomation'
;
import
GoodsSpecifications
from
'./components/goodsspecifications'
;
import
Goodsaftersale
from
'./components/goodsaftersale'
;
export
default
{
name
:
'Index'
,
components
:
{
Goodsinfomation
,
GoodsSpecifications
,
Goodsaftersale
,
},
data
()
{
return
{
loading
:
false
,
...
...
@@ -91,7 +100,7 @@
leaf
:
'leaf'
},
isNextStep
:
true
,
isShowGoodsDetails
:
fals
e
,
isShowGoodsDetails
:
tru
e
,
isFIActive
:
0
,
/**/
floorNav
:
[
...
...
@@ -105,6 +114,10 @@
goodsinfodata
:
{
categoryList
:
[],
categoryStr
:
''
},
/* 商品规格 */
specificationsdata
:
{
},
/* 售后及服务 */
goodsaftersale
:
{
...
...
@@ -116,10 +129,6 @@
TIMER
:
null
,
}
// return end
},
components
:
{
Goodsinfomation
,
Goodsaftersale
},
created
()
{
...
...
@@ -234,20 +243,47 @@
}
},
/*-----------------------*/
/* 添加商品详细 */
/* 设置楼层导航事件驱动方法* @params Number index 楼层下标 */
setFloorNavMountClick
(
index
)
{
let
_this
=
this
_this
.
isFIActive
=
index
;
//debugger
clearInterval
(
_this
.
TIMER
)
clearInterval
(
_this
.
TIMER
);
// 可以通过 floor-cont的父元素,高度减去上下两个div的高度,来准确计算出来了,需要wtach监听,暂时用初步高来计算,一般问题不大
let
floor_cont
=
document
.
getElementsByClassName
(
'floor-cont'
)[
0
];
let
floor_item
=
document
.
getElementsByClassName
(
'floor-item'
),
floor_offsetTop
=
floor_item
[
index
].
offsetTop
-
floor_item
[
0
].
offsetTop
,
window_scrollTop
=
_this
.
$refs
.
scrollview
.
scrollTop
,
timer
=
{
step
:
45
,
times
:
20
,
FLOOR_OFFSETTOP
:
floor_offsetTop
};
// 电梯层数,即需要滚动的dom个数
fiLength
=
floor_item
.
length
,
// 每次点击,对应dom需要滚动的高度
floor_offsetTop
=
floor_item
[
index
].
offsetTop
-
floor_item
[
0
].
offsetTop
,
window_scrollTop
=
_this
.
$refs
.
scrollview
.
scrollTop
,
// 基本滚动动画配置
timer
=
{
step
:
45
,
times
:
20
,
FLOOR_OFFSETTOP
:
0
};
// floor_cont 可是窗口的 高
let
hxz
=
0
;
let
resList
=
[];
let
list
=
[];
for
(
let
i
=
0
;
i
<
floor_item
.
length
;
i
++
)
{
list
.
push
(
Number
(
floor_item
[
i
].
offsetHeight
));
}
resList
=
list
.
slice
(
index
)
for
(
let
j
=
0
;
j
<
resList
.
length
;
j
++
)
{
hxz
+=
resList
[
j
]
}
if
(
hxz
>
floor_cont
.
offsetHeight
)
{
timer
.
FLOOR_OFFSETTOP
=
floor_offsetTop
;
}
else
{
//let maxScrollTopDom = _this.comMaxScrollTop(0,floor_item,floor_cont.offsetHeight);
timer
.
FLOOR_OFFSETTOP
=
floor_cont
.
scrollHeight
-
floor_cont
.
offsetHeight
}
console
.
log
(
3333
,
floor_item
[
0
].
offsetTop
,
floor_item
[
1
].
offsetTop
,
floor_item
[
2
].
offsetTop
,
floor_item
[
3
].
offsetTop
,
floor_item
[
4
].
offsetTop
,
document
.
body
.
scrollTop
,
document
.
documentElement
.
scrollTop
);
//debugger
if
(
window_scrollTop
>
floor_offsetTop
)
{
_this
.
setFloorScrollArrowUp
(
timer
)
}
else
if
(
window_scrollTop
===
floor_offsetTop
)
{
...
...
@@ -256,9 +292,9 @@
_this
.
setFloorScrollArrowDown
(
timer
)
}
},
/* 设置楼层向上滚动* @params Object timer 定时器配置 */
setFloorScrollArrowUp
(
timer
)
{
//debugger
let
_this
=
this
clearInterval
(
_this
.
TIMER
)
_this
.
TIMER
=
setInterval
(()
=>
{
...
...
@@ -271,23 +307,11 @@
}
},
timer
.
times
)
},
/* 设置楼层向下滚动@params Object timer 定时器配置 */
setFloorScrollArrowDown
(
timer
)
{
let
floor_item
=
document
.
getElementsByClassName
(
'floor-cont'
);
let
fuck
=
0
;
let
_this
=
this
clearInterval
(
_this
.
TIMER
)
fuck
=
timer
.
FLOOR_OFFSETTOP
/**/
// if(_this.isFIActive === 4) {
// console.log(280,_this.$refs.scrollview.scrollTop);
// timer.FLOOR_OFFSETTOP = timer.FLOOR_OFFSETTOP - 333;
// }
console
.
log
(
999
,
floor_item
[
0
].
offsetHeight
);
//offsetHeight
/**/
_this
.
TIMER
=
setInterval
(()
=>
{
const
window_scrollTop
=
_this
.
$refs
.
scrollview
.
scrollTop
if
(
window_scrollTop
>=
timer
.
FLOOR_OFFSETTOP
)
{
...
...
@@ -299,6 +323,37 @@
},
timer
.
times
)
},
/*-----------*/
//
comMaxScrollTop
(
jsq
,
listDom
,
floor_cont
)
{
let
result
=
{
index
:
0
,
scrollTop
:
0
,
};
jsq
++
let
total
=
0
;
let
orgIndex
=
5
-
jsq
;
let
List
=
[];
for
(
let
i
=
0
;
i
<
listDom
.
length
;
i
++
)
{
List
.
push
(
Number
(
listDom
[
i
].
offsetHeight
)
);
}
// 得到,所有dom的盒子高度
let
resList
=
[];
resList
=
List
.
slice
(
orgIndex
);
for
(
let
j
=
0
;
j
<
resList
.
length
;
j
++
)
{
total
+=
Number
(
resList
[
j
])
}
if
(
total
<
floor_cont
)
{
return
this
.
comMaxScrollTop
(
jsq
,
listDom
,
floor_cont
);
}
else
if
(
total
>=
floor_cont
)
{
result
.
index
=
jsq
;
result
.
scrollTop
=
total
;
return
result
;
}
},
}
// methods end
}
</
script
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论