zs 2 years ago
parent
commit
2ad179c238

+ 11 - 5
pages/indepot/detail.js

@@ -11,7 +11,7 @@ Page({
         frameStyle: { useTop: true, name: '信息管理', leftArrow: true, useBar: false },
         // 主体高度
         infoHeight: '',
-        id:'',
+        id: '',
         form: {},
         // 弹框
         dialog: { title: '添加商品', show: false, type: '1' },
@@ -90,12 +90,18 @@ Page({
         this.setData({ 'twoorderForm.type_name': data.name })
     },
     // 上传图片
-    afterRead: function (event) {
-        console.log(event.detail);
+    imgUpl: function (e) {
+        const that = this;
+        let data = that.data.img_url;
+        data.push(e.detail)
+        that.setData({ img_url: data })
     },
     // 删除图片
-    uploadDelete: function (e) {
-        console.log(e.detail);
+    imgDel: function (e) {
+        const that = this;
+        let list = that.data.img_url;
+        let arr = list.filter((i, index) => index != e.detail.index)
+        that.setData({ img_url: arr })
     },
     twoorderSubmit: function (e) {
         console.log(e.detail);

+ 2 - 1
pages/indepot/detail.json

@@ -1,6 +1,7 @@
 {
   "component": true,
   "usingComponents": {
-    "mobile-main": "/commpents/mobile-frame/mobile-main"
+    "mobile-main": "/commpents/mobile-frame/mobile-main",
+    "vanupload": "/commpents/upload/index"
   }
 }

+ 1 - 1
pages/indepot/detail.wxml

@@ -202,7 +202,7 @@
             <text class="icon iconfont icon-tupian"></text>
           </view>
           <view class="right">
-            <van-uploader file-list="{{ img_url }}" bind:after-read="afterRead" bind:delete="uploadDelete" />
+            <vanupload list="{{img_url}}" count="{{4}}" previewSize="{{80}}" bind:imgUpload="imgUpl" bind:imgDel="imgDel"></vanupload>
           </view>
         </view>
         <view class="save">

+ 2 - 0
pages/stock/index.js

@@ -28,6 +28,8 @@ Page({
     },
     // 详细信息
     toView: function (e) {
+        let data = { id: '1234567', name: '11', type_name: '办公室生活用品', num: '11', money: '111', brief: '无' }
+        this.setData({ info: data })
         this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
     },
     // 信息变更

+ 2 - 2
pages/stock_order/index.js

@@ -25,7 +25,7 @@ Page({
     },
     // 详细信息
     toView: function (e) {
-        let data = { id: '1234567', code: '8', name: '其他' }
+        let data = { order_num: '1', receive_user_name: '8', status_name: '其他', order: [{ name: '1',num:'111',money:'99' }] }
         this.setData({ info: data })
         this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
     },
@@ -48,7 +48,7 @@ Page({
     },
     // 监听用户是否登录
     watchLogin: function () {
-        let data = [{ id: '1234567', code: '8', name: '其他' }]
+        let data = [{ order_num: '1', receive_user_name: '8', status_name: '其他' }]
         this.setData({ list: data })
         // wx.getStorage({
         // key: 'user',

+ 5 - 1
pages/stock_order/index.less

@@ -31,7 +31,7 @@
 
     .two {
         float: left;
-        width: 100%;
+        width: 95%;
         padding: 10px;
 
         .list {
@@ -81,6 +81,7 @@
 
     .content {
         float: left;
+        width: 100%;
         padding: 8px 0;
         border-radius: 6px;
         margin: 0 0 5px 0;
@@ -104,6 +105,7 @@
 
     .order {
         float: left;
+        width: 100%;
         padding: 8px 0;
         border-radius: 6px;
         margin: 0 0 5px 0;
@@ -111,6 +113,7 @@
 
         .order_1 {
             float: left;
+            width: 95%;
             margin: 0 10px;
         }
 
@@ -121,6 +124,7 @@
 
         .order_2 {
             float: left;
+            width: 97%;
             padding: 0 5px;
             margin: 5px 0 0 0;
 

+ 5 - 1
pages/stock_order/index.wxss

@@ -28,7 +28,7 @@
 }
 .main .two {
   float: left;
-  width: 100%;
+  width: 95%;
   padding: 10px;
 }
 .main .two .list {
@@ -68,6 +68,7 @@
 }
 .dialog .content {
   float: left;
+  width: 100%;
   padding: 8px 0;
   border-radius: 6px;
   margin: 0 0 5px 0;
@@ -86,6 +87,7 @@
 }
 .dialog .order {
   float: left;
+  width: 100%;
   padding: 8px 0;
   border-radius: 6px;
   margin: 0 0 5px 0;
@@ -93,6 +95,7 @@
 }
 .dialog .order .order_1 {
   float: left;
+  width: 95%;
   margin: 0 10px;
 }
 .dialog .order .order_1 text {
@@ -101,6 +104,7 @@
 }
 .dialog .order .order_2 {
   float: left;
+  width: 97%;
   padding: 0 5px;
   margin: 5px 0 0 0;
 }