bookticket.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015
  1. <template>
  2. <view class="pages">
  3. <view class="" :style="{height: navHeight+'px' }"></view>
  4. <view class="navbar-box">
  5. <u-navbar title="订单详情" :safeAreaInsetTop="true" @leftClick="leftClick" :titleStyle="{color:'#fff'}"
  6. leftIconColor="#fff" bgColor="transparent"></u-navbar>
  7. </view>
  8. <view class="page-wrap">
  9. <view class="base-info">
  10. <view class="up u-flex">
  11. <image class="img" :src="pageContent.performImg" mode="aspectFill" alt="">
  12. <view class="text">
  13. <view class="name text-item">{{pageContent.performName}}-{{pageContent.goodsName}}</view>
  14. <view class="time text-item">日期 {{pageContent.timeDate}}({{pageContent.timeWeek}})</view>
  15. <view class="time text-item">场次 {{pageContent.performTimeStart}} -
  16. {{pageContent.performTimeEnd}}</view>
  17. <view class="num text-item">{{pageContent.goodsName}} / {{pageContent.seatTypeName}}</view>
  18. <view class=" text-item">{{pageContent.auditoriumName}}</view>
  19. <!-- <view class="position text-item">{{performInfo.name}}</view> -->
  20. <!-- <view class="addr u-flex u-row-between">
  21. <view class="u-line-1">地址:遵义市《伟大转折》演艺中心</view>
  22. <u-icon name="arrow-right" color="#2D2D2D" size="36rpx"></u-icon>
  23. </view> -->
  24. </view>
  25. </view>
  26. <view class="down">
  27. <view class="num-wrap u-flex u-row-between">
  28. <view class="title">选购数量</view>
  29. <view class="num">{{totalVisitor}}</view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="block-wrap purchaser">
  34. <view class="block-title u-flex">
  35. <view class="name">购票人信息</view>
  36. <!-- <text>用于入园身份验证</text> -->
  37. </view>
  38. <view class="" v-if="vuex_member_info.isAuth">
  39. <view class="item">姓名:{{pageContent.purchaser.name}}</view>
  40. <view class="item">手机号:{{pageContent.purchaser.mobile|hidePhoneNumber}}</view>
  41. <view class="item">身份证:{{pageContent.purchaser.idcard|maskID}}</view>
  42. </view>
  43. <view class="un-auth" v-else @click="$u.route('center/factorauth',{from:'bookticket'})">
  44. 请先<text style="color: #ED0000;">实名认证</text>
  45. </view>
  46. </view>
  47. <view class="block-wrap visitors">
  48. <view class="block-title u-flex">
  49. <view class="name">观影人信息</view>
  50. <!-- <text>用于入园身份验证</text> -->
  51. </view>
  52. <view class="people-list u-flex u-flex-wrap">
  53. <view class="people btn" v-if="visitors.length>0" v-for="(visitor,index) in visitors" :key="index">
  54. {{visitor.name}}
  55. </view>
  56. <view class="btn u-flex u-row-center" @click="visitorShow = true">
  57. <u-icon name="plus-circle" color="#2D2D2D" size="32rpx"></u-icon>
  58. <text class="text">新增/更换</text>
  59. </view>
  60. </view>
  61. <!-- <view class="no-people u-flex" v-if="!visitors.length>0">
  62. <text>游客</text>
  63. <text class="right" @click="visitorShow = true">点击选择游客</text>
  64. </view> -->
  65. <view class="peoples" v-if="visitors.length>0">
  66. <view class="peoples-item u-flex u-row-between" v-for="(visitor,index) in visitors" :key="index">
  67. <view class="left u-flex">
  68. <u-icon @click="delVisitor(visitor)" name="close-circle" color="#2D2D2D"
  69. size="32rpx"></u-icon>
  70. <text style="margin-left: 8rpx;">观影人{{ index + 1 }}</text>
  71. <text class="name">{{visitor.name}}</text>
  72. <!-- <text class="people-id">{{ visitor.idcard | maskID }}</text> -->
  73. </view>
  74. <view class="right" @click="editVisitor(visitor)">编辑</view>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="coupon">
  79. <view class="title u-flex u-row-between u-border-bottom">
  80. <text>本单可享优惠</text>
  81. </view>
  82. <view class="single-til u-flex u-row-between">
  83. <view class="text">优惠券</view>
  84. <view class="more-text u-flex">
  85. <text>未使用</text>
  86. <u-icon name="arrow-right" color="#E6E6E6" size="24rpx"></u-icon>
  87. </view>
  88. </view>
  89. <view class="no-coupon">
  90. 您暂无可使用优惠券~
  91. </view>
  92. </view>
  93. <view class="notice">
  94. <view class="title u-flex u-row-between u-border-bottom">
  95. <text>购票须知</text>
  96. </view>
  97. <view class="notice-item parse-content">
  98. <u-parse :content="pageContent.ticketNotice"></u-parse>
  99. </view>
  100. <!-- <view class="notice-item">
  101. 1.由于设备故障等不可抗力因素,存在少量场次取消的情况,会
  102. 进行退票退款
  103. </view>
  104. <view class="notice-item">
  105. 2.由于影院系统不稳定等因素,存在出票失败的情况,会进行退款
  106. </view>
  107. <view class="notice-item">
  108. 3.取票码可以在“我的-订单页”中查看
  109. </view> -->
  110. </view>
  111. </view>
  112. <u-popup :show="visitorShow">
  113. <view class="people-show-content">
  114. <view class="title">
  115. <view class="cancel" @click="visitorShow=false">取消</view>
  116. 选择观影人
  117. </view>
  118. <view class="add-btn u-flex u-row-center" @click="addVisitor">
  119. <!-- <image class="img" :src="staticUrl+'/img/car.png'" ></image> -->
  120. 添加观影人信息
  121. </view>
  122. <view class="list">
  123. <u-checkbox-group v-model="selectedVisitor" iconPlacement="left">
  124. <view class="people u-flex u-row-between" v-for="(item,index) in visitorList" :key="index">
  125. <u-checkbox activeColor="#ED0303" :label="item.name" :name="item.idcard"></u-checkbox>
  126. <u-icon name="edit-pen-fill" color="#7F7F7F" size="32rpx"
  127. @click="editVisitor(item)"></u-icon>
  128. </view>
  129. </u-checkbox-group>
  130. </view>
  131. <view class="full-btn" @click="confirmVisitor">确定</view>
  132. </view>
  133. </u-popup>
  134. <view class="page-bottom">
  135. <view class="inner u-flex u-row-between">
  136. <view class="left u-flex">
  137. <text>应付金额:</text>
  138. <view class="total-price">
  139. {{totalPrice}}
  140. </view>
  141. </view>
  142. <view class="right">
  143. <view class="btn active" v-if="totalPrice>0&&cansubmit&&vuex_member_info.isAuth"
  144. @click="setTemplate">立即支付</view>
  145. <!-- <u-button @click="setTemplate" class="btn active" v-if="totalPrice>0&&cansubmit&&vuex_member_info.isAuth">立即支付</u-button> -->
  146. <view class="btn" v-else>立即支付</view>
  147. </view>
  148. </view>
  149. </view>
  150. <u-modal
  151. :show="umodal.show"
  152. :title="umodal.title"
  153. :content='umodal.content'
  154. confirmColor="#ED0303"
  155. @confirm="modalConfirm"
  156. ></u-modal>
  157. </view>
  158. </template>
  159. <script>
  160. import {
  161. systemInfo
  162. } from "@/mixin.js";
  163. // #ifdef H5
  164. import wxH5 from "weixin-jsapi";
  165. // #endif
  166. export default {
  167. mixins: [systemInfo],
  168. data() {
  169. return {
  170. performId: '',
  171. performInfo: {},
  172. pageData: {}, //上个页面传过来的数据
  173. pageContent: {
  174. performName: '',
  175. goodsName: '',
  176. timeDate: '',
  177. timeWeek: '',
  178. seatTypeName: '',
  179. auditoriumName: '',
  180. performTimeEnd: '',
  181. performTimeStart: '',
  182. purchaser: {
  183. mobile: '',
  184. idcard: ''
  185. },
  186. ticketNotice: '',
  187. viewerList: [],
  188. }, //页面信息
  189. ticketNotice: '',
  190. cansubmit: true,
  191. staticUrl: this.$commonConfig.staticUrl,
  192. visitors: [], //确认的游客
  193. visitorShow: false, //游客弹层
  194. visitorList: [], //游客列表
  195. selectedVisitor: [], //选中的游客(id)
  196. params: {}, //要提交的数据
  197. orderId: '', //订单提交获取
  198. payResult: {}, //gotoPay结果
  199. paysuccess: false, //支付结果
  200. templateIdList: [], //微信小程序订阅消息
  201. umodal:{
  202. show:false,
  203. title:'温馨提示',
  204. content:''
  205. },
  206. scene:null,
  207. retailId:null,//分销码
  208. label:null,//scene解析出来的
  209. retailId:null,
  210. }
  211. },
  212. computed: {
  213. totalPrice() {
  214. let that = this;
  215. return this.visitors.reduce((total, item) => {
  216. let price = null;
  217. price = Number(that.pageData.salePrice);
  218. total += price;
  219. return total;
  220. }, 0).toFixed(2);
  221. },
  222. totalVisitor() {
  223. let that = this;
  224. return this.visitors.reduce((total, item) => {
  225. total += 1;
  226. return total;
  227. }, 0);
  228. },
  229. },
  230. onShow() {
  231. this.getSettlement();
  232. },
  233. onLoad(page) {
  234. console.log('page', page);
  235. this.pageData = page;
  236. this.performId = page.performId;
  237. this.pageData.performTimeId = page.performTimeId;
  238. this.pageData.seatTypeId = page.seatTypeId
  239. this.getSystemInfo();
  240. this.getSettlement();
  241. this.getTemplateIdList(); //获取模板列表
  242. },
  243. methods: {
  244. leftClick(e) {
  245. let pages = getCurrentPages();
  246. if (pages.length == 1) {
  247. uni.$u.route('/pages/index/index')
  248. } else {
  249. uni.navigateBack()
  250. };
  251. },
  252. getSettlement() {
  253. this.$u.api.getSettlement(this.pageData).then(res => {
  254. // console.log('getSettlement',res.data);
  255. this.pageContent = res.data;
  256. this.getMemberAll();
  257. }).catch(err => {
  258. console.log('getSettlement', err);
  259. })
  260. },
  261. getMemberAll() {
  262. let that = this;
  263. // const userId = this.vuex_member_info.id;
  264. const userId = this.pageContent.viewerList[0]?.id;
  265. this.$u.api.selectMemberAll({
  266. userid: userId
  267. }).then(res => {
  268. // console.log('getMemberAll',res.data);
  269. this.visitorList = res.data.list;
  270. // this.visitors = this.visitorList.filter(obj => obj.memberId==userId);
  271. this.visitors = this.visitorList.filter(obj => that.selectedVisitor.includes(obj.idcard));
  272. // console.log('this.visitorList',this.visitorList);
  273. // console.log('this.selectedVisitor',this.selectedVisitor);
  274. // console.log('this.visitors',this.visitors);
  275. }).catch(err => {
  276. console.log('getMemberAll', err);
  277. })
  278. },
  279. confirmVisitor() {
  280. let that = this;
  281. // console.log('selectedVisitor',this.selectedVisitor);
  282. this.visitorShow = false;
  283. this.visitors = this.visitorList.filter(obj => that.selectedVisitor.includes(obj.idcard)).map(item => {
  284. return {
  285. name: item.name,
  286. mobile: item.mobile,
  287. idcard: item.idcard
  288. }
  289. });
  290. // console.log('this.visitors',this.visitors);
  291. },
  292. delVisitor(visitor) {
  293. // console.log('delVisitor',visitor);
  294. // console.log('this.visitors',this.visitors);
  295. this.visitors = this.visitors.filter(obj => obj.idcard != visitor.idcard);
  296. this.selectedVisitor = this.selectedVisitor.filter(item => item != visitor.idcard);
  297. // console.log('this.visitors',this.visitors);
  298. // console.log('this.selectedVisitor',this.selectedVisitor);
  299. },
  300. addVisitor() {
  301. uni.$u.route('/center/people', {
  302. type: 'addVisitor',
  303. fromPage: 'bookticket'
  304. });
  305. },
  306. editVisitor(item) {
  307. uni.$u.route('/center/people', {
  308. type: 'editVisitor',
  309. fromPage: 'bookticket',
  310. id: item.id,
  311. name: item.name,
  312. mobile: item.mobile,
  313. idcard: item.idcard,
  314. });
  315. },
  316. getTemplateIdList() {
  317. this.$u.api.templateIdList({
  318. templateLabel: 'order_pay'
  319. }).then(res => {
  320. // console.log('getTemplateIdList', res.data);
  321. this.templateIdList = res.data.list.map(item => {
  322. return item.templateId
  323. });
  324. // if(this.templateIdList.length>0){
  325. // this.templateEven();
  326. // }
  327. }).catch(err => {
  328. console.log('getTemplateIdList', err);
  329. })
  330. },
  331. async submitorder() {
  332. let _this = this;
  333. let retailId = null;
  334. try {
  335. retailId = await new Promise((resolve, reject) => {
  336. uni.getStorage({
  337. key: 'retailId',
  338. success: function (res) {
  339. console.log('getPositionData retailId====', res.data);
  340. resolve(res.data);
  341. },
  342. fail: function (error) {
  343. reject(error);
  344. }
  345. });
  346. });
  347. console.log('getPositionData retailId', retailId);
  348. } catch (error) {
  349. console.error('获取retailId失败', error);
  350. // 在这里可以添加处理失败的逻辑
  351. }
  352. this.retailId = retailId;
  353. console.log('submitorder retailId',this.retailId);
  354. // if(this.scene&&this.scene!='undefined'){
  355. // await this.$u.api.uncompress({scene:this.scene}).then(res=>{
  356. // // data.performId = res.data.performId;
  357. // this.label = res.data.label;
  358. // this.retailId = res.data.retailId;
  359. // console.log('uncompress',res.data);
  360. // }).catch(err=>{
  361. // console.log('uncompress',err);
  362. // })
  363. // }
  364. let params = {
  365. performId: this.pageContent.performId,
  366. goodsList: [{
  367. goodsId: this.pageContent.goodsId,
  368. salePeice: this.pageContent.salePrice,
  369. saleNum: 1
  370. }],
  371. auditoriumId: this.pageContent.auditoriumId,
  372. performTimeId: this.pageContent.performTimeId,
  373. seatTypeId: this.pageContent.seatTypeId,
  374. purchaser: {
  375. name: this.pageContent.purchaser.name,
  376. mobile: this.pageContent.purchaser.mobile,
  377. idcard: this.pageContent.purchaser.idcard
  378. },
  379. viewerList: this.visitors,
  380. label:this.label,
  381. retailId:this.retailId
  382. }
  383. console.log('submitorder params',params);
  384. // #ifdef MP
  385. params['source'] = 1
  386. // #endif
  387. // #ifdef H5
  388. params['source'] = 4
  389. // #endif
  390. this.cansubmit = false;
  391. // console.log('pageData',this.pageData);
  392. // console.log('visitors',this.visitors);
  393. // console.log('params',params);
  394. this.$u.api.submitOrder(params,{custom:{toast:false}}).then(res => {
  395. // console.log('submitOrder',res.data);
  396. this.orderId = res.data.orderId;
  397. // this.templateEven()
  398. this.gotoPay();
  399. // 删除分销信息
  400. // this.setTemplate();
  401. // uni.removeStorage({
  402. // key:'retailId',
  403. // success: (e) => {
  404. // console.log('removeStorage retailId success',e);
  405. // },
  406. // fail: (e) => {
  407. // console.log('removeStorage retailId fail',e);
  408. // }
  409. // });
  410. // uni.removeStorage({
  411. // key:'scene',
  412. // success: (e) => {
  413. // console.log('removeStorage scene success',e);
  414. // },
  415. // fail: (e) => {
  416. // console.log('removeStorage scene fail',e);
  417. // }
  418. // });
  419. }).catch(err => {
  420. this.cansubmit = true;
  421. uni.hideLoading();
  422. // uni.$u.toast(err.msg);
  423. // if (err.msg.includes('限购')) {
  424. this.umodal.title = '';
  425. this.umodal.content = err.msg;
  426. this.umodal.show = true;
  427. // setTimeout(() => {
  428. // uni.$u.route('/center/order', {
  429. // status: 0
  430. // });
  431. // }, 2000)
  432. // }
  433. console.log('submitOrder', err);
  434. })
  435. },
  436. modalConfirm(){
  437. this.umodal.show = false;
  438. },
  439. // 订阅消息
  440. templateEven() {
  441. let that = this
  442. wx.showModal({
  443. title: '温馨提示',
  444. content: '为更好的促进与您的交流,服务号需要实时向您发送消息',
  445. confirmText: "同意",
  446. cancelText: "拒绝",
  447. success: function(res) {
  448. if (res.confirm) {
  449. //调用订阅消息
  450. // console.log('用户点击确定');
  451. //调用订阅
  452. that.setTemplate();
  453. } else if (res.cancel) {
  454. // console.log('用户点击取消');
  455. ///显示第二个弹说明一下
  456. wx.showModal({
  457. title: '温馨提示',
  458. content: '拒绝后您将无法获取实时的消息',
  459. confirmText: "知道了",
  460. showCancel: false,
  461. success: function(res) {
  462. that.gotoPay();
  463. ///点击知道了的后续操作
  464. ///如跳转首页面
  465. }
  466. });
  467. }
  468. }
  469. });
  470. },
  471. // 设置小程序订阅消息
  472. setTemplate() {
  473. let that = this;
  474. // console.log('templateIdList', this.templateIdList);
  475. // #ifdef MP
  476. uni.requestSubscribeMessage({
  477. tmplIds: that.templateIdList,
  478. success(res) {
  479. // that.gotoPay();
  480. console.log("设置小程序订阅消息 success:", res);
  481. },
  482. fail(res) {
  483. console.log("设置小程序订阅消息 fail:", res);
  484. },
  485. complete(res) {
  486. // that.gotoPay();
  487. that.submitorder();
  488. console.log("设置小程序订阅消息 complete:", res);
  489. }
  490. })
  491. // #endif
  492. // #ifdef H5
  493. that.gotoPay()
  494. // #endif
  495. },
  496. gotoPay() {
  497. this.$u.api.gotoPay({
  498. orderId: this.orderId,
  499. openid: ''
  500. }).then(res => {
  501. this.payResult = res.data.payInfo;
  502. this.payResult.package = res.data.payInfo.packageValue;
  503. // #ifdef H5
  504. this.initConfig(this.payResult)
  505. // #endif
  506. // #ifdef MP
  507. this.wxPay()
  508. // #endif
  509. // if(this.params.paymentMode==1||this.params.paymentMode==4){
  510. // this.wxPay()
  511. // }else{
  512. // uni.$u.route('/shopping/paysuccess');
  513. // }
  514. // console.log('gotoPayres', res.data);
  515. }).catch(err => {
  516. this.cansubmit = true;
  517. // this.paypass = '';
  518. // this.checkPassShow = false;
  519. console.log('gotoPay', err);
  520. })
  521. },
  522. wxPay() {
  523. let that = this;
  524. uni.requestPayment({
  525. ...this.payResult,
  526. "provider": "wxpay",
  527. "orderInfo": {
  528. // "appid": "wx499********7c70e", // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
  529. // "noncestr": "c5sEwbaNPiXAF3iv", // 随机字符串
  530. // "package": "Sign=WXPay", // 固定值
  531. // "partnerid": "148*****52", // 微信支付商户号
  532. // "prepayid": "wx202254********************fbe90000", // 统一下单订单号
  533. // "timestamp": 1597935292, // 时间戳(单位:秒)
  534. // "sign": "A842B45937F6EFF60DEC7A2EAA52D5A0" // 签名,这里用的 MD5/RSA 签名
  535. },
  536. success(res) {
  537. that.payQuery();
  538. },
  539. fail(e) {
  540. uni.$u.route('/center/order', {
  541. status: 0
  542. });
  543. console.log('wxPayfail', e);
  544. },
  545. complete() {
  546. this.cansubmit = true;
  547. }
  548. })
  549. },
  550. payQuery() {
  551. let that = this;
  552. let retryCount = 0;
  553. let maxRetryCount = 5; // 设置最大重试次数
  554. let interval = 2000; // 设置间隔时间为2秒
  555. let timeout = 10000; // 设置超时时间为10秒
  556. let timer;
  557. uni.showLoading({
  558. title: '支付结果查询中'
  559. })
  560. timer = setInterval(() => {
  561. retryCount++;
  562. if (retryCount > maxRetryCount || retryCount * interval > timeout) {
  563. clearInterval(timer);
  564. uni.hideLoading();
  565. console.log("支付查询超时或达到最大重试次数");
  566. // 在这里添加超时或达到最大重试次数的处理逻辑
  567. uni.$u.route('/center/order');
  568. } else {
  569. console.log("第" + retryCount + "次查询");
  570. // 调用查询支付状态的方法
  571. // 如果支付状态为成功,则清除定时器并处理成功的逻辑
  572. // 如果支付状态为失败,则清除定时器并处理失败的逻辑
  573. this.$u.api.payQuery({
  574. orderId: this.orderId
  575. }).then(res => {
  576. // 0-未支付 1-已支付 2-支付中 3-支付失败 4-支付退款
  577. let payStatus = res.data.payStatus;
  578. if (payStatus === 1) {
  579. uni.$u.route('/center/orderdetails', {
  580. type:'redirectTo',
  581. id: res.data.orderId
  582. });
  583. // uni.$u.route('/center/order', {
  584. // status: 3
  585. // });
  586. // uni.$u.route('/center/paysuccess');
  587. } else if (payStatus === 0 || payStatus === 2) {
  588. this.payQuery()
  589. } else if (payStatus === 3) {
  590. uni.toast('支付失败')
  591. }
  592. clearInterval(timer);
  593. }).catch(err => {
  594. console.log('payQuery', err);
  595. }).finally(() => {
  596. uni.hideLoading()
  597. this.cansubmit = true;
  598. })
  599. }
  600. }, interval);
  601. },
  602. /**
  603. * 公众号微信支付
  604. */
  605. initConfig() {
  606. // #ifdef H5
  607. let that = this
  608. wxH5.config({
  609. debug: false, // 这里一般在测试阶段先用ture,等打包给后台的时候就改回false,
  610. appId: that.payResult.appId, // 必填,公众号的唯一标识
  611. timestamp: that.payResult.timeStamp, // 必填,生成签名的时间戳
  612. nonceStr: that.payResult.nonceStr, // 必填,生成签名的随机串
  613. signature: that.payResult.paySign, // 必填,签名
  614. jsApiList: ['chooseWXPay', 'checkJsApi'] // 必填,需要使用的JS接口列表
  615. })
  616. wxH5.ready(() => {
  617. wxH5.chooseWXPay({
  618. timestamp: that.payResult.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
  619. nonceStr: that.payResult.nonceStr, // 支付签名随机串,不长于 32 位
  620. package: that.payResult.packageValue, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
  621. signType: 'SHA1', // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
  622. paySign: that.payResult.paySign, // 支付签名
  623. success: () => {
  624. that.payQuery();
  625. },
  626. fail: (e) => {
  627. uni.$u.route('/center/order', {
  628. status: 0
  629. });
  630. console.log('wxPayfail', e);
  631. },
  632. cancel: () => {
  633. uni.$u.route('/center/order', {
  634. status: 0
  635. });
  636. that.cansubmit = true;
  637. }
  638. })
  639. })
  640. // #endif
  641. }
  642. }
  643. }
  644. </script>
  645. <style>
  646. page {
  647. background: linear-gradient(180deg, #ED0000 0%, #F9FBFD 50%, #fff 100%);
  648. background-repeat: no-repeat;
  649. }
  650. </style>
  651. <style lang="scss" scoped>
  652. .base-info {
  653. border-radius: 30rpx;
  654. overflow: hidden;
  655. background: radial-gradient(circle at -26rpx 294rpx, transparent 8%, #fff 4%) left, radial-gradient(circle at calc(100% + 26rpx) 294rpx, transparent 8%, #fff 4%) right;
  656. background-size: 50% 100%;
  657. background-repeat: no-repeat;
  658. padding: 34rpx 36rpx;
  659. box-sizing: border-box;
  660. margin: 30rpx 0 40rpx;
  661. .up {
  662. margin-bottom: 36rpx;
  663. .img {
  664. display: block;
  665. width: 172rpx;
  666. height: 230rpx;
  667. border-radius: 20rpx;
  668. margin-right: 32rpx;
  669. }
  670. .text {
  671. flex: 1;
  672. font-size: 22rpx;
  673. font-weight: 400;
  674. color: #606060;
  675. line-height: 1;
  676. }
  677. .text-item {
  678. margin-bottom: 18rpx;
  679. }
  680. .name {
  681. font-size: 32rpx;
  682. line-height: 1.5;
  683. font-weight: bold;
  684. color: #2D2D2D;
  685. }
  686. .addr {
  687. font-size: 24rpx;
  688. font-weight: 500;
  689. color: #2D2D2D;
  690. }
  691. }
  692. .down {
  693. position: relative;
  694. &:before {
  695. content: '';
  696. width: calc(100% + 26rpx);
  697. height: 1px;
  698. position: absolute;
  699. left: -13rpx;
  700. top: -2rpx;
  701. border-top: 4rpx dashed #F39FA0;
  702. }
  703. .num-wrap {
  704. padding-top: 36rpx;
  705. .title {
  706. font-size: 14px;
  707. color: #4E4E4E;
  708. }
  709. }
  710. }
  711. }
  712. .block-wrap {
  713. background: #FFFFFF;
  714. box-shadow: 0rpx 0rpx 20rpx 2rpx rgba(221, 221, 221, 0.5);
  715. border-radius: 20rpx;
  716. margin-bottom: 28rpx;
  717. padding: 32rpx 30rpx 34rpx;
  718. .block-title {
  719. // padding-left: 16rpx;
  720. position: relative;
  721. margin-bottom: 22rpx;
  722. font-size: 24rpx;
  723. font-weight: 500;
  724. color: #CACACA;
  725. // &:before{
  726. // content: '';
  727. // width: 6rpx;
  728. // height: 32rpx;
  729. // background: #1677FF;
  730. // border-radius: 4rpx;
  731. // position: absolute;
  732. // left: 0;
  733. // top: 50%;
  734. // margin-top: -16rpx;
  735. // }
  736. .name {
  737. font-size: 32rpx;
  738. font-weight: bold;
  739. color: #2D2D2D;
  740. margin-right: 20rpx;
  741. }
  742. }
  743. .no-people {
  744. font-size: 28rpx;
  745. font-weight: 400;
  746. color: #7F7F7F;
  747. .right {
  748. margin-left: 20rpx;
  749. color: #1677FF;
  750. }
  751. }
  752. .peoples {
  753. font-size: 28rpx;
  754. font-weight: 400;
  755. color: #7F7F7F;
  756. margin-bottom: 24rpx;
  757. .peoples-item {
  758. margin-bottom: 10rpx;
  759. }
  760. .name {
  761. margin-left: 20rpx;
  762. margin-right: 28rpx;
  763. font-size: 28rpx;
  764. font-weight: bold;
  765. color: #363636;
  766. }
  767. .people-id {
  768. font-size: 20rpx;
  769. font-weight: 400;
  770. color: #606060;
  771. }
  772. .right {
  773. font-size: 28rpx;
  774. font-weight: 400;
  775. color: #ED0303;
  776. }
  777. }
  778. }
  779. .people-list {
  780. margin-bottom: 20rpx;
  781. .btn {
  782. width: 185rpx;
  783. height: 60rpx;
  784. line-height: 60rpx;
  785. font-size: 24rpx;
  786. font-weight: 500;
  787. color: #2D2D2D;
  788. background-color: #F1F1F1;
  789. border: 1px solid #F1F1F1;
  790. border-radius: 8rpx;
  791. margin-bottom: 12rpx;
  792. .text {
  793. margin-left: 16rpx;
  794. }
  795. &.people {
  796. margin-right: 16rpx;
  797. text-align: center;
  798. background-color: #FFF2F2;
  799. border-color: #ED0303;
  800. }
  801. }
  802. }
  803. .visitors {
  804. margin-bottom: 20rpx;
  805. }
  806. .people-show-content {
  807. background: #FFFFFF;
  808. border-radius: 40rpx 40rpx 0rpx 0rpx;
  809. padding: 30rpx 40rpx;
  810. .title {
  811. position: relative;
  812. font-size: 32rpx;
  813. font-weight: 500;
  814. color: #606060;
  815. margin-bottom: 46rpx;
  816. text-align: center;
  817. .cancel {
  818. position: absolute;
  819. left: 0;
  820. top: 0;
  821. }
  822. }
  823. .add-btn {
  824. margin-bottom: 28rpx;
  825. background: #ffdee1;
  826. border-radius: 44rpx;
  827. padding: 26rpx;
  828. font-size: 24rpx;
  829. font-weight: 400;
  830. color: #ff1616;
  831. .img {
  832. width: 28rpx;
  833. height: 36rpx;
  834. margin-right: 36rpx;
  835. }
  836. }
  837. .list {
  838. /deep/ .u-radio-group {
  839. flex-wrap: wrap;
  840. }
  841. /deep/ .u-checkbox-group {
  842. flex-wrap: wrap;
  843. }
  844. overflow-y: auto;
  845. height: 40vh;
  846. .people {
  847. width: 100%;
  848. margin-bottom: 24rpx;
  849. }
  850. }
  851. .btn {}
  852. }
  853. .coupon {
  854. background: #FFFFFF;
  855. box-shadow: 0rpx 0rpx 16rpx 2rpx rgba(232, 232, 232, 0.5);
  856. border-radius: 16rpx;
  857. padding: 44rpx 36rpx;
  858. margin-bottom: 24rpx;
  859. .title {
  860. font-size: 28rpx;
  861. font-weight: bold;
  862. color: #2D2D2D;
  863. padding-bottom: 20rpx;
  864. margin-bottom: 26rpx;
  865. border-bottom-style: dashed;
  866. }
  867. .single-til {
  868. margin-bottom: 28rpx;
  869. .text {
  870. font-weight: 400;
  871. }
  872. }
  873. .no-coupon {
  874. height: 116rpx;
  875. line-height: 116rpx;
  876. text-align: center;
  877. background: #F9FAFD;
  878. border-radius: 8rpx;
  879. font-size: 24rpx;
  880. font-weight: 400;
  881. color: #C0C0C0;
  882. }
  883. }
  884. .notice {
  885. background: #FFFFFF;
  886. box-shadow: 0rpx 0rpx 16rpx 2rpx rgba(232, 232, 232, 0.5);
  887. border-radius: 16rpx;
  888. padding: 44rpx 36rpx;
  889. margin-bottom: 24rpx;
  890. .title {
  891. font-size: 28rpx;
  892. font-weight: bold;
  893. color: #2D2D2D;
  894. padding-bottom: 20rpx;
  895. margin-bottom: 26rpx;
  896. border-bottom-style: dashed;
  897. }
  898. .notice-item {
  899. font-size: 24rpx;
  900. font-weight: 400;
  901. color: #7F7F7F;
  902. line-height: 36rpx;
  903. margin-bottom: 8rpx;
  904. }
  905. }
  906. .page-bottom {
  907. position: relative;
  908. z-index: 1001;
  909. height: 98rpx;
  910. padding: 24rpx 20rpx 50rpx;
  911. .inner {
  912. position: fixed;
  913. background-color: #fff;
  914. height: 98rpx;
  915. left: 0;
  916. right: 0;
  917. bottom: 0;
  918. padding: 24rpx 20rpx 50rpx;
  919. box-shadow: 0rpx -4rpx 12rpx 0rpx rgba(215, 215, 215, 0.5);
  920. .total-price {
  921. font-size: 40rpx;
  922. font-weight: bold;
  923. color: #ED0000;
  924. }
  925. .btn {
  926. font-size: 28rpx;
  927. height: 80rpx;
  928. line-height: 80rpx;
  929. border-radius: 50rpx;
  930. padding: 0 50rpx;
  931. background-color: #eee;
  932. color: #333;
  933. text-align: center;
  934. &.active {
  935. background: linear-gradient(90deg, #FF7979 0%, #ED0000 100%);
  936. color: #fff;
  937. }
  938. }
  939. }
  940. }
  941. .purchaser {
  942. .item {
  943. margin-bottom: 10rpx;
  944. font-size: 26rpx;
  945. color: #333;
  946. }
  947. .un-auth {
  948. padding: 26rpx;
  949. background-color: #eee;
  950. color: #333;
  951. text-align: center;
  952. border-radius: 8rpx;
  953. }
  954. }
  955. </style>