bookticket.vue 27 KB

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