소스 검색

Merge branch 'dev'

wenjie 1 개월 전
부모
커밋
56f2e7a6a5

+ 1 - 0
.cloudbase/container/debug.json

@@ -0,0 +1 @@
+{"containers":[],"config":{}}

+ 1 - 5
app.js

@@ -9,11 +9,7 @@ App({
     let custom = wx.getMenuButtonBoundingClientRect()
     this.globalData.statusBarHeight = windowInfo.statusBarHeight
     this.globalData.navBarHeight = custom.height + (custom.top - windowInfo.statusBarHeight) * 2
-
-    // 默认店铺
-    if(!wx.getStorageSync('shopInfo')){
-      wx.setStorageSync('shopInfo',{shopName:'瑞果商链-“星闪豹”',shopId:1})
-    }
+   
   },
   globalData: {
     // 定义全局请求队列

+ 2 - 1
app.json

@@ -150,6 +150,7 @@
     "navbar": "/components/topNavtar/topNavtar",
     "tabbar": "/components/tabbar/tabbar",
     "van-loading": "@vant/weapp/loading/index",
-    "van-action-sheet": "@vant/weapp/action-sheet/index"
+    "van-action-sheet": "@vant/weapp/action-sheet/index",
+    "van-overlay": "@vant/weapp/overlay/index"
   }
 }

+ 1 - 1
pages/applyRefund/applyRefund.wxml

@@ -13,7 +13,7 @@
           <radio class="radio" checked="{{applyType == 1}}" value="1" color="#006CE8" />
           <view class="info">
             <view class="title">我要退款</view>
-            <view class="desc">没收到货,已收到货与商家协商后无需退货只退款</view>
+            <view class="desc">没收到货,已收到货与商家协商后无需退货只退款</view>
           </view>
       </view>
       <view class="item">

+ 2 - 2
pages/basket/basket.js

@@ -76,7 +76,7 @@ Page({
     }
     //加载购物车
     var params = {
-      url: "/p/shopCart/info/1",
+      url: `/p/shopCart/info/${wx.getStorageSync('channelId')||3}`,
       method: "POST",
       data: reqData,
       dontTrunLogin: true,
@@ -324,7 +324,7 @@ Page({
     var ths = this;
     wx.showLoading();
     var params = {
-      url: "/p/shopCart/totalPay",
+      url: `/p/shopCart/totalPay?channelId=${wx.getStorageSync('channelId')||3}`,
       method: "POST",
       data: shopCartIds,
       callBack: function (res) {

+ 4 - 2
pages/category/category.js

@@ -609,7 +609,7 @@ Page({
   // 获取购物车数据
   getCarData() {
     var params = {
-      url: "/p/shopCart/info/1",
+      url: `/p/shopCart/info/${wx.getStorageSync('channelId')||3}`,
       method: "post",
       data: [{
         "basketId": 0,
@@ -654,7 +654,9 @@ Page({
        
     })
     var params = {
-      url: "/p/shopCart/totalPay?t="+new Date().getTime(),
+      // url: "/p/shopCart/totalPay?t="+new Date().getTime(),
+      url: `/p/shopCart/totalPay?channelId=${wx.getStorageSync('channelId')||3}&t=new Date().getTime()`,
+
       method: "post",
       data: basketIds,
       callBack: (res) => {

+ 3 - 2
pages/category1/category.js

@@ -609,7 +609,7 @@ Page({
   // 获取购物车数据
   getCarData() {
     var params = {
-      url: "/p/shopCart/info/1",
+      url: `/p/shopCart/info/${wx.getStorageSync('channelId')||3}`,
       method: "post",
       data: [{
         "basketId": 0,
@@ -654,7 +654,8 @@ Page({
        
     })
     var params = {
-      url: "/p/shopCart/totalPay?t="+new Date().getTime(),
+      // url: "/p/shopCart/totalPay?t="+new Date().getTime(),
+      url: `/p/shopCart/totalPay?channelId=${wx.getStorageSync('channelId')||3}&t=new Date().getTime()`,
       method: "post",
       data: basketIds,
       callBack: (res) => {

+ 110 - 169
pages/index/index.js

@@ -8,8 +8,12 @@ const updateManager = wx.getUpdateManager()
 import eventBus from '../../utils/eventBus';
 
 Page({
-  isHand:false,
   data: {
+    showPopup:false,
+    imageUrl:'',
+    isHand:false,
+    shopList:[],
+    showShopList:false,
     isScroll:false,
     active:1,
     imgUrl:'',
@@ -42,7 +46,6 @@ Page({
     hotList: [],
     recommendedList: [],
     totalNum: 1,
-    addCarshow: false,
     shopDetail: {},
     select_address: '',
     categoryList: [],
@@ -65,6 +68,7 @@ Page({
   },
 
   onLoad: function () {
+    console.log('load');
     // 实例化API核心类
     qqmapsdk = new QQMapWX({
       key: 'D3MBZ-LQK6U-IONVC-GJDPK-C43GF-UYFOC'
@@ -79,10 +83,7 @@ Page({
     this.setData({
       select_address: wx.getStorageSync('ADDRESS')
     })
-    // 默认店铺
-    if(!wx.getStorageSync('shopInfo')){
-      wx.setStorageSync('shopInfo',{shopName:'瑞果商链-“星闪豹”',shopId:1})
-    }
+
     if(wx.getStorageSync('loginResult').userId){
       this.getUserInfo().then(()=>{
         this.getAllData();
@@ -163,32 +164,32 @@ Page({
         wx.setStorageSync('LATITUDE', res.latitude)
         wx.setStorageSync('LONGITUDE', res.longitude)
         // 调用腾讯地图api获取当前位置
-        qqmapsdk.reverseGeocoder({
-          location: {
-            latitude: latitude,
-            longitude: longitude
-          },
-          success: function (res) {
-            console.log(res.result, '---address_success');
-            wx.setStorageSync('ADDRESS', res.result.address_component.street)
-            that.setData({
-              select_address: wx.getStorageSync('ADDRESS')
-            })
-          },
-          fail: function (res) {
-            console.log(res, '---address_err');
-            wx.showToast({
-              title: res + '地址信息获取失败',
-              icon: "none"
-            })
-            setTimeout(() => {
-              wx.hideToast();
-            }, 2000)
-          },
-          complete: function (res) {
-            // console.log(res, '---callback');
-          }
-        });
+        // qqmapsdk.reverseGeocoder({
+        //   location: {
+        //     latitude: latitude,
+        //     longitude: longitude
+        //   },
+        //   success: function (res) {
+        //     console.log(res.result, '---address_success');
+        //     wx.setStorageSync('ADDRESS', res.result.address_component.street)
+        //     that.setData({
+        //       select_address: wx.getStorageSync('ADDRESS')
+        //     })
+        //   },
+        //   fail: function (res) {
+        //     console.log(res, '---address_err');
+        //     wx.showToast({
+        //       title: res + '地址信息获取失败',
+        //       icon: "none"
+        //     })
+        //     setTimeout(() => {
+        //       wx.hideToast();
+        //     }, 2000)
+        //   },
+        //   complete: function (res) {
+        //     // console.log(res, '---callback');
+        //   }
+        // });
       },
       fail: function (err) {
         wx.removeStorageSync('ADDRESS')
@@ -279,6 +280,27 @@ Page({
       }
     });
   },
+  /**
+   * 弹窗公告
+   */
+  getDialog: function () {
+    var params = {
+      url: "/popup/config",
+      method: "GET",
+      data: {
+      },
+      callBack: (res) => {
+       this.setData({
+        showPopup:res.showPopup,
+        imageUrl:res.imageUrl
+       })
+      }
+    };
+    http.request(params);
+  },
+  onClickHide:function(){
+    this.setData({showPopup:false})
+  },
   /**
    * 广告位
    */
@@ -553,132 +575,54 @@ Page({
     })
   },
 
-  /**
-   * 秒杀
-   */
-  getSnapUpList: function () {
-    wx.showLoading()
-    var params = {
-      url: "/seckill/pageProd",
-      method: "GET",
-      data: {
-        size: 4,
-        lat: wx.getStorageSync('LATITUDE'),
-        lon: wx.getStorageSync('LONGITUDE'),
-        distance: wx.getStorageSync('DISTANCE') || 0
-      },
-      callBack: (res) => {
-        wx.hideLoading();
-        let result = res.records.filter(item => util.dateToTimestamp(item.endTime) > new Date().getTime()) //过滤掉秒杀时间已结束的商品
-        let img = ''
-        result.map(e => {
-          img = e.pic.split(',')
-          e.pic = img[0]
-        })
-        this.setData({
-          snapUpList: result
-        });
-        let closestItem = null;
-        let minTimeDiff = Infinity;
-        this.data.snapUpList.forEach((e) => {
-          const endTime = util.dateToTimestamp(e.endTime);
-          const now = new Date().getTime();
-          const timeDiff = endTime - now;
-          // 获取距离时间最近的秒杀时间
-          if (timeDiff < minTimeDiff && timeDiff > 0) {
-            minTimeDiff = timeDiff;
-            closestItem = e;
-          }
-        })
-        if (closestItem) {
-          const endTime = util.dateToTimestamp(closestItem.endTime);
-          const interval = setInterval(() => {
-            const now = new Date().getTime();
-            const timeDiff = endTime - now;
-            if (timeDiff <= 0) {
-              clearInterval(interval);
-              return;
-            }
-            const days = Math.floor(timeDiff / (1000 * 60 * 60 * 24));
-            const hours = Math.floor((timeDiff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
-            const minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
-            const seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);
-            this.setData({
-              days: days,
-              hours: hours,
-              minutes: minutes,
-              seconds: seconds
-            });
-          }, 1000);
-        }
-      }
-    };
-    http.request(params);
-  },
-  /**
-   * 新品推荐
-   */
-  getNewList: function () {
-    // var params = {
-    //   url: "/prod/lastedProdPage",
-    //   method: "GET",
-    //   data: {
-    //     current: 1,
-    //     size: 4,
-    //     lat: wx.getStorageSync('LATITUDE'),
-    //     lon: wx.getStorageSync('LONGITUDE'),
-    //     distance: wx.getStorageSync('DISTANCE') || 0,
-    //     shopId:this.data.shop_id
-    //   },
-    //   callBack: (res) => {
-    //     let img = ''
-    //     res.records.map(e => {
-    //       img = e.pic.split(',')
-    //       e.pic = img[0]
-    //     })
-    //     this.setData({
-    //       newList: res.records,
-    //     })
-    //   }
-    // };
-    // http.request(params);
-  },
+
+
   /**
    * 获取距离最近店铺id
    * @param {*} e 
    */
   get_neighborShop: function () {
-    var params = {
-      url: "/shop/neighborShop",
-      method: "GET",
-      data: {
-        lat: wx.getStorageSync('LATITUDE'),
-        lon: wx.getStorageSync('LONGITUDE'),
-        channelId:wx.getStorageSync('channelId')||3
-      },
-      callBack: (res) => {
-        if(typeof res == 'number'){
-          // this.getaddress_transports(res)
-          this.setData({
-            shop_id: res
-          })
-          setTimeout(() => {
-            this.getClassInfo(res);
-          }, 300)
-        }else{
-          wx.setStorageSync('shopInfo', res)
-          // this.getaddress_transports(res.shopId)
+    return new Promise((resolve,reject)=>{
+      var params = {
+        // url: "/shop/neighborShop",
+        url: "/shop/addrShop",
+        method: "GET",
+        data: {
+          lat: wx.getStorageSync('LATITUDE'),
+          lon: wx.getStorageSync('LONGITUDE'),
+          channelId:wx.getStorageSync('channelId')||3
+        },
+        callBack: (res) => {
           this.setData({
-            shop_id: res.shopId,
-            shopName:res.shopName
+            shopList:res
           })
-          setTimeout(() => {
-            this.getClassInfo(res.shopId);
-          }, 300)
+          if(res.every(i=>!i.hasProduct)){
+           return this.setData({
+              showShopList:true
+            })
+          }
+
+          for (let i = 0; i < res.length; i++) {
+            const item = res[i];
+            if(item.hasProduct){
+              console.log('==========================');
+              wx.setStorageSync('shopInfo', item)
+              // this.getaddress_transports(item.shopId)
+              this.setData({
+                shop_id: item.shopId,
+                shopName:item.shopName
+              })
+              this.getClassInfo(item.shopId);
+              resolve()
+              break; // 直接终止整个循环(输出1,2)
+
+            }
+          }
+
         }
-      }
-    };
-    http.request(params);
+      };
+      http.request(params);
+    })
   },
   /**
    * 获取最大配送范围
@@ -708,7 +652,7 @@ Page({
   },
   onClose: function () {
     this.setData({
-      addCarshow: false
+      showShopList: false
     })
   },
   /**
@@ -814,7 +758,7 @@ Page({
   },
 
   onShow: function () {
-    
+    this.getDialog()
     // this.get_test()
     this.setData({
       select_address: wx.getStorageSync('ADDRESS')
@@ -843,20 +787,16 @@ Page({
    * 选择定位后更新列表
    */
   go_update() {
-    // this.get_neighborShop()
     this.setData({
       current:1,
-      shop_id: wx.getStorageSync("shopInfo").shopId,
-      shopName:wx.getStorageSync("shopInfo").shopName
     })
-    
-    setTimeout(() => {
-      this.getNewList();
-      this.getSnapUpList();
+    this.get_neighborShop().then(res=>{
       this.getHotSalesProds()
-    }, 1000)
+    })
+  
   },
-  getAllData() {
+  getAllData(type) {
+    console.log('=========type',type);
     this.setData({
       current:1,
       shop_id: wx.getStorageSync("shopInfo").shopId,
@@ -864,18 +804,19 @@ Page({
     })
     http.getCartCount(); //重新计算购物车总数量
     this.getIndexImgs();
-    this.getClassInfo(this.data.shopId);
-    // this.get_neighborShop()
+    // this.getClassInfo(this.data.shopId);
     // this.getNoticeList();
     this.getAbulk();
     this.getRecommended()
     this.getRecommendeds()
     this.getAdv()
-    setTimeout(() => {
-      this.getNewList();
-      this.getSnapUpList();
-      this.getHotSalesProds();
-    }, 500)
+    if(type == 'refresh'){//切换店铺
+      this.getHotSalesProds()
+    }else{
+      this.get_neighborShop().then(res=>{
+        this.getHotSalesProds()
+      })
+    }
   },
 
   //加载轮播图
@@ -957,7 +898,7 @@ Page({
           this.setData({
             hotSalesList
           })
-          if (res.records.length < 1) {
+          if (hotSalesList.length>=res.total) {
             this.setData({
               isAll: true
             })

+ 16 - 35
pages/index/index.wxml

@@ -263,7 +263,7 @@
       </view>
       <block wx:else>
         <view style="height: 500rpx;">
-          <van-empty image="search" description="附近暂无可配送门店" />
+          <van-empty image="search" description="暂无可查看商品" />
         </view>
         <!-- <view class="reset-localization" bindtap="toLocationPage">定位不准确?<text style="color: rgb(40,120,255);">点击手动定位</text></view> -->
       </block>
@@ -275,42 +275,23 @@
       </block>
   </view>
 
-    <van-popup show="{{ addCarshow }}" closeable round position="bottom" custom-style="height: 43%" bind:close="onClose">
-      <view class="popup-box">
-        <view class="popup-detail">
-          <view class="popup-img-box">
-            <image style="width: 200rpx;height: 200rpx;" src="{{shopDetail.pic}}" mode="" />
-          </view>
-          <view class="popup-shop-detail">
-            <view class="shop-price"><text style="font-size:26rpx;">¥</text>{{wxs.toPrice(shopDetail.price)}}</view>
-            <view class="shop-detail">
-              <view class="shop-isselect">已选</view>
-              <view class="shop-info">黑色,1件</view>
-            </view>
-          </view>
-        </view>
-        <view class="popup-line"></view>
-        <view class="shop-color">
-          <view class="color-text">颜色</view>
-          <view class="color-btn-box">
-            <view class="color-btn">黑色</view>
-            <view class="color-btn">黑色</view>
-            <view class="color-btn">黑色</view>
-          </view>
+
+  <view class="my-popup" wx:if="{{showShopList}}" bind:tap="onClose">
+  
+    <view class="popup-box">
+      <view class="notice">你没有该门店的商品数据查看权限,请切换其他门店</view>
+        <view class="popup-item" wx:for="{{shopList}}">
+          <view class="name {{!item.hasProduct?'disabled':''}}">{{item.shopName}}</view>
+          <view class="tag" wx:if="{{!item.hasProduct}}">无权限</view>
         </view>
-        <view class="popup-num-box">
-          <view class="color-text">数量</view>
-          <view class="stepper-box">
-            <view class="stepper-minus">-</view>
-            <view class="stepper-num">1</view>
-            <view class="stepper-add">+</view>
-          </view>
+    </view>
+  </view>
+
+      <van-overlay show="{{ showPopup }}" bind:click="onClickHide">
+        <view class="wrapper">
+          <image class="img" src="{{imageUrl}}" mode=""></image>
         </view>
-      </view>
-      <view class="bottom-button-box">
-        <view class="bottom-button">选好了</view>
-      </view>
-    </van-popup>
+      </van-overlay>
 
     <tabbar active="0" isScroll="{{isScroll}}"></tabbar>
 

+ 56 - 0
pages/index/index.wxss

@@ -1005,3 +1005,59 @@ swiper.pic-swiper .banner {
 .tab-box::-webkit-scrollbar-thumb {
   display: none;
 }
+
+.my-popup{
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 750rpx;
+  height: 100vh;
+  background: rgba(0,0,0,0.5);
+  z-index: 99;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.my-popup .popup-box{
+  width: 572rpx;
+  height: 640rpx;
+  background: #FFFFFF;
+  border-radius: 32rpx 32rpx 32rpx 32rpx;
+  padding: 24rpx;
+  box-sizing: border-box;
+}
+.my-popup .popup-box .notice{
+  font-size: 24rpx;
+  color: #AAAAAA;
+}
+.my-popup .popup-box .popup-item{
+  line-height: 92rpx;
+  display: flex;
+  align-items: center;
+}
+.my-popup .popup-box .popup-item .name.disabled{
+  color: #AAAAAA;
+}
+.my-popup .popup-box .popup-item .tag{
+  width: 104rpx;
+  height: 36rpx;
+  line-height: 36rpx;
+  text-align: center;
+  background: #AAAAAA;
+  border-radius: 22rpx 22rpx 22rpx 22rpx;
+  font-size: 24rpx;
+  color: #FFFFFF;
+  margin-left: 20rpx;
+}
+
+.wrapper {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  height: 100%;
+}
+
+.wrapper .img{
+  width: 750rpx;
+  height: 784rpx;
+}

+ 24 - 19
pages/locationAdd/locationAdd.js

@@ -71,8 +71,8 @@ Page({
       method: "GET",
       data: {
         addrId:'',
-        lat: wx.getStorageSync('LATITUDE'),
-        lon: wx.getStorageSync('LONGITUDE'),
+        lat: wx.getStorageSync('LATITUDE')||wx.getStorageSync('shopInfo').lat,
+        lon: wx.getStorageSync('LONGITUDE')||wx.getStorageSync('shopInfo').lon,
         channelId:wx.getStorageSync('channelId')||3
       },
       callBack: (res) => {
@@ -104,24 +104,25 @@ Page({
    * 选择店铺
    */
   chooseShop(e){
+    if(!e.currentTarget.dataset.item.hasProduct) return
     wx.setStorageSync('LATITUDE', e.currentTarget.dataset.item.lat)
     wx.setStorageSync('LONGITUDE', e.currentTarget.dataset.item.lon)
     // this.getTxmap()
     // wx.setStorageSync('ADDRESS', e.currentTarget.dataset.item.address)
     wx.setStorageSync('shopInfo', e.currentTarget.dataset.item)
-        setTimeout(() => {
-          let pages = getCurrentPages();
-          let prevPage = pages[pages.length - 2]; //获取A页面
-          wx.navigateBack({
-            delta: 1,
-            success: function (e) { // 成功的回调
-              if (prevPage == undefined || prevPage == null) return;
-              // prevPage.go_update(); // 调用A页面的方法, 并将值传过去
-              prevPage.getAllData(); // 调用A页面的方法, 并将值传过去
-              
-            }
-          })
-        }, 500)
+    setTimeout(() => {
+      let pages = getCurrentPages();
+      let prevPage = pages[pages.length - 2]; //获取A页面
+      wx.navigateBack({
+        delta: 1,
+        success: function (e) { // 成功的回调
+          if (prevPage == undefined || prevPage == null) return;
+          // prevPage.go_update(); // 调用A页面的方法, 并将值传过去
+          prevPage.getAllData(); // 调用A页面的方法, 并将值传过去
+          
+        }
+      })
+    }, 500)
   },
   /**
    * 设置默认
@@ -138,7 +139,7 @@ Page({
         wx.hideLoading();
         this.getAddrList()
         // 当前定位显示选择地址的名称 不再显示路名
-        this.getTxmap()
+        // this.getTxmap()
        wx.setStorageSync('ADDRESS', e.currentTarget.dataset.item.addressName)
         setTimeout(() => {
           let pages = getCurrentPages();
@@ -147,7 +148,9 @@ Page({
             delta: 1,
             success: function (e) { // 成功的回调
               if (prevPage == undefined || prevPage == null) return;
-              prevPage.go_update(); // 调用A页面的方法, 并将值传过去
+              // prevPage.go_update(); // 调用A页面的方法, 并将值传过去
+              prevPage.getAllData(); // 调用A页面的方法, 并将值传过去
+
             }
           })
         }, 500)
@@ -160,8 +163,8 @@ Page({
     // 调用腾讯地图api获取当前位置
     qqmapsdk.reverseGeocoder({
       location: {
-        latitude: wx.getStorageSync('LATITUDE'),
-        longitude: wx.getStorageSync('LONGITUDE')
+        latitude: wx.getStorageSync('LATITUDE')||wx.getStorageSync('shopInfo').lat,
+        longitude: wx.getStorageSync('LONGITUDE')||wx.getStorageSync('shopInfo').lon
       },
       success: (res) => {
         wx.hideLoading()
@@ -206,6 +209,8 @@ Page({
             success: function (e) { // 成功的回调
               if (prevPage == undefined || prevPage == null) return;
               prevPage.go_update(); // 调用A页面的方法, 并将值传过去
+              // prevPage.getAllData('refresh'); // 调用A页面的方法, 并将值传过去
+
             }
           })
         }, 500)

+ 7 - 5
pages/locationAdd/locationAdd.wxml

@@ -3,10 +3,10 @@
   <view class="top-card-box">
     <view class="current-location">当前定位</view>
     <view class="location-box">
-      <view class="location-address">
+      <!-- <view class="location-address">
         <van-icon name="location" />
         <view class="address-text">{{address||'未授权定位'}}</view>
-      </view>
+      </view> -->
       <view bindtap="getLocation" class="reset-location">
         <image style="width: 40rpx;height: 40rpx;margin-right: 10rpx;" src="/images/icon/location.png" mode="" />
         <view>重新定位</view>
@@ -39,15 +39,17 @@
           附近的门店
         </view>
         <view class="shop">
-          {{nearShop.shopName}}
+          <view class="name {{!nearShop.hasProduct?'disabled':''}}">{{nearShop.shopName}}</view>
+          <view class="tag" wx:if="{{!nearShop.hasProduct}}">无权限</view>
         </view>
         <view class="desc">
-          为您选择距离最近的可配送店
+          为您选择距离最近的可配送店
         </view>
       </view>
       <view class="box">
         <view class="shop" bind:tap="chooseShop"  data-item="{{item}}" wx:for="{{shopList}}">
-          {{item.shopName}}
+          <view class="name {{!item.hasProduct?'disabled':''}}">{{item.shopName}}</view>
+          <view class="tag" wx:if="{{!item.hasProduct}}">无权限</view>
         </view>
       </view>
     </view>

+ 16 - 0
pages/locationAdd/locationAdd.wxss

@@ -29,6 +29,22 @@ page {
 }
 .shop{
   line-height: 92rpx;
+  display: flex;
+  align-items: center;
+}
+.shop .name.disabled{
+  color: #AAAAAA;
+}
+.shop .tag{
+  width: 104rpx;
+  height: 36rpx;
+  line-height: 36rpx;
+  text-align: center;
+  background: #AAAAAA;
+  border-radius: 22rpx 22rpx 22rpx 22rpx;
+  font-size: 24rpx;
+  color: #FFFFFF;
+  margin-left: 20rpx;
 }
 .near-shop{
   margin-bottom: 20rpx;

+ 3 - 2
pages/login/login.js

@@ -120,9 +120,10 @@ Page({
         // 发送 res.code 到后台换取 openId, sessionKey, unionId
         http.request({
           login: true,
-          url: '/appLogin',
+          url: '/p/user/miniAppLogin',
+          method:"GET",
           data: {
-            principal: res.code,
+            code: res.code,
             appType: 1
           },
           callBack: result => {

+ 2 - 0
pages/prod/prod.js

@@ -595,6 +595,8 @@ Page({
       url: "/prod/prodRecommended",
       method: "GET",
       data: {
+        shopId:this.data.shopId,
+        channelId:wx.getStorageSync('channelId')||3,
         current: this.data.current,
         size: 10,
       },

+ 4 - 4
utils/config.js

@@ -2,10 +2,10 @@
 // var domain = "https://shop-h5.zswllife.cn/api"; //统一接口域名,正式环境 
 // var wsDomain = "wss://shop-h5.zswllife.cn/api"; //统一接口域名,正式环境 
 
-var domain = "https://shop.api.zswlgz.com"; //统一接口域名,测试环境 
-var wsDomain = "wss://shop-h5.dev.zswllife.cn/api"; //统一接口域名,测试环境 
-// var domain = "http://47.109.84.152:8112"; //统一接口域名,正式环境 
-// var domain = "https://5d2f568f.r36.cpolar.top"; //统一接口域名,正式环境 
+var domain = "https://shop.api.zswlgz.com"; //统一接口域名,正式环境 
+var wsDomain = "wss://shop-h5.dev.zswllife.cn/api"; //统一接口域名,正式环境 
+// var domain = "http://47.109.84.152:8112"; //统一接口域名,测试环境 
+// var domain = "https://3af85f91.r36.cpolar.top"; //统一接口域名,正式环境 
 // var wsDomain = "wss://shop.haimamart.com/api"; //统一接口域名,正式环境 
 
 // var domain = "http://192.168.1.206:8112"; //统一接口域名,测试环境

+ 3 - 2
utils/http.js

@@ -150,9 +150,10 @@ var getToken = function (fn) {
       console.log(res);
       request({
         login: true,
-        url: '/appLogin',
+        url: '/p/user/miniAppLogin',
+        method:"GET",
         data: {
-          principal: res.code,
+          code: res.code,
           appType: 1
         },
         callBack: result => {