bookticket.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  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. // ygh
  504. if(!res.data.needPay){
  505. //this.payQuery();
  506. uni.$u.route('/center/orderdetails', {
  507. type:'redirectTo',
  508. id: this.orderId
  509. });
  510. }else {
  511. this.payResult = res.data.payInfo;
  512. this.payResult.package = res.data.payInfo.packageValue;
  513. // #ifdef H5
  514. this.initConfig(this.payResult)
  515. // #endif
  516. // #ifdef MP
  517. this.wxPay()
  518. // #endif
  519. }
  520. // if(this.params.paymentMode==1||this.params.paymentMode==4){
  521. // this.wxPay()
  522. // }else{
  523. // uni.$u.route('/shopping/paysuccess');
  524. // }
  525. // console.log('gotoPayres', res.data);
  526. }).catch(err => {
  527. this.cansubmit = true;
  528. // this.paypass = '';
  529. // this.checkPassShow = false;
  530. console.log('gotoPay', err);
  531. })
  532. },
  533. wxPay() {
  534. let that = this;
  535. uni.requestPayment({
  536. ...this.payResult,
  537. "provider": "wxpay",
  538. "orderInfo": {
  539. // "appid": "wx499********7c70e", // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
  540. // "noncestr": "c5sEwbaNPiXAF3iv", // 随机字符串
  541. // "package": "Sign=WXPay", // 固定值
  542. // "partnerid": "148*****52", // 微信支付商户号
  543. // "prepayid": "wx202254********************fbe90000", // 统一下单订单号
  544. // "timestamp": 1597935292, // 时间戳(单位:秒)
  545. // "sign": "A842B45937F6EFF60DEC7A2EAA52D5A0" // 签名,这里用的 MD5/RSA 签名
  546. },
  547. success(res) {
  548. that.payQuery();
  549. },
  550. fail(e) {
  551. uni.$u.route('/center/order', {
  552. status: 0
  553. });
  554. console.log('wxPayfail', e);
  555. },
  556. complete() {
  557. this.cansubmit = true;
  558. }
  559. })
  560. },
  561. payQuery() {
  562. let that = this;
  563. let retryCount = 0;
  564. let maxRetryCount = 5; // 设置最大重试次数
  565. let interval = 2000; // 设置间隔时间为2秒
  566. let timeout = 10000; // 设置超时时间为10秒
  567. let timer;
  568. uni.showLoading({
  569. title: '支付结果查询中'
  570. })
  571. timer = setInterval(() => {
  572. retryCount++;
  573. if (retryCount > maxRetryCount || retryCount * interval > timeout) {
  574. clearInterval(timer);
  575. uni.hideLoading();
  576. console.log("支付查询超时或达到最大重试次数");
  577. // 在这里添加超时或达到最大重试次数的处理逻辑
  578. uni.$u.route('/center/order');
  579. } else {
  580. console.log("第" + retryCount + "次查询");
  581. // 调用查询支付状态的方法
  582. // 如果支付状态为成功,则清除定时器并处理成功的逻辑
  583. // 如果支付状态为失败,则清除定时器并处理失败的逻辑
  584. this.$u.api.payQuery({
  585. orderId: this.orderId
  586. }).then(res => {
  587. // 0-未支付 1-已支付 2-支付中 3-支付失败 4-支付退款
  588. let payStatus = res.data.payStatus;
  589. if (payStatus === 1) {
  590. uni.$u.route('/center/orderdetails', {
  591. type:'redirectTo',
  592. id: res.data.orderId
  593. });
  594. // uni.$u.route('/center/order', {
  595. // status: 3
  596. // });
  597. // uni.$u.route('/center/paysuccess');
  598. } else if (payStatus === 0 || payStatus === 2) {
  599. this.payQuery()
  600. } else if (payStatus === 3) {
  601. uni.toast('支付失败')
  602. }
  603. clearInterval(timer);
  604. }).catch(err => {
  605. console.log('payQuery', err);
  606. }).finally(() => {
  607. uni.hideLoading()
  608. this.cansubmit = true;
  609. })
  610. }
  611. }, interval);
  612. },
  613. /**
  614. * 公众号微信支付
  615. */
  616. initConfig() {
  617. // #ifdef H5
  618. let that = this
  619. wxH5.config({
  620. debug: false, // 这里一般在测试阶段先用ture,等打包给后台的时候就改回false,
  621. appId: that.payResult.appId, // 必填,公众号的唯一标识
  622. timestamp: that.payResult.timeStamp, // 必填,生成签名的时间戳
  623. nonceStr: that.payResult.nonceStr, // 必填,生成签名的随机串
  624. signature: that.payResult.paySign, // 必填,签名
  625. jsApiList: ['chooseWXPay', 'checkJsApi'] // 必填,需要使用的JS接口列表
  626. })
  627. wxH5.ready(() => {
  628. wxH5.chooseWXPay({
  629. timestamp: that.payResult.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
  630. nonceStr: that.payResult.nonceStr, // 支付签名随机串,不长于 32 位
  631. package: that.payResult.packageValue, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
  632. signType: 'SHA1', // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
  633. paySign: that.payResult.paySign, // 支付签名
  634. success: () => {
  635. that.payQuery();
  636. },
  637. fail: (e) => {
  638. uni.$u.route('/center/order', {
  639. status: 0
  640. });
  641. console.log('wxPayfail', e);
  642. },
  643. cancel: () => {
  644. uni.$u.route('/center/order', {
  645. status: 0
  646. });
  647. that.cansubmit = true;
  648. }
  649. })
  650. })
  651. // #endif
  652. }
  653. }
  654. }
  655. </script>
  656. <style>
  657. page {
  658. background: linear-gradient(180deg, #ED0000 0%, #F9FBFD 50%, #fff 100%);
  659. background-repeat: no-repeat;
  660. }
  661. </style>
  662. <style lang="scss" scoped>
  663. .base-info {
  664. border-radius: 30rpx;
  665. overflow: hidden;
  666. 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;
  667. background-size: 50% 100%;
  668. background-repeat: no-repeat;
  669. padding: 34rpx 36rpx;
  670. box-sizing: border-box;
  671. margin: 30rpx 0 40rpx;
  672. .up {
  673. margin-bottom: 36rpx;
  674. .img {
  675. display: block;
  676. width: 172rpx;
  677. height: 230rpx;
  678. border-radius: 20rpx;
  679. margin-right: 32rpx;
  680. }
  681. .text {
  682. flex: 1;
  683. font-size: 22rpx;
  684. font-weight: 400;
  685. color: #606060;
  686. line-height: 1;
  687. }
  688. .text-item {
  689. margin-bottom: 18rpx;
  690. }
  691. .name {
  692. font-size: 32rpx;
  693. line-height: 1.5;
  694. font-weight: bold;
  695. color: #2D2D2D;
  696. }
  697. .addr {
  698. font-size: 24rpx;
  699. font-weight: 500;
  700. color: #2D2D2D;
  701. }
  702. }
  703. .down {
  704. position: relative;
  705. &:before {
  706. content: '';
  707. width: calc(100% + 26rpx);
  708. height: 1px;
  709. position: absolute;
  710. left: -13rpx;
  711. top: -2rpx;
  712. border-top: 4rpx dashed #F39FA0;
  713. }
  714. .num-wrap {
  715. padding-top: 36rpx;
  716. .title {
  717. font-size: 14px;
  718. color: #4E4E4E;
  719. }
  720. }
  721. }
  722. }
  723. .block-wrap {
  724. background: #FFFFFF;
  725. box-shadow: 0rpx 0rpx 20rpx 2rpx rgba(221, 221, 221, 0.5);
  726. border-radius: 20rpx;
  727. margin-bottom: 28rpx;
  728. padding: 32rpx 30rpx 34rpx;
  729. .block-title {
  730. // padding-left: 16rpx;
  731. position: relative;
  732. margin-bottom: 22rpx;
  733. font-size: 24rpx;
  734. font-weight: 500;
  735. color: #CACACA;
  736. // &:before{
  737. // content: '';
  738. // width: 6rpx;
  739. // height: 32rpx;
  740. // background: #1677FF;
  741. // border-radius: 4rpx;
  742. // position: absolute;
  743. // left: 0;
  744. // top: 50%;
  745. // margin-top: -16rpx;
  746. // }
  747. .name {
  748. font-size: 32rpx;
  749. font-weight: bold;
  750. color: #2D2D2D;
  751. margin-right: 20rpx;
  752. }
  753. }
  754. .no-people {
  755. font-size: 28rpx;
  756. font-weight: 400;
  757. color: #7F7F7F;
  758. .right {
  759. margin-left: 20rpx;
  760. color: #1677FF;
  761. }
  762. }
  763. .peoples {
  764. font-size: 28rpx;
  765. font-weight: 400;
  766. color: #7F7F7F;
  767. margin-bottom: 24rpx;
  768. .peoples-item {
  769. margin-bottom: 10rpx;
  770. }
  771. .name {
  772. margin-left: 20rpx;
  773. margin-right: 28rpx;
  774. font-size: 28rpx;
  775. font-weight: bold;
  776. color: #363636;
  777. }
  778. .people-id {
  779. font-size: 20rpx;
  780. font-weight: 400;
  781. color: #606060;
  782. }
  783. .right {
  784. font-size: 28rpx;
  785. font-weight: 400;
  786. color: #ED0303;
  787. }
  788. }
  789. }
  790. .people-list {
  791. margin-bottom: 20rpx;
  792. .btn {
  793. width: 185rpx;
  794. height: 60rpx;
  795. line-height: 60rpx;
  796. font-size: 24rpx;
  797. font-weight: 500;
  798. color: #2D2D2D;
  799. background-color: #F1F1F1;
  800. border: 1px solid #F1F1F1;
  801. border-radius: 8rpx;
  802. margin-bottom: 12rpx;
  803. .text {
  804. margin-left: 16rpx;
  805. }
  806. &.people {
  807. margin-right: 16rpx;
  808. text-align: center;
  809. background-color: #FFF2F2;
  810. border-color: #ED0303;
  811. }
  812. }
  813. }
  814. .visitors {
  815. margin-bottom: 20rpx;
  816. }
  817. .people-show-content {
  818. background: #FFFFFF;
  819. border-radius: 40rpx 40rpx 0rpx 0rpx;
  820. padding: 30rpx 40rpx;
  821. .title {
  822. position: relative;
  823. font-size: 32rpx;
  824. font-weight: 500;
  825. color: #606060;
  826. margin-bottom: 46rpx;
  827. text-align: center;
  828. .cancel {
  829. position: absolute;
  830. left: 0;
  831. top: 0;
  832. }
  833. }
  834. .add-btn {
  835. margin-bottom: 28rpx;
  836. background: #ffdee1;
  837. border-radius: 44rpx;
  838. padding: 26rpx;
  839. font-size: 24rpx;
  840. font-weight: 400;
  841. color: #ff1616;
  842. .img {
  843. width: 28rpx;
  844. height: 36rpx;
  845. margin-right: 36rpx;
  846. }
  847. }
  848. .list {
  849. /deep/ .u-radio-group {
  850. flex-wrap: wrap;
  851. }
  852. /deep/ .u-checkbox-group {
  853. flex-wrap: wrap;
  854. }
  855. overflow-y: auto;
  856. height: 40vh;
  857. .people {
  858. width: 100%;
  859. margin-bottom: 24rpx;
  860. }
  861. }
  862. .btn {}
  863. }
  864. .coupon {
  865. background: #FFFFFF;
  866. box-shadow: 0rpx 0rpx 16rpx 2rpx rgba(232, 232, 232, 0.5);
  867. border-radius: 16rpx;
  868. padding: 44rpx 36rpx;
  869. margin-bottom: 24rpx;
  870. .title {
  871. font-size: 28rpx;
  872. font-weight: bold;
  873. color: #2D2D2D;
  874. padding-bottom: 20rpx;
  875. margin-bottom: 26rpx;
  876. border-bottom-style: dashed;
  877. }
  878. .single-til {
  879. margin-bottom: 28rpx;
  880. .text {
  881. font-weight: 400;
  882. }
  883. }
  884. .no-coupon {
  885. height: 116rpx;
  886. line-height: 116rpx;
  887. text-align: center;
  888. background: #F9FAFD;
  889. border-radius: 8rpx;
  890. font-size: 24rpx;
  891. font-weight: 400;
  892. color: #C0C0C0;
  893. }
  894. }
  895. .notice {
  896. background: #FFFFFF;
  897. box-shadow: 0rpx 0rpx 16rpx 2rpx rgba(232, 232, 232, 0.5);
  898. border-radius: 16rpx;
  899. padding: 44rpx 36rpx;
  900. margin-bottom: 24rpx;
  901. .title {
  902. font-size: 28rpx;
  903. font-weight: bold;
  904. color: #2D2D2D;
  905. padding-bottom: 20rpx;
  906. margin-bottom: 26rpx;
  907. border-bottom-style: dashed;
  908. }
  909. .notice-item {
  910. font-size: 24rpx;
  911. font-weight: 400;
  912. color: #7F7F7F;
  913. line-height: 36rpx;
  914. margin-bottom: 8rpx;
  915. }
  916. }
  917. .page-bottom {
  918. position: relative;
  919. z-index: 1001;
  920. height: 98rpx;
  921. padding: 24rpx 20rpx 50rpx;
  922. .inner {
  923. position: fixed;
  924. background-color: #fff;
  925. height: 98rpx;
  926. left: 0;
  927. right: 0;
  928. bottom: 0;
  929. padding: 24rpx 20rpx 50rpx;
  930. box-shadow: 0rpx -4rpx 12rpx 0rpx rgba(215, 215, 215, 0.5);
  931. .total-price {
  932. font-size: 40rpx;
  933. font-weight: bold;
  934. color: #ED0000;
  935. }
  936. .btn {
  937. font-size: 28rpx;
  938. height: 80rpx;
  939. line-height: 80rpx;
  940. border-radius: 50rpx;
  941. padding: 0 50rpx;
  942. background-color: #eee;
  943. color: #333;
  944. text-align: center;
  945. &.active {
  946. background: linear-gradient(90deg, #FF7979 0%, #ED0000 100%);
  947. color: #fff;
  948. }
  949. }
  950. }
  951. }
  952. .purchaser {
  953. .item {
  954. margin-bottom: 10rpx;
  955. font-size: 26rpx;
  956. color: #333;
  957. }
  958. .un-auth {
  959. padding: 26rpx;
  960. background-color: #eee;
  961. color: #333;
  962. text-align: center;
  963. border-radius: 8rpx;
  964. }
  965. }
  966. </style>