diff --git a/src/api/classApi.js b/src/api/classApi.js
index 6ed1954..010ee78 100644
--- a/src/api/classApi.js
+++ b/src/api/classApi.js
@@ -1,19 +1,25 @@
- class API {
- constructor(url,req) {
+import $http from '@/utils/httpRequest'
+
+class API {
+ constructor(constructorData) {
const map={
- add:'POST',
- del:'DELETE',
- update:'PUT',
- get:'GET'
+ add:'post',
+ del:'post',
+ update:'post',
+ get:'get',
+ getList:'get'
}
- this.url=url
for(let key in map){
+ let url=constructorData[key].url||constructorData[key]
+ const method=constructorData[key].method||map[key]
this[key]=function(data){
- data=Array.isArray(data)?data:{...data,shopId:uni.getStorageSync('shopId')}
- if(key==='del'){
- delete data.shopId
- }
- return req(url, data,map[key])
+ console.log(data)
+ return $http({
+ url: (key=='get'?(url+'/'+data.id||data):url) +(key=='del'?'?id='+(data.id||data):''),
+ method:method,
+ params:(method=='get'&&key!='del')?data:{},
+ data: (method=='post'&&key!='del')?data:{}
+ })
}
}
}
diff --git a/src/api/invite-award.js b/src/api/invite-award.js
new file mode 100644
index 0000000..bc08a13
--- /dev/null
+++ b/src/api/invite-award.js
@@ -0,0 +1,25 @@
+import classAPi from './classApi.js'
+
+export const $inviteAwardApi = new classAPi({
+ add: {
+ url:'completAward/insertCompletAward'
+ },
+ del: {
+ url:'completAward/deleteCompletAward'
+
+ },
+ update: {
+ url:'completAward/updateCompletAward'
+
+ },
+ get: {
+ url:'completAward'
+
+ },
+ getList: {
+ url:'completAward/selectCompletAward'
+
+ }
+})
+
+
\ No newline at end of file
diff --git a/src/api/red-pack.js b/src/api/red-pack.js
new file mode 100644
index 0000000..0eaeeaa
--- /dev/null
+++ b/src/api/red-pack.js
@@ -0,0 +1,25 @@
+import classAPi from './classApi.js'
+
+export const $redPackApi = new classAPi({
+ add: {
+ url:'discSpinningAmount/insertDiscSpinningAmount'
+ },
+ del: {
+ url:'discSpinningAmount/deleteDiscSpinningAmount'
+
+ },
+ update: {
+ url:'discSpinningAmount/updateDiscSpinningAmount'
+
+ },
+ get: {
+ url:'discSpinningAmount/'
+
+ },
+ getList: {
+ url:'discSpinningAmount/selectDiscSpinningAmount'
+
+ }
+})
+
+
\ No newline at end of file
diff --git a/src/utils/validate.js b/src/utils/validate.js
index 331e8cb..1493145 100644
--- a/src/utils/validate.js
+++ b/src/utils/validate.js
@@ -29,3 +29,7 @@ export function isPhone (s) {
export function isURL (s) {
return /^http[s]?:\/\/.*/.test(s)
}
+
+export function isNull(val){
+ return val === null || val === undefined||val === '';
+}
\ No newline at end of file
diff --git a/src/views/banner/bannerList.vue b/src/views/banner/bannerList.vue
index 4acbbaa..b147ec1 100644
--- a/src/views/banner/bannerList.vue
+++ b/src/views/banner/bannerList.vue
@@ -1,902 +1,1248 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-