kulley 6 tahun lalu
induk
melakukan
5636d3ddc7
4 mengubah file dengan 1634 tambahan dan 3 penghapusan
  1. 1475 0
      graphql-all
  2. 24 0
      src/pages/home/index.css
  3. 114 3
      src/pages/home/index.js
  4. 21 0
      src/utils/gql.js

+ 1475 - 0
graphql-all

@@ -0,0 +1,1475 @@
+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 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
+        }
+        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, $keyword: Int, $createdAt: String, $updatedAt: String) {
+    userSearchbyprops: userSearch_by_props(user_id: $user_id keyword: $keyword createdAt: $createdAt updatedAt: $updatedAt) {
+        id
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+        keyword
+        createdAt
+        updatedAt
+    }
+}
+
+query userCollectbyprops($user_id: ID, $product_id: ID, $createdAt: String, $updatedAt: String) {
+    userCollectbyprops: userCollect_by_props(user_id: $user_id product_id: $product_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, $name: String, $createdAt: String, $status: String, $intro: String, $price: Float, $img: String, $stock: Int) {
+    productbyprops: product_by_props(category: $category updatedAt: $updatedAt 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 orderProductbyid($id: ID) {
+    orderProductbyid: orderProduct_by_id(id: $id) {
+        remark
+        updatedAt
+        unit
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        orderPay
+        createdAt
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        id
+        count
+        productPay
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+    }
+}
+
+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
+        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, $product_id: ID, $orderPay: Float, $createdAt: String, $order_id: ID, $count: Int, $productPay: Float, $user_id: ID) {
+    orderProductbyprops: orderProduct_by_props(remark: $remark updatedAt: $updatedAt product_id: $product_id orderPay: $orderPay createdAt: $createdAt order_id: $order_id count: $count productPay: $productPay user_id: $user_id) {
+        remark
+        updatedAt
+        unit
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        orderPay
+        createdAt
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        id
+        count
+        productPay
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+    }
+}
+
+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, $count: Int, $createdAt: String, $updatedAt: String) {
+    userCartbyprops: userCart_by_props(user_id: $user_id product_id: $product_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
+        }
+        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: Int, $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!, $user_id: ID, $product_id: ID, $createdAt: String, $updatedAt: String) {
+    createuserCollect: create_userCollect(id: $id user_id: $user_id product_id: $product_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, $count: Int, $createdAt: String, $updatedAt: String) {
+    deleteuserCart: delete_userCart(id: $id user_id: $user_id product_id: $product_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 createuserSearch($id: ID!, $user_id: ID, $keyword: Int, $createdAt: String, $updatedAt: String) {
+    createuserSearch: create_userSearch(id: $id user_id: $user_id keyword: $keyword 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: Int, $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 deleteorderProduct($remark: String, $updatedAt: String, $product_id: ID, $orderPay: Float, $createdAt: String, $order_id: ID, $id: ID, $count: Int, $productPay: Float, $user_id: ID) {
+    deleteorderProduct: delete_orderProduct(remark: $remark updatedAt: $updatedAt product_id: $product_id orderPay: $orderPay createdAt: $createdAt order_id: $order_id id: $id count: $count productPay: $productPay user_id: $user_id)
+}
+
+mutation deleteuserCollect($id: ID, $user_id: ID, $product_id: ID, $createdAt: String, $updatedAt: String) {
+    deleteuserCollect: delete_userCollect(id: $id user_id: $user_id product_id: $product_id createdAt: $createdAt updatedAt: $updatedAt)
+}
+
+mutation updateuserCollect($id: ID, $user_id: ID, $product_id: ID, $createdAt: String, $updatedAt: String) {
+    updateuserCollect: update_userCollect(id: $id user_id: $user_id product_id: $product_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 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, $count: Int, $createdAt: String, $updatedAt: String) {
+    updateuserCart: update_userCart(id: $id user_id: $user_id product_id: $product_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
+        }
+        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, $count: Int, $createdAt: String, $updatedAt: String) {
+    createuserCart: create_userCart(id: $id user_id: $user_id product_id: $product_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
+        }
+        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, $keyword: Int, $createdAt: String, $updatedAt: String) {
+    deleteuserSearch: delete_userSearch(id: $id user_id: $user_id keyword: $keyword 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, $user_id: ID, $keyword: Int, $createdAt: String, $updatedAt: String) {
+    updateuserSearch: update_userSearch(id: $id user_id: $user_id keyword: $keyword 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, $unit: Int, $product_id: ID, $orderPay: Float, $createdAt: String, $order_id: ID, $id: ID!, $count: Int, $productPay: Float, $user_id: ID) {
+    createorderProduct: create_orderProduct(remark: $remark updatedAt: $updatedAt unit: $unit product_id: $product_id orderPay: $orderPay createdAt: $createdAt order_id: $order_id id: $id count: $count productPay: $productPay user_id: $user_id) {
+        remark
+        updatedAt
+        unit
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        orderPay
+        createdAt
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        id
+        count
+        productPay
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+    }
+}
+
+mutation deleteproduct($category: String, $updatedAt: String, $name: String, $createdAt: String, $status: String, $id: ID, $intro: String, $price: Float, $img: String, $stock: Int) {
+    deleteproduct: delete_product(category: $category updatedAt: $updatedAt name: $name createdAt: $createdAt status: $status id: $id intro: $intro price: $price img: $img stock: $stock)
+}
+
+mutation updateorderProduct($remark: String, $updatedAt: String, $unit: Int, $product_id: ID, $orderPay: Float, $createdAt: String, $order_id: ID, $id: ID, $count: Int, $productPay: Float, $user_id: ID) {
+    updateorderProduct: update_orderProduct(remark: $remark updatedAt: $updatedAt unit: $unit product_id: $product_id orderPay: $orderPay createdAt: $createdAt order_id: $order_id id: $id count: $count productPay: $productPay user_id: $user_id) {
+        remark
+        updatedAt
+        unit
+        product_id {
+            category
+            updatedAt
+            unit
+            name
+            createdAt
+            status
+            id
+            intro
+            price
+            img
+            stock
+        }
+        orderPay
+        createdAt
+        order_id {
+            deliveryTime
+            updatedAt
+
+            payTime
+            orderTotalPay
+            createdAt
+            orderStatus
+
+            id
+            orderShipFee
+            count
+
+            productTotalPay
+        }
+        id
+        count
+        productPay
+        user_id {
+            email
+            updatedAt
+            password
+            telephone
+            username
+            createdAt
+            openid
+            id
+        }
+    }
+}
+
+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
+    }
+}

+ 24 - 0
src/pages/home/index.css

@@ -0,0 +1,24 @@
+.guess-wrap {
+    background-color: white;
+    min-height: 100px;
+}
+
+.guess-title {
+    display: block;
+    color: #397f44;
+    font-size: 16px;
+    margin: 0 auto;
+    padding: 20px 0;
+    width: 120px;
+    text-align: center;
+}
+
+.guess-item {
+
+}
+
+.guess-item-img {
+    background-size: cover;
+    width: 150px;
+    height: 160px;
+}

+ 114 - 3
src/pages/home/index.js

@@ -1,17 +1,128 @@
 import React, {Component} from 'react'
+import {Grid, Carousel, WhiteSpace, ActivityIndicator, Flex} from 'antd-mobile'
+import './index.css'
+import {Query} from "react-apollo";
+import gql from "graphql-tag";
+import {productbyprops} from "../../utils/gql"
+
 class Home extends Component {
     constructor(props) {
         super(props)
         this.state = {
-
+            data: ['AiyWuByWklrrUDlFignR', 'TekJlZRVCjLFexlOCuWn', 'IJOtIlfsYdTyaDTRVrLI'],
         }
     }
 
     render() {
+        const data = [
+            {
+                icon: 'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png',
+                text: '基础护理'
+            },
+            {
+                icon: 'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png',
+                text: '面膜'
+            },
+            {
+                icon: 'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png',
+                text: '洁面'
+            },
+            {
+                icon: 'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png',
+                text: '防晒'
+            },
+            {
+                icon: 'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png',
+                text: '面部保湿'
+            },
+            {
+                icon: 'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png',
+                text: '彩妆'
+            },
+            {
+                icon: 'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png',
+                text: '指甲油'
+            },
+            {
+                icon: 'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png',
+                text: '更多'
+            }
+        ]
+
         return (
-            <div>Home</div>
+            <div>
+                <Carousel
+                    autoplay={true}
+                    infinite
+                >
+                    {this.state.data.map(val => (
+                        <a
+                            key={val}
+                            href="http://www.alipay.com"
+                            style={{ display: 'inline-block', width: '100%', height: 'auto', maxHeight: '200px', overflow: 'hidden' }}
+                        >
+                            <img
+                                src={`https://zos.alipayobjects.com/rmsportal/${val}.png`}
+                                alt=""
+                                style={{ width: '100%', verticalAlign: 'top' }}
+                            />
+                        </a>
+                    ))}
+                </Carousel>
+                <Grid data={data} activeStyle={false} hasLine={false} isCarousel={true}/>
+                <WhiteSpace/>
+                <Query query={gql(productbyprops)} variables={{}}>
+                    {
+                        ({loading, error, data}) => {
+                            if (loading) {
+                                return (
+                                    <div className="tab-center">
+                                        <ActivityIndicator text="Loading..." size="large"/>z
+                                    </div>
+                                )
+                            }
+                            if (error) {
+                                return 'error!';
+                            }
+                            return (
+                                <Like data={data.productbyprops}/>
+                            )
+                        }
+                    }
+                </Query>
+            </div>
         )
     }
 }
 
-export default Home
+export default Home
+
+class Like extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+
+        }
+    }
+
+    render() {
+        let {data} = this.props;
+        console.log(data)
+        return (
+            <div className='guess-wrap'>
+                <div className='guess-title'>- 猜你喜欢 -</div>
+                <Flex wrap="wrap">
+                {
+                    data.map(data=>{
+                        return (
+                            <Flex.Item key={data.id}>
+                                <div className='guess-item-img' style={{backgroundImage: "url('"+ data.img + "')"}}/>
+                            </Flex.Item>
+                        )
+                    })
+                }
+                </Flex>
+            </div>
+        )
+    }
+}

+ 21 - 0
src/utils/gql.js

@@ -0,0 +1,21 @@
+const productbyprops =
+    `query productbyprops($category: String, $updatedAt: String, $name: String, $createdAt: String, $status: String, $intro: String, $price: Float, $img: String, $stock: Int) {
+        productbyprops: product_by_props(category: $category updatedAt: $updatedAt 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
+        }
+    }
+`
+
+export {
+    productbyprops
+}