调整全局支付收银class
This commit is contained in:
@@ -10,8 +10,8 @@ import router from '../router'
|
|||||||
|
|
||||||
// 基础配置
|
// 基础配置
|
||||||
const config = {
|
const config = {
|
||||||
apiUrl : 'https://oapi.lianshang.vip/api/', // 正式环境
|
// apiUrl : 'https://oapi.lianshang.vip/api/', // 正式环境
|
||||||
// apiUrl : 'http://api.ahxh.shangkelian.cn/api/', // 测试环境
|
apiUrl : 'http://api.ahxh.shangkelian.cn/api/', // 测试环境
|
||||||
apiUrls : 'https://storage.lianshang.vip/', // 图片路径(测试/正式)
|
apiUrls : 'https://storage.lianshang.vip/', // 图片路径(测试/正式)
|
||||||
timeout : 60000
|
timeout : 60000
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "链商星球",
|
"name" : "链商星球",
|
||||||
"appid" : "__UNI__1F65101",
|
"appid" : "__UNI__1F65101",
|
||||||
"description" : "安徽星煌,链商星球商家工具",
|
"description" : "安徽星煌,链商星球商家工具",
|
||||||
"versionName" : "1.0.9",
|
"versionName" : "1.1.0",
|
||||||
"versionCode" : 109,
|
"versionCode" : 110,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@@ -212,18 +212,19 @@
|
|||||||
}, 3000);
|
}, 3000);
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
|
console.log(err.errMsg)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付失败',
|
title: '支付被取消',
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
mask: true,
|
mask: true,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url: '/pages/goods/payStatus?success=false'
|
// url: '/pages/goods/payStatus?success=false'
|
||||||
})
|
// })
|
||||||
this.canPay = true
|
// this.canPay = true
|
||||||
}, 3000);
|
// }, 3000);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -263,7 +264,7 @@
|
|||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付失败' + err,
|
title: '支付被取消',
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
mask: true,
|
mask: true,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
|
|||||||
@@ -215,32 +215,14 @@
|
|||||||
this.coupons = res.coupons
|
this.coupons = res.coupons
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onBackPress({
|
|
||||||
from
|
|
||||||
}) {
|
|
||||||
if (from == 'backbutton') {
|
|
||||||
this.$nextTick(function() {
|
|
||||||
uniShare.hide()
|
|
||||||
})
|
|
||||||
return uniShare.isShow;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 提交购买单
|
// 提交购买单
|
||||||
buyGoods() {
|
buyGoods() {
|
||||||
let token = this.$store.getters.getToken
|
let token = this.$store.getters.getToken
|
||||||
if (token == '') {
|
if (token == '') {
|
||||||
let userLogin = new userAuth()
|
this.$Router.push({name: 'Login'})
|
||||||
userLogin.Login()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// this.$Router.push({
|
|
||||||
// name: 'Buy',
|
|
||||||
// params: {
|
|
||||||
// skuId: this.goodsObj.skus[0].sku_id,
|
|
||||||
// qty : this.goodsObj.skus[0].number
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/goods/confirmOrder?qty=1&type=2&goods_sku_id=' + this.goodsObj.skus[0].sku_id
|
url: '/pages/goods/confirmOrder?qty=1&type=2&goods_sku_id=' + this.goodsObj.skus[0].sku_id
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -63,15 +63,14 @@
|
|||||||
<radio-group class="pay-group" @change="payType">
|
<radio-group class="pay-group" @change="payType">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<label>
|
<label>
|
||||||
<radio class="pay-radio" value="eb" checked color="#8b64fd" />
|
<radio class="pay-radio" value="wechat" checked color="#8b64fd" />
|
||||||
<view class="pay-title">易货额支付</view>
|
<view class="pay-title">微信支付</view>
|
||||||
<view class="pay-sub-title">可用{{account.eb}},冻结{{account.frozenEb}}</view>
|
|
||||||
</label>
|
</label>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<label>
|
<label>
|
||||||
<radio class="pay-radio" value="wechat" color="#8b64fd" />
|
<radio class="pay-radio" value="alipay" color="#8b64fd" />
|
||||||
<view class="pay-title">微信支付</view>
|
<view class="pay-title">支付宝支付</view>
|
||||||
</label>
|
</label>
|
||||||
</view>
|
</view>
|
||||||
</radio-group>
|
</radio-group>
|
||||||
@@ -87,16 +86,12 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
payValue: 'eb',
|
payValue: 'wechat',
|
||||||
orderNo : '',
|
orderNo : '',
|
||||||
price : '0.00',
|
price : '0.00',
|
||||||
stock : 1,
|
stock : 1,
|
||||||
loding : true,
|
loding : true,
|
||||||
info : {},
|
info : {}
|
||||||
account : {
|
|
||||||
eb : '0.00',
|
|
||||||
frozenEb: '0.00'
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -124,8 +119,7 @@
|
|||||||
openLay(){
|
openLay(){
|
||||||
let token = this.$store.getters.getToken
|
let token = this.$store.getters.getToken
|
||||||
if(token == ''){
|
if(token == ''){
|
||||||
let userLogin = new userAuth()
|
this.$Router.push({name: 'Login'})
|
||||||
userLogin.Login()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$refs.buyLay.open('bottom')
|
this.$refs.buyLay.open('bottom')
|
||||||
@@ -152,47 +146,24 @@
|
|||||||
},
|
},
|
||||||
// 支付
|
// 支付
|
||||||
orderPay(){
|
orderPay(){
|
||||||
let data = {}
|
|
||||||
marketsPay(this.orderNo, this.payValue).then(res => {
|
marketsPay(this.orderNo, this.payValue).then(res => {
|
||||||
switch (this.payValue){
|
switch (this.payValue){
|
||||||
case 'eb':
|
|
||||||
this.$refs.payLay.close()
|
|
||||||
this.$Router.push({
|
|
||||||
name : 'payResults',
|
|
||||||
params : {
|
|
||||||
index: 1,
|
|
||||||
price: this.price,
|
|
||||||
type : 'eb',
|
|
||||||
total: '可在我的资产下我的权证中查看购买的数字权证'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 'wechat':
|
case 'wechat':
|
||||||
this.wxPay(JSON.parse(res))
|
|
||||||
|
break
|
||||||
|
case 'alipay':
|
||||||
|
cashierPay.pay('alipay', res, 'market').then(payRes => {
|
||||||
|
console.log(payRes)
|
||||||
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
icon : 'none'
|
icon : 'none'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
|
||||||
// 微信支付
|
|
||||||
wxPay(payConfig){
|
|
||||||
uni.requestPayment({
|
|
||||||
provider : 'wxpay',
|
|
||||||
orderInfo : payConfig,
|
|
||||||
success : payRes => {
|
|
||||||
console.log(payRes)
|
|
||||||
},
|
|
||||||
fail : payErr => {
|
|
||||||
uni.showToast({
|
|
||||||
title: payErr.errMsg,
|
|
||||||
icon : 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,7 +282,7 @@
|
|||||||
getAliPayConfig(orderId, {
|
getAliPayConfig(orderId, {
|
||||||
type: 'app'
|
type: 'app'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
cashierPay.pay('alipay', res.wechat).then(payRes => {
|
cashierPay.pay('alipay', res.wechat, 'vip').then(payRes => {
|
||||||
this.idenInfo()
|
this.idenInfo()
|
||||||
})
|
})
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@@ -298,7 +298,7 @@
|
|||||||
type: 'app'
|
type: 'app'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let payConfig = JSON.parse(res)
|
let payConfig = JSON.parse(res)
|
||||||
cashierPay.pay('wxpay', payConfig).then(payRes => {
|
cashierPay.pay('wxpay', payConfig, 'vip').then(payRes => {
|
||||||
this.idenInfo()
|
this.idenInfo()
|
||||||
})
|
})
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Web唐明明
|
* Web唐明明
|
||||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||||
@@ -6,49 +5,77 @@
|
|||||||
* moduleName: 收银
|
* moduleName: 收银
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class cashierPay{
|
class cashierPay {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
||||||
}
|
}
|
||||||
pay(platform, orderInfo){
|
// 收银台
|
||||||
if(!platform){
|
pay(platform, orderInfo, buyType) {
|
||||||
|
if (!platform) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '缺少必要参数:支付平台类型',
|
title: '缺少必要参数:支付平台类型',
|
||||||
icon : 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(!orderInfo){
|
if (!orderInfo) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '缺少必要参数:支付参数不能为空',
|
title: '缺少必要参数:支付参数不能为空',
|
||||||
icon : 'none'
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!buyType) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '缺少必要参数:缺少支付类型',
|
||||||
|
icon: 'none'
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
provider : platform,
|
provider: platform,
|
||||||
orderInfo : orderInfo,
|
orderInfo: orderInfo,
|
||||||
success : payRes => {
|
success: payRes => {
|
||||||
uni.showModal({
|
|
||||||
title : "开通提示",
|
|
||||||
content : "支付成功,已成功开通/升级节点身份",
|
|
||||||
showCancel : false,
|
|
||||||
success : ()=> {
|
|
||||||
resolve(payRes)
|
resolve(payRes)
|
||||||
}
|
this.showToast(buyType)
|
||||||
})
|
|
||||||
},
|
},
|
||||||
fail : payErr => {
|
fail: payErr => {
|
||||||
reject(payErr)
|
reject(payErr)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付被取消',
|
title: '支付被取消',
|
||||||
icon : 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 成功提示信息
|
||||||
|
showToast(buyType){
|
||||||
|
switch(buyType){
|
||||||
|
case 'vip':
|
||||||
|
uni.showModal({
|
||||||
|
title: "开通提示",
|
||||||
|
content: "支付成功,已成功开通/升级节点身份",
|
||||||
|
showCancel: false,
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case 'goods':
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功',
|
||||||
|
mask: true,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case 'market':
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功',
|
||||||
|
mask: true,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new cashierPay();
|
export default new cashierPay();
|
||||||
|
|||||||
2
unpackage/cache/appleConfig.ini
vendored
2
unpackage/cache/appleConfig.ini
vendored
@@ -19,7 +19,7 @@ spotlight%403x=823b4145ec87155874cad6c3c6f9f5e9
|
|||||||
|
|
||||||
[universalLinks]
|
[universalLinks]
|
||||||
spaceid=
|
spaceid=
|
||||||
universalLinks=https://io.lianshang.app
|
universalLinks=https://lianshang/app/
|
||||||
|
|
||||||
[universalLinks_qq]
|
[universalLinks_qq]
|
||||||
spaceid_qq=
|
spaceid_qq=
|
||||||
|
|||||||
6
unpackage/dist/build/app-plus/app-service.js
vendored
6
unpackage/dist/build/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
2
unpackage/dist/build/app-plus/app-view.js
vendored
2
unpackage/dist/build/app-plus/app-view.js
vendored
File diff suppressed because one or more lines are too long
2
unpackage/dist/build/app-plus/manifest.json
vendored
2
unpackage/dist/build/app-plus/manifest.json
vendored
File diff suppressed because one or more lines are too long
3289
unpackage/dist/dev/app-plus/app-service.js
vendored
3289
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
2
unpackage/dist/dev/app-plus/manifest.json
vendored
2
unpackage/dist/dev/app-plus/manifest.json
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user