语音功能优化,委托销售界面优化 ,支付成功界面显示问题处理,交易大厅bug处理

This commit is contained in:
jia 2023-08-17 17:58:28 +08:00
parent 5885261a60
commit 10e260bbcc
9 changed files with 535 additions and 569 deletions

767
App.vue
View File

@ -1,385 +1,424 @@
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
// #ifdef APP-PLUS
let jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
import {
checkLogin
} from "./libs/login";
import {
HTTP_REQUEST_URL
} from './config/app';
import {
getconfig,
history
} from '@/api/public.js'
import Routine from './libs/routine.js';
import voice from'./plugin/voice/voice.js'
export default {
globalData: {
spid: 0,
code: 0,
isLogin: false,
userInfo: {},
MyMenus: [],
balance_func_status: 0, //
recharge_switch: 0, //
store_user_min_recharge: 0, //
yue_pay_status: 0, //
alipay_open: 0, //
routine_logo: '', //logo
share_pic: '',
site_logo: '',
site_name: '', //
fid: '', //id
uid: '',
hide_mer_status: 0,
member_status: 0,
copy_command_status: 0, //
arrival_notice: 0, //
is_phone_login: 0,
auto_arrival: 0,
mer_location: 0,
statusBarHeight: 0,
mer_location: 0,
store_street_theme: 1,
sys_intention_agree: '',
copyright_status: '',
copyright_context: '',
copyright_image: '',
open_update_info: 0,
recommend_switch: 0,
svip_switch_status: 0,
community_reply_status: 0,
community_reply_auth: 0,
margin_ico_switch: 0,
margin_ico: '',
community_app_switch: [],
navigation: {},
imgColor: '',
...uni.getStorageSync('GLOBAL_DATA') || {}
},
onLaunch: function(option) {
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
this.globalData.uid = this.$store.state.app.uid
let that = this;
// #ifdef MP
if (HTTP_REQUEST_URL == '') {
console.error(
"请配置根目录下的config.js文件中的 'HTTP_REQUEST_URL'\n\n请修改开发者工具中【详情】->【AppID】改为自己的Appid\n\n请前往后台【小程序】->【小程序配置】填写自己的 appId and AppSecret"
);
return false;
}
if (option.query.hasOwnProperty('scene')) {
switch (option.scene) {
//
case 1047:
// console.log(option, 'val')
let val = that.$util.getUrlParams(decodeURIComponent(option.query.scene));
that.globalData.code = val;
that.globalData.uid = val
break;
//
case 1048:
that.globalData.code = option.query.scene;
break;
//
case 1049:
that.globalData.code = option.query.scene;
break;
//
case 1001:
that.globalData.spid = option.query.scene;
break;
}
}
// #endif
//
uni.getSystemInfo({
success: function(res) {
that.globalData.navHeight = res.statusBarHeight * (750 / res.windowWidth) + 91;
}
});
// #ifdef MP
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
that.globalData.navH = menuButtonInfo.top * 2 + menuButtonInfo.height / 2;
const version = uni.getSystemInfoSync().SDKVersion
if (Routine.compareVersion(version, '2.21.2') >= 0) {
that.$Cache.set('MP_VERSION_ISNEW', true)
} else {
that.$Cache.set('MP_VERSION_ISNEW', false)
}
// #endif
that.getConfigData()
//#ifdef APP-PLUS
jpushModule.setLoggerEnable(true);
jpushModule.initJPushService()
jpushModule.addConnectEventListener(result=>{
let connectEnable = result.connectEnable
// console.log("jpush", connectEnable)
})
//
// jpushModule.setAlias({
// 'alias': uni.getStorageSync('userId'),
// 'sequence': 1
// })
//
// jpushModule.addTagAliasListener(result => {
// let code = result.code
// let sequence = result.sequence
// let tags = result.tags
// let tag = result.tag
// let tagEnable = result.tagEnable
// let alias = result.alias
// console.log(alias, '')
// })
//
jpushModule.addNotificationListener(result => {
let notificationEventType = result.notificationEventType
let messageID = result.messageID
let title = result.title
let content = result.content
let extras = result.extras
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
// #ifdef APP-PLUS
let jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
import {
checkLogin
} from "./libs/login";
import {
HTTP_REQUEST_URL
} from './config/app';
import {
getconfig,
history
} from '@/api/public.js'
import Routine from './libs/routine.js';
console.log("通知", result)
// if(result.content==""){
// console.log("", '11111111')
// voice.init()
// }
if(result.extras.type=='ORDER_CREATE'){
voice.init()
export default {
data() {
return {
audioTeam: []
}
},
globalData: {
spid: 0,
code: 0,
isLogin: false,
userInfo: {},
MyMenus: [],
balance_func_status: 0, //
recharge_switch: 0, //
store_user_min_recharge: 0, //
yue_pay_status: 0, //
alipay_open: 0, //
routine_logo: '', //logo
share_pic: '',
site_logo: '',
site_name: '', //
fid: '', //id
uid: '',
hide_mer_status: 0,
member_status: 0,
copy_command_status: 0, //
arrival_notice: 0, //
is_phone_login: 0,
auto_arrival: 0,
mer_location: 0,
statusBarHeight: 0,
mer_location: 0,
store_street_theme: 1,
sys_intention_agree: '',
copyright_status: '',
copyright_context: '',
copyright_image: '',
open_update_info: 0,
recommend_switch: 0,
svip_switch_status: 0,
community_reply_status: 0,
community_reply_auth: 0,
margin_ico_switch: 0,
margin_ico: '',
community_app_switch: [],
navigation: {},
imgColor: '',
...uni.getStorageSync('GLOBAL_DATA') || {}
},
onLaunch: function(option) {
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
this.globalData.uid = this.$store.state.app.uid
let that = this;
// #ifdef MP
if (HTTP_REQUEST_URL == '') {
console.error(
"请配置根目录下的config.js文件中的 'HTTP_REQUEST_URL'\n\n请修改开发者工具中【详情】->【AppID】改为自己的Appid\n\n请前往后台【小程序】->【小程序配置】填写自己的 appId and AppSecret"
);
return false;
}
if (option.query.hasOwnProperty('scene')) {
switch (option.scene) {
//
case 1047:
// console.log(option, 'val')
let val = that.$util.getUrlParams(decodeURIComponent(option.query.scene));
that.globalData.code = val;
that.globalData.uid = val
break;
//
case 1048:
that.globalData.code = option.query.scene;
break;
//
case 1049:
that.globalData.code = option.query.scene;
break;
//
case 1001:
that.globalData.spid = option.query.scene;
break;
}
//
if (notificationEventType == 'notificationOpened') {
uni.navigateTo({
url: result.extras.route
})
}
})
// jpushModule.addCustomMessageListener(result => {
// let messageID = result.messageID
// let content = result.content
// let extras = result.extras
// console.log("", result)
// })
//#endif
}
// #endif
//
uni.getSystemInfo({
success: function(res) {
that.globalData.navHeight = res.statusBarHeight * (750 / res.windowWidth) + 91;
}
});
// #ifdef MP
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
that.globalData.navH = menuButtonInfo.top * 2 + menuButtonInfo.height / 2;
const version = uni.getSystemInfoSync().SDKVersion
if (Routine.compareVersion(version, '2.21.2') >= 0) {
that.$Cache.set('MP_VERSION_ISNEW', true)
} else {
that.$Cache.set('MP_VERSION_ISNEW', false)
}
// #endif
that.getConfigData()
},
onShow() {
// console.log(voice.in)
// voice.connectSocketGlobal()
let that = this
// H5
if (this.$store.state.app.token) {
//
// #ifdef H5
history({
page: location.pathname + location.search,
}).then(() => {});
//#endif
};
// #ifndef H5
setTimeout(() => {
if (that.globalData.copy_command_status == 1) {
uni.getClipboardData({
success: function(res) {
if (/^(\/@[1-9]{1}).*\*\//.test(res.data)) {
that.$store.commit("PARSE_PWD", res.data)
}
},
fail: function(res) {
//
}
})
}
}, 1500)
// #endif
},
methods: {
//
setOpenShare: function(data) {
let that = this;
let href = location.href;
href = href.indexOf("?") === -1 ? href + "?spid=" + this.globalData.uid : href + "&spid=" + this.globalData
.uid;
if (that.$wechat.isWeixin()) {
let configAppMessage = {
desc: data.share_info,
title: data.share_title,
link: href,
imgUrl: data.share_pic
};
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
}
},
//
getConfigData() {
getconfig().then(res => {
uni.$emit('update', res.data)
this.$store.commit('GLOBAL_DATA', res.data);
this.globalData.balance_func_status = res.data.balance_func_status
this.globalData.recharge_switch = res.data.recharge_switch
this.globalData.routine_logo = res.data.routine_logo
this.globalData.share_pic = res.data.share_pic
this.globalData.community_reply_status = res.data.community_reply_status
this.globalData.site_logo = res.data.site_logo
this.globalData.login_logo = res.data.login_logo
this.globalData.site_name = res.data.site_name
this.globalData.store_user_min_recharge = res.data.store_user_min_recharge
this.globalData.yue_pay_status = res.data.yue_pay_status
this.globalData.sys_intention_agree = res.data.sys_intention_agree
this.globalData.mer_intention_open = res.data.mer_intention_open
this.globalData.alipay_open = res.data.alipay_open
this.globalData.hide_mer_status = res.data.hide_mer_status
this.globalData.mer_location = res.data.mer_location
this.globalData.arrival_notice = res.data.procudt_increase_status
this.globalData.auto_arrival = res.data.sys_extension_type
this.globalData.member_status = res.data.member_status
this.globalData.copy_command_status = res.data.copy_command_status
this.globalData.is_phone_login = res.data.is_phone_login
this.globalData.mer_location = res.data.mer_location
this.globalData.store_street_theme = res.data.store_street_theme
this.globalData.copyright_status = res.data.copyright_status
this.globalData.copyright_image = res.data.copyright_image
this.globalData.copyright_context = res.data.copyright_context
this.globalData.open_update_info = res.data.open_update_info
this.globalData.recommend_switch = res.data.recommend_switch
this.globalData.svip_switch_status = res.data.svip_switch_status
this.globalData.navigation = res.data.navigation
this.globalData.community_app_switch = res.data.community_app_switch
this.globalData.community_reply_auth = res.data.community_reply_auth
this.globalData.margin_ico_switch = res.data.margin_ico_switch
this.globalData.margin_ico = res.data.margin_ico
this.$store.commit("VIEW_COLOR", res.data.global_theme.theme)
this.$store.commit("KEY_COLOR", '_' + res.data.global_theme.type)
try {
uni.setStorageSync('SUBSCRIBE_MESSAGE', res.data.tempid);
} catch (e) {
// error
}
// #ifdef H5
this.setOpenShare(res.data);
// #endif
}).catch(err => {});
}
},
onHide: function() {
//console.log('App Hide')
},
watch: {
// H5
$route(n) {
if (this.$store.state.app.token) {
//
history({
page: location.pathname + location.search,
}).then(() => {});
}
},
}
}
//#ifdef APP-PLUS
jpushModule.setLoggerEnable(true);
jpushModule.initJPushService()
jpushModule.addConnectEventListener(result => {
let connectEnable = result.connectEnable
// console.log("jpush", connectEnable)
})
//
// jpushModule.setAlias({
// 'alias': uni.getStorageSync('userId'),
// 'sequence': 1
// })
//
// jpushModule.addTagAliasListener(result => {
// let code = result.code
// let sequence = result.sequence
// let tags = result.tags
// let tag = result.tag
// let tagEnable = result.tagEnable
// let alias = result.alias
// console.log(alias, '')
// })
//
jpushModule.addNotificationListener(result => {
let notificationEventType = result.notificationEventType
let messageID = result.messageID
let title = result.title
let content = result.content
let extras = result.extras
console.log("通知", result)
if (result.extras.type == 'ORDER_CREATE') {
if (this.audioTeam.length > 0) {
this.audioTeam.push(result.extras.type);
} else {
this.audio()
this.audioTeam.push(result.extras.type);
}
}
//
if (notificationEventType == 'notificationOpened') {
uni.navigateTo({
url: result.extras.route
})
}
})
// jpushModule.addCustomMessageListener(result => {
// let messageID = result.messageID
// let content = result.content
// let extras = result.extras
// console.log("", result)
// })
//#endif
},
onShow() {
let that = this
// H5
if (this.$store.state.app.token) {
//
// #ifdef H5
history({
page: location.pathname + location.search,
}).then(() => {});
//#endif
};
// #ifndef H5
setTimeout(() => {
if (that.globalData.copy_command_status == 1) {
uni.getClipboardData({
success: function(res) {
if (/^(\/@[1-9]{1}).*\*\//.test(res.data)) {
that.$store.commit("PARSE_PWD", res.data)
}
},
fail: function(res) {
//
}
})
}
}, 1500)
// #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
.uid;
if (that.$wechat.isWeixin()) {
let configAppMessage = {
desc: data.share_info,
title: data.share_title,
link: href,
imgUrl: data.share_pic
};
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
configAppMessage);
}
},
//
getConfigData() {
getconfig().then(res => {
uni.$emit('update', res.data)
this.$store.commit('GLOBAL_DATA', res.data);
this.globalData.balance_func_status = res.data.balance_func_status
this.globalData.recharge_switch = res.data.recharge_switch
this.globalData.routine_logo = res.data.routine_logo
this.globalData.share_pic = res.data.share_pic
this.globalData.community_reply_status = res.data.community_reply_status
this.globalData.site_logo = res.data.site_logo
this.globalData.login_logo = res.data.login_logo
this.globalData.site_name = res.data.site_name
this.globalData.store_user_min_recharge = res.data.store_user_min_recharge
this.globalData.yue_pay_status = res.data.yue_pay_status
this.globalData.sys_intention_agree = res.data.sys_intention_agree
this.globalData.mer_intention_open = res.data.mer_intention_open
this.globalData.alipay_open = res.data.alipay_open
this.globalData.hide_mer_status = res.data.hide_mer_status
this.globalData.mer_location = res.data.mer_location
this.globalData.arrival_notice = res.data.procudt_increase_status
this.globalData.auto_arrival = res.data.sys_extension_type
this.globalData.member_status = res.data.member_status
this.globalData.copy_command_status = res.data.copy_command_status
this.globalData.is_phone_login = res.data.is_phone_login
this.globalData.mer_location = res.data.mer_location
this.globalData.store_street_theme = res.data.store_street_theme
this.globalData.copyright_status = res.data.copyright_status
this.globalData.copyright_image = res.data.copyright_image
this.globalData.copyright_context = res.data.copyright_context
this.globalData.open_update_info = res.data.open_update_info
this.globalData.recommend_switch = res.data.recommend_switch
this.globalData.svip_switch_status = res.data.svip_switch_status
this.globalData.navigation = res.data.navigation
this.globalData.community_app_switch = res.data.community_app_switch
this.globalData.community_reply_auth = res.data.community_reply_auth
this.globalData.margin_ico_switch = res.data.margin_ico_switch
this.globalData.margin_ico = res.data.margin_ico
this.$store.commit("VIEW_COLOR", res.data.global_theme.theme)
this.$store.commit("KEY_COLOR", '_' + res.data.global_theme.type)
try {
uni.setStorageSync('SUBSCRIBE_MESSAGE', res.data.tempid);
} catch (e) {
// error
}
// #ifdef H5
this.setOpenShare(res.data);
// #endif
}).catch(err => {});
}
},
onHide: function() {
//console.log('App Hide')
},
watch: {
// H5
$route(n) {
if (this.$store.state.app.token) {
//
history({
page: location.pathname + location.search,
}).then(() => {});
}
},
}
}
</script>
<style lang="scss">
/* #ifndef APP-PLUS-NVUE || APP-NVUE */
@import "@/plugin/animate/animate.min.css";
@import 'static/css/base.css';
@import 'static/iconfont/iconfont.css';
@import 'static/iconfont/iconlihai.css';
@import 'static/iconfont/icontan.css';
@import 'static/css/style.scss';
/* #ifndef APP-PLUS-NVUE || APP-NVUE */
@import "@/plugin/animate/animate.min.css";
@import 'static/css/base.css';
@import 'static/iconfont/iconfont.css';
@import 'static/iconfont/iconlihai.css';
@import 'static/iconfont/icontan.css';
@import 'static/css/style.scss';
view {
box-sizing: border-box;
}
view {
box-sizing: border-box;
}
.custom_style {
color: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 24rpx;
.custom_style {
color: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 24rpx;
&_icon {
background-image: url('static/tabbar_icon/d.png');
background-repeat: no-repeat;
background-size: cover;
font-size: 80rpx;
width: 100rpx;
height: 100rpx;
border-radius: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-top: -40rpx;
// box-shadow: 0px 5px 10px 1px rgba(32, 161, 98, 0.3);
}
}
&_icon {
background-image: url('static/tabbar_icon/d.png');
background-repeat: no-repeat;
background-size: cover;
font-size: 80rpx;
width: 100rpx;
height: 100rpx;
border-radius: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-top: -40rpx;
// box-shadow: 0px 5px 10px 1px rgba(32, 161, 98, 0.3);
}
}
.bg-color-red {
background-color: #e93323 !important;
}
.bg-color-red {
background-color: #e93323 !important;
}
.syspadding {
padding-top: var(--status-bar-height);
}
.syspadding {
padding-top: var(--status-bar-height);
}
.flex {
display: flex;
}
.flex {
display: flex;
}
.uni-scroll-view::-webkit-scrollbar {
/* 隐藏滚动条,但依旧具备可以滚动的功能 */
display: none
}
.uni-scroll-view::-webkit-scrollbar {
/* 隐藏滚动条,但依旧具备可以滚动的功能 */
display: none
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
::-moz-scrollbar {
width: 0;
height: 0;
color: transparent;
}
::-moz-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.empty-txt {
line-height: 100rpx;
font-size: 22rpx;
color: #999;
text-align: center;
}
.empty-txt {
line-height: 100rpx;
font-size: 22rpx;
color: #999;
text-align: center;
}
.product-con .conter img {
display: block;
}
.product-con .conter img {
display: block;
}
.open-location {
height: 100vh;
}
.open-location {
height: 100vh;
}
uni-tabbar {
bottom: 0;
}
uni-tabbar {
bottom: 0;
}
/*#endif*/
/*#endif*/
</style>

View File

@ -38,7 +38,7 @@
:range="item.attrValue" :range-key="'sku'">
<view class="uni-input">{{item.attrValue[index].sku}}</view>
</picker>
<view class="" style="margin-top: 10rpx;">
库存:{{item.attrValue[index].stock}}
</view>
@ -272,12 +272,11 @@
/*点击选中与否*/
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) {
item.product_attr_unique = item.attrValue[0].unique
}
@ -405,17 +404,22 @@
position: relative;
align-items: center;
justify-content: space-between;
border-top: 2rpx solid #E7E6E4;
.picTxt_one {
white-space: nowrap;
overflow: hidden;
}
.picTxt_one {
display: flex;
margin-top: 20rpx;
.slecte {
margin-right: 30rpx;
width: 280rpx;
width: 280rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
@ -427,7 +431,7 @@
border-radius: 10rpx 10rpx 10rpx 10rpx;
white-space: nowrap;
overflow: hidden;
}
}

View File

@ -217,22 +217,27 @@
})
},
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.index == 1) {
uni.navigateTo({
// #ifdef MP || H5
url: '/pages/short_video/nvueSwiper/index?id=' + this.cateGoods[0]
.community_id
// #endif
// #ifdef APP
url: `/pages/short_video/appSwiper/index?id=${this.cateGoods[0].community_id}`
// #endif
})
if(item){
if (item.index == 1 ) {
uni.navigateTo({
// #ifdef MP || H5
url: '/pages/short_video/nvueSwiper/index?id=' + this.cateGoods[0]
.community_id
// #endif
// #ifdef APP
url: `/pages/short_video/appSwiper/index?id=${this.cateGoods[0].community_id}`
// #endif
})
}
}
})
},
/*获取分类列表*/

View File

@ -2,7 +2,7 @@
<view :style="viewColor">
<view class='payment-status'>
<!--失败时 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-->
<view class='iconfont icon-duihao2 icon' v-if ="order_pay_info.paid !=0"></view>
<view class='iconfont icon-duihao2 icon' v-if="order_pay_info.paid !=0"></view>
<view class='iconfont icon-iconfontguanbi icon' v-else></view>
<!-- 失败时订单支付失败 -->
<view class='status'>{{order_pay_info.paid == 1 ?'支付成功':'订单未支付'}}</view>
@ -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,22 +98,30 @@
// +----------------------------------------------------------------------
// | 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,
},
filters: {
timeYMD: function (value) {
if(value){
var newDate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(value)
timeYMD: function(value) {
if (value) {
var newDate = /\d{4}-\d{1,2}-\d{1,2}/g.exec(value)
return newDate[0]
}
}
}
},
data() {
return {
@ -115,15 +133,16 @@
isShowAuth: false, //
status: 0,
msg: '',
couponList:[], //
isOpen:false ,//
couponList: [], //
isOpen: false, //
moneyBg: '/static/images/couponBg',
text: '展开更多',
timer: null,
product_type:'',
product_type: '',
};
},
computed: mapGetters(['isLogin','viewColor','keyColor']),
computed: mapGetters(['isLogin', 'viewColor', 'keyColor']),
onLoad: function(options) {
if (!options.order_id) return this.$util.Tips({
title: '缺少参数无法查看订单支付状态'
@ -135,23 +154,22 @@
this.order_type = options.order_type;
this.status = options.status || 0;
this.msg = options.msg || '';
this.product_type=options.product_type
this.product_type = options.product_type
if (this.isLogin) {
this.refreshData();
} else {
this.isAuto = true;
this.isShowAuth = true
}
console.log(options);
}
console.log(options);
},
methods: {
refreshData(){
this.timer = setInterval(()=>{
this.getOrderPayInfo();
},1000)
refreshData() {
this.getOrderPayInfo();
},
//
bindMore(){
bindMore() {
this.isOpen = !this.isOpen
this.text = this.text == '展开更多' ? '收起' : '展开更多';
},
@ -161,7 +179,7 @@
},
//
authColse: function(e) {
this.isShowAuth = e;
this.isShowAuth = e;
},
/**
*
@ -176,7 +194,7 @@
uni.setNavigationBarTitle({
title: res.data.paid == 1 ? '支付成功' : '支付失败'
});
if(res.data.paid == 1){
if (res.data.paid == 1) {
clearInterval(this.timer);
this.timer = null;
}
@ -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{
&.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,46 +311,56 @@
text-align: center;
line-height: 86rpx;
margin: 0 auto 20rpx auto;
&.gColor{
&.gColor {
background-color: var(--view-theme);
}
&.s-Color{
&.s-Color {
color: var(--view-theme);
border: 1px solid var(--view-theme);
border: 1px solid var(--view-theme);
}
}
.t-color {
color: var(--view-theme)!important;
color: var(--view-theme) !important;
}
.coupon-wrapper{
.hd{
.coupon-wrapper {
.hd {
display: flex;
align-items: center;
justify-content: center;
margin: 30rpx 0;
color: #999999;
font-size: 24rpx;
.line{
.line {
width: 70rpx;
height: 1px;
background: #DCDCDC;
}
.txt{
.txt {
margin: 0 20rpx;
}
}
.coupon-box{
.coupon-box {
height: 356rpx;
padding: 0 20rpx;
overflow: hidden;
&.on{
&.on {
height: auto;
}
.coupon-item{
.coupon-item {
width: 100%;
margin-bottom: 20rpx;
box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.06);
.left-bg{
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.06);
.left-bg {
display: flex;
align-items: center;
justify-content: center;
@ -332,40 +368,46 @@
height: 160rpx;
color: #fff;
font-size: 64rpx;
text{
text {
margin-top: 26rpx;
font-size: 36rpx;
}
}
.info{
.info {
display: flex;
flex-direction: column;
justify-content: space-between;
margin-left: 20rpx;
padding: 20rpx 0;
.title{
.title {
color: #282828;
font-size: 30rpx;
}
.des{
.des {
font-size: 24rpx;
color: #999999;
}
}
}
}
.more{
.more {
display: flex;
align-items: center;
justify-content: center;
padding-top: 24rpx;
font-size: 24rpx;
color: #999999;
.iconfont{
.iconfont {
margin-top: 6rpx;
margin-left: 10rpx;
font-size: 20rpx;
}
}
}
</style>
</style>

View File

@ -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>

View File

@ -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)))

View File

@ -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

View File

@ -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.