发货+兼容苹果
This commit is contained in:
7
App.vue
7
App.vue
@@ -19,6 +19,11 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
platform:null, // 系统
|
||||
}
|
||||
},
|
||||
onLaunch: function(e) {
|
||||
// 检测自动更新
|
||||
// #ifdef APP-PLUS
|
||||
@@ -143,7 +148,6 @@
|
||||
},
|
||||
onShow: function(e) {
|
||||
|
||||
// console.log(store.state,'playVisible')
|
||||
// #ifdef MP-WEIXIN
|
||||
//获取二维码携带的参数
|
||||
let scene = decodeURIComponent(e.query.scene);
|
||||
@@ -197,7 +201,6 @@
|
||||
console.log('页面销毁')
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -45,7 +45,9 @@ const courtConfig = {
|
||||
}
|
||||
};
|
||||
//手机号验证正则表达式
|
||||
const phoneRegular = /^1\d{10}$/;
|
||||
// const phoneRegular = /^1\d{10}$/;
|
||||
// 手机号码验证 支持港澳台 大陆
|
||||
const phoneRegular = /^[1][3-8]\d{9}$|^([6|9])\d{7}$|^[0][9]\d{8}$|^[6]([8|6])\d{5}$/;
|
||||
//邮箱验证正则表达式
|
||||
const mailRegular = /^\w+@\w+(\.[a-zA-Z]{2,3}){1,2}$/;
|
||||
//密码验证正则表达式
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
"src" : "图片路径"
|
||||
}
|
||||
],
|
||||
"versionName" : "1.2.9",
|
||||
"versionCode" : 129,
|
||||
"versionName" : "1.2.10",
|
||||
"versionCode" : 1210,
|
||||
"app-plus" : {
|
||||
"compatible" : {
|
||||
"ignoreVersion" : true
|
||||
|
||||
@@ -4,14 +4,16 @@
|
||||
<!-- 顶部导航栏 -->
|
||||
<z-nav-bar title="物流详情"></z-nav-bar>
|
||||
</view>
|
||||
<view class="" style="margin-bottom: 20rpx; font-size: 28rpx;">
|
||||
<view class="kuaidiItem">运单号: {{expressOrderSn}}
|
||||
<u-tag @click="copyData(expressOrderSn)" class="copyCode" text="复制" plain type="success" /></view>
|
||||
</view>
|
||||
<view v-if="deliverDetails.length > 0">
|
||||
<!-- <u-tabs active-color="#2979ff" inactive-color="#606266" bar-height="6" bar-width="40"
|
||||
name="name" :list="deliverList" :is-scroll="false" :current="current" @change="tabchange"></u-tabs> -->
|
||||
<view class="deliverCntent">
|
||||
<view class="">
|
||||
|
||||
<view class="kuaidiItem">{{expressCompanyName}} {{expressOrderSn}}
|
||||
<u-tag @click="copyData(expressOrderSn)" class="copyCode" text="复制" plain type="success" /></view>
|
||||
<view v-for="(item, index) in deliverDetails" :class="['item',index == 0 ? 'first':'' ]">
|
||||
<view class="flexbox">
|
||||
<view class="img_icon "></view>
|
||||
@@ -26,8 +28,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="quesheng" v-else>
|
||||
<image src="../../static/icon/kongbai.png" ></image>
|
||||
<text>- 暂无物流信息 -</text>
|
||||
<u-divider text="- 暂无物流信息 -"></u-divider>
|
||||
</view>
|
||||
<music-play :playData="playData"></music-play>
|
||||
<public-module></public-module>
|
||||
@@ -49,26 +50,23 @@
|
||||
playData:{},
|
||||
loading: false,
|
||||
orderId: null,
|
||||
deliverDetails: [{
|
||||
Traces: []
|
||||
}],
|
||||
deliverDetails: [],
|
||||
express:{}, // 面单
|
||||
consignee:{}, // 收件人信息
|
||||
expressOrderSn:'', // 运单号
|
||||
expressCompanyCode:'', //快递编码
|
||||
expressCompanyName:'' ,// 快递公司
|
||||
// expressCompanyCode:'', //快递编码
|
||||
// expressCompanyName:'' ,// 快递公司
|
||||
orderSn : '',
|
||||
current: 0,
|
||||
deliverList: [],
|
||||
deliverDetailsLength: null,
|
||||
orderContet:{},
|
||||
sheetList:[]
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.expressOrderSn = e.expressOrderSn
|
||||
this.expressCompanyCode = e.expressCompanyCode
|
||||
this.expressCompanyName = e.expressCompanyName
|
||||
// this.expressCompanyCode = e.expressCompanyCode
|
||||
// this.expressCompanyName = e.expressCompanyName
|
||||
//this.express = e.express
|
||||
//this.consignee = e.consignee
|
||||
console.log(e,'传入的参数')
|
||||
@@ -122,21 +120,7 @@
|
||||
console.log(this.orderContet,'订单详情')
|
||||
})
|
||||
},
|
||||
// getSheetInfo(){
|
||||
// console.log('查询快递信息')
|
||||
// this.$http
|
||||
// .get(`express/getPrintTemplateList?expressOrderSn=${this.orderSn}`)
|
||||
// .then(res => {
|
||||
// if(res.code == 0){
|
||||
// this.sheetList = res.result.data
|
||||
// console.log(res,'面单信息')
|
||||
// this.getdeliverDetails()
|
||||
// }
|
||||
// }).catch(e => {
|
||||
// console.log('e',e)
|
||||
|
||||
// })
|
||||
// },
|
||||
// 复制到剪切板
|
||||
copyData(data){
|
||||
uni.setClipboardData({
|
||||
@@ -153,29 +137,30 @@
|
||||
// 获取物流
|
||||
getdeliverDetails() {
|
||||
this.deliverList = []
|
||||
var strLength = this.orderContet.consignee.consigneeMobile.length
|
||||
var subMobile = this.orderContet.consignee.consigneeMobile.substring(strLength-4,strLength)
|
||||
// var strLength = this.orderContet.consignee.consigneeMobile.length
|
||||
// var subMobile = this.orderContet.consignee.consigneeMobile.substring(strLength-4,strLength)
|
||||
// this.expressOrderSn = 'SF1504651506851'
|
||||
// this.expressCompanyCode = 'SF'
|
||||
// subMobile = '9277'
|
||||
uni.showLoading()
|
||||
this.$http
|
||||
//.post(`/book/buyOrder/queryFMS?orderId=${this.orderId}`)
|
||||
.get(`/book/buyOrder/queryExpress?expressOrderSn=${this.expressOrderSn}&expressCompanyCode=${this.expressCompanyCode}&customerName=${subMobile}`)
|
||||
.get(`/book/buyOrder/searchExpress?expressOrderSn=${this.expressOrderSn}`)
|
||||
.then(res => {
|
||||
console.log(res, '物流信息')
|
||||
if (res && res.code === 0) {
|
||||
uni.hideLoading()
|
||||
// this.deliverDetails = res.result.traces
|
||||
console.log(res.result.traces,'物流信息')
|
||||
// res.rntStr.forEach((item, index) => {
|
||||
this.deliverDetails = res.result.traces.reverse()
|
||||
// item.Traces = item.Traces.reverse()
|
||||
// //console.log(item)
|
||||
// this.deliverList.push({'name':item.ShipperName})
|
||||
// })
|
||||
console.log(res.express.traces,'物流信息')
|
||||
if(res.express.traces.length > 0){
|
||||
this.deliverDetails = res.express.traces.reverse()
|
||||
}else{
|
||||
this.deliverDetails = []
|
||||
}
|
||||
|
||||
}
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
console.log(e,'e')
|
||||
})
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<z-nav-bar title="订单详情"></z-nav-bar>
|
||||
<view class="adDefault" v-if="consigneeShow">
|
||||
<view class="adDefault" v-if="consigneeShow && orderContet.orderType == 'order'">
|
||||
<view class="defalTop">
|
||||
<text class="userName">
|
||||
{{orderContet.consignee.consigneeName}}
|
||||
@@ -21,7 +21,7 @@
|
||||
</view>
|
||||
|
||||
<view class="orderList" v-if="consigneeShow">
|
||||
<view class="" v-if="sheetList.length > 1" style="background-color: rgb(113, 213, 161); margin-bottom: 20rpx; border-radius: 20rpx; color: #fff; font-size: 28rpx; padding: 10rpx;">
|
||||
<view class="" v-if="sheetList.length > 1 && orderContet.orderStatus==2" style="background-color: rgb(113, 213, 161); margin-bottom: 20rpx; border-radius: 20rpx; color: #fff; font-size: 28rpx; padding: 10rpx;">
|
||||
订单已被拆分成 {{sheetList.length}} 个包裹
|
||||
</view>
|
||||
<view class="orderItem">
|
||||
@@ -74,7 +74,7 @@
|
||||
<span style="color: #666;margin-right: 10rpx;float: left;">商品总价 : </span>
|
||||
<span>¥</span>{{orderContet.orderPrice}}
|
||||
</view>
|
||||
<view class="orderReal">
|
||||
<view class="orderReal" v-if="orderContet.orderType == 'order'"">
|
||||
<span style="color: #666;margin-right: 10rpx;float: left;">运费 : </span>
|
||||
<span>¥</span>{{orderContet.shippingPrice}}
|
||||
</view>
|
||||
@@ -99,17 +99,17 @@
|
||||
<span style="color: #666;margin-right: 10rpx;float: left;">付款时间 : </span>
|
||||
<text style="font-size: 24rpx;color: #666;">{{orderContet.paymentDate}}</text>
|
||||
</view>
|
||||
<view class="orderReal" v-if="orderContet.orderStatus >= 2 && orderContet.orderStatus != 5">
|
||||
<!-- <view class="orderReal" v-if="orderContet.orderStatus >= 2 && orderContet.orderStatus != 5">
|
||||
<span style="color: #666;margin-right: 10rpx;float: left;">发货时间 : </span>
|
||||
<text style="font-size: 24rpx;color: #666;">{{orderContet.shippingTime}}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="orderOper">
|
||||
<view style="width: 100%; text-align: right;">
|
||||
<!-- <u-button text="" type="success" plain ></u-button>
|
||||
<u-button text="" type="primary" plain >
|
||||
|
||||
</u-button> -->
|
||||
<view v-if="orderContet.orderStatus>=2 && sheetList.length > 0 && orderContet.orderStatus != 5" class="opFix" @click="seeExpressDetail(orderContet)">查看物流</view>
|
||||
<view v-if="orderContet.orderStatus==2 && sheetList.length > 0 && orderContet.orderStatus != 5" class="opFix" @click="seeExpressDetail(orderContet)">查看物流</view>
|
||||
<view v-if="orderContet.orderStatus==2" class="opCan" @click="OverOrder" >确认收货</view>
|
||||
|
||||
<view v-if="orderContet.orderStatus==0" class="opFix" @click="canceOrder">取消订单</view>
|
||||
@@ -177,7 +177,10 @@
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item,index) in sheetList" @click="seeExpressDetails(item)">
|
||||
包裹 {{index+1}}
|
||||
<h4 style="margin-bottom: 10rpx;">包裹 {{index+1}}</h4>
|
||||
<view class="">运单号:{{item.expressOrderSn}}
|
||||
<u-tag @click="copyData(item.expressOrderSn)" size="mini" class="copyCode" text="复制单号" plain type="success" /></view>
|
||||
<view class="">发货时间:{{item.createTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -269,6 +272,15 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 复制到剪切板
|
||||
copyData(data){
|
||||
uni.setClipboardData({
|
||||
data,
|
||||
success: function () {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
},
|
||||
seeExpressDetails(item){
|
||||
console.log(item,'item')
|
||||
uni.navigateTo({
|
||||
@@ -516,7 +528,7 @@
|
||||
}else if(this.sheetList.length == 1){
|
||||
// 直接展示详情
|
||||
uni.navigateTo({
|
||||
url: "./deliverDetail?orderSn=" + item.orderSn + "&expressOrderSn=" + this.sheetList[0].expressOrderSn + "&expressCompanyCode="+this.sheetList[0].expressCompanyCode + "&expressCompanyName="+this.sheetList[0].expressCompanyName
|
||||
url: "./deliverDetail?orderSn=" + item.orderSn + "&expressOrderSn=" + this.sheetList[0].expressOrderSn
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -570,9 +582,9 @@
|
||||
.get(`/book/buyOrder/orderDetail?orderSn=${this.orderSn}`)
|
||||
.then(res => {
|
||||
console.log('订单详情',res)
|
||||
var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间
|
||||
var nowSeconds = Math.floor(new Date().getTime() / 1000);
|
||||
res.result.overTime = seconds - nowSeconds
|
||||
// var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间
|
||||
// var nowSeconds = Math.floor(new Date().getTime() / 1000);
|
||||
// res.result.overTime = seconds - nowSeconds
|
||||
|
||||
this.orderContet = res.result
|
||||
this.consigneeShow = true
|
||||
@@ -590,63 +602,15 @@
|
||||
} else if (this.orderContet.orderStatus == 3) {
|
||||
this.titleStat = '已完成'
|
||||
}
|
||||
|
||||
|
||||
if(parseInt(this.orderContet.orderStatus) >= 2){
|
||||
// 查询快递信息
|
||||
// this.getSheetInfo()
|
||||
if(this.orderContet.goodsList.length > 0){
|
||||
this.sheetList = []
|
||||
// console.log('存在商品数据', this.orderContet.goodsList.length)
|
||||
// var ids = []
|
||||
// ids.push(this.orderContet.goodsList[0].expressInfo.expressOrderSn)
|
||||
// this.sheetList.push(this.orderContet.goodsList[0].expressInfo)
|
||||
// for (let index = 1; index < this.orderContet.goodsList.length; index++) {
|
||||
// // if (!ids.includes(this.orderContet.goodsList[index].expressInfo.expressOrder)) {
|
||||
// ids.push(this.orderContet.goodsList[index].expressInfo.expressOrderSn)
|
||||
// this.sheetList.push(this.orderContet.goodsList[index].expressInfo)}
|
||||
// console.log(this.orderContet.goodsList[index].expressInfo.expressOrderSn,'expressOrderSn')
|
||||
// // }
|
||||
// console.log(ids,this.sheetList,'this.sheetList')
|
||||
}
|
||||
if(this.orderContet.orderStatus >= 2 && this.orderContet.orderType == 'order'){
|
||||
this.sheetList = this.orderContet.expressOrders
|
||||
}else{
|
||||
this.sheetList = []
|
||||
}
|
||||
console.log(this.orderContet,'订单详情')
|
||||
})
|
||||
},
|
||||
// getSheetInfo(){
|
||||
// console.log('查询快递信息')
|
||||
// this.$http
|
||||
// .get(`express/getPrintTemplateList?expressOrderSn=${this.orderSn}`)
|
||||
// .then(res => {
|
||||
// if(res.code == 0){
|
||||
// this.sheetList = res.result.data
|
||||
// console.log(res,'面单信息')
|
||||
// }
|
||||
// }).catch(e => {
|
||||
// console.log('e',e)
|
||||
|
||||
// })
|
||||
// },
|
||||
// 获取物流
|
||||
// getdeliverDetails() {
|
||||
// this.$http
|
||||
// .post(`/book/buyOrder/queryFMS?orderId=${this.orderID}`)
|
||||
// .then(res => {
|
||||
// if (res && res.code === 0) {
|
||||
// console.log(res, '物流信息')
|
||||
// // if(res.msg.indexOf('暂未查到物流信息') == -1){
|
||||
// // this.
|
||||
// // }
|
||||
// res.rntStr.forEach(item => {
|
||||
// item.Traces = item.Traces.reverse()
|
||||
// })
|
||||
// this.deliverDetails = res.rntStr
|
||||
// this.deliverDetailsLength = this.deliverDetails[0].Traces.length
|
||||
// } else {
|
||||
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// 取消订单
|
||||
canceOrder() {
|
||||
uni.showModal({
|
||||
@@ -1038,7 +1002,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.copyCode{display: inline-block; margin-left: 20rpx; }
|
||||
.deliverCntent {
|
||||
padding: 32rpx;
|
||||
position: relative;
|
||||
|
||||
@@ -77,8 +77,10 @@
|
||||
style="font-weight: bold; color: #f56c6c;">{{ifex.realMoney}}</text>
|
||||
</view>
|
||||
<view class="orderOper" v-if="ifex.orderStatus==0">
|
||||
<view class="opFix" @click.stop="canceOrder(ifex)">取消订单</view>
|
||||
<view class="opCan" @click="goPay(ifex)">去支付</view>
|
||||
<view class="opFix" @click.stop = "canceOrder(ifex)">取消订单</view>
|
||||
<view class="opCan" @click.stop = "getNewIap" v-if="ifex.orderType == 'point' && ifex.paymentMethod == '3'">重新下单</view>
|
||||
<view class="opCan" v-else @click.stop = "goPay(ifex)">去支付</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="status==0" style="text-align: center;">
|
||||
@@ -151,7 +153,7 @@
|
||||
},
|
||||
onShow() {
|
||||
this.getOrderList()
|
||||
this.checkIapOrders() //检查未完成的苹果支付订单
|
||||
// this.checkIapOrders() //检查未完成的苹果支付订单
|
||||
this.getOS()
|
||||
// this.countDown()
|
||||
|
||||
@@ -185,6 +187,12 @@
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['setUserInfo']),
|
||||
// 苹果用户重新下单
|
||||
getNewIap(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/peanut/reCharge'
|
||||
})
|
||||
},
|
||||
// 倒计时回调
|
||||
countDown() {
|
||||
console.log('重新刷新订单')
|
||||
@@ -459,7 +467,7 @@
|
||||
}, function(e) {
|
||||
if (e.errCode == 2) {
|
||||
// 用户未绑定支付方式,app内支付流程结束,系统弹出框引导用户绑定支付方式,此过程将跳转到系统应用 AppStore 进行绑定支付方式,绑定成功同步支付成功,用户成功付款
|
||||
plus.runtime.openURL("https://apps.apple.com/account/billing");
|
||||
// plus.runtime.openURL("https://apps.apple.com/account/billing");
|
||||
} else {
|
||||
// restoreFlag = false; // 支付失败清楚标记
|
||||
that.finishTransaction(result);
|
||||
|
||||
@@ -321,7 +321,7 @@
|
||||
},
|
||||
// 页面加载完毕
|
||||
onReady() {
|
||||
this.requestIapOrder()
|
||||
// this.requestIapOrder()
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
@@ -329,8 +329,9 @@
|
||||
this.tjProList = []
|
||||
this.getData()
|
||||
this.getTags()
|
||||
// this.requestIapOrder()
|
||||
uni.stopPullDownRefresh()
|
||||
this.requestIapOrder()
|
||||
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loadingNow = true
|
||||
@@ -476,17 +477,7 @@
|
||||
that.ComplateRequestArr = results
|
||||
console.log(that.ComplateRequestArr,'未完成订单数组')
|
||||
if(results && results.length>0){
|
||||
// for(var j = 0; j<results.length; j++){
|
||||
// if(results[j].transactionState == '1'){
|
||||
// // 已经支付,但是没有走逻辑的内购订单
|
||||
// that.iapCheck(results[j])
|
||||
// // that.iapCheck(repciptData)
|
||||
// }else{
|
||||
// // 其他状态的内购订单 直接关闭
|
||||
// that.finishTransaction(results[j])
|
||||
|
||||
// }
|
||||
// }
|
||||
results.map((item,index)=>{
|
||||
// "0"为正在支付;"1"为支付成功;"2"为支付失败;"3"为支付已恢复。
|
||||
if(item.transactionState == '1'){
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
优惠券
|
||||
</view>
|
||||
<!-- <b class="chong_btn" @click="onPageJump('../sdkDemo/pay')">充 值</b> -->
|
||||
<b class="chong_btn" @click="onPageJump('./reCharge')">充 值</b>
|
||||
<b class="chong_btn" v-if="platform != 'ios'" @click="onPageJump('./reCharge')">充 值</b>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -133,13 +133,18 @@
|
||||
signContent: '是否要退出登录?',
|
||||
playData:{},
|
||||
isAndorid:true,
|
||||
platform : null, // 设备系统
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
// #ifdef APP-PLUS
|
||||
this.getOS()
|
||||
this.platform = uni.getSystemInfoSync().platform
|
||||
// console.log('操纵系统',this.platform)
|
||||
// #endif
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo'])
|
||||
|
||||
@@ -266,6 +266,7 @@
|
||||
// 支付成功,result 为 IAP商品交易信息对象 IAPTransaction 需将返回的支付凭证传给后端进行二次认证
|
||||
that.iapCheck(result)
|
||||
}, function(e) {
|
||||
console.log('错误回调', e)
|
||||
if(e.errCode == 2){
|
||||
// 用户未绑定支付方式,app内支付流程结束,系统弹出框引导用户绑定支付方式,此过程将跳转到系统应用 AppStore 进行绑定支付方式,绑定成功同步支付成功,用户成功付款
|
||||
plus.runtime.openURL("https://apps.apple.com/account/billing");
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view class="mainContent">
|
||||
<view class="title">{{talkBookDetail.title}}</view>
|
||||
<view class="voices" v-if="talkBookDetail.voices != '' && audioShow">
|
||||
<audio style="text-align: left; overflow: hidden;" :src="talkBookDetail.voices"
|
||||
<audio style="text-align: left; overflow: hidden;" :src="talkBookDetail.voices" @play="audioPlay"
|
||||
poster="../../static/icon/home_icon_0.png" :name="talkBookDetail.title"
|
||||
:author="bookInfo.author.authorName" :action="audioAction" controls></audio>
|
||||
</view>
|
||||
@@ -85,6 +85,11 @@
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['setUserInfo']),
|
||||
audioPlay(){
|
||||
console.log('播放讲书',this.$music)
|
||||
this.$music.setCloseBgm() // 关闭听书音频
|
||||
this.setUserInfo({'playFlag': false})
|
||||
},
|
||||
// 购买
|
||||
gotoBuy() {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
<view class="AC_mes">
|
||||
<view style="font-size: 50rpx;font-weight: bold;">{{userMes.peanutCoin}}</view>
|
||||
<view style="color: #888;font-size: 30rpx;margin-top: 10rpx;">天医币</view>
|
||||
<text class="AC_chong" @click="buPoint()">充值</text>
|
||||
|
||||
<text v-if="platform != 'ios'" class="AC_chong" @click="buPoint()">充值</text>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="AC_con">
|
||||
@@ -112,6 +114,7 @@
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
platform:null,
|
||||
tab_list: [{
|
||||
name: '天医币',
|
||||
}, {
|
||||
@@ -148,7 +151,6 @@
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
// 返回顶部
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
@@ -181,6 +183,10 @@
|
||||
onLoad(e) {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
// #ifdef APP-PLUS
|
||||
this.platform = uni.getSystemInfoSync().platform
|
||||
console.log('操纵系统',this.platform)
|
||||
// #endif
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo'])
|
||||
|
||||
Binary file not shown.
@@ -28,7 +28,6 @@ var music = {
|
||||
if(mute){
|
||||
bgm.pause()
|
||||
}else{
|
||||
|
||||
// bgm.src = bgm.musicList[bgm.playIndex].url
|
||||
// 判断播放列表是否空
|
||||
if(bgm.musicList.length == 0){
|
||||
@@ -50,11 +49,21 @@ var music = {
|
||||
// 没有就添加添加url到播放器,播放新的
|
||||
if(bgm.src == ''){
|
||||
console.log(bgm.playIndex,'播放的索引',store.state.userInfo.playIndex,'播放的时长',store.state.userInfo.playTimes)
|
||||
store.commit('setUserInfo',{'playTitle': bgm.musicList[bgm.playIndex].chapterName})
|
||||
store.commit('setUserInfo',{'playTitle': bgm.musicList[bgm.playIndex].chapter})
|
||||
store.commit('setUserInfo',{'fengImg': bgm.musicList[bgm.playIndex].bookImage})
|
||||
store.commit('setUserInfo',{'playingInfo': bgm.musicList[bgm.playIndex]})
|
||||
console.log(store.state.userInfo,'chapterName',bgm.playIndex)
|
||||
store.state.userInfo.playTimes ? bgm.htimes = store.state.userInfo.playTimes : ''
|
||||
|
||||
// 设置默认原生播放组件的显示标题和图片
|
||||
// bgm.title = bgm.musicList[bgm.playIndex].chapter
|
||||
bgm.title = '正在播放'
|
||||
console.log('应该显示的title',bgm.musicList[bgm.playIndex].chapter)
|
||||
// bgm.artist = '暂无'
|
||||
//bgm.singer = '暂无'
|
||||
bgm.coverImgUrl = 'https://www.nuttyreading.com/images/logo.png'
|
||||
bgm.image = 'https://www.nuttyreading.com/images/logo.png'
|
||||
|
||||
this.getChartUrl()
|
||||
// 获取历史秒数
|
||||
|
||||
@@ -64,6 +73,7 @@ var music = {
|
||||
}
|
||||
bgm.onPause(()=>{
|
||||
console.log('暂停背景音乐');
|
||||
bgm.title = '未在播放'
|
||||
this.saveTimes()
|
||||
clearInterval(bgm.interval)
|
||||
bgm.interval = null
|
||||
@@ -124,6 +134,12 @@ var music = {
|
||||
this.saveRate(bgm.musicList[bgm.playIndex])
|
||||
// console.log('历史播放进度,秒数', bgm.htimes)
|
||||
bgm.seek(bgm.htimes)
|
||||
bgm.title = '正在播放'
|
||||
console.log('应该显示的title', bgm.musicList[bgm.playIndex].chapter)
|
||||
bgm.artist = '暂无'
|
||||
//bgm.singer = '暂无'
|
||||
bgm.coverImgUrl = 'https://www.nuttyreading.com/images/logo.png'
|
||||
bgm.image = 'https://www.nuttyreading.com/images/logo.png'
|
||||
// console.log(bgm,'bgm')
|
||||
})
|
||||
bgm.onEnded(() => {
|
||||
@@ -133,6 +149,22 @@ var music = {
|
||||
store.commit('setUserInfo',{'playFlag': false})
|
||||
this.setPlayIndex('next') // 下一首
|
||||
})
|
||||
bgm.onPrev(() => {
|
||||
console.log('点了上一曲')
|
||||
if(bgm.playIndex - 1 >= 0){
|
||||
this.setPlayIndex('prve') // 上一首
|
||||
}else{
|
||||
console.log('没有上一首了')
|
||||
}
|
||||
})
|
||||
bgm.onNext(() => {
|
||||
console.log('点了下一曲')
|
||||
if(bgm.playIndex + 1 <= bgm.musicList.length){
|
||||
this.setPlayIndex('next') // 下一首
|
||||
}else{
|
||||
console.log('没有下一首了,到头了')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 添加播放列表
|
||||
setList(list,op,playindex,time){
|
||||
@@ -151,6 +183,7 @@ var music = {
|
||||
if(playindex){
|
||||
bgm.playIndex = playindex
|
||||
console.log(playindex,'传值了')
|
||||
|
||||
if(time){ // 如果传了历史播放秒数
|
||||
bgm.htimes = time
|
||||
}else{
|
||||
@@ -162,6 +195,8 @@ var music = {
|
||||
bgm.htimes = 0
|
||||
bgm.playIndex = 0
|
||||
}
|
||||
|
||||
|
||||
if(op == 'autoPlay'){
|
||||
store.commit('setUserInfo',{'playTimes': 0})
|
||||
if(bgm._options.src == ''){
|
||||
@@ -363,6 +398,7 @@ var music = {
|
||||
bgm.playIndex += 1
|
||||
console.log('下一首',bgm.playIndex,bgm.oldIndex, store.state.userInfo.playIndex)
|
||||
// bgm.stop()
|
||||
bgm.htimes = 0
|
||||
this.getChartUrl() // 获取章节url
|
||||
//this.playBgm({'mute':false})
|
||||
// store.commit('setUserInfo',{'playFlag': false})
|
||||
@@ -378,6 +414,7 @@ var music = {
|
||||
bgm.oldIndex = bgm.playIndex
|
||||
bgm.playIndex -= 1
|
||||
console.log('上一首',bgm.playIndex)
|
||||
bgm.htimes = 0
|
||||
this.getChartUrl() // 获取章节url
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user