|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- <template>
- <navBar title="选择产品" :scrollTop="scrollTop"></navBar>
- <navBgCar></navBgCar>
- <view class="content-value">
- <view
- @click="savaHandle(item)"
- class="ul-item"
- v-for="(item, index) in state.dataArray"
- :key="index"
- >
- <image
- style="width: 100%; height: 170rpx; border-radius: 20rpx"
- :src="`${$imgUrl}applyCard/product-bg.png`"
- ></image>
- <view class="item-value">
- <image class="icon-tip" :src="`${$imgUrl}applyCard/wechat.png`"></image>
- <view class="content">
- <view class="title">
- {{ item.promoteName }}
- </view>
- <!-- 1记账卡2储值卡3记存卡 -->
- <!-- <view style="margin-top: 15rpx" class="tip" v-if="item.cardType=='1'">
- 记账卡
- </view> -->
- <view style="margin-top: 15rpx" class="tip">
- {{ item.cardTypeArr }}
- </view>
- </view>
- <view class="money">
- ¥:{{ item.fee * 0.01 }}
- </view>
- </view>
- </view>
- <view class="bottomTip"> 到底啦!敬请期待其他产品! </view>
- </view>
- </template>
-
- <script setup lang="ts">
- import { onLoad, onPageScroll } from "@dcloudio/uni-app";
- import { reactive, ref } from "vue";
- import { etcQueryProduct, productReCode } from "@/utils/network/api.js";
- import { request } from "@/utils/network/request.js";
-
- import { stringToJson } from "@/utils/network/encryption";
- import { fileURL } from "@/datas/fileURL.js";
- import navBgCar from "./components/nav-bg-car1";
- import navBar from "@/components/nav-bar/nav-bar2.vue";
-
- import { getItem, StorageKeys,setItem} from "@/utils/storage.ts";
- import { msg } from "@/utils/utils";
- const imgURL = `${fileURL}image/`;
- // import { setItem } from "@/utils/storage";
-
- const scrollTop = ref(0); //滚动距离
-
- const savaHandle = (val) => {
- 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/applyCard/essential-information?promoteId=${val.promoteId}&userType=${state.userType}&type=${state.type}&isSign=${state.isSign}`,
- });
-
- // if (state.userType === 1) {
- // uni.redirectTo({
- // url: `/subpackage/applyCard/opening-account-people?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}`,
- // });
- // } else {
- // uni.redirectTo({
- // url: `/subpackage/applyCard/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/applyCard/release-products?orderId=${state.orderId}&&clientFee=${val.clientFee}&&id=${val.id}`,
- // });
- // } else {
-
- // uni.navigateTo({
- // url: `/subpackage/applyCard/product-detail?orderId=${state.orderId}&&clientFee=${val.clientFee}&&id=${val.id}`,
- // });
- // }
- // });
- };
-
- onLoad((option: any) => {
- // state.orderId = option.orderId;
- // state.userType = option.userType;
- // 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??[];
- // });
-
- var data = {
- productType: state.type,
- source:'WECHAT' //请求方来源
- };
- const options = {
- type: 2,
- data: data,
- method: "POST",
- showLoading: true,
- };
- console.log("输出内容", options);
- request(etcQueryProduct, options).then((res) => {
- // console.log(res.bizContent);
- const data = stringToJson(res.bizContent);
- console.log(data);
- // console.log(typeof(data));
- state.dataArray = data.csmsnPromoteDistPro ?? [];
- for(var i=0;i<state.dataArray.length;i++){
- const cardTypeArr=[]
- for(var j=0;j<state.dataArray[i].cardType.length;j++){
- if(state.dataArray[i].cardType[j]=='1'){
- cardTypeArr.push('记账卡')
- }else if(state.dataArray[i].cardType[j]=='2'){
- cardTypeArr.push('储值卡')
- }else if(state.dataArray[i].cardType[j]=='3'){
- cardTypeArr.push('记存卡')
- }
- }
- state.dataArray[i].cardTypeArr=cardTypeArr.toString()
- }
- console.log("state.dataArray",state.dataArray)
- });
- });
-
- //监听页面滚动
- onPageScroll((e) => {
- scrollTop.value = e.scrollTop;
- });
-
- const productReCodeAction = (id) => {
- var data = {
- productId: id,
- orderId: state.orderId,
- };
- const options = {
- type: 2,
- data: data,
- method: "POST",
- showLoading: true,
- };
-
- return new Promise(async (resolve, reject) => {
- const res = await request(productReCode, options);
- const data = stringToJson(res.bizContent);
- resolve(data);
- }).catch((error) => {
- reject(error);
- });
- };
-
- const state = reactive({
- isSign:'',
- orderId: "",
- userType: 1, //1 个人 2单位
- type: 0, //0 客车 1货车
- vehiclePlateColor: "",
- data: {
- show: false,
- src: imgURL + "applyCard/edit.png",
- },
- dataArray: [],
- list: [
- {
- bg: imgURL + "applyCard/product-bg.png",
- icon: imgURL + "applyCard/wechat.png",
- title: "【货车】微信车主服务",
- tip: "绑定微信支付,无需绑定银行卡",
- },
- ],
- });
- </script>
-
- <style lang="scss" scoped>
- .bottomTip {
- margin-top: 100rpx;
- text-align: center;
- font-size: 28rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #b3b3b3;
- }
-
- .content-value {
- position: relative;
- // margin-top: -50rpx;
- padding: 0rpx 30rpx;
- position: relative;
-
- .img-pos {
- position: absolute;
- left: 500rpx;
- top: -38rpx;
- right: 50rpx;
-
- .img-flex {
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .car-img {
- width: 86rpx;
- height: 42rpx;
- }
-
- .flag-img {
- width: 30rpx;
- height: 35rpx;
- }
- }
- }
- }
-
- .flex {
- display: flex;
- align-items: center;
- }
-
- .action {
- margin-top: 30rpx;
- padding-left: 20rpx;
- padding-right: 20rpx;
- padding-bottom: 30rpx;
-
- .button {
- height: 80rpx;
- background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
- border-radius: 40rpx;
- font-size: 32rpx;
- font-weight: 400;
- color: #ffffff;
- line-height: 80rpx;
- }
- }
-
- .action-btn {
- margin-left: 45rpx;
- width: 121rpx;
- height: 61rpx;
- border: 1px solid rgba(255, 255, 255, 1);
- border-radius: 30rpx;
- background: rgba(255, 255, 255, 0.2);
-
- text-align: center;
- font-size: 30rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- line-height: 61rpx;
- }
-
- .tag1 {
- padding: 5rpx;
- background: rgba(0, 179, 139, 0.5);
- border-radius: 6rpx;
- font-size: 22rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- }
-
- .tag3 {
- padding: 5rpx;
- background: rgba(139, 112, 228, 0.5);
- border-radius: 6rpx;
- font-size: 22rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- }
-
- .tag2 {
- padding: 5rpx;
- background: rgba(249, 97, 60, 0.5);
- border-radius: 6rpx;
- font-size: 22rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- }
-
- .ul-item {
- padding: 5px 20rpx;
- display: flex;
- align-items: center;
-
- .item-value {
- padding: 20rpx;
- position: absolute;
- display: flex;
- align-items: center;
- // justify-content: space-around;
- width: 80%;
-
- .content {
- width: 51%;
- .title {
- font-size: 32rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
-
- }
-
- .tip {
- font-size: 24rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- }
- }
- }
-
- .icon-tip {
- width: 100rpx;
- height: 100rpx;
- }
-
- .content {
- margin-left: 40rpx;
- }
- }
- .money{
- color: white;
- // float: right;
- }
- </style>
|