소스 검색

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

xing.li 3 년 전
부모
커밋
71659ccab4

+ 6 - 1
api/welfareMall.js

@@ -146,7 +146,12 @@ class WelfareMall extends request {
     return this.postRequest(`${this.BASE_URL}open/activity/get-order-params`, params);
     return this.postRequest(`${this.BASE_URL}open/activity/get-order-params`, params);
   }
   }
 
 
-
+  /**
+   * 个人中心数据,包括导航
+   */
+  static getPersonalData(params) {
+    return this.postRequest(`${this.BASE_URL}open/welfare-mall/personal-data`, params);
+  }
 
 
 
 
 
 

+ 25 - 10
pages/welfareMall/feedback/feedback.js

@@ -158,22 +158,37 @@ Page({
       content: this.data.content,
       content: this.data.content,
     }).then(res => {
     }).then(res => {
         if (res.code == 200) {
         if (res.code == 200) {
-          wx.showToast({
-            title: '反馈意见提交成功',
-            icon: 'none',
-            duration: 1500
-          });
-          wx.switchTab({
-            url: "../personal/personal"
-          })
+          this.getModal()
         }
         }
-        this.data.lock = false
     }).catch(_ => {
     }).catch(_ => {
         console.log(_)
         console.log(_)
-        this.data.lock = false
     })
     })
   },
   },
 
 
+  getModal() {
+    wx.showModal({
+      title: '非常感谢您的反馈',
+      content: '沪上阿姨有您更优秀 研发团队正在拼命优化中',
+      showCancel: false,//是否显示取消按钮
+      cancelText:"否",//默认是“取消”
+      cancelColor:'skyblue',//取消文字的颜色
+      confirmText:"我知道了",//默认是“确定”
+      confirmColor: 'black',//确定文字的颜色
+      success: res => {if (res.cancel) {
+          wx.switchTab({
+            url: "../personal/personal"
+          })
+        } else {
+            //点击确定 
+            wx.switchTab({
+              url: "../personal/personal"
+            })
+        }
+      },
+      fail: function (res) { },//接口调用失败的回调函数 
+    })
+},
+
   /**
   /**
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */

+ 17 - 6
pages/welfareMall/feedback/feedback.wxss

@@ -1,9 +1,10 @@
 /* pages/welfareMall/feedback/feedback.wxss */
 /* pages/welfareMall/feedback/feedback.wxss */
+page{
+  background: #F7F7F7;
+}
 .feedback{
 .feedback{
   width: 750rpx;
   width: 750rpx;
   height: auto;
   height: auto;
-  padding-bottom: 119rpx; 
-  background: #F7F7F7;
 }
 }
 
 
 /* 垂直方向布局,水平居中 **/
 /* 垂直方向布局,水平居中 **/
@@ -30,7 +31,7 @@
 
 
 .feedback-title{
 .feedback-title{
   font-size: 24rpx;
   font-size: 24rpx;
-  font-weight: 500;
+  font-weight: 600;
   color: #444444;
   color: #444444;
 }
 }
 
 
@@ -38,9 +39,11 @@ textarea{
   width: 659rpx;
   width: 659rpx;
   height: 320rpx;
   height: 320rpx;
   background: #FFFFFF;
   background: #FFFFFF;
-  border: 1rpx solid #3E3E3E;
+  border: 1px solid #3E3E3E;
   border-radius: 10rpx;
   border-radius: 10rpx;
   z-index: 1;
   z-index: 1;
+  padding-left: 33rpx;
+  padding-top: 42rpx;
 }
 }
 
 
 .suggest_text-count{
 .suggest_text-count{
@@ -66,7 +69,7 @@ textarea{
   width: 350rpx;
   width: 350rpx;
   height: 40rpx;
   height: 40rpx;
   font-size: 24rpx;
   font-size: 24rpx;
-  font-weight: 500;
+  font-weight: 600;
   color: #444444;
   color: #444444;
 }
 }
 
 
@@ -85,7 +88,7 @@ textarea{
 .explain-img-preview{
 .explain-img-preview{
   width: 154rpx;
   width: 154rpx;
   height: 154rpx;
   height: 154rpx;
-  border: 1rpx solid #3E3E3E;
+  border: 1px solid #3E3E3E;
   border-radius: 10rpx;
   border-radius: 10rpx;
   z-index: 1;
   z-index: 1;
   justify-content: center;
   justify-content: center;
@@ -127,4 +130,12 @@ textarea{
   font-size: 36rpx;
   font-size: 36rpx;
   font-weight: 500;
   font-weight: 500;
   color: #FFFFFF;
   color: #FFFFFF;
+}
+
+.sug_p{
+  width: 194rpx;
+  height: 30rpx;
+  font-size: 28rpx;
+  font-weight: 600;
+  color: #444444;
 }
 }

+ 2 - 2
pages/welfareMall/historical/historical.wxml

@@ -21,7 +21,7 @@
         </view>
         </view>
       </view>
       </view>
       <view class="content-line"></view>
       <view class="content-line"></view>
-      <view class="content-lower flex-row" data-ordersn="{{item.orderSn}}" catchtap="getCompletion">
+      <view class="content-lower" data-ordersn="{{item.orderSn}}" catchtap="getCompletion">
         <view class="lower-total">共{{item.goodsList.length}}件商品 合计¥{{item.payPriceFormatter}}</view>
         <view class="lower-total">共{{item.goodsList.length}}件商品 合计¥{{item.payPriceFormatter}}</view>
         <view class="lower-order-style flex-row">
         <view class="lower-order-style flex-row">
           <view class="lower-order-text">订单详情</view>
           <view class="lower-order-text">订单详情</view>
@@ -29,6 +29,6 @@
       </view>
       </view>
     </view>
     </view>
     <view class="no_result" wx:if="{{noResult}}">———— 抱歉,您暂无历史订单 ————</view>
     <view class="no_result" wx:if="{{noResult}}">———— 抱歉,您暂无历史订单 ————</view>
-    <view class="no_result" wx:if="{{noMore}}">———— 更多订单 | 敬请期待 ————</view>
+    <view class="no_result" wx:if="{{noMore}}">—— 人家也是有底线的 ——</view>
   </view>
   </view>
 </view>
 </view>

+ 18 - 6
pages/welfareMall/historical/historical.wxss

@@ -22,12 +22,16 @@
   justify-content: center;
   justify-content: center;
 }
 }
 
 
+.historical-style{
+  margin-top: 14rpx;
+}
+
 .historical-content{
 .historical-content{
   width: 716rpx;
   width: 716rpx;
-  height: 327rpx;
+  /* height: 327rpx; */
   background: #FFFFFF;
   background: #FFFFFF;
   border-radius: 10rpx;
   border-radius: 10rpx;
-  margin-top: 14rpx;
+  margin-bottom: 20rpx;
 }
 }
 
 
 .content-hm{
 .content-hm{
@@ -106,14 +110,18 @@
 
 
 .content-line{
 .content-line{
   width: 679rpx;
   width: 679rpx;
-  height: 1rpx;
+  height: 1px;
   background: #A0A0A0;
   background: #A0A0A0;
 }
 }
 
 
 .content-lower{
 .content-lower{
   width: 676rpx;
   width: 676rpx;
-  height: 80rpx;
-  justify-content: space-between;
+  padding-top: 30rpx;
+  padding-bottom: 30rpx;
+  min-height: 48rpx;
+  box-sizing: border-box;
+  display: flex;
+  flex-direction: row;
 }
 }
 
 
 .lower-total{
 .lower-total{
@@ -121,13 +129,17 @@
   font-family: Source Han Sans CN;
   font-family: Source Han Sans CN;
   font-weight: 500;
   font-weight: 500;
   color: #444444;
   color: #444444;
+  width: 500rpx;
+  line-height: 46rpx;
+  flex: 1;
 }
 }
 
 
 .lower-order-style{
 .lower-order-style{
   width: 140rpx;
   width: 140rpx;
   height: 46rpx;
   height: 46rpx;
+  box-sizing: border-box;
   background: #FFFFFF;
   background: #FFFFFF;
-  border: 1rpx solid #B01717;
+  border: 1px solid #B01717;
   border-radius: 10rpx;
   border-radius: 10rpx;
 }
 }
 
 

+ 10 - 1
pages/welfareMall/order/orderCompletion.js

@@ -210,7 +210,16 @@ Page({
     });
     });
     await that.cancel();
     await that.cancel();
     // await that.onLoad(that.options);
     // await that.onLoad(that.options);
-    await that.selectOrder(that.data.orderSn);
+    wx.showToast({
+      title: '申请退款已提交',
+      icon: 'none',
+      duration: 1500,
+      success: function(){
+        setTimeout(() => {
+          that.selectOrder(that.data.orderSn);
+        }, 1500);
+      }
+    });
     // await wx.navigateTo({
     // await wx.navigateTo({
     //   url:  "../refund/refund?orderSn=" + that.data.orderSn
     //   url:  "../refund/refund?orderSn=" + that.data.orderSn
     // })
     // })

+ 4 - 3
pages/welfareMall/order/orderCompletion.wxss

@@ -1,9 +1,10 @@
 /* pages/welfareMall/order/orderCompletion.wxss */
 /* pages/welfareMall/order/orderCompletion.wxss */
+page{ 
+  background: #F7F7F7;
+}
 .order{
 .order{
   width: 750rpx;
   width: 750rpx;
   height: auto;
   height: auto;
-  padding-bottom: 119rpx; 
-  background: #F7F7F7;
 }
 }
 
 
 /* 垂直方向布局,水平居中 **/
 /* 垂直方向布局,水平居中 **/
@@ -181,7 +182,7 @@
   width: 150rpx;
   width: 150rpx;
   height: 51rpx;
   height: 51rpx;
   background: #FFFFFF;
   background: #FFFFFF;
-  border: 1rpx solid #B01717;
+  border: 1px solid #B01717;
   border-radius: 10rpx;
   border-radius: 10rpx;
   margin-left: 10rpx;
   margin-left: 10rpx;
 }
 }

+ 31 - 99
pages/welfareMall/personal/personal.js

@@ -12,7 +12,8 @@ Page({
     isLogin: false,
     isLogin: false,
     mobileTop: 'TONY WU',
     mobileTop: 'TONY WU',
     countNum: 0,
     countNum: 0,
-    grayTheme:false
+    grayTheme:false,
+    navigationList:[],
   },
   },
 
 
   /**
   /**
@@ -51,8 +52,8 @@ Page({
     })
     })
   },
   },
 
 
-  // 授权手机号--历史订单
-  getPhoneNumberHis(e) {
+  // 授权手机号--跳转导航栏
+  getPhoneNav(e) {
     getPhoneNumberSync(e, async () => {
     getPhoneNumberSync(e, async () => {
         let nums = await this.getCountNum();
         let nums = await this.getCountNum();
         this.setData({
         this.setData({
@@ -60,112 +61,42 @@ Page({
             mobileTop: getMobileCache(),
             mobileTop: getMobileCache(),
             countNum: nums,
             countNum: nums,
         });
         });
-        const url = "../historical/historical"
-        wx.navigateTo({
-            url
-        })      
+        this.goToCoupon(e);  
     })
     })
   },
   },
 
 
-  // 授权手机号--意见反馈
-  getPhoneNumberFee(e) {
-    getPhoneNumberSync(e, async () => {
-        let nums = await this.getCountNum();
-        this.setData({
-            isLogin: true,
-            mobileTop: getMobileCache(),
-            countNum: nums,
-        });
-        const url = "../feedback/feedback"
-        wx.navigateTo({
-            url
-        })      
-    })
-  },
-
-  // 授权手机号--签到
-  getPhoneNumberSigin(e) {
-    getPhoneNumberSync(e, async () => {
-        let nums = await this.getCountNum();
-        this.setData({
-            isLogin: true,
-            mobileTop: getMobileCache(),
-            countNum: nums,
-        });
-        const url = "../../signIn/activity/activity"
-        wx.navigateTo({
-            url
-        })      
-    })
-  },
-
-  // 授权手机号--抽奖
-  getPhoneNumberLuck(e) {
-    getPhoneNumberSync(e, async () => {
-        let nums = await this.getCountNum();
-        this.setData({
-            isLogin: true,
-            mobileTop: getMobileCache(),
-            countNum: nums,
-        });
-        const url = "./../luckDraw/index"
-        wx.navigateTo({
-            url
-        })      
-    })
-  },
+  // 动态获取导航栏
+  async getIndexList(){
+    let res =  await WelfareMall.getPersonalData();
 
 
-  // 授权手机号--券包
-  getPhoneNumberCoupon(e) {
-    getPhoneNumberSync(e, async () => {
-        let nums = await this.getCountNum();
-        this.setData({
-            isLogin: true,
-            mobileTop: getMobileCache(),
-            countNum: nums,
-        });
-        const url = "../../luckDraw/profile"
-        wx.navigateTo({
-            url
-        })      
+    this.setData({
+      navigationList:res.data.navigationList,
     })
     })
   },
   },
 
 
-  toHistorical(e) {
-      const url = "../historical/historical?id=" + e.currentTarget.dataset.id
+  // 导航栏地址链接跳转
+  goToCoupon:function(e){
+    var appId = e.currentTarget.dataset.appid;
+    var path = e.currentTarget.dataset.path;
+  
+    if(appId && path){
+      wx.navigateToMiniProgram({
+        appId: appId,
+        path: path,
+        success(res) {
+          // 打开成功
+        }
+      })
+    }
+    
+    if(!appId && path){
       wx.navigateTo({
       wx.navigateTo({
-          url
+        url: path,
       })
       })
+    }
+   
   },
   },
 
 
-  toFeedback(e) {
-    const url = "../feedback/feedback?id=" + e.currentTarget.dataset.id
-    wx.navigateTo({
-      url: url,
-    })
-  },
-
-  toSigIn(e) {
-    const url = "../../signIn/activity/activity?id=" + e.currentTarget.dataset.id
-    wx.navigateTo({
-        url
-    })
-  },
-
-  toLuck(e) {
-    const url = "../../luckDraw/index?id=" + e.currentTarget.dataset.id
-    wx.navigateTo({
-        url
-    })
-  },
-
-  toCoupon(e) {
-    const url = "../../luckDraw/profile?id=" + e.currentTarget.dataset.id
-    wx.navigateTo({
-        url
-    })
-},
-
   /**
   /**
    * 生命周期函数--监听页面初次渲染完成
    * 生命周期函数--监听页面初次渲染完成
    */
    */
@@ -180,8 +111,9 @@ Page({
       this.setData({
       this.setData({
           grayTheme: app.globalData.grayTheme
           grayTheme: app.globalData.grayTheme
       })
       })
+    this.getIndexList();
     let  userMobile = await activity.getMobileCache();
     let  userMobile = await activity.getMobileCache();
-    console.log(userMobile)
+    // console.log(userMobile)
     if (userMobile.length !== 0) {
     if (userMobile.length !== 0) {
       this.setData({
       this.setData({
         isLogin: true,
         isLogin: true,

+ 34 - 91
pages/welfareMall/personal/personal.wxml

@@ -1,107 +1,50 @@
 <!--pages/welfareMall/personal/personal.wxml-->
 <!--pages/welfareMall/personal/personal.wxml-->
 <view class="{{grayTheme?'page':''}}">
 <view class="{{grayTheme?'page':''}}">
-<view class="personal flex-column">
-  <!-- 首部个人信息 -->
-  <view class="head flex-column">
-    <view class="head-personal flex-row">
-      <image wx:if="{{!isLogin}}" class="head-personal-logo" src="/images/welfareMall/head-portrait.png" />
-      <!-- 获取用户头像 -->
-      <open-data wx:if="{{isLogin}}" class="head-personal-logo" type="userAvatarUrl"></open-data>
-      <view class="head-personal-nl flex-column" wx:if="{{isLogin}}">
-        <!-- 获取用户微信昵称 -->
-        <open-data class="head-personal-name" type="userNickName" lang="zh_CN"></open-data>
-        <view class="head-personal-login">{{phone.toHide(mobileTop)}}</view>
-      </view>
-      <button class="personal-isLogin" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">登录/注册</button>
-    </view>
-    <view class="head-card flex-row">
-      <view class="head-card-coupon">我的优惠券</view>
-      <view class="head-card-nt flex-row">
-        <view class="head-card-num">{{countNum}}</view>
-        <view class="head-card-text">张</view>
-      </view>
-    </view>
-  </view>
-  <!-- 中部详细信息 -->
-  <view class="center">
-    <!-- 内容 -->
-    <view class="content flex-column">
-      <!-- 签到领券 -->
-      <!-- <view class="sign-in content-style flex-row">
-        <button class="wx-isLogin" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"></button>
-        <view class="grant flex-row" catchtap="toSigIn">
-          <view class="content-img-text flex-row">
-            <image class="content-img" src="/images/welfareMall/sign-in.png" />
-            <view class="content-text">签到领券</view>
-          </view>
-          <image class="content-jump" src="/images/welfareMall/jump.png" />
+  <view class="personal flex-column">
+    <!-- 首部个人信息 -->
+    <view class="head flex-column">
+      <view class="head-personal flex-row">
+        <image wx:if="{{!isLogin}}" class="head-personal-logo" src="/images/welfareMall/head-portrait.png" />
+        <!-- 获取用户头像 -->
+        <open-data wx:if="{{isLogin}}" class="head-personal-logo" type="userAvatarUrl"></open-data>
+        <view class="head-personal-nl flex-column" wx:if="{{isLogin}}">
+          <!-- 获取用户微信昵称 -->
+          <open-data class="head-personal-name" type="userNickName" lang="zh_CN"></open-data>
+          <view class="head-personal-login">{{phone.toHide(mobileTop)}}</view>
         </view>
         </view>
+        <button class="personal-isLogin" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">登录/注册</button>
       </view>
       </view>
-      <view class="content-lower"></view> -->
-      <!-- 抽奖领券 -->
-      <!-- <view class="luck-draw content-style flex-row">
-        <button class="wx-isLogin" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"></button>
-        <view class="grant flex-row" catchtap="toLuck">
-          <view class="content-img-text flex-row">
-            <image class="content-img" src="/images/welfareMall/luck-draw.png" />
-            <view class="content-text">抽奖领券</view>
-          </view>
-          <image class="content-jump" src="/images/welfareMall/jump.png" />
+      <view class="head-card flex-row">
+        <view class="head-card-coupon">我的优惠券</view>
+        <view class="head-card-nt flex-row">
+          <view class="head-card-num">{{countNum}}</view>
+          <view class="head-card-text">张</view>
         </view>
         </view>
       </view>
       </view>
-      <view class="content-lower"></view> -->
-      <!-- 我的券包 -->
-      <view class="coupon-bag content-style flex-row">
-        <view class="grant flex-row">
-          <button class="wx-isLogin" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberCoupon"></button>
-          <view class="grant flex-row" catchtap="toHistorical">
-            <view class="content-img-text flex-row" catchtap="toCoupon">
-              <image class="content-img" src="/images/welfareMall/coupon-bag.png" />
-              <view class="content-text">我的券包</view>
+    </view>
+    <!-- 中部详细信息 -->
+    <view class="center">
+      <!-- 内容 -->
+      <view class="content flex-column">
+      <!-- 导航栏遍历 -->
+        <view wx:for="{{navigationList}}" data-appid="{{item.appId}}"  wx:key="unique">
+          <view class="sign-in content-style flex-row">
+            <button class="wx-isLogin" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNav" data-path="{{item.path}}"></button>
+            <view class="grant flex-row" bindtap="goToCoupon" data-path="{{item.path}}">
+              <view class="content-img-text flex-row">
+                <image class="content-img" src="{{item.figure}}"></image>
+                <view class="content-text">{{item.title}}</view>
+              </view>
+              <image class="content-jump" src="/images/welfareMall/jump.png" />
             </view>
             </view>
           </view>
           </view>
-          <image class="content-jump" src="/images/welfareMall/jump.png" />
+          <view class="content-lower"></view>
         </view>
         </view>
+        <view></view>
       </view>
       </view>
-      <view class="content-lower"></view>
-      <!-- 邀请好友 -->
-      <!-- <view class="invite-friends content-style flex-row">
-        <view class="content-img-text flex-row">
-          <image class="content-img" src="/images/welfareMall/invite-friends.png" />
-          <view class="content-text">邀请好友</view>
-        </view>
-        <image class="content-jump" src="/images/welfareMall/jump.png" />
-      </view> -->
-      <view class="content-lower"></view>
-      <!-- 历史订单 -->
-      <view class="historical-order content-style flex-row">
-        <button class="wx-isLogin" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberHis"></button>
-        <view class="grant flex-row" catchtap="toHistorical">
-          <view class="content-img-text flex-row">
-            <image class="content-img" src="/images/welfareMall/historical-order.png" />
-            <view class="content-text">历史订单</view>
-          </view>
-          <image class="content-jump" src="/images/welfareMall/jump.png" />
-        </view>
-      </view>
-      <view class="content-lower"></view>
-      <!-- 意见反馈 -->
-      <view class="feedback content-style flex-row">
-        <button class="wx-isLogin" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberFee"></button>
-        <view class="grant flex-row" catchtap="toFeedback">
-          <view class="content-img-text flex-row">
-            <image class="content-img" src="/images/welfareMall/feedback.png" />
-            <view class="content-text">意见反馈</view>
-          </view>
-          <image class="content-jump" src="/images/welfareMall/jump.png" />
-        </view>
-      </view>
-      <view class="content-lower"></view>
-      <view></view>
     </view>
     </view>
   </view>
   </view>
 </view>
 </view>
-</view>
 
 
 <!-- 使用wxs 手机号码中间四位显示为*号 -->
 <!-- 使用wxs 手机号码中间四位显示为*号 -->
 <wxs module="phone">
 <wxs module="phone">