|
|
@@ -108,17 +108,44 @@
|
|
|
<view class="footer_tab">
|
|
|
<u-line color="#D6D6DB" />
|
|
|
<view style="height: 100%;display: flex;align-items: center;position: relative;">
|
|
|
- <view style="text-align: center;margin-left: 30rpx;">
|
|
|
- <image src="/static/sc.png" class="sc"></image>
|
|
|
+ <view style="text-align: center;margin-left: 30rpx;" @click="favorites">
|
|
|
+ <image :src="collecStatus ? '/static/star.png' : '/static/sc.png'" class="sc"></image>
|
|
|
<view class="sc_t">收藏</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="buy" @click="jumpPay">
|
|
|
+ <view class="buy" v-if="payStatus === 0" @click="buyTK">
|
|
|
+ 立即购买
|
|
|
+ </view>
|
|
|
+ <view class="buy" v-if="payStatus === 1" @click="jumpPay">
|
|
|
开始阅读
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+<u-popup v-model="showPricePop" mode="bottom" border-radius="14">
|
|
|
+ <view class="topBox">
|
|
|
+ <view class="firstTopL">
|
|
|
+ <view class="imageBs"><image :src="$method.splitImgHost(detail.coverUrl)" mode=""></image></view>
|
|
|
+ <view class="textBs">{{ detail.name }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="boldFonstType">
|
|
|
+ 类型:
|
|
|
+ <span style="font-weight: bold;">{{ detail.categoryName }}</span>
|
|
|
+ </view>
|
|
|
+ <view class="priceBxs">
|
|
|
+ <view class="pricleft">
|
|
|
+ 活动价
|
|
|
+ <span style="font-weight: bold;">¥{{ detail.price }}</span>
|
|
|
+ </view>
|
|
|
+ <view class="pricright" style="text-decoration: line-through;color: #666;">¥{{ detail.price }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="btnspric">
|
|
|
+ <view class="lefprL">
|
|
|
+ 实付:
|
|
|
+ <span style="color: #E91313;">¥{{ prices }}</span>
|
|
|
+ </view>
|
|
|
+ <view class="lefprR" @click="getorder">提交订单</view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -137,17 +164,136 @@
|
|
|
id:0,
|
|
|
detail:{},
|
|
|
teacherList:[],
|
|
|
- recommendList:[]
|
|
|
+ recommendList:[],
|
|
|
+ showPricePop: false, //购买详情弹窗
|
|
|
+ newDate: 0, //现在时间戳
|
|
|
+ prices: 0, //实付
|
|
|
+ payStatus: 0,//是否已购买
|
|
|
+ collecStatus: false,
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
this.id = option.id
|
|
|
this.getDetail()
|
|
|
this.noteRecommendList({fileId:this.id})
|
|
|
+ this.getHaveThis()
|
|
|
},
|
|
|
onShow(){
|
|
|
+ if (!uni.getStorageSync('union_id') && this.$store.state.token === '') {
|
|
|
+ } else {
|
|
|
+ this.favoritesStatus();
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ favoritesStatus() {
|
|
|
+ this.$api.noteCollects(this.id).then(result => {
|
|
|
+ if (result.data.data === undefined) {
|
|
|
+ this.collecStatus = false;
|
|
|
+ } else {
|
|
|
+ this.collecStatus = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //收藏
|
|
|
+ favorites() {
|
|
|
+ var self = this;
|
|
|
+ if (!uni.getStorageSync('union_id') && this.$store.state.token === '') {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/login/login'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ if (this.collecStatus) {
|
|
|
+ this.$api.noteCollects(self.id).then(results => {
|
|
|
+ self.$api.noteCollectdelete(results.data.data.collectNoteId).then(resz => {
|
|
|
+ self.favoritesStatus();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ var data = {
|
|
|
+ userId: this.$store.state.userInfo.userId,
|
|
|
+ fileId: self.id
|
|
|
+ };
|
|
|
+ this.$api.noteCollectsadd(data).then(res => {
|
|
|
+ self.favoritesStatus();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //检测是否已购买该课程
|
|
|
+ getHaveThis(){
|
|
|
+ var self = this
|
|
|
+ var data = {
|
|
|
+ possessId: this.id,
|
|
|
+ typeId: 3
|
|
|
+ }
|
|
|
+ this.$api.systemuserowner(data).then(res => {
|
|
|
+ if(res.data.code === 200){
|
|
|
+ self.payStatus = res.data.data.payStatus
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //提交订单
|
|
|
+ getorder(){
|
|
|
+ var self = this
|
|
|
+ var data = {
|
|
|
+ goodsList: [{
|
|
|
+ goodsId: self.detail.fileId,
|
|
|
+ num: 1,
|
|
|
+ goodsType: 3
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ self.$api.order(data).then(res => {
|
|
|
+ if(res.data.code === 200){
|
|
|
+ let objarr = res.data.data
|
|
|
+ wx.requestPayment({
|
|
|
+ timeStamp: objarr.timeStamp,
|
|
|
+ nonceStr: objarr.nonceStr,
|
|
|
+ package: objarr.package,
|
|
|
+ signType: objarr.signType,
|
|
|
+ paySign: objarr.sign,
|
|
|
+ success (result) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '支付成功',
|
|
|
+ showCancel: false,
|
|
|
+ success: function (resst) {
|
|
|
+ if(resst.confirm){
|
|
|
+ self.showPricePop = false
|
|
|
+ self.getHaveThis()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail (err){
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '支付失败',
|
|
|
+ showCancel: false,
|
|
|
+ success: function (resst) {
|
|
|
+ self.showPricePop = false
|
|
|
+ self.getHaveThis()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //购买题库
|
|
|
+ buyTK(){
|
|
|
+ var self = this;
|
|
|
+ uni.getStorage({
|
|
|
+ key: 'union_id',
|
|
|
+ success: function(res) {
|
|
|
+ // 继续操作
|
|
|
+ self.showPricePop = true;
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ //重新登入
|
|
|
+ self.$navTo.togo('/pages/login/login', {});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
jumpDetail(item) {
|
|
|
this.$navTo.togo('/pages2/course/keynote', {
|
|
|
id:item.fileId
|
|
|
@@ -157,6 +303,7 @@
|
|
|
let self = this
|
|
|
this.$api.noteInfo(this.id).then(res => {
|
|
|
self.detail = res.data.data
|
|
|
+ self.prices = res.data.data.price
|
|
|
if(self.detail.teacherIds&&self.detail.teacherIds!=''){
|
|
|
let param = {
|
|
|
teacherIds : self.detail.teacherIds
|
|
|
@@ -220,6 +367,133 @@
|
|
|
}
|
|
|
</style>
|
|
|
<style scope>
|
|
|
+
|
|
|
+ .btnspric {
|
|
|
+ border-top: 1rpx solid #eee;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 108rpx;
|
|
|
+ padding-left: 43rpx;
|
|
|
+ padding-right: 32rpx;
|
|
|
+ }
|
|
|
+ .btnspric > .lefprL {
|
|
|
+ font-size: 36rpx;
|
|
|
+ color: #0c141f;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .btnspric > .lefprR {
|
|
|
+ padding: 0rpx 24rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ line-height: 60rpx;
|
|
|
+ text-align: center;
|
|
|
+ color: #fff;
|
|
|
+ background: #32467b;
|
|
|
+ border-radius: 24rpx;
|
|
|
+ box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
|
|
|
+ }
|
|
|
+ .yhj,
|
|
|
+ .hdyhj {
|
|
|
+ padding: 24rpx 29rpx 24rpx 34rpx;
|
|
|
+ }
|
|
|
+ .yhj {
|
|
|
+ border-bottom: 16rpx solid #f9f9f9;
|
|
|
+ }
|
|
|
+ .yhjtit {
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #0c141f;
|
|
|
+ font-weight: 500;
|
|
|
+ margin-bottom: 14rpx;
|
|
|
+ }
|
|
|
+ .yhjList {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 14rpx;
|
|
|
+ }
|
|
|
+ .yhjList > .yhjLefts {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .yhjLefts > .yhl {
|
|
|
+ color: #32467b;
|
|
|
+ font-size: 30rpx;
|
|
|
+ margin-right: 31rpx;
|
|
|
+ }
|
|
|
+ .yhjLefts > .yhbq {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #ff9500;
|
|
|
+ border-radius: 18rpx;
|
|
|
+ background-color: rgba(255, 149, 0, 0.2);
|
|
|
+ border: 2rpx solid #ff9500;
|
|
|
+ height: 38rpx;
|
|
|
+ line-height: 38rpx;
|
|
|
+ padding: 0rpx 16rpx;
|
|
|
+ }
|
|
|
+ .ts {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #999;
|
|
|
+ margin: 14rpx 0rpx;
|
|
|
+ padding-right: 29rpx;
|
|
|
+ padding-left: 34rpx;
|
|
|
+ }
|
|
|
+ .yh {
|
|
|
+ padding-top: 20rpx;
|
|
|
+ }
|
|
|
+ .yh > .yhtitle {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-right: 29rpx;
|
|
|
+ padding-left: 34rpx;
|
|
|
+ }
|
|
|
+ .priceBxs {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .priceBxs > .pricleft {
|
|
|
+ border-radius: 24rpx;
|
|
|
+ border: 1rpx solid #e91313;
|
|
|
+ background-color: rgba(233, 19, 19, 0.1);
|
|
|
+ padding: 0rpx 18rpx;
|
|
|
+ height: 49rpx;
|
|
|
+ line-height: 49rpx;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #e91313;
|
|
|
+ margin-right: 13rpx;
|
|
|
+ }
|
|
|
+ .topBox {
|
|
|
+ padding: 32rpx 32rpx 24rpx;
|
|
|
+ border-bottom: 1rpx solid #eeeeee;
|
|
|
+ }
|
|
|
+ .topBox > .boldFonstType {
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 30rpx;
|
|
|
+ margin: 16rpx 0rpx 23rpx;
|
|
|
+ }
|
|
|
+ .topBox > .firstTopL {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .topBox > .firstTopL > .imageBs {
|
|
|
+ width: 331rpx;
|
|
|
+ height: 160rpx;
|
|
|
+ border-radius: 6rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-right: 8rpx;
|
|
|
+ box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
|
|
|
+ }
|
|
|
+ .topBox > .firstTopL > .imageBs > image {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ .topBox > .firstTopL > .textBs {
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #0c141f;
|
|
|
+ }
|
|
|
.text_box{
|
|
|
font-size: 24rpx;
|
|
|
font-family: PingFang SC;
|