页面完善

This commit is contained in:
@fawn-nine
2023-06-02 18:06:08 +08:00
parent 27f08527e8
commit 1e145aa4b0
5 changed files with 98 additions and 52 deletions

View File

@@ -8,10 +8,9 @@
<view class="deliverCntent">
<view class="" v-for="(list, index1) in deliverDetails" :key="index1">
<view v-show="index1 == current">
<view class="kuaidiItem">{{list.ShipperName}}{{list.LogisticCode}}</view>
<view class="kuaidiItem">{{list.ShipperName}} {{list.LogisticCode}} <u-tag @click="copyData(list.LogisticCode)" class="copyCode" text="复制" plain type="success" /></view>
<view class="item" v-for="(item, index) in list.Traces">
<view class="flexbox">
<view class="img_icon "></view>
<view class="wuliu">
<view class="time">{{item.AcceptTime}}</view>
@@ -43,9 +42,7 @@
Traces: []
}],
current: 0,
deliverList: [{
name: null
}],
deliverList: [],
deliverDetailsLength: null
}
},
@@ -59,12 +56,22 @@
...mapState(['userInfo']),
},
methods: {
// 复制到剪切板
copyData(data){
uni.setClipboardData({
data,
success: function () {
console.log('success');
}
});
},
tabchange(item) {
console.log(item)
this.current = item.index
},
// 获取物流
getdeliverDetails() {
this.deliverList = []
uni.showLoading()
this.$http
.post(`/book/buyorder/queryFMS?orderId=${this.orderId}`)
@@ -73,12 +80,12 @@
if (res && res.code === 0) {
uni.hideLoading()
this.deliverDetails = res.rntStr
//console.log(res.rntStr)
// console.log(res.rntStr,'物流信息')
res.rntStr.forEach((item, index) => {
item.Traces = item.Traces.reverse()
// console.log(item)
this.deliverList[index].name = item.ShipperName
})
//console.log(item)
this.deliverList.push({'name':item.ShipperName})
})
}
})
},
@@ -94,6 +101,7 @@
}
</style>
<style lang="scss" scoped>
.copyCode{display: inline-block; margin-left: 20rpx; }
.u-tabs {
background: #fff
}
@@ -122,7 +130,7 @@
background-color: #fff;
margin-bottom: 20rpx;
border-top: 1px solid #eee;
font-size: 24rpx;
font-size: 28rpx;
color:#777;
.item {
padding-left: 10px;
@@ -143,7 +151,7 @@
.time {
color: #888;
font-size: 14px;
font-size: 28rpx;
margin-bottom: 5px
}

View File

@@ -3,7 +3,7 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar :title="titleStat"></z-nav-bar>
<view class="deliverCntent" v-if="orderType == 2">
<!-- <view class="deliverCntent" v-if="orderType == 2">
<view v-if="deliverDetails">
<view v-for="(item, index) in deliverDetails[0].Traces">
<view class="flexbox" v-if="index == 0">
@@ -14,9 +14,8 @@
</view>
</view>
</view>
</view>
<view class="flexbox moreBtnF" @click="onPageJump(orderID)"><span class="moreBtn"> > </span></view>
</view>
</view>
</view> -->
<view class="adDefault" v-if="orderContet.products!=''">
<view class="defalTop">
<text class="userName">
@@ -90,8 +89,15 @@
<text style="font-size: 24rpx;color: #666;">{{orderContet.createTime}}</text>
</view>
<view class="orderOper">
<view class="opFix opShou" @click="OverOrder" v-if="orderContet.orderStatus==2">确认收货</view>
<view v-if="orderContet.orderStatus==0">
<view v-if="orderContet.orderStatus==2" style="width: 100%; text-align: right;">
<!-- <u-button text="" type="success" plain ></u-button>
<u-button text="" type="primary" plain >
</u-button> -->
<view class="opFix" @click="onPageJump(orderID)">查看物流</view>
<view class="opCan" @click="OverOrder" >确认收货</view>
</view>
<view v-if="orderContet.orderStatus==0" style="width: 100%; text-align: right;">
<view class="opFix" @click="canceOrder">取消订单</view>
<view class="opCan" @click="goPay">去支付</view>
</view>
@@ -192,9 +198,9 @@
} else if (this.orderContet.orderStatus == 3) {
this.titleStat = '已完成'
}
if (this.orderType == 2) {
this.getdeliverDetails()
}
// if (this.orderType == 2) {
// this.getdeliverDetails()
// }
})
},
// 获取物流
@@ -202,9 +208,11 @@
this.$http
.post(`/book/buyorder/queryFMS?orderId=${this.orderID}`)
.then(res => {
console.log(res,'物流信息')
if (res && res.code === 0) {
// console.log(res, '物流信息')
console.log(res, '物流信息')
// if(res.msg.indexOf('暂未查到物流信息') == -1){
// this.
// }
res.rntStr.forEach(item => {
item.Traces = item.Traces.reverse()
})

View File

@@ -106,11 +106,13 @@ import {
iapChannel:{},
checking:false, // 正在检测
ComplateRequestArr:null,
isAndorid:true
}
},
onShow() {
this.getOrderList()
this.checkIapOrders() //检查未完成的苹果支付订单
this.getOS()
},
computed: {
...mapState(['userInfo']),
@@ -122,6 +124,17 @@ import {
},
methods: {
...mapMutations(['setUserInfo']),
// 获得操作系统
getOS(){
let oprateOs = ''
oprateOs = uni.getSystemInfoSync().platform
console.log(oprateOs)
if(oprateOs == 'android'){
this.isAndorid = true
}else{
this.isAndorid = false
}
},
checkIapOrders() {
const that = this
// 如果ios已经绑定支付信息就直接支付如果没有绑定就需要先绑定
@@ -196,8 +209,7 @@ import {
// 支付
goPay(payItem) {
console.log(payItem,'payItem')
console.log(payItem,'payItem')
if(payItem.paymentMethod == 2){
console.log('阿里支付')
setPay({
@@ -223,38 +235,56 @@ import {
})
} else if(payItem.paymentMethod == 1){
console.log('微信支付')
let data1={
orderSn:payItem.orderSn,
buyOrderId: null,
totalAmount: payItem.realMoney
}
console.log(data1,'data1')
setWXPay(data1,res => {
if (res.success) {
uni.showToast({
title: "支付成功"
});
} else {
console.log(res)
if(res.data.errMsg.indexOf('User canceled') != -1){
// console.log(this.isAndorid)
if(this.isAndorid == false){
uni.showModal({
title: '提示',
content: '很抱歉,苹果系统暂不支持微信支付',
showCancel:false
})
return false
}else{
let data1={
orderSn:payItem.orderSn,
buyOrderId: null,
totalAmount: payItem.realMoney
}
console.log(data1,'data1')
setWXPay(data1,res => {
if (res.success) {
uni.showToast({
title: "用户取消支付",
title: "支付成功"
});
} else {
console.log(res)
if(res.data.errMsg.indexOf('User canceled') != -1){
uni.showToast({
title: "用户取消支付",
icon: "none",
image: '../../static/icon/ic_close.png'
});
}else{
uni.showToast({
title: "支付失败",
icon: "none",
image: '../../static/icon/ic_close.png'
});
}else{
uni.showToast({
title: "支付失败",
icon: "none",
image: '../../static/icon/ic_close.png'
});
}
}
}
})
})
}
}else if(payItem.paymentMethod == 3){
// 苹果充值
console.log('苹果二次支付')
this.iphonepay(payItem)
if(this.isAndorid){
uni.showModal({
title:'提示',
showCancel:false,
content:'很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单'
})
}else{
this.iphonepay(payItem)
}
}
},
iphonepay(payItem) {

View File

@@ -146,14 +146,14 @@
getData() {
this.bokMesDet.userId = this.userInfo.id
// 获取输家 列表
// 获取书架列表
this.$http
.post('book/bookshelf/getUserBookshelf', {
'userId': this.userInfo.id
})
.then(res => {
this.bookData = res.userBookshelf
console.log(res)
});
},

View File

@@ -3133,8 +3133,8 @@ import { nextTick } from "vue";
}else if(options.chapterid == 'prev'){ // 上一章
this.goPreChapter()
}else if(options.curpage>0){
// this.goNextPage()
console.log(options.curpage)
this.goNextPage()
// console.log(options.curpage)
}else if(options.curpage<0){
this.goPrePage()
}