C端小程序
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

828 satır
22 KiB

  1. // pages/spellGroup/mySpellGroup/index.js
  2. const navigationBarHeight = (getApp().statusBarHeight + 50) + 'px'
  3. var config = require("../../../config/config.js");
  4. const Http = require("../../../utils/HttpBasics");
  5. const imgurl = require("../../../utils/imgurl");
  6. const utils = require("../../../utils/util.js");
  7. let app = getApp();
  8. Page({
  9. /**
  10. * 页面的初始数据
  11. */
  12. data: {
  13. mouldType: 0,
  14. navigationBarHeight,
  15. fenxiang: imgurl.fenxiang1.url,
  16. homeSelectedO: imgurl.homeSelectedO.url,
  17. isshowposter: false, //是否显示分享弹框
  18. teljpgUrl: imgurl.teljpg.url,
  19. wmhome: imgurl.wmhome.url,
  20. share01: imgurl.share01.url,
  21. close02: imgurl.close02.url,
  22. closedUrl: imgurl.closed.url,
  23. quesGouUrl: imgurl.ques_gou.url,
  24. headbgUrl: imgurl.headbg.url,
  25. quesBgUrl: imgurl.ques_bg.url,
  26. couponChannelId: '',
  27. couponId: '',
  28. data: null,
  29. spellData: null,
  30. canSpell: true,
  31. canBuyIf: true,
  32. clock: "00",
  33. day: "00",
  34. hour: "00",
  35. min: "00",
  36. sec: "00",
  37. detailPicture: [],
  38. coverPicture: [],
  39. swiperCurrent: 0,
  40. showTime: true,
  41. limitCondition: "",
  42. minLimit: 0,
  43. maxLimit: 0,
  44. spellGroupOrder: false,
  45. opacity: 0,
  46. queueData: null,
  47. zIndex: 11,
  48. display: "none",
  49. orderGroupId: '',
  50. merchantVoList: []
  51. },
  52. /**
  53. * 生命周期函数--监听页面加载
  54. */
  55. onLoad: function (options) {
  56. this.setData({
  57. mouldType:app.globalData.mouldType
  58. })
  59. Http.get({
  60. url: config.api.checkUserStatus,
  61. data: {
  62. token: app.globalData.token
  63. }
  64. }).then(res => {
  65. Http.get({
  66. url: config.api.checkPhoneStatus,
  67. data: {}
  68. }).then(res => {
  69. this.setData({
  70. couponChannelId: options.couponChannelId,
  71. couponId: options.couponId ? options.couponId : ''
  72. })
  73. if (options && options.couponChannelId) {
  74. this.getDetail(options.couponChannelId);
  75. }
  76. if (options && options.couponId) {
  77. this.getOneSpell(options.couponId)
  78. }
  79. }).catch(res => {
  80. wx.redirectTo({
  81. url: `/pages/getphoneInfo/index`
  82. });
  83. })
  84. }).catch(res => {
  85. wx.redirectTo({
  86. url: `/pages/getuserinfo/index`
  87. })
  88. })
  89. },
  90. /**
  91. * 显示分享海报
  92. */
  93. /* showPoster: function() {
  94. //跳转到海报生成页
  95. wx.navigateTo({
  96. url: `/pages/canvas/index?couponChannelId=${this.data.data.id}`
  97. })
  98. }, */
  99. showPoster: function () {
  100. console.log(this.data.data)
  101. let that = this;
  102. Http.get({
  103. url: config.api.checkUserStatus,
  104. data: {
  105. token: app.globalData.token
  106. }
  107. }).then(res => {
  108. wx.navigateTo({
  109. url: `/pages/canvas/index?couponChannelId=${that.data.data.id}`
  110. })
  111. }).catch(err => {
  112. console.log(err)
  113. if (err.code == 11004) {
  114. // 用户昵称未授权
  115. wx.redirectTo({
  116. url: `/pages/getuserinfo/index?couponChannelId=${that.data.data.id}&fromflag=poster`
  117. })
  118. }
  119. })
  120. //跳转到海报生成页
  121. },
  122. /**
  123. * 显示分享弹框
  124. */
  125. showshare: function () {
  126. this.setData({
  127. isshowposter: true,
  128. })
  129. },
  130. /**
  131. * 隐藏分享弹框
  132. */
  133. hidemodal: function () {
  134. this.setData({
  135. isshowposter: false,
  136. })
  137. },
  138. gotoIndex: function () {
  139. wx.switchTab({
  140. url: '/index/index',
  141. })
  142. },
  143. /**
  144. * 拨打电话
  145. */
  146. phone: function (e) {
  147. let that = this;
  148. wx.makePhoneCall({
  149. phoneNumber: e.target.dataset.merchantlinkphone
  150. });
  151. },
  152. /**
  153. * 直接购买
  154. */
  155. gotoBuy(e) {
  156. let that = this;
  157. this.setData({
  158. canBuyIf: false,
  159. formId: e.detail.formId,
  160. queueData: null,
  161. orderGroupId: ''
  162. })
  163. that.getQuestions();
  164. },
  165. getQuestions(type) {
  166. let that = this;
  167. Http.get({
  168. url: config.api.getQuestion,
  169. data: {
  170. couponType: JSON.stringify(that.data.data.type)
  171. }
  172. })
  173. .then(res => {
  174. wx.hideLoading();
  175. if (res.data == undefined) {
  176. // 立即购买
  177. that.orderFunc(type);
  178. } else if (res.data) {
  179. var animation = wx.createAnimation({});
  180. animation.translate((that.data.widthScreen - that.data.widthScreen), 0).scale(1).opacity(1).step({
  181. duration: 500
  182. })
  183. that.setData({
  184. queueData: animation.export(),
  185. zIndex: 9,
  186. opacity: 1,
  187. display: "block",
  188. questionnaire: JSON.parse(res.data.content),
  189. questionId: res.data.id
  190. });
  191. }
  192. })
  193. .catch(err => {
  194. wx.hideLoading();
  195. wx.showToast({
  196. title: err.message,
  197. icon: 'none',
  198. duration: 2000,
  199. mask: false
  200. });
  201. })
  202. },
  203. /**
  204. * 点击提交问题单选
  205. */
  206. formSubmit: function (e) {
  207. console.log(e);
  208. let that = this;
  209. /**
  210. * 多选
  211. */
  212. if (e.currentTarget.dataset.flags == 'multi') {
  213. if (that.data.anwserId.length == 0) {
  214. var answserIs = null
  215. } else {
  216. var answserIs = that.data.anwserId.join(",");
  217. }
  218. } else if (e.currentTarget.dataset.flags == 'single') {
  219. var answserIs = e.detail.value;
  220. }
  221. console.log(answserIs)
  222. console.log(e.currentTarget.dataset.questionid)
  223. Http.post({
  224. url: config.api.answerQuestion,
  225. data: {
  226. answer: answserIs,
  227. questionId: e.currentTarget.dataset.questionid
  228. }
  229. })
  230. .then(res => {
  231. that.closeQuestion();
  232. })
  233. .catch(err => {
  234. wx.showToast({
  235. title: err.message,
  236. icon: 'none',
  237. duration: 2000,
  238. mask: false
  239. });
  240. })
  241. },
  242. /**
  243. * 多选
  244. */
  245. checkboxChange: function (e) {
  246. console.log(e)
  247. this.setData({
  248. anwserId: e.detail.value
  249. })
  250. },
  251. closeQuestion: function () {
  252. let that = this;
  253. that.setData({
  254. display: "none",
  255. zIndex: 11,
  256. opacity: 0
  257. })
  258. setTimeout(function () {
  259. that.orderFunc();
  260. }, 500)
  261. },
  262. // 时间格式化输出,如11:03 25:19 每1s都会调用一次
  263. dateformat(micro_second) {
  264. // 总秒数
  265. var second = Math.floor(micro_second / 1000);
  266. // 天数
  267. var day = Math.floor(second / 3600 / 24) < 10 ? "0" + Math.floor(second / 3600 / 24) : Math.floor(second / 3600 / 24);
  268. // 小时
  269. var hr = Math.floor(second / 3600 % 24) < 10 ? "0" + Math.floor(second / 3600 % 24) : Math.floor(second / 3600 % 24);
  270. // 分钟
  271. var min = Math.floor(second / 60 % 60) < 10 ? "0" + Math.floor(second / 60 % 60) : Math.floor(second / 60 % 60);
  272. // 秒
  273. var sec = Math.floor(second % 60) < 10 ? "0" + Math.floor(second % 60) : Math.floor(second % 60);
  274. // return day + "天" + hr + "小时" + min + "分钟" + sec + "秒";
  275. return {
  276. a1: day,
  277. b1: hr,
  278. c1: min,
  279. d1: sec
  280. }
  281. },
  282. countdown(time) {
  283. let that = this;
  284. var EndTime = time;
  285. if (that.data.spellData != null) {
  286. EndTime = that.data.spellData.expiredDate;
  287. }
  288. var NowTime = new Date().getTime();
  289. var total_micro_second = EndTime - NowTime || [];
  290. // 渲染倒计时时钟
  291. let obj = that.dateformat(total_micro_second);
  292. if (total_micro_second > 0) {
  293. that.setData({
  294. clock: obj,
  295. day: obj.a1,
  296. hour: obj.b1,
  297. min: obj.c1,
  298. sec: obj.d1,
  299. })
  300. } else {
  301. that.setData({
  302. clock: "00",
  303. day: "00",
  304. hour: "00",
  305. min: "00",
  306. sec: "00",
  307. })
  308. }
  309. if (that.data.showTime) {
  310. setTimeout(function () {
  311. total_micro_second -= 1000;
  312. that.countdown();
  313. }, 1000)
  314. }
  315. },
  316. // 获得未支付的订单
  317. getUnPaidOrder(couponId) {
  318. let that = this;
  319. Http.get({
  320. url: config.api.getUnPaidOrder,
  321. data: {
  322. couponId: couponId
  323. }
  324. }).then(res => {
  325. that.setData({
  326. disOrderNumber: res.data.orderNumber,
  327. couponChannelId: res.data.couponChannelId,
  328. orderGroupId: res.data.orderGroupId,
  329. composeOrderType: res.data.composeOrderType
  330. })
  331. // 拼团订单
  332. if (res.data.payment / 100 != Number(that.data.data.price)) {
  333. that.setData({
  334. spellGroupOrder: true
  335. })
  336. } else {
  337. // 原价购买订单
  338. that.setData({
  339. spellGroupOrder: false
  340. })
  341. }
  342. if (that.data.spellGroupOrder) {
  343. wx.showModal({
  344. title: '提示',
  345. content: "您有未支付拼团订单,请先进行支付",
  346. confirmText: "去支付",
  347. success: function (res) {
  348. if (res.confirm) {
  349. wx.navigateTo({
  350. url: `/pages/spellGroup/paySpellGroup/index?orderId=${that.data.disOrderNumber}&couponChannelId=${that.data.couponChannelId}&couponId=${couponId}&orderGroupId={that.data.orderGroupId}&composeOrderType=${that.data.composeOrderType}`,
  351. })
  352. }
  353. }
  354. })
  355. } else {
  356. wx.showModal({
  357. title: '提示',
  358. content: '您有未支付订单,请先进行支付',
  359. confirmText: "去支付",
  360. success: function (res) {
  361. if (res.confirm) {
  362. wx.navigateTo({
  363. url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}&composeOrderType=${that.data.composeOrderType}`,
  364. })
  365. }
  366. }
  367. })
  368. }
  369. }).catch(error => {
  370. console.log(error)
  371. wx.showToast({
  372. title: error.message,
  373. icon: "none",
  374. duration: 3000
  375. })
  376. })
  377. },
  378. /**
  379. * 发起拼团
  380. */
  381. gotoSpell(e) {
  382. app.globalData.previewFlag = false
  383. let that = this;
  384. that.setData({
  385. canSpell: false,
  386. formId: e.detail.formId,
  387. orderGroupId: 0
  388. })
  389. that.getQuestions(0);
  390. },
  391. //参与别人的拼团
  392. gotoPartner() {
  393. wx.navigateTo({
  394. url: `/pages/joinFrDpell/index?orderId=${this.data.spellData.orderId}&couponId=${this.data.spellData.couponId}&orderGroupId=${this.data.spellData.orderGroupId}&couponChannelId=${this.data.couponChannelId}&avatarUrl=${this.data.spellData.avatarUrl}&nickName=${this.data.spellData.nickName}`
  395. });
  396. },
  397. /**
  398. * 获取一个拼团信息
  399. */
  400. getOneSpell(couponId) {
  401. let that = this;
  402. Http.get({
  403. url: config.api.queryRemainOne,
  404. data: {
  405. couponId: couponId
  406. }
  407. }).then(res => {
  408. wx.stopPullDownRefresh();
  409. if (res.data) {
  410. that.countdown(res.data.expiredDate);
  411. that.setData({
  412. spellData: res.data
  413. });
  414. }
  415. });
  416. },
  417. /**
  418. * 获取券详情信息
  419. */
  420. getDetail(couponChannelId) {
  421. let that = this;
  422. Http.get({
  423. url: config.api.couponDetail,
  424. data: {
  425. couponChannelId: couponChannelId
  426. }
  427. }).then(res => {
  428. wx.stopPullDownRefresh();
  429. let data = res.data;
  430. if (res && res.data && res.data.detailPicture) {
  431. that.setData({
  432. detailPicture: JSON.parse(res.data.detailPicture)
  433. })
  434. }
  435. if (res && res.data && res.data.coverPicture) {
  436. that.setData({
  437. coverPicture: JSON.parse(res.data.coverPicture)
  438. })
  439. }
  440. if (res && res.data && res.data.conditions) {
  441. that.setData({
  442. limitCondition: JSON.parse(res.data.conditions).type
  443. })
  444. if (JSON.parse(res.data.conditions).type == 2 && (JSON.parse(res.data.conditions).min || JSON.parse(res.data.conditions).min == 0)) {
  445. that.setData({
  446. minLimit: JSON.parse(res.data.conditions).min
  447. })
  448. }
  449. if (JSON.parse(res.data.conditions).type == 2 && (JSON.parse(res.data.conditions).max) || JSON.parse(res.data.conditions).max == 0) {
  450. that.setData({
  451. maxLimit: JSON.parse(res.data.conditions).max
  452. })
  453. }
  454. }
  455. data.price = (data.price / 100).toFixed(2)
  456. data.salePrice = (data.salePrice / 100).toFixed(2);
  457. data.validStartDate = utils.formatTime(data.validStartDate, 'yyyy-MM-dd')
  458. data.validEndDate = utils.formatTime(data.validEndDate, 'yyyy-MM-dd')
  459. that.setData({
  460. data,
  461. merchantVoList: data.merchantVoList
  462. });
  463. });
  464. },
  465. /**
  466. * 去拼团
  467. */
  468. goToOrderGroup(orderId, orderGroupId, _this) {
  469. let that = this;
  470. // 支付成功
  471. Http.post({
  472. url: config.api.toOrderGroup,
  473. data: {
  474. id: orderGroupId,
  475. orderId,
  476. couponId: _this.data.data.couponId
  477. }
  478. })
  479. .then(res => {
  480. wx.navigateTo({
  481. url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}&orderGroupId=${res.data.orderGroupId}&couponChannelId=${_this.data.couponChannelId}`
  482. });
  483. })
  484. .catch(err => {
  485. console.log(err);
  486. })
  487. },
  488. /**
  489. * 支付订单更新
  490. */
  491. payOrderUpdate: (orderId, payOrderId, status, reason, _this, orderGroupId) => {
  492. console.log(orderGroupId, 7777)
  493. let that = this;
  494. // 支付成功
  495. Http.post({
  496. url: config.api.payOrderUpdate,
  497. data: {
  498. payOrderId: payOrderId,
  499. composeOrderId: orderId,
  500. status: status,
  501. reason: reason
  502. }
  503. })
  504. .then(res => {
  505. wx.hideLoading()
  506. if (orderGroupId !== 0) {
  507. wx.navigateTo({
  508. url: '/pages/order/detail/index?orderId=' + res.data.mainOrderId,
  509. })
  510. } else {
  511. _this.goToOrderGroup(orderId, res.data.mainOrderId, _this)
  512. }
  513. })
  514. .catch(err => {
  515. if (err.code != 12002) {
  516. setTimeout(function () {
  517. _this.payOrderUpdate(orderId, payOrderId, status, reason, _this, orderGroupId);
  518. }, 2000)
  519. }
  520. })
  521. },
  522. /**
  523. * 发起支付
  524. */
  525. orderFunc() {
  526. let that = this;
  527. let orderGroupId = this.data.orderGroupId;
  528. let data = {
  529. couponChannelId: this.data.data.id,
  530. couponId: this.data.data.couponId,
  531. formId: this.data.formId
  532. }
  533. /**
  534. * 拼团订单
  535. */
  536. if (this.data.orderGroupId == 0) {
  537. data.orderGroupId = this.data.orderGroupId,
  538. that.setData({
  539. isFromSpell: true
  540. })
  541. } else {
  542. that.setData({
  543. isFromSpell: false
  544. })
  545. }
  546. Http.get({
  547. url: config.api.checkUserStatus,
  548. data: {
  549. token: app.globalData.token
  550. }
  551. }).then(res => {
  552. Http.get({
  553. url: config.api.checkPhoneStatus,
  554. data: {}
  555. }).then(res => {
  556. /**
  557. * orderSave 下单
  558. */
  559. return Http.post({
  560. url: config.api.orderSave,
  561. data: data
  562. });
  563. }).catch(err => {
  564. console.log(err);
  565. that.setData({
  566. showbutton: false,
  567. showbutton1: false,
  568. canSpell: true,
  569. canBuyIf: true
  570. })
  571. if (err.code == 2011) {
  572. wx.showToast({
  573. title: "商户信息没找到",
  574. image: './../../../assets/images/fail.png',
  575. duration: 2000,
  576. mask: false
  577. });
  578. } else if (err.code == 2013) {
  579. wx.showToast({
  580. title: "商户信息禁用",
  581. image: './../../../assets/images/fail.png',
  582. duration: 2000,
  583. mask: false
  584. });
  585. } else if (err.code == 3000) {
  586. wx.showToast({
  587. title: "库存不足",
  588. image: './../../../assets/images/fail.png',
  589. duration: 2000,
  590. mask: false
  591. });
  592. } else if (err.code == 3001) {
  593. wx.showToast({
  594. title: "您已超过限购",
  595. image: './../../../assets/images/fail.png',
  596. duration: 2000,
  597. mask: false
  598. });
  599. } else if (err.code == 3002) {
  600. wx.showToast({
  601. title: "订单失败",
  602. image: './../../../assets/images/fail.png',
  603. duration: 2000,
  604. mask: false
  605. });
  606. } else if (err.code == 3003) {
  607. wx.showToast({
  608. title: "订单不存在",
  609. image: './../../../assets/images/fail.png',
  610. duration: 2000,
  611. mask: false
  612. });
  613. } else if (err.code == 3004) {
  614. wx.showToast({
  615. title: "订单不存在",
  616. image: './../../../assets/images/fail.png',
  617. duration: 2000,
  618. mask: false
  619. });
  620. } else if (err.code == 4003) {
  621. wx.showToast({
  622. title: "卡券已作废",
  623. image: './../../../assets/images/fail.png',
  624. duration: 2000,
  625. mask: false
  626. });
  627. } else if (err.code == 3012) {
  628. // wx.showToast({
  629. // title: err.message,
  630. // icon: "none"
  631. // })
  632. that.getUnPaidOrder(that.data.data.couponId);
  633. } else if (err.code == 11005) {
  634. /**
  635. * 将值传到用户手机号授权的页面
  636. *
  637. */
  638. wx.redirectTo({
  639. url: `/pages/getphoneInfo/index?path=spell&couponChannelId=${that.data.couponChannelId}&couponId=${that.data.data.couponId}`
  640. });
  641. } else if (err.code == 11006) {
  642. // 用户手机已加密
  643. wx.redirectTo({
  644. url: `/pages/phoneinput/phoneinput?path=spell&couponChannelId=${that.data.couponChannelId}&couponId=${that.data.data.couponId}`
  645. });
  646. } else {
  647. wx.showToast({
  648. title: err.message,
  649. icon: 'none',
  650. duration: 2000,
  651. mask: false
  652. });
  653. }
  654. }).then(res => {
  655. console.log(res,"123")
  656. if (typeof (res) != "undefined") {
  657. let orderId = "" + res.data.mainOrderId;
  658. that.setData({
  659. orderId: orderId,
  660. composeOrderType: res.data.composeOrderType,
  661. canSpell: false,
  662. canBuyIf: true
  663. });
  664. // 支付金额不为0
  665. /**
  666. * 支付订单创建
  667. */
  668. Http.post({
  669. url: config.api.payOrderCreate,
  670. data: {
  671. orderId: orderId,
  672. composeOrderType: that.data.composeOrderType
  673. }
  674. }).then(res => {
  675. var payOrderId = "" + res.data.payOrderId;
  676. wx.hideLoading();
  677. wx.requestPayment({
  678. timeStamp: res.data.timeStamp,
  679. nonceStr: res.data.nonceStr,
  680. package: res.data.package,
  681. signType: (res.data.signType) ? res.data.signType : "MD5",
  682. paySign: res.data.paySign,
  683. success: res => {
  684. that.setData({
  685. canSpell: false
  686. })
  687. wx.showLoading({
  688. title: '订单正在处理中...',
  689. })
  690. // setTimeout(function() {
  691. // wx.hideLoading()
  692. // }, 5000)
  693. that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', that, orderGroupId);
  694. if (res.errMsg == "requestPayment:ok") {
  695. setTimeout(function () {
  696. wx.hideLoading();
  697. }, 2000);
  698. }
  699. },
  700. fail: res => {
  701. /**
  702. * 支付失败,需要更新订单的状态
  703. */
  704. that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', that, orderGroupId);
  705. that.setData({
  706. showbutton: false,
  707. canSpell: true,
  708. canBuyIf: true
  709. })
  710. return;
  711. },
  712. complete: res => { }
  713. });
  714. /// End payment --------
  715. })
  716. .catch(err => {
  717. that.setData({
  718. canSpell: true,
  719. canBuyIf: true
  720. })
  721. wx.showToast({
  722. title: err.message,
  723. icon: 'none',
  724. duration: 2000,
  725. mask: false
  726. });
  727. })
  728. }
  729. })
  730. })
  731. .catch(err => {
  732. console.log(err)
  733. if (err.code == 11004) {
  734. wx.redirectTo({
  735. url: `/pages/getuserinfo/index?fromflag=spellcoupondetail&couponChannelIdflag=${that.data.couponChannelId}`,
  736. })
  737. } else {
  738. wx.showToast({
  739. title: err.message,
  740. icon: "none",
  741. duration: 2500
  742. })
  743. }
  744. })
  745. },
  746. /**
  747. * 生命周期函数--监听页面显示
  748. */
  749. onShow: function () {
  750. this.setData({
  751. mouldType: app.globalData.mouldType,
  752. canSpell: true,
  753. canBuyIf: true,
  754. showTime: true,
  755. })
  756. if (this.data.spellData != null) {
  757. this.countdown()
  758. }
  759. },
  760. /**
  761. * 生命周期函数--监听页面隐藏
  762. */
  763. onHide: function () {
  764. this.setData({
  765. showTime: false
  766. })
  767. },
  768. /**
  769. * 生命周期函数--监听页面卸载
  770. */
  771. onUnload: function () {
  772. this.setData({
  773. showTime: false
  774. })
  775. },
  776. /**
  777. * 页面相关事件处理函数--监听用户下拉动作
  778. */
  779. onPullDownRefresh: function (e) {
  780. let that = this;
  781. console.log(this.data.couponId, 222)
  782. that.getDetail(that.data.couponChannelId);
  783. if (that.data.couponId) {
  784. that.getOneSpell(that.data.couponId)
  785. }
  786. },
  787. onShareAppMessage: function (options) {
  788. app.globalData.previewFlag = true
  789. console.log(options)
  790. var that = this;
  791. var shareObj = {
  792. title: that.data.data.title,
  793. path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}&couponId=${that.data.data.couponId}&spellGroup=spellGroup`,
  794. success: function (res) {
  795. if (res.errMsg == 'shareAppMessage:ok') { }
  796. },
  797. fail: function (error) {
  798. if (res.errMsg == 'shareAppMessage:fail cancel') { } else if (res.errMsg == 'shareAppMessage:fail') { }
  799. }
  800. };
  801. // 来自页面内的按钮的转发
  802. if (options.from == 'button') {
  803. var eData = options.target.dataset.id;
  804. shareObj.path = `/pages/index/index?couponChannelId=${eData}&couponId=${that.data.data.couponId}&spellGroup=spellGroup&frommd=JC`;
  805. }
  806. // 返回shareObj
  807. return shareObj;
  808. },
  809. })