Bladeren bron

修改显示问题

Csy817 6 jaren geleden
bovenliggende
commit
e1ea4d0938
2 gewijzigde bestanden met toevoegingen van 4 en 6 verwijderingen
  1. 1 1
      src/pages/home/all/index.js
  2. 3 5
      src/utils/gql.js

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

@@ -91,7 +91,7 @@ class All extends Component {
                 </Query>
                 <WhiteSpace/>
                 <div className='guess-wrap'>
-                    <Query query={gql(productbyprops)} variables={{status: '1'}}>
+                    <Query query={gql(productbyprops)} variables={{status: '1', recommend: 1}}>
                         {
                             ({loading, error, data}) => {
                                 if (loading) {

+ 3 - 5
src/utils/gql.js

@@ -9,11 +9,9 @@ const category_by_props = `
 `
 
 const productbyprops = `
-    query productbyprops($category_id: ID, $updatedAt: String, $name: String, $createdAt: String, $status: String, $intro: String, $price: Float, $img: String, $stock: Int) {
-        productbyprops: product_by_props(category_id: $category_id updatedAt: $updatedAt name: $name createdAt: $createdAt status: $status intro: $intro price: $price img: $img stock: $stock) {
-            category_id{
-                id
-            }
+    query productbyprops($recommend: Int, $where: product_filter, $sort_by: product_sort_by, $limit: Int, $unit: String, $order_by: OrderBy, $name: String, $filter: Filter, $status: String, $price: Float, $category_id: ID, $img: String, $stock: Int, $skip: Int) {
+        productbyprops: product_by_props(recommend: $recommend where: $where sort_by: $sort_by limit: $limit unit: $unit order_by: $order_by name: $name filter: $filter status: $status price: $price category_id: $category_id img: $img stock: $stock skip: $skip) {
+            recommend
             updatedAt
             unit
             name