Commit 9ebd2a08 authored by jyx's avatar jyx

调试客服接口,添加支付状态判断,代码优化

parent b2296e01
......@@ -95,8 +95,7 @@
data() {
return {
vipList: [],
selectedIndex: 0,
tid: 0,
selectedIndex: 0,
userBean: {},
showClone: false
};
......@@ -173,8 +172,7 @@
},
wxPay(wxData, largeType) {
let wxParams = wxData.params;
let that = this;
this.tid=wxData.tid;
let that = this;
// 发起微信支付
wx.requestPayment({
timeStamp: wxParams.timeStamp,
......@@ -192,12 +190,10 @@
// 虚拟支付
let wxParams = wxData.params;
let signDataParams = wxData.params.sigData;
// let signDataStr = wxData.params.signDataStr;
let that = this;
const SDKVersion = wx.getSystemInfoSync().SDKVersion;
if (this.compareVersion(SDKVersion, '2.19.2') >= 0 || wx.canIUse('requestVirtualPayment')) {
wx.requestVirtualPayment({
// signData :signDataStr,
signData: JSON.stringify(wxData.params.sigData),
// signData: JSON.stringify({
// offerId: signDataParams.offerId,
......@@ -214,7 +210,8 @@
signature: wxParams.signature,
mode: wxParams.mode,
success(res) {
that.paySuccess(largeType);
// 拉取服务器,是否支付成功
that.queryOrderStatus(largeType, wxData.params.sigData.outTradeNo)
},
fail({
errMsg,
......@@ -228,6 +225,25 @@
message.notify('当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。');
}
},
queryOrderStatus(largeType, tid) {
// setTimeout(() => {
// }, 5000);
let that = this;
this.post({
data: {
tid: tid
},
url: '/vip/queryVipOrder',
showLoading: true,
success: ({
data
}) => {
that.paySuccess(largeType);
}
});
},
compareVersion(_v1, _v2) {
if (typeof _v1 !== 'string' || typeof _v2 !== 'string') return 0
......
......@@ -113,15 +113,15 @@
let index = options.index ?? ''
if (index != '' && index != undefined) {
this.currentPage = index
}
if(wx.setVisualEffectOnCapture){
wx.setVisualEffectOnCapture({
visualEffect: 'hidden',
success:(res) => {
},
})
}
if (wx.setVisualEffectOnCapture) {
wx.setVisualEffectOnCapture({
visualEffect: 'hidden',
success: (res) => {
},
})
}
},
onShow() {
......@@ -197,13 +197,13 @@
position: absolute;
bottom: 0;
width: 100%;
height: 120rpx;
height: 110rpx;
background: white;
display: flex;
.editItem {
height: 120rpx;
line-height: 120rpx;
height: 110rpx;
line-height: 110rpx;
text-align: center;
width: 50%;
}
......@@ -213,7 +213,8 @@
display: flex;
background-color: black;
.tab {
.tab {
height: 110rpx;
flex: 1;
text-align: center;
font-size: 26rpx;
......
......@@ -20,8 +20,14 @@
<view style="position: relative;">
<view style="position: absolute;z-index: 10;margin-left: 20rpx;">
<view style="position: relative;">
<view
style="position: absolute;z-index: 10;margin-left: 18rpx;margin-top: 10rpx;font-size: 24rpx;color: white;">
<view style="
position: absolute;
z-index: 10;
width: 50rpx;
text-align: center;
margin-top: 8rpx;
font-size: 24rpx;
color: white;">
{{index+1}}
</view>
<image v-if="index==0"
......@@ -80,8 +86,7 @@
style="font-size: 30rpx;font-weight: 777;margin-top: 20rpx;margin-bottom: 10rpx;margin-left: 4rpx;">
推荐</view>
<view style="column-count: 2;column-gap: 0;margin-top: 20rpx;">
<view style="column-count: 2;column-gap: 20rpx;margin-top: 20rpx;">
<view class="item-wrap" v-for="(item, i) in dataList" :key="i" v-if="i % 2 == 0"
@click="handleInfo(item)">
......@@ -173,8 +178,16 @@
<image @click="handleBottomClose()"
style="width: 30rpx;height: 30rpx;display: flex;align-items: right;margin: 10rpx;"
src="../../static/index/ic_quit_white.png" mode="aspectFill"></image>
<view @click="handleBottomPlay(newRecordBean)" style="width: 160rpx;height: 50rpx;background-color: red;border-radius:30rpx;color: white;font-size: 24rpx;justify-content: center;
align-items: center;display: flex;padding-bottom: 4rpx;margin-right: 20rpx;">
<view @click="handleBottomPlay(newRecordBean)" style="
width: 160rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
background-color: red;
border-radius:30rpx;
color: white;
font-size: 24rpx;
margin-right: 20rpx;">
继续观看
</view>
</view>
......@@ -272,10 +285,10 @@
this.newRecordBean = data.vedio;
}
}
});
if (this.$refs.paging != null) {
this.$refs.paging.refresh();
});
if (this.$refs.paging != null) {
this.$refs.paging.refresh();
}
},
hide() {
......@@ -358,7 +371,7 @@
}
.item-wrap {
width: 96%;
width: 100%;
border-radius: 10rpx;
background-color: #fff;
break-inside: avoid;
......
......@@ -38,7 +38,8 @@
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/bg_my_vip.png" mode="scaleToFill"></image>
</view>
<view v-if="os === 'android' " style="display: flex;height: 200rpx;margin: 20rpx;background: #f5ca86;border-radius: 20rpx;">
<view v-if="os === 'android' "
style="display: flex;height: 200rpx;margin: 20rpx;background: #f5ca86;border-radius: 20rpx;">
<view style="flex-grow: 2; margin-left: 20rpx;">
<view
style="width: 100%;height: 100%;display: flex;flex-direction: column;justify-content: center;">
......@@ -126,14 +127,16 @@
statusBarHeight: app.globalData.statusBarHeight,
userBean: {},
showAnimate: false,
windowHeight: 0,
os:'android',
versionName: app.globalData.versionName
windowHeight: 0,
os: 'android',
versionName: app.globalData.versionName,
corpid: '', // 企业ID
curl: '', // 客服链接
};
},
methods: {
show() {
this.os=wx.getSystemInfoSync().platform;
show() {
this.os = wx.getSystemInfoSync().platform;
this.windowHeight = uni.getSystemInfoSync().windowHeight
// loadData() {
this.post({
......@@ -170,45 +173,59 @@
navigateTo(`/pagesA/vipPay/vipPay`)
},
handlePhone() {
// 联系我们
// this.post({
// url: '/vedio/customerServiceNumbers',
// showLoading: false,
// success: ({
// data
// }) => {
// let datas = data.customerServiceNumbers.split(',')
// let corpid = datas[0]
// let curl = datas[1]
// wx.openCustomerServiceChat({
// extInfo: {
// url: curl
// },
// corpId: corpid,
// success(res) {},
// fail(e) {
// console.log(e)
// }
// })
if (this.corpid != '' && this.curl != '') {
wx.openCustomerServiceChat({
extInfo: {
url: this.curl
},
corpId: this.corpid,
success(res) {},
fail(e) {
console.log(e)
}
})
} else {
let that = this
// 联系我们
this.post({
url: '/vedio/customerServiceNumbers',
showLoading: false,
success: ({
data
}) => {
let datas = data.customerServiceNumbers.split(',')
that.corpid = datas[0]
that.curl = datas[1]
wx.openCustomerServiceChat({
extInfo: {
url: that.curl
},
corpId: that.corpid,
success(res) {},
fail(e) {
console.log(e)
}
})
}
});
}
// wx.makePhoneCall({
// phoneNumber: '4000969950',
// success: function(res) {
// console.log('拨打电话成功!');
// },
// fail: function(res) {
// console.log('拨打电话失败!');
// }
// });
wx.makePhoneCall({
phoneNumber: '4000969950',
success: function(res) {
console.log('拨打电话成功!');
},
fail: function(res) {
console.log('拨打电话失败!');
}
})
// })
},
paySuccess(largeType) {
// largeType=vip 开通vip
// largeType=point 购买看点
message.notify('支付成功');
paySuccess(largeType) {
// largeType=vip 开通vip
// largeType=point 购买看点
message.notify('支付成功');
this.post({
url: '/user/baseMsg',
showLoading: false,
......
......@@ -8,11 +8,13 @@
style="width:31%; position: relative; border-radius:20rpx;margin-bottom: 10rpx;margin-left: 14rpx;"
@click.stop="click(value)" @longpress.stop="longClick(key)">
<image class="integral-mall-goods" mode="aspectFill" :src="value.coverImage"></image>
<view class="text" style="font-size: 26rpx;color: black;height: 36rpx;">{{value.title}}</view>
<view class="text" style="font-size: 22rpx;color: gray;height: 30rpx;">
<view class="text" style="font-size: 26rpx;color: black;height: 36rpx;margin-left: 5rpx;">
{{value.title}}
</view>
<view class="text" style="font-size: 22rpx;color: gray;height: 30rpx;margin-left: 5rpx;">
{{value.vedioDesc}}
</view>
<view v-if="isEditStyle" @click.stop="cbClick(key)" style="position: absolute;background: #000000; opacity: 0.6;width: 92%;height: 100%;top: 0;border-radius:20rpx;
<view v-if="isEditStyle" @click.stop="cbClick(key)" style="position: absolute;background: #000000; opacity: 0.6;width: 92%;height: 96%;top: 0;border-radius:20rpx;
padding-left: 20rpx;padding-top: 20rpx;">
<image v-if="value.isChecked" src="@/static/ic_selected.png"
style="width: 50rpx;height: 50rpx;" />
......@@ -164,7 +166,6 @@
}
.cb {
margin-top: 10rpx;
margin-left: 10rpx;
// position: absolute;
......
......@@ -7,8 +7,8 @@
<video v-if="Math.abs(displayIndex-index)==0" :id="''+list.vedioId" :controls="controls"
:autoplay="true" :isplay="true" play-btn-position="center" :loop="!isplay" @ended="ended"
@controlstoggle="controlstoggle" :show-fullscreen-btn="false" :poster="list.coverImage"
:show-loading="true" @click="tapVideoHover()" :enable-progress-gesture="false"
:style="'width:100%; height:100%;'" :src="list.recommendUrl" object-fit="cover" />
:show-loading="true" @click="tapVideoHover()" :enable-progress-gesture="false" class="tsvideo"
:src="list.recommendUrl" object-fit="cover" />
</view>
<view v-if="!isqp" class="userInfo flex">
<!-- 点赞 -->
......@@ -296,7 +296,6 @@
<style lang="scss" scoped>
.body {
// background: yellow;
background: #000000;
width: 100%;
height: 100%;
......@@ -345,7 +344,6 @@
z-index: 99;
width: 100%;
position: absolute;
// bottom: 32px;
bottom: 0;
color: #ffffff;
flex-direction: column;
......@@ -397,4 +395,20 @@
font-size: 30rpx;
color: #ffffff;
}
.tsvideo {
width: 100%;
height: 100%;
animation: showDivAni 1s 1;
}
@keyframes showDivAni {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style>
\ No newline at end of file
<template>
<view style="width: 100%;height: 100%;">
<status-title style="position: absolute;" iconColor="white" :showBack="true"></status-title>
<swiper class="swiper" circular @change="swiperChange" :current="current" :vertical="true">
<swiper-item v-for="(list, index) in displaySwiperList" :key="index" :style="'width:100%; height:100%;'">
<status-title style="position: absolute;" iconColor="white" :showBack="true" />
<swiper class="swiper" circular @change="swiperChange" :current="current" :vertical="true" :duration="duration">
<swiper-item v-for="(list, index) in displaySwiperList" :key="index">
<view style="width:100%; height:100%;">
<video v-if="Math.abs(displayIndex-index)==0 && list.vedioUrl" :id="list.vedioIndex" @play="play"
@ended="ended" :controls="controls" :loop="!isplay" :enable-progress-gesture="false"
:show-loading="true" :show-fullscreen-btn="false" @controlstoggle="controlstoggle"
:poster="data.coverImage" @click="tapVides()" @timeupdate="timeupdate"
style="width:100%; height:100%;" :autoplay="!list.lock" :src="list.vedioUrl" class="tsvideo"
play-btn-position="center" object-fit="contain" />
<video v-if="Math.abs(displayIndex-index)==0 && list.vedioUrl" :id="list.vedioIndex" @ended="ended"
:controls="controls" :loop="!isplay" :enable-progress-gesture="false" :show-loading="true"
:show-fullscreen-btn="false" @controlstoggle="controlstoggle" :poster="data.coverImage"
@click="tapVides()" @timeupdate="timeupdate" :autoplay="!list.lock" :src="list.vedioUrl"
class="tsvideo" play-btn-position="center" object-fit="contain" />
<view v-if="!isqp" class="userInfo">
<!-- 点赞 -->
<view class="flex" style="opacity: 0.9; margin-top: 10rpx;">
......@@ -54,7 +53,7 @@
</swiper-item>
</swiper>
<uni-popup type="bottom" ref="select2">
<uni-popup type="bottom" ref="select">
<view
:style="'width: '+ windowWidth +'px; height: 860rpx; background-color: #202020; border-radius:20rpx 20rpx 0 0;'">
<view style="height: 70rpx;display: flex; flex-direction: row;align-items: center;">
......@@ -107,7 +106,8 @@
</swiper>
</view>
</uni-popup>
<coin-popup :show="showCoinPop" :point="data.point" :vedioId="data.vedioId" @close="showCoinPop = false" @paySuccess="paySuccess">
<coin-popup :show="showCoinPop" :point="data.point" :vedioId="data.vedioId" @close="showCoinPop = false"
@paySuccess="paySuccess">
</coin-popup>
</view>
</template>
......@@ -148,15 +148,13 @@
originIndex: 0, // 记录源数据的下标
windowWidth: 0,
windowHeight: 0,
current: 0,
current: 0, // swiper 下标
oid: 0,
isplay: true, //是否自动播放下一个视频
duration: 500,
isqp: false,
mid: 0,
safeArea: 0,
ttuop: 0,
heightxw: 100,
data: {},
isPlayNext: 0,
tabIndex: 0,
......@@ -175,9 +173,6 @@
uni.getSystemInfo({
success: res => {
this.safeArea = res.safeAreaInsets.bottom;
if (this.safeArea > 0) {
this.heightxw = 97
}
}
})
......@@ -250,10 +245,10 @@
}, 500)
},
down() {
this.$refs.select2.close();
this.$refs.select.close();
},
sellxj() {
this.$refs.select2.open('bottom');
this.$refs.select.open('bottom');
this.$nextTick(() => {
this.tabIndex = parseInt(this.originIndex / 30)
// 延迟渲染,否则位置错乱
......@@ -351,7 +346,6 @@
}
});
},
play() {},
ended() {
// 1.播放当前视频结束时触发,自动切换下一个视频
if (this.isplay) {
......@@ -584,7 +578,9 @@
}
.tsvideo {
/* animation:showDivAni 1s 1; */
width: 100%;
height: 100%;
animation: showDivAni 1s 1;
}
@keyframes showDivAni {
......@@ -598,7 +594,7 @@
}
.tsimg {
/* animation:fadenum12 10s 1; */
// animation: fadenum12 10s 1;
}
.contentcd {
......@@ -606,7 +602,6 @@
left: 4%;
width: 92%;
position: absolute;
// bottom: 36px;
bottom: 30rpx;
color: #ffffff;
flex-direction: column;
......
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