Compare commits
53 Commits
xie
...
changeAliP
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df177725d8 | ||
|
|
67f26757ce | ||
|
|
69176ffbd9 | ||
|
|
e9bcc83e4c | ||
|
|
9f0845f97d | ||
|
|
80bef54e47 | ||
|
|
ebd616aef5 | ||
|
|
7c9b2a3c80 | ||
|
|
6c64c27a5a | ||
|
|
f726ecf29a | ||
|
|
7ee7b52c93 | ||
|
|
3904f02c55 | ||
|
|
f578943c10 | ||
|
|
3f6a1c546b | ||
|
|
a428b3fa49 | ||
|
|
e4c17df0f9 | ||
|
|
79f0b7461d | ||
|
|
172e0fa2be | ||
|
|
dfaa65c7a2 | ||
|
|
85d2d7f41b | ||
|
|
f76423d222 | ||
|
|
8004ee57c1 | ||
|
|
87d32db367 | ||
|
|
c8ffd37e4a | ||
|
|
f702fb63d8 | ||
|
|
ed130e8dc5 | ||
|
|
719f90889c | ||
|
|
9508af8780 | ||
|
|
a582e56af5 | ||
|
|
54694548f4 | ||
|
|
3a390f2ece | ||
|
|
c3268fe7e7 | ||
|
|
0342b547da | ||
|
|
2cf585340f | ||
|
|
19de052673 | ||
|
|
3cba070d7e | ||
|
|
62b3400bfc | ||
|
|
5efb7085d5 | ||
|
|
74d83fd2a8 | ||
|
|
a5d05367bd | ||
|
|
8d39d98ac4 | ||
|
|
e6411e6661 | ||
|
|
7238eb05c2 | ||
|
|
f73e521179 | ||
|
|
d1953091a9 | ||
|
|
7f49331372 | ||
|
|
545fd9cc75 | ||
|
|
05edf730c9 | ||
|
|
62bd642563 | ||
|
|
049117e4b0 | ||
|
|
4f1a8d43ac | ||
|
|
47b2c774f1 | ||
|
|
e7b000572b |
@@ -5,7 +5,7 @@
|
||||
"configurations" : [
|
||||
{
|
||||
"app-plus" : {
|
||||
"launchtype" : "local"
|
||||
"launchtype" : "remote"
|
||||
},
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
@@ -20,12 +20,16 @@
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"playground" : "standard",
|
||||
"playground" : "custom",
|
||||
"type" : "uni-app:app-ios"
|
||||
},
|
||||
{
|
||||
"playground" : "custom",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-ios_simulator"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
10
App.vue
@@ -1,8 +1,7 @@
|
||||
<script>
|
||||
import {
|
||||
music,
|
||||
bgm
|
||||
} from "@/utils/music.js";
|
||||
iap
|
||||
} from "@/utils/myIapCheck.js";
|
||||
import store from "@/store/index.js";
|
||||
import socket from "@/config/socket";
|
||||
// #ifdef H5
|
||||
@@ -27,7 +26,7 @@
|
||||
onLaunch: function(e) {
|
||||
// 检测自动更新
|
||||
// #ifdef APP-PLUS
|
||||
updata();
|
||||
updata();
|
||||
// #endif
|
||||
|
||||
uni.getSystemInfo({
|
||||
@@ -59,7 +58,8 @@
|
||||
if (store.state.userInfo.token) {
|
||||
socket.init();
|
||||
}
|
||||
// APPUpdate();
|
||||
// 检测是否有未关闭苹果内购订单
|
||||
iap.getChannels()
|
||||
// #endif
|
||||
},
|
||||
onShow: function(e) {
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
{
|
||||
"version": "1",
|
||||
"prompt": "template",
|
||||
"title": "服务协议和隐私政策",
|
||||
"message": " 请你务必审慎阅读、充分理解“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"https://wumen.taihumed.com/agreement.html\">《用户协议》</a>和<a href=\"https://wumen.taihumed.com/privacy.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||
"buttonAccept": "同意并接受",
|
||||
"buttonRefuse": "暂不同意",
|
||||
"hrefLoader": "system",
|
||||
"backToExit":"false",
|
||||
"second": {
|
||||
"title": "确认提示",
|
||||
"message": " 进入应用前,你需先同意<a href=\"https://wumen.taihumed.com/agreement.html\">《用户协议》</a>和<a href=\"https://wumen.taihumed.com/privacy.html\">《隐私政策》</a>,否则将退出应用。",
|
||||
"buttonAccept": "同意并继续",
|
||||
"buttonRefuse": "退出应用"
|
||||
},
|
||||
"disagreeMode":{
|
||||
"support": false,
|
||||
"loadNativePlugins": false,
|
||||
"visitorEntry": false,
|
||||
"showAlways": false
|
||||
},
|
||||
"styles": {
|
||||
"backgroundColor": "#FFF",
|
||||
"borderRadius":"5px",
|
||||
"title": {
|
||||
"color": "#333"
|
||||
"version" : "1",
|
||||
"prompt" : "template",
|
||||
"title" : "服务协议和隐私政策",
|
||||
"message" : " 请你务必审慎阅读、充分理解“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"https://wumen.taihumed.com/agreement.html\">《用户协议》</a>和<a href=\"https://wumen.taihumed.com/privacy.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||
"buttonAccept" : "同意并接受",
|
||||
"buttonRefuse" : "暂不同意",
|
||||
"hrefLoader" : "system",
|
||||
"backToExit" : "false",
|
||||
"second" : {
|
||||
"title" : "确认提示",
|
||||
"message" : " 进入应用前,你需先同意<a href=\"https://wumen.taihumed.com/agreement.html\">《用户协议》</a>和<a href=\"https://wumen.taihumed.com/privacy.html\">《隐私政策》</a>,否则将退出应用。",
|
||||
"buttonAccept" : "同意并继续",
|
||||
"buttonRefuse" : "退出应用"
|
||||
},
|
||||
"buttonAccept": {
|
||||
"color": "#333"
|
||||
"disagreeMode" : {
|
||||
"support" : false,
|
||||
"loadNativePlugins" : false,
|
||||
"visitorEntry" : false,
|
||||
"showAlways" : false
|
||||
},
|
||||
"buttonRefuse": {
|
||||
"color": "#333"
|
||||
},
|
||||
"buttonVisitor": {
|
||||
"color": "#55aaff"
|
||||
"styles" : {
|
||||
"backgroundColor" : "#FFF",
|
||||
"borderRadius" : "5px",
|
||||
"title" : {
|
||||
"color" : "#333"
|
||||
},
|
||||
"buttonAccept" : {
|
||||
"color" : "#333"
|
||||
},
|
||||
"buttonRefuse" : {
|
||||
"color" : "#333"
|
||||
},
|
||||
"buttonVisitor" : {
|
||||
"color" : "#55aaff"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<view class="box">
|
||||
<view class="box" v-if="sayList && sayList.length > 0">
|
||||
<view class="firstLeve flexbox leve" v-for="(item, index) in sayList" :key="index" style="flex-wrap: wrap;">
|
||||
<view class="imgbox" :style="getBackGround(item.user.avatar)">
|
||||
<view v-if="item.user && item.user != null && item.user != 'null'" class="imgbox" :style="getBackGround(item.user.avatar)">
|
||||
<view class="img">
|
||||
<!-- <image :src="item.user.avatar" mode="aspectFit" style="width: 80rpx; height: 80rpx;"></image> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentBox contentBoxfirstLeve">
|
||||
<view class="name">
|
||||
<view class="name" v-if="item.user && item.user != null && item.user != 'null'">
|
||||
{{item.user.name == '' ? '暂无昵称': item.user.name}}
|
||||
</view>
|
||||
<view class="content" v-if="item.content != ''">
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
.guide_pages_bg2 {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: url("@/static/icon/e_0ban_2.jpg") no-repeat;
|
||||
background: url("@/static/icon/e_0ban_2.jpg") no-repeat bottom center;
|
||||
background-size: cover;
|
||||
// background-color: #007AFF;
|
||||
display: flex;
|
||||
@@ -107,7 +107,7 @@
|
||||
.guide_pages_bg3 {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: url("@/static/icon/e_0ban_3.jpg") no-repeat;
|
||||
background: url("@/static/icon/e_0ban_3.jpg") no-repeat bottom center;
|
||||
background-size: cover;
|
||||
// background-color: #EA552D;
|
||||
display: flex;
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
.close_btj {
|
||||
position: absolute;
|
||||
top: 60%;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 290rpx;
|
||||
height: 68rpx;
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
:src="'/' + item.iconPath"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<text
|
||||
<text
|
||||
class="footer_nav_item_text"
|
||||
:class="[item.pagePath == path ? 'footer_item_text_active' : '']"
|
||||
:class="[item.pagePath == path ? 'footer_item_text_active' : '',index == 2 && item.pagePath == path ? 'redText' :'']"
|
||||
>{{ item.text }}</text
|
||||
>
|
||||
</view>
|
||||
@@ -216,6 +216,7 @@ export default {
|
||||
color: #7b7b7b;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
.footer_nav_item_text.redText{color: red;}
|
||||
|
||||
.footer_nav_item_text_active {
|
||||
color: #f9a633;
|
||||
|
||||
@@ -6,8 +6,8 @@ if (process.env.NODE_ENV === 'development') {
|
||||
// socketUrl = "ws://localhost:6001/";
|
||||
// baseUrl = "https://twin-ui.com/demo/";
|
||||
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
|
||||
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式
|
||||
baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
|
||||
baseUrl = "https://api.nuttyreading.com/"; // 线上正式
|
||||
// baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
|
||||
// baseUrl = "http://59.110.212.44:9200/pb/";
|
||||
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
|
||||
// baseUrl = "http://192.168.110.110:9200/pb/";
|
||||
|
||||
@@ -85,10 +85,12 @@ $http.getAliToken = function(callback) {
|
||||
//请求开始拦截器
|
||||
$http.requestStart = function(options) {
|
||||
// console.log("请求开始", options);
|
||||
if (options.load && options.data.loadAnimate != 'none') {
|
||||
//打开加载动画
|
||||
store.commit("setLoadingShow", true);
|
||||
}
|
||||
// if (options.load && options.data.loadAnimate != 'none') {
|
||||
// //打开加载动画
|
||||
// store.commit("setLoadingShow", true);
|
||||
// }
|
||||
// delete(options.loadAnimate)
|
||||
// console.log('options',options);
|
||||
// 图片、视频上传大小限制
|
||||
if (options.method == "FILE") {
|
||||
// 文件最大字节: options.maxSize 可以在调用方法的时候加入参数
|
||||
|
||||
@@ -1,272 +1,405 @@
|
||||
/**
|
||||
* 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
|
||||
*/
|
||||
var isIos
|
||||
// #ifdef APP-PLUS
|
||||
isIos = (plus.os.name == "iOS")
|
||||
// #endif
|
||||
|
||||
var isIos
|
||||
// #ifdef APP-PLUS
|
||||
isIos = (plus.os.name == "iOS")
|
||||
// #endif
|
||||
// 判断推送权限是否开启
|
||||
function judgeIosPermissionPush() {
|
||||
var result = false;
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var app = UIApplication.sharedApplication();
|
||||
var enabledTypes = 0;
|
||||
if (app.currentUserNotificationSettings) {
|
||||
var settings = app.currentUserNotificationSettings();
|
||||
enabledTypes = settings.plusGetAttribute("types");
|
||||
console.log("enabledTypes1:" + enabledTypes);
|
||||
if (enabledTypes == 0) {
|
||||
console.log("推送权限没有开启");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
plus.ios.deleteObject(settings);
|
||||
} else {
|
||||
enabledTypes = app.enabledRemoteNotificationTypes();
|
||||
if (enabledTypes == 0) {
|
||||
console.log("推送权限没有开启!");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
console.log("enabledTypes2:" + enabledTypes);
|
||||
}
|
||||
plus.ios.deleteObject(app);
|
||||
plus.ios.deleteObject(UIApplication);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断推送权限是否开启
|
||||
function judgeIosPermissionPush() {
|
||||
var result = false;
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var app = UIApplication.sharedApplication();
|
||||
var enabledTypes = 0;
|
||||
if (app.currentUserNotificationSettings) {
|
||||
var settings = app.currentUserNotificationSettings();
|
||||
enabledTypes = settings.plusGetAttribute("types");
|
||||
console.log("enabledTypes1:" + enabledTypes);
|
||||
if (enabledTypes == 0) {
|
||||
console.log("推送权限没有开启");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
plus.ios.deleteObject(settings);
|
||||
} else {
|
||||
enabledTypes = app.enabledRemoteNotificationTypes();
|
||||
if (enabledTypes == 0) {
|
||||
console.log("推送权限没有开启!");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
console.log("enabledTypes2:" + enabledTypes);
|
||||
}
|
||||
plus.ios.deleteObject(app);
|
||||
plus.ios.deleteObject(UIApplication);
|
||||
return result;
|
||||
}
|
||||
// 判断定位权限是否开启
|
||||
function judgeIosPermissionLocation() {
|
||||
var result = false;
|
||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||
var status = cllocationManger.authorizationStatus();
|
||||
result = (status != 2)
|
||||
console.log("定位权限开启:" + result);
|
||||
// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
|
||||
/* var enable = cllocationManger.locationServicesEnabled();
|
||||
var status = cllocationManger.authorizationStatus();
|
||||
console.log("enable:" + enable);
|
||||
console.log("status:" + status);
|
||||
if (enable && status != 2) {
|
||||
result = true;
|
||||
console.log("手机定位服务已开启且已授予定位权限");
|
||||
} else {
|
||||
console.log("手机系统的定位没有打开或未给予定位权限");
|
||||
} */
|
||||
plus.ios.deleteObject(cllocationManger);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断定位权限是否开启
|
||||
function judgeIosPermissionLocation() {
|
||||
var result = false;
|
||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||
var status = cllocationManger.authorizationStatus();
|
||||
result = (status != 2)
|
||||
console.log("定位权限开启:" + result);
|
||||
// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
|
||||
/* var enable = cllocationManger.locationServicesEnabled();
|
||||
var status = cllocationManger.authorizationStatus();
|
||||
console.log("enable:" + enable);
|
||||
console.log("status:" + status);
|
||||
if (enable && status != 2) {
|
||||
result = true;
|
||||
console.log("手机定位服务已开启且已授予定位权限");
|
||||
} else {
|
||||
console.log("手机系统的定位没有打开或未给予定位权限");
|
||||
} */
|
||||
plus.ios.deleteObject(cllocationManger);
|
||||
return result;
|
||||
}
|
||||
// 判断麦克风权限是否开启
|
||||
function judgeIosPermissionRecord() {
|
||||
var result = false;
|
||||
var avaudiosession = plus.ios.import("AVAudioSession");
|
||||
var avaudio = avaudiosession.sharedInstance();
|
||||
var permissionStatus = avaudio.recordPermission();
|
||||
console.log("permissionStatus:" + permissionStatus);
|
||||
if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
|
||||
console.log("麦克风权限没有开启");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("麦克风权限已经开启");
|
||||
}
|
||||
plus.ios.deleteObject(avaudiosession);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断麦克风权限是否开启
|
||||
function judgeIosPermissionRecord() {
|
||||
var result = false;
|
||||
var avaudiosession = plus.ios.import("AVAudioSession");
|
||||
var avaudio = avaudiosession.sharedInstance();
|
||||
var permissionStatus = avaudio.recordPermission();
|
||||
console.log("permissionStatus:" + permissionStatus);
|
||||
if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
|
||||
console.log("麦克风权限没有开启");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("麦克风权限已经开启");
|
||||
}
|
||||
plus.ios.deleteObject(avaudiosession);
|
||||
return result;
|
||||
}
|
||||
// 判断相机权限是否开启
|
||||
function judgeIosPermissionCamera() {
|
||||
var result = false;
|
||||
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
||||
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
|
||||
console.log("authStatus:" + authStatus);
|
||||
if (authStatus == 3) {
|
||||
result = true;
|
||||
console.log("相机权限已经开启");
|
||||
} else {
|
||||
console.log("相机权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(AVCaptureDevice);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断相机权限是否开启
|
||||
function judgeIosPermissionCamera() {
|
||||
var result = false;
|
||||
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
||||
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
|
||||
console.log("authStatus:" + authStatus);
|
||||
if (authStatus == 3) {
|
||||
result = true;
|
||||
console.log("相机权限已经开启");
|
||||
} else {
|
||||
console.log("相机权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(AVCaptureDevice);
|
||||
return result;
|
||||
}
|
||||
// 判断相册权限是否开启
|
||||
function judgeIosPermissionPhotoLibrary() {
|
||||
var result = false;
|
||||
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
|
||||
var authStatus = PHPhotoLibrary.authorizationStatus();
|
||||
console.log("authStatus:" + authStatus);
|
||||
if (authStatus == 3) {
|
||||
result = true;
|
||||
console.log("相册权限已经开启");
|
||||
} else {
|
||||
console.log("相册权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(PHPhotoLibrary);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断相册权限是否开启
|
||||
function judgeIosPermissionPhotoLibrary() {
|
||||
var result = false;
|
||||
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
|
||||
var authStatus = PHPhotoLibrary.authorizationStatus();
|
||||
console.log("authStatus:" + authStatus);
|
||||
if (authStatus == 3) {
|
||||
result = true;
|
||||
console.log("相册权限已经开启");
|
||||
} else {
|
||||
console.log("相册权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(PHPhotoLibrary);
|
||||
return result;
|
||||
}
|
||||
// 判断通讯录权限是否开启
|
||||
function judgeIosPermissionContact() {
|
||||
var result = false;
|
||||
var CNContactStore = plus.ios.import("CNContactStore");
|
||||
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
|
||||
if (cnAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("通讯录权限已经开启");
|
||||
} else {
|
||||
console.log("通讯录权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(CNContactStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断通讯录权限是否开启
|
||||
function judgeIosPermissionContact() {
|
||||
var result = false;
|
||||
var CNContactStore = plus.ios.import("CNContactStore");
|
||||
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
|
||||
if (cnAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("通讯录权限已经开启");
|
||||
} else {
|
||||
console.log("通讯录权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(CNContactStore);
|
||||
return result;
|
||||
}
|
||||
// 判断日历权限是否开启
|
||||
function judgeIosPermissionCalendar() {
|
||||
var result = false;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("日历权限已经开启");
|
||||
} else {
|
||||
console.log("日历权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断日历权限是否开启
|
||||
function judgeIosPermissionCalendar() {
|
||||
var result = false;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("日历权限已经开启");
|
||||
} else {
|
||||
console.log("日历权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
// 判断备忘录权限是否开启
|
||||
function judgeIosPermissionMemo() {
|
||||
var result = false;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("备忘录权限已经开启");
|
||||
} else {
|
||||
console.log("备忘录权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断备忘录权限是否开启
|
||||
function judgeIosPermissionMemo() {
|
||||
var result = false;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("备忘录权限已经开启");
|
||||
} else {
|
||||
console.log("备忘录权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
// Android权限查询
|
||||
function requestAndroidPermission(permissionID) {
|
||||
return new Promise((resolve, reject) => {
|
||||
plus.android.requestPermissions(
|
||||
permissionID.split(","),
|
||||
// [permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
|
||||
function(resultObj) {
|
||||
var result = 0;
|
||||
for (var i = 0; i < resultObj.granted.length; i++) {
|
||||
var grantedPermission = resultObj.granted[i];
|
||||
console.log('已获取的权限:' + grantedPermission);
|
||||
result = 1
|
||||
}
|
||||
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
|
||||
var deniedPresentPermission = resultObj.deniedPresent[i];
|
||||
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
|
||||
result = 0
|
||||
}
|
||||
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
|
||||
var deniedAlwaysPermission = resultObj.deniedAlways[i];
|
||||
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
|
||||
result = -1
|
||||
}
|
||||
resolve(result);
|
||||
// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
|
||||
// if (result != 1) {
|
||||
// gotoAppPermissionSetting()
|
||||
// }
|
||||
},
|
||||
function(error) {
|
||||
console.log('申请权限错误:' + error.code + " = " + error.message);
|
||||
resolve({
|
||||
code: error.code,
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// Android权限查询
|
||||
function requestAndroidPermission(permissionID) {
|
||||
return new Promise((resolve, reject) => {
|
||||
plus.android.requestPermissions(
|
||||
[permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
|
||||
function(resultObj) {
|
||||
var result = 0;
|
||||
for (var i = 0; i < resultObj.granted.length; i++) {
|
||||
var grantedPermission = resultObj.granted[i];
|
||||
console.log('已获取的权限:' + grantedPermission);
|
||||
result = 1
|
||||
}
|
||||
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
|
||||
var deniedPresentPermission = resultObj.deniedPresent[i];
|
||||
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
|
||||
result = 0
|
||||
}
|
||||
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
|
||||
var deniedAlwaysPermission = resultObj.deniedAlways[i];
|
||||
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
|
||||
result = -1
|
||||
}
|
||||
resolve(result);
|
||||
// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
|
||||
// if (result != 1) {
|
||||
// gotoAppPermissionSetting()
|
||||
// }
|
||||
},
|
||||
function(error) {
|
||||
console.log('申请权限错误:' + error.code + " = " + error.message);
|
||||
resolve({
|
||||
code: error.code,
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
// 使用一个方法,根据参数判断权限
|
||||
function judgeIosPermission(permissionID) {
|
||||
if (permissionID == "location") {
|
||||
return judgeIosPermissionLocation()
|
||||
} else if (permissionID == "camera") {
|
||||
return judgeIosPermissionCamera()
|
||||
} else if (permissionID == "photoLibrary") {
|
||||
return judgeIosPermissionPhotoLibrary()
|
||||
} else if (permissionID == "record") {
|
||||
return judgeIosPermissionRecord()
|
||||
} else if (permissionID == "push") {
|
||||
return judgeIosPermissionPush()
|
||||
} else if (permissionID == "contact") {
|
||||
return judgeIosPermissionContact()
|
||||
} else if (permissionID == "calendar") {
|
||||
return judgeIosPermissionCalendar()
|
||||
} else if (permissionID == "memo") {
|
||||
return judgeIosPermissionMemo()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 使用一个方法,根据参数判断权限
|
||||
function judgeIosPermission(permissionID) {
|
||||
if (permissionID == "location") {
|
||||
return judgeIosPermissionLocation()
|
||||
} else if (permissionID == "camera") {
|
||||
return judgeIosPermissionCamera()
|
||||
} else if (permissionID == "photoLibrary") {
|
||||
return judgeIosPermissionPhotoLibrary()
|
||||
} else if (permissionID == "record") {
|
||||
return judgeIosPermissionRecord()
|
||||
} else if (permissionID == "push") {
|
||||
return judgeIosPermissionPush()
|
||||
} else if (permissionID == "contact") {
|
||||
return judgeIosPermissionContact()
|
||||
} else if (permissionID == "calendar") {
|
||||
return judgeIosPermissionCalendar()
|
||||
} else if (permissionID == "memo") {
|
||||
return judgeIosPermissionMemo()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// 跳转到**应用**的权限页面
|
||||
function gotoAppPermissionSetting() {
|
||||
if (isIos) {
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var application2 = UIApplication.sharedApplication();
|
||||
var NSURL2 = plus.ios.import("NSURL");
|
||||
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
|
||||
var setting2 = NSURL2.URLWithString("app-settings:");
|
||||
application2.openURL(setting2);
|
||||
|
||||
// 跳转到**应用**的权限页面
|
||||
function gotoAppPermissionSetting() {
|
||||
if (isIos) {
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var application2 = UIApplication.sharedApplication();
|
||||
var NSURL2 = plus.ios.import("NSURL");
|
||||
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
|
||||
var setting2 = NSURL2.URLWithString("app-settings:");
|
||||
application2.openURL(setting2);
|
||||
plus.ios.deleteObject(setting2);
|
||||
plus.ios.deleteObject(NSURL2);
|
||||
plus.ios.deleteObject(application2);
|
||||
} else {
|
||||
// console.log(plus.device.vendor);
|
||||
var Intent = plus.android.importClass("android.content.Intent");
|
||||
var Settings = plus.android.importClass("android.provider.Settings");
|
||||
var Uri = plus.android.importClass("android.net.Uri");
|
||||
var mainActivity = plus.android.runtimeMainActivity();
|
||||
var intent = new Intent();
|
||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
mainActivity.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
plus.ios.deleteObject(setting2);
|
||||
plus.ios.deleteObject(NSURL2);
|
||||
plus.ios.deleteObject(application2);
|
||||
} else {
|
||||
// console.log(plus.device.vendor);
|
||||
var Intent = plus.android.importClass("android.content.Intent");
|
||||
var Settings = plus.android.importClass("android.provider.Settings");
|
||||
var Uri = plus.android.importClass("android.net.Uri");
|
||||
var mainActivity = plus.android.runtimeMainActivity();
|
||||
var intent = new Intent();
|
||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
mainActivity.startActivity(intent);
|
||||
}
|
||||
}
|
||||
// 检查系统的设备服务是否开启
|
||||
// var checkSystemEnableLocation = async function () {
|
||||
function checkSystemEnableLocation() {
|
||||
if (isIos) {
|
||||
var result = false;
|
||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||
var result = cllocationManger.locationServicesEnabled();
|
||||
console.log("系统定位开启:" + result);
|
||||
plus.ios.deleteObject(cllocationManger);
|
||||
return result;
|
||||
} else {
|
||||
var context = plus.android.importClass("android.content.Context");
|
||||
var locationManager = plus.android.importClass("android.location.LocationManager");
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
||||
var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
|
||||
console.log("系统定位开启:" + result);
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
// 检查系统的设备服务是否开启
|
||||
// var checkSystemEnableLocation = async function () {
|
||||
function checkSystemEnableLocation() {
|
||||
if (isIos) {
|
||||
var result = false;
|
||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||
var result = cllocationManger.locationServicesEnabled();
|
||||
console.log("系统定位开启:" + result);
|
||||
plus.ios.deleteObject(cllocationManger);
|
||||
return result;
|
||||
} else {
|
||||
var context = plus.android.importClass("android.content.Context");
|
||||
var locationManager = plus.android.importClass("android.location.LocationManager");
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
||||
var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
|
||||
console.log("系统定位开启:" + result);
|
||||
return result
|
||||
}
|
||||
}
|
||||
let permissionMap = {
|
||||
"android": {
|
||||
"CAMERA_EXTERNAL_STORAGE": {
|
||||
"name": "android.permission.READ_EXTERNAL_STORAGE,android.permission.WRITE_EXTERNAL_STORAGE,android.permission.CAMERA",
|
||||
"title": "相机/相册权限说明",
|
||||
"content": "便于您使用该功能上传您的照片/图片用于上传用户头像、留言上传图片、申诉反馈上传图片等场景中读取和写入相册和文件内容"
|
||||
},
|
||||
"CAMERA": {
|
||||
"name": "android.permission.CAMERA",
|
||||
"title": "相机权限说明",
|
||||
"content": "便于您使用该功能上传您的照片/图片用于上传用户头像、留言上传图片、申诉反馈上传图片等场景中拍摄图片"
|
||||
},
|
||||
// "EXTERNAL_STORAGE": {
|
||||
// "name": "android.permission.READ_EXTERNAL_STORAGE,android.permission.WRITE_EXTERNAL_STORAGE",
|
||||
// "title": "相册权限说明",
|
||||
// "content": "便于您使用该功能上传您的照片/图片/视频及用于上传工单故障、维修图片、扫码识别设备等信息、意见反馈上传图片、上传设备、客户、设备图片等场景中读取和写入相册和文件内容"
|
||||
// },
|
||||
// "LOCATION": {
|
||||
// "name": "android.location.LocationManager",
|
||||
// "title": "定位权限说明",
|
||||
// "content": "便于您使用该功能定位您当前的位置,并上报当前位置给服务器,来智能得按照当前位置给您分配距离您最近的工单信息等功能"
|
||||
// },
|
||||
// "CALLPHONE": {
|
||||
// "name": "android.permission.CALL_PHONE",
|
||||
// "title": "拨打电话权限说明",
|
||||
// "content": "便于您使用该功能能够快速和提交工单信息的客户进行联系并进行及时处理"
|
||||
// },
|
||||
},
|
||||
"ios": {}
|
||||
}
|
||||
|
||||
let view = null;
|
||||
let viewShow = false;
|
||||
|
||||
function showViewDesc(permission) {
|
||||
let plat = isIos ? "ios" : "android";
|
||||
view = new plus.nativeObj.View('per-modal', {
|
||||
top: '0px',
|
||||
left: '0px',
|
||||
width: '100%',
|
||||
backgroundColor: 'rgba(0,0,0,0.4)',
|
||||
//opacity: '.9'
|
||||
})
|
||||
view.drawRect({
|
||||
color: '#fff',
|
||||
radius: '5px'
|
||||
}, {
|
||||
top: '170px',
|
||||
left: '5%',
|
||||
width: '90%',
|
||||
height: "150px",
|
||||
})
|
||||
view.drawText(permissionMap[plat][permission]["title"], {
|
||||
top: '180px',
|
||||
left: "8%",
|
||||
height: "30px"
|
||||
}, {
|
||||
align: "left",
|
||||
color: "#000",
|
||||
}, {
|
||||
onClick: function(e) {
|
||||
console.log(e);
|
||||
}
|
||||
})
|
||||
view.drawText(permissionMap[plat][permission]["content"], {
|
||||
top: '210px',
|
||||
height: "80px",
|
||||
left: "8%",
|
||||
width: "84%"
|
||||
}, {
|
||||
whiteSpace: 'normal',
|
||||
size: "14px",
|
||||
align: "left",
|
||||
color: "#656563"
|
||||
})
|
||||
setTimeout(()=>{
|
||||
view.show()
|
||||
},200)
|
||||
}
|
||||
|
||||
function premissionCheck(permission) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let plat = isIos ? "ios" : "android";
|
||||
if (isIos) { // ios
|
||||
// const camera = permission.judgeIosPermission("camera");//判断ios是否给予摄像头权限
|
||||
// //ios相册没权限,系统会自动弹出授权框
|
||||
// //let photoLibrary = permission.judgeIosPermission("photoLibrary");//判断ios是否给予相册权限
|
||||
// if(camera){
|
||||
// resolve();
|
||||
// }else{
|
||||
// reject('需要开启相机使用权限');
|
||||
// }
|
||||
resolve(1)
|
||||
} else { // android
|
||||
let permission_arr = permissionMap[plat][permission]["name"].split(",");
|
||||
|
||||
let flag = true;
|
||||
for(let i = 0;i<permission_arr.length;i++) {
|
||||
let status = plus.navigator.checkPermission(permission_arr[i]);
|
||||
if(status == "undetermined") {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
if (flag == false) { // 未完全授权
|
||||
showViewDesc(permission);
|
||||
requestAndroidPermission(permissionMap[plat][permission]["name"]).then((res) => {
|
||||
viewShow = false;
|
||||
setTimeout(()=>{
|
||||
viewShow = true;
|
||||
},120)
|
||||
view.close();
|
||||
// if (res == -1) {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '操作权限已被拒绝,请手动前往设置',
|
||||
// confirmText: "立即设置",
|
||||
// success: (res) => {
|
||||
// if (res.confirm) {
|
||||
// gotoAppPermissionSetting()
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
resolve(res)
|
||||
})
|
||||
} else {
|
||||
resolve(1)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
judgeIosPermission: judgeIosPermission,
|
||||
requestAndroidPermission: requestAndroidPermission,
|
||||
checkSystemEnableLocation: checkSystemEnableLocation,
|
||||
gotoAppPermissionSetting: gotoAppPermissionSetting
|
||||
gotoAppPermissionSetting: gotoAppPermissionSetting,
|
||||
premissionCheck: premissionCheck
|
||||
}
|
||||
|
||||
272
js_sdk/wa-permission11/permission.js
Normal file
@@ -0,0 +1,272 @@
|
||||
/**
|
||||
* 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
|
||||
*/
|
||||
|
||||
var isIos
|
||||
// #ifdef APP-PLUS
|
||||
isIos = (plus.os.name == "iOS")
|
||||
// #endif
|
||||
|
||||
// 判断推送权限是否开启
|
||||
function judgeIosPermissionPush() {
|
||||
var result = false;
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var app = UIApplication.sharedApplication();
|
||||
var enabledTypes = 0;
|
||||
if (app.currentUserNotificationSettings) {
|
||||
var settings = app.currentUserNotificationSettings();
|
||||
enabledTypes = settings.plusGetAttribute("types");
|
||||
console.log("enabledTypes1:" + enabledTypes);
|
||||
if (enabledTypes == 0) {
|
||||
console.log("推送权限没有开启");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
plus.ios.deleteObject(settings);
|
||||
} else {
|
||||
enabledTypes = app.enabledRemoteNotificationTypes();
|
||||
if (enabledTypes == 0) {
|
||||
console.log("推送权限没有开启!");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
console.log("enabledTypes2:" + enabledTypes);
|
||||
}
|
||||
plus.ios.deleteObject(app);
|
||||
plus.ios.deleteObject(UIApplication);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断定位权限是否开启
|
||||
function judgeIosPermissionLocation() {
|
||||
var result = false;
|
||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||
var status = cllocationManger.authorizationStatus();
|
||||
result = (status != 2)
|
||||
console.log("定位权限开启:" + result);
|
||||
// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
|
||||
/* var enable = cllocationManger.locationServicesEnabled();
|
||||
var status = cllocationManger.authorizationStatus();
|
||||
console.log("enable:" + enable);
|
||||
console.log("status:" + status);
|
||||
if (enable && status != 2) {
|
||||
result = true;
|
||||
console.log("手机定位服务已开启且已授予定位权限");
|
||||
} else {
|
||||
console.log("手机系统的定位没有打开或未给予定位权限");
|
||||
} */
|
||||
plus.ios.deleteObject(cllocationManger);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断麦克风权限是否开启
|
||||
function judgeIosPermissionRecord() {
|
||||
var result = false;
|
||||
var avaudiosession = plus.ios.import("AVAudioSession");
|
||||
var avaudio = avaudiosession.sharedInstance();
|
||||
var permissionStatus = avaudio.recordPermission();
|
||||
console.log("permissionStatus:" + permissionStatus);
|
||||
if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
|
||||
console.log("麦克风权限没有开启");
|
||||
} else {
|
||||
result = true;
|
||||
console.log("麦克风权限已经开启");
|
||||
}
|
||||
plus.ios.deleteObject(avaudiosession);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断相机权限是否开启
|
||||
function judgeIosPermissionCamera() {
|
||||
var result = false;
|
||||
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
||||
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
|
||||
console.log("authStatus:" + authStatus);
|
||||
if (authStatus == 3) {
|
||||
result = true;
|
||||
console.log("相机权限已经开启");
|
||||
} else {
|
||||
console.log("相机权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(AVCaptureDevice);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断相册权限是否开启
|
||||
function judgeIosPermissionPhotoLibrary() {
|
||||
var result = false;
|
||||
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
|
||||
var authStatus = PHPhotoLibrary.authorizationStatus();
|
||||
console.log("authStatus:" + authStatus);
|
||||
if (authStatus == 3) {
|
||||
result = true;
|
||||
console.log("相册权限已经开启");
|
||||
} else {
|
||||
console.log("相册权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(PHPhotoLibrary);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断通讯录权限是否开启
|
||||
function judgeIosPermissionContact() {
|
||||
var result = false;
|
||||
var CNContactStore = plus.ios.import("CNContactStore");
|
||||
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
|
||||
if (cnAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("通讯录权限已经开启");
|
||||
} else {
|
||||
console.log("通讯录权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(CNContactStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断日历权限是否开启
|
||||
function judgeIosPermissionCalendar() {
|
||||
var result = false;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("日历权限已经开启");
|
||||
} else {
|
||||
console.log("日历权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 判断备忘录权限是否开启
|
||||
function judgeIosPermissionMemo() {
|
||||
var result = false;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = true;
|
||||
console.log("备忘录权限已经开启");
|
||||
} else {
|
||||
console.log("备忘录权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Android权限查询
|
||||
function requestAndroidPermission(permissionID) {
|
||||
return new Promise((resolve, reject) => {
|
||||
plus.android.requestPermissions(
|
||||
[permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
|
||||
function(resultObj) {
|
||||
var result = 0;
|
||||
for (var i = 0; i < resultObj.granted.length; i++) {
|
||||
var grantedPermission = resultObj.granted[i];
|
||||
console.log('已获取的权限:' + grantedPermission);
|
||||
result = 1
|
||||
}
|
||||
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
|
||||
var deniedPresentPermission = resultObj.deniedPresent[i];
|
||||
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
|
||||
result = 0
|
||||
}
|
||||
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
|
||||
var deniedAlwaysPermission = resultObj.deniedAlways[i];
|
||||
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
|
||||
result = -1
|
||||
}
|
||||
resolve(result);
|
||||
// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
|
||||
// if (result != 1) {
|
||||
// gotoAppPermissionSetting()
|
||||
// }
|
||||
},
|
||||
function(error) {
|
||||
console.log('申请权限错误:' + error.code + " = " + error.message);
|
||||
resolve({
|
||||
code: error.code,
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// 使用一个方法,根据参数判断权限
|
||||
function judgeIosPermission(permissionID) {
|
||||
if (permissionID == "location") {
|
||||
return judgeIosPermissionLocation()
|
||||
} else if (permissionID == "camera") {
|
||||
return judgeIosPermissionCamera()
|
||||
} else if (permissionID == "photoLibrary") {
|
||||
return judgeIosPermissionPhotoLibrary()
|
||||
} else if (permissionID == "record") {
|
||||
return judgeIosPermissionRecord()
|
||||
} else if (permissionID == "push") {
|
||||
return judgeIosPermissionPush()
|
||||
} else if (permissionID == "contact") {
|
||||
return judgeIosPermissionContact()
|
||||
} else if (permissionID == "calendar") {
|
||||
return judgeIosPermissionCalendar()
|
||||
} else if (permissionID == "memo") {
|
||||
return judgeIosPermissionMemo()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 跳转到**应用**的权限页面
|
||||
function gotoAppPermissionSetting() {
|
||||
if (isIos) {
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var application2 = UIApplication.sharedApplication();
|
||||
var NSURL2 = plus.ios.import("NSURL");
|
||||
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
|
||||
var setting2 = NSURL2.URLWithString("app-settings:");
|
||||
application2.openURL(setting2);
|
||||
|
||||
plus.ios.deleteObject(setting2);
|
||||
plus.ios.deleteObject(NSURL2);
|
||||
plus.ios.deleteObject(application2);
|
||||
} else {
|
||||
// console.log(plus.device.vendor);
|
||||
var Intent = plus.android.importClass("android.content.Intent");
|
||||
var Settings = plus.android.importClass("android.provider.Settings");
|
||||
var Uri = plus.android.importClass("android.net.Uri");
|
||||
var mainActivity = plus.android.runtimeMainActivity();
|
||||
var intent = new Intent();
|
||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
mainActivity.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
// 检查系统的设备服务是否开启
|
||||
// var checkSystemEnableLocation = async function () {
|
||||
function checkSystemEnableLocation() {
|
||||
if (isIos) {
|
||||
var result = false;
|
||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||
var result = cllocationManger.locationServicesEnabled();
|
||||
console.log("系统定位开启:" + result);
|
||||
plus.ios.deleteObject(cllocationManger);
|
||||
return result;
|
||||
} else {
|
||||
var context = plus.android.importClass("android.content.Context");
|
||||
var locationManager = plus.android.importClass("android.location.LocationManager");
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
||||
var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
|
||||
console.log("系统定位开启:" + result);
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
judgeIosPermission: judgeIosPermission,
|
||||
requestAndroidPermission: requestAndroidPermission,
|
||||
checkSystemEnableLocation: checkSystemEnableLocation,
|
||||
gotoAppPermissionSetting: gotoAppPermissionSetting
|
||||
}
|
||||
4
main.js
@@ -28,7 +28,7 @@ Vue.prototype.$apkUrl = "https://a.app.qq.com/o/simple.jsp?pkgname=com.cn.medici
|
||||
|
||||
uni.getSystemInfo({
|
||||
success: function (res) {
|
||||
|
||||
Vue.prototype.$platform = res.platform;
|
||||
Vue.prototype.iosHidden = true;
|
||||
if (res.platform == 'ios') {
|
||||
|
||||
@@ -106,6 +106,8 @@ import commonAddress from '@/pages/component/commonComponents/address/index.vue'
|
||||
Vue.component('common-address', commonAddress);
|
||||
import commonSelectGoods from '@/pages/component/commonComponents/selectGoods.vue'
|
||||
Vue.component('common-select-goods', commonSelectGoods);
|
||||
import commonVideoIos from '@/pages/component/commonComponents/video/ios.nvue'
|
||||
Vue.component('common-video-ios', commonVideoIos);
|
||||
// import musicPlay from '@/components/music.vue'
|
||||
// Vue.component('music-play', musicPlay);
|
||||
|
||||
|
||||
@@ -12,12 +12,19 @@
|
||||
"src" : "图片路径"
|
||||
}
|
||||
],
|
||||
"versionName" : "1.0.02",
|
||||
"versionCode" : 1002,
|
||||
"versionName" : "1.0.15",
|
||||
"versionCode" : 1015,
|
||||
"app-plus" : {
|
||||
"nvueCompiler" : "weex",
|
||||
"compatible" : {
|
||||
"ignoreVersion" : true
|
||||
},
|
||||
"screenOrientation" : [
|
||||
"portrait-primary",
|
||||
"portrait-secondary",
|
||||
"landscape-primary",
|
||||
"landscape-secondary"
|
||||
],
|
||||
"privacy" : {
|
||||
"prompt" : "template",
|
||||
"template" : {
|
||||
@@ -31,8 +38,8 @@
|
||||
"Payment" : {},
|
||||
"Share" : {},
|
||||
"Camera" : {},
|
||||
"VideoPlayer" : {},
|
||||
"OAuth" : {}
|
||||
"OAuth" : {},
|
||||
"VideoPlayer" : {}
|
||||
},
|
||||
"distribute" : {
|
||||
"apple" : {
|
||||
@@ -120,8 +127,9 @@
|
||||
"urltypes" : "medicine",
|
||||
"urlschemewhitelist" : "nuttyreading,zmzm",
|
||||
"privacyDescription" : {
|
||||
"NSPhotoLibraryUsageDescription" : "为了给您提供修改头像的功能",
|
||||
"NSCameraUsageDescription" : "为了给您提供修改头像的功能"
|
||||
"NSPhotoLibraryUsageDescription" : "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用",
|
||||
"NSCameraUsageDescription" : "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用",
|
||||
"NSPhotoLibraryAddUsageDescription" : "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用"
|
||||
}
|
||||
},
|
||||
"icons" : {
|
||||
@@ -165,6 +173,13 @@
|
||||
"nativePlugins" : {},
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
},
|
||||
"safearea" : {
|
||||
//安全区域配置,仅iOS平台生效
|
||||
"bottom" : {
|
||||
// 底部安全区域配置
|
||||
"offset" : "none" // 底部安全区域偏移,"none"表示不空出安全区域,"auto"自动计算空出安全区域,默认值为"none"
|
||||
}
|
||||
}
|
||||
},
|
||||
// 5+App特有相关
|
||||
|
||||
BIN
node_modules.zip
Normal file
11
pages.json
@@ -366,12 +366,21 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
// ios课程播放
|
||||
"path": "pages/course/chapterDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "章节详情",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
// Andriod课程播放
|
||||
"path": "pages/course/chapterDetailAndorid",
|
||||
"style": {
|
||||
"navigationBarTitleText": "章节详情",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/course/courseSet",
|
||||
"style": {
|
||||
@@ -579,7 +588,7 @@
|
||||
"pagePath": "pages/bookShop/orderList",
|
||||
"iconPath": "static/tab/order.png",
|
||||
"selectedIconPath": "static/tab/order_active.png",
|
||||
"text": "订单"
|
||||
"text": "我的订单"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/taihu/index",
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
|
||||
|
||||
<view class="quanyi_item " v-for="(v, i) in qunyiList"
|
||||
<view class="quanyi_item " v-for="(v, i) in qunyiList" :key="i"
|
||||
@click="handleClickQuanyi(v, i, item)" style="font-weight: 700;color:#71d5a1;">
|
||||
<view style="width: 100%;display: flex;
|
||||
align-items: center;">
|
||||
|
||||
@@ -931,7 +931,7 @@ export default {
|
||||
color: "#fff",
|
||||
});
|
||||
}
|
||||
if (this.orderContet.orderStatus == 0) {
|
||||
if (this.orderContet.orderStatus == 0 && this.orderContet.paymentMethod != 3) {
|
||||
this.customButton.push({
|
||||
width: "160rpx",
|
||||
text: "继续付款",
|
||||
@@ -1078,16 +1078,11 @@ export default {
|
||||
} else if (payItem.paymentMethod == 3) {
|
||||
// 苹果充值
|
||||
console.log("苹果二次支付");
|
||||
if (this.isAndorid) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
showCancel: false,
|
||||
content:
|
||||
"很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单",
|
||||
});
|
||||
} else {
|
||||
this.iphonepay(payItem);
|
||||
}
|
||||
uni.showModal({
|
||||
content:'apple内购订单不支持继续支付,请重新发起支付申请并完成支付',
|
||||
confirmText:'好的',
|
||||
showCancel:false
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -395,7 +395,7 @@
|
||||
<view class="right flexbox opbtns">
|
||||
<view
|
||||
class="orderstatusbtn orderstatusbtn_success"
|
||||
v-if="slotProps.row.orderStatus == 0"
|
||||
v-if="slotProps.row.orderStatus == 0 && slotProps.row.paymentMethod != 3"
|
||||
@click.stop="goPay(slotProps.row)"
|
||||
>继续付款</view
|
||||
>
|
||||
@@ -897,7 +897,7 @@ export default {
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, "内容获取成功");
|
||||
// console.log(res, "内容获取成功");
|
||||
that.pagination.total = res.data.total;
|
||||
if (res.data.total == 0) {
|
||||
this.isLoadingHide = true;
|
||||
@@ -947,16 +947,8 @@ export default {
|
||||
}
|
||||
);
|
||||
} else if (payItem.paymentMethod == 1) {
|
||||
console.log("微信支付");
|
||||
// console.log(this.isAndorid)
|
||||
if (this.isAndorid == false) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "很抱歉,苹果系统暂不支持微信支付",
|
||||
showCancel: false,
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
console.log("微信支付");
|
||||
|
||||
let data1 = {
|
||||
orderSn: payItem.orderSn,
|
||||
buyOrderId: null,
|
||||
@@ -984,21 +976,25 @@ export default {
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (payItem.paymentMethod == 3) {
|
||||
});
|
||||
} else if (payItem.paymentMethod == 3 && this.ordersListTab == 0 ) {
|
||||
// 苹果充值
|
||||
console.log("苹果二次支付");
|
||||
if (this.isAndorid) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
showCancel: false,
|
||||
content:
|
||||
"很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单",
|
||||
});
|
||||
} else {
|
||||
this.iphonepay(payItem);
|
||||
}
|
||||
uni.showModal({
|
||||
content:'apple内购订单不支持继续支付,请重新发起支付申请并完成支付',
|
||||
confirmText:'好的',
|
||||
showCancel:false
|
||||
})
|
||||
// if (this.isAndorid) {
|
||||
// uni.showModal({
|
||||
// title: "提示",
|
||||
// showCancel: false,
|
||||
// content:
|
||||
// "很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单",
|
||||
// });
|
||||
// } else {
|
||||
// this.iphonepay(payItem);
|
||||
// }
|
||||
}else if (payItem.paymentMethod == 4){
|
||||
console.log('天医币二次支付')
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<template>
|
||||
<view class="richDetail">
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
|
||||
<view
|
||||
scroll-x="true"
|
||||
class="detail_title video_box"
|
||||
style="background-color: #fff"
|
||||
>
|
||||
|
||||
>
|
||||
|
||||
<view
|
||||
v-for="(v, i) in dataList"
|
||||
:class="`video_item ${currentVideo&¤tVideo.id == v.id ? 'hot' : ''}`"
|
||||
@@ -28,13 +27,16 @@
|
||||
import $http from "@/config/requestConfig.js";
|
||||
import { mapState } from "vuex";
|
||||
export default {
|
||||
props: ["detailInfo", "dataList", "currentVideo"],
|
||||
props: ["detailInfo", "dataList", "currentVideo", "changeVideoLock"],
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onLoad(options) {},
|
||||
onHide() {},
|
||||
mounted() {
|
||||
console.log('currentVideo播放列表收到的--',this.currentVideo)
|
||||
},
|
||||
computed: {
|
||||
...mapState(["userInfo"]),
|
||||
},
|
||||
@@ -47,8 +49,10 @@ export default {
|
||||
}
|
||||
},
|
||||
handleClick(data) {
|
||||
if(this.changeVideoLock){
|
||||
return
|
||||
}
|
||||
console.log("data at line 35:", data);
|
||||
|
||||
this.$emit("open", data);
|
||||
},
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ import { mapState, mapMutations } from "vuex";
|
||||
|
||||
const { platform } = uni.getSystemInfoSync();
|
||||
|
||||
import permision from "@/js_sdk/wa-permission/permission.js";
|
||||
import permision from "@/js_sdk/wa-permission11/permission.js";
|
||||
|
||||
const definitions = [
|
||||
{
|
||||
|
||||
1439
pages/component/commonComponents/video/ios.nvue
Normal file
@@ -11,16 +11,19 @@
|
||||
isFullScreen ? 'background:#000' : ''
|
||||
}`"
|
||||
>
|
||||
<!-- 加密视频 -->
|
||||
<view :style="`background:#000`">
|
||||
<common-video
|
||||
<common-video-ios
|
||||
@changeScreen="changeScreen"
|
||||
@changeScreenLoading="changeScreenLoading"
|
||||
v-if="isfresh"
|
||||
ref="commonVideo"
|
||||
:videoTitle="curriculumData.title"
|
||||
:currentVideo="currentVideo"
|
||||
:noRecored = "noRecored"
|
||||
:currentVideoList="videoArray"
|
||||
>
|
||||
</common-video>
|
||||
</common-video-ios>
|
||||
<view style="height: 200px" v-else></view>
|
||||
</view>
|
||||
|
||||
@@ -327,6 +330,7 @@ export default {
|
||||
limitTitle: "提示",
|
||||
limitContent: "",
|
||||
scrollViewHeight: 0,
|
||||
noRecored:null, // 是否为试听资源
|
||||
urlList: {
|
||||
detail: "sociology/course/getCourseCatalogueChapterDetail",
|
||||
curriculumInfo: "app/phone.do?getCourseInfo",
|
||||
@@ -334,9 +338,12 @@ export default {
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
// #ifdef APP-PLUS
|
||||
plus.screen.lockOrientation("default");
|
||||
|
||||
// #endif
|
||||
this.options = options;
|
||||
this.noRecored = options.noRecored
|
||||
console.log('this.noRecored=>',this.noRecored)
|
||||
this.screenLoading = false;
|
||||
|
||||
this.currentCateIndex = this.options.videoIndex
|
||||
@@ -345,6 +352,7 @@ export default {
|
||||
// #ifdef APP-PLUS
|
||||
plus.screen.unlockOrientation(); //解除锁定屏幕方向
|
||||
plus.screen.lockOrientation("portrait-primary");
|
||||
|
||||
this.getCourseDescriptionData();
|
||||
|
||||
// this.getUserInfo()
|
||||
@@ -445,33 +453,6 @@ export default {
|
||||
}
|
||||
|
||||
console.log("data at line 380111111111111111111:", data.type);
|
||||
|
||||
// var mynavData = JSON.stringify(data); // 这里转换成 字符串
|
||||
|
||||
// if (data.type == 0 || data.type == 2) {
|
||||
// //1 mp4 2 mp3
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/curriculum/order/curriculum/videoDetail?data=${mynavData}`,
|
||||
// });
|
||||
// } else if (data.type == 1) {
|
||||
// //视频云点播
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/curriculum/order/curriculum/videoDetailOss?data=${mynavData}`,
|
||||
// });
|
||||
// }
|
||||
|
||||
// else if (data.type == 2) {
|
||||
// //mp3
|
||||
// this.isOpenMp3 = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.mp3Detail.init({ data: mynavData });
|
||||
// });
|
||||
// }
|
||||
|
||||
// uni.navigateTo({
|
||||
// // url: '../bookShop/commodityDetail?id=' + item.id
|
||||
// url: `/pages/curriculum/order/curriculum/detail?navTitle=${v.title}&title=${v.title}&oid=${v.oid}`,
|
||||
// });
|
||||
},
|
||||
hancleModalCancel() {
|
||||
this.show = false;
|
||||
@@ -489,13 +470,7 @@ export default {
|
||||
customerOid: uni.getStorageSync("customerOid"),
|
||||
...this.taiHuClassInfo,
|
||||
},
|
||||
};
|
||||
// $mars.progressBegin('申请中...');
|
||||
// $mars.post(customerType, 'applyRelearn', data, function (ret) {
|
||||
// api.hideProgress();
|
||||
|
||||
// fnLoadDataGrid();
|
||||
// });
|
||||
};
|
||||
},
|
||||
|
||||
//课程详情
|
||||
|
||||
1188
pages/course/chapterDetailAndorid.vue
Normal file
@@ -207,15 +207,15 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-section class="mb-10 graybg" title="留言板" type="line">
|
||||
<!-- <uni-section class="mb-10 graybg" title="留言板" type="line">
|
||||
<template v-slot:right>
|
||||
<view class="flexbox" style="align-items: center" @click="addSay()">
|
||||
<u-icon name="edit-pen" color="#2979ff" size="28"></u-icon>
|
||||
<text>发布留言</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-section>
|
||||
<view class="liuyanBox">
|
||||
</uni-section> -->
|
||||
<view class="liuyanBox" v-if="false">
|
||||
<view class="" v-if="sayList.length > 0">
|
||||
<commentsList
|
||||
:sayList="sayList"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<public-module></public-module>
|
||||
<z-nav-bar title="课程价格"></z-nav-bar>
|
||||
<view class="addVip">
|
||||
<u-alert v-if="" style="
|
||||
<u-alert v-if="isAndorid" style="
|
||||
width: 100%;
|
||||
" :title="goBuyTitle" type="warning" :show-icon="true">
|
||||
<template slot="rightSlot" slot-scope="slotProps">
|
||||
@@ -105,7 +105,8 @@
|
||||
proPriceList: [],
|
||||
pricespop: false,
|
||||
userMsg: {},
|
||||
cartList: []
|
||||
cartList: [],
|
||||
isAndorid:true
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
@@ -115,6 +116,7 @@
|
||||
// console.log(e, '------')
|
||||
this.getUserInfo()
|
||||
this.getCoursePriceList1()
|
||||
this.getOS()
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo'])
|
||||
@@ -122,7 +124,7 @@
|
||||
//页面显示
|
||||
onShow() {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
uni.hideTabBar();
|
||||
// this.getCoursePriceList()
|
||||
},
|
||||
onPageScroll(e) {
|
||||
@@ -138,6 +140,17 @@
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
// 获得操作系统
|
||||
getOS() {
|
||||
let oprateOs = "";
|
||||
oprateOs = uni.getSystemInfoSync().platform;
|
||||
// console.log(oprateOs)
|
||||
if (oprateOs == "android") {
|
||||
this.isAndorid = true;
|
||||
} else {
|
||||
this.isAndorid = false;
|
||||
}
|
||||
},
|
||||
loadMoreCourse(val, i) {
|
||||
console.log(val, 'val',i,'++++++++++++++++')
|
||||
let _page = val.subpage
|
||||
|
||||
@@ -360,6 +360,8 @@
|
||||
}
|
||||
|
||||
.jianjie {
|
||||
line-height: 30rpx; height: 60rpx; overflow: hidden;
|
||||
overflow: hidden!important;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
@include bov();
|
||||
@@ -377,11 +379,14 @@
|
||||
.subCate {
|
||||
padding-top:10px;
|
||||
padding-bottom: 10px;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
.item {
|
||||
border: 1px solid #bfcad9;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
border-radius: 4px; width: 100%;
|
||||
color: #333;
|
||||
margin-right: 16rpx;
|
||||
padding: 14rpx 30rpx;
|
||||
@@ -392,6 +397,7 @@
|
||||
}
|
||||
|
||||
.item.active {
|
||||
border-color: $themeColor;
|
||||
background-color: $themeColor;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -36,14 +36,14 @@
|
||||
VIP畅学
|
||||
</view>
|
||||
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||
<view class="imgcontainer" @click="onPageJump('/pages/course/myCourseLearn',item.id)">
|
||||
<view class="imgcontainer" @click="onPageJump('/pages/course/courseDetail',item.id)">
|
||||
<image v-if="item.image && item.image != ''" :src="item.image" mode="aspectFit"></image>
|
||||
<!-- <image :src="item.image" mode="" @click="goDetail(item.productId)"></image> -->
|
||||
<!-- <image v-else src="/static/nobg.jpg" mode="widthFix"></image> -->
|
||||
</view>
|
||||
<view class="buyItems">
|
||||
<view class="txt555">
|
||||
<view class="" @click="onPageJump('/pages/course/myCourseLearn',item.id)">
|
||||
<view class="" @click="onPageJump('/pages/course/courseDetail',item.id)">
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
@@ -54,7 +54,7 @@
|
||||
<!-- 收藏状态{{item.isStudying}} -->
|
||||
<text class="add citem" v-if="item.isStudying == 0" @click="addCollection(item,index)">加入在学习</text>
|
||||
<text class="del citem" v-else @click="delCollection(item,index)">取消在学习</text>
|
||||
<text class="citem btn_box" @click="onPageJump('/pages/course/myCourseLearn',item.id)">去学习</text>
|
||||
<text class="citem btn_box" @click="onPageJump('/pages/course/courseDetail',item.id)">去学习</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -76,11 +76,11 @@
|
||||
</view>
|
||||
<!-- {{userMsg}} -->
|
||||
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||
<view class="imgcontainer" @click="onPageJump('/pages/course/myCourseLearn',item.id)">
|
||||
<view class="imgcontainer" @click="onPageJump('/pages/course/courseDetail',item.id)">
|
||||
<image :src="item.image" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="buyItems">
|
||||
<view class="txt555" @click="onPageJump('/pages/course/myCourseLearn',item.id)">
|
||||
<view class="txt555" @click="onPageJump('/pages/course/courseDetail',item.id)">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="jianjie" v-html="item.content">
|
||||
@@ -88,7 +88,7 @@
|
||||
<view class="collection">
|
||||
<!-- <text class="add citem" v-if="item.isStudying == 0" @click="addCollection(item,index)">加入在学习</text> -->
|
||||
<text class="del citem" @click="delCollection(item,index)">取消在学习</text>
|
||||
<text class="citem btn_box" @click="onPageJump('/pages/course/myCourseLearn',item.id)">去学习</text>
|
||||
<text class="citem btn_box" @click="onPageJump('/pages/course/courseDetail',item.id)">去学习</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -854,6 +854,7 @@
|
||||
}
|
||||
|
||||
.jianjie {
|
||||
line-height: 30rpx; height: 60rpx; overflow: hidden;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
@include bov();
|
||||
|
||||
@@ -74,10 +74,8 @@
|
||||
<!-- </text> -->
|
||||
</view>
|
||||
<view class="tag-view">
|
||||
|
||||
|
||||
<uni-tag @click="goBuy()" text="购买课程" type="warning" style="larg" />
|
||||
<uni-tag @click="onPageJump('/pages/mine/vip/index')" style="margin-left: 20rpx;" text="开通VIP" type="success" />
|
||||
<uni-tag @click="goBuy()" text="购买课程" type="warning" size="normal" />
|
||||
<uni-tag v-if="isAndorid" @click="onPageJump('/pages/mine/vip/index')" size="normal" style="margin-left: 20rpx;" text="开通VIP" type="success" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -116,6 +114,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isAndorid: true,
|
||||
playData: {},
|
||||
catalogueId: null,
|
||||
// fixed: false,
|
||||
@@ -208,7 +207,8 @@
|
||||
plus.screen.unlockOrientation();
|
||||
plus.screen.lockOrientation("portrait-primary");
|
||||
// #endif
|
||||
this.getData(this.courseId)
|
||||
this.getData(this.courseId)
|
||||
this.getOS()
|
||||
},
|
||||
onReachBottom() {
|
||||
console.log('触底');
|
||||
@@ -225,7 +225,17 @@
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
|
||||
// 获得操作系统
|
||||
getOS() {
|
||||
let oprateOs = "";
|
||||
oprateOs = uni.getSystemInfoSync().platform;
|
||||
// console.log(oprateOs)
|
||||
if (oprateOs == "android") {
|
||||
this.isAndorid = true;
|
||||
} else {
|
||||
this.isAndorid = false;
|
||||
}
|
||||
},
|
||||
getUserInfo() {
|
||||
// 用户详情
|
||||
// if (this.userInfo.id != undefined) {
|
||||
@@ -885,7 +895,7 @@
|
||||
if (res.code == 0) {
|
||||
if (res.chapterList.length > 0) {
|
||||
this.courseList = res.chapterList
|
||||
console.log('status++++++++++++++', this.courseList)
|
||||
// console.log('status++++++++++++++', this.courseList)
|
||||
} else {
|
||||
this.courseList = []
|
||||
}
|
||||
|
||||
@@ -717,6 +717,7 @@ export default {
|
||||
curriculumInfo: "app/phone.do?getCourseInfo",
|
||||
detailInfo: "sociology/product/getProductDetail",
|
||||
goodsList: "book/shopproduct/getGlProductList",
|
||||
visitorDetailInfo: "visitor/getProductDetail", // 游客状态下的商品详情
|
||||
},
|
||||
customButtonGroup1: [
|
||||
{
|
||||
@@ -726,6 +727,7 @@ export default {
|
||||
color: "#fff",
|
||||
},
|
||||
],
|
||||
requestType:'', // 数据请求类型是否为游客登陆状态
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
@@ -780,7 +782,7 @@ export default {
|
||||
},
|
||||
onLoad(options) {
|
||||
this.options = options;
|
||||
console.log('options',options)
|
||||
console.log('options',options)
|
||||
// this.handleClickGetGoodsList();
|
||||
// this.getUserInfo()
|
||||
// this.getCateList()
|
||||
@@ -799,6 +801,7 @@ export default {
|
||||
// this.searchList = []
|
||||
},
|
||||
onShow() {
|
||||
this.requestType = this.options.type
|
||||
this.selectGoodsData = {};
|
||||
this.getCourseDescriptionData();
|
||||
this.show = false;
|
||||
@@ -823,6 +826,21 @@ export default {
|
||||
this.show = false;
|
||||
},
|
||||
selectGoods(data) {
|
||||
if(this.requestType == 'visitor'){
|
||||
uni.showModal({
|
||||
content:"登陆后可购买本商品",
|
||||
confirmText:'去登录',
|
||||
cancelText:'再逛逛',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url:'/pages/user/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
this.selectGoodsData = data;
|
||||
this.$refs.commonSelectGoods.open()
|
||||
// this.show = true;
|
||||
@@ -830,10 +848,25 @@ export default {
|
||||
},
|
||||
|
||||
onHandleClickBuy1() {
|
||||
if(this.requestType == 'visitor'){
|
||||
uni.showModal({
|
||||
content:"登陆后可购买本商品",
|
||||
confirmText:'去登录',
|
||||
cancelText:'再逛逛',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url:'/pages/user/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$refs.commonSelectGoods.open();
|
||||
// this.show = true;
|
||||
},
|
||||
onHandleClickBuy() {
|
||||
onHandleClickBuy() {
|
||||
console.log(
|
||||
this.selectGoodsData,
|
||||
"this.selectGoodsDatathis.selectGoodsDatathis.selectGoodsData"
|
||||
@@ -957,10 +990,11 @@ export default {
|
||||
async getCourseDescriptionData() {
|
||||
var data = {};
|
||||
var that = this;
|
||||
|
||||
let url = ''
|
||||
this.requestType == 'visitor' ? url = this.urlList.visitorDetailInfo : url = this.urlList.detailInfo
|
||||
this.$http
|
||||
.request({
|
||||
url: this.urlList.detailInfo,
|
||||
url,
|
||||
method: "POST",
|
||||
data: {
|
||||
productId: this.options.id,
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="prof">吴门医述是一款专业的医学线上教育平台。内容涵盖中医学、针灸学、心身医学、中西汇通学、肿瘤学。仰望星空、脚踏实地、梦从这里起航。</view>
|
||||
<view class="prof">吴门医述是一款线上视频平台。内容涵盖中医学、针灸学、心身医学、中西汇通学、肿瘤学。仰望星空、脚踏实地、梦从这里起航。</view>
|
||||
<view class="" style="text-align: center;">
|
||||
<!-- https://main.nuttyreading.com/privacy.html -->
|
||||
<!-- <text @click="seeDetail('')" style="color: #007aff; font-size: 26rpx;">隐私政策</text> -->
|
||||
<uni-link href="https://zmzm.taihumed.com/privacy.html" text="隐私政策"></uni-link>
|
||||
<uni-link href="https://wumen.taihumed.com/privacy/" text="隐私政策"></uni-link>
|
||||
<!-- <uni-link href="https://uniapp.dcloud.io/" text="https://uniapp.dcloud.io/"></uni-link> -->
|
||||
</view>
|
||||
<music-play :playData="playData"></music-play>
|
||||
|
||||
@@ -63,31 +63,73 @@
|
||||
</view>
|
||||
<br clear="both" />
|
||||
</view>
|
||||
<!-- <view class="now_vip" v-if="userMes.vip==0">
|
||||
<text>
|
||||
<image src="../../static/icon/mine_p.png" style="height: 44rpx;"></image>
|
||||
开通会员畅享海量内容
|
||||
</text>
|
||||
<b class="kt_btn" @click="onPageJump('./opeVip')">开通VIP</b>
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="now_vip" v-if="userMes.vip==1">
|
||||
<text>
|
||||
<image src="../../static/icon/mine_v.png"></image>
|
||||
尊贵的VIP会员
|
||||
<font style="font-size: 14rpx;margin-left: 20rpx;">{{userMes.vipValidtime}}到期</font>
|
||||
</text>
|
||||
<b class="kt_btn" @click="onPageJump('./opeVip')">立即续费</b>
|
||||
</view> -->
|
||||
|
||||
<view
|
||||
style="
|
||||
padding: 20rpx;
|
||||
height: 200rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx; overflow: hidden;
|
||||
"
|
||||
>
|
||||
<!-- vip 只有安卓才显示-->
|
||||
<view v-if="isAndorid"
|
||||
class="chong_zhi boxShadow box_fillet vip_box"
|
||||
@click="onPageJump('/pages/mine/vip/index')"
|
||||
>
|
||||
<view v-if="!userMes.userVip" class="noVip">
|
||||
<view class="zhanghu PM_font" style="text-align: left">
|
||||
<image
|
||||
class="vip_image"
|
||||
src="@/static/vip.png"
|
||||
mode="aspectFit"
|
||||
>
|
||||
</image>
|
||||
<text style="color: #fff; font-size: 60rpx;">VIP</text>
|
||||
</view>
|
||||
<view class="" style="width:calc(100% - 200rpx);">
|
||||
<swiper
|
||||
:autoplay="true"
|
||||
:interval="3000"
|
||||
:duration="1000"
|
||||
style="width:100%; height: 60rpx"
|
||||
>
|
||||
<swiper-item
|
||||
v-for="(item, index) in swiperList"
|
||||
style="width: 100%; height: 100%"
|
||||
>
|
||||
<view
|
||||
style="
|
||||
background: linear-gradient(
|
||||
130deg,
|
||||
rgb(46, 103, 106) 0%,
|
||||
rgb(114, 173, 146) 100%
|
||||
)
|
||||
text;
|
||||
text-align: center;
|
||||
"
|
||||
:style="item.style"
|
||||
v-html="item.name"
|
||||
></view>
|
||||
<!-- <image :src="curriculumData.explainsImg" mode="widthFix" class="headImage"></image> -->
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="noVip hasVip">
|
||||
<view class="zhanghu PM_font" style="text-align: center">
|
||||
<image
|
||||
class="vip_image"
|
||||
src="@/static/vip.png"
|
||||
mode="aspectFit"
|
||||
>
|
||||
</image>
|
||||
<text style="color: #fff; font-size: 60rpx;">VIP</text>
|
||||
</view>
|
||||
|
||||
<view class="time"
|
||||
>{{ userMes.userVip.endTime.split(" ")[0] }}到期</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<!-- end -->
|
||||
<view class="chong_zhi boxShadow box_fillet chongzhi_box">
|
||||
<!-- <view
|
||||
class="zhanghu"
|
||||
@@ -176,67 +218,9 @@
|
||||
></view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="chong_zhi boxShadow box_fillet vip_box"
|
||||
@click="onPageJump('/pages/mine/vip/index')"
|
||||
>
|
||||
<view v-if="!userMes.userVip" class="noVip">
|
||||
<view class="zhanghu PM_font" style="text-align: center">
|
||||
<image
|
||||
class="vip_image"
|
||||
src="@/static/icon/noquanyi.png"
|
||||
mode="aspectFit"
|
||||
>
|
||||
</image>
|
||||
<text style="color: #c4d3d4">VIP</text>
|
||||
</view>
|
||||
|
||||
<swiper
|
||||
:autoplay="true"
|
||||
:interval="3000"
|
||||
:duration="1000"
|
||||
style="width: 100%; height: 60rpx"
|
||||
>
|
||||
<swiper-item
|
||||
v-for="(item, index) in swiperList"
|
||||
style="width: 100%; height: 100%"
|
||||
>
|
||||
<view
|
||||
style="
|
||||
background: linear-gradient(
|
||||
130deg,
|
||||
rgb(46, 103, 106) 0%,
|
||||
rgb(114, 173, 146) 100%
|
||||
)
|
||||
text;
|
||||
text-align: center;
|
||||
"
|
||||
:style="item.style"
|
||||
v-html="item.name"
|
||||
></view>
|
||||
<!-- <image :src="curriculumData.explainsImg" mode="widthFix" class="headImage"></image> -->
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view v-else class="noVip hasVip">
|
||||
<view class="zhanghu PM_font" style="text-align: center">
|
||||
<image
|
||||
class="vip_image"
|
||||
src="@/static/icon/quanyi.png"
|
||||
mode="aspectFit"
|
||||
>
|
||||
</image>
|
||||
<text style="">VIP</text>
|
||||
</view>
|
||||
|
||||
<view class="time"
|
||||
>{{ userMes.userVip.endTime.split(" ")[0] }}到期</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="list_box">
|
||||
<view class="xiugai boxShadow box_fillet">
|
||||
<common-list
|
||||
@@ -326,16 +310,16 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
swiperList: [
|
||||
{ name: "开通会员畅享更多活动" },
|
||||
{ name: "众妙之门视频" },
|
||||
{ name: "开通会员畅享更多活动",style:"color:#fff;font-size:28rpx" },
|
||||
{ name: "众妙之门视频",style:"color:#fff;font-size:28rpx" },
|
||||
{
|
||||
name: "吴门医述视频",
|
||||
name: "吴门医述视频",style:"color:#fff;font-size:28rpx"
|
||||
},
|
||||
{ name: "专属视频视听" },
|
||||
{ name: "专属视频视听",style:"color:#fff;font-size:28rpx" },
|
||||
{
|
||||
name: "读书相关权益",
|
||||
name: "读书相关权益",style:"color:#fff;font-size:28rpx"
|
||||
},
|
||||
{ name: "活动报名<text style='color:red'>(折扣价)</text>" },
|
||||
{ name: "活动报名<text style='color:#ffaa7f'>(折扣价)</text>" ,style:"color:#fff;font-size:28rpx"},
|
||||
],
|
||||
infoShow: false, // 显示电子书相关
|
||||
showEbook: false, // 显示电子书相关
|
||||
@@ -613,16 +597,16 @@ export default {
|
||||
font-weight: bold;
|
||||
font-size: 38upx;
|
||||
margin-bottom: 10rpx;
|
||||
color: #fff !important;
|
||||
color: #6990c7 !important;
|
||||
}
|
||||
|
||||
.phone {
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
color: #6990c7 !important;
|
||||
}
|
||||
|
||||
.tong {
|
||||
color: #999;
|
||||
color: #6990c7 !important;
|
||||
font-size: 25upx;
|
||||
}
|
||||
|
||||
@@ -671,9 +655,10 @@ export default {
|
||||
}
|
||||
}
|
||||
.commonPageBox {
|
||||
background-image: url("@/static/icon/mine_bg.png");
|
||||
// background-image: url("@/static/icon/mine_bg.png");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
background-image: linear-gradient(-60deg, #fdf0ed 0%, #bfe3f0 40%, #e4eefa 60%, #bfe3f0 80%, #fdf0ed 100%);
|
||||
// background-color: #d8f8e4 !important;
|
||||
}
|
||||
.chong_zhi {
|
||||
@@ -703,19 +688,19 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
flex-direction: column;
|
||||
// flex-direction: column;
|
||||
.zhanghu {
|
||||
font-size: 40rpx;
|
||||
width: 120rpx;
|
||||
margin-top: 20rpx;
|
||||
width: 200rpx;
|
||||
// margin-top: 20rpx;
|
||||
margin-bottom: 0rpx;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// justify-content: space-around;
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -724,13 +709,13 @@ export default {
|
||||
.time {
|
||||
color: #fff;
|
||||
padding: 4rpx 20rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 20rpx;
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
#56B0CE 0%,
|
||||
#6DDAEA 100%
|
||||
) !important;
|
||||
font-size: 28rpx;
|
||||
border-radius: 20rpx;
|
||||
// background: linear-gradient(
|
||||
// to right,
|
||||
// #56B0CE 0%,
|
||||
// #6DDAEA 100%
|
||||
// ) !important;
|
||||
}
|
||||
}
|
||||
.chong_list {
|
||||
@@ -762,11 +747,11 @@ export default {
|
||||
}
|
||||
|
||||
.chong_btn {
|
||||
position: absolute;
|
||||
// position: absolute;
|
||||
font-size: 26rpx;
|
||||
display: block;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
// top: 0px;
|
||||
// right: 0px;
|
||||
float: right;
|
||||
border-radius: 50rpx;
|
||||
color: #fffbf6;
|
||||
@@ -782,7 +767,7 @@ export default {
|
||||
border-radius: 20rpx !important;
|
||||
margin: 0 20rpx;
|
||||
// padding:0 40rpx;
|
||||
background: #E2F5FA;
|
||||
background: #f0f9fb;
|
||||
|
||||
.nav_list {
|
||||
background-color: #b7e0e2;
|
||||
@@ -824,7 +809,7 @@ export default {
|
||||
}
|
||||
|
||||
.box_fillet {
|
||||
border-radius: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
@@ -833,34 +818,30 @@ export default {
|
||||
|
||||
.chongzhi_box {
|
||||
position: relative;
|
||||
width: calc(100% - 320rpx);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
float: left;
|
||||
// float: left;
|
||||
padding: 30rpx 20rpx 10rpx;
|
||||
background-color: #E2F5FA;
|
||||
background-color: #f0f9fb;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.vip_box {
|
||||
padding: 0;
|
||||
|
||||
float: right;
|
||||
margin-bottom: 32rpx;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
width: 300rpx;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20rx;
|
||||
// background: rgba(255, 255, 255, 0.85);
|
||||
|
||||
// padding: 30rpx 20rpx 10rpx;
|
||||
// background-color: $themeBgColor;
|
||||
border-radius: 20rx;
|
||||
background-image: linear-gradient(60deg, #8265f9 30%, #016dea 100%);
|
||||
// @include themeBorder(6rpx, 20rpx, #258feb, #a6d8dc);
|
||||
@include themeBorder(
|
||||
10rpx,
|
||||
20rpx,
|
||||
(
|
||||
linear-gradient(#DDF2FC, #BFDDF2),
|
||||
linear-gradient(to bottom left, #D5EDF8, #a6d8dc)
|
||||
)
|
||||
);
|
||||
// @include themeBorder(
|
||||
// 10rpx,
|
||||
// 20rpx,
|
||||
// (
|
||||
// linear-gradient(#DDF2FC, #BFDDF2),
|
||||
// linear-gradient(to bottom left, #D5EDF8, #a6d8dc)
|
||||
// )
|
||||
// );
|
||||
|
||||
.zhanghu {
|
||||
font-size: 80rpx;
|
||||
@@ -990,16 +971,13 @@ uni-page-body {
|
||||
}
|
||||
.user_vip {
|
||||
z-index:1;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
width: auto;
|
||||
padding: 4rpx 10rpx;
|
||||
font-weight: 800;
|
||||
border-radius: 20rpx;
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
rgb(204, 229, 244) 0%,
|
||||
rgb(197, 227, 215) 100%
|
||||
);
|
||||
background: linear-gradient(60deg, #8265f9 30%, #016dea 100%);
|
||||
}
|
||||
.super {
|
||||
background: linear-gradient(to right, #5bc9c1 0%, #258feb 100%);
|
||||
|
||||
@@ -38,31 +38,6 @@
|
||||
>退出登录</u-button
|
||||
>
|
||||
</view>
|
||||
|
||||
<!-- <view class="set_box" style="margin-top:20rpx">
|
||||
<list :dataList="otherList" @hancleClick="handleClickRightContent" label="title">
|
||||
|
||||
|
||||
<template slot="rightSlot" slot-scope="slotProps">
|
||||
|
||||
|
||||
|
||||
|
||||
<text class="fdButtonBox aui-text-success">{{ slotProps.row.content }}</text>
|
||||
|
||||
|
||||
|
||||
<view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
</list>
|
||||
|
||||
|
||||
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<u-modal
|
||||
@@ -73,10 +48,19 @@
|
||||
@confirm="signOut"
|
||||
>
|
||||
</u-modal>
|
||||
<u-popup key="1" v-if="showCodeImg" :show="showCodeImg" :round="10" @close="closePup">
|
||||
<view class="box6">
|
||||
<text style="color: #999; margin-bottom: 20rpx;">点击图片后长按图片保存到手机,或使用微信扫描二维码添加客服企业微信</text>
|
||||
<image @click="previewImage('/static/qiyeWx.jpg')" src="/static/qiyeWx.jpg" mode="widthFix" style="width: 100px; height: 100px; margin: 0 auto;"></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// #ifdef APP-PLUS
|
||||
import updata from "@/uni_modules/uni-upgrade-center-app/utils/check-update";
|
||||
// #endif
|
||||
import list from "@/pages/component/commonComponents/list";
|
||||
import $http from "@/config/requestConfig.js";
|
||||
|
||||
@@ -92,7 +76,7 @@ export default {
|
||||
playData: {},
|
||||
options: {},
|
||||
searchValue: "",
|
||||
|
||||
showCodeImg:false,
|
||||
twoCateList: [], // 二级分类标题
|
||||
titleList: [], // 方剂标题
|
||||
curOneCateIndex: 0, // 当前选中的一级分类
|
||||
@@ -117,11 +101,15 @@ export default {
|
||||
type: "email",
|
||||
},
|
||||
{
|
||||
title: "微信号",
|
||||
content: "yilujiankangkefu",
|
||||
title: "企业微信",
|
||||
content: "",
|
||||
type: "wxNumber",
|
||||
},
|
||||
|
||||
{
|
||||
title: "版本检测",
|
||||
content: "",
|
||||
type: "checkVersion",
|
||||
},
|
||||
// {
|
||||
|
||||
// "title": "清楚缓存",
|
||||
@@ -161,6 +149,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(["setUserInfo"]),
|
||||
closePup(){
|
||||
this.showCodeImg = false
|
||||
},
|
||||
signOut() {
|
||||
this.signShow = false;
|
||||
this.setUserInfo({ token: null });
|
||||
@@ -217,8 +208,12 @@ export default {
|
||||
this.$commonJS.handleCopy(row.content, row.title);
|
||||
break;
|
||||
case "wxNumber":
|
||||
this.$commonJS.handleCopy(row.content, row.title);
|
||||
this.showCodeImg = true
|
||||
// this.$commonJS.handleCopy(row.content, row.title);
|
||||
break;
|
||||
case "checkVersion":
|
||||
this.getNewVersion()
|
||||
break;
|
||||
case "pageJump":
|
||||
uni.navigateTo({
|
||||
url: row.url,
|
||||
@@ -227,26 +222,8 @@ export default {
|
||||
|
||||
//
|
||||
}
|
||||
},
|
||||
// 检查是有权限使用搜索功能
|
||||
checkDisable() {
|
||||
console.log("点击了");
|
||||
},
|
||||
// 显示无权限弹窗
|
||||
// showNoRights() {
|
||||
// let that = this
|
||||
// uni.showModal({
|
||||
// content: "",
|
||||
// confirmText: '好的',
|
||||
// showCancel: false,
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {
|
||||
// // console.log('用户点击确定');
|
||||
// that.clear()
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
},
|
||||
|
||||
// 获取用户详情
|
||||
getUserInfo() {
|
||||
// 用户详情
|
||||
@@ -258,6 +235,19 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
// 版本检测
|
||||
async getNewVersion(){
|
||||
// #ifdef APP-PLUS
|
||||
var info = await updata();
|
||||
console.log('info',JSON.stringify(info))
|
||||
if(info.result.code == 0){
|
||||
uni.showToast({
|
||||
title:info.result.message,
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
// 详情
|
||||
gotoDetail(v) {
|
||||
console.log(v);
|
||||
@@ -402,27 +392,6 @@ export default {
|
||||
async setOneCateIndex(item, index) {
|
||||
console.log(index, 99999);
|
||||
var that = this;
|
||||
|
||||
// if(this.userMes.tgdzPower == 0){
|
||||
// let that = this
|
||||
// uni.showModal({
|
||||
// content: "购买 针灸六经法要上册和下册 后方可使用此功能",
|
||||
// confirmText: '好的',
|
||||
// showCancel: false,
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {
|
||||
// // console.log('用户点击确定');
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
// if(item.title == "时辰取穴"){
|
||||
// uni.navigateTo({
|
||||
// url: "../timeAcupoint/timeAcupoint"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
let type = item.type;
|
||||
this.curOneCateIndex = index;
|
||||
this.curTwoCateIndex = 0;
|
||||
@@ -431,16 +400,7 @@ export default {
|
||||
this.showSearchList = false;
|
||||
// if (index != 2) {
|
||||
await this.getTowCateList(type);
|
||||
|
||||
// uni.createSelectorQuery().select('.oneCateList').boundingClientRect(function (rect) {
|
||||
// var height = rect.height
|
||||
// console.log('元素高度:',);
|
||||
|
||||
// }).exec();
|
||||
|
||||
// } else {
|
||||
// this.getJFList(dictType)
|
||||
// }
|
||||
|
||||
},
|
||||
async getTowCateList(type) {
|
||||
var that = this;
|
||||
@@ -449,12 +409,9 @@ export default {
|
||||
url: "book/medicaldes/typeList?label=" + type,
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
loadAnimate: "none", // 请求加载动画
|
||||
// 'categoryId': id
|
||||
loadAnimate: "none", // 请求加载动画
|
||||
},
|
||||
// header: { //默认 无 说明:请求头
|
||||
// 'Content-Type': 'application/json'
|
||||
// },
|
||||
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, "二级分类获取成功");
|
||||
@@ -510,16 +467,7 @@ export default {
|
||||
}
|
||||
this.getTitles(this.twoCateList[0].dictType);
|
||||
|
||||
this.$nextTick(async () => {
|
||||
// await uni.createSelectorQuery().select('.uni-tabbar').boundingClientRect(function (rect) {
|
||||
// console.log(rect.height, '3333')
|
||||
|
||||
// // var height = 42 + rect.height + 10;
|
||||
// // that.scrollViewHeight = height;
|
||||
// // console.log(that.scrollViewHeight, '111111')
|
||||
// // that.$forceUpdate()
|
||||
// // console.log('元素高度2:', height);
|
||||
// }).exec();
|
||||
this.$nextTick(async () => {
|
||||
await uni
|
||||
.createSelectorQuery()
|
||||
.select(".cateList")
|
||||
@@ -557,156 +505,31 @@ export default {
|
||||
// const finalResult = Object.keys(result).map(key => ({ [key]: result[key] }));
|
||||
return result;
|
||||
},
|
||||
// getJFList(id) {
|
||||
// $http.request({
|
||||
// url: "book/prescript/prescriptListForJF",
|
||||
// method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
// data: {
|
||||
// loadAnimate: 'none', // 请求加载动画
|
||||
// 'categoryId': id
|
||||
// },
|
||||
// header: { //默认 无 说明:请求头
|
||||
// 'Content-Type': 'application/json'
|
||||
// },
|
||||
// }).then(res => {
|
||||
// if (res.code == 0 && res.list.length > 0) {
|
||||
// this.twoCateList = []
|
||||
// this.titleList = this.transformData(res.list)
|
||||
// console.log('JF经方', this.titleList)
|
||||
// } else {
|
||||
// this.twoCateList = []
|
||||
// this.titleList = []
|
||||
// }
|
||||
// }).catch(e => {
|
||||
// this.twoCateList = []
|
||||
// this.titleList = []
|
||||
// console.log(e)
|
||||
// })
|
||||
// },
|
||||
|
||||
getCateList(id) {
|
||||
id ? "" : (id = 0);
|
||||
this.twoCateList = [];
|
||||
this.curTwoCateIndex = 0;
|
||||
// 0为获取顶级分类,其他为搜索下级分类,目前的逻辑,顶级是写死的,所以可能只会涉及到搜索第二级
|
||||
// $http.request({
|
||||
// url: "book/prescript/prescriptCategoryList",
|
||||
// method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
// data: {
|
||||
// loadAnimate: 'none', // 请求加载动画
|
||||
// 'categoryId': id
|
||||
// },
|
||||
// header: { //默认 无 说明:请求头
|
||||
// 'Content-Type': 'application/json'
|
||||
// },
|
||||
// }).then(res => {
|
||||
// console.log(res, '脉穴分类获取成功')
|
||||
// if (res.code == 0 && res.list.length > 0) {
|
||||
// this.oneCateList = res.list
|
||||
|
||||
this.getTowCateList(this.oneCateList[0].type);
|
||||
// } else {
|
||||
// this.oneCateList = []
|
||||
// }
|
||||
// }).catch(e => {
|
||||
// this.oneCateList = []
|
||||
// console.log(e)
|
||||
// })
|
||||
|
||||
},
|
||||
|
||||
// 放大图片
|
||||
previewImage(url) {
|
||||
console.log(url);
|
||||
this.showCodeImg = false
|
||||
uni.previewImage({
|
||||
urls: [url],
|
||||
longPressActions: {
|
||||
itemList: ["很抱歉,暂不支持保存图片到本地"],
|
||||
success: function (res) {
|
||||
// console.log(res,'+++++')
|
||||
},
|
||||
},
|
||||
// longPressActions: {
|
||||
// itemList: ["很抱歉,暂不支持保存图片到本地"],
|
||||
// success: function (res) {
|
||||
// // console.log(res,'+++++')
|
||||
// },
|
||||
// },
|
||||
});
|
||||
},
|
||||
// getSearch() {
|
||||
// $http.request({
|
||||
// url: "book/prescript/searchPrescript",
|
||||
// method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
// data: {
|
||||
// loadAnimate: 'none', // 请求加载动画
|
||||
// 'keywords': this.searchValue,
|
||||
// type: this.curOneCateIndex + 1
|
||||
// },
|
||||
// header: { //默认 无 说明:请求头
|
||||
// 'Content-Type': 'application/json'
|
||||
// },
|
||||
// }).then(res => {
|
||||
// console.log(res, '搜索结果')
|
||||
// if (res.code == 0 && res.list.length >= 0) {
|
||||
// this.showSearchList = true
|
||||
// this.searchList = res.list
|
||||
// } else {
|
||||
// this.searchList = []
|
||||
// }
|
||||
// }).catch(e => {
|
||||
// // this.titleList = []
|
||||
// this.searchList = []
|
||||
// console.log(e)
|
||||
// })
|
||||
// },
|
||||
// search(res) {
|
||||
// console.log(res, 'res')
|
||||
// // uni.showToast({
|
||||
// // title: '搜索:' + res,
|
||||
// // icon: 'none'
|
||||
// // })
|
||||
// if (res == '') {
|
||||
// this.showSearchList = false
|
||||
// this.searchList = []
|
||||
// } else {
|
||||
// this.getSearch()
|
||||
// }
|
||||
|
||||
// },
|
||||
// input(res) {
|
||||
// console.log('----input:', res)
|
||||
// if (res == '') {
|
||||
// this.searchList = []
|
||||
// } else {
|
||||
// this.getSearch()
|
||||
// }
|
||||
// },
|
||||
// clear(res) {
|
||||
// console.log('----clear:', res)
|
||||
// // uni.showToast({
|
||||
// // title: 'clear事件,清除值为:',
|
||||
// // icon: 'none'
|
||||
// // })
|
||||
// this.searchValue = ''
|
||||
// this.showSearchList = false
|
||||
// },
|
||||
// blur(res) {
|
||||
// // console.log('----blur:', res)
|
||||
// // if (res == '') {
|
||||
// // this.showSearchList = false
|
||||
// // this.searchList = []
|
||||
// // } else {
|
||||
// // this.getSearch()
|
||||
// // }
|
||||
// },
|
||||
// focus(e) {
|
||||
// console.log('----focus:')
|
||||
// // uni.showToast({
|
||||
// // title: 'focus事件,输出值为:' + e.value,
|
||||
// // icon: 'none'
|
||||
// // })
|
||||
// // 等于1 就是有权限
|
||||
// // this.showSearchList = true
|
||||
|
||||
// },
|
||||
// cancel(res) {
|
||||
// uni.showToast({
|
||||
// title: '点击取消,输入值为:' + res.value,
|
||||
// icon: 'none'
|
||||
// })
|
||||
// }
|
||||
|
||||
},
|
||||
onBackPress() {
|
||||
// #ifdef APP-PLUS
|
||||
@@ -719,6 +542,79 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
@import "@/style/common.scss";
|
||||
|
||||
.box6 {
|
||||
padding: 20rpx;
|
||||
text-align: center;
|
||||
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.list {
|
||||
padding: 0 10px;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.item {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-bottom: 10rpx;
|
||||
padding-top:20rpx ;
|
||||
padding-bottom:20rpx ;
|
||||
line-height:40rpx;
|
||||
border-radius: 50rpx;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
.item.active {
|
||||
color: $themeColor;
|
||||
border: 1px solid $themeColor;
|
||||
}
|
||||
|
||||
.item:last-child {
|
||||
// border-bottom: none
|
||||
}
|
||||
}
|
||||
|
||||
.tbn {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.buybtn { padding: 0 20rpx;
|
||||
background-color: #00d8df;
|
||||
margin: 0;
|
||||
margin-right: 20rpx;
|
||||
|
||||
text {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.saveBtnss {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 80rpx;
|
||||
|
||||
// width: 46%;
|
||||
overflow: hidden;
|
||||
border-radius: 50rpx;
|
||||
|
||||
text {
|
||||
padding-left: 10rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.gouwuche {
|
||||
border: 1px solid #666;
|
||||
padding-right: 20rpx;
|
||||
|
||||
text {
|
||||
// color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.u-grid-list {
|
||||
// height: 40rpx;
|
||||
}
|
||||
|
||||
@@ -373,8 +373,9 @@
|
||||
</view>
|
||||
</u-radio-group>
|
||||
</template>
|
||||
<template v-if="currentEditType == 'avatar'">
|
||||
<u-upload
|
||||
<template v-if="currentEditType == 'avatar'" >
|
||||
<view class="" @click="checkPermision">
|
||||
<u-upload
|
||||
:fileList="fileAvatar"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
@@ -385,6 +386,7 @@
|
||||
:previewFullImage="true"
|
||||
>
|
||||
</u-upload>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<u-button
|
||||
@@ -397,11 +399,12 @@
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<music-play :playData="playData"></music-play>
|
||||
<!-- <music-play :playData="playData"></music-play> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import permission from "@/js_sdk/wa-permission/permission.js"
|
||||
import musicPlay from "@/components/music.vue";
|
||||
import $http from "@/config/requestConfig.js";
|
||||
var clear;
|
||||
@@ -1146,9 +1149,14 @@ export default {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
|
||||
async checkPermision(){
|
||||
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
|
||||
if (result != 1) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
// 头像上传
|
||||
afterRead(e) {
|
||||
async afterRead(e) {
|
||||
let that = this;
|
||||
uni.uploadFile({
|
||||
url: this.$baseUrl + "oss/fileoss",
|
||||
|
||||
@@ -103,6 +103,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
checking : false,
|
||||
playData: {},
|
||||
options: {},
|
||||
xieyi: {
|
||||
@@ -138,7 +139,7 @@
|
||||
},
|
||||
],
|
||||
iosPaylist: [{
|
||||
title: "apple pay支付",
|
||||
title: "IAP支付",
|
||||
id: 3,
|
||||
imgUrl: require("@/static/icon/pay_2.png"),
|
||||
}, ],
|
||||
@@ -180,29 +181,52 @@
|
||||
//方法
|
||||
methods: {
|
||||
...mapMutations(["setUserInfo"]),
|
||||
// 查询未关闭iap订单
|
||||
async restoreComplateRequest() {
|
||||
let that = this
|
||||
console.log('检测未完成订单')
|
||||
// if (!that.checking) {
|
||||
// that.checking = true
|
||||
// console.log(this.iapChannel, 'this.iapChannel')
|
||||
await this.iapChannel.restoreCompletedTransactions({
|
||||
manualFinishTransaction: true
|
||||
}, function(results) {
|
||||
// console.log(that.checking)
|
||||
// results 格式为数组存放恢复的IAP商品交易信息对象 IAPTransaction,通用需将返回的支付凭证传给后端进行二次认证
|
||||
that.ComplateRequestArr = results
|
||||
console.log('未完成订单数组共有:=》',that.ComplateRequestArr.length )
|
||||
if (results && results.length > 0) {
|
||||
results.map((item, index) => {
|
||||
// "0"为正在支付;"1"为支付成功;"2"为支付失败;"3"为支付已恢复。
|
||||
if (item.transactionState == '1') {
|
||||
// 已经支付,但是没有走逻辑的内购订单 就发给后台做验证
|
||||
that.iapCheck('未完成订单的验证',item, index)
|
||||
// that.finishTransaction(item)
|
||||
} else if(item.transactionState != '1' || item.transactionState != '0') {
|
||||
// 不是正在支付订单,也不是已经支付订单就关闭掉
|
||||
// 其他状态的内购订单
|
||||
that.finishTransaction(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
// }
|
||||
|
||||
},
|
||||
// 关闭交易订单
|
||||
finishTransaction(trans) {
|
||||
this.iapChannel.finishTransaction(
|
||||
trans,
|
||||
(success) => {
|
||||
console.log("关闭订单成功");
|
||||
this.setUserInfo({
|
||||
restoreFlag: false
|
||||
});
|
||||
console.log("关闭订单成功");
|
||||
},
|
||||
(fail) => {
|
||||
console.log("关闭订单失败");
|
||||
}
|
||||
);
|
||||
},
|
||||
async showXieyi() {
|
||||
|
||||
// this.$http.get(`sys/agreement/list?key=pay`).then((res) => {
|
||||
// this.xieyi = res.page.list[0];
|
||||
// this.xieyiShow = true;
|
||||
// });
|
||||
|
||||
|
||||
async showXieyi() {
|
||||
var data = await this.$commonJS.getAgreement(106);
|
||||
if (data.content) {
|
||||
data.content = data.content.replace(
|
||||
@@ -231,20 +255,69 @@
|
||||
}
|
||||
// console.log(this.radioValue)
|
||||
},
|
||||
iphonepay() {
|
||||
const that = this;
|
||||
// 如果ios已经绑定支付信息,就直接支付,如果没有绑定,就需要先绑定
|
||||
console.log("检测支付环境...");
|
||||
plus.payment.getChannels((channels) => {
|
||||
console.log(channels, "channels");
|
||||
for (var i in channels) {
|
||||
// 判断是否苹果支付1
|
||||
if (channels[i].id === "appleiap") {
|
||||
that.iapChannel = channels[i];
|
||||
that.requestOrder();
|
||||
requestPayment(orderInfo) {
|
||||
let that = this
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.requestPayment({
|
||||
provider: 'appleiap',
|
||||
orderInfo: orderInfo,
|
||||
success: (res) => {
|
||||
that.iapCheck(res);
|
||||
resolve(res);
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading()
|
||||
// console.log('其他支付错误', err);
|
||||
that.restoreComplateRequest()
|
||||
if (err.code == 2) {
|
||||
uni.showToast({
|
||||
title: '取消支付,内购订单即将关闭',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '支付失败,内购订单即将关闭',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
getProvider() {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getProvider({
|
||||
service: 'payment',
|
||||
success: (res) => {
|
||||
const iapChannel = res.providers.find((channel) => {
|
||||
return (channel.id === 'appleiap')
|
||||
})
|
||||
resolve(iapChannel);
|
||||
// 如果 iapChannel 为 null,说明当前包没有包含iap支付模块。注意:HBuilder基座不包含 iap 通道
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
async iphonepay() {
|
||||
const that = this;
|
||||
uni.showLoading({
|
||||
title:"检测支付环境"
|
||||
})
|
||||
console.log("检测支付环境...");
|
||||
this.iapChannel = await this.getProvider()
|
||||
console.log('that.iapChannel',this.iapChannel);
|
||||
if(this.iapChannel){
|
||||
this.requestOrder();
|
||||
}else{
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title:'不支持内购支付',
|
||||
icon:'none'
|
||||
})
|
||||
console.log("获取iap支付通道失败:" + e.message, that.iapChannel);
|
||||
}
|
||||
},
|
||||
requestOrder() {
|
||||
uni.showLoading({
|
||||
@@ -255,10 +328,14 @@
|
||||
console.log(that.stepsCj.priceTypeId, 88888888);
|
||||
// ['xxxxx'] 是平台申请拿到的内购商品的id
|
||||
let IAPOrders = [];
|
||||
IAPOrders.push(that.stepsCj.priceTypeId + "");
|
||||
console.log(IAPOrders, "IAPOrders");
|
||||
IAPOrders.push('p' + that.stepsCj.priceTypeId);
|
||||
// console.log(IAPOrders, "IAPOrders");
|
||||
// 新建订单
|
||||
that.iapChannel.requestOrder(
|
||||
uni.showLoading({
|
||||
title: "正在创建订单",
|
||||
mask: true,
|
||||
});
|
||||
that.iapChannel.requestProduct(
|
||||
IAPOrders,
|
||||
function(event) {
|
||||
// uni.hideLoading()
|
||||
@@ -278,57 +355,37 @@
|
||||
}
|
||||
);
|
||||
},
|
||||
topay(id) {
|
||||
async topay(id) {
|
||||
const that = this;
|
||||
uni.hideLoading();
|
||||
// if(this.chargeOrderSn != '' || this.chargeOrderSn != undefined){ // 判断是不是二次支付的订单
|
||||
// that.orderSn = this.chargeOrderSn
|
||||
// console.log(that.orderSn,'二次支付的订单号')
|
||||
// }
|
||||
// var restoreFlag = true; // 调用支付接口时标记 restoreFlag = true , 实际应用请将标记存储在 storage 中
|
||||
this.setUserInfo({
|
||||
restoreFlag: true
|
||||
});
|
||||
console.log(this.userInfo, "更新后的用户信息");
|
||||
plus.payment.request(
|
||||
that.iapChannel, {
|
||||
uni.showLoading({
|
||||
title: "正在支付",
|
||||
mask: true,
|
||||
});
|
||||
let orderInfo = {
|
||||
productid: id,
|
||||
username: that.orderSn, // 用户标识/订单标识
|
||||
quantity:1,
|
||||
manualFinishTransaction: true, // 3.5.1+ 支持,设置此参数后需要开发者主动关闭订单,参见下面的关闭订单方法 finishTransaction()
|
||||
},
|
||||
function(result) {
|
||||
// restoreFlag = false; // 支付成功清除标记 restoreFlag = false
|
||||
that.transaction = result;
|
||||
// 支付成功,result 为 IAP商品交易信息对象 IAPTransaction 需将返回的支付凭证传给后端进行二次认证
|
||||
that.iapCheck(result);
|
||||
},
|
||||
function(e) {
|
||||
console.log("错误回调", e);
|
||||
if (e.errCode == 2) {
|
||||
// 用户未绑定支付方式,app内支付流程结束,系统弹出框引导用户绑定支付方式,此过程将跳转到系统应用 AppStore 进行绑定支付方式,绑定成功同步支付成功,用户成功付款
|
||||
plus.runtime.openURL("https://apps.apple.com/account/billing");
|
||||
} else {
|
||||
// restoreFlag = false; // 支付失败清楚标记
|
||||
that.finishTransaction(result);
|
||||
//console.log('订单关闭后的用户信息', that.userInfo);
|
||||
console.log(e);
|
||||
//console.log(e.message)
|
||||
}
|
||||
}
|
||||
);
|
||||
this.transaction = await this.requestPayment(orderInfo)
|
||||
console.log('支付后的that.transaction',this.transaction);
|
||||
},
|
||||
iapCheck(result) {
|
||||
let that = this;
|
||||
console.log("进入后台验证");
|
||||
uni.showLoading({
|
||||
title:'正在验证订单结果'
|
||||
})
|
||||
let data = {
|
||||
transactionId: result.transactionIdentifier, // 支付交易id
|
||||
customerOid: that.userInfo.id,
|
||||
productId: result.payment.productid, // 产品id
|
||||
productId: result.payment.productid.slice(1), // 产品id
|
||||
orderId: result.payment.username, // 系统订单号
|
||||
receiptData: result.transactionReceipt, // 苹果返回收据
|
||||
// isSandBox:true
|
||||
// body: that.stepsCj.priceTypeId // 充值类型id
|
||||
};
|
||||
console.log(data, "data");
|
||||
console.log("提交给后台的数据",data);
|
||||
$http
|
||||
.request({
|
||||
url: "/Ipa/veri",
|
||||
@@ -342,19 +399,19 @@
|
||||
.then((res) => {
|
||||
console.log(JSON.stringify(res));
|
||||
if (res.code == 0) {
|
||||
//uni.hideLoading()
|
||||
that.userInfo.restoreFlag == true ?
|
||||
that.setUserInfo({
|
||||
restoreFlag: false
|
||||
}) :
|
||||
"";
|
||||
console.log(that.userInfo.restoreFlag);
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title:'充值成功!',
|
||||
icon:'success'
|
||||
})
|
||||
console.log("充值订单已处理,请留意账户金额变动....");
|
||||
// 服务器验证票据有效后在客户端关闭订单 (iapChannel.finishTransaction)
|
||||
that.finishTransaction(result);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
uni.hideLoading()
|
||||
console.log('后台验证失败=>',e);
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
showCancel: false,
|
||||
@@ -448,7 +505,11 @@
|
||||
that.payType = e;
|
||||
},
|
||||
//ios充值
|
||||
iosPay() {
|
||||
iosPay() {
|
||||
// 苹果内购实现思路:
|
||||
// 1.先确认支付通道是否包含苹果内购
|
||||
// 2.检查一下是否存在上次未处理完的订单(主要是支付成功没有走回调的订单),异常订单直接关闭掉,成功没有走回调的提交给后台进行验证
|
||||
// 3.请求并创建新的订单
|
||||
this.iphonepay();
|
||||
},
|
||||
// 充值
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
<view class="icon_hua">
|
||||
<image src="../../static/homeLogo.png" mode="aspectFit" class="icon_hua_1"></image>
|
||||
</view>
|
||||
<view class="hehan">
|
||||
<image src="../../static/icon/hehan.png" mode="aspectFit" class="icon_hua_1"></image>
|
||||
</view>
|
||||
<view class="topSearch_box">
|
||||
<image src="../../static/search.png" mode="aspectFit"
|
||||
@click="onPageJump('/pages/peanut/searchFor')"></image>
|
||||
@@ -35,22 +38,22 @@
|
||||
<text>吴门医述</text>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="newLeve2">
|
||||
<view class="home_nar nomargin" style="padding: 0; background-color: #fff;">
|
||||
<view class="flexbox">
|
||||
<view :class="['hn_cl_tit',tabsid==item.id?'active':'']" @click="curseClick(item)"
|
||||
v-for="(item, index) in curseTagList" :key="index">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
<text>{{item.title}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fourBox" style="padding: 0;" v-if="sbuMedicalTagsList && sbuMedicalTagsList.length > 0">
|
||||
<view class="fourBox" style="padding: 0; padding-bottom: 8rpx;" v-if="sbuMedicalTagsList && sbuMedicalTagsList.length > 0">
|
||||
<view class="childrenBox fourIcon flexbox" style="justify-content: space-around;">
|
||||
<div class="item flexbox" @click="curseClickJump(item)" v-for="(item, index) in sbuMedicalTagsList"
|
||||
:key="index">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
<image :src="item.icon" mode="aspectFit" v-if="item.icon != '' && item.icon != null"></image>
|
||||
<text>{{item.title}}</text>
|
||||
</div>
|
||||
</view>
|
||||
@@ -60,10 +63,10 @@
|
||||
<view class="learnBox" >
|
||||
<view class="titleBox flexbox">
|
||||
<image src="../../static/learing.png" mode="aspectFit"></image>
|
||||
<text>正在学习</text>
|
||||
<text>观看记录</text>
|
||||
</view>
|
||||
<view class="learn flexbox">
|
||||
<view class="item" v-for="(item, index) in learnList" :key="index" @click="onPageJump('/pages/course/myCourseLearn',item.id)">
|
||||
<view class="item" v-for="(item, index) in learnList" :key="index" @click="onPageJump('/pages/course/courseDetail',item.id)">
|
||||
<view class="img" style="overflow: hidden;">
|
||||
<image v-if="item.image && item.image != ''" :src="item.image" mode="aspectFit"></image>
|
||||
<image v-else src="/static/nobg.jpg" mode="widthFix"></image>
|
||||
@@ -177,14 +180,14 @@
|
||||
<view class="item" v-for="(item, index) in tryListenList" :key="index"
|
||||
@click="onPageJump('/pages/course/courseDetail',item.id, item.title)">
|
||||
<view class="imgcontainer">
|
||||
<image v-if="item.image==''" src="@/static/nobg.jpg" mode="aspectFit"></image>
|
||||
<image v-if="item.image=='' || !item.image" src="@/static/nobg.jpg" mode="aspectFit"></image>
|
||||
<image v-else :src="item.image" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="buyItems flexbox">
|
||||
<view class="txt555">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="buybtn" @click.stop="onPageJump()">
|
||||
<view class="buybtn" >
|
||||
<span>购买</span>
|
||||
</view>
|
||||
</view>
|
||||
@@ -199,6 +202,7 @@
|
||||
<view>
|
||||
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
|
||||
</view>
|
||||
<!-- 应对华为审核,去掉app跳转 -->
|
||||
<view class="appJump ">
|
||||
<view class="everhealth item flexbox" @click="appjumpfun('nuttyreading')">
|
||||
<view class="img">
|
||||
@@ -220,7 +224,7 @@
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<z-navigation></z-navigation>
|
||||
<music-play :playList="myList"></music-play>
|
||||
<!-- <music-play :playList="myList"></music-play> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -386,7 +390,7 @@
|
||||
this.$http
|
||||
.post('medical/home/getCourseMedicalTree')
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
if (res.code == 0) {
|
||||
if (res.labels.length > 0) {
|
||||
this.curseTagList = res.labels
|
||||
@@ -1057,13 +1061,15 @@
|
||||
}
|
||||
|
||||
.childrenBox {
|
||||
background-color: #e4eefa !important;
|
||||
// @include mshadow(10px, 1);
|
||||
background-color: #fff;
|
||||
background-color: #e4eefa !important;
|
||||
// border:1px solid #e4eefa;
|
||||
border-radius: 6rpx !important;
|
||||
@include mshadow(10px, 1);
|
||||
// background-color: #fff;
|
||||
justify-content: center;
|
||||
box-shadow: none !important;
|
||||
border-radius: 0 !important;
|
||||
|
||||
// border-radius: 0 !important;
|
||||
|
||||
.item {
|
||||
text {
|
||||
color: #3361a5;
|
||||
@@ -1113,7 +1119,7 @@
|
||||
.fourIcon {
|
||||
justify-content: space-between;
|
||||
box-shadow: 0px 0px 10px 0px rgba(167, 187, 228, 1);
|
||||
margin-bottom: 8px;
|
||||
// margin-bottom: 8px;
|
||||
// border: 1px solid #fff;
|
||||
text-align: center;
|
||||
height: 60px;
|
||||
@@ -1349,6 +1355,7 @@
|
||||
background-color: #fff;
|
||||
padding: 0 10rpx;
|
||||
border-top: 1px solid #eee;
|
||||
padding-top: 4rpx;
|
||||
// padding-bottom:2rpx;
|
||||
}
|
||||
.home_nar {
|
||||
@@ -1371,7 +1378,7 @@
|
||||
// box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.3);
|
||||
|
||||
image {
|
||||
width: 120rpx;
|
||||
width: 100rpx;
|
||||
height: 90rpx;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
@@ -1399,7 +1406,7 @@
|
||||
// position: relative;
|
||||
text {
|
||||
color: #3361a5;
|
||||
font-weight: bold;
|
||||
// font-weight: bold;
|
||||
}
|
||||
}
|
||||
// .hn_cl_tit.active::after{
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
|
||||
.time { display: block; width: 300rpx;
|
||||
font-size: 26rpx;
|
||||
color: #bebebe;width: 35%;
|
||||
color: #bebebe;width:39%;
|
||||
}
|
||||
|
||||
.title {
|
||||
|
||||
@@ -97,8 +97,8 @@
|
||||
<button @click="onSubmit" class="active" v-if="btnShow">登 录</button>
|
||||
<button v-else>登 录</button>
|
||||
</view>
|
||||
<!-- <view class="loginHelp" v-if="submitClickNum > 0"> -->
|
||||
<view class="loginHelp">
|
||||
<view class="loginHelp" v-if="submitClickNum > 0">
|
||||
<!-- <view class="loginHelp"> -->
|
||||
<text>登录遇到问题?</text><text class="link" @click="onPageJump('/pages/user/workOrder','login')">去反馈问题</text>
|
||||
</view>
|
||||
<!-- <view class="password_register" style="margin: 0 auto; text-align: center; display: block;">
|
||||
@@ -122,9 +122,9 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="youKeL" style="margin-bottom: 80rpx;">
|
||||
<view class="youKeL" style="margin-bottom: 80rpx;" v-if="!isAndorid">
|
||||
<view @click="onPageJump('/pages/user/visitor')">免登陆体验</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
|
||||
<z-popup v-model="HealthOpen" type="center" :hideOnBlur="false">
|
||||
@@ -249,8 +249,9 @@
|
||||
yszcText: {},
|
||||
quShow: false,
|
||||
quCodeList: [], // 国家区域码
|
||||
quCode: 86,
|
||||
quCode: '86',
|
||||
submitClickNum:0, // 登陆按钮点击次数
|
||||
isAndorid : true
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
@@ -264,6 +265,7 @@
|
||||
pname: 'com.tencent.mm',
|
||||
action: "weixin://"
|
||||
});
|
||||
this.getOS()
|
||||
// #endif
|
||||
},
|
||||
//页面显示
|
||||
@@ -277,6 +279,17 @@
|
||||
methods: {
|
||||
...mapMutations(['setUserInfo']),
|
||||
...mapMutations(['setHealthMes']),
|
||||
// 获得操作系统
|
||||
getOS() {
|
||||
let oprateOs = "";
|
||||
oprateOs = uni.getSystemInfoSync().platform;
|
||||
// console.log(oprateOs)
|
||||
if (oprateOs == "android") {
|
||||
this.isAndorid = true;
|
||||
} else {
|
||||
this.isAndorid = false;
|
||||
}
|
||||
},
|
||||
closeMusic() {
|
||||
this.$music.setCloseBgm() // 关闭音频
|
||||
uni.setStorage({
|
||||
@@ -434,6 +447,7 @@
|
||||
}
|
||||
if (this.quCode == null || this.quCode == 86) { // 如果没选择国家code,默认是中国大陆
|
||||
if (!this.$base.phoneRegular.test(this.phone)) {
|
||||
this.submitClickNum += 1
|
||||
uni.showToast({
|
||||
title: '手机格式不正确',
|
||||
icon: 'none'
|
||||
@@ -507,6 +521,7 @@
|
||||
}
|
||||
if (this.quCode == null || this.quCode == 86) {
|
||||
if (!this.$base.phoneRegular.test(this.phone)) {
|
||||
this.submitClickNum += 1
|
||||
uni.showToast({
|
||||
title: '手机格式不正确',
|
||||
icon: 'none'
|
||||
@@ -523,7 +538,7 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.$base.mailRegular.test(this.email)) {
|
||||
if (!this.$base.mailRegular.test(this.email)) {
|
||||
uni.showToast({
|
||||
title: '邮箱格式不正确',
|
||||
icon: 'none'
|
||||
|
||||
@@ -172,6 +172,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import permission from "@/js_sdk/wa-permission/permission.js"
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
var clear;
|
||||
@@ -530,7 +531,11 @@
|
||||
},
|
||||
|
||||
// 头像
|
||||
choseAvatar(e) {
|
||||
async choseAvatar(e) {
|
||||
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
|
||||
if (result != 1) {
|
||||
return false
|
||||
}
|
||||
let that = this
|
||||
if (that.fileAvatar.length == 0) {
|
||||
uni.showToast({
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<view class="input_box">
|
||||
<uni-forms-item label="" name="contactInformation" label-width="0">
|
||||
<text class="input_tit"><i>*</i>联系电话:</text>
|
||||
{{reversedMessage}}
|
||||
{{reversedMessage}}
|
||||
<view class="in">
|
||||
<input type="number" placeholder-style="font-size:26rpx" @input="telInput"
|
||||
v-model="form.contactInformation" placeholder="请输入与您联系的手机号" />
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<view class="input_box">
|
||||
<text class="input_tit">问题截图:</text>
|
||||
<view class="in" style="border: none;">
|
||||
<view class="in" style="border: none;" @click="checkPermision">
|
||||
<u-upload :fileList="fileList1" @afterRead="addPic" @delete="deletePic" multiple :maxCount="4"
|
||||
width="40" height="40" :previewFullImage="true">
|
||||
</u-upload>
|
||||
@@ -78,6 +78,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import permission from "@/js_sdk/wa-permission/permission.js"
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
@@ -137,35 +138,35 @@
|
||||
typeLIst: [
|
||||
// { value: 0, text: "请选择" },
|
||||
{
|
||||
value: 1,
|
||||
value: "1",
|
||||
text: "登陆相关问题"
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
value: "2",
|
||||
text: "账号相关问题"
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
value: "3",
|
||||
text: "订单相关问题"
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
value: "4",
|
||||
text: "购买相关问题"
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
value: "5",
|
||||
text: "VIP相关问题"
|
||||
},
|
||||
{
|
||||
value: 6,
|
||||
value: "6",
|
||||
text: "充值相关问题"
|
||||
},
|
||||
{
|
||||
value: 7,
|
||||
value: "7",
|
||||
text: "网络暴力举报"
|
||||
},
|
||||
{
|
||||
value: 8,
|
||||
value: "8",
|
||||
text: "其他"
|
||||
},
|
||||
],
|
||||
@@ -177,11 +178,11 @@
|
||||
this.pageType = e.name
|
||||
switch (this.pageType) {
|
||||
case "login":
|
||||
this.form.type = 1
|
||||
this.form.type = '1'
|
||||
break;
|
||||
|
||||
case "order":
|
||||
this.form.type = 3
|
||||
this.form.type = '3'
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -207,8 +208,14 @@
|
||||
// console.log('键盘输入',e);
|
||||
this.telError = false
|
||||
},
|
||||
addPic(e) {
|
||||
// console.log("添加图片");
|
||||
async checkPermision(){
|
||||
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
|
||||
if (result != 1) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
async addPic(e) {
|
||||
console.log("添加图片");
|
||||
let that = this;
|
||||
for (var i = 0; i < e.file.length; i++) {
|
||||
//console.log(i,e.file[i].url)
|
||||
@@ -318,15 +325,20 @@
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
|
||||
::v-deep .uni-forms-item{
|
||||
margin-bottom: 26rpx !important;
|
||||
}
|
||||
.input_tit{
|
||||
font-weight: bold;
|
||||
}
|
||||
.page {
|
||||
background-color: #ffffff;
|
||||
padding: 0 65rpx;
|
||||
min-height: 100vh;
|
||||
|
||||
.title {
|
||||
padding: 60rpx 0 40rpx 0;
|
||||
font-size: 60rpx;
|
||||
padding: 30rpx 0 40rpx 0;
|
||||
font-size: 40rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
|
||||
5932
static/aliplayercomponents-1.0.9.min.js
vendored
Normal file
BIN
static/icon/hehan.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
static/qiyeWx.jpg
Normal file
|
After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
BIN
static/vip.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
@@ -2,6 +2,7 @@ export const state = {
|
||||
//webView地址
|
||||
webViewUrl: "",
|
||||
loadingShow: false,
|
||||
videoTimer: false,
|
||||
//微信场景参数
|
||||
chatScenesInfo: {},
|
||||
//绑定微信头像昵称弹窗状态
|
||||
@@ -47,6 +48,14 @@ export const mutations = {
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
setVideoTimer(state, data) {
|
||||
if (data) {
|
||||
state.videoTimer = data;
|
||||
// #ifdef H5
|
||||
// window.sessionStorage.setItem('webViewUrl', data);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
//数据加载状态
|
||||
setLoadingShow(state, data) {
|
||||
if(state.loadingShow){
|
||||
@@ -95,6 +104,7 @@ export const mutations = {
|
||||
checkIapOrder(){
|
||||
console.log('验证苹果支付未关闭订单')
|
||||
}
|
||||
|
||||
};
|
||||
export const actions = {
|
||||
|
||||
|
||||
3
uni.scss
@@ -65,4 +65,5 @@ $uni-font-size-title:40upx;
|
||||
$uni-color-subtitle: #555555; // 二级标题颜色
|
||||
$uni-font-size-subtitle:36upx;
|
||||
$uni-color-paragraph: #3F536E; // 文章段落颜色
|
||||
$uni-font-size-paragraph:30upx;
|
||||
$uni-font-size-paragraph:30upx;
|
||||
|
||||
|
||||
141
utils/myIapCheck.js
Normal file
@@ -0,0 +1,141 @@
|
||||
import store from '@/store/index.js'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
// #ifdef APP-PLUS
|
||||
const iapChannel = null;
|
||||
const checking = false
|
||||
const ComplateRequestArr = []
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
// const bgm = {};
|
||||
// #endif
|
||||
|
||||
|
||||
var iap = {
|
||||
getProvider() {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getProvider({
|
||||
service: 'payment',
|
||||
success: (res) => {
|
||||
const iapChannel = res.providers.find((channel) => {
|
||||
return (channel.id === 'appleiap')
|
||||
})
|
||||
resolve(iapChannel);
|
||||
// 如果 iapChannel 为 null,说明当前包没有包含iap支付模块。注意:HBuilder基座不包含 iap 通道
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
// 检测支付通道
|
||||
async getChannels(){
|
||||
const that = this;
|
||||
console.log('检测支付通道')
|
||||
this.iapChannel = await this.getProvider()
|
||||
if(this.iapChannel){
|
||||
// this.requestOrder();
|
||||
this.restoreComplateRequest()
|
||||
}else{
|
||||
console.log("不支持iap支付");
|
||||
}
|
||||
},
|
||||
// 检测是否有未关闭订单
|
||||
restoreComplateRequest() {
|
||||
let that = this
|
||||
console.log('检测未完成订单')
|
||||
this.iapChannel.restoreCompletedTransactions({
|
||||
manualFinishTransaction: true
|
||||
}, function(results) {
|
||||
if (!that.checking) {
|
||||
that.checking = true
|
||||
// results 格式为数组存放恢复的IAP商品交易信息对象 IAPTransaction,通用需将返回的支付凭证传给后端进行二次认证
|
||||
that.ComplateRequestArr = results
|
||||
console.log('未完成订单数组共有:=》',that.ComplateRequestArr.length ,that.ComplateRequestArr)
|
||||
|
||||
if (that.ComplateRequestArr.length > 0) {
|
||||
that.ComplateRequestArr.map((item, index) => {
|
||||
// "0"为正在支付;"1"为支付成功;"2"为支付失败;"3"为支付已恢复。
|
||||
if (item.transactionState == '1') {
|
||||
console.log('待验证订单,即将进入后台验证:=>', item)
|
||||
// return false
|
||||
// 已经支付,但是没有走逻辑的内购订单 就发给后台做验证
|
||||
that.iapCheck(item, index)
|
||||
// that.finishTransaction(item)
|
||||
} else {
|
||||
// 其他状态的内购订单
|
||||
that.finishTransaction(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 关闭订单
|
||||
finishTransaction(trans) {
|
||||
this.iapChannel.finishTransaction(
|
||||
trans,
|
||||
(success) => {
|
||||
console.log("关闭订单成功");
|
||||
that.checking = false
|
||||
},
|
||||
(fail) => {
|
||||
console.log("关闭订单失败");
|
||||
that.checking = false
|
||||
}
|
||||
);
|
||||
},
|
||||
iapCheck(result) {
|
||||
let that = this;
|
||||
console.log("进入后台验证");
|
||||
let data = {
|
||||
transactionId: result.transactionIdentifier, // 支付交易id
|
||||
customerOid: store.state.userInfo.id,
|
||||
productId: result.payment.productid.slice(1), // 产品id
|
||||
orderId: result.payment.username, // 系统订单号
|
||||
receiptData: result.transactionReceipt, // 苹果返回收据
|
||||
// isSandBox:true
|
||||
// body: that.stepsCj.priceTypeId // 充值类型id
|
||||
};
|
||||
console.log("提交给后台的数据=>", data);
|
||||
// return false
|
||||
$http
|
||||
.request({
|
||||
url: "/Ipa/veri",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
// $http.post('Ipa/veri', data)
|
||||
.then((res) => {
|
||||
// console.log(JSON.stringify(res));
|
||||
if (res.code == 0) {
|
||||
// uni.hideLoading()
|
||||
console.log("充值订单已处理....");
|
||||
// 服务器验证票据有效后在客户端关闭订单 (iapChannel.finishTransaction)
|
||||
that.finishTransaction(result);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log('后台验证失败=>',e);
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
cancelColor:'#0081ff',
|
||||
content: `您的账户下存在验证异常的订单(订单编号为:${e.data.orderId}),可尝试稍后重启app,如不能解决您的问题,可联系官方客服`,
|
||||
cancelText:'已验证关闭订单',
|
||||
confirmText:'知道了',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log("用户点击确定");
|
||||
}else{
|
||||
console.log('点了取消')
|
||||
that.finishTransaction(result);
|
||||
}
|
||||
},
|
||||
});
|
||||
// that.finishTransaction(result);
|
||||
});
|
||||
},
|
||||
}
|
||||
module.exports = {iap}
|
||||
|
||||