Browse Source

选择卡类型

yxb
DESKTOP-2IO5MST\huting 2 years ago
parent
commit
a45871408a

+ 1
- 1
pages/user/user.vue View File

@@ -327,7 +327,7 @@
console.log('用户信息', res)
let data = stringToJson(res.bizContent)
state.accountInfoVo = data.accountInfoVo;
if(data.monthFlowingVo){
if(data.monthFlowingVo && JSON.stringify(data.monthFlowingVo) != "{}"){
state.monthFlowingVo = data.monthFlowingVo;
state.isTrajectory=true;
}

+ 1
- 1
subpackage/orders/car-release.vue View File

@@ -234,7 +234,7 @@
state.show = true;
} else {
// 签约
if(state.isSign == 1){
if(state.isSign == 1 || state.isSign == 3){
if (!hasLogin()) {
uni.redirectTo({
url: `/subpackage/orders/addAddress?orderId=${state.form.orderId

+ 64
- 49
subpackage/orders/choice-product.vue View File

@@ -3,7 +3,7 @@
<navBgCar></navBgCar>
<view class="content-value">
<view
@click="savaHandle(item)"
@click="savaHandle(item)"
class="ul-item"
v-for="(item, index) in state.dataArray"
:key="index"
@@ -33,6 +33,17 @@
</view>
<view class="bottomTip"> 到底啦!敬请期待其他产品! </view>
</view>
<u-popup mode="center" v-model="state.choiceCardShow">
<view class="squire">
<u-radio-group>
<u-radio :customStyle="{marginBottom: '8px'}" activeColor="#2CE242"
v-for="(item, index) in state.radiolist1" :key="index" :label="item.disabled" :name="item.name"
@change="radioChange">
{{item.name}}
</u-radio>
</u-radio-group>
</view>
</u-popup>
</template>

<script setup lang="ts">
@@ -52,42 +63,52 @@ const imgURL = `${fileURL}image/`;
// import { setItem } from "@/utils/storage";

const scrollTop = ref(0); //滚动距离

// 单选默认数据
// let flag = ref(true)
// 单选
const radioChange = (n) => {
console.log('radioChange', n);
if (n == '记账卡') {
state.isValueCard=1
} else if(n == '储值卡'){
state.isValueCard=2
}else{
state.isValueCard=3
}
uni.redirectTo({
url: `/subpackage/orders/essential-information?promoteId=${getItem("promoteId")}&userType=${state.userType}&type=${state.type}&isSign=${state.isSign}&isValueCard=${state.isValueCard}`,
});
}
const savaHandle = (val) => {
state.choiceCardShow=true;
console.log("vAL",val)
// productReCodeAction(val.id).then((value) => {
// if (val.isValueCard === 2) {
setItem("clientFee", val.clientFee);
setItem("promoteId", val.promoteId);
setItem("isValueCard", val.isValueCard);
state.isSign=val.isSign;
uni.redirectTo({
url: `/subpackage/orders/essential-information?promoteId=${val.promoteId}&userType=${state.userType}&type=${state.type}&isSign=${state.isSign}`,
});

// if (state.userType === 1) {
// uni.redirectTo({
// url: `/subpackage/orders/opening-account-people?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}`,
// });
// } else {
// uni.redirectTo({
// url: `/subpackage/orders/opening-account-unit?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}`,
// });
// }

// if (val.isValueCard === 2) {
// setItem('clientFee', val.clientFee)
// setItem("productId", val.id)
// uni.navigateTo({
// url: `/subpackage/orders/release-products?orderId=${state.orderId}&&clientFee=${val.clientFee}&&id=${val.id}`,
// });
// } else {

// uni.navigateTo({
// url: `/subpackage/orders/product-detail?orderId=${state.orderId}&&clientFee=${val.clientFee}&&id=${val.id}`,
// });
// }
// });
// 判断是几张卡
if(val.cardTypeArr.split(",").length==1){
if(val.cardTypeArr.split(",")[0]=="记账卡"){
state.isValueCard=1
} else if(val.cardTypeArr.split(",")[0] == '储值卡'){
state.isValueCard=2
}else{
state.isValueCard=3
}
uni.redirectTo({
url: `/subpackage/orders/essential-information?promoteId=${getItem("promoteId")}&userType=${state.userType}&type=${state.type}&isValueCard=${state.isValueCard}`,
});
}else{
state.radiolist1=[];
// 处理卡的数据
for(var i=0;i<val.cardTypeArr.split(",").length;i++){
const obj={};
obj["name"]=val.cardTypeArr.split(",")[i];
obj["disabled"]=false;
state.radiolist1.push(obj)
}
console.log("state.radiolist1",state.radiolist1)
}
};

onLoad((option: any) => {
@@ -96,24 +117,6 @@ onLoad((option: any) => {
// state.vehiclePlateColor = option.vehiclePlateColor;
state.userType = option.userType;
state.type = option.type;
// var data = {
// orderId: state.orderId,
// };
// const options = {
// type: 2,
// data: data,
// method: "POST",
// showLoading: true,
// };
// console.log('输出内容',options.data)
// request(etcQueryProduct, options).then((res) => {
// console.log(res.bizContent);
// const data = stringToJson(res.bizContent);
// console.log(data);
// console.log(typeof(data));
// state.dataArray = data?data:[];
// });

var data = {
type: state.type,
source:'WECHAT' //请求方来源
@@ -175,6 +178,9 @@ const productReCodeAction = (id) => {
};

const state = reactive({
isValueCard:1, //卡的类型
radiolist1:[], //选择卡的数据列表
choiceCardShow:false, //选择卡的弹出框
isSign:'',
orderId: "",
userType: 1, //1 个人 2单位
@@ -197,6 +203,9 @@ const state = reactive({
</script>

<style lang="scss" scoped>
::v-deep .u-icon__icon{
top: -4px !important;
}
.bottomTip {
margin-top: 100rpx;
text-align: center;
@@ -349,4 +358,10 @@ const state = reactive({
color: white;
// float: right;
}
::v-deep .u-mode-center-box{
border-radius: 10rpx;
}
.squire{
padding: 20rpx;
}
</style>

+ 8
- 14
subpackage/orders/essential-information.vue View File

@@ -20,7 +20,7 @@
</view>
<view>
<!-- 收货地址 -->
<view v-if="!state.data.address" class="address-lane">
<view v-if="!state.data.region" class="address-lane">
<view class="title">请选择或新增收货地址</view>
<view style="margin-top: 30rpx" class="action">
<button type="default" class="button" @click="state.show = true">
@@ -28,7 +28,7 @@
</button>
</view>
</view>
<view v-if="state.data.address" class="address-lane">
<view v-if="state.data.region" class="address-lane">
<view class="title">收货地址</view>
<view
@click="state.show = true"
@@ -169,7 +169,8 @@ const state = reactive({
},
show: false,
addressArray: [],
isSign:''
isSign:'',
isValueCard:'',
});
const globalParam=()=>{
const options = {
@@ -265,23 +266,15 @@ const nextAction = () => {
console.log(result);
if (state.data.userType == 1) {
uni.navigateTo({
url: `/subpackage/orders/opening-account-people?orderId=${data.orderId}&&vehiclePlateColor=${state.data.vehiclePlateColor}&isSign=${state.isSign}&type=${state.data.type}`,
url: `/subpackage/orders/opening-account-people?orderId=${data.orderId}&&vehiclePlateColor=${state.data.vehiclePlateColor}&isSign=${state.isValueCard}&type=${state.data.type}`,
});
} else {
uni.navigateTo({
url: `/subpackage/orders/opening-account-unit?orderId=${data.orderId}&&vehiclePlateColor=${state.data.vehiclePlateColor}&isSign=${state.isSign}&type=${state.data.type}`,
url: `/subpackage/orders/opening-account-unit?orderId=${data.orderId}&&vehiclePlateColor=${state.data.vehiclePlateColor}&isSign=${state.isValueCard}&type=${state.data.type}`,
});
}
})
// uni.navigateTo({
// url: `/subpackage/orders/choice-product?orderId=${data.orderId}&userType=${state.data.userType}&vehiclePlateColor=${state.data.vehiclePlateColor}`,
// })
// uni.redirectTo({
// url: `/subpackage/orders/choice-product?orderId=${data.orderId}&userType=${state.data.userType}&vehiclePlateColor=${state.data.vehiclePlateColor}`,
// });

}
});
});
@@ -344,7 +337,7 @@ onLoad((option: any) => {
state.data.type = option.type; //客车
state.data.userType = option.userType;
state.data.promoteId = option.promoteId;
state.isSign=option.isSign
state.isValueCard=option.isValueCard
console.log("订单选择推广发行产品接口",option)
uni.getLocation({
type: 'wgs84',
@@ -418,6 +411,7 @@ const productReCodeAction = (orderId) => {
var data = {
promoteId: state.data.promoteId,
orderId: orderId,
isValueCard:state.isValueCard
};
const options = {
type: 2,

Loading…
Cancel
Save