浏览代码

页面跳转

xiaohaizhao 8 月之前
父节点
当前提交
58f3439d3d
共有 3 个文件被更改,包括 137 次插入6 次删除
  1. 41 4
      pages/tabbar/mine/index.js
  2. 76 1
      pages/tabbar/mine/index.scss
  3. 20 1
      pages/tabbar/mine/index.wxml

+ 41 - 4
pages/tabbar/mine/index.js

@@ -1,10 +1,6 @@
 const _Http = getApp().globalData.http;
 let downCount = null;
 Page({
-
-    /**
-     * 页面的初始数据
-     */
     data: {
         userMsg: {},
         pathList: [], //功能权限
@@ -40,6 +36,14 @@ Page({
                 pathList
             })
         };
+        this.setData({
+            auth: JSON.stringify(wx.getStorageSync('auth')),
+            userMsg: JSON.stringify(wx.getStorageSync('userMsg')),
+            site: JSON.stringify(wx.getStorageSync('siteP')),
+            templetList: JSON.stringify(wx.getStorageSync('templetList')),
+            languagecode: wx.getStorageSync('languagecode'),
+            isWorderform: getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['E-订单'], ['销售管理'])[0].apps.some(v => v.name == "worderform")
+        })
     },
     /* 查询用户信息 */
     queryUserMsg() {
@@ -62,6 +66,39 @@ Page({
     },
     onShow() {
         this.getTabBar().init();
+        if (this.data.isWorderform) _Http.basic({
+			"id": 2025030613432602,
+			"content": {},
+			"languagecode": "ZH",
+		}).then(res => {
+			console.log("获取订单数量", res)
+			if (res.code != '1') return wx.showToast({
+				title: res.msg,
+				icon: "none"
+			})
+			let list = [{
+				key: "新建",
+				icon: "icon-xinjian"
+			}, {
+				key: "提交",
+				icon: "icon-tijiao1"
+			}, {
+				key: "交期待确认",
+				icon: "icon-jiaoqidaiqueren"
+			}, {
+				key: "交期确认",
+				icon: "icon-jiaoqiqueren"
+			}, {
+				key: "审核",
+				icon: "icon-shenhe1"
+			}]
+			this.setData({
+				orders: list.map(v => {
+					v.badge = res.data[v.key]
+					return v
+				})
+			})
+		})
     },
     /* 退出登录 */
     outLogin() {

+ 76 - 1
pages/tabbar/mine/index.scss

@@ -93,9 +93,84 @@
     }
 }
 
-.operating {
+.orderForm {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding-left: 40rpx;
+    padding-right: 26rpx;
+    width: 100vw;
+    height: 90rpx;
+    box-sizing: border-box;
+    background-color: #fff;
+
+    .left {
+        .work {
+            color: #3874F6;
+            margin-right: 18rpx;
+        }
+
+        font-family: PingFang SC,
+        PingFang SC;
+        font-weight: 500;
+        font-size: 28rpx;
+        color: #262626;
+    }
+
+    .right {
+        font-family: PingFang SC, PingFang SC;
+        font-size: 28rpx;
+        color: #999999;
+    }
+}
+
+.orders {
+    display: flex;
+    width: 100vw;
     background-color: #fff;
 
+    .stuta {
+        flex: 1;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        padding-top: 20rpx;
+        padding-bottom: 18rpx;
+        box-sizing: border-box;
+
+        .iconfont {
+            position: relative;
+            font-size: 44rpx;
+            color: #666;
+
+            .badge {
+                position: absolute;
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                top: -15rpx;
+                right: -20rpx;
+                min-width: 30rpx;
+                height: 30rpx;
+                background: #FF3B30;
+                border-radius: 24rpx;
+                font-size: 20rpx;
+                color: #FFFFFF;
+            }
+        }
+
+        .text {
+            font-size: 20rpx;
+            color: #333333;
+            margin-top: 8rpx;
+        }
+    }
+}
+
+.operating {
+    background-color: #fff;
+    margin-top: 20rpx;
+    
     .item {
         width: 100%;
 

+ 20 - 1
pages/tabbar/mine/index.wxml

@@ -12,7 +12,26 @@
         <van-icon size='40rpx' name="arrow" />
     </navigator>
 </view>
-<view style="height: 20rpx;"></view>
+<block wx:if="{{isWorderform}}">
+    <navigator class="orderForm" version='develop' target='miniProgram' app-id='wxc1b6ae925ac1d06a' path="{{'/packageA/orderForm/index'+'?auth='+auth+'&userMsg='+userMsg+'&site='+site+'&templetList='+templetList+'$languagecode='+languagecode}}" url="/packageA/orderForm/index" open-type="navigate">
+        <view class="left">
+            <text class="work work-dingdan"></text>
+            我的订单
+        </view>
+        <view class="right">全部
+            <van-icon size='30rpx' name="arrow" />
+        </view>
+    </navigator>
+
+    <view class="orders" wx:if="{{orders.length}}">
+        <navigator class="stuta" version='develop' target='miniProgram' app-id='wxc1b6ae925ac1d06a' path="{{'/packageA/orderForm/index'+'?auth='+auth+'&userMsg='+userMsg+'&site='+site+'&templetList='+templetList+'$languagecode='+languagecode+'&stuta='+item.key}}" url="/packageA/orderForm/index" open-type="navigate" wx:for="{{orders}}" wx:key="key">
+            <view class="iconfont {{item.icon}}">
+                <view class="badge" style="padding: {{item.badge>9?'0 4rpx':''}};" wx:if="{{item.badge}}">{{item.badge>99?'99+':item.badge}}</view>
+            </view>
+            <view class="text">{{language[item.key]||item.key}}</view>
+        </navigator>
+    </view>
+</block>
 <view class='operating' hover>
     <navigator class="item" url="{{item.name=='团队管理'?item.path+'?auth='+teamAuth:item.path}}" wx:for="{{pathList}}">
         <view class="con">