lhl 3 years ago
parent
commit
a512be9004
7 changed files with 299 additions and 176 deletions
  1. 5 0
      api/public.js
  2. 2 1
      main.js
  3. 15 0
      pages/index/index.vue
  4. 273 175
      pages/users/order_confirm/index.vue
  5. 0 0
      static/js/alipay.js
  6. 4 0
      static/js/dsbridge.js
  7. 0 0
      static/js/weixin.js

+ 5 - 0
api/public.js

@@ -115,4 +115,9 @@ export function getSubscribe(){
 	return request.get("subscribe", {}, {
 	return request.get("subscribe", {}, {
 		noAuth: true
 		noAuth: true
 	});
 	});
+}
+
+//发放积分
+export function advertisement(data) {
+	return request.post("advertisement",data,{noAuth: true});
 }
 }

+ 2 - 1
main.js

@@ -14,8 +14,9 @@ import Cache from './utils/cache'
 import util from 'utils/util'
 import util from 'utils/util'
 import { HTTP_REQUEST_URL } from '@/config/app';
 import { HTTP_REQUEST_URL } from '@/config/app';
 import skeleton from './components/skeleton/index.vue'
 import skeleton from './components/skeleton/index.vue'
+import dsbridge from '@/static/js/dsbridge.js'
 Vue.component('skeleton', skeleton)
 Vue.component('skeleton', skeleton)
-
+Vue.prototype.$dsbridge = dsbridge
 Vue.prototype.$util = util;
 Vue.prototype.$util = util;
 Vue.prototype.$Cache = Cache;
 Vue.prototype.$Cache = Cache;
 Vue.prototype.$eventHub = new Vue();
 Vue.prototype.$eventHub = new Vue();

+ 15 - 0
pages/index/index.vue

@@ -531,6 +531,21 @@
 			this.reconnect();
 			this.reconnect();
 		},
 		},
 		methods: {
 		methods: {
+			//观看广告领奖
+			openGg() {
+				getUserInfo().then(res => {
+					that.userInfo = res.data;
+					this.$dsbridge.call("fnAds.onShowRewardVideoAD", {}, function(result) {
+						let res = JSON.parse(result)
+						if (res.event == 'onReward') {	
+							advertisement({
+								task: '1'
+							}).then(e => {
+							}).catch(err => {})
+						}
+					});
+				});
+			},
 			navto(url) {
 			navto(url) {
 				uni.navigateTo({
 				uni.navigateTo({
 					url,
 					url,

File diff suppressed because it is too large
+ 273 - 175
pages/users/order_confirm/index.vue


File diff suppressed because it is too large
+ 0 - 0
static/js/alipay.js


+ 4 - 0
static/js/dsbridge.js

@@ -0,0 +1,4 @@
+var bridge={default:this,call:function(b,a,c){var e="";"function"==typeof a&&(c=a,a={});a={data:void 0===a?null:a};if("function"==typeof c){var g="dscb"+window.dscb++;window[g]=c;a._dscbstub=g}a=JSON.stringify(a);if(window._dsbridge)e=_dsbridge.call(b,a);else if(window._dswk||-1!=navigator.userAgent.indexOf("_dsbridge"))e=prompt("_dsbridge="+b,a);return JSON.parse(e||"{}").data},register:function(b,a,c){c=c?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout(function(){bridge.call("_dsb.dsinit")},
+0));"object"==typeof a?c._obs[b]=a:c[b]=a},registerAsyn:function(b,a){this.register(b,a,!0)},hasNativeMethod:function(b,a){return this.call("_dsb.hasNativeMethod",{name:b,type:a||"all"})},disableJavascriptDialogBlock:function(b){this.call("_dsb.disableJavascriptDialogBlock",{disable:!1!==b})}};
+!function(){if(!window._dsf){var b={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:bridge,close:function(){bridge.call("_dsb.closePage")},_handleMessageFromNative:function(a){var e=JSON.parse(a.data),b={id:a.callbackId,complete:!0},c=this._dsf[a.method],d=this._dsaf[a.method],h=function(a,c){b.data=a.apply(c,e);bridge.call("_dsb.returnValue",b)},k=function(a,c){e.push(function(a,c){b.data=a;b.complete=!1!==c;bridge.call("_dsb.returnValue",b)});a.apply(c,e)};if(c)h(c,this._dsf);else if(d)k(d,this._dsaf);
+else if(c=a.method.split("."),!(2>c.length)){a=c.pop();var c=c.join("."),d=this._dsf._obs,d=d[c]||{},f=d[a];f&&"function"==typeof f?h(f,d):(d=this._dsaf._obs,d=d[c]||{},(f=d[a])&&"function"==typeof f&&k(f,d))}}},a;for(a in b)window[a]=b[a];bridge.register("_hasJavascriptMethod",function(a,b){b=a.split(".");if(2>b.length)return!(!_dsf[b]&&!_dsaf[b]);a=b.pop();b=b.join(".");return(b=_dsf._obs[b]||_dsaf._obs[b])&&!!b[a]})}}();module.exports=bridge;

File diff suppressed because it is too large
+ 0 - 0
static/js/weixin.js


Some files were not shown because too many files changed in this diff