puyao před 7 hodinami
rodič
revize
930e4d6073

+ 26 - 0
App.vue

@@ -72,6 +72,32 @@
 		},
 		 
 		methods: {
+			checkUpdates(){
+				const updateManager = uni.getUpdateManager();
+				setTimeout(()=>{
+					uni.showModal({
+						title: '更新提示',
+						content: '新版本已经准备好,是否重启小程序?',
+						confirmText: '立即重启',
+						confirmColor: '#2179f5',
+						showCancel: false,
+						success(res) {
+							if (res.confirm) {
+								// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+								updateManager.applyUpdate();
+							}
+						}
+					});
+				},1000)
+				updateManager.onUpdateFailed(function() {
+					// 新的版本下载失败
+					uni.showModal({
+						title: '更新提示',
+						content: '新版本下载失败,请检查网络后重试。',
+						showCancel: false
+					});
+				});
+			},
 			checkUpdate() {
 				const updateManager = uni.getUpdateManager();
 				updateManager.onCheckForUpdate(function(res) {

+ 18 - 1
common/request.js

@@ -1,5 +1,6 @@
 // uni-app请求封装
 import {TOKEN_KEYAuto} from '@/utils/courseTool.js'
+import store from '@/store/index.js'
 export default class Request {
 	http(router, data = {}, method,contentType) {
 		let that = this;
@@ -11,7 +12,6 @@ export default class Request {
 		let path = 'https://userapp.ysya.top/store'//益寿缘
 		// let path = 'https://userapp.ysya.top/ceshi/store'//益寿缘测试
 		
-		
 		// let path = 'http://w43fa358.natappfree.cc/store'//本地接口
 		// let path = 'https://userapp.moonxiang.com/prod-api/store'//北京存在文化商城
 		// let path = 'https://user.test.ylrztop.com/prod-api/store'//云联融智优选
@@ -87,6 +87,23 @@ export default class Request {
 				data: data,
 				method: method,
 				success: (res) => {
+					if(type !==0&&(res.data.code == 401 || res.data.code == 4001||res.data.code == 4004)) {
+						store.commit('setCoureLogin', 2);
+						uni.removeStorageSync("userinfos")
+						// uni.removeStorageSync('userInfo');
+						uni.removeStorageSync('TOKEN_WEXIN');
+						if(type==2) {
+							uni.removeStorageSync(TOKEN_KEYAuto)
+						}
+						if(type==1) {
+							uni.removeStorageSync('ManageToken');
+							uni.navigateTo({
+								url:'/pages_manage/login'
+							})
+						}
+						resolve({ code: 401, data: null });
+						return
+					}
 					//收到开发者服务器成功返回的回调函数
 					if(res.data.code==401){//没有权限直接退出到登录界面
 						let pages = getCurrentPages();

+ 1 - 1
manifest.json

@@ -52,7 +52,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx0d1a3dd485268521",
+        "appid" : "wx50bcb040b4963a7e",
         "setting" : {
             "urlCheck" : false
         },

+ 4 - 2
pages/shopping/confirmOrder.vue

@@ -134,6 +134,7 @@
 			 </view>
 			 
 		</popupBottom>
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
@@ -142,14 +143,15 @@
 	
 	import {confirm,computed,create} from '@/api/storeOrder'
 	import { getMyEnableCouponList } from '@/api/coupon'
-	 
+	 import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	import EvanSwitch from '@/components/evan-switch/evan-switch.vue'
 	import popupBottom from '@/components/px-popup-bottom/px-popup-bottom.vue'
 	
 	export default {
 		components: {
 			EvanSwitch,
-			popupBottom
+			popupBottom,
+			ykscreenRecord
 		},
 		data() {
 			return {

+ 5 - 0
pages/shopping/payOrder.vue

@@ -47,12 +47,17 @@
 		<view class="btn-box">
 			<view class="btn" @click="payOrder()">去支付</view>
 		</view>
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
 <script>
 	import {pay,getStoreOrderById} from '@/api/storeOrder'
+	import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	export default {
+		components:{
+			ykscreenRecord
+		},
 		data() {
 			return {
 				payLimitTime:null,

+ 5 - 0
pages/shopping/paymentOrder.vue

@@ -142,6 +142,7 @@
 				<button  class="share" data-name="shareBtn" open-type="share">分享</button>
 			</view> -->
 		</view>
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
@@ -149,7 +150,11 @@
 	import {getUserInfo} from '@/api/user'
 	import {getStoreConfig} from '@/api/common'
 	import {editPayType,pay,getStoreOrderById,orderBindUser,userCancelPay} from '@/api/storeOrder'
+	import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	export default {
+		components:{
+			ykscreenRecord
+		},
 		data() {
 			return {
 				orderId:null,

+ 2 - 3
pages_company/order/cart.vue

@@ -115,7 +115,6 @@
 							});
 							this.getCarts()
 						}else{
-							
 							uni.showToast({
 								icon:'none',
 								title: res.msg,
@@ -183,7 +182,7 @@
 						}else{
 							uni.showToast({
 								icon:'none',
-								title: "请求失败",
+								title: res.msg,
 							});
 						}
 					},
@@ -238,7 +237,7 @@
 						}else{
 							uni.showToast({
 								icon:'none',
-								title: "请求失败",
+								title:res.msg,
 							});
 						}
 					},

+ 5 - 0
pages_company/order/confirmCompanyOrder.vue

@@ -90,12 +90,17 @@
 			</view>
 			
 		</modal>
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
 <script>
 	import {getSalesOrder,addUserCart,updateSalseOrderMoney} from '@/api/companyOrder.js'
+	import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	export default {
+		components:{
+			ykscreenRecord
+		},
 		data() {
 			return {
 				inputShow:false,

+ 5 - 0
pages_company/order/confirmOrder.vue

@@ -55,6 +55,7 @@
 			</view>
 			<view class="btn" @click="showOrder()">查看</view>
 		</view>
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
@@ -64,7 +65,11 @@
 	import {getSalesOrder,addUserCart} from '@/api/companyOrder.js'
 	import {bindcompany} from '@/api/companyUser.js'
 	import { loginByMiniApp} from '@/api/user'
+	import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	export default {
+		components:{
+			ykscreenRecord
+		},
 		data() {
 			return {
 				count0:0,

+ 27 - 12
pages_course/videovip.vue

@@ -274,6 +274,7 @@
 <script>
 	import { generateRandomString} from "@/utils/common.js"
 	import dayjs from 'dayjs';
+	import { mapGetters } from 'vuex';
 	import {
 		getErrMsg,
 		getH5CourseByVideoId,
@@ -463,6 +464,20 @@
 			avataruser() {
 				return this.userinfos.avatar
 			},
+			...mapGetters(['coureLogin']),
+		},
+		watch: {
+		    coureLogin: {
+		      immediate: true,          // 页面一进入就检查一次
+		      handler(val) {
+		        if (val == 2&&this.isLogin) {
+					console.log("看课AppToken失效,请重新登录")
+					this.isLogin = false
+					this.isAddKf = 0
+					this.goLogin()
+		        }
+		      }
+		    }
 		},
 		onLoad(option) {
 			this.getWebviewUrl()
@@ -507,11 +522,11 @@
 			// this.sortLink = this.urlOption.link || ''
 			this.getMenuButton()
 			// #ifdef MP-WEIXIN
-			// if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userInfos')){
+			// if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userinfos')){
 			// 	this.userlogo=true
 			// }
-			console.log(uni.getStorageSync('userInfos'))
-			if(!uni.getStorageSync('userInfos')&&this.$store.state.logoname=='乐氏本源'){
+			console.log(uni.getStorageSync('userinfos'))
+			if(!uni.getStorageSync('userinfos')&&this.$store.state.logoname=='乐氏本源'){
 				uni.navigateTo({
 					url:'/pages_course/webview'
 				})
@@ -521,7 +536,7 @@
 		},
 		onShow() {
 			this.userinfos=uni.getStorageSync('userinfos')
-			this.userinfo=uni.getStorageSync('userinfo')
+			this.userInfo=uni.getStorageSync('userInfo')
 			this.tipsOpen = false
 			this.isExpand = true
 			this.uuId = generateRandomString(16)
@@ -532,7 +547,7 @@
 			console.log(AppToken)
 			if(AppToken){
 				// this.isLogin=true
-				if(this.isAddKf == 1&&this.userinfo.userId){
+				if(this.isAddKf == 1&&this.userInfo.userId){
 					console.log(1233)
 					this.getH5CourseVideoDetails()
 				} else{
@@ -629,10 +644,10 @@
 									uni.getStorageSync('TOKEN_WEXIN');
 									this.userInfo=uni.getStorageSync('userInfo');
 									this.isLogin = true
-									this.getH5CourseVideoDetails()
-									// setTimeout(()=>{
-									// 	this.getIsAddKf()
-									// },200)
+									// this.getH5CourseVideoDetails()
+									setTimeout(()=>{
+										this.getIsAddKf()
+									},200)
 								}else if(res.code==406){
 									uni.hideLoading();
 									uni.showToast({
@@ -680,7 +695,7 @@
 					});
 					return
 				}
-				uni.setStorageSync('userInfos',this.userinfos)
+				uni.setStorageSync('userinfos',this.userinfos)
 				this.editUserA()
 				this.userlogo=false
 			},
@@ -742,7 +757,7 @@
 								console.log(loginRes)
 								console.log(e)
 								let code = loginRes.code // 获取开发code
-								this.userinfos=uni.getStorageSync('userInfos')?uni.getStorageSync('userInfos'):this.userinfos
+								this.userinfos=uni.getStorageSync('userinfos')?uni.getStorageSync('userinfos'):this.userinfos
 								loginByMiniApp({
 								   encryptedData: e.mp.detail.encryptedData,
 								   iv: e.mp.detail.iv,
@@ -833,7 +848,7 @@
 								console.log(loginRes)
 								console.log(e)
 								let code = loginRes.code // 获取开发code
-								this.userinfos=uni.getStorageSync('userInfos')?uni.getStorageSync('userInfos'):this.userinfos
+								this.userinfos=uni.getStorageSync('userinfos')?uni.getStorageSync('userinfos'):this.userinfos
 								loginByMiniApp({
 								   encryptedData: e.mp.detail.encryptedData,
 								   iv: e.mp.detail.iv,

+ 4 - 2
pages_shopping/shopping/confirmCreateOrder.vue

@@ -134,6 +134,7 @@
 			 </view>
 			 
 		</popupBottom>
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
@@ -142,14 +143,15 @@
 	
 	import {confirm,computed,create} from '@/api/storeOrder'
 	import { getMyEnableCouponList } from '@/api/coupon'
-	 
+	 import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	import EvanSwitch from '@/components/evan-switch/evan-switch.vue'
 	import popupBottom from '@/components/px-popup-bottom/px-popup-bottom.vue'
 	
 	export default {
 		components: {
 			EvanSwitch,
-			popupBottom
+			popupBottom,
+			ykscreenRecord
 		},
 		data() {
 			return {

+ 4 - 2
pages_shopping/shopping/confirmPackageOrder.vue

@@ -116,6 +116,7 @@
 			 </view>
 			 
 		</popupBottom>
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
@@ -123,13 +124,14 @@
 	import {getWeixinTemps} from '@/api/common'
 	import {confirmPackageOrder,computedPackageOrder,createPackageOrder} from '@/api/storeOrder'
 	import { getMyEnableCouponList } from '@/api/coupon'
-	 
+	 import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	import EvanSwitch from '@/components/evan-switch/evan-switch.vue'
 	import popupBottom from '@/components/px-popup-bottom/px-popup-bottom.vue'
 	export default {
 		components: {
 			EvanSwitch,
-			popupBottom
+			popupBottom,
+			ykscreenRecord
 		},
 		data() {
 			return {

+ 5 - 1
pages_user/user/pay.vue

@@ -24,14 +24,18 @@
 		<view class="ad">
 			<ad unit-id="adunit-a018415a6deb69e8"></ad>
 		</view>
-		
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
 <script>
 	import {payment} from '@/api/payment'
 	import { loginByMiniApp} from '@/api/user'
+	import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	export default {
+		components:{
+			ykscreenRecord
+		},
 		data() {
 			return {
 				companyUserId:null,

+ 5 - 0
pages_user/user/storeOrder.vue

@@ -104,14 +104,19 @@
 				</view>
 			</view>
 		</mescroll-body>
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
 <script>
 	import {getMyStoreOrderList,cancelOrder} from '@/api/storeOrder'
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+	import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	export default {
 		mixins: [MescrollMixin], 
+		components:{
+			ykscreenRecord
+		},
 		data() {
 			return {
 				searchKey:"",

+ 5 - 1
pages_user/user/storeOrderDelivery.vue

@@ -51,13 +51,17 @@
 			</view>
 			
 		</view>
-		
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
 <script>
 	import {getMyStoreOrderById,cancelOrder,getExpress} from '@/api/storeOrder'
+	import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	export default {
+		components:{
+			ykscreenRecord
+		},
 		data() {
 			return {
 				statusBarHeight:uni.getStorageSync("menuInfo").statusBarHeight,

+ 5 - 0
pages_user/user/storeOrderDetail.vue

@@ -254,12 +254,17 @@
 			<view class="btn pay" v-if="order.status==2&&order.payType!=1&&order.isPayRemain==0&&order.deliverySn=='SF'" @click="payRemain()">支付尾款</view>
 			<view class="btn pay" v-if="order.status==2" @click="finish()">确认收货</view>
 		</view>
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
 <script>
 	import {getMyStoreOrderById,cancelOrder,express,finishOrder,orderBindUser} from '@/api/storeOrder'
+	import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	export default {
+		components:{
+			ykscreenRecord
+		},
 		data() {
 			return {
 				isAfterSales:0,

+ 5 - 0
pages_user/user/storeProductRelation.vue

@@ -25,13 +25,18 @@
 			 	</view>
 			 </view>
 		</mescroll-body>
+		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
 <script>
 	import {delProductFoots,getProductFoots} from '@/api/user'
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+	import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	export default {
+		components:{
+			ykscreenRecord
+		},
 		mixins: [MescrollMixin], 
 		data() {
 			return {

+ 11 - 2
store/index.js

@@ -8,6 +8,7 @@ import {
 } from '@/api/index.js'
 export default new Vuex.Store({
   state: {
+	  coureLogin: uni.getStorageSync('coureLogin') || 0,
 	 webviewUrl: '',
 	 wsDanmuUrl: 'wss://userapp.ysya.top', // 弹幕评论接口地址
 	 //红包领取规则:
@@ -16,8 +17,9 @@ export default new Vuex.Store({
 	 uploadFile: 'https://userapp.ysya.top',
 	imgpath: 'https://ysy-1329817240.cos.ap-guangzhou.myqcloud.com',//益寿缘图片请求地址
 	logoname:'益寿缘',
-	appid:'wx0d1a3dd485268521',//益寿缘
-	// appid:'wx50bcb040b4963a7e',//营口市康安健康服务(益寿缘)
+	// appid:'wx0d1a3dd485268521',//益寿缘
+	appid:'wx50bcb040b4963a7e',//营口市康安健康服务(益寿缘)
+	// appid:'wx6d21646ba042d66f',//久运健康线上服务(益寿缘)
   },
   mutations: {
     setCount(state, value) {
@@ -28,8 +30,15 @@ export default new Vuex.Store({
     },
 	setWebviewUrl(state, value) {
 		state.webviewUrl = value;
+	},
+	setCoureLogin(state, payload) {
+		uni.setStorageSync('coureLogin', payload);
+		state.coureLogin = payload;
 	}
   },
+  getters: {
+    coureLogin: (state) => state.coureLogin,
+  },
   actions: {
     fetchUser({ commit }) {
       // const res = await uni.request({ url: '/api/user' });