Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

sign-up-ali.vue 4.9KB

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