panhui 7 лет назад
Родитель
Сommit
eb450fe10d

+ 112 - 105
src/main/vue/src/components/SingleUpload.vue

@@ -1,10 +1,5 @@
 <template>
-    <el-upload
-        class="single-upload"
-        :action="url"
-        :show-file-list="false"
-        :on-success="onSuccess"
-        :before-upload="beforeUpload">
+    <el-upload class="single-upload" :action="url" :show-file-list="false" :on-success="onSuccess" :before-upload="beforeUpload">
         <div></div>
         <div class="wrapper">
             <img v-if="imageUrl" :src="imageUrl" class="avatar">
@@ -17,122 +12,134 @@
     </el-upload>
 </template>
 <script>
-    import {imageUrlPrefix} from '../config'
+import { imageUrlPrefix } from '../config'
 
-    const baseUrl = process.env.NODE_ENV === 'production' ? '../' : 'http://localhost:8080';
-    export default {
-        created() {
-            this.updateImageUrl(this.value);
+const baseUrl = process.env.NODE_ENV === 'production' ? '../' : 'http://localhost:8080';
+export default {
+    created() {
+        this.updateImageUrl(this.value);
+    },
+    props: {
+        value: String,
+        usePrefix: {
+            type: Boolean,
+            default: true
         },
-        props: {
-            value: String,
-            usePrefix: {
-                type: Boolean,
-                default: true
-            },
-            prefix: {
-                type: String,
-                default: imageUrlPrefix
-            },
-            url: {
-                type: String,
-                default: baseUrl + '/assets/uploadFile'
+        prefix: {
+            type: String,
+            default: imageUrlPrefix
+        },
+        url: {
+            type: String,
+            default: baseUrl + '/assets/uploadFile'
+        },
+        maxSize: {
+            type: Number,
+            default: 0
+        }
+    },
+    data() {
+        return {
+            imageUrl: '',
+            loading: false
+        };
+    },
+    methods: {
+        onSuccess(res, file) {
+            this.loading = false;
+            this.imageUrl = URL.createObjectURL(file.raw);
+            var newVal = '';
+            if (res.data instanceof Array) {
+                newVal = res.data[0];
+            } else {
+                newVal = res.data;
             }
+            this.$emit('input', newVal);
         },
-        data() {
-            return {
-                imageUrl: '',
-                loading: false
-            };
+        onError(err, file, fileList) {
+            this.loading = false;
         },
-        methods: {
-            onSuccess(res, file) {
-                this.loading = false;
-                this.imageUrl = URL.createObjectURL(file.raw);
-                var newVal = '';
-                if (res.data instanceof Array) {
-                    newVal = res.data[0];
-                } else {
-                    newVal = res.data;
-                }
-                this.$emit('input', newVal);
-            },
-            onError(err, file, fileList) {
-                this.loading = false;
-            },
-            beforeUpload(file) {
-                this.loading = true;
-                return true;
-            },
-            updateImageUrl(url) {
-                if (this.usePrefix && url && url.indexOf(this.prefix) === -1 && url.indexOf('http') === -1) {
-                    this.imageUrl = this.prefix + url;
-                } else {
-                    this.imageUrl = url;
+        beforeUpload(file) {
+             if (this.maxSize) {
+                if (file.size > this.maxSize) {
+                    this.$message({
+                        type: 'warning',
+                        message: '为了更好的展示体验,图片大小应控制在5M以内。'
+                    });
+                    return false
                 }
             }
+            this.loading = true;
+            return true;
         },
-        watch: {
-            value(val) {
-                this.updateImageUrl(val);
+        updateImageUrl(url) {
+            if (this.usePrefix && url && url.indexOf(this.prefix) === -1 && url.indexOf('http') === -1) {
+                this.imageUrl = this.prefix + url;
+            } else {
+                this.imageUrl = url;
             }
         }
+    },
+    watch: {
+        value(val) {
+            this.updateImageUrl(val);
+        }
     }
+}
 </script>
 <style lang="less" scoped>
-    .avatar-uploader-icon {
-        font-size: 28px;
-        color: #8c939d;
-        width: 178px;
-        height: 178px;
-        line-height: 178px;
-        text-align: center;
-        border: 1px dashed #d9d9d9;
-        border-radius: 6px;
-        cursor: pointer;
-        position: relative;
-        overflow: hidden;
-        background-color: #fbfdff;
-        &:hover {
-            border-color: #409EFF;
-        }
+.avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 178px;
+    height: 178px;
+    line-height: 178px;
+    text-align: center;
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    background-color: #fbfdff;
+    &:hover {
+        border-color: #409eff;
     }
+}
 
-    .avatar {
-        width: 178px;
-        height: 178px;
-        display: block;
-        border: 1px dashed #d9d9d9;
-        border-radius: 6px;
-        cursor: pointer;
-        position: relative;
-        overflow: hidden;
-        &:hover {
-            border-color: #409EFF;
-        }
+.avatar {
+    width: 178px;
+    height: 178px;
+    display: block;
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    &:hover {
+        border-color: #409eff;
     }
+}
 
-    .wrapper {
-        position: relative;
-    }
+.wrapper {
+    position: relative;
+}
 
-    .single-upload .el-upload {
-        position: relative;
-    }
-
-    .loading {
-        position: absolute;
-        top: 0;
-        bottom: 0;
-        left: 0;
-        right: 0;
-        margin: auto;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        background: rgba(255, 255, 255, 0.6);
-        color: #333;
-        font-size: 24px;
-    }
+.single-upload .el-upload {
+    position: relative;
+}
 
+.loading {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    margin: auto;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background: rgba(255, 255, 255, 0.6);
+    color: #333;
+    font-size: 24px;
+}
 </style>

+ 13 - 4
src/main/vue/src/components/SingleUploadTitle.vue

@@ -61,6 +61,10 @@ export default {
         needName: {
             type: String,
             default: ''
+        },
+        maxSize: {
+            type: Number,
+            default: 0
         }
     },
     data() {
@@ -113,10 +117,15 @@ export default {
             }
 
 
-
-
-
-
+            if (this.maxSize) {
+                if (file.size > this.maxSize) {
+                    this.$message({
+                        type: 'warning',
+                        message: '为了更好的展示体验,图片大小应控制在5M以内。'
+                    });
+                    return false
+                }
+            }
             this.loading = true;
             this.$emit('start')
             return true;

+ 4 - 4
src/main/vue/src/pagesPre/OrderExamine.vue

@@ -47,9 +47,9 @@
             <el-pagination style="padding:0 0 20px" background :page-size="7" @current-change="currentPageChange" :current-page="currentPage" layout="total, prev, pager, next" :total="totalNumber">
             </el-pagination>
 
-            <!-- <div class="bottom">
+            <div class="bottom">
                 <el-button type="warning" v-if="!isChange" plain @click="goShare">他人审片</el-button>
-            </div> -->
+            </div>
         </template>
 
     </div>
@@ -411,11 +411,11 @@ export default {
             if (this.$route.query.repairId) {
                 repair = '&repairId=' + this.$route.query.repairId
             }
-            this.$alert('点击确定转到下列分享链接:<br/> http://localhost:8081/index.html#/OrderExamineShare?orderId=' + this.$route.query.orderId + repair, '分享链接', {
+            this.$alert('点击确定转到下列分享链接:<br/> https://www.tutuxiang.com/index#/OrderExamineShare?orderId=' + this.$route.query.orderId + repair, '分享链接', {
                 confirmButtonText: '确定',
                 dangerouslyUseHTMLString: true,
                 callback: action => {
-                    window.open('http://localhost:8081/index.html#/OrderExamineShare?orderId=' + this.$route.query.orderId + repair)
+                    window.open('https://www.tutuxiang.com/index#/OrderExamineShare?orderId=' + this.$route.query.orderId + repair)
                 }
             });
         }

+ 4 - 0
src/main/vue/src/pagesPre/OrderExamineShare.vue

@@ -95,6 +95,10 @@ export default {
 
                 }
 
+                if (this.statusFlag != 3 && this.statusFlag != 4) {
+                    this.isFinish = true
+                }
+
                 if (this.isFinish) {
                     this.$alert('该阶段审核已经结束', '审核结束', {
                         confirmButtonText: '确定',

+ 2 - 2
src/main/vue/src/pagesPre/PayOrder.vue

@@ -28,12 +28,12 @@
                 <el-radio v-model="payStyle" label="支付宝">
                     <img style="width:88px;height:30px;margin-left:14px;" src="../assetsPre/pay1.png" alt="">
                 </el-radio>
-                <el-radio v-model="payStyle" label="微信">
+                <!-- <el-radio v-model="payStyle" label="微信">
                     <img style="width:125px;height:43px;margin-left:8px;" class="payIcon" src="../assetsPre/pay2.png" alt="">
                 </el-radio>
                 <el-radio v-model="payStyle" label="银联">
                     <img style="width:150px;height:39px;margin-left:8px;" class="payIcon" src="../assetsPre/pay3.png" alt="">
-                </el-radio>
+                </el-radio> -->
             </template>
         </div>
 

+ 2 - 2
src/main/vue/src/pagesPre/ProductInfo.vue

@@ -42,8 +42,8 @@
                 <el-input v-model="formData.title" :disabled="'title'==subColumn"></el-input>
             </el-form-item>
             <el-form-item prop="image" label="商品主图">
-                <single-upload v-model="formData.image" :disabled="'image'==subColumn"></single-upload>
-                <span style="color:#999;font-size:12px;">最佳尺寸 352*200</span>
+                <single-upload :maxSize='5120000' v-model="formData.image" :disabled="'image'==subColumn"></single-upload>
+                <span style="color:#999;font-size:12px;">最佳尺寸 352*200 大小5M以内</span>
             </el-form-item>
             <el-form-item prop="serviceDetail" label="服务详情" style="max-width:400px">
                 <el-input type="textarea" v-model="formData.serviceDetail" :disabled="'serviceDetail'==subColumn"></el-input>

+ 11 - 6
src/main/vue/src/pagesPre/SetStoreInfo.vue

@@ -41,8 +41,8 @@
             <el-input type="textarea" :rows="2" v-model="formData.description" maxlength="30" style="width:320px;" :disabled="'description'==subColumn" placeholder="请输入店铺简介(30字以内)"></el-input>
         </el-form-item>
         <el-form-item prop="icon" label="店铺头像">
-            <single-upload-title v-model="formData.icon" :width='200' :height='125' :title="'添加头像'" :disabled="'icon'==subColumn"></single-upload-title>
-            <div style="font-size:12px;color:rgba(153,153,153,1);">注:格式jpg/jpeg/png,大小不超过10M,建议尺寸360*280</div>
+            <single-upload-title v-model="formData.icon" :maxSize='5120000' :width='200' :height='125' :title="'添加头像'" :disabled="'icon'==subColumn"></single-upload-title>
+            <div style="font-size:12px;color:rgba(153,153,153,1);">注:格式jpg/jpeg/png,大小不超过5M,建议尺寸360*280</div>
         </el-form-item>
         <el-form-item prop="address" label="经营地址">
             <el-cascader :options="cityData" placeholder="省/市/区" :props='{value:"name",label:"name"}' v-model="formData.address">
@@ -63,8 +63,8 @@
 
         <el-form-item>
 
-            <el-button v-if="nowStyle=='商家店铺'" @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
-            <el-button v-else @click="onSave" style='width:320px;' :loading="$store.state.fetchingData" type="primary">下一步</el-button>
+            <el-button v-if="nowStyle=='商家店铺'" @click="onSave" :loading="loading" type="primary">保存</el-button>
+            <el-button v-else @click="onSave" style='width:320px;' :loading="loading" type="primary">下一步</el-button>
 
         </el-form-item>
     </el-form>
@@ -217,7 +217,8 @@ export default {
             serviceTypes: [],
             serviceTypeDetails: {},
             storeLabels: [],
-            creditList: []
+            creditList: [],
+            loading: false
         }
     },
     computed: {
@@ -247,15 +248,19 @@ export default {
             if (!data.credit) {
                 data.credit = this.creditList[0].credit
             }
-
+            this.loading = true
             this.$http.post({
                 url: this.formData.id ? '/storeInfo/update' : '/storeInfo/save',
                 data: data
             }).then(res => {
+                this.loading = false
                 if (res.success) {
                     this.$message.success('成功');
                     if (this.nowStyle == '商家店铺') {
 
+                        if (!this.formData.id) {
+                            this.formData.id = res.data
+                        }
 
                         this.$http.get({
                             url: '/storeInfo/getOne',