You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

release-products.vue 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <navBar title="支付账户签约" navbgClass="nav-bgXin" fontColor='#fff'></navBar>
  3. <navBgCar :activeNum='5'></navBgCar>
  4. <view class="content-value">
  5. <view @click="qianyueAction(item)" class="ul-item" v-for="(item, index) in state.list" :key="index">
  6. <image class="icon-tip" :src="item.icon"></image>
  7. <view class="content">
  8. <view class="title">
  9. {{ item.title }}
  10. </view>
  11. <view style="margin-top: 15rpx" class="flex">
  12. <view :class="item.tag">
  13. {{ item.tag1 }}
  14. </view>
  15. <view style="margin-left: 15rpx" :class="item.tag" v-if="item.tag2">
  16. {{ item.tag2 }}
  17. </view>
  18. </view>
  19. <view style="margin-top: 15rpx" class="tip">
  20. {{ item.tip }}
  21. </view>
  22. </view>
  23. <view class="action-btn" :class="item.btnClass">{{ item.btnText }}</view>
  24. </view>
  25. </view>
  26. </template>
  27. <script setup lang="ts">
  28. import { onLoad,onShow } from "@dcloudio/uni-app";
  29. import { reactive } from "vue";
  30. import { etcQyList ,payAfterOrder} from "@/utils/network/api.js";
  31. import { request, requestNew } from "@/utils/network/request.js";
  32. import { fileURL } from "@/datas/fileURL.js";
  33. import navBar from "@/components/nav-bar/nav-bar2.vue";
  34. import navBgCar from "./components/nav-bg-car1";
  35. const imgURL = `${fileURL}image/`;
  36. import { navTo } from "@/utils/utils";
  37. import useOrderSkip from "@/composables/order/useOrderSkip";
  38. import {
  39. setItem, getItem
  40. } from "@/utils/storage";
  41. const tools = require("../../static/etcUtil/tools.js");
  42. const { gotoActiveOrder } = useOrderSkip();
  43. const qianyueAction = (val) => {
  44. gotoEditUserOrUnitInfo()
  45. console.log(val);
  46. // // #ifdef MP-ALIPAY
  47. // navTo(
  48. // `/subpackage/orders/sign-up-ali?orderId=${state.orderId}&orderQuery=${state.orderQuery}`,
  49. // );
  50. // // #endif
  51. // // #ifdef MP-WEIXIN
  52. // navTo(
  53. // `/subpackage/orders/sign-up?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}&orderQuery=${state.orderQuery}`,
  54. // );
  55. // // #endif
  56. };
  57. //解析URL获取参数
  58. const getRequest = (urlStr) => {
  59. if (typeof urlStr == "undefined") {
  60. // 获取url中"?"符后的字符串
  61. var url = decodeURI(location.search);
  62. } else {
  63. var url = "?" + urlStr.split("?")[1];
  64. }
  65. var theRequest = new Object();
  66. if (url.indexOf("?") != -1) {
  67. var str = url.substr(1);
  68. var strs = str.split("&");
  69. for (var i = 0; i < strs.length; i++) {
  70. theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
  71. }
  72. }
  73. return theRequest;
  74. };
  75. onShow(() => {
  76. // 支付完跳转到广告页,回来再次查询跳转 (签约完回来也要查询)
  77. console.log("刷新页面之前===========",state)
  78. if (state.payOK) {
  79. console.log("刷新页面",state)
  80. const options = {
  81. type: 2,
  82. data: {
  83. orderNo: state.orderId
  84. },
  85. method: "POST",
  86. showLoading: true,
  87. }
  88. requestNew(payAfterOrder, options).then((res) => {
  89. if (res.orderStep === 'WAITING_ACTIVE') {
  90. if(state.jhOk){
  91. uni.showModal({
  92. title: "*激活检测*",
  93. content: "您还没有激活成功,点击签约可直达激活",
  94. showCancel: false,
  95. confirmText: "我知道了",
  96. });
  97. }else{
  98. // 前往激活
  99. console.log("前往激活")
  100. state.jhOk = false
  101. gotoActiveOrder(getItem('orderQueryActivate'));
  102. }
  103. } else if (res.orderStep === 'ORDER_PAID') {
  104. uni.showModal({
  105. title: "*签约检测*",
  106. content: "您还没有签约成功,请重新签约",
  107. showCancel: false,
  108. confirmText: "我知道了",
  109. });
  110. }
  111. })
  112. // gotoEditUserOrUnitInfo()
  113. }
  114. })
  115. onLoad((option : any) => {
  116. if (option.q) {
  117. const q = decodeURIComponent(option.q); // 获取到二维码原始链接内容
  118. console.log(getRequest(q));
  119. state.orderId = getRequest(q)['orderId'];
  120. } else {
  121. state.orderId = option.orderId;
  122. state.orderQuery = option.orderQuery;
  123. state.clientFee = option.clientFee;
  124. state.id = option.id;
  125. }
  126. if (option.orderSource) state.orderSource = option.orderSource
  127. getUserOrUnitInfo() // 获取订单类型
  128. });
  129. const getUserOrUnitInfo = () => {
  130. const options = {
  131. type: 2,
  132. data: {
  133. orderNo: state.orderId
  134. },
  135. method: "POST",
  136. showLoading: true,
  137. }
  138. requestNew(payAfterOrder, options).then((res) => {
  139. state.userOrUnitInfo = res
  140. let unChannel = [
  141. {
  142. icon: imgURL + "issuance/weixin.png",
  143. title: "微信签约",
  144. // tip: "服务费是每笔交易金额的0.05%",
  145. tag1: "微信代付",
  146. tag2: "微信便捷支付",
  147. tag: "tag1",
  148. channelId: '',
  149. btnText: '签约',
  150. },
  151. ]
  152. let channel = [
  153. {
  154. icon: imgURL + "issuance/icon-sign-contract.png",
  155. title: "渠道签约",
  156. // tip: "服务费是每笔交易金额的0.05%",
  157. tag1: "签约代扣后可自动划扣账单",
  158. tag2: "",
  159. tag: "tag4",
  160. btnClass: 'btn-class',
  161. channelId: '',
  162. btnText: '跳转',
  163. },
  164. ]
  165. if (res.qtSign) {
  166. state.list = unChannel;
  167. } else if (res.qdAppId) {
  168. state.list = channel;
  169. } else {
  170. state.list = unChannel;
  171. }
  172. })
  173. }
  174. const gotoEditUserOrUnitInfo = () => {
  175. let res = state.userOrUnitInfo
  176. console.log("res",res)
  177. if (res.orderStep === 'WAITING_ACTIVE') {
  178. state.jhOk = true
  179. // 前往激活
  180. console.log("前往激活")
  181. gotoActiveOrder(getItem('orderQueryActivate'));
  182. } else if (res.orderStep === 'ORDER_PAID') {
  183. // 前往签约
  184. console.log("前往签约1")
  185. if (res.qtSign) {
  186. // 黔通智联签约
  187. // #ifdef MP-ALIPAY
  188. navTo(
  189. `/subpackage/orders/sign-up-ali?orderId=${state.orderId}&orderQuery=${state.orderQuery}`,
  190. );
  191. // #endif
  192. // #ifdef MP-WEIXIN
  193. navTo(
  194. `/subpackage/orders/sign-up?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}&orderQuery=${state.orderQuery}`,
  195. );
  196. // #endif
  197. } else if (res.qdAppId){
  198. state.payOK = true
  199. // 其他渠道签约
  200. uni.navigateToMiniProgram({
  201. appId: res.qdAppId,
  202. path: res.qdSignUrl,
  203. extraData: {},
  204. envVersion: 'trial',
  205. success(res) {
  206. state.payOK = true
  207. console.log(res);
  208. },
  209. complete(res) {
  210. console.log(res);
  211. },
  212. fail(res) {
  213. console.log(res);
  214. // 未成功跳转到车主小程序
  215. },
  216. });
  217. } else {
  218. // 其他渠道签约
  219. const params = encodeURIComponent(JSON.stringify(res.qdSignUrl))
  220. tools.toUrl(`/subpackage/personal-center/webview?url=` + params);
  221. }
  222. }else{
  223. uni.showModal({
  224. content: "订单待审核,可在ETC订单查看",
  225. showCancel: false,
  226. confirmText: "我知道了",
  227. success() {
  228. uni.redirectTo({
  229. url: `/pages/order/order?indexPage=1`
  230. });
  231. }
  232. });
  233. }
  234. }
  235. const state = reactive({
  236. data: {
  237. show: false,
  238. src: imgURL + "applyCard/edit.png",
  239. },
  240. list: [],
  241. id: "",
  242. clientFee: "",
  243. payOK: false,
  244. jhOk: false,
  245. orderId: "",
  246. orderQuery: "0",
  247. orderSource: '', // 订单来源
  248. userOrUnitInfo: {
  249. orderStep: "",
  250. qdAppId: "",
  251. qdSignUrl: "",
  252. qtSign: false,
  253. }
  254. });
  255. </script>
  256. <style lang="scss" scoped>
  257. .content-value {
  258. position: absolute;
  259. top: 370rpx;
  260. width: 100%;
  261. min-height: calc(100% - 370rpx);
  262. box-sizing: border-box;
  263. padding: 0 30rpx 210rpx;
  264. }
  265. .flex {
  266. display: flex;
  267. align-items: center;
  268. }
  269. .action-btn {
  270. width: 124rpx;
  271. height: 50rpx;
  272. font-family: SourceHanSansSC, SourceHanSansSC;
  273. font-weight: 400;
  274. font-size: 24rpx;
  275. color: #FFFFFF;
  276. background: radial-gradient(at 0% 0%, #CCB375 0%, #E7D398 100%);
  277. border-radius: 25rpx;
  278. text-align: center;
  279. line-height: 50rpx;
  280. margin-top: 16rpx;
  281. }
  282. .btn-class{
  283. color: #FFFFFF;
  284. background: radial-gradient(at 0% 0%, #01243A 0%, #004576 100%);
  285. }
  286. .tag1 {
  287. color: #CCB375;
  288. border-radius: 5rpx;
  289. border: 1rpx solid #CCB375;
  290. font-family: SourceHanSansSC, SourceHanSansSC;
  291. font-weight: 400;
  292. font-size: 20rpx;
  293. height: 30rpx;
  294. line-height: 30rpx;
  295. text-align: center;
  296. padding: 0 10rpx;
  297. }
  298. .tag3 {
  299. padding: 5rpx;
  300. background: rgba(139, 112, 228, 0.5);
  301. border-radius: 6rpx;
  302. font-size: 22rpx;
  303. font-family: Microsoft YaHei;
  304. font-weight: 400;
  305. color: #ffffff;
  306. }
  307. .tag4{
  308. padding: 5rpx;
  309. font-size: 24rpx;
  310. font-family: Microsoft YaHei;
  311. color: #999999;
  312. }
  313. .tag2 {
  314. padding: 5rpx;
  315. background: rgba(249, 97, 60, 0.5);
  316. border-radius: 6rpx;
  317. font-size: 22rpx;
  318. font-family: Microsoft YaHei;
  319. font-weight: 400;
  320. color: #ffffff;
  321. }
  322. .ul-item {
  323. // padding: 5px 20rpx;
  324. display: flex;
  325. background-color: #fff;
  326. padding: 50rpx 30rpx 40rpx;
  327. border-radius: 12rpx;
  328. .content {
  329. margin-left: 23rpx;
  330. flex: 1 1 auto;
  331. .title {
  332. font-size: 30rpx;
  333. font-family: SourceHanSansSC, SourceHanSansSC;
  334. font-weight: 400;
  335. color: #111;
  336. }
  337. .tip {
  338. font-size: 24rpx;
  339. font-family: SourceHanSansSC, SourceHanSansSC;
  340. font-weight: 400;
  341. color: #999;
  342. }
  343. }
  344. .icon-tip {
  345. width: 80rpx;
  346. height: 80rpx;
  347. flex-shrink: 0;
  348. }
  349. }
  350. </style>