Commit ffb14807 by 谢中龙

新增公优化

parent 176c5f5f
......@@ -22,18 +22,36 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let memberId = options.memberId;
if (memberId) {
let share_memberId = options.memberId;
if (share_memberId) {
let tentacleInfo = {
content: '分类',
title: '分类',
tentacleId: memberId,
tentacleId: share_memberId,
contentType: app.globalData.contants.SHARE_TYPE.CLASSIFY,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this.generatePointObject(tentacleInfo);
}
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 1
})
}
this.getCategoryList();
},
//跳转到商品列表
onTapToGoodsList(e){
let id = e.currentTarget.dataset.id;
let name = e.currentTarget.dataset.label;
wx.navigateTo({
url: `/subPackage/page/pages/categoryPro/categoryPro?id=${id}&name=${name}`,
});
},
/**
......@@ -47,14 +65,7 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 1
})
}
this.getCategoryList()
},
// 分类列表
......
......@@ -16,11 +16,19 @@
<!-- 无三级分类时 -->
<!-- 显示一级图片 -->
<view class="img-con">
<image src="{{currentFirstCategory.image ? currentFirstCategory.image : defaultWidthCategoryImg}}" mode="widthFix"></image>
<image
data-id="{{currentFirstCategory.id}}"
data-label="{{currentFirstCategory.label}}"
bindtap="onTapToGoodsList"
src="{{currentFirstCategory.image ? currentFirstCategory.image : defaultWidthCategoryImg}}"
mode="widthFix"></image>
</view>
<view class="menu-list">
<view wx:for="{{secondCategory}}" wx:key="*this" wx:for-index="k" wx:for-item="second" class="menu-third">
<view data-id="{{second.id}}" data-name="{{second.label}}" bindtap="navPage">
<view data-id="{{second.id}}" data-name="{{second.label}}"
data-id="{{second.id}}"
data-label="{{second.label}}"
bindtap="onTapToGoodsList">
<image src="{{second.image ? second.image : defaultCategoryImg}}" class="thr-menu-image" mode="aspectFill"/>
<view class="thr-menu-name">{{second.label}}</view>
</view>
......@@ -31,9 +39,15 @@
<view class="second-category" wx:if="{{currentFirstCategory.hasThirdChildren}}">
<view class="category-item" wx:for="{{secondCategory}}" wx:key="*this" wx:for-item="item">
<view class="img-con">
<image src="{{item.image ? item.image : defaultWidthCategoryImg}}" mode="widthFix"></image>
<image data-id="{{secondCategory.id}}"
data-label="{{secondCategory.label}}"
bindtap="onTapToGoodsList"
src="{{item.image ? item.image : defaultWidthCategoryImg}}" mode="widthFix"></image>
</view>
<view class="more">
<view class="more"
data-id="{{secondCategory.id}}"
data-label="{{secondCategory.label}}"
bindtap="onTapToGoodsList">
<label>{{item.label}}</label>
<view class="right-more">
全部 <image src="/assets/imgs/arrow-right.png" mode="aspectFit"></image>
......@@ -42,7 +56,10 @@
<!-- 具体的布局 -->
<view class="menu-list">
<view wx:for="{{item.children}}" wx:key="*this" wx:for-index="k" wx:for-item="third" class="menu-third">
<view data-id="{{third.id}}" data-name="{{third.label}}" bindtap="navPage">
<view data-id="{{third.id}}" data-name="{{third.label}}"
data-id="{{third.id}}"
data-label="{{third.label}}"
bindtap="onTapToGoodsList">
<image src="{{third.image ? third.image : defaultCategoryImg}}" class="thr-menu-image" mode="aspectFill"/>
<view class="thr-menu-name">{{third.label}}</view>
</view>
......
......@@ -927,14 +927,17 @@ wxService.page({
},
//下单
order(isSelect, params) {
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(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.deductCheckStatus){
params.pointPayInfo = this.data.pointPayInfo;
......
......@@ -650,7 +650,7 @@
"id": 89,
"name": "支付券信息",
"pathName": "subPackageA/page/pages/payCardInfo/payCardInfo",
"query": "id=704053422655279104",
"query": "id=704753070554353664",
"scene": null
},
{
......
......@@ -31,6 +31,31 @@ wxService.page({
title: '刷新成功',
});
}
const _baseUserInfo = wx.getStorageSync('_baseUserInfo');
if(!_baseUserInfo){
wx.showToast({
title: '登录已过期,请返回重新登录',
icon : 'none'
});
return;
}
console.log(_baseUserInfo)
let memberId = _baseUserInfo.memberId;
wxService.post(`/coupon/couponMoneyBuyActivity/buyer/member/buyRecord/getList?memberId=${memberId}`).then(res => {
if(!res) return ;
let data = res.data.data?res.data.data : [];
data.forEach(item => {
item.buyPrice = parseFloat(item.buyPrice/100).toFixed(2);
});
this.data.recordsList = data;
this.setData({
recordsList : this.data.recordsList
});
})
},
/**
......@@ -59,4 +84,4 @@ wxService.page({
}
}
},
})
\ No newline at end of file
})
<!--subPackageA/page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.wxml-->
<view class="records-list" wx:if="{{recordsList.length > 0}}">
<view class="records-item">
<view class="records-item" wx:for="{{recordsList}}" wx:key="*this" wx:for-item="item">
<view class="records-title">
<label>活动名称活动名称活动名称活动名称</label>
<text>¥50.00</text>
<label>{{item.activityName}}</label>
<text>¥{{item.buyPrice}}</text>
</view>
<view class="other-info">
有效时间: <label>2020-04-30 15:30:30至2020-04-30 15:30:30</label>
<!-- 有效时间: <label>2020-04-30 15:30:30至2020-04-30 15:30:30</label> -->
购买时间: <label>{{item.payOrderTime}}</label>
</view>
</view>
</view>
......
......@@ -24,7 +24,7 @@ wxService.page({
//获取支付券详情
getPayCardInfo(){
wxService.get(`/coupon/wechatCouponSet/get/${this.data.activityId}`).then(res => {
wxService.get(`/coupon/wechatCouponInfo/get/${this.data.activityId}`).then(res => {
if(res){
let obj = res.data.data ? res.data.data : null;
if (obj){
......@@ -47,8 +47,28 @@ wxService.page({
});
//调用接口领取
let wechatCouponSetId = this.data.activityInfo.id;
wxService.get(`/coupon/wechatCoupon/get?wechatCouponSetId=${wechatCouponSetId}`).then(res => {
if(res){
if(res.data.result == 0){
wx.showModal({
title: '领取成功提示',
content: '领取成功,是否到我的优惠券中查看?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
confirmColor: '#cb3c3c',
success: function (modalRes) {
if (modalRes.confirm) {
wx.navigateTo({
url: '/pages/coupons/coupons',
});
}
}
});
}
}
});
},
......
......@@ -960,35 +960,6 @@ class WXService extends Http {
_self.showOpenCardModelLock = false
}
})
// wx.showModal({
// title: '请激活会员卡',
// content: '为了您更好的购物体验,请您先完善会员信息',
// showCancel: true,
// success: res => {
// if (res.confirm) {
// wx.navigateToMiniProgram({
// appId: 'wxeb490c6f9b154ef9', // 固定为此 appid,不可改动
// extraData: options, // 包括 encrypt_card_id, outer_str, biz三个字段,须从 step3 中获得的链接中获取参数
// success: function (data) {
// console.log('navigateToMiniProgram success data is %o', data)
// _self.lock = false
// },
// fail: function (data) {
// console.log('navigateToMiniProgram fail data is %o', data)
// _self.lock = false
// reject(data)
// }
// })
// } else {
// this.router('/pages/welcome/welcome')
// console.log('取消开卡跳转')
// }
// },
// complete: () => {
// this.showOpenCardModelLock = false
// }
// })
}
/**
* 开卡
......@@ -1021,23 +992,7 @@ class WXService extends Http {
})
}
})
// 注释原因 所有跳转前 判断新老会员
// return new Promise((resolve, reject) => {
// if (baseUserInfo && baseUserInfo.member && baseUserInfo.member.mobile) {
// console.log('已开卡')
// wxService.openCardList()
// resolve(baseUserInfo)
// } else if (!baseUserInfo || !baseUserInfo.member || !baseUserInfo.member.mobile) {
// console.log('去开卡')
// return this.navigateToMiniProgram({
// biz: baseUserInfo.biz,
// encrypt_card_id: baseUserInfo.encryptCardId,
// outer_str: baseUserInfo.outerStr
// })
// } else {
// reject({ state: 0 })
// }
// })
}
/**
* 查看微信卡包中的卡券
......
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