浏览代码

续期问题

shish 2 年之前
父节点
当前提交
4d4a8339c0
共有 1 个文件被更改,包括 56 次插入11 次删除
  1. 56 11
      ghsApp/src/admin/home/workbench.vue

+ 56 - 11
ghsApp/src/admin/home/workbench.vue

@@ -236,11 +236,11 @@ export default {
 		// #ifdef APP-PLUS
 		let type = uni.getSystemInfoSync().platform
 		if(type == 'android'){
-			this.popRenew()
+			this.beginShowRenew()
 		}
 		// #endif
 		// #ifdef MP-WEIXIN
-			this.popRenew()
+			this.beginShowRenew()
 		// #endif
 	},
 	onPullDownRefresh() {
@@ -268,19 +268,63 @@ export default {
 			this.$refs.renewRef.close()
 			noRemind().then(res=>{ })
 		},
-		popRenew(){
+		beginShowRenew(){
 			let that = this
-			needRemind().then(res=>{
-				if(res.code == 1){
-					that.currentDeadline = res.data.currentDeadline
-					that.newDeadline = res.data.newDeadline
-					if(res.data.need && res.data.need == 1){
-						that.$refs.renewRef.open('center')
+			setTimeout(function(){
+				needRemind().then(res=>{
+					if(res.code == 1){
+						that.currentDeadline = res.data.currentDeadline
+						that.newDeadline = res.data.newDeadline
+						if(res.data.need && res.data.need == 1){
+							that.$refs.renewRef.open('center')
+						}
 					}
-				}
-			})
+				})
+			},1500)
 		},
 		startRenew(){
+
+			// #ifdef APP-PLUS
+			let that = this
+			let type = uni.getSystemInfoSync().platform
+			that.$msg("请在小程序上续期")
+			if(type == 'android'){
+
+				if(plus.runtime.isApplicationExist({pname:'com.tencent.mm',action:'weixin://'})){
+					plus.share.getServices(function(s){
+						var sweixin
+						for (var i = 0; i < s.length; i++) {
+						var t = s[i];
+						if (t.id == 'weixin') {
+							sweixin = t;
+						}
+						}
+						let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs ? that.dictInfo.miniOriginalId.current.ghs : ''
+						if (sweixin && sweixin.nativeClient) {
+						sweixin.launchMiniProgram({
+							id: miniOriginalId,
+							path: '/admin/home/workbench',
+							type: 0
+						});
+						} else {
+						that.$msg("没有找到微信服务")
+						//that.$msg("获取微信失败:" + e.message)
+						//console.log(JSON.stringify(e));
+						}
+					}, function(e){
+						that.$msg("没有找到微信服务哦")
+						//that.$msg("获取微信失败:" + e.message)
+						//console.log(JSON.stringify(e));
+					});
+				} else {
+					that.$msg("请安装微信,再打开小程序")
+					return false
+				}
+
+				return true
+			}
+			// #endif
+			// #ifdef MP-WEIXIN
 			uni.showLoading({mask:true})
 			renewShop().then(res=>{
 				uni.hideLoading()
@@ -288,6 +332,7 @@ export default {
 					wexinPay(res.data, this.getSuccess, this.getError)
 				}
 			})
+			// #endif
 		},
 		getSuccess(){
 			this.closeRenew();