Commit 50584994 authored by 潘永坪's avatar 潘永坪

支付宝小程序关联二维码,和支付处理

parent f2658352
...@@ -5,16 +5,23 @@ ...@@ -5,16 +5,23 @@
// 3、推荐使用uni-app里面的onReady 代替 vue 里面的 mounted // 3、推荐使用uni-app里面的onReady 代替 vue 里面的 mounted
//4.setStorageSync与setStorage的区别:如果后续的操作需要使用更新storage后保存的data,则使用setStorageSync使用异步性能更好,使用同步数据更安全 //4.setStorageSync与setStorage的区别:如果后续的操作需要使用更新storage后保存的data,则使用setStorageSync使用异步性能更好,使用同步数据更安全
export default { export default {
onLaunch: function() {//初始化完成时触发(全局只触发一次 onLaunch: function(options) {//初始化完成时触发(全局只触发一次
let openid=uni.getStorageSync("openid") let openid=uni.getStorageSync("openid")
if(!openid){ if(!openid){
setTimeout(()=>{//解决关联普通二维码扫码首次进入时一直显示登录中 setTimeout(()=>{//解决关联普通二维码扫码首次进入时一直显示登录中
uni.navigateTo({ uni.navigateTo({
url: "pages/login/login" url: "/pages/login/login"
}) })
},300) },300)
} }
//#ifdef MP-ALIPAY
if (options.query && options.query.qrCode) {
uni.setStorageSync('alipayQrCode',options.query.qrCode)
}else{
uni.removeStorageSync('alipayQrCode')
}
//#endif
}, },
onShow: function() { onShow: function() {
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</view> </view>
<!--#endif--> <!--#endif-->
<!-- <button @click="getUserInfo()"> 授权获取头像昵称 </button> --> <!-- <button @click="getUserInfo()"> 授权获取头像昵称 </button> -->
<view class="bottom" v-show="showBottom"> <view class="bottom">
<!--#ifdef MP-WEIXIN--> <!--#ifdef MP-WEIXIN-->
<web-view src="https://wx.pangdly.com"></web-view> <web-view src="https://wx.pangdly.com"></web-view>
<!--#endif--> <!--#endif-->
...@@ -80,16 +80,8 @@ ...@@ -80,16 +80,8 @@
export default { export default {
data() { data() {
return { return {
showBottom:false,//控制底部显示隐藏
}
},
onLoad() {
if(uni.getStorageSync("openid")){
this.showBottom=true
}
},
onReady(){
}
}, },
methods: { methods: {
getUserInfo() { // 获取用户信息 getUserInfo() { // 获取用户信息
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
companyId: "", //公司Id companyId: "", //公司Id
merchantId: "", //商户Id merchantId: "", //商户Id
name: "", //商家名称 name: "", //商家名称
payType:42,//支付类型,微信小程序支付 payType:"",//支付类型,微信小程序42,支付宝小程序33
paySign: "", //签名 paySign: "", //签名
signType: "", //签名方式 signType: "", //签名方式
timeStamp: "", //时间戳 timeStamp: "", //时间戳
...@@ -158,16 +158,12 @@ ...@@ -158,16 +158,12 @@
onLoad(option) { onLoad(option) {
//#ifdef MP-WEIXIN //#ifdef MP-WEIXIN
this.enterUrl=option.q this.enterUrl=option.q
this.payType = 42
//#endif //#endif
//#ifdef MP-ALIPAY //#ifdef MP-ALIPAY
uni.showModal({ this.enterUrl=uni.getStorageSync("alipayQrCode")
title: '提示', this.payType = 33
content:JSON.stringify(option)
});
if(option.query && option.query.qrCode){
this.enterUrl=option.query.qrCode
}
//#endif //#endif
if(this.enterUrl){//扫普通二维码进入 if(this.enterUrl){//扫普通二维码进入
this.merchantId=this.getUrlKey("merchantId") this.merchantId=this.getUrlKey("merchantId")
......
项目介绍文件
一、本地存储数据
1.uni.getStorageSync("openid")
2.uni.getStorageSync("alipayQrCode")
(my["webpackJsonp"]=my["webpackJsonp"]||[]).push([["common/main"],{"0f37":function(e,t,n){"use strict";n.r(t);var r=n("3713");for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);n("dbd1");var u,c,f,i,a=n("f0c5"),l=Object(a["a"])(r["default"],u,c,!1,null,null,null,!1,f,i);t["default"]=l.exports},"25fe":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={onLaunch:function(){var t=e.getStorageSync("openid");t||setTimeout((function(){e.navigateTo({url:"pages/login/login"})}),300)},onShow:function(){},onHide:function(){}};t.default=n}).call(this,n("c11b")["default"])},3713:function(e,t,n){"use strict";n.r(t);var r=n("25fe"),o=n.n(r);for(var u in r)"default"!==u&&function(e){n.d(t,e,(function(){return r[e]}))}(u);t["default"]=o.a},d81f:function(e,t,n){"use strict";(function(e){n("6909"),n("921b");var t=c(n("66fd")),r=c(n("0f37")),o=c(n("cd04")),u=c(n("1d0e"));function c(e){return e&&e.__esModule?e:{default:e}}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n("48bb"),t.default.prototype.$request=u.default,t.default.use(o.default),t.default.config.productionTip=!1,r.default.mpType="app";var l=new t.default(i({},r.default));e(l).$mount()}).call(this,n("c11b")["createApp"])},dbd1:function(e,t,n){"use strict";var r=n("def2"),o=n.n(r);o.a},def2:function(e,t,n){}},[["d81f","common/runtime","common/vendor"]]]); (my["webpackJsonp"]=my["webpackJsonp"]||[]).push([["common/main"],{"0f37":function(e,t,n){"use strict";n.r(t);var r=n("3713");for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);n("dbd1");var u,c,f,a,i=n("f0c5"),l=Object(i["a"])(r["default"],u,c,!1,null,null,null,!1,f,a);t["default"]=l.exports},"25fe":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={onLaunch:function(t){var n=e.getStorageSync("openid");n||setTimeout((function(){e.navigateTo({url:"/pages/login/login"})}),300),t.query&&t.query.qrCode?e.setStorageSync("alipayQrCode",t.query.qrCode):e.removeStorageSync("alipayQrCode")},onShow:function(){},onHide:function(){}};t.default=n}).call(this,n("c11b")["default"])},3713:function(e,t,n){"use strict";n.r(t);var r=n("25fe"),o=n.n(r);for(var u in r)"default"!==u&&function(e){n.d(t,e,(function(){return r[e]}))}(u);t["default"]=o.a},d81f:function(e,t,n){"use strict";(function(e){n("6909"),n("921b");var t=c(n("66fd")),r=c(n("0f37")),o=c(n("cd04")),u=c(n("1d0e"));function c(e){return e&&e.__esModule?e:{default:e}}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n("48bb"),t.default.prototype.$request=u.default,t.default.use(o.default),t.default.config.productionTip=!1,r.default.mpType="app";var l=new t.default(a({},r.default));e(l).$mount()}).call(this,n("c11b")["createApp"])},dbd1:function(e,t,n){"use strict";var r=n("def2"),o=n.n(r);o.a},def2:function(e,t,n){}},[["d81f","common/runtime","common/vendor"]]]);
\ No newline at end of file \ No newline at end of file
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
], ],
"subPackages": [], "subPackages": [],
"window": { "window": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "white",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "胖丁旅行",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#192033",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
}, },
"permission": { "permission": {
...@@ -36,5 +36,6 @@ ...@@ -36,5 +36,6 @@
"uniStatistics": { "uniStatistics": {
"enable": true "enable": true
}, },
"usingComponents": {} "usingComponents": {},
"sitemapLocation": "sitemap.json"
} }
\ No newline at end of file
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["common/main"],{"0f37":function(e,t,n){"use strict";n.r(t);var r=n("3713");for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);n("dbd1");var u,c,f,i,a=n("f0c5"),l=Object(a["a"])(r["default"],u,c,!1,null,null,null,!1,f,i);t["default"]=l.exports},"25fe":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={onLaunch:function(){var t=e.getStorageSync("openid");t||setTimeout((function(){e.navigateTo({url:"pages/login/login"})}),300)},onShow:function(){},onHide:function(){}};t.default=n}).call(this,n("543d")["default"])},3713:function(e,t,n){"use strict";n.r(t);var r=n("25fe"),o=n.n(r);for(var u in r)"default"!==u&&function(e){n.d(t,e,(function(){return r[e]}))}(u);t["default"]=o.a},d81f:function(e,t,n){"use strict";(function(e){n("6909"),n("921b");var t=c(n("66fd")),r=c(n("0f37")),o=c(n("cd04")),u=c(n("1d0e"));function c(e){return e&&e.__esModule?e:{default:e}}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n("48bb"),t.default.prototype.$request=u.default,t.default.use(o.default),t.default.config.productionTip=!1,r.default.mpType="app";var l=new t.default(i({},r.default));e(l).$mount()}).call(this,n("543d")["createApp"])},dbd1:function(e,t,n){"use strict";var r=n("def2"),o=n.n(r);o.a},def2:function(e,t,n){}},[["d81f","common/runtime","common/vendor"]]]); (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["common/main"],{"0f37":function(e,t,n){"use strict";n.r(t);var r=n("3713");for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);n("dbd1");var u,c,f,i,a=n("f0c5"),l=Object(a["a"])(r["default"],u,c,!1,null,null,null,!1,f,i);t["default"]=l.exports},"25fe":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={onLaunch:function(t){var n=e.getStorageSync("openid");n||setTimeout((function(){e.navigateTo({url:"/pages/login/login"})}),300)},onShow:function(){},onHide:function(){}};t.default=n}).call(this,n("543d")["default"])},3713:function(e,t,n){"use strict";n.r(t);var r=n("25fe"),o=n.n(r);for(var u in r)"default"!==u&&function(e){n.d(t,e,(function(){return r[e]}))}(u);t["default"]=o.a},d81f:function(e,t,n){"use strict";(function(e){n("6909"),n("921b");var t=c(n("66fd")),r=c(n("0f37")),o=c(n("cd04")),u=c(n("1d0e"));function c(e){return e&&e.__esModule?e:{default:e}}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n("48bb"),t.default.prototype.$request=u.default,t.default.use(o.default),t.default.config.productionTip=!1,r.default.mpType="app";var l=new t.default(i({},r.default));e(l).$mount()}).call(this,n("543d")["createApp"])},dbd1:function(e,t,n){"use strict";var r=n("def2"),o=n.n(r);o.a},def2:function(e,t,n){}},[["d81f","common/runtime","common/vendor"]]]);
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"065f":function(n,t,e){"use strict";e.r(t);var o=e("737f"),u=e.n(o);for(var c in o)"default"!==c&&function(n){e.d(t,n,(function(){return o[n]}))}(c);t["default"]=u.a},"2bba":function(n,t,e){"use strict";(function(n){e("6909"),e("921b");o(e("66fd"));var t=o(e("c545"));function o(n){return n&&n.__esModule?n:{default:n}}n(t.default)}).call(this,e("543d")["createPage"])},"737f":function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={data:function(){return{showBottom:!1}},onLoad:function(){n.getStorageSync("openid")&&(this.showBottom=!0)},onReady:function(){},methods:{getUserInfo:function(){n.getUserProfile({lang:"zh_CN",desc:"登录",success:function(n){console.log(n)},fail:function(n){}})}}};t.default=e}).call(this,e("543d")["default"])},c545:function(n,t,e){"use strict";e.r(t);var o=e("e007"),u=e("065f");for(var c in u)"default"!==c&&function(n){e.d(t,n,(function(){return u[n]}))}(c);e("d9b5");var f,a=e("f0c5"),r=Object(a["a"])(u["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],f);t["default"]=r.exports},d9b5:function(n,t,e){"use strict";var o=e("e90d"),u=e.n(o);u.a},e007:function(n,t,e){"use strict";var o;e.d(t,"b",(function(){return u})),e.d(t,"c",(function(){return c})),e.d(t,"a",(function(){return o}));var u=function(){var n=this,t=n.$createElement;n._self._c},c=[]},e90d:function(n,t,e){}},[["2bba","common/runtime","common/vendor"]]]); (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"065f":function(n,t,e){"use strict";e.r(t);var o=e("737f"),u=e.n(o);for(var c in o)"default"!==c&&function(n){e.d(t,n,(function(){return o[n]}))}(c);t["default"]=u.a},"2bba":function(n,t,e){"use strict";(function(n){e("6909"),e("921b");o(e("66fd"));var t=o(e("c545"));function o(n){return n&&n.__esModule?n:{default:n}}n(t.default)}).call(this,e("543d")["createPage"])},"6c5e":function(n,t,e){"use strict";var o;e.d(t,"b",(function(){return u})),e.d(t,"c",(function(){return c})),e.d(t,"a",(function(){return o}));var u=function(){var n=this,t=n.$createElement;n._self._c},c=[]},"737f":function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={data:function(){return{showBottom:!1}},onLoad:function(){n.getStorageSync("openid")&&(this.showBottom=!0)},onReady:function(){},methods:{getUserInfo:function(){n.getUserProfile({lang:"zh_CN",desc:"登录",success:function(n){console.log(n)},fail:function(n){}})}}};t.default=e}).call(this,e("543d")["default"])},c545:function(n,t,e){"use strict";e.r(t);var o=e("6c5e"),u=e("065f");for(var c in u)"default"!==c&&function(n){e.d(t,n,(function(){return u[n]}))}(c);e("d9b5");var f,a=e("f0c5"),r=Object(a["a"])(u["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],f);t["default"]=r.exports},d9b5:function(n,t,e){"use strict";var o=e("e90d"),u=e.n(o);u.a},e90d:function(n,t,e){}},[["2bba","common/runtime","common/vendor"]]]);
\ No newline at end of file \ No newline at end of file
...@@ -6,8 +6,37 @@ ...@@ -6,8 +6,37 @@
"setting": { "setting": {
"urlCheck": true, "urlCheck": true,
"es6": true, "es6": true,
"enhance": false,
"postcss": true, "postcss": true,
"minified": true "preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "", "libVersion": "",
...@@ -15,19 +44,15 @@ ...@@ -15,19 +44,15 @@
"projectname": "uni-pdtravel", "projectname": "uni-pdtravel",
"condition": { "condition": {
"search": { "search": {
"current": -1,
"list": [] "list": []
}, },
"conversation": { "conversation": {
"current": -1,
"list": [] "list": []
}, },
"game": { "game": {
"current": -1,
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": -1,
"list": [] "list": []
} }
} }
......
{
"condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": [
{
"name": "pages/index/index",
"pathName": "pages/index/index",
"query": "",
"scene": null
}
]
}
}
}
\ No newline at end of file
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}
\ No newline at end of file
{ {
"modes": [ "modes": [
{ {
"title": "支付页面", "title": "支付",
"page": "pages/ourPayment/ourPayment", "page": "pages/ourPayment/ourPayment"
"pageQuery": "companyId=10001"
} }
] ]
} }
\ No newline at end of file
...@@ -103,16 +103,24 @@ __webpack_require__.r(__webpack_exports__); ...@@ -103,16 +103,24 @@ __webpack_require__.r(__webpack_exports__);
// 3、推荐使用uni-app里面的onReady 代替 vue 里面的 mounted // 3、推荐使用uni-app里面的onReady 代替 vue 里面的 mounted
//4.setStorageSync与setStorage的区别:如果后续的操作需要使用更新storage后保存的data,则使用setStorageSync使用异步性能更好,使用同步数据更安全 //4.setStorageSync与setStorage的区别:如果后续的操作需要使用更新storage后保存的data,则使用setStorageSync使用异步性能更好,使用同步数据更安全
var _default = { var _default = {
onLaunch: function onLaunch() {//初始化完成时触发(全局只触发一次 onLaunch: function onLaunch(options) {//初始化完成时触发(全局只触发一次
var openid = uni.getStorageSync("openid"); var openid = uni.getStorageSync("openid");
if (!openid) { if (!openid) {
setTimeout(function () {//解决关联普通二维码扫码首次进入时一直显示登录中 setTimeout(function () {//解决关联普通二维码扫码首次进入时一直显示登录中
uni.navigateTo({ uni.navigateTo({
url: "pages/login/login" }); url: "/pages/login/login" });
}, 300); }, 300);
} }
if (options.query && options.query.qrCode) {
uni.setStorageSync('alipayQrCode', options.query.qrCode);
} else {
uni.removeStorageSync('alipayQrCode');
}
}, },
onShow: function onShow() { onShow: function onShow() {
......
This diff is collapsed.
...@@ -211,16 +211,8 @@ __webpack_require__.r(__webpack_exports__); ...@@ -211,16 +211,8 @@ __webpack_require__.r(__webpack_exports__);
var _default = var _default =
{ {
data: function data() { data: function data() {
return { return {};
showBottom: false //控制底部显示隐藏
};
},
onLoad: function onLoad() {
if (uni.getStorageSync("openid")) {
this.showBottom = true;
}
},
onReady: function onReady() {
}, },
methods: { methods: {
......
<view><view hidden="{{!(showBottom)}}" class="bottom"><web-view src="https://wx.pangdly.com"></web-view></view></view> <view><view class="bottom"><web-view src="https://wx.pangdly.com"></web-view></view></view>
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"ignore": [] "ignore": []
}, },
"setting": { "setting": {
"urlCheck": true, "urlCheck": false,
"es6": true, "es6": true,
"enhance": false, "enhance": false,
"postcss": true, "postcss": true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment