Browse Source

修改bug

cr 4 years ago
parent
commit
ec4f656fd6

+ 1 - 1
src/common/store/user.js

@@ -49,7 +49,7 @@ const module = {
49 49
 
50 50
         // 退出登录处理
51 51
         logout(state) {
52
-            state.user = data.user || null
52
+            state.user = null
53 53
             state.token =  ''
54 54
             state.tokenExpires =  ''
55 55
             state.openId = '';

+ 2 - 2
src/components/share/index.vue

@@ -14,14 +14,14 @@
14 14
       </div>
15 15
       <div class="c-share__division">分享</div>
16 16
       <ul class="c-list">
17
-        <li class="c-list__item">
17
+        <!-- <li class="c-list__item">
18 18
           <button class="button" open-type="share">
19 19
             <div class="c-list__content">
20 20
               <img class="c-list__icon" src="/static/share/icon_2.jpg" alt />
21 21
               <div class="c-list__text">发送给微信好友</div>
22 22
             </div>
23 23
           </button>
24
-        </li>
24
+        </li> -->
25 25
         <li class="c-list__item" @click="share('single')">
26 26
           <div class="c-list__content">
27 27
             <img class="c-list__icon" src="/static/share/icon_3.jpg" alt />

+ 0 - 1
src/pages/index/index.vue

@@ -367,7 +367,6 @@ export default {
367 367
         // }
368 368
         self.fn.shareMenu();
369 369
         self.tab = this.$store.state.common.tabIndex;
370
-        console.log(1);
371 370
         this.getList();
372 371
     },
373 372
 

+ 1 - 1
src/pages/index/login.vue

@@ -11,7 +11,7 @@
11 11
                 />
12 12
             </div>
13 13
             <div class="inp-box">
14
-                <input type="password" name="code" maxlength="6" v-model="password" placeholder="请输入密码" />
14
+                <input type="password" name="password" v-model="password" placeholder="请输入密码" />
15 15
             </div>
16 16
             <button class="btn" @click="submit">确定</button>
17 17
         </div>

+ 1 - 0
src/pages/index/select.vue

@@ -3,6 +3,7 @@
3 3
         <div class="shop-select">
4 4
             <ul class="list">
5 5
                 <li
6
+                    v-if="entry ===''"
6 7
                     class="item"
7 8
                     @click="shopClick({})"
8 9
                     :class="{ on: !curShop.id }"

+ 25 - 26
src/pages/manage/add-good-form.vue

@@ -57,18 +57,13 @@
57 57
                     <input type="text" v-model="baseInfo.name" />
58 58
                 </div>
59 59
             </section>
60
-
61 60
             <section class="form-item">
62 61
                 <div class="label">
63 62
                     <span class="required hide">*</span>
64
-                    商品描述
63
+                    初始销量
65 64
                 </div>
66 65
                 <div class="box">
67
-                    <textarea
68
-                        v-model="baseInfo.description"
69
-                        :maxlength="1048"
70
-                        :auto-height="true"
71
-                    ></textarea>
66
+                    <input type="number" v-model="baseInfo.initialSale" />
72 67
                 </div>
73 68
             </section>
74 69
 
@@ -222,26 +217,26 @@
222 217
                 </div>
223 218
             </section>
224 219
             <section class="form-img-item">
225
-                <div class="tit"><span class="required">*</span>主图</div>
220
+                <div class="tit">
221
+                    <span class="required">*</span>详情图
222
+                </div>
226 223
                 <div class="list">
227 224
                     <easy-upload
228 225
                         :types="'image'"
229
-                        v-model="mainImage"
230
-                        :uploadCount="1"
231
-                        @change="minImgChange"
226
+                        v-model="productForm.detailImages"
227
+                        :uploadCount="100"
228
+                        @change="detailImagesChange"
232 229
                     ></easy-upload>
233 230
                 </div>
234 231
             </section>
235 232
             <section class="form-img-item">
236
-                <div class="tit">
237
-                    <span class="required hide">*</span>详情图
238
-                </div>
233
+                <div class="tit"><span class="required hide">*</span>主图</div>
239 234
                 <div class="list">
240 235
                     <easy-upload
241 236
                         :types="'image'"
242
-                        v-model="productForm.detailImages"
243
-                        :uploadCount="100"
244
-                        @change="detailImagesChange"
237
+                        v-model="mainImage"
238
+                        :uploadCount="1"
239
+                        @change="minImgChange"
245 240
                     ></easy-upload>
246 241
                 </div>
247 242
             </section>
@@ -296,10 +291,14 @@
296 291
                 <section class="form-item">
297 292
                     <div class="label">
298 293
                         <span class="required hide">*</span>
299
-                        初始销量
294
+                        商品描述
300 295
                     </div>
301 296
                     <div class="box">
302
-                        <input type="number" v-model="baseInfo.initialSale" />
297
+                        <textarea
298
+                            v-model="baseInfo.description"
299
+                            :maxlength="1048"
300
+                            :auto-height="true"
301
+                        ></textarea>
303 302
                     </div>
304 303
                 </section>
305 304
                 <section class="form-item">
@@ -382,7 +381,7 @@ export default {
382 381
             supplierList: ["测试供应商"], // 供应商
383 382
             storeList: [], // 店铺列表
384 383
             cateList: [], // 分类列表
385
-            showOther: true, // 显示其他
384
+            showOther: false, // 显示其他
386 385
 
387 386
             barCodeData: {}, // 条码扫描数据
388 387
 
@@ -754,11 +753,11 @@ export default {
754 753
                     type: "array",
755 754
                     msg: "请上传封面图",
756 755
                 },
757
-                // {
758
-                //     key: "detailImages",
759
-                //     type: "array",
760
-                //     msg: "请上传详情图",
761
-                // },
756
+                {
757
+                    key: "detailImages",
758
+                    type: "array",
759
+                    msg: "请上传详情图",
760
+                }
762 761
             ];
763 762
 
764 763
             for (let item of requiredFile1) {
@@ -1022,7 +1021,7 @@ button::before {
1022 1021
     font-size: px(50);
1023 1022
     border: none;
1024 1023
     width: 50%;
1025
-    &~.btn{
1024
+    & ~ .btn {
1026 1025
         border-left: 1px solid #999;
1027 1026
     }
1028 1027
 }

+ 27 - 25
src/pages/manage/edit-good-form.vue

@@ -57,18 +57,13 @@
57 57
                     <input type="text" v-model="baseInfo.name" />
58 58
                 </div>
59 59
             </section>
60
-
61 60
             <section class="form-item">
62 61
                 <div class="label">
63 62
                     <span class="required hide">*</span>
64
-                    商品描述
63
+                    初始销量
65 64
                 </div>
66 65
                 <div class="box">
67
-                    <textarea
68
-                        v-model="baseInfo.description"
69
-                        :maxlength="1048"
70
-                        :auto-height="true"
71
-                    ></textarea>
66
+                    <input type="number" v-model="baseInfo.initialSale" />
72 67
                 </div>
73 68
             </section>
74 69
 
@@ -222,26 +217,26 @@
222 217
                 </div>
223 218
             </section>
224 219
             <section class="form-img-item">
225
-                <div class="tit"><span class="required">*</span>主图</div>
220
+                <div class="tit">
221
+                    <span class="required ">*</span>详情图
222
+                </div>
226 223
                 <div class="list">
227 224
                     <easy-upload
228 225
                         :types="'image'"
229
-                        v-model="mainImage"
230
-                        :uploadCount="1"
231
-                        @change="minImgChange"
226
+                        v-model="productForm.detailImages"
227
+                        :uploadCount="100"
228
+                        @change="detailImagesChange"
232 229
                     ></easy-upload>
233 230
                 </div>
234 231
             </section>
235 232
             <section class="form-img-item">
236
-                <div class="tit">
237
-                    <span class="required hide">*</span>详情图
238
-                </div>
233
+                <div class="tit"><span class="required hide">*</span>主图</div>
239 234
                 <div class="list">
240 235
                     <easy-upload
241 236
                         :types="'image'"
242
-                        v-model="productForm.detailImages"
243
-                        :uploadCount="100"
244
-                        @change="detailImagesChange"
237
+                        v-model="mainImage"
238
+                        :uploadCount="1"
239
+                        @change="minImgChange"
245 240
                     ></easy-upload>
246 241
                 </div>
247 242
             </section>
@@ -293,13 +288,18 @@
293 288
                         </radio-group>
294 289
                     </div>
295 290
                 </section>
291
+
296 292
                 <section class="form-item">
297 293
                     <div class="label">
298 294
                         <span class="required hide">*</span>
299
-                        初始销量
295
+                        商品描述
300 296
                     </div>
301 297
                     <div class="box">
302
-                        <input type="number" v-model="baseInfo.initialSale" />
298
+                        <textarea
299
+                            v-model="baseInfo.description"
300
+                            :maxlength="1048"
301
+                            :auto-height="true"
302
+                        ></textarea>
303 303
                     </div>
304 304
                 </section>
305 305
                 <section class="form-item">
@@ -382,7 +382,7 @@ export default {
382 382
             supplierList: ["测试供应商"], // 供应商
383 383
             storeList: [], // 店铺列表
384 384
             cateList: [], // 分类列表
385
-            showOther: true, // 显示其他
385
+            showOther: false, // 显示其他
386 386
 
387 387
             barCodeData: {}, // 条码扫描数据
388 388
 
@@ -515,10 +515,12 @@ export default {
515 515
                         }
516 516
                     }
517 517
                 }
518
-                arr.push({
519
-                    id: curId,
520
-                    name: nameStr,
521
-                });
518
+                if (nameStr) {
519
+                    arr.push({
520
+                        id: curId,
521
+                        name: nameStr,
522
+                    });
523
+                }
522 524
             }
523 525
             if (arr.length) {
524 526
                 this.typeList = arr;
@@ -1040,7 +1042,7 @@ radio-group {
1040 1042
     font-size: px(50);
1041 1043
     border: none;
1042 1044
     width: 100%;
1043
-    &~.btn{
1045
+    & ~ .btn {
1044 1046
         border-left: 1px solid #999;
1045 1047
     }
1046 1048
 }

+ 139 - 149
src/pages/manage/good-list.vue

@@ -167,35 +167,36 @@
167 167
                                     v-for="(item, index) in goodsList"
168 168
                                     :key="index"
169 169
                                 >
170
-                                    <my-image
171
-                                        class="goods__img"
172
-                                        :src="item.mainImage"
173
-                                        @click="edit(item)"
174
-                                    ></my-image>
175
-                                    <div class="goods__info">
176
-                                        <div class="goods__box">
177
-                                            <div
178
-                                                class="goods__title"
179
-                                                @click="edit(item)"
180
-                                            >
181
-                                                {{ item.name }}
182
-                                            </div>
183
-                                            <div
184
-                                                class="goods__sale"
185
-                                                @click="edit(item)"
186
-                                            >
187
-                                                <span v-if="item.price">
188
-                                                    价格:¥{{
189
-                                                        item.price / 100
190
-                                                    }}
191
-                                                </span>
192
-
193
-                                                <span v-if="item.stock">
194
-                                                    库存:{{ item.stock }}
195
-                                                </span>
170
+                                    <div class="main">
171
+                                        <my-image
172
+                                            class="goods__img"
173
+                                            :src="item.mainImage"
174
+                                            @click="edit(item)"
175
+                                        ></my-image>
176
+                                        <div class="goods__info">
177
+                                            <div class="goods__box">
178
+                                                <div
179
+                                                    class="goods__title"
180
+                                                    @click="edit(item)"
181
+                                                >
182
+                                                    {{ item.name }}
183
+                                                </div>
184
+                                                <div
185
+                                                    class="goods__sale"
186
+                                                    @click="edit(item)"
187
+                                                >
188
+                                                    <span v-if="item.price">
189
+                                                        价格:¥{{
190
+                                                            item.price / 100
191
+                                                        }}
192
+                                                    </span>
193
+
194
+                                                    <span v-if="item.stock">
195
+                                                        库存:{{ item.stock }}
196
+                                                    </span>
197
+                                                </div>
196 198
                                             </div>
197
-                                        </div>
198
-                                        <!-- <div
199
+                                            <!-- <div
199 200
                                             class="goods__price"
200 201
                                             @click="edit(item)"
201 202
                                         >
@@ -209,50 +210,42 @@
209 210
                                                 库存:{{ "¥" + item.stock }}
210 211
                                             </div>
211 212
                                         </div> -->
212
-                                        <!-- 登录 -->
213
-                                        <div class="btns">
214
-                                            <button class="button">
215
-                                                <div
216
-                                                    class="goods__add-text"
217
-                                                    @click="share(item)"
218
-                                                >
219
-                                                    分享
220
-                                                </div>
221
-                                            </button>
222
-                                            <button class="button">
223
-                                                <div
224
-                                                    class="goods__add-text"
225
-                                                    @click="setPrice(item)"
226
-                                                >
227
-                                                    改价
228
-                                                </div>
229
-                                            </button>
230
-                                            <button
231
-                                                class="button"
232
-                                                @click="setStock(item)"
233
-                                            >
234
-                                                <div class="goods__add-text">
235
-                                                    改库存
236
-                                                </div>
237
-                                            </button>
238
-                                            <button
239
-                                                class="button"
240
-                                                v-if="item.status === 0"
241
-                                                @click="setStatus(item, 1)"
242
-                                            >
243
-                                                <div class="goods__add-text">
244
-                                                    上架
245
-                                                </div>
246
-                                            </button>
247
-                                            <button
248
-                                                class="button"
249
-                                                v-if="item.status === 1"
250
-                                                @click="setStatus(item, 0)"
251
-                                            >
252
-                                                <div class="goods__add-text">
253
-                                                    下架
254
-                                                </div>
255
-                                            </button>
213
+                                            <!-- 登录 -->
214
+                                        </div>
215
+                                    </div>
216
+
217
+                                    <div class="btns">
218
+                                        <div
219
+                                            class="btn"
220
+                                            @click="share(item)"
221
+                                        >
222
+                                            {{item.shareLoading?'生成中':'海报'}}
223
+                                        </div>
224
+                                        <div
225
+                                            class="btn"
226
+                                            @click="setPrice(item)"
227
+                                        >
228
+                                            改价
229
+                                        </div>
230
+                                        <div
231
+                                            class="btn"
232
+                                            @click="setStock(item)"
233
+                                        >
234
+                                            改库存
235
+                                        </div>
236
+                                        <div
237
+                                            class="btn"
238
+                                            v-if="item.status === 0"
239
+                                            @click="setStatus(item, 1)"
240
+                                        >
241
+                                            上架
242
+                                        </div>
243
+                                        <div
244
+                                            class="btn"
245
+                                            v-if="item.status === 1"
246
+                                            @click="setStatus(item, 0)"
247
+                                        >
248
+                                            下架
256 249
                                         </div>
257 250
                                     </div>
258 251
                                 </li>
@@ -325,7 +318,6 @@
325 318
         </div>
326 319
 
327 320
         <my-share ref="share" @share="saveImage"></my-share>
328
-        <img src="/static/share/avatar.png" style="display:none" alt="">
329 321
     </div>
330 322
 </template>
331 323
 
@@ -676,18 +668,33 @@ export default {
676 668
             }
677 669
         },
678 670
 
671
+        shareLoading(id,status){
672
+            for(let item of this.goodsList){
673
+                if(item.id === id){
674
+                    item.shareLoading = status;
675
+                }
676
+            }
677
+            this.goodsList = [...this.goodsList];
678
+        },
679
+
679 680
         // 分享
680 681
         share(val) {
682
+            if(val.shareLoading){
683
+                return;
684
+            }
681 685
             const self = this;
682
-            uni.showLoading({
683
-                title: "加载中...",
684
-            });
686
+            this.shareLoading(val.id,true);
687
+            // uni.showLoading({
688
+            //     title: "加载中...",
689
+            //     mask:true
690
+            // });
685 691
             this.api.get("/Product/Detail", { id: val.id }).then((res) => {
686 692
                 this.shareGood = res.data;
687
-                uni.hideLoading();
688
-                self.$refs.share.open("", "", "", () => {
689
-                    self.canvasShow = false;
690
-                });
693
+                // uni.hideLoading();
694
+                // self.$refs.share.open("", "", "", () => {
695
+                //     self.canvasShow = false;
696
+                // });
697
+                this.saveImage('single');
691 698
             });
692 699
         },
693 700
         // 获取换算成画布使用的像素
@@ -703,14 +710,16 @@ export default {
703 710
             const self = this;
704 711
             const ctx = uni.createCanvasContext("canvas", self);
705 712
 
706
-            uni.showLoading({
707
-                title: "正在生成海报",
708
-            });
713
+            // uni.showLoading({
714
+            //     title: "正在生成海报",
715
+            //     mask:true
716
+            // });
709 717
             return new Promise((resolve) => {
710 718
                 self.router.getScene(self.$mp.query).then((res) => {
711 719
                     Promise.all([
712 720
                         uni.getImageInfo({
713
-                            src: this.user.acatar || '/static/share/avatar.png',
721
+                            src: this.user.avatar || (self.config.imageResourceUrl +
722
+                                "images/common/avatar.png"),
714 723
                         }),
715 724
                         uni.getImageInfo({
716 725
                             src: self.shareGood.baseInfo.mainImage,
@@ -718,11 +727,11 @@ export default {
718 727
                         // 获取小程序吗
719 728
                         self.api
720 729
                             .get("/Share/GetQRCode", {
721
-                                path: 'pages/goods/detail',
730
+                                path: "pages/goods/detail",
722 731
                                 paremeters: JSON.stringify({
723
-                                    goodsId:self.shareGood.baseInfo.id
732
+                                    goodsId: self.shareGood.baseInfo.id,
733
+                                    storeId:self.shareGood.baseInfo.storeId
724 734
                                 }),
725
-                                
726 735
                             })
727 736
                             .then((res) => {
728 737
                                 return uni.getImageInfo({
@@ -848,14 +857,14 @@ export default {
848 857
                         ctx.draw();
849 858
 
850 859
                         self.canvasShow = true;
851
-                        uni.hideLoading();
860
+                        // uni.hideLoading();
852 861
                         setTimeout(() => {
853 862
                             // 生成临时路径
854 863
                             uni.canvasToTempFilePath({
855 864
                                 canvasId: "canvas",
856 865
                                 fileType: "jpg",
857 866
                                 success: function (res) {
858
-                                    // self.canvasShow = false
867
+                                    self.canvasShow = false
859 868
                                     self.canvasImgPath = [res.tempFilePath];
860 869
                                     resolve(res.tempFilePath);
861 870
                                 },
@@ -889,7 +898,8 @@ export default {
889 898
                 self.router.getScene(self.$mp.query).then((res) => {
890 899
                     Promise.all([
891 900
                         uni.getImageInfo({
892
-                            src: this.user.acatar || '/static/share/avatar.png',
901
+                            src: this.user.avatar || (self.config.imageResourceUrl +
902
+                                "images/common/avatar.png"),
893 903
                         }),
894 904
                         uni.getImageInfo({
895 905
                             src: url,
@@ -902,11 +912,11 @@ export default {
902 912
                         // 获取小程序吗
903 913
                         self.api
904 914
                             .get("/Share/GetQRCode", {
905
-                                path: 'pages/goods/detail',
915
+                                path: "pages/goods/detail",
906 916
                                 paremeters: JSON.stringify({
907
-                                    goodsId:self.shareGood.baseInfo.id
917
+                                    goodsId: self.shareGood.baseInfo.id,
918
+                                    storeId:self.shareGood.baseInfo.storeId
908 919
                                 }),
909
-                                
910 920
                             })
911 921
                             .then((res) => {
912 922
                                 return uni.getImageInfo({
@@ -1013,7 +1023,7 @@ export default {
1013 1023
         // 保存图片到相册
1014 1024
         async saveImage(type) {
1015 1025
             const self = this;
1016
-
1026
+            const good = this.shareGood;
1017 1027
             if (type === "single" && !self.canvasHandleStatus) {
1018 1028
                 // 分享图
1019 1029
                 self.canvasHandleStatus = true;
@@ -1035,6 +1045,8 @@ export default {
1035 1045
                                     if (res.confirm) {
1036 1046
                                         self.canvasHandleStatus = false;
1037 1047
                                         self.fn.openSetting();
1048
+                                    }else{
1049
+                                        self.shareLoading(good.baseInfo.id,false);
1038 1050
                                     }
1039 1051
                                 });
1040 1052
                         } else {
@@ -1044,9 +1056,11 @@ export default {
1044 1056
                                 uni.saveImageToPhotosAlbum({
1045 1057
                                     filePath: res,
1046 1058
                                     success: function () {
1047
-                                        self.fn.showToast("保存成功");
1059
+                                        self.shareLoading(good.baseInfo.id,false);
1060
+                                        self.fn.showToast("海报保存成功");
1048 1061
                                     },
1049 1062
                                     complete: function () {
1063
+                                        self.shareLoading(good.baseInfo.id,false);
1050 1064
                                         self.canvasHandleStatus = false;
1051 1065
                                     },
1052 1066
                                 });
@@ -1391,18 +1405,23 @@ page {
1391 1405
         display: flex;
1392 1406
         flex-wrap: wrap;
1393 1407
         justify-content: space-between;
1394
-        padding: px(35) px(35) 0 px(60);
1408
+        padding: px(35) 0 0 0;
1395 1409
         background-color: #fff;
1396 1410
         border-top: 1px solid #f6f6f6;
1397 1411
     }
1398 1412
 
1399 1413
     &__item {
1400 1414
         width: 100%;
1401
-        padding-bottom: px(100);
1415
+        margin-bottom: px(60);
1416
+        border-bottom: 1px solid #f1f1f1;
1417
+    }
1418
+    .main {
1419
+        width: 100%;
1402 1420
         overflow: hidden;
1403 1421
         // border-radius: px(20) px(20) 0 0;
1404 1422
         display: flex;
1405 1423
         justify-content: space-between;
1424
+        padding: 0 px(35);
1406 1425
     }
1407 1426
 
1408 1427
     &__img {
@@ -1475,19 +1494,29 @@ page {
1475 1494
     }
1476 1495
     .btns {
1477 1496
         overflow: visible;
1478
-        position: absolute;
1479
-        bottom: 0;
1480
-        right: 0;
1481
-        z-index: 1;
1497
+        // position: absolute;
1498
+        // bottom: 0;
1499
+        // right: 0;
1500
+        // z-index: 1;
1501
+        width: 100%;
1482 1502
         display: flex;
1483 1503
         align-items: center;
1484 1504
         max-width: 100%;
1485
-        .button {
1486
-            margin-left: px(20);
1487
-        }
1505
+        border-top: 1px solid #f1f1f1;
1506
+        margin-top: px(20);
1488 1507
     }
1489
-    .button {
1490
-        // padding: px(30) px(10) px(10) px(30);
1508
+    .btn {
1509
+        width: 25%;
1510
+        height: px(100);
1511
+        line-height: px(100);
1512
+        // background-color: #27a34f;
1513
+        color: #333;
1514
+        font-size: px(40);
1515
+        padding: 0 px(20);
1516
+        text-align: center;
1517
+        &~.btn{
1518
+            border-left: 1px solid #f1f1f1;
1519
+        }
1491 1520
     }
1492 1521
     .cart-num {
1493 1522
         // padding: px(30) px(10) px(10) px(30);
@@ -1503,44 +1532,6 @@ page {
1503 1532
         z-index: 1;
1504 1533
     }
1505 1534
 
1506
-    &__add-text {
1507
-        height: px(60);
1508
-        line-height: px(60);
1509
-        background-color: #27a34f;
1510
-        color: #fff;
1511
-        font-size: px(30);
1512
-        padding: 0 px(20);
1513
-        border-radius: px(30);
1514
-    }
1515
-
1516
-    &__add {
1517
-        background-color: #27a34f;
1518
-        width: px(60);
1519
-        height: px(60);
1520
-        border-radius: 50%;
1521
-        // box-shadow: px(1) px(2) px(6) #27a34f;
1522
-        position: relative;
1523
-        &::after,
1524
-        &::before {
1525
-            content: "";
1526
-            position: absolute;
1527
-            top: 50%;
1528
-            left: 50%;
1529
-            z-index: 1;
1530
-            width: 60%;
1531
-            height: px(6);
1532
-            border-radius: px(6);
1533
-            background: #fff;
1534
-        }
1535
-        &::after {
1536
-            transform: translate(-50%, -50%);
1537
-        }
1538
-        &::before {
1539
-            transform-origin: center;
1540
-            transform: translate(-50%, -50%) rotate(90deg);
1541
-        }
1542
-    }
1543
-
1544 1535
     &__remove {
1545 1536
         background-color: #fff;
1546 1537
         width: px(60);
@@ -1719,13 +1710,13 @@ page {
1719 1710
 }
1720 1711
 .canvas {
1721 1712
     position: fixed;
1722
-    top: 0;
1723
-    left: 0;
1724
-    z-index: 996;
1713
+    top: -100%;
1714
+    left: -100%;
1715
+    z-index: -11;
1725 1716
     width: 100%;
1726 1717
     height: 100%;
1727 1718
     background-color: rgba(0, 0, 0, 0.4);
1728
-
1719
+    visibility: hidden;
1729 1720
     &__content {
1730 1721
         position: relative;
1731 1722
         width: 100%;
@@ -1772,5 +1763,4 @@ page {
1772 1763
         background-color: #fff;
1773 1764
     }
1774 1765
 }
1775
-
1776 1766
 </style>

+ 24 - 6
src/pages/manage/index.vue

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
     <div class="page">
3
-        <div class="page__top" v-if="user.isSysAdmin">
3
+        <div class="page__top" v-if="user.isAdmin">
4 4
             <div class="name">当前门店:</div>
5 5
             <div class="shop" v-if="!hideShop" @click="goShopSelect">
6 6
                 <div class="shop__name">
@@ -10,7 +10,7 @@
10 10
                 </div>
11 11
             </div>
12 12
         </div>
13
-        <div class="page__top">
13
+        <div class="page__top" v-else>
14 14
             <div class="name">当前门店:</div>
15 15
             <div class="shop">
16 16
                 <div class="shop__name">
@@ -46,7 +46,9 @@
46 46
             </li>
47 47
         </ul>
48 48
 
49
-        <div class="ver">0.2.2</div>
49
+        <button class="btn" @click="layout">退出登录</button>
50
+
51
+        <div class="ver">0.2.24</div>
50 52
     </div>
51 53
 </template>
52 54
 
@@ -64,10 +66,9 @@ export default {
64 66
         };
65 67
     },
66 68
 
67
-    onLoad() {
68
-    },
69
+    onLoad() {},
69 70
     async onShow() {
70
-        console.log(this.user)
71
+        console.log(this.user);
71 72
         if (!this.user.isAdmin) {
72 73
             if (!this.user.storeId) {
73 74
                 this.fn.showModal({
@@ -113,6 +114,13 @@ export default {
113 114
                 },
114 115
             });
115 116
         },
117
+
118
+        layout() {
119
+            this.$store.commit("user/logout", null);
120
+            this.router.replace({
121
+                path: "/pages/index/login",
122
+            });
123
+        },
116 124
     },
117 125
 
118 126
     // 数据计算
@@ -207,4 +215,14 @@ export default {
207 215
     text-align: center;
208 216
     color: #aaa;
209 217
 }
218
+.btn {
219
+    position: fixed;
220
+    bottom: px(50);
221
+    left: px(30);
222
+    right: px(30);
223
+    z-index: 10;
224
+    color: #fff;
225
+    background-color: #e92e25;
226
+    font-size: px(44);
227
+}
210 228
 </style>