Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
hmd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f3660b39
authored
Jul 18, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改loading
1 parent
35a65de2
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
50 additions
and
34 deletions
api/env/index.js
api/module/common.js
api/request/http.js
packageEquity/pages/open/open.js
packageEquity/pages/open/open.wxml
pages/loading/loading.js
pages/loading/loading.json
pages/tab/index/index.wxml
pages/tab/mine/index.js
project.config.json
api/env/index.js
View file @
f3660b3
...
@@ -107,8 +107,8 @@ const pathEnum = {
...
@@ -107,8 +107,8 @@ const pathEnum = {
}
}
const
defaultMerchantId
=
{
const
defaultMerchantId
=
{
ip
:
'44210895'
,
ip
:
'44210895'
,
dev
:
'4421
0895
'
,
dev
:
'4421
1227
'
,
uat
:
'442
10895
'
,
uat
:
'442
09846
'
,
prod
:
'44189923'
prod
:
'44189923'
}[
target
[
index
]]
}[
target
[
index
]]
...
...
api/module/common.js
View file @
f3660b3
...
@@ -19,10 +19,6 @@ module.exports = {
...
@@ -19,10 +19,6 @@ module.exports = {
noSignAttr
:
[
"file"
],
noSignAttr
:
[
"file"
],
});
});
},
},
// /**根据sceneId 查参数 */
// getSceneById(data) {
// return http.post('dj.api.smartcarlife.common.getSceneById', data)
// },
/** 首页、发现列表 搜索接口 */
/** 首页、发现列表 搜索接口 */
search
(
data
)
{
search
(
data
)
{
return
http
.
post
({
return
http
.
post
({
...
...
api/request/http.js
View file @
f3660b3
...
@@ -54,7 +54,7 @@ class Request {
...
@@ -54,7 +54,7 @@ class Request {
}
:
{
}
:
{
'Cache-Control'
:
'no-cache'
'Cache-Control'
:
'no-cache'
}
}
header
.
merchantId
=
defaultMerchantId
header
.
merchantId
=
wx
.
$merchant_id
||
defaultMerchantId
let
projectName
=
this
.
getRopProject
(
params
.
method
)
let
projectName
=
this
.
getRopProject
(
params
.
method
)
if
(
!
projectName
)
projectName
=
this
.
getRopProject
(
params
.
method
)
if
(
!
projectName
)
projectName
=
this
.
getRopProject
(
params
.
method
)
const
path
=
pathEnum
[
projectName
]
const
path
=
pathEnum
[
projectName
]
...
...
packageEquity/pages/open/open.js
View file @
f3660b3
...
@@ -6,12 +6,14 @@ Page({
...
@@ -6,12 +6,14 @@ Page({
data
:
{
data
:
{
isOpen
:
false
,
isOpen
:
false
,
openingStatus
:
false
,
openingStatus
:
false
,
IMGURKBASE
:
'equity/version/1_0_0/'
,
IMGURKBASE
:
'equity/version/1_0_0/'
,
},
},
// 获取门店会员卡信息
// 获取门店会员卡信息
getMemberCardData
()
{
getMemberCardData
()
{
const
{
merchantId
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
const
{
merchantId
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
let
newMerchantId
=
merchantId
||
defaultMerchantId
let
newMerchantId
=
merchantId
||
defaultMerchantId
let
para
=
{
let
para
=
{
merchantId
:
newMerchantId
merchantId
:
newMerchantId
...
@@ -56,15 +58,12 @@ Page({
...
@@ -56,15 +58,12 @@ Page({
},
},
// 去购买会员
// 去购买会员
async
openMemberFn
()
{
async
openMemberFn
()
{
let
sid
=
wx
.
$util
.
getSessionId
()
const
loginStatu
=
await
wx
.
p
.
router
.
intercept
()
if
(
!
sid
)
{
if
(
loginStatu
)
return
this
.
setData
({
const
{
showLogin
:
true
memberInfo
})
}
=
this
.
data
return
wx
.
p
.
wxApi
.
showLoading
()
}
const
{
memberInfo
}
=
this
.
data
wx
.
$api
.
showLoading
()
let
para
=
{
let
para
=
{
equityClassId
:
memberInfo
.
equityClassId
,
equityClassId
:
memberInfo
.
equityClassId
,
orderCode
:
memberInfo
.
orderCode
,
orderCode
:
memberInfo
.
orderCode
,
...
@@ -84,7 +83,13 @@ Page({
...
@@ -84,7 +83,13 @@ Page({
},
},
// 处理购买参数拉起支付
// 处理购买参数拉起支付
handlePay
(
payData
)
{
handlePay
(
payData
)
{
const
{
timeStamp
,
nonceStr
,
packages
,
signType
,
paySign
}
=
payData
const
{
timeStamp
,
nonceStr
,
packages
,
signType
,
paySign
}
=
payData
let
self
=
this
let
self
=
this
wx
.
requestPayment
({
wx
.
requestPayment
({
timeStamp
:
timeStamp
,
timeStamp
:
timeStamp
,
...
@@ -118,4 +123,4 @@ Page({
...
@@ -118,4 +123,4 @@ Page({
// url: '/packageShopmall/packageEquity/pages/active/active'
// url: '/packageShopmall/packageEquity/pages/active/active'
// })
// })
// }
// }
})
})
\ No newline at end of file
\ No newline at end of file
packageEquity/pages/open/open.wxml
View file @
f3660b3
...
@@ -34,5 +34,4 @@
...
@@ -34,5 +34,4 @@
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<login show="{{showLogin}}"></login>
\ No newline at end of file
\ No newline at end of file
</view>
\ No newline at end of file
\ No newline at end of file
pages/loading/loading.js
View file @
f3660b3
...
@@ -12,8 +12,19 @@ Page({
...
@@ -12,8 +12,19 @@ Page({
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
async
onLoad
(
options
)
{
async
onLoad
(
options
)
{
console
.
log
(
options
,
'==='
)
this
.
tabList
=
__wxConfig
.
tabBar
.
list
this
.
tabList
=
__wxConfig
.
tabBar
.
list
wx
.
p
.
wxApi
.
showLoading
()
wx
.
p
.
wxApi
.
showLoading
()
//scenc获取页面参数并跳转
if
(
options
.
scene
)
{
return
this
.
getSceneById
(
options
.
scene
)
}
if
(
options
.
url
)
{
return
this
.
login
(
options
)
}
},
async
login
(
options
)
{
if
(
options
.
merchantId
)
wx
.
$merchant_id
=
options
.
merchantId
try
{
try
{
const
{
const
{
code
,
code
,
...
@@ -34,10 +45,6 @@ Page({
...
@@ -34,10 +45,6 @@ Page({
wx
.
p
.
storage
.
rm
(
'sessionId'
)
wx
.
p
.
storage
.
rm
(
'sessionId'
)
}
}
console
.
log
(
data
,
'============='
)
console
.
log
(
data
,
'============='
)
//scenc获取页面参数并跳转
if
(
options
.
scene
)
{
return
this
.
getSceneById
(
options
.
scene
)
}
if
(
options
.
url
)
{
if
(
options
.
url
)
{
return
this
.
jumpPage
(
options
.
url
)
return
this
.
jumpPage
(
options
.
url
)
}
}
...
@@ -46,8 +53,8 @@ Page({
...
@@ -46,8 +53,8 @@ Page({
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
wx
.
p
.
wxApi
.
showToast
(
String
(
error
))
wx
.
p
.
wxApi
.
showToast
(
String
(
error
))
wx
.
p
.
router
.
goHome
()
}
}
},
},
async
getSceneById
(
scene
)
{
async
getSceneById
(
scene
)
{
const
id
=
decodeURIComponent
(
scene
).
split
(
'='
).
at
(
-
1
)
const
id
=
decodeURIComponent
(
scene
).
split
(
'='
).
at
(
-
1
)
...
@@ -58,7 +65,7 @@ Page({
...
@@ -58,7 +65,7 @@ Page({
}
=
await
wx
.
p
.
api
.
wechatApi
.
getSceneById
({
}
=
await
wx
.
p
.
api
.
wechatApi
.
getSceneById
({
id
id
})
})
if
(
code
==
0
)
this
.
jumpPage
(
data
.
scene
)
if
(
code
==
0
)
this
.
login
(
data
.
scene
)
else
throw
{}
else
throw
{}
}
catch
(
error
)
{
}
catch
(
error
)
{
wx
.
p
.
wxApi
.
showToast
(
error
||
'获取scene失败'
)
wx
.
p
.
wxApi
.
showToast
(
error
||
'获取scene失败'
)
...
...
pages/loading/loading.json
View file @
f3660b3
{
{
"usingComponents"
:
{}
"usingComponents"
:
{},
"navigationStyle"
:
"custom"
}
}
\ No newline at end of file
\ No newline at end of file
pages/tab/index/index.wxml
View file @
f3660b3
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
<view class="btn text-center" bindtap="jump" data-url="activity.index">
<view class="btn text-center" bindtap="jump" data-url="activity.index">
查看更多
查看更多
<view class="icon">
<view class="icon">
<
image webp src="{{IMGURL}}index/more.png"></
image>
<
glsx-image webp src="home/more.png"></glsx-
image>
</view>
</view>
</view>
</view>
</block>
</block>
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
<block wx:else>
<block wx:else>
<view class="nothing flex">
<view class="nothing flex">
<view class="icon">
<view class="icon">
<
image webp src="{{IMGURL}}index/index-activity-nothing.png"></
image>
<
glsx-image webp src="home/index-activity-nothing.png"></glsx-
image>
</view>
</view>
暂无优惠活动,敬请期待
暂无优惠活动,敬请期待
</view>
</view>
...
...
pages/tab/mine/index.js
View file @
f3660b3
...
@@ -60,17 +60,25 @@ Page({
...
@@ -60,17 +60,25 @@ Page({
})
})
}
else
{
}
else
{
wx
.
p
.
api
.
equityApi
.
checkOpenMember
().
then
(
res
=>
{
wx
.
p
.
api
.
equityApi
.
checkOpenMember
().
then
(
res
=>
{
let
flag
=
false
console
.
log
(
res
,
'----------'
)
res
.
data
=
{
}
let
flag
=
false
,
identity
=
0
// 普通会员3 银卡2 金卡1 非会员 0
if
(
res
.
data
&&
res
.
data
.
validitDate
)
{
if
(
res
.
data
&&
res
.
data
.
validitDate
)
{
res
.
data
.
time
=
new
Date
(
res
.
data
.
validitDate
).
format
(
'yyyy.MM.dd'
)
res
.
data
.
time
=
new
Date
(
res
.
data
.
validitDate
).
format
(
'yyyy.MM.dd'
)
}
}
if
(
res
.
code
==
0
&&
res
.
data
)
{
if
(
res
.
code
==
0
&&
res
.
data
)
{
flag
=
true
flag
=
true
identity
=
3
if
(
res
.
data
&&
res
.
data
.
cardTypeSpecial
)
identity
=
res
.
data
.
cardTypeSpecial
}
}
wx
.
p
.
storage
.
set
(
'isVIP'
,
flag
)
wx
.
p
.
storage
.
set
(
'isVIP'
,
flag
)
this
.
setData
({
this
.
setData
({
isMember
:
flag
,
isMember
:
flag
,
vipInfo
:
res
.
data
vipInfo
:
res
.
data
,
identity
})
})
})
})
}
}
...
...
project.config.json
View file @
f3660b3
...
@@ -57,6 +57,6 @@
...
@@ -57,6 +57,6 @@
],
],
"include"
:
[]
"include"
:
[]
},
},
"appid"
:
"wx
6e40cfb83ce4ffb1
"
,
"appid"
:
"wx
e10067a63c1856ac
"
,
"projectname"
:
"hmd"
"projectname"
:
"hmd"
}
}
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment