Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/jeffrey/feat/coupon-center' into skk/feat/welfare-mall

# Conflicts:
#	pages/welfareMall/personal/personal.js
kk.shi 3 anni fa
parent
commit
f43e37faa0

+ 2 - 2
app.json

@@ -36,13 +36,13 @@
     "list": [  {
       "text": "首页",
       "pagePath": "pages/welfareMall/index/index",
-      "selectedIconPath": "images/welfareMall/home-active.png",
+      "selectedIconPath": "images/welfareMall/home.png",
       "iconPath": "images/welfareMall/home.png"
   },
   {
       "text": "我的",
       "pagePath": "pages/welfareMall/personal/personal",
-      "selectedIconPath": "images/welfareMall/user-active.png",
+      "selectedIconPath": "images/welfareMall/user.png",
       "iconPath": "images/welfareMall/user.png"
   }
   ]

+ 2 - 2
app.wxss

@@ -35,7 +35,7 @@ display: -webkit-box;
 -webkit-line-clamp: 2;
 }
 
-/* page{
+.page{
   -webkit-filter: grayscale(100%);
   filter: grayscale(100%);
-} */
+}

+ 51 - 0
components/topbar.js

@@ -0,0 +1,51 @@
+// components/topbar.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    attached: function() {
+        var url =getCurrentPages()[getCurrentPages().length-1].route
+
+        let dwObj = wx.getMenuButtonBoundingClientRect()
+        let navHeight_ = (dwObj.top + dwObj.height)
+        let capsuleTop_ = dwObj.top
+        let windowHeight = wx.getSystemInfoSync().windowHeight
+
+        this.setData({
+            navHeight: navHeight_,
+            capsuleTop:capsuleTop_, 
+            capHeight: dwObj.height,
+            bodyHeight: windowHeight - navHeight_,
+        });
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        handleBack() {
+            let routeLen = getCurrentPages().length;
+            if (routeLen == 1) {
+                wx.reLaunch({
+                  url: '/pages/welfareMall/index/index',
+                })
+                return
+            }
+            const url =getCurrentPages()[getCurrentPages().length-2].route
+            wx.switchTab({
+              url: "/" + url,
+            })
+        }
+    }
+})

+ 4 - 0
components/topbar.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 6 - 0
components/topbar.wxml

@@ -0,0 +1,6 @@
+<!--components/topbar.wxml-->
+<view class="topbar" style="top:{{capsuleTop + 3}}px; left: 28rpx;">
+   <view class="back" catchtap="handleBack">
+      <image src="/images/back.png" />
+   </view>
+</view>

+ 17 - 0
components/topbar.wxss

@@ -0,0 +1,17 @@
+/* components/topbar.wxss */
+
+.topbar {
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: 999;
+}
+
+.topbar .back {
+    width: 36rpx;
+    height: 36rpx;
+}
+.topbar .back image {
+    width: 20rpx;
+    height: 36rpx;
+}

BIN
images/back.png


BIN
images/welfareMall/home_black.png


BIN
images/welfareMall/user_black.png


+ 1 - 1
pages/luckDraw/index.wxml

@@ -34,4 +34,4 @@
 </view>
 
 <!-- 底部导航 -->
-<tab-bar />
+<!-- <tab-bar /> -->

+ 1 - 1
pages/luckDraw/profile.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "个人中心",
+  "navigationBarTitleText": "我的卡券",
   "usingComponents": {
     "tab-bar": "./components/tabbar"
   }

+ 1 - 1
pages/luckDraw/profile.wxml

@@ -126,4 +126,4 @@ var toHide = function(array) {
 module.exports.toHide = toHide;
 </wxs>
 <!-- 底部导航 -->
-<tab-bar />
+<!-- <tab-bar /> -->

+ 1 - 1
pages/luckDraw/recordPrize.wxml

@@ -34,6 +34,6 @@
 
 
 <!-- 底部导航 -->
-<tab-bar />
+<!-- <tab-bar /> -->
 
 

+ 2 - 1
pages/signIn/activity/activity.json

@@ -1,6 +1,7 @@
 {
   "usingComponents": {
-    "jumpmallapp": "../../../components/jumpmallapp"
+    "jumpmallapp": "../../../components/jumpmallapp",
+    "topbar": "../../../components/topbar"
   },
   "navigationStyle": "custom"
 }

+ 1 - 1
pages/signIn/activity/activity.wxml

@@ -1,6 +1,6 @@
 <!--pages/signIn/index.wxml-->
 <view wx:if="{{showPage}}">
-
+<topbar />
 <!-- 页面主体 -->
 <view class="sign-scroll-body" style="margin-top:{{navHeight}}px; height: {{bodyHeight}}px;">
     <view class="sign-info-extra">

+ 1 - 1
pages/welfareMall/activityInfo/activityInfo.wxml

@@ -52,7 +52,7 @@
 <image src="/images/welfareMall/buy_info.png" class="bottom_icon"></image>
 <view class="bottom_tilte_text">购买须知</view>
 </view>
-<rich-text class="bottom_title_b" nodes="{{detail.remark}}"></rich-text>
+<rich-text class="bottom_title_b" nodes="{{detail.buyRemark}}"></rich-text>
 
 </view>
 

+ 34 - 5
pages/welfareMall/index/index.js

@@ -16,14 +16,15 @@ Page({
       autoplay: true,
       interval: 2000,
       duration: 500,
-      indicatorDots:true
+      indicatorDots:true,
+      grayTheme:false
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-      this.getIndexList()
+      
   },
 
   /**
@@ -37,7 +38,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    this.getIndexList()
   },
 
   /**
@@ -76,8 +77,13 @@ Page({
   },
 
    //跳转超值券包
+   goToCouponBag:function () {
+    wx.navigateTo({
+      url: "/pages/welfareMall/activityList/activityList",
+    })
+   },
   goToCoupon:function(e){
-    var appId = e.currentTarget.dataset.appId;
+    var appId = e.currentTarget.dataset.appid;
     var path = e.currentTarget.dataset.path;
   
     if(appId && path){
@@ -113,11 +119,34 @@ Page({
     this.setData({
       activityList:res.data.activityList,
       bannerList:res.data.bannerList,
-      navigationList:res.data.navigationList
+      navigationList:res.data.navigationList,
+      grayTheme:res.data.config.grayTheme
     })
+
+    this.setThrem(res.data.config.grayTheme)
+  
  
   },
+  //设置滤镜
+  setThrem(grayTheme){
+    app.globalData.grayTheme = grayTheme;
+    let index0 = "images/welfareMall/home-active.png"
+    let index1 = "images/welfareMall/user-active.png"
+
+    if(grayTheme){
+      index0 = "images/welfareMall/home_black.png"
+      index1 = "images/welfareMall/user_black.png"
+    }
 
+    wx.setTabBarItem({
+      index: 0,
+      selectedIconPath: index0
+    })
+    wx.setTabBarItem({
+      index: 1,
+      selectedIconPath: index1
+    })
+  },
   goToBanner(e){
     var appId = e.currentTarget.dataset.appid;
     var path = e.currentTarget.dataset.path;

+ 3 - 3
pages/welfareMall/index/index.wxml

@@ -1,5 +1,5 @@
 
-
+<view class="{{grayTheme?'page':''}}">
 <view>
 <swiper  class="swiper"
 indicator-dots="{{indicatorDots}}"
@@ -24,7 +24,7 @@ indicator-dots="{{indicatorDots}}"
 <view class="coupon_list flex-column">
   <view class="c_l_top flex-row">
     <view class="c_l_top_l">推荐优惠</view>
-    <view class="c_l_top_r" bindtap="goToCoupon">更多</view>
+    <view class="c_l_top_r" bindtap="goToCouponBag">更多</view>
   </view>
 
   <view class="coupon_item flex-row" wx:for="{{activityList}}"  wx:key="unique" bindtap="goCouponDetail" data-id="{{item.activityId}}">
@@ -59,4 +59,4 @@ indicator-dots="{{indicatorDots}}"
     </view>
   </view> -->
 </view>
-
+</view>

+ 2 - 1
pages/welfareMall/index/index.wxss

@@ -47,13 +47,14 @@ Page {
 }
 
 .b_i_text {
-  width: 48px;
+  width: 80px;
   height: 12px;
   line-height: 12px;
   font-size: 12px;
   font-weight: 500;
   color: #303030;
   margin-bottom: 10px;
+  margin-top: 4px;
 }
 
 /* 券包的样式 */

+ 5 - 0
pages/welfareMall/personal/personal.js

@@ -2,6 +2,7 @@
 import WelfareMall from '../../../api/welfareMall'
 import activity from '../../../api/activity'
 import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
+const app = getApp();
 Page({
 
   /**
@@ -11,6 +12,7 @@ Page({
     isLogin: false,
     mobileTop: 'TONY WU',
     countNum: 0,
+    grayTheme:false
   },
 
   /**
@@ -175,6 +177,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: async function () {
+      this.setData({
+          grayTheme: app.globalData.grayTheme
+      })
     let  userMobile = await activity.getMobileCache();
     console.log(userMobile)
     if (userMobile.length !== 0) {

+ 2 - 0
pages/welfareMall/personal/personal.wxml

@@ -1,4 +1,5 @@
 <!--pages/welfareMall/personal/personal.wxml-->
+<view class="{{grayTheme?'page':''}}">
 <view class="personal flex-column">
   <!-- 首部个人信息 -->
   <view class="head flex-column">
@@ -100,6 +101,7 @@
     </view>
   </view>
 </view>
+</view>
 
 <!-- 使用wxs 手机号码中间四位显示为*号 -->
 <wxs module="phone">

+ 107 - 101
project.private.config.json

@@ -1,108 +1,114 @@
 {
-  "setting": {},
-  "condition": {
-    "plugin": {
-      "list": []
-    },
-    "game": {
-      "list": []
-    },
-    "gamePlugin": {
-      "list": []
-    },
-    "miniprogram": {
-      "list": [
-        {
-          "name": "pages/activityInfo/activityInfo",
-          "pathName": "pages/activityInfo/activityInfo",
-          "query": "id=Bg5740r78w&mobile=18636653274",
-          "scene": null
+    "setting": {},
+    "condition": {
+        "plugin": {
+            "list": []
         },
-        {
-          "name": "pages/couponReceive/couponReceive",
-          "pathName": "pages/couponReceive/couponReceive",
-          "query": "codeId=JyZmVzKm0D-47",
-          "scene": null
+        "game": {
+            "list": []
         },
-        {
-          "name": "pages/myCoupons/myCoupons",
-          "pathName": "pages/myCoupons/myCoupons",
-          "query": "mobile=18636653274",
-          "scene": null
+        "gamePlugin": {
+            "list": []
         },
-        {
-          "name": "pages/receiveCoupon/receiveCoupon",
-          "pathName": "pages/receiveCoupon/receiveCoupon",
-          "query": "",
-          "scene": 1013
-        },
-        {
-          "name": "pages/welfareMall/personal/personal",
-          "pathName": "pages/welfareMall/personal/personal",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/welfareMall/historical/historical",
-          "pathName": "pages/welfareMall/historical/historical",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/welfareMall/refund/refund",
-          "pathName": "pages/welfareMall/refund/refund",
-          "query": "id=undefined",
-          "scene": null
-        },
-        {
-          "name": "福利go ",
-          "pathName": "pages/welfareMall/index/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "超值券包",
-          "pathName": "pages/welfareMall/activityList/activityList",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "券包详情",
-          "pathName": "pages/welfareMall/activityInfo/activityInfo",
-          "query": "activityId=dl5v9NpmWQ",
-          "scene": null
-        },
-        {
-          "name": "pages/luckDraw/detail",
-          "pathName": "pages/luckDraw/detail",
-          "query": "id=8",
-          "scene": null
-        },
-        {
-          "name": "pages/luckDraw/index",
-          "pathName": "pages/luckDraw/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/luckDraw/profile",
-          "pathName": "pages/luckDraw/profile",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/signIn/activity/activity",
-          "pathName": "pages/signIn/activity/activity",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "pages/signIn/record/record",
-          "pathName": "pages/signIn/record/record",
-          "query": "",
-          "scene": null
+        "miniprogram": {
+            "list": [
+                {
+                    "name": "pages/activityInfo/activityInfo",
+                    "pathName": "pages/activityInfo/activityInfo",
+                    "query": "id=Bg5740r78w&mobile=18636653274",
+                    "scene": null
+                },
+                {
+                    "name": "pages/couponReceive/couponReceive",
+                    "pathName": "pages/couponReceive/couponReceive",
+                    "query": "codeId=JyZmVzKm0D-47",
+                    "scene": null
+                },
+                {
+                    "name": "pages/myCoupons/myCoupons",
+                    "pathName": "pages/myCoupons/myCoupons",
+                    "query": "mobile=18636653274",
+                    "scene": null
+                },
+                {
+                    "name": "pages/receiveCoupon/receiveCoupon",
+                    "pathName": "pages/receiveCoupon/receiveCoupon",
+                    "query": "",
+                    "scene": 1013
+                },
+                {
+                    "name": "pages/welfareMall/personal/personal",
+                    "pathName": "pages/welfareMall/personal/personal",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/welfareMall/historical/historical",
+                    "pathName": "pages/welfareMall/historical/historical",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/welfareMall/refund/refund",
+                    "pathName": "pages/welfareMall/refund/refund",
+                    "query": "id=undefined",
+                    "scene": null
+                },
+                {
+                    "name": "福利go ",
+                    "pathName": "pages/welfareMall/index/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "超值券包",
+                    "pathName": "pages/welfareMall/activityList/activityList",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "券包详情",
+                    "pathName": "pages/welfareMall/activityInfo/activityInfo",
+                    "query": "activityId=dl5v9NpmWQ",
+                    "scene": null
+                },
+                {
+                    "name": "pages/luckDraw/detail",
+                    "pathName": "pages/luckDraw/detail",
+                    "query": "id=8",
+                    "scene": null
+                },
+                {
+                    "name": "pages/luckDraw/index",
+                    "pathName": "pages/luckDraw/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/luckDraw/profile",
+                    "pathName": "pages/luckDraw/profile",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/signIn/activity/activity",
+                    "pathName": "pages/signIn/activity/activity",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/signIn/record/record",
+                    "pathName": "pages/signIn/record/record",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/signIn/activity/activity",
+                    "pathName": "pages/signIn/activity/activity",
+                    "query": "",
+                    "scene": null
+                }
+            ]
         }
-      ]
     }
-  }
 }

+ 1 - 1
utils/request.js

@@ -2,7 +2,7 @@ import util from './util.js'
 class request {
 
     //本地的
-    // static BASE_URL = 'http://localhost:8014/'
+//    static BASE_URL = 'http://localhost:8014/'
 //   pre环境的
   static BASE_URL = 'https://oapi.shpr.top/'
 //   正式的