@ -10,8 +10,7 @@
< up-form labelPosition = "left" label -width = " 100rpx " >
< up-form-item label = "身份" borderBottom >
< up-radio-group v-model = "Role" placement="row" >
< up-radio activeColor = "#20b128" label = "行业会员" :name = "1"
style = "margin-right: 10rpx;" > < / up-radio >
< up-radio activeColor = "#20b128" label = "行业会员" :name = "1" style = "margin-right: 10rpx;" > < / up-radio >
< up-radio activeColor = "#20b128" label = "商户" :name = "4" > < / up-radio >
< / up-radio-group >
< / up-form-item >
@ -22,8 +21,8 @@
< view v-else >
< up-sticky bgColor = "#fff" style = "padding: 20rpx;" >
< up-tabs v-if = "Role ==1" :list="tabsLst" :itemStyle = "{width:'33vw',paddingBottom:'20rpx'}"
lineColor = '#50C758' : current = 'currentTab' @ change = "tabsChange" > < / up-tabs >
< up-tabs v-if = "Role == 1" :list="tabsLst" :itemStyle="{ width: '33vw', paddingBottom: '20rpx' }" lineColor = '#50C758'
: current = 'currentTab' @ change = "tabsChange" > < / up-tabs >
< up-tabs v -else :list = "tabsLst2" : itemStyle = "{ width: '50vw', paddingBottom: '20rpx' }" lineColor = '#50C758'
: current = 'currentTab' @ change = "tabsChange1" > < / up-tabs >
< / up-sticky >
@ -31,8 +30,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 = "" >
@ -50,8 +51,8 @@
< / up-form-item >
< up-form-item label = "" >
< view @ click = "showPop = true" style = "width: 100%;" >
< up-input style = "pointer-events: none" v-model = "formData.address" border = "none "
prefixIcon= "map" readonly placeholder = "点击选择地址" : customStyle = " {
< up-input style = "pointer-events: none" v-model = "formData.address" border="none" prefixIcon = "map "
readonly placeholder = "点击选择地址" : customStyle = " {
background : '#F3F3F3' , padding : '20rpx' ,
'border-radius' : '30rpx'
} " :placeholderStyle=" { color : '#444444' } " :prefixIconStyle=" { 'margin-right' : '40rpx' } "
@ -82,23 +83,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
@ -127,12 +125,11 @@
< up-input v-model = "formData2.real_name" disabled border="none" prefixIcon = "account"
placeholder = "系统自动获取" color = 'grey'
: customStyle = "{ background: '#F3F3F3', padding: '20rpx', 'border-radius': '30rpx' }"
: placeholderStyle = "{ color: 'grey' }"
: prefixIconStyle = "{ 'margin-right': '40rpx' }" > < / up-input >
: placeholderStyle = "{ color: 'grey' }" : prefixIconStyle = "{ 'margin-right': '40rpx' }" > < / up-input >
< / up-form-item >
< up-form-item label = "" >
< up-input style = "pointer-events: none" v-model = "formData2.address" border = "none "
prefixIcon= "map" readonly color = 'grey' placeholder = "系统自动获取" : customStyle = " {
< up-input style = "pointer-events: none" v-model = "formData2.address" border="none" prefixIcon = "map "
readonly color = 'grey' placeholder = "系统自动获取" : customStyle = " {
background : '#F3F3F3' , padding : '20rpx' ,
'border-radius' : '30rpx'
} " :placeholderStyle=" { color : 'grey' } " :prefixIconStyle=" { 'margin-right' : '40rpx' } " > < / up-input >
@ -152,17 +149,17 @@
< view class = "store-info" >
< view class = "" style = "width: 300rpx;margin: 0 auto;border-bottom: 1px solid #F3F3F3;" >
< up-input inputAlign = 'center' placeholder = "请输入金额" @ focus = "formData2.price = ''" color = '#FF6B00'
: placeholderStyle = "{ fontSize:'28rpx'}" fontSize = '20px' border = "none"
v- model = "formData2.price" type= 'digit' @ blur = 'tofixedPrice(2)' > < / up-input >
: placeholderStyle = "{ fontSize: '28rpx' }" fontSize = '20px' border = "none" v - model = "formData2.price"
type= 'digit' @ blur = 'tofixedPrice(2)' > < / up-input >
< / view >
< view style = "color: red;margin-top: 20rpx;font-size: 24rpx;"
v - if = "formData2.label_limit && formData2.price < formData2.label_limit" >
< view class = "" >
{ { formData2 . label _name } } 会员最低金额不能低于 { { formData2 . label _limit } } 元
< / view >
< view class = "" >
<!-- < view class = "" >
最高金额不能超过10000 .00 元
< / view >
< / view > -- >
< view class = "" >
可单次多笔累计操作
< / view >
@ -180,6 +177,8 @@
< / view >
< / block >
<!-- tabs2 -- >
< block v-if = "currentTab == 2 && Role == 1" >
< view class = "vip-card" >
@ -272,8 +271,8 @@
: activeStyle = "{ color: '#20B128' }" > < / up-tabs >
< up-line style = "margin-top:20rpx " > < / up-line >
< view class = "address-content" v -if = ' currentAddressIndex = = 0 ' >
< view class = "address-li" : class = '{ act: item.city_code == formData.city }'
v - for = "item in addressList.city" : key = "item.city_code" @ click = "addressLiClick(0, item)" >
< view class = "address-li" : class = '{ act: item.city_code == formData.city }' v -for = " item in addressList.city "
: key = "item.city_code" @ click = "addressLiClick(0, item)" >
< text > { { item . city _name } } < / text >
< up-icon name = "arrow-right" : color = "item.city_code == formData.city ? '#20B128' : '#777777'" / >
< / view >
@ -296,13 +295,12 @@
< view class = "address-li" v-for = "item in addressList.village" @ click = "addressLiClick(3, item)"
: key = "item.village_code" : class = '{ act: item.village_code == formData.village }' >
< text > { { item . village _name } } < / text >
< up-icon name = "arrow-right"
: color = "item.village_code == formData.village ? '#20B128' : '#777777'" / >
< up-icon name = "arrow-right" : color = "item.village_code == formData.village ? '#20B128' : '#777777'" / >
< / view >
< / view >
< view class = "address-content" v -else -if = ' currentAddressIndex = = 4 ' >
< view class = "address-li" : class = '{ act: item.id == formData.brigade }'
v - for = "item in addressList.brigade" : key = "item.id" @ click = "addressLiClick(4, item)" >
< view class = "address-li" : class = '{ act: item.id == formData.brigade }' v -for = " item in addressList.brigade "
: key = "item.id" @ click = "addressLiClick(4, item)" >
< text > { { item . brigade _name } } < / text >
< up-icon name = "arrow-right" : color = "item.id == formData.brigade ? '#20B128' : '#777777'" / >
< / view >
@ -311,15 +309,12 @@
< / 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" >
{ { popPhone } }
< / view >
< / up-modal >
< / template >
< script setup >
import {
@ -337,6 +332,8 @@
} from "@/api/address.js"
import {
vipRechargeApi ,
getRechargeListApi ,
isUserShipApi ,
rechargeCountApi ,
reVipRechargeApi ,
rechargeListsApi ,
@ -442,6 +439,7 @@
/ / 手 机 保 留 一 天 结 束
/ / 验 证 码
const vipList = reactive ( [ 1 , 2 , 3 , 5 , 6 , 7 , 8 ] )
const cutDown = ref ( 0 )
const flag = ref ( true )
const code = ref ( '' )
@ -578,10 +576,10 @@
} = await getVipInfoByPhone ( {
mobile : formData2 . mobile
} )
/ / i f ( d a t a . u s e r _ s h i p ! = 4 ) {
/ / u n i . h i d e L o a d i n g ( )
/ / r e t u r n u n i . $ u . t o a s t ( ' 查 询 失 败 ' ) ;
/ / }
if ( ! vipList . includes ( data . user _ship ) ) {
uni . hideLoading ( )
return uni . $u . toast ( '查询失败' ) ;
}
if ( formData . mobile ) {
formData2 . mobile = formData . mobile
}
@ -596,14 +594,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 ] = ''
@ -620,8 +613,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
}
@ -723,6 +714,7 @@
] ) ;
let timerInvol = null
let paySuccess ;
/ / 开 起 一 个 s c o k e t 监 听 用 户 知 否 支 付 成 功
const userInfo = useUserStore ( ) . userInfo ;
const connection = new Push ( {
@ -732,13 +724,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 ) => {
@ -786,10 +799,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 )
} )
}
@ -800,13 +815,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 ) {
/ / f o r m D a t a . r e c h a r g e _ t y p e = ' I N D U S T R Y M E M B E R S '
/ / f o r m D a t a . u s e r _ s h i p = f o r m D a t a . l a b e l _ i d
@ -821,6 +832,12 @@
/ / } , 1 0 0 0 0 )
/ / } )
/ / r e t u r n
/ / f o r m D a t a . u s e r _ s h i p = f o r m D a t a . l a b e l _ i d
/ / a w a i t i s U s e r S h i p A p i ( {
/ / u s e r _ s h i p : f o r m D a t a . u s e r _ s h i p ,
/ / v i l l a g e : f o r m D a t a . v i l l a g e ,
/ / b r i g a d e : f o r m D a t a . b r i g a d e
/ / } )
uni . scanCode ( {
success : function ( res ) {
if ( String ( res . result . length ) != 18 ) return uni . $u . toast ( '二维码未扫描完整' ) ;
@ -828,13 +845,13 @@
title : '支付中...'
} ) ;
formData . auth _code = res . result
formData . recharge _type = 'INDUSTRYMEMBERS'
formData . user _ship = formData . label _id
vipRechargeApi ( formData ) . then ( res => {
paySuccess = false ;
timerInvol = setTimeout ( ( ) => {
uni . hideLoading ( ) ;
if ( currentTab . value == 2 ) return ;
if ( ! paySuccess ) {
uni . $u . toast ( '支付超时' ) ;
}
} , 30000 )
} )
}
@ -856,13 +873,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 )
}
/ / 支 付 成 功 后 清 除 f o r m D a t a 并 且 切 换 t a b s 2
const paySuccessToTabs2 = ( ) => {
uni . hideLoading ( )
@ -933,19 +956,12 @@
}
onLoad ( ( ) => {
/ / g e t U s e r S h i p ( ) . t h e n ( r e s = > {
/ / r a n g e . v a l u e = r e s . d a t a . l i s t s . m a p ( i t e m = > {
/ / r e t u r n {
/ / v a l u e : i t e m . i d ,
/ / t e x t : i t e m . t i t l e
/ / }
/ / } ) f
/ / } )
getUserShip ( ) . then ( res => {
columns . value = [ res . data . lists ]
} )
getPhoneOneDay ( )
getCityList ( )
getRechargeList ( )
} )
onPullDownRefresh ( ( ) => {
@ -1025,20 +1041,20 @@
}
. card1 {
padding : 52 rpx 30 rpx ;
padding : 30 rpx ;
. card1 - tit {
font - size : 32 rpx ;
color : # 444444 ;
text - align : center ;
margin - bottom : 9 0rpx ;
margin - bottom : 2 0rpx ;
}
. store - info {
font - size : 28 rpx ;
color : # 20 B128 ;
text - align : center ;
margin - top : 3 0rpx ;
margin - top : 2 0rpx ;
}
}
@ -1084,7 +1100,7 @@
. address - content {
padding : 20 rpx ;
height : 5 0vh ;
height : 6 0vh ;
overflow - y : auto ;
. address - li {
@ -1120,5 +1136,65 @@
. btn - text {
color : # 20 B128 ;
}
. link {
padding - left : 20 rpx ;
color : # 2 F6BF2 ;
font - size : 28 rpx ;
margin - bottom : 30 rpx ;
position : relative ;
text - decoration : underline ;
text - underline - offset : 10 rpx ;
cursor : pointer ;
}
. link : : after {
content : '' ;
width : 12 rpx ;
height : 12 rpx ;
background - color : # 2 F6BF2 ;
position : absolute ;
top : 50 % ;
transform : translateY ( - 50 % ) ;
border - radius : 12 rpx ;
left : 0 ;
}
. gift - pack {
display : flex ;
justify - content : space - between ;
flex - wrap : wrap ;
. gift - pack - li {
padding : 20 rpx 40 rpx ;
border : # 20 B128 1 px solid ;
border - radius : 24 rpx 24 rpx 24 rpx 24 rpx ;
background - color : # F6F6F6 ;
margin - bottom : 20 rpx ;
font - size : 26 rpx ;
color : # 777777 ;
width : 310 rpx ;
box - sizing : border - box ;
text - align : center ;
. gift - pack - li - top {
margin - bottom : 10 rpx ;
color : # 20 B128 ;
}
. act - gift - top {
color : white ;
}
}
. act - gift {
background - color : # 38 BE41 ;
color : white ;
}
}
< / style >