语音功能优化,委托销售界面优化 ,支付成功界面显示问题处理,交易大厅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> <script>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | CRMEB [ CRMEB ] // | CRMEB [ CRMEB ]
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB // | Licensed CRMEBCRMEB
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// #ifdef APP-PLUS // #ifdef APP-PLUS
let jpushModule = uni.requireNativePlugin("JG-JPush"); let jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif // #endif
import { import {
checkLogin checkLogin
} from "./libs/login"; } from "./libs/login";
import { import {
HTTP_REQUEST_URL HTTP_REQUEST_URL
} from './config/app'; } from './config/app';
import { import {
getconfig, getconfig,
history history
} from '@/api/public.js' } from '@/api/public.js'
import Routine from './libs/routine.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
console.log("通知", result) export default {
// if(result.content==""){ data() {
// console.log("", '11111111') return {
// voice.init() audioTeam: []
// } }
if(result.extras.type=='ORDER_CREATE'){ },
voice.init() 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') { // #endif
uni.navigateTo({ //
url: result.extras.route uni.getSystemInfo({
}) success: function(res) {
} that.globalData.navHeight = res.statusBarHeight * (750 / res.windowWidth) + 91;
}) }
});
// jpushModule.addCustomMessageListener(result => { // #ifdef MP
// let messageID = result.messageID let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
// let content = result.content that.globalData.navH = menuButtonInfo.top * 2 + menuButtonInfo.height / 2;
// let extras = result.extras const version = uni.getSystemInfoSync().SDKVersion
// console.log("", result) if (Routine.compareVersion(version, '2.21.2') >= 0) {
// }) that.$Cache.set('MP_VERSION_ISNEW', true)
//#endif } else {
that.$Cache.set('MP_VERSION_ISNEW', false)
}
// #endif
that.getConfigData()
}, //#ifdef APP-PLUS
onShow() {
// console.log(voice.in)
jpushModule.setLoggerEnable(true);
// voice.connectSocketGlobal() jpushModule.initJPushService()
jpushModule.addConnectEventListener(result => {
let that = this let connectEnable = result.connectEnable
// H5 // console.log("jpush", connectEnable)
if (this.$store.state.app.token) { })
//
// #ifdef H5 //
history({ // jpushModule.setAlias({
page: location.pathname + location.search, // 'alias': uni.getStorageSync('userId'),
}).then(() => {}); // 'sequence': 1
//#endif // })
}; //
// #ifndef H5 // jpushModule.addTagAliasListener(result => {
setTimeout(() => { // let code = result.code
if (that.globalData.copy_command_status == 1) { // let sequence = result.sequence
uni.getClipboardData({ // let tags = result.tags
success: function(res) { // let tag = result.tag
if (/^(\/@[1-9]{1}).*\*\//.test(res.data)) { // let tagEnable = result.tagEnable
that.$store.commit("PARSE_PWD", res.data) // let alias = result.alias
} // console.log(alias, '')
}, // })
fail: function(res) { //
// jpushModule.addNotificationListener(result => {
} let notificationEventType = result.notificationEventType
}) let messageID = result.messageID
} let title = result.title
}, 1500) let content = result.content
// #endif let extras = result.extras
},
methods: { console.log("通知", result)
//
setOpenShare: function(data) { if (result.extras.type == 'ORDER_CREATE') {
let that = this; if (this.audioTeam.length > 0) {
let href = location.href; this.audioTeam.push(result.extras.type);
href = href.indexOf("?") === -1 ? href + "?spid=" + this.globalData.uid : href + "&spid=" + this.globalData } else {
.uid; this.audio()
if (that.$wechat.isWeixin()) { this.audioTeam.push(result.extras.type);
let configAppMessage = { }
desc: data.share_info,
title: data.share_title,
link: href, }
imgUrl: data.share_pic //
}; if (notificationEventType == 'notificationOpened') {
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage); uni.navigateTo({
} url: result.extras.route
}, })
// }
getConfigData() { })
getconfig().then(res => {
uni.$emit('update', res.data) // jpushModule.addCustomMessageListener(result => {
this.$store.commit('GLOBAL_DATA', res.data); // let messageID = result.messageID
this.globalData.balance_func_status = res.data.balance_func_status // let content = result.content
this.globalData.recharge_switch = res.data.recharge_switch // let extras = result.extras
this.globalData.routine_logo = res.data.routine_logo // console.log("", result)
this.globalData.share_pic = res.data.share_pic // })
this.globalData.community_reply_status = res.data.community_reply_status //#endif
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 onShow() {
this.globalData.mer_intention_open = res.data.mer_intention_open let that = this
this.globalData.alipay_open = res.data.alipay_open // H5
this.globalData.hide_mer_status = res.data.hide_mer_status if (this.$store.state.app.token) {
this.globalData.mer_location = res.data.mer_location //
this.globalData.arrival_notice = res.data.procudt_increase_status // #ifdef H5
this.globalData.auto_arrival = res.data.sys_extension_type history({
this.globalData.member_status = res.data.member_status page: location.pathname + location.search,
this.globalData.copy_command_status = res.data.copy_command_status }).then(() => {});
this.globalData.is_phone_login = res.data.is_phone_login //#endif
this.globalData.mer_location = res.data.mer_location };
this.globalData.store_street_theme = res.data.store_street_theme // #ifndef H5
this.globalData.copyright_status = res.data.copyright_status setTimeout(() => {
this.globalData.copyright_image = res.data.copyright_image if (that.globalData.copy_command_status == 1) {
this.globalData.copyright_context = res.data.copyright_context uni.getClipboardData({
this.globalData.open_update_info = res.data.open_update_info success: function(res) {
this.globalData.recommend_switch = res.data.recommend_switch if (/^(\/@[1-9]{1}).*\*\//.test(res.data)) {
this.globalData.svip_switch_status = res.data.svip_switch_status that.$store.commit("PARSE_PWD", res.data)
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 fail: function(res) {
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 { }, 1500)
uni.setStorageSync('SUBSCRIBE_MESSAGE', res.data.tempid); // #endif
} catch (e) { },
// error methods: {
} /**
// #ifdef H5 * 语音播报
this.setOpenShare(res.data); *
// #endif *
}).catch(err => {}); */
} async audio() {
}, const innerAudioContext = uni.createInnerAudioContext();
onHide: function() { innerAudioContext.autoplay = true;
//console.log('App Hide') innerAudioContext.src = `/static/audio/order.mp3`;
}, innerAudioContext.onPlay(() => {
watch: { console.log('开始播放')
// H5 });
$route(n) { innerAudioContext.onEnded(() => {
if (this.$store.state.app.token) { console.log('语音播报结束')
// innerAudioContext.destroy() //
history({ if (this.audioTeam.length > 1) {
page: location.pathname + location.search, this.audioTeam.splice(0, 1);
}).then(() => {}); 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> </script>
<style lang="scss"> <style lang="scss">
/* #ifndef APP-PLUS-NVUE || APP-NVUE */ /* #ifndef APP-PLUS-NVUE || APP-NVUE */
@import "@/plugin/animate/animate.min.css"; @import "@/plugin/animate/animate.min.css";
@import 'static/css/base.css'; @import 'static/css/base.css';
@import 'static/iconfont/iconfont.css'; @import 'static/iconfont/iconfont.css';
@import 'static/iconfont/iconlihai.css'; @import 'static/iconfont/iconlihai.css';
@import 'static/iconfont/icontan.css'; @import 'static/iconfont/icontan.css';
@import 'static/css/style.scss'; @import 'static/css/style.scss';
view { view {
box-sizing: border-box; box-sizing: border-box;
} }
.custom_style { .custom_style {
color: #fff; color: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 24rpx; font-size: 24rpx;
&_icon { &_icon {
background-image: url('static/tabbar_icon/d.png'); background-image: url('static/tabbar_icon/d.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
font-size: 80rpx; font-size: 80rpx;
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
border-radius: 100%; border-radius: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-top: -40rpx; margin-top: -40rpx;
// box-shadow: 0px 5px 10px 1px rgba(32, 161, 98, 0.3); // box-shadow: 0px 5px 10px 1px rgba(32, 161, 98, 0.3);
} }
} }
.bg-color-red { .bg-color-red {
background-color: #e93323 !important; background-color: #e93323 !important;
} }
.syspadding { .syspadding {
padding-top: var(--status-bar-height); padding-top: var(--status-bar-height);
} }
.flex { .flex {
display: flex; display: flex;
} }
.uni-scroll-view::-webkit-scrollbar { .uni-scroll-view::-webkit-scrollbar {
/* 隐藏滚动条,但依旧具备可以滚动的功能 */ /* 隐藏滚动条,但依旧具备可以滚动的功能 */
display: none display: none
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 0; width: 0;
height: 0; height: 0;
color: transparent; color: transparent;
} }
::-moz-scrollbar { ::-moz-scrollbar {
width: 0; width: 0;
height: 0; height: 0;
color: transparent; color: transparent;
} }
.empty-txt { .empty-txt {
line-height: 100rpx; line-height: 100rpx;
font-size: 22rpx; font-size: 22rpx;
color: #999; color: #999;
text-align: center; text-align: center;
} }
.product-con .conter img { .product-con .conter img {
display: block; display: block;
} }
.open-location { .open-location {
height: 100vh; height: 100vh;
} }
uni-tabbar { uni-tabbar {
bottom: 0; bottom: 0;
} }
/*#endif*/ /*#endif*/
</style> </style>

View File

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

View File

@ -217,22 +217,27 @@
}) })
}, },
getGoods: function(item) { getGoods: function(item) {
// console.log(item);
graphicLstApi(this.where).then(res => { graphicLstApi(this.where).then(res => {
this.cateGoods.push(...res.data.list) this.cateGoods.push(...res.data.list)
if (res.data.list.length < this.where.limit) this.status = 'nomore' 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 (this.where.page == 1 && res.data.list.length <= 0) this.emptyShow = true
if (item.index == 1) {
uni.navigateTo({ if(item){
// #ifdef MP || H5
url: '/pages/short_video/nvueSwiper/index?id=' + this.cateGoods[0] if (item.index == 1 ) {
.community_id uni.navigateTo({
// #endif // #ifdef MP || H5
// #ifdef APP url: '/pages/short_video/nvueSwiper/index?id=' + this.cateGoods[0]
url: `/pages/short_video/appSwiper/index?id=${this.cateGoods[0].community_id}` .community_id
// #endif // #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 :style="viewColor">
<view class='payment-status'> <view class='payment-status'>
<!--失败时 用icon-iconfontguanbi fail替换icon-duihao2 bg-color--> <!--失败时 用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='iconfont icon-iconfontguanbi icon' v-else></view>
<!-- 失败时订单支付失败 --> <!-- 失败时订单支付失败 -->
<view class='status'>{{order_pay_info.paid == 1 ?'支付成功':'订单未支付'}}</view> <view class='status'>{{order_pay_info.paid == 1 ?'支付成功':'订单未支付'}}</view>
@ -14,20 +14,24 @@
</view> </view>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view>支付方式</view> <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-if="order_pay_info.pay_type==1 || order_pay_info.pay_type==2 || order_pay_info.pay_type==3"
<view v-else-if="order_pay_info.pay_type==4 || order_pay_info.pay_type==5" class='itemCom'>支付宝</view> 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 v-else class='itemCom'>余额</view>
</view> </view>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view>支付金额</view> <view>支付金额</view>
<view class='itemCom'>{{order_pay_info.pay_price}}</view> <view class='itemCom'>{{order_pay_info.pay_price}}</view>
</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>赠送积分</view>
<view class='itemCom t-color'>{{order_pay_info.give_integral}}</view> <view class='itemCom t-color'>{{order_pay_info.give_integral}}</view>
</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>失败原因</view>
<view class='itemCom'>{{order_pay_info.pay_type==0 ? '余额不足':msg}}</view> <view class='itemCom'>{{order_pay_info.pay_type==0 ? '余额不足':msg}}</view>
</view> </view>
@ -42,8 +46,10 @@
<!-- <view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==2"> <!-- <view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==2">
<button class='returnBnt bg-color' hover-class='none'>重新支付</button> <button class='returnBnt bg-color' hover-class='none'>重新支付</button>
</view> --> </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 @click="goPink(order_pay_info.activity_id)" class='returnBnt s-Color' formType="submit"
<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> 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="coupon-wrapper" v-if="couponList.length>0 && order_pay_info.paid">
<view class="hd"> <view class="hd">
<view class="line"></view> <view class="line"></view>
@ -53,12 +59,16 @@
<view class="coupon-box" :class="{on:isOpen}"> <view class="coupon-box" :class="{on:isOpen}">
<block v-for="(item,index) in couponList" :key="index"> <block v-for="(item,index) in couponList" :key="index">
<view class="coupon-item flex"> <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="info">
<view class="title">{{item.title}}</view> <view class="title">{{item.title}}</view>
<view class="des">{{item.use_min_price}}元可用</view> <view class="des">{{item.use_min_price}}元可用</view>
<block v-if="item.coupon_type == 1"> <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>
<block v-if="item.coupon_type == 0"> <block v-if="item.coupon_type == 0">
<view class="des">领取后{{ item.coupon_time}}天内可用</view> <view class="des">领取后{{ item.coupon_time}}天内可用</view>
@ -88,22 +98,30 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import {getPayOrder} from '@/api/order.js'; import {
import {openOrderSubscribe} from '@/utils/SubscribeMessage.js'; getPayOrder
import {mapGetters} from "vuex"; } from '@/api/order.js';
import {
openOrderSubscribe
} from '@/utils/SubscribeMessage.js';
import {
mapGetters
} from "vuex";
import authorize from '@/components/Authorize'; import authorize from '@/components/Authorize';
import { HTTP_REQUEST_URL } from '@/config/app'; import {
HTTP_REQUEST_URL
} from '@/config/app';
export default { export default {
components: { components: {
authorize, authorize,
}, },
filters: { filters: {
timeYMD: function (value) { timeYMD: function(value) {
if(value){ if (value) {
var newDate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(value) var newDate = /\d{4}-\d{1,2}-\d{1,2}/g.exec(value)
return newDate[0] return newDate[0]
} }
} }
}, },
data() { data() {
return { return {
@ -115,15 +133,16 @@
isShowAuth: false, // isShowAuth: false, //
status: 0, status: 0,
msg: '', msg: '',
couponList:[], // couponList: [], //
isOpen:false ,// isOpen: false, //
moneyBg: '/static/images/couponBg', moneyBg: '/static/images/couponBg',
text: '展开更多', text: '展开更多',
timer: null, timer: null,
product_type:'', product_type: '',
}; };
}, },
computed: mapGetters(['isLogin','viewColor','keyColor']), computed: mapGetters(['isLogin', 'viewColor', 'keyColor']),
onLoad: function(options) { onLoad: function(options) {
if (!options.order_id) return this.$util.Tips({ if (!options.order_id) return this.$util.Tips({
title: '缺少参数无法查看订单支付状态' title: '缺少参数无法查看订单支付状态'
@ -135,23 +154,22 @@
this.order_type = options.order_type; this.order_type = options.order_type;
this.status = options.status || 0; this.status = options.status || 0;
this.msg = options.msg || ''; this.msg = options.msg || '';
this.product_type=options.product_type this.product_type = options.product_type
if (this.isLogin) { if (this.isLogin) {
this.refreshData(); this.refreshData();
} else { } else {
this.isAuto = true; this.isAuto = true;
this.isShowAuth = true this.isShowAuth = true
} }
console.log(options); console.log(options);
}, },
methods: { methods: {
refreshData(){ refreshData() {
this.timer = setInterval(()=>{
this.getOrderPayInfo(); this.getOrderPayInfo();
},1000)
}, },
// //
bindMore(){ bindMore() {
this.isOpen = !this.isOpen this.isOpen = !this.isOpen
this.text = this.text == '展开更多' ? '收起' : '展开更多'; this.text = this.text == '展开更多' ? '收起' : '展开更多';
}, },
@ -161,7 +179,7 @@
}, },
// //
authColse: function(e) { authColse: function(e) {
this.isShowAuth = e; this.isShowAuth = e;
}, },
/** /**
* *
@ -176,7 +194,7 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.data.paid == 1 ? '支付成功' : '支付失败' title: res.data.paid == 1 ? '支付成功' : '支付失败'
}); });
if(res.data.paid == 1){ if (res.data.paid == 1) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
} }
@ -203,11 +221,10 @@
* 去订单详情页面 * 去订单详情页面
*/ */
goOrderDetails: function(e) { goOrderDetails: function(e) {
console.log(this.product_type);
let that = this; let that = this;
if (this.product_type == 98) { if (this.product_type == 98) {
uni.navigateTo({ 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 { } else {
uni.navigateTo({ uni.navigateTo({
@ -235,6 +252,7 @@
border-radius: 10rpx; border-radius: 10rpx;
padding: 1rpx 0 28rpx 0; padding: 1rpx 0 28rpx 0;
} }
.payment-status .icon { .payment-status .icon {
font-size: 70rpx; font-size: 70rpx;
width: 140rpx; width: 140rpx;
@ -246,19 +264,23 @@
border: 6rpx solid #f5f5f5; border: 6rpx solid #f5f5f5;
margin: -76rpx auto 0 auto; margin: -76rpx auto 0 auto;
background-color: #999; background-color: #999;
&.icon-duihao2{
&.icon-duihao2 {
background-color: var(--view-theme); background-color: var(--view-theme);
} }
} }
.payment-status .icon.fail { .payment-status .icon.fail {
text-shadow: 0px 4px 0px #7a7a7a; text-shadow: 0px 4px 0px #7a7a7a;
} }
.payment-status .status { .payment-status .status {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
margin: 25rpx 0 37rpx 0; margin: 25rpx 0 37rpx 0;
} }
.payment-status .wrapper { .payment-status .wrapper {
border: 1px solid #eee; border: 1px solid #eee;
margin: 0 30rpx 47rpx 30rpx; margin: 0 30rpx 47rpx 30rpx;
@ -266,16 +288,20 @@
border-left: 0; border-left: 0;
border-right: 0; border-right: 0;
} }
.payment-status .wrapper .item { .payment-status .wrapper .item {
font-size: 28rpx; font-size: 28rpx;
color: #282828; color: #282828;
} }
.payment-status .wrapper .item~.item { .payment-status .wrapper .item~.item {
margin-top: 20rpx; margin-top: 20rpx;
} }
.payment-status .wrapper .item .itemCom { .payment-status .wrapper .item .itemCom {
color: #666; color: #666;
} }
.payment-status .returnBnt { .payment-status .returnBnt {
width: 630rpx; width: 630rpx;
height: 86rpx; height: 86rpx;
@ -285,46 +311,56 @@
text-align: center; text-align: center;
line-height: 86rpx; line-height: 86rpx;
margin: 0 auto 20rpx auto; margin: 0 auto 20rpx auto;
&.gColor{
&.gColor {
background-color: var(--view-theme); background-color: var(--view-theme);
} }
&.s-Color{
&.s-Color {
color: var(--view-theme); color: var(--view-theme);
border: 1px solid var(--view-theme); border: 1px solid var(--view-theme);
} }
} }
.t-color { .t-color {
color: var(--view-theme)!important; color: var(--view-theme) !important;
} }
.coupon-wrapper{
.hd{ .coupon-wrapper {
.hd {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin: 30rpx 0; margin: 30rpx 0;
color: #999999; color: #999999;
font-size: 24rpx; font-size: 24rpx;
.line{
.line {
width: 70rpx; width: 70rpx;
height: 1px; height: 1px;
background: #DCDCDC; background: #DCDCDC;
} }
.txt{
.txt {
margin: 0 20rpx; margin: 0 20rpx;
} }
} }
.coupon-box{
.coupon-box {
height: 356rpx; height: 356rpx;
padding: 0 20rpx; padding: 0 20rpx;
overflow: hidden; overflow: hidden;
&.on{
&.on {
height: auto; height: auto;
} }
.coupon-item{
.coupon-item {
width: 100%; width: 100%;
margin-bottom: 20rpx; margin-bottom: 20rpx;
box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.06); box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.06);
.left-bg{
.left-bg {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -332,40 +368,46 @@
height: 160rpx; height: 160rpx;
color: #fff; color: #fff;
font-size: 64rpx; font-size: 64rpx;
text{
text {
margin-top: 26rpx; margin-top: 26rpx;
font-size: 36rpx; font-size: 36rpx;
} }
} }
.info{
.info {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
margin-left: 20rpx; margin-left: 20rpx;
padding: 20rpx 0; padding: 20rpx 0;
.title{
.title {
color: #282828; color: #282828;
font-size: 30rpx; font-size: 30rpx;
} }
.des{
.des {
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
} }
} }
} }
} }
.more{
.more {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding-top: 24rpx; padding-top: 24rpx;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
.iconfont{
.iconfont {
margin-top: 6rpx; margin-top: 6rpx;
margin-left: 10rpx; margin-left: 10rpx;
font-size: 20rpx; font-size: 20rpx;
} }
} }
} }
</style> </style>

View File

@ -72,7 +72,7 @@
<view class="content_enter-one"> <view class="content_enter-one">
类型 类型
</view> </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>
<view class="content_enter-two" v-else> <view class="content_enter-two" v-else>
@ -83,7 +83,7 @@
</view> </view>
<view class="content_bootm" v-if='listobj.resale'> <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}}) 查看TA提到的宝贝({{listobj.resale.length}})
</view> </view>

View File

@ -582,8 +582,9 @@
/*获取选中的宝贝*/ /*获取选中的宝贝*/
getProduct(data) { getProduct(data) {
this.productList=[] this.productList=[]
this.price = 0 this.price = 0;
if (data.length > 0) { if (data.length > 0) {
this.productList = data; this.productList = data;
for (let i in data) { for (let i in data) {
console.log(Number(data[i].num) , Number(data[i].price),(Number(data[i].num) * Number(data[i].price))) 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 use_integral: that.use_integral
}).then(res => { }).then(res => {
// //
console.log(res); that.product_type=res.data.order_type
that.is_take = false that.is_take = false
res.data.order.forEach(el => { res.data.order.forEach(el => {
if (el.order.isTake == 1) that.is_take = true 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.