Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
mallapp
Commits
bc534b47
Commit
bc534b47
authored
Feb 19, 2024
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交小程序评价标签以及规格日期选择
parent
050875fa
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
532 additions
and
470 deletions
+532
-470
goodsku.vue
components/goods/goodsku.vue
+15
-5
index.vue
components/goods/sign/index.vue
+19
-11
u-tabs.vue
node_modules/uview-ui/components/u-tabs/u-tabs.vue
+11
-3
comment-list.vue
pages/goods/comment-list.vue
+380
-398
goods.vue
pages/goods/goods.vue
+24
-51
order-commit-details.vue
pages/order/order-commit-details.vue
+83
-2
No files found.
components/goods/goodsku.vue
View file @
bc534b47
...
...
@@ -30,7 +30,7 @@
</view>
</view>
</view>
<!--
<view
class=
"sku-item"
v-for=
"(x, i) in g.attr_groups"
v-if=
"x.isdateformat==1"
>
<!--
<view
class=
"sku-item"
v-for=
"(x, i) in g.attr_groups"
v-if=
"x.isdateformat==1"
>
<view
class=
"sku-title"
>
{{
x
.
attr_group_name
}}
</view>
<view>
<view
class=
"sku-chi"
:style=
"
{
...
...
@@ -47,7 +47,8 @@
<!--x.isdateformat=1 改成日历模式 -->
<view
class=
"sku-title"
>
{{
x
.
attr_group_name
}}
</view>
<view>
<calendar
@
finish=
"chosenDateResult"
:defaultDate=
"x.attr_list[0].attr_name"
:immediately=
"true"
:priceList=
"x.attr_list"
></calendar>
<calendar
@
finish=
"chosenDateResult"
:defaultDate=
"getDefaultDate(x.attr_list[0].attr_name)"
:immediately=
"true"
:priceList=
"x.attr_list"
></calendar>
</view>
</view>
</scroll-view>
...
...
@@ -245,6 +246,16 @@
);
},
methods
:
{
getDefaultDate
(
item
)
{
var
result
=
item
;
if
(
this
.
skuObj
&&
this
.
skuObj
.
attr_list
&&
this
.
skuObj
.
attr_list
.
length
>
0
&&
this
.
g
.
mall_id
==
19
&&
this
.
g
.
mch_id
==
29
)
{
var
tempItem
=
this
.
skuObj
.
attr_list
[
0
];
if
(
tempItem
&&
tempItem
.
attr_name
)
{
result
=
tempItem
.
attr_name
;
}
}
return
result
;
},
chosenDateResult
(
result
)
{
for
(
let
index
=
0
;
index
<
this
.
g
.
attr_groups
.
length
;
index
++
)
{
for
(
let
j
=
0
;
j
<
this
.
g
.
attr_groups
[
index
].
attr_list
.
length
;
j
++
)
{
...
...
@@ -486,13 +497,12 @@
}
});
}
if
(
this
.
g
.
attr_groups
&&
this
.
g
.
attr_groups
.
length
>
0
)
{
this
.
g
.
attr_groups
.
forEach
((
x
,
index
)
=>
{
if
(
x
.
isdateformat
==
1
)
{
if
(
x
.
attr_list
&&
x
.
attr_list
.
length
>
0
)
{
x
.
attr_list
.
forEach
((
subItem
,
subIndex
)
=>
{
var
newSign
=
(
subIndex
+
1
)
+
":"
+
priceSign
;
var
newSign
=
subItem
.
attr_id
+
":"
+
priceSign
;
if
(
this
.
g
.
attr
&&
this
.
g
.
attr
.
length
)
{
this
.
g
.
attr
.
forEach
(
y
=>
{
if
(
y
.
sign_id
==
newSign
)
{
...
...
@@ -506,7 +516,7 @@
}
});
}
console
.
log
(
"this.g.attr_groups"
,
this
.
g
.
attr_groups
)
if
(
this
.
g
.
attr
&&
this
.
g
.
attr
.
length
)
{
this
.
g
.
attr
.
forEach
(
x
=>
{
if
(
x
.
sign_id
==
sign
)
{
...
...
components/goods/sign/index.vue
View file @
bc534b47
...
...
@@ -6,9 +6,16 @@
<view
v-for=
"(item,index) in d"
class=
"fontw100"
:class=
"[active==item.Id?'active':'']"
:style=
"
{'color':active==item.Id?mainColor:''}"
@click="changeHandler(item.Id)">
<view>
{{
item
.
Name
}}
</view>
<text
class=
"fontw100"
:style=
"
{'color':mainColor}">¥
{{
item
.
minprices
}}
<text>
起
</text>
</text>
<template
v-if=
"item.minprices"
>
<text
class=
"fontw100"
:style=
"
{'color':mainColor}">¥
{{
item
.
minprices
}}
<text>
起
</text>
</text>
</
template
>
<
template
v-else
>
<text
class=
"fontw100"
:style=
"
{'color':mainColor}">
<text>
暂无团期
</text>
</text>
</
template
>
<view
class=
"tabsLine"
:style=
"{'background':active==item.Id?mainColor:''}"
></view>
</view>
</view>
...
...
@@ -218,6 +225,7 @@
watch
:
{
defaultDate
(
newVal
)
{
console
.
log
(
"newVal"
,
newVal
)
this
.
userDefaultDate
=
newVal
;
if
(
this
.
userDefaultDate
!=
""
)
{
this
.
start
=
this
.
setDefaultDate
(
this
.
userDefaultDate
);
...
...
@@ -271,19 +279,19 @@
}
},
methods
:
{
getMinPrice
(){
this
.
d
.
forEach
(
x
=>
{
getMinPrice
()
{
this
.
d
.
forEach
(
x
=>
{
x
.
prices
=
[]
})
for
(
let
i
=
0
;
i
<
this
.
priceList
.
length
;
i
++
)
{
let
datas
=
this
.
priceList
[
i
].
attr_name
.
split
(
'-'
)
for
(
let
j
=
0
;
j
<
this
.
d
.
length
;
j
++
)
{
let
m
=
this
.
d
[
j
].
Month
>
9
?
this
.
d
[
j
].
Month
:
'0'
+
this
.
d
[
j
].
Month
if
(
datas
[
1
]
==
m
)
{
this
.
d
[
j
].
prices
.
push
(
this
.
priceList
[
i
].
newPrice
)
let
datas
=
this
.
priceList
[
i
].
attr_name
.
split
(
'-'
)
for
(
let
j
=
0
;
j
<
this
.
d
.
length
;
j
++
)
{
let
m
=
this
.
d
[
j
].
Month
>
9
?
this
.
d
[
j
].
Month
:
'0'
+
this
.
d
[
j
].
Month
if
(
datas
[
1
]
==
m
)
{
this
.
d
[
j
].
prices
.
push
(
this
.
priceList
[
i
].
newPrice
)
}
}
}
}
this
.
d
.
forEach
(
x
=>
{
x
.
minprices
=
Math
.
min
.
apply
(
null
,
x
.
prices
)
})
...
...
node_modules/uview-ui/components/u-tabs/u-tabs.vue
View file @
bc534b47
...
...
@@ -3,12 +3,12 @@
background: bgColor
}">
<scroll-view
scroll-x
class=
"u-scroll-view"
:scroll-left=
"scrollLeft"
scroll-with-animation
>
<view
class=
"u-scroll-box"
:class=
"
{'u-tabs-scorll-flex': !isScroll}">
<view
class=
"u-scroll-box"
:class=
"
{'u-tabs-scorll-flex': !isScroll
,'u-tabs-scorll-flexWrap': isWrap
}">
<view
class=
"u-tab-item"
:id=
"'u-tab-item-' + index"
v-for=
"(item, index) in list"
:key=
"index"
@
tap=
"clickTab(index)"
:style=
"[tabItemStyle(index)]"
>
{{
item
[
name
]
||
item
[
'name'
]
}}
</view>
<view
v-if=
"showBar"
class=
"u-tab-bar"
:style=
"[tabBarStyle]"
></view>
<view
v-if=
"showBar
&&!isWrap
"
class=
"u-tab-bar"
:style=
"[tabBarStyle]"
></view>
</view>
</scroll-view>
</view>
...
...
@@ -42,6 +42,11 @@
export
default
{
name
:
"u-tabs"
,
props
:
{
// 是否换行
isWrap
:
{
type
:
Boolean
,
default
:
false
},
// 导航菜单是否需要滚动,如只有2或者3个的时候,就不需要滚动了,此时使用flex平分tab的宽度
isScroll
:
{
type
:
Boolean
,
...
...
@@ -193,7 +198,7 @@
return
(
index
)
=>
{
let
style
=
{
height
:
this
.
height
+
'rpx'
,
'line-height'
:
this
.
height
+
'rpx'
,
//
'line-height': this.height + 'rpx',
fontSize
:
this
.
fontSize
+
'rpx'
,
'transition-duration'
:
`
${
this
.
duration
}
s`
,
padding
:
this
.
isScroll
?
`0
${
this
.
gutter
}
rpx`
:
''
,
...
...
@@ -335,4 +340,7 @@
display
:
flex
;
justify-content
:
space-between
;
}
.u-tabs-scorll-flexWrap
{
flex-wrap
:
wrap
;
}
</
style
>
pages/goods/comment-list.vue
View file @
bc534b47
This diff is collapsed.
Click to expand it.
pages/goods/goods.vue
View file @
bc534b47
...
...
@@ -306,7 +306,10 @@
<view
class=
"label"
>
选择
</view>
<view
class=
"content"
>
<view
class=
"sku-chosen"
@
click=
"chosenSku"
>
<view
class=
"sku"
>
{{ currentSku.attr_list.length > 0 ? '已' : '请' }}选择 {{ sku }}
</view>
<view
class=
"sku"
>
<
template
v-if=
"currentSku&¤tSku.attr_list && currentSku.attr_list.length > 0"
>
已选择
{{
sku
}}
</
template
>
<
template
v-else
>
请选择
{{
sku
}}
</
template
>
</view>
<view
class=
"arrow"
>
<u-icon
name=
"arrow"
:size=
"32"
color=
"#111"
></u-icon>
</view>
...
...
@@ -613,16 +616,7 @@
let
basedata
=
uni
.
getStorageSync
(
"basedata"
)
?
uni
.
getStorageSync
(
"basedata"
)
:
''
;
this
.
AppletID
=
basedata
.
home_pages
.
id
?
basedata
.
home_pages
.
id
:
0
;
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
// if (!this.u) {
// this.u = {
// nickName: "未登录",
// avatarUrl: "",
// };
// this.showAuth = true;
// } else {
// this.init();
// this.initPage();
// }
this
.
initPage
();
this
.
getVipId
();
...
...
@@ -701,9 +695,7 @@
this
.
init
();
},
methods
:
{
// counter() {
// document.querySelector("#productId");
// },
// tob切换
change
(
index
)
{
this
.
current
=
index
;
...
...
@@ -712,26 +704,7 @@
console
.
log
(
e
);
},
initImages
()
{
// let that = this;
// let info = uni.createSelectorQuery().in(this);
// info
// .select(".goods")
// .boundingClientRect((data) => {
// console.log("得到布局位置信息" + JSON.stringify(data));
// })
// .exec();
// info
// .boundingClientRect(function (data) {
// console.log(data)
// })
// .exec();
// wx.createSelectorQuery()
// .selectAll("#goodpic")
// .fields({ rect: true })
// .exec(res => {
// console.log(res);
// });
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
...
...
@@ -772,7 +745,6 @@
if
(
res
.
data
)
{
this
.
vipState
=
res
.
data
.
VIPModel
;
}
// this.initRecommend();
}
);
},
...
...
@@ -795,20 +767,21 @@
if
(
res
.
resultCode
==
1
)
{
this
.
g
=
res
.
data
.
goods
;
// 报名限制数组
res
.
data
.
goods
.
edu_data
&&
res
.
data
.
goods
.
edu_data
.
ClassCondition
&&
res
.
data
.
goods
.
edu_data
.
ClassCondition
.
forEach
(
item2
=>
{
if
(
item2
.
ItemType
==
1
)
{
this
.
ItemType1
.
push
(
item2
)
}
else
if
(
item2
.
ItemType
==
2
)
{
this
.
ItemType2
.
push
(
item2
)
}
else
if
(
item2
.
ItemType
==
3
)
{
this
.
ItemType3
.
push
(
item2
)
}
else
if
(
item2
.
ItemType
==
4
)
{
this
.
ItemType4
.
push
(
item2
)
}
else
if
(
item2
.
ItemType
==
5
)
{
this
.
ItemType5
.
push
(
item2
)
}
})
res
.
data
.
goods
.
edu_data
&&
res
.
data
.
goods
.
edu_data
.
ClassCondition
&&
res
.
data
.
goods
.
edu_data
.
ClassCondition
.
forEach
(
item2
=>
{
if
(
item2
.
ItemType
==
1
)
{
this
.
ItemType1
.
push
(
item2
)
}
else
if
(
item2
.
ItemType
==
2
)
{
this
.
ItemType2
.
push
(
item2
)
}
else
if
(
item2
.
ItemType
==
3
)
{
this
.
ItemType3
.
push
(
item2
)
}
else
if
(
item2
.
ItemType
==
4
)
{
this
.
ItemType4
.
push
(
item2
)
}
else
if
(
item2
.
ItemType
==
5
)
{
this
.
ItemType5
.
push
(
item2
)
}
})
// 报名限制数组结束
this
.
g
.
totalStock
=
0
;
this
.
g
.
attr
.
forEach
((
x
)
=>
{
...
...
@@ -909,8 +882,8 @@
},
(
res
)
=>
{
this
.
comments
=
res
.
data
.
pageData
;
console
.
log
(
"1111"
,
this
.
comments
)
// this.initRecommend();
},
(
err
)
=>
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
...
...
@@ -1273,7 +1246,7 @@
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
/* -webkit-line-clamp: 2;
/* -webkit-line-clamp: 2;
-webkit-box-orient: vertical; */
font-size
:
16px
;
/* height: 45px; */
...
...
pages/order/order-commit-details.vue
View file @
bc534b47
...
...
@@ -13,6 +13,12 @@
</view>
<view
class=
"content-box"
>
<view
class=
"title-box"
>
输入评价内容
</view>
<view
class=
"classifyBigBox"
>
<view
class=
"oneClassify flex"
:class=
"
{selectActive:selected[item.Id]==true}" v-for="(item,i) in LabelIdList"
@click="onSelectClassify(item.Id)">
{{
item
.
Name
}}
</view>
</view>
<view
class=
"editor-box"
>
<view
class=
"editor-icon"
>
<u-icon
name=
"edit"
size=
"36"
></u-icon>
...
...
@@ -54,13 +60,17 @@
Content
:
""
,
OrderDetailId
:
0
,
CommentImgList
:
[],
CommentScore
:
5
CommentScore
:
5
,
LabelIds
:
''
,
},
submitStatus
:
false
,
goodsName
:
""
,
goodsPic
:
""
,
action
:
this
.
host2
+
"/api/File/UploadTencent"
,
fileList
:
[],
LabelIdList
:
[],
selected
:
[],
selectedLabelId
:
[],
};
},
onLoad
(
option
)
{
...
...
@@ -71,6 +81,7 @@
this
.
goodsName
=
param
.
GoodsName
;
this
.
goodsPic
=
param
.
CoverImage
;
}
this
.
GetCommentLabel
()
},
mounted
()
{
uni
.
setNavigationBarTitle
({
...
...
@@ -78,10 +89,21 @@
});
this
.
mc
=
this
.
$uiConfig
.
mainColor
;
this
.
secondary
=
this
.
$uiConfig
.
secondary
;
let
MallBaseId
=
uni
.
getStorageSync
(
"mall_UserInfo"
).
MallBaseId
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
MallBaseId
:
1
;
let
MallBaseId
=
uni
.
getStorageSync
(
"mall_UserInfo"
).
MallBaseId
?
uni
.
getStorageSync
(
"mall_UserInfo"
)
.
MallBaseId
:
1
;
this
.
action
=
this
.
host2
+
'/api/File/UploadTencent?MallBaseId='
+
MallBaseId
},
methods
:
{
onSelectClassify
(
id
)
{
this
.
$set
(
this
.
selected
,
id
,
!
this
.
selected
[
id
])
//动态更新视图数据
let
index
=
this
.
selectedLabelId
.
findIndex
(
item
=>
item
==
id
)
if
(
index
==
-
1
)
{
this
.
selectedLabelId
.
push
(
id
)
}
else
{
this
.
selectedLabelId
=
this
.
selectedLabelId
.
filter
(
item
=>
item
!==
id
);
}
},
uploadSuccessHandler
(
data
,
index
,
lists
)
{
let
r
=
JSON
.
parse
(
data
);
this
.
msg
.
CommentImgList
.
push
(
r
.
data
);
...
...
@@ -89,8 +111,21 @@
change
(
val
)
{
this
.
msg
.
CommentScore
=
val
},
GetCommentLabel
()
{
this
.
request2
({
url
:
"/api/order/GetCommentLabelList"
,
data
:
{},
},
(
res
)
=>
{
this
.
LabelIdList
=
res
.
data
;
}
);
},
submitForm
()
{
this
.
submitStatus
=
true
;
if
(
this
.
selectedLabelId
){
this
.
msg
.
LabelIds
=
this
.
selectedLabelId
.
join
(
','
)
}
if
(
this
.
msg
.
CommentScore
>
0
)
{
this
.
request2
({
url
:
"/api/AppletOrder/SetGoodsCommentInfo"
,
...
...
@@ -134,6 +169,52 @@
</
script
>
<
style
>
.commit-detail
.classifyBigBox
{
margin
:
27
rpx
0
;
display
:
grid
;
grid-template-columns
:
repeat
(
4
,
1
fr
);
grid-gap
:
30
rpx
;
font-size
:
10px
;
}
.commit-detail
.oneClassify
{
display
:
flex
;
align-items
:
center
;
padding
:
17
rpx
;
justify-content
:
center
;
background
:
F7F7F7
;
border-radius
:
13
rpx
;
background
:
#F5F5F5
;
color
:
#696969
;
border
:
2
rpx
solid
#dedede
;
}
.commit-detail
.selectActive
{
background
:
#ff547b
;
color
:
#FFFFFF
;
}
.commit-detail
.tl-btn-120
{
width
:
180
rpx
;
padding
:
17
rpx
;
background
:
F7F7F7
;
color
:
#999
;
border-radius
:
13
rpx
;
border
:
2
rpx
solid
#dedede
;
text-align
:
center
;
}
.commit-detail
.onConfirmFiltrate
{
width
:
180
rpx
;
padding
:
17
rpx
;
background
:
#2851F3
;
color
:
#FFFFFF
;
border-radius
:
13
rpx
;
text-align
:
center
;
margin-left
:
20
rpx
;
}
.commit-detail
{
background
:
#faf8f9
;
height
:
100vh
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment