Commit 8e6b3b3b by sunerhu

1.修改了一些bug

parent 8cc6cea6
...@@ -52,12 +52,38 @@ ...@@ -52,12 +52,38 @@
// } // }
// }) // })
initApp() initApp()
// this.checkArguments();
// plus.globalEvent.addEventListener('newintent', e => {
//   this.checkArguments(); // 检测启动参数
//  });
}, },
onShow: function() { onShow: function() {
console.log('App Show') console.log('App Show')
}, },
onHide: function() { onHide: function() {
console.log('App Hide') console.log('App Hide')
},
methods:{
checkArguments() {
console.log('runtime.launcher: ' + plus.runtime.launcher);
// 判断APP打开方式 miniProgram为微信小程序打开
// if (plus.runtime.launcher == 'miniProgram') {
// plus.runtime.argumrnts为打开时APP传的值(<wx-open-launch-app>中的extinfo),可以传字符串通过符号截取判断类型
console.log(plus.runtime.arguments);
if (plus.runtime.arguments) {
            //我截取了字符串,判断是商品并且根据ID跳转到商品详情页
var str = plus.runtime.arguments;
var arr = str.split('/');
var id = arr[1];
if (arr[0] == 'goods') {
              //跳转到商品详情页,注意pages前面的"/"不要忘记,否则会造成无法跳转。使用navigateTo跳转到页面会有返回按钮,点击返回到首页
uni.navigateTo({
url: 'pages/index/index'
});
}
}
// }
}
} }
} }
</script> </script>
......
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
</view> </view>
<view class="share-entrance"> <view class="share-entrance">
<view style="z-index: 99999;"> <view style="z-index: 99999;">
<uni-popup ref="share" type="top" safeArea backgroundColor="#fff" :maskClick='true' <uni-popup ref="share" type="top" safeArea backgroundColor="#F4F2F3" :maskClick='true'
@change="maskClick"> @change="maskClick">
<uni-popup-share @select="sharechange"></uni-popup-share> <uni-popup-share @select="sharechange"></uni-popup-share>
</uni-popup> </uni-popup>
</view> </view>
<view class="" style="width: 50rpx;height: 50rpx;padding-right: 20rpx;"> <view class="" style="width: 40rpx;height: 40rpx;padding-right: 20rpx;">
<image class="image" @click="reinvite" src="../../static/fastentry/Slice122.png" mode=""></image> <image class="image" @click="reinvite" src="../../static/fastentry/Slice122.png" mode=""></image>
</view> </view>
<view class="" style="width: 50rpx;height: 50rpx; "> <view class="" style="width: 40rpx;height: 40rpx; ">
<image class="image" @click="shareToggle" src="../../static/fastentry/Slice12.png" mode=""></image> <image class="image" @click="shareToggle" src="../../static/fastentry/Slice12.png" mode=""></image>
</view> </view>
</view> </view>
...@@ -33,20 +33,24 @@ ...@@ -33,20 +33,24 @@
<h4>{{courseInfo.fileTitle}}</h4> <h4>{{courseInfo.fileTitle}}</h4>
</view> </view>
<view class="shareF"> <view class="shareF">
<view class="awakenApp" @click="jumpapp()" v-if="coursesharing == 1"> <!-- <view class="awakenApp" @click="jumpapp()" v-if="coursesharing == 1">
<view class="" style="width: 50rpx; height: 50rpx;"> <view class="" style="width: 50rpx; height: 50rpx;">
<image style="width: 50rpx; height: 50rpx;" src="../../static/Slice117.png" mode=""></image> <image style="width: 50rpx; height: 50rpx;" src="../../static/Slice117.png" mode=""></image>
</view> </view>
<text>唤醒App</text> <text>唤醒App</text>
</view> </view> -->
<!-- v-if="isWeixin == true" --> <!-- v-if="isWeixin == true" -->
<!-- <view class="awakenApp"> <view class="awakenApp">
<wx-open-launch-app id="launch-btn" appid="wxb591d0034cdcf0cd" extinfo="extinfo"> <wx-open-launch-app id="launch-btn" appid="wxb591d0034cdcf0cd" extinfo="extinfo">
<script type="text/wxtag-template"> <view v-is="'script'" type="text/wxtag-template">
<button class="btn" >打开/下载App</button> <!-- <view class="" style="width: 50rpx; height: 50rpx;">
</script> <image style="width: 50rpx; height: 50rpx;" src="../../static/Slice117.png" mode=""></image>
</wx-open-launch-app>
</view> --> </view> -->
<!-- <text>唤醒App</text> -->
<button class="btn" style="color: #FFFFFF;margin-left: 10rpx;">唤醒App</button>
</view>
</wx-open-launch-app>
</view>
<strong> <strong>
</strong> </strong>
...@@ -85,7 +89,6 @@ ...@@ -85,7 +89,6 @@
<view class="courseInfoContent"> <view class="courseInfoContent">
<h4>{{index + 1}}.{{item.fileTitle}}<text <h4>{{index + 1}}.{{item.fileTitle}}<text
class="courseType">{{item.fileType=='1' ? '必修' : '选修'}}</text></h4> class="courseType">{{item.fileType=='1' ? '必修' : '选修'}}</text></h4>
<view class="timeContent"> <view class="timeContent">
<view class=""> <view class="">
{{secondsTransferPipe(Number(item.maxViewTime))}}/{{secondsTransferPipe(Number(item.courseTotalTime))}} {{secondsTransferPipe(Number(item.maxViewTime))}}/{{secondsTransferPipe(Number(item.courseTotalTime))}}
...@@ -400,7 +403,6 @@ ...@@ -400,7 +403,6 @@
userId: uni.getStorageSync('cffp_userId'), userId: uni.getStorageSync('cffp_userId'),
packFileId: this.courseInfo.packFileId packFileId: this.courseInfo.packFileId
}).then(res => { }).then(res => {
console.log(res, 1011111111)
if (res['success']) { if (res['success']) {
this.courseInfo = res['data']['data']; this.courseInfo = res['data']['data'];
this.lecturerId = res['data']['data']['fileLecturerId']; this.lecturerId = res['data']['data']['fileLecturerId'];
...@@ -508,7 +510,6 @@ ...@@ -508,7 +510,6 @@
api.findVideoPlayback(param).then(res => { api.findVideoPlayback(param).then(res => {
if (res['success']) { if (res['success']) {
this.videoPlaybackInfo = res['data']; this.videoPlaybackInfo = res['data'];
console.log('查询视频播放轨迹结果=====', this.videoPlaybackInfo)
this.viewTime = this.videoPlaybackInfo.viewTime this.viewTime = this.videoPlaybackInfo.viewTime
this.viewTime = this.videoPlaybackInfo.viewTime ? this.videoPlaybackInfo.viewTime : 0; this.viewTime = this.videoPlaybackInfo.viewTime ? this.videoPlaybackInfo.viewTime : 0;
this.totalTime = this.videoPlaybackInfo.totalTime ? this.videoPlaybackInfo.totalTime : 0; this.totalTime = this.videoPlaybackInfo.totalTime ? this.videoPlaybackInfo.totalTime : 0;
...@@ -621,31 +622,34 @@ ...@@ -621,31 +622,34 @@
systemType: '1' systemType: '1'
} }
api.Wxshare(WxConfigRequestVO).then(res => { api.Wxshare(WxConfigRequestVO).then(res => {
console.log(res, '第三步'); console.log(res.data.appId)
jWeixin.config({ jWeixin.config({
debug: false, //调试的时候需要 在app上回弹出errmg:config ok 的时候就证明没问题了 这时候就可以改为false debug: true, //调试的时候需要 在app上回弹出errmg:config ok 的时候就证明没问题了 这时候就可以改为false
appId: res.data.appId, //appid appId: res.data.appId, //appid
timestamp: res.data.timestamp, //时间戳 timestamp: res.data.timestamp, //时间戳
nonceStr: res.data.nonceStr, //随机串 nonceStr: res.data.nonceStr, //随机串
signature: res.data.signature, //签名 signature: res.data.signature, //签名
jsApiList: res.data.jsApiList //必填 是下面需要用到的方法集合 jsApiList: res.data.jsApiList, //必填 是下面需要用到的方法集合
}) openTagList: ['wx-open-launch-app', 'wx-open-launch-weapp']
if (callback) { });
callback() jWeixin.ready(function(res1) {
} console.log('成功--------' + res1);
});
jWeixin.error(function(res2) {
close.log('失败---------' + res2);
});
}) })
}, },
}, },
onLoad(option) { onLoad(option) {
this.fileId = option.fileId; this.fileId = option.fileId;
this.courseInfo.packFileId = option.packFileId this.courseInfo.packFileId = option.packFileId
if (option.coursesharing) { if (option.coursesharing) {
this.userId = '' this.userId = ''
this.coursesharing = option.coursesharing this.coursesharing = option.coursesharing
// this.isWeixin = true; // 是微信端 this.isWeixin = true; // 是微信端
// this.JsApiTicketApi(); this.JsApiTicketApi();
this.serialsNo = option.serialsNo this.serialsNo = option.serialsNo
this.shareCode = option.shareCode this.shareCode = option.shareCode
this.shareUserId = option.shareUserId this.shareUserId = option.shareUserId
...@@ -666,31 +670,32 @@ ...@@ -666,31 +670,32 @@
this.switchTab(1); this.switchTab(1);
this.loginType = uni.getStorageSync('loginType') this.loginType = uni.getStorageSync('loginType')
}, },
// mounted() { mounted() {
// let _this = this; let _this = this;
// var btn = document.getElementById('launch-btn'); var btn = document.getElementById('launch-btn');
// alert(btn) btn.addEventListener('launch', function(e) {
// btn.addEventListener('launch', function(e) { console.log('success');
// alert('success') });
// console.log('success'); btn.addEventListener('error', function(e) {
// }); uni.showModal({
// btn.addEventListener('error', function(e) { title: '系统消息',
// console.log('fail', e.detail); content: '您的手机未找到当前应用,是否去下载?',
// alert('fail') success: function(res) {
// uni.showModal({ if (res.confirm) {
// title: '系统消息', if(uni.getSystemInfoSync().platform == 'ios'){
// content: '您的手机未找到当前应用,是否去下载?', window.location.href = "http://itunes.apple.com/us/app/id399608199";
// success: function(res) { }else {
// if (res.confirm) { alert('android')
// window.location.href = _this.versionsData.versionResources }
// console.log('用户点击确定'); //在App Store Connect中的App Store下的app信息,可找到appleId
// } else if (res.cancel) { console.log('用户点击确定');
// console.log('用户点击取消'); } else if (res.cancel) {
// } console.log('用户点击取消');
// } }
// }); }
// }); });
// }, });
},
onReady() { onReady() {
this.videoContext = uni.createVideoContext('myVideo'); this.videoContext = uni.createVideoContext('myVideo');
}, },
...@@ -754,7 +759,7 @@ ...@@ -754,7 +759,7 @@
align-items: center; align-items: center;
border-top-left-radius: 30rpx; border-top-left-radius: 30rpx;
border-bottom-left-radius: 30rpx; border-bottom-left-radius: 30rpx;
padding-left: 10rpx; // padding-left: 10rpx;
color: #fff; color: #fff;
height: 60rpx; height: 60rpx;
background: #20269B; background: #20269B;
...@@ -782,8 +787,8 @@ ...@@ -782,8 +787,8 @@
margin-right: 30rpx; margin-right: 30rpx;
.image { .image {
width: 50rpx; width: 40rpx;
height: 50rpx; height: 40rpx;
// margin-top: 10rpx; // margin-top: 10rpx;
// margin-right: 25rpx; // margin-right: 25rpx;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- <text class="iconfont icon-youjiantou zuojiantou" @click="goBack()" style="left: 20rpx;"></text> --> <!-- <text class="iconfont icon-youjiantou zuojiantou" @click="goBack()" style="left: 20rpx;"></text> -->
<!-- tab选项 --> <!-- tab选项 -->
<view class="tabTitle"> <view class="tabTitle">
<text :class="{'actived': tabType===1}" @click="switchTab(1)">直团队</text> <text :class="{'actived': tabType===1}" @click="switchTab(1)">直团队</text>
<text :class="{'actived': tabType===2}" @click="switchTab(2)">所辖团队</text> <text :class="{'actived': tabType===2}" @click="switchTab(2)">所辖团队</text>
<text :class="{'actived': tabType===3}" @click="switchTab(3)">其他</text> <text :class="{'actived': tabType===3}" @click="switchTab(3)">其他</text>
</view> </view>
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
data() { data() {
return { return {
datatitleList: ['姓名', '所属组织', '单数', '销售额', '销售收入'], datatitleList: ['姓名', '所属组织', '单数', '销售额', '销售收入'],
teamList: ['直团队', '所辖团队', '其他'], teamList: ['直团队', '所辖团队', '其他'],
teamtype: 0, teamtype: 0,
montdindex: 0, montdindex: 0,
array: ['一季度', '二季度', '三季度', '四季度'], array: ['一季度', '二季度', '三季度', '四季度'],
......
## 1.0.0(2021-03-11)
- 第一个版本
<template>
<view v-if="loadshow" class="fullloading" :style="{backgroundColor: bgcolor}">
<!-- :style="{width:iconwidth+'rpx',height:iconheight+'rpx'}" -->
<view class="" style="width: 110rpx;height: 110rpx;margin: 20% auto;">
<image src="../../../../static/orange-fullloading/loading.gif" style="width: 110rpx;height: 110rpx;"></image>
<view class="text" v-if="text" :style="{fontSize:textsize+'rpx',color:textcolor}">{{text}}</view>
</view>
</view>
</template>
<script>
export default {
props: {
// loadicon: {
// type: String,
// default() {
// return ''
// }
// },
text: {
type: String,
default() {
return ''
}
},
iconwidth: {
type: [Number, String],
default() {
return 110
}
},
iconheight: {
type: [Number, String],
default() {
return 110
}
},
textcolor: {
type: String,
default() {
return '#000000'
}
},
textsize: {
type: [Number, String],
default() {
return 30
}
},
bgcolor: {
type: String,
default() {
return '#ffffff'
}
},
loadshow: {
type: Boolean,
default() {
return true
}
},
},
data() {
return {
loadingImg: '',
errorImg: ''
}
},
methods: {
}
}
</script>
<style scoped lang="scss">
.fullloading{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
// background-color: #fff;
text-align: center;
z-index: 99999;
}
.fullloading image{
width: 110rpx;
height: 110rpx;
margin-top: 50%;
}
</style>
\ No newline at end of file
{
"id": "orange-fullloading",
"displayName": "通用全屏加载组件,支持自定义图标和文字及其他样式",
"version": "1.0.0",
"description": "支持小程序,APP,H5的通用全屏加载组件,便于页面数据缓冲显示,提供用户更友好的浏览体验",
"keywords": [
"全屏加载",
"全屏",
"加载",
"loading",
"load"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": "2677667678"
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "n"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}
\ No newline at end of file
### 安装方式
本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`
### 基本用法
``template`` 中使用组件
```html
<orange-fullloading :loadicon="loadicon" text="加载中"></orange-fullloading>
```
## API
### orange-fullloading Props
|属性名 |类型 |默认值 |说明 |
|:-: |:-: |:-: |:-: |
|loadicon |String |- |加载图标路径 |
|loadshow |Boolean |true |是否显示 |
|bgcolor |String |#ffffff |全屏加载页面背景色 |
|iconwidth |Number |110 |加载图标宽度,单位rpx,填写数字即可 |
|iconheight |Number |110 |加载图标高度,单位rpx,填写数字即可 |
|text |String |- |加载文字,不填则不显示 |
|textcolor |String |#000000 |加载文字颜色 |
|textsize |Number |30 |加载文字大小,单位rpx,填写数字即可 |
<template> <template>
<view class="uni-popup-share"> <view class="uni-popup-share">
<view class="uni-share-title"><text class="uni-share-title-text">{{shareTitleText}}</text></view> <view class="uni-share-title"><text class="uni-share-title-text">{{shareTitleText}}</text></view>
<view class="uni-share-content"> <view class="uni-share-content">
<view class="uni-share-content-box"> <view class="uni-share-content-box">
<view class="uni-share-content-item" v-for="(item,index) in bottomData" :key="index" @click.stop="select(item,index)"> <view class="uni-share-content-item" v-for="(item,index) in bottomData" :key="index" @click.stop="select(item,index)">
<!-- <image style="width: 40rpx;height: 40rpx;" class="uni-share-image" :src="item.icon" mode=""></image> --> <view class="" style="background: #FFFFFF; border-radius: 50%;width: 60rpx;height: 60rpx;">
<!-- <span :class="item.icon"></span> --> <view style="font-size: 50rpx;text-align: center;margin-top: 5rpx;" :class="item.icon">
<view :class="item.icon"> </view>
</view> </view>
<view class=""> <view class="">
<text class="uni-share-text">{{item.text}}</text> <text class="uni-share-text">{{item.text}}</text>
</view> </view>
...@@ -117,7 +117,8 @@ ...@@ -117,7 +117,8 @@
</script> </script>
<style lang="scss" > <style lang="scss" >
.uni-popup-share { .uni-popup-share {
background-color: #fff; background-color: #F4F2F3;
// background-color: #fff;
border-top-left-radius: 11rpx; border-top-left-radius: 11rpx;
border-top-right-radius: 11rpx; border-top-right-radius: 11rpx;
} }
...@@ -159,7 +160,7 @@ ...@@ -159,7 +160,7 @@
/* #endif */ /* #endif */
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
padding: 10rpx 30rpx; padding: 10rpx 40rpx;
align-items: center; align-items: center;
} }
......
...@@ -7,7 +7,6 @@ import api from "../api/api"; ...@@ -7,7 +7,6 @@ import api from "../api/api";
//初始化 //初始化
export function initJssdkShare(callback, url) { export function initJssdkShare(callback, url) {
console.log(callback,url, '第二步');
var url = url var url = url
//这一步需要调用后台接口,返回需要的签名 签名时间戳 随机串 和公众号appid //这一步需要调用后台接口,返回需要的签名 签名时间戳 随机串 和公众号appid
...@@ -21,7 +20,6 @@ export function initJssdkShare(callback, url) { ...@@ -21,7 +20,6 @@ export function initJssdkShare(callback, url) {
} }
// @ts-ignore // @ts-ignore
api.Wxshare(WxConfigRequestVO).then(res => { api.Wxshare(WxConfigRequestVO).then(res => {
console.log(res, '第三步');
jWeixin.config({ jWeixin.config({
debug: false,//调试的时候需要 在app上回弹出errmg:config ok 的时候就证明没问题了 这时候就可以改为false debug: false,//调试的时候需要 在app上回弹出errmg:config ok 的时候就证明没问题了 这时候就可以改为false
appId: res.data.appId,//appid appId: res.data.appId,//appid
...@@ -37,7 +35,6 @@ export function initJssdkShare(callback, url) { ...@@ -37,7 +35,6 @@ export function initJssdkShare(callback, url) {
} }
// data是穿的参数 url是当前页面的链接 // data是穿的参数 url是当前页面的链接
export function hshare(data,url){ export function hshare(data,url){
console.log(data, url, '第一步')
// initJssdkShare(data, url) // initJssdkShare(data, url)
initJssdkShare(function(){ initJssdkShare(function(){
jWeixin.ready(function(){ jWeixin.ready(function(){
......
// import {baseURL,apiURL,cffpURL} from "../environments/environment"; // import {baseURL,apiURL,cffpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口 // 白名单,不需要携带token就允许被访问的接口
const whiteApiList = [`/api/authorize/obtainToken`,`/api/authorize/checkToken`]; const whiteApiList = [`/api/authorize/obtainToken`, `/api/authorize/checkToken`];
export const interceptor = () => { export const interceptor = () => {
uni.addInterceptor('request', { uni.addInterceptor('request', {
...@@ -17,11 +17,11 @@ export const interceptor = () => { ...@@ -17,11 +17,11 @@ export const interceptor = () => {
if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) { if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) {
uni.request({ uni.request({
url: '/api/authorize/obtainToken', url: '/api/authorize/obtainToken',
method:'POST', method: 'POST',
data:{ticket: 'uni-app'}, data: { ticket: 'uni-app' },
success: (res) => { success: (res) => {
if(res.statusCode===200){ if (res.statusCode === 200) {
uni.setStorageSync('uni-token',res.data['data']['token']); uni.setStorageSync('uni-token', res.data['data']['token']);
window.location.href = window.location.href + '?' + 't_reload=' + new Date().getTime(); window.location.href = window.location.href + '?' + 't_reload=' + new Date().getTime();
} }
// console.log(res) // console.log(res)
...@@ -34,7 +34,10 @@ export const interceptor = () => { ...@@ -34,7 +34,10 @@ export const interceptor = () => {
//设置请求头及token //设置请求头及token
args.header = { args.header = {
'content-type': args.method === 'POST' ? 'application/json' : 'application/x-www-form-urlencoded', 'content-type': args.method === 'POST' ? 'application/json' : 'application/x-www-form-urlencoded',
'X-Authorization': uni.getStorageSync('uni-token') ? uni.getStorageSync('uni-token') : '' 'X-Authorization': uni.getStorageSync('uni-token') ? uni.getStorageSync('uni-token') : '',
// 'Access-Control-Allow-Headers': 'appId',
// 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
// 'Access-Control-Max-Age': 86400,
} }
// console.log(args.header) // console.log(args.header)
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment