Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
yoho-miniapp-ufo
·
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
陈峰
6 years ago
Commit
4f7eae7546d3323718cd0786d0dd9f8ae3746cd3
2 parents
be8ee3e2
44d85c6f
Merge branch 'release/6.9.5' into 'master'
Release/6.9.5 See merge request
!17
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
103 additions
and
18 deletions
.npmrc
project.config.json
src/config.js
src/pages/order/orderConfirm/components/productCell.wxml
src/pages/order/orderConfirm/orderConfirm.js
src/pages/order/orderConfirm/orderConfirm.wxml
src/pages/order/orderService.js
src/pages/orderDetail/index.wxml
.npmrc
0 → 100644
View file @
4f7eae7
registry=http://npm.yohops.com
...
...
project.config.json
View file @
4f7eae7
...
...
@@ -9,10 +9,22 @@
"postcss"
:
false
,
"minified"
:
false
,
"newFeature"
:
true
,
"autoAudits"
:
false
"coverView"
:
true
,
"nodeModules"
:
false
,
"autoAudits"
:
false
,
"checkInvalidKey"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"babelSetting"
:
{
"ignore"
:
[],
"disablePlugins"
:
[],
"outputPath"
:
""
}
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.2.4"
,
"simulatorType"
:
"wechat"
,
"simulatorPluginLibVersion"
:
{},
"condition"
:
{
"search"
:
{
"current"
:
-1
,
...
...
@@ -30,7 +42,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
1
4
,
"current"
:
1
5
,
"list"
:
[
{
"id"
:
-1
,
...
...
@@ -124,6 +136,13 @@
"pathName"
:
"pages/productDetail/index"
,
"query"
:
"q=https%3A%2F%2Fo.yohobuy.com%2Fufo%3Fp%3D517449%2C1%26skup%3D517449%26skn%3D10003791&scancode_time=1553151155"
,
"scene"
:
1011
},
{
"id"
:
15
,
"name"
:
"定单确认"
,
"pathName"
:
"pages/order/orderConfirm/orderConfirm"
,
"query"
:
"product_id=10006681&skup=1629313&user_activity_id=47403"
,
"scene"
:
1011
}
]
}
...
...
src/config.js
View file @
4f7eae7
...
...
@@ -4,13 +4,21 @@ const appid = 'wxc677c88385762287'
export
default
{
development
:
{
domains
:
{
// production
// test
api
:
'http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway'
,
yohoApi
:
'http://api-test3.dev.yohocorp.com'
,
yohoLogin
:
'http://
java-yoho-wechat.test3.ingress
.dev.yohocorp.com'
,
yohoLogin
:
'http://
api-test3
.dev.yohocorp.com'
,
activityHost
:
'http://yoho-activity-platform.test3.ingress.dev.yohocorp.com'
,
reportHost
:
'https://app.yoho.cn/collect/v3'
,
yasHost
:
'https://analysis.yohobuy.com/yas_mobile'
// production
// api: 'https://2.yohobuy.com',
// yohoApi: 'https://api.yoho.cn',
// yohoLogin: 'https://api.yoho.cn',
// activityHost: 'https://action.yoho.cn',
// reportHost: 'https://app.yoho.cn/collect/v3',
// yasHost: 'https://analysis.yohobuy.com/yas_mobile'
},
apiParams
:
{
client_type
:
'miniapp'
,
...
...
src/pages/order/orderConfirm/components/productCell.wxml
View file @
4f7eae7
...
...
@@ -6,6 +6,6 @@
<text class="productPrice">¥{{productInfo.goodPrice}}</text>
<text class="productName">{{productInfo.productName}}</text>
<text class="productColor" wx:if="{{isStore}}">{{productInfo.colorName + ',' + productInfo.sizeName + ',' +productInfo.skup}}</text>
<text class="productColor" wx:else>{{
productInfo.colorName + ',' + productInfo.sizeName
}}</text>
<text class="productColor" wx:else>{{
(productInfo.colorName || '') + ',' + (productInfo.sizeName || '')
}}</text>
</view>
</view>
...
...
src/pages/order/orderConfirm/orderConfirm.js
View file @
4f7eae7
...
...
@@ -9,10 +9,12 @@ import orderService from '../orderService'
import
{
getImgUrl
}
from
'../../../utils'
;
import
router
from
'../../../router/index.js'
import
{
prePay
}
from
'../../order/wxpay.js'
import
Yas
from
'../../../utils/yas'
;
import
Yas
from
'../../../utils/yas'
let
yas
;
const
ACTIVITY_TYPE
=
18
;
// 砍价
const
api
=
new
orderService
();
Page
({
...
...
@@ -26,23 +28,36 @@ Page({
unCheckImage
:
'../../../assets/images/unselect@2x.png'
,
isStore
:
0
,
storeId
:
0
,
skup
:
''
,
coupons
:
[],
selectCouponCode
:
''
,
selectCouponAmount
:
''
,
selectingCoupon
:
false
selectingCoupon
:
false
,
user_activity_id
:
''
// 有值代表砍价
},
onLoad
:
async
function
(
option
)
{
yas
=
new
Yas
(
this
);
yas
.
pageOpenReport
();
this
.
setData
({
isStore
:
Number
(
option
.
is_store
)
||
0
,
storeId
:
option
.
store_id
||
0
,
skup
:
option
.
skup
||
''
,
product_id
:
option
.
product_id
||
''
,
hasAddress
:
false
hasAddress
:
false
,
user_activity_id
:
option
.
user_activity_id
||
''
})
await
this
.
fetchData
(
option
.
is_store
);
if
(
!
option
.
is_store
)
{
},
async
onShow
()
{
let
userInfo
=
wx
.
getStorageSync
(
'userInfo'
);
if
(
!
(
userInfo
&&
userInfo
.
uid
&&
userInfo
.
session_key
))
{
router
.
go
(
'nativeLogin'
);
return
;
}
await
this
.
fetchData
(
this
.
data
.
isStore
);
if
(
!
this
.
data
.
isStore
)
{
await
this
.
fetchAddress
()
}
},
...
...
@@ -72,10 +87,19 @@ Page({
coupon_code
:
code
},
()
=>
wx
.
hideLoading
());
}
else
{
info
=
await
api
.
orderCompute
(
{
const
params
=
{
skup
:
this
.
data
.
skup
,
coupon_code
:
code
},
()
=>
wx
.
hideLoading
());
};
if
(
this
.
data
.
user_activity_id
)
{
Object
.
assign
(
params
,
{
user_activity_id
:
this
.
data
.
user_activity_id
,
activity_type
:
ACTIVITY_TYPE
});
}
info
=
await
api
.
orderCompute
(
params
,
()
=>
wx
.
hideLoading
());
}
}
catch
(
e
)
{}
...
...
@@ -99,6 +123,14 @@ Page({
skup
:
this
.
data
.
skup
,
store_id
:
this
.
data
.
storeId
}
if
(
this
.
data
.
user_activity_id
)
{
Object
.
assign
(
params
,
{
user_activity_id
:
this
.
data
.
user_activity_id
,
activity_type
:
ACTIVITY_TYPE
})
}
let
data
;
if
(
isStore
)
{
data
=
await
api
.
createOfflinePayment
(
params
,
()
=>
wx
.
hideLoading
())
...
...
@@ -110,7 +142,17 @@ Page({
})
data
.
promotionFormulaList
.
splice
(
index
,
1
)
}
else
{
data
=
await
api
.
createPaymentInfo
(
params
,
()
=>
wx
.
hideLoading
())
try
{
data
=
await
api
.
createPaymentInfo
(
params
,
()
=>
wx
.
hideLoading
())
}
catch
(
e
)
{
console
.
log
(
e
)
wx
.
showModal
({
title
:
'失败'
,
content
:
e
.
message
,
showCancel
:
false
,
})
return
;
}
}
api
.
orderSelectCoupon
(
this
.
data
.
skup
,
()
=>
wx
.
hideLoading
()).
then
(
data
=>
{
...
...
@@ -191,11 +233,19 @@ Page({
let
skup
=
this
.
data
.
skup
let
channelNo
=
''
;
let
couponCode
=
this
.
data
.
selectCouponCode
||
''
;
let
extra
=
null
;
if
(
this
.
data
.
user_activity_id
)
{
extra
=
{
user_activity_id
:
this
.
data
.
user_activity_id
,
activity_type
:
ACTIVITY_TYPE
};
}
// wx.showLoading({
// title: '',
// })
data
=
await
api
.
buyerSubmit
(
skup
,
channelNo
,
addressId
,
couponCode
,
()
=>
wx
.
hideLoading
());
data
=
await
api
.
buyerSubmit
(
{
skup
,
channelNo
,
addressId
,
couponCode
,
extra
}
,
()
=>
wx
.
hideLoading
());
}
if
(
data
&&
data
.
orderCode
)
{
let
skup
=
this
.
data
.
skup
...
...
src/pages/order/orderConfirm/orderConfirm.wxml
View file @
4f7eae7
...
...
@@ -6,7 +6,8 @@
wx:else></storeAddress>
<productCell productInfo="{{good}}" isStore="{{isStore === 1}}"></productCell>
<couponCell bindselect="showSelectCoupon" amount="{{selectCouponAmount}}"></couponCell>
<!-- // 砍价没有优惠券 -->
<couponCell wx:if="{{!user_activity_id}}" bindselect="showSelectCoupon" amount="{{selectCouponAmount}}"></couponCell>
<priceCell promotionFormulaList="{{promotionFormulaList}}" damagesDesc="{{damagesDesc}}" isStore="{{isStore === 1}}"></priceCell>
<payDeliveryCell paymentWay="{{paymentWay}}" deliveryWay="{{deliveryWay}}"></payDeliveryCell>
</scroll-view>
...
...
src/pages/order/orderService.js
View file @
4f7eae7
...
...
@@ -56,15 +56,15 @@ export default class orderService extends BaseService {
})
}
async
buyerSubmit
(
skup
,
channelNo
=
'2919'
,
addressId
,
couponCode
,
complete
)
{
async
buyerSubmit
(
{
skup
,
channelNo
=
'2919'
,
addressId
,
couponCode
,
complete
,
extra
=
{}}
)
{
return
await
this
.
GET
({
return
await
this
.
GET
(
Object
.
assign
(
{
method
:
BUYER_SUBMIT
,
skup
,
channelNo
,
addressId
,
coupon_code
:
couponCode
||
''
},
{
},
extra
),
{
path
:
'/shopping'
,
complete
})
...
...
src/pages/orderDetail/index.wxml
View file @
4f7eae7
...
...
@@ -38,6 +38,12 @@
<text class='order-detail-sum-grey-txt'>商品金额:</text>
<text class='order-detail-sum-grey-txt'>¥{{data.priceInfo.goodPrice}}</text>
</view>
<view class='order-detail-count-view' wx:if="{{data.priceInfo.activityCutPrice}}">
<block wx:if="{{data.priceInfo.activityCutPrice != '0.00' && data.priceInfo.activityCutPrice != '0'}}">
<text class='order-detail-sum-grey-txt'>活动优惠:</text>
<text class='order-detail-sum-grey-txt'>-¥{{data.priceInfo.activityCutPrice}}</text>
</block>
</view>
<view class='order-detail-count-view' wx:if="{{data.isOffline !== 'Y'}}">
<text class='order-detail-sum-grey-txt'>运费:</text>
<text class='order-detail-sum-grey-txt'>¥{{data.priceInfo.feePrice}}</text>
...
...
Please
register
or
login
to post a comment