Commit 67e70295 by 谢中龙

积分换物库存校验,增加其他商户配置备注

parent 065dc74b
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// 组件plus 中数据请求 token 修改 // 组件plus 中数据请求 token 修改
// app.js 中brandId 修改为对应 // app.js 中brandId 修改为对应
const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test, 预生产 pre const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test, 预生产 pre
const needMock = '' // const needMock = '' //
// 舞象联系我 :766c50920993bf9c41c6c3d2761a2df5 // 舞象联系我 :766c50920993bf9c41c6c3d2761a2df5
//泰华 联系我 :6e4314d558e55fbc64fe2e757e24d61f //泰华 联系我 :6e4314d558e55fbc64fe2e757e24d61f
...@@ -60,11 +60,28 @@ const needMock = '' // ...@@ -60,11 +60,28 @@ const needMock = '' //
/** /**
* 多多一上 生产环境配置 * 多多一上 生产环境配置
* appId = wxf7bc302c51166dc0 //小程序 appId * appId = wxf7bc302c51166dc0 //小程序 appId
* tunnel-token = //token 杨辰提供 * tunnel-token = 1ea3f0c0dd0c91ee54e546a99beafbfb //token 杨辰提供
* brandId= 2007 //商户Id * brandId= 2007 //商户Id
* contactUspluginId = 64bf88d82b3f0d506bd00ed90d5706f1 联系我插件id * contactUspluginId = 64bf88d82b3f0d506bd00ed90d5706f1 联系我插件id
*/ */
/**
* 雪岛书屋 生产环境配置
* appId = wx207f8a95bbc9d3ab //小程序 appId
* tunnel-token = d93a5def7511da3d0f2d171d9c344e91 //token 杨辰提供
* brandId= 2008 //商户Id
* contactUspluginId = 联系我插件id
*
*/
/**
* 苏州邻里 生产环境配置
* appId = wxe7770946f9d93d38 //小程序 appId
* tunnel-token = fde4fde168dd5aabe962643843c19290 //token 杨辰提供
* brandId= 2003 //商户Id
* contactUspluginId = 联系我插件id
*
*/
// appid_dev_wx wxc3b64b09b1d3dfc2 // appid_dev_wx wxc3b64b09b1d3dfc2
...@@ -104,7 +121,7 @@ const appId = { ...@@ -104,7 +121,7 @@ const appId = {
dev: 'wxc3b64b09b1d3dfc2',//appid_dev_wx dev: 'wxc3b64b09b1d3dfc2',//appid_dev_wx
test: 'wxac09792264c49b5c',//appid_test_wx 1002商城 test: 'wxac09792264c49b5c',//appid_test_wx 1002商城
pre: 'wxac09792264c49b5c',//appid_test_wx 1002商城 pre: 'wxac09792264c49b5c',//appid_test_wx 1002商城
prod: 'wx313ec36b710125d4',//appid_prod_ prod: 'wx207f8a95bbc9d3ab',//appid_prod_
} }
const imgConfig = { const imgConfig = {
...@@ -118,7 +135,7 @@ const token = { ...@@ -118,7 +135,7 @@ const token = {
dev: 'brand1001', //开发 dev: 'brand1001', //开发
test: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', //测试 test: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', //测试
pre: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', //预生产 pre: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', //预生产
prod: 'd6db651f8b9c7db4176465accfc1c913843fd9ad328cd5f4fe201d918072c9e8' ,// 生产 prod: 'fde4fde168dd5aabe962643843c19290' ,// 生产
} }
const envInfo = (() => { const envInfo = (() => {
...@@ -128,10 +145,11 @@ const envInfo = (() => { ...@@ -128,10 +145,11 @@ const envInfo = (() => {
imgCtx: imgConfig[PROJECT_ENV], imgCtx: imgConfig[PROJECT_ENV],
tunnelToken: token[PROJECT_ENV], tunnelToken: token[PROJECT_ENV],
appId: appId[PROJECT_ENV], appId: appId[PROJECT_ENV],
brandId: 3001,// 1001 1002 3001 3002 //2711 711生产brandId, brandId: 1002,// 1001 1002 3001 3002 //2711 711生产brandId,
plusIsOpen : true, //是否开启plus plusIsOpen: false, //是否开启plus
contactUsPluginId: '766c50920993bf9c41c6c3d2761a2df5', contactUsPluginId: '766c50920993bf9c41c6c3d2761a2df5',
contactUsIsOpen : true,//是否开启联系我 contactUsIsOpen : false,//是否开启联系我
hasTrial : false , //是否开启体验者功能
} }
})() })()
......
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
.arrow-right-wrap{ .arrow-right-wrap{
position: absolute; position: absolute;
right: 0; right: 0;
top: 20rpx; top: 0rpx;
} }
.pro-footer{ .pro-footer{
position: fixed; position: fixed;
......
...@@ -62,6 +62,7 @@ wxService.page({ ...@@ -62,6 +62,7 @@ wxService.page({
// invalidCouponList: [], // invalidCouponList: [],
}) })
} }
// 可使用 // 可使用
if( current == 0 ){ if( current == 0 ){
this.getCouponList(1,10,1) this.getCouponList(1,10,1)
...@@ -155,7 +156,10 @@ wxService.page({ ...@@ -155,7 +156,10 @@ wxService.page({
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () {}, onPullDownRefresh: function () {
// console.log(this.data.currentTab)
// wx.stopPullDownRefresh();
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
......
{ {
"enablePullDownRefresh":true, "enablePullDownRefresh":false,
"navigationBarTitleText": "我的卡券", "navigationBarTitleText": "我的卡券",
"usingComponents": { "usingComponents": {
"no-more": "/component/noMore/noMore", "no-more": "/component/noMore/noMore",
......
/* pages/userCenter.wxss */ /* pages/userCenter.wxss */
@import './../../base/base.wxss'; @import './../../base/base.wxss';
page{
background: #f2f2f2;
}
scroll-view{ scroll-view{
height: 100%; height: 100%;
} }
...@@ -40,12 +43,13 @@ scroll-view{ ...@@ -40,12 +43,13 @@ scroll-view{
/* 卡劵列表 */ /* 卡劵列表 */
.coupon-wrap{ .coupon-wrap{
padding: 20rpx; padding: 20rpx;
padding-top: 0;
} }
.coupon-list{ .coupon-list{
width: 712rpx; width: 712rpx;
height: 209rpx; height: 209rpx;
position: relative; position: relative;
margin-bottom: 20rpx; margin-bottom: 14rpx;
} }
.coupon-bg{ .coupon-bg{
width: 712rpx; width: 712rpx;
...@@ -61,6 +65,7 @@ scroll-view{ ...@@ -61,6 +65,7 @@ scroll-view{
position: absolute; position: absolute;
top: 18rpx; top: 18rpx;
left: 16rpx; left: 16rpx;
border-radius: 5rpx;
} }
.coupon-info{ .coupon-info{
position: absolute; position: absolute;
...@@ -127,7 +132,7 @@ scroll-view{ ...@@ -127,7 +132,7 @@ scroll-view{
swiper { swiper {
width: 100%; width: 100%;
flex: 1; flex: 1;
height:100vh; height:90vh;
padding-bottom:20rpx; padding-bottom:20rpx;
position: absolute; position: absolute;
overflow: scroll; overflow: scroll;
......
...@@ -5,6 +5,7 @@ const utils = require('../../utils/util') ...@@ -5,6 +5,7 @@ const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo const envInfo = require('../../config/index').envInfo
import { Integer } from '../../utils/integerDigitalConvertion' import { Integer } from '../../utils/integerDigitalConvertion'
const { memberId, member } = wx.getStorageSync('_baseUserInfo') const { memberId, member } = wx.getStorageSync('_baseUserInfo')
const defaultProImg = 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/product_defalut.jpg';
wxService.page({ wxService.page({
...@@ -98,7 +99,7 @@ wxService.page({ ...@@ -98,7 +99,7 @@ wxService.page({
proData.push(extendProList[i]) proData.push(extendProList[i])
} }
} }
console.log(proData)
this.setData({ this.setData({
proData: proData proData: proData
}) })
...@@ -111,7 +112,6 @@ wxService.page({ ...@@ -111,7 +112,6 @@ wxService.page({
}) })
}, },
//全选 //全选
allSelect() { allSelect() {
this.setData({ this.setData({
...@@ -150,6 +150,7 @@ wxService.page({ ...@@ -150,6 +150,7 @@ wxService.page({
}) })
return false; return false;
} }
let spreadProducts = [] let spreadProducts = []
for (var i in this.data.proData){ for (var i in this.data.proData){
spreadProducts.push({ spreadProducts.push({
...@@ -158,7 +159,6 @@ wxService.page({ ...@@ -158,7 +159,6 @@ wxService.page({
name: this.data.proData[i].productName name: this.data.proData[i].productName
}) })
} }
console.log(spreadProducts)
wxService.post(`/merchant/spread/save`, { wxService.post(`/merchant/spread/save`, {
spreadProducts: spreadProducts spreadProducts: spreadProducts
...@@ -169,7 +169,7 @@ wxService.page({ ...@@ -169,7 +169,7 @@ wxService.page({
this.data.proData.forEach((item)=>{ this.data.proData.forEach((item)=>{
item.url = item.productImgUrl item.url = item.productImgUrl
item.title = item.productName item.title = item.productName
}) });
let tentacleInfo = { let tentacleInfo = {
content: JSON.stringify(this.data.proData), content: JSON.stringify(this.data.proData),
contentId: data.id, contentId: data.id,
...@@ -191,19 +191,19 @@ wxService.page({ ...@@ -191,19 +191,19 @@ wxService.page({
this.setData({ this.setData({
showCardModal: true, showCardModal: true,
cardTitle: this.data.proData[0].productName, cardTitle: this.data.proData[0].productName,
cardUrl: this.data.proData[0].productImgUrl, cardUrl: this.data.proData[0].productImgUrl || defaultProImg,
pagePath: path, pagePath: path,
scene: scene scene: scene
}); });
}else{ }else{
this.setData({ this.setData({
cardTitle: this.data.explain ? this.data.explain : this.data.proData[0].productName, cardTitle: this.data.explain ? this.data.explain : this.data.proData[0].productName,
cardUrl: this.data.proData[0].productImgUrl || 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/product_defalut.jpg', cardUrl: this.data.proData[0].productImgUrl || defaultProImg,
pagePath: path, pagePath: path,
scene: scene scene: scene
}); },() => {
this.getMiniCode() this.getMiniCode()
});
} }
} }
}) })
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
</view> </view>
<view class="swiper-tab-item {{currentTab==1 ? 'active' : ''}}" wx:if="{{currentHasUserInfo}}" data-current="1" bindtap="clickTab">我的分享 <view class="swiper-tab-item {{currentTab==1 ? 'active' : ''}}"
wx:if="{{currentHasUserInfo}}" data-current="1" bindtap="clickTab">我的分享
<view class="line" wx-if="{{currentTab==1}}" /> <view class="line" wx-if="{{currentTab==1}}" />
</view> </view>
</view> </view>
......
...@@ -23,11 +23,22 @@ wxService.page({ ...@@ -23,11 +23,22 @@ wxService.page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad() { }, onLoad() {
wx.hideShareMenu();
this.refreshPointRequest();
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { }, onReady: function () { },
//刷新积分请求
refreshPointRequest() {
const { memberId } = wx.getStorageSync('_baseUserInfo')
if (!memberId) {
return;
}
wxService.get('/member/memberPoint/refreshExpiredPoint?memberId=' + memberId).then(res => { })
},
//查询会员积分信息 //查询会员积分信息
getMemberIntegrateInfo() { getMemberIntegrateInfo() {
// wx.showLoading({ // wx.showLoading({
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<view class="upload_Item"> <view class="upload_Item">
<image <image
class="upload_Item_img" class="upload_Item_img"
src="{{sub.skuImgUrl}}" src="{{sub.skuImgUrl ? sub.skuImgUrl : sub.mainImgUrl}}"
bindtap='goProDetail' bindtap='goProDetail'
data-id='{{sub.goodsId}}' data-id='{{sub.goodsId}}'
/> />
......
...@@ -61,6 +61,16 @@ wxService.page({ ...@@ -61,6 +61,16 @@ wxService.page({
data.countDownOrderTime = 7200000; // 2时(h)=7200000毫秒(ms) data.countDownOrderTime = 7200000; // 2时(h)=7200000毫秒(ms)
// 订单倒计时 超多两小时 刷新当前页 // 订单倒计时 超多两小时 刷新当前页
// 本地时间 - 创建时间 > 2小时 刷新当前页 // 本地时间 - 创建时间 > 2小时 刷新当前页
if (data.logistic){
let receiverInfoArr = data.logistic.receiverInfo.split(',').reverse().filter(item => item);
data.logistic.receiverName = receiverInfoArr[1];
data.logistic.receiverMobile = receiverInfoArr[0];
data.logistic.receiverAddress = receiverInfoArr[2] + receiverInfoArr[3];
}
else{
data.logistic = null;
}
this.setData({ this.setData({
detail: data, detail: data,
mergedAmount: data.mergedAmount || 0 mergedAmount: data.mergedAmount || 0
...@@ -71,6 +81,7 @@ wxService.page({ ...@@ -71,6 +81,7 @@ wxService.page({
} }
}) })
}, },
initCountDown(countDownOrderTime,startTime,localTime) { initCountDown(countDownOrderTime,startTime,localTime) {
// 毫秒差 本地时间 - 创建时间 // 毫秒差 本地时间 - 创建时间
let countTimeSpan = localTime - startTime let countTimeSpan = localTime - startTime
......
...@@ -54,12 +54,10 @@ ...@@ -54,12 +54,10 @@
<view class="pro-wrap"> <view class="pro-wrap">
<block wx:for="{{detail.skuVOList}}" wx:for-item="item" wx:key=""> <block wx:for="{{detail.skuVOList}}" wx:for-item="item" wx:key="">
<view class="pro-list"> <view class="pro-list">
<image class="pro-img" src="{{item.skuImgUrl}}" /> <image class="pro-img" src="{{item.skuImgUrl ? item.skuImgUrl : item.mainImgUrl}}" mode='aspectFit'/>
<view class="pro-info"> <view class="pro-info">
<view class="pro-name">{{item.productName}}</view> <view class="pro-name">{{item.productName}}</view>
<view class="pro-desc"> <view class="pro-desc">{{item.skuSpec}}</view>
规格 {{item.skuSpec}}
</view>
<view class="pro-price"> <view class="pro-price">
<text class="price">¥{{item.price}}</text> <text class="price">¥{{item.price}}</text>
<text class="number">x {{item.count}}</text> <text class="number">x {{item.count}}</text>
...@@ -73,7 +71,7 @@ ...@@ -73,7 +71,7 @@
<view class="order-pro-info"> <view class="order-pro-info">
<view class="order-pro-list"> <view class="order-pro-list">
<text>商品合计</text> <text>商品合计</text>
<text>¥{{detail.payAmount}}</text> <text>¥{{detail.skuAmount}}</text>
</view> </view>
<view class="order-pro-list"> <view class="order-pro-list">
<text>运费</text> <text>运费</text>
...@@ -104,6 +102,18 @@ ...@@ -104,6 +102,18 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 收货地址信息 -->
<view class='receive-info' wx:if="{{detail.logistic}}">
<view class='title-desc'>收货信息</view>
<view class='re-address-info'>
<text class='re-u-name'>{{detail.logistic.receiverName}}</text>
<text>{{detail.logistic.receiverMobile}}</text>
</view>
<view class='re-address-info'>
<text>{{detail.logistic.receiverAddress}}</text>
</view>
</view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="button-wrap" wx-if="{{detail.status == 'C'}}"> <view class="button-wrap" wx-if="{{detail.status == 'C'}}">
<button class="btn btn-primary btn-lg" data-id="{{detail.id}}" bindtap="handelDelOrder">删除订单</button> <button class="btn btn-primary btn-lg" data-id="{{detail.id}}" bindtap="handelDelOrder">删除订单</button>
......
...@@ -202,3 +202,30 @@ page{ ...@@ -202,3 +202,30 @@ page{
border-radius: 23rpx; border-radius: 23rpx;
font-size: 18rpx; font-size: 18rpx;
} }
/* 收货信息 */
.receive-info{
padding: 30rpx;
margin-top: 10rpx;
background: #ffffff;
font-size: 24rpx;
}
.receive-info .title-desc{
color: #333333;
font-weight: bold;
display: flex;
padding-bottom: 30rpx;
align-items: center;
}
.re-address-info{
font-size: 24rpx;
color: #666666;
display: flex;
margin-bottom: 10rpx;
}
.re-address-info .re-u-name{
margin-right: 30rpx;
}
\ No newline at end of file
...@@ -92,7 +92,9 @@ wxService.page({ ...@@ -92,7 +92,9 @@ wxService.page({
// 订单列表 // 订单列表
setTimeout(() => { setTimeout(() => {
// wxService.router(`/pages/order/order`).search({params}) // wxService.router(`/pages/order/order`).search({params})
wxService.router(`/pages/order/order`) wx.navigateBack({
delta : 1
});
}, 2000) }, 2000)
} }
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.8.2", "libVersion": "2.8.2",
"appid": "wx313ec36b710125d4", "appid": "wxac09792264c49b5c",
"projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E", "projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
......
...@@ -112,9 +112,11 @@ wxService.page({ ...@@ -112,9 +112,11 @@ wxService.page({
duration : 2000, duration : 2000,
mask : true, mask : true,
success : function(){ success : function(){
setTimeout(() => {
wx.navigateBack({ wx.navigateBack({
delta: 1 delta: 1
}); });
},1500);
} }
}); });
} }
......
...@@ -416,9 +416,9 @@ wxService.page({ ...@@ -416,9 +416,9 @@ wxService.page({
// 回到商城 // 回到商城
onTapToMall(){ onTapToMall(){
wx.redirectTo({ wx.navigateTo({
url: '/pages/userCenter/userCenter', url: '/pages/userCenter/userCenter',
}) });
}, },
//跳转到会员 //跳转到会员
onTapToMember(){ onTapToMember(){
......
...@@ -27,9 +27,19 @@ wxService.page({ ...@@ -27,9 +27,19 @@ wxService.page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.hideShareMenu();
this.refreshPointRequest();
this.initIntegralCouponList(); this.initIntegralCouponList();
this.initIntegralProductList(); this.initIntegralProductList();
}, },
//刷新积分请求
refreshPointRequest() {
const { memberId } = wx.getStorageSync('_baseUserInfo')
if (!memberId) {
return;
}
wxService.get('/member/memberPoint/refreshExpiredPoint?memberId=' + memberId).then(res => { })
},
handelTab(e) { handelTab(e) {
let curTab = e.currentTarget.dataset.tab let curTab = e.currentTarget.dataset.tab
this.setData({ this.setData({
...@@ -44,6 +54,10 @@ wxService.page({ ...@@ -44,6 +54,10 @@ wxService.page({
// this.initIntegralCouponList(); // this.initIntegralCouponList();
//获取会员积分信息 //获取会员积分信息
this.getMemberIntegrateInfo(); this.getMemberIntegrateInfo();
if (wx.getStorageSync('needReloadExchangeList')){
wx.removeStorageSync('needReloadExchangeList');
this.initIntegralProductList();
}
}, },
//积分换物记录 //积分换物记录
onTapToExchangeRecords() { onTapToExchangeRecords() {
...@@ -99,16 +113,46 @@ wxService.page({ ...@@ -99,16 +113,46 @@ wxService.page({
else { else {
this.data.currentTab = 'goods'; this.data.currentTab = 'goods';
} }
let integralGoodsList = data ? data : [];
this.setData({ this.setData({
integralGoodsList: data ? data : [],
currentTab: this.data.currentTab currentTab: this.data.currentTab
}) });
this.findExchangeNumByIds(integralGoodsList);
} }
} }
}).finally(() => { }).finally(() => {
wx.hideLoading(); wx.hideLoading();
}) })
}, },
//查询指定积分换物活动兑换数量
findExchangeNumByIds(integralGoodsList){
//获取ids
let ids = integralGoodsList.map(g => {
return g.id;
});
wxService.post(`/member/pointsRedemptionProductSetting/getExchangeCount`, ids).then(res => {
if (res){
let data = res.data.data ? res.data.data : null;
if (data) {
for (let k in data) {
let id = k, value = data[k];
for (let i = 0; i < integralGoodsList.length; i++) {
if (integralGoodsList[i].id == id) {
integralGoodsList[i].canExchange = integralGoodsList[i].stock > value;
}
}
}
}
}
this.setData({
integralGoodsList: integralGoodsList,
});
});
},
// 积分兑换优惠券列表 // 积分兑换优惠券列表
initIntegralCouponList() { initIntegralCouponList() {
wx.showLoading({ wx.showLoading({
...@@ -140,8 +184,16 @@ wxService.page({ ...@@ -140,8 +184,16 @@ wxService.page({
}, },
// 立即兑换物品 // 立即兑换物品
exchangeGoods(e) { exchangeGoods(e) {
const { id, point } = e.currentTarget.dataset; const { id, point, canexchange } = e.currentTarget.dataset;
const { memberId } = wx.getStorageSync('_baseUserInfo') const { memberId } = wx.getStorageSync('_baseUserInfo');
if (!canexchange){
this.setData({
dialogStockEmpty : true
});
return ;
}
//检查是不是可以兑换 //检查是不是可以兑换
wx.showLoading({ wx.showLoading({
title: '检查兑换资格中..', title: '检查兑换资格中..',
......
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
<view class='coupon-btn-click' <view class='coupon-btn-click'
data-id="{{item.id}}" data-id="{{item.id}}"
data-point="{{item.point}}" data-point="{{item.point}}"
data-canexchange="{{item.canExchange}}"
catchtap='exchangeGoods'>立即兑换</view> catchtap='exchangeGoods'>立即兑换</view>
<view class='coupon-btn-num'>{{item.point}}积分</view> <view class='coupon-btn-num'>{{item.point}}积分</view>
</view> </view>
......
...@@ -57,6 +57,12 @@ page { ...@@ -57,6 +57,12 @@ page {
font-size: 24rpx; font-size: 24rpx;
text-align: center; text-align: center;
} }
.coupon-btn-click.disabled{
background-color: #dddddd !important;
box-shadow: none;
}
.coupon-btn-num { .coupon-btn-num {
width: 153.8rpx; width: 153.8rpx;
height: 22rpx; height: 22rpx;
......
...@@ -12,6 +12,7 @@ wxService.page({ ...@@ -12,6 +12,7 @@ wxService.page({
data: { data: {
isExchange: false, isExchange: false,
dialogUserLimit : false, dialogUserLimit : false,
dialogStockEmpty : false,
integralMallDetail: {} integralMallDetail: {}
}, },
...@@ -24,10 +25,34 @@ wxService.page({ ...@@ -24,10 +25,34 @@ wxService.page({
this.getIntegralCouponDetail(id) this.getIntegralCouponDetail(id)
}, },
//btn回调
onDialogBtnCallBack(e) {
let pages = getCurrentPages();
let index = pages.length - 1;
for (let i = 0; i < pages.length; i++) {
if (pages[i].route.indexOf('IntegralMallGoods/IntegralMallGoods') > -1) {
index = index - i;
break;
}
}
wx.navigateBack({
delta: index
});
},
//立即兑换 //立即兑换
exchange() { exchange() {
const { memberId } = wx.getStorageSync('_baseUserInfo'); const { memberId } = wx.getStorageSync('_baseUserInfo');
const id = this.data.integralMallDetail.id; const id = this.data.integralMallDetail.id;
if (!this.data.integralMallDetail.canExchange){
this.setData({
dialogStockEmpty : true,
});
return ;
}
//检查是不是可以兑换 //检查是不是可以兑换
wx.showLoading({ wx.showLoading({
title: '检查兑换资格中..', title: '检查兑换资格中..',
...@@ -57,12 +82,32 @@ wxService.page({ ...@@ -57,12 +82,32 @@ wxService.page({
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
data.desc = JSON.parse(data.desc) data.desc = JSON.parse(data.desc)
data.canExchange = true;
this.setData({ this.setData({
integralMallDetail: data integralMallDetail: data
},() => {
this.findExchangeNumByIds(id);
}); });
} }
}).finally(() => { }).finally(() => {
wx.hideLoading() wx.hideLoading()
}) })
},
//查询指定积分换物活动兑换数量
findExchangeNumByIds(id) {
//获取ids
let ids = [id];
wxService.post(`/member/pointsRedemptionProductSetting/getExchangeCount`, ids).then(res => {
let data = res.data.data ? res.data.data : null;
if (data) {
let value = data[id];
this.data.integralMallDetail.canExchange = this.data.integralMallDetail.stock > value;
} }
this.setData({
integralMallDetail: this.data.integralMallDetail
});
});
},
}) })
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"navigationBarTitleText": "积分换物详情", "navigationBarTitleText": "积分换物详情",
"usingComponents": { "usingComponents": {
"go-home": "/component/goHome/goHome", "go-home": "/component/goHome/goHome",
"dialog-stock-empty": "/component/dialogStockEmpty/dialogStockEmpty",
"dialog-user-limit": "/component/dialogUserLimit/dialogUserLimit" "dialog-user-limit": "/component/dialogUserLimit/dialogUserLimit"
} }
} }
\ No newline at end of file
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<view class='page-integral-detail'> <view class='page-integral-detail'>
<view class='coupon-wrap'> <view class='coupon-wrap'>
<view class='coupon-list'> <view class='coupon-list'>
<view class='coupon-img'> <view class='coupon-img'>
<image wx:if="{{integralMallDetail.thumbnail}}" src='{{integralMallDetail.thumbnail}}' /> <image wx:if="{{integralMallDetail.thumbnail}}" src='{{integralMallDetail.thumbnail}}' />
<image wx:else src='/assets/imgs/qr-code.png' /> <image wx:else src='/assets/imgs/qr-code.png' />
...@@ -27,3 +26,5 @@ ...@@ -27,3 +26,5 @@
<!--goHome--> <!--goHome-->
<go-home/> <go-home/>
<dialog-user-limit show="{{dialogUserLimit}}"/> <dialog-user-limit show="{{dialogUserLimit}}"/>
<dialog-stock-empty show="{{dialogStockEmpty}}" bind:btnClick="onDialogBtnCallBack"/>
...@@ -128,6 +128,7 @@ wxService.page({ ...@@ -128,6 +128,7 @@ wxService.page({
wx.showToast({ wx.showToast({
title: '兑换成功', title: '兑换成功',
}); });
wx.setStorageSync('needReloadExchangeList', true)
setTimeout(() => { setTimeout(() => {
wx.navigateBack({ wx.navigateBack({
......
...@@ -667,6 +667,8 @@ class WXService extends Http { ...@@ -667,6 +667,8 @@ class WXService extends Http {
currentHasUserInfo: true, currentHasUserInfo: true,
isVip: vipFlag isVip: vipFlag
}, () => { }, () => {
//开启体验功能时才进行校验这个功能
if (envInfo.hasTrial) {
_self.trialList().then(res => { _self.trialList().then(res => {
if (!res) return false if (!res) return false
const { currentPaths } = res const { currentPaths } = res
...@@ -679,7 +681,8 @@ class WXService extends Http { ...@@ -679,7 +681,8 @@ class WXService extends Http {
experAccessible: false experAccessible: false
}) })
} }
}) });
}
}); });
} else { } else {
page.setData({ page.setData({
......
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