bookticket.vue 26 KB

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