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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <!-- <navBar title="产品详情"></navBar>
  3. <navBgCar></navBgCar> -->
  4. <view class="content-wrap">
  5. <view class="ul-item">
  6. <image style="width: 100%; height: 170rpx; background-color: #eeeeee"
  7. :src="`${$imgUrl}applyCard/product-bg.png`"></image>
  8. <view class="item-value">
  9. <image class="icon-tip" :src="`${$imgUrl}applyCard/wechat.png`"></image>
  10. <view class="content">
  11. <view class="title"> 微信车主服务 </view>
  12. <view style="margin-top: 15rpx" class="tip"> 先通行后付费! </view>
  13. </view>
  14. <view class="price">
  15. ¥<text style="font-size: 40rpx">99</text>.00
  16. </view>
  17. </view>
  18. </view>
  19. <view class="card-box">
  20. <view class="title"> 基础服务 </view>
  21. <view class="item-box">
  22. <view class=""> ETC设备与卡片 </view>
  23. <view class=""> 设备质保一年 </view>
  24. <view class=""> 开具通行费发票 </view>
  25. <view class=""> 高速通行9.5折 </view>
  26. </view>
  27. </view>
  28. <view class="radio">
  29. <view class="title"> 推荐加购权益 </view>
  30. <view class="radio-item">
  31. <image :src="`${$imgUrl}card-bg.png`" mode=""></image>
  32. <view class="radio-box">
  33. <view class="radio-box-left">
  34. <view class="icon">
  35. <image :src="`${$imgUrl}park.png`" mode=""></image>
  36. </view>
  37. <view class="content">
  38. <view class=""> 64元停车券 </view>
  39. <text>¥44.00</text>
  40. </view>
  41. </view>
  42. <view class="choose-item" @click="flag = 1">
  43. <view class="active" v-if="flag == 1"> </view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="radio-item">
  48. <image :src="`${$imgUrl}card-bg.png`" mode=""></image>
  49. <view class="radio-box">
  50. <view class="radio-box-left">
  51. <view class="icon">
  52. <image :src="`${$imgUrl}car1.png`" mode=""></image>
  53. </view>
  54. <view class="content">
  55. <view class=""> 10次洗车券 </view>
  56. <text>¥44.00</text>
  57. </view>
  58. </view>
  59. <view class="choose-item" @click="flag = 2">
  60. <view class="active" v-if="flag == 2"> </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="more-btn">
  65. 查看更多<u-icon name="arrow-down"></u-icon>
  66. </view>
  67. </view>
  68. <view class="value-wrapper">
  69. <view class="flex">
  70. <view class="title"> 产品金额 </view>
  71. <view class="value">
  72. {{ "¥" + state.clientFee }}
  73. </view>
  74. </view>
  75. <view class="flex">
  76. <view class="title"> 加购权益 </view>
  77. <view class="value"> ¥0.00 </view>
  78. </view>
  79. <view class="flex">
  80. <view class="title"> 运费 </view>
  81. <view class="value"> ¥0.00 </view>
  82. </view>
  83. <view class="flex">
  84. <view class="title"> 优惠券 </view>
  85. <view class="value"> 暂无优惠券 </view>
  86. </view>
  87. <view class="flex">
  88. <view class="title"> 积分兑换 </view>
  89. <view class="value"> 暂无积分 </view>
  90. </view>
  91. <view class="flex">
  92. <view class="title"> 实付款 </view>
  93. <view class="money">
  94. {{ "¥" + state.clientFee }}
  95. </view>
  96. </view>
  97. </view>
  98. <view class="footer">
  99. <u-radio-group v-model="value">
  100. <u-radio shape="square">
  101. 阅读并同意<text>《用户授权协议》</text><text>《XXX隐私协议》</text>
  102. </u-radio>
  103. </u-radio-group>
  104. </view>
  105. <view class="action">
  106. <button type="default" class="button" @click="savaHandle()">
  107. {{ "确认办理:¥" + state.clientFee }}
  108. </button>
  109. </view>
  110. </view>
  111. </template>
  112. <script setup lang="ts">
  113. import { onLoad, onShow } from "@dcloudio/uni-app";
  114. import { reactive, ref } from "vue";
  115. import { etcQueryProduct, getOpenidApi } from "@/utils/network/api.js";
  116. import { request } from "@/utils/network/request.js";
  117. import { stringToJson } from "@/utils/network/encryption";
  118. import { fileURL } from "@/datas/fileURL.js";
  119. // import navBgCar from "./components/nav-bg-car5";
  120. // import navBar from "../../components/nav-bar/nav-bar2.vue"
  121. import { getItem, StorageKeys } from "@/utils/storage.ts";
  122. import {
  123. checkOrderStatus,
  124. wechatAppID,
  125. wechatPayConfigId,
  126. wechatSecret,
  127. } from "@/utils/network/api";
  128. import { confirm, msg } from "@/utils/utils";
  129. const imgURL = `${fileURL}image/`;
  130. const flag = ref(1);
  131. const savaHandle = () => {
  132. uni.redirectTo({
  133. url: "/subpackage/after-sale/to-bookkeeping-card/result",
  134. });
  135. };
  136. //获取微信小程序openid
  137. const getOpenID = () => {
  138. uni.login({
  139. provider: "weixin",
  140. success: function (e) {
  141. getOpenid(e.code)
  142. },
  143. });
  144. };
  145. const getOpenid = (code) => {
  146. const options = {
  147. type: 2,
  148. data: {
  149. "jsCode": code
  150. },
  151. method: "POST",
  152. showLoading: true,
  153. };
  154. // #ifdef MP-WEIXIN
  155. request(getOpenidApi, options).then((res) => {
  156. const result = stringToJson(res.bizContent);
  157. console.log("获取微信小程序openid", result);
  158. const openidData = stringToJson(result.data);
  159. state.openid = openidData.openid
  160. });
  161. // #endif
  162. }
  163. //支付成功改变订单状态
  164. const checkOrder = () => {
  165. const options = {
  166. type: 2,
  167. data: {
  168. orderId: state.orderId,
  169. payConfigId: wechatPayConfigId,
  170. },
  171. method: "POST",
  172. showLoading: true,
  173. };
  174. request(checkOrderStatus, options).then((res) => {
  175. msg("支付成功!");
  176. var pages = getCurrentPages().length;
  177. uni.navigateBack({
  178. delta: pages,
  179. });
  180. });
  181. };
  182. onLoad((option : any) => {
  183. state.orderId = option.orderId;
  184. state.clientFee = option.clientFee / 100;
  185. getOpenID();
  186. });
  187. const state = reactive({
  188. openid: "",
  189. orderId: "",
  190. clientFee: undefined,
  191. });
  192. </script>
  193. <style lang="scss" scoped>
  194. .action {
  195. margin-top: 40rpx;
  196. padding-left: 20rpx;
  197. padding-right: 20rpx;
  198. padding-bottom: 30rpx;
  199. .button {
  200. height: 80rpx;
  201. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  202. border-radius: 40rpx;
  203. font-size: 32rpx;
  204. font-weight: 400;
  205. color: #ffffff;
  206. line-height: 80rpx;
  207. }
  208. }
  209. .footer {
  210. margin-top: 45rpx;
  211. text {
  212. color: #00b38b;
  213. }
  214. }
  215. .value-wrapper {
  216. margin-top: 40rpx;
  217. padding: 0rpx 30rpx;
  218. border-bottom: 1rpx solid #dcdcdc;
  219. .flex {
  220. padding: 20rpx 0rpx;
  221. display: flex;
  222. justify-content: space-between;
  223. align-items: center;
  224. .title {
  225. font-size: 28rpx;
  226. font-family: Microsoft YaHei;
  227. font-weight: 400;
  228. color: #777777;
  229. line-height: 28rpx;
  230. }
  231. .value {
  232. font-size: 28rpx;
  233. font-family: Microsoft YaHei;
  234. font-weight: 400;
  235. color: #333333;
  236. line-height: 28rpx;
  237. }
  238. .money {
  239. font-size: 36rpx;
  240. font-family: Microsoft YaHei;
  241. font-weight: 400;
  242. color: #00b38b;
  243. line-height: 36rpx;
  244. }
  245. }
  246. }
  247. .content-wrap {
  248. position: relative;
  249. padding: 0rpx 30rpx;
  250. .ul-item {
  251. padding: 5px 0rpx;
  252. display: flex;
  253. align-items: center;
  254. .item-value {
  255. padding: 20rpx;
  256. position: absolute;
  257. display: flex;
  258. align-items: center;
  259. justify-content: space-around;
  260. .content {
  261. .title {
  262. font-size: 32rpx;
  263. font-family: Microsoft YaHei;
  264. font-weight: 400;
  265. color: #ffffff;
  266. }
  267. .tip {
  268. font-size: 24rpx;
  269. font-family: Microsoft YaHei;
  270. font-weight: 400;
  271. color: #ffffff;
  272. }
  273. }
  274. .price {
  275. margin-left: 180rpx;
  276. font-size: 25rpx;
  277. font-family: Microsoft YaHei;
  278. font-weight: 400;
  279. color: #ffffff;
  280. }
  281. }
  282. .icon-tip {
  283. width: 100rpx;
  284. height: 100rpx;
  285. }
  286. .content {
  287. margin-left: 40rpx;
  288. }
  289. }
  290. .card-box {
  291. .title {
  292. font-size: 30rpx;
  293. font-family: Microsoft YaHei;
  294. font-weight: 400;
  295. color: #333333;
  296. margin: 30rpx 0;
  297. }
  298. .item-box {
  299. display: flex;
  300. flex-wrap: wrap;
  301. view {
  302. background: #c1ffed;
  303. border: 1px solid #00b38b;
  304. border-radius: 30rpx;
  305. padding: 5rpx 15rpx;
  306. font-size: 28rpx;
  307. font-family: Microsoft YaHei;
  308. font-weight: 400;
  309. color: #019977;
  310. margin: 20rpx 30rpx;
  311. margin-top: 0;
  312. }
  313. }
  314. }
  315. .radio {
  316. .title {
  317. font-size: 30rpx;
  318. font-family: Microsoft YaHei;
  319. font-weight: 400;
  320. color: #333333;
  321. margin: 30rpx 0;
  322. }
  323. .more-btn {
  324. text-align: center;
  325. margin-top: 30rpx;
  326. border-bottom: 1rpx solid #dcdcdc;
  327. padding-bottom: 30rpx;
  328. font-size: 26rpx;
  329. font-family: Microsoft YaHei;
  330. font-weight: 400;
  331. color: #999999;
  332. }
  333. .radio-item {
  334. width: 100%;
  335. height: 150rpx;
  336. position: relative;
  337. image {
  338. width: 100%;
  339. height: 100%;
  340. position: absolute;
  341. z-index: -1;
  342. }
  343. .radio-box {
  344. // width: 100%;
  345. // height: 100%;
  346. display: flex;
  347. justify-content: space-between;
  348. align-items: center;
  349. padding: 30rpx;
  350. margin: 30rpx 0;
  351. .radio-box-left {
  352. display: flex;
  353. .icon {
  354. width: 88rpx;
  355. height: 88rpx;
  356. background: #89fcdb;
  357. border-radius: 50%;
  358. display: flex;
  359. justify-content: center;
  360. align-items: center;
  361. image {
  362. width: 48rpx;
  363. height: 48rpx;
  364. z-index: 1;
  365. }
  366. }
  367. .content {
  368. margin-left: 64rpx;
  369. view {
  370. font-size: 28rpx;
  371. font-family: Microsoft YaHei;
  372. font-weight: 400;
  373. color: #333333;
  374. margin-bottom: 10rpx;
  375. }
  376. text {
  377. font-size: 36rpx;
  378. font-family: Microsoft YaHei;
  379. font-weight: 400;
  380. color: #333333;
  381. }
  382. }
  383. }
  384. .choose-item {
  385. width: 44rpx;
  386. height: 44rpx;
  387. border: 2px solid #00b38b;
  388. border-radius: 50%;
  389. display: flex;
  390. justify-content: center;
  391. align-items: center;
  392. .active {
  393. width: 34rpx;
  394. height: 34rpx;
  395. background: #00b38b;
  396. border-radius: 50%;
  397. }
  398. }
  399. }
  400. }
  401. }
  402. }
  403. </style>