Commit 04532a53 by sunerhu

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

parent 74c4c563
...@@ -305,6 +305,10 @@ export default { ...@@ -305,6 +305,10 @@ export default {
userRead(params){ userRead(params){
return request(`${apiURL}/cffp/share/userRead`, "POST", params) return request(`${apiURL}/cffp/share/userRead`, "POST", params)
}, },
//H5 分享
Wxshare(params){
return request(`${apiURL}/wxConfig`, "POST", params)
},
//支付宝网页支付 //支付宝网页支付
aliWapPay(params){ aliWapPay(params){
return request(`${apiURL}/aliPay/aliWapPay`, "POST", params) return request(`${apiURL}/aliPay/aliWapPay`, "POST", params)
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
</view> </view>
<view class="courseDetailBox"> <view class="courseDetailBox">
<view class="title"> <view class="title">
<h4 @click="curriculumDetail()">{{title}}</h4> <h4>{{title}}</h4>
<text class="detailBtn" @click="viewDetail()" v-if="isNeedViewDetail">订单详情></text> <!-- <text class="detailBtn" @click="viewDetail()" v-if="isNeedViewDetail">订单详情></text> -->
</view> </view>
<view class="summaryBox" v-if="summaryBox"> <view class="summaryBox" v-if="summaryBox">
<text>{{summaryBox}}</text> <text>{{summaryBox}}</text>
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
type:Object type:Object
}, },
isNeedViewDetail:{ isNeedViewDetail:{
type:Boolean type:Boolean,
// 销售课程传参判断是否需要显示订单详情字段 --暂时废弃
}, },
orderId:{ orderId:{
type:Number type:Number
...@@ -78,16 +79,6 @@ ...@@ -78,16 +79,6 @@
return [].concat(v2,v1) 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(){ lecturerQuery(){
api.lecturerQuery({id:this.fileLecturerId}).then(res=>{ api.lecturerQuery({id:this.fileLecturerId}).then(res=>{
if(res['success']){ if(res['success']){
...@@ -124,6 +115,7 @@ ...@@ -124,6 +115,7 @@
color: #333; color: #333;
.title{ .title{
display: flex; display: flex;
max-width: 380rpx;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.detailBtn{ .detailBtn{
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
}, },
"dependencies": { "dependencies": {
"nanoid": "^4.0.0", "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> <template>
<view class="container"> <view class="container">
<!-- <view class="" v-if="coursesharing == 1" style="padding: 0;">
</view> -->
<view class="shareheader" style="" v-if="coursesharing != 1"> <view class="shareheader" style="" v-if="coursesharing != 1">
<view class="iconfont icon-youjiantou" @click="goBack()"> <view class="iconfont icon-youjiantou" @click="goBack()">
</view> </view>
...@@ -13,8 +10,6 @@ ...@@ -13,8 +10,6 @@
<uni-popup-share @select="sharechange"></uni-popup-share> <uni-popup-share @select="sharechange"></uni-popup-share>
</uni-popup> </uni-popup>
</view> </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;"> <view class="" style="width: 50rpx;height: 50rpx;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>
...@@ -37,7 +32,6 @@ ...@@ -37,7 +32,6 @@
<view class="courseTitle"> <view class="courseTitle">
<h4>{{courseInfo.fileTitle}}</h4> <h4>{{courseInfo.fileTitle}}</h4>
<view class="shareF"> <view class="shareF">
<!-- <view></view> -->
<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>
...@@ -129,6 +123,9 @@ ...@@ -129,6 +123,9 @@
import UniShareWx from "@/uni_modules/uni-share-wx/index.vue"; import UniShareWx from "@/uni_modules/uni-share-wx/index.vue";
import dataHandling from "@/util/dataHandling"; import dataHandling from "@/util/dataHandling";
import { import {
hshare
} from '@/util/fiveshare'
import {
nanoid nanoid
} from 'nanoid'; } from 'nanoid';
export default { export default {
...@@ -177,7 +174,6 @@ ...@@ -177,7 +174,6 @@
this.userId = val this.userId = val
uni.setStorageSync('cffp_userId', this.userId); uni.setStorageSync('cffp_userId', this.userId);
this.coursesharing = null this.coursesharing = null
this.jumppurchase()
this.getuserRead() this.getuserRead()
} else { } else {
this.sharelogin = false this.sharelogin = false
...@@ -190,11 +186,10 @@ ...@@ -190,11 +186,10 @@
var loadDateTime = new Date(); var loadDateTime = new Date();
window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页 window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
var timeOutDateTime = new Date(); var timeOutDateTime = new Date();
if (timeOutDateTime - loadDateTime < 5000) { if (timeOutDateTime - loadDateTime < 500) {
window.location.href = "https://mcffp.anjibao.cn/app/"; window.location.href = "https://mcffp.anjibao.cn/app/";
} else { } else {
window.location = "https://mdev.anjibao.cn/cffp/app.ipa"; //ios下载地址 window.location = "www.baidu.com"; //ios下载地址
//window.location = "https://mdev.anjibao.cn/cffp/app.apk"; //ios下载地址
} }
}, 500); }, 500);
...@@ -202,11 +197,11 @@ ...@@ -202,11 +197,11 @@
var loadDateTime = new Date(); var loadDateTime = new Date();
window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页 window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
var timeOutDateTime = new Date(); var timeOutDateTime = new Date();
if (timeOutDateTime - loadDateTime < 5000) { if (timeOutDateTime - loadDateTime < 500) {
window.open('cffpapp://'); window.open('cffpapp://');
} else { } else {
// window.location = "https://mdev.anjibao.cn/cffp/app.ipa"; //ios下载地址 // 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); }, 500);
...@@ -223,8 +218,8 @@ ...@@ -223,8 +218,8 @@
reinvite() { reinvite() {
const shareCode = nanoid() + this.userId const shareCode = nanoid() + this.userId
let dataWXform = { let dataWXform = {
href: "https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId + href:"https://mdev.zuihuibi.cn/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId +
'&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode, '&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode+'&shareUserId=' + this.userId,
title: this.courseInfo.fileTitle, title: this.courseInfo.fileTitle,
summary: `加入我们开启学习之旅`, summary: `加入我们开启学习之旅`,
imageUrl: this.courseInfo.displayImage, imageUrl: this.courseInfo.displayImage,
...@@ -243,7 +238,6 @@ ...@@ -243,7 +238,6 @@
url: val.item.link url: val.item.link
}) })
}, },
// 订单保存 // 订单保存
saveOrder() { saveOrder() {
if (this.loginType === 'visitor') { if (this.loginType === 'visitor') {
...@@ -257,9 +251,9 @@ ...@@ -257,9 +251,9 @@
this.jumppurchase() this.jumppurchase()
} }
} }
}, },
jumppurchase() { jumppurchase() {
console.log(this.shareUserId, 485488)
const param = { const param = {
productType: '1', productType: '1',
productId: this.courseInfo.fileId, productId: this.courseInfo.fileId,
...@@ -267,7 +261,7 @@ ...@@ -267,7 +261,7 @@
shareUserId: this.shareUserId, shareUserId: this.shareUserId,
shareReadId: this.shareReadId, shareReadId: this.shareReadId,
shareCode: this.shareCode, shareCode: this.shareCode,
dataSource: this.dataSource dataSource: this.coursesharing == 1 ? '2': this.dataSource
} }
api.saveOrder(param).then(res => { api.saveOrder(param).then(res => {
if (res['success']) { if (res['success']) {
...@@ -463,14 +457,22 @@ ...@@ -463,14 +457,22 @@
} }
api.userRead(UserReadRequestVO).then(res => { api.userRead(UserReadRequestVO).then(res => {
if (res['success']) { if (res['success']) {
console.log('操作成功') this.shareReadId = res.data.id
// uni.showToast({ this.jumppurchase()
// title: '阅读成功',
// duration: 2000
// });
} }
}) })
} },
// 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) { onLoad(option) {
this.fileId = option.fileId; this.fileId = option.fileId;
...@@ -479,8 +481,11 @@ ...@@ -479,8 +481,11 @@
this.coursesharing = option.coursesharing this.coursesharing = option.coursesharing
this.serialsNo = option.serialsNo this.serialsNo = option.serialsNo
this.shareCode = option.shareCode this.shareCode = option.shareCode
this.shareUserId = option.shareUserId
this.getuserRead() this.getuserRead()
this.getshareData()
} }
let dataForm = uni.getStorageSync('userinfodataForm') let dataForm = uni.getStorageSync('userinfodataForm')
this.realName = dataForm.realName this.realName = dataForm.realName
// this.switchTab(1); // this.switchTab(1);
......
...@@ -108,8 +108,9 @@ ...@@ -108,8 +108,9 @@
url:`../authentication-query/authentication-result?queryType=1` url:`../authentication-query/authentication-result?queryType=1`
}) })
}else{ }else{
let certificateId = certifyItem.isAdopt != 1?certifyItem.certificateId: null
uni.navigateTo({ 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 @@ ...@@ -160,14 +160,7 @@
this.totalOrder = res.data.totalOrder this.totalOrder = res.data.totalOrder
this.totalCoursePrice = res.data.totalCoursePrice this.totalCoursePrice = res.data.totalCoursePrice
this.totalIncome = res.data.totalIncome this.totalIncome = res.data.totalIncome
// var dataForm = { this.sortswitch()
// courseIncome:'1040',
// coursePrice: '1040',
// areaCenterName:'区域二级服务中心',
// orderNum: '200',
// name: '张柚子'
// }
// this.dataList.push(dataForm)
} }
}) })
}, },
......
...@@ -45,8 +45,13 @@ ...@@ -45,8 +45,13 @@
<h4 class="noListTip" v-if="!userShareCourseOrders || userShareCourseOrders.length <=0 && tabType===2">暂无分享记录!</h4> <h4 class="noListTip" v-if="!userShareCourseOrders || userShareCourseOrders.length <=0 && tabType===2">暂无分享记录!</h4>
<template v-if="userCourses && tabType===1"> <template v-if="userCourses && tabType===1">
<view class="saleOrderInfoItem" v-for="item in userCourses" :key="item.fileId"> <view class="saleOrderInfoItem" v-for="item in userCourses" :key="item.fileId">
<view class="courseInfoContent"> <view class="courseInfoContent" style="display: flex;justify-content: space-between;">
<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="" @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>
<view class="countsContent"> <view class="countsContent">
<text>实际支付:¥{{parseFloat(item.paymentAmount).toFixed(2)}}</text> <text>实际支付:¥{{parseFloat(item.paymentAmount).toFixed(2)}}</text>
...@@ -89,6 +94,17 @@ ...@@ -89,6 +94,17 @@
} }
}, },
methods: { 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) { bindDateChange: function(e) {
this.queryDate = e.detail.value; this.queryDate = e.detail.value;
this.userCourseList(); this.userCourseList();
...@@ -144,12 +160,6 @@ ...@@ -144,12 +160,6 @@
url:`/pages/myPoints/myPoints` url:`/pages/myPoints/myPoints`
}) })
}, },
// 查看订单详情
viewDetail(id){
uni.navigateTo({
url:`/pages/orderDetail/orderDetail?id=${id}`
})
}
}, },
onLoad() { onLoad() {
this.userCourseCount() this.userCourseCount()
...@@ -211,7 +221,7 @@ ...@@ -211,7 +221,7 @@
.saleDetailContent{ .saleDetailContent{
margin: 10rpx 20rpx; margin: 10rpx 20rpx;
.saleOrderInfoItem{ .saleOrderInfoItem{
padding: 18rpx 10rpx; padding: 18rpx 0rpx 18rpx 10rpx;
border-radius: 20rpx; border-radius: 20rpx;
background-color: #fff; background-color: #fff;
.countsContent{ .countsContent{
...@@ -219,6 +229,12 @@ ...@@ -219,6 +229,12 @@
color: #333; color: #333;
font-size: 32rpx; font-size: 32rpx;
margin-top: 20rpx; margin-top: 20rpx;
}
.detailBtn{
font-size: 24rpx;
color: #4A4A4A;
white-space: nowrap;
} }
} }
.orderItemDetailBox{ .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