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
f96e4f7c
Commit
f96e4f7c
authored
Sep 24, 2021
by
beisir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:测试app分享环境
parent
6a49e2f9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
147 deletions
+32
-147
utils.service.js
src/service/utils.service.js
+1
-1
index.vue
src/views/goodsList/index.vue
+2
-1
index.vue
src/views/orderList/index.vue
+29
-145
No files found.
src/service/utils.service.js
View file @
f96e4f7c
...
...
@@ -379,5 +379,5 @@ export function appShareEventChange({ title, desc, link, imgUrl, posterUrl }) {
}
}
};
Bridge
.
showShareView
(
data
);
js
Bridge
.
showShareView
(
data
);
}
src/views/goodsList/index.vue
View file @
f96e4f7c
...
...
@@ -86,7 +86,6 @@ import { setAppTitleColor } from '@/service/utils.service';
import
{
registeredEvents
}
from
'
@/service/sa.service
'
;
import
{
isNull
}
from
'
@/service/validation.service
'
;
import
config
from
'
@/config
'
;
console
.
log
(
config
.
localHost
);
let
topicIndex
;
export
default
{
// eslint-disable-next-line vue/name-property-casing
...
...
@@ -196,6 +195,7 @@ export default {
async
openShareEvent
()
{
const
activity_id
=
this
.
activityId
;
const
shareInfo
=
await
this
.
getShareData
();
console
.
log
(
shareInfo
);
this
.
$store
.
dispatch
(
'
goods_share_open
'
,
shareInfo
);
registeredEvents
(
'
H5_GroupZeroYuanPurchaseActivityPageSharePopupBtnClick
'
,
{
activity_id
...
...
@@ -331,6 +331,7 @@ async function getActivityList(urlQuery, next) {
vm
.
activityId
=
activityId
;
vm
.
goodsTemp
=
t
;
localStorage
.
set
(
'
activityId
'
,
activityId
);
vm
.
setTitleColor
(
t
.
bgcolor
);
vm
.
getGoodsList
(
true
);
vm
.
reload
=
false
;
});
...
...
src/views/orderList/index.vue
View file @
f96e4f7c
...
...
@@ -19,25 +19,16 @@
</cr-tab>
</cr-tabs>
<share-pic
ref=
"sharePic"
:share-pic-data=
"sharePicData"
@
outputPicUrl=
"outputPicUrl"
/>
<!--
<cr-action-sheet
v-model=
"showExpressPopup"
title=
"请选择物流单号"
cancel-txt=
"关闭"
round
:actions=
"expressActions"
@
click=
"toExpress"
/>
-->
</div>
</
template
>
<
script
>
import
groupBuyApi
from
'
@/api/groupBuy
'
;
import
List
from
'
./components/List
'
;
import
{
isApp
}
from
'
@/service/validation.service
'
;
import
localStorage
from
'
@/service/localStorage.service
'
;
import
{
EventBus
}
from
'
@/service/utils.service
'
;
import
{
isApp
,
isWxMp
}
from
'
@/service/validation.service
'
;
import
sharePic
from
'
@/components/sharePic
'
;
import
qs
from
'
qs
'
;
import
MpBridge
from
'
@/service/mp
'
;
import
config
from
'
@/config
'
;
const
commonParams
=
{
loading
:
false
,
finished
:
false
,
...
...
@@ -98,23 +89,26 @@ export default {
mounted
()
{
this
.
getstatusQuery
();
this
.
getList
();
// this.onShareEventChange();
},
beforeDestroy
()
{
console
.
log
(
'
订单页EventBusClose
'
);
const
name
=
this
.
$route
.
name
;
EventBus
.
$off
(
`shareClickItem
${
name
}
`
);
},
created
()
{
this
.
nativeBridge
=
new
MpBridge
();
},
methods
:
{
outputPicUrl
(
posterUrl
)
{
async
outputPicUrl
(
posterUrl
)
{
if
(
isApp
)
{
// 如果是app环境直接调用app方法
const
shareInfo
=
await
this
.
getShareData
({
...
this
.
sharePicData
,
posterUrl
});
this
.
$store
.
dispatch
(
'
goods_share_open
'
,
shareInfo
);
}
if
(
isWxMp
)
{
// 如果是小程序则默认跳转小程序的海报保存页面
this
.
nativeBridge
.
openNewUrl
({
newUrl
:
`/pages/goodshare/index?url=
${
encodeURIComponent
(
JSON
.
stringify
(
posterUrl
))}
`
});
}
},
async
getShareData
(
shareInfo
)
{
// 处理详情页面分享数据
const
linkPath
=
qs
.
stringify
({
h
:
0
,
skuNo
:
shareInfo
.
skuNo
,
...
...
@@ -124,21 +118,20 @@ export default {
templateId
:
shareInfo
.
templateId
,
templateDetailId
:
shareInfo
.
templateId
});
const
detailUrl
=
`
${
window
.
location
.
origin
}
/groupBuy/skuInfoSmallPic?
${
linkPath
}
`
;
const
detailUrl
=
`
${
config
.
localHost
}
/groupBuy/skuInfoSmallPic?
${
linkPath
}
`
;
return
Promise
.
resolve
({
title
:
shareInfo
.
skuName
,
desc
:
''
,
link
:
`pages/webview/webview?url=
${
encodeURIComponent
(
JSON
.
stringify
(
detailUrl
))}
`
,
// 页面地址
imgUrl
:
shareInfo
.
skuImg
// 图片地
imgUrl
:
shareInfo
.
skuImg
,
// 图片地
posterUrl
:
shareInfo
.
posterUrl
});
},
async
onShareEventChange
({
ev
,
nativeBridge
})
{
const
vm
=
this
;
console
.
log
(
'
订单页EventBusOpen
'
);
const
shareDic
=
await
vm
.
getShareData
(
vm
.
sharePicData
);
console
.
log
(
shareDic
);
const
shareDic
=
await
this
.
getShareData
(
this
.
sharePicData
);
if
(
ev
===
'
pic
'
)
{
// 分享海报跳转小程序海报分享页面
vm
.
$refs
.
sharePic
.
createAndUploadPic
();
this
.
$refs
.
sharePic
.
createAndUploadPic
();
}
if
(
ev
===
'
weixin
'
)
{
// 分享朋友派发微信postMessage事件
...
...
@@ -165,9 +158,15 @@ export default {
async
openShareEvent
(
info
)
{
try
{
const
[
res
]
=
await
groupBuyApi
.
getGroupShareInfo
(
info
.
orderNo
);
console
.
log
(
res
);
this
.
sharePicData
=
res
;
if
(
isWxMp
)
{
// 如果是微信弹出底部框
this
.
$store
.
dispatch
(
'
goods_share_open
'
);
}
if
(
isApp
)
{
// 如果是app则先调用创建海报组件
this
.
$refs
.
sharePic
.
createAndUploadPic
();
}
}
catch
(
err
)
{
console
.
log
(
err
);
}
...
...
@@ -183,121 +182,6 @@ export default {
break
;
}
},
orderRefundPopup
(
cashCouponCancelNote
,
showCashCouponCancelNote
)
{
let
tips
=
{
message
:
this
.
currentOrder
.
cancelNote
||
'
宝贝马上就要发货了,您真的要取消吗?
'
,
confirmButtonText
:
'
仍要取消
'
,
cancelButtonText
:
'
留下商品
'
,
onConfirm
:
()
=>
{
this
.
showCancelPopup
=
true
;
}
};
if
(
this
.
currentOrder
.
skuList
[
0
].
skuSource
===
5
||
this
.
currentOrder
.
skuList
[
0
].
skuSource
===
6
)
{
tips
=
{
message
:
'
该商品暂不支持取消,您可以在收货时直接拒收,钱款原路退回付款账户中
'
,
confirmButtonText
:
'
知道了
'
,
showCancelButton
:
false
};
}
if
(
showCashCouponCancelNote
)
{
tips
=
{
message
:
cashCouponCancelNote
,
confirmButtonText
:
'
确认退货
'
,
cancelButtonText
:
'
不退了
'
,
onConfirm
:
()
=>
{
this
.
showCancelPopup
=
true
;
}
};
}
this
.
$dialog
(
tips
);
},
orderCancelPopup
()
{
this
.
showCancelPopup
=
true
;
},
// 售后中
toRefund
()
{
if
(
this
.
currentOrder
.
currentSku
.
havingService
)
{
localStorage
.
set
(
'
orderInfo
'
,
this
.
currentOrder
);
this
.
$router
.
push
({
name
:
'
refundDetail
'
});
return
;
}
if
([
2
,
5
,
6
].
indexOf
(
this
.
currentOrder
.
currentSku
.
skuSource
)
>
-
1
)
{
this
.
$dialog
({
message
:
'
您购买的商品确认收货后才可以申请售后哦!
'
,
confirmButtonText
:
'
知道了
'
,
showCancelButton
:
false
});
return
;
}
},
toPay
()
{
this
.
$router
.
push
({
name
:
'
pay
'
,
query
:
{
orderNo
:
this
.
currentOrder
.
orderNo
}
});
},
toGoods
()
{
this
.
$router
.
push
({
path
:
'
/goodDetail
'
,
query
:
{
skuNo
:
this
.
currentOrder
.
skuList
[
0
].
skuNo
}
});
},
orderConfirmPopup
()
{
if
(
!
this
.
currentOrder
.
orderNo
)
return
;
// this.$dialog({
// title: '确定该订单已收货吗?',
// onConfirm: () => {
// orderApi
// .orderConfirm({
// orderNo: this.currentOrder.orderNo,
// status: 41
// })
// .then(res => {
// if (res[0]) {
// this.updateCurrentOrder(41, '交易完成');
// this.$toast('操作成功');
// }
// });
// }
// });
},
handleCancelstatus
()
{
this
.
updateCurrentOrder
(
51
,
'
交易关闭
'
);
},
updateCurrentOrder
(
status
,
txt
)
{
this
.
$set
(
this
.
navList
[
this
.
currentTab
].
list
[
this
.
currentOrder
.
index
],
`orderStatus`
,
status
);
this
.
$set
(
this
.
navList
[
this
.
currentTab
].
list
[
this
.
currentOrder
.
index
],
`orderStatusText`
,
txt
);
},
expressActionsCheck
()
{
const
{
expressInfoList
}
=
this
.
currentOrder
;
if
(
expressInfoList
.
length
>
1
)
{
this
.
expressActions
=
expressInfoList
.
map
(
item
=>
{
return
{
name
:
item
.
deliveryNo
,
deliveryNo
:
item
.
deliveryNo
,
expressCompanyCode
:
item
.
expressCompanyCode
};
});
this
.
showExpressPopup
=
true
;
}
else
{
this
.
toExpress
(
expressInfoList
[
0
]);
}
},
toExpress
(
item
)
{
this
.
$router
.
push
({
path
:
'
/expressDetail
'
,
query
:
{
...
item
,
deliveryOrderId
:
this
.
currentOrder
.
orderNo
}
});
},
orderNotify
()
{
this
.
$toast
.
success
(
'
已通知卖家
'
);
},
setNavListData
(
key
,
val
)
{
this
.
$set
(
this
.
navList
[
this
.
currentTab
],
key
,
val
);
},
...
...
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