123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- var app = getApp(),
- api = getApp().api;
- Page({
- data: {
- isPageShow: !1,
- order: null,
- getGoodsTotalPrice: function () {
- return this.data.order.total_price
- },
- hide: 1,
- qrcode: ""
- },
- onLoad: function (e) {
- getApp().page.onLoad(this, e);
- var t = this;
- getApp().core.showLoading({
- title: "正在加载"
- });
- var o = getCurrentPages(),
- a = o[o.length - 2];
- getApp().request({
- url: getApp().api.order.detail,
- data: {
- order_id: e.id,
- route: a.route
- },
- success: function (e) {
- 0 == e.code && t.setData({
- order: e.data,
- isPageShow: !0
- })
- },
- complete: function () {
- getApp().core.hideLoading()
- }
- })
- },
- orderQrcode: function (t) {
- var e = this,
- a = e.data.order.goods_list,
- b = t.target.dataset.goodlistId,
- o = t.target.dataset.index;
- getApp().core.showLoading({
- title: "正在加载",
- mask: !0
- }),
- // e.data.goods_list[o].offline_qrcode ? (e.setData({
- // hide: 0,
- // qrcode: e.data.goods_list[o].offline_qrcode
- // }),
- // getApp().core.hideLoading()) :
- getApp().request({
- url: getApp().api.order.get_goods_qrcode,
- data: {
- code_id: a[b].virtual_data[o].code_id
- },
- success: function (t) {
- 0 == t.code ? e.setData({
- hide: 0,
- qrcode: t.data.url
- }) : getApp().core.showModal({
- title: "提示",
- content: t.msg
- })
- // wx.navigateTo({
- // url:"/pages/order-detail-clerk/order-detail-clerk?code_id=" + a[b].virtual_data[o].code_id
- // })
- },
- complete: function () {
- getApp().core.hideLoading()
- }
- })
- },
- hide: function (t) {
- this.setData({
- hide: 1
- })
- },
- copyText: function (e) {
- var t = e.currentTarget.dataset.text;
- getApp().core.setClipboardData({
- data: t,
- success: function () {
- getApp().core.showToast({
- title: "已复制"
- })
- }
- })
- },
- viewImg: function(e){
- var url = e.currentTarget.dataset.qrurl;
- console.log(url)
- getApp().core.previewImage({
- urls: [url],
- })
- },
- location: function () {
- var e = this.data.order.shop;
- getApp().core.openLocation({
- latitude: parseFloat(e.latitude),
- longitude: parseFloat(e.longitude),
- address: e.address,
- name: e.name
- })
- },
- orderRevoke: function (t) {
- var o = this;
- getApp().core.showModal({
- title: "提示",
- content: "是否退款该订单?",
- cancelText: "否",
- confirmText: "是",
- success: function (e) {
- if (e.cancel) return !0;
- e.confirm && (getApp().core.showLoading({
- title: "操作中"
- }), getApp().request({
- url: getApp().api.order.revoke,
- data: {
- order_id: t.currentTarget.dataset.id
- },
- success: function (e) {
- getApp().core.hideLoading(), getApp().core.showModal({
- title: "提示",
- content: e.msg,
- showCancel: !1,
- success: function (e) {
- e.confirm && o.onLoad({
- id: o.data.order.order_id
- })
- }
- })
- }
- }))
- }
- })
- }
- });
|