Commit 04532a53 by sunerhu

1.H5 分享页面修改--测试

parent 74c4c563
......@@ -305,6 +305,10 @@ export default {
userRead(params){
return request(`${apiURL}/cffp/share/userRead`, "POST", params)
},
//H5 分享
Wxshare(params){
return request(`${apiURL}/wxConfig`, "POST", params)
},
//支付宝网页支付
aliWapPay(params){
return request(`${apiURL}/aliPay/aliWapPay`, "POST", params)
......
......@@ -5,8 +5,8 @@
</view>
<view class="courseDetailBox">
<view class="title">
<h4 @click="curriculumDetail()">{{title}}</h4>
<text class="detailBtn" @click="viewDetail()" v-if="isNeedViewDetail">订单详情></text>
<h4>{{title}}</h4>
<!-- <text class="detailBtn" @click="viewDetail()" v-if="isNeedViewDetail">订单详情></text> -->
</view>
<view class="summaryBox" v-if="summaryBox">
<text>{{summaryBox}}</text>
......@@ -49,7 +49,8 @@
type:Object
},
isNeedViewDetail:{
type:Boolean
type:Boolean,
// 销售课程传参判断是否需要显示订单详情字段 --暂时废弃
},
orderId:{
type:Number
......@@ -78,16 +79,6 @@
return [].concat(v2,v1)
}
},
viewDetail(){
uni.navigateTo({
url:`/pages/orderDetail/orderDetail?id=${this.orderId}&type=drop`
})
},
curriculumDetail(){
uni.navigateTo({
url:`/pages/courseDetail/courseDetail?fileId=${this.fileId}`
})
},
lecturerQuery(){
api.lecturerQuery({id:this.fileLecturerId}).then(res=>{
if(res['success']){
......@@ -124,6 +115,7 @@
color: #333;
.title{
display: flex;
max-width: 380rpx;
justify-content: space-between;
align-items: center;
.detailBtn{
......
......@@ -18,6 +18,8 @@
},
"dependencies": {
"nanoid": "^4.0.0",
"vue-signature-pad": "^3.0.2"
"require.js": "^1.0.0",
"vue-signature-pad": "^3.0.2",
"weixin-js-sdk": "^1.6.0"
}
}
<template>
<view class="container">
<!-- <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>
......@@ -13,8 +10,6 @@
<uni-popup-share @select="sharechange"></uni-popup-share>
</uni-popup>
</view>
<!-- <img @click="reinvite" src="../../static/fastentry/Slice122.png" alt="">
<img @click="shareToggle" src="../../static/fastentry/Slice12.png" alt=""> -->
<view class="" style="width: 50rpx;height: 50rpx;padding-right: 20rpx;">
<image class="image" @click="reinvite" src="../../static/fastentry/Slice122.png" mode=""></image>
......@@ -37,7 +32,6 @@
<view class="courseTitle">
<h4>{{courseInfo.fileTitle}}</h4>
<view class="shareF">
<!-- <view></view> -->
<view class="awakenApp" @click="jumpapp()" v-if="coursesharing == 1">
<view class="" style="width: 50rpx; height: 50rpx;">
<image style="width: 50rpx; height: 50rpx;" src="../../static/Slice117.png" mode=""></image>
......@@ -129,6 +123,9 @@
import UniShareWx from "@/uni_modules/uni-share-wx/index.vue";
import dataHandling from "@/util/dataHandling";
import {
hshare
} from '@/util/fiveshare'
import {
nanoid
} from 'nanoid';
export default {
......@@ -177,7 +174,6 @@
this.userId = val
uni.setStorageSync('cffp_userId', this.userId);
this.coursesharing = null
this.jumppurchase()
this.getuserRead()
} else {
this.sharelogin = false
......@@ -190,11 +186,10 @@
var loadDateTime = new Date();
window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
var timeOutDateTime = new Date();
if (timeOutDateTime - loadDateTime < 5000) {
if (timeOutDateTime - loadDateTime < 500) {
window.location.href = "https://mcffp.anjibao.cn/app/";
} else {
window.location = "https://mdev.anjibao.cn/cffp/app.ipa"; //ios下载地址
//window.location = "https://mdev.anjibao.cn/cffp/app.apk"; //ios下载地址
window.location = "www.baidu.com"; //ios下载地址
}
}, 500);
......@@ -202,11 +197,11 @@
var loadDateTime = new Date();
window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
var timeOutDateTime = new Date();
if (timeOutDateTime - loadDateTime < 5000) {
if (timeOutDateTime - loadDateTime < 500) {
window.open('cffpapp://');
} else {
// window.location = "https://mdev.anjibao.cn/cffp/app.ipa"; //ios下载地址
window.location = "https://mdev.anjibao.cn/cffp/app.apk"; //ios下载地址
window.location = "www.baidu.com"; //ios下载地址
}
}, 500);
......@@ -223,8 +218,8 @@
reinvite() {
const shareCode = nanoid() + this.userId
let dataWXform = {
href: "https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId +
'&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode,
href:"https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId +
'&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode+'&shareUserId=' + this.userId,
title: this.courseInfo.fileTitle,
summary: `加入我们开启学习之旅`,
imageUrl: this.courseInfo.displayImage,
......@@ -243,7 +238,6 @@
url: val.item.link
})
},
// 订单保存
saveOrder() {
if (this.loginType === 'visitor') {
......@@ -257,9 +251,9 @@
this.jumppurchase()
}
}
},
jumppurchase() {
console.log(this.shareUserId, 485488)
const param = {
productType: '1',
productId: this.courseInfo.fileId,
......@@ -267,7 +261,7 @@
shareUserId: this.shareUserId,
shareReadId: this.shareReadId,
shareCode: this.shareCode,
dataSource: this.dataSource
dataSource: this.coursesharing == 1 ? '2': this.dataSource
}
api.saveOrder(param).then(res => {
if (res['success']) {
......@@ -463,14 +457,22 @@
}
api.userRead(UserReadRequestVO).then(res => {
if (res['success']) {
console.log('操作成功')
// uni.showToast({
// title: '阅读成功',
// duration: 2000
// });
this.shareReadId = res.data.id
this.jumppurchase()
}
})
}
},
// H5 自定义分享
getshareData(){
let data = {
title:this.courseInfo.fileTitle,
desc:'加入我们开启学习之旅',
link: window.location.href,//分享链接
imgUrl: this.courseInfo.displayImage, //图片
}
var url = window.location.href.split('#')[0]
hshare(data,url)
},
},
onLoad(option) {
this.fileId = option.fileId;
......@@ -479,8 +481,11 @@
this.coursesharing = option.coursesharing
this.serialsNo = option.serialsNo
this.shareCode = option.shareCode
this.shareUserId = option.shareUserId
this.getuserRead()
this.getshareData()
}
let dataForm = uni.getStorageSync('userinfodataForm')
this.realName = dataForm.realName
// this.switchTab(1);
......
......@@ -108,8 +108,9 @@
url:`../authentication-query/authentication-result?queryType=1`
})
}else{
let certificateId = certifyItem.isAdopt != 1?certifyItem.certificateId: null
uni.navigateTo({
url:`../certifyDetail/certifyDetail?certificateId=${certifyItem.certificateId}&userSignupId=null&status=${certifyItem.isAdopt}`
url:`../certifyDetail/certifyDetail?certificateId=${certificateId}&userSignupId=${certifyItem.userSignupId}&status=${certifyItem.isAdopt}`
})
}
},
......
......@@ -160,14 +160,7 @@
this.totalOrder = res.data.totalOrder
this.totalCoursePrice = res.data.totalCoursePrice
this.totalIncome = res.data.totalIncome
// var dataForm = {
// courseIncome:'1040',
// coursePrice: '1040',
// areaCenterName:'区域二级服务中心',
// orderNum: '200',
// name: '张柚子'
// }
// this.dataList.push(dataForm)
this.sortswitch()
}
})
},
......
......@@ -45,8 +45,13 @@
<h4 class="noListTip" v-if="!userShareCourseOrders || userShareCourseOrders.length <=0 && tabType===2">暂无分享记录!</h4>
<template v-if="userCourses && tabType===1">
<view class="saleOrderInfoItem" v-for="item in userCourses" :key="item.fileId">
<view class="courseInfoContent">
<course-item :thumbnailPath="item.displayImage" :fileId="item.fileId" :title="item.fileTitle" :summaryBox="item.fileSynopsis" :dataList="{coursePrice:item.coursePrice,salesNumber:item.salesNumber}" :fileLecturerId="item.fileLecturerId" :isNeedViewDetail="true" :orderId="item.orderId"></course-item>
<view class="courseInfoContent" style="display: flex;justify-content: space-between;">
<view class="" @click="curriculumDetail(item)">
<course-item :thumbnailPath="item.displayImage" :fileId="item.fileId" :title="item.fileTitle" :summaryBox="item.fileSynopsis" :dataList="{coursePrice:item.coursePrice,salesNumber:item.salesNumber}" :fileLecturerId="item.fileLecturerId" :orderId="item.orderId"></course-item>
</view>
<view class="detailBtn">
<text class="detailBtn" @click="viewDetail(item)" style="color: #000;">订单详情></text>
</view>
</view>
<view class="countsContent">
<text>实际支付:¥{{parseFloat(item.paymentAmount).toFixed(2)}}</text>
......@@ -89,6 +94,17 @@
}
},
methods: {
curriculumDetail(item){
uni.navigateTo({
url:`/pages/courseDetail/courseDetail?fileId=${item.fileId}`
})
},
// 查看订单详情
viewDetail(item){
uni.navigateTo({
url:`/pages/orderDetail/orderDetail?id=${item.orderId}&type=drop`
})
},
bindDateChange: function(e) {
this.queryDate = e.detail.value;
this.userCourseList();
......@@ -144,12 +160,6 @@
url:`/pages/myPoints/myPoints`
})
},
// 查看订单详情
viewDetail(id){
uni.navigateTo({
url:`/pages/orderDetail/orderDetail?id=${id}`
})
}
},
onLoad() {
this.userCourseCount()
......@@ -211,7 +221,7 @@
.saleDetailContent{
margin: 10rpx 20rpx;
.saleOrderInfoItem{
padding: 18rpx 10rpx;
padding: 18rpx 0rpx 18rpx 10rpx;
border-radius: 20rpx;
background-color: #fff;
.countsContent{
......@@ -219,6 +229,12 @@
color: #333;
font-size: 32rpx;
margin-top: 20rpx;
}
.detailBtn{
font-size: 24rpx;
color: #4A4A4A;
white-space: nowrap;
}
}
.orderItemDetailBox{
......
// var wx = require("weixin-js-sdk/index.js") //引入刚下载的js文件
// import $H from '@/api/request.js' //封装好的接口请求
import wx from 'weixin-js-sdk'
import api from "../api/api";
//初始化
export function initJssdkShare(callback, url) {
console.log(callback,url, '第二步');
var url = url
//这一步需要调用后台接口,返回需要的签名 签名时间戳 随机串 和公众号appid
//注意url:window.location.href.split('#')[0] //
// request.post("", {
// url // url是当前页面的url
// },
let WxConfigRequestVO = {
url:url,
systemType:'1'
}
// @ts-ignore
api.Wxshare(WxConfigRequestVO).then(res => {
console.log(res, '第三步');
wx.config({
debug: true,//调试的时候需要 在app上回弹出errmg:config ok 的时候就证明没问题了 这时候就可以改为false
appId: res.data.appId,//appid
timestamp: res.data.timestamp,//时间戳
nonceStr: res.data.nonceStr,//随机串
signature: res.data.signature,//签名
jsApiList: res.data.jsApiList//必填 是下面需要用到的方法集合
})
if(callback){
callback()
}
})
}
// data是穿的参数 url是当前页面的链接
export function hshare(data,url){
console.log(data, url, '第一步')
// initJssdkShare(data, url)
initJssdkShare(function(){
wx.ready(function(){
console.log(data);
var sharedata={
title: data.title, //标题
desc: data.desc, //描述
link: data.link ,//分享链接
imgUrl:data.imgUrl, //图片
success:(res=>{
})
};
wx.updateAppMessageShareData(sharedata)//自定义微信分享给朋友
wx.updateTimelineShareData(sharedata);//自定义微信分享给朋友
wx.onMenuShareAppMessage(sharedata);//获取“分享给朋友”按钮点击状态及自定义分享内容接口(即将废弃)
})
},url)
}
\ No newline at end of file
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