Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
高淑倩
7-Eleven
Commits
92a93d4b
Commit
92a93d4b
authored
Mar 20, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化功能
parent
8daeb66f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
16 deletions
+85
-16
app.json
src/app.json
+4
-0
index.js
src/config/index.js
+19
-2
project.config.json
src/project.config.json
+3
-3
subPage.js
src/subPackage/page/pages/subPage/subPage.js
+24
-11
util.js
src/utils/util.js
+33
-0
wxService.js
src/utils/wxService.js
+2
-0
No files found.
src/app.json
View file @
92a93d4b
...
@@ -132,6 +132,10 @@
...
@@ -132,6 +132,10 @@
"contactPlugin"
:
{
"contactPlugin"
:
{
"version"
:
"1.3.0"
,
"version"
:
"1.3.0"
,
"provider"
:
"wx104a1a20c3f81ec2"
"provider"
:
"wx104a1a20c3f81ec2"
},
"live-player-plugin"
:
{
"version"
:
"1.0.2"
,
"provider"
:
"wx2b03c6e691cd7370"
}
}
},
},
"permission"
:
{
"permission"
:
{
...
...
src/config/index.js
View file @
92a93d4b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id
// 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应
// app.js 中brandId 修改为对应
const
PROJECT_ENV
=
'
test
'
// 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
const
PROJECT_ENV
=
'
prod
'
// 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 :
//仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4
//3001 3001 , wx313ec36b710125d4
//2006 泰华 , wx40fec8944623c8b3
//2006 泰华 , wx40fec8944623c8b3
...
@@ -24,7 +24,7 @@ const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门
...
@@ -24,7 +24,7 @@ const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门
//2992 山东盛联微商城 wx53dedc202ae0d0c2
//2992 山东盛联微商城 wx53dedc202ae0d0c2
//2002 巴黎贝甜 wx21968cb3a486d4ab
//2002 巴黎贝甜 wx21968cb3a486d4ab
const
BRANCH_ID
=
1002
const
BRANCH_ID
=
2006
const
isMall
=
true
const
isMall
=
true
// const needMock = '' //
// const needMock = '' //
...
@@ -70,6 +70,7 @@ const prod_brand_config = {
...
@@ -70,6 +70,7 @@ const prod_brand_config = {
orderingMustOpenCard
:
false
,
//下单是否必须卡开
orderingMustOpenCard
:
false
,
//下单是否必须卡开
canUseWechatAddress
:
true
,
//是否使用获取微信地址
canUseWechatAddress
:
true
,
//是否使用获取微信地址
isOpenSelfMention
:
true
,
// 是否开启门店自提
isOpenSelfMention
:
true
,
// 是否开启门店自提
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
isNeedGetLocation
:
true
,
//是否开启小程序获取位置(提交订单时获取门店信息)
isNeedGetLocation
:
true
,
//是否开启小程序获取位置(提交订单时获取门店信息)
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
shareTitle
:
'【舞象星品荟-社交商城】'
,
shareTitle
:
'【舞象星品荟-社交商城】'
,
...
@@ -90,6 +91,7 @@ const prod_brand_config = {
...
@@ -90,6 +91,7 @@ const prod_brand_config = {
hasLiveVideo
:
true
,
//是否有直播功能
hasLiveVideo
:
true
,
//是否有直播功能
orderingMustOpenCard
:
true
,
orderingMustOpenCard
:
true
,
isOpenSelfMention
:
true
,
// 是否开启门店自提
isOpenSelfMention
:
true
,
// 是否开启门店自提
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
shareTitle
:
'【泰华微商城】'
,
shareTitle
:
'【泰华微商城】'
,
...
@@ -108,6 +110,7 @@ const prod_brand_config = {
...
@@ -108,6 +110,7 @@ const prod_brand_config = {
isMall
:
isMall
,
isMall
:
isMall
,
hasLiveVideo
:
false
,
//是否有直播功能
hasLiveVideo
:
false
,
//是否有直播功能
orderingMustOpenCard
:
true
,
orderingMustOpenCard
:
true
,
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
...
@@ -127,6 +130,7 @@ const prod_brand_config = {
...
@@ -127,6 +130,7 @@ const prod_brand_config = {
isMall
:
isMall
,
isMall
:
isMall
,
hasLiveVideo
:
false
,
//是否有直播功能
hasLiveVideo
:
false
,
//是否有直播功能
orderingMustOpenCard
:
false
,
orderingMustOpenCard
:
false
,
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
...
@@ -146,6 +150,7 @@ const prod_brand_config = {
...
@@ -146,6 +150,7 @@ const prod_brand_config = {
hasLiveVideo
:
false
,
//是否有直播功能
hasLiveVideo
:
false
,
//是否有直播功能
isMall
:
isMall
,
isMall
:
isMall
,
orderingMustOpenCard
:
false
,
orderingMustOpenCard
:
false
,
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
...
@@ -166,6 +171,7 @@ const prod_brand_config = {
...
@@ -166,6 +171,7 @@ const prod_brand_config = {
isMall
:
isMall
,
// 商城或门户 true 商城 false 门户
isMall
:
isMall
,
// 商城或门户 true 商城 false 门户
orderingMustOpenCard
:
false
,
//下单是否必须卡开
orderingMustOpenCard
:
false
,
//下单是否必须卡开
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
shareTitle
:
'【LA RUTA DE VIA】'
,
//分享海报上显示的小程序title
shareTitle
:
'【LA RUTA DE VIA】'
,
//分享海报上显示的小程序title
...
@@ -185,6 +191,7 @@ const prod_brand_config = {
...
@@ -185,6 +191,7 @@ const prod_brand_config = {
canUseWechatAddress
:
false
,
//是否使用获取微信地址
canUseWechatAddress
:
false
,
//是否使用获取微信地址
orderingMustOpenCard
:
false
,
orderingMustOpenCard
:
false
,
guiderCanScanQrcode
:
false
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
false
,
//导购是否有扫一扫功能
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
shareTitle
:
'【hotwind热风微商城】'
,
shareTitle
:
'【hotwind热风微商城】'
,
...
@@ -203,6 +210,7 @@ const prod_brand_config = {
...
@@ -203,6 +210,7 @@ const prod_brand_config = {
hasLiveVideo
:
true
,
//是否有直播功能
hasLiveVideo
:
true
,
//是否有直播功能
isMall
:
isMall
,
isMall
:
isMall
,
orderingMustOpenCard
:
true
,
orderingMustOpenCard
:
true
,
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
isOpenSelfMention
:
true
,
// 是否开启门店自提
isOpenSelfMention
:
true
,
// 是否开启门店自提
isNeedGetLocation
:
true
,
//是否开启小程序获取位置(提交订单时获取门店信息)
isNeedGetLocation
:
true
,
//是否开启小程序获取位置(提交订单时获取门店信息)
...
@@ -222,6 +230,7 @@ const prod_brand_config = {
...
@@ -222,6 +230,7 @@ const prod_brand_config = {
isMall
:
isMall
,
isMall
:
isMall
,
canUseWechatAddress
:
true
,
//是否使用获取微信地址
canUseWechatAddress
:
true
,
//是否使用获取微信地址
orderingMustOpenCard
:
false
,
orderingMustOpenCard
:
false
,
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
...
@@ -238,6 +247,7 @@ const prod_brand_config = {
...
@@ -238,6 +247,7 @@ const prod_brand_config = {
contactUsPluginId
:
''
,
contactUsPluginId
:
''
,
hasLiveVideo
:
false
,
//是否有直播功能
hasLiveVideo
:
false
,
//是否有直播功能
hasTrial
:
false
,
hasTrial
:
false
,
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
canUseWechatAddress
:
true
,
//是否使用获取微信地址
canUseWechatAddress
:
true
,
//是否使用获取微信地址
isMall
:
isMall
,
isMall
:
isMall
,
orderingMustOpenCard
:
false
,
orderingMustOpenCard
:
false
,
...
@@ -260,6 +270,7 @@ const prod_brand_config = {
...
@@ -260,6 +270,7 @@ const prod_brand_config = {
hasLiveVideo
:
false
,
//是否有直播功能
hasLiveVideo
:
false
,
//是否有直播功能
canUseWechatAddress
:
true
,
//是否使用获取微信地址
canUseWechatAddress
:
true
,
//是否使用获取微信地址
orderingMustOpenCard
:
false
,
orderingMustOpenCard
:
false
,
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
...
@@ -279,6 +290,7 @@ const prod_brand_config = {
...
@@ -279,6 +290,7 @@ const prod_brand_config = {
hasLiveVideo
:
false
,
//是否有直播功能
hasLiveVideo
:
false
,
//是否有直播功能
canUseWechatAddress
:
true
,
//是否使用获取微信地址
canUseWechatAddress
:
true
,
//是否使用获取微信地址
orderingMustOpenCard
:
false
,
orderingMustOpenCard
:
false
,
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
isNeedGetLocation
:
false
,
//是否开启小程序获取位置(提交订单时获取门店信息)
...
@@ -297,6 +309,7 @@ const prod_brand_config = {
...
@@ -297,6 +309,7 @@ const prod_brand_config = {
hasTrial
:
false
,
hasTrial
:
false
,
canUseWechatAddress
:
true
,
//是否使用获取微信地址
canUseWechatAddress
:
true
,
//是否使用获取微信地址
isMall
:
isMall
,
isMall
:
isMall
,
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
orderingMustOpenCard
:
true
,
orderingMustOpenCard
:
true
,
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
isOpenSelfMention
:
false
,
// 是否开启门店自提
isOpenSelfMention
:
false
,
// 是否开启门店自提
...
@@ -316,6 +329,7 @@ const prod_brand_config = {
...
@@ -316,6 +329,7 @@ const prod_brand_config = {
isMall
:
isMall
,
isMall
:
isMall
,
canUseWechatAddress
:
true
,
//是否使用获取微信地址
canUseWechatAddress
:
true
,
//是否使用获取微信地址
orderingMustOpenCard
:
true
,
orderingMustOpenCard
:
true
,
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
isOpenSelfMention
:
true
,
// 是否开启门店自提
isOpenSelfMention
:
true
,
// 是否开启门店自提
hasLiveVideo
:
false
,
//是否有直播功能
hasLiveVideo
:
false
,
//是否有直播功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
...
@@ -335,6 +349,7 @@ const prod_brand_config = {
...
@@ -335,6 +349,7 @@ const prod_brand_config = {
isMall
:
isMall
,
isMall
:
isMall
,
canUseWechatAddress
:
true
,
//是否使用获取微信地址
canUseWechatAddress
:
true
,
//是否使用获取微信地址
orderingMustOpenCard
:
false
,
orderingMustOpenCard
:
false
,
canRefundDaysAfterDelivery
:
15
,
//发货后多少天之内可显示申请退款按钮
isOpenSelfMention
:
true
,
// 是否开启门店自提
isOpenSelfMention
:
true
,
// 是否开启门店自提
hasLiveVideo
:
false
,
//是否有直播功能
hasLiveVideo
:
false
,
//是否有直播功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
guiderCanScanQrcode
:
true
,
//导购是否有扫一扫功能
...
@@ -436,6 +451,7 @@ let isNeedGetLocation = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].isN
...
@@ -436,6 +451,7 @@ let isNeedGetLocation = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].isN
let
canUseWechatAddress
=
PROJECT_ENV
==
'prod'
?
prod_brand_config
[
BRANCH_ID
].
canUseWechatAddress
:
true
;
let
canUseWechatAddress
=
PROJECT_ENV
==
'prod'
?
prod_brand_config
[
BRANCH_ID
].
canUseWechatAddress
:
true
;
let
hasLiveVideo
=
PROJECT_ENV
==
'prod'
?
prod_brand_config
[
BRANCH_ID
].
hasLiveVideo
:
false
;
let
hasLiveVideo
=
PROJECT_ENV
==
'prod'
?
prod_brand_config
[
BRANCH_ID
].
hasLiveVideo
:
false
;
let
guiderCanScanQrcode
=
PROJECT_ENV
==
'prod'
?
prod_brand_config
[
BRANCH_ID
].
guiderCanScanQrcode
:
true
;
let
guiderCanScanQrcode
=
PROJECT_ENV
==
'prod'
?
prod_brand_config
[
BRANCH_ID
].
guiderCanScanQrcode
:
true
;
let
canRefundDaysAfterDelivery
=
PROJECT_ENV
==
'prod'
?
prod_brand_config
[
BRANCH_ID
].
canRefundDaysAfterDelivery
:
15
;
//配置信息导出
//配置信息导出
const
envInfo
=
(()
=>
{
const
envInfo
=
(()
=>
{
return
{
return
{
...
@@ -459,6 +475,7 @@ const envInfo = (() => {
...
@@ -459,6 +475,7 @@ const envInfo = (() => {
canUseWechatAddress
:
canUseWechatAddress
,
canUseWechatAddress
:
canUseWechatAddress
,
hasLiveVideo
:
hasLiveVideo
,
hasLiveVideo
:
hasLiveVideo
,
guiderCanScanQrcode
:
guiderCanScanQrcode
,
guiderCanScanQrcode
:
guiderCanScanQrcode
,
canRefundDaysAfterDelivery
:
canRefundDaysAfterDelivery
,
}
}
})()
})()
...
...
src/project.config.json
View file @
92a93d4b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
},
},
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.8.2"
,
"libVersion"
:
"2.8.2"
,
"appid"
:
"wx
ac09792264c49b5c
"
,
"appid"
:
"wx
40fec8944623c8b3
"
,
"projectname"
:
"%E5%BE%AE%E5%95%86%E5%9F%8E"
,
"projectname"
:
"%E5%BE%AE%E5%95%86%E5%9F%8E"
,
"debugOptions"
:
{
"debugOptions"
:
{
"hidedInDevtools"
:
[]
"hidedInDevtools"
:
[]
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
"list"
:
[]
"list"
:
[]
},
},
"miniprogram"
:
{
"miniprogram"
:
{
"current"
:
81
,
"current"
:
13
,
"list"
:
[
"list"
:
[
{
{
"id"
:
-1
,
"id"
:
-1
,
...
@@ -128,7 +128,7 @@
...
@@ -128,7 +128,7 @@
"id"
:
13
,
"id"
:
13
,
"name"
:
"subPage"
,
"name"
:
"subPage"
,
"pathName"
:
"subPackage/page/pages/subPage/subPage"
,
"pathName"
:
"subPackage/page/pages/subPage/subPage"
,
"query"
:
"pageId=
26
"
,
"query"
:
"pageId=
106&t=cKG2AoWZ00
"
,
"scene"
:
null
"scene"
:
null
},
},
{
{
...
...
src/subPackage/page/pages/subPage/subPage.js
View file @
92a93d4b
...
@@ -37,7 +37,7 @@ wxService.page({
...
@@ -37,7 +37,7 @@ wxService.page({
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
()
{
onLoad
(
options
)
{
this
.
setData
(
this
.
setData
(
{
{
pages
:
[],
pages
:
[],
...
@@ -56,18 +56,31 @@ wxService.page({
...
@@ -56,18 +56,31 @@ wxService.page({
handlerDataOnPage
=
new
utils
.
HandlerDataOnPage
()
handlerDataOnPage
=
new
utils
.
HandlerDataOnPage
()
renderPage
=
require
(
'../../../../utils/renderPage'
).
getRenderPage
()
renderPage
=
require
(
'../../../../utils/renderPage'
).
getRenderPage
()
handlerDataOnPage
.
init
(
this
,
'pages'
)
handlerDataOnPage
.
init
(
this
,
'pages'
)
if
(
this
.
options
[
'scene'
])
{
// 判断
let
idParam
=
decodeURIComponent
(
this
.
options
[
'scene'
]).
split
(
'&'
)[
0
];
if
(
options
.
pageId
){
// let hasPageId = idParam ? (idParam.indexOf('pageId') > -1 ? true : false) : false
;
this
.
data
.
pageId
=
options
.
pageId
;
let
shareId
=
idParam
&&
idParam
.
split
(
'='
)[
1
]
||
0
;
this
.
setData
({
this
.
options
.
pageId
=
shareId
;
pageId
:
this
.
data
.
pageId
}
});
this
.
setData
({
pageId
:
this
.
options
.
pageId
},()
=>
{
this
.
initPage
(
this
.
data
.
pageId
)
this
.
initPage
(
this
.
data
.
pageId
)
})
}
else
{
let
pageId
=
shareId
;
if
(
options
[
'scene'
])
{
let
idParam
=
decodeURIComponent
(
options
[
'scene'
]).
split
(
'&'
)[
0
];
// let hasPageId = idParam ? (idParam.indexOf('pageId') > -1 ? true : false) : false;
let
shareId
=
idParam
&&
idParam
.
split
(
'='
)[
1
]
||
0
;
pageId
=
shareId
;
}
this
.
data
.
pageId
=
pageId
;
this
.
setData
({
pageId
:
this
.
data
.
pageId
});
this
.
initPage
(
this
.
data
.
pageId
);
}
},
},
/**
/**
...
...
src/utils/util.js
View file @
92a93d4b
...
@@ -161,6 +161,38 @@ function parseUrl(query) {
...
@@ -161,6 +161,38 @@ function parseUrl(query) {
return
result
;
return
result
;
}
}
/**
* 计算传入时间和当前时间差
* @param d 时间 格式:2010 - 04 - 10 10: 22: 36
* @return
*/
function
getDateDiff
(
d
){
var
now
=
new
Date
().
getTime
();
var
diffValue
=
now
-
Date
.
parse
(
d
.
replace
(
/-/g
,
'/'
).
replace
(
/:/g
,
":"
));
if
(
diffValue
<
0
)
{
return
null
;
}
var
minute
=
1000
*
60
;
var
hour
=
minute
*
60
;
var
day
=
hour
*
24
;
var
halfamonth
=
day
*
15
;
var
month
=
day
*
30
;
var
monthC
=
diffValue
/
month
;
var
weekC
=
diffValue
/
(
7
*
day
);
var
dayC
=
diffValue
/
day
;
var
hourC
=
diffValue
/
hour
;
var
minC
=
diffValue
/
minute
;
let
result
=
{};
result
.
month
=
parseInt
(
monthC
);
result
.
week
=
parseInt
(
weekC
);
result
.
days
=
parseInt
(
dayC
);
result
.
hours
=
parseInt
(
hourC
);
result
.
minutes
=
parseInt
(
minC
);
return
result
;
}
function
getCurrentRouter
()
{
function
getCurrentRouter
()
{
var
pages
=
getCurrentPages
()
// 获取加载的页面
var
pages
=
getCurrentPages
()
// 获取加载的页面
...
@@ -401,6 +433,7 @@ module.exports = {
...
@@ -401,6 +433,7 @@ module.exports = {
getUserInfoByBtn
,
getUserInfoByBtn
,
moment
,
moment
,
parseUrl
,
parseUrl
,
getDateDiff
,
_
,
_
,
// _: underscore,
// _: underscore,
HandlerDataOnPage
,
HandlerDataOnPage
,
...
...
src/utils/wxService.js
View file @
92a93d4b
...
@@ -656,6 +656,8 @@ class WXService extends Http {
...
@@ -656,6 +656,8 @@ class WXService extends Http {
config
.
data
.
speadProductsBanner
=
envInfo
.
speadProductsBanner
;
config
.
data
.
speadProductsBanner
=
envInfo
.
speadProductsBanner
;
config
.
data
.
canUseWechatAddress
=
envInfo
.
canUseWechatAddress
;
config
.
data
.
canUseWechatAddress
=
envInfo
.
canUseWechatAddress
;
config
.
data
.
guiderCanScanQrcode
=
envInfo
.
guiderCanScanQrcode
;
config
.
data
.
guiderCanScanQrcode
=
envInfo
.
guiderCanScanQrcode
;
config
.
data
.
canRefundDaysAfterDelivery
=
envInfo
.
canRefundDaysAfterDelivery
;
//默认
//默认
config
.
data
.
loading
=
true
;
config
.
data
.
loading
=
true
;
...
...
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