sharp-agezi 6 rokov pred
rodič
commit
856e5c9078

+ 15 - 1
customized/pages/car/car.js

@@ -96,7 +96,7 @@ Page({
         'content-type': 'application/x-www-form-urlencoded'
       },
       data:{
-        userId: app.globalData.user_id //'oovpNwjlsY6xx8ceCebFa1dOLd9E'  //app.globalData.user_id,
+        userId: app.globalData.user_id   //app.globalData.user_id //'oovpNwjlsY6xx8ceCebFa1dOLd9E'  //app.globalData.user_id,
       },
       success:function(res){
         console.log('购物车列表数据',res)
@@ -151,5 +151,19 @@ Page({
       checkAll: checkAll,
       checkStatic: checkStatic
     })
+  },
+  previewImage(e){ // 点击图片放大
+    let urls = [],that = this;
+    console.log(e)
+    e.target.dataset.srcarray.forEach(el=>{
+      urls.push(that.data.host + el)
+    })
+    wx.previewImage({
+      urls: urls,
+      current:'e.target.dataset.src',
+      success(res){
+        console.log(res,"放大成功")
+      }
+    })
   }
 })

+ 1 - 1
customized/pages/car/car.wxml

@@ -20,7 +20,7 @@
             </view>
             <!-- 图片list -->
             <view class='f-box car-img-list' >
-              <image wx:for='{{item.imgArray}}' wx:for-item="itemSrc" src='{{host}}{{itemSrc}}' mode="aspectFit"></image>
+              <image wx:for='{{item.imgArray}}' wx:for-item="itemSrc" src='{{host}}{{itemSrc}}' mode="aspectFit" data-src="{{host}}{{itemSrc}}" data-srcArray="{{item.imgArray}}" bindtap='previewImage'></image>
             </view>
           </view>
         </view>

+ 3 - 0
customized/pages/car/car.wxss

@@ -1,4 +1,7 @@
 /* customized/pages/made/car/car.wxss */
+.car-box{
+  width:750rpx;
+}
 .car-checkbox{
   width:100rpx;
 }

+ 7 - 0
customized/pages/made/madeImg/madeImg.js

@@ -176,6 +176,10 @@ Page({
   },
   getImgList(){ // 根据userid 获取图片列表
     // /queryCustomGoodsUserListByUserId
+    wx.showLoading({
+      title: '加载中...',
+      icon:'none'
+    })
     let that = this
     wx.request({
       url: host+'/queryCustomGoodsUserListByUserId',
@@ -188,6 +192,9 @@ Page({
         that.setData({
           imageArray:res.data
         })
+      },
+      complete(){
+        wx.hideLoading()
       }
     })