Ver Fonte

签到隐藏

Xiao_123 há 6 meses atrás
pai
commit
fad2dc546f

+ 0 - 1
components/Navbar/index.vue

@@ -23,7 +23,6 @@ onLoad(() => {
   statusBarHeight.value = systemInfo.statusBarHeight
   const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
   navbarHeight.value = menuButtonInfo.height + ((menuButtonInfo.top - statusBarHeight.value) * 2) + 10
-
 })
 </script>
 

+ 14 - 13
layout/components/authModal/login/index.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="ss-p-30 head-box">
     <template v-if="changeType === 'login'">
-      <view class="head-title">欢迎来到门墩儿</view>
+      <view class="head-title ss-m-b-30">欢迎来到门墩儿</view>
       <uni-segmented-control
         class="ss-m-t-30"
         :current="current"
@@ -13,9 +13,15 @@
       <!-- <view class="head-subtitle ss-m-t-10">未注册的手机号,验证后自动注册账号</view> -->
 
       <view class="ss-m-t-30">
+        <!-- 手机号快捷登录 -->
+        <view v-if="current === 0">
+          <button v-if="!protocol" class="send-button" @click="showProtocolToast">手机号快捷登录</button>
+          <button v-else class="send-button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">手机号快捷登录</button>
+        </view>
+
         <!-- 短信验证码登录 -->
         <uni-forms
-          v-if="current === 0"
+          v-if="current === 1"
           ref="smsLoginRef"
           v-model="state.sms"
           :rules="state.smsRules"
@@ -42,7 +48,7 @@
 
         <!-- 账号密码登录 -->
         <uni-forms
-          v-if="current === 1"
+          v-if="current === 2"
           ref="accountLoginRef"
           v-model="state.account"
           :rules="state.rules"
@@ -59,11 +65,6 @@
           </uni-forms-item>
         </uni-forms>
 
-        <view v-if="current === 2">
-          <button v-if="!protocol" class="send-button" @click="showProtocolToast">手机号快捷登录</button>
-          <button v-else class="send-button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">手机号快捷登录</button>
-        </view>
-
         <view class="quickLogon">
           <view>
             <!-- <button v-if="!protocol" class="wxLogon" type="text" :plain="true" @click="showProtocolToast">微信一键登录</button>
@@ -71,7 +72,7 @@
           </view>
           <view class="register" @tap="handleChangeRegister">还没有登录账户?去注册</view>
         </view>
-        <button v-if="current !== 2" class="send-button" @tap="handleLogin"> 登 录  </button>
+        <button v-if="current !== 0" class="send-button" @tap="handleLogin"> 登 录  </button>
         <view class="agreement-box ss-flex ss-row-center" style="margin-bottom: 30px;">
           <uni-icons size="20" :type="protocol ? 'checkbox-filled' : 'circle'" :color="protocol ? '#00897B' : '#ccc'" @tap="protocol = !protocol"></uni-icons>
           <view class="color-999 ss-flex ss-col-center ss-m-l-8 font-size-13">
@@ -150,7 +151,7 @@ import { getSmsCode, getSmsTimer } from '@/utils/code'
 import { userStore } from '@/store/user'
 
 const useUserStore = userStore()
-const items = ['短信登录', '账号登录', '手机号快捷登录']
+const items = ['手机号快捷登录', '短信登录', '账号登录']
 const current = ref(0)
 const accountLoginRef = ref()
 const smsLoginRef = ref()
@@ -259,7 +260,7 @@ const getPhoneNumber = async (e) => {
         phoneCode: e.detail.code,
         state: e.detail.encryptedData,
       }
-      await useUserStore.handleSmsLogin(query, 2)
+      await useUserStore.handleSmsLogin(query, current.value)
     },
     fail:(res)=> { console.log("获取登录凭证code失败!", res) }
   })
@@ -279,9 +280,9 @@ async function handleRegister () {
 // 登录
 const handleLogin = async () => {
   if (!protocol.value) return uni.showToast({ title: '请先阅读并同意用户协议和隐私政策', icon: 'none' })
-  const validate = await unref(current.value === 0 ? smsLoginRef : accountLoginRef).validate()
+  const validate = await unref(current.value === 1 ? smsLoginRef : accountLoginRef).validate()
   if (!validate) return
-  const query = current.value === 0 ? state.value.sms : state.value.account
+  const query = current.value === 1 ? state.value.sms : state.value.account
   Object.assign(query, {
     account: query.phone
   })

+ 1 - 2
pages/index/crowdsourcing.vue

@@ -174,7 +174,6 @@ $defaultColor: #999;
 		// }
 		&-recommend {
 			padding: 0 24rpx;
-			margin-bottom: 20rpx;
 			&-box {
 				@include box;
 				&-title {
@@ -209,7 +208,7 @@ $defaultColor: #999;
 		}
 		&-list {
 			width: 100%;
-			padding: 0 24rpx 24rpx 24rpx;
+			// padding: 0 24rpx 24rpx 24rpx;
 			box-sizing: border-box;
 			&-box {
 				padding: 24rpx;

+ 53 - 53
pages/index/welfare.vue

@@ -30,7 +30,7 @@
             </view>
           </view>
           <!-- 签到 -->
-          <view class="signIn">
+          <!-- <view class="signIn">
             <view class="signIn-content">
               <view class="signIn-content-items">
                 <view class="item" v-for="(sign, i) in SignItems" :key="sign.day">
@@ -53,7 +53,7 @@
                 </button>
               </view>
             </view>
-          </view>
+          </view> -->
           <!-- 积分规则、积分兑换 -->
           <view class="ss-m-t-20">
             <uni-section title="积分规则" type="line"  style="background-color: #fff;">
@@ -94,9 +94,9 @@
 import { ref, watch } from 'vue'
 import layoutPage from '@/layout'
 import {
-	getRewardSignInConfigList,
-	getRewardSignInRecordSummary,
-  createRewardSignInRecord,
+	// getRewardSignInConfigList,
+	// getRewardSignInRecordSummary,
+  // createRewardSignInRecord,
   getAccountBalance,
   getUserAccount,
 } from '@/api/sign'
@@ -108,7 +108,7 @@ import { showAuthModal } from '@/hooks/useModal'
 const useUserStore = userStore()
 // 设置自定义tabBar选中值
 
-const SignItems = ref([])
+// const SignItems = ref([])
 // 积分规则
 const integralRules = ref([])
 const getTask = async () => {
@@ -131,18 +131,18 @@ const handleClickGoods = () => {
 }
 
 // 连续签到天数
-const continuousDay = ref(0)
+// const continuousDay = ref(0)
 // 今天有无签到
-const todaySignIn = ref(false)
+// const todaySignIn = ref(false)
 
 // 今天
-const todayNumber = ref()
+// const todayNumber = ref()
 
 const balance = ref({})
 
 watch([() => useUserStore.refreshToken, () => useUserStore.isLogin], () => {
   if (useUserStore.isLogin) {
-    getSummary()
+    // getSummary()
     getBalance()
   }
 })
@@ -157,9 +157,9 @@ onShow(() => {
 
 function init () {
   // 获取签到列表
-  getSignIn()
+  // getSignIn()
   // 获取签到信息
-  getSummary()
+  // getSummary()
   // 获取余额积分
   getBalance()
   // 获取积分规则列表
@@ -178,51 +178,51 @@ async function getBalance() {
 
 
 // 获取个人签到统计
-async function getSummary() {
-  const { data } = await getRewardSignInRecordSummary()
-  if (!data) return
-  continuousDay.value = data.continuousDay // 连续签到第n天
-  todaySignIn.value = data.todaySignIn // 今天有无签到
-  todayNumber.value = todaySignIn.value ? continuousDay.value - 1 : continuousDay.value
-}
+// async function getSummary() {
+//   const { data } = await getRewardSignInRecordSummary()
+//   if (!data) return
+//   continuousDay.value = data.continuousDay // 连续签到第n天
+//   todaySignIn.value = data.todaySignIn // 今天有无签到
+//   todayNumber.value = todaySignIn.value ? continuousDay.value - 1 : continuousDay.value
+// }
 // 获取签到列表
-async function getSignIn () {
-  try {
-    const { data } = await getRewardSignInConfigList()
-    SignItems.value = data
-  } catch (error) {
+// async function getSignIn () {
+//   try {
+//     const { data } = await getRewardSignInConfigList()
+//     SignItems.value = data
+//   } catch (error) {
     
-  }
-}
+//   }
+// }
 // 签到
-async function handleSignIn () {
-  uni.showLoading({
-    title: '正在签到'
-  })
-  try {
-    const { code } = await createRewardSignInRecord()
-    if (code !== 0) {
-      return
-    }
-    setTimeout(async () => {
-      const { code: _code } = await getSummary()
-      if (_code !== 0) {
-        return
-      }
-      uni.showToast({
-        title: '签到成功',
-        icon: 'success',
-        mask: true
-      })
-      // 更新积分
-      getBalance()
-    }, 1000)
-  } catch (error) {
+// async function handleSignIn () {
+//   uni.showLoading({
+//     title: '正在签到'
+//   })
+//   try {
+//     const { code } = await createRewardSignInRecord()
+//     if (code !== 0) {
+//       return
+//     }
+//     setTimeout(async () => {
+//       const { code: _code } = await getSummary()
+//       if (_code !== 0) {
+//         return
+//       }
+//       uni.showToast({
+//         title: '签到成功',
+//         icon: 'success',
+//         mask: true
+//       })
+//       // 更新积分
+//       getBalance()
+//     }, 1000)
+//   } catch (error) {
     
-  } finally {
-    uni.hideLoading()
-  }
-}
+//   } finally {
+//     uni.hideLoading()
+//   }
+// }
 
 function handleLogin () {
   if (!useUserStore.isLogin) {

+ 33 - 17
pagesA/integral/index.vue

@@ -5,11 +5,11 @@
         <view>
           <view class="panel">
             <view>
-              <uni-icons color="#f30" type="icon-renminbi1688" size="16" custom-prefix="iconfont"></uni-icons>
+              <!-- <uni-icons color="#f30" type="icon-renminbi1688" size="16" custom-prefix="iconfont"></uni-icons> -->
               <text class="text">{{ balance.point }}</text>
             </view>
             <view>
-              <button class="btn" @tap="handleUse">使用积分</button>
+              <button class="btn" @tap="handleUse">积分兑换</button>
             </view>
           </view>
           <view class="list">
@@ -25,6 +25,13 @@
           </view>
         </view>
       </scroll-view>
+
+      <uni-popup ref="inputDialog" type="dialog">
+        <view class="shareQrCodePopupContent">
+          <view class="ss-m-b-10">请前往网页版门墩儿商城查看</view>
+          <uni-link href="http://menduner.citupro.com:7878/mall" text="点击复制网页地址" color="#00897B" fontSize="16" copyTips="已复制,请在电脑端打开"></uni-link>
+        </view>
+      </uni-popup>
     </view>
   </layout-page>
 </template>
@@ -46,6 +53,7 @@ const pageInfo = ref({
 })
 const total = ref(0)
 const more = ref('more')
+const inputDialog = ref()
 
 getBalance()
 getList()
@@ -96,21 +104,22 @@ function loadingMore () {
 }
 
 function handleUse () {
-  wx.navigateToMiniProgram({  
-    appId: 'wx6decdf12f9e7a061', // 目标小程序的 appId
-    // envVersion: 'develop',
-    success(res) {  
-        // 打开成功  
-        console.log('成功跳转至小程序:', res);  
-    },  
-    fail(err) {  
-        // 打开失败
-        uni.showToast({
-          title: '打开商城失败',
-          icon: 'none'
-        })
-    }  
-  })
+  // wx.navigateToMiniProgram({  
+  //   appId: 'wx6decdf12f9e7a061', // 目标小程序的 appId
+  //   // envVersion: 'develop',
+  //   success(res) {  
+  //       // 打开成功  
+  //       console.log('成功跳转至小程序:', res);  
+  //   },  
+  //   fail(err) {  
+  //       // 打开失败
+  //       uni.showToast({
+  //         title: '打开商城失败',
+  //         icon: 'none'
+  //       })
+  //   }  
+  // })
+  inputDialog.value.open()
 }
 
 </script>
@@ -156,4 +165,11 @@ function handleUse () {
     // padding: 20rpx;
   }
 }
+.shareQrCodePopupContent {
+	width: 75vw;
+	padding: 40rpx;
+	margin-bottom: 20rpx;
+	text-align: center;
+	background-color: #fff;
+}
 </style>

+ 1 - 1
store/user.js

@@ -50,7 +50,7 @@ export const userStore = defineStore('user', {
     },
     // 登录
     async handleSmsLogin (query, index = 0) {
-      const apiList = [smsLogin, passwordLogin, weChatLogin] 
+      const apiList = [weChatLogin, smsLogin, passwordLogin] 
       const { data, code } = await apiList[index](query)
       if (code === 0) {
         uni.showToast({