Browse Source

no message

feature/v1.2
xpz2018 5 years ago
parent
commit
54de434777
7 changed files with 92 additions and 7 deletions
  1. 1
      app.js
  2. 1
      app.json
  3. 14
      pages/home/index/index.wxml
  4. 44
      pages/home/setting/index.js
  5. 10
      pages/home/setting/index.json
  6. 28
      pages/home/setting/index.wxml
  7. 1
      pages/home/setting/index.wxss

1
app.js

@ -8,6 +8,7 @@ App({
//----------------------------------------------globalData--------------------------------------
globalData: {
token: null,
agenting: 1,
keyboardHeight: 0,
isIos: false
}

1
app.json

@ -9,6 +9,7 @@
"pages/home/customer-info/index",
"pages/home/authory/index",
"pages/home/qrcode/index",
"pages/home/setting/index",
"pages/process/agent-list/index",
"pages/process/check-list/index",
"pages/process/order-list/index",

14
pages/home/index/index.wxml

@ -47,7 +47,7 @@
</view>
</view> -->
<!-- 企业信息 -->
<view style="height:16rpx"></view>
<view style="height:24rpx"></view>
<van-cell-group>
<van-cell is-link clickable url="/pages/home/employee/index" wx:if="{{userInfo.enterpriseId && userInfo.position != 'ORDINARY'}}">
<view class="flex" slot="title" style="align-items: center">
@ -68,20 +68,20 @@
</view>
</van-cell> -->
</van-cell-group>
<view style="height:16rpx"></view>
<view style="height:24rpx"></view>
<van-cell-group>
<van-cell is-link clickable url="/pages/home/password/index">
<van-cell is-link clickable url="/pages/home/setting/index">
<view class="flex" slot="title" style="align-items: center">
<text class="cuIcon-lock text-black" style="font-size:36rpx"></text>
<text class="text-sg" style="margin-left:12rpx">修改密码</text>
<van-icon name="setting-o" size="18" />
<text class="text-sg" style="margin-left:12rpx">设置</text>
</view>
</van-cell>
<van-cell is-link clickable bind:click="loginOut">
<!-- <van-cell is-link clickable bind:click="loginOut">
<view class="flex" slot="title" style="align-items: center">
<van-icon name="setting-o" size="18" />
<text class="text-sg" style="margin-left:12rpx">退出当前账号</text>
</view>
</van-cell>
</van-cell> -->
</van-cell-group>
<view style="height:16rpx"></view>

44
pages/home/setting/index.js

@ -0,0 +1,44 @@
// pages/home/setting/index.js
import Dialog from '../../../components/dialog/dialog'
import util from '../../../utils/util'
import { finalizeToken } from "../../../api/user"
const event = require('../../../utils/event')
const storage = require('../../../utils/storage')
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
agenting: true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var agenting = storage.get('saas-agenting')
if(!util.isEmpty(agenting)){
app.globalData.agenting = agenting
}
this.setData({ agenting: app.globalData.agenting ? true : false })
},
settingAgent: function(){
var agenting = this.data.agenting ? 0 : 1
app.globalData.agenting = agenting
storage.put('saas-agenting', agenting)
this.setData({ agenting: agenting ? true : false })
},
loginOut: function () {
Dialog.confirm({ title: '温馨提示', message: '确定退出纸通宝账号?' }).then(() => {
storage.remove('Authorization')
app.globalData.token = null
app.userInfo = null
finalizeToken()
wx.redirectTo({ url: '/pages/login/index' })
event.emit('EventMessage', { what: 888, desc: 'Logout' })
}).catch(error => {
})
}
})

10
pages/home/setting/index.json

@ -0,0 +1,10 @@
{
"usingComponents": {
"van-cell": "/components/cell/index",
"van-cell-group": "/components/cell-group/index",
"van-info": "/components/info/index",
"van-icon": "/components/icon/index",
"van-switch": "/components/switch/index",
"van-dialog": "/components/dialog/index"
}
}

28
pages/home/setting/index.wxml

@ -0,0 +1,28 @@
<!--pages/home/setting/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content" style="color:black;font-size:18px">重置</view>
</cu-custom>
<view style="height:24rpx"></view>
<van-cell-group>
<van-cell clickable bind:click="settingAgent">
<view slot="title" class="flex flex-justify">
<view class="text-black">默认使用千鸟代付</view>
<view class="flex flex-center">
<van-switch checked="{{ agenting }}" size="22px" />
</view>
</view>
</van-cell>
<van-cell is-link clickable url="/pages/home/password/index">
<view class="flex" slot="title" style="align-items: center">
<text class="text-sg">修改密码</text>
</view>
</van-cell>
<van-cell is-link clickable bind:click="loginOut">
<view class="flex" slot="title" style="align-items: center">
<text class="text-sg">退出当前账号</text>
</view>
</van-cell>
</van-cell-group>
<van-dialog id="van-dialog" />

1
pages/home/setting/index.wxss

@ -0,0 +1 @@
/* pages/home/setting/index.wxss */
Loading…
Cancel
Save