|
@@ -37,7 +37,7 @@
|
|
|
:show="show"
|
|
|
:title="'¥' + money"
|
|
|
:hide-on-click-outside="false"
|
|
|
- :maxlength="8"
|
|
|
+ :maxlength="5"
|
|
|
extra-key="."
|
|
|
@input="handleInput"
|
|
|
@delete="handleDelete"
|
|
@@ -49,12 +49,12 @@
|
|
|
</van-col>
|
|
|
<van-overlay :show="overlayShow" @click="overlayShow = false" />
|
|
|
<van-row class="rechargeSelect" gutter="16">
|
|
|
- <van-col span="8"><van-col @click="btn(50)" span="24" class="col">50</van-col></van-col>
|
|
|
- <van-col span="8"><van-col @click="btn(100)" span="24" class="col">100</van-col></van-col>
|
|
|
- <van-col span="8"><van-col @click="btn(150)" span="24" class="col">150</van-col></van-col>
|
|
|
- <van-col span="8"><van-col @click="btn(200)" span="24" class="col">200</van-col></van-col>
|
|
|
- <van-col span="8"><van-col @click="btn(300)" span="24" class="col">300</van-col></van-col>
|
|
|
- <van-col span="8"><van-col @click="btn(500)" span="24" class="col">500</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(50)" :class="active == 50 ? 'active' : ''" span="24" class="col">50</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(100)" :class="active == 100 ? 'active' : ''" span="24" class="col">100</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(150)" :class="active == 150 ? 'active' : ''" span="24" class="col">150</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(200)" :class="active == 200 ? 'active' : ''" span="24" class="col">200</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(300)" :class="active == 300 ? 'active' : ''" span="24" class="col">300</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(500)" :class="active == 500 ? 'active' : ''" span="24" class="col">500</van-col></van-col>
|
|
|
</van-row>
|
|
|
<van-row class="arrival" type="flex">
|
|
|
<van-col class="arrivalContent">到账金额:<span>¥{{ (Number((100 - (100 - proportion * 100)) * money) / 100 ).toFixed(2) }}</span></van-col>
|
|
@@ -110,7 +110,7 @@
|
|
|
:show="show"
|
|
|
:title="'¥' + money"
|
|
|
:hide-on-click-outside="false"
|
|
|
- :maxlength="8"
|
|
|
+ :maxlength="5"
|
|
|
extra-key="."
|
|
|
@input="handleInput"
|
|
|
@delete="handleDelete"
|
|
@@ -122,12 +122,12 @@
|
|
|
</van-col>
|
|
|
<van-overlay :show="overlayShow" @click="overlayShow = false" />
|
|
|
<van-row class="rechargeSelect" gutter="16">
|
|
|
- <van-col span="8"><van-col @click="btn(50)" span="24" class="col">50</van-col></van-col>
|
|
|
- <van-col span="8"><van-col @click="btn(100)" span="24" class="col">100</van-col></van-col>
|
|
|
- <van-col span="8"><van-col @click="btn(150)" span="24" class="col">150</van-col></van-col>
|
|
|
- <van-col span="8"><van-col @click="btn(200)" span="24" class="col">200</van-col></van-col>
|
|
|
- <van-col span="8"><van-col @click="btn(300)" span="24" class="col">300</van-col></van-col>
|
|
|
- <van-col span="8"><van-col @click="btn(500)" span="24" class="col">500</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(50)" :class="active == 50 ? 'active' : ''" span="24" class="col">50</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(100)" :class="active == 100 ? 'active' : ''" span="24" class="col">100</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(150)" :class="active == 150 ? 'active' : ''" span="24" class="col">150</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(200)" :class="active == 200 ? 'active' : ''" span="24" class="col">200</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(300)" :class="active == 300 ? 'active' : ''" span="24" class="col">300</van-col></van-col>
|
|
|
+ <van-col span="8"><van-col @click="btn(500)" :class="active == 500 ? 'active' : ''" span="24" class="col">500</van-col></van-col>
|
|
|
</van-row>
|
|
|
<van-row class="arrival" type="flex">
|
|
|
<van-col class="arrivalContent">到账金额:<span>¥{{ (Number((100 - (100 - proportion * 100)) * money) / 100 ).toFixed(2) }}</span></van-col>
|
|
@@ -235,15 +235,10 @@ export default {
|
|
|
listLoading:true,
|
|
|
czType:undefined, //支付类型 1微信 2支付宝
|
|
|
url:undefined,
|
|
|
+ active:undefined
|
|
|
};
|
|
|
},
|
|
|
- watch: {
|
|
|
- money(val) {
|
|
|
- if (/^0[1-9]/.test(val)) {
|
|
|
- this.money = val.substring(1);
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
+
|
|
|
components: {
|
|
|
[Field.name]: Field,
|
|
|
[NumberKeyboard.name]: NumberKeyboard,
|
|
@@ -313,6 +308,15 @@ export default {
|
|
|
this.fanhui = true;
|
|
|
}
|
|
|
},
|
|
|
+ // watch: {
|
|
|
+ // '$route' () {
|
|
|
+ // if(localStorage.getItem("user_wt") && localStorage.getItem("cardId57")){
|
|
|
+ // this.Balance()
|
|
|
+ // this.recharge2()
|
|
|
+ // this.proportionData()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
mounted(){
|
|
|
var url = window.location.href;
|
|
|
if(url.indexOf("token") > 1){
|
|
@@ -332,6 +336,28 @@ export default {
|
|
|
}
|
|
|
this.isWeixinOrAlipay()
|
|
|
|
|
|
+ // 监听
|
|
|
+ let uas = navigator.userAgent;
|
|
|
+ let _this = this
|
|
|
+ if(uas.indexOf('iPhone') > -1){
|
|
|
+ // 监听APP的传过来的消息
|
|
|
+ window.addEventListener('message', function (e) {
|
|
|
+ /*
|
|
|
+ * e.data 是APP返回的JSON字符串,字段:
|
|
|
+ * eventType 事件类型
|
|
|
+ * source 来源
|
|
|
+ * data 业务参数 - 返回数据放这里
|
|
|
+ * */
|
|
|
+ _this.czType = undefined
|
|
|
+ _this.appMessage(e)
|
|
|
+
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ window.document.addEventListener('message', function (e) {
|
|
|
+ _this.czType = undefined
|
|
|
+ _this.appMessage(e)
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
weixin(){
|
|
@@ -503,29 +529,27 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
handleInput(key) {
|
|
|
- (this.state1 = "color:#000;background: #fff;"),
|
|
|
- (this.state2 = "color:#000;background: #fff;"),
|
|
|
- (this.state3 = "color:#000;background: #fff;"),
|
|
|
- (this.state4 = "color:#000;background: #fff;"),
|
|
|
- (this.state5 = "color:#000;background: #fff;"),
|
|
|
- (this.state6 = "color:#000;background: #fff;"),
|
|
|
- (this.money = this.money + "");
|
|
|
+ if(this.money === 0){
|
|
|
+ this.money = key
|
|
|
+ }else{
|
|
|
+ this.money = this.money + ""
|
|
|
+ }
|
|
|
+
|
|
|
if (this.money === "" && key === ".") {
|
|
|
this.money = "0";
|
|
|
} else if (this.money.indexOf(".") !== -1 && key === ".") {
|
|
|
+ this.money = '0.'
|
|
|
return;
|
|
|
- } else if (
|
|
|
- this.money.indexOf("0") !== -1 &&
|
|
|
- this.money.length === 1 &&
|
|
|
- key === 0
|
|
|
- ) {
|
|
|
+ } else if (this.money.indexOf("0") !== -1 && this.money.length === 1 && key === 0) {
|
|
|
return;
|
|
|
} else if (/\.\d{2}$/.test(this.money)) {
|
|
|
return;
|
|
|
}
|
|
|
this.money += key;
|
|
|
+
|
|
|
},
|
|
|
- handleDelete() {
|
|
|
+ handleDelete(key) {
|
|
|
+ this.active = undefined
|
|
|
this.money = this.money + "";
|
|
|
if (!this.money) {
|
|
|
return;
|
|
@@ -547,76 +571,6 @@ export default {
|
|
|
this.env = "Alipay";
|
|
|
}
|
|
|
},
|
|
|
- // async pay(money, topPayType, payType, channelId) {
|
|
|
- // if(money.toString().indexOf(".")<1){
|
|
|
- // money = money + ".00"
|
|
|
- // }
|
|
|
- // if(localStorage.getItem("type")){ //充值系统后台扫码充值
|
|
|
- // axios.post('/dxtop/order/topScanPayApi', {
|
|
|
- // "money": Number(money).toFixed(2),
|
|
|
- // "topPayType": topPayType,
|
|
|
- // "payType": payType,
|
|
|
- // "channelId": channelId,
|
|
|
- // "scene": 2,
|
|
|
- // }).then(res => {
|
|
|
- // this.loading = false;
|
|
|
- // if(res.data.status == "ERROR"){
|
|
|
- // Toast(res.data.msg)
|
|
|
- // }else{
|
|
|
- // window.location.href = res.data.data
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }else{ //公众号充值(ERP或外包人员)
|
|
|
- // axios.get("dxtop/staff/one",{
|
|
|
- // params:{
|
|
|
- // id:localStorage.getItem("user_wt")
|
|
|
- // }
|
|
|
- // }).then(res =>{
|
|
|
- // if(res.data?.data?.sid){
|
|
|
- // if(localStorage.getItem("classify")){
|
|
|
- // let type = localStorage.getItem("classify")
|
|
|
- // let channelName =undefined
|
|
|
- // if(type == "1"){
|
|
|
- // channelName = "外包人员充值"
|
|
|
- // }
|
|
|
- // if(type == "2"){
|
|
|
- // channelName = "ERP人员充值"
|
|
|
- // }
|
|
|
- // axios.post('/dxtop/order/topScanPayApi', {
|
|
|
- // "money": Number(money).toFixed(2),
|
|
|
- // "topPayType": topPayType,
|
|
|
- // "payType": payType,
|
|
|
- // "channelName":channelName,
|
|
|
- // "scene": 6,
|
|
|
- // "userId": res.data.data.sid
|
|
|
- // }).then(res => {
|
|
|
- // this.loading = false;
|
|
|
- // if(res.data.status == "ERROR"){
|
|
|
- // Toast(res.data.msg)
|
|
|
- // }else{
|
|
|
- // window.location.href = res.data.data
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }else{
|
|
|
- // axios.post('/dxtop/order/topScanPayApi', {
|
|
|
- // "money": Number(money).toFixed(2),
|
|
|
- // "topPayType": topPayType,
|
|
|
- // "payType": payType,
|
|
|
- // "channelId": channelId,
|
|
|
- // "scene": 2,
|
|
|
- // }).then(res => {
|
|
|
- // this.loading = false;
|
|
|
- // if(res.data.status == "ERROR"){
|
|
|
- // Toast(res.data.msg)
|
|
|
- // }else{
|
|
|
- // window.location.href = res.data.data
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // },
|
|
|
//支付
|
|
|
jumpMode() {
|
|
|
if(this.channelId){//游客
|
|
@@ -669,7 +623,6 @@ export default {
|
|
|
},
|
|
|
async pay(money, topPayType, payType, channelId,userId) {
|
|
|
if(userId){
|
|
|
- console.log(1)
|
|
|
//("erp返回支付宝app支付链接 公众号返回微信支付链接")
|
|
|
axios.get("dxtop/staff/one",{
|
|
|
params:{
|
|
@@ -677,30 +630,49 @@ export default {
|
|
|
}
|
|
|
}).then(res =>{
|
|
|
if(res.data?.data?.sid){
|
|
|
- let channelName =undefined
|
|
|
- if(localStorage.getItem("classify") == "1"){
|
|
|
- channelName = "外包人员充值"
|
|
|
- }
|
|
|
- if(localStorage.getItem("classify") == "2"){
|
|
|
- channelName = "ERP人员充值"
|
|
|
- }
|
|
|
- axios.post('/dxtop/order/topScanPayApi', {
|
|
|
- "money": Number(money).toFixed(2),
|
|
|
- "topPayType": topPayType,
|
|
|
- "payType": payType,
|
|
|
- "channelName":channelName,
|
|
|
- "scene": 6,
|
|
|
- "userId": res.data.data.sid
|
|
|
- }).then(res2 => {
|
|
|
- this.loading = false;
|
|
|
- if(res2.data.status == "ERROR"){
|
|
|
- Toast(res2.data.msg)
|
|
|
- }else{
|
|
|
- window.location.href = res2.data.data
|
|
|
+ if(localStorage.getItem("classify")){
|
|
|
+ let channelName =undefined
|
|
|
+ if(localStorage.getItem("classify") == "1"){
|
|
|
+ channelName = "外包人员充值"
|
|
|
+ }
|
|
|
+ if(localStorage.getItem("classify") == "2"){
|
|
|
+ channelName = "ERP人员充值"
|
|
|
}
|
|
|
- }).catch(() => {
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
+ axios.post('/dxtop/order/topScanPayApi', {
|
|
|
+ "money": Number(money).toFixed(2),
|
|
|
+ "topPayType": topPayType,
|
|
|
+ "payType": payType,
|
|
|
+ "channelName":channelName,
|
|
|
+ "scene": 6,
|
|
|
+ "userId": res.data.data.sid
|
|
|
+ }).then(res2 => {
|
|
|
+ this.loading = false;
|
|
|
+ if(res2.data.status == "ERROR"){
|
|
|
+ Toast(res2.data.msg)
|
|
|
+ }else{
|
|
|
+ window.location.href = res2.data.data
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ axios.post('/dxtop/order/callUnifiedPay', {
|
|
|
+ "money": Number(money).toFixed(2),
|
|
|
+ "topPayType": topPayType,
|
|
|
+ "payType": payType,
|
|
|
+ "scene": 3,
|
|
|
+ "userId": res.data.data.sid
|
|
|
+ }).then(res2 => {
|
|
|
+ this.loading = false;
|
|
|
+ if(res2.data.status == "ERROR"){
|
|
|
+ Toast(res2.data.msg)
|
|
|
+ }else{
|
|
|
+ window.location.href = res2.data.data
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
}else{
|
|
|
Toast("用户sid不存在")
|
|
|
}
|
|
@@ -722,8 +694,6 @@ export default {
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
}else{//返回支付宝微信支付连接
|
|
|
- console.log(3)
|
|
|
- return
|
|
|
// console.log("返回支付宝微信支付链接 用于url进入 不带渠道参数")
|
|
|
axios.post('/dxtop/order/topScanPayApi', {
|
|
|
"money": Number(money).toFixed(2),
|
|
@@ -837,6 +807,7 @@ export default {
|
|
|
},
|
|
|
btn(id){
|
|
|
this.money = id
|
|
|
+ this.active = id
|
|
|
},
|
|
|
zfTypt(url){
|
|
|
this.czType = url.czType
|
|
@@ -861,6 +832,7 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+
|
|
|
.mianBox {
|
|
|
width: 100vw;
|
|
|
height: 100vh;
|
|
@@ -932,10 +904,6 @@ export default {
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
}
|
|
|
- .van-col.col:hover {
|
|
|
- background: #D7000F;
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
> .van-col:nth-child(1),> .van-col:nth-child(2),> .van-col:nth-child(3){
|
|
|
margin-top:-6px;
|
|
|
}
|
|
@@ -945,8 +913,11 @@ export default {
|
|
|
text-align: left;
|
|
|
font-size: 15px;
|
|
|
.arrivalContent{
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 700;
|
|
|
span{
|
|
|
color:#D7000F;
|
|
|
+ font-weight: 400;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1036,10 +1007,10 @@ export default {
|
|
|
width: 28%;
|
|
|
border:1px solid rgba(242, 46, 60, 1) !important;
|
|
|
}
|
|
|
- & > .van-col.active {
|
|
|
- background: #F22E3C;
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
+ // & > .van-col.active {
|
|
|
+ // background: #F22E3C;
|
|
|
+ // color: #fff;
|
|
|
+ // }
|
|
|
& > .van-col:nth-child(3n-1),
|
|
|
& > .van-col:nth-child(3n) {
|
|
|
margin-left: 8%;
|
|
@@ -1100,7 +1071,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.list{
|
|
|
- -webkit-overflow-scrolling: touch;
|
|
|
padding-bottom:20px;
|
|
|
.listData{
|
|
|
height:100%;
|
|
@@ -1164,11 +1134,26 @@ export default {
|
|
|
}
|
|
|
|
|
|
|
|
|
+}
|
|
|
+.active {
|
|
|
+ background: #D7000F !important;
|
|
|
+ color: #fff !important;
|
|
|
+}
|
|
|
+.mianBox::-webkit-scrollbar {
|
|
|
+ display: none; /* Chrome Safari */
|
|
|
+}
|
|
|
+
|
|
|
+.mianBox {
|
|
|
+ scrollbar-width: none; /* firefox */
|
|
|
+ -ms-overflow-style: none; /* IE 10+ */
|
|
|
+ overflow-x: hidden;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
/*特殊处理 */
|
|
|
/deep/ .van-field__control{
|
|
|
color: rgba(242, 46, 60, 1) !important;
|
|
|
margin-left:0;
|
|
|
+ margin-top:2px;
|
|
|
}
|
|
|
/deep/ .van-field__label{
|
|
|
width:0 !important;
|
|
@@ -1177,7 +1162,9 @@ export default {
|
|
|
margin-left:-10px !important;
|
|
|
font-size: 17px;
|
|
|
}
|
|
|
-
|
|
|
+/deep/ .van-field{
|
|
|
+ background: transparent
|
|
|
+}
|
|
|
|
|
|
//
|
|
|
|