扫码核销

huipay-h5
游梦婷 12 months ago
parent 1973aee590
commit 4477c8b71e
  1. 9
      App.vue
  2. 73
      pages.json
  3. 4
      pages/index/merchant-details/merchant-details.vue
  4. 6
      pages/index/normal-Merchant/normal-Merchant.vue
  5. 8
      pages/login/login.vue
  6. 79
      pages/welcome/welcome.vue
  7. 22
      subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue

@ -38,7 +38,10 @@
// //
receiverName: '', receiverName: '',
// //
storeAddress: '' storeAddress: '',
accountId:'',
urlKey:'',
urlCode:'',
}, },
onLaunch: function() { onLaunch: function() {
/* let that = this; /* let that = this;
@ -61,6 +64,10 @@
this.globalData.userInfo = uni.getStorageSync("payuser") || ''; this.globalData.userInfo = uni.getStorageSync("payuser") || '';
this.globalData.token = uni.getStorageSync("paytoken") || ''; this.globalData.token = uni.getStorageSync("paytoken") || '';
this.globalData.openId = uni.getStorageSync("openId") || ''; this.globalData.openId = uni.getStorageSync("openId") || '';
this.globalData.accountId = uni.getStorageSync("accountId") || '';
this.globalData.urlKey = uni.getStorageSync("urlKey") || '';
this.globalData.urlCode = uni.getStorageSync("urlCode") || '';
}, },
onHide: function() {} onHide: function() {}
} }

@ -646,35 +646,20 @@
{ {
"path":"groupBuyingConfiguration/groupBuyingConfiguration", "path":"groupBuyingConfiguration/groupBuyingConfiguration",
"style": { "style": {
"navigationBarTitleText": "团购配置", "navigationBarTitleText": "团购配置"
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none"
}
} }
}, },
{ {
"path":"groupBuyingConfiguration/storeImg/storeImg", "path":"groupBuyingConfiguration/storeImg/storeImg",
"style": { "style": {
"navigationBarTitleText": "门店图片", "navigationBarTitleText": "门店图片"
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none"
}
} }
}, },
{ {
"path":"groupBuyingConfiguration/storeImg/storeImgAdd", "path":"groupBuyingConfiguration/storeImg/storeImgAdd",
"style": { "style": {
"navigationBarTitleText": "添加图片", "navigationBarTitleText": "添加图片"
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none"
}
} }
}, },
@ -682,67 +667,49 @@
"path":"groupBuyingConfiguration/storeProduct/storeProduct", "path":"groupBuyingConfiguration/storeProduct/storeProduct",
"style": { "style": {
"navigationBarTitleText": "门店产品", "navigationBarTitleText": "门店产品"
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none"
}
} }
}, },
{ {
"path":"groupBuyingConfiguration/storeProduct/storeProductAdd", "path":"groupBuyingConfiguration/storeProduct/storeProductAdd",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": ""
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none"
}
} }
},{ },{
"path":"groupBuyingConfiguration/groupProduct/groupProduct", "path":"groupBuyingConfiguration/groupProduct/groupProduct",
"style": { "style": {
"navigationBarTitleText": "团购产品", "navigationBarTitleText": "团购产品"
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none"
}
} }
},{ },{
"path":"groupBuyingConfiguration/groupProduct/groupProductAdd", "path":"groupBuyingConfiguration/groupProduct/groupProductAdd",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": ""
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none"
}
} }
}, },
{ {
"path":"groupBuyingConfiguration/storeMessage/storeMessage", "path":"groupBuyingConfiguration/storeMessage/storeMessage",
"style": { "style": {
"navigationBarTitleText": "门店信息", "navigationBarTitleText": "门店信息"
"enablePullDownRefresh": false, }
"app-plus": { },
"titleNView": false, // {
"softinputNavBar": "none" "path":"groupBuyingConfiguration/groupVerify/groupVerify",
} "style": {
"navigationBarTitleText": "核销订单",
"enablePullDownRefresh": false
} }
} }
] ]
}], }],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8",
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none"
}
} }
} }

@ -54,7 +54,7 @@
<view class="width94 backcorfff border-r mart15" v-for="(item,index) in storeList" :key="index" <view class="width94 backcorfff border-r mart15" v-for="(item,index) in storeList" :key="index"
@click="jumpstoredes(item.id)"> @click="jumpstoredes(item.id)">
<view class="notes" style="border-bottom: 0px;"> <view class="notes" style="border-bottom: 0px;">
<image src="../../../static/img/store/store7.png" mode="widthFix" class="iconw40"></image> <image src="../../../static/img/store/store7.png" mode="widthFix" class="iconw40 height40p"></image>
<view class="width65 margle"> <view class="width65 margle">
<view class="font14 fcor333">{{item.name}}</view> <view class="font14 fcor333">{{item.name}}</view>
<view class="font12 fcor999">{{item.updateTime | timeFormat('yyyy-mm-dd')}} <view class="font12 fcor999">{{item.updateTime | timeFormat('yyyy-mm-dd')}}
@ -93,7 +93,7 @@
<button class="btns mart10 margle10" @click.stop="jumpBindScan(item.id,1)">绑定二维码</button> <button class="btns mart10 margle10" @click.stop="jumpBindScan(item.id,1)">绑定二维码</button>
<button class="btns mart10 margle10" @click.stop="jumpBindScan(item.id,2)">二维码列表</button> <button class="btns mart10 margle10" @click.stop="jumpBindScan(item.id,2)">二维码列表</button>
<button class="btns mart10 margle10" @click.stop="jumpService(item.id)">绑定设备</button> <button class="btns mart10 margle10" @click.stop="jumpService(item.id)">绑定设备</button>
<!-- <button class="btns mart10 margle10" @click.stop="jumpGroupService(item.id)">团购配置</button> --> <button class="btns mart10 margle10" @click.stop="jumpGroupService(item.id)">团购配置</button>
<!-- <button class="btns mart10 marRight10" @click.stop="jumpService(item.id,2)">设备列表</button> --> <!-- <button class="btns mart10 marRight10" @click.stop="jumpService(item.id,2)">设备列表</button> -->
</view> </view>
<view class="lin10"></view> <view class="lin10"></view>

@ -1,5 +1,5 @@
<template> <template>
<view> <view class="paddtop15">
<view class="input-box"> <view class="input-box">
<view class="icon search"></view> <view class="icon search"></view>
<input placeholder="请输入商户名称" v-model="mersearchName" placeholder-style="color:#c0c0c0;" <input placeholder="请输入商户名称" v-model="mersearchName" placeholder-style="color:#c0c0c0;"
@ -12,7 +12,7 @@
<view class="width94 backcorfff border-r mart15" v-for="(item,index) in merchantlist" :key="index" <view class="width94 backcorfff border-r mart15" v-for="(item,index) in merchantlist" :key="index"
@click="jumpmerdes(item.id)"> @click="jumpmerdes(item.id)">
<view class="notes"> <view class="notes">
<image src="../../../static/img/merchantstu.png" mode="widthFix" class="iconw40"></image> <image src="../../../static/img/merchantstu.png" mode="widthFix" class="iconw40 height40p"></image>
<view class="width60 margle"> <view class="width60 margle">
<view class="font14 fcor333">{{item.merName}}</view> <view class="font14 fcor333">{{item.merName}}</view>
<view class="font12 fcor999"> <view class="font12 fcor999">
@ -125,7 +125,7 @@
.input-box { .input-box {
width: 90%; width: 90%;
margin-left: 5%; margin-left: 5%;
margin-top: 15px; // margin-top: 15px;
margin-bottom: 15px; margin-bottom: 15px;
height: 70rpx; height: 70rpx;
background-color: #fff; background-color: #fff;

@ -124,6 +124,14 @@
key: "paytoken", key: "paytoken",
data: res.return_data.uniqueCode data: res.return_data.uniqueCode
}) })
if(app.globalData.accountId == '0001'&& app.globalData.urlKey){ //
uni.redirectTo({
url: '/subpackages/groupBuyingConfiguration/groupVerify/groupVerify?orderKey='+app.globalData.urlKey,
})
return
}
uni.reLaunch({ uni.reLaunch({
url: '../tabBar/home/home' url: '../tabBar/home/home'
}) })

@ -16,28 +16,51 @@
} }
}, },
onLoad(options) { onLoad(options) {
let that = this;
// uni.reLaunch({ // uni.reLaunch({
// url: '../tabBar/home/home' // url: '../tabBar/home/home'
// }) // })
// return
let that = this;
/*
重定向前:https://gratia-pay.dctpay.com/cweb?accountId=0001&key=123#/
https://gratia-pay.dctpay.com/cweb?accountId=0001&key=123&code=456#/
重定向后 -微信
https://gratia-pay.dctpay.com/cweb/?redirect_uri=https://gratia-pay.dctpay.com/cweb&code=0111BKGa1EvjoG0sm9Ha1u8wG111BKGR&state=1#/
["https://gratia-pay.dctpay.com/cweb/?redirect_uri", "https://gratia-pay.dctpay.com/cweb&code", "0111BKGa1EvjoG0sm9Ha1u8wG111BKGR&state", "1#/"]
*/
// #ifdef H5 // #ifdef H5
let arr1 = window.location.href; let locationPathStr = window.location.href;
let arr2 = arr1.split('='); let locationPathArr = locationPathStr.split('=');
if (arr2[2]) { let codeArr = locationPathArr[2] ? locationPathArr[2].split('&') : [];
var arr3 = arr2[2].split('&'); if (locationPathArr[locationPathArr.length-1]=='1#/'&&codeArr[0]) {
if (arr3[0] != undefined && arr3[0]) { app.globalData.h5code = codeArr[0];
app.globalData.h5code = arr3[0]; uni.setStorageSync("h5code",codeArr[0])
uni.setStorage({ this.getAccessToken();//openID
key: "h5code",
data: arr3[0]
})
}
} else { } else {
// openid if(locationPathArr[1]){
that.jumpcdx(); let accountId = locationPathArr[1].split("&")[0];
} app.globalData.accountId=accountId;
if (app.globalData.h5code) { uni.setStorageSync("accountId",accountId);
that.getAccessToken(); }
if(locationPathArr[2]){
let key;
if(!locationPathArr[3]){
key = locationPathArr[2].split("#")[0];
}else{
key = locationPathArr[2].split("&")[0];
}
app.globalData.urlKey = key;
uni.setStorageSync("urlKey",key);
}
if(locationPathArr[3]&&!locationPathArr[4]){
let code = locationPathArr[3].split("#")[0];
app.globalData.code = code;
uni.setStorageSync("urlCode",code);
}
this.jumpcdx();//
} }
// #endif // #endif
}, },
@ -50,12 +73,11 @@
getAccessToken(params).then(res => { getAccessToken(params).then(res => {
if (res.return_code == '000000' && res.return_data.openid) { if (res.return_code == '000000' && res.return_data.openid) {
app.globalData.openId = res.return_data.openid; app.globalData.openId = res.return_data.openid;
/* uni.setStorage({
key: "openId",
data: res.return_data.openid
}) */
uni.setStorageSync("openId",res.return_data.openid); uni.setStorageSync("openId",res.return_data.openid);
if (this.userInfo) { if (this.userInfo) {
if(!this.isGoHomeUrl()) return;
uni.reLaunch({ uni.reLaunch({
url: '../tabBar/home/home' url: '../tabBar/home/home'
}) })
@ -70,10 +92,23 @@
} }
}); });
}, },
isGoHomeUrl(){
// 0001https://gratia-pay.dctpay.com/cweb?accountId=0001&key=123
if (app.globalData.accountId == '0001' && app.globalData.h5code){
let orderKey = uni.getStorageSync("urlKey");
if(orderKey){
uni.redirectTo({
url: '/subpackages/groupBuyingConfiguration/groupVerify/groupVerify?orderKey='+orderKey,
})
return false;
}
}
return true;
},
jumpcdx() { jumpcdx() {
let redirectUrl = app.globalData.redirectUrl; let redirectUrl = app.globalData.redirectUrl;
location.href = location.href =
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https://hsg.dctpay.com/wechat_authorize/?redirect_uri=${redirectUrl}&response_type=code&scope=snsapi_base#wechat_redirect`; `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https://hsg.dctpay.com/wechat_authorize/?redirect_uri=${redirectUrl}&response_type=code&scope=snsapi_base&state=1#wechat_redirect`;
}, },
} }
} }

@ -0,0 +1,22 @@
<template>
<view>
========={{key}}========
</view>
</template>
<script>
export default {
data(){
return{
key:'',
}
},
onLoad(option){
this.key = option.orderKey;
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save