Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

detail.vue 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  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 {getOpenId } from "@/utils/network/api.js";
  116. import { request, requestNew } from "@/utils/network/request.js";
  117. import { stringToJson } from "@/utils/network/encryption";
  118. import { fileURL } from "@/datas/fileURL.js";
  119. import { getItem, StorageKeys } from "@/utils/storage.ts";
  120. import {
  121. checkOrderStatus,
  122. wechatAppID,
  123. wechatPayConfigId,
  124. wechatSecret,
  125. } from "@/utils/network/api";
  126. import { confirm, msg } from "@/utils/utils";
  127. const imgURL = `${fileURL}image/`;
  128. const flag = ref(1);
  129. const savaHandle = () => {
  130. uni.redirectTo({
  131. url: "/subpackage/after-sale/to-bookkeeping-card/result",
  132. });
  133. };
  134. //获取微信小程序openid
  135. const getOpenID = () => {
  136. uni.login({
  137. provider: "weixin",
  138. success: function (e) {
  139. getOpenid(e.code)
  140. },
  141. });
  142. };
  143. const getOpenid = (code) => {
  144. const options = {
  145. type: 2,
  146. data: {
  147. "jsCode": code
  148. },
  149. method: "POST",
  150. showLoading: true,
  151. };
  152. // #ifdef MP-WEIXIN
  153. requestNew(getOpenId, options).then((res) => {
  154. const result = res;
  155. console.log("获取微信小程序openid", result);
  156. const openidData = stringToJson(result.data);
  157. state.openid = openidData.openid
  158. });
  159. // #endif
  160. }
  161. //支付成功改变订单状态
  162. const checkOrder = () => {
  163. const options = {
  164. type: 2,
  165. data: {
  166. orderId: state.orderId,
  167. payConfigId: wechatPayConfigId,
  168. },
  169. method: "POST",
  170. showLoading: true,
  171. };
  172. request(checkOrderStatus, options).then((res) => {
  173. msg("支付成功!");
  174. var pages = getCurrentPages().length;
  175. uni.navigateBack({
  176. delta: pages,
  177. });
  178. });
  179. };
  180. onLoad((option : any) => {
  181. state.orderId = option.orderId;
  182. state.clientFee = option.clientFee / 100;
  183. getOpenID();
  184. });
  185. const state = reactive({
  186. openid: "",
  187. orderId: "",
  188. clientFee: undefined,
  189. });
  190. </script>
  191. <style lang="scss" scoped>
  192. .action {
  193. margin-top: 40rpx;
  194. padding-left: 20rpx;
  195. padding-right: 20rpx;
  196. padding-bottom: 30rpx;
  197. .button {
  198. height: 80rpx;
  199. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  200. border-radius: 40rpx;
  201. font-size: 32rpx;
  202. font-weight: 400;
  203. color: #ffffff;
  204. line-height: 80rpx;
  205. }
  206. }
  207. .footer {
  208. margin-top: 45rpx;
  209. text {
  210. color: #00b38b;
  211. }
  212. }
  213. .value-wrapper {
  214. margin-top: 40rpx;
  215. padding: 0rpx 30rpx;
  216. border-bottom: 1rpx solid #dcdcdc;
  217. .flex {
  218. padding: 20rpx 0rpx;
  219. display: flex;
  220. justify-content: space-between;
  221. align-items: center;
  222. .title {
  223. font-size: 28rpx;
  224. font-family: Microsoft YaHei;
  225. font-weight: 400;
  226. color: #777777;
  227. line-height: 28rpx;
  228. }
  229. .value {
  230. font-size: 28rpx;
  231. font-family: Microsoft YaHei;
  232. font-weight: 400;
  233. color: #333333;
  234. line-height: 28rpx;
  235. }
  236. .money {
  237. font-size: 36rpx;
  238. font-family: Microsoft YaHei;
  239. font-weight: 400;
  240. color: #00b38b;
  241. line-height: 36rpx;
  242. }
  243. }
  244. }
  245. .content-wrap {
  246. position: relative;
  247. padding: 0rpx 30rpx;
  248. .ul-item {
  249. padding: 5px 0rpx;
  250. display: flex;
  251. align-items: center;
  252. .item-value {
  253. padding: 20rpx;
  254. position: absolute;
  255. display: flex;
  256. align-items: center;
  257. justify-content: space-around;
  258. .content {
  259. .title {
  260. font-size: 32rpx;
  261. font-family: Microsoft YaHei;
  262. font-weight: 400;
  263. color: #ffffff;
  264. }
  265. .tip {
  266. font-size: 24rpx;
  267. font-family: Microsoft YaHei;
  268. font-weight: 400;
  269. color: #ffffff;
  270. }
  271. }
  272. .price {
  273. margin-left: 180rpx;
  274. font-size: 25rpx;
  275. font-family: Microsoft YaHei;
  276. font-weight: 400;
  277. color: #ffffff;
  278. }
  279. }
  280. .icon-tip {
  281. width: 100rpx;
  282. height: 100rpx;
  283. }
  284. .content {
  285. margin-left: 40rpx;
  286. }
  287. }
  288. .card-box {
  289. .title {
  290. font-size: 30rpx;
  291. font-family: Microsoft YaHei;
  292. font-weight: 400;
  293. color: #333333;
  294. margin: 30rpx 0;
  295. }
  296. .item-box {
  297. display: flex;
  298. flex-wrap: wrap;
  299. view {
  300. background: #c1ffed;
  301. border: 1px solid #00b38b;
  302. border-radius: 30rpx;
  303. padding: 5rpx 15rpx;
  304. font-size: 28rpx;
  305. font-family: Microsoft YaHei;
  306. font-weight: 400;
  307. color: #019977;
  308. margin: 20rpx 30rpx;
  309. margin-top: 0;
  310. }
  311. }
  312. }
  313. .radio {
  314. .title {
  315. font-size: 30rpx;
  316. font-family: Microsoft YaHei;
  317. font-weight: 400;
  318. color: #333333;
  319. margin: 30rpx 0;
  320. }
  321. .more-btn {
  322. text-align: center;
  323. margin-top: 30rpx;
  324. border-bottom: 1rpx solid #dcdcdc;
  325. padding-bottom: 30rpx;
  326. font-size: 26rpx;
  327. font-family: Microsoft YaHei;
  328. font-weight: 400;
  329. color: #999999;
  330. }
  331. .radio-item {
  332. width: 100%;
  333. height: 150rpx;
  334. position: relative;
  335. image {
  336. width: 100%;
  337. height: 100%;
  338. position: absolute;
  339. z-index: -1;
  340. }
  341. .radio-box {
  342. // width: 100%;
  343. // height: 100%;
  344. display: flex;
  345. justify-content: space-between;
  346. align-items: center;
  347. padding: 30rpx;
  348. margin: 30rpx 0;
  349. .radio-box-left {
  350. display: flex;
  351. .icon {
  352. width: 88rpx;
  353. height: 88rpx;
  354. background: #89fcdb;
  355. border-radius: 50%;
  356. display: flex;
  357. justify-content: center;
  358. align-items: center;
  359. image {
  360. width: 48rpx;
  361. height: 48rpx;
  362. z-index: 1;
  363. }
  364. }
  365. .content {
  366. margin-left: 64rpx;
  367. view {
  368. font-size: 28rpx;
  369. font-family: Microsoft YaHei;
  370. font-weight: 400;
  371. color: #333333;
  372. margin-bottom: 10rpx;
  373. }
  374. text {
  375. font-size: 36rpx;
  376. font-family: Microsoft YaHei;
  377. font-weight: 400;
  378. color: #333333;
  379. }
  380. }
  381. }
  382. .choose-item {
  383. width: 44rpx;
  384. height: 44rpx;
  385. border: 2px solid #00b38b;
  386. border-radius: 50%;
  387. display: flex;
  388. justify-content: center;
  389. align-items: center;
  390. .active {
  391. width: 34rpx;
  392. height: 34rpx;
  393. background: #00b38b;
  394. border-radius: 50%;
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. </style>