作者 韩昌

修改:14.40

... ... @@ -49,7 +49,7 @@ const props = defineProps({
// 余额
balance: {
type: String,
default: 0
default: ''
},
// 是否订单支付
isOrderPay: {
... ... @@ -68,14 +68,14 @@ const props = defineProps({
})
onMounted(() => {
setTimeout(() => {
if (props.totalPrice > props.balance) {
if (props.totalPrice > +props.balance) {
payMode[1].shows = false
}
}, 100)
})
watchEffect(() => {
// console.log('余额',props.balance) 余额不足点击充值,返回页面刷新余额
if (props.totalPrice < props.balance) {
console.log('余额', props.balance) //余额不足点击充值,返回页面刷新余额
if (props.totalPrice < +props.balance) {
payMode[1].shows = true
}
})
... ... @@ -128,12 +128,12 @@ const getPays = async () => {
const res = await getPay(params)
proxy.$methods.pay(res)
canclePop()
// console.log('getPay', res)
// uni.showToast({ title: '支付成功', icon: 'none' })
// setTimeout(() => {
// uni.navigateBack()
// }, 1500);
if (defaultMode.value === 1) {
uni.showToast({ title: '支付成功', icon: 'none' })
setTimeout(() => {
uni.navigateBack()
}, 1500)
}
// 保存数据
} catch (err) {
uni.showToast({ title: err, icon: 'none' })
... ...
... ... @@ -7,14 +7,14 @@
<view class="info">
<view class="topBox">
<view class="shopTitle ellipsis">{{ it.goods_name }}</view>
<view class="desc ellipsis">{{ it.describe }}</view>
<view class="desc ellipsis">{{ it.goods_attr ? it.goods_attr : '' }}</view>
<view class="num ellipsis" v-if="![2].includes(shop.order_status)">x{{ it.total_num }}</view>
</view>
<!-- 非积分商品 -->
<view class="priceBox flexJ" v-if="it.goodstatus != 3">
<view class="flexA">
<text>¥{{ it.total_price }}</text>
<text v-if="shop.goodstatus_text === 2" class="linePrice">122</text>
<view class="">
<text>¥{{ it.goods_price }}</text>
<text v-if="shop.goodstatus_text === 2" class="linePrice">{{ it.line_price }}</text>
</view>
<view class="reality flexA">
<view class="shi">{{ textHandler(shop.order_status) }}</view>
... ... @@ -56,7 +56,7 @@ const props = defineProps({
}
})
const textHandler = orderStatus => ([1, 11].includes(orderStatus) ? '需付款:' : [2, 3, 4, 21].includes(orderStatus) ? '实付款:' : '')
const textHandler = orderStatus => ([1, 11].includes(orderStatus) ? '需付款:' : [2, 3, 4, 21].includes(orderStatus) ? '实付款:' : '')
onMounted(() => {
nextTick(() => {
... ... @@ -173,5 +173,6 @@ onMounted(() => {
.linePrice {
text-decoration: line-through;
color: rgba($color: #000000, $alpha: 0.3) !important;
display: block;
}
</style>
... ...
... ... @@ -62,8 +62,8 @@
<image :src="item.icon" mode=""></image>
<u-badge :absolute="true" v-if="index == 2" :offset="[-6, -6]" color="#fff" bgColor="#F63D3A" max="99" :value="value"></u-badge>
</view>
<text v-if="index != 1">{{ item.name }}</text>
<button v-if="index == 1" open-type="contact">{{ item.name }}</button>
<text>{{ item.name }}</text>
<button open-type="contact" v-if="index === 1"></button>
</view>
</view>
<view class="flexA" v-if="shopType != 3">
... ... @@ -72,7 +72,14 @@
</view>
<view v-else class="exchange flexC" @click="toOrder(3)">我要兑换</view>
</view>
<popPay :moreSpec="moreSpec" :shopDetail="detaileList" @close="payPopShow = false" :shopType="shopType" :btnType="btnType" :payPopShow="payPopShow"></popPay>
<popPay
:moreSpec="moreSpec"
:shopDetail="detaileList"
@close="payPopShow = false"
:shopType="shopType"
:btnType="btnType"
:payPopShow="payPopShow"
></popPay>
</view>
</template>
... ... @@ -91,7 +98,11 @@ onHide(() => {
payPopShow.value = false
})
const currentNum = ref(0)
const list6 = reactive(['https://cdn.uviewui.com/uview/swiper/swiper2.png', 'https://cdn.uviewui.com/uview/swiper/swiper3.png', 'https://cdn.uviewui.com/uview/swiper/swiper1.png'])
const list6 = reactive([
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
'https://cdn.uviewui.com/uview/swiper/swiper1.png'
])
const icList = reactive([
{ id: 1, name: '店铺', icon: '/static/indexIc/shopIc.png' },
{ id: 2, name: '客服', icon: '/static/indexIc/service.png' },
... ... @@ -260,6 +271,7 @@ const getShopDetailes = async id => {
.leftIc {
margin-right: 34rpx;
position: relative;
.images {
position: relative;
... ... @@ -279,11 +291,14 @@ const getShopDetailes = async id => {
}
button {
position: relative;
position: absolute;
bottom: 0;
left: 0;
top: 0;
right: 0;
background: transparent;
width: 100%;
height: 100%;
color: #323233ff;
/* width: 48rpx;
height: 48rpx; */
font-size: 20rpx;
border: none !important;
padding: 0 !important;
... ...
... ... @@ -219,7 +219,7 @@ page {
.downTime {
display: flex;
justify-content: flex-end;
margin-bottom: 58rpx;
margin-bottom: 12rpx;
.u-count-down__text {
color: #fc4338ff;
... ...
<template>
<!-- 确认订单 -->
<u-navbar bgColor="#F6F8FA" :placeholder="true" title="" :autoBack="true"></u-navbar>
<view class="mainBox">
<view class="checkAddress flexJ" @click="checkAddress" v-if="!adress.name">
<view class="add flexA">
<image src="/static/shopCarIc/address.png" mode=""></image>
新增收货地址
</view>
<image src="/static/mineIc/gayRight.png" mode=""></image>
</view>
<view v-else>
<!-- 收货地址 -->
<shopAddres :adress="adress"></shopAddres>
</view>
<view class="ordersShop">
<view class="shop flexJ" v-for="item in buyShop" :key="item.id">
<view class="shopPhoto">
<image :src="item.image" mode=""></image>
</view>
<view class="shopInfo">
<view class="shopName ellipsis">{{item.name}}</view>
<view class="shopDesc ellipsis">{{item.describe}}</view>
<view class="price flexJ">
<text v-if="shopType!=3">¥{{item.goods_price}}</text>
<view v-else class="flexA points">
{{orderInfo.coscore}}<text>积分</text>
</view>
<view class="num">x{{item.total_num}}</view>
</view>
</view>
</view>
<view class="line"></view>
<view class="modeBox flexJ">
<text>提货方式</text>
<view class="mode">快递配送</view>
</view>
<view class="modeBox flexJ" v-if="shopType==3">
<text>运费</text>
<view class="yunPrice">¥{{orderInfo.express_price}}</view>
</view>
</view>
<view class="btnsBox iosAuto flexJ">
<!-- 积分购买 -->
<view class="pointsPrcie flexV" v-if="shopType==3">
<view class="allPoints flexA">
<view class="all">合计:</view>
<view class="pointsNum">
{{orderInfo.coscore}}<text>积分</text>
</view>
</view>
<view class="pointsMoeny">{{orderInfo.express_price}}元</view>
</view>
<!-- 非积分购买 -->
<view class="allMoney flexA" v-else>
<text>总价:</text> {{orderInfo.total_price}}
</view>
<view class="btn flexC" @click="btns">{{ shopType==3 ? '立即兑换' : '立即购买' }}</view>
</view>
<!-- 选择支付方式弹窗 -->
<payMode @canclePop="modeShow = false" :car_Id="car_Id" :balance="balance" :totalPrice="orderInfo.total_price" :adressId="adress.id" :payParams="payParams" :modeShow="modeShow"></payMode>
<!-- 确认积分兑换弹窗 -->
<tipPop @pointsBtns="pointsBtns" :integral="orderInfo.coscore" :tipShow="tipShow"></tipPop>
</view>
<!-- 确认订单 -->
<u-navbar bgColor="#F6F8FA" :placeholder="true" title="" :autoBack="true"></u-navbar>
<view class="mainBox">
<view class="checkAddress flexJ" @click="checkAddress" v-if="!adress.name">
<view class="add flexA">
<image src="/static/shopCarIc/address.png" mode=""></image>
新增收货地址
</view>
<image src="/static/mineIc/gayRight.png" mode=""></image>
</view>
<view v-else>
<!-- 收货地址 -->
<shopAddres :adress="adress"></shopAddres>
</view>
<view class="ordersShop">
<view class="shop flexJ" v-for="item in buyShop" :key="item.id">
<view class="shopPhoto">
<image :src="item.image" mode=""></image>
</view>
<view class="shopInfo">
<view class="shopName ellipsis">{{ item.name }}</view>
<view class="shopDesc ellipsis">{{ item.describe }}</view>
<view class="price flexJ">
<text v-if="shopType != 3">¥{{ item.goods_price }}</text>
<view v-else class="flexA points">
{{ orderInfo.coscore }}
<text>积分</text>
</view>
<view class="num">x{{ item.total_num }}</view>
</view>
</view>
</view>
<view class="line"></view>
<view class="modeBox flexJ">
<text>提货方式</text>
<view class="mode">快递配送</view>
</view>
<view class="modeBox flexJ" v-if="shopType == 3">
<text>运费</text>
<view class="yunPrice">¥{{ orderInfo.express_price }}</view>
</view>
</view>
<view class="btnsBox iosAuto flexJ">
<!-- 积分购买 -->
<view class="pointsPrcie flexV" v-if="shopType == 3">
<view class="allPoints flexA">
<view class="all">合计:</view>
<view class="pointsNum">
{{ orderInfo.coscore }}
<text>积分</text>
</view>
</view>
<view class="pointsMoeny">{{ orderInfo.express_price }}元</view>
</view>
<!-- 非积分购买 -->
<view class="allMoney flexA" v-else>
<text>总价:</text>
{{ orderInfo.total_price }}
</view>
<view class="btn flexC" @click="btns">{{ shopType == 3 ? '立即兑换' : '立即购买' }}</view>
</view>
<!-- 选择支付方式弹窗 -->
<payMode
@canclePop="modeShow = false"
:car_Id="car_Id"
:balance="balance"
:totalPrice="orderInfo.total_price"
:adressId="adress.id"
:payParams="payParams"
:modeShow="modeShow"
></payMode>
<!-- 确认积分兑换弹窗 -->
<tipPop @pointsBtns="pointsBtns" :integral="orderInfo.coscore" :tipShow="tipShow"></tipPop>
</view>
</template>
<script setup>
import { ref,reactive } from 'vue'
import {onShow,onLoad} from '@dcloudio/uni-app'
import payMode from '@/componets/checkPayMode.vue'
import tipPop from '@/componets/tipPop.vue'
import shopAddres from '@/componets/address.vue'
import { getbBuyData,getCarsettlement } from '@/api/'
onLoad((e)=> {
if(e.ids) {
car_Id.value = e.ids
getCarsettlements(e.ids) //购物车结算
} else {
shopType.value = e.shopType //商品类型
payParams.value = JSON.parse(e.params) //规格id 商品数量 商品id
getbBuyDatas(JSON.parse(e.params))
console.log(e.params, '商品规格信息')
}
//默认地址
uni.getStorageSync('defaultAdres') ? adress.value = uni.getStorageSync('defaultAdres') : ''
})
onShow(()=> {
// 余额
uni.getStorageSync('balance') ? balance.value = uni.getStorageSync('balance') : ''
})
let modeShow = ref(false) //选择支付方式
let payParams = ref({}) //支付参数
let shopType = ref(1)// 1=普通商品,2=特价商品,3=积分商品
let car_Id = ref('') //购物车结算商品的购物车id
let balance = ref(0) //余额
let buyShop = ref([]) //购买de商品
let orderInfo = ref({}) //购买信息
// 购买商品信息
const getbBuyDatas = async (obj)=>{
try {
let params = {
goods_id:obj.id, //integer 是 商品ID
num:obj.num, //integer 是 数量
goods_spec_id:obj.specId, //integer 是 规格ID
}
const res = await getbBuyData(params)
buyShop.value = res.goods_list //购买de商品
orderInfo.value = res //购买信息
console.log('getbBuyData', res)
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('getbBuyData', err)
}
}
// 购物车结算
const getCarsettlements = async (ids)=>{
try {
const res = await getCarsettlement(ids)
buyShop.value = res.goods_list //购买de商品
orderInfo.value = res //购买信息
console.log('getCarsettlement', res)
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('getCarsettlement', err)
}
}
let adress = ref({}) //收货地址
// 选择地址
const checkAddress = ()=> {
uni.navigateTo({
url: `/pages/mine/myAddress?isCheck=${1}`,
events: {
steBack: data => {
adress.value = data
console.log('地址',data)
}
}
})
}
// 是否使用积分弹窗
const tipShow = ref(false)
// 是否使用积分 0否 1 是
const pointsBtns = (type)=>{
tipShow.value = false
if(type == 1) {
modeShow.value = true
}
}
// 立即购买按钮 shopType== 1 || 2立即购买 == shopType==3立即兑换按钮
const btns = ()=> {
if(shopType.value==3) {
console.log('立即兑换按钮')
if(uni.getStorageSync('myPoints') < orderInfo.value.coscore)
return uni.showToast({ title:'您的积分不足~',icon:'none' })
tipShow.value = true
} else {
modeShow.value = true
console.log('立即购买')
}
}
import { ref, reactive } from 'vue'
import { onShow, onLoad } from '@dcloudio/uni-app'
import payMode from '@/componets/checkPayMode.vue'
import tipPop from '@/componets/tipPop.vue'
import shopAddres from '@/componets/address.vue'
import { getbBuyData, getCarsettlement, getyue } from '@/api/'
onLoad(e => {
if (e.ids) {
car_Id.value = e.ids
getCarsettlements(e.ids) //购物车结算
} else {
shopType.value = e.shopType //商品类型
payParams.value = JSON.parse(e.params) //规格id 商品数量 商品id
getbBuyDatas(JSON.parse(e.params))
console.log(e.params, '商品规格信息')
}
//默认地址
uni.getStorageSync('defaultAdres') ? (adress.value = uni.getStorageSync('defaultAdres')) : ''
})
onShow(() => {
// 余额
getyues()
// uni.getStorageSync('balance') ? balance.value = uni.getStorageSync('balance') : ''
})
let modeShow = ref(false) //选择支付方式
let payParams = ref({}) //支付参数
let shopType = ref(1) // 1=普通商品,2=特价商品,3=积分商品
let car_Id = ref('') //购物车结算商品的购物车id
let balance = ref(0) //余额
let buyShop = ref([]) //购买de商品
let orderInfo = ref({}) //购买信息
// 购买商品信息
const getbBuyDatas = async obj => {
try {
let params = {
goods_id: obj.id, //integer 是 商品ID
num: obj.num, //integer 是 数量
goods_spec_id: obj.specId //integer 是 规格ID
}
const res = await getbBuyData(params)
buyShop.value = res.goods_list //购买de商品
orderInfo.value = res //购买信息
console.log('getbBuyData', res)
// 保存数据
} catch (err) {
uni.showToast({ title: err, icon: 'none' })
console.log('getbBuyData', err)
}
}
const getyues = async () => {
try {
const res = await getyue()
balance.value = res.money
// 保存数据
} catch (err) {
uni.showToast({ title: err, icon: 'none' })
console.log('getyue', err)
}
}
// 购物车结算
const getCarsettlements = async ids => {
try {
const res = await getCarsettlement(ids)
buyShop.value = res.goods_list //购买de商品
orderInfo.value = res //购买信息
console.log('getCarsettlement', res)
// 保存数据
} catch (err) {
uni.showToast({ title: err, icon: 'none' })
console.log('getCarsettlement', err)
}
}
let adress = ref({}) //收货地址
// 选择地址
const checkAddress = () => {
uni.navigateTo({
url: `/pages/mine/myAddress?isCheck=${1}`,
events: {
steBack: data => {
adress.value = data
console.log('地址', data)
}
}
})
}
// 是否使用积分弹窗
const tipShow = ref(false)
// 是否使用积分 0否 1 是
const pointsBtns = type => {
tipShow.value = false
if (type == 1) {
modeShow.value = true
}
}
// 立即购买按钮 shopType== 1 || 2立即购买 == shopType==3立即兑换按钮
const btns = () => {
if (shopType.value == 3) {
console.log('立即兑换按钮')
if (uni.getStorageSync('myPoints') < orderInfo.value.coscore) return uni.showToast({ title: '您的积分不足~', icon: 'none' })
tipShow.value = true
} else {
modeShow.value = true
console.log('立即购买')
}
}
</script>
<style lang="scss">
page {
background: #F6F8FA;
}
.mainBox {
width: 100%;
padding: 20rpx 24rpx 0;
box-sizing: border-box;
.checkAddress {
width: 100%;
padding: 24rpx 20rpx 26rpx;
box-sizing: border-box;
border-radius: 24rpx;
background: #ffffffff;
margin-bottom: 20rpx;
.add {
color: #323233ff;
font-size: 28rpx;
font-weight: 700;
image {
width: 32rpx;
height: 32rpx;
margin-right: 16rpx;
}
}
image {
width: 16rpx;
height: 32rpx;
}
}
.addressBox {
margin-bottom: 20rpx;
padding: 32rpx 20rpx 31rpx 32rpx;
background: #fff;
.right {
display: flex;
image {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
margin-top: 9rpx;
}
.area {
text {
color: #323233ff;
font-size: 28rpx;
font-weight: 700;
line-height: 36rpx;
}
.name {
color: #646566ff;
font-size: 24rpx;
margin-top: 9rpx;
}
}
}
image {
width: 16rpx;
height: 32rpx;
}
}
.ordersShop {
width: 100%;
padding: 24rpx 20rpx 32rpx 20rpx;
box-sizing: border-box;
border-radius: 24rpx;
background-color: #fff;
.shop {
margin-bottom: 24rpx;
.shopPhoto {
width: 180rpx;
height: 180rpx;
margin-right: 20rpx;
image {
width: 180rpx;
height: 180rpx;
border-radius: 16rpx;
}
}
.shopInfo {
width: 100%;
.shopName {
color: #323233ff;
font-size: 26rpx;
font-weight: 700;
}
.shopDesc {
margin: 16rpx 0 58rpx;
color: #00000066;
font-size: 20rpx;
}
.price {
width: 100%;
text {
color: #fc4338ff;
font-size: 28rpx;
font-weight: 700;
}
.num {
color: #323233ff;
font-size: 26rpx;
}
.points {
color: #000000e6;
font-size: 32rpx;
font-weight: 700;
text {
margin: 6rpx 0 0 8rpx;
color: #000000e6;
font-size: 22rpx;
}
}
}
}
}
.line {
margin: 40rpx 0 33rpx;
width: 100%;
height: 1rpx;
opacity: 1;
background: #eeeff0ff;
}
.modeBox {
margin-top: 32rpx;
text {
color: #000000e6;
font-size: 26rpx;
}
.mode {
color: #000000e6;
font-size: 26rpx;
font-weight: 700;
}
.yunPrice {
color: #fc4338ff;
font-size: 26rpx;
font-weight: 700;
}
}
}
}
.btnsBox {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 96rpx;
opacity: 1;
background: #ffffffff;
.allMoney {
margin-left: 32rpx;
color: #fc4338ff;
font-size: 40rpx;
font-weight: 700;
text {
color: #000000ff;
font-size: 32rpx;
font-weight: 700;
}
}
.btn {
margin-right: 24rpx;
width: 256rpx;
height: 80rpx;
border-radius: 80rpx;
color: #ffffffff;
font-size: 30rpx;
font-weight: 700;
background: linear-gradient(-88deg, #fe6434ff 0%, #ff2f2fff 100%);
}
.pointsPrcie {
margin-left: 32rpx;
.allPoints {
.all {
color: #000000ff;
font-size: 30rpx;
font-weight: 700;
}
.pointsNum {
margin-left: 12rpx;
color: #fc4338ff;
font-size: 40rpx;
font-weight: 700;
text {
margin: 8rpx 0 0 8rpx;
color: #fc4338ff;
font-size: 22rpx;
}
}
}
.pointsMoeny {
color: #00000099;
font-size: 24rpx;
}
}
}
page {
background: #f6f8fa;
}
.mainBox {
width: 100%;
padding: 20rpx 24rpx 0;
box-sizing: border-box;
.checkAddress {
width: 100%;
padding: 24rpx 20rpx 26rpx;
box-sizing: border-box;
border-radius: 24rpx;
background: #ffffffff;
margin-bottom: 20rpx;
.add {
color: #323233ff;
font-size: 28rpx;
font-weight: 700;
image {
width: 32rpx;
height: 32rpx;
margin-right: 16rpx;
}
}
image {
width: 16rpx;
height: 32rpx;
}
}
.addressBox {
margin-bottom: 20rpx;
padding: 32rpx 20rpx 31rpx 32rpx;
background: #fff;
.right {
display: flex;
image {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
margin-top: 9rpx;
}
.area {
text {
color: #323233ff;
font-size: 28rpx;
font-weight: 700;
line-height: 36rpx;
}
.name {
color: #646566ff;
font-size: 24rpx;
margin-top: 9rpx;
}
}
}
image {
width: 16rpx;
height: 32rpx;
}
}
.ordersShop {
width: 100%;
padding: 24rpx 20rpx 32rpx 20rpx;
box-sizing: border-box;
border-radius: 24rpx;
background-color: #fff;
.shop {
margin-bottom: 24rpx;
.shopPhoto {
width: 180rpx;
height: 180rpx;
margin-right: 20rpx;
image {
width: 180rpx;
height: 180rpx;
border-radius: 16rpx;
}
}
.shopInfo {
width: 100%;
.shopName {
color: #323233ff;
font-size: 26rpx;
font-weight: 700;
}
.shopDesc {
margin: 16rpx 0 58rpx;
color: #00000066;
font-size: 20rpx;
}
.price {
width: 100%;
text {
color: #fc4338ff;
font-size: 28rpx;
font-weight: 700;
}
.num {
color: #323233ff;
font-size: 26rpx;
}
.points {
color: #000000e6;
font-size: 32rpx;
font-weight: 700;
text {
margin: 6rpx 0 0 8rpx;
color: #000000e6;
font-size: 22rpx;
}
}
}
}
}
.line {
margin: 40rpx 0 33rpx;
width: 100%;
height: 1rpx;
opacity: 1;
background: #eeeff0ff;
}
.modeBox {
margin-top: 32rpx;
text {
color: #000000e6;
font-size: 26rpx;
}
.mode {
color: #000000e6;
font-size: 26rpx;
font-weight: 700;
}
.yunPrice {
color: #fc4338ff;
font-size: 26rpx;
font-weight: 700;
}
}
}
}
.btnsBox {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 96rpx;
opacity: 1;
background: #ffffffff;
.allMoney {
margin-left: 32rpx;
color: #fc4338ff;
font-size: 40rpx;
font-weight: 700;
text {
color: #000000ff;
font-size: 32rpx;
font-weight: 700;
}
}
.btn {
margin-right: 24rpx;
width: 256rpx;
height: 80rpx;
border-radius: 80rpx;
color: #ffffffff;
font-size: 30rpx;
font-weight: 700;
background: linear-gradient(-88deg, #fe6434ff 0%, #ff2f2fff 100%);
}
.pointsPrcie {
margin-left: 32rpx;
.allPoints {
.all {
color: #000000ff;
font-size: 30rpx;
font-weight: 700;
}
.pointsNum {
margin-left: 12rpx;
color: #fc4338ff;
font-size: 40rpx;
font-weight: 700;
text {
margin: 8rpx 0 0 8rpx;
color: #fc4338ff;
font-size: 22rpx;
}
}
}
.pointsMoeny {
color: #00000099;
font-size: 24rpx;
}
}
}
</style>
... ...
... ... @@ -30,7 +30,7 @@ const _sfc_main = {
},
balance: {
type: String,
default: 0
default: ""
},
isOrderPay: {
type: Boolean,
... ... @@ -50,13 +50,14 @@ const _sfc_main = {
const props = __props;
common_vendor.onMounted(() => {
setTimeout(() => {
if (props.totalPrice > props.balance) {
if (props.totalPrice > +props.balance) {
payMode[1].shows = false;
}
}, 100);
});
common_vendor.watchEffect(() => {
if (props.totalPrice < props.balance) {
console.log("\u4F59\u989D", props.balance);
if (props.totalPrice < +props.balance) {
payMode[1].shows = true;
}
});
... ... @@ -99,6 +100,12 @@ const _sfc_main = {
const res = await api_index.getPay(params);
proxy.$methods.pay(res);
canclePop();
if (defaultMode.value === 1) {
common_vendor.index.showToast({ title: "\u652F\u4ED8\u6210\u529F", icon: "none" });
setTimeout(() => {
common_vendor.index.navigateBack();
}, 1500);
}
} catch (err) {
common_vendor.index.showToast({ title: err, icon: "none" });
console.log("getPay", err);
... ...
... ... @@ -9,7 +9,7 @@ const _sfc_main = {
},
setup(__props) {
const props = __props;
const textHandler = (orderStatus) => [1, 11].includes(orderStatus) ? "\u9700\u4ED8\u6B3E\uFF1A" : [2, 3, 4, 21].includes(orderStatus) ? "\u5B9E\u4ED8\u6B3E\uFF1A" : "";
const textHandler = (orderStatus) => [1, 11].includes(orderStatus) ? "\u9700\u4ED8\u6B3E:" : [2, 3, 4, 21].includes(orderStatus) ? "\u5B9E\u4ED8\u6B3E:" : "";
common_vendor.onMounted(() => {
common_vendor.nextTick(() => {
console.log(props.shop, "\u8BA2\u5355\u6570\u636E\u662F\u4EC0\u4E48");
... ... @@ -21,28 +21,30 @@ const _sfc_main = {
return common_vendor.e({
a: it.image,
b: common_vendor.t(it.goods_name),
c: common_vendor.t(it.describe)
c: common_vendor.t(it.goods_attr ? it.goods_attr : "")
}, ![2].includes(__props.shop.order_status) ? {
d: common_vendor.t(it.total_num)
} : {}, {
e: it.goodstatus != 3
}, it.goodstatus != 3 ? common_vendor.e({
f: common_vendor.t(it.total_price),
f: common_vendor.t(it.goods_price),
g: __props.shop.goodstatus_text === 2
}, __props.shop.goodstatus_text === 2 ? {} : {}, {
h: common_vendor.t(textHandler(__props.shop.order_status)),
i: common_vendor.t(it.total_price)
}, __props.shop.goodstatus_text === 2 ? {
h: common_vendor.t(it.line_price)
} : {}, {
i: common_vendor.t(textHandler(__props.shop.order_status)),
j: common_vendor.t(it.total_price)
}) : common_vendor.e({
j: [2].includes(__props.shop.order_status)
k: [2].includes(__props.shop.order_status)
}, [2].includes(__props.shop.order_status) ? {
k: common_vendor.t(__props.shop.score),
l: common_vendor.t(it.total_num)
l: common_vendor.t(__props.shop.score),
m: common_vendor.t(it.total_num)
} : {
m: common_vendor.t(textHandler(__props.shop.order_status)),
n: common_vendor.t(it.coscore),
o: common_vendor.t(it.diff_price)
n: common_vendor.t(textHandler(__props.shop.order_status)),
o: common_vendor.t(it.coscore),
p: common_vendor.t(it.diff_price)
}), {
p: it.id
q: it.id
});
}),
b: ![2].includes(__props.shop.order_status)
... ...
<view wx:for="{{a}}" wx:for-item="it" wx:key="p" class="shop"><view class="shopPhoto"><image src="{{it.a}}" mode=""></image></view><view class="info"><view class="topBox"><view class="shopTitle ellipsis">{{it.b}}</view><view class="desc ellipsis">{{it.c}}</view><view wx:if="{{b}}" class="num ellipsis">x{{it.d}}</view></view><view wx:if="{{it.e}}" class="priceBox flexJ"><view class="flexA"><text>¥{{it.f}}</text><text wx:if="{{it.g}}" class="linePrice">122</text></view><view class="reality flexA"><view class="shi">{{it.h}}</view><text>¥</text><view class="price">{{it.i}}</view></view></view><view wx:else class="pointsShop"><block wx:if="{{it.j}}"><view class="flexJ" style="flex:1"><view class="flexA"><image src="/static/shopCarIc/pointsIc.png" mode=""></image><view class="pointsPrice">{{it.k}}</view></view><view class="num ellipsis">x{{it.l}}</view></view></block><block wx:else><text>{{it.m}}</text><image src="/static/shopCarIc/pointsIc.png" mode=""></image><view class="points">{{it.n}}</view><view class="pointsPrice">¥{{it.o}}</view></block></view></view></view>
\ No newline at end of file
<view wx:for="{{a}}" wx:for-item="it" wx:key="q" class="shop"><view class="shopPhoto"><image src="{{it.a}}" mode=""></image></view><view class="info"><view class="topBox"><view class="shopTitle ellipsis">{{it.b}}</view><view class="desc ellipsis">{{it.c}}</view><view wx:if="{{b}}" class="num ellipsis">x{{it.d}}</view></view><view wx:if="{{it.e}}" class="priceBox flexJ"><view class=""><text>¥{{it.f}}</text><text wx:if="{{it.g}}" class="linePrice">{{it.h}}</text></view><view class="reality flexA"><view class="shi">{{it.i}}</view><text>¥</text><view class="price">{{it.j}}</view></view></view><view wx:else class="pointsShop"><block wx:if="{{it.k}}"><view class="flexJ" style="flex:1"><view class="flexA"><image src="/static/shopCarIc/pointsIc.png" mode=""></image><view class="pointsPrice">{{it.l}}</view></view><view class="num ellipsis">x{{it.m}}</view></view></block><block wx:else><text>{{it.n}}</text><image src="/static/shopCarIc/pointsIc.png" mode=""></image><view class="points">{{it.o}}</view><view class="pointsPrice">¥{{it.p}}</view></block></view></view></view>
\ No newline at end of file
... ...
... ... @@ -114,4 +114,5 @@
.linePrice {
text-decoration: line-through;
color: rgba(0, 0, 0, 0.3) !important;
display: block;
}
\ No newline at end of file
... ...
... ... @@ -27,7 +27,11 @@ const _sfc_main = {
payPopShow.value = false;
});
const currentNum = common_vendor.ref(0);
common_vendor.reactive(["https://cdn.uviewui.com/uview/swiper/swiper2.png", "https://cdn.uviewui.com/uview/swiper/swiper3.png", "https://cdn.uviewui.com/uview/swiper/swiper1.png"]);
common_vendor.reactive([
"https://cdn.uviewui.com/uview/swiper/swiper2.png",
"https://cdn.uviewui.com/uview/swiper/swiper3.png",
"https://cdn.uviewui.com/uview/swiper/swiper1.png"
]);
const icList = common_vendor.reactive([
{ id: 1, name: "\u5E97\u94FA", icon: "/static/indexIc/shopIc.png" },
{ id: 2, name: "\u5BA2\u670D", icon: "/static/indexIc/service.png" },
... ... @@ -134,16 +138,11 @@ const _sfc_main = {
value: value.value
})
} : {}, {
e: index != 1
}, index != 1 ? {
f: common_vendor.t(item.name)
} : {}, {
g: index == 1
}, index == 1 ? {
h: common_vendor.t(item.name)
} : {}, {
i: item.id,
j: common_vendor.o(($event) => btns(index), item.id)
e: common_vendor.t(item.name),
f: index === 1
}, index === 1 ? {} : {}, {
g: item.id,
h: common_vendor.o(($event) => btns(index), item.id)
});
}),
r: common_vendor.unref(shopType) != 3
... ...
<view><u-navbar wx:if="{{a}}" u-s="{{['left']}}" u-i="1a35f0c9-0" bind:__l="__l" u-p="{{a}}"><view class="u-nav-slot" slot="left"><image src="/static/indexIc/back.png" mode=""></image></view></u-navbar><view class="swiperBox"><u-swiper wx:if="{{f}}" u-s="{{['indicator']}}" bindchange="{{e}}" u-i="1a35f0c9-1" bind:__l="__l" u-p="{{f}}"><view slot="indicator"><view wx:if="{{b}}" class="indicator-num"><text class="indicator-num__text">{{c}}/{{d}}</text></view></view></u-swiper></view><view class="info"><shop-info wx:if="{{g}}" u-i="1a35f0c9-2" bind:__l="__l" u-p="{{g}}"></shop-info></view><view class="line"></view><view class="mainBox"><view wx:if="{{h}}"><view class="commentNmu flexJ"><text>评论({{i}})</text><view wx:if="{{j}}" class="see flexA" bindtap="{{k}}"> 查看全部 <image src="/static/indexIc/orangeRight.png" mode=""></image></view></view><view wx:if="{{l}}"><comment wx:if="{{m}}" u-i="1a35f0c9-3" bind:__l="__l" u-p="{{m}}"></comment></view><view wx:else class="commentNull flexV"><image src="/static/indexIc/cpmmentNull.png" mode=""></image> 暂无评论 </view></view><view wx:if="{{n}}"><view class="line"></view><view class="titles">商品详情</view><rich-text nodes="{{o}}"></rich-text></view></view><view wx:if="{{p}}" class="lineBox flexC"><view class="lines"></view><text>商品详情</text><view class="lines"></view></view><view class="" style="height:300rpx"></view><view class="btnBox iosAuto flexJ"><view class="left flexA"><view wx:for="{{q}}" wx:for-item="item" wx:key="i" class="leftIc flexV" bindtap="{{item.j}}"><view class="images"><image src="{{item.a}}" mode=""></image><u-badge wx:if="{{item.b}}" u-i="{{item.c}}" bind:__l="__l" u-p="{{item.d}}"></u-badge></view><text wx:if="{{item.e}}">{{item.f}}</text><button wx:if="{{item.g}}" open-type="contact">{{item.h}}</button></view></view><view wx:if="{{r}}" class="flexA"><view class="add flexC" bindtap="{{s}}">加入购物车</view><view class="buy flexC" bindtap="{{t}}">立即购买</view></view><view wx:else class="exchange flexC" bindtap="{{v}}">我要兑换</view></view><pop-pay wx:if="{{x}}" bindclose="{{w}}" u-i="1a35f0c9-5" bind:__l="__l" u-p="{{x}}"></pop-pay></view>
\ No newline at end of file
<view><u-navbar wx:if="{{a}}" u-s="{{['left']}}" u-i="1a35f0c9-0" bind:__l="__l" u-p="{{a}}"><view class="u-nav-slot" slot="left"><image src="/static/indexIc/back.png" mode=""></image></view></u-navbar><view class="swiperBox"><u-swiper wx:if="{{f}}" u-s="{{['indicator']}}" bindchange="{{e}}" u-i="1a35f0c9-1" bind:__l="__l" u-p="{{f}}"><view slot="indicator"><view wx:if="{{b}}" class="indicator-num"><text class="indicator-num__text">{{c}}/{{d}}</text></view></view></u-swiper></view><view class="info"><shop-info wx:if="{{g}}" u-i="1a35f0c9-2" bind:__l="__l" u-p="{{g}}"></shop-info></view><view class="line"></view><view class="mainBox"><view wx:if="{{h}}"><view class="commentNmu flexJ"><text>评论({{i}})</text><view wx:if="{{j}}" class="see flexA" bindtap="{{k}}"> 查看全部 <image src="/static/indexIc/orangeRight.png" mode=""></image></view></view><view wx:if="{{l}}"><comment wx:if="{{m}}" u-i="1a35f0c9-3" bind:__l="__l" u-p="{{m}}"></comment></view><view wx:else class="commentNull flexV"><image src="/static/indexIc/cpmmentNull.png" mode=""></image> 暂无评论 </view></view><view wx:if="{{n}}"><view class="line"></view><view class="titles">商品详情</view><rich-text nodes="{{o}}"></rich-text></view></view><view wx:if="{{p}}" class="lineBox flexC"><view class="lines"></view><text>商品详情</text><view class="lines"></view></view><view class="" style="height:300rpx"></view><view class="btnBox iosAuto flexJ"><view class="left flexA"><view wx:for="{{q}}" wx:for-item="item" wx:key="g" class="leftIc flexV" bindtap="{{item.h}}"><view class="images"><image src="{{item.a}}" mode=""></image><u-badge wx:if="{{item.b}}" u-i="{{item.c}}" bind:__l="__l" u-p="{{item.d}}"></u-badge></view><text>{{item.e}}</text><button wx:if="{{item.f}}" open-type="contact"></button></view></view><view wx:if="{{r}}" class="flexA"><view class="add flexC" bindtap="{{s}}">加入购物车</view><view class="buy flexC" bindtap="{{t}}">立即购买</view></view><view wx:else class="exchange flexC" bindtap="{{v}}">我要兑换</view></view><pop-pay wx:if="{{x}}" bindclose="{{w}}" u-i="1a35f0c9-5" bind:__l="__l" u-p="{{x}}"></pop-pay></view>
\ No newline at end of file
... ...
... ... @@ -118,6 +118,7 @@
}
.btnBox .left .leftIc {
margin-right: 34rpx;
position: relative;
}
.btnBox .left .leftIc .images {
position: relative;
... ... @@ -134,11 +135,14 @@
font-size: 20rpx;
}
.btnBox .left .leftIc button {
position: relative;
position: absolute;
bottom: 0;
left: 0;
top: 0;
right: 0;
background: transparent;
width: 100%;
height: 100%;
color: #323233ff;
/* width: 48rpx;
height: 48rpx; */
font-size: 20rpx;
border: none !important;
padding: 0 !important;
... ...
... ... @@ -48,7 +48,7 @@ page {
.mainBox .orderBox .downTime {
display: flex;
justify-content: flex-end;
margin-bottom: 58rpx;
margin-bottom: 12rpx;
}
.mainBox .orderBox .downTime .u-count-down__text {
color: #fc4338ff;
... ...
... ... @@ -28,7 +28,7 @@ const _sfc_main = {
common_vendor.index.getStorageSync("defaultAdres") ? adress.value = common_vendor.index.getStorageSync("defaultAdres") : "";
});
common_vendor.onShow(() => {
common_vendor.index.getStorageSync("balance") ? balance.value = common_vendor.index.getStorageSync("balance") : "";
getyues();
});
let modeShow = common_vendor.ref(false);
let payParams = common_vendor.ref({});
... ... @@ -53,6 +53,15 @@ const _sfc_main = {
console.log("getbBuyData", err);
}
};
const getyues = async () => {
try {
const res = await api_index.getyue();
balance.value = res.money;
} catch (err) {
common_vendor.index.showToast({ title: err, icon: "none" });
console.log("getyue", err);
}
};
const getCarsettlements = async (ids) => {
try {
const res = await api_index.getCarsettlement(ids);
... ...
<u-navbar wx:if="{{a}}" u-i="0a9b88e7-0" bind:__l="__l" u-p="{{a}}"></u-navbar><view class="mainBox"><view wx:if="{{b}}" class="checkAddress flexJ" bindtap="{{c}}"><view class="add flexA"><image src="/static/shopCarIc/address.png" mode=""></image> 新增收货地址 </view><image src="/static/mineIc/gayRight.png" mode=""></image></view><view wx:else><shop-addres wx:if="{{d}}" u-i="0a9b88e7-1" bind:__l="__l" u-p="{{d}}"></shop-addres></view><view class="ordersShop"><view wx:for="{{e}}" wx:for-item="item" wx:key="g" class="shop flexJ"><view class="shopPhoto"><image src="{{item.a}}" mode=""></image></view><view class="shopInfo"><view class="shopName ellipsis">{{item.b}}</view><view class="shopDesc ellipsis">{{item.c}}</view><view class="price flexJ"><text wx:if="{{f}}">¥{{item.d}}</text><view wx:else class="flexA points">{{item.e}}<text>积分</text></view><view class="num">x{{item.f}}</view></view></view></view><view class="line"></view><view class="modeBox flexJ"><text>提货方式</text><view class="mode">快递配送</view></view><view wx:if="{{g}}" class="modeBox flexJ"><text>运费</text><view class="yunPrice">¥{{h}}</view></view></view><view class="btnsBox iosAuto flexJ"><view wx:if="{{i}}" class="pointsPrcie flexV"><view class="allPoints flexA"><view class="all">合计:</view><view class="pointsNum">{{j}}<text>积分</text></view></view><view class="pointsMoeny">{{k}}元</view></view><view wx:else class="allMoney flexA"><text>总价:</text> {{l}}</view><view class="btn flexC" bindtap="{{n}}">{{m}}</view></view><pay-mode wx:if="{{p}}" bindcanclePop="{{o}}" u-i="0a9b88e7-2" bind:__l="__l" u-p="{{p}}"></pay-mode><tip-pop wx:if="{{r}}" bindpointsBtns="{{q}}" u-i="0a9b88e7-3" bind:__l="__l" u-p="{{r}}"></tip-pop></view>
\ No newline at end of file
<u-navbar wx:if="{{a}}" u-i="0a9b88e7-0" bind:__l="__l" u-p="{{a}}"></u-navbar><view class="mainBox"><view wx:if="{{b}}" class="checkAddress flexJ" bindtap="{{c}}"><view class="add flexA"><image src="/static/shopCarIc/address.png" mode=""></image> 新增收货地址 </view><image src="/static/mineIc/gayRight.png" mode=""></image></view><view wx:else><shop-addres wx:if="{{d}}" u-i="0a9b88e7-1" bind:__l="__l" u-p="{{d}}"></shop-addres></view><view class="ordersShop"><view wx:for="{{e}}" wx:for-item="item" wx:key="g" class="shop flexJ"><view class="shopPhoto"><image src="{{item.a}}" mode=""></image></view><view class="shopInfo"><view class="shopName ellipsis">{{item.b}}</view><view class="shopDesc ellipsis">{{item.c}}</view><view class="price flexJ"><text wx:if="{{f}}">¥{{item.d}}</text><view wx:else class="flexA points">{{item.e}} <text>积分</text></view><view class="num">x{{item.f}}</view></view></view></view><view class="line"></view><view class="modeBox flexJ"><text>提货方式</text><view class="mode">快递配送</view></view><view wx:if="{{g}}" class="modeBox flexJ"><text>运费</text><view class="yunPrice">¥{{h}}</view></view></view><view class="btnsBox iosAuto flexJ"><view wx:if="{{i}}" class="pointsPrcie flexV"><view class="allPoints flexA"><view class="all">合计:</view><view class="pointsNum">{{j}} <text>积分</text></view></view><view class="pointsMoeny">{{k}}元</view></view><view wx:else class="allMoney flexA"><text>总价:</text> {{l}}</view><view class="btn flexC" bindtap="{{n}}">{{m}}</view></view><pay-mode wx:if="{{p}}" bindcanclePop="{{o}}" u-i="0a9b88e7-2" bind:__l="__l" u-p="{{p}}"></pay-mode><tip-pop wx:if="{{r}}" bindpointsBtns="{{q}}" u-i="0a9b88e7-3" bind:__l="__l" u-p="{{r}}"></tip-pop></view>
\ No newline at end of file
... ...
... ... @@ -25,7 +25,7 @@
/* 透明度 */
/* 文章场景相关 */
page {
background: #F6F8FA;
background: #f6f8fa;
}
.mainBox {
width: 100%;
... ...
... ... @@ -16,6 +16,13 @@
"query": "status=0",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/index/shopDetaile",
"query": "id=107",
"launchMode": "default",
"scene": null
}
]
}
... ...