Commit 42222290 by LiuJunYi

版本v1.28(会员限购)

parent e8ce8ca0
......@@ -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: '图片保存失败',
})
......
......@@ -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>
......
......@@ -37,7 +37,7 @@
"list": []
},
"miniprogram": {
"current": 15,
"current": 16,
"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"
}
]
}
......
......@@ -7,9 +7,9 @@ export const Config = {
// //测试
// export const Config = {
// apiPath: "https://meixzz.usa1.utools.club/api/",
// mobPath: "https://meixzz.usa1.utools.club/mob/",
// shopJoinPath: "https://meixzz.usa1.utools.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
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