zhengkaixin 2 년 전
부모
커밋
0c9e72bf97
5개의 변경된 파일271개의 추가작업 그리고 18개의 파일을 삭제
  1. 1 1
      apis/weixin.js
  2. 55 1
      pages/login/login.vue
  3. 66 9
      pages/monthlyCardActivity/monthlyCardBuy.vue
  4. 64 4
      pages/user/InviteFriends.vue
  5. 85 3
      pages/user/finance/recharge.vue

+ 1 - 1
apis/weixin.js

@@ -51,7 +51,7 @@ export function getConfig() {
 }
 
 export function checkSubscribe(data) {
-	return request({
+	return requestWhite({
 		url: '/wechat/checkSubscribe',
 		data: data,
 		method: 'post',

+ 55 - 1
pages/login/login.vue

@@ -31,16 +31,30 @@
 					</view>
 				</view>
 			</view>		
-			<u-button :style="[inputStyle]" class="login-btn" type="success" shape="circle" @click="login">登录</u-button>
+			<u-button    :style="[inputStyle]" class="login-btn" type="success" shape="circle" @click="login">登录</u-button>
 			<u-verification-code :seconds="sendMsgSecond" ref="uCode" @change="codeChange" @end="end" @start="start" change-text="已发送(Xs)">
 			</u-verification-code>
 		</view>	
+		
+		<u-modal v-model="show1" @confirm="gotoGz"
+		cancel-text="暂不关注"  
+		confirm-text="前往关注"
+		
+		 confirm-color="#53b56b"
+			:show-cancel-button="true" 
+			ref="uModal2" :asyncClose="true" 
+			 >
+			<view style="padding: 15px;"
+			
+			>请关注<span style=" color:  #53b56b;">{{projectName}}</span>公众号,以便第一时间收到充电结束消息提醒</view>
+		</u-modal>
 	</view>
 </template>
 
 <script>
 	import * as loginApi from '@/apis/login.js'
 	import * as API from '@/apis/index.js'
+	import * as API_weixin from '@/apis/weixin.js'
 	
 	import {
 		checkPhone
@@ -66,6 +80,8 @@
 				code: '',
 				codeId: '',
 				projectName:'',
+				show1:false,
+				show2:false,
 			}
 		},
 		computed: {
@@ -117,7 +133,40 @@
 			else
 				this.theme('standard')
 		},
+		onShow() {
+			this.checkSubscribe()
+		},
 		methods: {
+			gotoGz(){
+				this.carhelp.setGzDate()
+				var url="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=Mzg4Njc5ODEyMw==#wechat_redirect";
+				window.location.href=url
+				
+			},
+			checkSubscribe(){
+				API_weixin.checkSubscribe({
+					openId: this.carhelp.getOpenId() 
+				}).then((res) => {
+					
+					if(res.data=="0"){
+						this.show1=true
+						
+					}else{
+						//this.init();
+						this.show2=true;
+						//this.carhelp.setGzDate() 
+						
+					}
+					
+					//setGzDate
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+				
+			},
+			
 			theme(type) {
 			  if(type == 'elder')	
 			  {
@@ -198,6 +247,11 @@
 				this.value = !this.value;
 			},
 			login() {
+				if(!this.show2){
+					this.show1=true;
+					return
+				}
+				
 				var checkPhoneResult = checkPhone(this.form.telephone);
 				
 				if(!this.form.telephone || checkPhoneResult != true) {

+ 66 - 9
pages/monthlyCardActivity/monthlyCardBuy.vue

@@ -45,12 +45,15 @@
 		</u-modal>
 		<img id="qrcode" style="display: none;">
 		
-		
-		
-		<view class="bottom" v-if="!endCardBool" >
+		<view class="bottom" v-if="!show2" @click="gotoGz" >
+			<button class="dredge" >关注公众号</button>
+			
+		</view>
+		<view class="bottom" v-else-if="!endCardBool" >
 			<button class="dredge" >已下架</button>
 			
 		</view>
+		
 		<!-- 立即开通 -->
 		<view class="bottom" v-else-if="ispay" >
 			<button class="dredge" >已购买</button>
@@ -66,11 +69,28 @@
 			<p>开通表示阅读并同意
 				<text class="agreement" @click="gotoUrl('pages/article/details?code=FWFZKXY')">《服务费折扣协议》</text>
 			</p>
-		</view>
+		</view>
+		
+		
+		<u-modal v-model="show1" @confirm="gotoGz"
+		cancel-text="暂不关注"  
+		confirm-text="前往关注"
+		
+		 confirm-color="#53b56b"
+			:show-cancel-button="true" 
+			ref="uModal2" :asyncClose="true" 
+			 >
+			<view style="padding: 15px;"
+			
+			>请关注<span style=" color:  #53b56b;">{{projectName}}</span>公众号,才能参与活动购买月卡</view>
+		</u-modal>
+		 
 	</view>
 </template>
 
-<script>
+<script>
+	import * as API_weixin from '@/apis/weixin.js'
+	
 	import * as Pay from '@/apis/weixin.js'
 	import * as API from '@/apis/card.js'
 	import * as loginApi from '@/apis/login.js'
@@ -87,7 +107,8 @@
 			return {
 				cardId:'3e1b0f8f-61b0-405f-a285-929b5346479f',
 				qrCodeImg: "",
-				showModel: false,
+				showModel: false,
+				projectName:"",
 				list: [{
 					text: '微信',
 
@@ -98,15 +119,22 @@
 				submitForm:{},
 				detail:{},
 				ispay:true,
+				show2:false,
+				show1:false,
 				endTime:"2022-08-08"
 			}
 		},
+		onLoad() {
+			this.projectName=process.car.ProjectName;
+			
+		},
 		onReady() {
-			this.getInfo();
-			this.getUserInfo()
+			
+			//this.checkSubscribe()
+			
 		},
 		 onShow(){
-			 this.getUserInfo();
+			 this.checkSubscribe();
 		 },
 		 computed:{
 			 endCardBool(){
@@ -121,6 +149,35 @@
 			 }
 		 },
 		methods: {
+			gotoGz(){
+				this.carhelp.setGzDate()
+				var url="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=Mzg4Njc5ODEyMw==#wechat_redirect";
+				window.location.href=url
+				
+			},
+			checkSubscribe(){
+				API_weixin.checkSubscribe({
+					openId: this.carhelp.getOpenId() 
+				}).then((res) => {
+					
+					if(res.data=="0"){
+						this.show1=true
+						
+					}else{
+						this.getInfo();
+						this.getUserInfo()
+						this.show2=true;
+						//this.carhelp.setGzDate() 
+					}
+					
+					//setGzDate
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+				
+			},
 			userCardBool(userCard){
 				
 				

+ 64 - 4
pages/user/InviteFriends.vue

@@ -77,6 +77,20 @@
 				</view>
 			</view>
 		</view>
+		
+		<u-modal v-model="show1" @confirm="gotoGz"
+		cancel-text="暂不关注"  
+		confirm-text="前往关注"
+		
+		 confirm-color="#53b56b"
+			:show-cancel-button="true" 
+			ref="uModal2" :asyncClose="true" 
+			 >
+			<view style="padding: 15px;"
+			
+			>请关注<span style=" color:  #53b56b;">{{projectName}}</span>公众号,以便第一时间收到充电结束消息提醒</view>
+		</u-modal>
+		
 	</view>
 </template>
 
@@ -89,6 +103,7 @@
 	import * as API_WeiXin from '@/apis/weixin'
 	import * as API from '@/apis/friends.js'
 	import * as WxJsApi from '@/utils/wxJsApi.js'
+	import * as API_weixin from '@/apis/weixin.js'
 	
 	export default {
 		data() {
@@ -99,13 +114,20 @@
 				show:false,
 				amount:0,
 				uid:"",
-				list:[]
+				list:[],
+				show1:false,
+				show2:false,
+				projectName:"",
+				
 			}
 		},
 		onLoad(op) {
+			this.projectName=process.car.ProjectName;
+			
 				this.id=op.id
 				this.code=op.icode
 				this.uid=op.uid
+				//
 				this.get_wx_config();
 				
 		},
@@ -119,6 +141,46 @@
 		onShow() {
 			
 			//pages/user/InviteFriends?id=2&icode=FX&uid=731b9765-3565-4b3c-918b-5d3ec3b505fb
+				if(this.show2){
+					
+				}
+				this.onShowmethods()
+			
+				this.checkSubscribe()
+				
+		},
+		methods: {
+			gotoGz(){
+				this.carhelp.setGzDate()
+				var url="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=Mzg4Njc5ODEyMw==#wechat_redirect";
+				window.location.href=url
+				
+			},
+			checkSubscribe(){
+				API_weixin.checkSubscribe({
+					openId: this.carhelp.getOpenId() 
+				}).then((res) => {
+					
+					if(res.data=="0"){
+						this.show1=true
+						
+					}else{
+						//this.init();
+						this.show2=true;
+						//this.carhelp.setGzDate() 
+						
+						
+					}
+					
+					//setGzDate
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+				
+			},
+			onShowmethods(){
 				var info=this.carhelp.getPersonInfo();
 				if(info){
 					this.inviteCouponList();
@@ -129,9 +191,7 @@
 						url:url
 					})
 				}
-				
-		},
-		methods: {
+			},
 			theme(type) {
 				
 			  if(type == 'elder')	

+ 85 - 3
pages/user/finance/recharge.vue

@@ -1,6 +1,14 @@
 <template>
 	<view>
 		<ujp-navbar title="充值"></ujp-navbar>
+		
+		<view class="userBanner" v-if="selectImg">
+			<u-image 
+			 :mode="'scaleToFill'" height="160" 
+			:src="selectImg.imgUrl"></u-image>
+				
+		</view>
+				
 		<view class="recharge">
 			<view class="title oldTextjp" oldstyle="font-size:20px">选择充值金额</view>
 			<p class="oldTextjp2" oldstyle="font-size:16px">当前余额{{detail.balance>0?detail.balance:0}}元</p>
@@ -61,8 +69,8 @@
 					</u-modal>
 			<img id="qrcode" style="display: none;" >
 					
-			<view class="recharge-btn">
-				<view>
+			<view class="recharge-btn" v-if="show2">
+				<view v-if="show2">
 					<u-checkbox-group>
 						<u-checkbox active-color="green" v-model="checked" shape="circle" @change="checkboxChange()"></u-checkbox>
 					</u-checkbox-group>
@@ -76,11 +84,35 @@
 					<span>立即充值</span>
 				</u-button>
 			</view>
+			<u-modal v-model="show1" @confirm="gotoGz"
+			cancel-text="暂不关注"  
+			confirm-text="前往关注"
+			
+			 confirm-color="#53b56b"
+				:show-cancel-button="true" 
+				ref="uModal2" :asyncClose="true" 
+				 >
+				<view style="padding: 15px;"
+				
+				>请关注<span style=" color:  #53b56b;">{{projectName}}</span>公众号,才能进行余额充值</view>
+			</u-modal>
+			
+			<view class="recharge-btn transactionClass" v-if="!show2">
+				
+				
+				<u-button
+				 class="success-btn"
+					shape="circle" type="success" @click="gotoGz">
+					<span>关注公众号</span>
+				</u-button>
+			</view>
 		</view>
 	</view>
 </template>
 
 <script>
+	import * as API_weixin from '@/apis/weixin.js'
+	
 	import * as Pay from '@/apis/weixin.js'
 	import QRCode from 'qrcodejs2'
 	import {
@@ -93,6 +125,8 @@
 	export default {
 		data() {
 			return {
+				show1:false,
+				show2:false,
 				submitNum:0,
 				submitNumCk:1,
 				showModel:false,
@@ -103,6 +137,8 @@
 				moneyActiveClass: 1,
 				submitForm:{},
 				qrCodeImg:"",
+				bannerList:[],
+				selectImg:null,
 				moneyList: [
 
 				],
@@ -124,8 +160,13 @@
 				otherNum:"",
 				value1: '',
 				checked: true,
+				projectName:"",
 			}
 		},
+		onLoad() {
+			this.projectName=process.car.ProjectName;
+			
+		},
 		onReady() {
 			if (this.carhelp.getPersonInfo()) {
 				this.userId = this.carhelp.getPersonInfo().id;
@@ -134,6 +175,34 @@
 			this.init();
 		},
 		methods: {
+			gotoGz(){
+				this.carhelp.setGzDate()
+				var url="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=Mzg4Njc5ODEyMw==#wechat_redirect";
+				window.location.href=url
+				
+			},
+			checkSubscribe(){
+				API_weixin.checkSubscribe({
+					openId: this.carhelp.getOpenId() 
+				}).then((res) => {
+					
+					if(res.data=="0"){
+						this.show1=true
+						
+					}else{
+						//this.init();
+						this.show2=true;
+						//this.carhelp.setGzDate() 
+					}
+					
+					//setGzDate
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+				
+			},
 			confirm(){
 				uni.redirectTo({
 					url:"/pages/user/finance/rechargeRes?id="+this.outOrderNo
@@ -200,7 +269,13 @@
 						this.selectItem = this.moneyList[0];
 						this.moneyActiveClass = this.moneyList[0].id
 						//(this.moneyActiveClass)
-
+					}
+					for(var i in this.moneyList){
+						var item =this.moneyList[i]
+						if(item.imgUrl){
+							this.selectImg=item
+							break
+						}
 					}
 					uni.hideLoading()
 					this.init1()
@@ -215,6 +290,9 @@
 				this.moneyActiveClass = index;
 				if(item){
 					this.selectItem=item;
+					if(item.imgUrl){
+						this.selectImg=item
+					}
 				}
 			},
 			// 选中某个单选框时,由radio时触发
@@ -305,6 +383,7 @@
 			}
 		},
 		onShow() {
+			this.checkSubscribe()
 			if (this.isReady) {
 				this.init1()
 			}
@@ -318,6 +397,9 @@
 </style>
 
 <style lang="scss" scoped>
+	.userBanner{
+		margin: 16px;
+	}
 	/deep/.u-radio-group {
 		width: 100%;
 	}