Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <image style="
  3. margin-top: 20rpx;
  4. width: 100%;
  5. height: 240rpx;
  6. background-color: #eeeeee;
  7. " :src="`${$imgUrl}applyCard/car-service.png`"></image>
  8. <view class="title"> 支付宝签约代扣 </view>
  9. <view class="value">
  10. <view class="content_1">
  11. 支付宝签约代扣是支付宝支付为车主用户提供的安全便捷的智慧服务
  12. </view>
  13. <view class="content_2">
  14. 本次将为贵州黔通智联科技股份有限公司开启免密支付服务,后续相关的费用将通过支付宝签约代扣从你的支付宝账户扣除
  15. </view>
  16. <view class="content_3">
  17. 注:签约成功后请返回本页面,再次点击开通服务
  18. </view>
  19. </view>
  20. <view class="action">
  21. <button type="default" class="button" @click="savaHandle()">
  22. 开通服务
  23. </button>
  24. <!-- <button type="default" class="button" @click="addInterestsList()">
  25. 加购权益
  26. </button> -->
  27. </view>
  28. </template>
  29. <script setup lang="ts">
  30. import { onLoad, onShow } from "@dcloudio/uni-app";
  31. import { reactive } from "vue";
  32. import { etcQYAction } from "@/utils/network/api.js";
  33. import { request } from "@/utils/network/request.js";
  34. import { stringToJson } from "@/utils/network/encryption";
  35. import { fileURL } from "@/datas/fileURL.js";
  36. import navBar from "@/components/nav-bar/nav-bar2.vue";
  37. import navBgCar from "./components/nav-bg-car4";
  38. import { setItem, StorageKeys } from "@/utils/storage";
  39. import { msg, confirm, getOrderStatusName } from "@/utils/utils";
  40. import {
  41. checkOrderStatus,
  42. orderPay,
  43. wechatAppID,
  44. wechatPayConfigId,
  45. wechatSecret,
  46. aliPayConfigIdTwo,
  47. obtainUserId,
  48. } from "@/utils/network/api";
  49. const imgURL = `${fileURL}image/`;
  50. const state = reactive({
  51. openid: "",
  52. orderId: "",
  53. id: "",
  54. clientFee: "",
  55. code: "",
  56. qdOrderNo: "", //渠道订单编号
  57. });
  58. onLoad((option : any) => {
  59. console.log("option22222", option)
  60. state.orderId = option.orderId;
  61. state.qdOrderNo = option.qdOrderNo;
  62. setItem('accessToken', option.token);
  63. setItem(StorageKeys.Token, option.token);
  64. setItem('openId', option.openId);
  65. });
  66. const addInterestsList = () => {
  67. uni.navigateTo({
  68. url: `/subpackage/orders/interestsList?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}`
  69. });
  70. }
  71. const savaHandle = () => {
  72. my.getAuthCode({
  73. scopes: 'auth_user',
  74. success: res => {
  75. // 获取需要的用户信息
  76. state.code = res.authCode
  77. //如果获取openId成功
  78. if (state.code) {
  79. console.log("code*******", state.code);
  80. const optionsUser = {
  81. type: 2,
  82. data: {
  83. payConfigId: aliPayConfigIdTwo,
  84. code: res.authCode
  85. },
  86. method: "POST",
  87. showLoading: true,
  88. };
  89. console.log('支付宝用户编号请求:', optionsUser)
  90. request(obtainUserId, optionsUser).then((res) => {
  91. console.log('支付宝用户编号返回:', res)
  92. const bizContent = stringToJson(res.bizContent);
  93. var data = {
  94. orderId: state.orderId,
  95. subOpenId: bizContent.openId,
  96. };
  97. const options = {
  98. type: 2,
  99. data: data,
  100. method: "POST",
  101. showLoading: true,
  102. };
  103. request(etcQYAction, options).then((res) => {
  104. console.log("res*******", res);
  105. const data = stringToJson(res.bizContent);
  106. console.log("data*******", data);
  107. if (data.signStatus === "WAIT_SIGN") {
  108. //待签约
  109. my.ap.navigateToAlipayPage({
  110. path: "https://render.alipay.com/p/yuyan/180020010001250649/sign.html?orderId=" + data.alipayOrderId
  111. });
  112. } else if (data.signStatus === "SIGNED") {
  113. //已签约
  114. // msg("已签约");
  115. confirm(
  116. "您已完成签约,等待业务员审核发货",
  117. () => {
  118. // uni.switchTab({
  119. // url: "/pages/order/order"
  120. // })
  121. // uni.$emit("refreshOrder");
  122. // uni.navigateBack();
  123. const param = `https://qtzl.etcjz.cn/order/#/pages/sigManage/signContract?qdOrderNo=${state.qdOrderNo}&type=3`
  124. const params = encodeURIComponent(JSON.stringify(param))
  125. console.log('支付结果查询params', params)
  126. uni.navigateTo({
  127. url: `/subpackage/personal-center/webview?url=` + params
  128. })
  129. },
  130. "已完成签约",
  131. false
  132. );
  133. } else if (data.signStatus === "UNSIGN") {
  134. //已解约
  135. // msg("已解约");
  136. confirm(
  137. "您已解约!",
  138. () => {
  139. // uni.switchTab({
  140. // url: "/pages/order/order"
  141. // })
  142. },
  143. "您已解约",
  144. false
  145. );
  146. }
  147. });
  148. })
  149. } else {
  150. //如果获取openId失败
  151. uni.showToast({
  152. title: "网络异常,请重试!",
  153. icon: "none",
  154. duration: 1000,
  155. });
  156. return;
  157. }
  158. },
  159. fail: err => {
  160. console.log('my.getAuthCode 调用失败', err)
  161. }
  162. });
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. .action {
  167. margin-top: 40rpx;
  168. padding-left: 20rpx;
  169. padding-right: 20rpx;
  170. padding-bottom: 30rpx;
  171. .button {
  172. height: 80rpx;
  173. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  174. border-radius: 40rpx;
  175. font-size: 32rpx;
  176. font-weight: 400;
  177. color: #ffffff;
  178. line-height: 80rpx;
  179. }
  180. }
  181. .title {
  182. text-align: center;
  183. margin-top: 15rpx;
  184. font-size: 36rpx;
  185. font-family: Microsoft YaHei;
  186. font-weight: 400;
  187. color: #333333;
  188. line-height: 36rpx;
  189. }
  190. .value {
  191. padding: 0rpx 60rpx;
  192. }
  193. .content_1 {
  194. margin-top: 60rpx;
  195. font-size: 30rpx;
  196. font-family: Microsoft YaHei;
  197. font-weight: 400;
  198. color: #666666;
  199. line-height: 58rpx;
  200. }
  201. .content_2 {
  202. margin-top: 50rpx;
  203. font-size: 30rpx;
  204. font-family: Microsoft YaHei;
  205. font-weight: 400;
  206. color: #666666;
  207. line-height: 58rpx;
  208. }
  209. .content_3 {
  210. margin-top: 50rpx;
  211. font-size: 30rpx;
  212. font-family: Microsoft YaHei;
  213. font-weight: 400;
  214. color: #ff0000;
  215. line-height: 58rpx;
  216. }
  217. </style>