Commit 416941cc by 程南

样式替换

parent 68ddc37f
...@@ -171,7 +171,7 @@ App({ ...@@ -171,7 +171,7 @@ App({
isPlusVip: isPlusVip, isPlusVip: isPlusVip,
cityJson: cityJson, cityJson: cityJson,
brandId: envInfo.brandId, brandId: envInfo.brandId,
themeColor: '#007d63',//主题颜色 themeColor: envInfo.themeColor,//主题颜色
}, },
//跳转10级 //跳转10级
navigateTo(routerObj){ navigateTo(routerObj){
......
...@@ -106,7 +106,11 @@ ...@@ -106,7 +106,11 @@
"pages/shareArticle/shareArticle", "pages/shareArticle/shareArticle",
"pages/pointActicityGroup/pointActivityGroup", "pages/pointActicityGroup/pointActivityGroup",
"pages/pointExchangeCoupon/pointExchangeCoupon", "pages/pointExchangeCoupon/pointExchangeCoupon",
"pages/pointExchangeGoods/pointExchangeGoods" "pages/pointExchangeGoods/pointExchangeGoods",
"pages/payCardInfo/payCardInfo",
"pages/moneyBuyCoupon/moneyBuyCoupon",
"pages/moneyBuyCouponInfo/moneyBuyCouponInfo",
"pages/moneyBuyCouponRecords/moneyBuyCouponRecords"
] ]
}, },
{ {
...@@ -141,10 +145,6 @@ ...@@ -141,10 +145,6 @@
"contactPlugin": { "contactPlugin": {
"version": "1.3.0", "version": "1.3.0",
"provider": "wx104a1a20c3f81ec2" "provider": "wx104a1a20c3f81ec2"
},
"live-player-plugin": {
"version": "1.0.7",
"provider": "wx2b03c6e691cd7370"
} }
}, },
"permission": { "permission": {
......
page{ page{
--themecolor: #007d63; /* var(--themecolor) --主题色配置 */ --themecolor: #007d63; /* var(--themecolor) --主题色配置 */
--themeColorRgba01 : rgba(0,125,99,0.1);
--themeColorRgba02 : rgba(0,125,99,0.2);
--themeColorRgba03 : rgba(0,125,99,0.3);
--themeColorRgba04 : rgba(0,125,99,0.4);
--themeColorRgba05 : rgba(0,125,99,0.5);
--themeColorRgba06 : rgba(0,125,99,0.6);
--themeColorRgba07 : rgba(0,125,99,0.7);
--themeColorRgba08 : rgba(0,125,99,0.8);
--themeColorRgba09 : rgba(0,125,99,0.9);
} }
......
...@@ -31,6 +31,6 @@ ...@@ -31,6 +31,6 @@
height: 70rpx; height: 70rpx;
line-height: 70rpx; line-height: 70rpx;
border-radius: 35rpx; border-radius: 35rpx;
background-color: rgba(0,125,99, 1); background-color: var(--themecolor);
text-align: center; text-align: center;
} }
\ No newline at end of file
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
height: 88rpx; height: 88rpx;
line-height: 88rpx; line-height: 88rpx;
font-size: 30rpx; font-size: 30rpx;
background-color: #05c35b !important; background-color: var(--themecolor) !important;
margin: 50rpx auto 32rpx; margin: 50rpx auto 32rpx;
} }
.agree-rule{ .agree-rule{
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
margin-right: 10rpx; margin-right: 10rpx;
} }
.rule-text{ .rule-text{
color: #05c35b; color: var(--themecolor);
} }
.rule-wrap{ .rule-wrap{
margin-left: 76rpx; margin-left: 76rpx;
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
height: 88rpx; height: 88rpx;
line-height: 88rpx; line-height: 88rpx;
font-size: 30rpx; font-size: 30rpx;
background-color: #05c35b !important; background-color: var(--themecolor) !important;
margin: 50rpx auto 32rpx; margin: 50rpx auto 32rpx;
} }
.agree-rule{ .agree-rule{
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
margin-right: 10rpx; margin-right: 10rpx;
} }
.rule-text{ .rule-text{
color: #05c35b; color: var(--themecolor);
} }
.rule-wrap{ .rule-wrap{
margin-left: 76rpx; margin-left: 76rpx;
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
line-height: 35rpx; line-height: 35rpx;
border-radius: 19rpx; border-radius: 19rpx;
text-align: center; text-align: center;
background-color: rgba(0,125,99, 1); background-color: var(--themecolor);
border: 2rpx solid rgba(151, 151, 151, 1); border: 2rpx solid rgba(151, 151, 151, 1);
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
font-size: 18rpx; font-size: 18rpx;
......
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
line-height: 40rpx; line-height: 40rpx;
text-align: center; text-align: center;
border-radius: 5rpx; border-radius: 5rpx;
background-color: rgba(0,125,99, 1); background-color: var(--themecolor);
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
font-size: 18rpx; font-size: 18rpx;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
......
...@@ -11,6 +11,10 @@ Component({ ...@@ -11,6 +11,10 @@ Component({
type: Boolean, type: Boolean,
type: false type: false
}, },
currentHasMobile : {
type: Boolean,
type: false
},
disableNum: { // 不能改变的数量 disableNum: { // 不能改变的数量
type: Number, type: Number,
observer: '_disableNumChange', observer: '_disableNumChange',
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
</view> </view>
</scroll-view> </scroll-view>
<!-- 按钮状态 --> <!-- 按钮状态 -->
<view wx:if="{{!currentHasUserInfo}}"> <view wx:if="{{!currentHasMobile}}">
<!-- <button <!-- <button
bindgetuserinfo="_getUserInfo" bindgetuserinfo="_getUserInfo"
data-jflag="false" data-jflag="false"
......
<!--component/statusPoint/statusPoint.wxml--> <!--component/statusPoint/statusPoint.wxml-->
<!--#05C35B -->
<view class="status" style="height: {{imgHeight}}rpx" wx:if="{{img}}"> <view class="status" style="height: {{imgHeight}}rpx" wx:if="{{img}}">
<view class="status-tips" style="background-color:rgba(5, 195, 91, 1);" wx:if="{{currentStatus == 2 && currentTimeStatus == 1}}">进行中 >></view> <view class="status-tips" wx:if="{{currentStatus == 2 && currentTimeStatus == 1}}">进行中 >></view>
<view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:elif="{{currentStatus == 3}}"> 已失效 >></view> <view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:elif="{{currentStatus == 3}}"> 已失效 >></view>
<view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:elif="{{currentTimeStatus == 2}}">已结束 >></view> <view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:elif="{{currentTimeStatus == 2}}">已结束 >></view>
<view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:elif="{{currentTimeStatus == 3}}">未开始 >></view> <view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:elif="{{currentTimeStatus == 3}}">未开始 >></view>
<view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:else>已结束 >></view> <view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:else>已结束 >></view>
<!--<image class='status-tips' src='/assets/imgs/point/status.png' mode="widthFix"/>-->
<image wx:if="{{img}}" class='status-img' src='{{img}}' /> <image wx:if="{{img}}" class='status-img' src='{{img}}' />
</view> </view>
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
line-height: 58rpx; line-height: 58rpx;
font-size: 24rpx; font-size: 24rpx;
border-radius: 10rpx 100rpx 100rpx 10rpx; border-radius: 10rpx 100rpx 100rpx 10rpx;
background-color: var(--themecolor);
} }
.status-img { .status-img {
border-radius: 8rpx; border-radius: 8rpx;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id // 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应 // app.js 中brandId 修改为对应
const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre const PROJECT_ENV = 'dev' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 : //仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4 有直播 //3001 3001 , wx313ec36b710125d4 有直播
//2006 泰华 , wx40fec8944623c8b3 有直播 //2006 泰华 , wx40fec8944623c8b3 有直播
...@@ -25,7 +25,7 @@ const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门 ...@@ -25,7 +25,7 @@ const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门
//2992 山东盛联微商城 wx53dedc202ae0d0c2 //2992 山东盛联微商城 wx53dedc202ae0d0c2
//2002 巴黎贝甜 wx21968cb3a486d4ab //2002 巴黎贝甜 wx21968cb3a486d4ab
const BRANCH_ID = 3001 const BRANCH_ID = 1001
const isMall = true const isMall = true
// const needMock = '' // // const needMock = '' //
...@@ -76,6 +76,7 @@ const prod_brand_config = { ...@@ -76,6 +76,7 @@ const prod_brand_config = {
isNeedGetLocation : true,//是否开启小程序获取位置(提交订单时获取门店信息) isNeedGetLocation : true,//是否开启小程序获取位置(提交订单时获取门店信息)
guiderCanScanQrcode : true,//导购是否有扫一扫功能 guiderCanScanQrcode : true,//导购是否有扫一扫功能
shareTitle: '【舞象星品荟-社交商城】', shareTitle: '【舞象星品荟-社交商城】',
themeColor: '#cb3c3c',//主题颜色
logo: 'https://img3.bigaka.com/prd/3001/202003/20200331/3001842823fb-2601-4b58-a648-79ad799ad425.png', logo: 'https://img3.bigaka.com/prd/3001/202003/20200331/3001842823fb-2601-4b58-a648-79ad799ad425.png',
openRefundTips : true,//是否开启退货须知显示 openRefundTips : true,//是否开启退货须知显示
refundTips : '温馨提示:退货通过审核后需将清单随包裹一起寄回或纸条备注(订单号与退货商品款号)【请务必审核通过后24小时内填写寄回运单号,拒签到付/顺丰/EMS/天天快递 不影响二次销售】',//退货须知文本 refundTips : '温馨提示:退货通过审核后需将清单随包裹一起寄回或纸条备注(订单号与退货商品款号)【请务必审核通过后24小时内填写寄回运单号,拒签到付/顺丰/EMS/天天快递 不影响二次销售】',//退货须知文本
...@@ -95,6 +96,7 @@ const prod_brand_config = { ...@@ -95,6 +96,7 @@ const prod_brand_config = {
isMall: isMall, isMall: isMall,
hasLiveVideo: true,//是否有直播功能 hasLiveVideo: true,//是否有直播功能
orderingMustOpenCard: true, orderingMustOpenCard: true,
themeColor: '#cb3c3c',//主题颜色
touchPointStorageTime: 30 * 60 * 1000,//单位毫秒 touchPointStorageTime: 30 * 60 * 1000,//单位毫秒
isOpenSelfMention: true, // 是否开启门店自提 isOpenSelfMention: true, // 是否开启门店自提
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮 canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
...@@ -111,6 +113,7 @@ const prod_brand_config = { ...@@ -111,6 +113,7 @@ const prod_brand_config = {
tunnelToken: '1ea3f0c0dd0c91ee54e546a99beafbfb', tunnelToken: '1ea3f0c0dd0c91ee54e546a99beafbfb',
brandId: 2007, brandId: 2007,
plusIsOpen: false, plusIsOpen: false,
themeColor: '#cb3c3c',//主题颜色
contactUsIsOpen: true, contactUsIsOpen: true,
touchPointStorageTime: 30 * 60 * 1000,//单位毫秒 touchPointStorageTime: 30 * 60 * 1000,//单位毫秒
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
...@@ -138,6 +141,7 @@ const prod_brand_config = { ...@@ -138,6 +141,7 @@ const prod_brand_config = {
touchPointStorageTime: 30 * 60 * 1000,//单位毫秒 touchPointStorageTime: 30 * 60 * 1000,//单位毫秒
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
contactUsPluginId: '', contactUsPluginId: '',
themeColor: '#cb3c3c',//主题颜色
hasTrial: false, hasTrial: false,
isMall: isMall, isMall: isMall,
hasLiveVideo: false,//是否有直播功能 hasLiveVideo: false,//是否有直播功能
...@@ -159,6 +163,7 @@ const prod_brand_config = { ...@@ -159,6 +163,7 @@ const prod_brand_config = {
plusIsOpen: false, plusIsOpen: false,
contactUsIsOpen: false, contactUsIsOpen: false,
contactUsPluginId: '', contactUsPluginId: '',
themeColor: '#cb3c3c',//主题颜色
touchPointStorageTime: 30 * 60 * 1000,//单位毫秒 touchPointStorageTime: 30 * 60 * 1000,//单位毫秒
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
hasTrial: false, hasTrial: false,
...@@ -184,6 +189,7 @@ const prod_brand_config = { ...@@ -184,6 +189,7 @@ const prod_brand_config = {
contactUsPluginId: '',//联系我们插件PluginID contactUsPluginId: '',//联系我们插件PluginID
hasTrial: false,// 是否有体验账号 hasTrial: false,// 是否有体验账号
hasLiveVideo: false,//是否有直播功能 hasLiveVideo: false,//是否有直播功能
themeColor: '#cb3c3c',//主题颜色
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
isMall: isMall,// 商城或门户 true 商城 false 门户 isMall: isMall,// 商城或门户 true 商城 false 门户
orderingMustOpenCard: false,//下单是否必须卡开 orderingMustOpenCard: false,//下单是否必须卡开
...@@ -210,6 +216,7 @@ const prod_brand_config = { ...@@ -210,6 +216,7 @@ const prod_brand_config = {
hasLiveVideo: false,//是否有直播功能 hasLiveVideo: false,//是否有直播功能
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
orderingMustOpenCard: false, orderingMustOpenCard: false,
themeColor: '#007d63',//主题颜色
touchPointStorageTime: 48 * 60 * 60 * 1000,//单位毫秒 touchPointStorageTime: 48 * 60 * 60 * 1000,//单位毫秒
guiderCanScanQrcode: false,//导购是否有扫一扫功能 guiderCanScanQrcode: false,//导购是否有扫一扫功能
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮 canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
...@@ -231,6 +238,7 @@ const prod_brand_config = { ...@@ -231,6 +238,7 @@ const prod_brand_config = {
contactUsPluginId: '6d310b33ba27c784fb6872942a57711d', contactUsPluginId: '6d310b33ba27c784fb6872942a57711d',
hasTrial: false, hasTrial: false,
hasLiveVideo: true,//是否有直播功能 hasLiveVideo: true,//是否有直播功能
themeColor: '#cb3c3c',//主题颜色
touchPointStorageTime: 30 * 60 * 1000,//单位毫秒 touchPointStorageTime: 30 * 60 * 1000,//单位毫秒
isMall: isMall, isMall: isMall,
orderingMustOpenCard: true, orderingMustOpenCard: true,
...@@ -253,6 +261,7 @@ const prod_brand_config = { ...@@ -253,6 +261,7 @@ const prod_brand_config = {
contactUsPluginId: '', contactUsPluginId: '',
hasTrial: false, hasTrial: false,
hasLiveVideo: false,//是否有直播功能 hasLiveVideo: false,//是否有直播功能
themeColor: '#cb3c3c',//主题颜色
isMall: isMall, isMall: isMall,
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
touchPointStorageTime: 30 * 60 * 1000,//单位毫秒 touchPointStorageTime: 30 * 60 * 1000,//单位毫秒
...@@ -280,6 +289,7 @@ const prod_brand_config = { ...@@ -280,6 +289,7 @@ const prod_brand_config = {
touchPointStorageTime: 30 * 60 * 1000,//单位毫秒 touchPointStorageTime: 30 * 60 * 1000,//单位毫秒
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
isMall: isMall, isMall: isMall,
themeColor: '#cb3c3c',//主题颜色
orderingMustOpenCard: false, orderingMustOpenCard: false,
guiderCanScanQrcode: true,//导购是否有扫一扫功能 guiderCanScanQrcode: true,//导购是否有扫一扫功能
isOpenSelfMention: false, // 是否开启门店自提 isOpenSelfMention: false, // 是否开启门店自提
...@@ -299,6 +309,7 @@ const prod_brand_config = { ...@@ -299,6 +309,7 @@ const prod_brand_config = {
contactUsPluginId: '', contactUsPluginId: '',
hasTrial: false, hasTrial: false,
isMall: isMall, isMall: isMall,
themeColor: '#cb3c3c',//主题颜色
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
touchPointStorageTime: 30 * 60 * 1000,//单位毫秒 touchPointStorageTime: 30 * 60 * 1000,//单位毫秒
orderingMustOpenCard: false, orderingMustOpenCard: false,
...@@ -321,6 +332,7 @@ const prod_brand_config = { ...@@ -321,6 +332,7 @@ const prod_brand_config = {
contactUsIsOpen: true, contactUsIsOpen: true,
contactUsPluginId: '', contactUsPluginId: '',
hasTrial: false, hasTrial: false,
themeColor: '#cb3c3c',//主题颜色
isMall: isMall, isMall: isMall,
hasLiveVideo: false,//是否有直播功能 hasLiveVideo: false,//是否有直播功能
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
...@@ -345,6 +357,7 @@ const prod_brand_config = { ...@@ -345,6 +357,7 @@ const prod_brand_config = {
contactUsPluginId: 'fbe3bb6f88e7331ca719713910c164a2',//联系我插件 contactUsPluginId: 'fbe3bb6f88e7331ca719713910c164a2',//联系我插件
hasLiveVideo: false,//是否有直播功能 hasLiveVideo: false,//是否有直播功能
hasTrial: false, hasTrial: false,
themeColor: '#cb3c3c',//主题颜色
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
touchPointStorageTime: 30 * 60 * 1000,//单位毫秒 touchPointStorageTime: 30 * 60 * 1000,//单位毫秒
isMall: isMall, isMall: isMall,
...@@ -368,6 +381,7 @@ const prod_brand_config = { ...@@ -368,6 +381,7 @@ const prod_brand_config = {
contactUsPluginId: '50934d036dc2051758f4d934d7100b78', contactUsPluginId: '50934d036dc2051758f4d934d7100b78',
hasTrial: false, hasTrial: false,
isMall: isMall, isMall: isMall,
themeColor: '#cb3c3c',//主题颜色
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
touchPointStorageTime: 30 * 60 * 1000,//单位毫秒 touchPointStorageTime: 30 * 60 * 1000,//单位毫秒
orderingMustOpenCard: true, orderingMustOpenCard: true,
...@@ -390,6 +404,7 @@ const prod_brand_config = { ...@@ -390,6 +404,7 @@ const prod_brand_config = {
contactUsIsOpen: false, contactUsIsOpen: false,
contactUsPluginId: '', contactUsPluginId: '',
hasTrial: true, hasTrial: true,
themeColor: '#cb3c3c',//主题颜色
isMall: isMall, isMall: isMall,
canUseWechatAddress: false,//是否使用获取微信地址 canUseWechatAddress: false,//是否使用获取微信地址
touchPointStorageTime: 30 * 60 * 1000,//单位毫秒 touchPointStorageTime: 30 * 60 * 1000,//单位毫秒
...@@ -507,6 +522,8 @@ let canRefundDaysAfterDelivery = PROJECT_ENV == 'prod' ? prod_brand_config[BRANC ...@@ -507,6 +522,8 @@ let canRefundDaysAfterDelivery = PROJECT_ENV == 'prod' ? prod_brand_config[BRANC
let touchPointStorageTime = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].touchPointStorageTime : 1800000; let touchPointStorageTime = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].touchPointStorageTime : 1800000;
let openRefundTips = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].openRefundTips : true; let openRefundTips = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].openRefundTips : true;
let refundTips = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].refundTips : '温馨提示:退货通过审核后需将清单随包裹一起寄回或纸条备注(订单号与退货商品款号)【请务必审核通过后24小时内填写寄回运单号,拒签到付/顺丰/EMS/天天快递 不影响二次销售】'; let refundTips = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].refundTips : '温馨提示:退货通过审核后需将清单随包裹一起寄回或纸条备注(订单号与退货商品款号)【请务必审核通过后24小时内填写寄回运单号,拒签到付/顺丰/EMS/天天快递 不影响二次销售】';
let themeColor = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].themeColor : '#cb3c3c';
//配置信息导出 //配置信息导出
const envInfo = (() => { const envInfo = (() => {
return { return {
...@@ -534,6 +551,7 @@ const envInfo = (() => { ...@@ -534,6 +551,7 @@ const envInfo = (() => {
touchPointStorageTime: touchPointStorageTime, touchPointStorageTime: touchPointStorageTime,
openRefundTips : openRefundTips, openRefundTips : openRefundTips,
refundTips : refundTips, refundTips : refundTips,
themeColor : themeColor,
} }
})() })()
......
...@@ -3,34 +3,55 @@ const app = getApp() ...@@ -3,34 +3,55 @@ const app = getApp()
const wxService = require('../../utils/wxService') const wxService = require('../../utils/wxService')
import { Integer } from '../../utils/integerDigitalConvertion' import { Integer } from '../../utils/integerDigitalConvertion'
const { memberId, member } = wx.getStorageSync('_baseUserInfo') const { memberId, member } = wx.getStorageSync('_baseUserInfo')
const defaultCategoryImg = 'https://img3.bigaka.com/prd/3001/202004/20200428/30012dfcf171-5140-40fc-babd-4482da4f7a1a.jpg';
const defaultWidthCategoryImg = 'https://img3.bigaka.com/prd/3001/202004/20200428/300168439317-6b28-4947-9054-b6d08b9081ce.jpg';
wxService.page({ wxService.page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
curMenu: [0, 0], currentFirstCategory : {},
navData: [], navData: [],
secondCategory : [],
defaultCategoryImg : defaultCategoryImg,
defaultWidthCategoryImg : defaultWidthCategoryImg,
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let memberId = options.memberId; let share_memberId = options.memberId;
if (memberId) { if (share_memberId) {
let tentacleInfo = { let tentacleInfo = {
content: '分类', content: '分类',
title: '分类', title: '分类',
tentacleId: memberId, tentacleId: share_memberId,
contentType: app.globalData.contants.SHARE_TYPE.CLASSIFY, contentType: app.globalData.contants.SHARE_TYPE.CLASSIFY,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销 type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}; };
this.generatePointObject(tentacleInfo); 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}`,
});
}, },
/** /**
...@@ -44,14 +65,7 @@ wxService.page({ ...@@ -44,14 +65,7 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 1
})
}
this.getCategoryList()
}, },
// 分类列表 // 分类列表
...@@ -60,70 +74,75 @@ wxService.page({ ...@@ -60,70 +74,75 @@ wxService.page({
title: '加载中' title: '加载中'
}) })
wxService.get(`/sale/product/mallCategory/buyer/findCategoryTree`).then(res => { wxService.get(`/sale/product/mallCategory/buyer/findCategoryTree`).then(res => {
const { result, data } = res.data let { result, data } = res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading();
data = data ? data : [];
data.forEach(item => {
item.active = false;
});
// 处理三级标识
this.handleFirstCategoryHasThirdChildren(data);
if(data.length > 0){
data[0].active = true;
this.data.currentFirstCategory = data[0];
this.data.secondCategory = data[0].children ? data[0].children : [];
this.data.secondCategory = this.handleSecondCategoryChildren(this.data.secondCategory);
}
this.setData({ this.setData({
navData: data navData: data,
}) secondCategory : this.data.secondCategory,
currentFirstCategory : this.data.currentFirstCategory,
});
} }
}).finally(() => { }).finally(() => {
wx.hideLoading() wx.hideLoading()
}) })
}, },
selectMenu: function (event) { selectMenu: function (e) {
const { id1, id2, name1, name2 } = event.target.dataset let index = e.currentTarget.dataset.index;
// xm_bi.Event.stat("classClick", { this.data.navData.forEach(item => {
// "className": name2, item.active = false;
// "classType": "中类", });
// "classID": id2 this.data.navData[index].active = true;
// }) this.data.currentFirstCategory = this.data.navData[index];
this.data.secondCategory = this.data.navData[index].children ? this.data.navData[index].children : [];
this.data.secondCategory = this.handleSecondCategoryChildren(this.data.secondCategory);
this.setData({ this.setData({
curMenu: [event.target.dataset.i, event.target.dataset.j] navData: this.data.navData,
}) secondCategory : this.data.secondCategory,
// app.sr.track('browse_category_detail', { currentFirstCategory : this.data.currentFirstCategory,
// first_category: { });
// id: id1,
// name: name1
// },
// second_category: {
// id: id2,
// name: name2
// }
// })
}, },
//处理二级分类下的三级 如果没有三级则children 设置为空数组
handleSecondCategoryChildren(secondCategory){
secondCategory.forEach(item => {
item.children = item.children ? item.children : [];
});
return secondCategory;
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
}, },
/** //处理某一级是不是都有三级分类
* 生命周期函数--监听页面卸载 handleFirstCategoryHasThirdChildren(navData){
*/ navData.forEach(first => {
onUnload: function () { first.hasThirdChildren = false;
let firstChildren = first.children ? first.children : [];
}, if(firstChildren.length > 0){
for(let i = 0 ;i < firstChildren.length ; i ++){
/** firstChildren[i].children = firstChildren[i].children ? firstChildren[i].children : [];
* 页面相关事件处理函数--监听用户下拉动作 if(firstChildren[i].children.length > 0){
*/ first.hasThirdChildren = true;
onPullDownRefresh: function () { break;
}
}
}
});
}, },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
......
{ {
"navigationBarTitleText": "分类", "navigationBarTitleText": "分类",
"disableScroll" : true,
"usingComponents": { "usingComponents": {
"go-home": "/component/goHome/goHome", "go-home": "/component/goHome/goHome",
"go-guid": "/component/goGuid/goGuid" "go-guid": "/component/goGuid/goGuid"
......
...@@ -2,64 +2,72 @@ ...@@ -2,64 +2,72 @@
<view class="nav-container search-top"> <view class="nav-container search-top">
<scroll-view class="nav-menu" scroll-y="true"> <scroll-view class="nav-menu" scroll-y="true">
<view <view wx:for="{{navData}}" wx:key="*this" wx:for-index="index" wx:for-item="item" class="menu-item">
wx:for="{{navData}}" <view class="menu-name {{ item.active ? ' theme-text-color' : ''}}"
wx:key="{{j}}" data-index="{{index}}" data-name="{{item.label}}" data-id="{{item.id}}" bindtap="selectMenu">
wx:for-index="j" {{item.label}}
wx:for-item="menuSec"
class="menu-item{{j == curMenu[1] ? ' active' : ''}}"
>
<view
class="menu-name{{j == curMenu[1] ? ' theme-text-color' : ''}}"
data-j="{{j}}"
data-name="{{menuSec.label}}"
data-id="{{menuSec.id}}"
bindtap="selectMenu"
>{{menuSec.label}}
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<scroll-view class="nav-contents" scroll-y="true"> <scroll-view class="nav-contents clear-box" scroll-y="true" wx:if="{{currentFirstCategory.id}}">
<view <!-- 二级分类 -->
wx:for="{{navData}}" <view class="second-category" wx:if="{{!currentFirstCategory.hasThirdChildren}}">
wx:key="{{j}}" <!-- 无三级分类时 -->
wx:for-index="j" <!-- 显示一级图片 -->
wx:for-item="menuSec" <view class="img-con">
class="nav-content{{j == curMenu[1] ? ' active' : ''}}" <image
> data-id="{{currentFirstCategory.id}}"
<navigator data-label="{{currentFirstCategory.label}}"
hover-class="none" bindtap="onTapToGoodsList"
class="sec-menu-image" src="{{currentFirstCategory.image ? currentFirstCategory.image : defaultWidthCategoryImg}}"
open-type="navigate" mode="widthFix"></image>
url="/subPackage/page/pages/categoryPro/categoryPro?id={{menuSec.id}}&name={{menuSec.label}}" </view>
>
<image src="{{menuSec.image}}" mode="widthFix" />
</navigator>
<view class="menu-list"> <view class="menu-list">
<view <view wx:for="{{secondCategory}}" wx:key="*this" wx:for-index="k" wx:for-item="second" class="menu-third">
wx:for="{{menuSec.children}}" <view data-id="{{second.id}}" data-name="{{second.label}}"
wx:key="{{k}}" data-id="{{second.id}}"
wx:for-index="k" data-label="{{second.label}}"
wx:for-item="menuThr" bindtap="onTapToGoodsList">
class="menu-third" <image src="{{second.image ? second.image : defaultCategoryImg}}" class="thr-menu-image" mode="aspectFill"/>
> <view class="thr-menu-name">{{second.label}}</view>
<view data-id="{{menuThr.id}}" data-name="{{menuThr.label}}" bindtap="navPage"> </view>
<navigator </view>
hover-class="none" </view>
class="sec-menu-image" </view>
open-type="navigate" <!-- 有三级分类时 -->
url="/subPackage/page/pages/categoryPro/categoryPro?id={{menuThr.id}}&name={{menuThr.label}}" <view class="second-category" wx:if="{{currentFirstCategory.hasThirdChildren}}">
> <view class="category-item" wx:for="{{secondCategory}}" wx:key="*this" wx:for-item="item">
<image src="{{menuThr.image}}" class="thr-menu-image" /> <view class="img-con">
<view class="thr-menu-name">{{menuThr.label}}</view> <image data-id="{{secondCategory.id}}"
</navigator> data-label="{{secondCategory.label}}"
bindtap="onTapToGoodsList"
src="{{item.image ? item.image : defaultWidthCategoryImg}}" mode="widthFix"></image>
</view>
<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>
</view>
</view>
<!-- 具体的布局 -->
<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}}"
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>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<!--goHome--> <!--goHome-->
......
...@@ -11,27 +11,41 @@ page { ...@@ -11,27 +11,41 @@ page {
.nav-menu { .nav-menu {
flex: 0; flex: 0;
width: 25%; width: 25%;
padding-bottom: 50px; padding-bottom: 20px;
} }
.nav-menu .menu-item { .nav-menu .menu-item {
position: relative; position: relative;
/* padding: 0 16rpx; */ /* padding: 0 16rpx; */
padding: 0 28rpx;
font-size: 26rpx; font-size: 26rpx;
color: #000000; color: #000000;
line-height: 100rpx; height: 100rpx;
text-align: center; } display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.nav-menu .menu-item .menu-name { .nav-menu .menu-item .menu-name {
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
font-size: 26rpx; } font-size: 26rpx;
padding: 0 20rpx;
width: 100%;
}
.clear-box{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.nav-contents { .nav-contents {
flex: 1; flex: 1;
width: 75%; } width: 75%;
padding: 30rpx;
}
.nav-content { .nav-content {
display: none; display: none;
...@@ -61,19 +75,20 @@ page { ...@@ -61,19 +75,20 @@ page {
} }
.menu-list:after{ .menu-list:after{
content: ''; content: '';
width: 150rpx; width: 140rpx;
} }
.menu-third { .menu-third {
width: 150rpx; width: 140rpx;
text-align: center; text-align: center;
padding-bottom: 32rpx; } padding-bottom: 32rpx;
}
.menu-third image { .menu-third image {
width: 150rpx; width: 140rpx;
height: 150rpx; height: 140rpx;
border-radius: 2rpx; border-radius: 2rpx;
} }
.thr-menu-name { .thr-menu-name {
font-size: 24rpx; font-size: 24rpx;
...@@ -83,3 +98,59 @@ page { ...@@ -83,3 +98,59 @@ page {
font-stretch: normal; font-stretch: normal;
letter-spacing: -1px; letter-spacing: -1px;
color: #333; } color: #333; }
.second-category{
width: 100%;
height: auto;
}
.img-con{
width: 100%;
margin-bottom: 30rpx;
}
.img-con img{
width: 100%;
}
.category-item{
width: 100%;
height: auto;
}
.category-item .more{
width: 100%;
height: auto;
padding: 10rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
color: #333333;
padding-bottom: 20rpx;
border-bottom: solid 1rpx #dddddd;
margin-bottom: 20rpx;
}
.category-item .more label{
font-size: 28rpx;
font-weight: bold;
}
.category-item .more .right-more{
font-size: 24rpx;
color: #999999;
display: flex;
align-items: center;
justify-content: flex-end;
font-weight: 500;
}
.category-item .more .right-more image{
width: 18rpx;
height: 24rpx;
margin-left: 10rpx;
}
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
</view> </view>
<view class="rg-item-info" bindtap="onTapChangeCheckPointDeductOpenStatus"> <view class="rg-item-info" bindtap="onTapChangeCheckPointDeductOpenStatus">
<view class="point-info">可用<label>{{avaliablePoint}}</label>积分,抵 <label>{{pointDeductMoney}}</label>元 </view> <view class="point-info">可用<label>{{avaliablePoint}}</label>积分,抵 <label>{{pointDeductMoney}}</label>元 </view>
<icon color="rgb(0,125,99)" size="20" type="{{deductCheckStatus ? 'success' : 'circle'}}" role="img"></icon> <icon color="{{themeColor}}" size="20" type="{{deductCheckStatus ? 'success' : 'circle'}}" role="img"></icon>
</view> </view>
</view> </view>
<!-- --> <!-- -->
......
...@@ -62,7 +62,7 @@ page { ...@@ -62,7 +62,7 @@ page {
.bottom-code{ .bottom-code{
font-size: 40rpx; font-size: 40rpx;
color: #05c35b; color: var(--themecolor);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-end; justify-content: flex-end;
......
...@@ -10,28 +10,56 @@ wxService.page({ ...@@ -10,28 +10,56 @@ wxService.page({
*/ */
data: { data: {
couponDetail:{}, couponDetail:{},
cardno: '' cardno: '',
couponType : '',
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow () { onShow () {
const {cardno} = this.options
this.getCouponDetail(cardno)
this.setData({
cardno
})
}, },
onLoad() { onLoad(options) {
wx.hideShareMenu(); wx.hideShareMenu();
const {cardno,type} = options
this.data.couponType = type;
this.getCouponDetail(cardno,type)
this.setData({
cardno : cardno,
couponType : type,
});
}, },
// 卡券详情 // 卡券详情
getCouponDetail(id){ getCouponDetail(id,type){
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) });
if(!type){
this.getNormalCouponInfo(id);
}
//支付券
else if(type == 1){
this.getPayCardInfo(id);
}
//包邮券
else if(type == 2){
this.getPostalVoucherInfo(id);
}
},
//获取支付券详情
getPayCardInfo(id){
},
//获取包邮券详情
getPostalVoucherInfo(id){
},
//获取优惠券相信
getNormalCouponInfo(id){
wxService.post(`/coupon/coupon/get?cardNo=${id}`).then(res => { wxService.post(`/coupon/coupon/get?cardNo=${id}`).then(res => {
const {result,data} = res.data const {result,data} = res.data
if(result == 0){ if(result == 0){
...@@ -52,6 +80,8 @@ wxService.page({ ...@@ -52,6 +80,8 @@ wxService.page({
wx.hideLoading() wx.hideLoading()
}) })
}, },
//展示券码
handelPresentCouponCode(e) { handelPresentCouponCode(e) {
// let data = e.currentTarget.dataset // let data = e.currentTarget.dataset
const {cardno} = this.data const {cardno} = this.data
......
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
<view class='coupon-name fs-28'>{{couponDetail.couponSetting.title}}</view> <view class='coupon-name fs-28'>{{couponDetail.couponSetting.title}}</view>
<view class='coupon-desc fs-28'>{{couponDetail.coupon.startTime}} 至 {{couponDetail.coupon.endTime}}</view> <view class='coupon-desc fs-28'>{{couponDetail.coupon.startTime}} 至 {{couponDetail.coupon.endTime}}</view>
</view> </view>
<view class='coupon-code fs-24' bindtap="handelPresentCouponCode">出示券码</view> <view class='coupon-code fs-24' bindtap="handelPresentCouponCode" wx:if="{{!couponType}}">出示券码</view>
<view class='coupon-code fs-24' wx:if="{{couponType == 1}}">支付券</view>
<view class='coupon-code fs-24' wx:if="{{couponType == 2}}">包邮券</view>
</view> </view>
<view class='integral-detail'> <view class='integral-detail'>
<!-- <view class='integral-list'> <!-- <view class='integral-list'>
...@@ -30,7 +32,7 @@ ...@@ -30,7 +32,7 @@
<!--goHome--> <!--goHome-->
<go-home/> <go-home/>
<floatNav bind:getAuth="_getUserInfo" bind:updatePage="updatePage"/> <floatNav bind:getAuth="_getUserInfo" bind:updatePage="updatePage"/>
<view class="position-bottom"> <view class="position-bottom" wx:if="{{!couponType}}">
<button type='primary' class="redeem-now" bindtap='handelPresentCouponCode'>出示券码</button> <button type='primary' class="redeem-now" bindtap='handelPresentCouponCode'>出示券码</button>
</view> </view>
......
...@@ -42,10 +42,14 @@ ...@@ -42,10 +42,14 @@
color: #ffffff; color: #ffffff;
position: absolute; position: absolute;
right: 20rpx; right: 20rpx;
top: 30rpx; top: 0rpx;
width: 24rpx; width: 24rpx;
word-wrap: break-word; word-wrap: break-word;
font-weight: bold; font-weight: bold;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
} }
.integral-detail{ .integral-detail{
margin: 90rpx 0 160rpx 0; margin: 90rpx 0 160rpx 0;
......
...@@ -9,68 +9,44 @@ wxService.page({ ...@@ -9,68 +9,44 @@ wxService.page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
nav:[
{
type:'1',
name:'可使用'
},{
type:'2',
name:'已失效'
}
],
pageNo: 1,
pageSize: 10,
invalidPageNo: 1,
totalPages: 0,
totalElements: 0,
invalidTotalElements: 0,
couponList: [], couponList: [],
invalidCouponList: [],
invalidTotalPages: 0,
invalidTotalElements: 0,
currentTab: 0, currentTab: 0,
noMoreCoupon: false, noMoreCoupon: false,
noMoreCouponInvalid: false // 支付券
payCouponList : [],
//包邮券
postalVoucherList : []
}, },
//滑动切换 //滑动切换
swiperTab: function (e) { swiperTab: function (e) {
const {current} = e.detail const {current} = e.detail
if (this.data.currentTab == current) { this.tabSwitch(current);
return false;
} else {
this.setData({
currentTab: current
})
}
// 可使用
if( current == 0 ){
this.getCouponList(1,10,1)
}else if( current == 1){
// 失效
this.getCouponList(1,10,0)
}
}, },
// 点击切换 // 点击切换
clickTab: function (e) { clickTab: function (e) {
const {current} = e.target.dataset const {current} = e.target.dataset
if (this.data.currentTab == current) { this.tabSwitch(current);
return false; },
} else { //tab栏切换
tabSwitch(current){
if (this.data.currentTab == current) return false;
this.data.currentTab = current;
this.setData({ this.setData({
currentTab: current, currentTab: this.data.currentTab,
// couponList: [], // 清空数据 });
// invalidCouponList: [],
})
}
// 可使用 // 所有可使用优惠券
if( current == 0 ){ if( current == 0 ){
this.getCouponList(1,10,1) this.getCouponList(1,10,1)
}else if( current == 1){ }else if( current == 1){
// 失效 //微信支付券
this.getCouponList(1,10,0)
} }
}, else if(current == 2){
//包邮券
}
} ,
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -82,13 +58,19 @@ wxService.page({ ...@@ -82,13 +58,19 @@ wxService.page({
*/ */
onShow () { onShow () {
// 可使用 已失效 // 可使用 已失效
this.getCouponList(1,10,1) this.getCouponList(1,10,1);
this.getCouponList(1,10,0)
}, },
//跳转到卡券详情
handelPresentCouponDetail(e) { handelPresentCouponDetail(e) {
let {cardno} = e.currentTarget.dataset let {cardno,type} = e.currentTarget.dataset
wxService.router(`/pages/couponDetail/couponDetail`).search({cardno}) if(type){
wxService.router(`/pages/couponDetail/couponDetail`).search({cardno:cardno,type:type});
}
else{
wxService.router(`/pages/couponDetail/couponDetail`).search({cardno:cardno});
}
}, },
//
handelPresentCouponCode(e) { handelPresentCouponCode(e) {
let {cardno} = e.currentTarget.dataset let {cardno} = e.currentTarget.dataset
wxService.router(`/pages/couponCodeDetail/couponCodeDetail`).search({cardno}) wxService.router(`/pages/couponCodeDetail/couponCodeDetail`).search({cardno})
...@@ -96,59 +78,32 @@ wxService.page({ ...@@ -96,59 +78,32 @@ wxService.page({
//获取优惠券列表 //获取优惠券列表
getCouponList(pageNo,pageSize,statusNum){ getCouponList(pageNo,pageSize,statusNum){
//获取我的优惠券
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) });
let params;
if(statusNum == 1){ let params = {};
params = { params.status = 1;
status: 1 this.data.couponList = [];
}
if(pageNo == 1){
this.setData({
pageNo: 1,
couponList: [], // 清空数据
})
}
} else {
params = {
statusNot: 1
}
if(pageNo == 1){
this.setData({
invalidCouponList: [],
invalidPageNo: 1
})
}
}
wxService.post(`/coupon/coupon/listWithMember4Mina?number=${pageNo}&size=${pageSize}`, params).then(res => { wxService.post(`/coupon/coupon/listWithMember4Mina?number=1&size=1000000`, params).then(res => {
if(!res) return false if(!res) return false
const {result,data} = res.data const {result,data} = res.data
if(result == 0){ if(result == 0){
console.log(res)
wx.hideLoading() wx.hideLoading()
// 处理时间显示 // 处理时间显示
if(!data.content) return false if(!data.content) return false
data.content.forEach(item=> { data.content.forEach(item=> {
item.startTime = item.startTime.substring(0,10) item.startTime = item.startTime.substring(0,10)
item.endTime = item.endTime.substring(0,10) item.endTime = item.endTime.substring(0,10)
}) });
// 可使用 or 已失效
if(statusNum == 1) {
// couponList
this.setData({
couponList: this.data.pageNo == 1? [...data.content]: [...this.data.couponList,...data.content],
totalPages: data.totalPages,
totalElements: data.totalElements
})
} else {
// invalidCouponList
this.setData({ this.setData({
invalidCouponList: this.data.invalidPageNo == 1? [...data.content]: [...this.data.invalidCouponList,...data.content], couponList: data.content,
invalidTotalPages: data.totalPages, });
invalidTotalElements: data.totalElements
})
}
} }
}).finally(() => { }).finally(() => {
...@@ -164,29 +119,10 @@ wxService.page({ ...@@ -164,29 +119,10 @@ wxService.page({
}, },
//scoll view 触到底部 //scoll view 触到底部
onBottom(){ onBottom(){
const { currentTab, pageNo, pageSize, totalPages, invalidPageNo, invalidTotalPages } = this.data
if (currentTab == 0) {
if (pageNo < totalPages) {
this.setData({
pageNo: pageNo + 1,
})
// status 1
this.getCouponList(this.data.pageNo, pageSize, 1)
} else {
this.setData({
noMoreCoupon: true
})
}
} else {
this.setData({
noMoreCouponInvalid: true
})
}
}, },
/** //跳转到我的购买优惠券记录
* 页面上拉触底事件的处理函数 onTapToBuyCouponRecords(){
*/
onReachBottom: function () {
}, },
}) })
\ No newline at end of file
<!--pages/userCenter.wxml--> <!--pages/userCenter.wxml-->
<view class='page-coupons'> <view class='page-coupons'>
<view class="swiper-tab"> <view class="swiper-tab">
<view class="swiper-tab-item {{currentTab==0?'active':''}}" data-current="0" bindtap="clickTab">可使用 ({{totalElements}})</view> <view class="swiper-tab-item {{currentTab==0?'active':''}}"
<view class="swiper-tab-item {{currentTab==1?'active':''}}" data-current="1" bindtap="clickTab">已失效 ({{invalidTotalElements}})</view> data-current="0" bindtap="clickTab">优惠券</view>
<view class="swiper-tab-item {{currentTab==1?'active':''}}"
data-current="1" bindtap="clickTab">微信支付券</view>
<view class="swiper-tab-item {{currentTab==2?'active':''}}"
data-current="2" bindtap="clickTab">包邮券</view>
</view> </view>
<!--bindchange="swiperTab"--> <!--bindchange="swiperTab"-->
<swiper current="{{currentTab}}" duration="300" bindchange="swiperTab"> <swiper current="{{currentTab}}" duration="300" bindchange="swiperTab">
<swiper-item> <swiper-item >
<scroll-view scroll-y wx:if="{{couponList.length}}" bindscrolltolower="onBottom"> <!-- 优惠券 -->
<scroll-view scroll-y wx:if="{{couponList.length}}" bindscrolltolower="onBottom" style="height:86vh;">
<view class='coupon-wrap'> <view class='coupon-wrap'>
<view <view
class='coupon-list' class='coupon-list'
wx:for="{{couponList}}" wx:for="{{couponList}}"
wx:for-item="item" wx:for-item="item"
wx:for-index="k" wx:for-index="k"
wx:key="{{k}}" wx:key="{{k}}">
>
<view <view
data-title="{{item.title}}" data-title="{{item.title}}"
data-cardNo="{{item.cardNo}}" data-cardNo="{{item.cardNo}}"
data-id="{{item.couponId}}" data-id="{{item.couponId}}"
bindtap="handelPresentCouponDetail">
<image class='coupon-bg'
src='https://img3.bigaka.com/prd/3001/202003/20200309/300109875abd-15b0-4de3-9673-18d2d1ee4e20.png' />
<view class='coupon-img'>
<image wx:if="{{item.takeCouponBgimg}}" class='coupon-bg' src='{{item.takeCouponBgimg}}' mode="aspectFit"/>
<image wx:else src='https://img3.bigaka.com/prd/3001/202003/20200309/30018086c13a-4579-47ed-a16e-c74cb8010c1d.png' />
</view>
<view class='coupon-info'>
<view class='coupon-name fs-28'>{{item.title}}</view>
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<!-- <view class='coupon-desc fs-24'>{{item.notice}}</view> -->
</view>
<view class='coupon-code fs-24' data-cardNo="{{item.cardNo}}" catchtap="handelPresentCouponCode">出示劵码</view>
</view>
</view>
</view>
</scroll-view>
<view class='empty-wrap' wx:if="{{!couponList.length}}">
<view class='empty-info'>
<image class='empty-img'
src='https://img3.bigaka.com/prd/3001/202003/20200309/30012bce7628-f373-4fa7-a6a4-ada9c1c721d6.png' />
<view class='empty-text'>没有任何优惠券~</view>
</view>
</view>
</swiper-item>
<!-- 微信支付券 -->
<swiper-item>
<scroll-view scroll-y wx:if="{{payCouponList.length}}">
<view class='coupon-wrap'>
<view
class='coupon-list'
wx:for="{{payCouponList}}"
wx:for-item="item"
wx:for-index="k"
wx:key="*this">
<view
data-title="{{item.title}}"
data-cardNo="{{item.cardNo}}"
data-id="{{item.couponId}}"
data-type="1"
bindtap="handelPresentCouponDetail" bindtap="handelPresentCouponDetail"
> >
<image class='coupon-bg' <image class='coupon-bg'
...@@ -33,37 +77,38 @@ ...@@ -33,37 +77,38 @@
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view> <view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<!-- <view class='coupon-desc fs-24'>{{item.notice}}</view> --> <!-- <view class='coupon-desc fs-24'>{{item.notice}}</view> -->
</view> </view>
<view class='coupon-code fs-24' data-cardNo="{{item.cardNo}}" catchtap="handelPresentCouponCode">出示劵码</view> <view class='coupon-code fs-24' data-cardNo="{{item.cardNo}}">查看详情</view>
</view> </view>
</view> </view>
</view> </view>
<no-more wx:if="{{noMoreCoupon}}" />
</scroll-view> </scroll-view>
<view class='empty-wrap' wx:if="{{!couponList.length}}">
<view class='empty-wrap' wx:if="{{!payCouponList.length}}">
<view class='empty-info'> <view class='empty-info'>
<image class='empty-img' <image class='empty-img'
src='https://img3.bigaka.com/prd/3001/202003/20200309/30012bce7628-f373-4fa7-a6a4-ada9c1c721d6.png' /> src='https://img3.bigaka.com/prd/3001/202003/20200309/30012bce7628-f373-4fa7-a6a4-ada9c1c721d6.png' />
<view class='empty-text'>没有任何卡劵</view> <view class='empty-text'>没有任何支付券~</view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
<!-- 包邮券 -->
<swiper-item> <swiper-item>
<scroll-view scroll-y wx:if="{{invalidCouponList.length}}"> <scroll-view scroll-y wx:if="{{postalVoucherList.length}}">
<view class='coupon-wrap'> <view class='coupon-wrap'>
<view <view
class='coupon-list' class='coupon-list'
wx:for="{{invalidCouponList}}" wx:for="{{postalVoucherList}}"
wx:for-item="item" wx:for-item="item"
wx:for-index="k" wx:for-index="k"
wx:key="{{k}}" wx:key="{{k}}"
> >
<view class='invalid-coupon' /> <view
<!--5 已使用 !5 过期--> data-title="{{item.title}}"
<image wx:if="{{item.status == 5}}" data-cardNo="{{item.cardNo}}"
src='https://img3.bigaka.com/prd/3001/202003/20200309/3001c35498ca-ec0d-42b5-a46a-afb8f66ce996.png' class='invalid-img' /> data-id="{{item.couponId}}"
<image wx:else data-type="2"
src='https://img3.bigaka.com/prd/3001/202003/20200309/30018297bfb0-e2b0-4687-838e-e78463eae06f.png' class='invalid-img' /> bindtap="handelPresentCouponDetail"
>
<image class='coupon-bg' <image class='coupon-bg'
src='https://img3.bigaka.com/prd/3001/202003/20200309/300109875abd-15b0-4de3-9673-18d2d1ee4e20.png' /> src='https://img3.bigaka.com/prd/3001/202003/20200309/300109875abd-15b0-4de3-9673-18d2d1ee4e20.png' />
<view class='coupon-img'> <view class='coupon-img'>
...@@ -75,23 +120,25 @@ ...@@ -75,23 +120,25 @@
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view> <view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<!-- <view class='coupon-desc fs-24'>{{item.notice}}</view> --> <!-- <view class='coupon-desc fs-24'>{{item.notice}}</view> -->
</view> </view>
<view class='coupon-code fs-24'>出示劵码</view> <view class='coupon-code fs-24' data-cardNo="{{item.cardNo}}">查看详情</view>
</view>
</view> </view>
</view> </view>
<view class='no-more-exp'>--- 已失效优惠券最多显示10条 ---</view>
<no-more wx:if="{{noMoreCouponInvalid}}" />
</scroll-view> </scroll-view>
<view class='empty-wrap' wx:if="{{!invalidCouponList.length}}"> <view class='empty-wrap' wx:if="{{!postalVoucherList.length}}">
<view class='empty-info'> <view class='empty-info'>
<image class='empty-img' <image class='empty-img'
src='https://img3.bigaka.com/prd/3001/202003/20200309/30012bce7628-f373-4fa7-a6a4-ada9c1c721d6.png' /> src='https://img3.bigaka.com/prd/3001/202003/20200309/30012bce7628-f373-4fa7-a6a4-ada9c1c721d6.png' />
<view class='empty-text'>没有任何卡劵</view> <view class='empty-text'>没有任何包邮券~</view>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
<!-- 优惠券购买记录 -->
<view class="coupon-buy-records" wx:if="{{currentTab == 0}}" bindtap="onTapToBuyCouponRecords">优惠券购买记录</view>
<!--goHome--> <!--goHome-->
<go-home/> <go-home/>
<floatNav bind:getAuth="_getUserInfo" bind:updatePage="updatePage"/> <floatNav bind:getAuth="_getUserInfo" bind:updatePage="updatePage"/>
......
...@@ -22,14 +22,15 @@ scroll-view{ ...@@ -22,14 +22,15 @@ scroll-view{
color: #666666; color: #666666;
} }
.nav-active{ .nav-active{
color: #05c35b; color: var(--themecolor);
border-bottom: 3rpx solid #05c35b; border-bottom: 3rpx solid var(--themecolor);
} }
.empty-wrap{ .empty-wrap{
width: 300rpx; width: 300rpx;
margin: 190rpx auto 0; margin: 190rpx auto 0;
text-align: center; text-align: center;
} }
.empty-img{ .empty-img{
width: 197rpx; width: 197rpx;
height: 176rpx; height: 176rpx;
...@@ -82,7 +83,7 @@ scroll-view{ ...@@ -82,7 +83,7 @@ scroll-view{
left: 236rpx; left: 236rpx;
} }
.coupon-name{ .coupon-name{
color:#05c35b; color:var(--themecolor);
} }
.coupon-time{ .coupon-time{
color:#999999; color:#999999;
...@@ -135,15 +136,34 @@ scroll-view{ ...@@ -135,15 +136,34 @@ scroll-view{
text-align: center; text-align: center;
} }
.active{ .active{
color: #05c35b; color: var(--themecolor);
border-bottom: 4rpx solid #05c35b; border-bottom: 4rpx solid var(--themecolor);
} }
swiper { swiper {
width: 100%; width: 100%;
flex: 1; flex: 1;
height:90vh; height:91vh;
padding-bottom:20rpx; /* padding-bottom:20rpx; */
position: absolute; position: absolute;
overflow: scroll; overflow: scroll;
top: 100rpx; top: 100rpx;
} }
.coupon-buy-records{
background: var(--themecolor);
width: 100%;
height: 80rpx;
color: #ffffff;
font-size: 28rpx;
position: fixed;
bottom: 0;
left: 0;
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
}
.coupon-buy-records:active{
opacity: 0.7;
}
\ No newline at end of file
...@@ -20,7 +20,7 @@ page{ ...@@ -20,7 +20,7 @@ page{
position: relative; position: relative;
} }
.spend-status{ .spend-status{
color: #05c35b; color: var(--themecolor);
position: absolute; position: absolute;
right: 0; right: 0;
bottom: 0; bottom: 0;
......
...@@ -201,7 +201,7 @@ wxService.page({ ...@@ -201,7 +201,7 @@ wxService.page({
content : '恭喜您获得一个集点', content : '恭喜您获得一个集点',
showCancel : false, showCancel : false,
confirmText : '确认领取', confirmText : '确认领取',
confirmColor : '#05C35B', confirmColor : themecolor,
success (res) { success (res) {
if(res.confirm){ if(res.confirm){
self.userConfirmGetCollectionPoint(id); self.userConfirmGetCollectionPoint(id);
......
...@@ -181,6 +181,7 @@ ...@@ -181,6 +181,7 @@
<sku-popup <sku-popup
bind:getMobile="userGetMobile" bind:getMobile="userGetMobile"
currentHasMobile="{{currentHasMobile}}"
product-name="{{productInfo.productName}}" product-name="{{productInfo.productName}}"
spec-item="{{productInfo.specItemList}}" spec-item="{{productInfo.specItemList}}"
good-type="{{productInfo.productType}}" good-type="{{productInfo.productType}}"
......
...@@ -54,7 +54,7 @@ page{ ...@@ -54,7 +54,7 @@ page{
width: 88rpx; width: 88rpx;
height: 30rpx; height: 30rpx;
border-radius: 3rpx; border-radius: 3rpx;
background-color: rgba(0,125,99, 0.08); background-color: var(--themeColorRgba01);
font-size: 13rpx; font-size: 13rpx;
color: var(--themecolor); color: var(--themecolor);
line-height: 30rpx; line-height: 30rpx;
...@@ -238,7 +238,7 @@ page{ ...@@ -238,7 +238,7 @@ page{
width: 240rpx; width: 240rpx;
} }
.product-footer .footer-buttons button.btn-cart { .product-footer .footer-buttons button.btn-cart {
background: rgba(0,125,99,0.71); background: var(--themeColorRgba07);
} }
.product-footer .footer-buttons button.buy-button { .product-footer .footer-buttons button.buy-button {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<view class="" wx:if="{{pItem.type == 2}}"> <view class="" wx:if="{{pItem.type == 2}}">
<person-center isVip="{{isVip}}" bind:getAuth="_getUserInfo" <person-center isVip="{{isVip}}" bind:getAuth="_getUserInfo"
bind:getMobile="userGetMobile" bind:getMobile="userGetMobile"
currentHasMobile="{{currentHasMobile}}"
currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}" currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}"
person-data="{{pItem.customer}}" integral-num="{{integralNum}}" person-data="{{pItem.customer}}" integral-num="{{integralNum}}"
valueCardNum="{{valueCardNum}}" coupon-num="{{couponNum}}" token="{{token}}"/> valueCardNum="{{valueCardNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.8.2", "libVersion": "2.8.2",
"appid": "wx313ec36b710125d4", "appid": "wxc3b64b09b1d3dfc2",
"projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E", "projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
...@@ -645,6 +645,20 @@ ...@@ -645,6 +645,20 @@
"pathName": "pages/pointList/pointList", "pathName": "pages/pointList/pointList",
"query": "", "query": "",
"scene": null "scene": null
},
{
"id": -1,
"name": "现金购券",
"pathName": "subPackageA/page/pages/moneyBuyCoupon/moneyBuyCoupon",
"query": "",
"scene": null
},
{
"id": -1,
"name": "支付券详情",
"pathName": "subPackageA/page/pages/payCardInfo/payCardInfo",
"query": "id= 704753070554353664",
"scene": null
} }
] ]
} }
......
...@@ -170,7 +170,7 @@ view{ ...@@ -170,7 +170,7 @@ view{
justify-content: center; justify-content: center;
font-size: 22rpx; font-size: 22rpx;
padding: 0 10rpx; padding: 0 10rpx;
background: rgba(0,125,99, 0.2); background: var(--themeColorRgba02);
color: var(--themecolor); color: var(--themecolor);
border-radius: 5rpx; border-radius: 5rpx;
} }
......
...@@ -50,8 +50,8 @@ page { ...@@ -50,8 +50,8 @@ page {
width: 153.8rpx; width: 153.8rpx;
height: 48rpx; height: 48rpx;
border-radius: 33rpx; border-radius: 33rpx;
background-color: rgba(5, 195, 91, 1); background-color: var(--themecolor);
box-shadow: 0rpx 3rpx 10rpx 0rpx rgba(5, 195, 91, 0.3); box-shadow: 0rpx 3rpx 10rpx 0rpx var(--themeColorRgba03);
line-height: 48rpx; line-height: 48rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
font-size: 24rpx; font-size: 24rpx;
...@@ -222,5 +222,5 @@ page { ...@@ -222,5 +222,5 @@ page {
border-right: 1rpx solid rgba(102, 102, 102, 1); border-right: 1rpx solid rgba(102, 102, 102, 1);
} }
.tab-active { .tab-active {
color: rgba(5, 195, 91, 1); color: var(--themecolor);
} }
\ No newline at end of file
...@@ -226,5 +226,5 @@ page { ...@@ -226,5 +226,5 @@ page {
border-right: 1rpx solid rgba(102, 102, 102, 1); border-right: 1rpx solid rgba(102, 102, 102, 1);
} }
.tab-active { .tab-active {
color: rgba(5, 195, 91, 1); color: var(--themecolor);
} }
\ No newline at end of file
...@@ -107,7 +107,7 @@ view{ ...@@ -107,7 +107,7 @@ view{
width: 100%; width: 100%;
height: 90rpx; height: 90rpx;
margin-top: 80rpx; margin-top: 80rpx;
background: -webkit-linear-gradient(left,rgb(0,125,99,0.7),rgb(0,125,99,1)); background: -webkit-linear-gradient(left,var(--themeColorRgba07),var(--themeColor));
border-radius: 8rpx; border-radius: 8rpx;
color: #ffffff; color: #ffffff;
font-size: 28rpx; font-size: 28rpx;
......
...@@ -4,10 +4,17 @@ ...@@ -4,10 +4,17 @@
<!-- {{pages}} --> <!-- {{pages}} -->
<block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem"> <block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
<view wx:if="{{pItem.type == 1}}"> <view wx:if="{{pItem.type == 1}}">
<image-swiper image-data="{{pItem.rotationchart.images}}" bind:updatePage="updatePage" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"/> <image-swiper image-data="{{pItem.rotationchart.images}}"
bind:updatePage="updatePage" bind:getAuth="_getUserInfo"
currentHasUserInfo="{{currentHasUserInfo}}"/>
</view> </view>
<view class="" wx:if="{{pItem.type == 2}}"> <view class="" wx:if="{{pItem.type == 2}}">
<person-center bind:getMobile="userGetMobile" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" valueCardNum="{{valueCardNum}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/> <person-center bind:getMobile="userGetMobile"
currentHasMobile="{{currentHasMobile}}" bind:getAuth="_getUserInfo"
currentHasUserInfo="{{currentHasUserInfo}}"
base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}"
valueCardNum="{{valueCardNum}}"
integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view> </view>
<view class="" wx:if="{{pItem.type == 3}}"> <view class="" wx:if="{{pItem.type == 3}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/> <pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
......
...@@ -29,8 +29,8 @@ view{ ...@@ -29,8 +29,8 @@ view{
width: 174rpx; width: 174rpx;
height: 54rpx; height: 54rpx;
border-radius: 27rpx; border-radius: 27rpx;
background-color: rgba(5, 195, 91, 1); background-color: var(--themecolor);
box-shadow: 0px 3rpx 10rpx 0px rgba(5, 195, 91, 0.3); box-shadow: 0px 3rpx 10rpx 0px var(--themeColorRgba03);
color: #ffffff; color: #ffffff;
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -72,7 +72,7 @@ view{ ...@@ -72,7 +72,7 @@ view{
min-width: 200rpx; min-width: 200rpx;
max-width: 200rpx; max-width: 200rpx;
height: 100%; height: 100%;
background: #05C35B ; background: var(--themecolor);
color: #ffffff; color: #ffffff;
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -281,7 +281,7 @@ view{ ...@@ -281,7 +281,7 @@ view{
.guid-sure{ .guid-sure{
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;
background: linear-gradient(to right, rgba(0,125,99,0.5) , var(--themecolor)); background: linear-gradient(to right, var(--themeColorRgba05) , var(--themecolor));
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
......
// subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.wxml-->
<text>subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.wxml</text>
/* subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.wxss */
\ No newline at end of file
// subPackage/page/pages/valueCard/valueCard.js
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
wxService.page({
/**
* 页面的初始数据
*/
data: {
cardList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// wx.hideShareMenu();
this.getActivityList();
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
//跳转活动详情
onTapToCardInfo(e){
let item = e.currentTarget.dataset.item;
wx.navigateTo({
url: '/subPackageA/page/pages/moneyBuyCouponInfo/moneyBuyCouponInfo?id=' + item.acvivityId,
});
},
//获取有效活动列表
getActivityList(refresh){
wx.showLoading({
title: '加载中..',
});
wxService.post(`/coupon/couponMoneyBuyActivity/buyer/getValidList`,{},null,true).then(res => {
if(res){
let list = res.data.data ? res.data.data : [];
this.data.cardList = list;
this.setData({
cardList: this.data.cardList
});
}
wx.hideLoading();
if(refresh){
setTimeout(() => {
wx.showToast({
title: '刷新成功',
});
wx.hideNavigationBarLoading();
wx.stopPullDownRefresh();
}, 300);
}
});
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
wx.showNavigationBarLoading();
this.getActivityList(true);
},
})
\ No newline at end of file
{
"navigationBarTitleText": "现金购券",
"backgroundTextStyle": "dark",
"enablePullDownRefresh": true,
"usingComponents": {
"empty": "../../../../component/empty/empty"
}
}
\ No newline at end of file
<!--subPackage/page/pages/valueCard/valueCard.wxml-->
<view class='cards-list' wx:if="{{cardList.length > 0}}">
<view class='card-item'
wx:for="{{cardList}}"
wx:for-item="item"
wx:for-index="idx"
wx:key="*this"
data-item="{{item}}"
bindtap='onTapToCardInfo'>
<image src='{{item.listPicture}}' mode='widthFix'></image>
<view class='card-buy-btn'>立即抢购</view>
</view>
</view>
<empty text="暂无超值卡活动~" wx:else/>
<view class='no-more' wx:if="{{cardList.length > 5}}">-- 我也是有底线滴 --</view>
\ No newline at end of file
/* subPackage/page/pages/valueCard/valueCard.wxss */
page{
background: #ffffff;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.cards-list{
width: 100%;
height: auto;
padding: 30rpx;
}
.cards-list .card-item{
width: 100%;
margin-bottom: 20rpx;
position: relative;
}
.cards-list .card-item .card-buy-btn{
position: absolute;
bottom: 20rpx;
right: 20rpx;
width: 174rpx;
height: 54rpx;
border-radius: 27rpx;
background-color: var(--themecolor);
box-shadow: 0px 3rpx 10rpx 0px var(--themeColorRgba03);
color: #ffffff;
display: flex;
align-items: center;
font-size: 24rpx;
justify-content: center;
}
.cards-list .card-item .card-buy-btn:active{
opacity: 0.7;
}
.cards-list .card-item:last-child{
margin-bottom: 0;
}
.cards-list .card-item image{
width: 100%;
display: block;
border-radius: 6rpx;
}
.no-more{
width: 100%;
height: auto;
padding: 30rpx 0;
color: #999999;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file
// subPackage/page/pages/valueCardInfo/valueCardInfo.js
const app = getApp();
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
wxService.page({
/**
* 页面的初始数据
*/
data: {
id: null,
checked: false,
showModal: false,
valueCardInfo: {},
userHasBaseInfo: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.data.id = options.id;
console.log(options)
// wx.hideShareMenu();
this.getValueCardActivityInfo();
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.userHasLogin();
},
//获取当前用户是否登录
userHasLogin() {
const baseUserInfo = wx.getStorageSync('_baseUserInfo');
if (baseUserInfo) {
this.setData({
userHasBaseInfo: true
})
}
else {
this.setData({
userHasBaseInfo: false
})
}
},
//获取活动详情
getValueCardActivityInfo() {
wx.showLoading({
title: '加载中..',
});
wxService.post(`/coupon/couponMoneyBuyActivity/getDetail?id=${this.data.id}`,{},null,true).then(res => {
if (res) {
let obj = res.data.data ? res.data.data : null;
if (obj) {
obj.activityDesc = obj.definition ? JSON.parse(obj.definition) : [];
obj.acPayMoney = parseFloat(obj.buyPrice / 10 / 10).toFixed(2);
obj.startTime = obj.startTime.substring(0, 10);
obj.endTime = obj.endTime.substring(0, 10);
obj.hasDate = obj.activityDesc.filter(item => item.type == 1).length > 0;
//处理说明文本
let descArr = JSON.parse(JSON.stringify(obj.activityDesc));
descArr = descArr.filter(item => item.type != 1);
// let tempArr = descArr.map(item => {
// return item.value;
// });
// console.log(obj)
obj.descArr = descArr;
this.data.valueCardInfo = obj;
this.setData({
valueCardInfo: this.data.valueCardInfo
});
}
}
wx.hideLoading();
});
},
//修改选中状态
onTapSwitchChecked() {
this.data.checked = !this.data.checked;
this.setData({
checked: this.data.checked
});
},
//关闭modal
onTapCloseModal() {
this.setData({
showModal: false,
});
},
//查看rule
onTapViewRule() {
this.setData({
showModal: true
})
},
//同意并阅读
onTapModalAgree() {
this.setData({
showModal: false,
checked: true,
});
},
//立即购买
onTapBuy() {
if (!this.data.checked) {
return;
}
const { member } = wx.getStorageSync('_baseUserInfo');
if (!member) {
wx.showToast({
title: '请先去登录',
icon: 'none'
})
return;
}
if(!member.cardNoWeixin){
wx.showToast({
title: '请先开卡后购买',
});
wxService.openCard()
return ;
}
//buyWayType 1微信 2支付宝
let memeberId = member.id ,buyWayType = 1;
let activityId = this.data.id;
let url = `/coupon/couponMoneyBuyActivity/buyer/buy?activityId=${activityId}&memberId=${memeberId}&buyWayType=${buyWayType}`;
wx.showLoading({
title: '支付中..',
});
wxService.post(url).then(res => {
wx.hideLoading();
if (res.data.result == 0) {
console.log(res)
this.setData({
checked: false,
});
let data = res.data.data ? res.data.data : null;
if (data) {
let wxParams = data.wxParams;
wx.requestPayment({
timeStamp: wxParams.timeStamp,
nonceStr: wxParams.nonceStr,
package: wxParams.package,
signType: wxParams.signType,
paySign: wxParams.paySign,
success: res => {
wx.showModal({
title: '购买成功提示',
content: '购买成功,是否到我的优惠券中查看?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
confirmColor: app.globalData.themeColor,
success: function (modalRes) {
if (modalRes.confirm) {
wx.navigateTo({
url: '/pages/coupons/coupons',
});
}
}
});
},
fail: error => {
wx.showToast({
title: '已取消支付',
icon: 'none'
});
}
})
}
}
else {
wx.showToast({
title: '购买失败,请稍后再试!',
icon: 'none'
});
}
});
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
})
\ No newline at end of file
{
"navigationBarTitleText": "现金购券详情",
"enablePullDownRefresh": false,
"usingComponents": {}
}
\ No newline at end of file
<!--subPackage/page/pages/valueCardInfo/valueCardInfo.wxml-->
<image src='{{valueCardInfo.detailPicture ? valueCardInfo.detailPicture : valueCardInfo.listPicture}}'
class='card-info' mode='widthFix'></image>
<view class='card-info-body'>
<view class='card-title'>{{valueCardInfo.activityName}}</view>
<view class='card-desc-item' wx:if="{{valueCardInfo.hasDate}}">
<view class='lf'>活动时间</view>
<view class='rg'>{{valueCardInfo.startTime}} 至 {{valueCardInfo.endTime}}</view>
</view>
<view class='card-desc-item'>
<view class='lf'>现金支付</view>
<view class='rg'>¥{{valueCardInfo.acPayMoney}}</view>
</view>
<view class='card-desc-item'
wx:for="{{valueCardInfo.descArr}}"
wx:for-item="item"
wx:for-index="idx"
wx:key="*this">
<view class='lf'>{{item.label ? item.label : '说明内容'}}</view>
<view class='rg'>
<view class='list-item'> {{item.value}}</view>
</view>
</view>
</view>
<!-- 底部 -->
<view class='bottom-buy'>
<view class='lf-info'>
<!-- 选中 active -->
<view class='check-box {{checked ? "active" : ""}}' bindtap='onTapSwitchChecked'>
<image src='/assets/imgs/tick-success.png' mode='aspectFit'></image>
</view>
<view class='explain'>
<label> 阅读并同意 </label>
<text bindtap='onTapViewRule'>《活动规则》</text>
</view>
</view>
<view class='rg-button positionRe {{checked ? "" : "disabled"}}' wx:if="{{!userHasBaseInfo}}">
<button class="positionAbs clear-btn"
bindgetuserinfo="_getUserInfo" open-type='getUserInfo'></button>
{{buyType == 1 ? "立即购买" : "立即兑换"}}
</view>
<view class='rg-button {{checked ? "" : "disabled"}}'
wx:if="{{userHasBaseInfo}}" bindtap='onTapBuy'>立即购买</view>
</view>
<!-- 超值卡规则 -->
<view class='rule-modal' wx:if="{{showModal}}">
<view class='modal-body'>
<view class='modal-body-title'>
《活动规则》
<image class='modal-body-close' src='/assets/imgs/gray_close.png' mode='aspectFit' bindtap='onTapCloseModal'></image>
</view>
<view class='modal-body-con'>
<image src="{{valueCardInfo.rulePicture}}" mode="widthFix"></image>
</view>
<view class='modal-body-bottom'>
<label bindtap='onTapModalAgree'>阅读并同意</label>
</view>
</view>
</view>
\ No newline at end of file
/* subPackage/page/pages/valueCardInfo/valueCardInfo.wxss */
page{
background: #ffffff;
box-sizing: border-box;
-webkit-box-sizing: border-box;
padding-bottom: 100rpx;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.card-info{
width: 100%;
display: block;
}
.card-info-body{
width: 100%;
padding: 30rpx;
}
.card-title{
font-size: 28rpx;
color: #333333;
font-weight: bold;
margin-bottom: 20rpx;
}
.card-desc-item{
width: 100%;
height: auto;
display: flex;
font-size: 28rpx;
margin-bottom: 10rpx;
}
.card-desc-item .lf{
flex: 0;
min-width: 120rpx;
max-width: 120rpx;
color: #666666;
}
.card-desc-item .rg{
flex: 1;
padding-left: 10rpx;
color: #333333;
}
.card-desc-item .rg .list-item{
margin-bottom: 8rpx;
white-space: pre-line;
}
.bottom-buy{
bottom: 0;
left: 0;
position: fixed;
z-index: 2;
border-top: solid 2rpx #ddd;
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
background: #ffffff;
}
.bottom-buy .rg-button{
flex: 0;
min-width: 200rpx;
max-width: 200rpx;
height: 100%;
background: var(--themecolor);
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
}
.bottom-buy .rg-button:active{
opacity: 0.7;
}
.bottom-buy .rg-button.disabled{
background: #cccccc;
}
.bottom-buy .rg-button.disabled:active{
opacity: 1;
}
.bottom-buy .lf-info{
flex: 1;
padding-left: 30rpx;
display: flex;
justify-content: flex-start;
align-items: center;
}
.check-box{
width: 42rpx;
height: 42rpx;
border-radius: 50%;
border: solid 1px #dddddd;
display: flex;
align-items: center;
justify-content: center;
}
.check-box image{
display: none;
}
.check-box.active{
background: #ff3333;
border: solid 1px #ff3333;
}
.check-box.active image{
display: block;
width: 25rpx;
height: 25rpx;
}
.explain{
display: flex;
flex-direction: column;
justify-content: center;
padding-left: 10rpx;
font-size: 28rpx;
}
.explain label{
color: #333333;
padding-left: 8rpx;
}
.explain text{
color: #558ACB;
font-size: 22rpx;
}
.rule-modal{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 3;
display: flex;
align-items: center;
justify-content: center;
}
.rule-modal .modal-body{
width: 80vw;
height: 80vh;
background: #ffffff;
border-radius: 8rpx;
display: flex;
flex-direction: column;
}
.rule-modal .modal-body .modal-body-title{
flex: 0;
min-height: 80rpx;
max-height: 80rpx;
width: 100%;
border-bottom: solid 2rpx #dddddd;
position: relative;
display: flex;
justify-content: center;
align-items: center;
color: #333333;
font-size: 28rpx;
}
.rule-modal .modal-body .modal-body-title .modal-body-close{
position: absolute;
width: 32rpx;
height: 32rpx;
top: 24rpx;
right: 24rpx;
}
.rule-modal .modal-body .modal-body-title .modal-body-close:active{
opacity: 0.7;
}
.rule-modal .modal-body .modal-body-con{
flex: 1;
padding: 20rpx;
overflow: hidden;
overflow-y: auto;
font-size: 24rpx;
color: #666666;
}
.rule-modal .modal-body .modal-body-con image{
width: 100%;
}
.rule-modal .modal-body .modal-body-bottom{
flex: 0;
min-height: 120rpx;
max-height: 120rpx;
display: flex;
align-items: center;
justify-content: center;
}
.rule-modal .modal-body .modal-body-bottom label{
width: 280rpx;
height: 80rpx;
background: #ff3333;
color: #ffffff;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
}
.rule-modal .modal-body .modal-body-bottom label:active{
opacity: 0.7;
}
// subPackageA/page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.js
const wxService = require('../../../../utils/wxService')
const util = require('../../../../utils/util')
wxService.page({
/**
* 页面的初始数据
*/
data: {
recordsList : [],
pageSize : 10,
pageNo : 1,
totalPage : 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.hideShareMenu();
this.getBuyCouponRecords();
},
//获取优惠券购买记录
getBuyCouponRecords(refresh){
let pageNo = this.data.pageNo , pageSize = this.data.pageSize;
if(refresh){
wx.stopPullDownRefresh();
wx.showToast({
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
});
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.data.pageNo = 1;
this.data.recordsList = [];
this.getBuyCouponRecords(true);
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.data.pageNo < this.data.totalPage){
this.data.pageNo ++;
this.getBuyCouponRecords();
}
else{
if(this.data.pageNo > 1){
wx.showToast({
title: '暂无更多数据了~',
icon :' none'
});
}
}
},
})
{
"enablePullDownRefresh":true,
"navigationBarTitleText": "优惠券购买记录",
"usingComponents": {
"empty": "/component/empty/empty"
}
}
\ 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" wx:for="{{recordsList}}" wx:key="*this" wx:for-item="item">
<view class="records-title">
<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>{{item.payOrderTime}}</label>
</view>
</view>
</view>
<!-- 空的时候 -->
<empty text="未查到任何优惠券购买记录~" wx:if="{{recordsList.length == 0}}"/>
\ No newline at end of file
/* subPackageA/page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.wxss */
page{
background: #ffffff;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.records-list{
width: 100%;
height: auto;
padding: 20rpx;
}
.records-list .records-item{
padding: 20rpx;
border-bottom: solid 1rpx #dddddd;
font-size: 24rpx;
color: #333333;
}
.records-title{
font-size: 28rpx;
font-weight: bold;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10rpx;
}
.other-info{
color: #999999;
font-weight: 24rpx;
}
.records-title text{
color: red;
}
\ No newline at end of file
// subPackage/page/pages/couponCenterInfo/couponCenterInfo.js
const app = getApp();
const wxService = require('../../../../utils/wxService')
const util = require('../../../../utils/util')
wxService.page({
/**
* 页面的初始数据
*/
data: {
activityId : null,
activityInfo : {},
showDialog : false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let id = options.id;
if(id){
this.data.activityId = id;
this.getPayCardInfo();
}
},
//获取支付券详情
getPayCardInfo(){
wxService.get(`/coupon/wechatCouponInfo/get/${this.data.activityId}`).then(res => {
if(res){
let obj = res.data.data ? res.data.data : null;
if (obj){
let detailInfo = obj.detailInfo ? JSON.parse(obj.detailInfo) : [];
this.data.activityInfo = obj;
this.data.activityInfo.desc = detailInfo;
this.setData({
activityInfo : this.data.activityInfo
});
}
}
})
},
//领取优惠券
onTapGetCoupon(){
wx.showLoading({
title: '领取中..',
});
//调用接口领取
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: app.globalData.themeColor,
success: function (modalRes) {
if (modalRes.confirm) {
wx.navigateTo({
url: '/pages/coupons/coupons',
});
}
}
});
}
}
});
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let url = this.data.activityInfo.activityImgUrl ? this.data.activityInfo.activityImgUrl : 'https://img3.bigaka.com/prd/3001/202003/20200331/3001649f2f08-3b4e-4b5b-97c1-30cdf646651c.png';
return {
title: `我分享给你一张“${this.data.activityInfo.couponName}”的支付券,赶快领取吧~`,
path: `/subPackageA/page/pages/payCardInfo/payCardInfo?id=${this.data.activityId}`,
imageUrl: url, // 可以更换分享的图片
}
}
});
\ No newline at end of file
{
"navigationBarTitleText": "支付券信息",
"usingComponents": {
}
}
\ No newline at end of file
<!--subPackage/page/pages/couponCenterInfo/couponCenterInfo.wxml-->
<view class="coupon-info-con">
<!-- 修改为新的布局 -->
<view class="coupon-package">
<image src="{{activityInfo.activityImgUrl}}" mode="widthFix"></image>
</view>
<!-- 活动说明 -->
<view class='integral-detail' style="margin-top:20rpx;" wx:if="{{activityInfo.desc.length > 0}}">
<view class='integral-list' wx:for="{{activityInfo.desc}}" wx:key="*this">
<text class='integral-title'>{{item.label}}</text>
<text class='integral-desc wpl'>{{item.value}}</text>
</view>
</view>
<!-- 按钮 -->
<view class="get-btn positionRe">
<button wx:if="{{!currentHasUserInfo}}"
bindgetuserinfo="_getUserInfo"
open-type='getUserInfo'
class="clear-btn positionAbs">立即领取</button>
<view wx:else class="view-btn" bindtap="onTapGetCoupon">立即领取</view>
</view>
</view>
/* subPackage/page/pages/couponCenterInfo/couponCenterInfo.wxss */
page{
background: #ffffff;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.coupon-info-con{
padding: 30rpx;
}
.coupon-info-bg{
width: 100%;
height: 174rpx;
background-position: center;
background-size: 100%;
background-repeat: no-repeat;
position: relative;
padding-left: 170rpx;
}
.coupon-info-bg .lf-coupon-Bg{
position: absolute;
left: 0;
top: 0;
width: 170rpx;
height: 100%;
padding: 15rpx;
}
.coupon-package{
width: 100%;
height: auto;
}
.coupon-package image{
width: 100%;
}
.coupon-info-bg .lf-coupon-Bg image{
width: 100%;
height: 100%;
}
.coupon-info-bg .rg-coupon-info{
width: 100%;
height: 100%;
padding: 15rpx;
font-size: 24rpx;
}
.coupon-title{
font-size: 28rpx;
color: #333333;
margin-bottom: 8rpx;
font-weight: 550;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.coupon-date{
font-size: 22rpx;
color: #999999;
margin-bottom: 5rpx;
}
.exp-intro{
margin-top: 60rpx;
}
.exp-intro .exp-intro-item{
display: flex;
font-size: 28rpx;
color: #333333;
}
.exp-intro .exp-intro-item .intro-title{
flex: 0;
min-width: 100rpx;
max-width: 100rpx;
}
.exp-intro .exp-intro-item .intro-desc{
flex: 1;
color: #999999;
}
.integral-detail{
margin-top: 60rpx;
}
.integral-list{
margin-bottom: 20rpx;
font-size: 24rpx;
color: #999999;
}
.integral-title{
font-size: 24rpx;
color: #333333;
margin-right: 8rpx;
}
.integral-title,.integral-desc{
display: inline-block;
}
.get-btn{
width: 100%;
height: 90rpx;
margin-top: 80rpx;
background: -webkit-linear-gradient(left,var(--themeColorRgba07),var(--themecolor));
border-radius: 8rpx;
color: #ffffff;
font-size: 28rpx;
display: flex;
justify-content: center;
align-items: center;
}
.get-btn button{
color: #ffffff;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
}
.get-btn .view-btn{
color: #ffffff;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 1;
}
.get-btn:active{
opacity: 0.7;
}
\ No newline at end of file
...@@ -50,8 +50,8 @@ page { ...@@ -50,8 +50,8 @@ page {
width: 153.8rpx; width: 153.8rpx;
height: 48rpx; height: 48rpx;
border-radius: 33rpx; border-radius: 33rpx;
background-color: rgba(5, 195, 91, 1); background-color: var(--themecolor);
box-shadow: 0rpx 3rpx 10rpx 0rpx rgba(5, 195, 91, 0.3); box-shadow: 0rpx 3rpx 10rpx 0rpx var(--themeColorRgba03);
line-height: 48rpx; line-height: 48rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
font-size: 24rpx; font-size: 24rpx;
...@@ -222,5 +222,5 @@ page { ...@@ -222,5 +222,5 @@ page {
border-right: 1rpx solid rgba(102, 102, 102, 1); border-right: 1rpx solid rgba(102, 102, 102, 1);
} }
.tab-active { .tab-active {
color: rgba(5, 195, 91, 1); color: var(--themecolor);
} }
\ No newline at end of file
...@@ -50,8 +50,8 @@ page { ...@@ -50,8 +50,8 @@ page {
width: 153.8rpx; width: 153.8rpx;
height: 48rpx; height: 48rpx;
border-radius: 33rpx; border-radius: 33rpx;
background-color: rgba(5, 195, 91, 1); background-color: var(--themecolor);
box-shadow: 0rpx 3rpx 10rpx 0rpx rgba(5, 195, 91, 0.3); box-shadow: 0rpx 3rpx 10rpx 0rpx var(--themeColorRgba03);
line-height: 48rpx; line-height: 48rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
font-size: 24rpx; font-size: 24rpx;
...@@ -222,5 +222,5 @@ page { ...@@ -222,5 +222,5 @@ page {
border-right: 1rpx solid rgba(102, 102, 102, 1); border-right: 1rpx solid rgba(102, 102, 102, 1);
} }
.tab-active { .tab-active {
color: rgba(5, 195, 91, 1); color: var(--themecolor);
} }
\ No newline at end of file
...@@ -302,17 +302,54 @@ class Logger { ...@@ -302,17 +302,54 @@ class Logger {
} }
// 通过点击按钮 获取用户信息并登陆注册到crm系统中 // 通过点击按钮 获取用户信息并登陆注册到crm系统中
function getUserInfoByBtn(userInfo) { function getUserInfoByBtn(userInfo, authType) {
const logger = new Logger() const logger = new Logger()
const app = getApp() const app = getApp()
if (Object.keys(userInfo).length === 1) { if (Object.keys(userInfo).length === 1) {
return wxService.Promise.reject(userInfo.errMsg) return wxService.Promise.reject(userInfo.errMsg)
} }
if(authType == 'phoneNumber'){
return wxService.login().then((res) => {
wx.setStorageSync('_userInfo', userInfo)
wx.setStorageSync('_wechatInfo', userInfo)
wx.setStorageSync('reLoginErr', false)
wx.showLoading({
title: '正在加载...',
icon: 'none',
mask: true
})
let currentLoginUrl = `/member/minaLogin`
let param = {
code: res.code,
wechatInfo: userInfo,
brandId: app.globalData.brandId
};
param.wechatInfo.authType = authType;
if (!envInfo.isMall) {
param.appid = app.globalData.appId
}
return wxService.post(`${currentLoginUrl}`, param);
}).then(response => {
logger.log('getCrmUserInfo response', response)
if (response.data.data.rspCode === -1) {
return Promise.reject(response.data.data)
}
return Promise.resolve(response.data.data)
}).finally(() => {
wx.hideLoading()
});
}
else{
return wxService.login().then((res) => { return wxService.login().then((res) => {
logger.log(' wx getUserInfoByBtn success res --->', res) logger.log(' wx getUserInfoByBtn success res --->', res)
return Promise.all([Promise.resolve(userInfo), Promise.resolve(res)]) return Promise.all([Promise.resolve(userInfo), Promise.resolve(res)])
}).then((res) => { }).then((res) => {
logger.log(' wx _userInfo success res --->', res) logger.log(' wx _userInfo success res --->', res)
wx.setStorageSync('_userInfo', res[0].userInfo) wx.setStorageSync('_userInfo', res[0].userInfo)
wx.setStorageSync('_wechatInfo', res[0]) wx.setStorageSync('_wechatInfo', res[0])
...@@ -328,14 +365,14 @@ function getUserInfoByBtn(userInfo) { ...@@ -328,14 +365,14 @@ function getUserInfoByBtn(userInfo) {
let param = { let param = {
code: res[1].code, code: res[1].code,
wechatInfo: res[0], wechatInfo: res[0],
brandId: app.globalData.brandId, brandId: app.globalData.brandId
// appid: app.globalData.appId // appid: app.globalData.appId
}; };
param.wechatInfo.authType = authType;
if (!envInfo.isMall) { if (!envInfo.isMall) {
param.appid = app.globalData.appId param.appid = app.globalData.appId
} }
return wxService.post(`${currentLoginUrl}`, param)
return wxService.post(`${currentLoginUrl}`,param)
}, (err) => { }, (err) => {
return Promise.reject(err) return Promise.reject(err)
}).then(response => { }).then(response => {
...@@ -347,6 +384,8 @@ function getUserInfoByBtn(userInfo) { ...@@ -347,6 +384,8 @@ function getUserInfoByBtn(userInfo) {
}).finally(() => { }).finally(() => {
wx.hideLoading() wx.hideLoading()
}) })
}
} }
...@@ -359,9 +398,9 @@ function getSum(preValue,curValue,index, array) { ...@@ -359,9 +398,9 @@ function getSum(preValue,curValue,index, array) {
return preValue + curValue; return preValue + curValue;
} }
function _getUserInfo(ev) { function _getUserInfo(ev,authType) {
const userInfo = ev.detail || ev const userInfo = ev.detail || ev
return getUserInfoByBtn(userInfo).then((data = {}) => { return getUserInfoByBtn(userInfo, authType).then((data = {}) => {
const { token } = data const { token } = data
wx.setStorageSync('_accreditUserInfo', userInfo) wx.setStorageSync('_accreditUserInfo', userInfo)
wx.hideNavigationBarLoading() wx.hideNavigationBarLoading()
......
...@@ -117,6 +117,7 @@ class WXService extends Http { ...@@ -117,6 +117,7 @@ class WXService extends Http {
code: result.code, code: result.code,
wechatInfo: null, wechatInfo: null,
brandId: app.globalData.brandId, brandId: app.globalData.brandId,
authType : 'userInfo'
}; };
if (!envInfo.isMall) { if (!envInfo.isMall) {
param.appid = app.globalData.appId param.appid = app.globalData.appId
...@@ -617,28 +618,14 @@ class WXService extends Http { ...@@ -617,28 +618,14 @@ class WXService extends Http {
config.data.canRefundDaysAfterDelivery = envInfo.canRefundDaysAfterDelivery; config.data.canRefundDaysAfterDelivery = envInfo.canRefundDaysAfterDelivery;
config.data.openRefundTips = envInfo.openRefundTips; config.data.openRefundTips = envInfo.openRefundTips;
config.data.refundTips = envInfo.refundTips; config.data.refundTips = envInfo.refundTips;
//主题颜色
config.data.themeColor = envInfo.themeColor;
//默认 //默认
config.data.loading = true; config.data.loading = true;
const CONFIG_PAPGE = { const CONFIG_PAPGE = {
onLoad: function (...args) { onLoad: function (...args) {
wx.login({
success: (res) => {
console.log('************************************')
console.log(res)
},
fail: (res) => {
}
})
const page = this const page = this
_self.initAppGlobalDataSync() _self.initAppGlobalDataSync()
watch.setWatcher(page); watch.setWatcher(page);
...@@ -814,7 +801,7 @@ class WXService extends Http { ...@@ -814,7 +801,7 @@ class WXService extends Http {
wx.showLoading({ wx.showLoading({
title: '用户登录中..', title: '用户登录中..',
}); });
_self.getAuthUserInfo(res.detail).then(res => { _self.getAuthUserInfo(res.detail,'userInfo').then(res => {
this.setData({ this.setData({
currentHasUserInfo: true currentHasUserInfo: true
}); });
...@@ -825,13 +812,13 @@ class WXService extends Http { ...@@ -825,13 +812,13 @@ class WXService extends Http {
}, },
//统一处理手机号授权成功 //统一处理手机号授权成功
userGetMobile(res){ userGetMobile(res){
console.log(res)
wx.showLoading({ wx.showLoading({
title: '用户登录中..', title: '用户登录中..',
}); });
_self.getAuthUserInfo(res.detail).then(res => { _self.getAuthUserInfo(res.detail,'phoneNumber').then(res => {
this.setData({ this.setData({
currentHasUserInfo: true currentHasMobile: true,
currentHasUserInfo : true,
}); });
wx.hideLoading(); wx.hideLoading();
}).catch(err => { }).catch(err => {
......
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