luyisha 3 years ago
parent
commit
9347cb1adb
  1. 12
      pages/about/bannerManage/addBanner.vue
  2. 2
      pages/about/bannerManage/bannerManage.vue
  3. 24
      pages/about/noticeManage/noticeManage.vue
  4. 1
      pages/about/serviceSet/serviceSet.vue
  5. 47
      pages/home/home.vue
  6. 4
      pages/scratchCard/scratch.js
  7. 53
      pages/scratchCard/scratchCard.vue
  8. 9
      pages/ucenter/ucenter.vue
  9. 104
      uni_modules/uni-id-pages/pages/login/login-withpwd.vue
  10. 7
      uni_modules/uni-id-pages/pages/register/register.vue
  11. 11
      uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue

12
pages/about/bannerManage/addBanner.vue

@ -9,7 +9,7 @@
<image class="swiper-item" :src="item.url"></image>
</swiper-item>
</swiper> -->
<view class="" v-if="editInfo.image">
<view class="" v-if="editInfo.image" @click="addImg">
<image class="" :src="editInfo.image"></image>
</view>
<text v-else @click="addImg">点击添加轮播图</text>
@ -51,16 +51,18 @@
uni.uploadFile({
url: API.baseUrl+'/rotationChart/upload',
filePath: tempFilePaths[0],
name: 'file',
name: 'image',
header: {
token: uni.getStorageSync('user_token')
},
formData: {
'image': tempFilePaths[0]
},
success: (uploadFileRes) => {
console.log(uploadFileRes.data);
// this.editInfo.image
let data = JSON.parse(uploadFileRes.data);
this.editInfo.image = data.data.url;
this.editInfo.img = data.data.path;//
}
});
}
@ -71,7 +73,7 @@
id: this.id||'',
title: this.editInfo.title,
sort: this.editInfo.sort,
image: this.editInfo.image
image: this.editInfo.img
};
API.request('/rotationChart/save', data, res=>{
uni.showToast({

2
pages/about/bannerManage/bannerManage.vue

@ -60,7 +60,7 @@
}
},
onLoad(e) {
onShow() {
this.getList();
},
onNavigationBarButtonTap() {

24
pages/about/noticeManage/noticeManage.vue

@ -4,8 +4,8 @@
<view class="setPage">
<view v-for="(item,index) in setList" :key="index" class="set_item">
<view style="" class="item_top">
<view class="">标题{{item.title}}</view>
<text class="text" style="font-size: 12px;">发布时间{{item.time}}</text>
<view class="box2">标题{{item.title}}</view>
<text class="text" style="font-size: 12px;">发布时间{{item.create_time}}</text>
<view class=""><text class="box3" v-html="item.content"></text></view>
</view>
<view style="" class="flex-row">
@ -69,7 +69,7 @@
}
},
onLoad(e) {
onShow() {
this.getList();
},
onNavigationBarButtonTap() {
@ -103,7 +103,7 @@
}
.set_item{
width: 670rpx;
height: 280rpx;
min-height: 280rpx;
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.11);
margin-bottom: 40rpx;
border-radius: 10px;
@ -112,21 +112,27 @@
padding: 30rpx 30rpx;
line-height: 24px;
}
.box2{
display: -webkit-box;//
-webkit-box-orient: vertical;//
-webkit-line-clamp: 1;//
overflow: hidden;
}
.text{
color: #999;
}
.box3{
font-size: 12px;
display: -webkit-box;//
-webkit-box-orient: vertical;//
-webkit-line-clamp: 1;//
overflow: hidden;
// display: -webkit-box;//
// -webkit-box-orient: vertical;//
// -webkit-line-clamp: 1;//
// overflow: hidden;
}
.flex-row{
display: flex;
align-items: center;
justify-content: space-between;
padding: 0px 110rpx;
padding: 0px 110rpx 30rpx;
}
.red{
color: #E33837;

1
pages/about/serviceSet/serviceSet.vue

@ -98,6 +98,7 @@
})
this.showEdit = false;
this.editInfo = {};
this.getList();
})
},
getList(){

47
pages/home/home.vue

@ -159,28 +159,32 @@
}
},
onShow() {
if(this.userType=='user'){
this.getAwardRecords();
updateTabBar.changeUser();
}else if(this.userType=='background'){
updateTabBar.changebackground();
}
setTimeout(()=>{
if(this.userType=='user'){
updateTabBar.changeUser();
this.getZoneList();
this.getRotationChart();
this.getAwardRecords();
this.getNotice();
}else if(this.userType=='background'){
updateTabBar.changebackground();
this.getNeedSta();
this.getUserSta();
this.getUpDownSta();
this.pieChart = echarts.init(document.getElementById('piechart'));
this.myChart = echarts.init(document.getElementById('mychart'));
setTimeout(()=>{
this.renderPie();
this.renderChart();
}, 200)
}
}, 500)
},
created() {
this.userType = uni.getStorageSync('userType');
if(this.userType=='user'){
this.getZoneList();
this.getRotationChart();
this.getAwardRecords();
this.getNotice();
}
if(this.userType=='background'){
this.getNeedSta();
this.getUserSta();
this.getUpDownSta();
}
},
mounted() {
if(this.userType=='user'){
@ -199,15 +203,6 @@
});
}
if(this.userType=='background'){
this.pieChart = echarts.init(document.getElementById('piechart'));
this.myChart = echarts.init(document.getElementById('mychart'));
setTimeout(()=>{
this.renderPie();
this.renderChart();
}, 200)
}
},
methods: {
toUrl(item){

4
pages/scratchCard/scratch.js

@ -13,12 +13,12 @@ class Scratch {
this.area = this.r * this.r
this.scale = opts.scale || 0.3
this.totalArea = this.width * this.height
// this.show = opts.show || false
this.show = false
this.init()
}
init () {
this.show = false
this.clearPoints = []
this.ctx = uni.createCanvasContext(this.canvasId)
this.drawMask()

53
pages/scratchCard/scratchCard.vue

@ -36,6 +36,7 @@
</view>
<view class="winPrize" v-if="isWin">
{{awards_amount}}
<view style="width: 300rpx;height: 90rpx;position: absolute;left: 225rpx;top: 680rpx;z-index: 4;" @click="again"></view>
<view class="close" @click="isWin = false"></view>
</view>
<view class="noPrize" v-if="isThank">
@ -96,7 +97,6 @@ export default {
prize_img: '', //
isScratching: false, // ,
isThank: false,
// show: false,
guaCanvas: null,
isShow: false,
c_r_id: '',
@ -106,9 +106,12 @@ export default {
// console.log(this.show);
},
watch: {
isShow(n){
this.showResult = true;
this.doPrizeScratchTicketFun();
isShow(n, o){
console.log(n,o);
if(n && n!=o){
this.showResult = true;
this.doPrizeScratchTicketFun();
}
}
},
onLoad(e) {
@ -117,19 +120,22 @@ export default {
// +''
})
this.id = e.id;
this.initInfo();
API.request('/zone/beginInitInfo', {zone_goods_id: this.id}, res=>{
this.ticketInfo = res.data.data;
})
let timer = setInterval(()=>{
if(this.guaCanvas && this.guaCanvas.show){
this.isShow = true;
clearInterval(timer);
}
}, 500)
},
methods: {
initInfo(){
API.request('/zone/beginInitInfo', {zone_goods_id: this.id}, res=>{
this.ticketInfo = res.data.data;
})
let timer = setInterval(()=>{
if(this.guaCanvas && this.guaCanvas.show){
this.isShow = true;
clearInterval(timer);
}
}, 500)
},
initCanvas () {
// onReadyh5onLoad
this.guaCanvas = new Scratch(this, {
@ -156,11 +162,15 @@ export default {
// this.isWin = true;
// this.isThank = true;
API.endLottery({c_r_id: this.c_r_id}, res=>{
this.awards_amount = res.data.awards_amount;
this.isWin = true;
if(res.data.awards_amount){
this.awards_amount = res.data.awards_amount;
this.isWin = true;
}else{
this.isWin = false
this.isThank = true;
}
}, fail=>{
this.isWin = false
this.isThank = true;
// this.isScratching = false
})
},
@ -171,7 +181,14 @@ export default {
},
//
again(){
this.isWin = false;
this.isThank = false;
this.toDraw = false;
this.showResult = false;
this.isScratching = false;
this.isShow = false;
this.guaCanvas.show = false;
this.initInfo();
}
},
}

9
pages/ucenter/ucenter.vue

@ -10,7 +10,7 @@
<view v-else class="defaultAvatarUrl"></view>
<view class="logo-title">
<text class="uer-name" v-if="hasLogin">ID: {{userInfo.id}}</text>
<text class="uer-name" v-if="hasLogin">ID: {{userInfo.id || userInfo.aid}}</text>
<text class="uer-name" v-else @click.capture="toUserInfo">点击登陆</text>
</view>
<view class="logo-out" @click.stop="logoOut" v-if="hasLogin">
@ -326,6 +326,8 @@
//#endif
if(uni.getStorageSync('userType')=='background'){
this.getAdminUserInfo();
}else if(uni.getStorageSync('userType')=='agent'){
this.getAgentInfo();
}else{
this.getUserInfo();
}
@ -586,6 +588,11 @@
this.userInfo = res.data.data;
})
},
getAgentInfo(){
API.request('/agentTeam/getAgentUserInfo', {}, res=>{
this.userInfo = res.data;
})
},
getAdminUserInfo(){
API.request('/adminUser/userInfo', {}, res=>{
this.userInfo = res.data.data;

104
uni_modules/uni-id-pages/pages/login/login-withpwd.vue

@ -143,11 +143,6 @@
// return this.$refs.agreements.popup(this.pwdLogin)
// }
let data = {
"password": this.password,
"phone": this.username
}
// if (/^1\d{10}$/.test(this.username)) {
// data.mobile = this.username
// } else if (/@/.test(this.username)) {
@ -155,74 +150,47 @@
// } else {
// data.username = this.username
// }
if(this.userType=='user'){
API.login(data, res=>{
console.log(res);
// this.loginSuccess()
let url = '', newUrl = '';
let data = {};
switch (this.userType){
case 'user':
url = '/passport/login';
data = {phone: this.username, password: this.password};
newUrl = '/pages/home/home';
break;
case 'agent':
url = '/passport/agentLogin';
data = {phone: this.username, password: this.password};
newUrl = '/pages/list/team';
break;
case 'background':
url = '/passport/adminLogin';
data = {account_number: this.username, password: this.password};
newUrl = '/pages/home/home';
uni.showToast({
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');
// updateTabBar.changeUser();
setTimeout(()=>{
uni.switchTab({
url:'/pages/home/home'
})
}, 1500)
})
break;
}
if(this.userType=='agent'){
API.request('/passport/agentLogin', {
phone: this.username,
password: this.password
}, res=>{
console.log(res);
uni.showToast({
title: res.msg
API.request(url, data, res=>{
uni.showToast({
title: res.msg
})
let accounts = uni.getStorageSync('accounts') || [];
accounts.push(this.username);
accounts = Array.from(new Set(accounts));
uni.setStorageSync('accounts', accounts);
uni.setStorageSync('user_token', res.data.token);
uni.setStorageSync('userType', this.userType);
setTimeout(()=>{
uni.switchTab({
url:newUrl
})
uni.setStorageSync('user_token', res.data.token);
let accounts = uni.getStorageSync('accounts') || [];
accounts.push(this.username);
uni.setStorageSync('accounts', accounts);
uni.setStorageSync('userType', 'agent');
// updateTabBar.changeAgent();
setTimeout(()=>{
uni.switchTab({
url:'/pages/list/team'
})
}, 1500)
}, fail=>{}, false)
}
}, 1500)
}, fail=>{}, false)
if(this.userType=='background'){
API.request('/passport/adminLogin', {
account_number: this.username,
password: this.password
}, res=>{
console.log(res);
uni.showToast({
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', 'background');
// updateTabBar.changebackground();
setTimeout(()=>{
uni.switchTab({
url:'/pages/home/home'
})
}, 1500)
}, fail=>{}, false)
}
// uniIdCo.login(data).then(e => {

7
uni_modules/uni-id-pages/pages/register/register.vue

@ -45,9 +45,9 @@
placeholder="密码" type="password"
v-model="formData.password" trim="both" />
</uni-forms-item>
<uni-forms-item name="password2" v-model="formData.password2" >
<uni-forms-item name="repassword" v-model="formData.repassword" >
<uni-easyinput :inputBorder="false" :focus="focusPassword2" @blur="focusPassword2 =false"
class="input-box" placeholder="确认密码" maxlength="20" type="password" v-model="formData.password2"
class="input-box" placeholder="确认密码" maxlength="20" type="password" v-model="formData.repassword"
trim="both" />
</uni-forms-item>
<!-- <uni-forms-item>
@ -85,7 +85,7 @@
username: "",
nickname: "",
password: "",
password2: "",
repassword: "",
captcha: ""
},
rules,
@ -142,6 +142,7 @@
let data = {
phone: this.formData.phone,
password: this.formData.password,
repassword: this.formData.repassword,
sms_code: this.formData.phoneCaptcha,
invite_code: this.formData.invitationCode
}

11
uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue

@ -20,9 +20,9 @@
type="password" :inputBorder="false" v-model="formData.newPassword" placeholder="修改密码">
</uni-easyinput>
</uni-forms-item>
<uni-forms-item name="newPassword2">
<uni-forms-item name="repassword">
<uni-easyinput :focus="focusNewPassword2" @blur="focusNewPassword2 = false" class="input-box"
type="password" :inputBorder="false" v-model="formData.newPassword2" placeholder="确认修改密码">
type="password" :inputBorder="false" v-model="formData.repassword" placeholder="确认修改密码">
</uni-easyinput>
</uni-forms-item>
<button class="uni-btn send-btn-box submit-btn" type="primary" @click="submit">提交</button>
@ -47,7 +47,7 @@
formData: {
'oldPassword': '',
'newPassword': '',
'newPassword2': '',
'repassword': '',
},
rules: {
newPassword: {
@ -61,7 +61,7 @@
// }
]
},
// ...passwordMod.getPwdRules('newPassword', 'newPassword2')
// ...passwordMod.getPwdRules('newPassword', 'repassword')
},
logo: "/static/logo.png"
}
@ -89,7 +89,8 @@
.then(res => {
// console.log(res);
let data = {
password: this.formData.newPassword
password: this.formData.newPassword,
repassword: this.formData.repassword
}
API.modifyPassword(data, res=>{
uni.showToast({

Loading…
Cancel
Save