...
|
...
|
@@ -19,14 +19,15 @@ |
|
|
<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="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>
|
|
|
<text v-if="shopType != 3">¥{{ item.goods_price }}</text>
|
|
|
<view v-else class="flexA points">
|
|
|
{{orderInfo.coscore}}<text>积分</text>
|
|
|
{{ orderInfo.coscore }}
|
|
|
<text>积分</text>
|
|
|
</view>
|
|
|
<view class="num">x{{item.total_num}}</view>
|
|
|
<view class="num">x{{ item.total_num }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
...
|
...
|
@@ -35,44 +36,54 @@ |
|
|
<text>提货方式</text>
|
|
|
<view class="mode">快递配送</view>
|
|
|
</view>
|
|
|
<view class="modeBox flexJ" v-if="shopType==3">
|
|
|
<view class="modeBox flexJ" v-if="shopType == 3">
|
|
|
<text>运费</text>
|
|
|
<view class="yunPrice">¥{{orderInfo.express_price}}</view>
|
|
|
<view class="yunPrice">¥{{ orderInfo.express_price }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="btnsBox iosAuto flexJ">
|
|
|
<!-- 积分购买 -->
|
|
|
<view class="pointsPrcie flexV" v-if="shopType==3">
|
|
|
<view class="pointsPrcie flexV" v-if="shopType == 3">
|
|
|
<view class="allPoints flexA">
|
|
|
<view class="all">合计:</view>
|
|
|
<view class="pointsNum">
|
|
|
{{orderInfo.coscore}}<text>积分</text>
|
|
|
{{ orderInfo.coscore }}
|
|
|
<text>积分</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="pointsMoeny">{{orderInfo.express_price}}元</view>
|
|
|
<view class="pointsMoeny">{{ orderInfo.express_price }}元</view>
|
|
|
</view>
|
|
|
<!-- 非积分购买 -->
|
|
|
<view class="allMoney flexA" v-else>
|
|
|
<text>总价:</text> {{orderInfo.total_price}}
|
|
|
<text>总价:</text>
|
|
|
{{ orderInfo.total_price }}
|
|
|
</view>
|
|
|
<view class="btn flexC" @click="btns">{{ shopType==3 ? '立即兑换' : '立即购买' }}</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>
|
|
|
<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) {
|
|
|
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 {
|
...
|
...
|
@@ -82,26 +93,27 @@ |
|
|
console.log(e.params, '商品规格信息')
|
|
|
}
|
|
|
//默认地址
|
|
|
uni.getStorageSync('defaultAdres') ? adress.value = uni.getStorageSync('defaultAdres') : ''
|
|
|
})
|
|
|
onShow(()=> {
|
|
|
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)=>{
|
|
|
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
|
|
|
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商品
|
...
|
...
|
@@ -109,12 +121,24 @@ |
|
|
console.log('getbBuyData', res)
|
|
|
// 保存数据
|
|
|
} catch (err) {
|
|
|
uni.showToast({ title:err,icon:'none' })
|
|
|
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)=>{
|
|
|
}
|
|
|
|
|
|
// 购物车结算
|
|
|
const getCarsettlements = async ids => {
|
|
|
try {
|
|
|
const res = await getCarsettlement(ids)
|
|
|
buyShop.value = res.goods_list //购买de商品
|
...
|
...
|
@@ -122,52 +146,51 @@ |
|
|
console.log('getCarsettlement', res)
|
|
|
// 保存数据
|
|
|
} catch (err) {
|
|
|
uni.showToast({ title:err,icon:'none' })
|
|
|
uni.showToast({ title: err, icon: 'none' })
|
|
|
console.log('getCarsettlement', err)
|
|
|
}
|
|
|
}
|
|
|
let adress = ref({}) //收货地址
|
|
|
// 选择地址
|
|
|
const checkAddress = ()=> {
|
|
|
}
|
|
|
let adress = ref({}) //收货地址
|
|
|
// 选择地址
|
|
|
const checkAddress = () => {
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/mine/myAddress?isCheck=${1}`,
|
|
|
events: {
|
|
|
steBack: data => {
|
|
|
adress.value = data
|
|
|
console.log('地址',data)
|
|
|
console.log('地址', data)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
// 是否使用积分弹窗
|
|
|
const tipShow = ref(false)
|
|
|
// 是否使用积分 0否 1 是
|
|
|
const pointsBtns = (type)=>{
|
|
|
}
|
|
|
// 是否使用积分弹窗
|
|
|
const tipShow = ref(false)
|
|
|
// 是否使用积分 0否 1 是
|
|
|
const pointsBtns = type => {
|
|
|
tipShow.value = false
|
|
|
if(type == 1) {
|
|
|
if (type == 1) {
|
|
|
modeShow.value = true
|
|
|
}
|
|
|
}
|
|
|
// 立即购买按钮 shopType== 1 || 2立即购买 == shopType==3立即兑换按钮
|
|
|
const btns = ()=> {
|
|
|
if(shopType.value==3) {
|
|
|
}
|
|
|
// 立即购买按钮 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' })
|
|
|
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;
|
|
|
}
|
|
|
page {
|
|
|
background: #f6f8fa;
|
|
|
}
|
|
|
|
|
|
.mainBox {
|
|
|
.mainBox {
|
|
|
width: 100%;
|
|
|
padding: 20rpx 24rpx 0;
|
|
|
box-sizing: border-box;
|
...
|
...
|
@@ -329,9 +352,9 @@ |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.btnsBox {
|
|
|
.btnsBox {
|
|
|
position: fixed;
|
|
|
left: 0;
|
|
|
bottom: 0;
|
...
|
...
|
@@ -368,7 +391,6 @@ |
|
|
margin-left: 32rpx;
|
|
|
|
|
|
.allPoints {
|
|
|
|
|
|
.all {
|
|
|
color: #000000ff;
|
|
|
font-size: 30rpx;
|
...
|
...
|
@@ -394,5 +416,5 @@ |
|
|
font-size: 24rpx;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</style> |
...
|
...
|
|