ming 3 жил өмнө
parent
commit
57592cf29e

+ 13 - 6
business/wx-login.vue

@@ -1,10 +1,10 @@
 <template>
-	<fs-modal v-model="modelValue" :showTitle="false" :showCancel="false" :showConfirm="false" :maskClickable="maskClickable">
+	<fs-modal v-model="visible" :showTitle="false" :showCancel="false" :showConfirm="false" :maskClickable="maskClickable">
 		<view style="padding: 20rpx;">
-			<view class="title bold" style="font-size: 18px;margin-bottom: 30rpx;">授权微信访问</view>
-			<view class="content" style="font-size: 15px;">
+			<view class="title bold" style="font-size:20px;margin-bottom: 60rpx;">授权微信访问</view>
+			<!-- <view class="content" style="font-size: 15px;">
 				为了保护他人的隐私,授权后可查看对方的名片
-			</view>
+			</view> -->
 			<view class="wxlogin-btn">
 				<fs-button full round type="success" @click="getUserProfile" v-if="canIUseGetUserProfile">授权微信</fs-button>
 				<fs-button full round type="success" open-type="getUserInfo" @getuserinfo="getUserInfo" v-else>授权微信</fs-button>
@@ -23,7 +23,7 @@
 </template>
 
 <script setup>
-import { ref } from 'vue'
+import { ref, computed } from 'vue'
 import { wxLogin } from '@/services/common'
 
 const props = defineProps({
@@ -31,10 +31,17 @@ const props = defineProps({
 	maskClickable: {
 		type: Boolean,
 		default: true
-	}
+	},
 })
 const emits = defineEmits(['update:modelValue', 'success'])
 
+const visible = computed(
+	{
+		get: () => props.modelValue,
+		set: value => emits('update:modelValue', value)
+	}
+)
+
 const checkboxArray = ref(['1'])
 
 const canIUseGetUserProfile = ref(wx.getUserProfile ? true : false)

+ 3 - 1
components/fs-loadmore/fs-loadmore.vue

@@ -2,7 +2,9 @@
 	<view>
 		<slot></slot>
 		<fs-empty v-if="!state.loading && !state.dataList.length"></fs-empty>
-		<fs-divider v-if="!state.hasMore">{{nomore}}</fs-divider>
+		<template v-else>
+			<fs-divider v-if="!state.hasMore">{{nomore}}</fs-divider>
+		</template>
 	</view>
 </template>
 

+ 2 - 2
services/common.js

@@ -8,11 +8,11 @@ export function wxLogin(data) {
 		uni.login({
 		  provider: 'weixin',
 		  success: function (res) {
-		    http.post('user/wxlogin', {
+		    http.post('wxMini/authLogin', {
 					encryptedData: data.encryptedData,
 					ivStr: data.iv,
 					userInfo: JSON.stringify(data.userInfo),
-					code: res.code ,
+					code: res.code,
 				}, {
 		    	isAuth: false,
 		    	loadingTitle: '登录中...'

+ 1 - 1
store/index.js

@@ -3,7 +3,7 @@ import { login, wxLogin, logout } from '../services/common'
 
 const store = createStore({
   state: {
-    userInfo: uni.getStorageSync('userInfo') || {name: 'ming'},
+    userInfo: uni.getStorageSync('userInfo'),
 		token: uni.getStorageSync('token') || ''
   },
   mutations: {