ccj 2 rokov pred
rodič
commit
04f7d24152
1 zmenil súbory, kde vykonal 52 pridanie a 15 odobranie
  1. 52 15
      common/helper.js

+ 52 - 15
common/helper.js

@@ -92,24 +92,61 @@ const setAudit = (item) => {
 	}
 	console.log(item)
 }
-const contactCustomerService = (item) => {
-	console.log(item)
-	if (!item) {
-		// item = '400123123'
-		item = '4006688647'
+const contactCustomerService = (phone) => {
+	console.log(phone)
+	//客服
+	if (!phone) {
+		phone = '4006688647'
 	}
-	console.log("联系客服")
-	uni.makePhoneCall({
-		phoneNumber: item,
-		success: (res) => {
-			console.log('调用成功!')
+	const res = uni.getSystemInfoSync();
+	// ios系统默认有个模态框
+	if(res.platform=='ios'){
+		uni.makePhoneCall({
+		phoneNumber:phone,
+		success(){
+			console.log('拨打成功了');
 		},
-		// 失败回调
-		fail: (res) => {
-			console.log('调用失败!')
-			contactCustomerService(item)
+		fail() {
+			console.log('拨打失败了');
 		}
-	});
+	})
+	}else{
+	//安卓手机手动设置一个showActionSheet
+		uni.showActionSheet({
+			itemList: [phone,'呼叫'],
+			success:function(res){
+				console.log(res);
+			   if(res.tapIndex==1){
+				uni.makePhoneCall({
+				  phoneNumber: phone,
+				success: (res) => {
+					console.log('调用成功!')
+					
+				},
+			  
+				// 失败回调
+				fail: (res) => {
+					console.log('调用失败!')
+					// contactCustomerService(item)
+				}
+				})
+			  }
+			}
+		  })
+	}
+	// console.log("联系客服")
+	// uni.makePhoneCall({
+	// 	phoneNumber: item,
+	// 	success: (res) => {
+	// 		console.log('调用成功!')
+	// 	},
+
+	// 	// 失败回调
+	// 	fail: (res) => {
+	// 		console.log('调用失败!')
+	// 		contactCustomerService(item)
+	// 	}
+	// });
 }
 // 获取市、区简称
 const filterUrban = (s) => {