Forráskód Böngészése

fix 支持门店多张照片

wzh 3 hónapja
szülő
commit
fdbce23a8f

+ 2 - 2
api/hexiao.js

@@ -691,9 +691,9 @@ export function queryYwySalesDetail(data){
         data: data
     })
 }
-export function queryWritePrizeDetail(data){
+export function queryYwyWritePrizeDetail(data){
     return request({
-        url: `/jxs/queryWritePrizeDetail`,
+        url: `/jxs/queryYwyWritePrizeDetail`,
         method: 'post',
         data: data
     })

+ 10 - 7
pages/hexiao/ywy/add_retail.vue

@@ -52,8 +52,8 @@
             :del-icon="edit"
             file-mediatype="image"
             mode="grid"
-            :limit="1"
-            title="最多选择1张图片"
+            :limit="9"
+            title="最多选择9张图片"
             v-model="formData.photos"
         />
       </view>
@@ -97,9 +97,12 @@ export default {
             ownerName: data.contact_name,
             contact: data.contact_phone,
             address: data.address,
-            photos: [{
-              "url":data.store_photo,
-            }]
+          }
+          this.formData.photos = [];
+          let photos = data.store_photo.split(",")
+          for (let i = 0; i < photos.length; i++) {
+            let photo = photos[i];
+            this.formData.photos.push({url:photo})
           }
         })
       }
@@ -143,7 +146,7 @@ export default {
       // 执行提交逻辑
       uni.showLoading({ title: '正在保存...' });
       if(this.formData.storeId>0){
-        updateStore(this.formData.storeId,this.formData.storeName,this.formData.ownerName,this.formData.contact,this.formData.address,imageUrlarr[0])
+        updateStore(this.formData.storeId,this.formData.storeName,this.formData.ownerName,this.formData.contact,this.formData.address,imageUrlarr.join(","))
             .then(res=>{
               uni.hideLoading();
               if(res.code == 0){
@@ -162,7 +165,7 @@ export default {
 
             })
       }else{
-        addStore(this.formData.storeName,this.formData.ownerName,this.formData.contact,this.formData.address,imageUrlarr[0])
+        addStore(this.formData.storeName,this.formData.ownerName,this.formData.contact,this.formData.address,imageUrlarr.join(","))
             .then(res=>{
               uni.hideLoading();
               if(res.code == 0){

+ 2 - 2
pages/hexiao/ywy/hexiao_detail_ywy.vue

@@ -82,7 +82,7 @@
 </template>
 
 <script>
-import {queryWritePrizeDetail} from "@/api/hexiao";
+import {queryYwyWritePrizeDetail} from "@/api/hexiao";
 
 export default {
   data() {
@@ -134,7 +134,7 @@ export default {
       this.loadStatus = 'loading';
 
       // 在这里替换成您真实的 uni.request API 调用
-      queryWritePrizeDetail({ywyId:this.ywyId,startTime:this.startTime,endTime:this.endTime}).then(res=>{
+      queryYwyWritePrizeDetail({salesmanId:this.ywyId,startTime:this.startTime,endTime:this.endTime}).then(res=>{
         this.recordList = res.data.list;
         this.isLoading = false;
         this.totalInfo = {totalCount:res.data.totalCount}