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
7bdf6a64
Commit
7bdf6a64
authored
Sep 23, 2021
by
beisir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:update shareGroup
parent
bfa869a1
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
124 additions
and
108 deletions
+124
-108
groupBuy.js
src/api/groupBuy.js
+3
-0
groupShare.vue
src/components/groupShare.vue
+3
-17
index.vue
src/views/goodsList/index.vue
+69
-73
List.vue
src/views/orderList/components/List.vue
+49
-18
No files found.
src/api/groupBuy.js
View file @
7bdf6a64
...
...
@@ -52,5 +52,8 @@ export default {
return
http
.
get
(
`
${
talosHost
}
/api/kdsp/group-order/list`
,
{
params
});
},
getGroupShareInfo
(
orderNo
)
{
return
http
.
get
(
`
${
talosHost
}
/api/kdsp/groupShareInfo?orderNo=
${
orderNo
}
`
);
}
};
src/components/groupShare.vue
View file @
7bdf6a64
...
...
@@ -34,7 +34,6 @@ export default {
}),
showShare
:
{
get
()
{
console
.
log
(
this
.
$store
.
state
.
pay
);
return
this
.
$store
.
state
.
pay
.
showShare
;
},
set
()
{
...
...
@@ -50,24 +49,11 @@ export default {
methods
:
{
shareCloseChange
()
{},
bundleShareClickItem
(
ev
)
{
if
(
ev
===
'
wexin
'
)
{
if
(
ev
===
'
we
i
xin
'
)
{
this
.
shareDialogConfirm
();
}
EventBus
.
$emit
(
'
shareClickItem
'
,
ev
);
// if (ev === 'pic') {
// const { posterUrl } = this.shareInfo;
// this.nativeBridge.openNewUrl({
// newUrl: `/pages/goodshare/index?url=${encodeURIComponent(JSON.stringify(posterUrl))}`
// });
// }
// if (ev === 'weixin') {
// this.nativeBridge.run({
// event: 'showShareView',
// data: {
// shareDic: this.shareInfo
// }
// });
// }
const
nativeBridge
=
this
.
nativeBridge
;
EventBus
.
$emit
(
'
shareClickItem
'
,
{
ev
,
nativeBridge
});
registeredEvents
(
'
H5_GroupZeroYuanPurchaseActivityPageSharePopupWindowBtnClick
'
,
{
sku_no
:
''
,
buttons_name
:
''
,
// 按钮名称
...
...
src/views/goodsList/index.vue
View file @
7bdf6a64
This diff is collapsed.
Click to expand it.
src/views/orderList/components/List.vue
View file @
7bdf6a64
...
...
@@ -89,7 +89,8 @@ import { isWxMp, isApp } from '@/service/validation.service';
import
Bridge
from
'
@qg/js-bridge
'
;
import
MpBridge
from
'
@/service/mp
'
;
import
{
registeredEvents
}
from
'
@/service/sa.service
'
;
import
{
EventBus
}
from
'
@/service/utils.service
'
;
import
groupBuyApi
from
'
@/api/groupBuy
'
;
export
default
{
name
:
'
OrderSkuList
'
,
components
:
{
...
...
@@ -106,6 +107,8 @@ export default {
},
data
()
{
return
{
shareInfo
:
null
,
nativeBridge
:
null
,
gpCountDown
:
new
Date
(
'
2021-09-12 00:00:00
'
).
getTime
(),
...
...
@@ -148,6 +151,9 @@ export default {
if
(
isApp
)
this
.
nativeBridge
=
new
Bridge
();
else
if
(
isWxMp
)
this
.
nativeBridge
=
new
MpBridge
();
},
mounted
()
{
this
.
onShareEventChange
();
},
methods
:
{
goGroupDetails
(
skuInfo
)
{
this
.
nativeBridge
.
openNewUrl
({
...
...
@@ -157,33 +163,29 @@ export default {
goGroupPayPages
(
skuInfo
)
{
this
.
$router
.
push
(
`/pay?orderNo=
${
skuInfo
.
orderNo
}
`
);
},
async
getGroupShareInfo
(
order
)
{
const
res
=
await
groupBuyApi
.
getGroupShareInfo
(
order
);
console
.
log
(
res
);
},
async
openShareEvent
(
skuInfo
)
{
let
options
=
await
this
.
getShareData
(
skuInfo
);
this
.
$store
.
dispatch
(
'
goods_share_open
'
,
options
);
// this.getGroupShareInfo('1440970158226214912');
this
.
shareInfo
=
skuInfo
;
this
.
$store
.
dispatch
(
'
goods_share_open
'
);
registeredEvents
(
'
H5_MyPuzzlePageGroupOrderBtnClick
'
,
{
sku_no
:
''
,
leader_user_id
:
''
});
},
async
getShareData
(
skuInfo
)
{
return
Promise
.
resolve
({
title
:
skuInfo
.
skuName
,
desc
:
'
我正在免费拿商品,请你帮帮我
'
,
link
:
`
${
window
.
location
.
origin
}
/activity/zeroBuy`
,
// 页面地址
imgUrl
:
skuInfo
.
imageUrl
// 图片地
});
// await
},
toDetail
(
goodsItem
)
{
const
{
sku
No
,
sku
List
,
activityInfoId
,
activityHundredGroupId
}
=
goodsItem
;
const
{
skuList
,
activityInfoId
,
activityHundredGroupId
}
=
goodsItem
;
this
.
$router
.
push
({
path
:
'
/groupBuy/skuInfoSmallPic
'
,
query
:
{
h
:
0
,
skuNo
,
activityHundredGroupId
,
skuNo
:
skuList
[
0
].
skuNo
,
groupBuyGroupId
:
activityHundredGroupId
,
goodsSpecialId
:
skuList
[
0
].
goodsSpecialId
,
activityId
:
activityInfoId
,
templateId
:
skuList
[
0
].
activityTemplateInfoId
,
...
...
@@ -197,8 +199,37 @@ export default {
onOptionClick
(
orderInfo
,
eventType
)
{
this
.
$emit
(
EVENT_CLICK
,
{
orderInfo
,
eventType
});
},
toHome
()
{
this
.
$router
.
replace
({
path
:
'
/home
'
});
async
getShareData
(
shareInfo
)
{
return
{
title
:
shareInfo
.
skuName
,
link
:
`
${
window
.
location
.
origin
}
/activity/zeroBuy`
,
// 页面地址
imgUrl
:
shareInfo
.
skuImg
// 图片地
};
},
onShareEventChange
()
{
EventBus
.
$on
(
'
shareClickItem
'
,
async
function
({
ev
,
nativeBridge
})
{
if
(
ev
===
'
pic
'
)
{
// 分享海报跳转小程序海报分享页面
// nativeBridge.openNewUrl({
// newUrl: `/pages/goodshare/index?url=${encodeURIComponent(
// JSON.stringify(shareDic.posterUrl)
// )}`
// });
}
if
(
ev
===
'
weixin
'
)
{
// const res = await groupBuyApi.getGroupShareInfo(this.shareInfo.order);
const
[
res
]
=
await
groupBuyApi
.
getGroupShareInfo
(
'
1440884214932389888
'
);
console
.
log
(
res
);
const
shareDic
=
await
this
.
getShareData
(
res
);
// 分享朋友派发微信postMessage事件
nativeBridge
.
run
({
event
:
'
showShareView
'
,
data
:
{
shareDic
}
});
}
});
}
}
};
...
...
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