Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
xianyu-ufo-app-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
y.huang
5 years ago
Commit
f6ab76697a69a54bbe929d3912d338d9b3b8f830
2 parents
8d51eb92
d0c6c9ba
master
...
deploy_1019_2108
develop
develop_service
discuss
feature/2019/1230-community-article
feature/2filter
feature/confirm-money
feature/coupon
feature/detail-images-contents
feature/order-address
feature/pay-success-resource
feature/product-detail-tip-show
feature/product_multiImage
feature/qiugou
feature/safeArea
feature/saler_coupon
feature/scroll
feature/search-word
feature/ufo-activitys
feature/ufo-icon
feature/video
hotfix/11
hotfix/detail-imageview-close
hotfix/image
hotfix/income-order-confirm
hotfix/report
hotfix/udid
promotion/order-list
2019111405
trade_btn
tag_1025_1000
tag_1021_1437
feat/product_detail_payment
ROPM_activity_resource
Merge branch 'develop' of
http://git.yoho.cn/fe/xianyu-ufo-app-web
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
126 additions
and
85 deletions
apps/components/order-pay-type/pay-type.vue
apps/entry-client.js
apps/pages/address/address/address.vue
apps/pages/order/buyer-confirm.vue
apps/pages/order/components/confirm/address.vue
apps/pages/order/deliver.vue
apps/pages/order/index.js
apps/pages/order/pay.vue
apps/pages/order/seller-confirm.vue
apps/store/address/address/mutations.js
apps/store/order/order-confirm.js
config/order-api-map.js
doraemon/models/passport.js
apps/components/order-pay-type/pay-type.vue
View file @
f6ab766
...
...
@@ -56,6 +56,12 @@ export default {
desc: {
type: String,
default: ''
},
extra: {
type: Object,
default() {
return {};
}
}
},
components: {
...
...
@@ -76,7 +82,7 @@ export default {
async mounted() {
},
methods: {
...mapOrderAction(['
fetchPayList
']),
...mapOrderAction(['
payAction
']),
show() {
this.$refs.actionSheet.show();
},
...
...
@@ -90,11 +96,37 @@ export default {
pay() {
this.$emit('confirmAction');
const toast = this.$createToast({
txt: '正在调起支付宝'
}).show();
this.payAction({
orderCode: this.orderCode
}).then((result) => {
toast.hide();
this.onSuccess(result);
}).catch((result) => {
toast.hide();
this.onError(result);
});
},
onError(result) {
this.$emit('on-pay-error');
this.$createToast({
txt: result.message,
time: 1500,
type: 'txt'
}).show();
},
onSuccess(result) {
this.hide();
this.$emit('on-pay-success');
this.$router.push({
name: 'OrderPay',
query: {
order_code: this.orderCode,
payment: PAYMENTS.ALIPAY + '_platform'
orderCode: this.orderCode,
payParams: result.data.payParams
}
});
}
...
...
apps/entry-client.js
View file @
f6ab766
...
...
@@ -52,8 +52,15 @@ yoho.auth = async(loginUrl) => {
if
(
user
&&
user
.
uid
)
{
return
user
;
}
else
{
cookie
.
set
(
'third_backurl'
,
location
.
href
);
location
.
href
=
loginUrl
||
`
$
{
location
.
origin
}
/xianyu/
passport
/
login
/
taobao
`
;
cookie
.
set
(
'third_backurl'
,
location
.
href
,
{
domain
:
'.yohobuy.com'
,
path
:
'/'
});
console
.
log
(
location
.
href
)
setTimeout
(()
=>
{
location
.
href
=
loginUrl
||
`
$
{
location
.
origin
}
/xianyu/
passport
/
login
/
taobao
`
;
},
100
);
return
;
}
}
...
...
apps/pages/address/address/address.vue
View file @
f6ab766
...
...
@@ -107,7 +107,7 @@ export default {
}
},
activated() {
this.selectedAddressId = this.$route.query.address
I
d;
this.selectedAddressId = this.$route.query.address
_i
d;
this.fetchUserAddressList();
},
beforeRouteEnter(to, from, next) {
...
...
apps/pages/order/buyer-confirm.vue
View file @
f6ab766
...
...
@@ -61,7 +61,15 @@ export default {
storageId: this.storageId
});
await this.fetchPayment({ skup: this.productDetail.skup });
const payInfo = await this.fetchPayment({ skup: this.productDetail.skup });
if (payInfo?.code !== 200) {
this.$createToast({
time: 2000,
txt: payInfo.message,
type: 'txt'
}).show();
}
if (this.address.address_id) {
await this.compute();
...
...
@@ -154,37 +162,31 @@ export default {
await this.compute();
const
{ data: { orderCode, message } }
= await this.buyPayAction({
const
result
= await this.buyPayAction({
skup: this.productDetail.skup,
addressId: this.address.address_id,
couponCode: get(this.orderDetail, 'recommendedCouponInfo.coupon_code', ''),
promotionId: get(this.orderDetail, 'promotionTips.promotionIds', '')
});
if (!orderCode) {
if (!
result?.data?.
orderCode) {
this.$createToast({
time: 1500,
txt: message,
txt:
result?.
message,
type: 'txt'
}).show();
return;
}
this.$createOrderPayType({
orderCode,
orderCode
: result.data.orderCode
,
price: this.orderDetail.amount,
desc: '金额',
onCloseAction() {
vm.onClose(orderCode);
vm.onClose(
result.data.
orderCode);
},
onPayAction() {
vm.onPay();
}
}).show();
},
onPay() {
console.log('ok');
},
onClose(orderCode) {
this.$router.push({
name: 'orderDetail',
...
...
@@ -199,8 +201,6 @@ export default {
</script>
<style lang="scss" scoped>
@import '~statics/scss/variable.scss';
.footer {
position: absolute;
bottom: 0;
...
...
apps/pages/order/components/confirm/address.vue
View file @
f6ab766
...
...
@@ -36,7 +36,10 @@ export default {
methods: {
onClick() {
this.$router.push({
name: 'address'
name: 'address',
query: {
address_id: this.data.address_id
}
});
}
}
...
...
apps/pages/order/deliver.vue
View file @
f6ab766
...
...
@@ -87,6 +87,8 @@ export default {
this.canScan = true;
}
this.$yoho.auth();
this.fetchAppraiseAddressChangeNotice({orderCode: this.orderCode}).then(res => {
let isChanged = get(res, 'data.isChanged');
let isForceShow = get(res, 'data.isForceShow');
...
...
apps/pages/order/index.js
View file @
f6ab766
...
...
@@ -17,8 +17,8 @@ export default [
path
:
'/xianyu/order/pay.html'
,
component
:
()
=>
import
(
/* webpackChunkName: "order" */
'./pay'
),
props
:
route
=>
({
orderCode
:
route
.
query
.
order_code
,
payment
:
route
.
query
.
payment
,
orderCode
:
route
.
query
.
orderCode
,
payParams
:
route
.
query
.
payParams
,
}),
},
{
...
...
apps/pages/order/pay.vue
View file @
f6ab766
<template>
<div>
{{orderCode}}
{{payment}}
{{orderCode}} <====>
{{payParams}}
</div>
</template>
<script>
const ALIPAY_DOMAIN = 'https://mapi.alipay.com/gateway.do';
export default {
name: 'PayPage',
props: ['orderCode', 'pay
ment
'],
props: ['orderCode', 'pay
Params
'],
mounted() {
},
methods: {
if (this.payParams) {
const url = ALIPAY_DOMAIN + '?' + encodeURIComponent(this.payParams);
}
console.log(url);
}
},
methods: {}
};
</script>
...
...
apps/pages/order/seller-confirm.vue
View file @
f6ab766
...
...
@@ -128,33 +128,24 @@ export default {
return;
}
const { orderCode } = orderResult.data;
this.orderPay = this.$createOrderPayType({
price: this.fee.earnestMoneyStr,
desc: '保证金',
orderCode,
orderCode
: orderResult.data.orderCode
,
onCloseAction() {
vm.onClose();
vm.$router.push({
name: 'orderDetail',
params: {
owner: UserType.sell,
code: orderCode
}
});
},
onPayAction() {
vm.onPay();
vm.onClose(orderResult.data.orderCode);
}
}).show();
},
onClose() {
console.log('close');
onClose(orderCode) {
this.$router.push({
name: 'orderDetail',
params: {
owner: UserType.sell,
code: orderCode
}
});
},
onPay() {
console.log('pay');
}
}
};
</script>
...
...
apps/store/address/address/mutations.js
View file @
f6ab766
...
...
@@ -18,5 +18,8 @@ export default {
},
[
Types
.
SET_USER_ADDRESS_INFO
](
state
,
addressInfo
)
{
state
.
addressInfo
=
addressInfo
||
{};
// 修改根状态
this
.
state
.
order
.
orderConfirm
.
address
=
addressInfo
;
}
};
...
...
apps/store/order/order-confirm.js
View file @
f6ab766
...
...
@@ -117,9 +117,13 @@ export default function() {
}
},
actions
:
{
async
fetchOrderAddress
({
commit
},
payload
)
{
async
fetchOrderAddress
({
commit
,
state
},
payload
)
{
const
orderCount
=
await
this
.
$api
.
get
(
'/api/order/confirm/count'
,
payload
);
if
(
state
.
address
?.
address_id
)
{
return
;
}
if
(
get
(
orderCount
,
'data.cnt'
,
0
))
{
const
addressInfo
=
await
this
.
$api
.
get
(
'/api/order/confirm/address'
);
...
...
@@ -143,8 +147,8 @@ export default function() {
},
async
fetchUserStatus
()
{
const
alipayStatus
=
await
this
.
$api
.
get
(
'/api/order/alipay/status'
);
const
userStatus
=
await
this
.
$api
.
get
(
'/api/order/user/status'
);
// const alipayStatus = await this.$api.get('/api/order/alipay/status');
// const userStatus = await this.$api.get('/api/order/user/status');
},
async
submitOrder
({
commit
},
payload
)
{
...
...
@@ -159,10 +163,12 @@ export default function() {
const
orderInfo
=
await
this
.
$api
.
post
(
'/api/order/confirm/buypayment'
,
{
skup
,
api_version
:
1
});
if
(
orderInfo
.
code
!==
200
)
{
return
;
return
orderInfo
;
}
commit
(
Types
.
FETCH_ORDER_BUY_ORDER
,
orderInfo
.
data
);
return
orderInfo
;
},
async
computeOrder
({
commit
},
{
skup
,
couponCode
,
addressId
,
promotionId
})
{
...
...
@@ -193,6 +199,19 @@ export default function() {
});
return
order
;
},
async
payAction
(
ctx
,
{
orderCode
})
{
const
payResult
=
await
this
.
$api
.
post
(
'/api/order/pay'
,
{
orderCode
,
payment
:
2
});
if
(
payResult
.
code
!==
200
)
{
return
Promise
.
reject
(
payResult
);
}
return
payResult
;
}
},
getters
:
{},
...
...
config/order-api-map.js
View file @
f6ab766
module
.
exports
=
{
'/api/ufo/invite/friendList'
:
{
ufo
:
true
,
api
:
'ufo.invite.code'
,
params
:
{},
},
'/api/ufo/invite/recordDetailList'
:
{
ufo
:
true
,
api
:
'ufo.invite.getInviteSettlementItemList'
,
params
:
{},
},
'/api/yoho/resource'
:
{
service
:
true
,
api
:
'operations/api/v5/resource/get'
,
params
:
{
content_code
:
{
type
:
String
},
},
},
'/api/union/inviteList'
:
{
api
:
'app.union.shareOrder.queryInviteYohoList'
,
params
:
{
page
:
{
type
:
Number
},
size
:
{
type
:
Number
},
},
},
'/api/union/queryUnion'
:
{
api
:
'app.union.shareOrder.queryUnionTypeByUid'
,
params
:
{},
},
// 获取调价商品及尺码信息
'/api/ufo/seller/entryGoodsSizeList'
:
{
auth
:
true
,
...
...
@@ -322,6 +293,15 @@ module.exports = {
params
:
{},
},
// 支付下单
'/api/order/pay'
:
{
ufo
:
true
,
auth
:
true
,
path
:
'payment'
,
api
:
'ufo.order.pay'
,
params
:
{}
},
// 订单物流信息
'/api/order/express'
:
{
ufo
:
true
,
...
...
doraemon/models/passport.js
View file @
f6ab766
const
_
=
require
(
'lodash'
);
const
url
=
require
(
'url'
);
const
uuid
=
require
(
'uuid'
);
const
passport
=
require
(
'passport'
);
const
TaobaoStrategy
=
require
(
'./passport-taobao'
);
...
...
@@ -150,7 +149,7 @@ const login = {
if
(
result
.
code
===
200
)
{
if
(
_
.
get
(
result
,
'data.is_bind'
)
===
'N'
)
{
redirectUrl
=
req
.
cookies
.
third_backurl
?
url
.
parse
(
req
.
cookies
.
third_backurl
)
:
homePage
;
redirectUrl
=
req
.
cookies
.
third_backurl
?
req
.
cookies
.
third_backurl
:
homePage
;
redirectUrl
+=
redirectUrl
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
;
redirectUrl
+=
'bind_code='
+
encodeURIComponent
(
aes
.
dynamicEncryption
(
`
taobao
::
$
{
user
.
open_uid
}
`
));
}
else
if
(
+
_
.
get
(
result
,
'data.uid'
)
>
0
)
{
...
...
@@ -160,7 +159,7 @@ const login = {
req
,
res
}).
finally
(()
=>
{
let
refer
=
req
.
cookies
.
third_backurl
?
url
.
parse
(
req
.
cookies
.
third_backurl
)
:
homePage
;
let
refer
=
req
.
cookies
.
third_backurl
?
req
.
cookies
.
third_backurl
:
homePage
;
return
res
.
redirect
(
refer
);
});
...
...
Please
register
or
login
to post a comment