苹果审核,bug恢复

This commit is contained in:
徐哼唧L
2024-02-26 09:05:04 +08:00
parent 5ae322d192
commit 08667cd3fc
36 changed files with 2158 additions and 1232 deletions

View File

@@ -66,7 +66,7 @@
<view v-if="contentShow == 0">
<view class="pingjia">
<!-- <h4></h4> -->
<view class="" v-if="listenList.length > 0 && listenList[0]" style="margin:0rpx 0rpx 30rpx;">
<view class="" v-if="listenList.length > 0 && listenList[0]&&iosHide" style="margin:0rpx 0rpx 30rpx;">
<view class="">
<view style="font-weight: 700;margin-bottom: 30rpx;color:#71d5a1;">赠送听书权益</view>
</view>

View File

@@ -509,15 +509,15 @@
uni.showModal({
title: '提示',
content: '微信号yilujiankangkefu',
success: function (res) {
if (res.confirm) {
uni.makePhoneCall({
phoneNumber: '022-24142321' //仅为示例
});
} else if (res.cancel) {
// success: function (res) {
// if (res.confirm) {
// uni.makePhoneCall({
// phoneNumber: '022-24142321' //仅为示例
// });
// } else if (res.cancel) {
}
}
// }
// }
})
},
// 查看物流

View File

@@ -37,10 +37,11 @@
<text>{{item.productName}}</text>
</view>
<view class="itemPrice">
<text v-if="item.activityPrice && item.activityPrice > 0">{{item.activityPrice*item.productAmount}}</text>
<text
v-if="item.activityPrice && item.activityPrice > 0">{{item.activityPrice*item.productAmount}}</text>
<text v-else>{{item.price*item.productAmount}}</text>
<u-number-box v-model="item.productAmount" @change="valChange($event, item)" :input-width="50"
:input-height="20" :min="1" :max="item.productStock" integer ></u-number-box>
:input-height="20" :min="1" :max="item.productStock" integer></u-number-box>
</view>
</view>
</view>
@@ -55,10 +56,8 @@
<u-icon name="red-packet-fill" color="#e74141" size="18" class="yqLeft"></u-icon>
优惠券
<u-icon name="arrow-right" color="#aaa" size="18" class="yqRight"></u-icon>
<text class="dagnqian"
v-if="youhuiList.length>0">当前可选{{this.youhuiList.length}}</text>
<text class="dagnqian" v-else
style="background-color: #999;">暂无优惠券</text>
<text class="dagnqian" v-if="youhuiList.length>0">当前可选{{this.youhuiList.length}}</text>
<text class="dagnqian" v-else style="background-color: #999;">暂无优惠券</text>
<text class="dagnqian" v-if="youhuiContent.id!=undefined">
- {{youhuiContent.coupons.couponAmount}}</text>
</view>
@@ -67,19 +66,25 @@
运费
<text>{{farePrice}}</text>
</view>
<view class="yq_beizhu">
<u-icon name="info-circle" color="#ffb529" size="12" style="display: inline-block;margin-right: 10rpx;"></u-icon>
如订单包含一种或多种预售书预售书和现货书需分开发货即需要收取多次快递首重费用如多本书会按照实际重量收取快递续重费用
</view>
</view>
<!-- 安卓支付列表 -->
<view class="zhif_fangsh" v-if="isAndorid">
<view class="zhif_radio">
<u-radio-group v-model="payType">
<view style="width: 100%;">
<view v-for="(item, index) in paylist" class="zhif_xuanx">
<view v-for="(item, index) in paylist" class="zhif_xuanx">
<image :src="item.img"></image>
{{item.title}}
<span v-if="item.id == 4" style="color: #bbb; margin-left: 10px;">{{userMes.peanutCoin}}天医币可用</span>
<span @click.stop="buPoint" style="color: #bf0c0c; margin-left: 10px;" v-if="item.id == 4" class="chongBtn">去充值</span>
<span v-if="item.id == 4"
style="color: #bbb; margin-left: 10px;">{{userMes.peanutCoin}}天医币可用</span>
<span @click.stop="buPoint" style="color: #bf0c0c; margin-left: 10px;" v-if="item.id == 4"
class="chongBtn">去充值</span>
<u-radio :key="index" activeColor="#fe6e09" :name='item.id'
style="float: right;margin-top: 5rpx;" ></u-radio>
style="float: right;margin-top: 5rpx;"></u-radio>
</view>
</view>
</u-radio-group>
@@ -90,20 +95,22 @@
<view class="zhif_radio">
<u-radio-group v-model="payType">
<view style="width: 100%;">
<view v-for="(item, index) in paylistIos" class="zhif_xuanx">
<view v-for="(item, index) in paylistIos" class="zhif_xuanx">
<image :src="item.img"></image>
{{item.title}}
<span v-if="item.id == 4" style="color: #bbb; margin-left: 10px;">{{userMes.peanutCoin}}天医币可用</span>
<span @click.stop="buPoint" style="color: #bf0c0c; margin-left: 10px;" v-if="item.id == 4" class="chongBtn">去充值</span>
<span v-if="item.id == 4"
style="color: #bbb; margin-left: 10px;">{{userMes.peanutCoin}}天医币可用</span>
<span @click.stop="buPoint" style="color: #bf0c0c; margin-left: 10px;" v-if="item.id == 4"
class="chongBtn">去充值</span>
<u-radio :key="index" activeColor="#fe6e09" :name='item.id'
style="float: right;margin-top: 5rpx;" ></u-radio>
style="float: right;margin-top: 5rpx;"></u-radio>
</view>
</view>
</u-radio-group>
</view>
</view>
<view class="footer" >
<view class="footer">
<view class="commodityPrice" v-if="payType != 4">
<span style="color: #666;margin-right: 10rpx; font-size: 15px;">实付款: </span>
<span></span>{{realPrice}}
@@ -122,7 +129,7 @@
立即支付
</view>
</view>
</view>
</view>
<!-- 地址弹出 -->
<u-popup :show="dizhiShow" :round="10" @close="dizhiShow=false">
<view class="tanchu">
@@ -133,7 +140,7 @@
</view>
<view style="max-height: 1000rpx;overflow-y: scroll;">
<view :class="adressMoRIndex == index ? 'addressItem addItem_style' : 'addressItem'"
v-for="(item,index) in addressList" :key="index" @click="choseDizhi(index)">
v-for="(item,index) in addressList" :key="index" @click="choseDizhi(index)">
<view class="addrContent">
<view class="addrContentTop">
<view class="userName">
@@ -150,7 +157,7 @@
</view>
<view class="addrContentBottom">
<view class="userAddress">
{{item.province}} {{item.city}} {{item.county}}
{{item.province}} {{item.city}} {{item.county}}
{{item.detailAddress}}
</view>
</view>
@@ -193,11 +200,11 @@
</view>
<view class="" v-else>
<u-divider text="暂无可用优惠券哦"></u-divider>
</view>
</view>
</view>
</u-popup>
<music-play :playData="playData"></music-play>
<music-play :playData="playData"></music-play>
</view>
</template>
@@ -206,7 +213,8 @@
import $http from '@/config/requestConfig.js';
import {
setPay,
setPayAssign,setWXPay
setPayAssign,
setWXPay
} from '@/config/utils';
import {
mapState
@@ -214,26 +222,26 @@
export default {
data() {
return {
isAndorid:true, // 操作系统
playData:{},
isAndorid: true, // 操作系统
playData: {},
typeId: 0,
shangIDNum: 0,
cartIDNum: [],
cartList: [],
userMes:{}, // 用户信息
amount:null, // 商品总价
userMes: {}, // 用户信息
amount: null, // 商品总价
addressList: [],
adressMoRen: {},
adressMoRenPath:"",
adressMoRenPath: "",
adressMoRIndex: 0,
youhuiList: [],
addressId:null,
addressId: null,
youhuiContent: {},
youhuiIndex: '',
dizhiShow: false,
youhuiShow: false,
totalPrice: 0,
isSend:'0',
isSend: '0',
farePrice: 0,
realPrice: 0,
payType: 1,
@@ -242,17 +250,17 @@
title: '支付宝',
id: 2,
img: '../../static/icon/pay_1.png'
},
},
{
title: '微信',
id: 1,
img: '../../static/icon/pay_2.png'
},
{
title: '天医币购买',
id: 4,
img: '../../static/icon/oder_chong.png'
},
title: '天医币购买',
id: 4,
img: '../../static/icon/oder_chong.png'
},
// {
// title: 'ios内购',
// id: 3,
@@ -263,17 +271,17 @@
title: '支付宝',
id: 2,
img: '../../static/icon/pay_1.png'
},
},
{
title: '微信',
id: 1,
img: '../../static/icon/pay_2.png'
},
{
title: '天医币购买',
id: 4,
img: '../../static/icon/oder_chong.png'
},
// {
// title: '天医币购买',
// id: 4,
// img: '../../static/icon/oder_chong.png'
// },
// {
// title: 'ios内购',
// id: 3,
@@ -290,41 +298,41 @@
this.typeId = 0
this.shangIDNum = e.list
}
// this.getYunFei()
this.getData()
this.getOS()
// this.getYunFei()
this.getData()
this.getOS()
},
onShow() {
onShow() {
// if (this.typeId == 1) {
// this.getCartList()
// } else if (this.typeId == 0) {
// this.getShangList(this.shangIDNum);
// }
if (this.typeId == 1) {
this.getCartList()
} else if (this.typeId == 0) {
this.getShangList(this.shangIDNum);
this.getShangList(this.shangIDNum);
}
// this.getUserAddress()
},
computed: {
...mapState(['userInfo']),
},
components:{
components: {
musicPlay
},
methods: {
// 获得操作系统
getOS(){
getOS() {
let oprateOs = ''
oprateOs = uni.getSystemInfoSync().platform
// console.log(oprateOs)
if(oprateOs == 'android'){
if (oprateOs == 'android') {
this.isAndorid = true
}else{
} else {
this.isAndorid = false
}
},
@@ -337,18 +345,18 @@
getData() {
let that = this
// 获取个人信息
// 用户详情
if (this.userInfo.id != undefined) {
this.$http
.post('book/user/info/' + this.userInfo.id)
.then(res => {
this.userMes = res.user
// consol.log(this.userMes.peanutCoin,'呼呼')
if (this.userMes.vip != 0) {
this.typeFen = 2
}
});
}
// 用户详情
if (this.userInfo.id != undefined) {
this.$http
.post('book/user/info/' + this.userInfo.id)
.then(res => {
this.userMes = res.user
// consol.log(this.userMes.peanutCoin,'呼呼')
if (this.userMes.vip != 0) {
this.typeFen = 2
}
});
}
},
// 获取地址列表
getUserAddress() {
@@ -362,13 +370,13 @@
// console.log(this.addressList,'地址列表')
this.adressMoRen = this.addressList[this.adressMoRIndex]
console.log(this.adressMoRen, '默认')
if(this.adressMoRen != {} && this.adressMoRen.id){
if (this.adressMoRen != {} && this.adressMoRen.id) {
// console.log('运费之前')
this.getYunFei()
}else{
} else {
// this.getUserAddress()
uni.showToast({
title:'获取用户地址失败',
title: '获取用户地址失败',
icon: 'none'
})
}
@@ -376,15 +384,15 @@
}
})
},
goPoinBuy(){
if(this.realPrice > this.userMes.peanutCoin){
goPoinBuy() {
if (this.realPrice > this.userMes.peanutCoin) {
uni.showToast({
title:'天医币不足,请充值',
title: '天医币不足,请充值',
icon: 'none',
duration: 2000
})
return
}else{
return
} else {
this.goBuyJie()
}
},
@@ -404,11 +412,12 @@
price = item.productAmount * item.price;
allprice += price
})
this.amount = allprice // 商品总价
this.amount = allprice // 商品总价
this.allPrice()
// '&products=' + proId + //商品id
this.$http
.post('book/couponhistory/appGetUserCoupon?userId=' + this.userInfo.id + '&amount=' + this.amount + '&type=0')
.post('book/couponhistory/appGetUserCoupon?userId=' + this.userInfo.id + '&amount=' + this.amount +
'&type=0')
.then(res => {
this.youhuiList = res.userCoupons
});
@@ -426,13 +435,13 @@
prodCont.image = res.shopProduct.productImages
prodCont.productName = res.shopProduct.productName
prodCont.productAmount = 1
if(res.shopProduct.activityPrice && res.shopProduct.activityPrice > 0){
if (res.shopProduct.activityPrice && res.shopProduct.activityPrice > 0) {
prodCont.price = res.shopProduct.activityPrice
}else{
} else {
prodCont.price = res.shopProduct.price
}
prodCont.weight = res.shopProduct.weight
this.cartList.push(prodCont)
this.cartList.push(prodCont)
this.getCourpe()
this.getUserAddress()
//this.getYunFei()
@@ -452,55 +461,58 @@
console.log(this.cartList, '购物车列表')
this.getCourpe()
this.getUserAddress()
})
},
// 获取运费
getYunFei(){
getYunFei() {
let key = []
let dataToString = ''
// console.log(this.adressMoRen, '默认地址')
this.cartList.forEach((item, index) => {
key.push({productId: item.productId, quantity:item.productAmount})
// dataToString = dataToString.concat(item.productId+"="+item.productAmount+"&")
})
// console.log(key,'this.adressMoRen.areaidpath')
this.cartList.forEach((item, index) => {
key.push({
productId: item.productId,
quantity: item.productAmount
})
// dataToString = dataToString.concat(item.productId+"="+item.productAmount+"&")
})
// console.log(key,'this.adressMoRen.areaidpath')
$http.request({
// url: "book/buyOrder/calculateTransportPrice/",
url: "book/buyOrder/calculateTransportPrice",
// url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data:{
'regionCode':this.adressMoRen.regionCode,
'products':key,
loadAnimate:'none', // 请求加载动画
} ,
data: {
'regionCode': this.adressMoRen.regionCode,
'products': key,
loadAnimate: 'none', // 请求加载动画
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
}).then(res => {
if (res.code == 0) {
this.farePrice = res.result
console.log('需要的运费',res.result)
console.log('需要的运费', res.result)
this.allPrice()
}
})
},
},
// 总价
allPrice() {
let allprice = 0;
this.cartList.forEach((item, index) => {
let price = 0;
if(item.activityPrice && item.activityPrice > 0){
if (item.activityPrice && item.activityPrice > 0) {
price = item.productAmount * item.activityPrice;
}else{
} else {
price = item.productAmount * item.price;
}
}
allprice += price
})
})
this.totalPrice = allprice
if (this.youhuiContent.id != undefined) {
this.realPrice = this.totalPrice - this.youhuiContent.coupons.couponAmount
@@ -510,9 +522,9 @@
this.realPrice = this.realPrice + this.farePrice
},
// 超出阈值时
overlimit(){
overlimit() {
uni.showToast({
title:'超出商品数量',
title: '超出商品数量',
icon: 'error',
duration: 1000
})
@@ -523,34 +535,34 @@
productItem = item
productItem.productAmount = e.value
this.updateCart(productItem)
this.$nextTick(()=>{
this.$nextTick(() => {
this.getYunFei()
this.getCourpe()
})
},
// 更新购物车
updateCart(shagnpin){
// 已在购物车中添加
$http.request({
url: "book/ordercart/update",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: shagnpin,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
}
}).then(res => {
if (res.code == 0) {
// uni.showToast({
// title: '加入购物车成功',
// duration: 1000,
// });
}
})
},
// 更新购物车
updateCart(shagnpin) {
// 已在购物车中添加
$http.request({
url: "book/ordercart/update",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: shagnpin,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
}
}).then(res => {
if (res.code == 0) {
// uni.showToast({
// title: '加入购物车成功',
// duration: 1000,
// });
}
})
},
// 更改地址
choseDizhi(e) {
choseDizhi(e) {
this.adressMoRIndex = e
this.adressMoRen = this.addressList[this.adressMoRIndex]
console.log(this.adressMoRen)
@@ -573,9 +585,9 @@
this.youhuiShow = false
},
// 提交结算
goBuyJie() {
if(this.addressList.length == 0) {
this.dizhiShow = true // 如果没有地址信息
goBuyJie() {
if (this.addressList.length == 0) {
this.dizhiShow = true // 如果没有地址信息
}
if (!this.nowClick) {
return
@@ -606,12 +618,12 @@
userId: this.userInfo.id, //下单人ID
shippingUser: this.adressMoRen.consigneeName, //收货人姓名
userPhone: this.adressMoRen.consigneePhone, //收货人手机号
// province: this.adressMoRen.areaidpathtext.split(' ')[0], //省
// city: this.adressMoRen.areaidpathtext.split(' ')[1], //市
// district: this.adressMoRen.areaidpathtext.split(' ')[2], //区
//address: this.adressMoRen.useraddress, //地址
paymentMethod: this.payType, //支付方式 2支付宝1微信3ios内购 4天医币购买
orderMoney: this.totalPrice, //订单金额
realMoney: this.realPrice, //实收金额
@@ -623,9 +635,9 @@
orderStatus: 0, //订单状态
productList: xiaBiao, //订单列表商品
orderType: "order", //订单类型
addressId:this.adressMoRen.id // 地址ID
}
$http.request({
addressId: this.adressMoRen.id // 地址ID
}
$http.request({
// url: "book/buyOrder/buySave",
url: "book/buyOrder/placeOrder",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
@@ -642,54 +654,54 @@
image: '../../static/icon/ic_close.png'
});
} else {
if(this.payType == 2){
// 常规支付
uni.showToast({
title: "正在支付",
icon: "loading"
});
setPay({
typePay: 'alipay',
subject: 'order',
totalAmount: res.money,
type: 2,
relevanceoid: res.orderSn,
customerId: this.userInfo.id,
}, res => {
if (res.success) {
uni.showToast({
title: "支付成功"
});
setTimeout(() => {
uni.switchTab({
url: './orderList'
if (this.payType == 2) {
// 常规支付
uni.showToast({
title: "正在支付",
icon: "loading"
});
setPay({
typePay: 'alipay',
subject: 'order',
totalAmount: res.money,
type: 2,
relevanceoid: res.orderSn,
customerId: this.userInfo.id,
}, res => {
if (res.success) {
uni.showToast({
title: "支付成功"
});
// uni.navigateTo({
// url: './orderList'
// });
}, 1000)
} else {
uni.showToast({
title: "支付失败",
icon: "none",
image: '../../static/icon/ic_close.png'
});
// setTimeout(() => {
// uni.navigateTo({
// url: './orderList'
// });
// }, 1000)
}
})
}else if(this.payType == 1){
setTimeout(() => {
uni.switchTab({
url: './orderList'
});
// uni.navigateTo({
// url: './orderList'
// });
}, 1000)
} else {
uni.showToast({
title: "支付失败",
icon: "none",
image: '../../static/icon/ic_close.png'
});
// setTimeout(() => {
// uni.navigateTo({
// url: './orderList'
// });
// }, 1000)
}
})
} else if (this.payType == 1) {
// 微信支付
let data1 = {
orderSn:res.orderSn,
buyOrderId: null,
totalAmount: res.money
orderSn: res.orderSn,
buyOrderId: null,
totalAmount: res.money
}
setWXPay(data1,res => {
setWXPay(data1, res => {
if (res.success) {
uni.showToast({
title: "支付成功"
@@ -699,28 +711,28 @@
url: './orderList'
});
}, 1000)
} else {
} else {
console.log(res)
if(res.data.errMsg.indexOf('User canceled') != -1){
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(this.payType == 4){
} else if (this.payType == 4) {
// 天医币支付
uni.showToast({
title: "购买成功",
icon: "success"
icon: "success"
});
setTimeout(() => {
uni.switchTab({
@@ -884,6 +896,11 @@
float: right;
}
}
.yq_beizhu {
color: #aaa;
font-size: 24rpx;
}
}
.youhui_quan>view {
@@ -899,7 +916,8 @@
padding: 30rpx 40rpx 0 40rpx;
background-color: #fff;
border-bottom: 1px solid #eee;
padding-bottom:90rpx;
padding-bottom: 90rpx;
.zhif_radio {
.zhif_xuanx {
@@ -1067,6 +1085,7 @@
border-color: #fd6004;
}
}
.chongBtn {
background-color: #54a966;
color: #fff !important;
@@ -1074,6 +1093,6 @@
border-radius: 10rpx;
padding: 2rpx 10rpx;
font-size: 20rpx;
display: inline-block;
display: inline-block;
}
</style>
</style>