Quellcode durchsuchen

添加客服功能

李万涛 vor 2 Jahren
Ursprung
Commit
65edbaffdc

+ 0 - 184
common/wechat/sdk1.js

xqd
@@ -1,184 +0,0 @@
-var jweixin = require("jweixin-module");
-import http from "@/common/request/index";
-import $platform from "@/common/platform";
-
-import {
-	wechatJssdk
-} from '@/api/public/index.js'
-
-export default {
-	//判断是否在微信中
-	isWechat() {
-		var ua = window.navigator.userAgent.toLowerCase();
-		if (ua.match(/micromessenger/i) == "micromessenger") {
-			return true;
-		} else {
-			return false;
-		}
-	},
-
-	// 鉴权页面
-	async initJssdk(callback) {
-		let url = window.location.href.split('#')[0]
-		let res = await wechatJssdk({
-			uri: url
-		})
-		console.log('initJssdk(callback)返回值', res);
-		if (res.code == 0) {
-			jweixin.config({
-				debug: res.data.debug,
-				appId: res.data.appId,
-				timestamp: res.data.timestamp,
-				nonceStr: res.data.nonceStr,
-				signature: res.data.signature,
-				jsApiList: res.data.jsApiList,
-				openTagList: res.data.openTagList
-			});
-			if (callback) {
-				callback(res.data);
-			}
-		}
-	},
-
-	//在需要定位页面调用
-	getLocation(callback) {
-		this.isWechat() && this.initJssdk(function(res) {
-			jweixin.ready(function() {
-				jweixin.getLocation({
-					type: "gcj02", // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
-					success: function(res) {
-						callback(res);
-					},
-					fail: function(res) {
-						console.log("%c微信H5sdk,getLocation失败:",
-							"color:green;background:yellow");
-					},
-				});
-			});
-		});
-	},
-
-	//获取微信收货地址
-	openAddress(callback) {
-		this.isWechat() && this.initJssdk(function(res) {
-			jweixin.ready(function() {
-				jweixin.openAddress({
-					success: function(res) {
-						callback(res);
-					},
-					fail: function(err) {
-						console.log("%c微信H5sdk,openAddress失败:",
-							"color:green;background:yellow");
-					},
-					complete: function(msg) {}
-				});
-			});
-		});
-	},
-
-	// 微信扫码
-	scanQRCode(callback) {
-		this.isWechat() && this.initJssdk(function(res) {
-			jweixin.ready(function() {
-				jweixin.scanQRCode({
-					needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
-					scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
-					success: function(res) {
-						callback(res);
-					},
-					fail: function(res) {
-						console.log("%c微信H5sdk,scanQRCode失败:",
-							"color:green;background:yellow");
-					},
-				});
-			});
-		});
-	},
-
-	// 微信分享
-	share(data, callback) {
-		// console.log('1',data);
-		this.isWechat() && this.initJssdk(function(res) {
-			jweixin.ready(function() {
-				// console.log(data);
-				var shareData = {
-					title: data.title,
-					desc: data.desc,
-					link: data.path,
-					imgUrl: data.image,
-					success: function(res) {
-						console.log('分享成功ll');
-						// callback(res);
-						// 分享后的一些操作,比如分享统计等等
-					},
-					cancel: function(res) {
-						// console.log(res);
-					}
-				};
-
-				jweixin.updateAppMessageShareData(shareData); //新版接口
-				//分享到朋友圈接口
-				jweixin.updateTimelineShareData(shareData);
-
-
-			});
-		});
-
-	},
-
-
-	// 打开坐标位置
-	openLocation(data, callback) { //打开位置
-		this.isWechat() && this.initJssdk(function(res) {
-			jweixin.ready(function() {
-				jweixin.openLocation({ //根据传入的坐标打开地图
-					latitude: data.latitude,
-					longitude: data.longitude
-				});
-			});
-		});
-	},
-	// 选择图片
-	chooseImage(callback) { //选择图片
-		this.isWechat() && this.initJssdk(function(res) {
-			jweixin.ready(function() {
-				jweixin.chooseImage({
-					count: 1,
-					sizeType: ["compressed"],
-					sourceType: ["album"],
-					success: function(rs) {
-						callback(rs);
-					}
-				});
-			});
-		});
-	},
-
-	//微信支付
-	wxpay(data, callback) {
-		let that = this;
-		this.isWechat() && this.initJssdk(function(res) {
-			jweixin.ready(function() {
-				jweixin.chooseWXPay({
-					timestamp: data
-						.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
-					nonceStr: data.nonceStr, // 支付签名随机串,不长于 32 位
-					package: data.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
-					signType: data.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
-					paySign: data.paySign, // 支付签名
-					success: function(res) {
-						callback(res);
-					},
-					fail: function(res) {
-						console.log("%c微信H5sdk,chooseWXPay失败:",
-							"color:green;background:yellow");
-						callback(res);
-					},
-					cancel: function(res) {
-
-					},
-				});
-			});
-		});
-	}
-};

+ 6 - 3
pages/index/scoreDetail/index.vue

xqd
@@ -129,10 +129,13 @@
 				}
 			},
 
+			// jumpToKefu() {
+			// 	uni.navigateTo({
+			// 		url: '/pages/user/public/kefu'
+			// 	})
+			// },
 			jumpToKefu() {
-				uni.navigateTo({
-					url: '/pages/user/public/kefu'
-				})
+				window.open('https://work.weixin.qq.com/kfid/kfc807229b723286051')
 			},
 			async goStudy(course_id) {
 

+ 6 - 4
pages/tusk/tuskDetail/index.vue

xqd
@@ -113,12 +113,14 @@
 
 		},
 		methods: {
+			// jumpToKefu() {
+			// 	uni.navigateTo({
+			// 		url: '/pages/user/public/kefu'
+			// 	})
+			// },
 			jumpToKefu() {
-				uni.navigateTo({
-					url: '/pages/user/public/kefu'
-				})
+				window.open('https://work.weixin.qq.com/kfid/kfc807229b723286051')
 			},
-
 			async handleReceiveOrder(task_id) {
 				let _this = this
 				uni.showModal({

+ 6 - 64
pages/user/public/kefu.vue

xqd xqd
@@ -5,34 +5,10 @@
 			<view :style="{height: tobheight+'px'}"></view>
 		</view>
 		<view class="server">
-			<image src="/static/images/kefu.png" mode=""></image>
-		</view>
-		<view v-if="appInfo.kf_tel" class="kefu">
-			<view class="dian"></view>
-			<view class="">客服手机号:{{appInfo.kf_tel}}</view>
-			<view class="yijian"><u-button @click="bohao" color="#26B3A0" size="mini" type="primary" shape="circle"
-					text="一键拨号"></u-button></view>
-		</view>
-		<view v-if="appInfo.kf_wechat" class="kefu">
-			<view class="dian"></view>
-			<view>客服微信号:{{appInfo.kf_wechat}}</view>
-			<view class="yijian"><u-button @click="fhuzhi" color="#26B3A0" size="mini" type="primary" shape="circle"
-					text="一键复制"></u-button></view>
+			<!-- <image src="/static/images/kefu.png" mode=""></image> -->
 
+			<iframe src="https://work.weixin.qq.com/kfid/kfc807229b723286051" frameborder="0"></iframe>
 		</view>
-		<!-- <view class="sds">dfhsfsdh25</view> -->
-		<block v-if="appInfo.kf_qrcode_path">
-			<view class="kefu">
-				<view class="dian"></view>
-				<view class="">客服二维码</view>
-			</view>
-			<view class="qrcode_path">
-				<image @click="viewsave(appInfo.kf_qrcode_path)" :src="appInfo.kf_qrcode_path" mode="widthFix"></image>
-			</view>
-		</block>
-
-
-		<wike-loading-page :isLoading="isLoading"></wike-loading-page>
 	</view>
 </template>
 
@@ -58,46 +34,12 @@
 			...mapGetters(['appInfo'])
 		},
 		watch: {
-			appInfo: function(e) {
-				let that = this;
-				uni.setNavigationBarTitle({
-					title: that.appInfo.site_name
-				})
-			}
-		},
-		onLoad() {
-			if (this.platform == 'wxMiniProgram') {
-				var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight
-				var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop
-				this.tobheight = (menumtop + paddingtop + uni.getMenuButtonBoundingClientRect().height)
-			}
-			this.isLoading = false
-			console.log('this.tobheight', this.tobheight);
+
 		},
+		onLoad() {},
 		methods: {
-			viewsave(e) {
-				uni.previewImage({
-					urls: [e],
-					current: 0
-				})
-			},
-			bohao() {
-				var that = this;
-				uni.makePhoneCall({
-					phoneNumber: that.appInfo.kf_tel
-				});
-			},
-			fhuzhi() {
-				var that = this;
-				uni.setClipboardData({
-					data: that.appInfo.kf_wechat,
-					success: function() {
-						uni.showToast({
-							title: '微信号已复制'
-						})
-					}
-				});
-			}
+
+
 		}
 	}
 </script>

+ 16 - 5
pages/user/user.vue

xqd xqd xqd
@@ -69,6 +69,13 @@
 			<!-- 用户服务 -->
 			<view class="com-item">
 				<view class="com-wrap">
+					<view class="cell" @click="openKefu">
+						<view class="cell-left">
+							<u-icon name="server-fill" color="#26B3A0" size="22"></u-icon>
+							<view class="cell-text">联系客服</view>
+						</view>
+						<u-icon name="arrow-right" color="#9e9e9e" size="18"></u-icon>
+					</view>
 					<navigator class="cell" v-for="(item, index) in serverList" :key="index" :url="item.path">
 						<view class="cell-left">
 							<u-icon :name="item.icon" color="#26B3A0" size="22"></u-icon>
@@ -219,11 +226,12 @@
 						iconName: 'icon-xiugaioryijian'
 					}
 				],
-				serverList: [{
-						title: '联系客服',
-						icon: 'server-fill',
-						path: '/pages/user/public/kefu'
-					},
+				serverList: [
+					// {
+					// 	title: '联系客服',
+					// 	icon: 'server-fill',
+					// 	path: '/pages/user/public/kefu'
+					// },
 					{
 						title: '系统设置',
 						icon: 'setting-fill',
@@ -285,6 +293,9 @@
 
 		},
 		methods: {
+			openKefu() {
+				window.open('https://work.weixin.qq.com/kfid/kfc807229b723286051')
+			},
 			getlogin() {
 				// console.log(2222);
 				uni.navigateTo({