Commit 42222290 by LiuJunYi

版本v1.28(会员限购)

parent e8ce8ca0
...@@ -42,7 +42,7 @@ Page({ ...@@ -42,7 +42,7 @@ Page({
/** /**
* 用户资料授权 * 用户资料授权
*/ */
checkUserLogin: function (callback) { checkUserLogin: function(callback) {
if (app.globalData.userInfo == null) { if (app.globalData.userInfo == null) {
api.me.info().then(res => { api.me.info().then(res => {
if (res.code == 0) { if (res.code == 0) {
...@@ -160,7 +160,7 @@ Page({ ...@@ -160,7 +160,7 @@ Page({
// 获取评论数据 // 获取评论数据
getCommentData: function() { getCommentData: function() {
// 商家详情没有评论 // 商家详情没有评论
if(this.data.detail.type=='2'){ if (this.data.detail.type == '2') {
this.setData({ this.setData({
hasMore: false, hasMore: false,
loading: false loading: false
...@@ -214,13 +214,13 @@ Page({ ...@@ -214,13 +214,13 @@ Page({
pid: this.data.id pid: this.data.id
}).then(res => { }).then(res => {
// 收藏改变 // 收藏改变
if(res.code==0){ if (res.code == 0) {
let detail = that.data.detail let detail = that.data.detail
detail.is_collect = !detail.is_collect detail.is_collect = !detail.is_collect
if( res.collect == 'add' ){ if (res.collect == 'add') {
// 添加收藏 // 添加收藏
detail.collect_num = parseInt(detail.collect_num) + 1 detail.collect_num = parseInt(detail.collect_num) + 1
}else{ } else {
// 移除收藏 // 移除收藏
detail.collect_num = parseInt(detail.collect_num) - 1 detail.collect_num = parseInt(detail.collect_num) - 1
} }
...@@ -245,17 +245,30 @@ Page({ ...@@ -245,17 +245,30 @@ Page({
// 立即报名 // 立即报名
enrollClick: function() { 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 let status = this.data.detail.status
// 0-立即报名;1-预约下次;2-已售罄 // 0-立即报名;1-预约下次;2-已售罄
if(status==0){ if (status == 0) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/detail/enroll/index?id=' + this.data.id, url: '/pages/detail/enroll/index?id=' + this.data.id,
}) })
} else if (status == 1){ } else if (status == 1) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/detail/appoint/index?id=' + this.data.id, url: '/pages/detail/appoint/index?id=' + this.data.id,
}) })
}else{ } else {
$Toast({ $Toast({
content: "活动已售罄", content: "活动已售罄",
type: 'error' type: 'error'
...@@ -270,23 +283,23 @@ Page({ ...@@ -270,23 +283,23 @@ Page({
}) })
}, },
// 客户弹框按钮点击 // 客户弹框按钮点击
handleKfClose: function(event){ handleKfClose: function(event) {
let that = this let that = this
if(event.type=='ok'){ if (event.type == 'ok') {
// 保存二维码 // 保存二维码
wx.downloadFile({ wx.downloadFile({
url: that.data.detail.kf_qrcode, url: that.data.detail.kf_qrcode,
success: function(res){ success: function(res) {
console.log(res) console.log(res)
if (res.statusCode === 200){ if (res.statusCode === 200) {
wx.saveImageToPhotosAlbum({ wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath, filePath: res.tempFilePath,
success: function (res) { success: function(res) {
wx.showToast({ wx.showToast({
title: '图片保存成功', title: '图片保存成功',
}) })
}, },
fail: function (res) { fail: function(res) {
wx.showToast({ wx.showToast({
title: '图片保存失败', title: '图片保存失败',
}) })
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class='header'> <view class='header'>
<view class='title'>{{detail.title}}</view> <view class='title'>{{detail.title}}</view>
<view class='intro'> <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>
</view> </view>
<i-cell-group> <i-cell-group>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 15, "current": 16,
"list": [ "list": [
{ {
"id": 0, "id": 0,
...@@ -133,7 +133,14 @@ ...@@ -133,7 +133,14 @@
{ {
"id": -1, "id": -1,
"name": "我的订单", "name": "我的订单",
"pathName": "pages/me/order/index" "pathName": "pages/me/order/index",
"query": ""
},
{
"id": 16,
"name": "活动详情(草莓)",
"pathName": "pages/detail/index",
"query": "id=298"
} }
] ]
} }
......
...@@ -7,9 +7,9 @@ export const Config = { ...@@ -7,9 +7,9 @@ export const Config = {
// //测试 // //测试
// export const Config = { // export const Config = {
// apiPath: "https://meixzz.usa1.utools.club/api/", // apiPath: "https://meixzz.utools.club/api/",
// mobPath: "https://meixzz.usa1.utools.club/mob/", // mobPath: "https://meixzz.utools.club/mob/",
// shopJoinPath: "https://meixzz.usa1.utools.club/mob/Index/shopjoin" // shopJoinPath: "https://meixzz.utools.club/mob/Index/shopjoin"
// } // }
export default Config export default Config
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment