Browse Source

添加图片上传 接口修改

wangyong 5 years ago
parent
commit
a9332105fe

+ 3 - 2
customized/pages/boxMade/boxMadeImg/boxMadeImg.js

@@ -212,13 +212,14 @@ Page({
       success(res) {
         const tempFilePaths = res.tempFilePaths
         wx.uploadFile({
-          url: host + 'fileUpload', // 仅为示例,非真实的接口地址
+          url: host + 'adminFileUpload', // 仅为示例,非真实的接口地址
           filePath: tempFilePaths[0],
           name: 'file',
           formData: {
             file: tempFilePaths[0],
             userId: app.globalData.user_id,
-            imgStatus: 0, // 表示素材
+            customGoodsId:wx.getStorageSync('detail').id,
+            customGoodsImgPlaceId: that.data.dataId[0] == that.data.imgTouch.isActive ? 1 : 2, // that.data.dataId[0] 是正面,1是背面
           },
           success(res) {
             console.log(res, '我上传完了')

+ 1 - 1
customized/pages/boxMade/boxMadeImg/boxMadeImg.wxss

@@ -29,7 +29,7 @@ page{
 .upload-btn{
   width:120rpx;
   height:120rpx;
-  line-height:36rpx;
+  line-height:40rpx;
   background:none;
   font-size:26rpx;
 }

+ 3 - 2
customized/pages/made/madeImg/madeImg.js

@@ -225,13 +225,14 @@ Page({
       success(res) {
         const tempFilePaths = res.tempFilePaths
         wx.uploadFile({
-          url: host + 'fileUpload', // 仅为示例,非真实的接口地址
+          url: host + 'adminFileUpload', // 仅为示例,非真实的接口地址
           filePath: tempFilePaths[0],
           name: 'file',
           formData: {
             file: tempFilePaths[0],
             userId: app.globalData.user_id,
-            imgStatus: 0, // 表示素材
+            customGoodsId: wx.getStorageSync('detail').id,
+            customGoodsImgPlaceId: that.data.imgTouch.isActive * 1 - 1
           },
           success(res) {
             console.log(res, '我上传完了')

+ 1 - 1
customized/pages/made/madeImg/madeImg.wxss

@@ -32,7 +32,7 @@ page{
 .upload-btn{
   width:180rpx;
   height:180rpx;
-  line-height:36rpx;
+  line-height:40rpx;
   background:none;
   font-size:26rpx;
 }

+ 3 - 2
customized/pages/oneMade/oneMadeImg/oneMadeImg.js

@@ -210,13 +210,14 @@ Page({
       success(res) {
         const tempFilePaths = res.tempFilePaths
         wx.uploadFile({
-          url: host + 'fileUpload', // 仅为示例,非真实的接口地址
+          url: host + 'adminFileUpload', // 仅为示例,非真实的接口地址
           filePath: tempFilePaths[0],
           name: 'file',
           formData: {
             file: tempFilePaths[0],
             userId: app.globalData.user_id,
-            imgStatus: 0, // 表示素材
+            customGoodsId: wx.getStorageSync('detail').id,
+            customGoodsImgPlaceId: 1, // that.data.dataId[0] 是正面,1是背面
           },
           success(res) {
             console.log(res, '我上传完了')

+ 1 - 1
customized/pages/oneMade/oneMadeImg/oneMadeImg.wxss

@@ -35,7 +35,7 @@ page{
 .upload-btn{
   width:120rpx;
   height:120rpx;
-  line-height:36rpx;
+  line-height:40rpx;
   background:none;
   font-size:26rpx;
 }