vipBuy.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125
  1. <template>
  2. <view class="container">
  3. <view class="info es-pt-34">
  4. <view class="u-f-ajc u-f-jsb es-ml-24" :style="{marginTop: statusBarHeight+'px'}">
  5. <view class="u-f-ajc" @tap="toBack">
  6. <image class="es-icon-64" src="/static/image/agent/member/back_white_icon.png" mode=""></image>
  7. </view>
  8. <view class="u-f-ajc">
  9. <image class="es-h-52 w264" src="/static/image/agent/member/member_title.png" mode=""></image>
  10. </view>
  11. <view class=""></view>
  12. </view>
  13. <view class="es-ml-32 u-f es-mt-44 info-box">
  14. <view class="u-f-ajc es-mr-20 avatar es-br-ban es-bc-white">
  15. <image class="es-br-ban es-icon-80" :src="!$isEmpty(user.avatar)?user.avatar:avatar" mode="">
  16. </image>
  17. </view>
  18. <view class="">
  19. <view class="es-c-white es-fs-32 es-fw-600">
  20. {{ $isEmpty(user.nickName)?"暂无昵称":user.nickName }}
  21. </view>
  22. <view class="es-mt-4 es-c-99 es-fs-24" v-if="user.isVip==1">
  23. 有效期至:{{ $formatDate(user.vipEndDate) }}
  24. </view>
  25. </view>
  26. <image class="vipBg" src="/static/image/agent/member/vip_bg.png" mode="aspectFit"></image>
  27. </view>
  28. </view>
  29. <view class="content es-bc-white">
  30. <view class="u-f-ajc u-f-jsb">
  31. <view class="content-card u-f-ajc u-f-fc" v-for="(item,index) in dataList" :key="index"
  32. @tap="changePackage(index)" :class="[pickIndex==index?'active':'es-bc-white']">
  33. <view class="es-fs-32 es-fw " :class="[pickIndex==index?'color995316':'es-c-22']">
  34. {{item.packageName}}
  35. </view>
  36. <view class="es-mt-14" :class="[pickIndex==index?'colorFE4D46':'colorD59B6D']">
  37. <text class="es-fs-40 es-fw-500 es-mr-4">¥</text>
  38. <text class="es-fs-64 es-fw ">{{item.sellPrice}}</text>
  39. </view>
  40. <view class="es-fs-24 color9A9A99 es-mt-8 delete-line">
  41. 原价{{item.price}}元
  42. </view>
  43. <view class="es-mt-18 content-card-btn es-fs-24 es-br-32"
  44. :class="[pickIndex==index?'es-c-white active-btn':'es-bc-white colorD59B6D']">
  45. {{descText[index]}}
  46. </view>
  47. </view>
  48. </view>
  49. <view class="priceBox es-mt-32" v-if="couponTotal>0">
  50. <view class="u-f">
  51. <view class="es-fs-24 u-f-ajc es-mr-12 es-fw-500 es-br-16 color995316 priceBox-tip">
  52. 开通可得
  53. </view>
  54. <view class="es-fs-36 es-fw-bold colorFFF3DE es-mr-26">
  55. {{couponTotal}}张通用红包
  56. </view>
  57. <view class="u-f es-ae yuanBox">
  58. <view class="es-fs-60 es-fw-bold colorFFF3DE">
  59. {{couponOverallPrice}}
  60. </view>
  61. <view class="es-fs-20 es-fw-bold colorFF261D yuan u-f-ajc es-mb-20">
  62. </view>
  63. </view>
  64. </view>
  65. <view class="es-mt-30 u-f priceBox-price">
  66. <view class="es-mr-8 es-br-16 colorFE4D46 u-f-ajc u-f-fc priceBox-price-list"
  67. v-for="(item,index) in fsCouponList" :key="index">
  68. <view class="">
  69. <text class="es-fs-32">¥</text>
  70. <text class="es-fs-44 es-fw-bold">{{item.price}}</text>
  71. </view>
  72. <view class="u-f-ajc ">
  73. <image class="red_envelope" src="/static/image/agent/member/red_envelope_list_bg.png"
  74. mode=""></image>
  75. </view>
  76. <view class="es-mt-4 es-fs-24" v-if="item.minPrice>0">
  77. 满{{item.minPrice}}元可用
  78. </view>
  79. </view>
  80. </view>
  81. <view class="priceBox-btn es-mt-24 u-f-ajc es-mr-24" v-if="false">
  82. <text class="es-fs-36 es-fw-500 es-mr-14 colorFE4D46">一键领取优惠券</text>
  83. <text class="es-fs-24 es-fw-600 es-mr-6 priceBox-btn-bg0 es-c-white">{{timeArr.hours}}</text>
  84. <text class="es-fs-24 es-fw-600 es-mr-6">:</text>
  85. <text class="es-fs-24 es-fw-600 es-mr-6 priceBox-btn-bg0 es-c-white">{{timeArr.minutes}}</text>
  86. <text class="es-fs-24 es-fw-600 es-mr-6">:</text>
  87. <text class="es-fs-24 es-fw-600 es-mr-10 priceBox-btn-bg0 es-c-white">{{timeArr.seconds}}</text>
  88. <text class="es-fs-24 es-c-22">后结束</text>
  89. </view>
  90. </view>
  91. <view class="es-mt-32 u-f-ajc">
  92. <view class="left-line left-lineBg es-mr-24"></view>
  93. <view class="es-fs-40 es-c-22 es-fw es-mr-24">
  94. 会员六大特权
  95. </view>
  96. <view class="left-line right-line right-lineBg"></view>
  97. </view>
  98. <scroll-view scroll-x="true" class="scroll-X">
  99. <view class="es-mt-32 u-f">
  100. <view class="es-mr-64 u-f-ajc u-f-fc" v-for="(item,index) in list" :key="index">
  101. <view class="u-f-ajc">
  102. <image class="es-br-ban es-icon-96" :src="item.imageUrl" mode="">
  103. </image>
  104. </view>
  105. <view class="u-f-ajc es-mt-12 es-fs-24 color4C2B0A" :style="{whiteSpace:'nowrap'}">
  106. {{item.title}}
  107. </view>
  108. </view>
  109. </view>
  110. </scroll-view>
  111. </view>
  112. <view class="fixed es-bc-white u-f-ajc u-f-fc">
  113. <view class="es-fs-40 es-fw-600 fixed-btn u-f-ajc" @tap="payFun">
  114. ¥{{checkPrice}}/{{desc[pickIndex]}} 立即开通
  115. <view class="fixed-btn-text es-c-white es-fs-24 u-f-ajc">
  116. {{descText[pickIndex]}}
  117. </view>
  118. </view>
  119. <view class="es-mt-24">
  120. <text class="es-fs-24 es-c-75">开通即同意</text>
  121. <text class="es-fs-24 colorD59B6D" @tap="openH5(0)">《会员服务协议》</text>
  122. </view>
  123. </view>
  124. <uni-popup ref="popPayType" type="bottom" borderRadius="10rpx 10rpx 0px 0px">
  125. <view class="pay-box">
  126. <view class="title">请选择支付方式</view>
  127. <view class="pay-list">
  128. <view class="pay-item wx" @click="doBuy(1)">
  129. <image src="/static/images/wx.png"></image>
  130. <view class="name">微信支付</view>
  131. </view>
  132. <view class="pay-item alipay" @click="doBuy(2)">
  133. <image src="/static/images/alipay.png"></image>
  134. <view class="name">支付宝支付</view>
  135. </view>
  136. </view>
  137. </view>
  138. </uni-popup>
  139. </view>
  140. </template>
  141. <script>
  142. import {
  143. getIOSPayStatus
  144. } from '@/api/common.js';
  145. import {
  146. getUserInfo,
  147. getCouponsUnderVipPackage
  148. } from '@/api/user'
  149. import {
  150. getPackageList,
  151. createVipOrder,
  152. vipZfbPayment,
  153. getVipOrderById,
  154. applePayment,
  155. vipWxPayment,
  156. setIapCertificate
  157. } from '@/api/course'
  158. export default {
  159. data() {
  160. return {
  161. statusBarHeight: '',
  162. descText: ['新客体验', '限时优惠', '一单回本'],
  163. desc: ['月', '季', '年'],
  164. active: 0,
  165. list: [{
  166. imageUrl: '/static/image/agent/member/coupon_icon.png',
  167. title: '优惠券'
  168. }, {
  169. imageUrl: '/static/image/agent/member/system_testing_icon.png',
  170. title: '体制检测'
  171. }, {
  172. imageUrl: '/static/image/agent/member/health_encyclopedia_icon.png',
  173. title: '养生百科'
  174. }, {
  175. imageUrl: '/static/image/agent/member/classic_medical_books_icon.png',
  176. title: '经典医书'
  177. }, {
  178. imageUrl: '/static/image/agent/member/multi_device_login_icon.png',
  179. title: '多设备登录'
  180. }, {
  181. imageUrl: '/static/image/agent/member/remove_ads_icon.png',
  182. title: '去除广告'
  183. }, ],
  184. timer: null,
  185. timeArr: {},
  186. dataList: [],
  187. pickIndex: 0,
  188. packageItem: {
  189. sellPrice: 0,
  190. price: 0
  191. },
  192. checkPrice: 0.0,
  193. payTypes: ["微信支付", "支付宝支付"],
  194. payType: 1, //微信支付:1 支付宝支付:2
  195. user: {
  196. avatar: "/static/images/detault_head.png",
  197. userName: "",
  198. phone: "",
  199. nickName: "",
  200. },
  201. order: null,
  202. showPayTips: false,
  203. agree: false,
  204. isAgreePrivacy: false,
  205. isIos: false,
  206. showIOSPay: 0,
  207. isCanPay: true,
  208. iapChannel: null,
  209. restoreFlag: false,
  210. appleProductId: '',
  211. tzCashier: null,
  212. userInfo: null,
  213. couponTotal: 0,
  214. couponOverallPrice: 0,
  215. fsCouponList: [],
  216. }
  217. },
  218. // onBackPress() {
  219. // // 手动调用返回方法
  220. // uni.navigateBack({ delta: 1});
  221. // // 阻止默认的返回行为
  222. // return true;
  223. // },
  224. onLoad(options) {
  225. // #ifdef APP-PLUS
  226. this.tzCashier = uni.requireNativePlugin("TZBank-Cashier");
  227. this.isIos = this.$isIos();
  228. this.userInfo = JSON.parse(uni.getStorageSync("userInfo"));
  229. if (this.isIos) {
  230. this.getIOSPayStatusFun()
  231. } else {
  232. this.isAgreePrivacy = plus.runtime.isAgreePrivacy();
  233. }
  234. // #endif
  235. this.initData();
  236. const systemInfo = uni.getSystemInfoSync();
  237. this.statusBarHeight = systemInfo.statusBarHeight;
  238. },
  239. onShow() {
  240. if (this.showPayTips) {
  241. if(this.$refs.popTip){
  242. this.$refs.popTip.open();
  243. }
  244. this.showPayTips = false;
  245. }
  246. this.restoreComplateRequest()
  247. },
  248. onUnload() {
  249. const subNVue = uni.getSubNVueById('privilege');
  250. if (subNVue) {
  251. setTimeout(e => {
  252. subNVue.show();
  253. }, 200);
  254. }
  255. },
  256. methods: {
  257. toBack() {
  258. uni.navigateBack()
  259. },
  260. payFun() {
  261. if (this.isIos) {
  262. this.doBuy(3);
  263. } else {
  264. this.$refs.popPayType.open();
  265. }
  266. },
  267. async getCouponsUnderVipPackageFun() {
  268. const res = await getCouponsUnderVipPackage({
  269. packageId: this.dataList[this.pickIndex].packageId
  270. })
  271. if (res.code == 200) {
  272. this.couponTotal = res.data.couponTotal
  273. this.couponOverallPrice = res.data.couponOverallPrice
  274. this.fsCouponList = res.data.fsCouponList
  275. } else {
  276. uni.showToast({
  277. icon: 'none',
  278. title: res.msg
  279. })
  280. }
  281. },
  282. padZero(num) {
  283. return num < 10 ? `0${num}` : num.toString();
  284. },
  285. formatCountdown(seconds) {
  286. // 1. 先校验输入:确保是有效正整数,避免负数/非数字导致计算错误
  287. const totalSeconds = Math.max(0, Math.floor(Number(seconds) || 0));
  288. // 2. 重新梳理计算逻辑(核心修复)
  289. const hours = Math.floor(totalSeconds / 3600);
  290. const remainingAfterHours = totalSeconds % 3600; // 小时取余后剩余的秒数
  291. const minutes = Math.floor(remainingAfterHours / 60);
  292. const secs = remainingAfterHours % 60;
  293. // 3. 返回格式化结果(补零+原始值)
  294. return {
  295. hours: this.padZero(hours),
  296. minutes: this.padZero(minutes),
  297. seconds: this.padZero(secs),
  298. total: totalSeconds // 确保total是处理后的有效数值
  299. };
  300. },
  301. updateCountdown(now, targetTime) {
  302. console.log(now, targetTime);
  303. const distance = targetTime - now;
  304. console.log('distance', distance);
  305. // 时间计算
  306. const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) || '00';
  307. const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)) || '00';
  308. const seconds = Math.floor((distance % (1000 * 60)) / 1000) || '00';
  309. // 显示倒计时
  310. console.log(hours + "小时 " + minutes + "分钟 " + seconds + "秒 ");
  311. // 如果倒计时结束,显示消息并停止计时器
  312. if (distance < 0) {
  313. clearInterval(this.timer);
  314. }
  315. return {
  316. hours,
  317. minutes,
  318. seconds
  319. }
  320. },
  321. timingFun() {
  322. const now = new Date().getTime();
  323. const end = now + 600000
  324. this.timer = setInterval(this.updateCountdown(now, end), 1000)
  325. },
  326. getIOSPayStatusFun() {
  327. getIOSPayStatus().then(res => {
  328. if (res.code == 200) {
  329. this.showIOSPay = res.iosPayStatus
  330. }
  331. })
  332. },
  333. initData() {
  334. this.getPackageList();
  335. this.getUserInfo();
  336. },
  337. getPackageList() {
  338. getPackageList().then(res => {
  339. if (res.code == 200) {
  340. this.dataList = res.data;
  341. this.packageItem = this.dataList[0];
  342. this.checkPrice = this.packageItem.sellPrice;
  343. this.appleProductId = this.packageItem.appleProductId
  344. this.getCouponsUnderVipPackageFun()
  345. }
  346. },
  347. rej => {}
  348. );
  349. },
  350. doBuy(type) {
  351. this.payType = type
  352. this.createVipOrder();
  353. },
  354. createVipOrder() {
  355. // if (!this.agree) {
  356. // uni.showToast({
  357. // title: "请同意相关协议",
  358. // icon: 'none'
  359. // });
  360. // return
  361. // }
  362. if (!this.$isLogin()) {
  363. this.$showLoginPage();
  364. return;
  365. }
  366. if (this.isIos && this.showIOSPay != 1) {
  367. uni.showToast({
  368. title: '请开通苹果支付',
  369. icon: 'none'
  370. });
  371. return
  372. }
  373. // if (this.isIos && this.showIOSPay == 1) {
  374. // this.payType = 3
  375. // }
  376. uni.showLoading({
  377. title: ""
  378. });
  379. let params = {
  380. "packageId": this.packageItem.packageId,
  381. "payType": this.payType
  382. };
  383. createVipOrder(params).then(res => {
  384. console.log("qxj createVipOrder res:" + JSON.stringify(res));
  385. uni.hideLoading();
  386. this.$refs.popPayType.close()
  387. if (res.code == 200) {
  388. this.order = res.order;
  389. console.log("qxj payType",this.payType);
  390. if (this.payType == 1) { //微信支付
  391. this.doWxPay();
  392. } else if (this.payType == 3 && this.isIos) { //苹果
  393. this.doApplePay()
  394. } else { //支付宝
  395. this.doAlipay();
  396. }
  397. } else {
  398. uni.showToast({
  399. title: res.msg,
  400. icon: 'none'
  401. });
  402. }
  403. },
  404. rej => {}
  405. );
  406. },
  407. changePackage(index) {
  408. this.pickIndex = index;
  409. this.packageItem = this.dataList[index];
  410. this.checkPrice = this.packageItem.sellPrice;
  411. this.appleProductId = this.packageItem.appleProductId
  412. this.getCouponsUnderVipPackageFun()
  413. },
  414. changePayType(index) {
  415. this.payType = index + 1;
  416. },
  417. getUserInfo() {
  418. let that = this;
  419. getUserInfo().then(res => {
  420. if (res.code == 200) {
  421. if (res.user != null) {
  422. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  423. this.user = res.user;
  424. } else {
  425. uni.showToast({
  426. icon: 'none',
  427. title: res.msg,
  428. });
  429. }
  430. }
  431. },
  432. rej => {}
  433. );
  434. },
  435. doAlipay() {
  436. var data = {
  437. orderId: this.order.orderId
  438. };
  439. let that = this;
  440. // #ifdef APP-PLUS
  441. uni.showLoading();
  442. vipZfbPayment(data).then(res => {
  443. uni.hideLoading();
  444. if(that.$refs.popTip){
  445. that.$refs.popTip.open();
  446. }
  447. if (res.code == 200) {
  448. if (res.type == "tz") {
  449. const match = res.data.body.url.match(/[\?&]businessCstNo=([^&]+)/);
  450. const businessCstNo = match ? match[1] : null;
  451. console.log("qxj tzCashier:" + this.tzCashier + " businessCstNo:" + businessCstNo);
  452. this.tzCashier.pay({
  453. env: 0,
  454. wxMiniProgramType: 0,
  455. wxAppId: 'wx703c4bd07bbd1695',
  456. wxUniversalLink: "https://yjf.runtzh.com/",
  457. orderFlowNo: res.data.body.orderFlowNo,
  458. businessCstNo: businessCstNo,
  459. platMerCstNo: res.data.body.platMerCstNo
  460. }, (res) => {
  461. uni.$emit('closePrivilege', {});
  462. that.showPayTips = true;
  463. });
  464. } else if (res.type == 'hf') {
  465. if (uni.getSystemInfoSync().platform == 'android') {
  466. var alipayScheme = 'alipays://platformapi/startApp?&saId=10000007&qrcode=' + res
  467. .data.qr_code;
  468. } else {
  469. var alipayScheme = 'alipay://platformapi/startApp?&saId=10000007&qrcode=' + res
  470. .data.qr_code;
  471. }
  472. // 在uni-app中使用plus.runtime.openURL打开URL
  473. plus.runtime.openURL(alipayScheme, function(error) {
  474. });
  475. uni.$emit('closePrivilege', {});
  476. that.showPayTips = true;
  477. }
  478. } else {
  479. uni.showToast({
  480. title: res.msg,
  481. icon: 'none'
  482. })
  483. }
  484. },
  485. rej => {}
  486. );
  487. // #endif
  488. },
  489. doWxPay() {
  490. var data = {
  491. orderId: this.order.orderId
  492. };
  493. let that = this;
  494. uni.showLoading();
  495. //眺收银台
  496. // vipWxPayment(data).then(res => {
  497. // uni.hideLoading();
  498. // //that.$refs.popPayType.close();
  499. // that.$refs.popTip.open();
  500. // if(res.code==200){
  501. // console.log('weixcin',res)
  502. // if(res.type=="tz"){
  503. // let businessCstNo=that.userInfo.userId;
  504. // if(!!res.data.body.url){
  505. // const match = res.data.body.url.match(/[\?&]businessCstNo=([^&]+)/);
  506. // businessCstNo = match ? match[1] : null;
  507. // }
  508. // console.log("qxj tzCashier:"+this.tzCashier+" businessCstNo:"+businessCstNo);
  509. // this.tzCashier.pay({
  510. // env:0,
  511. // wxMiniProgramType:0,
  512. // wxAppId:"wx703c4bd07bbd1695",
  513. // wxUniversalLink:"https://yjf.runtzh.com/",
  514. // orderFlowNo:res.data.body.orderFlowNo,
  515. // businessCstNo:businessCstNo,
  516. // platMerCstNo:res.data.body.platMerCstNo
  517. // },(res)=>{
  518. // console.log('weixcin',res)
  519. // uni.$emit('closePrivilege', {});
  520. // that.showPayTips=true;
  521. // });
  522. // }
  523. // else if(res.type=='hf'){
  524. // uni.$emit('closePrivilege', {});
  525. // that.showPayTips=true;
  526. // }
  527. // }
  528. // else{
  529. // uni.showToast({title:res.msg,icon:'none'})
  530. // }
  531. // },
  532. // rej => {}
  533. // );
  534. //跳转小程序支付
  535. plus.share.getServices(function(res) {
  536. var sweixin = null;
  537. for (var i = 0; i < res.length; i++) {
  538. var t = res[i];
  539. if (t.id == 'weixin') {
  540. sweixin = t;
  541. }
  542. }
  543. if (sweixin) {
  544. let path = '/pages_order/userVipOrderPayment?orderId=' + that.order.orderId +
  545. "&payMethod=app";
  546. console.log('调起小程序 path:' + path);
  547. //唤起微信跳转小程序
  548. sweixin.launchMiniProgram({
  549. id: "gh_feb7753a310b", //gh_7a6a32e5ef61 御君方互医
  550. path: '/pages_order/userVipOrderPayment?orderId=' + that.order.orderId +
  551. "&payMethod=app",
  552. type: 0 // 微信小程序版本类型,可取值: 0-正式版; 1-测试版; 2-体验版。 默认值为0。
  553. }, function() {
  554. console.log("微信唤起成功");
  555. return true;
  556. }, function(e) {
  557. console.log("微信唤起失败", e);
  558. uni.showToast({
  559. title: '微信唤起失败,请检查是否有微信应用',
  560. icon: 'none'
  561. });
  562. return false;
  563. });
  564. that.showPayTips = true;
  565. uni.$emit('closePrivilege', {});
  566. } else {
  567. uni.showToast({
  568. title: '微信唤起失败,请检查是否有微信应用',
  569. icon: 'none',
  570. duration: 3000
  571. });
  572. return false;
  573. }
  574. }, function(res) {
  575. console.log(JSON.stringify(res));
  576. });
  577. },
  578. getVipOrderById() {
  579. getVipOrderById(this.order.orderId).then(res => {
  580. if(this.$refs.popTip){
  581. this.$refs.popTip.close();
  582. }
  583. if (res.code == 200) {
  584. if (res.data.status == 1 || res.data.payTime != null) {
  585. // #ifdef APP-PLUS
  586. if (plus.runtime.channel == "baidu") { //获取渠道标识
  587. let bdCmdType = uni.getStorageSync("bdCmdType");
  588. if (bdCmdType != null && parseInt(bdCmdType) <= 2) {
  589. //this.$registerIdCode("orders",2,res.data.payMoney.toString()); //已下单
  590. }
  591. }
  592. // #endif
  593. this.getUserInfo();
  594. uni.showToast({
  595. title: "支付成功",
  596. icon: 'success'
  597. });
  598. } else {
  599. uni.showToast({
  600. title: "支付失败",
  601. icon: 'error'
  602. });
  603. }
  604. }
  605. setTimeout(() => {
  606. this.$navBack();
  607. }, 2000);
  608. },
  609. rej => {}
  610. );
  611. },
  612. openH5(index) {
  613. uni.setStorageSync('url', index == 0 ? "https://userapp.his.cdwjyyh.com/web/userAgreement" : "https://userapp.his.cdwjyyh.com/web/vipAutomaticService");
  614. uni.navigateTo({
  615. url: "/pages/index/h5"
  616. })
  617. },
  618. closeTip() {
  619. if(this.$refs.popTip){
  620. this.$refs.popTip.close();
  621. }
  622. this.getVipOrderById();
  623. },
  624. confirmTip() {
  625. uni.showLoading({
  626. title: "请稍侯...",
  627. mask: true
  628. });
  629. setTimeout(() => {
  630. uni.hideLoading();
  631. this.getVipOrderById();
  632. uni.$emit('refreshUser', {});
  633. }, 2000);
  634. },
  635. handleAgree() { // 同意
  636. this.agree = !this.agree
  637. if (this.isIos) {
  638. if (this.agree) {
  639. plus.runtime.agreePrivacy()
  640. } else {
  641. plus.runtime.disagreePrivacy();
  642. }
  643. }
  644. },
  645. doApplePay() {
  646. var data = {
  647. orderId: this.order.orderId
  648. };
  649. let that = this;
  650. uni.showLoading({
  651. title: ""
  652. });
  653. applePayment(data).then(res => {
  654. uni.hideLoading();
  655. console.log("applePayment===", res)
  656. if (res.code == 200) {
  657. this.checkApplePay(res.payCode)
  658. } else {
  659. uni.showLoading({
  660. title: res.msg,
  661. icon: none
  662. })
  663. }
  664. }).catch(err => {
  665. uni.hideLoading();
  666. })
  667. },
  668. checkApplePay(payCode) {
  669. const that = this
  670. uni.showLoading({
  671. title: '检测支付环境...',
  672. mask: true
  673. })
  674. uni.getProvider({
  675. service: 'payment',
  676. success: (res) => {
  677. let iapChannel = res.providers.find((channel) => channel.id === 'appleiap');
  678. that.iapChannel = iapChannel
  679. if (!iapChannel) {
  680. console.log('Apple IAP channel not found. Check device & configuration.');
  681. uni.hideLoading()
  682. uni.showToast({
  683. title: "不支持苹果支付",
  684. icon: 'none'
  685. })
  686. return;
  687. }
  688. // 获取订单信息,必须调用此方法才能进行 iap 支付
  689. iapChannel.requestOrder([that.appleProductId], function(orderList) {
  690. console.log('requestOrder success666: ', orderList)
  691. that.applePay(payCode)
  692. }, function(e) {
  693. uni.showToast({
  694. title: "获取产品信息失败",
  695. icon: 'none'
  696. })
  697. console.log('requestOrder failed: ' + JSON.stringify(e));
  698. })
  699. },
  700. fail: (err) => {
  701. console.log('Failed to get payment provider:', err);
  702. uni.hideLoading()
  703. uni.showToast({
  704. title: "获取支付通道失败",
  705. icon: 'none'
  706. })
  707. }
  708. });
  709. },
  710. // 请求是否有已完成未关闭的订单
  711. restoreComplateRequest() {
  712. const that = this
  713. if (this.iapChannel) {
  714. this.iapChannel.restoreComplateRequest({
  715. manualFinishTransaction: true, // 3.5.1+ 支持,设置此参数后需要开发者主动关闭订单,参见下面的关闭订单方法 finishTransaction()
  716. username: "USERID_" + that.user.userId
  717. }, function(res) {
  718. // res 格式为数组存放恢复的IAP商品交易信息对象 IAPTransaction,需要将返回的支付凭证传给后端进行二次认证
  719. //如果有并且状态为已支付则请求关闭并回调给后端
  720. console.log("已完成未关闭的订单信息:", res)
  721. if (res.length > 0) {
  722. //轮询关闭订单
  723. res.map(item => {
  724. that.finishTransaction(item, that.iapChannel)
  725. })
  726. }
  727. });
  728. }
  729. },
  730. // 关闭订单
  731. finishTransaction(transaction, iapChannel) {
  732. console.log("==finishTransaction===")
  733. return new Promise((resolve, reject) => {
  734. this.iapChannel.finishTransaction(transaction, (res) => {
  735. console.log("==fresolve inishTransaction===", res)
  736. resolve(res);
  737. }, (err) => {
  738. console.log("==err inishTransaction===", err)
  739. reject(err);
  740. });
  741. });
  742. },
  743. //苹果支付
  744. applePay(payCode) {
  745. console.log("苹果支付", this.order.orderId, payCode)
  746. let that = this
  747. uni.showLoading({
  748. title: '支付中...',
  749. mask: true
  750. })
  751. this.restoreFlag = true
  752. uni.requestPayment({
  753. provider: 'appleiap',
  754. orderInfo: {
  755. productid: that.appleProductId,
  756. username: 'USERID_' + this.user.userId, // 透传参数,一般用于标记订单和用户的关系,向苹果服务器二次验证票据时返回此字段
  757. quantity: 1, // 购买数量,至少大于等于 1
  758. manualFinishTransaction: true,
  759. optimize: true // 设置 optimize: true 解决丢单问题
  760. },
  761. async success(res) {
  762. console.log("苹果支付===", res)
  763. that.restoreFlag = false
  764. // {
  765. // "payment": {
  766. // "productid": "001",
  767. // "quantity": "1",
  768. // "username": "ORDERID562"
  769. // },
  770. // "transactionDate": "2025-07-02 18:20:37",
  771. // "transactionIdentifier": "2000000953130653",
  772. // "transactionReceipt": "MIIUQAYJKoZIhvcNAQcCoIIUMTCCFC0CAQExDzANBglghkgBZQMEAgEFADCCA3YGCSqGSIb3DQEHAaCCA2cEggNjMYIDXzAKAgEIAgEBBAIWADAKAgEUAgEBBAIMADALAgEBAgEBBAMCAQAwCwIBCwIBAQQDAgEAMAsCAQ8CAQEEAwIBADALAgEQAgEBBAMCAQAwCwIBGQIBAQQDAgEDMAwCAQoCAQEEBBYCNCswDAIBDgIBAQQEAgIAvTANAgENAgEBBAUCAwLBFDANAgETAgEBBAUMAzEuMDAOAgED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QWuhjmiwa333pg7mVxpWakJtS92X/tHn3LgZU7wnn21dz1QmlzJDMlEmKz9jn6ajyHI5IMc9uSh8OJBjGI10v9Et3w2vehLAngXTHC22DEhTA+FFIw9w907dH2/5FZwFT3HFXCNWVq8ec5fuJ/QKzOX0FAbpP5n0yAtom5VHK8o85/qc8oliAyJ/qggUNdg==",
  773. // "transactionState": "1",
  774. // "errMsg": "requestPayment:ok"
  775. // }
  776. if (res.transactionState == '1') {
  777. //调用后端接口验签
  778. let data = {
  779. payCode: payCode,
  780. transactionId: res.transactionIdentifier,
  781. receipt: res.transactionReceipt,
  782. chooseEnv: false, // 是否选择正式环境
  783. payclassifyId: that.appleProductId,
  784. classify: 5, // 5:appvip,course
  785. }
  786. that.submitMisson(data, res)
  787. }
  788. },
  789. fail(e) {
  790. console.log('调起苹果支付失败:', e)
  791. that.isCanPay = true
  792. uni.showLoading({
  793. title: '支付失败',
  794. icon: "error"
  795. })
  796. },
  797. complete() {
  798. that.isCanPay = true
  799. uni.hideLoading()
  800. }
  801. })
  802. },
  803. // 苹果内购二次校验
  804. submitMisson(data, transaction) {
  805. const that = this
  806. uni.showLoading({
  807. title: '正在处理支付结果...',
  808. mask: true
  809. })
  810. setIapCertificate(data).then(async res => {
  811. uni.hideLoading()
  812. if (res.code == 200) {
  813. //给支付按钮解锁
  814. that.isCanPay = true
  815. console.log("submitMisson===", res)
  816. if (res.status == 1 || res.payTime != null) {
  817. // #ifdef APP-PLUS
  818. if (plus.runtime.channel == "baidu") { //获取渠道标识
  819. let bdCmdType = uni.getStorageSync("bdCmdType");
  820. if (bdCmdType != null && parseInt(bdCmdType) <= 2) {
  821. //this.$registerIdCode("orders",2,res.data.payMoney.toString()); //已下单
  822. }
  823. }
  824. // #endif
  825. that.getUserInfo();
  826. await that.finishTransaction(transaction)
  827. uni.showToast({
  828. title: "支付成功",
  829. icon: 'success'
  830. });
  831. } else {
  832. uni.showToast({
  833. title: "支付失败",
  834. icon: 'error'
  835. });
  836. }
  837. }
  838. }).catch(() => {
  839. uni.hideLoading()
  840. })
  841. }
  842. }
  843. }
  844. </script>
  845. <style scoped lang="scss">
  846. .container {
  847. background: #141517;
  848. height: auto;
  849. min-height: 100vh;
  850. padding-bottom: 206rpx;
  851. overflow-y: scroll;
  852. overflow-x: hidden;
  853. display: flex;
  854. flex-direction: column;
  855. }
  856. .info {
  857. .info-box {
  858. position: relative;
  859. .vipBg {
  860. position: absolute;
  861. right: -64rpx;
  862. bottom: -160rpx;
  863. }
  864. }
  865. .w264 {
  866. width: 264rpx;
  867. }
  868. .avatar {
  869. padding: 4rpx;
  870. }
  871. }
  872. .content {
  873. margin-top: 92rpx;
  874. padding: 40rpx 32rpx 40rpx;
  875. border-radius: 40rpx 40rpx 0 0;
  876. flex: 1;
  877. .es-mr-64 {
  878. margin-right: 64rpx;
  879. }
  880. .active {
  881. background: linear-gradient(135deg, #FEF7E7 0%, #FFEEE5 100%);
  882. border-radius: 24rpx 24rpx 24rpx 24rpx;
  883. border: 4rpx solid;
  884. border-image: linear-gradient(135deg, rgba(254, 223, 179, 1), rgba(254, 224, 189, 1)) 4 4;
  885. }
  886. .content-card {
  887. padding: 32rpx;
  888. border-radius: 24rpx;
  889. border: 4rpx solid #ECECEC;
  890. .delete-line {
  891. text-decoration: line-through;
  892. }
  893. .color9A9A99 {
  894. color: #9A9A99;
  895. }
  896. .content-card-btn {
  897. padding: 12rpx 30rpx;
  898. border: 1rpx solid #D59B6D;
  899. }
  900. .active-btn {
  901. border: none;
  902. background: linear-gradient(270deg, #FE6300 0%, #FE9D00 100%);
  903. }
  904. }
  905. // 价格
  906. .priceBox {
  907. padding: 24rpx 0 24rpx 24rpx;
  908. background-image: url('/static/image/agent/member/frame-bg.png');
  909. background-repeat: no-repeat;
  910. background-size: 100% 100%;
  911. position: relative;
  912. .priceBox-tip {
  913. padding: 4rpx 12rpx;
  914. background: linear-gradient(90deg, #FEF1E5 0%, #FFE6B5 100%);
  915. border-radius: 8rpx;
  916. }
  917. .yuanBox {
  918. position: absolute;
  919. top: 0;
  920. right: 48rpx;
  921. }
  922. .yuan {
  923. width: 24rpx;
  924. height: 24rpx;
  925. background: #FFF3DE;
  926. border-radius: 4rpx;
  927. }
  928. .colorFFF3DE {
  929. color: #FFF3DE;
  930. }
  931. .priceBox-price {
  932. overflow-x: auto;
  933. overflow-y: hidden;
  934. .priceBox-price-list {
  935. flex-shrink: 0;
  936. width: 164rpx;
  937. height: 164rpx;
  938. background: #FFFCF6;
  939. .red_envelope {
  940. width: 88rpx;
  941. height: 17rpx;
  942. }
  943. }
  944. }
  945. .priceBox-btn {
  946. height: 96rpx;
  947. background: linear-gradient(180deg, #FFF4D5 0%, #FFE5B1 100%);
  948. border-radius: 16rpx;
  949. .priceBox-btn-bg0 {
  950. padding: 8rpx;
  951. // width: 40rpx;
  952. // height: 40rpx;
  953. background: #222222;
  954. border-radius: 8rpx;
  955. }
  956. }
  957. }
  958. .left-line {
  959. width: 120rpx;
  960. height: 6rpx;
  961. border-radius: 3rpx;
  962. }
  963. .left-lineBg {
  964. background: linear-gradient(90deg, rgba(255, 247, 226, 0) 0%, #F7D3B6 100%);
  965. }
  966. .right-lineBg {
  967. background: linear-gradient(90deg, #F7D3B6 0%, rgba(255, 247, 226, 0) 100%);
  968. }
  969. .color4C2B0A {
  970. color: #4C2B0A;
  971. }
  972. }
  973. .colorFF261D {
  974. color: #FF261D;
  975. }
  976. .color995316 {
  977. color: #995316;
  978. }
  979. .colorFE4D46 {
  980. color: #FE4D46;
  981. }
  982. .colorD59B6D {
  983. color: #D59B6D;
  984. }
  985. .fixed {
  986. position: fixed;
  987. bottom: 0;
  988. box-shadow: 0rpx 0rpx 8rpx 6rpx rgba(0, 0, 0, 0.05);
  989. border-radius: 40rpx 40rpx 0rpx 0rpx;
  990. padding: 32rpx;
  991. width: 100vw;
  992. box-sizing: border-box;
  993. .fixed-btn {
  994. height: 104rpx;
  995. width: 100%;
  996. background: linear-gradient(90deg, #E8C591 0%, #F5DEB2 100%);
  997. box-shadow: 0rpx 12rpx 11rpx 0rpx rgba(200, 156, 105, 0.2);
  998. border-radius: 52rpx 52rpx 52rpx 52rpx;
  999. color: #995316;
  1000. position: relative;
  1001. .fixed-btn-text {
  1002. position: absolute;
  1003. top: -24rpx;
  1004. right: 26rpx;
  1005. width: 128rpx;
  1006. height: 56rpx;
  1007. background: linear-gradient(270deg, #FE6300 0%, #FE9D00 100%);
  1008. border-radius: 32rpx 32rpx 32rpx 0;
  1009. }
  1010. }
  1011. }
  1012. .pay-box {
  1013. border-radius: 30rpx 30rpx 0rpx 0rpx;
  1014. padding: 30rpx;
  1015. height: 350rpx;
  1016. background-color: #fff;
  1017. width: 100%;
  1018. display: flex;
  1019. flex-direction: column;
  1020. text-align: center;
  1021. justify-content: flex-start;
  1022. .title {
  1023. font-size: 32rpx;
  1024. font-weight: bold;
  1025. color: #111;
  1026. }
  1027. .pay-list {
  1028. margin-top: 50rpx;
  1029. display: flex;
  1030. text-align: center;
  1031. justify-content: center;
  1032. .pay-item {
  1033. margin: 10rpx;
  1034. padding: 30rpx 0rpx;
  1035. border-radius: 60rpx;
  1036. background-color: green;
  1037. flex: 1;
  1038. display: flex;
  1039. text-align: center;
  1040. justify-content: center;
  1041. image {
  1042. width: 40rpx;
  1043. height: 40rpx;
  1044. }
  1045. .name {
  1046. margin-left: 15rpx;
  1047. font-size: 32rpx;
  1048. font-weight: bold;
  1049. color: #fff;
  1050. }
  1051. }
  1052. .wx {
  1053. background-color: #09ba08;
  1054. }
  1055. .alipay {
  1056. background-color: #04a9ed;
  1057. }
  1058. }
  1059. }
  1060. </style>