语音功能优化,委托销售界面优化 ,支付成功界面显示问题处理,交易大厅bug处理
This commit is contained in:
parent
5885261a60
commit
10e260bbcc
63
App.vue
63
App.vue
@ -22,8 +22,13 @@ import {
|
||||
history
|
||||
} from '@/api/public.js'
|
||||
import Routine from './libs/routine.js';
|
||||
import voice from'./plugin/voice/voice.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
audioTeam: []
|
||||
}
|
||||
},
|
||||
globalData: {
|
||||
spid: 0,
|
||||
code: 0,
|
||||
@ -121,6 +126,8 @@ import {
|
||||
that.getConfigData()
|
||||
|
||||
//#ifdef APP-PLUS
|
||||
|
||||
|
||||
jpushModule.setLoggerEnable(true);
|
||||
jpushModule.initJPushService()
|
||||
jpushModule.addConnectEventListener(result => {
|
||||
@ -152,12 +159,15 @@ import {
|
||||
let extras = result.extras
|
||||
|
||||
console.log("通知", result)
|
||||
// if(result.content=="您有新的订单,请注意查看。"){
|
||||
// console.log("通知", '11111111')
|
||||
// voice.init()
|
||||
// }
|
||||
|
||||
if (result.extras.type == 'ORDER_CREATE') {
|
||||
voice.init()
|
||||
if (this.audioTeam.length > 0) {
|
||||
this.audioTeam.push(result.extras.type);
|
||||
} else {
|
||||
this.audio()
|
||||
this.audioTeam.push(result.extras.type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// 点击事件
|
||||
@ -181,10 +191,6 @@ import {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
// console.log(voice.in)
|
||||
|
||||
// voice.connectSocketGlobal()
|
||||
|
||||
let that = this
|
||||
// 记录H5和公众号
|
||||
if (this.$store.state.app.token) {
|
||||
@ -213,11 +219,43 @@ import {
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 语音播报
|
||||
*
|
||||
*
|
||||
*/
|
||||
async audio() {
|
||||
const innerAudioContext = uni.createInnerAudioContext();
|
||||
innerAudioContext.autoplay = true;
|
||||
innerAudioContext.src = `/static/audio/order.mp3`;
|
||||
innerAudioContext.onPlay(() => {
|
||||
console.log('开始播放')
|
||||
});
|
||||
innerAudioContext.onEnded(() => {
|
||||
console.log('语音播报结束')
|
||||
innerAudioContext.destroy() //销毁
|
||||
if (this.audioTeam.length > 1) {
|
||||
this.audioTeam.splice(0, 1);
|
||||
console.log('队列中');
|
||||
this.audio()
|
||||
} else {
|
||||
console.log('队列为零');
|
||||
this.audioTeam = []
|
||||
}
|
||||
});
|
||||
innerAudioContext.onError(() => {
|
||||
console.log('语音播报失败')
|
||||
innerAudioContext.destroy() // 销毁
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 微信分享;
|
||||
setOpenShare: function(data) {
|
||||
let that = this;
|
||||
let href = location.href;
|
||||
href = href.indexOf("?") === -1 ? href + "?spid=" + this.globalData.uid : href + "&spid=" + this.globalData
|
||||
href = href.indexOf("?") === -1 ? href + "?spid=" + this.globalData.uid : href + "&spid=" + this
|
||||
.globalData
|
||||
.uid;
|
||||
if (that.$wechat.isWeixin()) {
|
||||
let configAppMessage = {
|
||||
@ -226,7 +264,8 @@ import {
|
||||
link: href,
|
||||
imgUrl: data.share_pic
|
||||
};
|
||||
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
|
||||
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
|
||||
configAppMessage);
|
||||
}
|
||||
},
|
||||
// 获取配置
|
||||
|
@ -272,10 +272,9 @@
|
||||
/*点击选中与否*/
|
||||
goodsCheck(item) {
|
||||
this.$set(item, 'check', !item.check);
|
||||
console.log( item.num)
|
||||
if (item.check) {
|
||||
if (this.peicenumber > 0) {
|
||||
item.num = this.peicenumber
|
||||
if (this.peicenumber == 0) {
|
||||
item.num = 1
|
||||
}
|
||||
|
||||
if (!item.product_attr_unique) {
|
||||
@ -408,6 +407,11 @@
|
||||
|
||||
border-top: 2rpx solid #E7E6E4;
|
||||
|
||||
.picTxt_one {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.picTxt_one {
|
||||
display: flex;
|
||||
margin-top: 20rpx;
|
||||
|
@ -217,11 +217,14 @@
|
||||
})
|
||||
},
|
||||
getGoods: function(item) {
|
||||
// console.log(item);
|
||||
|
||||
graphicLstApi(this.where).then(res => {
|
||||
this.cateGoods.push(...res.data.list)
|
||||
if (res.data.list.length < this.where.limit) this.status = 'nomore'
|
||||
if (this.where.page == 1 && res.data.list.length <= 0) this.emptyShow = true
|
||||
|
||||
if(item){
|
||||
|
||||
if (item.index == 1 ) {
|
||||
uni.navigateTo({
|
||||
// #ifdef MP || H5
|
||||
@ -233,6 +236,8 @@
|
||||
// #endif
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
/*获取分类列表*/
|
||||
|
@ -14,20 +14,24 @@
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>支付方式</view>
|
||||
<view v-if="order_pay_info.pay_type==1 || order_pay_info.pay_type==2 || order_pay_info.pay_type==3" class='itemCom'>微信</view>
|
||||
<view v-else-if="order_pay_info.pay_type==4 || order_pay_info.pay_type==5" class='itemCom'>支付宝</view>
|
||||
<view v-if="order_pay_info.pay_type==1 || order_pay_info.pay_type==2 || order_pay_info.pay_type==3"
|
||||
class='itemCom'>微信</view>
|
||||
<view v-else-if="order_pay_info.pay_type==4 || order_pay_info.pay_type==5" class='itemCom'>支付宝
|
||||
</view>
|
||||
<view v-else class='itemCom'>余额</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>支付金额</view>
|
||||
<view class='itemCom'>{{order_pay_info.pay_price}}</view>
|
||||
</view>
|
||||
<view v-if="order_pay_info.give_integral > 0 && order_pay_info.paid" class='item acea-row row-between-wrapper'>
|
||||
<view v-if="order_pay_info.give_integral > 0 && order_pay_info.paid"
|
||||
class='item acea-row row-between-wrapper'>
|
||||
<view>赠送积分</view>
|
||||
<view class='itemCom t-color'>{{order_pay_info.give_integral}}个</view>
|
||||
</view>
|
||||
<!--失败时加上这个 -->
|
||||
<view class='item acea-row row-between-wrapper' v-if="order_pay_info.paid==0 && order_pay_info.pay_type != 'offline' && msg != 'success'">
|
||||
<view class='item acea-row row-between-wrapper'
|
||||
v-if="order_pay_info.paid==0 && order_pay_info.pay_type != 'offline' && msg != 'success'">
|
||||
<view>失败原因</view>
|
||||
<view class='itemCom'>{{order_pay_info.pay_type==0 ? '余额不足':msg}}</view>
|
||||
</view>
|
||||
@ -42,8 +46,10 @@
|
||||
<!-- <view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==2">
|
||||
<button class='returnBnt bg-color' hover-class='none'>重新支付</button>
|
||||
</view> -->
|
||||
<button @click="goPink(order_pay_info.activity_id)" class='returnBnt s-Color' formType="submit" hover-class='none' v-if="order_pay_info.activity_type == 4 && order_pay_info.paid">邀请好友参团</button>
|
||||
<button v-if="!order_pay_info.paid || order_pay_info.activity_type != 4" @click="goIndex" class='returnBnt s-Color' formType="submit" hover-class='none'>返回首页</button>
|
||||
<button @click="goPink(order_pay_info.activity_id)" class='returnBnt s-Color' formType="submit"
|
||||
hover-class='none' v-if="order_pay_info.activity_type == 4 && order_pay_info.paid">邀请好友参团</button>
|
||||
<button v-if="!order_pay_info.paid || order_pay_info.activity_type != 4" @click="goIndex"
|
||||
class='returnBnt s-Color' formType="submit" hover-class='none'>返回首页</button>
|
||||
<view class="coupon-wrapper" v-if="couponList.length>0 && order_pay_info.paid">
|
||||
<view class="hd">
|
||||
<view class="line"></view>
|
||||
@ -53,12 +59,16 @@
|
||||
<view class="coupon-box" :class="{on:isOpen}">
|
||||
<block v-for="(item,index) in couponList" :key="index">
|
||||
<view class="coupon-item flex">
|
||||
<view class="left-bg" :style="{ 'background-image': `url(${domain}/static/diy/couponBg${keyColor}.png)` }"><text>¥</text>{{item.coupon_price}}</view>
|
||||
<view class="left-bg"
|
||||
:style="{ 'background-image': `url(${domain}/static/diy/couponBg${keyColor}.png)` }">
|
||||
<text>¥</text>{{item.coupon_price}}
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="title">{{item.title}}</view>
|
||||
<view class="des">满{{item.use_min_price}}元可用</view>
|
||||
<block v-if="item.coupon_type == 1">
|
||||
<view class="des">有效期:{{ item.use_start_time |timeYMD }}-{{ item.use_end_time |timeYMD}}</view>
|
||||
<view class="des">
|
||||
有效期:{{ item.use_start_time |timeYMD }}-{{ item.use_end_time |timeYMD}}</view>
|
||||
</block>
|
||||
<block v-if="item.coupon_type == 0">
|
||||
<view class="des">领取后{{ item.coupon_time}}天内可用</view>
|
||||
@ -88,11 +98,19 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import {getPayOrder} from '@/api/order.js';
|
||||
import {openOrderSubscribe} from '@/utils/SubscribeMessage.js';
|
||||
import {mapGetters} from "vuex";
|
||||
import {
|
||||
getPayOrder
|
||||
} from '@/api/order.js';
|
||||
import {
|
||||
openOrderSubscribe
|
||||
} from '@/utils/SubscribeMessage.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import authorize from '@/components/Authorize';
|
||||
import { HTTP_REQUEST_URL } from '@/config/app';
|
||||
import {
|
||||
HTTP_REQUEST_URL
|
||||
} from '@/config/app';
|
||||
export default {
|
||||
components: {
|
||||
authorize,
|
||||
@ -121,6 +139,7 @@
|
||||
text: '展开更多',
|
||||
timer: null,
|
||||
product_type: '',
|
||||
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin', 'viewColor', 'keyColor']),
|
||||
@ -146,9 +165,8 @@
|
||||
},
|
||||
methods: {
|
||||
refreshData() {
|
||||
this.timer = setInterval(()=>{
|
||||
|
||||
this.getOrderPayInfo();
|
||||
},1000)
|
||||
},
|
||||
// 优惠券展开
|
||||
bindMore() {
|
||||
@ -203,11 +221,10 @@
|
||||
* 去订单详情页面
|
||||
*/
|
||||
goOrderDetails: function(e) {
|
||||
console.log(this.product_type);
|
||||
let that = this;
|
||||
if (this.product_type == 98) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/users/order_list/index?status=1&product_type=${this.product_type}`
|
||||
url: `/pages/users/order_list/indexCopy?status=1&product_type=${this.product_type}`
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
@ -235,6 +252,7 @@
|
||||
border-radius: 10rpx;
|
||||
padding: 1rpx 0 28rpx 0;
|
||||
}
|
||||
|
||||
.payment-status .icon {
|
||||
font-size: 70rpx;
|
||||
width: 140rpx;
|
||||
@ -246,19 +264,23 @@
|
||||
border: 6rpx solid #f5f5f5;
|
||||
margin: -76rpx auto 0 auto;
|
||||
background-color: #999;
|
||||
|
||||
&.icon-duihao2 {
|
||||
background-color: var(--view-theme);
|
||||
}
|
||||
}
|
||||
|
||||
.payment-status .icon.fail {
|
||||
text-shadow: 0px 4px 0px #7a7a7a;
|
||||
}
|
||||
|
||||
.payment-status .status {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin: 25rpx 0 37rpx 0;
|
||||
}
|
||||
|
||||
.payment-status .wrapper {
|
||||
border: 1px solid #eee;
|
||||
margin: 0 30rpx 47rpx 30rpx;
|
||||
@ -266,16 +288,20 @@
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item {
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item~.item {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item .itemCom {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.payment-status .returnBnt {
|
||||
width: 630rpx;
|
||||
height: 86rpx;
|
||||
@ -285,17 +311,21 @@
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
margin: 0 auto 20rpx auto;
|
||||
|
||||
&.gColor {
|
||||
background-color: var(--view-theme);
|
||||
}
|
||||
|
||||
&.s-Color {
|
||||
color: var(--view-theme);
|
||||
border: 1px solid var(--view-theme);
|
||||
}
|
||||
}
|
||||
|
||||
.t-color {
|
||||
color: var(--view-theme) !important;
|
||||
}
|
||||
|
||||
.coupon-wrapper {
|
||||
.hd {
|
||||
display: flex;
|
||||
@ -304,26 +334,32 @@
|
||||
margin: 30rpx 0;
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
|
||||
.line {
|
||||
width: 70rpx;
|
||||
height: 1px;
|
||||
background: #DCDCDC;
|
||||
}
|
||||
|
||||
.txt {
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-box {
|
||||
height: 356rpx;
|
||||
padding: 0 20rpx;
|
||||
overflow: hidden;
|
||||
|
||||
&.on {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.coupon-item {
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.06);
|
||||
|
||||
.left-bg {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -332,21 +368,25 @@
|
||||
height: 160rpx;
|
||||
color: #fff;
|
||||
font-size: 64rpx;
|
||||
|
||||
text {
|
||||
margin-top: 26rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-left: 20rpx;
|
||||
padding: 20rpx 0;
|
||||
|
||||
.title {
|
||||
color: #282828;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.des {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
@ -354,6 +394,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -361,6 +402,7 @@
|
||||
padding-top: 24rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
|
||||
.iconfont {
|
||||
margin-top: 6rpx;
|
||||
margin-left: 10rpx;
|
||||
|
@ -72,7 +72,7 @@
|
||||
<view class="content_enter-one">
|
||||
类型
|
||||
</view>
|
||||
<view class="content_enter-two" v-if="listobj.is_type==3">
|
||||
<view class="content_enter-two" v-if="listobj.resale_type==1">
|
||||
调货
|
||||
</view>
|
||||
<view class="content_enter-two" v-else>
|
||||
@ -83,7 +83,7 @@
|
||||
</view>
|
||||
|
||||
<view class="content_bootm" v-if='listobj.resale'>
|
||||
<view class="content_bootm_txt">
|
||||
<view class="content_bootm_txt" v-if='listobj.resale.length>0'>
|
||||
查看TA提到的宝贝({{listobj.resale.length}})
|
||||
</view>
|
||||
|
||||
|
@ -582,8 +582,9 @@
|
||||
/*获取选中的宝贝*/
|
||||
getProduct(data) {
|
||||
this.productList=[]
|
||||
this.price = 0
|
||||
this.price = 0;
|
||||
if (data.length > 0) {
|
||||
|
||||
this.productList = data;
|
||||
for (let i in data) {
|
||||
console.log(Number(data[i].num) , Number(data[i].price),(Number(data[i].num) * Number(data[i].price)))
|
||||
|
@ -1027,7 +1027,7 @@
|
||||
use_integral: that.use_integral
|
||||
}).then(res => {
|
||||
// 默认选中
|
||||
console.log(res);
|
||||
that.product_type=res.data.order_type
|
||||
that.is_take = false
|
||||
res.data.order.forEach(el => {
|
||||
if (el.order.isTake == 1) that.is_take = true
|
||||
|
@ -1,125 +0,0 @@
|
||||
/**
|
||||
* Notes: APP语音播报
|
||||
* @author WJD
|
||||
* @version 1.0.0
|
||||
* @Date 2022-01-26
|
||||
*/
|
||||
|
||||
// 是否播放中
|
||||
let isPlaying = false;
|
||||
// 播放列表
|
||||
let currentAudio = ['/static/audio/order.mp3'];
|
||||
// 播放顺序
|
||||
let playIndex = 0
|
||||
// 播放器
|
||||
let audioPlayer = null;
|
||||
// 平台
|
||||
let platform = 'iOS';
|
||||
// 定时器
|
||||
let timer = null;
|
||||
|
||||
|
||||
const voice = {
|
||||
// 创建播放器
|
||||
init: () => {
|
||||
platform = plus.os.name;
|
||||
if (platform == 'Android') {
|
||||
let MediaPlayer = plus.android.importClass("android.media.MediaPlayer");
|
||||
audioPlayer = new MediaPlayer()
|
||||
}
|
||||
if (platform == "iOS") {
|
||||
let AVAudioPlayer = plus.ios.importClass("AVAudioPlayer");
|
||||
audioPlayer = new AVAudioPlayer();
|
||||
}
|
||||
console.log('创建播放器成功');
|
||||
voice.playAudio();
|
||||
},
|
||||
|
||||
// 重置播放列表
|
||||
resetPlayList: () => {
|
||||
playIndex = 0;
|
||||
currentAudio = ['/static/audio/order.mp3'];
|
||||
},
|
||||
clearTimer: () => {
|
||||
if (timer) {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
}
|
||||
|
||||
},
|
||||
// 播放音频
|
||||
playAudio: () => {
|
||||
|
||||
if (isPlaying) {
|
||||
console.log('播放中,请等待...')
|
||||
return false;
|
||||
}
|
||||
if (audioPlayer == null) {
|
||||
console.log('未启动音频播放器');
|
||||
return false;
|
||||
}
|
||||
|
||||
let audioList = currentAudio;
|
||||
// voice.resetPlayList();
|
||||
// if (currentAudio.length == 0) {
|
||||
// const keys = Object.keys(audioList)
|
||||
// console.log(audioList)
|
||||
// if (keys.length) {
|
||||
// currentAudio = Object.values(audioList)[0]
|
||||
// delete audioList[keys[0]]
|
||||
// playIndex = 0
|
||||
// } else {
|
||||
// voice.resetPlayList();
|
||||
// }
|
||||
// }
|
||||
console.log('正在播报:', currentAudio[playIndex]);
|
||||
let path = plus.io.convertLocalFileSystemURL(currentAudio[playIndex]);
|
||||
let currentTime = 0; // 当前流媒体的播放的位置,单位是秒
|
||||
let currentDuration = 0; // 当前文件时长
|
||||
if (platform == 'iOS') {
|
||||
let NSData = plus.ios.importClass("NSData");
|
||||
let AVAudioPlayer = plus.ios.importClass("AVAudioPlayer");
|
||||
let pathFileData = NSData.dataWithContentsOfFile(path);
|
||||
audioPlayer.initWithDataerror(pathFileData, null);
|
||||
// audioPlayer.setNumberOfLoops(-1); //-1:无限循环
|
||||
audioPlayer.prepareToPlay(); //初始化播放器
|
||||
audioPlayer.play();
|
||||
isPlaying = audioPlayer.isPlaying();
|
||||
// 当前播放进度 currentTime 秒
|
||||
} else {
|
||||
let MediaPlayer = plus.android.importClass("android.media.MediaPlayer");
|
||||
audioPlayer.setDataSource(path); //指定音频文件路径
|
||||
// audioPlayer.setLooping(true); //设置为循环播放
|
||||
audioPlayer.prepare(); //初始化播放器MediaPlayer
|
||||
audioPlayer.start();
|
||||
isPlaying = audioPlayer.isPlaying();
|
||||
// 获取音乐的总时长
|
||||
console.log(isPlaying, audioPlayer.getDuration());
|
||||
// 当前播放进度 getCurrentPosition 毫秒
|
||||
}
|
||||
|
||||
timer = setInterval(function() {
|
||||
currentTime = platform == 'iOS' ? audioPlayer.currentTime() : audioPlayer
|
||||
.getCurrentPosition() / 1000;
|
||||
currentDuration = platform == 'iOS' ? audioPlayer.duration() : audioPlayer
|
||||
.getDuration() / 1000;
|
||||
// console.log(currentTime, currentDuration)
|
||||
if (currentTime == currentDuration || currentTime == 0) {
|
||||
isPlaying = false;
|
||||
voice.clearTimer();
|
||||
if (playIndex < currentAudio.length - 1) {
|
||||
playIndex++
|
||||
} else {
|
||||
currentAudio = [];
|
||||
playIndex = 0;
|
||||
}
|
||||
if (Object.keys(audioList).length == 0 && currentAudio.length == 0) {
|
||||
voice.resetPlayList();
|
||||
}
|
||||
// voice.playAudio();
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
|
||||
export default voice
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user