Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wxapp
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
wxapp
Commits
42222290
Commit
42222290
authored
Feb 20, 2019
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
版本v1.28(会员限购)
parent
e8ce8ca0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
22 deletions
+43
-22
pages/detail/index.js
+29
-16
pages/detail/index.wxml
+1
-1
project.config.json
+9
-2
utils/Config.js
+4
-3
No files found.
pages/detail/index.js
View file @
42222290
...
...
@@ -40,9 +40,9 @@ Page({
},
/**
* 用户资料授权
*/
checkUserLogin
:
function
(
callback
)
{
* 用户资料授权
*/
checkUserLogin
:
function
(
callback
)
{
if
(
app
.
globalData
.
userInfo
==
null
)
{
api
.
me
.
info
().
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
...
...
@@ -160,7 +160,7 @@ Page({
// 获取评论数据
getCommentData
:
function
()
{
// 商家详情没有评论
if
(
this
.
data
.
detail
.
type
==
'2'
)
{
if
(
this
.
data
.
detail
.
type
==
'2'
)
{
this
.
setData
({
hasMore
:
false
,
loading
:
false
...
...
@@ -214,13 +214,13 @@ Page({
pid
:
this
.
data
.
id
}).
then
(
res
=>
{
// 收藏改变
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
let
detail
=
that
.
data
.
detail
detail
.
is_collect
=
!
detail
.
is_collect
if
(
res
.
collect
==
'add'
)
{
if
(
res
.
collect
==
'add'
)
{
// 添加收藏
detail
.
collect_num
=
parseInt
(
detail
.
collect_num
)
+
1
}
else
{
}
else
{
// 移除收藏
detail
.
collect_num
=
parseInt
(
detail
.
collect_num
)
-
1
}
...
...
@@ -245,17 +245,30 @@ Page({
// 立即报名
enrollClick
:
function
()
{
//检查是否限购,0为不限购
if
(
this
.
data
.
detail
.
vip_limits
&&
this
.
data
.
detail
.
is_vip
)
{
//检查当前购买数量是否大于限购
if
(
this
.
data
.
detail
.
buy_vip_limits
>=
this
.
data
.
detail
.
vip_limits
)
{
//弹窗不让购买
wx
.
showModal
({
title
:
'信息'
,
content
:
'您已超过此活动的会员限购次数,如需额外购买,请联系客服处理!'
,
showCancel
:
false
})
return
;
}
}
let
status
=
this
.
data
.
detail
.
status
// 0-立即报名;1-预约下次;2-已售罄
if
(
status
==
0
)
{
if
(
status
==
0
)
{
wx
.
navigateTo
({
url
:
'/pages/detail/enroll/index?id='
+
this
.
data
.
id
,
})
}
else
if
(
status
==
1
){
}
else
if
(
status
==
1
)
{
wx
.
navigateTo
({
url
:
'/pages/detail/appoint/index?id='
+
this
.
data
.
id
,
})
}
else
{
}
else
{
$Toast
({
content
:
"活动已售罄"
,
type
:
'error'
...
...
@@ -270,23 +283,23 @@ Page({
})
},
// 客户弹框按钮点击
handleKfClose
:
function
(
event
){
handleKfClose
:
function
(
event
)
{
let
that
=
this
if
(
event
.
type
==
'ok'
)
{
if
(
event
.
type
==
'ok'
)
{
// 保存二维码
wx
.
downloadFile
({
url
:
that
.
data
.
detail
.
kf_qrcode
,
success
:
function
(
res
){
success
:
function
(
res
)
{
console
.
log
(
res
)
if
(
res
.
statusCode
===
200
){
if
(
res
.
statusCode
===
200
)
{
wx
.
saveImageToPhotosAlbum
({
filePath
:
res
.
tempFilePath
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
wx
.
showToast
({
title
:
'图片保存成功'
,
})
},
fail
:
function
(
res
)
{
fail
:
function
(
res
)
{
wx
.
showToast
({
title
:
'图片保存失败'
,
})
...
...
pages/detail/index.wxml
View file @
42222290
...
...
@@ -8,7 +8,7 @@
<view class='header'>
<view class='title'>{{detail.title}}</view>
<view class='intro'>
{{detail.type=='2'?'':'限'+detail.sign_limits+'组报名'}} 收藏{{detail.collect_num}}次
{{detail.type=='2'?'':'限'+detail.sign_limits+'组报名'}} 收藏{{detail.collect_num}}次
<block wx:if="{{detail.vip_limits}}">会员限购{{detail.vip_limits}}次/已购{{detail.buy_vip_limits}}次</block>
</view>
</view>
<i-cell-group>
...
...
project.config.json
View file @
42222290
...
...
@@ -37,7 +37,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
1
5
,
"current"
:
1
6
,
"list"
:
[
{
"id"
:
0
,
...
...
@@ -133,7 +133,14 @@
{
"id"
:
-1
,
"name"
:
"我的订单"
,
"pathName"
:
"pages/me/order/index"
"pathName"
:
"pages/me/order/index"
,
"query"
:
""
},
{
"id"
:
16
,
"name"
:
"活动详情(草莓)"
,
"pathName"
:
"pages/detail/index"
,
"query"
:
"id=298"
}
]
}
...
...
utils/Config.js
View file @
42222290
...
...
@@ -7,9 +7,9 @@ export const Config = {
// //测试
// export const Config = {
// apiPath: "https://meixzz.u
sa1.u
tools.club/api/",
// mobPath: "https://meixzz.u
sa1.u
tools.club/mob/",
// shopJoinPath: "https://meixzz.u
sa1.u
tools.club/mob/Index/shopjoin"
// apiPath: "https://meixzz.utools.club/api/",
// mobPath: "https://meixzz.utools.club/mob/",
// shopJoinPath: "https://meixzz.utools.club/mob/Index/shopjoin"
// }
export
default
Config
\ No newline at end of file
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