Преглед на файлове

兑换核销,子级权限完善,添加空白页跳转权限,后端状态码500处理

ltx529596 преди 4 години
родител
ревизия
d26aa9a176

+ 2 - 2
src/config/index.config.js

@@ -2,8 +2,8 @@ const CONFIG = {
     //开发环境配置
     development: {
         assetsPath: '/static', // 静态资源路径
-        // baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
-        baseUrl: 'http://192.168.100.135:83/merch',  // 后台接口请求地址
+        baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
+        // baseUrl: 'http://192.168.100.135:83/merch',  // 后台接口请求地址
         hostUrl: 'http://localhost:8080',        // H5地址(前端运行地址)
         websocketUrl: '',        // websocket服务端地址
         weixinAppId: '', // 微信公众号appid

+ 15 - 16
src/pages/components/mask.vue

@@ -18,18 +18,20 @@
               <view class="checked-box-warp">
                 <view class="father-warp">
                   <view class="father-item" v-for="fatheritem in menuList" :key='fatheritem.id'>
-
                     <view class="fatherbar" @tap.stop='chechedFather(fatheritem.id, fatheritem.children)'>
+
                       <view class="icon active" v-if="hasMenuList.includes(fatheritem.id)"></view>
                       <view class="icon" v-else></view>
+
                       <view class="title">{{ fatheritem.name }}</view>
                     </view>
-
                     <view class="son-warp">
                       <view class="son-item" v-for="sonitem in fatheritem.children" :key="sonitem.id">
                         <view class="sonerbar" @tap.stop='chechedSon(sonitem.id,fatheritem)'>
+
                           <view class="icon active" v-if="hasMenuList.includes(sonitem.id)"></view>
                           <view class="icon" v-else></view>
+
                           <view class="title">{{ sonitem.name }}</view>
                         </view>
                       </view>
@@ -123,26 +125,23 @@ export default {
         for (const item of childrenArr) {
           this.hasMenuList.includes(item) ? temp.push(item) : ''
         }
-        if (temp.length === 0) {
-          for (let i = 0; i < this.hasMenuList.length; i++) {
-            if (this.hasMenuList[i] === father.id) {
-              this.hasMenuList.splice(i,1)
-            }
-          }
-        }
-        console.log(temp.length);
+        // if (temp.length === 0) {
+        //   for (let i = 0; i < this.hasMenuList.length; i++) {
+        //     if (this.hasMenuList[i] === father.id) {
+        //       this.hasMenuList.splice(i,1)
+        //     }
+        //   }
+        // }
       } else {
         this.hasMenuList.push(num)
         for (const item of childrenArr) {
           this.hasMenuList.includes(item) ? temp.push(item) : ''
         }
-        console.log(temp.length);
         
-        if (temp.length === father.children.length) {
-          if ( !this.hasMenuList.includes(father.id)) {
-            this.hasMenuList.push(father.id)
-          }
+        if ( !this.hasMenuList.includes(father.id)) {
+          this.hasMenuList.push(father.id)
         }
+       
       }
       console.log(this.hasMenuList);
       this.$mStore.commit('setHasRoleList',this.hasMenuList)
@@ -211,7 +210,7 @@ export default {
       border-bottom-left-radius: 20upx;
       border-bottom-right-radius: 20upx;
       .message {
-        padding: 10upx 60upx 15upx;
+        padding: 40upx 60upx 15upx;
         overflow-y: scroll;
         height: 670upx;
         .radiolist {

+ 18 - 22
src/pages/goods/editclassify.vue

@@ -139,30 +139,26 @@ export default {
     // 所属店铺
     async getShopList() {
       this.storeList = [{ name: '所属店铺', id: '' }];
-      await this.$http
-        .get('/shop/getList', {
-          mid: this.scenicId,
-        })
-        .then(async (res) => {
-          if (res.data) {
-            let arr = [];
-            res.data.forEach((element) => {
-              arr.push({ name: element.name, id: element.id });
+      await this.$http.get('/shop/getList', { mid: this.scenicId }).then(async (res) => {
+        if (res.data) {
+          let arr = [];
+          res.data.forEach((element) => {
+            arr.push({ name: element.name, id: element.id });
+          });
+          this.storeList = this.storeList.concat(arr);
+          this.storeDisabled = false
+          
+          // 回显
+          if (this.classData.shopId) {
+            this.storeList.forEach((element,index) => {
+              if (this.classData.shopId === element.id) {
+                this.storeIndex = index
+              }
             });
-						this.storeList = this.storeList.concat(arr);
-            this.storeDisabled = false
-            
-            // 回显
-            if (this.classData.shopId) {
-              this.storeList.forEach((element,index) => {
-                if (this.classData.shopId === element.id) {
-                  this.storeIndex = index
-                }
-              });
-              this.storeId = this.classData.shopId
-            }
+            this.storeId = this.classData.shopId
           }
-        });
+        }
+      });
 		},
 		// 选择店铺
     bindPickerChange(e) {

+ 72 - 38
src/pages/goods/goods.vue

@@ -70,7 +70,7 @@
         <view class="line"></view>
       </view>
     </view>
-    <view style="height: 272upx;"></view>
+    <view style="height: 272upx"></view>
     <!-- 审核 -->
     <view class="order-content" v-if="isactive === 1">
       <view class="order-list" v-for="(item, index) in shoplist" :key="index">
@@ -92,8 +92,9 @@
             >
           </view>
 
-          <view class="right" v-if="item.price">¥<text class="price">{{ item.price | dounit }}</text></view>
-          
+          <view class="right" v-if="item.price"
+            >¥<text class="price">{{ item.price | dounit }}</text></view
+          >
         </view>
         <view class="operate">
           <view
@@ -129,7 +130,9 @@
             >
           </view>
 
-          <view class="right" v-if="item.price">¥<text class="price">{{ item.price | dounit }}</text></view>
+          <view class="right" v-if="item.price"
+            >¥<text class="price">{{ item.price | dounit }}</text></view
+          >
         </view>
         <view class="operate">
           <view
@@ -183,11 +186,10 @@
       </view>
     </view>
 
-
     <uni-load-more :status="more"> </uni-load-more>
     <rf-loading v-if="loading"></rf-loading>
     <tabBar :currentIndex="typeNum"></tabBar>
-    <view style="height: 100upx;"></view>
+    <view style="height: 100upx"></view>
   </view>
 </template>
 
@@ -196,7 +198,7 @@ import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 export default {
   name: 'order',
   components: { uniLoadMore },
-  data() {
+  data () {
     //这里存放数据
     return {
       typeNum: null,
@@ -231,14 +233,14 @@ export default {
     };
   },
   filters: {
-    putaway(val) {
+    putaway (val) {
       if (val === '0') {
         return '已下架';
       } else if (val === '1') {
         return '已上架';
       }
     },
-    state(val) {
+    state (val) {
       if (val === '1') {
         return '待审核';
       } else if (val === '2') {
@@ -247,7 +249,7 @@ export default {
         return '审核未通过';
       }
     },
-    dounit(val) {
+    dounit (val) {
       if (val) {
         return val / 100;
       } else {
@@ -256,7 +258,7 @@ export default {
     },
   },
   // 下拉刷新
-  onPullDownRefresh() {
+  onPullDownRefresh () {
     this.more = 'loading';
     this.isactive = 1;
     this.params = {
@@ -271,7 +273,7 @@ export default {
     this.getTicketShopList();
   },
   // 上拉加载
-  onReachBottom() {
+  onReachBottom () {
     if (this.soleStatus === 1) {
       if (this.more === 'noMore') {
         return;
@@ -282,7 +284,7 @@ export default {
   // 监听页面返回
   onBackPress (options) {
     console.log(options);
-    this.getTicketShopList().then(()=>{
+    this.getTicketShopList().then(() => {
       this.getShopList()
     })
   },
@@ -291,22 +293,38 @@ export default {
 
     // this.params.mid = uni.getStorageSync('scenicMessage').id
     // console.log(this.params.mid);
-    
-    this.getTicketShopList().then(()=>{
+
+    this.getTicketShopList().then(() => {
       this.getShopList()
     })
   },
-  
-  
+  onShow () {
+    this.getTicketShopList()
+  },
+
   //方法集合
   methods: {
-   
+
     // 跳转详情
-    topage(id) {
-      this.$mRouter.push({ route: '/pages/goods/shopdetail', query:{id: id}});
+    topage (id) {
+      let arr = []
+      let role = uni.getStorageSync('role')
+      role.forEach((element,index) => {
+        if (element.code === 'goods') {
+          let childrenRole = element.children
+          element.children.forEach( element =>{
+            arr.push(element.code)
+          })
+          if (arr.includes('info')) {
+            this.$mRouter.push({ route: '/pages/goods/shopdetail', query: { id: id } });
+          } else {
+            this.$mHelper.toast('无权限访问')
+          }
+        }
+      });        
     },
     // 删除商品
-    async deleteshop(id) {
+    async deleteshop (id) {
       let _self = this;
       this.deleteId = id;
       uni.showModal({
@@ -318,9 +336,7 @@ export default {
               .then(async (res) => {
                 if (res.code === 200 && res.msg === 'OK') {
                   _self.$mHelper.toast('删除成功');
-                  setTimeout(() => {
-                    _self.getTicketShopList();
-                  }, 500);
+                  _self.getTicketShopList();
                 }
               });
           }
@@ -328,13 +344,13 @@ export default {
       });
     },
     // 根据名字搜索
-    searchByname() {
+    searchByname () {
       this.more = 'loading';
       this.params.pageNum = 1;
       this.getTicketShopList();
     },
     // 选择商铺
-    bindPickerChange(e) {
+    bindPickerChange (e) {
       this.more = 'loading';
       this.params.pageNum = 1;
       this.shopID = '';
@@ -342,9 +358,9 @@ export default {
       this.params.shopId = this.shopArray[this.index].id;
       this.getTicketShopList();
     },
-   
+
     // 获取店铺列表
-    async getShopList() {
+    async getShopList () {
       await this.$http.get('/homePage/getShopByMerId').then((res) => {
         if (res.data && res.code === 200) {
           let newarr = [{ name: '全部', id: '' }];
@@ -367,7 +383,7 @@ export default {
     // },
 
     // 待审核tab切换
-    changeTabByStatus(type, status) {
+    changeTabByStatus (type, status) {
       this.more = 'loading';
       this.shoplist = [];
       this.params.pageNum = 1;
@@ -378,17 +394,35 @@ export default {
       this.getTicketShopList();
     },
     // tab
-    changeTab(type, putaway) {
+    changeTab (type, putaway) {
+
+      // let childrenRole = []
+      // this.$mStore.state.role.forEach((element,index) => {
+      //   if (element.code === 'order') {
+      //     element.children.forEach((element,index)=>{
+      //       if (element.code) {
+      //         childrenRole.push(element.code)
+      //       }
+      //     })
+      //     if (childrenRole.includes(type)) {
+      //       this.isactive = type;
+      //     } else {
+      //       this.$mHelper.toast('无权限访问')
+      //     }
+      //   }
+      // });
+
+      this.isactive = type;
+
       this.more = 'loading';
       this.params.pageNum = 1;
-      this.isactive = type;
       this.params.upDown = putaway;
       this.putAwat = putaway;
       delete this.params.status;
       this.getTicketShopList();
     },
     // 置顶
-    sticktop(id, status) {
+    sticktop (id, status) {
       if (status != 0) {
         this.topstatus = '-2';
       } else {
@@ -409,7 +443,7 @@ export default {
     },
 
     // 商品列表(待审核状态)
-    async getTicketShopList() {
+    async getTicketShopList () {
       this.more = 'loading'
       this.soleStatus = 1;
       this.shoplist = [];
@@ -435,7 +469,7 @@ export default {
       });
     },
     // 更多(待审核状态)
-    async getMoreByStatus() {
+    async getMoreByStatus () {
       this.params.pageNum++;
       let listArr = [];
       // 判断tab切换的条件
@@ -458,17 +492,17 @@ export default {
       });
     },
     // 通过审核
-    passGet(id) {},
+    passGet (id) { },
     // 下架
-    shopPutDown(id) {
+    shopPutDown (id) {
       this.changeShopStatus(id, this.params.upDown);
     },
     // 上架
-    shopPutUp(id) {
+    shopPutUp (id) {
       this.changeShopStatus(id, this.params.upDown);
     },
     // 修改商品状态
-    async changeShopStatus(ids, upordown, state) {
+    async changeShopStatus (ids, upordown, state) {
       let upstate = 0;
       if (upordown === '1') {
         upstate = 0;

+ 5 - 1
src/pages/index/blankPage.vue

@@ -20,7 +20,11 @@ export default {
   onLoad () {
     if (uni.getStorageSync('user') && uni.getStorageSync('role')) {
       let role = uni.getStorageSync('role')
-      this.$mRouter.reLaunch({route: `/pages/${role[0].code}/${role[0].code}`})
+      if (role[0]) {
+        this.$mRouter.reLaunch({route: `/pages/${role[0].code}/${role[0].code}`})
+      } else {
+        this.$mRouter.reLaunch({route: '/pages/public/login'})
+      }
     } else {
       this.$mRouter.reLaunch({route: '/pages/public/login'})
     }

+ 16 - 3
src/pages/index/conversion.vue

@@ -37,6 +37,13 @@
         <view class="orderstatus titlebar"
           >订单状态:<text class="txt">{{ orderDetail.statusName }}</text>
         </view>
+        <view class="titlebar chechNum"
+          >核销次数:<text class="txt">{{ orderDetail.checkList.length }} / {{ orderDetail.checkNum}} </text></view
+        >
+        <view class="titlebar checkedTime" v-for="(item,index) in orderDetail.checkList" :key="index">
+          核销时间:<text class="txt">{{ item.checkTime }}</text>
+        </view>
+
         <view class="tourist" v-if="orderDetail.playManList[0].name">
           <view class="title">游客信息</view>
           <view
@@ -176,10 +183,16 @@ export default {
       }
 
       .orderstatus {
-        height: 98upx;
-        line-height: 98upx;
         border-top: 1px solid #e1e1e1;
-        border-bottom: 1px solid #e1e1e1;
+        padding-top: 22upx;
+        // height: 98upx;
+        // line-height: 98upx;
+      }
+      .checkedTime {
+        &:last-child {
+          padding-bottom: 22upx;
+          border-bottom: 1px solid #e1e1e1;
+        }
       }
 
       .tourist {

+ 4 - 1
src/pages/index/userinfo/adduser.vue

@@ -142,7 +142,8 @@ export default {
         }
       })
     },
-    // 提交表单
+   
+   // 提交表单
     submitUserInfo () {
       this.verify().then( userInfo =>{
         this.loading = true
@@ -161,6 +162,8 @@ export default {
               this.$mRouter.back()
             }, 500);
           } 
+        }).catch(err0r =>{
+          this.loading = false
         })
         
       })

+ 77 - 68
src/pages/order/order.vue

@@ -11,7 +11,7 @@
       </view>
       <view class="uni-list-cell">
         <view class="uni-list-cell-db">
-          <picker style="width: 100%; height: 100%;" @change="bindPickerChange" :value="index" :range="shopArray" range-key="name">
+          <picker style="width: 100%; height: 100%" @change="bindPickerChange" :value="index" :range="shopArray" range-key="name">
             <view class="uni-input">{{ shopArray[index].name }}</view>
           </picker>
           <view class="icon-warp">
@@ -23,49 +23,40 @@
         </view>
       </view>
       <view class="btn-time">
-        <uni-calendar ref="calendar" :insert="false" :range="true" :startDate="'2020-01-01'" :endDate="date" @confirm="confirm"/>
+        <uni-calendar ref="calendar" :insert="false" :range="true" :startDate="'2020-01-01'" :endDate="date" @confirm="confirm" />
         <view class="opentime" @tap="openTime">
           <view class="start">{{ startdate ? startdate : date }}</view>
           <text class="guo">至</text>
           <view class="end">{{ enddate ? enddate : date }}</view>
           <text class="sundate">共:{{ sunday }}天</text>
         </view>
-        <view style="width: 19upx;">
-          <image src="../../static/images/moreicon.png" class="iconRight"></image>
+        <view style="width: 19upx">
+          <image
+            src="../../static/images/moreicon.png"
+            class="iconRight"
+          ></image>
         </view>
       </view>
       <view class="header-bar">
-        <view class="item" @tap="changeTab(0, flagList[0])" :class="{ active: isactive === 0,henganimationLeft: direction === 'right', henganimationRight: direction === 'left' }">
+        <view class="item" @tap="changeTab('pay', flagList[0])" :class="{ active: isactive === 'pay' }">
           <view class="ordertype">已付款</view>
           <view class="heng"></view>
         </view>
-        <view
-          class="item"
-          @tap="changeTab(1, flagList[1])"
-          :class="{ active: isactive === 1,henganimationLeft: direction === 'right', henganimationRight: direction === 'left' }"
-        >
+        <view class="item" @tap="changeTab('refund', flagList[1])" :class="{ active: isactive === 'refund' }">
           <view class="ordertype">已完成</view>
           <view class="heng"></view>
         </view>
-        <view
-          class="item"
-          @tap="changeTab(2, flagList[2])"
-          :class="{ active: isactive === 2,henganimationLeft: direction === 'right', henganimationRight: direction === 'left' }"
-        >
+        <view class="item" @tap="changeTab('rubbishOrder', flagList[2])" :class="{ active: isactive === 'rubbishOrder'}">
           <view class="ordertype">退款</view>
           <view class="heng"></view>
         </view>
         <view class="line"></view>
       </view>
     </view>
-    <view style="height: 352upx;"></view>
+    <view style="height: 352upx"></view>
 
-    <view
-      class="order-content"
-      v-if="isactive === 0"
-      :class="{ leaveRightToLeft: isactive === 0 && direction=== 'left', leaveLeftToRight: isactive === 0 && direction ==='right'}"
-     
-    >
+    <!-- <view class="order-content" v-if="isactive === 'pay'" :class="{ leaveRightToLeft: isactive === 0 && direction === 'left', leaveLeftToRight: isactive === 0 && direction === 'right', }"> -->
+    <view class="order-content" v-if="isactive === 'pay'" >
       <view
         class="order-list"
         @tap="todetail(item.ordersNo)"
@@ -100,9 +91,7 @@
     </view>
     <view
       class="order-content"
-      v-if="isactive === 1"
-      :class="{ leaveRightToLeft: isactive === 1 && direction=== 'left', leaveLeftToRight: isactive === 1 && direction ==='right'}"
-     
+      v-if="isactive === 'refund'"
     >
       <view
         class="order-list"
@@ -138,9 +127,7 @@
     </view>
     <view
       class="order-content"
-      v-if="isactive === 2"
-      :class="{ leaveRightToLeft: isactive === 2 && direction=== 'left', leaveLeftToRight: isactive === 2 && direction ==='right'}"
-    
+      v-if="isactive === 'rubbishOrder'"
     >
       <view
         class="order-list"
@@ -167,19 +154,18 @@
           >
           <view class="playtime"
             >游玩时间:<text class="message"
-              >{{ item.palyTime.substring(0, 11) }}
-              {{ item.timePart ? item.timePart : '' }}</text
+              >{{ item.palyTime.substring(0, 11)
+              }}{{ item.timePart ? item.timePart : '' }}</text
             ></view
           >
         </view>
       </view>
     </view>
 
-
     <uni-load-more :status="more"> </uni-load-more>
     <rf-loading v-if="loading"></rf-loading>
-    <tabBar :currentIndex="typeNum" ></tabBar>
-    <view style="height: 100upx;"></view>
+    <tabBar :currentIndex="typeNum"></tabBar>
+    <view style="height: 100upx"></view>
   </view>
 </template>
 
@@ -190,16 +176,18 @@ import uniCalendar from '@/components/uni-calendar/uni-calendar.vue';
 export default {
   name: 'order',
   components: { uniLoadMore, uniCalendar },
-  data() {
+  data () {
     //这里存放数据
     return {
+      roleList: [],
       typeNum: null,
       // loading: false,
       shopArray: [{ name: '全部', id: '' }],
       index: 0,
       shopID: 0,
 
-      isactive: 0, // tab
+      isactive: 'pay', // tab
+
       flagList: ['pay', 'accomplish', 'refundorder'],
       direction: '',
 
@@ -238,7 +226,7 @@ export default {
     };
   },
   // 下拉刷新page.json中要配置
-  onPullDownRefresh() {
+  onPullDownRefresh () {
     this.startdate = '';
     this.enddate = '';
     this.sunday = 1;
@@ -256,7 +244,7 @@ export default {
     this.getOrderList();
   },
   // 页面触底加载
-  onReachBottom() {
+  onReachBottom () {
     if (this.soleStatus === 1) {
       if (this.more === 'noMore') {
         return;
@@ -264,23 +252,25 @@ export default {
       this.loadMoreList();
     }
   },
-  onLoad() {
+  onLoad () {
     this.typeNum = this.$mStore.state.roleIndex
+    // 权限设置
 
     this.getShopList();
     this.getOrderList();
   },
   //方法集合
   methods: {
- 
+
+    /*
     // 手势开始
-    handstart(event) {
+    handstart (event) {
       this.startTime = Date.now();
       this.startX = event.changedTouches[0].clientX;
       this.startY = event.changedTouches[0].clientY;
     },
     // 手势结束
-    handend(event) {
+    handend (event) {
       const endTime = Date.now();
       const endX = event.changedTouches[0].clientX;
       const endY = event.changedTouches[0].clientY;
@@ -327,15 +317,17 @@ export default {
         return;
       }
     },
+    */
+
     // 打开日历
-    openTime() {
+    openTime () {
       this.startdate = '';
       this.enddate = '';
       this.sunday = 1;
       this.$refs.calendar.open();
     },
     // 确认时间后
-    confirm(e) {
+    confirm (e) {
       this.more = 'loading';
 
       this.startdate = e.range.before;
@@ -354,7 +346,7 @@ export default {
     },
 
     // 根据订单号或者手机号查询
-    orderByNum() {
+    orderByNum () {
       this.more = 'loading';
       let num = '';
       num = this.params.buyPhone;
@@ -370,30 +362,47 @@ export default {
     },
 
     // 商铺选择
-    bindPickerChange(e) {
+    bindPickerChange (e) {
       this.more = 'loading';
       this.index = e.detail.value;
       this.params.shopId = this.shopArray[this.index].id;
       this.getOrderList();
     },
-
+    
     // tab
-    changeTab(type, falg) {
-      this.direction = ''  // 关闭动画
-      this.more = 'loading';
-      this.params.pageNum = 1;
-      this.isactive = type;
-      console.log(this.isactive);
-      this.params.orderFlag = falg;
-      this.getOrderList();
+    changeTab (type, falg) {
+      console.log(type);
+      let childrenRole = []
+      this.roleList = this.$mStore.state.role
+      this.roleList.forEach((element,index) => {
+        if (element.code === 'order') {
+          element.children.forEach((element,index)=>{
+            if (element.code) {
+              childrenRole.push(element.code)
+            }
+          })
+          if (childrenRole.includes(type)) {
+            this.isactive = type;
+            this.more = 'loading';
+            this.params.pageNum = 1;
+            this.params.orderFlag = falg;
+            this.getOrderList();
+          } else {
+            this.$mHelper.toast('无权限访问')
+          }
+        }
+      });
+
+     
+      // this.direction = ''  // 关闭动画
     },
     // 跳转详情
-    todetail(num) {
+    todetail (num) {
       uni.setStorageSync('order', num);
       this.$mRouter.push({ route: '/pages/order/orderdetail' });
     },
     // 获取店铺列表
-    async getShopList() {
+    async getShopList () {
       await this.$http.get('/homePage/getShopByMerId').then((res) => {
         if (res.data && res.code === 200) {
           let newarr = [{ name: '全部', id: '' }];
@@ -402,7 +411,7 @@ export default {
       });
     },
     // 订单列表
-    async getOrderList() {
+    async getOrderList () {
       this.soleStatus = 1;
       this.orderList = [];
       await this.$http
@@ -420,7 +429,7 @@ export default {
       uni.stopPullDownRefresh();
     },
     // 上拉加载
-    async loadMoreList() {
+    async loadMoreList () {
       this.params.pageNum++;
       await this.$http
         .post('/orders/proList', this.params)
@@ -573,26 +582,26 @@ export default {
         display: block;
       }
       .henganimationLeft .heng {
-        transition: all .5s;
-        animation: hengRightToLeft .5s;
+        transition: all 0.5s;
+        animation: hengRightToLeft 0.5s;
       }
       .henganimationRight .heng {
-        transition: all .5s;
-        animation: hengLeftToRight .5s;
+        transition: all 0.5s;
+        animation: hengLeftToRight 0.5s;
       }
       @keyframes hengRightToLeft {
-        from{
+        from {
           transform: translateX(141upx);
         }
-        to{
+        to {
           transform: translateX(0);
         }
       }
       @keyframes hengLeftToRight {
-        from{
+        from {
           transform: translateX(-141upx);
         }
-        to{
+        to {
           transform: translateX(0);
         }
       }
@@ -643,12 +652,12 @@ export default {
   }
   .leaveRightToLeft {
     transition: all 0.5s linear;
-    animation: leaveinRihthToLeft .5s;
+    animation: leaveinRihthToLeft 0.5s;
     z-index: 10;
   }
   .leaveLeftToRight {
     transition: all 0.5s linear;
-    animation: leaveLeftToRight .5s;
+    animation: leaveLeftToRight 0.5s;
     z-index: 10;
   }
 

+ 3 - 1
src/pages/public/login.vue

@@ -141,7 +141,6 @@ export default {
         .then( async r => {
           console.log(r);
           let rolelist = r.data.pages
-          this.$mHelper.toast('恭喜您,登录成功!');
           this.$mStore.commit('login', r.data);
 
           // 商家信息
@@ -151,7 +150,10 @@ export default {
             }
           });
 
+          this.$mHelper.toast('恭喜您,登录成功!');
+          
           this.$mRouter.reLaunch({ route: `/pages/${rolelist[0].code}/${rolelist[0].code}`}); 
+          this.btnLoading = false;
 
         })
         .catch(() => {

+ 3 - 13
src/store/index.js

@@ -56,19 +56,8 @@ const store = new Vuex.Store({
             } else {
                 return false
             }
-        },
-        hasrole: state=> {
-            if (state.role) {
-                return state.role
-            } else {
-                mHelper.toast('该账号无权访问,默认重新登录!')
-                uni.hideLoading()
-                setTimeout(() => {
-                    mRouter.reLaunch({route: '/pages/public/login'})
-                }, 1000);
-                return
-            }
         }
+        
     },
     // 方法函数,一般用于计算state中的数据
     mutations: {
@@ -92,7 +81,8 @@ const store = new Vuex.Store({
             uni.setStorageSync('scenicMessage',data)
         },
         login(state, provider) {
-			state.user = provider;
+            state.user = provider;
+            state.role = provider.pages
             uni.setStorageSync('user', provider.token);
             uni.setStorageSync('role',provider.pages)
         },