Browse Source

适配小程序

ming 3 years ago
parent
commit
ab9cdd79a3

+ 1 - 1
components/fs-action/fs-action.vue

@@ -33,7 +33,7 @@ const props = defineProps({
 		default: true
 	}
 })
-const emits = defineEmits(['update:modelValue', ''])
+const emits = defineEmits(['update:modelValue', 'change'])
 
 const visible = computed(
 	{

+ 25 - 1
components/fs-button/fs-button.vue

@@ -16,6 +16,13 @@
       { width: width },
       customStyle,
     ]"
+		:open-type="openType"
+		:form-type="formType"
+		@getuserinfo="getUserInfo"
+		@contact="contact"
+		@getphonenumber="getPhoneNumber"
+		@opensetting="openSetting"
+		@error="error"
     @click="handleClick"
   >
 		<view class="fs-loader" v-if="loading"></view>
@@ -29,6 +36,8 @@
 	import { computed, useAttrs } from 'vue'
 	
 	const props = defineProps({
+		openType: String,
+		formType: String,
     size: {
       type: String,
       validator(value) {
@@ -63,7 +72,7 @@
 		loading: Boolean
   })
 	
-	const emits = defineEmits(['click'])
+	const emits = defineEmits(['click','getuserinfo','contact','getphonenumber','opensetting','error'])
 		
 	const handleClick = e =>  {
 	  if (props.link && !props.disabled) {
@@ -73,6 +82,21 @@
 	  }
 	  !props.disabled && emits('click')
 	}
+	const getuserinfo = (event) => {
+	  emits('getuserinfo', event.detail)
+	}
+	const contact = (event) => {
+	  emits('contact', event.detail)
+	}
+	const getphonenumber = (event) => {
+	  emits('getphonenumber', event.detail)
+	}
+	const opensetting = (event) => {
+	  emits('opensetting', event.detail)
+	}
+	const error = (event) => {
+	  emits('error', event.detail)
+	}
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
components/fs-date-format/fs-date-format.vue

@@ -5,7 +5,7 @@
 </template>
 
 <script setup>
-import 'dayjs'
+import dayjs from 'dayjs'
 
 const props = defineProps({
 	date: String,

+ 4 - 2
components/fs-timeline/fs-timeline.vue

@@ -3,9 +3,11 @@
 		<view class="fs-timeline-item" v-for="(item, index) in options" :key="index">
 			<view class="fs-dot-box">
 				<slot name="dot" :item="item" :index="index">
-					<view class="fs-dot" 
+					<view 
+						class="fs-dot" 
 						:class="index === 0 ? 'bg-' + activeColorType : ''" 
-						:style="{backgroundColor: index === 0 ? activeColor : '#969799'}">
+						:style="{backgroundColor: index === 0 ? activeColor : '#969799'}"
+					>
 					</view>
 				</slot>
 			</view>

+ 1 - 0
hooks/useLoadmore/index.js

@@ -10,6 +10,7 @@ export default loadmoreRef => {
 	
 	onMounted(() => {
 		refs = getCurrentInstance().refs
+		console.log(refs);
 		refs[loadmoreRef].query()
 	})
 	

+ 1 - 1
pages/login/login2.vue

@@ -33,7 +33,7 @@
 			</fs-form>
 			
 			<fs-cell justify="right">
-				<navigator class="primary fs12" slot="title" url="./forgetPwd" v-show="curTab === 0">忘记密码?</navigator>
+				<navigator class="primary fs12" slot="title" url="./forgetPwd" v-show="curTab === 1">忘记密码?</navigator>
 				<navigator class="primary fs12" slot="value" url="./register">去注册</navigator>
 			</fs-cell>
 		</view>

+ 13 - 0
pages/login/login4.vue

@@ -20,6 +20,8 @@
 			</fs-field>
 			<fs-gutter height="100rpx" bgColor="#fff"></fs-gutter>
 			<fs-button full round @click="handleLogin" :customStyle="{background: 'linear-gradient(to right, #00c6fc, #9adcf1)'}">登录</fs-button>
+			<fs-gutter height="60rpx" bgColor="#fff"></fs-gutter>
+			<fs-button full round type="success"  @click="getUserProfile">微信登录</fs-button>
 		</fs-form>
 	</view>
 </template>
@@ -56,6 +58,17 @@ const handleLogin = () => {
 		})
 	})
 }
+
+const getUserProfile = () => {
+	wx.getUserProfile({
+		desc: '用于完善会员资料',
+		success: res => {
+			// store.dispatch('wxLogin').then(res => {
+				
+			// })
+		}
+	})
+}
 </script>
 
 <style>