|
|
@@ -128,6 +128,7 @@
|
|
|
<script>
|
|
|
import network from '@/utils/network'
|
|
|
import tool from '@/utils/tool'
|
|
|
+ import QRCode from 'qrcode'
|
|
|
export default{
|
|
|
name: 'order-overseas',
|
|
|
data() {
|
|
|
@@ -175,6 +176,7 @@
|
|
|
consigneeIdNo: '',
|
|
|
IDCardDialog: false,
|
|
|
IDCardWebsite: 'http://t.taoplus.com.my/Home/UploadIDCard',
|
|
|
+ flag:this.isPC()
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -207,6 +209,43 @@
|
|
|
this.IDCardDialog = true
|
|
|
},
|
|
|
methods:{
|
|
|
+ async pay(info) {
|
|
|
+ if (this.flag === 'website') {
|
|
|
+ //pc
|
|
|
+ let payTypeText = this.payType === 'WECHAT' ? '微信' : '支付宝'
|
|
|
+ let url = await QRCode.toDataURL(info.qrCode);
|
|
|
+ await this.$alert(`<img src=${url} alt="" >`, `请使用${payTypeText}扫码支付`, {
|
|
|
+ showClose: false,
|
|
|
+ showCancelButton: true,
|
|
|
+ showConfirmButton: true,
|
|
|
+ confirmButtonText: '支付成功',
|
|
|
+ cancelButtonText: '取消支付',
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ center: true,
|
|
|
+ callback: action => {
|
|
|
+ if(action === 'confirm'){
|
|
|
+ this.$router.push({path: `/shop/order-list`})
|
|
|
+ }else{
|
|
|
+ this.$router.push({path: `/shop/index`})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (this.payType === 'WECHAT') {
|
|
|
+ //微信
|
|
|
+ } else {
|
|
|
+ //支付宝
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //移动端
|
|
|
+ let origin = window.location.origin + '/#/shop/order-list'
|
|
|
+ window.location.replace(info.mweb_url + '&redirect_url=' + encodeURIComponent(origin))
|
|
|
+ if (this.payType === 'WECHAT') {
|
|
|
+ //微信
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
getSummaries(param) {
|
|
|
const { columns, data } = param;
|
|
|
const sums = [];
|
|
|
@@ -264,42 +303,43 @@
|
|
|
consigneeIdNo: this.consigneeIdNo,
|
|
|
consigneeRealName: this.consigneeRealName,
|
|
|
}
|
|
|
- this.$confirm(`确定要购买商品吗?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- customClass: 'msgbox',
|
|
|
- }).then(() => {
|
|
|
- network.postData(`shop/sure-approach-order`, data).then(response => {
|
|
|
- this.submitButtonStat = false
|
|
|
-
|
|
|
- // 跳转到中转页面
|
|
|
- // 'http://nc-fele-mips.elken.com:8016' // test
|
|
|
- // 'http://fele.ncshop.elken.com' // prod
|
|
|
- location.href = 'https://fele.ncshop.elken.com/pay.html?RefNo=' + response.SN
|
|
|
-
|
|
|
- // 唤起支付页面
|
|
|
- // network.postData(`shop/i-pay88`, { Amount: response.ORDER_AMOUNT, RefNo: response.SN }).then(payment => {
|
|
|
- // this.actionUrl = payment.transactionUrl
|
|
|
- // this.form = payment.paymentFields
|
|
|
- //
|
|
|
- // this.visible = true
|
|
|
- // this.payLoading = false
|
|
|
- // }).catch(err => {
|
|
|
- // this.$message({
|
|
|
- // message: err,
|
|
|
- // type: 'error'
|
|
|
- // })
|
|
|
- // this.submitButtonStat = false
|
|
|
- // })
|
|
|
- })
|
|
|
- }).catch(err => {
|
|
|
- this.$message({
|
|
|
- message: err,
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
+ network.postData(`shop/sure-approach-order`, data).then(async response => {
|
|
|
+ await this.pay(response)
|
|
|
this.submitButtonStat = false
|
|
|
+ // 跳转到中转页面
|
|
|
+ // 'http://nc-fele-mips.elken.com:8016' // test
|
|
|
+ // 'http://fele.ncshop.elken.com' // prod
|
|
|
+ // location.href = 'https://fele.ncshop.elken.com/pay.html?RefNo=' + response.SN
|
|
|
+
|
|
|
+ // 唤起支付页面
|
|
|
+ // network.postData(`shop/i-pay88`, { Amount: response.ORDER_AMOUNT, RefNo: response.SN }).then(payment => {
|
|
|
+ // this.actionUrl = payment.transactionUrl
|
|
|
+ // this.form = payment.paymentFields
|
|
|
+ //
|
|
|
+ // this.visible = true
|
|
|
+ // this.payLoading = false
|
|
|
+ // }).catch(err => {
|
|
|
+ // this.$message({
|
|
|
+ // message: err,
|
|
|
+ // type: 'error'
|
|
|
+ // })
|
|
|
+ // this.submitButtonStat = false
|
|
|
+ // })
|
|
|
})
|
|
|
+ // this.$confirm(`确定要购买商品吗?`, '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // type: 'warning',
|
|
|
+ // customClass: 'msgbox',
|
|
|
+ // }).then(() => {
|
|
|
+ //
|
|
|
+ // }).catch(err => {
|
|
|
+ // this.$message({
|
|
|
+ // message: err,
|
|
|
+ // type: 'error'
|
|
|
+ // })
|
|
|
+ // this.submitButtonStat = false
|
|
|
+ // })
|
|
|
},
|
|
|
getSumMoney(){
|
|
|
let cash_plus_sum=[];
|
|
|
@@ -328,7 +368,7 @@
|
|
|
this.pointsSum = this.cashSum = tool.formatPrice(tool.sum(cash_plus_sum) + this.freight) ;
|
|
|
},
|
|
|
getShowCart(){
|
|
|
- network.getData('shop/show-cart')
|
|
|
+ network.getData(`shop/show-cart?device=${this.flag}`)
|
|
|
.then(response=>{
|
|
|
this.loading=false;
|
|
|
this.all_address=response.allAddress;
|
|
|
@@ -342,12 +382,9 @@
|
|
|
this.addressId = this.all_address[0].ID
|
|
|
}
|
|
|
|
|
|
- for(let key in response.payList){
|
|
|
+ for(let key in response.onlinePayList){
|
|
|
// 如果是海外商品,则只有在线支付
|
|
|
- if (key === 'online') {
|
|
|
- this.payList.push({type:key, name:response.payList[key].name})
|
|
|
- break;
|
|
|
- }
|
|
|
+ this.payList.push({type:key, name:response.onlinePayList[key].name})
|
|
|
}
|
|
|
|
|
|
//默认设置为第一项付款方式
|
|
|
@@ -355,7 +392,7 @@
|
|
|
})
|
|
|
},
|
|
|
chosePayType(type){
|
|
|
-
|
|
|
+ console.log(type)
|
|
|
},
|
|
|
choseAddress(addressId){
|
|
|
},
|
|
|
@@ -406,6 +443,13 @@
|
|
|
// window.location.href = this.IDCardWebsite
|
|
|
window.open(this.IDCardWebsite, '_blank')
|
|
|
},
|
|
|
+ isPC() {
|
|
|
+ let flag = window.navigator.userAgent.match(
|
|
|
+ /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
|
|
+ );
|
|
|
+ return flag ? 'mobile' :'website'
|
|
|
+
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|