This commit is contained in:
zmj 2024-06-26 14:06:40 +08:00
parent b7af7ef629
commit 03657673fb
6 changed files with 160 additions and 40 deletions

View File

@ -288,15 +288,29 @@
const currentTab = ref(1) const currentTab = ref(1)
const formData = reactive({ const formData = reactive({
// store_id: STORE_INFO.id,
// mobile: "",
// province: 510000,
// city: '',
// area: "",
// street: "",
// village: "",
// real_name: "",
// auth_code: "",
// address: "",
// label_name: "",
// label_id: "",
// user_ship: '',
// code: ''
store_id: STORE_INFO.id, store_id: STORE_INFO.id,
mobile: "", mobile: "19130550023",
province: 510000, province: 510000,
city: '', city: '510600',
area: "", area: "510626",
street: "", street: "510626101",
village: "", village: "",
real_name: "赵明军", real_name: "赵明军",
auth_code: "", auth_code: "131527008529094084",
address: "", address: "",
label_name: "", label_name: "",
label_id: "", label_id: "",
@ -430,16 +444,24 @@
if (!formData.real_name) return uni.$u.toast('请填写真实姓名'); if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
if (!formData.mobile) return uni.$u.toast('请填写电话号码'); if (!formData.mobile) return uni.$u.toast('请填写电话号码');
if (!formData.code) return uni.$u.toast('请输入短信验证码'); if (!formData.code) return uni.$u.toast('请输入短信验证码');
uni.showLoading({
title: '支付中...'
});
formData.store_id = STORE_INFO.id formData.store_id = STORE_INFO.id
if (Role.value == 1) { if (Role.value == 1) {
formData.recharge_type = 'INDUSTRYMEMBERS'
formData.user_ship = 1
vipRechargeApi(formData).then(res => {
// timer = setTimeout(() => {
// uni.hideLoading();
// uni.$u.toast('');
// }, 30000)
})
return
uni.scanCode({ uni.scanCode({
success: function(res) { success: function(res) {
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
if (res.result.length != 14) return uni.$u.toast('二维码未扫描完整'); uni.showLoading({
title: '支付中...'
});
formData.auth_code = res.result formData.auth_code = res.result
formData.recharge_type = 'INDUSTRYMEMBERS' formData.recharge_type = 'INDUSTRYMEMBERS'
formData.user_ship = 1 formData.user_ship = 1
@ -482,7 +504,7 @@
const rePay = (item) => { const rePay = (item) => {
uni.scanCode({ uni.scanCode({
success: function(res) { success: function(res) {
if (res.result.length != 14) return uni.$u.toast('二维码未扫描完整'); if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
uni.showLoading({ uni.showLoading({
title: '支付中...' title: '支付中...'
}); });

View File

@ -34,7 +34,11 @@
<view class="title"> <view class="title">
<view class="name u-line-2">{{item.goods_name}}</view> <view class="name u-line-2">{{item.goods_name}}</view>
<view class="tip u-line-1">{{item.unit_name}}</view> <view class="tip u-line-1">{{item.unit_name}}</view>
<view class="tip u-line-1">原价<text
style="text-decoration: line-through;">{{item.unit_name}}</text>
</view>
</view> </view>
<view class="price-btn"> <view class="price-btn">
<view class="price">{{item.sell}}</view> <view class="price">{{item.sell}}</view>
<view class="btn"> <view class="btn">
@ -50,6 +54,7 @@
icon="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/29955202404260944367594.png"> icon="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/29955202404260944367594.png">
</up-empty> </up-empty>
</view> </view>
{{priceKey}}
<view style="width: 100%;height: 200rpx;"></view> <view style="width: 100%;height: 200rpx;"></view>
</view> </view>
</scroll-view> </scroll-view>
@ -129,7 +134,8 @@
<script setup> <script setup>
import { import {
onShow onShow,
onLoad
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
import { import {
computed, computed,
@ -257,6 +263,7 @@
cartList.value = res.data.lists; cartList.value = res.data.lists;
cartInfo.value = { cartInfo.value = {
total_price: res.data?.extend.total_price || '0.00', total_price: res.data?.extend.total_price || '0.00',
pay_price: res.data?.extend.pay_price || '0.00',
count: res.data?.count || 0 count: res.data?.count || 0
} }
setTimeout(() => { setTimeout(() => {
@ -266,7 +273,7 @@
} }
const c_price0 = computed(() => { const c_price0 = computed(() => {
let price = cartInfo.value.total_price + ''; let price = cartInfo.value.pay_price + '';
return price.split('.')[0] || '0'; return price.split('.')[0] || '0';
}) })
const c_price1 = computed(() => { const c_price1 = computed(() => {
@ -329,6 +336,12 @@
onShow(() => { onShow(() => {
getcartList(); getcartList();
}) })
let priceKey = ref({})
onLoad(opt => {
if (opt.priceKey) {
priceKey.value = JSON.parse(opt.priceKey)
}
})
</script> </script>
<style lang="scss"> <style lang="scss">
@ -403,8 +416,8 @@
} }
.shop-img { .shop-img {
height: 120rpx; height: 164rpx;
width: 120rpx; width: 164rpx;
margin-right: 20rpx; margin-right: 20rpx;
border-radius: 14rpx; border-radius: 14rpx;
} }

View File

@ -44,7 +44,7 @@
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword" <up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
:showAction="false"></up-search> :showAction="false"></up-search>
</view> </view>
<view class="nav-item" @click="navTo('/pages/cart/cart')"> <view class="nav-item" @click="navTo(`/pages/cart/cart?priceKey=${JSON.stringify(priceKey) }`)">
<image src="@/static/tab/ba.png"></image> <image src="@/static/tab/ba.png"></image>
<text>购物车</text> <text>购物车</text>
</view> </view>
@ -171,10 +171,18 @@
赠10%品牌礼品 赠10%品牌礼品
</view> </view>
</view> </view>
<view class="shop-content-li" style="color: #999999;"> <view class="shop-content-li" style="color: #999999;" v-if="priceKey.off_activity==1">
<view class="shop-content-li-l">&nbsp;&nbsp;&nbsp;</view> <view class="shop-content-li-l">&nbsp;&nbsp;&nbsp;</view>
<view class="shop-content-li-r line-through">{{item[priceKey.op_price]}}</view> <view class="shop-content-li-r line-through">{{item[priceKey.op_price]}}</view>
</view> </view>
<view class="shop-content-li" v-else>
<view class="shop-content-li-l">&nbsp;&nbsp;&nbsp;</view>
<view class="shop-content-li-r" style="color:#FC452F ;"><text
style="font-size: 28rpx;">{{item[priceKey.op_price]}}</text>
</view>
</view>
<view class="shop-content-li" style="justify-content: space-between;"> <view class="shop-content-li" style="justify-content: space-between;">
<view style="display: flex;"> <view style="display: flex;">
<view class="shop-content-li-l">&nbsp;&nbsp;&nbsp;</view> <view class="shop-content-li-l">&nbsp;&nbsp;&nbsp;</view>
@ -204,7 +212,7 @@
<view class="row"> <view class="row">
<view>合计</view> <view>合计</view>
<view class="price" v-if='cartInfo.pay_price<=0||userStore?.userInfo?.user_ship !=4'>¥<text <view class="price" v-if='cartInfo.pay_price<=0||userStore?.userInfo?.user_ship !=4'>¥<text
style="font-size: 36rpx;">{{ cartInfo.total_price }}</text></view> style="font-size: 36rpx;">{{ cartInfo.pay_price }}</text></view>
</view> </view>
<view style="font-size: 22rpx;text-indent: 3em;color: #F55726;" <view style="font-size: 22rpx;text-indent: 3em;color: #F55726;"
v-if="cartInfo.msg&&cartInfo.total_price>0 "> v-if="cartInfo.msg&&cartInfo.total_price>0 ">
@ -212,15 +220,36 @@
</view> </view>
</view> </view>
<view class="btn"> <view class="btn">
<up-button color="#20b128" @click="settleAccounts"> 结算</up-button> <up-button color="#20b128" :disabled="cartInfo.pay_price<=0" @click="settleAccounts"> 结算</up-button>
</view> </view>
<view class="cart" @click="navTo('/pages/cart/cart')"> <view class="cart" @click="navTo(`/pages/cart/cart?priceKey=${JSON.stringify(priceKey)}`)">
<image src="@/static/icon/cart.png"></image> <image src="@/static/icon/cart.png"></image>
<view class="badge">{{ cartInfo.count }}</view> <view class="badge">{{ cartInfo.count }}</view>
</view> </view>
</view> </view>
<goodPopup ref="goodRef" :show="showGoodPopup" @close="showGoodPopup = false" @change="changeGood" /> <goodPopup ref="goodRef" :show="showGoodPopup" @close="showGoodPopup = false" @change="changeGood" />
<u-overlay :show="showOverlay" @click="showOverlay = false">
<view class="warp">
<view class="rect" @tap.stop>
<view class="rect-tit">
温馨提示
</view>
<view class="rect-contetn">
只需再购买 {{500- cartInfo.pay_price}} 就能拥有10%的品牌礼品券若错过此次机会则无礼品券
</view>
<view class="rect-btn">
<view style="width: 236rpx;">
<up-button @click="abandActive">放弃优惠</up-button>
</view>
<view style="width: 236rpx;">
<up-button color="#20b128" @click="showOverlay=false">继续采购</up-button>
</view>
</view>
</view>
</view>
</u-overlay>
</view> </view>
</template> </template>
@ -416,6 +445,7 @@
const loading = ref(true); const loading = ref(true);
const goodList = ref([]); const goodList = ref([]);
const getGoodList = (loadmore = false) => { const getGoodList = (loadmore = false) => {
where.value.store_id = STORE_INFO.id; // id
loading.value = true; loading.value = true;
let class_id = rightActive.value || leftActive.value || topActive.value || ''; let class_id = rightActive.value || leftActive.value || topActive.value || '';
let class_all = ''; let class_all = '';
@ -589,8 +619,21 @@
addCart(data.product_id, data.cart_num); addCart(data.product_id, data.cart_num);
} }
// //
const showOverlay = ref(false); //
const abandActive = () => {
showOverlay.value = false
uni.navigateTo({
url: '/pagesOrder/settle/settle'
})
}
const settleAccounts = () => { const settleAccounts = () => {
if (+cartInfo.value.pay_price < 500) return showOverlay.value = true;
uni.navigateTo({ uni.navigateTo({
url: '/pagesOrder/settle/settle' url: '/pagesOrder/settle/settle'
}) })
@ -744,11 +787,13 @@
.badge { .badge {
position: absolute; position: absolute;
top: -10rpx; top: -10rpx;
right: 0; right: 10rpx;
background-color: #FF0000; background-color: #FF0000;
color: #FFFFFF; color: #FFFFFF;
padding: 0 8rpx; text-align: center;
border-radius: 50rpx; width: 30rpx;
height: 30rpx;
border-radius: 30rpx;
font-size: 18rpx; font-size: 18rpx;
} }
@ -1077,13 +1122,8 @@
// background-size: 100% 100%; // background-size: 100% 100%;
// margin: 5rpx; // margin: 5rpx;
// } // }
} }
} }
} }
@ -1155,4 +1195,41 @@
margin: 0 0 20rpx 20rpx; margin: 0 0 20rpx 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
} }
.warp {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.rect {
width: 630rpx;
height: 440rpx;
background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/9c70c202406261048431851.png');
background-size: 100% 100%;
box-sizing: border-box;
text-align: center;
// padding: 30rpx;
padding: 50rpx 32rpx;
.rect-tit {
text-align: center;
font-size: 32rpx;
color: #333333;
margin-bottom: 60rpx;
}
.rect-contetn {
font-size: 30rpx;
color: #333333;
}
.rect-btn {
display: flex;
margin-top: 50rpx;
justify-content: space-around;
}
}
</style> </style>

View File

@ -51,13 +51,15 @@
<view class="rest-item-num">{{userInfo.purchase_funds||'0.00'}}</view> <view class="rest-item-num">{{userInfo.purchase_funds||'0.00'}}</view>
<view class="rest-item-txt">采购款</view> <view class="rest-item-txt">采购款</view>
</view> </view>
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=4')"> <!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')"> -->
<view class="rest-item-num">{{userInfo.return_money||'0.00'}}</view> <view class="rest-item">
<view class="rest-item-txt">返还金</view>
</view>
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')">
<view class="rest-item-num">{{userInfo.integral ||"0.00"}}</view> <view class="rest-item-num">{{userInfo.integral ||"0.00"}}</view>
<view class="rest-item-txt">礼品券</view> <view class="rest-item-txt">冻结礼品券</view>
</view>
<!-- <view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')"> -->
<view class="rest-item">
<view class="rest-item-num">{{userInfo.integral ||"0.00"}}</view>
<view class="rest-item-txt">可用礼品券</view>
</view> </view>
</view> </view>
<view class="order-info-box"> <view class="order-info-box">

View File

@ -371,11 +371,11 @@
const passwordBoardProps = { const passwordBoardProps = {
title: '输入支付密码', title: '输入支付密码',
onComplete(value) { onComplete(value) {
uni.vibrateShort({ // uni.vibrateShort({
success: function() { // success: function() {
console.log('success'); // console.log('success');
} // }
}); // });
password.value = value password.value = value
passwordBoardVisible.value = false passwordBoardVisible.value = false
payFn() payFn()

View File

@ -43,6 +43,12 @@
} }
break; break;
} }
uni.vibrateShort({
success: function () {
console.log('success');
}
});
console.log("点击了")
if (refValue.value.length === props.num) { if (refValue.value.length === props.num) {
emits('complete', refValue.value.join('')); emits('complete', refValue.value.join(''));
} }