Sfoglia il codice sorgente

1、AR发行配置

huangmp 1 anno fa
parent
commit
26df45c78d

+ 5 - 0
src/components/order-card-item/index.vue

@@ -495,6 +495,9 @@
           }else if(prodName.indexOf("亚克力票根") !== -1){
             width = 780;
             height = 1488;
+          }else if(prodName.indexOf("AR吧唧") !== -1){
+            width = 1476;
+            height = 1476;
           }
           let _URL = window.URL || window.webkitURL;
           let img = new Image();
@@ -660,6 +663,8 @@
           this.prodType = '哪吒';
         }else if(prodName.indexOf('白月') != -1){
           this.prodType = '白月';
+        }else if(prodName.indexOf('AR吧唧') != -1){
+          this.prodType = 'AR吧唧';
         }
         this.$nextTick(() =>{
           this.$refs.canvasPreviewRef.init(cardItem, this.resourcesUrl + picUrl, this.prodType, side)

+ 2 - 1
src/views/modules/ar/arAssets/add-or-update.vue

@@ -111,7 +111,8 @@ export default {
         assetsType: 'Video',
         assetsList: [],
         assetsUrl: null,
-        cardType: null
+        cardType: null,
+        shopId: this.$store.state.user.shopId
       },
       uploadMultiple: true,
       uploadLimit: 50,

+ 15 - 4
src/views/modules/ar/arIssue/add-or-update.vue

@@ -145,11 +145,12 @@ export default {
         issueTime: null,
         issueTopic: {
           issueCover: null,
-          issueBgColor: null,
-          cardTypeBgColor: null,
-          cardTypeFontColor: null,
-          cardFontColor: null
+          issueBgColor: '#ffffff',
+          cardTypeBgColor: '#ffffff',
+          cardTypeFontColor: '#ffffff',
+          cardFontColor: '#ffffff'
         },
+        shopId: this.$store.state.user.shopId,
       },
       resourcesUrl: process.env.VUE_APP_RESOURCES_URL,
       lang: localStorage.getItem('lang'),
@@ -257,6 +258,16 @@ export default {
     onFrontRemove (response, file, fileList) {
       this.dataForm.issueTopic.issueCover = null
     },
+    close(){
+      this.visible = false
+      this.dataForm.issueTopic =  {
+        issueCover: null,
+          issueBgColor: '#ffffff',
+          cardTypeBgColor: '#ffffff',
+          cardTypeFontColor: '#ffffff',
+          cardFontColor: '#ffffff'
+      }
+    }
   }
 }
 </script>

+ 11 - 6
src/views/modules/ar/arIssue/index.vue

@@ -17,12 +17,6 @@
               align="center"
             >
             </el-table-column>
-            <!--<el-table-column
-              align="left"
-              prop="issueDesc"
-              label="发行描述"
-              width="250px"
-            >-->
             </el-table-column>
             <el-table-column
               align="center"
@@ -42,6 +36,17 @@
               label="发行时间"
             >
             </el-table-column>
+            <el-table-column
+              align="left"
+              prop="isDelete"
+              label="状态"
+              width="250px"
+            >
+              <template slot-scope="scope">
+                <el-tag v-if="scope.row.isDelete === 0" type="success">上架中</el-tag>
+                <el-tag v-if="scope.row.isDelete === 1" type="danger">已下架</el-tag>
+              </template>
+            </el-table-column>
             <el-table-column
               align="center"
               :label="$t('crud.menu')"

+ 7 - 3
src/views/modules/ar/arIssueConfig/add-or-update.vue

@@ -60,7 +60,7 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <el-button type="primary" @click="handleIssue">批量发行</el-button>
+      <el-button v-if="dataForm.configId" type="primary" @click="handleIssue">批量发行</el-button>
     </el-form>
     <span slot="footer" class="dialog-footer">
       <el-button class="default-btn" @click="visible = false">{{$t("crud.filter.cancelBtn")}}</el-button>
@@ -119,9 +119,13 @@ export default {
               this.dataForm.configId = data.configId
               this.dataForm.screenOrientation = data.screenOrientation
               this.arCodeConfig.configId = data.configId
-              for(let i in data.assetsPackageArray){
-                this.dataForm.assetsIdList.push(data.assetsPackageArray[i].videoId)
+              let obj = data.assetsPackageObj
+              if(obj){
+                for(let i in obj.videoList){
+                  this.dataForm.assetsIdList.push(obj.videoList[i].videoId)
+                }
               }
+
             }
           })
         }

+ 11 - 3
src/views/modules/ar/arIssueConfig/interactive-config.vue

@@ -115,7 +115,14 @@
         assetsList:[],
         prodId: null,
         videoList: [],
-        dataForm:{},
+        dataForm:{
+          assetsType: null,
+          screenOrientation: null,
+          assetsPackageObj:{
+            frameUrl: null,
+            videoList: []
+          }
+        },
       }
     },
 
@@ -140,7 +147,8 @@
                 this.dataForm.configId = data.configId
                 this.dataForm.assetsType = data.assetsType
                 this.dataForm.screenOrientation = data.screenOrientation
-                this.videoList = data.assetsPackageArray
+                this.dataForm.assetsPackageObj = data.assetsPackageObj
+                this.videoList = data.assetsPackageObj.videoList
               }
             })
           }
@@ -152,7 +160,7 @@
         if(this.dataForm.configId){
           url = '/ar/arIssuePicAssetsConfig/updateConfig'
         }
-        this.dataForm.assetsPackageArray = this.videoList
+        this.dataForm.assetsPackageObj.videoList = this.videoList
         this.$http({
           url: this.$http.adornUrl(url),
           method: 'post',

+ 19 - 6
src/views/modules/ar/arIssuePic/add-or-update.vue

@@ -67,6 +67,7 @@
             <el-radio label="D3CXK">大3寸</el-radio>
             <el-radio label="ZP">直拍</el-radio>
             <el-radio label="MXP">明信片</el-radio>
+            <el-radio label="HZ">吧唧</el-radio>
           </el-radio-group>
         </el-form-item>
       </el-row>
@@ -79,7 +80,6 @@
               list-type="picture-card"
               accept="image/*"
               :multiple="frontMultiple"
-              :before-upload="(file, fileList)=>handleBeforeUpload(file, fileList,'Front')"
               action="#"
               :limit="frontLimit"
               :file-list="dataForm.frontList"
@@ -101,7 +101,6 @@
               list-type="picture-card"
               accept="image/*"
               :multiple="true"
-              :before-upload="(file, fileList)=>handleBeforeUpload(file, fileList,'Back')"
               action="#"
               :limit="1"
               :file-list="dataForm.backList"
@@ -221,8 +220,13 @@ export default {
           this.dataForm.issuePicLevel = data.issuePicLevel
           let front = {name: data.issuePicName, url: this.resourcesUrl + this.dataForm.frontUrl, path: this.dataForm.frontUrl}
           let back = {name: data.issuePicName, url: this.resourcesUrl + this.dataForm.backUrl, path: this.dataForm.backUrl}
-          this.dataForm.frontList.push(front)
-          this.dataForm.backList.push(back)
+          if(front.path){
+            this.dataForm.frontList.push(front)
+          }
+          if(back.path){
+            this.dataForm.backList.push(back)
+          }
+
           this.dataForm.back = back
         })
       }
@@ -233,7 +237,12 @@ export default {
         return
       }
       try{
-        this.dataForm.frontUrl = this.dataForm.frontList.join(",");
+        if(this.dataForm.frontList.length > 0){
+          this.dataForm.frontUrl = this.dataForm.frontList.join(",");
+        }
+        if(this.dataForm.backList.length > 0){
+          this.dataForm.backList = this.dataForm.backList.join(",");
+        }
         this.isSubmitting = true
         this.$http({
           url: this.$http.adornUrl(`/ar/arIssuePic`),
@@ -273,7 +282,8 @@ export default {
         backList: [],
         frontList: [],
         back:{},
-        picType: "6x9"
+        picType: "6x9",
+        shopId: this.$store.state.user.shopId
       }
     },
 
@@ -339,6 +349,9 @@ export default {
       }else if (picType === 'ZP') {
         width = 732
         height = 1252
+      }else if (picType === 'HZ') {
+        width = 732
+        height = 1252
       }
       isSize = new Promise(function(resolve, reject) {
         let _URL = window.URL || window.webkitURL

+ 106 - 0
src/views/modules/ar/arIssuePic/frame-add-or-update.vue

@@ -0,0 +1,106 @@
+<template>
+  <el-dialog
+    title="柄图发行配置"
+    :close-on-click-modal="false"
+    :append-to-body="true"
+    width="760px"
+    v-if="visible"
+    @close="closeDialog"
+    :visible.sync="visible">
+    <el-form :model="dataForm" size="small" label-width="100px">
+      <el-row>
+        <el-divider>边框配置</el-divider>
+        <el-col :span="8">
+          <el-form-item label="边框地址">
+            <el-input v-model="dataForm.assetsPackageObj.frameUrl" style="width:340px"></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button class="default-btn" @click="visible = false">{{$t("crud.filter.cancelBtn")}}</el-button>
+      <el-button class="default-btn primary-btn" type="primary" @click="dataFormSubmit()">{{$t("crud.filter.submitBtn")}}</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  components: {
+
+  },
+  data () {
+    return {
+      visible: false,
+      dataForm: {
+        issueId: null,
+        issuePicId: null,
+        configId: null,
+        assetsPackageObj: {
+          frameUrl: null,
+          videoList: []
+        },
+        assetsType: 'Video'
+      }
+    }
+  },
+
+  created() {
+
+  },
+  methods: {
+    init (issuePicId, issueId) {
+      this.dataForm.issuePicId = issuePicId || null
+      this.dataForm.issueId = issueId || null
+      this.visible = true
+      this.$nextTick(() => {
+        if (this.dataForm.issuePicId) {
+          this.$http({
+            url: this.$http.adornUrl('/ar/arIssuePicAssetsConfig/infoByPicId/' + this.dataForm.issuePicId),
+            method: 'get',
+            params: this.$http.adornParams()
+          }).then(({data}) => {
+            if(data){
+              this.dataForm.configId = data.configId
+              this.dataForm.issueId = data.issueId
+              this.dataForm.issuePicId = data.issuePicId
+              this.dataForm.assetsPackageObj = data.assetsPackageObj
+            }
+          })
+        }
+      })
+    },
+    // 表单提交
+    dataFormSubmit () {
+      let url = '/ar/arIssuePicAssetsConfig/saveConfig'
+      if(this.dataForm.configId){
+        url = '/ar/arIssuePicAssetsConfig/updateConfig'
+      }
+      this.$http({
+        url: this.$http.adornUrl(url),
+        method: 'post',
+        data: this.$http.adornData(this.dataForm)
+      }).then(({data}) => {
+        this.$message({
+          message: this.$i18n.t('publics.operation'),
+          type: 'success'
+        });
+        this.closeDialog()
+      })
+    },
+    closeDialog(){
+      this.visible = false;
+      this.dataForm = {
+        configId: null,
+        issuePicId: null,
+        issueId: null,
+        assetsPackageObj: {
+          frameUrl: null,
+          videoList: []
+        },
+        assetsType: 'Video'
+      }
+    },
+  }
+}
+</script>

+ 15 - 5
src/views/modules/ar/arIssuePic/index.vue

@@ -62,13 +62,13 @@
             <el-table-column
               align="center"
               :label="$t('crud.menu')"
-              width="250"
+              width="350"
             >
               <template slot-scope="scope">
                 <div class="text-btn-con">
-<!--                  <div v-if="isAuth('ar:arIssue:update')" class="default-btn text-btn" @click="configHandle(scope.row.issuePicId)">基础配置</div>-->
                   <div v-if="isAuth('ar:arIssue:update')" class="default-btn text-btn" @click="interactiveConfigHandle(scope.row.issuePicId)">互动配置</div>
                   <div v-if="isAuth('ar:arIssue:update')" class="default-btn text-btn" @click="issueConfigHandle(scope.row.issuePicId)">发行配置</div>
+                  <div v-if="isAuth('ar:arIssue:update')" class="default-btn text-btn" @click="frameConfigHandle(scope.row.issuePicId)">边框配置</div>
                   <div v-if="isAuth('ar:arIssue:update')" class="default-btn text-btn" @click="updateHandle(scope.row.issuePicId)">{{ $t('text.updateBtn') }}</div>
                   <div v-if="isAuth('ar:arIssue:delete')" class="default-btn text-btn" @click="deleteHandle(scope.row.issuePicId)">{{ $t('text.delBtn') }}</div>
                 </div>
@@ -92,8 +92,9 @@
       <el-dialog :visible.sync="previewPicDialogVisible" :modal="false" title="图片预览" width="30%" top="3vh">
         <el-image :src="previewPicUrl" alt=""  style="width: 100%; height: 100%"/>
       </el-dialog>
-      <config-add-or-update ref="configAddOrUpdate"></config-add-or-update>
-      <interactive-config ref="interactiveConfigAddOrUpdate"></interactive-config>
+      <config-add-or-update ref="configAddOrUpdate" v-if="configVisible"></config-add-or-update>
+      <interactive-config ref="interactiveConfigAddOrUpdate" v-if="interactiveConfigVisible"></interactive-config>
+      <frame-config-add-or-update ref="frameConfigAddOrUpdate" v-if="frameConfigVisible"></frame-config-add-or-update>
     </div>
   </el-drawer>
 
@@ -103,6 +104,7 @@
 import AddOrUpdate from './add-or-update'
 import ConfigAddOrUpdate from '../arIssueConfig/add-or-update'
 import InteractiveConfig from "../arIssueConfig/interactive-config";
+import FrameConfigAddOrUpdate from "./frame-add-or-update";
 export default {
   data () {
     return {
@@ -122,13 +124,15 @@ export default {
       previewPicUrl: null,
       previewPicDialogVisible: false,
       configVisible: false,
+      frameConfigVisible: false,
       interactiveConfigVisible: false,
     }
   },
   components: {
     InteractiveConfig,
     AddOrUpdate,
-    ConfigAddOrUpdate
+    ConfigAddOrUpdate,
+    FrameConfigAddOrUpdate
   },
   created () {
     this.getDataList(this.page)
@@ -180,6 +184,12 @@ export default {
         this.$refs.configAddOrUpdate.init(issuePicId, this.issueId)
       })
     },
+    frameConfigHandle(issuePicId){
+      this.frameConfigVisible = true
+      this.$nextTick(() => {
+        this.$refs.frameConfigAddOrUpdate.init(issuePicId, this.issueId)
+      })
+    },
     interactiveConfigHandle(issuePicId){
       this.interactiveConfigVisible = true
       this.$nextTick(() => {

+ 1 - 0
src/views/modules/ar/arIssueUserCard/index.vue

@@ -21,6 +21,7 @@
               label="卡编号"
               prop="cardNo"
               align="center"
+              width="200px"
             >
             </el-table-column>
             <!-- 正面图 -->