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.4KB

2 years ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
2 years ago
10 months ago
10 months ago
7 months ago
2 years ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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">
  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">签约</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. console.log("option---", option)
  127. var data = {};
  128. const options = {
  129. type: 2,
  130. data: data,
  131. method: "POST",
  132. showLoading: true,
  133. };
  134. // #ifdef MP-ALIPAY
  135. state.list = [
  136. {
  137. icon: imgURL + "issuance/zfb.png",
  138. title: "支付宝签约",
  139. // tip: "服务费是每笔交易金额的0.05%",
  140. tag1: "支付宝代付",
  141. tag2: "支付宝便捷支付",
  142. tag: "tag1",
  143. channelId: '',
  144. },
  145. ]
  146. // #endif
  147. // #ifdef MP-WEIXIN
  148. state.list = [
  149. {
  150. icon: imgURL + "issuance/weixin.png",
  151. title: "微信签约",
  152. // tip: "服务费是每笔交易金额的0.05%",
  153. tag1: "微信代付",
  154. tag2: "微信便捷支付",
  155. tag: "tag1",
  156. channelId: '',
  157. },
  158. ];
  159. // #endif
  160. // requestNew(etcQyList, options).then((res) => {
  161. // const data = res;
  162. // });
  163. });
  164. const gotoEditUserOrUnitInfo = () => {
  165. // if (state.orderQuery == '1') {
  166. const options = {
  167. type: 2,
  168. data: {
  169. orderNo: state.orderId
  170. },
  171. method: "POST",
  172. showLoading: true,
  173. }
  174. requestNew(payAfterOrder, options).then((res) => {
  175. console.log("res",res)
  176. if (res.orderStep === 'WAITING_ACTIVE') {
  177. state.jhOk = true
  178. // 前往激活
  179. console.log("前往激活")
  180. gotoActiveOrder(getItem('orderQueryActivate'));
  181. } else if (res.orderStep === 'ORDER_PAID') {
  182. // 前往签约
  183. console.log("前往签约1")
  184. if (res.qtSign) {
  185. // 黔通智联签约
  186. // #ifdef MP-ALIPAY
  187. navTo(
  188. `/subpackage/orders/sign-up-ali?orderId=${state.orderId}&orderQuery=${state.orderQuery}`,
  189. );
  190. // #endif
  191. // #ifdef MP-WEIXIN
  192. navTo(
  193. `/subpackage/orders/sign-up?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}&orderQuery=${state.orderQuery}`,
  194. );
  195. // #endif
  196. } else if (res.qdAppId){
  197. state.payOK = true
  198. // 其他渠道签约
  199. uni.navigateToMiniProgram({
  200. appId: res.qdAppId,
  201. path: res.qdSignUrl,
  202. extraData: {},
  203. envVersion: 'trial',
  204. success(res) {
  205. state.payOK = true
  206. console.log(res);
  207. },
  208. complete(res) {
  209. console.log(res);
  210. },
  211. fail(res) {
  212. console.log(res);
  213. // 未成功跳转到车主小程序
  214. },
  215. });
  216. } else {
  217. // 其他渠道签约
  218. const params = encodeURIComponent(JSON.stringify(res.qdSignUrl))
  219. tools.toUrl(`/subpackage/personal-center/webview?url=` + params);
  220. }
  221. }else{
  222. uni.showModal({
  223. content: "订单待审核,可在ETC订单查看",
  224. showCancel: false,
  225. confirmText: "我知道了",
  226. success() {
  227. uni.redirectTo({
  228. url: `/pages/order/order?indexPage=1`
  229. });
  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. });
  248. </script>
  249. <style lang="scss" scoped>
  250. .content-value {
  251. position: absolute;
  252. top: 370rpx;
  253. width: 100%;
  254. min-height: calc(100% - 370rpx);
  255. box-sizing: border-box;
  256. padding: 0 30rpx 210rpx;
  257. }
  258. .flex {
  259. display: flex;
  260. align-items: center;
  261. }
  262. .action-btn {
  263. width: 124rpx;
  264. height: 50rpx;
  265. font-family: SourceHanSansSC, SourceHanSansSC;
  266. font-weight: 400;
  267. font-size: 24rpx;
  268. color: #FFFFFF;
  269. background: radial-gradient(at 0% 0%, #CCB375 0%, #E7D398 100%);
  270. border-radius: 25rpx;
  271. text-align: center;
  272. line-height: 50rpx;
  273. margin-top: 16rpx;
  274. }
  275. .tag1 {
  276. color: #CCB375;
  277. border-radius: 5rpx;
  278. border: 1rpx solid #CCB375;
  279. font-family: SourceHanSansSC, SourceHanSansSC;
  280. font-weight: 400;
  281. font-size: 20rpx;
  282. height: 30rpx;
  283. line-height: 30rpx;
  284. text-align: center;
  285. padding: 0 10rpx;
  286. }
  287. .tag3 {
  288. padding: 5rpx;
  289. background: rgba(139, 112, 228, 0.5);
  290. border-radius: 6rpx;
  291. font-size: 22rpx;
  292. font-family: Microsoft YaHei;
  293. font-weight: 400;
  294. color: #ffffff;
  295. }
  296. .tag2 {
  297. padding: 5rpx;
  298. background: rgba(249, 97, 60, 0.5);
  299. border-radius: 6rpx;
  300. font-size: 22rpx;
  301. font-family: Microsoft YaHei;
  302. font-weight: 400;
  303. color: #ffffff;
  304. }
  305. .ul-item {
  306. // padding: 5px 20rpx;
  307. display: flex;
  308. background-color: #fff;
  309. padding: 50rpx 30rpx 40rpx;
  310. border-radius: 12rpx;
  311. .content {
  312. margin-left: 23rpx;
  313. flex: 1 1 auto;
  314. .title {
  315. font-size: 30rpx;
  316. font-family: SourceHanSansSC, SourceHanSansSC;
  317. font-weight: 400;
  318. color: #111;
  319. }
  320. .tip {
  321. font-size: 24rpx;
  322. font-family: SourceHanSansSC, SourceHanSansSC;
  323. font-weight: 400;
  324. color: #999;
  325. }
  326. }
  327. .icon-tip {
  328. width: 80rpx;
  329. height: 80rpx;
  330. flex-shrink: 0;
  331. }
  332. }
  333. </style>