Browse Source

店铺管理

kulley 6 năm trước cách đây
mục cha
commit
8b5c87da3f
6 tập tin đã thay đổi với 381 bổ sung1479 xóa
  1. 0 1475
      graphql-all
  2. 1 0
      package.json
  3. 2 1
      src/configs/url.js
  4. 4 0
      src/pages/my/manage/shop/index.css
  5. 307 2
      src/pages/my/manage/shop/index.js
  6. 67 1
      src/utils/gql.js

+ 0 - 1475
graphql-all

@@ -1,1475 +0,0 @@
-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
-    }
-}

+ 1 - 0
package.json

@@ -8,6 +8,7 @@
     "antd": "^3.13.5",
     "antd-mobile": "^2.2.9",
     "apollo-boost": "^0.1.28",
+    "axios": "^0.18.0",
     "babel-core": "7.0.0-bridge.0",
     "babel-eslint": "9.0.0",
     "babel-jest": "23.6.0",

+ 2 - 1
src/configs/url.js

@@ -1,5 +1,6 @@
 // const graphqlFC = 'https://ec.ioobot.cn/graphql';            // old schema fc mongodb
 // const graphqlFC = 'http://ecenhance.ioobot.cn/graphql';      // new schema fc mongodb
 const graphqlFC = 'http://ecommerce.ioobot.cn/graphql';      // new schema server mongodb
+const storeFile = 'http://deploy.ioobot.cn/api/store-file';
 
-export {graphqlFC}
+export {graphqlFC, storeFile}

+ 4 - 0
src/pages/my/manage/shop/index.css

@@ -0,0 +1,4 @@
+.my-list-subtitle {
+    margin-left: 9px;
+    padding-top: 6px;
+}

+ 307 - 2
src/pages/my/manage/shop/index.js

@@ -2,16 +2,140 @@ import React, {Component} from 'react'
 import './index.css'
 import {NavBar, Icon} from 'antd-mobile'
 import {withRouter} from 'react-router-dom'
+import {ActivityIndicator, List, ImagePicker, InputItem, Button} from 'antd-mobile';
+import axios from 'axios'
+import {Query, Mutation} from "react-apollo";
+import gql from "graphql-tag";
+import {shop_by_props, create_shop, update_shop} from "../../../../utils/gql"
+import {storeFile} from "../../../../configs/url"
+
+const Item = List.Item;
 
 class Shop extends Component {
     constructor(props) {
         super(props)
-        this.state = {}
+        this.state = {
+
+        }
+    }
+
+    render() {
+        return (
+            <Query query={gql(shop_by_props)} variables={{limit: 1}}>
+                {
+                    ({loading, error, data}) => {
+                        if (loading) {
+                            return (
+                                <div className="loading">
+                                    <div className="align">
+                                        <ActivityIndicator text="Loading..." size="large"/>
+                                    </div>
+                                </div>
+                            );
+                        }
+
+                        if (error) {
+                            return 'error!';
+                        }
+
+                        let shop, newShop;
+                        let shopLength = data.shopbyprops.length;
+                        if (shopLength === 0) {
+                            // console.log('尚未个性化 shop');
+                            shop = {};
+                            newShop = true;
+                        } else if (shopLength === 1) {
+                            // console.log('存在 shop, update');
+                            shop = data.shopbyprops[0];
+                            newShop = false;
+                        } else {
+                            console.log('store 数据库出现错误');
+                        }
+
+                        let {name, description, address, intro, notice, slideshow, id} = shop;
+                        let shopID = newShop ? 'default' : id;
+                        return (
+                            <ShopRender
+                                name={name}
+                                description={description}
+                                address={address}
+                                intro={intro}
+                                slideshow={slideshow}
+                                notice={notice}
+                                newShop={newShop}
+                                shopID={shopID}
+                            />
+                        )
+                    }
+                }
+            </Query>
+        )
+    }
+}
+
+class ShopRender extends Component {
+    constructor(props) {
+        super(props)
+        this.state = {
+            files: [],
+            imgDatas: [],
+            name: props.name,
+            intro: props.intro,
+            description: props.description,
+            address: props.address,
+            notice: props.notice,
+            slideshow: props.slideshow
+        }
+    }
+
+    onChange = (files, operationType) => {
+        console.log("files", files, "operationType", operationType);
+
+        let imgDatas = [];
+        let {storeID} = this.state;
+
+        files.forEach((file, index) => {
+            let base64Cont = files[index].url.split(',')[1];
+            let imgType = files[index].file.type.split('/')[1];
+            let imgNewName = `slideshow_${index}_storeID_${storeID}.${imgType}`;
+
+            const imgData = {
+                'file-name': `appointment/images/${imgNewName}`,
+                'bucket': 'case',
+                'cont': base64Cont,
+                'public': true,
+                'format': 'base64'
+            };
+
+            imgDatas.push(imgData)
+        });
+
+        this.setState({
+            imgDatas,
+            files
+        });
+
+        console.log(imgDatas, 'imgDatas');
+    }
+
+    onReset = () => {
+        this.setState({
+            files: [],
+            imgDatas: [],
+            name: '',
+            intro: '',
+            description: '',
+            address: '',
+            notice: '',
+            slideshow: []
+        })
     }
 
     render() {
+        let {files, name, intro, description, address, notice, slideshow, imgDatas} = this.state;
+        let {newShop, shopID} = this.props
         return (
-            <div className='shop-navbar-wrap'>
+            <div className='shop-wrap'>
                 <NavBar
                     className='shop-navbar'
                     mode="light"
@@ -20,10 +144,191 @@ class Shop extends Component {
                         this.props.history.go(-2)
                     }}
                 >店铺管理</NavBar>
+                <div>
+                    <List renderHeader={() => '店铺个性化管理'} className="my-list">
+                        <InputItem onChange={(e) => {
+                            this.setState({name: e})
+                        }} value={name} placeholder="请输入店铺名称">名称</InputItem>
+                        <InputItem onChange={(e) => {
+                            this.setState({intro: e})
+                        }} value={intro} placeholder="请输入店铺名称简介">简介</InputItem>
+                        <InputItem onChange={(e) => {
+                            this.setState({description: e})
+                        }} value={description} placeholder="请输入店铺名称描述">描述</InputItem>
+                        <InputItem onChange={(e) => {
+                            this.setState({address: e})
+                        }} value={address} placeholder="请输入店铺名称地址">地址</InputItem>
+                        <InputItem onChange={(e) => {
+                            this.setState({notice: e})
+                        }} value={notice} placeholder="请输入店铺名称公告,不输入为不显示">通告</InputItem>
+                        <div className='my-list-subtitle'>首页轮播图</div>
+                        <ImagePicker
+                            files={files}
+                            onChange={this.onChange}
+                            onImageClick={(index, fs) => console.log(index, fs)}
+                            selectable={true}
+                            multiple={false}
+                        />
+                        <Item>
+                            {
+                                newShop ?
+                                    <CreateShopButton
+                                        shopID={shopID}
+                                        imgDatas={imgDatas}
+                                        name={name}
+                                        description={description}
+                                        address={address}
+                                        alert={alert}
+                                        slideshow={slideshow}
+                                    />
+                                    :
+                                    <UpdateShopButton
+                                        shopID={shopID}
+                                        imgDatas={imgDatas}
+                                        name={name}
+                                        description={description}
+                                        address={address}
+                                        alert={alert}
+                                        slideshow={slideshow}
+                                    />
+                            }
+                            <Button size="small" inline style={{marginLeft: '2.5px'}} onClick={this.onReset}>重置</Button>
+                        </Item>
+                    </List>
+                </div>
             </div>
 
         )
     }
 }
 
+class UpdateShopButton extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {}
+    }
+
+    uploadImg = () => {
+        let {imgDatas} = this.props;
+
+        return imgDatas.map((imgData) => (
+            axios({
+                url: storeFile,
+                method: 'post',
+                data: imgData
+            })
+        ));
+    };
+
+    render() {
+        let {name, description, address, intro, notice, imgDatas, shopID} = this.props;
+        return (
+            <Mutation
+                mutation={gql(update_shop)}
+                refetchQueries={[{query: gql(shop_by_props), variables: {}}]}
+            >
+                {(updatestore, {loading, error}) => {
+                    if (loading)
+                        return (
+                            <div className="loading">
+                                <div className="align">
+                                    <ActivityIndicator text="Loading..." size="large"/>
+                                </div>
+                            </div>
+                        );
+                    if (error)
+                        return 'error';
+                    let varObj = {
+                        id: shopID,
+                        name,
+                        description,
+                        address,
+                        intro,
+                        notice,
+                        updatedAt: new Date().getTime(),
+                    };
+                    return (
+                        <Button type="primary" size="small" inline onClick={() => {
+                            if (imgDatas.length !== 0) {
+                                Promise.all(this.uploadImg()).then(res => {
+                                    let prefix = 'https://case-1254337200.cos.ap-beijing.myqcloud.com/';
+                                    let slideshow = imgDatas.length === 1 ? prefix + imgDatas[0]['file-name'] : imgDatas.map((imgData, index) => (
+                                        prefix + imgDatas[index]['file-name']
+                                    ));
+                                    updatestore({variables: {...varObj, slideshow}})
+                                });
+                            } else {
+                                updatestore({variables: varObj})
+                            }
+                        }}>更新</Button>
+                    )
+                }}
+            </Mutation>
+        )
+    }
+}
+
+class CreateShopButton extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {}
+    }
+
+    uploadImg = () => {
+        let {imgDatas} = this.props;
+
+        return imgDatas.map((imgData) => (
+            axios({
+                url: storeFile,
+                method: 'post',
+                data: imgData
+            })
+        ));
+    };
+
+    render() {
+        let {name, description, address, intro, notice, imgDatas, shopID} = this.props;
+        return (
+            <Mutation
+                mutation={gql(create_shop)}
+                refetchQueries={[{query: gql(shop_by_props), variables: {}}]}
+            >
+                {(createstore, {loading, error}) => {
+                    if (loading)
+                        return (
+                            <div className="loading">
+                                <div className="align">
+                                    <ActivityIndicator text="Loading..." size="large"/>
+                                </div>
+                            </div>
+                        );
+                    if (error)
+                        return 'error';
+                    let varObj = {
+                        id: shopID,
+                        name: name ? name : '',
+                        description: description ? description : '',
+                        address: address ? address : '',
+                        intro: intro ? intro : '',
+                        notice: notice ? notice : '',
+                        createdAt: new Date().getTime(),
+                        updatedAt: ''
+                    };
+                    return (
+                        <Button type="primary" size="small" inline onClick={() => {
+                            Promise.all(this.uploadImg()).then(res => {
+                                let prefix = 'https://case-1254337200.cos.ap-beijing.myqcloud.com/';
+                                let slideshow = imgDatas.length === 1 ? prefix + imgDatas[0]['file-name'] : imgDatas.map((imgData, index) => (
+                                    prefix + imgDatas[index]['file-name']
+                                ));
+                                createstore({variables: {...varObj, slideshow}})
+                            });
+                        }}>创建</Button>
+                    )
+                }}
+            </Mutation>
+        )
+    }
+}
+
 export default withRouter(Shop)

+ 67 - 1
src/utils/gql.js

@@ -290,6 +290,69 @@ const create_order_product = `
     }
 `
 
+const shop_by_props = `
+    query shopbyprops($limit: Int) {
+        shopbyprops: shop_by_props(limit: $limit) {
+            description
+            address
+            updatedAt
+            telephone
+            name
+            createdAt
+            status
+            id
+            slideshow
+            notice
+            intro
+            img
+        }
+    }
+`
+
+const update_shop = `
+    mutation updateshop($description: String, $address: String, $updatedAt: String, $where: shop_filter, $telephone: String, $name: String, $createdAt: String, $status: String, $id: ID, $slideshow: String, $notice: String, $intro: String, $img: String) {
+        updateshop: update_shop(id: $id description: $description address: $address updatedAt: $updatedAt where: $where telephone: $telephone name: $name createdAt: $createdAt status: $status slideshow: $slideshow notice: $notice intro: $intro img: $img) {
+            result
+            shop {
+                description
+                address
+                updatedAt
+                telephone
+                name
+                createdAt
+                status
+                id
+                slideshow
+                notice
+                intro
+                img
+            }
+        }
+    }
+`
+
+const create_shop = `
+    mutation createshop($description: String, $address: String, $updatedAt: String, $telephone: String, $name: String, $createdAt: String, $status: String, $id: ID!, $slideshow: String, $notice: String, $intro: String, $img: String) {
+        createshop: create_shop(description: $description address: $address updatedAt: $updatedAt telephone: $telephone name: $name createdAt: $createdAt status: $status id: $id slideshow: $slideshow notice: $notice intro: $intro img: $img) {
+            result
+            shop {
+                description
+                address
+                updatedAt
+                telephone
+                name
+                createdAt
+                status
+                id
+                slideshow
+                notice
+                intro
+                img
+            }
+        }
+    }
+`
+
 export {
     category_by_props,
     productbyprops,
@@ -301,5 +364,8 @@ export {
     orderbyprops,
     orderProduct_by_props,
     create_order,
-    create_order_product
+    create_order_product,
+    shop_by_props,
+    create_shop,
+    update_shop
 }