Bläddra i källkod

feat: 绑定失败也删除拓客参数

zhanghui 2 år sedan
förälder
incheckning
1d61e80463
3 ändrade filer med 23 tillägg och 19 borttagningar
  1. 3 3
      App.vue
  2. 18 15
      common/js/commonUtils.js
  3. 2 1
      myPages/familyCard/index.vue

+ 3 - 3
App.vue

@@ -19,7 +19,7 @@
                         uni.removeStorageSync('parent_member_id');
 
 
-                        //用户分享用户绑定
+                        //用户点击用户分享进入小程序,进行绑定操作
                         let shareUserId = uni.getStorageSync('shareUserId')
                         if (shareUserId) {
                             that.$api.scanCode({
@@ -32,7 +32,7 @@
                         }
 
 
-                        //拓客端或者技师端扫码用户绑定
+                        //用户扫码拓客端进入小程序,携带的参数,进行绑定操作
                         let expandParam = uni.getStorageSync('expandParam')
                         if (expandParam) {
 
@@ -69,7 +69,7 @@
 
                         }
 
-                        //用户扫码技师端进入小程序 暂无操作
+                        //用户扫码技师端进入小程序,携带的参数。 暂无操作
                         let promotionParam = uni.getStorageSync('promotionParam')
 
 

+ 18 - 15
common/js/commonUtils.js

@@ -6,19 +6,19 @@ function isDataEmpty(data) {
   if (data === null || data === undefined) {
     return true;
   }
-  
+
   if (typeof data === 'string' && data.trim() === '') {
     return true;
   }
-  
+
   if (Array.isArray(data) && data.length === 0) {
     return true;
   }
-  
+
   if (typeof data === 'object' && Object.keys(data).length === 0) {
     return true;
   }
-  
+
   return false;
 }
 
@@ -28,11 +28,14 @@ function formatDate(timestamp) {
 	const year = date.getFullYear();
 	const month = (date.getMonth() + 1).toString().padStart(2, '0');
 	const day = date.getDate().toString().padStart(2, '0');
-	return `${year}-${month}-${day}`;
+	const hour = date.getHours().toString().padStart(2,'0');
+	const minutes = date.getMinutes().toString().padStart(2,'0');
+	const secoonds = date.getSeconds().toString().padStart(2,'0');
+	return `${year}-${month}-${day} ${hour}:${minutes}:${secoonds}`;
 }
 
 // 日期转换
-function dateFormatYmd(dateStr) { 
+function dateFormatYmd(dateStr) {
 	const timestamp = new Date(dateStr).getTime();
 	const date = new Date(timestamp);
 	const year = date.getFullYear();
@@ -42,27 +45,27 @@ function dateFormatYmd(dateStr) {
 }
 
 // 获取服务器图片
-async function getImgUrlByOssId(ossId){ 
+async function getImgUrlByOssId(ossId){
 	console.log(ossId)
 	if(ossId){
 		try {
-			const res = await uni.$u.http.get('/resource/oss/listByIds/'+ossId,{data: {auth: true}}); 
+			const res = await uni.$u.http.get('/resource/oss/listByIds/'+ossId,{data: {auth: true}});
 			if(res.length > 0){
 				console.log(res[0].url);
 				const url = res[0].url;
 				return url.replace(/^http:/, "https:");
 			}
-		} catch (err) { 
-			await uni.showToast({ 
-				title: "操作失败" 
-			}); 
-		} 
+		} catch (err) {
+			await uni.showToast({
+				title: "操作失败"
+			});
+		}
 	}
 	return null;
 }
 
 // 刷新用户登录信息
-async function refreshUserLoginInfo(){ 
+async function refreshUserLoginInfo(){
 	uni.$u.http.get('/member/wechat/getUserInfo',{data: {auth: true}}).then((res)=>{
 		// 数据获取token
 		this.$store.commit('updateLoginUserInfo', res);
@@ -87,4 +90,4 @@ export default {
   getImgUrlByOssId,
   refreshUserLoginInfo,
   replaceHttpWithHttps
-};
+};

+ 2 - 1
myPages/familyCard/index.vue

@@ -115,7 +115,7 @@
                 <u-icon name="/static/me/o1.png" size="20" v-if="choose" @click="changeChoose"></u-icon>
                 <u-icon name="/static/me/o.png" size="20" v-else @click="changeChoose"></u-icon>
                 <text class="read">我已阅读并同意</text>
-                <text class="agreement" @click="gotoAgreement">使用说明</text>
+                <text class="agreement" @click="gotoAgreement(12,'亲情卡使用说明')">使用说明</text>
             </view>
             <view class="zsBtn" @click="jumpToGive">赠送亲情卡</view>
         </view>
@@ -148,6 +148,7 @@
             },
             // 去协议页面
             gotoAgreement(type, name) {
+                console.log(type,name)
                 uni.navigateTo({
                     url: '/myPages/TermsOfService/index?name=' + name + '&type=' + type,
                 })