|
|

(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["chunk-a7edc126"], {
1: function(e, t) {},
2: function(e, t) {},
4788: function(e, t, o) {
"use strict";
function r() {
return new Promise((function(e) {
if (window.Amap)
e();
else {
window.onAmapLoaded = function() {
e()
}
;
var t = "https://webapi.amap.com/maps?v=1.4.15&key=7a73a01afa9d5126d98b735a236d071f&callback=onAmapLoaded"
, o = document.createElement("script");
o.src = t,
document.body.appendChild(o)
}
}
))
}
o.d(t, "a", (function() {
return r
}
))
},
"684e": function(e, t, o) {},
"722c": function(e, t, o) {
"use strict";
o.r(t);
var r = function() {
var e = this
, t = e.$createElement
, o = e._self._c || t;
return o("div", {
staticClass: "container",
style: {
backgroundImage: "url(" + e.bg + ")"
}
}, [o("div", {
staticClass: "voucher-bg",
style: {
width: "226px",
height: "438px",
color: "#fff",
backgroundImage: "url(" + e.bg_voucher + ")"
}
}, [o("div", {
staticClass: "voucher-container"
}, e._l(e.voucher, (function(t, r) {
return o("span", {
key: r,
staticClass: "voucher-num",
style: {
color: e.voucher_text_color
}
}, [e._v(e._s(t))])
}
)), 0)]), e._v(" "), o("div", {
attrs: {
id: "map"
}
}), e._v(" "), o("el-dialog", {
attrs: {
title: "提示",
visible: e.positionDialogVisible,
width: "90%",
"show-close": !1,
"before-close": function() {
return e.positionDialogVisible = !1
}
},
on: {
"update:visible": function(t) {
e.positionDialogVisible = t
}
}
}, [o("span", [e._v("无法获取当前定位,点击确定重新获取位置信息")]), e._v(" "), o("span", {
staticClass: "dialog-footer",
attrs: {
slot: "footer"
},
slot: "footer"
}, [o("el-button", {
attrs: {
type: "primary"
},
on: {
click: e.getPositionAgain
}
}, [e._v("确 定")])], 1)])], 1)
}
, n = []
, c = o("879d")
, i = o("f9bc")
, a = o("4788")
, s = "wx65f7b26ff8256877";
function d() {
WeixinJSBridge.call("hideOptionMenu")
}
"undefined" == typeof WeixinJSBridge ? document.addEventListener ? document.addEventListener("WeixinJSBridgeReady", d, !1) : document.attachEvent && (document.attachEvent("WeixinJSBridgeReady", d),
document.attachEvent("onWeixinJSBridgeReady", d)) : d();
var u = {
data: function() {
return {
code: "",
voucher: "",
bg: "https://cdn.w.cn/brand/qqfamily/bg20220817.jpg",
bg_voucher: "https://cdn.w.cn/brand/qqfamily/ticket.png",
store_code: "",
product_code: "",
positionDialogVisible: !1,
voucher_text_color: "#000",
voucher_status: "validVoucher"
}
},
mounted: function() {
if (this.product_code = this.$route.query && this.$route.query.p,
!this.product_code)
return this.errProduct();
this.code = this.$route.query && this.$route.query.code,
this.code ? this.setMap() : this.toWxAuthorize()
},
created: function() {
var e = document.createElement("script");
e.type = "text/javascript",
e.src = "https://res2.wx.qq.com/open/js/jweixin-1.6.0.js",
document.body.appendChild(e)
},
methods: {
getPositionAgain: function() {
location.reload()
},
errGetPosition: function() {
this.$message({
message: "抱歉,不在范围内",
type: "warning",
duration: 0,
showClose: !0
})
},
setMap: function() {
var e = this;
Object(a["a"])().then((function() {
e.mapObj = new AMap.Map("map"),
e.mapObj.plugin("AMap.Geolocation", (function() {
e.geolocation = new AMap.Geolocation({
enableHighAccuracy: !0,
showButton: !0,
buttonPosition: "LB",
buttonOffset: new AMap.Pixel(10,20),
showMarker: !0,
showCircle: !0,
panToLocation: !0,
zoomToAccuracy: !0
}),
e.mapObj.addControl(e.geolocation),
e.loading = e.$loading({
lock: !0,
text: "正在确定您的位置...",
background: "rgba(0, 0, 0, 0.5)",
customClass: "poistion-loading"
}),
e.geolocation.getCurrentPosition((function(t, o) {
if ("error" === t)
return e.positionDialogVisible = !0,
void (e.loading && e.loading.close());
Object(c["d"])({
longitude: o.position.lng,
latitude: o.position.lat
}).then((function(t) {
if (e.loading && e.loading.close(),
200 == t.code) {
var o = t.data || {}
, r = o.store_code;
e.store_code = r || "",
e.store_code ? e.fetchVoucher() : e.errGetVoucher()
} else
e.showErr(t.msg)
}
)).catch((function(t) {
e.errGetPosition(),
e.loading && e.loading.close()
}
))
}
))
}
))
}
)).catch((function() {
e.errGetPosition()
}
))
},
toWxAuthorize: function() {
var e = window.location.href
, t = "https://open.weixin.qq.com/connect/oauth2/authorize?";
window.location.href = t + "appid=" + s + "&redirect_uri=" + encodeURIComponent(e) + "&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect"
},
errGetVoucher: function() {
this.showErr("遇到一些问题,稍后再试")
},
errProduct: function() {
this.showErr("无法获取到信息")
},
showErr: function(e) {
this.$message.error({
message: e,
type: "error",
customClass: "reqest-error-msg",
duration: 15e3
})
},
fetchVoucher: function() {
var e = this
, t = {
storeCode: "40342753",
productCode: "6Yj9kRrGq3IgW8KbSzJ2cDTdyx7sQNMA",
code: "023lB300089UyO1ZEj100PX5Mm0lB30S"
}
, o = Object(i["c"])(t, "b7d3f6b6f121e1404eb8c303bfee4434");
Object(c["k"])({
store_code: this.store_code,
product_code: this.product_code,
code: this.code,
sign: o
}).then((function(t) {
if (200 == t.code) {
var o = t.data || {}
, r = o.voucher
, n = o.orderStatus;
e.voucher = r || "",
e.voucher_status = n || "validVoucher"
} else
e.showErr(t.msg)
}
)).catch((function() {
e.errGetVoucher()
}
))
}
}
}
, p = u
, l = (o("d3b9"),
o("2877"))
, f = Object(l["a"])(p, r, n, !1, null, "4ae1b47c", null);
t["default"] = f.exports
},
"879d": function(e, t, o) {
"use strict";
o.d(t, "a", (function() {
return i
}
)),
o.d(t, "b", (function() {
return a
}
)),
o.d(t, "g", (function() {
return s
}
)),
o.d(t, "i", (function() {
return d
}
)),
o.d(t, "f", (function() {
return u
}
)),
o.d(t, "j", (function() {
return p
}
)),
o.d(t, "k", (function() {
return l
}
)),
o.d(t, "e", (function() {
return f
}
)),
o.d(t, "l", (function() {
return h
}
)),
o.d(t, "h", (function() {
return g
}
)),
o.d(t, "c", (function() {
return m
}
)),
o.d(t, "d", (function() {
return _
}
));
var r = o("b775")
, n = o("4328")
, c = o.n(n)
, i = 1006
, a = "8f74349440e880390ca2b277702ad1bf";
function s(e) {
var t = e.product_code
, o = e.store_code
, n = e.scene_id
, i = e.member_nick
, a = e.open_id
, s = e.timestamp
, d = e.nonce_str
, u = e.sign;
return Object(r["a"])({
url: "/api/storeAccess/upai/v1/generateOrder",
method: "post",
data: c.a.stringify({
product_code: t,
store_code: o,
scene_id: n,
member_nick: i,
open_id: a,
timestamp: s,
nonce_str: d,
sign: u
})
})
}
function d(e) {
var t = e.order_id
, o = e.order_code
, n = e.member_code
, c = e.store_code
, i = e.order_status
, a = e.product_code
, s = e.order_amount
, d = e.create_time
, u = e.update_time
, p = e.expire_time
, l = e.timestamp
, f = e.nonce_str
, h = e.sign
, g = e.page
, m = e.page_size
, _ = e.open_id;
return Object(r["a"])({
url: "/api/storeAccess/upai/v1/getOrderList",
method: "get",
params: {
order_id: t,
order_code: o,
member_code: n,
store_code: c,
order_status: i,
product_code: a,
order_amount: s,
create_time: d,
update_time: u,
expire_time: p,
page: g,
page_size: m,
timestamp: l,
nonce_str: f,
sign: h,
open_id: _
}
})
}
function u(e) {
var t = e.order_code
, o = e.recommend
, n = e.contact_details
, i = e.timestamp
, a = e.sign
, s = e.nonce_str;
return Object(r["a"])({
url: "/api/storeAccess/upai/v1/createRefundOrder",
method: "post",
data: c.a.stringify({
order_code: t,
recommend: o,
contact_details: n,
timestamp: i,
sign: a,
nonce_str: s
})
})
}
function p(e) {
var t = e.brand_code
, o = e.wechat_code
, n = e.wechat_type;
return Object(r["a"])({
url: "/api/storeAccess/upai/v2/getVoucher",
method: "post",
data: c.a.stringify({
brand_code: t,
wechat_code: o,
wechat_type: n
})
})
}
function l(e) {
var t = e.store_code
, o = e.product_code
, n = e.code
, c = e.sign;
return Object(r["a"])({
url: "/api/mall/order/generate",
method: "post",
headers: {
"Content-Type": "application/json"
},
data: JSON.stringify({
storeCode: t,
productCode: o,
code: n,
sign: c
})
})
}
function f(e) {
var t = e.product_code
, o = e.wechat_code
, n = e.wechat_type;
return Object(r["a"])({
url: "/api/storeAccess/upai/v1/create",
method: "post",
data: c.a.stringify({
product_code: t,
wechat_code: o,
wechat_type: n
})
})
}
function h(e) {
var t = e.url;
return Object(r["a"])({
url: "/api/storeAccess/v3/pubJsApiSign",
method: "post",
data: c.a.stringify({
url: t
})
})
}
function g(e) {
var t = e.product_code
, o = e.wechat_code
, n = e.wechat_type;
return Object(r["a"])({
url: "/api/storeAccess/upai/v1/get",
method: "post",
data: c.a.stringify({
product_code: t,
wechat_code: o,
wechat_type: n
})
})
}
function m(e) {
var t = e.product_code
, o = e.wechat_code
, n = e.wechat_type;
return Object(r["a"])({
url: "/api/storeAccess/upai/bin",
method: "post",
data: c.a.stringify({
product_code: t,
wechat_code: o,
wechat_type: n
})
})
}
function _(e) {
var t = e.longitude
, o = e.latitude;
return Object(r["a"])({
url: "/api/storeAccess/qqFamily/check",
method: "post",
data: c.a.stringify({
longitude: t,
latitude: o
})
})
}
},
b775: function(e, t, o) {
"use strict";
var r = o("bc3a")
, n = o.n(r)
, c = o("5c96");
o("a78e");
var i = n.a.create({
timeout: 2e4
});
i.interceptors.request.use((function(e) {
return e
}
), (function(e) {
return console.log(e),
Promise.reject(e)
}
)),
i.interceptors.response.use((function(e) {
var t = e.data;
return 200 !== t.code ? (Object(c["Message"])({
message: t.msg || "Error",
type: "error",
customClass: "reqest-error-msg",
duration: 5e3
}),
Promise.reject(new Error(t.message || "Error"))) : t
}
), (function(e) {
return console.log("err" + e),
Object(c["Message"])({
message: e.message,
type: "error",
customClass: "reqest-error-msg",
duration: 5e3
}),
Promise.reject(e)
}
));
t["a"] = i
},
d3b9: function(e, t, o) {
"use strict";
o("684e")
},
f9bc: function(e, t, o) {
"use strict";
o.d(t, "a", (function() {
return f
}
)),
o.d(t, "c", (function() {
return h
}
)),
o.d(t, "b", (function() {
return g
}
));
var r = o("a8db")
, n = (o("6b54"),
o("ac6a"),
o("456d"),
o("55dd"),
o("72fe"))
, c = o.n(n)
, i = o("94f8")
, a = o.n(i)
, s = o("1132")
, d = o.n(s)
, u = o("f8d5")
, p = o.n(u)
, l = ["timestamp", "nonce_str", "sign"]
, f = "42094b24a8f29440474b52428f49cb4d";
function h(e, t) {
var o = Object.keys(e).sort().filter((function(t) {
return "sign" !== t && e[t]
}
))
, r = o.map((function(t) {
return String(t) + String(e[t])
}
)).join("")
, n = t + r + t;
return console.log("sign", n),
c()(n).toString()
}
function g(e, t) {
var o = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]
, n = e.timestamp
, c = e.nonce_str
, i = (e.sign,
Object(r["a"])(e, l))
, s = Object.keys(i).sort().filter((function(t) {
return Boolean(i[t]) || 0 === e[t]
}
))
, u = s.map((function(t) {
return String(t) + String(e[t])
}
)).join("")
, f = "".concat(n).concat(t).concat(u).concat(t).concat(c);
console.log("paramsStr", f);
var h = d.a.stringify(p.a.parse(f))
, g = a()(h).toString();
return o ? g.toUpperCase() : g
}
}
}]);
里面有个sign算法,求助大佬了帮忙扣下JS
谢谢
o = Object(i["c"])(t, "b7d3f6b6f121e1404eb8c303bfee4434");
Object(c["k"])({
store_code: this.store_code,
product_code: this.product_code,
code: this.code,
sign: o
|
|