Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yongxinda-h5
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
yongxinda-h5
Commits
74da1264
提交
74da1264
authored
11月 04, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试
上级
8d018bd2
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
76 行增加
和
23 行删除
+76
-23
productLine.ts
src/api/productLine.ts
+8
-0
main.ts
src/main.ts
+2
-0
goodsSku.vue
src/pages/goods/goodsSku.vue
+2
-1
drag-and-drop-sort.vue
src/pages/productLine/components/drag-and-drop-sort.vue
+31
-1
productLine.vue
src/pages/productLine/productLine.vue
+25
-21
useStore.ts
src/store/useStore.ts
+8
-0
没有找到文件。
src/api/productLine.ts
0 → 100644
浏览文件 @
74da1264
import
{
request
}
from
'@/utils/request'
// 产品线加入购物车
export
const
addProductLineCart
=
(
data
:
any
)
=>
request
(
'/wx/productLine/cart'
,
'POST'
,
data
)
// 产品线收藏
export
const
productLineCollect
=
(
data
:
any
)
=>
request
(
'/wx/productLine/collect'
,
'POST'
,
data
)
\ No newline at end of file
src/main.ts
浏览文件 @
74da1264
...
@@ -3,12 +3,14 @@ import App from './App.vue';
...
@@ -3,12 +3,14 @@ import App from './App.vue';
import
Model
from
'@/utils/util'
;
import
Model
from
'@/utils/util'
;
import
uView
from
'./uni_modules/vk-uview-ui'
;
import
uView
from
'./uni_modules/vk-uview-ui'
;
import
config
from
'@/utils/config'
;
import
config
from
'@/utils/config'
;
import
{
createPinia
}
from
'pinia'
;
export
function
createApp
()
{
export
function
createApp
()
{
const
app
=
createSSRApp
(
App
);
const
app
=
createSSRApp
(
App
);
app
.
config
.
globalProperties
.
$baseUrl
=
config
.
baseUrl
;
app
.
config
.
globalProperties
.
$baseUrl
=
config
.
baseUrl
;
app
.
config
.
globalProperties
.
$model
=
Model
;
app
.
config
.
globalProperties
.
$model
=
Model
;
app
.
use
(
uView
);
app
.
use
(
uView
);
app
.
use
(
createPinia
());
return
{
return
{
app
,
app
,
};
};
...
...
src/pages/goods/goodsSku.vue
浏览文件 @
74da1264
...
@@ -186,8 +186,9 @@ let buyNow = (selectShop: any) => {
...
@@ -186,8 +186,9 @@ let buyNow = (selectShop: any) => {
// 加入产品线
// 加入产品线
const
addProduct
=
(
selectShop
:
any
)
=>
{
const
addProduct
=
(
selectShop
:
any
)
=>
{
skuPopupRef
.
value
.
handClose
()
skuPopupRef
.
value
.
handClose
()
let
productId
:
any
=
getProductId
(
selectShop
.
sku_name_arr
)
// console.log(selectShop, '加入产品线');
// console.log(selectShop, '加入产品线');
emits
(
'addProduct'
,
selectShop
)
emits
(
'addProduct'
,
selectShop
,
productId
)
goodsInfo
.
value
=
{}
goodsInfo
.
value
=
{}
detailData
.
value
=
undefined
detailData
.
value
=
undefined
detailId
.
value
=
undefined
detailId
.
value
=
undefined
...
...
src/pages/productLine/components/drag-and-drop-sort.vue
浏览文件 @
74da1264
...
@@ -19,9 +19,10 @@
...
@@ -19,9 +19,10 @@
@
touchstart=
"handleTouchstart($event, index)"
@
touchstart=
"handleTouchstart($event, index)"
@
touchmove
.
prevent=
"handleTouchmove($event, index)"
@
touchmove
.
prevent=
"handleTouchmove($event, index)"
@
touchend=
"handleTouchend"
@
touchend=
"handleTouchend"
@
tap
.
prevent
=
"handleTap(index)"
@
tap=
"handleTap(index)"
style=
"width: 100%; height: 100%;"
style=
"width: 100%; height: 100%;"
>
>
<!-- @tap="handleTap(index)" -->
<!-- 自定义内容 -->
<!-- 自定义内容 -->
<view
<view
class=
"item"
class=
"item"
...
@@ -33,6 +34,13 @@
...
@@ -33,6 +34,13 @@
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<u-action-sheet
:list=
"sheetList"
v-model=
"sheetShow"
:cancel-btn=
"false"
safe-area-inset-bottom
class=
"action-sheet"
></u-action-sheet>
</view>
</view>
</template>
</template>
...
@@ -58,6 +66,18 @@ export default {
...
@@ -58,6 +66,18 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
sheetShow
:
false
,
sheetList
:
[
{
text
:
'修改规格'
,
},
{
text
:
'复制'
,
},
{
text
:
'删除'
,
},
],
// 控件列表
// 控件列表
controlsArray
:
[],
controlsArray
:
[],
// 每行最大存放的个数
// 每行最大存放的个数
...
@@ -126,6 +146,10 @@ export default {
...
@@ -126,6 +146,10 @@ export default {
that
.
controlsArray
[
s
].
show
=
false
;
that
.
controlsArray
[
s
].
show
=
false
;
}
}
that
.
controlsArray
[
index
].
show
=
true
;
that
.
controlsArray
[
index
].
show
=
true
;
that
.
sheetShow
=
true
;
},
handleLongPress
()
{
console
.
log
(
'chanan'
);
},
},
/** 处理手指触摸后移动 */
/** 处理手指触摸后移动 */
handleTouchmove
(
event
,
index
)
{
handleTouchmove
(
event
,
index
)
{
...
@@ -244,6 +268,8 @@ export default {
...
@@ -244,6 +268,8 @@ export default {
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
$sheet-heigth
:
var
(
--
window-bottom
);
.drag-and-drop-sort-B
{
.drag-and-drop-sort-B
{
position
:
relative
;
position
:
relative
;
...
@@ -251,4 +277,8 @@ export default {
...
@@ -251,4 +277,8 @@ export default {
position
:
absolute
;
position
:
absolute
;
}
}
}
}
.action-sheet
{
bottom
:
100px
;
}
</
style
>
</
style
>
src/pages/productLine/productLine.vue
浏览文件 @
74da1264
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
:show-line=
"scope.row.show"
:show-line=
"scope.row.show"
:line-color=
"scope.row.show ? '#0000f0' : ''"
:line-color=
"scope.row.show ? '#0000f0' : ''"
style=
"margin-left: 20rpx;"
style=
"margin-left: 20rpx;"
@
longPress=
"handleLongPress"
></u-section>
></u-section>
<view
v-else
class=
"add"
>
<view
v-else
class=
"add"
>
<u-icon
name=
"plus"
color=
"#c6c6c6"
size=
"50"
@
tap=
"addTabs"
></u-icon>
<u-icon
name=
"plus"
color=
"#c6c6c6"
size=
"50"
@
tap=
"addTabs"
></u-icon>
...
@@ -37,6 +36,7 @@
...
@@ -37,6 +36,7 @@
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 导航 -->
<uni-goods-nav
<uni-goods-nav
class=
"goods-nav"
class=
"goods-nav"
:fill=
"true"
:fill=
"true"
...
@@ -46,13 +46,15 @@
...
@@ -46,13 +46,15 @@
@
buttonClick=
"buttonClick"
@
buttonClick=
"buttonClick"
/>
/>
</view>
</view>
<!-- 选择弹出框 -->
<category-popup
<category-popup
ref=
"categoryRef"
ref=
"categoryRef"
:show=
"showPopup"
:show=
"showPopup"
@
close=
"handleClose"
@
close=
"handleClose"
@
categoryData=
"initCategory"
@
categoryData=
"initCategory"
/>
/>
<goodsSku
ref=
"goodsSkuRef"
@
selected=
"selected"
@
add-product=
"addProduct"
></goodsSku>
<!-- 产品线sku -->
<goodsSku
ref=
"goodsSkuRef"
@
add-product=
"addProduct"
></goodsSku>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
...
@@ -62,9 +64,13 @@ import dragAndDropSort from './components/drag-and-drop-sort.vue';
...
@@ -62,9 +64,13 @@ import dragAndDropSort from './components/drag-and-drop-sort.vue';
import
categoryPopup
from
'./components/categoryPopup.vue'
;
import
categoryPopup
from
'./components/categoryPopup.vue'
;
import
goodsSku
from
'@/pages/goods/goodsSku'
;
import
goodsSku
from
'@/pages/goods/goodsSku'
;
import
{
indexDetails
}
from
'@/api/index'
;
import
{
indexDetails
}
from
'@/api/index'
;
import
{
useStore
}
from
'@/store/useStore'
;
let
store
=
useStore
();
console
.
log
(
store
.
lineData
);
let
baseUrl
=
config
.
baseUrl
;
let
baseUrl
=
config
.
baseUrl
;
let
lineList
=
ref
(
[{}]
as
any
);
//右侧tabber数据
let
lineList
=
ref
(
store
.
lineData
);
//右侧tabber数据
let
showPopup
=
ref
(
false
as
Boolean
);
let
showPopup
=
ref
(
false
as
Boolean
);
let
categoryRef
=
ref
();
let
categoryRef
=
ref
();
let
goodsSkuRef
=
ref
();
let
goodsSkuRef
=
ref
();
...
@@ -101,13 +107,12 @@ let onClick = (e: any) => {
...
@@ -101,13 +107,12 @@ let onClick = (e: any) => {
icon
:
'none'
,
icon
:
'none'
,
});
});
};
};
let
buttonClick
=
(
e
:
any
)
=>
{
let
buttonClick
=
(
e
:
any
)
=>
{
console
.
log
(
e
);
console
.
log
(
e
);
// this.options[2].info++
// this.options[2].info++
};
};
// 长按选择操作
let
handleLongPress
=
()
=>
{};
// 添加产品线产品
// 添加产品线产品
let
initCategory
=
(
data
:
any
)
=>
{
let
initCategory
=
(
data
:
any
)
=>
{
...
@@ -115,30 +120,23 @@ let initCategory = (data: any) => {
...
@@ -115,30 +120,23 @@ let initCategory = (data: any) => {
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'加载中...'
,
title
:
'加载中...'
,
});
});
setTimeout
(()
=>
{
goodsSkuRef
.
value
.
init
(
detailData
.
value
,
data
.
id
);
goodsSkuRef
.
value
.
skuKey
=
true
;
goodsSkuRef
.
value
.
skuMode
=
5
;
uni
.
hideLoading
();
},
500
);
};
// 监听选择规格,及数量
const
selected
=
(
data
:
any
)
=>
{
// console.log(data);
// selectedGoodsItem.value = data[0];
// selectedGoodsSum.value = data[1];
};
};
// 保存到产品线
// 保存到产品线
let
addProduct
=
(
data
:
any
)
=>
{
let
addProduct
=
(
data
:
any
,
productId
:
number
)
=>
{
console
.
log
(
data
,
'加入产品线'
);
let
index
=
lineList
.
value
.
length
-
1
;
let
index
=
lineList
.
value
.
length
-
1
;
lineList
.
value
.
splice
(
index
,
0
,
{
lineList
.
value
.
splice
(
index
,
0
,
{
name
:
data
.
goods_name
,
name
:
data
.
goods_name
,
url
:
data
.
image
,
url
:
data
.
image
,
goodsId
:
data
.
goods_id
,
number
:
data
.
buy_num
,
productId
:
productId
,
show
:
false
,
show
:
false
,
});
});
store
.
$patch
({
lineData
:
lineList
.
value
,
});
console
.
log
(
store
.
lineData
);
goodsSkuRef
.
value
.
skuKey
=
false
;
goodsSkuRef
.
value
.
skuKey
=
false
;
};
};
...
@@ -151,7 +149,11 @@ const initDetails = (id: number) => {
...
@@ -151,7 +149,11 @@ const initDetails = (id: number) => {
id
,
id
,
}).
then
((
res
:
any
)
=>
{
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
uni
.
hideLoading
();
detailData
.
value
=
res
.
data
.
data
;
detailData
.
value
=
res
.
data
.
data
;
goodsSkuRef
.
value
.
init
(
detailData
.
value
,
id
);
goodsSkuRef
.
value
.
skuKey
=
true
;
goodsSkuRef
.
value
.
skuMode
=
5
;
console
.
log
(
res
.
data
.
data
,
'商品详情数据'
);
console
.
log
(
res
.
data
.
data
,
'商品详情数据'
);
}
}
});
});
...
@@ -159,6 +161,8 @@ const initDetails = (id: number) => {
...
@@ -159,6 +161,8 @@ const initDetails = (id: number) => {
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
$nav-heigth
:
var
(
--
window-bottom
);
*
{
*
{
-webkit-touch-callout
:
none
;
/*系统默认菜单被禁用*/
-webkit-touch-callout
:
none
;
/*系统默认菜单被禁用*/
-webkit-user-select
:
none
;
/*webkit浏览器*/
-webkit-user-select
:
none
;
/*webkit浏览器*/
...
@@ -212,6 +216,6 @@ const initDetails = (id: number) => {
...
@@ -212,6 +216,6 @@ const initDetails = (id: number) => {
width
:
100%
;
width
:
100%
;
position
:
fixed
;
position
:
fixed
;
bottom
:
50px
;
bottom
:
50px
;
z-index
:
99
;
z-index
:
0
;
}
}
</
style
>
</
style
>
src/store/useStore.ts
浏览文件 @
74da1264
import
{
defineStore
,
createPinia
}
from
'pinia'
import
{
defineStore
,
createPinia
}
from
'pinia'
export
let
useStore
=
defineStore
(
'productLine'
,
{
state
:
()
=>
{
return
{
lineData
:
[{}]
}
}
})
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论