|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357 |
- <template>
- <navBar title="支付账户签约" navbgClass="nav-bgXin" fontColor='#fff'></navBar>
- <navBgCar :activeNum='5'></navBgCar>
- <view class="content-value">
- <view @click="qianyueAction(item)" class="ul-item" v-for="(item, index) in state.list" :key="index">
- <image class="icon-tip" :src="item.icon"></image>
- <view class="content">
- <view class="title">
- {{ item.title }}
- </view>
- <view style="margin-top: 15rpx" class="flex">
- <view :class="item.tag">
- {{ item.tag1 }}
- </view>
- <view style="margin-left: 15rpx" :class="item.tag">
- {{ item.tag2 }}
- </view>
- </view>
- <view style="margin-top: 15rpx" class="tip">
- {{ item.tip }}
- </view>
- </view>
- <view class="action-btn">签约</view>
- </view>
- </view>
- </template>
-
- <script setup lang="ts">
- import { onLoad,onShow } from "@dcloudio/uni-app";
- import { reactive } from "vue";
- import { etcQyList ,payAfterOrder} from "@/utils/network/api.js";
- import { request, requestNew } from "@/utils/network/request.js";
- import { fileURL } from "@/datas/fileURL.js";
- import navBar from "@/components/nav-bar/nav-bar2.vue";
- import navBgCar from "./components/nav-bg-car1";
- const imgURL = `${fileURL}image/`;
- import { navTo } from "@/utils/utils";
- import useOrderSkip from "@/composables/order/useOrderSkip";
- import {
- setItem, getItem
- } from "@/utils/storage";
- const tools = require("../../static/etcUtil/tools.js");
- const { gotoActiveOrder } = useOrderSkip();
- const qianyueAction = (val) => {
- gotoEditUserOrUnitInfo()
- console.log(val);
- // // #ifdef MP-ALIPAY
- // navTo(
- // `/subpackage/orders/sign-up-ali?orderId=${state.orderId}&orderQuery=${state.orderQuery}`,
- // );
- // // #endif
- // // #ifdef MP-WEIXIN
- // navTo(
- // `/subpackage/orders/sign-up?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}&orderQuery=${state.orderQuery}`,
- // );
- // // #endif
-
- };
- //解析URL获取参数
- const getRequest = (urlStr) => {
- if (typeof urlStr == "undefined") {
- // 获取url中"?"符后的字符串
- var url = decodeURI(location.search);
- } else {
- var url = "?" + urlStr.split("?")[1];
- }
- var theRequest = new Object();
- if (url.indexOf("?") != -1) {
- var str = url.substr(1);
- var strs = str.split("&");
- for (var i = 0; i < strs.length; i++) {
- theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
- }
- }
- return theRequest;
- };
-
- onShow(() => {
- // 支付完跳转到广告页,回来再次查询跳转 (签约完回来也要查询)
- console.log("刷新页面之前===========",state)
- if (state.payOK) {
- console.log("刷新页面",state)
- const options = {
- type: 2,
- data: {
- orderNo: state.orderId
- },
- method: "POST",
- showLoading: true,
- }
- requestNew(payAfterOrder, options).then((res) => {
- if (res.orderStep === 'WAITING_ACTIVE') {
- if(state.jhOk){
- uni.showModal({
- title: "*激活检测*",
- content: "您还没有激活成功,点击签约可直达激活",
- showCancel: false,
- confirmText: "我知道了",
- });
- }else{
- // 前往激活
- console.log("前往激活")
- state.jhOk = false
- gotoActiveOrder(getItem('orderQueryActivate'));
- }
- } else if (res.orderStep === 'ORDER_PAID') {
- uni.showModal({
- title: "*签约检测*",
- content: "您还没有签约成功,请重新签约",
- showCancel: false,
- confirmText: "我知道了",
- });
- }
- })
- // gotoEditUserOrUnitInfo()
- }
- })
-
- onLoad((option : any) => {
- if (option.q) {
- const q = decodeURIComponent(option.q); // 获取到二维码原始链接内容
- console.log(getRequest(q));
- state.orderId = getRequest(q)['orderId'];
- } else {
- state.orderId = option.orderId;
- state.orderQuery = option.orderQuery;
- state.clientFee = option.clientFee;
- state.id = option.id;
- }
- console.log("option---", option)
- var data = {};
- const options = {
- type: 2,
- data: data,
- method: "POST",
- showLoading: true,
- };
- // #ifdef MP-ALIPAY
- state.list = [
- {
- icon: imgURL + "issuance/zfb.png",
- title: "支付宝签约",
- // tip: "服务费是每笔交易金额的0.05%",
- tag1: "支付宝代付",
- tag2: "支付宝便捷支付",
- tag: "tag1",
- channelId: '',
- },
- ]
- // #endif
- // #ifdef MP-WEIXIN
- state.list = [
- {
- icon: imgURL + "issuance/weixin.png",
- title: "微信签约",
- // tip: "服务费是每笔交易金额的0.05%",
- tag1: "微信代付",
- tag2: "微信便捷支付",
- tag: "tag1",
- channelId: '',
- },
- ];
- // #endif
- // requestNew(etcQyList, options).then((res) => {
- // const data = res;
-
- // });
- });
-
- const gotoEditUserOrUnitInfo = () => {
- // if (state.orderQuery == '1') {
- const options = {
- type: 2,
- data: {
- orderNo: state.orderId
- },
- method: "POST",
- showLoading: true,
- }
- requestNew(payAfterOrder, options).then((res) => {
- console.log("res",res)
- if (res.orderStep === 'WAITING_ACTIVE') {
- state.jhOk = true
- // 前往激活
- console.log("前往激活")
- gotoActiveOrder(getItem('orderQueryActivate'));
- } else if (res.orderStep === 'ORDER_PAID') {
- // 前往签约
- console.log("前往签约1")
- if (res.qtSign) {
- // 黔通智联签约
- // #ifdef MP-ALIPAY
- navTo(
- `/subpackage/orders/sign-up-ali?orderId=${state.orderId}&orderQuery=${state.orderQuery}`,
- );
- // #endif
- // #ifdef MP-WEIXIN
- navTo(
- `/subpackage/orders/sign-up?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}&orderQuery=${state.orderQuery}`,
- );
- // #endif
- } else if (res.qdAppId){
- state.payOK = true
- // 其他渠道签约
- uni.navigateToMiniProgram({
- appId: res.qdAppId,
- path: res.qdSignUrl,
- extraData: {},
- envVersion: 'trial',
- success(res) {
- state.payOK = true
- console.log(res);
- },
- complete(res) {
- console.log(res);
- },
- fail(res) {
- console.log(res);
- // 未成功跳转到车主小程序
- },
- });
- } else {
- // 其他渠道签约
- const params = encodeURIComponent(JSON.stringify(res.qdSignUrl))
- tools.toUrl(`/subpackage/personal-center/webview?url=` + params);
- }
- }else{
- uni.showModal({
- content: "订单待审核,可在ETC订单查看",
- showCancel: false,
- confirmText: "我知道了",
- success() {
- uni.redirectTo({
- url: `/pages/order/order?indexPage=1`
- });
- }
- });
- }
- });
- }
-
- const state = reactive({
- data: {
- show: false,
- src: imgURL + "applyCard/edit.png",
- },
- list: [],
- id: "",
- clientFee: "",
- payOK: false,
- jhOk: false,
- orderId: "",
- orderQuery: "0"
- });
- </script>
-
- <style lang="scss" scoped>
- .content-value {
- position: absolute;
- top: 370rpx;
- width: 100%;
- min-height: calc(100% - 370rpx);
- box-sizing: border-box;
- padding: 0 30rpx 210rpx;
- }
-
- .flex {
- display: flex;
- align-items: center;
- }
-
-
- .action-btn {
- width: 124rpx;
- height: 50rpx;
- font-family: SourceHanSansSC, SourceHanSansSC;
- font-weight: 400;
- font-size: 24rpx;
- color: #FFFFFF;
- background: radial-gradient(at 0% 0%, #CCB375 0%, #E7D398 100%);
- border-radius: 25rpx;
- text-align: center;
- line-height: 50rpx;
- margin-top: 16rpx;
-
- }
-
- .tag1 {
- color: #CCB375;
- border-radius: 5rpx;
- border: 1rpx solid #CCB375;
- font-family: SourceHanSansSC, SourceHanSansSC;
- font-weight: 400;
- font-size: 20rpx;
- height: 30rpx;
- line-height: 30rpx;
- text-align: center;
- padding: 0 10rpx;
- }
-
- .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;
- background-color: #fff;
- padding: 50rpx 30rpx 40rpx;
- border-radius: 12rpx;
-
- .content {
- margin-left: 23rpx;
- flex: 1 1 auto;
-
- .title {
- font-size: 30rpx;
- font-family: SourceHanSansSC, SourceHanSansSC;
- font-weight: 400;
- color: #111;
-
- }
-
- .tip {
- font-size: 24rpx;
- font-family: SourceHanSansSC, SourceHanSansSC;
- font-weight: 400;
- color: #999;
-
- }
- }
-
-
- .icon-tip {
- width: 80rpx;
- height: 80rpx;
- flex-shrink: 0;
- }
-
- }
- </style>
|