提交 8a1da1b6 编写于 作者: guangjun.yang's avatar guangjun.yang

Merge branch 'dev-purchase-0901' of...

Merge branch 'dev-purchase-0901' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-professional-exam into dev-purchase-0901

* 'dev-purchase-0901' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-professional-exam:
  修改授权s
  修改参数
  修改参数
  修改支付类型
  添加userId
  修改参数
  修改接口
  修改授权
  修改appid
......@@ -78,8 +78,9 @@ const user = {
getWxUserInfo({ state, commit }, code) {
const type = 15;
let url = process.env.BUILD_ENV === 'dev' ? `https://sc.yunqueyi.com/wechats/users/info/${type}/${code}` : getBaseUrl(`wechats/users/info/${type}/${code}`);
fetch({
url: getBaseUrl(`wechats/users/info/${type}/${code}`),
url,
method: 'get',
headers: { token: state.token }
}).then(res => {
......
......@@ -47,7 +47,7 @@ export const envConfig = {
webPageUrl: 'https://dev-phome.yunqueyi.com/',
hactiveUrl: 'https://dev-hactive.yunqueyi.com',
fileUrl: 'https://dev-www.yunqueyi.com',
appId: 'wx08b383d002c73f26', // 用于微信授权登录
appId: 'wx2c577552a2d28550', // 用于微信授权登录
},
test: {
baseUrl: 'https://test1-sc.yunqueyi.com/',
......
......@@ -8,7 +8,8 @@ export const wxConfig = (link) => {
// const params = { resetURI: true, url: encodeURIComponent(location.href) };
// 上线前是需要把域名改为线上的sc
let baseUrl = getBaseUrl("");
request({ url: `https://sc.yunqueyi.com/wechats/signs?url=${encodeURIComponent(link)}` }).then(res => {
let type = process.env.BUILD_ENV === 'dev' ? '&type=15' : '';
request({ url: `https://sc.yunqueyi.com/wechats/signs?url=${encodeURIComponent(link)}${type}` }).then(res => {
// request({ url: `${baseUrl}/wechats/signs?url=${encodeURIComponent(link)}` }).then(res => {
let configs = res.data.signMap;
wx.config({
......
......@@ -125,9 +125,6 @@ export default {
// 记录参数,授权登录返回时重新赋值,在main.js
sessionStorage.setItem('goodsDetailParams', JSON.stringify(this.$route.query))
},
beforeDestroy() {
this.countTotalPrice = null;
},
methods: {
// tab切换
tabToggle(index) {
......@@ -260,6 +257,7 @@ export default {
}
// 微信内先去授权
if (isWechat && !this.wxInfo.openid) {
this.$toast('微信授权中');
wxOauth();
return;
}
......@@ -279,11 +277,11 @@ export default {
this.POST('trade/center/order/createV2', orderData).then(res => {
if (res.code == "000000") {
const orderId = res.data.orderId;
// if (isWechat) {
if (isWechat) {
this.goWxPayInner(orderId);
// } else {
// this.goWxPayOut(orderId);
// }
} else {
this.goWxPayOut(orderId);
}
if (this.projectId) {
this.createRelation(this.projectId, orderId);
}
......@@ -295,18 +293,20 @@ export default {
// 站外微信支付
goWxPayOut(orderId) {
const data = {
openId: getAPPID(),
// openId: getAPPID(),
orderId,
payChannel: 1,
tradeType: 3,
}
this.POST('trade/center/mweb_prepay', data).then(res => {
if (res.code == "000000") {
let redirectUrl = this.getRedirectUrl(orderId);
let jumpLink = res.data + '&redirect_url=' + encodeURIComponent(redirectUrl);
window.location.href = jumpLink;
if (res.data) {
let redirectUrl = this.getRedirectUrl(orderId);
let jumpLink = res.data + '&redirect_url=' + encodeURIComponent(redirectUrl);
window.location.href = jumpLink;
}
} else {
this.$toast(res.message);
this.$toast(res.message || '暂时不能支付');
}
})
},
......@@ -316,14 +316,17 @@ export default {
openId: this.wxInfo.openid,
orderId,
payChannel: 1,
tradeType: 1,
tradeType: 4,
userId: this.$store.state.user.info.id
}
this.POST('trade/center/jsapi_prepay', data).then(res => {
if (res.code == "000000") {
console.log('______prepay_____', res.data);
if (res.code == "000000" && res.data) {
// console.log('______prepay_____', res.data);
const that = this;
const payData = {
...res.data,
appid: res.data.appId,
timestamp: res.data.timeStamp,
success: function() {
let query = { orderId };
if (that.projectId) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册