Forráskód Böngészése

Merge branch 'main' of https://gitlab.com/tea28/client

hejie 3 éve
szülő
commit
4593afd628
6 módosított fájl, 30 hozzáadás és 28 törlés
  1. 3 3
      src/app.scss
  2. 1 1
      src/manifest.json
  3. 22 14
      src/pages/my/index.vue
  4. 2 1
      src/pages/sign/index.vue
  5. 2 8
      src/request/api.js
  6. 0 1
      src/request/request.js

+ 3 - 3
src/app.scss

@@ -28,9 +28,9 @@ view, text, div {word-break: break-all;color:#333;font-family: "SourceHanSansSC-
 /* CDN 服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
 @font-face {
     font-family: 'iconfont';  /* Project id 3748689 */
-    src: url('//at.alicdn.com/t/c/font_3748689_ysjdhcth1f.woff2?t=1667564440180') format('woff2'),
-         url('//at.alicdn.com/t/c/font_3748689_ysjdhcth1f.woff?t=1667564440180') format('woff'),
-         url('//at.alicdn.com/t/c/font_3748689_ysjdhcth1f.ttf?t=1667564440180') format('truetype');
+    src: url('//at.alicdn.com/t/c/font_3748689_9lwy7tb2de.woff2?t=1668151644072') format('woff2'),
+         url('//at.alicdn.com/t/c/font_3748689_9lwy7tb2de.woff?t=1668151644072') format('woff'),
+         url('//at.alicdn.com/t/c/font_3748689_9lwy7tb2de.ttf?t=1668151644072') format('truetype');
   }
 .iconfont {
     font-family: "iconfont" !important;

+ 1 - 1
src/manifest.json

@@ -57,7 +57,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wxd546683d04952d40",
+        "appid" : "wx8ebee994ea7c5af3",
         "setting" : {
             "urlCheck" : false,
             "es6" : true,

+ 22 - 14
src/pages/my/index.vue

@@ -421,28 +421,34 @@ export default {
     }
   },
   onShow: function () {
+    
     let token = uni.getStorageSync('token');
     if (!token) {
+      this.login();
+    }
+  },
+  methods: {
+    login(){
       // #ifdef  MP-WEIXIN
-      this.showAuth = true;
-      appEv.authorizeUserInfo((res) => {
-        if (res) {
-          this.shopInfo = app.globalData.shopInfo;
-          this.showAuth = false;
-          this.loadData();
+      wx.login({
+        success (res) {
+          if (res.code) {
+            post("appletLogin",{ code: res.code }).then(res => {
+              console.log(res);
+            })
+          }
         }
-      });
+      })
       // #endif
-
+      
       // #ifdef  H5 || APP-PLUS
       this.goto("/pages/my/login")
       // #endif
-    } else {
-      this.user_id = userId;
-      this.loadData();
-    }
-  },
-  methods: {
+    },
+
+
+
+
     // 获取用户信息
     loadData() {
       u_post("ShuZiTeaYW/my/index", {
@@ -495,6 +501,8 @@ export default {
     SetHint: function () {
       appEv.errTips("此功能暂未开放");
     },
+
+    //是否实名
     async isrealName(){
       let n = await u_post("ShuZiTeaYW/userInfo/realName");
       return n.status == 200

+ 2 - 1
src/pages/sign/index.vue

@@ -5,7 +5,8 @@
         <!-- 页面标题-end -->
         <!-- 用户信息 -->
         <view class="userinfo flex_r flex_ac">
-            <image class="user_img" :src="userInof.headimgurl ? userInof.headimgurl : 'https://tea.soowin.com/mnt/image/m_avar.jpg'" mode=""></image>
+            <span v-if="!userInof.headimgurl" class="iconfont">&#xe630;</span>
+            <image v-else class="user_img" :src="userInof.headimgurl" mode=""></image>
             <view class="user_info flex_c flex_jc">
                 <view class="user_name">{{userinfo.headimgurl}}</view>
                 <view class="level_con flex_r flex_ac">

+ 2 - 8
src/request/api.js

@@ -1,14 +1,7 @@
 import host from "./config.js"
 import api from "./request.js"
-var app = getApp();
 const user = uni.getStorageSync('systemUserInfo');
 
-// function getUserId() {
-	// var userId;
-	// userId = app.globalData.systemUserInfo && app.globalData.systemUserInfo.userId ? app.globalData.systemUserInfo.userId : '';
-	// return userId
-// };
-
 export function get(url, params, baseURL) {
 	return api({
 		url,
@@ -22,6 +15,7 @@ export function post(url, params, baseURL) {
 		url,
 		params,
 		method: "POST",
+		header: { "Content-Type": "application/x-www-form-urlencoded" },
 		baseURL,
 	})
 }
@@ -31,11 +25,11 @@ export function u_post(url, params, baseURL) {
 		...params,
 		userId: user.userId
 	}
-	// params['userId'] = user.userId;
 	return api({
 		url,
 		params,
 		method: "POST",
+		header: { "Content-Type": "application/x-www-form-urlencoded" },
 		baseURL,
 	})
 }

+ 0 - 1
src/request/request.js

@@ -2,7 +2,6 @@ import host from "./config.js"
 
 export default ({ url, method, params, header, baseURL }) => {
 	baseURL = baseURL ? baseURL : host.Hhost;
-	header = header ? header : { "Content-Type": "application/x-www-form-urlencoded" }
 
 	return new Promise((resolve, reject) => {
 		uni.request({