This commit is contained in:
zmj 2024-07-05 18:18:02 +08:00
parent 001fdd05d8
commit f15573e557
6 changed files with 158 additions and 59 deletions

View File

@ -162,3 +162,7 @@ export const checkInventoryApi = (data) => {
export const isUserShipApi = (data) => {
return request.post('/user_ship/UserShip/is_user_ship', data);
}
export const getRechargeListApi = (data) => {
return request.get('/user/UserRecharge/recharge_list', data);
}

View File

@ -32,7 +32,7 @@
<view class="content" v-if='type==4'>
<view class="li" v-for="(item,index) in lists" :key="index">
<view class="li-top">
<text>{{item.order_sn}}</text>
<text>{{item.title}}</text>
<text style="font-weight: bold;" :style="{color:!item.status?'#50C758':'red'
}">{{ !item.status?'+':'-' }}{{item.number}}</text>
</view>

View File

@ -0,0 +1,11 @@
<template>
<image style="width: 100vw" mode='widthFix'
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/8d49820240705171635925.png">
</image>
</template>
<script>
</script>
<style>
</style>

View File

@ -31,8 +31,10 @@
<block v-if='currentTab == 0'>
<view class="card card1">
<view class="card1-tit">
行业会员开通报备
<up-input v-model='formData.auth_code'> </up-input>
购买采购包
</view>
<view class="store-info">
报备人{{ STORE_INFO.name }}
</view>
<up-form labelPosition="left" :model="formData" :borderBottom='false'>
<up-form-item label="">
@ -82,23 +84,20 @@
</view>
</up-form-item>
</up-form>
<view class="store-info">
报备人:{{ STORE_INFO.name }}
<view class="link" @click="navgo('/pageQuota/vipUser/activePage')">
点击查看礼品包内容
</view>
<view class="store-info" v-if="Role==1">
<view class="" style="width: 300rpx;margin: 0 auto;border-bottom: 1px solid #F3F3F3;">
<up-input inputAlign='center' type='digit' placeholder="请输入金额" @focus="formData.price=''"
color='#FF6B00' :placeholderStyle="{fontSize:'28rpx'}" fontSize='20px' border="none"
v-model="formData.price" @blur='tofixedPrice'></up-input>
<view class="gift-pack">
<view class="gift-pack-li" :class="index==giftIndex&&'act-gift'"
v-for="(item,index) in rechargeList" :key="index" @click="choseGift(index)">
<view class="gift-pack-li-top" :class="index==giftIndex &&'act-gift-top'">
<text style="font-size: 40rpx;">{{item.money}}</text><text>元采购包</text>
</view>
<view class="">
{{item.send}}{{item.send_string}}
</view>
<view style="color: red;margin-top: 20rpx;font-size: 24rpx;"
v-if="formData.label_limit&&formData.price<formData.label_limit">
{{formData.label_name}}角色最低金额不能低于{{formData.label_limit}}元且最高金额不能超过10000.00
</view>
</view>
</view>
<view class="submit-btn" @click="submit">
<view
@ -160,9 +159,9 @@
<view class="">
{{formData2.label_name}}会员最低金额不能低于{{formData2.label_limit}}
</view>
<view class="">
<!-- <view class="">
最高金额不能超过10000.00
</view>
</view> -->
<view class="">
可单次多笔累计操作
</view>
@ -180,6 +179,8 @@
</view>
</block>
<!-- tabs2 -->
<block v-if="currentTab == 2 &&Role==1">
<view class="vip-card">
@ -311,8 +312,6 @@
</up-popup>
<up-picker :show="showPop1" :columns="columns" @confirm='conformRole' @cancel='showPop1 = false'
@close="showPop1 = false" @open="showPop1 = true" keyName='title' confirmColor='#33B83A'></up-picker>
<up-modal :show="showModal" title="电话号码" content='15884967539' :closeOnClickOverlay="true" :zoom="true"
confirmColor='#33B83A' @confirm='showModal=false' @close="showModal=false">
<view class="slot-content">
@ -337,6 +336,7 @@
} from "@/api/address.js"
import {
vipRechargeApi,
getRechargeListApi,
isUserShipApi,
rechargeCountApi,
reVipRechargeApi,
@ -443,6 +443,7 @@
//
//
const vipList = reactive([1, 2, 3, 5, 6, 7, 8])
const cutDown = ref(0)
const flag = ref(true)
const code = ref('')
@ -579,10 +580,10 @@
} = await getVipInfoByPhone({
mobile: formData2.mobile
})
// if (data.user_ship != 4) {
// uni.hideLoading()
// return uni.$u.toast('');
// }
if (!vipList.includes(data.user_ship)) {
uni.hideLoading()
return uni.$u.toast('查询失败');
}
if (formData.mobile) {
formData2.mobile = formData.mobile
}
@ -597,14 +598,9 @@
}
const tofixedPrice = (type = 1) => {
if (type == 2) return formData2.price = (+formData2.price).toFixed(2)
formData.price = (+formData.price).toFixed(2)
}
const resetFormData = () => {
for (let key in formData) {
formData[key] = ''
(key != 'price') && (formData[key] = '')
}
for (let key in formData2) {
formData2[key] = ''
@ -621,8 +617,6 @@
const conformRole = (e) => {
formData.label_name = e.value[0].title
formData.label_id = e.value[0].id
formData.price = (+e.value[0].limit).toFixed(2)
formData.label_limit = e.value[0].limit
showPop1.value = false
}
@ -724,6 +718,7 @@
]);
let timerInvol = null
let paySuccess;
// scoket
const userInfo = useUserStore().userInfo;
const connection = new Push({
@ -733,13 +728,34 @@
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}`);
user_channel.on('message', function(data) {
try {
uni.hideLoading({});
paySuccess = true
uni.hideLoading();
clearTimeout(timerInvol);
paySuccessToTabs2()
} catch (error) {}
});
//
const navgo = (url) => {
uni.navigateTo({
url
})
}
//
const giftIndex = ref(0)
const rechargeList = ref([])
const getRechargeList = async () => {
let res = await getRechargeListApi()
rechargeList.value = res.data
formData.price = rechargeList.value[0].money
}
const choseGift = (index) => {
giftIndex.value = index
formData.price = rechargeList.value[index].money
}
//
const submit = async (type = 1) => {
@ -787,10 +803,12 @@
formData2.recharge_type = 'INDUSTRYMEMBERS'
formData2.user_ship = formData2.label_id
vipRechargeApi(formData2).then(res => {
paySuccess = false;
timerInvol = setTimeout(() => {
uni.hideLoading();
if (currentTab.value == 2) return;
if (!paySuccess) {
uni.$u.toast('支付超时');
}
}, 30000)
})
}
@ -801,9 +819,9 @@
if (!formData.code) return uni.$u.toast('请输入短信验证码');
if (!formData.address) return uni.$u.toast('请选择地址');
if (!formData.label_id) return uni.$u.toast('请选择用户身份');
if (Number(formData.price) < Number(formData.label_limit)) return uni.$u.toast(
`${formData.label_name}角色最低金额不能低于${formData.label_limit}`);
formData.store_id = STORE_INFO.id
formData.user_ship = formData.label_id
formData.recharge_type = 'INDUSTRYMEMBERS'
if (Role.value == 1) {
// formData.recharge_type = 'INDUSTRYMEMBERS'
// formData.user_ship = formData.label_id
@ -830,14 +848,14 @@
uni.showLoading({
title: '支付中...'
});
formData.user_ship = formData.label_id
formData.auth_code = res.result
formData.recharge_type = 'INDUSTRYMEMBERS'
vipRechargeApi(formData).then(res => {
paySuccess = false;
timerInvol = setTimeout(() => {
uni.hideLoading();
if (currentTab.value == 2) return;
if (!paySuccess) {
uni.$u.toast('支付超时');
}
}, 30000)
})
}
@ -859,13 +877,19 @@
}).then(res => {
timerInvol = setTimeout(() => {
uni.hideLoading();
if (!paySuccess) {
uni.$u.toast('支付超时');
}
}, 30000)
})
}
});
}
const tofixedPrice = (type = 1) => {
if (type == 2) return formData2.price = (+formData2.price).toFixed(2)
}
// formDatatabs2
const paySuccessToTabs2 = () => {
uni.hideLoading()
@ -936,19 +960,12 @@
}
onLoad(() => {
// getUserShip().then(res => {
// range.value = res.data.lists.map(item => {
// return {
// value: item.id,
// text: item.title
// }
// })f
// })
getUserShip().then(res => {
columns.value = [res.data.lists]
})
getPhoneOneDay()
getCityList()
getRechargeList()
})
onPullDownRefresh(() => {
@ -1028,20 +1045,20 @@
}
.card1 {
padding: 52rpx 30rpx;
padding: 30rpx;
.card1-tit {
font-size: 32rpx;
color: #444444;
text-align: center;
margin-bottom: 90rpx;
margin-bottom: 20rpx;
}
.store-info {
font-size: 28rpx;
color: #20B128;
text-align: center;
margin-top: 30rpx;
margin-top: 20rpx;
}
}
@ -1087,7 +1104,7 @@
.address-content {
padding: 20rpx;
height: 50vh;
height: 60vh;
overflow-y: auto;
.address-li {
@ -1123,5 +1140,65 @@
.btn-text {
color: #20B128;
}
.link {
padding-left: 20rpx;
color: #2F6BF2;
font-size: 28rpx;
margin-bottom: 30rpx;
position: relative;
text-decoration: underline;
text-underline-offset: 10rpx;
cursor: pointer;
}
.link::after {
content: '';
width: 12rpx;
height: 12rpx;
background-color: #2F6BF2;
position: absolute;
top: 50%;
transform: translateY(-50%);
border-radius: 12rpx;
left: 0;
}
.gift-pack {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.gift-pack-li {
padding: 20rpx 40rpx;
border: #20B128 1px solid;
border-radius: 24rpx 24rpx 24rpx 24rpx;
background-color: #F6F6F6;
margin-bottom: 20rpx;
font-size: 26rpx;
color: #777777;
width: 310rpx;
box-sizing: border-box;
text-align: center;
.gift-pack-li-top {
margin-bottom: 10rpx;
color: #20B128;
}
.act-gift-top {
color: white;
}
}
.act-gift {
background-color: #38BE41;
color: white;
}
}
</style>

View File

@ -235,6 +235,13 @@
"enablePullDownRefresh": true
}
},
{
"path": "vipUser/activePage",
"style": {
"navigationBarTitleText": "采购礼包",
"enablePullDownRefresh": false
}
},
{
"path": "asset/index",
"style": {

View File

@ -162,8 +162,8 @@
{{ item.store_name }}
</view>
<view class="shop-content-li" v-if="priceKey.off_activity==1">
<view class="shop-content-li-l" style="color: #FC452F;">
活动
<view class="shop-content-li-l">
</view>
<view class="shop-content-li-r" style="color:#FC452F ;"><text
style="font-size: 30rpx;">{{item[priceKey.price]}}</text>/{{ item.unit_name }}
@ -173,10 +173,10 @@
赠10%品牌礼品券
</view>
</view>
<view class="shop-content-li" style="color: #999999;" v-if="priceKey.off_activity==1">
<!-- <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> -->
<view class="shop-content-li" v-else>
<view class="shop-content-li-l">售价</view>