add
This commit is contained in:
parent
b7af7ef629
commit
03657673fb
|
@ -288,15 +288,29 @@
|
|||
|
||||
const currentTab = ref(1)
|
||||
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,
|
||||
mobile: "",
|
||||
mobile: "19130550023",
|
||||
province: 510000,
|
||||
city: '',
|
||||
area: "",
|
||||
street: "",
|
||||
city: '510600',
|
||||
area: "510626",
|
||||
street: "510626101",
|
||||
village: "",
|
||||
real_name: "赵明军",
|
||||
auth_code: "",
|
||||
auth_code: "131527008529094084",
|
||||
address: "",
|
||||
label_name: "",
|
||||
label_id: "",
|
||||
|
@ -430,16 +444,24 @@
|
|||
if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
|
||||
if (!formData.mobile) return uni.$u.toast('请填写电话号码');
|
||||
if (!formData.code) return uni.$u.toast('请输入短信验证码');
|
||||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
});
|
||||
formData.store_id = STORE_INFO.id
|
||||
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({
|
||||
success: function(res) {
|
||||
|
||||
if (res.result.length != 14) return uni.$u.toast('二维码未扫描完整');
|
||||
|
||||
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
|
||||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
});
|
||||
formData.auth_code = res.result
|
||||
formData.recharge_type = 'INDUSTRYMEMBERS'
|
||||
formData.user_ship = 1
|
||||
|
@ -482,7 +504,7 @@
|
|||
const rePay = (item) => {
|
||||
uni.scanCode({
|
||||
success: function(res) {
|
||||
if (res.result.length != 14) return uni.$u.toast('二维码未扫描完整');
|
||||
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
|
||||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
});
|
||||
|
|
|
@ -34,7 +34,11 @@
|
|||
<view class="title">
|
||||
<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">原价:<text
|
||||
style="text-decoration: line-through;">¥{{item.unit_name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="price-btn">
|
||||
<view class="price">¥{{item.sell}}</view>
|
||||
<view class="btn">
|
||||
|
@ -50,6 +54,7 @@
|
|||
icon="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/29955202404260944367594.png">
|
||||
</up-empty>
|
||||
</view>
|
||||
{{priceKey}}
|
||||
<view style="width: 100%;height: 200rpx;"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
@ -129,7 +134,8 @@
|
|||
|
||||
<script setup>
|
||||
import {
|
||||
onShow
|
||||
onShow,
|
||||
onLoad
|
||||
} from "@dcloudio/uni-app"
|
||||
import {
|
||||
computed,
|
||||
|
@ -257,6 +263,7 @@
|
|||
cartList.value = res.data.lists;
|
||||
cartInfo.value = {
|
||||
total_price: res.data?.extend.total_price || '0.00',
|
||||
pay_price: res.data?.extend.pay_price || '0.00',
|
||||
count: res.data?.count || 0
|
||||
}
|
||||
setTimeout(() => {
|
||||
|
@ -266,7 +273,7 @@
|
|||
}
|
||||
|
||||
const c_price0 = computed(() => {
|
||||
let price = cartInfo.value.total_price + '';
|
||||
let price = cartInfo.value.pay_price + '';
|
||||
return price.split('.')[0] || '0';
|
||||
})
|
||||
const c_price1 = computed(() => {
|
||||
|
@ -329,6 +336,12 @@
|
|||
onShow(() => {
|
||||
getcartList();
|
||||
})
|
||||
let priceKey = ref({})
|
||||
onLoad(opt => {
|
||||
if (opt.priceKey) {
|
||||
priceKey.value = JSON.parse(opt.priceKey)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
@ -403,8 +416,8 @@
|
|||
}
|
||||
|
||||
.shop-img {
|
||||
height: 120rpx;
|
||||
width: 120rpx;
|
||||
height: 164rpx;
|
||||
width: 164rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 14rpx;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
|
||||
:showAction="false"></up-search>
|
||||
</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>
|
||||
<text>购物车</text>
|
||||
</view>
|
||||
|
@ -171,10 +171,18 @@
|
|||
赠10%品牌礼品
|
||||
</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">原 价</view>
|
||||
<view class="shop-content-li-r line-through">¥{{item[priceKey.op_price]}}</view>
|
||||
</view>
|
||||
|
||||
<view class="shop-content-li" v-else>
|
||||
<view class="shop-content-li-l">售 价</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 style="display: flex;">
|
||||
<view class="shop-content-li-l">规 格</view>
|
||||
|
@ -204,7 +212,7 @@
|
|||
<view class="row">
|
||||
<view>合计</view>
|
||||
<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 style="font-size: 22rpx;text-indent: 3em;color: #F55726;"
|
||||
v-if="cartInfo.msg&&cartInfo.total_price>0 ">
|
||||
|
@ -212,15 +220,36 @@
|
|||
</view>
|
||||
</view>
|
||||
<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 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>
|
||||
<view class="badge">{{ cartInfo.count }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<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>
|
||||
</template>
|
||||
|
||||
|
@ -416,6 +445,7 @@
|
|||
const loading = ref(true);
|
||||
const goodList = ref([]);
|
||||
const getGoodList = (loadmore = false) => {
|
||||
where.value.store_id = STORE_INFO.id; // 店铺id
|
||||
loading.value = true;
|
||||
let class_id = rightActive.value || leftActive.value || topActive.value || '';
|
||||
let class_all = '';
|
||||
|
@ -589,8 +619,21 @@
|
|||
|
||||
addCart(data.product_id, data.cart_num);
|
||||
}
|
||||
|
||||
|
||||
// 结算
|
||||
const showOverlay = ref(false); // 遮罩层显示状态
|
||||
|
||||
const abandActive = () => {
|
||||
showOverlay.value = false
|
||||
uni.navigateTo({
|
||||
url: '/pagesOrder/settle/settle'
|
||||
})
|
||||
}
|
||||
|
||||
const settleAccounts = () => {
|
||||
|
||||
if (+cartInfo.value.pay_price < 500) return showOverlay.value = true;
|
||||
uni.navigateTo({
|
||||
url: '/pagesOrder/settle/settle'
|
||||
})
|
||||
|
@ -744,11 +787,13 @@
|
|||
.badge {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: 0;
|
||||
right: 10rpx;
|
||||
background-color: #FF0000;
|
||||
color: #FFFFFF;
|
||||
padding: 0 8rpx;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 30rpx;
|
||||
font-size: 18rpx;
|
||||
}
|
||||
|
||||
|
@ -1077,13 +1122,8 @@
|
|||
// background-size: 100% 100%;
|
||||
// margin: 5rpx;
|
||||
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1155,4 +1195,41 @@
|
|||
margin: 0 0 20rpx 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>
|
|
@ -51,13 +51,15 @@
|
|||
<view class="rest-item-num">{{userInfo.purchase_funds||'0.00'}}</view>
|
||||
<view class="rest-item-txt">采购款</view>
|
||||
</view>
|
||||
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=4')">
|
||||
<view class="rest-item-num">{{userInfo.return_money||'0.00'}}</view>
|
||||
<view class="rest-item-txt">返还金</view>
|
||||
</view>
|
||||
<view class="rest-item" @click="navgo('/pageQuota/balanceDetail/index?type=3')">
|
||||
<!-- <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 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 class="order-info-box">
|
||||
|
|
|
@ -371,11 +371,11 @@
|
|||
const passwordBoardProps = {
|
||||
title: '输入支付密码',
|
||||
onComplete(value) {
|
||||
uni.vibrateShort({
|
||||
success: function() {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
// uni.vibrateShort({
|
||||
// success: function() {
|
||||
// console.log('success');
|
||||
// }
|
||||
// });
|
||||
password.value = value
|
||||
passwordBoardVisible.value = false
|
||||
payFn()
|
||||
|
|
|
@ -43,6 +43,12 @@
|
|||
}
|
||||
break;
|
||||
}
|
||||
uni.vibrateShort({
|
||||
success: function () {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
console.log("点击了")
|
||||
if (refValue.value.length === props.num) {
|
||||
emits('complete', refValue.value.join(''));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue