|
|
@@ -141,7 +141,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { productList, getFamilyMembers, addFamilyMember, getPublicConfig } from '../../utils/api.js'
|
|
|
+import { getFamilyMembers, addFamilyMember, getProductsByDomain } from '../../utils/api.js'
|
|
|
import config from '@/config.js'
|
|
|
|
|
|
export default {
|
|
|
@@ -461,18 +461,8 @@ export default {
|
|
|
loadRecommendProducts: function() {
|
|
|
var self = this
|
|
|
self.loadingProducts = true
|
|
|
- // 先从配置读取类目ID,再加载该类目下的商品
|
|
|
- getPublicConfig('report_upload_category_id').then(function(configRes) {
|
|
|
- var params = { size: 4 }
|
|
|
- var categoryId = configRes && configRes.data
|
|
|
- if (categoryId) {
|
|
|
- params.categoryId = parseInt(categoryId)
|
|
|
- } else {
|
|
|
- params.domain = 'body'
|
|
|
- params.productType = 'assessment'
|
|
|
- }
|
|
|
- return productList(params)
|
|
|
- }).then(function(res) {
|
|
|
+ // 直接按身体维度加载推荐商品(商城已有的 domain 筛选器)
|
|
|
+ getProductsByDomain('body', 1, 4).then(function(res) {
|
|
|
if (res && res.data && res.data.records) {
|
|
|
self.recommendedProducts = res.data.records
|
|
|
} else {
|