Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
group-buy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
group-buy-ui
Commits
24f34329
Commit
24f34329
authored
Sep 23, 2021
by
beisir
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/group-buy' of git.quantgroup.cn:ui/group-buy-ui into feat/group-buy
parents
8535910a
ff0abda8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
106 additions
and
49 deletions
+106
-49
groupBuy.js
src/api/groupBuy.js
+4
-0
pay.api.js
src/api/pay.api.js
+1
-0
sharePic.vue
src/components/sharePic.vue
+50
-35
smallPic.vue
src/views/goodsDetail/smallPic.vue
+16
-2
createOrder.vue
src/views/order/createOrder.vue
+1
-3
payResult.vue
src/views/pay/payResult.vue
+34
-9
No files found.
src/api/groupBuy.js
View file @
24f34329
...
@@ -53,6 +53,10 @@ export default {
...
@@ -53,6 +53,10 @@ export default {
params
params
});
});
},
},
// 获取小程序码
getQrcodeUrl
(
params
)
{
return
http
.
get
(
`
${
talosHost
}
/api/kdsp/playBill/getMakePicData`
,
params
);
},
getGroupShareInfo
(
orderNo
)
{
getGroupShareInfo
(
orderNo
)
{
return
http
.
get
(
`
${
talosHost
}
/api/kdsp/groupShareInfo?orderNo=
${
orderNo
}
`
);
return
http
.
get
(
`
${
talosHost
}
/api/kdsp/groupShareInfo?orderNo=
${
orderNo
}
`
);
}
}
...
...
src/api/pay.api.js
View file @
24f34329
...
@@ -84,6 +84,7 @@ export default {
...
@@ -84,6 +84,7 @@ export default {
const
getCouponList
=
function
(
params
)
{
const
getCouponList
=
function
(
params
)
{
return
request
.
get
(
`
${
talosHost
}
/api/kdsp/appconfig/pay-succ-page/guide-stream`
,
{
params
});
return
request
.
get
(
`
${
talosHost
}
/api/kdsp/appconfig/pay-succ-page/guide-stream`
,
{
params
});
};
};
export
{
export
{
pay
,
pay
,
prepay
,
prepay
,
...
...
src/components/sharePic.vue
View file @
24f34329
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
</div>
</div>
<div
class=
"skuImg"
>
<div
class=
"skuImg"
>
<!-- 商品图 -->
<!-- 商品图 -->
<img
src=
"https://img.lkbang.net/activity/share/default/skuImg.pn
g"
alt=
""
/>
<img
:src=
"sharePicData.skuIm
g"
alt=
""
/>
<div
class=
"skuInfo"
>
<div
class=
"skuInfo"
>
<div
class=
"skuPrice"
>
<div
class=
"skuPrice"
>
<span
class=
"groupPriceContainer"
>
拼团价 ¥
</span>
<span
class=
"groupPriceContainer"
>
拼团价 ¥
</span>
...
@@ -50,12 +50,12 @@
...
@@ -50,12 +50,12 @@
</div>
</div>
<div
class=
"skuName"
>
<div
class=
"skuName"
>
<!-- 商品名称 -->
<!-- 商品名称 -->
SAINT LAURENT PARIS 圣罗兰 方管纯口红 3.8克 女神挚爱款 千颂伊同款
{{
sharePicData
.
skuName
}}
</div>
</div>
<div
class=
"shareInfo"
>
<div
class=
"shareInfo"
>
<!-- 底部分享信息 -->
<!-- 底部分享信息 -->
<div
class=
"qrcode"
>
<div
class=
"qrcode"
>
<img
src=
"https://img.lkbang.net/activity/share/default/qrcode.png
"
alt=
""
/>
<img
:src=
"qrcodeUrl
"
alt=
""
/>
</div>
</div>
<div
class=
"shareDesc"
>
<div
class=
"shareDesc"
>
<p>
分享自
<span>
羊小咩小程序
</span></p>
<p>
分享自
<span>
羊小咩小程序
</span></p>
...
@@ -67,45 +67,60 @@
...
@@ -67,45 +67,60 @@
<
script
>
<
script
>
import
html2canvas
from
'
html2canvas
'
;
import
html2canvas
from
'
html2canvas
'
;
import
qiNiuApi
from
'
@/api/qiniu.api
'
;
import
qiNiuApi
from
'
@/api/qiniu.api
'
;
import
groupBuyApi
from
'
@/api/groupBuy
'
;
import
{
upload
}
from
'
qiniu-js
'
;
import
{
upload
}
from
'
qiniu-js
'
;
import
config
from
'
@/config
'
;
import
config
from
'
@/config
'
;
export
default
{
export
default
{
mounted
()
{
props
:
{
// this.uploadPic();
sharePicData
:
{
type
:
Object
,
default
:
()
=>
{
return
{};
}
}
},
data
()
{
return
{
qrcodeUrl
:
''
};
},
},
methods
:
{
methods
:
{
async
uploadPic
()
{
async
createAndUploadPic
()
{
console
.
log
(
999
);
const
_this
=
this
;
const
[
qrcodeUrl
]
=
await
groupBuyApi
.
getQrcodeUrl
(
this
.
sharePicData
);
console
.
log
(
888
);
this
.
qrcodeUrl
=
qrcodeUrl
;
const
[
res
]
=
await
qiNiuApi
.
getQiniuToken
();
const
[
res
]
=
await
qiNiuApi
.
getQiniuToken
();
const
token
=
res
.
token
;
const
token
=
res
.
token
;
html2canvas
(
this
.
$refs
.
sharePic
,
{
console
.
log
(
777
);
width
:
1080
,
this
.
$nextTick
(()
=>
{
height
:
1920
,
html2canvas
(
this
.
$refs
.
sharePic
,
{
useCORS
:
true
,
width
:
1080
,
scale
:
1
height
:
1920
,
}).
then
(
function
(
canvas
)
{
useCORS
:
true
,
canvas
.
toBlob
(
scale
:
1
,
blob
=>
{
allowTaint
:
false
const
observable
=
upload
(
blob
,
null
,
token
);
}).
then
(
function
(
canvas
)
{
const
observer
=
{
canvas
.
toBlob
(
error
(
err
)
{
blob
=>
{
console
.
log
(
err
);
const
observable
=
upload
(
blob
,
null
,
token
);
},
const
observer
=
{
complete
({
hash
})
{
error
(
err
)
{
const
fileLink
=
config
.
qiniuHost
+
hash
;
console
.
log
(
err
);
console
.
log
(
'
fileLink
'
,
fileLink
);
},
}
complete
({
hash
})
{
};
console
.
log
(
'
success
'
,
config
.
qiniuHost
,
hash
);
observable
.
subscribe
(
observer
);
const
fileLink
=
config
.
qiniuHost
+
hash
;
// newImg.onload = function() {
_this
.
$emit
(
'
outputPicUrl
'
,
fileLink
);
// URL.revokeObjectURL(url);
}
// };
};
observable
.
subscribe
(
observer
);
// newImg.src = url;
},
// document.body.appendChild(newImg);
'
image/jpeg
'
,
},
0.85
'
image/jpeg
'
,
);
0.85
});
);
});
});
}
}
}
}
...
...
src/views/goodsDetail/smallPic.vue
View file @
24f34329
...
@@ -11,7 +11,11 @@
...
@@ -11,7 +11,11 @@
</div>
</div>
<div
class=
"goods-product-info"
>
<div
class=
"goods-product-info"
>
<div
class=
"goods-product-info-img"
>
<div
class=
"goods-product-info-img"
>
<span
class=
"goods-product-info-tag"
>
3人团
</span>
<span
v-if=
"detailInfo.groupBuyInfo && detailInfo.groupBuyInfo.groupBuyLimitUserCount"
class=
"goods-product-info-tag"
>
{{
detailInfo
.
groupBuyInfo
.
groupBuyLimitUserCount
}}
人团
</span
>
<cr-image
width=
"108px"
:src=
"detailInfo.thumbImageUrl"
/>
<cr-image
width=
"108px"
:src=
"detailInfo.thumbImageUrl"
/>
</div>
</div>
<div
class=
"goods-product-info-desc"
>
<div
class=
"goods-product-info-desc"
>
...
@@ -26,7 +30,7 @@
...
@@ -26,7 +30,7 @@
color=
"#EC1500"
color=
"#EC1500"
track-color=
"#F7F8F9"
track-color=
"#F7F8F9"
:show-pivot=
"false"
:show-pivot=
"false"
:percentage=
"
50
"
:percentage=
"
stockPercentage
"
/>
/>
</div>
</div>
<div
class=
"goods-product-info-desc-num"
>
<div
class=
"goods-product-info-desc-num"
>
...
@@ -116,6 +120,7 @@ export default {
...
@@ -116,6 +120,7 @@ export default {
inProgress
:
false
,
// 活动是否已经开始
inProgress
:
false
,
// 活动是否已经开始
countDownText
:
''
,
countDownText
:
''
,
showShareButton
:
false
,
// 是否显示分享按钮
showShareButton
:
false
,
// 是否显示分享按钮
stockPercentage
:
0
,
// 以下是原有的data
// 以下是原有的data
detailParam
:
{
detailParam
:
{
skuNo
:
''
,
skuNo
:
''
,
...
@@ -174,6 +179,15 @@ export default {
...
@@ -174,6 +179,15 @@ export default {
localStorage
.
set
(
'
groupBuyGroupId
'
,
res
.
groupBuyInfo
.
groupId
||
''
);
// 设置groupBuyGroupId,用于下单
localStorage
.
set
(
'
groupBuyGroupId
'
,
res
.
groupBuyInfo
.
groupId
||
''
);
// 设置groupBuyGroupId,用于下单
this
.
groupId
=
+
res
.
groupBuyInfo
.
groupId
||
''
;
this
.
groupId
=
+
res
.
groupBuyInfo
.
groupId
||
''
;
}
}
if
(
res
.
saleCount
&&
res
.
activitySkuTotalCount
)
{
const
percentage
=
+
res
.
saleCount
/
+
res
.
activitySkuTotalCount
;
if
(
isNaN
(
percentage
))
{
this
.
stockPercentage
=
0
;
}
else
{
this
.
stockPercentage
=
Math
.
floor
(
percentage
)
>=
1
?
100
:
Math
.
floor
(
percentage
*
100
);
}
console
.
log
(
this
.
stockPercentage
);
}
this
.
showShareButton
=
res
.
groupBuyInfo
.
groupBuyStatus
==
1
?
true
:
false
;
this
.
showShareButton
=
res
.
groupBuyInfo
.
groupBuyStatus
==
1
?
true
:
false
;
this
.
imgList
=
res
.
imageUrl
||
[];
this
.
imgList
=
res
.
imageUrl
||
[];
this
.
detailInfo
=
res
;
this
.
detailInfo
=
res
;
...
...
src/views/order/createOrder.vue
View file @
24f34329
...
@@ -207,9 +207,7 @@ export default {
...
@@ -207,9 +207,7 @@ export default {
newUrl
:
`/pages/pay/index?orderNo=
${
data
.
orderNo
}
&from=groupbuy`
newUrl
:
`/pages/pay/index?orderNo=
${
data
.
orderNo
}
&from=groupbuy`
});
});
}
else
if
(
isApp
)
{
}
else
if
(
isApp
)
{
this
.
nativeBridge
.
openNewUrl
({
this
.
$router
.
push
({
path
:
`/pay?orderNo=
${
data
.
orderNo
}
`
});
newUrl
:
`/pay?orderNo=
${
data
.
orderNo
}
`
});
}
else
{
}
else
{
return
;
// todo 处理纯h5情况
return
;
// todo 处理纯h5情况
// this.$dialog({
// this.$dialog({
...
...
src/views/pay/payResult.vue
View file @
24f34329
...
@@ -59,18 +59,23 @@
...
@@ -59,18 +59,23 @@
</div>
</div>
</div>
</div>
<Goods
/>
<Goods
/>
<sharePic
ref=
"sharePic"
:share-pic-data=
"sharePicData"
@
outputPicUrl=
"outputPicUrl"
/>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
goUrlExtends
}
from
'
./extends
'
;
import
{
goUrlExtends
}
from
'
./extends
'
;
import
CouponCard
from
'
./components/CouponCard.vue
'
;
import
CouponCard
from
'
./components/CouponCard.vue
'
;
import
{
getCouponList
}
from
'
@/api/pay.api
'
;
import
{
getCouponList
}
from
'
@/api/pay.api
'
;
import
groupBuyApi
from
'
@/api/groupBuy
'
;
import
Goods
from
'
@/components/RecoGoods/RecoGoods.vue
'
;
import
Goods
from
'
@/components/RecoGoods/RecoGoods.vue
'
;
import
{
isApp
,
isWxMp
}
from
'
@/service/validation.service
'
;
import
{
isApp
,
isWxMp
}
from
'
@/service/validation.service
'
;
import
{
EventBus
}
from
'
@/service/utils.service
'
;
import
sharePic
from
'
@/components/sharePic
'
;
export
default
{
export
default
{
components
:
{
components
:
{
Goods
,
Goods
,
CouponCard
CouponCard
,
sharePic
},
},
extends
:
goUrlExtends
,
extends
:
goUrlExtends
,
data
()
{
data
()
{
...
@@ -83,7 +88,8 @@ export default {
...
@@ -83,7 +88,8 @@ export default {
couponList
:
[],
couponList
:
[],
payStatusName
:
''
,
payStatusName
:
''
,
payMethodName
:
''
,
payMethodName
:
''
,
payType
:
''
payType
:
''
,
sharePicData
:
{}
};
};
},
},
created
()
{
created
()
{
...
@@ -97,14 +103,36 @@ export default {
...
@@ -97,14 +103,36 @@ export default {
this
.
freeAmount
=
freeAmount
||
''
;
this
.
freeAmount
=
freeAmount
||
''
;
this
.
payStatus
=
success
?
'
订单支付成功
'
:
'
订单支付失败
'
;
this
.
payStatus
=
success
?
'
订单支付成功
'
:
'
订单支付失败
'
;
this
.
payStatusName
=
success
?
'
支付成功
'
:
'
支付失败
'
;
this
.
payStatusName
=
success
?
'
支付成功
'
:
'
支付失败
'
;
this
.
$track
?.
registeredEvents
(
'
h5_RechargeResultPageExposure
'
,
{
pay_status
:
this
.
payStatus
});
this
.
getCouponList
();
this
.
getCouponList
();
this
.
setShareData
();
},
mounted
()
{
EventBus
.
$on
(
'
shareClickItem
'
,
({
ev
})
=>
{
if
(
ev
===
'
pic
'
)
{
this
.
createPic
();
}
});
},
beforeDestroy
()
{
EventBus
.
$off
(
'
shareClickItem
'
);
},
},
methods
:
{
methods
:
{
outputPicUrl
(
res
)
{
console
.
log
(
res
);
},
async
setShareData
()
{
const
[
res
]
=
await
groupBuyApi
.
getGroupShareInfo
({
orderNo
:
this
.
orderNo
});
this
.
sharePicData
=
res
;
},
createPic
()
{
console
.
log
(
typeof
this
.
$refs
.
sharePic
.
createAndUploadPic
);
this
.
$refs
.
sharePic
.
createAndUploadPic
();
},
share
()
{
share
()
{
// 分享
// 分享
this
.
$store
.
dispatch
(
'
goods_share_open
'
);
},
},
// goPay() {
// goPay() {
// this.$track?.registeredEvents('h5_RechargeResultPageClick', {
// this.$track?.registeredEvents('h5_RechargeResultPageClick', {
...
@@ -125,9 +153,7 @@ export default {
...
@@ -125,9 +153,7 @@ export default {
newUrl
:
`/pages/pay/index?orderNo=
${
this
.
orderNo
}
&from=groupbuy`
newUrl
:
`/pages/pay/index?orderNo=
${
this
.
orderNo
}
&from=groupbuy`
});
});
}
else
if
(
isApp
)
{
}
else
if
(
isApp
)
{
this
.
nativeBridge
.
openNewUrl
({
this
.
$router
.
push
({
path
:
`/pay?orderNo=
${
this
.
orderNo
}
`
});
newUrl
:
`/pay?orderNo=
${
this
.
orderNo
}
`
});
}
else
{
}
else
{
return
;
// todo 处理纯h5情况
return
;
// todo 处理纯h5情况
// this.$dialog({
// this.$dialog({
...
@@ -141,7 +167,6 @@ export default {
...
@@ -141,7 +167,6 @@ export default {
},
},
async
getCouponList
()
{
async
getCouponList
()
{
const
[
data
]
=
await
getCouponList
({
orderNo
:
this
.
orderNo
,
paySuccess
:
true
});
const
[
data
]
=
await
getCouponList
({
orderNo
:
this
.
orderNo
,
paySuccess
:
true
});
console
.
log
(
data
);
if
(
data
)
{
if
(
data
)
{
this
.
couponList
=
data
.
couponList
||
[];
this
.
couponList
=
data
.
couponList
||
[];
}
}
...
...
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