litian
2024-04-10 0c8505fb7d8a3ba0a3ef6dbcf5a7aa8cdb36105d
assets/js/middleGround/api/store.js
@@ -1,6 +1,12 @@
import request from "../../../request/index";
import { tokenKey, goodsStore } from '../../config'
import { handleQueryResourceListData, handleDetailQueryRequestData } from '../tool'
import {
  tokenKey,
  goodsStore
} from '../../config'
import {
  handleQueryResourceListData,
  handleDetailQueryRequestData
} from '../tool'
const storeApi = {
  /*
    **获取商品列表**
@@ -42,16 +48,9 @@
        Start: paging.start || '0',
        Size: paging.size || '10'
      },
      SortQuery:
        sort?.length == 0
          ? []
          : sort
            ? [sort]
            : [
              {
      SortQuery: sort?.length == 0 ? [] : sort ? [sort] : [{
                LinkOrder: 'Desc'
              }
            ],
      }],
      CreateDate: [],
      Description: [],
      Name: [],
@@ -78,8 +77,7 @@
      query.AccessControl.MainProductId = mainProductId
    }
    if (handelEBooK) {
      query.ProductCmsQuery = [
        {
      query.ProductCmsQuery = [{
          QueryCms: {
            Path: '*',
            Type: '\\',
@@ -98,16 +96,13 @@
            },
            ProductLinkInfo: []
          }
        }
      ]
      }]
    }
    const body = {
      query: JSON.stringify({
        Query: [
          {
        Query: [{
            Q1: query
          }
        ]
        }]
      })
    }
    let token = wx.getStorageSync(tokenKey) ? wx.getStorageSync(tokenKey) : '';
@@ -189,13 +184,9 @@
          Start: 0,
          Size: 9999
        },
        SortQuery: cmsSort
          ? [cmsSort]
          : [
            {
        SortQuery: cmsSort ? [cmsSort] : [{
              ProductLinkOrder: 'Asc'
            }
          ],
        }],
        ProductLinkInfo: [],
        ...itemFields
      }
@@ -261,13 +252,9 @@
        Size: '1'
      },
      'Id=': [`${productId}`],
      SortQuery: sort
        ? [sort]
        : [
          {
      SortQuery: sort ? [sort] : [{
            LinkOrder: 'Desc'
          }
        ],
      }],
      CreateDate: [],
      Description: [],
      Name: [],
@@ -294,11 +281,9 @@
    const body = {
      query: JSON.stringify({
        Query: [
          {
        Query: [{
            Q1: query
          }
        ]
        }]
      })
    }
@@ -664,6 +649,14 @@
      method: 'post',
      data
    })
  },
  //根据销售方式查询商品信息
  getProductBySaleMethod(data) {
    return request({
      url: '/store/api/ApiGetProductBySaleMethod',
      method: 'post',
      data
    })
  }
}