diff --git a/common/js/api.js b/common/js/api.js
index 96d0573..4751318 100644
--- a/common/js/api.js
+++ b/common/js/api.js
@@ -1,9 +1,8 @@
-let baseUrl = 'http://192.168.66.221:8000'
+// let baseUrl = 'http://192.168.66.221:8000'
+let baseUrl = 'http://192.168.66.16:8084'
let API = {
- login(data, success, fail){
- API.sendRequest('post', data, '/passport/login', success, fail)
- },
+ // 注册
register(data, success, fail){
API.sendRequest('post', data, '/passport/register', success, fail)
},
@@ -11,62 +10,84 @@ let API = {
retrieve(data, success, fail){
API.sendRequest('post', data, '/passport/retrieve', success, fail)
},
+ // 登录
+ login(data, success, fail){
+ API.sendRequest('post', data, '/passport/login', success, fail)
+ },
+ // 修改密码
modifyPassword(data, success, fail){
- API.sendRequest('post', data, '/user/modifyPassword', success, fail)
+ API.sendRequest('post', data, '/user/modifyPassword', success, fail, true)
},
// 短信验证码
sendCode(data, success, fail){
- API.sendRequest('post', data, '/passport/sendCode', success, fail)
+ API.sendRequest('post', data, '/passport/sendCode', success, fail, true)
},
// 提现记录
getWithdrawal(data, success, fail){
- API.sendRequest('post', data, '/user/withdrawalRecords', success, fail)
+ API.sendRequest('post', data, '/user/withdrawalRecords', success, fail, true)
},
getRecharge(data, success, fail){
- API.sendRequest('post', data, '/user/rechargeRecords', success, fail)
+ API.sendRequest('post', data, '/user/rechargeRecords', success, fail, true)
},
// 消费记录
getConsumption(data, success, fail){
- API.sendRequest('post', data, '/user/consumptionRecords', success, fail)
+ API.sendRequest('post', data, '/user/consumptionRecords', success, fail, true)
},
// 中奖记录
getAwards(data, success, fail){
- API.sendRequest('post', data, '/user/awardsRecords', success, fail)
+ API.sendRequest('post', data, '/user/awardsRecords', success, fail, true)
},
// 首页专区
getZoneList(data, success, fail){
- API.sendRequest('post', data, '/zone/zoneList', success, fail)
+ API.sendRequest('post', data, '/index/zoneList', success, fail, false)
},
// 首页专区-专区列表
getGoodsList(data, success, fail){
- API.sendRequest('post', data, '/zone/zoneGoodsList', success, fail)
+ API.sendRequest('post', data, '/zone/zoneGoodsList', success, fail, true)
},
// 开始刮奖
beginLottery(data, success, fail){
- API.sendRequest('post', data, '/zone/beginLottery', success, fail)
+ API.sendRequest('post', data, '/zone/beginLottery', success, fail, true)
},
// 刮完奖请求
endLottery(data, success, fail){
- API.sendRequest('post', data, '/zone/endLottery', success, fail)
+ API.sendRequest('post', data, '/zone/endLottery', success, fail, true)
},
// 首页中奖纪录
getAwardRecords(data, success, fail){
- API.sendRequest('post', data, '/index/awardRecords', success, fail)
+ API.sendRequest('post', data, '/index/awardRecords', success, fail, false)
},
// 首页轮播图
getRotationChart(data, success, fail){
- API.sendRequest('post', data, '/index/rotationChart', success, fail)
+ API.sendRequest('post', data, '/index/rotationChart', success, fail, false)
},
// 通用api
- request(url, data, success, fail){
- API.sendRequest('post', data, url, success, fail)
+ request(url, data, success, fail, boolean=true){
+ API.sendRequest('post', data, url, success, fail, boolean)
},
- sendRequest(method, data, url, success, fail){
+ sendRequest(method, data, url, success, fail, boolean){
+ let types = '';
+ if (method == 'POST') {
+ types = 'application/x-www-form-urlencoded'
+ } else {
+ types = 'application/json';
+ }
+
+ let requestObj = {}
+ if(boolean){
+ requestObj.header = {
+ 'Content-Type': types,
+ 'Accept': 'application/json, text/javascript, */*; q=0.01',
+ // 'Authorization': uni.getStorageSync('user_token')||''
+ 'token': uni.getStorageSync('user_token')||''
+ }
+ }
uni.request({
url:baseUrl+url,
- data: data,
method: method,
+ data: data,
+ ...requestObj,
success(res) {
// console.log(res, '000');
// 200=成功, 400 = 失败错误返回、404 token验证失败
diff --git a/pages.json b/pages.json
index ab9a398..ea3fbf1 100644
--- a/pages.json
+++ b/pages.json
@@ -254,6 +254,73 @@
}
}
+ ,{
+ "path" : "pages/NoticeDetails/NoticeDetails",
+ "style" :
+ {
+ "navigationBarTitleText": "公告详情",
+ "enablePullDownRefresh": false
+ }
+
+ }
+ ,{
+ "path" : "pages/about/bannerManage/bannerManage",
+ "style" :
+ {
+ "navigationBarTitleText": "轮播图管理",
+ "enablePullDownRefresh": false,
+ "app-plus": {
+ "titleNView": {
+ "buttons": [
+ {
+ "text": "添加轮播 ",
+ "fontSize": "14",
+ "color": "#999"
+ }
+ ]
+ }
+ }
+ }
+
+ }
+ ,{
+ "path" : "pages/about/bannerManage/addBanner",
+ "style" :
+ {
+ "navigationBarTitleText": "添加轮播图",
+ "enablePullDownRefresh": false
+ }
+
+ }
+ ,{
+ "path" : "pages/about/noticeManage/noticeManage",
+ "style" :
+ {
+ "navigationBarTitleText": "公告设置",
+ "enablePullDownRefresh": false,
+ "app-plus": {
+ "titleNView": {
+ "buttons": [
+ {
+ "text": "添加公告 ",
+ "fontSize": "14",
+ "color": "#999"
+ }
+ ]
+ }
+ }
+ }
+
+ }
+ ,{
+ "path" : "pages/about/noticeManage/addNotice",
+ "style" :
+ {
+ "navigationBarTitleText": "添加公告",
+ "enablePullDownRefresh": false
+ }
+
+ }
],
"subPackages": [{
"root": "uni_modules/uni-feedback",
diff --git a/pages/NoticeDetails/NoticeDetails.vue b/pages/NoticeDetails/NoticeDetails.vue
new file mode 100644
index 0000000..33c93ba
--- /dev/null
+++ b/pages/NoticeDetails/NoticeDetails.vue
@@ -0,0 +1,79 @@
+
+
+
+
+ {{title}}
+ {{create_time}}
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/about/about.vue b/pages/about/about.vue
index 1db3c9f..ac6fa0e 100644
--- a/pages/about/about.vue
+++ b/pages/about/about.vue
@@ -44,6 +44,18 @@
"to": '/pages/about/serviceSet/serviceSet',
"icon": "compose",
"iconN": "manager"
+ },
+ {
+ "title": '轮播图管理',
+ "to": '/pages/about/bannerManage/bannerManage',
+ "icon": "compose",
+ "iconN": "window"
+ },
+ {
+ "title": '公告管理',
+ "to": '/pages/about/noticeManage/noticeManage',
+ "icon": "compose",
+ "iconN": "flag"
}
]
]
diff --git a/pages/about/bannerManage/addBanner.vue b/pages/about/bannerManage/addBanner.vue
new file mode 100644
index 0000000..8f85da7
--- /dev/null
+++ b/pages/about/bannerManage/addBanner.vue
@@ -0,0 +1,165 @@
+
+
+
+
+
+
+
+
+
+
+ 点击添加轮播图
+
+
+
+ 名称:
+
+
+
+ 排序:
+
+
+
+
+ 确定发布
+
+
+
+
+
+
+
+
+
diff --git a/pages/about/bannerManage/bannerManage.vue b/pages/about/bannerManage/bannerManage.vue
new file mode 100644
index 0000000..a97914b
--- /dev/null
+++ b/pages/about/bannerManage/bannerManage.vue
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+ 轮播名称:{{item.title}}
+ 排序:{{item.sort}}%
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
diff --git a/pages/about/bonusSet/index.vue b/pages/about/bonusSet/index.vue
index 5b0564c..4f52eb2 100644
--- a/pages/about/bonusSet/index.vue
+++ b/pages/about/bonusSet/index.vue
@@ -57,7 +57,7 @@
}else{
this.bonusList = res.data;
}
- })
+ }, fail=>{}, false)
}
},
onLoad(e) {
diff --git a/pages/about/noticeManage/addNotice.vue b/pages/about/noticeManage/addNotice.vue
new file mode 100644
index 0000000..3248fa0
--- /dev/null
+++ b/pages/about/noticeManage/addNotice.vue
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+ 标题:
+
+
+
+
+ 描述内容:
+
+
+
+
+ 确定发布
+
+
+
+
+
+
+
+
+
diff --git a/pages/about/noticeManage/noticeManage.vue b/pages/about/noticeManage/noticeManage.vue
new file mode 100644
index 0000000..975b494
--- /dev/null
+++ b/pages/about/noticeManage/noticeManage.vue
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+ 标题:{{item.title}}
+ 发布时间:{{item.time}}
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
diff --git a/pages/home/home.vue b/pages/home/home.vue
index 5e8859a..0fe6437 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -18,8 +18,9 @@
-
- 公告:关于中奖概率调整问题
+
+ 公告:
+ {{notice.title}}
@@ -146,6 +147,9 @@
"sum_value": "20.00" ,//总数据,
xData: ['1月', '2月', '3月', '4月', '5月'],
data: [155, 250, 360, 100, 180, 204]
+ },
+ notice: {
+ title: '公告公告公告公告公告公告公告公告公告公告公告公告公告公告公告公告'
}
}
},
@@ -155,7 +159,9 @@
}
},
onShow() {
- this.getAwardRecords();
+ if(this.userType=='user'){
+ this.getAwardRecords();
+ }
},
created() {
@@ -164,6 +170,8 @@
if(this.userType=='user'){
this.getZoneList();
this.getRotationChart();
+ this.getAwardRecords();
+ this.getNotice();
}
if(this.userType=='background'){
this.getNeedSta();
@@ -204,8 +212,10 @@
uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
})
- }else if(item=='login'){
-
+ }else if(item=='notice'){
+ uni.navigateTo({
+ url: '/pages/NoticeDetails/NoticeDetails?id='+this.notice.id
+ })
}else if(item=='login'){
}else{
@@ -372,12 +382,18 @@
return item.value;
})
})
- }
-
+ },
+ /**/
+ getNotice(){
+ API.request('/index/getNotice', {}, res=>{
+ this.notice = res.data;
+ }, fail=>{}, false)
+ },
},
onReachBottom() {
- if(!this.nomore){
+ console.log(111);
+ if(this.userType=='user' && !this.nomore){
this.page++;
this.getAwardRecords(this.page, 10);
}
@@ -474,6 +490,18 @@
overflow: hidden;
}
}
+ .notice{
+ color: #101010;
+ font-size: 14px;line-height: 14px;margin-bottom: 30rpx;
+ display: -webkit-box;//将盒子转换为弹性盒子
+ -webkit-box-orient: vertical;//文本显示方式,默认水平
+ -webkit-line-clamp: 1;//设置显示多少行
+ overflow: hidden;
+
+ .notice_t{
+ color: #b0b0b0;
+ }
+ }
.goods_area{
flex-wrap: wrap;
justify-content: space-between;
diff --git a/static/user/icon_flag.png b/static/user/icon_flag.png
new file mode 100644
index 0000000..09930ff
Binary files /dev/null and b/static/user/icon_flag.png differ
diff --git a/static/user/icon_window.png b/static/user/icon_window.png
new file mode 100644
index 0000000..540cd44
Binary files /dev/null and b/static/user/icon_window.png differ
diff --git a/uni_modules/uni-id-pages/pages/login/login-withpwd.vue b/uni_modules/uni-id-pages/pages/login/login-withpwd.vue
index 63f9cd1..4a77ad6 100644
--- a/uni_modules/uni-id-pages/pages/login/login-withpwd.vue
+++ b/uni_modules/uni-id-pages/pages/login/login-withpwd.vue
@@ -60,7 +60,7 @@
data() {
return {
"password": "",
- "username": "",
+ "username": uni.getStorageSync('accounts')[0] || '',
"captcha": "",
"needCaptcha": false,
"focusUsername": false,
@@ -166,6 +166,9 @@
title: res.msg
})
uni.setStorageSync('user_token', res.data.token);
+ let accounts = uni.getStorageSync('accounts') || [];
+ accounts.push(this.username);
+ uni.setStorageSync('accounts', accounts);
uni.setStorageSync('userType', 'user');
setTimeout(()=>{
uni.switchTab({
@@ -192,7 +195,7 @@
url:'/pages/home/home'
})
}, 1500)
- })
+ }, fail=>{}, false)
}
if(this.userType=='background'){
@@ -212,7 +215,7 @@
url:'/pages/home/home'
})
}, 1500)
- })
+ }, fail=>{}, false)
}