Commit b36f43fc by 程南

Merge branch 'mall_dev_7.11.0' of ssh://gitlab.bigaka.net:2287/gaoshq/7-Eleven into mall_dev_7.11.0

parents 751dd803 bf29670e
......@@ -141,6 +141,10 @@
"contactPlugin": {
"version": "1.3.0",
"provider": "wx104a1a20c3f81ec2"
},
"live-player-plugin": {
"version": "1.0.7",
"provider": "wx2b03c6e691cd7370"
}
},
"permission": {
......
......@@ -69,7 +69,7 @@ Component({
});
return ;
}
//有弹框
this.data.showDialog = true;
let dialogInfo = page.dialogInfo ? JSON.parse(page.dialogInfo) : null;
......@@ -80,8 +80,10 @@ Component({
// 父组件 更新
const urls = getCurrentPages()
const currentPath = urls[0]
// const currentPath = '/subPackage/page/pages/subPage/subPage'
const pageId = dialogInfo.link.url
dialogInfo.link.newPath = `/${currentPath.route}`
dialogInfo.link.newPath = `/${currentPath.route}`
}
} else if (dialogInfo.row) {
let newRow = JSON.parse(dialogInfo.row)
......
// component/adDialog/adDialog.js
var app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo
const utilLink = require('../../utils/currentLinkRouter')
Component({
/**
* 组件的属性列表
*/
properties: {
showDialog : {
type:Boolean,
value: false
},
imageUrl : {
type : String,
default : ''
}
},
observers:{
},
/**
* 组件的初始数据
*/
data: {
},
lifetimes:{
attached(){
// console.log(this.data.pageInfo)
},
created(){
}
},
/**
* 组件的方法列表
*/
methods: {
//关闭
onTapClose(){
this.setData({
showDialog :false
});
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--component/adDialog/adDialog.wxml-->
<view class="ad-modal-bg" wx:if="{{showDialog}}">
<view class="ad-modal-body">
<view class="show-img">
<image mode="widthFix" src="{{imageUrl}}"></image>
</view>
<view class="close-dia">
<image src="/assets/imgs/close.png" mode="aspectFit" bindtap="onTapClose"></image>
</view>
</view>
</view>
/* component/adDialog/adDialog.wxss */
.ad-modal-bg{
position: fixed;
z-index: 9999;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.5);
left: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
}
.ad-modal-bg .ad-modal-body{
width: 70vw;
height: auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.ad-modal-bg .ad-modal-body .show-img{
width: 100%;
height: auto;
}
.ad-modal-bg .ad-modal-body .show-img image{
width: 100%;
height: auto;
}
.ad-modal-bg .ad-modal-body .close-dia{
width: 100%;
height: auto;
padding-top: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
.ad-modal-bg .ad-modal-body .close-dia image{
width: 80rpx;
height: 80rpx;
}
.ad-modal-bg .ad-modal-body .close-dia image:active{
opacity: 0.7;
}
\ No newline at end of file
......@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id
// 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 有直播
//2006 泰华 , wx40fec8944623c8b3 有直播
......@@ -25,7 +25,7 @@ const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门
//2992 山东盛联微商城 wx53dedc202ae0d0c2
//2002 巴黎贝甜 wx21968cb3a486d4ab
const BRANCH_ID = 1002
const BRANCH_ID = 2012
const isMall = true
// const needMock = '' //
......@@ -79,6 +79,7 @@ const prod_brand_config = {
logo: 'https://img3.bigaka.com/prd/3001/202003/20200331/3001842823fb-2601-4b58-a648-79ad799ad425.png',
openRefundTips : true,//是否开启退货须知显示
refundTips : '温馨提示:退货通过审核后需将清单随包裹一起寄回或纸条备注(订单号与退货商品款号)【请务必审核通过后24小时内填写寄回运单号,拒签到付/顺丰/EMS/天天快递 不影响二次销售】',//退货须知文本
//wx654ce96a7324e76f 小程序微信支付券
},
//泰华配置
2006: {
......
......@@ -60,7 +60,11 @@ wxService.page({
pointDeductRuleUrl : '',//积分规则说明
avaliablePoint : 0,//可用积分数
pointDeductMoney : 0.00,
//积分支付数据
pointPayInfo : {
point : 0,
pointAmount : 0
},
},
//获取积分抵扣配置信息
......@@ -110,6 +114,7 @@ wxService.page({
});
//需要计算显示订单价格
this.setPayPrice();
},
//显示积分抵扣规则
onTapShowDeductRule(){
......@@ -289,7 +294,7 @@ wxService.page({
this.setData({
useNotUserCoupon: true,
defalutCoupon: 0,
couponId: '',
couponId: 0,
couponSettingId: '',
defalutCouponId: '',
currentCoupon: 0,
......@@ -376,8 +381,9 @@ wxService.page({
let promotionPrice = (orderInitPrice - calCouponPrice) > 0 ? (orderInitPrice - calCouponPrice) : 0;
//看一下积分是否勾选了
if(this.data.deductCheckStatus){
promotionPrice = parseFloat(promotionPrice - this.data.pointDeductMoney).toString(2);
promotionPrice = promotionPrice*1 - this.data.pointDeductMoney*1;
}
// 实际价格 - 优惠价 + plus
this.setData({
// orderPrice: Math.round(orderInitPrice - orderCoupon)
......@@ -679,6 +685,9 @@ wxService.page({
if (this.data.couponId) {
params.couponId = this.data.couponId;
}
else if(this.data.couponId === 0){
params.couponId = 0;
}
wxService.post(`/sale/trade/buyer/preview`, params).then(res => {
if (res) {
......@@ -710,6 +719,19 @@ wxService.page({
noSelectPrice: sum
})
}
//获取是否有积分抵扣的
let pointPayInfo = data.pointPayInfo ? data.pointPayInfo : null;
if(pointPayInfo){
this.data.avaliablePoint = pointPayInfo.point;
this.data.pointDeductMoney = pointPayInfo.pointAmount;
if(pointPayInfo.point == 0 || pointPayInfo.pointAmount){
this.data.deductCheckStatus = false;
}
}
this.data.pointPayInfo = data.pointPayInfo;
//如果没有couponId则认为是第一次进来没有自己选择优惠券
if (!this.data.couponId) {
if (!this.data.useNotUserCoupon) {
......@@ -736,7 +758,10 @@ wxService.page({
defalutCouponId: defalutCouponId,
couponSettingId: couponSettingId,
orderInitPrice: data.amount,
totalGoodsPrice: this.data.totalGoodsPrice
totalGoodsPrice: this.data.totalGoodsPrice,
avaliablePoint : this.data.avaliablePoint,
pointDeductMoney : this.data.pointDeductMoney,
deductCheckStatus : this.data.deductCheckStatus
}, () => {
// 实付款
this.setPayPrice()
......@@ -747,7 +772,10 @@ wxService.page({
this.setData({
currentOrderList: data,
orderInitPrice: data.amount,
totalGoodsPrice: this.data.totalGoodsPrice
totalGoodsPrice: this.data.totalGoodsPrice,
avaliablePoint : this.data.avaliablePoint,
pointDeductMoney : this.data.pointDeductMoney,
deductCheckStatus : this.data.deductCheckStatus
}, () => {
// 实付款
this.setPayPrice()
......@@ -761,7 +789,10 @@ wxService.page({
defalutCouponId: this.data.defalutCouponId,
couponSettingId: this.data.couponSettingId,
orderInitPrice: data.amount,
totalGoodsPrice: this.data.totalGoodsPrice
totalGoodsPrice: this.data.totalGoodsPrice,
avaliablePoint : this.data.avaliablePoint,
pointDeductMoney : this.data.pointDeductMoney,
deductCheckStatus : this.data.deductCheckStatus
}, () => {
// 实付款
this.setPayPrice()
......@@ -890,12 +921,25 @@ wxService.page({
},
//下单
order(isSelect, params) {
if (this.data.orderStoreInfo) {
if (this.data.orderStoreInfo.storeId) {
params.storeId = this.data.orderStoreInfo.storeId;
if(params.orderType == 1){
if (this.data.orderStoreInfo) {
if (this.data.orderStoreInfo.storeId) {
params.storeId = this.data.orderStoreInfo.storeId;
}
if (this.data.orderStoreInfo.storeInfo) {
params.storeInfo = this.data.orderStoreInfo.storeInfo;
}
}
if (this.data.orderStoreInfo.storeInfo) {
params.storeInfo = this.data.orderStoreInfo.storeInfo;
}
//处理积分抵扣
if(this.data.deductCheckStatus){
params.pointPayInfo = this.data.pointPayInfo;
}
else{
params.pointPayInfo = {
point : 0,
pointAmount : 0
}
}
......@@ -903,10 +947,7 @@ wxService.page({
let url = isSelect ? '/sale/payment/merged/buyer/bill' : '/sale/trade/buyer/bill'
wxService.post(`${url}`, params).then(res => {
if (res) {
const {
result,
data
} = res.data
const {result,data} = res.data
let tradeId = data.tradeId;
wx.removeStorageSync('choosedStoreInfo');
wx.removeStorageSync('orderRemark');
......
......@@ -53,4 +53,4 @@
<contact-us-modal contactShow="{{contactUsModal}}"/>
<!-- 广告 -->
<ad-dialog pageInfo="{{pageInfo}}" currentHasUserInfo="{{currentHasUserInfo}}" bind:getAuth="_getUserInfo"/>
\ No newline at end of file
<ad-dialog pageInfo="{{pageInfo}}" bind:updatePage="updatePage" currentHasUserInfo="{{currentHasUserInfo}}" bind:getAuth="_getUserInfo"/>
\ No newline at end of file
......@@ -96,6 +96,9 @@ wxService.page({
data.logistic = null;
}
// 处理积分抵扣
data.pointPayInfo = data.pointPayInfo ? data.pointPayInfo : {point:0,pointAmount:0};
//处理能不能退款
let canApplyRefund = true;
let filter = skuVOList.filter(c => c.canRefundNum > 0);
......
......@@ -144,6 +144,10 @@
<text>¥{{utils.numberFormat(detail.promotionDiscount)}}</text>
</view>
<view class="order-pro-list">
<text>积分抵扣</text>
<text>使用{{detail.pointPayInfo.point}}积分,抵扣¥{{detail.pointPayInfo.pointAmount}}</text>
</view>
<view class="order-pro-list">
<text>优惠券优惠</text>
<text>¥{{utils.numberFormat(detail.coouponDiscount)}}</text>
</view>
......
......@@ -55,53 +55,59 @@ wxService.page({
};
this.generatePointObject(tentacleInfo);
}
this.getOptionsData();
},
watch: {
experAccessible(newVal, oldVal) {
if(newVal) {
// 登录接口返回err
const reLoginErrFlag = wx.getStorageSync('reLoginErr')
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
let id
if (baseUserInfo && !reLoginErrFlag) {
this.setData({
isAuthorization: false
}, () => {
const option = this.options || {}
const { scene } = option
if (scene) {
let idParam = decodeURIComponent(scene).split('&')[0]
let shareId = idParam && idParam.split('=')[1] || 0
id = shareId
} else {
id = option.id
}
if (id) {
this.setData({
id
}, () => {
this.getPointDetail(id)
})
}
// 隐藏 dialog
this.isShowDialog(false)
})
}
else if (!baseUserInfo && reLoginErrFlag) {
this.setData({
isAuthorization: true
})
// experAccessible(newVal, oldVal) {
// if(newVal) {
// this.getOptionsData();
// } else {
// // 去别的页面
// wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
// }
// }
},
//获取集点详情
getOptionsData(){
// 登录接口返回err
const reLoginErrFlag = wx.getStorageSync('reLoginErr')
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
let id
if (baseUserInfo && !reLoginErrFlag) {
this.setData({
isAuthorization: false
}, () => {
const option = this.options || {}
const { scene } = option
if (scene) {
let idParam = decodeURIComponent(scene).split('&')[0]
let shareId = idParam && idParam.split('=')[1] || 0
id = shareId
} else {
id = option.id
}
else {
if (id) {
this.setData({
isAuthorization: true
id
}, () => {
this.getPointDetail(id)
})
}
} else {
// 去别的页面
wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
}
// 隐藏 dialog
this.isShowDialog(false)
})
}
else if (!baseUserInfo && reLoginErrFlag) {
this.setData({
isAuthorization: true
})
}
else {
this.setData({
isAuthorization: true
})
}
},
// 集点详情
......@@ -156,13 +162,72 @@ wxService.page({
this.showTimeStatus('活动已经失效啦,看看其他的')
} else {
// 会员集点活动统计信息 进行中且有效
this.getPointConsumptionCount(id)
this.getPointConsumptionCount(id);
//限制必须是扫码进来的才调用
// let scene = wx.getLaunchOptionsSync().scene;
// if(scene == 1011){
this.getUserShowRewardCollectionPoint(id);
// }
}
})
}
}
})
},
//获取用户扫码进来是否需要弹出领取集点的
getUserShowRewardCollectionPoint(id){
wxService.post(`/sale/touchpoints/pointConsumptionActivity/verifyWhetherReward?id=${id}`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
//如果需要 弹出提示框
if(data == 1){
this.showConfirmModal(id);
}
}
}
})
},
//弹出原生提示框让用户去点击
showConfirmModal(id){
let self = this;
if(this.showModal){
return ;
}
this.showModal = true;
wx.showModal({
title : '集点领取提示',
content : '恭喜您获得一个集点',
showCancel : false,
confirmText : '确认领取',
confirmColor : '#05C35B',
success (res) {
if(res.confirm){
self.userConfirmGetCollectionPoint(id);
}
self.showModal = false;
}
})
},
//调用领取接口
userConfirmGetCollectionPoint(id){
wxService.post(`/sale/touchpoints/pointConsumptionActivity/award?id=${id}`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
//如果需要 弹出提示框
wx.showToast({
title: '领取成功~',
});
this.getPointDetail(this.data.id);
}
}
});
},
showTimeStatus(status) {
wx.showToast({
title: `${status}`,
......
......@@ -15,14 +15,15 @@ wxService.page({
currentTimeStatus: 1, // 1 进行中 2 已结束 3 未开始
},
watch: {
experAccessible(newVal, oldVal) {
if(newVal) {
this.getPointList()
} else {
// 去别的页面
wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
}
}
// 暂时先不要体验版
// experAccessible(newVal, oldVal) {
// if(newVal) {
// this.getPointList()
// } else {
// // 去别的页面
// wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
// }
// }
},
/**
* 生命周期函数--监听页面加载
......@@ -39,6 +40,9 @@ wxService.page({
};
this.generatePointObject(tentacleInfo);
}
//获取集点
this.getPointList();
},
/**
......
......@@ -54,6 +54,13 @@
</picker>
</view>
</view>
<!-- 温馨提示 -->
<view class="warn-tips" wx:if="{{openRefundTips && curType.name != '请选择'}}">
<view class="header">退货须知</view>
<view class="tips-content">
{{refundTips}}
</view>
</view>
<view class="form">
<view class="form-label">退款金额</view>
<view class="form-picker">
......
......@@ -178,3 +178,23 @@ page{
background: #ffffff;
padding: 20rpx; }
.warn-tips{
background-color: #eeeeee;
margin-top: 15rpx;
padding: 15rpx;
font-size: 24rpx;
color: #999999;
}
.warn-tips .header{
padding-bottom: 0rpx;
color: #333333;
font-weight: bold;
border-bottom: dashed 1rpx #eeeeee;
}
.tips-content{
padding-top: 20rpx;
letter-spacing: 2rpx;
line-height: 30rpx;
}
......@@ -81,4 +81,4 @@
<exception wx:if="{{!apiIsOk}}" bind:reCall="onTapReCall"/>
<!-- 广告 -->
<ad-dialog pageInfo="{{pageInfo}}" currentHasUserInfo="{{currentHasUserInfo}}" bind:getAuth="_getUserInfo"/>
<ad-dialog pageInfo="{{pageInfo}}" bind:updatePage="updatePage" currentHasUserInfo="{{currentHasUserInfo}}" bind:getAuth="_getUserInfo"/>
......@@ -13,7 +13,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.8.2",
"appid": "wxac09792264c49b5c",
"appid": "wxfe14ebde4a6eea3d",
"projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": {
"hidedInDevtools": []
......@@ -46,10 +46,11 @@
"current": 16,
"list": [
{
"id": -1,
"id": 0,
"name": "会员中心",
"pathName": "pages/userCenter/userCenter",
"query": ""
"query": "m=b)XQE0mX00",
"scene": null
},
{
"id": -1,
......@@ -635,7 +636,14 @@
"id": 87,
"name": "刮刮卡",
"pathName": "subPackageMarketing/page/pages/scratch/scratch",
"query": "id=700043642982764548",
"query": "i=d0)3YH1100&t=d0)PMHH100&s=share",
"scene": null
},
{
"id": -1,
"name": "集点活动列表",
"pathName": "pages/pointList/pointList",
"query": "",
"scene": null
}
]
......
......@@ -28,10 +28,19 @@ wxService.page({
//判断用户是不是已经登录了
let userInfo = wx.getStorageSync('_baseUserInfo');
if (userInfo) {
wx.reLaunch({
url: '/pages/userCenter/userCenter',
});
return;
if(userInfo.member.cardNoWeixin){
wx.showToast({
title: '您已开过卡',
icon : 'none'
});
setTimeout(() => {
wx.reLaunch({
url: '/pages/userCenter/userCenter',
});
},300);
return;
}
}
//未登录 需要授权登录 弹出设置的开卡图片
......
......@@ -151,11 +151,11 @@ wxService.page({
},
//获取经验值流水
getMemberExpHistory(memberId){
wxService.post(`/member/exp/queryExpDetail?pageNum=1&pageSize=10000`,{
wxService.get(`/member/memberExp/findPage?pageNum=1&pageSize=10000&status=null`,{
memberId: memberId,
}).then(res => {
if(!res) return ;
let list = res.data.data.content ? res.data.data.content : [];
let list = res.data.data ? res.data.data : [];
this.setData({
expHistory : list
});
......@@ -163,14 +163,14 @@ wxService.page({
},
//获取会员经验值
getMemberExp(memberId){
wxService.post(`/member/exp/byMemberIdQueryExp?memberId=${memberId}`).then(res => {
if(!res) return ;
let obj = res.data.data;
this.data.total.totalExp = obj.exp ? obj.exp : 0;
this.setData({
total: this.data.total
})
})
// wxService.post(`/member/exp/byMemberIdQueryExp?memberId=${memberId}`).then(res => {
// if(!res) return ;
// let obj = res.data.data;
// this.data.total.totalExp = obj.exp ? obj.exp : 0;
// this.setData({
// total: this.data.total
// })
// })
},
//获取会员详情
getMemberFind(memberId) {
......@@ -185,10 +185,13 @@ wxService.page({
const { result, data } = res && res.data || res && res.result
if (result == 0) {
wx.hideLoading()
this.data.memberInfo = data.member;
data.member.age = data.member.birthday ? utils.getAge(data.member.birthday) : 0;
data.member.sex = data.member.sex ? data.member.sex : '保密';
this.data.total.totalExp = data.member.exp ? data.member.exp : 0;
this.setData({
memberInfo: data.member
memberInfo: data.member,
total : this.data.total,
})
}
})
......@@ -368,14 +371,13 @@ wxService.page({
})
},
//立即回访
onTapReCall(){
onTapConactExternalUser(){
const currentEnv = wx.getStorageSync('_qyWeChat');
if (currentEnv) {
let qiyeExternalUserid = this.data.memberInfo.qiyeExternalUserid ? this.data.memberInfo.qiyeExternalUserid :
(this.data.memberInfo.qiyeInfo ? this.data.memberInfo.qiyeInfo.qiyeExternalUserid : '');
let guidInfo = wx.getStorageSync('guidBaseInfo'),
guidQiyeUserId = guidInfo.member.qiyeInfo.userid;
if (!qiyeExternalUserid) {
wx.showToast({
title: '该会员还不是您的好友,请先加好友!',
......
......@@ -12,7 +12,7 @@
data-phone="{{memberInfo.mobile}}"
bindtap="handelPhoneCall" mode='widthFix'></image>
</view>
<view class='u-item-rg' bindtap='onTapReCall'>立即回访</view>
<view class='u-item-rg' bindtap="onTapConactExternalUser">立即回访</view>
</view>
<view class='u-items'>
<view class='u-item-lf'>
......@@ -226,7 +226,7 @@
<view class='title'>{{item.sourceName}}</view>
<view>{{item.createTime}}</view>
</view>
<view class='time'>{{item.type == 0 ? "-" : "+"}}{{item.exp}}</view>
<view class='time'>{{item.type == 0 ? "-" : "+"}}{{item.changeValue}}</view>
</view>
<!-- 空 -->
<view class='empty' wx:if="{{expHistory.length == 0}}">暂无数据~</view>
......
// pages/userCenter.js
const wxService = require('../../../../utils/wxService')
const util = require('../../../../utils/util')
wxService.page({
/**
......@@ -8,6 +10,9 @@ wxService.page({
data: {
query: '',
integralCouponList: [], // 积分兑换优惠券列表
showDialog : false,
dialogPicture : '',
},
/**
......@@ -26,10 +31,20 @@ wxService.page({
wxService.post(`/coupon/couponCenterActivity/buyer/getValidList`).then(res => {
if (res) {
const { result, data } = res.data
let { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.data.integralCouponList = data ? data : [];
wx.hideLoading();
data = data ? data : [];
data.forEach(item => {
//判断活动开始时间是不是已经开始了
item.isStart = true;
//判断是不是老活动
if(item.couponList){
item.isStart = util.compareCurrentDate(item.startTime);
}
});
this.data.integralCouponList = data;
this.setData({
integralCouponList: this.data.integralCouponList
});
......@@ -69,14 +84,43 @@ wxService.page({
wx.showLoading({
title: '领取中..',
});
let isStart = e.currentTarget.dataset.start;
const { id } = e.currentTarget.dataset;
let item = e.currentTarget.dataset.item;
//先判断是不是老的活动
if(!item.couponList){
this.getCoupon(id,item);
return ;
}
if(isStart){
this.getCoupon(id,item);
}
//预约
else{
this.orderCouponActivity(id,item);
}
},
//立即领取
getCoupon(id,item){
wxService.post(`/coupon/couponCenterActivity/buyer/coupon/draw?id=${id}`).then(res => {
wx.hideLoading();
if(res){
if(res.data.result == 0){
wx.showToast({
title: '领取成功',
});
//判断是不是老活动
if(item.couponList){
this.data.showDialog = true;
this.data.dialogPicture = item.dialogPicture;
this.setData({
showDialog : this.data.showDialog,
dialogPicture : this.data.dialogPicture
});
}
else{
wx.showToast({
title: '领取成功!',
});
}
}
else{
wx.showToast({
......@@ -87,6 +131,11 @@ wxService.page({
}
});
},
//立即预约
orderCouponActivity(id){
},
//跳转到详情
goCouponDetail(e) {
const { id } = e.currentTarget.dataset
......
......@@ -4,10 +4,8 @@
"enablePullDownRefresh": true,
"usingComponents": {
"no-more": "/component/noMore/noMore",
"exchange-coupon-modal": "/component/exchange-coupon-modal/exchange-coupon-modal",
"dialog-stock-empty": "/component/dialogStockEmpty/dialogStockEmpty",
"dialog-user-limit": "/component/dialogUserLimit/dialogUserLimit",
"go-home": "/component/goHome/goHome",
"go-guid": "/component/goGuid/goGuid"
"go-guid": "/component/goGuid/goGuid",
"image-dialog": "/component/imageDialog/imageDialog"
}
}
\ No newline at end of file
......@@ -17,6 +17,7 @@
<image wx:if="{{item.listPicture}}" src='{{item.listPicture}}' mode="aspectFit"/>
<image wx:else src='https://img3.bigaka.com/prd/3001/202003/20200331/3001649f2f08-3b4e-4b5b-97c1-30cdf646651c.png' />
</view>
<!-- <view class='ac-date'>{{item.startTime}}至{{item.endTime}}</view> -->
<view class='coupon-info'>
<view class='coupon-name fs-28'>{{item.activityName}}</view>
<view class='coupon-desc text-align-left fs-24'>查看详情</view>
......@@ -29,8 +30,9 @@
class="clear-btn positionAbs"></button>
<view class='coupon-btn-click theme-color'
data-id="{{item.acvivityId}}"
bindtap='exchange'>立即领取</view>
<!-- <view class='ac-date'>{{item.startTime}}至{{item.endTime}}</view> -->
data-start="{{item.isStart}}"
data-item="{{item}}"
bindtap='exchange'>{{item.isStart ? '立即领取': '立即预约'}}</view>
</view>
</view>
</view>
......@@ -48,7 +50,8 @@
<go-guid />
<go-home/>
<floatNav bind:getAuth="_getUserInfo" bind:updatePage="updatePage"/>
<!-- image-dialog -->
<image-dialog showDialog="{{showDialog}}" imageUrl="{{dialogPicture}}"></image-dialog>
// subPackage/page/pages/couponCenterInfo/couponCenterInfo.js
const wxService = require('../../../../utils/wxService')
const util = require('../../../../utils/util')
wxService.page({
/**
......@@ -7,7 +8,8 @@ wxService.page({
*/
data: {
activityId : null,
activityInfo : {}
activityInfo : {},
showDialog : false,
},
/**
......@@ -36,6 +38,14 @@ wxService.page({
obj.desc = arr.filter(item => item.type == 2);
obj.hasExpDate = arr.filter(item => item.type == 1).length > 0 ;
this.data.activityInfo = obj;
//判断老活动
if(this.data.activityInfo.couponList){
this.data.activityInfo.isStart = util.compareCurrentDate(obj.startTime);
}
else{
this.data.activityInfo.isStart = true;
}
this.setData({
activityInfo: this.data.activityInfo
});
......@@ -67,13 +77,41 @@ wxService.page({
title: '领取中..',
});
let id = this.data.activityId;
let isStart = this.data.activityInfo.isStart;
//判断是不是老活动
if(!this.data.activityInfo.couponList){
this.getCoupon(id);
return ;
}
if(isStart){
this.getCoupon(id);
}
else{
//立即预约
this.orderCouponNow(id);
}
},
//立即;领取
getCoupon(id){
wxService.post(`/coupon/couponCenterActivity/buyer/coupon/draw?id=${id}`).then(res => {
wx.hideLoading();
if (res) {
if (res.data.result == 0) {
wx.showToast({
title: '领取成功',
});
//判断是不是老数据
if(!this.data.activityInfo.couponList){
wx.showToast({
title: '领取成功',
});
}
else{
this.data.showDialog = true;
this.setData({
showDialog : true
});
}
}
else {
wx.showToast({
......@@ -84,6 +122,10 @@ wxService.page({
}
});
},
//立即预约
orderCouponNow(id){
},
/**
* 用户点击右上角分享
......
{
"navigationBarTitleText": "优惠券信息",
"usingComponents": {}
"usingComponents": {
"image-dialog": "/component/imageDialog/imageDialog"
}
}
\ No newline at end of file
<!--subPackage/page/pages/couponCenterInfo/couponCenterInfo.wxml-->
<view class="coupon-info-con">
<view class="coupon-info-bg" style="background-image:url('https://img3.bigaka.com/prd/3001/202003/20200331/3001df30305c-f4fe-4c35-bd73-5d87d4882f7a.png')">
<!-- 老数据活动 -->
<view class="coupon-info-bg" wx:if="{{!activityInfo.couponList}}" style="background-image:url('https://img3.bigaka.com/prd/3001/202003/20200331/3001df30305c-f4fe-4c35-bd73-5d87d4882f7a.png')">
<view class="lf-coupon-Bg">
<image wx:if="{{activityInfo.listPicture}}" mode="aspectFit" src="{{activityInfo.listPicture}}"></image>
<image wx:else src='https://img3.bigaka.com/prd/3001/202003/20200331/3001649f2f08-3b4e-4b5b-97c1-30cdf646651c.png' />
......@@ -13,6 +14,12 @@
</view>
</view>
</view>
<!-- 修改为新的布局 -->
<view class="coupon-package" wx:if="{{activityInfo.couponList}}">
<image src="{{activityInfo.detailPicture}}" mode="widthFix"></image>
</view>
<!-- 活动说明 -->
<view class='integral-detail' wx:if="{{activityInfo.hasExpDate}}">
<view class='integral-list'>
......@@ -32,8 +39,10 @@
<button wx:if="{{!currentHasUserInfo}}"
bindgetuserinfo="_getUserInfo"
open-type='getUserInfo'
class="clear-btn positionAbs">立即领取</button>
<view wx:else class="view-btn" bindtap="onTapGetCoupon">立即领取</view>
class="clear-btn positionAbs">{{activityInfo.isStart ? '立即领取' : '立即预约'}}</button>
<view wx:else class="view-btn" bindtap="onTapGetCoupon">{{activityInfo.isStart ? '立即领取' : '立即预约'}}</view>
</view>
</view>
<!-- image-dialog -->
<image-dialog showDialog="{{showDialog}}" imageUrl="{{activityInfo.dialogPicture}}"></image-dialog>
\ No newline at end of file
......@@ -33,6 +33,16 @@ view{
padding: 15rpx;
}
.coupon-package{
width: 100%;
height: auto;
}
.coupon-package image{
width: 100%;
}
.coupon-info-bg .lf-coupon-Bg image{
width: 100%;
height: 100%;
......
......@@ -38,4 +38,4 @@
<go-guid/>
<!-- 广告 -->
<ad-dialog pageInfo="{{pageInfo}}" currentHasUserInfo="{{currentHasUserInfo}}" bind:getAuth="_getUserInfo"/>
\ No newline at end of file
<ad-dialog pageInfo="{{pageInfo}}" bind:updatePage="updatePage" currentHasUserInfo="{{currentHasUserInfo}}" bind:getAuth="_getUserInfo"/>
\ No newline at end of file
......@@ -167,20 +167,27 @@ class Scratch {
const pos = this.drawRect(e.touches[0].x, e.touches[0].y)
this.ctx.clearRect(pos[0], pos[1], pos[2], pos[2])
this.ctx.draw(true)
this.areaIsOk();
}
touchEnd (e) {
if (!this.isStart) return
if (!this.isStart) return
// 自动清楚采用点范围值方式判断
const { canvasWidth, canvasHeight, minX, minY, maxX, maxY } = this
if (maxX - minX > .2 * canvasWidth && maxY - minY > .2 * canvasHeight) {
this.ctx.draw()
this.endCallBack && this.endCallBack()
this.isStart = false
this.page.setData({
'isScroll': true
})
}
this.areaIsOk();
}
//清除
areaIsOk(){
const { canvasWidth, canvasHeight, minX, minY, maxX, maxY } = this
if (maxX - minX > .3 * canvasWidth && maxY - minY > .3 * canvasHeight) {
this.isStart = false
this.ctx.draw()
this.endCallBack && this.endCallBack()
this.page.setData({
'isScroll': true
})
}
}
reset () {
......
......@@ -24,6 +24,7 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.data.activityId = options.id;
if(this.data.activityId){
this.getActivityInfo();
......@@ -41,19 +42,22 @@ wxService.page({
if(res){
let data = res.data.data ? res.data.data : null;
if(data){
if(data.type == 3){
//判断打开着是不是自己
let currentLogginUser = wx.getStorageSync('_baseUserInfo');
if(!currentLogginUser){
let memberId = data.tentacleId;
this.markShareRecords(memberId,this.data.activityId);
}
else{
let curLoginMemberId = currentLogginUser.memberId;
if(curLoginMemberId != memberId){ // 不是自己打开的分享链接时才调用分享成功的接口 防止自己刷次数
let memberId = data.tentacleId;
this.markShareRecords(memberId,this.data.activityId);
}
// //判断打开着是不是自己
let currentLogginUser = wx.getStorageSync('_baseUserInfo');
data.tentacleType = data.type;
// this.markShareRecords(currentLogginUser.memberId,this.data.activityId,data);
// return ;
if(!currentLogginUser){
let memberId = null;
this.markShareRecords(memberId,this.data.activityId,data);
}
else{
let curLoginMemberId = currentLogginUser.memberId;
let memberId = data.tentacleId;
if(curLoginMemberId != memberId){ // 不是自己打开的分享链接时才调用分享成功的接口 防止自己刷次数
this.markShareRecords(curLoginMemberId,this.data.activityId,data);
}
}
}
......@@ -63,10 +67,11 @@ wxService.page({
},
//记录分享数据
markShareRecords(memberId,activityId){
wxService.post(`/marketing/lotteryMobile/shareRecord`,{
markShareRecords(memberId = null,activityId,tentacleContent){
wxService.post(`/marketing/lottery/shareRecord`,{
activityId : activityId,
memberId : memberId
memberId : memberId,
tentacleContent : tentacleContent,
}).then(res => {});
},
......@@ -88,7 +93,7 @@ wxService.page({
//获取活动详情
getActivityInfo(){
wxService.get(`/marketing/lottery/findById?id=${this.data.activityId}`).then(res => {
wxService.get(`/marketing/lotterySet/findById?id=${this.data.activityId}`).then(res => {
let {result , data} = res.data;
if(result == 0 && data){
this.data.activityInfo = data;
......@@ -126,7 +131,7 @@ wxService.page({
} ;
const { memberId } = wx.getStorageSync('_baseUserInfo');
let activityId = this.data.activityInfo.id;
wxService.post(`/marketing/lotteryMobile/getLotteryNumber?activityId=${activityId}&memberId=${memberId}`).then(res => {
wxService.post(`/marketing/lottery/getLotteryNumber?activityId=${activityId}&memberId=${memberId}`).then(res => {
if(res){
let count = res.data.data ? res.data.data : 0;
this.data.leftNum = count;
......@@ -174,9 +179,6 @@ wxService.page({
awardTxtFontSize: '22px',
callback: () => {
if(self.data.leftNum > 0){
wx.showLoading({
title: '开奖中..',
});
self.getAwardInfo();
}
else{
......@@ -212,14 +214,14 @@ wxService.page({
const { memberId } = wx.getStorageSync('_baseUserInfo');
let activityId = this.data.activityInfo.id;
let self = this;
wxService.get(`/marketing/lotteryMobile/lottery?activityId=${activityId}&memberId=${memberId}`).then(res => {
wxService.get(`/marketing/lottery/lottery?activityId=${activityId}&memberId=${memberId}`).then(res => {
if(res){
if(res.data.result == 0){
if(!res.data.data){
this.scratch.setAwardText(this.data.activityInfo.notWinning);
wx.showModal({
title: '刮奖结果提示',
content: this.data.activityInfo.notWinning,
content: this.data.activityInfo.notWinning ? this.data.activityInfo.notWinning : '很遗憾,您未中奖',
showCancel: true,
cancelText: '关闭',
confirmText: '再刮一次',
......@@ -271,7 +273,6 @@ wxService.page({
}
this.getUserCanScratchCount();
wx.hideLoading();
});
},
......
......@@ -148,7 +148,6 @@ class Http {
channel: channel
})
}
}
checkStatus (resp) {
......@@ -189,15 +188,27 @@ class Http {
content: '请求数据超时'
})
}
if (error.msg && error.msg !='该用户尚未登录'){
//针对刮刮卡错误语单独处理
else if(error.msg == '对不起,您已超过此活动设置刮奖最大次数!!' || error.msg == '当前活动已失效!'){
wx.showModal({
title: '刮刮卡提示',
content: error.msg,
showCancel: false,
confirmText: '好的',
confirmColor: '#cb3c3c',
success: function (modalRes) {
}
});
}
else if (error.msg && error.msg !='该用户尚未登录'){
setTimeout(() => {
wx.showToast({
title: `${error.msg}`,
icon: 'none',
duration:2500
})
})
});
}
return Promise.reject(error)
}
......
......@@ -190,9 +190,20 @@ function getDateDiff(d){
result.days = parseInt(dayC);
result.hours = parseInt(hourC);
result.minutes = parseInt(minC);
result.second = parseInt(result.minutes*60);
return result;
}
//判断时间与当前时间比
function compareCurrentDate(d){
var now = new Date().getTime();
var diffValue = now - Date.parse(d.replace(/-/g, '/').replace(/:/g, ":"));
if (diffValue < 0) {
return false
}
return true;
}
function getCurrentRouter() {
var pages = getCurrentPages() // 获取加载的页面
......@@ -467,6 +478,7 @@ module.exports = {
moment,
parseUrl,
getDateDiff,
compareCurrentDate,
_,
isVideo,
getFirstImgUrl,
......
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