Просмотр исходного кода

修改获取用户信息的接口

wangn 5 лет назад
Родитель
Сommit
d6d07190c9

+ 15 - 9
ghsApp/src/components/app-bind-info.vue

@@ -14,8 +14,7 @@
             </view>
             <button
               class="admin-button-com blue mini-btn"
-              open-type="getUserInfo"
-              @getuserinfo="getWxAvatar"
+              @click="getWxAvatar"
             >帮我填</button>
         </tui-list-cell>
         <tui-list-cell class="line-cell" :hover="false">
@@ -64,9 +63,17 @@
         methods:{
              // 获取微信信息
             getWxAvatar() {
-                uni.getUserInfo({
-                    provider: "weixin",
-                    success: res => {
+                // uni.getUserInfo({
+                //     provider: "weixin",
+                //     success: res => {
+                //     },
+                //     fail: () => {
+                //     // this.loading = false
+                //     }
+                // });
+                uni.getUserProfile({
+                  desc:'登录',
+                  success:(res)=>{
                     getWxInfo({ iv: res.iv, encryptedData: res.encryptedData }).then(
                         subRes => {
                         this.form.name = subRes.data.name;
@@ -76,10 +83,9 @@
                         });
                         }
                     );
-                    },
-                    fail: () => {
-                    // this.loading = false
-                    }
+                  },
+                  fail:(res)=>{
+                  }
                 });
             },
             // 获取微信手机号

+ 2 - 0
ghsApp/src/pagesStorehouse/stockWarn/detailed.vue

@@ -170,6 +170,7 @@ export default {
 
 		let dateDefaultOption = [];
 		let list = this.getDictionariesInfo.dateDefaultOption;
+    console.log('list===>', list)
 		for (let i=0;i<list.length;i++){
 			dateDefaultOption.push({name:list[i].name,id:list[i].value})
 		}
@@ -178,6 +179,7 @@ export default {
 		this.shopId = this.getLoginInfo.shopId;
 		console.log(' this.selectShopId',this.shopId)
 		console.log(' this.getLoginInfo.shopId',this.getLoginInfo.shopId)
+		console.log(' this.menuTimeObj',this.menuTimeObj, dateDefaultOption)
 		// console.log('userShopAll',this.setUserShopAll())
 
 		this.init();