Browse Source

小程序:商品详情接口对接

panyong 2 years ago
parent
commit
2e062cca64

+ 17 - 0
htmldev/wxMini/pages/businessDetail/api/index.js

@@ -0,0 +1,17 @@
+const { request } = require('../../../api/request')
+
+/**
+ * 收藏/取消收藏店铺
+ * @param shopId 店铺ID
+ * @param type 类型 1收藏2取消收藏
+ * @returns {Promise<*>}
+ */
+export const postShopCollect = (shopId, type) => request({
+  url: '/api/user/caigou/shop/collect',
+  method: 'POST',
+  data: {
+    shop_id: shopId,
+    type: type
+  },
+  showLoading: true
+})

+ 1 - 0
htmldev/wxMini/pages/businessDetail/businessDetail.wxml

@@ -17,6 +17,7 @@
     </block>
   </swiper>
 </view>
+  <!--TODO 收藏-->
 <view class="business-name">
   <text
     wx:for="{{objShopDetail.user_name}}"

+ 2 - 2
htmldev/wxMini/pages/collection/collection.js

@@ -6,11 +6,11 @@ Page({
   data: {
     nav: [
       {
-        name: '预售',
+        name: '商品',
         value: '1'
       },
       {
-        name: '现货',
+        name: '供应商',
         value: '2'
       }
     ],

+ 1 - 1
htmldev/wxMini/pages/mine/mine.wxml

@@ -77,7 +77,7 @@
       data-page="collection"
       bind:tap="jump">
       <image class="label" src="../../image/mine/star.png"></image>
-      <text class="value">农户收藏</text>
+      <text class="value">收藏</text>
     </view>
     <!-- todo -->
     <view