shish пре 4 година
родитељ
комит
d93f83e15f
3 измењених фајлова са 40 додато и 1 уклоњено
  1. 29 0
      hdApp/src/admin/home/me.vue
  2. 5 0
      hdApp/src/api/admin/index.js
  3. 6 1
      hdApp/src/pagesClient/official/apply.vue

+ 29 - 0
hdApp/src/admin/home/me.vue

@@ -82,6 +82,15 @@
               <div class="tui-title">帐号绑定</div>
             </tui-list-cell>
 
+            <!-- #ifdef APP-PLUS -->
+            <tui-list-cell @click="closeApp()" class="line-cell" :hover="false" :arrow="true" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
+              <div class="tui-title">关闭APP</div>
+            </tui-list-cell>
+            <tui-list-cell @click="loginOut()" class="line-cell" :hover="false" :arrow="true" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
+              <div class="tui-title">退出登陆</div>
+            </tui-list-cell>
+            <!-- #endif -->
+
           </view>
         </view>
       </view>
@@ -126,6 +135,26 @@ export default {
     this.getMyInfo()
   },
   methods: {
+    // #ifdef APP-PLUS
+    loginOut(){
+        let that = this
+        uni.clearStorage()
+        that.$store.commit("setLoginInfo", {})
+        plus.runtime.restart()        
+    },
+    closeApp(){
+      let type = uni.getSystemInfoSync().platform
+      switch(type){
+        case 'android':
+          plus.runtime.quit()
+          break;
+        case 'ios':
+          plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
+          break;
+        default:
+      }   
+    },
+    // #endif
 		getCustomService(){
 			let that = this;
 			uni.showModal({

+ 5 - 0
hdApp/src/api/admin/index.js

@@ -6,3 +6,8 @@ import https from '@/plugins/luch-request_0.0.7/request'
 export const adminSetPayPassword = data => {
 	return https.get('/admin/set-pay-password', data)
 }
+
+//添加修改安卓clientId
+export const replaceClientId = data => {
+	return https.get("/admin/replace-client-id", data);
+}

+ 6 - 1
hdApp/src/pagesClient/official/apply.vue

@@ -301,7 +301,9 @@ export default {
             that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
           })
           that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
-          getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+          getUser(true).then(res => { 
+            uni.setNavigationBarTitle({ title: res.name }) 
+          })
           that.setUserShopAll()
           // #ifdef APP-PLUS
           //保存安卓的clientId
@@ -312,8 +314,11 @@ export default {
             replaceClientId({id:currentClientId})
           }
           // #endif
+
         }
+
         this.$util.pageTo({url: "/pagesClient/official/result", type:2})
+
       });
     }
   },