Commit 8019c5a5 by sunerhu

1.分享记录接口对接。

parent cf54edf2
......@@ -296,5 +296,13 @@ export default {
// 账号注销
cancellation(params){
return request(`${apiURL}/cffp/user/cancellation`, "POST", params)
},
// 用户分享
userShare(params){
return request(`${apiURL}/cffp/share/userShare`, "POST", params)
},
// 用户阅读
userRead(params){
return request(`${apiURL}/cffp/share/userRead`, "POST", params)
}
}
<template>
<view class="content">
<view class="content-box">
<view style="margin: 20rpx;">
<view style="margin: 40rpx 30rpx;">
<view class="inputItem">
<input class="uni-input" name="invitationCode" placeholder="输入手机号" v-model="mobile" />
<input class="uni-input" name="invitationCode" maxlength="11" placeholder="输入手机号" v-model="mobile" />
</view>
<view class="login-code">
<input name="form.code" placeholder="输入验证码" v-model="code" type="number" maxlength="6" />
......@@ -40,6 +40,7 @@
sendCode: '获取验证码',
disabledSendBtn: false,
remainTimes:60,
userId:''
}
},
mounted() {
......@@ -111,7 +112,6 @@
if(res['success']){
this.userId = String(res['data']['userId']);
uni.setStorageSync('isLogin','1')
uni.setStorageSync('cffp_userId',this.userId);
// uni.navigateTo({
// url:'/pages/orderConfirm/orderConfirm?userId=' + this.userId
// })
......@@ -170,7 +170,7 @@
padding: 20rpx;
.grey {
font-size: 28rpx;
font-size: 24rpx;
color: #CECECE;
}
}
......
......@@ -18,12 +18,11 @@
<!-- :class="`padding-left-${item.level * 5 + 10}`"-->
<view class="d-td" >
<view class="" style="display: flex;">
<view class="">
<view class="" >
<uni-icons
v-if="item.hasChildren"
v-if="item.hasChildren && !treeList[0]"
:type="checkLazy(item.id) ? 'spinner-cycle' : !checkOpen(item.id) ? 'arrowright' : 'arrowdown'"
size="12"
></uni-icons>
</view>
<view @click="open(item, i)" v-if="item.level && !item.hasChildren" style="width: 24rpx;height: 26rpx;display: inline-block;"></view>
......@@ -77,6 +76,9 @@ export default {
type: Array,
default: null
},
type: {
type: String,
}
},
name: 'lazy-tree',
mounted() {
......@@ -177,7 +179,9 @@ export default {
this.openList = list;
},
async open(item, index) {
console.log(item, 11410)
if(index == 0 && this.type == 1){
return false
}
try {
if (this.checkLazy(item.id)) return;
if (!this.checkOpen(item.id)) {
......
{
"name": "日期区间picker",
"version": "1.0.7",
"lockfileVersion": 1,
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "日期区间picker",
"version": "1.0.7",
"dependencies": {
"nanoid": "^4.0.0",
"vue-signature-pad": "^3.0.2"
}
},
"node_modules/merge-images": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/merge-images/-/merge-images-1.2.0.tgz",
"integrity": "sha512-hEGvgnTdXr08uzGvEArxRsKpy7WmozM73YaSi4s5IYF4LxrhANpqfHaz9CgBZ5+0+s2NsjPnPdStz3aCc0Yulw=="
},
"node_modules/nanoid": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz",
"integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg==",
"bin": {
"nanoid": "bin/nanoid.js"
},
"engines": {
"node": "^14 || ^16 || >=18"
}
},
"node_modules/signature_pad": {
"version": "3.0.0-beta.4",
"resolved": "https://registry.npmmirror.com/signature_pad/-/signature_pad-3.0.0-beta.4.tgz",
"integrity": "sha512-cOf2NhVuTiuNqe2X/ycEmizvCDXk0DoemhsEpnkcGnA4kS5iJYTCqZ9As7tFBbsch45Q1EdX61833+6sjJ8rrw=="
},
"node_modules/vue-signature-pad": {
"version": "3.0.2",
"resolved": "https://registry.npmmirror.com/vue-signature-pad/-/vue-signature-pad-3.0.2.tgz",
"integrity": "sha512-o25o+lROfCmzASS2+fU8ZV801kV+D4/02zkZ+ez3NKeiUmbxW7kwlUf5oKQkvA+l7Ou9xGsGLsirBLch3jyX8A==",
"dependencies": {
"merge-images": "^1.1.0",
"signature_pad": "^3.0.0-beta.3"
},
"engines": {
"node": ">=12"
},
"peerDependencies": {
"vue": "^3.2.0"
}
}
},
"dependencies": {
"merge-images": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/merge-images/-/merge-images-1.2.0.tgz",
"integrity": "sha512-hEGvgnTdXr08uzGvEArxRsKpy7WmozM73YaSi4s5IYF4LxrhANpqfHaz9CgBZ5+0+s2NsjPnPdStz3aCc0Yulw=="
},
"nanoid": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz",
"integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg=="
},
"signature_pad": {
"version": "3.0.0-beta.4",
"resolved": "https://registry.npmmirror.com/signature_pad/-/signature_pad-3.0.0-beta.4.tgz",
......
......@@ -17,6 +17,7 @@
]
},
"dependencies": {
"nanoid": "^4.0.0",
"vue-signature-pad": "^3.0.2"
}
}
......@@ -132,6 +132,7 @@
},
onsubmit() {
this.loading = true
this.openForm.userIdType = this.openForm.userIdType?this.openForm.userIdType:'1'
let requestVo = this.openForm
// header:{
// 'content-type': 'application/json',
......
<template>
<view class="container">
<view class="shareheader" style="">
<!-- <view class="" v-if="coursesharing == 1" style="padding: 0;">
</view> -->
<view class="shareheader" style="" v-if="coursesharing != 1">
<view class="iconfont icon-youjiantou" @click="goBack()">
</view>
<view class="share-entrance" v-if="coursesharing != 1">
<view class="share-entrance">
<view style="z-index: 99999;">
<uni-popup ref="share" type="top" safeArea backgroundColor="#fff" :maskClick='true'
@change="maskClick">
......@@ -126,6 +128,9 @@
import BootPage from "@/components/bootpage/bootpage.vue";
import UniShareWx from "@/uni_modules/uni-share-wx/index.vue";
import dataHandling from "@/util/dataHandling";
import {
nanoid
} from 'nanoid';
export default {
components: {
UniShareWx,
......@@ -159,16 +164,21 @@
requiredCount: 0,
realName: '',
coursesharing: null,
serialsNo: null,
shareCode: null,
sharelogin: false
};
},
methods: {
close(val) {
console.log(val, 54812)
console.log(val, 558)
if (val) {
this.sharelogin = false
uni.setStorageSync('cffp_userId', val)
this.userId = val
uni.setStorageSync('cffp_userId', this.userId);
this.coursesharing = null
this.jumppurchase()
this.getuserRead()
} else {
this.sharelogin = false
}
......@@ -177,7 +187,17 @@
jumpapp() {
let platform = uni.getSystemInfoSync().platform
if (platform == 'ios') {
window.location.href = "https://mcffp.anjibao.cn/app/";
var loadDateTime = new Date();
window.location.href = "https://mcffp.anjibao.cn/app/";
window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
var timeOutDateTime = new Date();
if (timeOutDateTime - loadDateTime < 5000) {
window.location = "http://baidu.com"; //ios下载地址
} else {
}
}, 500);
} else if (platform == 'android') {
window.open('cffpapp://');
}
......@@ -191,12 +211,15 @@
},
// 打开微信分享啊
reinvite() {
const shareCode = nanoid() + this.userId
let dataWXform = {
href: "https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId +
'&coursesharing=1',
'&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode,
title: this.courseInfo.fileTitle,
summary: `加入我们开启学习之旅`,
imageUrl: this.courseInfo.displayImage,
fileId: this.fileId,
shareCode: shareCode
}
this.$refs.sharewx.open(dataWXform)
},
......@@ -419,18 +442,39 @@
this.videoContext.seek(0);
}
}
},
// 用户阅读
getuserRead(){
let UserReadRequestVO = {
userId: this.userId?this.userId:'',
serialsNo: this.serialsNo || 1,
shareCode: this.shareCode || 1,
shareUrl: window.location.href
}
api.userRead(UserReadRequestVO).then(res =>{
if (res['success']) {
uni.showToast({
title: '阅读成功',
duration: 2000
});
}
})
}
},
onLoad(option) {
this.fileId = option.fileId;
if (option.coursesharing) {
this.userId = ''
this.coursesharing = option.coursesharing
this.serialsNo = option.serialsNo
this.shareCode = option.shareCode
this.getuserRead()
}
let dataForm = uni.getStorageSync('userinfodataForm')
this.realName = dataForm.realName
// this.switchTab(1);
},
mounted() {
onShow() {
this.switchTab(1);
this.loginType = uni.getStorageSync('loginType')
},
......@@ -447,9 +491,13 @@
</script>
<style lang="scss">
page {
padding: 0;
}
.courseBannerBox {
height: 300rpx;
margin-top: 20rpx;
// margin-top: 20rpx;
background-color: #ebebeb;
display: flex;
justify-content: center;
......@@ -504,10 +552,11 @@
}
.shareheader {
padding-top: 60rpx;
display: flex;
justify-content: space-between;
align-items: center;
height: 60rpx;
height: 80rpx;
.icon-youjiantou {
display: inline-block;
......
......@@ -22,7 +22,7 @@
<i class="iconfont icon-youjiantou"></i>
</view>
</view>
</view>s
</view>
</view>
<!-- 没有报名项目 -->
<view class="noSign" v-if="signupInfos.length==0">
......
......@@ -114,6 +114,7 @@
</view>
</uni-popup>
</view>
</view>
</template>
......@@ -154,6 +155,7 @@
}
}
},
methods: {
// 支付
pay(){
......
......@@ -103,7 +103,7 @@
justify-content: space-between;
text{
&:first-child{
font-size: 24rpx;
font-size: 28rpx;
color: #333;
}
&:last-child{
......
......@@ -10,7 +10,7 @@
合计:{{item.rank}}
</view>
<view class="">
<lazy-tree :datatitleList="datatitleList" :dataList="dataList" type="1"></lazy-tree>
<lazy-tree :datatitleList="datatitleList" :dataList="dataList" type="2"></lazy-tree>
<!-- <myteam-table :datatitleList="datatitleList" :dataList="raiseList" type="2"></myteam-table> -->
<!-- <view class="table-content">
<span>辖下组织/成员</span>
......
......@@ -24,67 +24,93 @@
</view>
</uni-popup>
</view>
</view>
</template>
<script>
import api from "@/api/api";
import {
nanoid
} from 'nanoid';
export default {
data() {
return {
WXdata:{}
WXdata: {}
}
},
methods:{
methods: {
open(option) {
console.log(option, 155)
this.WXdata = option
this.$refs.sharewx.open()
this.share()
},
share() {
},
// 关闭微信分享啊
closeShare() {
this.$refs.sharewx.close()
},
uniShare(type) {
this.closeShare()
uni.share({
provider: "weixin",
scene: type === 1 ? "WXSceneSession" : "WXSceneTimeline",
type: 0,
href: this.WXdata.href,
title: this.WXdata.title,
summary: this.WXdata.summary,
imageUrl: this.WXdata.imageUrl,
success: function(res) {
let UserShareRequestVO = {
userId: uni.getStorageSync('cffp_userId'),
businessType: '1', // 分享类型
businessId: this.WXdata.fileId, // 课程Id
shareUrl: this.WXdata.href, // 分享链接
shareType: '2', // 分享类型(1:图片分享; 2:链接分享)
shareToWhere: type, //分享到哪儿(1好友 2朋友圈)
shareCode: this.WXdata.shareCode
}
api.userShare(UserShareRequestVO).then(res => {
// console.log('分享成功了吗')
if (res['success']) {
// uni.showToast({
// title: '分享成功',
// duration: 2000
// });
}
})
},
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
}
});
// if (type === 1) {
let that = this;
//获取图片后压缩
uni.downloadFile({
url: that.WXdata.imageUrl,
success: function(images) {
console.log(images, 1147474)
uni.compressImage({
src: images.tempFilePath,
quality: 20,
width: '60%',
height: '60%',
success: (res) => {
console.log('ok--->' + res.tempFilePath);
that.WXdata.tempImg = res.tempFilePath;
uni.share({
provider: "weixin",
scene: type === 1? "WXSceneSession":"WXSceneTimeline",
type: 0,
href: that.WXdata.href,
title: that.WXdata.title,
summary: that.WXdata.summary,
imageUrl: that.WXdata.tempImg,
success: function(res) {
console.log("success:" + JSON.stringify(res));
},
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
}
});
}
})
},
fail(error) {
uni.hideLoading();
}
})
// let that = this;
// uni.downloadFile({
// url: that.WXdata.imageUrl,
// success: function(images) {
// console.log(images, 1147474)
// uni.compressImage({
// src: images.tempFilePath,
// quality: 20,
// width: '60%',
// height: '60%',
// success: (res) => {
// console.log('ok--->' + res.tempFilePath);
// that.WXdata.tempImg = res.tempFilePath;
// }
// })
// },
// fail(error) {
// uni.hideLoading();
// }
// })
// }
},
}
}
......@@ -100,27 +126,28 @@
align-items: center;
padding-top: 36rpx;
}
.popup-content {
font-size: 32rpx;
color: #666;
padding-bottom: 40rpx;
.shareBox {
display: flex;
justify-content: space-around;
align-items: center;
.shareOptionItem {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.imgBox {
width: 100rpx;
}
}
}
}
</style>
\ No newline at end of file
</style>
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