#
whycq
2023-10-06 e1f70a62b31f326a6627d7975b17dd8304af7d90
#
3个文件已修改
53 ■■■■ 已修改文件
components/z-data-list/z-data-list.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/api/addMat.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/component/demo.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/z-data-list/z-data-list.vue
@@ -2,15 +2,16 @@
    <view >
        <view class="main">
            <view class="main-left" >
                <view class="main-list" v-for="it in dataList" >
                    <view>{{it.key}}</view>
                    <view style="margin-left: 8px;">{{it.value}}</view>
                <view class="main-list" v-for="it in dataList" style="width: 100%;">
                    <view style="flex: 1;padding-left: 8rpx;">{{it.key}}</view>
                    <view>:</view>
                    <view style="flex: 3;padding-left: 8rpx;">{{it.value}}</view>
                </view>
            </view>
            <view class="main-right" @click="goDetail">
                <view class="list-options">
                    <view class="list-number">1</view>
                    <view class="abdb"> > </view>
                    <uni-icons class="opt-icon" type="right" size="20" color="#707070"></uni-icons>
                </view>
            </view>
        </view>
@@ -72,13 +73,15 @@
        border-radius: 16rpx;
    }
    .main-left {
        flex: 4;
        flex: 7;
        background-color: #005500;
        display: flex;
        flex-direction: column;
        padding-top: 8rpx;
        padding-bottom: 8rpx;
    }
    .main-right {
        background-color: #ffaaff;
        flex: 1;
        display: flex;
        align-items: center;
@@ -86,6 +89,7 @@
    }
    .main-list {
        display: flex;
        align-items: center;
    }
    .list-options {
        display: flex;
@@ -96,7 +100,7 @@
        right: 10px;
        top: 5px;
    }
    .abdb {
        flex: 0;
    .opt-icon {
        display: flex;
    }
</style>
pages/api/addMat.js
@@ -1,36 +1,27 @@
async function addMat() {
    let that = this,item = {};
    var res = await uni.request({
    var ress = await uni.request({
        url: 'http://127.0.0.1:8089/bfwms/mat/auth',
        data: {matnr: '3CPPJ.B.GMB.LZ.QBY4-10/15P316LLZ'},
    }).then((res)=> {
        let mat = res.data.data
    }).then((result)=> {
        let mat = result.data.data
        item['detl'] = [
            {key: '商品码',value: mat.matnr},
            {key: '商品名称',value: mat.maktx},
            {key: '规格',value: mat.specs},
            {key: '数量',value: 100},
        ]
    },(res)=>{
        console.log(res);
    })
    // success(res) {
    //     result = res.data.data
    //     console.log(result);
    //     // res = res.data
    //     // let mat = res.data
    //     // let item = {}
    //     // item['detl'] = [
    //     //     {key: '商品码',value: mat.matnr},
    //     //     {key: '商品名称',value: mat.maktx},
    //     //     {key: '规格',value: mat.specs},
    //     //     {key: '数量',value: 100},
    //     // ]
    //     // that.zDataList.push(item)
    // }
    return item
}
function isEmpty(obj) {
    return typeof obj == "undefined" || obj == null || obj === "";
}
module.exports = {
    addMat: addMat
    addMat: addMat,
    isEmpty: isEmpty
}
pages/component/demo.vue
@@ -49,7 +49,9 @@
            },
            async add() {
                let mat = await addMat.addMat()
                this.zDataList.push(mat)
                if (!addMat.isEmpty(mat)) {
                    this.zDataList.push(mat)
                }
            },
            focus() {
                if (this.zInputList[0].focus) {