页面完善

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

View File

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

View File

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

View File

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

View File

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