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
ff0abda8
Commit
ff0abda8
authored
Sep 23, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Plain Diff
feat: 生成pic组件
parents
add2c36c
f67492df
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
168 additions
and
157 deletions
+168
-157
groupBuy.js
src/api/groupBuy.js
+3
-0
pay.api.js
src/api/pay.api.js
+1
-6
groupShare.vue
src/components/groupShare.vue
+4
-17
sharePic.vue
src/components/sharePic.vue
+9
-4
index.vue
src/views/goodsList/index.vue
+69
-73
List.vue
src/views/orderList/components/List.vue
+15
-19
index.vue
src/views/orderList/index.vue
+55
-26
payResult.vue
src/views/pay/payResult.vue
+12
-12
No files found.
src/api/groupBuy.js
View file @
ff0abda8
...
@@ -56,5 +56,8 @@ export default {
...
@@ -56,5 +56,8 @@ export default {
// 获取小程序码
// 获取小程序码
getQrcodeUrl
(
params
)
{
getQrcodeUrl
(
params
)
{
return
http
.
get
(
`
${
talosHost
}
/api/kdsp/playBill/getMakePicData`
,
params
);
return
http
.
get
(
`
${
talosHost
}
/api/kdsp/playBill/getMakePicData`
,
params
);
},
getGroupShareInfo
(
orderNo
)
{
return
http
.
get
(
`
${
talosHost
}
/api/kdsp/groupShareInfo?orderNo=
${
orderNo
}
`
);
}
}
};
};
src/api/pay.api.js
View file @
ff0abda8
...
@@ -85,10 +85,6 @@ const getCouponList = function(params) {
...
@@ -85,10 +85,6 @@ 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
});
};
};
const
getOrderShareInfo
=
function
(
params
)
{
return
request
.
get
(
`
${
talosHost
}
/api/kdsp/groupShareInfo`
,
{
params
});
};
export
{
export
{
pay
,
pay
,
prepay
,
prepay
,
...
@@ -102,6 +98,5 @@ export {
...
@@ -102,6 +98,5 @@ export {
kaGetNextUrl
,
kaGetNextUrl
,
getCouponList
,
getCouponList
,
queryPayStatus
,
queryPayStatus
,
reissueContract
,
reissueContract
getOrderShareInfo
};
};
src/components/groupShare.vue
View file @
ff0abda8
...
@@ -34,7 +34,6 @@ export default {
...
@@ -34,7 +34,6 @@ export default {
}),
}),
showShare
:
{
showShare
:
{
get
()
{
get
()
{
console
.
log
(
this
.
$store
.
state
.
pay
);
return
this
.
$store
.
state
.
pay
.
showShare
;
return
this
.
$store
.
state
.
pay
.
showShare
;
},
},
set
()
{
set
()
{
...
@@ -50,24 +49,12 @@ export default {
...
@@ -50,24 +49,12 @@ export default {
methods
:
{
methods
:
{
shareCloseChange
()
{},
shareCloseChange
()
{},
bundleShareClickItem
(
ev
)
{
bundleShareClickItem
(
ev
)
{
if
(
ev
===
'
wexin
'
)
{
if
(
ev
===
'
we
i
xin
'
)
{
this
.
shareDialogConfirm
();
this
.
shareDialogConfirm
();
}
}
EventBus
.
$emit
(
'
shareClickItem
'
,
ev
);
const
nativeBridge
=
this
.
nativeBridge
;
// if (ev === 'pic') {
console
.
log
(
'
派发事件!
'
);
// const { posterUrl } = this.shareInfo;
EventBus
.
$emit
(
'
shareClickItem
'
,
{
ev
,
nativeBridge
});
// this.nativeBridge.openNewUrl({
// newUrl: `/pages/goodshare/index?url=${encodeURIComponent(JSON.stringify(posterUrl))}`
// });
// }
// if (ev === 'weixin') {
// this.nativeBridge.run({
// event: 'showShareView',
// data: {
// shareDic: this.shareInfo
// }
// });
// }
registeredEvents
(
'
H5_GroupZeroYuanPurchaseActivityPageSharePopupWindowBtnClick
'
,
{
registeredEvents
(
'
H5_GroupZeroYuanPurchaseActivityPageSharePopupWindowBtnClick
'
,
{
sku_no
:
''
,
sku_no
:
''
,
buttons_name
:
''
,
// 按钮名称
buttons_name
:
''
,
// 按钮名称
...
...
src/components/sharePic.vue
View file @
ff0abda8
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
<
script
>
<
script
>
import
html2canvas
from
'
html2canvas
'
;
import
html2canvas
from
'
html2canvas
'
;
import
qiNiuApi
from
'
@/api/qiniu.api
'
;
import
qiNiuApi
from
'
@/api/qiniu.api
'
;
import
g
etQrcodeUrl
from
'
@/api/groupBuy
'
;
import
g
roupBuyApi
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
{
...
@@ -85,18 +85,22 @@ export default {
...
@@ -85,18 +85,22 @@ export default {
};
};
},
},
methods
:
{
methods
:
{
async
uploadPic
()
{
async
createAndUploadPic
()
{
console
.
log
(
999
);
const
_this
=
this
;
const
_this
=
this
;
const
[
qrcodeUrl
]
=
await
getQrcodeUrl
(
this
.
sharePicData
);
const
[
qrcodeUrl
]
=
await
groupBuyApi
.
getQrcodeUrl
(
this
.
sharePicData
);
console
.
log
(
888
);
this
.
qrcodeUrl
=
qrcodeUrl
;
this
.
qrcodeUrl
=
qrcodeUrl
;
const
[
res
]
=
await
qiNiuApi
.
getQiniuToken
();
const
[
res
]
=
await
qiNiuApi
.
getQiniuToken
();
const
token
=
res
.
token
;
const
token
=
res
.
token
;
console
.
log
(
777
);
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
html2canvas
(
this
.
$refs
.
sharePic
,
{
html2canvas
(
this
.
$refs
.
sharePic
,
{
width
:
1080
,
width
:
1080
,
height
:
1920
,
height
:
1920
,
useCORS
:
true
,
useCORS
:
true
,
scale
:
1
scale
:
1
,
allowTaint
:
false
}).
then
(
function
(
canvas
)
{
}).
then
(
function
(
canvas
)
{
canvas
.
toBlob
(
canvas
.
toBlob
(
blob
=>
{
blob
=>
{
...
@@ -106,6 +110,7 @@ export default {
...
@@ -106,6 +110,7 @@ export default {
console
.
log
(
err
);
console
.
log
(
err
);
},
},
complete
({
hash
})
{
complete
({
hash
})
{
console
.
log
(
'
success
'
,
config
.
qiniuHost
,
hash
);
const
fileLink
=
config
.
qiniuHost
+
hash
;
const
fileLink
=
config
.
qiniuHost
+
hash
;
_this
.
$emit
(
'
outputPicUrl
'
,
fileLink
);
_this
.
$emit
(
'
outputPicUrl
'
,
fileLink
);
}
}
...
...
src/views/goodsList/index.vue
View file @
ff0abda8
This diff is collapsed.
Click to expand it.
src/views/orderList/components/List.vue
View file @
ff0abda8
...
@@ -89,7 +89,7 @@ import { isWxMp, isApp } from '@/service/validation.service';
...
@@ -89,7 +89,7 @@ import { isWxMp, isApp } from '@/service/validation.service';
import
Bridge
from
'
@qg/js-bridge
'
;
import
Bridge
from
'
@qg/js-bridge
'
;
import
MpBridge
from
'
@/service/mp
'
;
import
MpBridge
from
'
@/service/mp
'
;
import
{
registeredEvents
}
from
'
@/service/sa.service
'
;
import
{
registeredEvents
}
from
'
@/service/sa.service
'
;
import
groupBuyApi
from
'
@/api/groupBuy
'
;
export
default
{
export
default
{
name
:
'
OrderSkuList
'
,
name
:
'
OrderSkuList
'
,
components
:
{
components
:
{
...
@@ -106,6 +106,8 @@ export default {
...
@@ -106,6 +106,8 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
shareInfo
:
null
,
nativeBridge
:
null
,
nativeBridge
:
null
,
gpCountDown
:
new
Date
(
'
2021-09-12 00:00:00
'
).
getTime
(),
gpCountDown
:
new
Date
(
'
2021-09-12 00:00:00
'
).
getTime
(),
...
@@ -157,33 +159,30 @@ export default {
...
@@ -157,33 +159,30 @@ export default {
goGroupPayPages
(
skuInfo
)
{
goGroupPayPages
(
skuInfo
)
{
this
.
$router
.
push
(
`/pay?orderNo=
${
skuInfo
.
orderNo
}
`
);
this
.
$router
.
push
(
`/pay?orderNo=
${
skuInfo
.
orderNo
}
`
);
},
},
async
getGroupShareInfo
(
order
)
{
const
res
=
await
groupBuyApi
.
getGroupShareInfo
(
order
);
console
.
log
(
res
);
},
async
openShareEvent
(
skuInfo
)
{
async
openShareEvent
(
skuInfo
)
{
let
options
=
await
this
.
getShareData
(
skuInfo
);
this
.
$emit
(
'
option-click
'
,
{
...
skuInfo
,
eventType
:
'
share
'
});
this
.
$store
.
dispatch
(
'
goods_share_open
'
,
options
);
// this.getGroupShareInfo('1440970158226214912');
// this.shareInfo = skuInfo;
// this.$store.dispatch('goods_share_open');
registeredEvents
(
'
H5_MyPuzzlePageGroupOrderBtnClick
'
,
{
registeredEvents
(
'
H5_MyPuzzlePageGroupOrderBtnClick
'
,
{
sku_no
:
''
,
sku_no
:
''
,
leader_user_id
:
''
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
)
{
toDetail
(
goodsItem
)
{
const
{
sku
No
,
sku
List
,
activityInfoId
,
activityHundredGroupId
}
=
goodsItem
;
const
{
skuList
,
activityInfoId
,
activityHundredGroupId
}
=
goodsItem
;
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
'
/groupBuy/skuInfoSmallPic
'
,
path
:
'
/groupBuy/skuInfoSmallPic
'
,
query
:
{
query
:
{
h
:
0
,
h
:
0
,
skuNo
,
skuNo
:
skuList
[
0
].
skuNo
,
activityHundredGroupId
,
groupBuyGroupId
:
activityHundredGroupId
,
goodsSpecialId
:
skuList
[
0
].
goodsSpecialId
,
goodsSpecialId
:
skuList
[
0
].
goodsSpecialId
,
activityId
:
activityInfoId
,
activityId
:
activityInfoId
,
templateId
:
skuList
[
0
].
activityTemplateInfoId
,
templateId
:
skuList
[
0
].
activityTemplateInfoId
,
...
@@ -196,9 +195,6 @@ export default {
...
@@ -196,9 +195,6 @@ export default {
},
},
onOptionClick
(
orderInfo
,
eventType
)
{
onOptionClick
(
orderInfo
,
eventType
)
{
this
.
$emit
(
EVENT_CLICK
,
{
orderInfo
,
eventType
});
this
.
$emit
(
EVENT_CLICK
,
{
orderInfo
,
eventType
});
},
toHome
()
{
this
.
$router
.
replace
({
path
:
'
/home
'
});
}
}
}
}
};
};
...
...
src/views/orderList/index.vue
View file @
ff0abda8
...
@@ -34,6 +34,8 @@ import groupBuyApi from '@/api/groupBuy';
...
@@ -34,6 +34,8 @@ import groupBuyApi from '@/api/groupBuy';
import
List
from
'
./components/List
'
;
import
List
from
'
./components/List
'
;
import
{
isApp
}
from
'
@/service/validation.service
'
;
import
{
isApp
}
from
'
@/service/validation.service
'
;
import
localStorage
from
'
@/service/localStorage.service
'
;
import
localStorage
from
'
@/service/localStorage.service
'
;
import
{
EventBus
}
from
'
@/service/utils.service
'
;
import
qs
from
'
qs
'
;
const
commonParams
=
{
const
commonParams
=
{
loading
:
false
,
loading
:
false
,
finished
:
false
,
finished
:
false
,
...
@@ -78,9 +80,56 @@ export default {
...
@@ -78,9 +80,56 @@ export default {
mounted
()
{
mounted
()
{
this
.
getstatusQuery
();
this
.
getstatusQuery
();
this
.
getList
();
this
.
getList
();
this
.
onShareEventChange
();
// this.$track.registeredEvents('H5_2B_MyOrderPageExposure');
// this.$track.registeredEvents('H5_2B_MyOrderPageExposure');
},
},
methods
:
{
methods
:
{
async
getShareData
(
shareInfo
)
{
const
linkPath
=
qs
.
stringify
({
h
:
0
,
skuNo
:
shareInfo
.
skuNo
,
groupBuyGroupId
:
shareInfo
.
activityHundredGroupId
,
goodsSpecialId
:
shareInfo
.
specialId
,
activityId
:
shareInfo
.
activityInfoId
,
templateId
:
shareInfo
.
templateId
,
templateDetailId
:
shareInfo
.
templateId
});
return
Promise
.
resolve
({
title
:
shareInfo
.
skuName
,
link
:
`pages/webview/webview?url=
${
window
.
location
.
origin
}
?url=
${
encodeURIComponent
(
JSON
.
stringify
(
linkPath
)
)}
`
,
// 页面地址
imgUrl
:
shareInfo
.
skuImg
// 图片地
});
},
onShareEventChange
()
{
const
vm
=
this
;
console
.
log
(
'
update
'
);
EventBus
.
$on
(
'
shareClickItem
'
,
async
function
({
ev
,
nativeBridge
})
{
console
.
log
(
ev
);
if
(
ev
===
'
pic
'
)
{
// 分享海报跳转小程序海报分享页面
// nativeBridge.openNewUrl({
// newUrl: `/pages/goodshare/index?url=${encodeURIComponent(
// JSON.stringify(shareDic.posterUrl)
// )}`
// });
}
if
(
ev
===
'
weixin
'
)
{
console
.
log
(
'
监听事件
'
);
// const res = await groupBuyApi.getGroupShareInfo(this.shareInfo.order);
const
[
res
]
=
await
groupBuyApi
.
getGroupShareInfo
(
'
1440884214932389888
'
);
const
shareDic
=
await
vm
.
getShareData
(
res
);
// 分享朋友派发微信postMessage事件
nativeBridge
.
run
({
event
:
'
showShareView
'
,
data
:
{
shareDic
}
});
}
});
},
getstatusQuery
()
{
getstatusQuery
()
{
const
{
status
}
=
this
.
$route
.
params
||
{};
const
{
status
}
=
this
.
$route
.
params
||
{};
status
&&
(
this
.
currentTab
=
Number
(
status
));
status
&&
(
this
.
currentTab
=
Number
(
status
));
...
@@ -93,34 +142,14 @@ export default {
...
@@ -93,34 +142,14 @@ export default {
handleLoad
()
{
handleLoad
()
{
this
.
getList
();
this
.
getList
();
},
},
openShareEvent
()
{
this
.
$store
.
dispatch
(
'
goods_share_open
'
);
},
handleOptionClick
(
info
)
{
handleOptionClick
(
info
)
{
const
{
orderInfo
}
=
info
||
{};
this
.
currentOrder
=
info
;
const
{
cashCouponCancelNote
,
showCashCouponCancelNote
}
=
orderInfo
||
{};
this
.
currentOrder
=
orderInfo
;
switch
(
info
.
eventType
)
{
switch
(
info
.
eventType
)
{
case
'
cancel
'
:
case
'
share
'
:
this
.
orderCancelPopup
();
this
.
openShareEvent
();
break
;
case
'
pay
'
:
this
.
toPay
();
break
;
case
'
notify
'
:
this
.
orderNotify
();
break
;
case
'
again
'
:
this
.
toGoods
();
break
;
case
'
logistics
'
:
this
.
expressActionsCheck
();
break
;
case
'
confirm
'
:
this
.
orderConfirmPopup
();
break
;
case
'
toRefund
'
:
this
.
orderRefundPopup
(
cashCouponCancelNote
,
showCashCouponCancelNote
);
break
;
case
'
refund
'
:
this
.
toRefund
();
break
;
break
;
default
:
default
:
this
.
currentOrder
=
{};
this
.
currentOrder
=
{};
...
...
src/views/pay/payResult.vue
View file @
ff0abda8
...
@@ -59,13 +59,14 @@
...
@@ -59,13 +59,14 @@
</div>
</div>
</div>
</div>
<Goods
/>
<Goods
/>
<sharePic
ref=
"sharePic"
:share-pic-data=
"sharePicData"
/>
<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
,
getOrderShareInfo
}
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
{
EventBus
}
from
'
@/service/utils.service
'
;
...
@@ -102,16 +103,13 @@ export default {
...
@@ -102,16 +103,13 @@ 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
();
this
.
setShareData
();
},
},
mounted
()
{
mounted
()
{
EventBus
.
$on
(
'
shareClickItem
'
,
ev
=>
{
EventBus
.
$on
(
'
shareClickItem
'
,
({
ev
})
=>
{
if
(
ev
===
'
pic
'
)
{
if
(
ev
===
'
pic
'
)
{
this
.
getOrderShareInfo
();
this
.
createPic
();
}
}
});
});
},
},
...
@@ -119,15 +117,18 @@ export default {
...
@@ -119,15 +117,18 @@ export default {
EventBus
.
$off
(
'
shareClickItem
'
);
EventBus
.
$off
(
'
shareClickItem
'
);
},
},
methods
:
{
methods
:
{
outputPicUrl
(
res
)
{
console
.
log
(
res
);
},
async
setShareData
()
{
async
setShareData
()
{
const
[
res
]
=
await
g
etOrder
ShareInfo
({
const
[
res
]
=
await
g
roupBuyApi
.
getGroup
ShareInfo
({
orderNo
:
this
.
orderNo
orderNo
:
this
.
orderNo
});
});
this
.
sharePicData
=
res
;
this
.
sharePicData
=
res
;
},
},
getOrderShareInfo
()
{
createPic
()
{
console
.
log
(
typeof
this
.
$refs
.
sharePic
.
u
ploadPic
);
console
.
log
(
typeof
this
.
$refs
.
sharePic
.
createAndU
ploadPic
);
this
.
$refs
.
sharePic
.
u
ploadPic
();
this
.
$refs
.
sharePic
.
createAndU
ploadPic
();
},
},
share
()
{
share
()
{
// 分享
// 分享
...
@@ -166,7 +167,6 @@ export default {
...
@@ -166,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