kulley 6 years ago
parent
commit
09a2934d00

+ 1683 - 0
ec.txt

@@ -0,0 +1,1683 @@
+query userbyid($id: ID) {
+    userbyid: user_by_id(id: $id) {
+        email
+        updatedAt
+        password
+        telephone
+        username
+        createdAt
+        openid
+        id
+        userData_id {
+            id
+            nickname
+            avatar
+            isVip
+            vipCode
+            userPoint
+            createdAt
+            updatedAt
+        }
+    }
+}
+
+query adminbyid($id: ID) {
+    adminbyid: admin_by_id(id: $id) {
+        id
+        openid
+        username
+        password
+        telephone
+        email
+        createdAt
+        updatedAt
+    }
+}
+
+query specificationStockbyid($id: ID) {
+    specificationStockbyid: specificationStock_by_id(id: $id) {
+        id
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        color
+        size
+        stock
+        status
+        createdAt
+        updatedAt
+    }
+}
+
+query orderPaybyprops($user_id: ID, $order_id: ID, $totalPay: Float, $transactionId: String, $payTime: String) {
+    orderPaybyprops: orderPay_by_props(user_id: $user_id order_id: $order_id totalPay: $totalPay transactionId: $transactionId payTime: $payTime) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        totalPay
+        transactionId
+        payTime
+    }
+}
+
+query userCartbyid($id: ID) {
+    userCartbyid: userCart_by_id(id: $id) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        specificationStock_id {
+            id
+
+            color
+            size
+            stock
+            status
+            createdAt
+            updatedAt
+        }
+        count
+        createdAt
+        updatedAt
+    }
+}
+
+query userDatabyid($id: ID) {
+    userDatabyid: userData_by_id(id: $id) {
+        id
+        nickname
+        avatar
+        isVip
+        vipCode
+        userPoint
+        createdAt
+        updatedAt
+    }
+}
+
+query adminbyprops($openid: String, $username: String, $password: String, $telephone: String, $email: String, $createdAt: String, $updatedAt: String) {
+    adminbyprops: admin_by_props(openid: $openid username: $username password: $password telephone: $telephone email: $email createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        openid
+        username
+        password
+        telephone
+        email
+        createdAt
+        updatedAt
+    }
+}
+
+query userSearchbyprops($user_id: ID, $createdAt: String, $updatedAt: String) {
+    userSearchbyprops: userSearch_by_props(user_id: $user_id createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        keyword
+        createdAt
+        updatedAt
+    }
+}
+
+query userCollectbyprops($user_id: ID, $createdAt: String, $updatedAt: String) {
+    userCollectbyprops: userCollect_by_props(user_id: $user_id createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        createdAt
+        updatedAt
+    }
+}
+
+query productbyprops($category: String, $updatedAt: String, $unit: String, $name: String, $createdAt: String, $status: String, $intro: String, $price: Float, $img: String, $stock: Int) {
+    productbyprops: product_by_props(category: $category updatedAt: $updatedAt unit: $unit name: $name createdAt: $createdAt status: $status intro: $intro price: $price img: $img stock: $stock) {
+        category
+        updatedAt
+        unit
+        name
+        createdAt
+        status
+        id
+        intro
+        price
+        img
+        stock
+    }
+}
+
+query orderLogisticsbyid($id: ID) {
+    orderLogisticsbyid: orderLogistics_by_id(id: $id) {
+        updatedAt
+        logisticsFee
+        expressId
+        createdAt
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        consigneeTel
+        id
+        consignAddress
+        LogisticsStatus
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        consigneeName
+    }
+}
+
+query specificationStockbyprops($product_id: ID, $color: String, $size: String, $stock: Int, $status: String, $createdAt: String, $updatedAt: String) {
+    specificationStockbyprops: specificationStock_by_props(product_id: $product_id color: $color size: $size stock: $stock status: $status createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        color
+        size
+        stock
+        status
+        createdAt
+        updatedAt
+    }
+}
+
+query orderProductbyid($id: ID) {
+    orderProductbyid: orderProduct_by_id(id: $id) {
+        remark
+        updatedAt
+        productColor
+        unit
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        productSize
+        orderPay
+        createdAt
+        productImg
+        productName
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        productPrice
+        id
+        count
+        productPay
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        orderPay_id {
+            id
+
+
+            totalPay
+            transactionId
+            payTime
+        }
+    }
+}
+
+query userCollectbyid($id: ID) {
+    userCollectbyid: userCollect_by_id(id: $id) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        createdAt
+        updatedAt
+    }
+}
+
+query userAddressbyprops($address: String, $updatedAt: String, $telephone: String, $default: Int, $city: String, $username: String, $postcode: String, $createdAt: String, $deletedAt: String, $user_id: ID, $area: String, $province: String) {
+    userAddressbyprops: userAddress_by_props(address: $address updatedAt: $updatedAt telephone: $telephone
+        default: $default city: $city username: $username postcode: $postcode createdAt: $createdAt deletedAt: $deletedAt user_id: $user_id area: $area province: $province) {
+        address
+        updatedAt
+        telephone
+        default
+        city
+        username
+        postcode
+        createdAt
+        deletedAt
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        area
+        province
+    }
+}
+
+query orderPaybyid($id: ID) {
+    orderPaybyid: orderPay_by_id(id: $id) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        totalPay
+        transactionId
+        payTime
+    }
+}
+
+query userAddressbyid($id: ID) {
+    userAddressbyid: userAddress_by_id(id: $id) {
+        address
+        updatedAt
+        telephone
+        default
+        city
+        username
+        postcode
+        createdAt
+        deletedAt
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        area
+        province
+    }
+}
+
+query orderLogisticsbyprops($updatedAt: String, $logisticsFee: Float, $expressId: String, $createdAt: String, $order_id: ID, $consigneeTel: String, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String) {
+    orderLogisticsbyprops: orderLogistics_by_props(updatedAt: $updatedAt logisticsFee: $logisticsFee expressId: $expressId createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName) {
+        updatedAt
+        logisticsFee
+        expressId
+        createdAt
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        consigneeTel
+        id
+        consignAddress
+        LogisticsStatus
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        consigneeName
+    }
+}
+
+query orderbyid($id: ID) {
+    orderbyid: order_by_id(id: $id) {
+        deliveryTime
+        updatedAt
+        orderLogistics_id {
+            updatedAt
+            logisticsFee
+            expressId
+            createdAt
+
+            consigneeTel
+            id
+            consignAddress
+            LogisticsStatus
+
+            consigneeName
+        }
+        payTime
+        orderTotalPay
+        createdAt
+        orderStatus
+        userAddress_id {
+            address
+            updatedAt
+            telephone
+            default
+            city
+            username
+            postcode
+            createdAt
+            deletedAt
+            id
+
+            area
+            province
+        }
+        id
+        orderShipFee
+        count
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        productTotalPay
+        orderPay_id {
+            id
+
+
+            totalPay
+            transactionId
+            payTime
+        }
+    }
+}
+
+query orderProductbyprops($remark: String, $updatedAt: String, $productColor: String, $unit: String, $product_id: ID, $productSize: String, $orderPay: Float, $createdAt: String, $productImg: String, $productName: String, $order_id: ID, $productPrice: Float, $count: Int, $productPay: Float, $user_id: ID, $orderPay_id: ID) {
+    orderProductbyprops: orderProduct_by_props(remark: $remark updatedAt: $updatedAt productColor: $productColor unit: $unit product_id: $product_id productSize: $productSize orderPay: $orderPay createdAt: $createdAt productImg: $productImg productName: $productName order_id: $order_id productPrice: $productPrice count: $count productPay: $productPay user_id: $user_id orderPay_id: $orderPay_id) {
+        remark
+        updatedAt
+        productColor
+        unit
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        productSize
+        orderPay
+        createdAt
+        productImg
+        productName
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        productPrice
+        id
+        count
+        productPay
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        orderPay_id {
+            id
+
+
+            totalPay
+            transactionId
+            payTime
+        }
+    }
+}
+
+query productbyid($id: ID) {
+    productbyid: product_by_id(id: $id) {
+        category
+        updatedAt
+        unit
+        name
+        createdAt
+        status
+        id
+        intro
+        price
+        img
+        stock
+    }
+}
+
+query userSearchbyid($id: ID) {
+    userSearchbyid: userSearch_by_id(id: $id) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        keyword
+        createdAt
+        updatedAt
+    }
+}
+
+query userDatabyprops($nickname: String, $avatar: String, $isVip: Boolean, $vipCode: String, $userPoint: Int, $createdAt: String, $updatedAt: String) {
+    userDatabyprops: userData_by_props(nickname: $nickname avatar: $avatar isVip: $isVip vipCode: $vipCode userPoint: $userPoint createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        nickname
+        avatar
+        isVip
+        vipCode
+        userPoint
+        createdAt
+        updatedAt
+    }
+}
+
+query userCartbyprops($user_id: ID, $product_id: ID, $specificationStock_id: ID, $count: Int, $createdAt: String, $updatedAt: String) {
+    userCartbyprops: userCart_by_props(user_id: $user_id product_id: $product_id specificationStock_id: $specificationStock_id count: $count createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        specificationStock_id {
+            id
+
+            color
+            size
+            stock
+            status
+            createdAt
+            updatedAt
+        }
+        count
+        createdAt
+        updatedAt
+    }
+}
+
+query userbyprops($openid: String, $username: String, $password: String, $telephone: String, $email: String, $userData_id: ID, $createdAt: String, $updatedAt: String) {
+    userbyprops: user_by_props(openid: $openid username: $username password: $password telephone: $telephone email: $email userData_id: $userData_id createdAt: $createdAt updatedAt: $updatedAt) {
+        email
+        updatedAt
+        password
+        telephone
+        username
+        createdAt
+        openid
+        id
+        userData_id {
+            id
+            nickname
+            avatar
+            isVip
+            vipCode
+            userPoint
+            createdAt
+            updatedAt
+        }
+    }
+}
+
+query orderbyprops($deliveryTime: String, $updatedAt: String, $orderLogistics_id: ID, $payTime: String, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $orderShipFee: Float, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
+    orderbyprops: order_by_props(deliveryTime: $deliveryTime updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id payTime: $payTime orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id orderShipFee: $orderShipFee count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
+        deliveryTime
+        updatedAt
+        orderLogistics_id {
+            updatedAt
+            logisticsFee
+            expressId
+            createdAt
+
+            consigneeTel
+            id
+            consignAddress
+            LogisticsStatus
+
+            consigneeName
+        }
+        payTime
+        orderTotalPay
+        createdAt
+        orderStatus
+        userAddress_id {
+            address
+            updatedAt
+            telephone
+            default
+            city
+            username
+            postcode
+            createdAt
+            deletedAt
+            id
+
+            area
+            province
+        }
+        id
+        orderShipFee
+        count
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        productTotalPay
+        orderPay_id {
+            id
+
+
+            totalPay
+            transactionId
+            payTime
+        }
+    }
+}
+
+mutation createorderPay($id: ID!, $user_id: ID, $order_id: ID, $totalPay: Float, $transactionId: String, $payTime: String) {
+    createorderPay: create_orderPay(id: $id user_id: $user_id order_id: $order_id totalPay: $totalPay transactionId: $transactionId payTime: $payTime) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        totalPay
+        transactionId
+        payTime
+    }
+}
+
+mutation createuser($email: String, $updatedAt: String, $password: String, $telephone: String, $username: String, $createdAt: String, $openid: String, $id: ID!, $userData_id: ID) {
+    createuser: create_user(email: $email updatedAt: $updatedAt password: $password telephone: $telephone username: $username createdAt: $createdAt openid: $openid id: $id userData_id: $userData_id) {
+        email
+        updatedAt
+        password
+        telephone
+        username
+        createdAt
+        openid
+        id
+        userData_id {
+            id
+            nickname
+            avatar
+            isVip
+            vipCode
+            userPoint
+            createdAt
+            updatedAt
+        }
+    }
+}
+
+mutation updateproduct($category: String, $updatedAt: String, $unit: String, $name: String, $createdAt: String, $status: String, $id: ID, $intro: String, $price: Float, $img: String, $stock: Int) {
+    updateproduct: update_product(category: $category updatedAt: $updatedAt unit: $unit name: $name createdAt: $createdAt status: $status id: $id intro: $intro price: $price img: $img stock: $stock) {
+        category
+        updatedAt
+        unit
+        name
+        createdAt
+        status
+        id
+        intro
+        price
+        img
+        stock
+    }
+}
+
+mutation updateuser($email: String, $updatedAt: String, $password: String, $telephone: String, $username: String, $createdAt: String, $openid: String, $id: ID, $userData_id: ID) {
+    updateuser: update_user(email: $email updatedAt: $updatedAt password: $password telephone: $telephone username: $username createdAt: $createdAt openid: $openid id: $id userData_id: $userData_id) {
+        email
+        updatedAt
+        password
+        telephone
+        username
+        createdAt
+        openid
+        id
+        userData_id {
+            id
+            nickname
+            avatar
+            isVip
+            vipCode
+            userPoint
+            createdAt
+            updatedAt
+        }
+    }
+}
+
+mutation updateuserData($id: ID, $nickname: String, $avatar: String, $isVip: Boolean, $vipCode: String, $userPoint: Int, $createdAt: String, $updatedAt: String) {
+    updateuserData: update_userData(id: $id nickname: $nickname avatar: $avatar isVip: $isVip vipCode: $vipCode userPoint: $userPoint createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        nickname
+        avatar
+        isVip
+        vipCode
+        userPoint
+        createdAt
+        updatedAt
+    }
+}
+
+mutation createuserCollect($id: ID!, $product_id: ID, $user_id: ID, $createdAt: String, $updatedAt: String) {
+    createuserCollect: create_userCollect(id: $id product_id: $product_id user_id: $user_id createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        createdAt
+        updatedAt
+    }
+}
+
+mutation createuserAddress($address: String, $updatedAt: String, $telephone: String, $default: Int, $city: String, $username: String, $postcode: String, $createdAt: String, $deletedAt: String, $id: ID!, $user_id: ID, $area: String, $province: String) {
+    createuserAddress: create_userAddress(address: $address updatedAt: $updatedAt telephone: $telephone
+        default: $default city: $city username: $username postcode: $postcode createdAt: $createdAt deletedAt: $deletedAt id: $id user_id: $user_id area: $area province: $province) {
+        address
+        updatedAt
+        telephone
+        default
+        city
+        username
+        postcode
+        createdAt
+        deletedAt
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        area
+        province
+    }
+}
+
+mutation deleteuserCart($id: ID, $user_id: ID, $product_id: ID, $specificationStock_id: ID, $count: Int, $createdAt: String, $updatedAt: String) {
+    deleteuserCart: delete_userCart(id: $id user_id: $user_id product_id: $product_id specificationStock_id: $specificationStock_id count: $count createdAt: $createdAt updatedAt: $updatedAt)
+}
+
+mutation updateuserAddress($address: String, $updatedAt: String, $telephone: String, $default: Int, $city: String, $username: String, $postcode: String, $createdAt: String, $deletedAt: String, $id: ID, $user_id: ID, $area: String, $province: String) {
+    updateuserAddress: update_userAddress(address: $address updatedAt: $updatedAt telephone: $telephone
+        default: $default city: $city username: $username postcode: $postcode createdAt: $createdAt deletedAt: $deletedAt id: $id user_id: $user_id area: $area province: $province) {
+        address
+        updatedAt
+        telephone
+        default
+        city
+        username
+        postcode
+        createdAt
+        deletedAt
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        area
+        province
+    }
+}
+
+mutation updateadmin($id: ID, $openid: String, $username: String, $password: String, $telephone: String, $email: String, $createdAt: String, $updatedAt: String) {
+    updateadmin: update_admin(id: $id openid: $openid username: $username password: $password telephone: $telephone email: $email createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        openid
+        username
+        password
+        telephone
+        email
+        createdAt
+        updatedAt
+    }
+}
+
+mutation deletespecificationStock($id: ID, $product_id: ID, $color: String, $size: String, $stock: Int, $status: String, $createdAt: String, $updatedAt: String) {
+    deletespecificationStock: delete_specificationStock(id: $id product_id: $product_id color: $color size: $size stock: $stock status: $status createdAt: $createdAt updatedAt: $updatedAt)
+}
+
+mutation createuserSearch($id: ID!, $keyword: Int, $user_id: ID, $createdAt: String, $updatedAt: String) {
+    createuserSearch: create_userSearch(id: $id keyword: $keyword user_id: $user_id createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        keyword
+        createdAt
+        updatedAt
+    }
+}
+
+mutation createproduct($category: String, $updatedAt: String, $unit: String, $name: String, $createdAt: String, $status: String, $id: ID!, $intro: String, $price: Float, $img: String, $stock: Int) {
+    createproduct: create_product(category: $category updatedAt: $updatedAt unit: $unit name: $name createdAt: $createdAt status: $status id: $id intro: $intro price: $price img: $img stock: $stock) {
+        category
+        updatedAt
+        unit
+        name
+        createdAt
+        status
+        id
+        intro
+        price
+        img
+        stock
+    }
+}
+
+mutation deleteuserData($id: ID, $nickname: String, $avatar: String, $isVip: Boolean, $vipCode: String, $userPoint: Int, $createdAt: String, $updatedAt: String) {
+    deleteuserData: delete_userData(id: $id nickname: $nickname avatar: $avatar isVip: $isVip vipCode: $vipCode userPoint: $userPoint createdAt: $createdAt updatedAt: $updatedAt)
+}
+
+mutation createspecificationStock($id: ID!, $product_id: ID, $color: String, $size: String, $stock: Int, $status: String, $createdAt: String, $updatedAt: String) {
+    createspecificationStock: create_specificationStock(id: $id product_id: $product_id color: $color size: $size stock: $stock status: $status createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        color
+        size
+        stock
+        status
+        createdAt
+        updatedAt
+    }
+}
+
+mutation deleteorderProduct($remark: String, $updatedAt: String, $productColor: String, $unit: String, $product_id: ID, $productSize: String, $orderPay: Float, $createdAt: String, $productImg: String, $productName: String, $order_id: ID, $productPrice: Float, $id: ID, $count: Int, $productPay: Float, $user_id: ID, $orderPay_id: ID) {
+    deleteorderProduct: delete_orderProduct(remark: $remark updatedAt: $updatedAt productColor: $productColor unit: $unit product_id: $product_id productSize: $productSize orderPay: $orderPay createdAt: $createdAt productImg: $productImg productName: $productName order_id: $order_id productPrice: $productPrice id: $id count: $count productPay: $productPay user_id: $user_id orderPay_id: $orderPay_id)
+}
+
+mutation deleteuserCollect($id: ID, $user_id: ID, $createdAt: String, $updatedAt: String) {
+    deleteuserCollect: delete_userCollect(id: $id user_id: $user_id createdAt: $createdAt updatedAt: $updatedAt)
+}
+
+mutation updateuserCollect($id: ID, $product_id: ID, $user_id: ID, $createdAt: String, $updatedAt: String) {
+    updateuserCollect: update_userCollect(id: $id product_id: $product_id user_id: $user_id createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        createdAt
+        updatedAt
+    }
+}
+
+mutation deleteorder($deliveryTime: String, $updatedAt: String, $orderLogistics_id: ID, $payTime: String, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $id: ID, $orderShipFee: Float, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
+    deleteorder: delete_order(deliveryTime: $deliveryTime updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id payTime: $payTime orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id id: $id orderShipFee: $orderShipFee count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id)
+}
+
+mutation deleteadmin($id: ID, $openid: String, $username: String, $password: String, $telephone: String, $email: String, $createdAt: String, $updatedAt: String) {
+    deleteadmin: delete_admin(id: $id openid: $openid username: $username password: $password telephone: $telephone email: $email createdAt: $createdAt updatedAt: $updatedAt)
+}
+
+mutation updatespecificationStock($id: ID, $product_id: ID, $color: String, $size: String, $stock: Int, $status: String, $createdAt: String, $updatedAt: String) {
+    updatespecificationStock: update_specificationStock(id: $id product_id: $product_id color: $color size: $size stock: $stock status: $status createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        color
+        size
+        stock
+        status
+        createdAt
+        updatedAt
+    }
+}
+
+mutation deleteuserAddress($address: String, $updatedAt: String, $telephone: String, $default: Int, $city: String, $username: String, $postcode: String, $createdAt: String, $deletedAt: String, $id: ID, $user_id: ID, $area: String, $province: String) {
+    deleteuserAddress: delete_userAddress(address: $address updatedAt: $updatedAt telephone: $telephone
+        default: $default city: $city username: $username postcode: $postcode createdAt: $createdAt deletedAt: $deletedAt id: $id user_id: $user_id area: $area province: $province)
+}
+
+mutation updateuserCart($id: ID, $user_id: ID, $product_id: ID, $specificationStock_id: ID, $count: Int, $createdAt: String, $updatedAt: String) {
+    updateuserCart: update_userCart(id: $id user_id: $user_id product_id: $product_id specificationStock_id: $specificationStock_id count: $count createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        specificationStock_id {
+            id
+
+            color
+            size
+            stock
+            status
+            createdAt
+            updatedAt
+        }
+        count
+        createdAt
+        updatedAt
+    }
+}
+
+mutation deleteuser($email: String, $updatedAt: String, $password: String, $telephone: String, $username: String, $createdAt: String, $openid: String, $id: ID, $userData_id: ID) {
+    deleteuser: delete_user(email: $email updatedAt: $updatedAt password: $password telephone: $telephone username: $username createdAt: $createdAt openid: $openid id: $id userData_id: $userData_id)
+}
+
+mutation createuserCart($id: ID!, $user_id: ID, $product_id: ID, $specificationStock_id: ID, $count: Int, $createdAt: String, $updatedAt: String) {
+    createuserCart: create_userCart(id: $id user_id: $user_id product_id: $product_id specificationStock_id: $specificationStock_id count: $count createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        specificationStock_id {
+            id
+
+            color
+            size
+            stock
+            status
+            createdAt
+            updatedAt
+        }
+        count
+        createdAt
+        updatedAt
+    }
+}
+
+mutation createuserData($id: ID!, $nickname: String, $avatar: String, $isVip: Boolean, $vipCode: String, $userPoint: Int, $createdAt: String, $updatedAt: String) {
+    createuserData: create_userData(id: $id nickname: $nickname avatar: $avatar isVip: $isVip vipCode: $vipCode userPoint: $userPoint createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        nickname
+        avatar
+        isVip
+        vipCode
+        userPoint
+        createdAt
+        updatedAt
+    }
+}
+
+mutation createorder($deliveryTime: String, $updatedAt: String, $orderLogistics_id: ID, $payTime: String, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $id: ID!, $orderShipFee: Float, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
+    createorder: create_order(deliveryTime: $deliveryTime updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id payTime: $payTime orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id id: $id orderShipFee: $orderShipFee count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
+        deliveryTime
+        updatedAt
+        orderLogistics_id {
+            updatedAt
+            logisticsFee
+            expressId
+            createdAt
+
+            consigneeTel
+            id
+            consignAddress
+            LogisticsStatus
+
+            consigneeName
+        }
+        payTime
+        orderTotalPay
+        createdAt
+        orderStatus
+        userAddress_id {
+            address
+            updatedAt
+            telephone
+            default
+            city
+            username
+            postcode
+            createdAt
+            deletedAt
+            id
+
+            area
+            province
+        }
+        id
+        orderShipFee
+        count
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        productTotalPay
+        orderPay_id {
+            id
+
+
+            totalPay
+            transactionId
+            payTime
+        }
+    }
+}
+
+mutation deleteuserSearch($id: ID, $user_id: ID, $createdAt: String, $updatedAt: String) {
+    deleteuserSearch: delete_userSearch(id: $id user_id: $user_id createdAt: $createdAt updatedAt: $updatedAt)
+}
+
+mutation deleteorderPay($id: ID, $user_id: ID, $order_id: ID, $totalPay: Float, $transactionId: String, $payTime: String) {
+    deleteorderPay: delete_orderPay(id: $id user_id: $user_id order_id: $order_id totalPay: $totalPay transactionId: $transactionId payTime: $payTime)
+}
+
+mutation updateorderPay($id: ID, $user_id: ID, $order_id: ID, $totalPay: Float, $transactionId: String, $payTime: String) {
+    updateorderPay: update_orderPay(id: $id user_id: $user_id order_id: $order_id totalPay: $totalPay transactionId: $transactionId payTime: $payTime) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        totalPay
+        transactionId
+        payTime
+    }
+}
+
+mutation deleteorderLogistics($updatedAt: String, $logisticsFee: Float, $expressId: String, $createdAt: String, $order_id: ID, $consigneeTel: String, $id: ID, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String) {
+    deleteorderLogistics: delete_orderLogistics(updatedAt: $updatedAt logisticsFee: $logisticsFee expressId: $expressId createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel id: $id consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName)
+}
+
+mutation updateuserSearch($id: ID, $keyword: Int, $user_id: ID, $createdAt: String, $updatedAt: String) {
+    updateuserSearch: update_userSearch(id: $id keyword: $keyword user_id: $user_id createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        keyword
+        createdAt
+        updatedAt
+    }
+}
+
+mutation updateorder($deliveryTime: String, $updatedAt: String, $orderLogistics_id: ID, $payTime: String, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $id: ID, $orderShipFee: Float, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
+    updateorder: update_order(deliveryTime: $deliveryTime updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id payTime: $payTime orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id id: $id orderShipFee: $orderShipFee count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
+        deliveryTime
+        updatedAt
+        orderLogistics_id {
+            updatedAt
+            logisticsFee
+            expressId
+            createdAt
+
+            consigneeTel
+            id
+            consignAddress
+            LogisticsStatus
+
+            consigneeName
+        }
+        payTime
+        orderTotalPay
+        createdAt
+        orderStatus
+        userAddress_id {
+            address
+            updatedAt
+            telephone
+            default
+            city
+            username
+            postcode
+            createdAt
+            deletedAt
+            id
+
+            area
+            province
+        }
+        id
+        orderShipFee
+        count
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        productTotalPay
+        orderPay_id {
+            id
+
+
+            totalPay
+            transactionId
+            payTime
+        }
+    }
+}
+
+mutation createorderLogistics($updatedAt: String, $logisticsFee: Float, $expressId: String, $createdAt: String, $order_id: ID, $consigneeTel: String, $id: ID!, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String) {
+    createorderLogistics: create_orderLogistics(updatedAt: $updatedAt logisticsFee: $logisticsFee expressId: $expressId createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel id: $id consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName) {
+        updatedAt
+        logisticsFee
+        expressId
+        createdAt
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        consigneeTel
+        id
+        consignAddress
+        LogisticsStatus
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        consigneeName
+    }
+}
+
+mutation updateorderLogistics($updatedAt: String, $logisticsFee: Float, $expressId: String, $createdAt: String, $order_id: ID, $consigneeTel: String, $id: ID, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String) {
+    updateorderLogistics: update_orderLogistics(updatedAt: $updatedAt logisticsFee: $logisticsFee expressId: $expressId createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel id: $id consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName) {
+        updatedAt
+        logisticsFee
+        expressId
+        createdAt
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        consigneeTel
+        id
+        consignAddress
+        LogisticsStatus
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        consigneeName
+    }
+}
+
+mutation createorderProduct($remark: String, $updatedAt: String, $productColor: String, $unit: String, $product_id: ID, $productSize: String, $orderPay: Float, $createdAt: String, $productImg: String, $productName: String, $order_id: ID, $productPrice: Float, $id: ID!, $count: Int, $productPay: Float, $user_id: ID, $orderPay_id: ID) {
+    createorderProduct: create_orderProduct(remark: $remark updatedAt: $updatedAt productColor: $productColor unit: $unit product_id: $product_id productSize: $productSize orderPay: $orderPay createdAt: $createdAt productImg: $productImg productName: $productName order_id: $order_id productPrice: $productPrice id: $id count: $count productPay: $productPay user_id: $user_id orderPay_id: $orderPay_id) {
+        remark
+        updatedAt
+        productColor
+        unit
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        productSize
+        orderPay
+        createdAt
+        productImg
+        productName
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        productPrice
+        id
+        count
+        productPay
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        orderPay_id {
+            id
+
+
+            totalPay
+            transactionId
+            payTime
+        }
+    }
+}
+
+mutation deleteproduct($category: String, $updatedAt: String, $unit: String, $name: String, $createdAt: String, $status: String, $id: ID, $intro: String, $price: Float, $img: String, $stock: Int) {
+    deleteproduct: delete_product(category: $category updatedAt: $updatedAt unit: $unit name: $name createdAt: $createdAt status: $status id: $id intro: $intro price: $price img: $img stock: $stock)
+}
+
+mutation updateorderProduct($remark: String, $updatedAt: String, $productColor: String, $unit: String, $product_id: ID, $productSize: String, $orderPay: Float, $createdAt: String, $productImg: String, $productName: String, $order_id: ID, $productPrice: Float, $id: ID, $count: Int, $productPay: Float, $user_id: ID, $orderPay_id: ID) {
+    updateorderProduct: update_orderProduct(remark: $remark updatedAt: $updatedAt productColor: $productColor unit: $unit product_id: $product_id productSize: $productSize orderPay: $orderPay createdAt: $createdAt productImg: $productImg productName: $productName order_id: $order_id productPrice: $productPrice id: $id count: $count productPay: $productPay user_id: $user_id orderPay_id: $orderPay_id) {
+        remark
+        updatedAt
+        productColor
+        unit
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        productSize
+        orderPay
+        createdAt
+        productImg
+        productName
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        productPrice
+        id
+        count
+        productPay
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        orderPay_id {
+            id
+
+
+            totalPay
+            transactionId
+            payTime
+        }
+    }
+}
+
+mutation createadmin($id: ID!, $openid: String, $username: String, $password: String, $telephone: String, $email: String, $createdAt: String, $updatedAt: String) {
+    createadmin: create_admin(id: $id openid: $openid username: $username password: $password telephone: $telephone email: $email createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        openid
+        username
+        password
+        telephone
+        email
+        createdAt
+        updatedAt
+    }
+}

+ 20 - 11
src/pages/cart/all/detail/index.js

@@ -1,6 +1,6 @@
-import React, { Component } from 'react'
+import React, {Component} from 'react'
 import {withRouter} from 'react-router-dom'
-import { Checkbox, WhiteSpace  } from 'antd-mobile' 
+import {Checkbox, WhiteSpace} from 'antd-mobile'
 import classNames from 'classnames' 
 
 import '../index.css'
@@ -11,17 +11,24 @@ class CartDetail extends Component {
         this.state={
             cartList:[],
             totalPrice:0,
-            isSelectAll:true,
+            isSelectAll:false,
             selectedCount:0
         } 
     }
 
     //获取数据
     componentWillMount(){
+        let cartList =  JSON.parse(sessionStorage.getItem("cartList"))
+        let cartListLength = cartList ? cartList.length : 0
+
         this.setState({
-            cartList:this.props.cartList
+            cartList: cartList || this.props.cartList
         },()=>{
-            this.checkedAll('',true) 
+            if(cartListLength){
+                this.sumPrice()
+            }else {
+                this.checkedAll('',true)
+            }
         }) 
 
     }
@@ -161,11 +168,13 @@ class CartDetail extends Component {
                 shopping.push(item)
             }
         }) 
-        console.log('shopping',shopping) 
-        window.localStorage.setItem("shopping",JSON.stringify(shopping)) 
-        window.localStorage.setItem("totalPrice",JSON.stringify(this.state.totalPrice))
+        // console.log('cartList',this.state.cartList)
+        console.log('shopping',shopping)
+        sessionStorage.setItem("cartList",JSON.stringify(this.state.cartList))
+        sessionStorage.setItem("shopping",JSON.stringify(shopping))
+        sessionStorage.setItem("totalPrice",JSON.stringify(this.state.totalPrice))
         this.props.history.push({
-            pathname: '/cart/order',
+            pathname: '/cart/orders',
             state:{}
         })
     } 
@@ -188,11 +197,11 @@ class CartDetail extends Component {
                                             />
                                         </div>
                                         <div className="cart-list-image">
-                                            <img src={item.product_id.img || "https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png"} alt=""/>
+                                            <img src={item.product_id.img || "https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png"} alt="商品图片"/>
                                         </div>
                                         <div className="cart-list-intro">
                                             <div>{item.product_id.name}</div>
-                                            <div>颜色尺码等</div>
+                                            <div>{item.specificationStock_id.color}  {item.specificationStock_id.size}</div>
                                             <div>¥ {item.product_id.price}</div>
                                         </div>
                                         <div className="cart-list-count">

+ 3 - 3
src/pages/cart/all/edit/index.js

@@ -98,9 +98,9 @@ class CartEdit extends Component {
                                 selectedCount:0
                             })
                         }
-                    });
+                    })
                 }
-            },
+            }
         ])
     }
 
@@ -213,7 +213,7 @@ class CartEdit extends Component {
                                                 </div>
                                                 <div className="cart-list-intro">
                                                     <div>{item.product_id.name}</div>
-                                                    <div>颜色尺码等</div>
+                                                    <div>{item.specificationStock_id.color}  {item.specificationStock_id.size}</div>
                                                     <div>¥ {item.product_id.price}</div>
                                                 </div>
                                                 <div className="cart-list-count">

+ 1 - 0
src/pages/cart/all/index.css

@@ -45,6 +45,7 @@
 
 .cart-list {
     width: 100%;
+    line-height: 22px;
     background-color: #fff;
     padding: 10px 0;
     display: flex;

+ 1 - 1
src/pages/cart/all/index.js

@@ -69,7 +69,7 @@ class All extends Component {
                             return (
                                 <div className="loading-center">
                                     <ActivityIndicator size="large"/>
-                                    <span>正在加载...</span>
+                                    <span>加载...</span>
                                 </div>
                             )
                         }

+ 1 - 1
src/pages/cart/index.js

@@ -11,7 +11,7 @@ const Cart = () => (
         <Switch>
             <Route exact path="/cart" component={All}/>
             <Route exact path="/cart/all" component={All}/>
-            <Route path="/cart/order" component={CartOrders}/>
+            <Route path="/cart/orders" component={CartOrders}/>
             <Route path="/cart/pay" component={Pay}/>
         </Switch>
     </div>

+ 52 - 31
src/pages/cart/orders/index.js

@@ -2,6 +2,10 @@ import React, {Component} from 'react'
 import {withRouter} from 'react-router-dom'
 import {NavBar, Icon, List, Picker} from 'antd-mobile'
 import classNames from 'classnames'
+import {Mutation} from "react-apollo"
+import gql from "graphql-tag"
+
+import {create_order} from "../../../utils/gql"
 
 import './index.css'
 
@@ -22,11 +26,10 @@ const delivery = [
 class CartOrders extends Component {
     constructor(props) {
         super(props)
-        // console.log('shopping',JSON.parse(window.localStorage.getItem("shopping")))
         this.state = {
             cartList: [],
             unfoldList: [],
-            totalPrice: JSON.parse(window.localStorage.getItem('totalPrice')),
+            totalPrice: JSON.parse(sessionStorage.getItem('totalPrice')),
             delivery: ["快递配送"],
             height: '100%',
             unfoldStatus: true,
@@ -35,7 +38,7 @@ class CartOrders extends Component {
     }
 
     componentWillMount() {
-        let cartList = JSON.parse(window.localStorage.getItem("shopping"))
+        let cartList = JSON.parse(sessionStorage.getItem("shopping"))
         if (cartList.length > 3) {
             let cartList1 = cartList.slice(0, 3)
             let unfoldList = cartList.slice(3)
@@ -64,6 +67,21 @@ class CartOrders extends Component {
         })
     }
 
+    onSubmitOrder = (create_order) => {
+        const orderContent = {
+
+        }
+
+        create_order({variables:orderContent}).then((data)=>{
+            // console.log('delete data',data)
+
+            this.props.history.push({
+                pathname:'/cart/pay',
+                state:{}
+            })
+        })
+    }
+
     render() {
         let {cartList, unfoldList, height, unfoldStatus, foldStatus, totalPrice} = this.state
 
@@ -101,22 +119,22 @@ class CartOrders extends Component {
                     <div className='orders-detail'>
                         <div className='cart-content'>
                             {
-                                cartList.map((ele, index) => {
+                                cartList.map((item, index) => {
                                     return (
                                         <div key={index}>
                                             <div className="cart-list">
                                                 <div className="cart-list-image">
                                                     <img
-                                                        src={ele.product_id.img || "https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png"}
+                                                        src={item.product_id.img || "https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png"}
                                                         alt=""/>
                                                 </div>
                                                 <div className="cart-orders-intro">
-                                                    <div>{ele.product_id.name}</div>
-                                                    <div>颜色尺码等</div>
-                                                    <div>¥ {ele.product_id.price}</div>
+                                                    <div>{item.product_id.name}</div>
+                                                    <div>{item.specificationStock_id.color}  {item.specificationStock_id.size}</div>
+                                                    <div>¥ {item.product_id.price}</div>
                                                 </div>
                                                 <div className="cart-orders-count">
-                                                    x {ele.count}
+                                                    x {item.count}
                                                 </div>
                                             </div>
                                         </div>
@@ -141,20 +159,20 @@ class CartOrders extends Component {
                                             this.onChangeHeight('100%', true, false)
                                         }}>
                                             {
-                                                unfoldList.map((ele, index) => {
+                                                unfoldList.map((item, index) => {
                                                     return (
                                                         <div key={index}>
                                                             <div className="cart-list">
                                                                 <div className="cart-list-image">
-                                                                    <img src={ele.product_id.img} alt=""/>
+                                                                    <img src={item.product_id.img} alt=""/>
                                                                 </div>
                                                                 <div className="cart-orders-intro">
-                                                                    <div>{ele.product_id.name}</div>
-                                                                    <div>颜色尺码等</div>
-                                                                    <div>¥ {ele.product_id.price}</div>
+                                                                    <div>{item.product_id.name}</div>
+                                                                    <div>{item.specificationStock_id.color}  {item.specificationStock_id.size}</div>
+                                                                    <div>¥ {item.product_id.price}</div>
                                                                 </div>
                                                                 <div className="cart-orders-count">
-                                                                    x {ele.count}
+                                                                    x {item.count}
                                                                 </div>
                                                             </div>
                                                         </div>
@@ -198,23 +216,26 @@ class CartOrders extends Component {
                         </div>
                     </div>
                 </div>
-                <div className="orders-footer">
-                    <div className="jiesuan">
-                        <div className='jiesuan-total'>
-                            <span>合计:</span>
-                            <span className="jiesuan-total_price">¥ {totalPrice}</span>
+                <Mutation mutation={gql(create_order)}
+                          onError={error=>console.log('create_order error',error)}
+                >
+                    {(create_order,{ loading, error }) => (
+                        <div className="orders-footer">
+                            <div className="jiesuan">
+                                <div className='jiesuan-total'>
+                                    <span>合计:</span>
+                                    <span className="jiesuan-total_price">¥ {totalPrice}</span>
+                                </div>
+                                <button className="jiesuan-button"
+                                        onClick={()=>{
+                                            this.onSubmitOrder(create_order)
+                                        }}>
+                                    <span>提交订单</span>
+                                </button>
+                            </div>
                         </div>
-                        <button className="jiesuan-button"
-                                onClick={()=>{
-                                    this.props.history.push({
-                                        pathname:'/cart/pay',
-                                        state:{}
-                                      })
-                                }}>
-                            <span>提交订单</span>
-                        </button>
-                    </div>
-                </div>
+                    )}
+                </Mutation>
             </div>
         )
     }

+ 1 - 1
src/pages/cart/pay/index.js

@@ -10,7 +10,7 @@ class Pay extends Component {
         super(props)
         this.state = {
             checked:true,
-            totalPrice:JSON.parse(localStorage.getItem('totalPrice')),
+            totalPrice:JSON.parse(sessionStorage.getItem('totalPrice')),
         }
     }
 

+ 57 - 4
src/utils/gql.js

@@ -42,7 +42,6 @@ const cart_by_userid = `
             id
             product_id{
                 category
-                createdAt
                 img
                 intro
                 name
@@ -50,7 +49,12 @@ const cart_by_userid = `
                 status
                 stock
                 unit
-                updatedAt
+            }
+            specificationStock_id{
+                color
+                size
+                stock
+                status
             }
         }
     }
@@ -118,7 +122,7 @@ const orderbyprops = `
                 address
                 updatedAt
                 telephone
-            default
+                default
                 city
                 username
                 postcode
@@ -194,6 +198,54 @@ const orderProduct_by_props = `
     }
 `
 
+const create_order = `
+    mutation createorder($deliveryTime: String, $updatedAt: String, $orderLogistics_id: ID, $payTime: String, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $id: ID!, $orderShipFee: Float, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
+        createorder: create_order(deliveryTime: $deliveryTime updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id payTime: $payTime orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id id: $id orderShipFee: $orderShipFee count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
+            deliveryTime
+            updatedAt
+            orderLogistics_id {
+                updatedAt
+                logisticsFee
+                expressId
+                createdAt
+                consigneeTel
+                id
+                consignAddress
+                LogisticsStatus    
+                consigneeName
+            }
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+            userAddress_id {
+                address
+                updatedAt
+                telephone
+                default
+                city
+                username
+                postcode
+                createdAt
+                deletedAt
+                id    
+                area
+                province
+            }
+            id
+            orderShipFee
+            count
+            productTotalPay
+            orderPay_id {
+                id        
+                totalPay
+                transactionId
+                payTime
+            }
+        }
+    }
+`
+
 
 export {
     productbyprops,
@@ -202,5 +254,6 @@ export {
     delete_userCart_by_id,
     userAddressbyprops,
     orderbyprops,
-    orderProduct_by_props
+    orderProduct_by_props,
+    create_order
 }