Browse Source

代码更新

wzy 1 month ago
parent
commit
f07a1de99a

+ 3 - 3
.env.development

@@ -7,6 +7,6 @@ VUE_APP_BASE_API = '/dev-api'
 # 开发环境
 # VUE_APP_DOMAIN_PREFIX = 'http://192.168.0.91:9007'
 # 演示环境
-# VUE_APP_DOMAIN_PREFIX = 'http://192.168.0.91:9007'
-VUE_APP_DOMAIN_PREFIX = 'https://mtradminapi.tfcliao.com'
-# VUE_APP_DOMAIN_PREFIX = '/api'
+# VUE_APP_DOMAIN_PREFIX = 'http://192.168.0.91:9103'
+# VUE_APP_DOMAIN_PREFIX = 'https://mtradmintest.tfcliao.com'
+VUE_APP_DOMAIN_PREFIX = '/api'

+ 1 - 0
.env.production

@@ -4,4 +4,5 @@ ENV = 'production'
 # base api
 VUE_APP_BASE_API = '/prod-api'
 
+# VUE_APP_DOMAIN_PREFIX = 'http://192.168.0.91:9007'
 VUE_APP_DOMAIN_PREFIX = 'https://mtradminapi.tfcliao.com'

+ 7 - 0
.env.test

@@ -0,0 +1,7 @@
+# just a flag
+ENV = 'test'
+
+# base api
+VUE_APP_BASE_API = '/prod-api'
+
+VUE_APP_DOMAIN_PREFIX = 'https://mtradminapitest.tfcliao.com'

+ 1 - 0
package.json

@@ -6,6 +6,7 @@
   "scripts": {
     "dev": "vue-cli-service serve",
     "build:prod": "vue-cli-service build",
+    "build:test": "vue-cli-service build --mode test",
     "build:stage": "vue-cli-service build --mode staging",
     "preview": "node build/index.js --preview",
     "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",

+ 26 - 18
src/App.vue

@@ -1,7 +1,15 @@
 <template>
   <div id="app">
-    <el-dialog title="温馨提示" top="30vh" :visible.sync="tipShow" width="30%" center>
-      <span>为保护个人隐私信息,系统自动对敏感数据进行脱敏。如需编辑、查看完整信息,可通过“用户隐私二次认证”功能进行验证,验证通过之后,24小时内可查看完整信息。</span>
+    <el-dialog
+      title="温馨提示"
+      top="30vh"
+      :visible.sync="tipShow"
+      width="30%"
+      center
+    >
+      <span
+        >为保护个人隐私信息,系统自动对敏感数据进行脱敏。如需编辑、查看完整信息,可通过“用户隐私二次认证”功能进行验证,验证通过之后,24小时内可查看完整信息。</span
+      >
       <span slot="footer" class="dialog-footer">
         <el-button @click="tipShow = false">关闭</el-button>
       </span>
@@ -11,41 +19,41 @@
 </template>
 
 <script>
-import { getPrivacySwitch } from '@/api/privacy'
+import { getPrivacySwitch } from "@/api/privacy";
 export default {
-  name: 'App',
+  name: "App",
   data() {
     return {
-      tipShow: false
-    }
+      tipShow: false,
+    };
   },
   created() {
     if (this.$store.state.user.token) {
-      this.getPrivacySwitch()
+      this.getPrivacySwitch();
     }
   },
   methods: {
     getPrivacySwitch() {
       getPrivacySwitch().then((res) => {
-        var IsTipshow = localStorage.getItem('IsTipshow')
-        localStorage.setItem('privacyTime', res.data)
+        var IsTipshow = localStorage.getItem("IsTipshow");
+        localStorage.setItem("privacyTime", res.data);
         if (this.$store.state.user.token && !IsTipshow && res.data === 0) {
-          this.tipShow = true
-          localStorage.setItem('IsTipshow', true)
+          this.tipShow = true;
+          localStorage.setItem("IsTipshow", true);
         }
-      })
-    }
-  }
-}
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss">
 .el-dialog__header {
-	background-color: #3A68F2;
-	text-align: left;
+  background-color: #3a68f2;
+  text-align: left;
 }
 
 .el-dialog__title {
-	color: #FFFFFF;
+  color: #ffffff;
 }
 </style>

+ 163 - 38
src/views/business/businessList/index.vue

@@ -40,6 +40,7 @@
           <el-table-column prop="shopCode" label="店铺编码" />
           <el-table-column prop="chargePersonName" label="负责人" />
           <el-table-column prop="chargePersonPhone" label="联系电话" />
+          <el-table-column prop="orderSort" label="当前排序" />
           <el-table-column label="合同状态">
             <template slot-scope="scope">
               <span v-if="scope.row.contractState === 0">无效</span>
@@ -78,15 +79,19 @@
       <!-- ******************************************************弹框开始****************************************************** -->
       <!-- 新建商家弹框 -->
       <el-dialog :title="userState === 0
-        ? '新增商家'
-        : userState === 1
-          ? '修改商家'
-          : '查看商家'
-        " :visible.sync="dialogVisible" width="30%" center :before-close="closeFn" :close-on-click-modal="false">
+          ? '新增商家'
+          : userState === 1
+            ? '修改商家'
+            : '查看商家'
+          " :visible.sync="dialogVisible" width="30%" center :before-close="closeFn" :close-on-click-modal="false">
         <div>
           <el-tabs v-model="activeName" @tab-click="handleClick">
             <el-tab-pane label="授权信息" name="first">
               <el-form ref="ruleFormInfo" :model="ruleForm" :rules="rulesInfo" label-width="120px">
+                <el-form-item prop="orderSort" label="排序">
+                  <el-input placeholder="请输入商家排序" v-model.number="ruleForm.orderSort"
+                    type="number"></el-input>
+                </el-form-item>
                 <el-form-item label="店铺名称" prop="shopName">
                   <el-input v-model="ruleForm.shopName" maxlength="20" :disabled="disabled" />
                 </el-form-item>
@@ -125,9 +130,10 @@
                       {{ ruleForm.longitude }} - {{ ruleForm.latitude }}
                     </span>
                     <el-button size="mini" type="primary" style="margin-left: 20px;"
-                      @click="$refs.selectAddressMapRef && $refs.selectAddressMapRef.show()">{{ ruleForm.longitude ? '修改'
-                        :
-                        '选择' }}</el-button>
+                      @click="$refs.selectAddressMapRef && $refs.selectAddressMapRef.show()">{{ ruleForm.longitude ?
+          '修改'
+          :
+          '选择' }}</el-button>
                   </div>
                 </el-form-item>
                 <el-form-item label="生效日期" prop="effectiveDate">
@@ -154,31 +160,31 @@
                     <!-- <el-radio :disabled="disabled" :label="1">
                       品牌厂家
                     </el-radio> -->
-                    <el-radio :disabled="disabled" :label="2">
-                      本地
+                    <el-radio :disabled="disabled" :label="1">
+                      商城
                     </el-radio>
                   </el-radio-group>
                 </el-form-item>
 
                 <el-form-item v-if="ruleForm.shopType === 2" prop="startTime" label="营业开始时间" :rules="[
-                  { required: true, message: '请选择营业开始时间', trigger: 'blur' }]">
+          { required: true, message: '请选择营业开始时间', trigger: 'blur' }]">
 
                   <el-time-select :disabled="disabled" placeholder="起始时间" v-model="ruleForm.startTime" :picker-options="{
-                    start: '00:00',
-                    step: '00:05',
-                  }">
+          start: '00:00',
+          step: '00:05',
+        }">
                   </el-time-select>
 
                 </el-form-item>
 
                 <el-form-item v-if="ruleForm.shopType === 2" prop="endTime" label="营业结束时间" :rules="[
-                  { required: true, message: '请选择营业结束时间', trigger: 'blur' }]">
+          { required: true, message: '请选择营业结束时间', trigger: 'blur' }]">
 
                   <el-time-select :disabled="disabled" placeholder="营业结束时间" v-model="ruleForm.endTime" :picker-options="{
-                    start: '00:00',
-                    step: '00:05',
-                    end: '24:00',
-                  }">
+          start: '00:00',
+          step: '00:05',
+          end: '24:00',
+        }">
                   </el-time-select>
                 </el-form-item>
 
@@ -193,9 +199,9 @@
                   </el-radio-group>
                 </el-form-item>
                 <el-form-item v-if="ruleForm.isVoucher === 1" :rules="[
-                  { required: true, message: '请输入代金券返还比例', trigger: 'blur' },
-                  { type: 'number', max: 100, min: 0, message: '请输入正确的代金券返还比例,0 ~ 100', trigger: ['blur', 'change'] }
-                ]" label="代金券返还比例" prop="voucherReturn">
+          { required: true, message: '请输入代金券返还比例', trigger: 'blur' },
+          { type: 'number', max: 100, min: 0, message: '请输入正确的代金券返还比例,0 ~ 100', trigger: ['blur', 'change'] }
+        ]" label="代金券返还比例" prop="voucherReturn">
                   <el-input :disabled="disabled" placeholder="请填写代金券返还比例,范围0 ~ 100"
                     v-model.number="ruleForm.voucherReturn">
                     <template slot="append">%</template>
@@ -232,22 +238,47 @@
                 </el-form-item>
 
                 <el-form-item prop="perCapita" label="人均">
-                  <el-input :disabled="disabled" type="number" placeholder="请输入人均消费额" v-model.number="ruleForm.perCapita"
-                    closeable></el-input>
+                  <el-input :disabled="disabled" type="number" placeholder="请输入人均消费额"
+                    v-model.number="ruleForm.perCapita" closeable></el-input>
                 </el-form-item>
 
                 <el-form-item prop="shopBrief" label="商家简介">
-                  <el-input :disabled="disabled" autosize maxlength="250" show-word-limit type="textarea"
+                  <el-input :disabled="disabled" autosize maxlength="2000" show-word-limit type="textarea"
                     placeholder="请输入商家简介" v-model="ruleForm.shopBrief" closeable></el-input>
                 </el-form-item>
+                <el-form-item prop="label" label="主营">
+                  <el-input :disabled="disabled" autosize maxlength="70" show-word-limit type="textarea"
+                    placeholder="请输入主营业务" v-model="ruleForm.label" closeable></el-input>
+                </el-form-item>
 
                 <el-form-item prop="advertisement" label="广告图">
-                  <el-upload :disabled="disabled" class="avatar-uploader" list-type="picture-card"
+                  <el-upload :disabled="disabled" class="avatar-uploader" list-type="picture-card" :multiple="false"
                     :file-list="advertisementList" :action="action" :on-success="handleAvatarSuccess"
                     :on-remove="handleRemovePic">
                     <i class="el-icon-plus avatar-uploader-icon" />
                   </el-upload>
                 </el-form-item>
+                <el-form-item prop="videoList" label="商家视频">
+                  <el-upload :disabled="disabled" class="avatar-uploader" :file-list="videoList" :action="action"
+                    :on-success="videoSuccess" :on-remove="videoRemove">
+
+                    <div class="list">
+                      <div v-if="videoList.length > 0" class="list-video">
+                        <div v-for="(item, index) in videoList" :key="index" class="video-item">
+                          <video controls width="400">
+                            <source :src="item.url" type="video/mp4">
+                            Your browser does not support the video tag.
+                          </video>
+                        </div>
+                      </div>
+                      <div class="upload-btn">
+                        <i class="el-icon-plus avatar-uploader-icon" />
+                      </div>
+                    </div>
+                  </el-upload>
+
+
+                </el-form-item>
               </el-form>
             </el-tab-pane>
             <el-tab-pane label="客户信息" name="second">
@@ -255,7 +286,8 @@
                 <el-form-item label="账号" prop="shopPhone">
                   <el-input v-if="shopPhoneShow" :value="hidden(ruleForm.shopPhone, 3, 4)" :disabled="disabled"
                     maxlength="20" @focus="focusShopPhoneInput" />
-                  <el-input v-else ref="shopPhoneCls" v-model="ruleForm.shopPhone" :disabled="disabled" maxlength="20" />
+                  <el-input v-else ref="shopPhoneCls" v-model="ruleForm.shopPhone" :disabled="disabled"
+                    maxlength="20" />
                 </el-form-item>
                 <el-form-item label="密码" prop="shopPassword">
                   <el-input v-model="ruleForm.shopPassword" type="password" :disabled="disabled" maxlength="16" />
@@ -301,7 +333,10 @@ export default {
     // 这里存放数据
     return {
       action: uploadUrl,
+      // 图片上传的地址
       advertisementList: [],
+      //  视频上传的地址
+      videoList: [],
       allShopCategoryList: [],
       areaData: {
         lazy: true,
@@ -339,6 +374,7 @@ export default {
       },
       disabled: false,
       ruleForm: {
+        orderSort:0,
         shopName: '', // 店铺名称
         chargePersonName: '', // 店铺负责人
         chargePersonPhone: '', // 负责人电话
@@ -359,6 +395,8 @@ export default {
         startTime: "",
         endTime: "",
         shopBrief: '', // 商家簡介
+        label: '', //主营业务
+        shopVideo:''
       },
       showPhone: false,
       showAddress: false,
@@ -409,6 +447,13 @@ export default {
           message: "请填写商家介绍",
           trigger: "blur"
         }],
+        label: [{
+          required: true,
+          message: "请填写主营业务",
+          trigger: "blur",
+        },
+        { min: 5, max: 70, message: '长度在 5 到 70 个字符', trigger: 'blur' }
+        ],
         isVoucher: [
           {
             required: true,
@@ -555,6 +600,7 @@ export default {
       this.newAddress = ''
       this.personPhone = ''
       this.ruleForm = {
+        orderSort:0,
         shopName: '', // 店铺名称
         chargePersonName: '', // 店铺负责人
         chargePersonPhone: '', // 负责人电话
@@ -572,6 +618,8 @@ export default {
         areaId: '', // 区域id
         longitude: '', // 经纬度
         latitude: '', // 经纬度
+        lable: '',
+        shopVideo:""
       }
       this.dialogVisible = true
       this.advertisementList = []
@@ -617,9 +665,16 @@ export default {
             this.$message.error('请输入生效年限')
             return
           }
+          if (submitData.label === '') {
+            this.$message.error('请输入主营业务')
+            return
+          }
 
           submitData.classificationId = submitData.classificationId[2]
           if (!this.userState) {
+            if(this.videoList.length > 0){
+              submitData.shopVideo = this.videoList.map(item => item.url).join(',')
+            }
             businessListSave(submitData).then((res) => {
               console.log(res)
               if (res.code === '') {
@@ -633,6 +688,10 @@ export default {
               this.$refs.ruleForm.clearValidate()
             })
           } else {
+            if(this.videoList.length > 0){
+              console.log(this.videoList,2222222222);
+              submitData.shopVideo = this.videoList.map(item => item.url).join(',')
+            }
             businessListUpdate(submitData).then((res) => {
               console.log(res)
               if (res.code === '') {
@@ -668,13 +727,26 @@ export default {
         this.ruleForm.voucherReturn *= 1
         const advertisementStr = this.ruleForm.advertisement
         if (advertisementStr && typeof advertisementStr === 'string') {
-          this.advertisementList = advertisementStr.split(',').map(item => {
-            return {
-              url: item,
-              uid: item + Math.random() + new Date()
-            }
-          })
-        }
+        this.advertisementList = advertisementStr.split(',').map(item => {
+          return {
+            url: item,
+            uid: item + Math.random() + new Date()
+          }
+        })
+      } else {
+        this.advertisementList = []
+      }
+      if (videoStr && typeof videoStr === 'string') {
+        this.videoList = videoStr.split(',').map(item => {
+          return {
+            url: item,
+            uid: item + Math.random() + new Date()
+          }
+        })
+      } else {
+        this.videoList = []
+      }
+
       }
     },
     // 编辑
@@ -686,12 +758,14 @@ export default {
       this.cpPhoneShow = true
       const res = await businessListGetById({ shopId: row.shopId })
       this.ruleForm = res.data
+      this.ruleForm.orderSort = row.orderSort
       this.dialogVisible = true
       this.isEdit = true
       this.originShopDetailInfo = JSON.parse(JSON.stringify(res.data))
       this.initShopClassPath(this.ruleForm.classificationId)
       this.ruleForm.voucherReturn *= 1
       const advertisementStr = this.ruleForm.advertisement
+      const videoStr = this.ruleForm.shopVideo
       if (advertisementStr && typeof advertisementStr === 'string') {
         this.advertisementList = advertisementStr.split(',').map(item => {
           return {
@@ -699,7 +773,20 @@ export default {
             uid: item + Math.random() + new Date()
           }
         })
+      } else {
+        this.advertisementList = []
+      }
+      if (videoStr && typeof videoStr === 'string') {
+        this.videoList = videoStr.split(',').map(item => {
+          return {
+            url: item,
+            uid: item + Math.random() + new Date()
+          }
+        })
+      } else {
+        this.videoList = []
       }
+
     },
     // 删除
     async del(row) {
@@ -807,6 +894,16 @@ export default {
         url, uid: url + Math.random() + Date.now()
       })
     },
+    videoSuccess(response) {
+      const { url } = response.data
+      this.videoList.push({
+        url, uid: url + Math.random() + Date.now()
+      })
+    },
+    videoRemove(e) {
+      const { uid } = e
+      this.videoList = this.videoList.filter(item => item.uid !== uid)
+    },
 
     handleRemovePic(e) {
       const { uid } = e
@@ -866,10 +963,7 @@ export default {
 }
 </script>
 
-<style
-  lang="scss"
-  scoped
->
+<style lang="scss" scoped>
 @import url("../../../styles/elDialog.scss");
 
 .pending {
@@ -887,4 +981,35 @@ export default {
 .elspan {
   margin-left: 10px;
 }
+
+video {
+  width: 150px;
+  height: 100px;
+}
+
+.upload-btn {
+  background-color: #fbfdff;
+  border: 1px dashed #c0ccda;
+  border-radius: 6px;
+  -webkit-box-sizing: border-box;
+  box-sizing: border-box;
+  width: 150px;
+  height: 100px;
+  cursor: pointer;
+  line-height: 100px;
+  vertical-align: top;
+  font-size: 28px;
+}
+.list-video{
+  display: flex;
+  gap: 20px;
+  align-items: center;
+  flex-wrap: wrap;
+}
+.list{
+  display: flex;
+  gap: 20px;
+  align-items: center;
+  flex-wrap: wrap;
+}
 </style>

+ 1 - 1
src/views/business/settlement/index.vue

@@ -115,7 +115,7 @@ export default {
         checkState: '0', // 入驻处理状态 0-未处理 1-通过 2-拒绝
         page: 1,
         pageSize: 10,
-        shopType: 2
+        shopType: 1
       },
       total: 10,
       tableData: [],

+ 1 - 1
src/views/order/pending/index.vue

@@ -40,7 +40,7 @@
             </el-select>
           </el-form-item> -->
           <el-form-item label="下单时间">
-            <el-date-picker v-model="formInline.dates" type="daterange" range-separator="至" start-placeholder="开始日期"
+            <el-date-picker model="formInline.dates" type="daterange" range-separator="至" start-placeholder="开始日期"
               end-placeholder="结束日期" />
           </el-form-item>
           <el-form-item>

+ 24 - 3
src/views/renovation/commdityClass/Edit.vue

@@ -3,9 +3,14 @@
     :close-on-click-modal="false" :title="title" :type="type" :visible.sync="isVisible"
     center width="48%"
     top="50px" class="group-dialog"
+    @close="close"
   >
     <div class="add-dialog-component">
       <el-alert :style="{ backgroundColor: '#fff' }" title="保存后将生效在移动端的分类里" type="info" :closable="false" />
+      <div class="sort">
+        <span>排序:</span>
+        <el-input type="number" :value="sort" size="mini" style="width: 100px;" @input="changeSort" />
+      </div>
       <el-tree
         class="tree-box" :data="treeData" :props="{ children: 'childs' }" node-key="id"
         default-expand-all draggable
@@ -112,6 +117,10 @@ export default {
     }
   },
   props: {
+    sort:{
+      type: Number,
+      default: 0
+    },
     dialogVisible: {
       type: Boolean,
       default: false
@@ -184,6 +193,9 @@ export default {
 		*/
   },
   methods: {
+    changeSort(e){
+      this.$emit("changeSort",e)
+    },
     async queryOneCategory(oneClassifyId) {
       console.log(oneClassifyId)
       if (oneClassifyId === undefined) {
@@ -313,7 +325,8 @@ export default {
     remove(node, data) {
       const parent = node.parent
       const children = parent.data.childs || parent.data
-      const index = children.findIndex((d) => d.idx === data.idx)
+      const index = children.findIndex((d) => d.id === data.id)
+      console.log(index,98989,children,data);
       if (index !== -1) {
         children.splice(index, 1)
         this.deleteArr.push(data.id || '')
@@ -368,8 +381,9 @@ export default {
         this.$message.error('请添加分类')
         return
       }
+      params[0].sort = this.sort
       const obj = {
-        classifies: params
+        classifies: params,
       }
       const res = await commdityClassAdd(obj)
       if (res.code === '') {
@@ -418,9 +432,10 @@ export default {
       }
       console.log(this.treeData)
       const params = this.treeData.map(treeFilter)
+      params[0].sort = this.sort
       const obj = {
         classifies: params,
-        deleteIds: this.deleteArr
+        deleteIds: this.deleteArr,
       }
       const res = await commdityClassUpdate(obj)
       if (res.code === '') {
@@ -546,4 +561,10 @@ export default {
 .upload-uploader {
 	margin-left: 30px;
 }
+.sort{
+  margin: 20px 0;
+  display: flex;
+  align-items: center;
+  gap: 20px;
+}
 </style>

+ 10 - 2
src/views/renovation/commdityClass/index.vue

@@ -8,6 +8,7 @@
       :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" :tree-props="{ children: 'childs' }"
     >
       <el-table-column prop="classifyName" label="商品类别" />
+      <el-table-column prop="sort" label="类别排序" />
       <el-table-column prop="status" label="操作">
         <template slot-scope="scope">
           <el-button type="text" @click.native.prevent="checkRow(scope.row)">查看</el-button>
@@ -24,8 +25,8 @@
       />
     </div>
     <EditDialog
-      ref="edit" :dialog-visible="dialog.isVisible" :type="dialog.type" @close="editClose"
-      @success="getProductCategory"
+      ref="edit" :dialog-visible="dialog.isVisible" :type="dialog.type" :sort="sort" @close="editClose"
+      @success="getProductCategory" @changeSort="changeSort"
     />
   </div>
 </template>
@@ -42,6 +43,8 @@ export default {
   },
   data() {
     return {
+      //  排序
+      sort:0,
       dialogVisible: false,
       formParams: {
         page: 1,
@@ -61,6 +64,9 @@ export default {
     this.getAll(this.formParams)
   },
   methods: {
+    changeSort(num){
+      this.sort =  Number(num)
+    },
     handleSizeChange(val) {
       this.formParams.pageSize = val
       this.getAll(this.formParams)
@@ -83,10 +89,12 @@ export default {
       this.$refs.edit.setParams({ treeData: [] })
     },
     editClose() {
+      this.sort = 0
       this.dialog.isVisible = false
     },
     // 编辑
     updateRow(row) {
+      this.sort = row.sort || 0
       const id = row.classifyId
       this.dialog = {
         type: 'edit',

+ 3 - 3
vue.config.js

@@ -42,7 +42,7 @@ module.exports = {
     proxy: {
       '/api': {
         // target: 'http://192.168.0.91:9007', // 测试
-        target: 'http://192.168.0.91:9007', // 平台端
+        target: 'https://mtradminapitest.tfcliao.com', // 平台端
         // target: 'http://192.168.0.91:9007', // 商家端
         changeOrigin: true,
         pathRewrite: {
@@ -51,7 +51,7 @@ module.exports = {
       },
       '/adminapi': {
         // target: 'http://192.168.0.91:9007', // 测试
-        target: 'http://192.168.0.91:9007', // 平台端
+        target: 'http://192.168.0.91:9203', // 平台端
         // target: 'http://192.168.0.91:9007', // 商家端
         changeOrigin: true,
         pathRewrite: {
@@ -60,7 +60,7 @@ module.exports = {
       },
       '/': {
         // target: 'http://192.168.0.91:9007', // 测试
-        target: 'http://192.168.0.91:9007', // 平台端
+        target: 'http://192.168.0.91:9203', // 平台端
         // target: 'http://192.168.0.91:9007', // 商家端
         changeOrigin: true
       }