Commit 9df04358 by chenwq

客户管理,服务中心管理

1 parent 4d2fefec
...@@ -46,6 +46,15 @@ Page({ ...@@ -46,6 +46,15 @@ Page({
wx.$router.go('packageMine.editCustomer', params) wx.$router.go('packageMine.editCustomer', params)
}, },
onRefreshBottom() {
wx.$api.hideLoading()
this.setData({
total: -1,
['pageCof.pageNum']: 1,
})
this.getList(true)
},
handleSearch(e) { handleSearch(e) {
wx.$api.hideLoading() wx.$api.hideLoading()
this.setData({ this.setData({
......
{ {
"navigationBarTitleText": "客户管理",
"usingComponents": { "usingComponents": {
"select-service-popup": "../../../components/selectServicePopup/selectServicePopup" "select-service-popup": "../../../components/selectServicePopup/selectServicePopup"
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</view> </view>
</view> </view>
</view> </view>
<scroll-view wx:if="{{customerList.length}}" scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSearch" bindscrolltolower="getList" class="list" style="height:calc(100vh - 148rpx - 110rpx);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}"> <scroll-view wx:if="{{customerList.length}}" scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="onRefreshBottom" bindscrolltolower="getList" class="list" style="height:calc(100vh - 148rpx - 110rpx);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="item-box" wx:for="{{customerList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}"> <view class="item-box" wx:for="{{customerList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}">
<view class="top"> <view class="top">
<view class="message"> <view class="message">
......
...@@ -38,6 +38,11 @@ Page({ ...@@ -38,6 +38,11 @@ Page({
}, },
handlePopupConfirm() { handlePopupConfirm() {
let { popupVal } = this.data
if(!popupVal) {
wx.$api.showToast('请选择邀请方式')
return true
}
this.setData({ this.setData({
isPopupShow: !this.data.isPopupShow isPopupShow: !this.data.isPopupShow
}) })
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</view> </view>
</view> </view>
<!-- 邀请 --> <!-- 邀请 -->
<popup show="{{isPopupShow}}" title="请选择邀请方式" height="36%" bindconfirm="handlePopupConfirm" bindhidePopup="handlePopup"> <popup show="{{isPopupShow}}" title="请选择邀请方式" height="500rpx" bindconfirm="handlePopupConfirm" bindhidePopup="handlePopup">
<view class="popup-row {{popupVal == 'code' ? 'popup-active' : ''}}" data-val="code" bindtap="handlePopupChoose">二维码邀请</view> <view class="popup-row {{popupVal == 'code' ? 'popup-active' : ''}}" data-val="code" bindtap="handlePopupChoose">二维码邀请</view>
<view class="popup-row {{popupVal == 'link' ? 'popup-active' : ''}}" data-val="link" bindtap="handlePopupChoose">链接邀请</view> <view class="popup-row {{popupVal == 'link' ? 'popup-active' : ''}}" data-val="link" bindtap="handlePopupChoose">链接邀请</view>
</popup> </popup>
......
...@@ -20,7 +20,7 @@ const formRule = { ...@@ -20,7 +20,7 @@ const formRule = {
], ],
} }
const formItems = [{ var formItems = [{
label: '商户号', label: '商户号',
props: 'merchantId', props: 'merchantId',
type: 'input', type: 'input',
...@@ -49,8 +49,8 @@ const formItems = [{ ...@@ -49,8 +49,8 @@ const formItems = [{
tips: '(可用于PC端登录)', tips: '(可用于PC端登录)',
props: 'password', props: 'password',
type: 'input', type: 'input',
inputType: 'safe-password',
password: true, password: true,
showPwd: false,
placeholder: '请输入登录密码(6-20位字母+数字)', placeholder: '请输入登录密码(6-20位字母+数字)',
maxlength: 20 maxlength: 20
}] }]
......
...@@ -24,6 +24,21 @@ Page({ ...@@ -24,6 +24,21 @@ Page({
}) })
}, },
handlePwdSwitch(e) {
let { idx } = e.currentTarget.dataset
this.setData({
['formItems[' + idx + '].showPwd']: !this.data.formItems[idx].showPwd
})
},
// 密码清空
handlePwdClear(e) {
let { attr } = e.currentTarget.dataset
this.setData({
['formData.' + attr]: ''
})
},
handleConfirm() { handleConfirm() {
let { apiNameObj, addOrEdit, formData } = this.data let { apiNameObj, addOrEdit, formData } = this.data
let _this = this let _this = this
......
{ {
"navigationBarTitleText": "创建服务中心", "navigationBarTitleText": "创建服务中心",
"usingComponents": {} "usingComponents": {
"input-icon": "/login/index/components/InputIcon/InputIcon"
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -37,6 +37,19 @@ ...@@ -37,6 +37,19 @@
color: #323436; color: #323436;
} }
.input-box {
display: flex;
align-items: center;
}
.input {
flex: 1;
}
.input-icon-box {
display: flex;
}
.disabled { .disabled {
background: #E1E2E6; background: #E1E2E6;
} }
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
<block wx:for="{{formItems}}" wx:key="index"> <block wx:for="{{formItems}}" wx:key="index">
<view class="label">{{item.label}}<text class="tips">{{item.tips}}</text></view> <view class="label">{{item.label}}<text class="tips">{{item.tips}}</text></view>
<view class="input-box {{item.disabled ? 'disabled' : ''}}" wx:if="{{item.type == 'input'}}"> <view class="input-box {{item.disabled ? 'disabled' : ''}}" wx:if="{{item.type == 'input'}}">
<input placeholder="{{item.placeholder || '请输入' + item.label}}" maxlength="{{item.maxlength}}" class="input" value="{{formData[item.props]}}" type="{{item.inputType || 'text'}}" password="{{item.password}}" disabled="{{item.disabled}}" placeholder-class="input-placeholder" data-attr="{{item.props}}" bindinput="handleInput" /> <input placeholder="{{item.placeholder || '请输入' + item.label}}" maxlength="{{item.maxlength}}" class="input" value="{{formData[item.props]}}" password="{{item.password && !item.showPwd}}" disabled="{{item.disabled}}" placeholder-class="input-placeholder" data-attr="{{item.props}}" bindinput="handleInput" />
<view wx:if="{{item.password}}" class="input-icon-box">
<input-icon show bindtap="handlePwdSwitch" type="{{item.showPwd?'showPwd':'hidePwd'}}" data-idx="{{index}}" />
<input-icon show="{{formData.password}}" bindtap="handlePwdClear" data-attr="{{item.props}}" />
</view>
</view> </view>
<view class="select-box" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}"> <view class="select-box" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}">
<view class="name" wx:if="{{formData[item.valueFn]}}">{{formData[item.valueFn]}}</view> <view class="name" wx:if="{{formData[item.valueFn]}}">{{formData[item.valueFn]}}</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!