陈龙 пре 4 месеци
родитељ
комит
cddd5fbce2

+ 10 - 0
src/Auman.PieceWage.UniApp/README.md

@@ -1,5 +1,15 @@
 # 开发日志
 
+## 0.0.4 `2024/12/16`
+
+1. 制作明细页。
+2. “我”的页面信息展示。
+
+## 0.0.3 `2024/12/13`
+
+1. 制作tabbar图标。
+2. 制作派工页面。
+
 ## 0.0.2 `2024/12/10`
 
 1. 编写《服务协议和隐私政策》。

+ 7 - 1
src/Auman.PieceWage.UniApp/components/page-dispatch/page-dispatch.vue

@@ -7,7 +7,7 @@
         </view>
         <view class="grow-1 height-0 scroll padding">
             <view class="dispatch-row" v-for="(item, index) in list" key="number">
-                <view class="dispatch-row-title">{{item.title}}</view>
+                <view class="dispatch-row-title" @tap="openDetail()">{{item.title}}</view>
                 <view class="dispatch-row-cells child-gap">
                     <view class="dispatch-row-cell width-40per">{{item.number}}</view>
                     <view class="dispatch-row-cell grow-1">{{item.spec}}</view>
@@ -90,6 +90,12 @@
                         content: res.message
                     });
                 }
+            },
+            
+            openDetail(){
+                uni.navigateTo({
+                    url: '/pages/dispatch/dispatch-detail'
+                })
             }
         }
     }

+ 125 - 0
src/Auman.PieceWage.UniApp/components/page-work-order/page-work-order.vue

@@ -0,0 +1,125 @@
+<template>
+    <view class="flex direction-column height-100pre width-100per">
+        <uni-search-bar placeholder="单号、型号" style="width: 100%;"></uni-search-bar>
+        <view class="flex padding-lr child-gap">
+            <uni-datetime-picker type="date" placeholder="开始时间"></uni-datetime-picker>
+            <uni-datetime-picker type="date" placeholder="结束时间"></uni-datetime-picker>
+        </view>
+        <view class="grow-1 height-0 scroll padding">
+            <view class="dispatch-row" v-for="(item, index) in list" key="number">
+                <view class="dispatch-row-title" @tap="openDetail()">{{item.title}}</view>
+                <view class="dispatch-row-cells child-gap">
+                    <view class="dispatch-row-cell width-40per">{{item.number}}</view>
+                    <view class="dispatch-row-cell grow-1">{{item.spec}}</view>
+                </view>
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+    import extend from '../../utils/extend';
+    import request from '../../utils/request';
+    export default {
+        name: "page-dispatch",
+        props: {
+            url: {
+                type: String,
+                default: ''
+            },
+            method: {
+                type: String,
+                default: 'get'
+            }
+        },
+        data() {
+            return {
+                list: [{
+                    title: '劳伦斯',
+                    number: 'C25412555',
+                    spec: '左扶1+右扶1+脚踏'
+                }, {
+                    title: '劳伦斯ds',
+                    number: 'C254125ert',
+                    spec: '左扶1+右扶1+脚踏'
+                }, {
+                    title: '劳ddsds',
+                    number: 'CD212244',
+                    spec: '左扶1+右扶1+脚踏'
+                }, {
+                    title: '劳gs',
+                    number: 'CD21552244',
+                    spec: '左扶1+右扶1+脚踏'
+                }, {
+                    title: '劳bdf',
+                    number: 'CS21552244',
+                    spec: '左扶1+右扶1+脚踏'
+                }, {
+                    title: 'hhhbdf',
+                    number: 'GCS21552244',
+                    spec: '左扶1+右扶1+脚踏'
+                }, {
+                    title: 'hhdggbdf',
+                    number: 'GC232244',
+                    spec: '左扶1+右扶1+脚踏'
+                }, {
+                    title: 'haadggbdf',
+                    number: 'GV3224de4',
+                    spec: '左扶1+右扶1+脚踏'
+                }]
+            };
+        },
+        created(){
+            this.load();
+        },
+        methods: {
+            async load(){
+                if (extend.isEmptyString(this.url)) {
+                    return;
+                }
+                uni.showLoading();
+                let res = await request.sendToken({
+                    url: this.url,
+                    method: this.method
+                });
+                uni.hideLoading();
+                console.log(res);
+                if (res.success) {} else {
+                    uni.showModal({
+                        title: '错误',
+                        content: res.message
+                    });
+                }
+            },
+            
+            openDetail(){
+                uni.navigateTo({
+                    url: '/pages/work-order/work-order-detail'
+                })
+            }
+        }
+    }
+</script>
+
+<style lang="scss">
+    .dispatch-row {
+        position: relative;
+        padding: 10upx 0;
+        
+        .dispatch-row-title {
+            font-size: 32upx;
+            padding: 10upx 0;
+        }
+        
+        .dispatch-row-cells {
+            position: relative;
+            display: flex;
+            font-size: 24upx;
+            color: #666666;
+        }
+        
+        .dispatch-row-cell {
+            flex-shrink: 0;
+        }
+    }
+</style>

+ 2 - 2
src/Auman.PieceWage.UniApp/manifest.json

@@ -2,8 +2,8 @@
     "name" : "生产流程管理",
     "appid" : "__UNI__930B119",
     "description" : "生产流程管理",
-    "versionName" : "0.0.3",
-    "versionCode" : 3,
+    "versionName" : "0.0.4",
+    "versionCode" : 4,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 14 - 0
src/Auman.PieceWage.UniApp/pages.json

@@ -40,12 +40,26 @@
                 "navigationBarTitleText" : "派工"
             }
         },
+        {
+            "path" : "pages/dispatch/dispatch-detail",
+            "style" : 
+            {
+                "navigationBarTitleText" : "产品详情"
+            }
+        },
         {
             "path" : "pages/work-order/work-order",
             "style" : 
             {
                 "navigationBarTitleText" : "报工"
             }
+        },
+        {
+            "path" : "pages/work-order/work-order-detail",
+            "style" : 
+            {
+                "navigationBarTitleText" : "产品详情"
+            }
         }
     ],
     "globalStyle": {

+ 58 - 0
src/Auman.PieceWage.UniApp/pages/dispatch/dispatch-detail.vue

@@ -0,0 +1,58 @@
+<template>
+    <view class="flex direction-column height-100pre padding">
+        <view class="image-box"></view>
+        <view class="title">{{row.title}}</view>
+        <view class="flex child-gap">
+            <view class="attr width-45per">{{row.number}}</view>
+            <view class="attr grow-1">上工序{{row.prevProcess}}</view>
+        </view>
+        <view class="attr padding-tb">{{row.spec}}</view>
+        <view class="flex grow-1 height-0 scroll">
+            <view>{{row.content}}</view>
+        </view>
+    </view>
+</template>
+
+<script>
+    export default {
+        data() {
+            return {
+                row: {
+                    title: '劳伦斯',
+                    number: 'cx2201548dd21',
+                    prevProcess: '流程1',
+                    spec: '左扶1*2+右扶1*1+脚踏',
+                    content: '总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;'
+                }
+            };
+        }
+    }
+</script>
+
+<style lang="scss">
+    .image-box {
+        position: relative;
+        width: 100%;
+        height: 300upx;
+        background-color: #f8f8f8;
+    }
+    
+    .title {
+        display: flex;
+        font-size: 42upx;
+        align-items: center;
+        justify-content: center;
+        padding: 40upx 20upx;
+    }
+    
+    .attr {
+        flex-shrink: 0;
+        color: #999999;
+        font-size: 28upx;
+    }
+    
+    .content {
+        font-size: 325upx;
+        padding: 20upx;
+    }
+</style>

+ 5 - 4
src/Auman.PieceWage.UniApp/pages/my/index.vue

@@ -55,16 +55,17 @@
             if (token.has()) {
                 this.isLogin = true;
                 userinfo = user.get();
-                this.username = userinfo.UserName;
-                this.loginName = userinfo.LoginName;
+                console.log(userinfo);
+                this.username = userinfo.userName;
+                this.loginName = userinfo.loginName;
                 console.log(userinfo);
             } else {
                 let res = await token.getByServer();
                 if (res.success) {
                     this.isLogin = true;
                     userinfo = user.get();
-                    this.username = userinfo.UserName;
-                    this.loginName = userinfo.LoginName;
+                    this.username = userinfo.userName;
+                    this.loginName = userinfo.loginName;
                 } else {
                     token.clear();
                     this.isLogin = false;

+ 58 - 0
src/Auman.PieceWage.UniApp/pages/work-order/work-order-detail.vue

@@ -0,0 +1,58 @@
+<template>
+    <view class="flex direction-column height-100pre padding">
+        <view class="image-box"></view>
+        <view class="title">{{row.title}}</view>
+        <view class="flex child-gap">
+            <view class="attr width-45per">{{row.number}}</view>
+            <view class="attr grow-1">上工序{{row.prevProcess}}</view>
+        </view>
+        <view class="attr padding-tb">{{row.spec}}</view>
+        <view class="flex grow-1 height-0 scroll">
+            <view>{{row.content}}</view>
+        </view>
+    </view>
+</template>
+
+<script>
+    export default {
+        data() {
+            return {
+                row: {
+                    title: '劳伦斯',
+                    number: 'cx2201548dd21',
+                    prevProcess: '流程1',
+                    spec: '左扶1*2+右扶1*1+脚踏',
+                    content: '总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;总长3.2米;左扶1(2个)各减7;单心减8;全套全部换成月球表面;'
+                }
+            };
+        }
+    }
+</script>
+
+<style lang="scss">
+    .image-box {
+        position: relative;
+        width: 100%;
+        height: 300upx;
+        background-color: #f8f8f8;
+    }
+    
+    .title {
+        display: flex;
+        font-size: 42upx;
+        align-items: center;
+        justify-content: center;
+        padding: 40upx 20upx;
+    }
+    
+    .attr {
+        flex-shrink: 0;
+        color: #999999;
+        font-size: 28upx;
+    }
+    
+    .content {
+        font-size: 325upx;
+        padding: 20upx;
+    }
+</style>

+ 10 - 2
src/Auman.PieceWage.UniApp/pages/work-order/work-order.vue

@@ -1,6 +1,14 @@
 <template>
-    <view>
-        
+    <view class="flex direction-column height-100pre">
+        <easy-tab type="line" @change="onTabChange">
+            <easy-tab-item>开料</easy-tab-item>
+            <easy-tab-item>断料</easy-tab-item>
+            <easy-tab-item>钉架子</easy-tab-item>
+            <easy-tab-item>打底</easy-tab-item>
+        </easy-tab>
+        <view class="flex grow-1 height-0 width-100per">
+            <page-work-order :url="url" :method="method"></page-work-order>
+        </view>
     </view>
 </template>
 

+ 4 - 0
src/Auman.PieceWage.UniApp/styles/main.css

@@ -39,6 +39,10 @@ text {
     width: 40%;
 }
 
+.width-45per {
+    width: 45%;
+}
+
 .width-50per {
     width: 50%;
 }

+ 3 - 3
src/Auman.PieceWage.UniApp/utils/token.js

@@ -5,9 +5,9 @@ import user from './user.js';
 import url from './url.js';
 
 /**
- * 默认过期时间 8 小时
+ * 默认过期时间 2 小时
  */
-const defaultExpiresIn = 28800000;
+const defaultExpiresIn = 7200000;
 
 /**
  * token 存储键
@@ -56,7 +56,7 @@ export default {
         }
         let timeout = 0;
         if (extend.isNumber(param.expires_in)) {
-            timeout = Date.now() + param.expires_in;
+            timeout = Date.now() + (param.expires_in * 1000) || defaultExpiresIn;
         } else {
             timeout = Date.now() + defaultExpiresIn;
         }