nosms.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. <template>
  2. <view class="container mine clearfix">
  3. <!-- <cu-custom :navbar-data='nvabarData' @navigateBack="hanldNavigateBack"></cu-custom> -->
  4. <view class="tui-header-box first"
  5. :style="{ height: isCmcustomClass == 'fiexd' ? CustomBar + 10 + 'px' : CustomBar + 30 + 'px' }"
  6. :class="isCmcustomClass">
  7. <view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 30 + 'px' }"></view>
  8. <view class="header-sit"> <text>无短信收款</text> </view>
  9. </view>
  10. <view class="tui-header-box"
  11. :style="{ height: CustomBar + 30 + 'px', backgroundImage: 'url(https://static.caimei365.com/app/crm/image/statistic_bg1.png)' }">
  12. </view>
  13. <view class="distinguish-section" :style="{ top: CustomBar + 'px', left: 0 + 'px' }">
  14. <view class="distinguish-section-conten">
  15. <view class="section-top">
  16. <view class="title" @click.stop="this.$api.navigateBack(1)"> <text class="iconfont icon-fanhui"></text> </view>
  17. <view class="button" @click="toNoSms('/pages/collection/list')"> <text
  18. class="iconfont icon-wodedingdan"></text> 收款列表 </view>
  19. </view>
  20. <view class="section-rows">
  21. <view class="rows-label">款项类型:</view>
  22. <view class="rows-mains">
  23. <picker @change="bindPickerChange(1, $event)" :value="index" :range="paymentActions"
  24. range-key="name">
  25. <input class="input" type="text" disabled="true" v-model="paymentTypeText" value=""
  26. placeholder="请选择款项类型" />
  27. </picker>
  28. </view>
  29. <text class="iconfont icon-xiayibu"></text>
  30. </view>
  31. <view class="section-rows">
  32. <view class="rows-label">收款时间:</view>
  33. <view class="rows-mains">
  34. <input class="input" type="text" v-model="params.time" disabled="true" placeholder="请选择收款时间"
  35. @click="showTuiDateTime" />
  36. </view>
  37. <text class="iconfont icon-xiayibu"></text>
  38. </view>
  39. <view class="section-rows">
  40. <view class="rows-label">收款类型:</view>
  41. <view class="rows-mains">
  42. <picker @change="bindPickerChange(2, $event)" :value="index" :range="banksActions"
  43. range-key="name">
  44. <input class="input" type="text" disabled="true" v-model="banksTypeText"
  45. placeholder="请选择收款类型" />
  46. </picker>
  47. </view>
  48. <text class="iconfont icon-xiayibu"></text>
  49. </view>
  50. <view class="section-rows">
  51. <view class="rows-label">收款金额:</view>
  52. <view class="rows-mains">
  53. <input class="input" v-model="params.amount" @blur="changeNumber($event)" type="number"
  54. placeholder="请输入收款金额" />
  55. </view>
  56. </view>
  57. <view class="section-rows" :class="isCheckedCharge ? '' : 'disabled'">
  58. <view class="rows-label">
  59. <text class="iconfont" :class="isCheckedCharge ? 'icon-yixuanze' : 'icon-weixuanze'"
  60. @click="checkedCharge"></text>
  61. 手续费:
  62. </view>
  63. <view class="rows-mains">
  64. <input class="input" v-model="params.chargeValue" :disabled="!isCheckedCharge" type="text"
  65. placeholder="请输入手续费" />
  66. </view>
  67. </view>
  68. <view class="section-text">收款短信(备注,必填)</view>
  69. <view class="section-textarea">
  70. <textarea class="textarea" :disabled="modal" placeholder="请输入收款备注..." v-model="params.remarks" />
  71. </view>
  72. </view>
  73. <view class="distinguish-button">
  74. <view class="button" @click="confirmDistinguish">收款</view>
  75. </view>
  76. </view>
  77. <!-- 时间组件 -->
  78. <tui-datetime ref="dateTime" :type="7" :startYear="startYear" :endYear="endYear" cancelColor="#555555"
  79. color="#4688fa" @confirm="bindStartDateChange"></tui-datetime>
  80. <!-- 弹窗提示 -->
  81. <tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :title="contentModalTitle"
  82. :content="contentModalText" :button="modalButton" color="#333" :size="32" shape="circle"
  83. :maskClosable="false">
  84. </tui-modal>
  85. </view>
  86. </template>
  87. <script>
  88. import statistic_bg2 from '@/static/temp/statistic_bg2.png'
  89. import statistic_bg1 from '@/static/temp/statistic_bg1.png'
  90. import wxLogin from '@/services/wxLogin.js'
  91. import {
  92. mapState,
  93. mapMutations
  94. } from 'vuex'
  95. export default {
  96. data() {
  97. return {
  98. nvabarData: {
  99. //顶部自定义导航
  100. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  101. showSearch: 0,
  102. title: '', // 导航栏 中间的标题
  103. haveBack: false,
  104. home: false,
  105. textLeft: this.$store.state.isIphone,
  106. bgColor: '#D33020',
  107. textColor: '#ffffff'
  108. },
  109. type: 7,
  110. setDateTime: '',
  111. startYear: 1980,
  112. endYear: 2030,
  113. modalButton: [{
  114. text: '取消',
  115. type: 'gray',
  116. plain: true //是否空心
  117. },
  118. {
  119. text: '确认',
  120. customStyle: {
  121. color: '#fff',
  122. bgColor: '#4688fa'
  123. },
  124. plain: false
  125. }
  126. ],
  127. paymentActions: [{
  128. name: '普通款项',
  129. value: 1
  130. },
  131. {
  132. name: '返佣款项',
  133. value: 2
  134. },
  135. {
  136. name: '供应商退款',
  137. value: 3
  138. }
  139. ],
  140. banksActions: [{
  141. name: '建设银行-7297',
  142. value: 1
  143. },
  144. {
  145. name: '广发银行-0115',
  146. value: 2
  147. },
  148. {
  149. name: '中信银行-7172',
  150. value: 3
  151. },
  152. {
  153. name: '中信银行-0897',
  154. value: 4
  155. },
  156. {
  157. name: '中信银行0897-财付通',
  158. value: 5
  159. },
  160. {
  161. name: '中信银行0897-支付宝',
  162. value: 6
  163. },
  164. {
  165. name: '支付宝',
  166. value: 7
  167. },
  168. {
  169. name: '微信支付',
  170. value: 8
  171. },
  172. {
  173. name: '快钱支付',
  174. value: 9
  175. }
  176. ],
  177. paymentTypeText: '普通款项', // 款项类型显示文案
  178. banksTypeText: '建设银行-7297', // 款项类型显示文案
  179. params: {
  180. type: 1,
  181. banksType: 1,
  182. amount: '',
  183. chargeValue: '',
  184. remarks: '',
  185. time: this.$api.getNowFormatDate()
  186. },
  187. infoData: {},
  188. isCmcustomClass: 'left',
  189. statistic_bg: statistic_bg2,
  190. statistic_bg1: statistic_bg1,
  191. CustomBar: this.CustomBar, // 顶部导航栏高度
  192. height: 64, //header高度
  193. top: 0, //标题图标距离顶部距离
  194. scrollH: 0, //滚动总高度
  195. opcity: 1,
  196. isCheckedCharge: false,
  197. contentModalTitle: '',
  198. contentModalText: '', //操作文字提示语句
  199. modal: false,
  200. }
  201. },
  202. onLoad() {
  203. let obj = {}
  204. // #ifdef MP-WEIXIN
  205. obj = wx.getMenuButtonBoundingClientRect()
  206. // #endif
  207. // #ifdef MP-BAIDU
  208. obj = swan.getMenuButtonBoundingClientRect()
  209. // #endif
  210. // #ifdef MP-ALIPAY
  211. my.hideAddToDesktopMenu()
  212. // #endif
  213. uni.getSystemInfo({
  214. success: res => {
  215. this.width = obj.left || res.windowWidth
  216. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  217. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  218. this.scrollH = res.windowWidth * 0.6
  219. }
  220. })
  221. },
  222. filters: {
  223. NumFormat: function(text) {
  224. //处理金额
  225. return Number(text).toFixed(2)
  226. }
  227. },
  228. computed: {
  229. ...mapState(['hasLogin', 'userInfo'])
  230. },
  231. methods: {
  232. bindPickerChange(type, e) {
  233. // 选择选项
  234. switch (type) {
  235. case 1:
  236. this.paymentTypeText = this.paymentActions[e.target.value].name
  237. this.params.type = this.paymentActions[e.target.value].value
  238. console.log('款项类型', this.paymentTypeText)
  239. console.log('款项类型', this.params.type)
  240. break
  241. case 2:
  242. this.banksTypeText = this.banksActions[e.target.value].name
  243. this.params.banksType = this.banksActions[e.target.value].value
  244. console.log('收款类型', this.params.banksType)
  245. break
  246. }
  247. },
  248. showTuiDateTime() {
  249. this.$refs.dateTime.show()
  250. },
  251. bindStartDateChange(event) {
  252. //开始时间
  253. console.log('开始时间==>', event.result)
  254. this.params.time = event.result
  255. },
  256. confirmDistinguish() {
  257. if (this.params.amount == '') {
  258. this.$util.msg('请输入收款金额', 2000)
  259. return
  260. }
  261. if (this.isCheckedCharge) {
  262. if (this.params.chargeValue == '') {
  263. this.$util.msg('请输入手续费', 2000)
  264. return
  265. }
  266. }
  267. if (this.params.remarks == '') {
  268. this.$util.msg('请填写收款备注', 2000)
  269. return
  270. }
  271. if (this.params.type == 1) {
  272. this.contentModalTitle = '确定收款吗?'
  273. this.contentModalText = '确认前请仔细检查各项数据是否正确,确认收款后将不能进行修改。' //操作文字提示语句
  274. } else if (this.params.type == 2) {
  275. this.contentModalTitle = ''
  276. this.contentModalText = '确定返佣收款吗?' //操作文字提示语句
  277. } else if (this.params.type == 3) {
  278. this.contentModalTitle = ''
  279. this.contentModalText = '确定供应商退款吗?' //操作文字提示语句
  280. }
  281. this.modal = true
  282. console.log('收款')
  283. },
  284. handleClick(e) {
  285. // 确认收款
  286. if (e.index == 1) {
  287. this.$api.navigateTo('/pages/collection/detail')
  288. }
  289. this.modal = false
  290. },
  291. hideMobel() {
  292. this.modal = false
  293. },
  294. checkedCharge() {
  295. // 勾选手续费
  296. this.isCheckedCharge = !this.isCheckedCharge
  297. },
  298. changeNumber(e) {
  299. // 校验输入为数字
  300. if (!this.$api.isNumber(e.detail.value)) {
  301. this.params.amount = ''
  302. } else {
  303. this.params.amount = e.detail.value
  304. }
  305. },
  306. toNoSms(url){
  307. this.$api.navigateTo(url)
  308. },
  309. navBack() {
  310. uni.navigateBack({
  311. delta: 1
  312. })
  313. }
  314. },
  315. onPageScroll(e) {
  316. //实时获取到滚动的值
  317. if (e.scrollTop > 30) {
  318. this.isCmcustomClass = 'fiexd'
  319. } else {
  320. this.isCmcustomClass = 'left'
  321. }
  322. },
  323. onPullDownRefresh() {
  324. setTimeout(() => {
  325. // this.initSsoMemberCollectionList()
  326. uni.stopPullDownRefresh()
  327. }, 200)
  328. },
  329. onShow() {
  330. if (this.hasLogin) {
  331. this.GetDataInfo()
  332. }
  333. }
  334. }
  335. </script>
  336. <style lang="scss">
  337. @import '@/uni.scss';
  338. page {
  339. background: #fff;
  340. }
  341. .tui-header-box {
  342. width: 100%;
  343. background: #ffffff;
  344. z-index: 999;
  345. background-size: cover;
  346. &.fiexd {
  347. position: fixed;
  348. top: 0;
  349. left: 0;
  350. background: #4688fa;
  351. border-radius: 0 0 20rpx 20rpx;
  352. }
  353. &.first {
  354. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  355. }
  356. }
  357. .header-top {
  358. width: 100%;
  359. font-size: 16px;
  360. font-weight: 500;
  361. height: 32px;
  362. display: flex;
  363. align-items: center;
  364. justify-content: center;
  365. position: relative;
  366. padding: 0 40rpx;
  367. }
  368. .header-sit {
  369. width: 400rpx;
  370. height: 80rpx;
  371. line-height: 80rpx;
  372. box-sizing: border-box;
  373. padding-left: 40rpx;
  374. text-align: left;
  375. font-size: $font-size-40;
  376. color: #ffffff;
  377. font-weight: 600;
  378. font-family: '正楷';
  379. }
  380. .mine {
  381. width: 100%;
  382. height: 100%;
  383. position: relative;
  384. }
  385. .distinguish-section {
  386. width: 100%;
  387. position: absolute;
  388. padding: 40rpx 20rpx;
  389. box-sizing: border-box;
  390. }
  391. .distinguish-section-conten {
  392. width: 100%;
  393. height: auto;
  394. position: relative;
  395. background-color: #ffffff;
  396. border-radius: 20rpx;
  397. padding: 20rpx;
  398. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  399. .section-top {
  400. width: 100%;
  401. height: 106rpx;
  402. box-sizing: border-box;
  403. padding: 20rpx 0;
  404. .title {
  405. float: left;
  406. width: 66rpx;
  407. line-height: 66rpx;
  408. color: #333333;
  409. text-align: left;
  410. .iconfont {
  411. color: #666666;
  412. font-size: $font-size-40;
  413. }
  414. }
  415. .button {
  416. float: right;
  417. box-sizing: border-box;
  418. padding: 0 24rpx;
  419. height: 100%;
  420. line-height: 66rpx;
  421. background: $btn-confirm;
  422. border-radius: 8rpx;
  423. text-align: center;
  424. color: #ffffff;
  425. }
  426. }
  427. .section-rows {
  428. width: 100%;
  429. height: 80rpx;
  430. box-sizing: border-box;
  431. padding: 0 20rpx;
  432. border-radius: 8rpx;
  433. background: #f8f8f8;
  434. margin-bottom: 20rpx;
  435. line-height: 80rpx;
  436. display: flex;
  437. position: relative;
  438. &.disabled {
  439. background: #e1e1e1;
  440. }
  441. .rows-label {
  442. flex: 3;
  443. .iconfont {
  444. margin-right: 8rpx;
  445. &.icon-yixuanze {
  446. color: $color-system;
  447. }
  448. }
  449. }
  450. .rows-mains {
  451. flex: 7;
  452. .input {
  453. width: 100%;
  454. height: 80rpx;
  455. box-sizing: border-box;
  456. padding-right: 40rpx;
  457. text-align: left;
  458. font-size: $font-size-28;
  459. color: #333333;
  460. }
  461. }
  462. .icon-xiayibu {
  463. display: block;
  464. width: 40rpx;
  465. height: 80rpx;
  466. position: absolute;
  467. right: 0;
  468. text-align: center;
  469. font-size: $font-size-32;
  470. }
  471. }
  472. .section-text {
  473. width: 100%;
  474. height: 66rpx;
  475. line-height: 66rpx;
  476. font-size: $font-size-24;
  477. color: #333333;
  478. }
  479. .section-textarea {
  480. width: 100%;
  481. height: 200rpx;
  482. box-sizing: border-box;
  483. padding: 20rpx;
  484. background: #f7f7f7;
  485. border-radius: 8rpx;
  486. .textarea {
  487. width: 100%;
  488. height: 100%;
  489. }
  490. }
  491. }
  492. .distinguish-button {
  493. width: 100%;
  494. height: 80rpx;
  495. margin-top: 100rpx;
  496. box-sizing: border-box;
  497. padding: 0 50rpx;
  498. .button {
  499. width: 100%;
  500. height: 80rpx;
  501. background: $btn-confirm;
  502. border-radius: 40rpx;
  503. text-align: center;
  504. color: #ffffff;
  505. line-height: 80rpx;
  506. font-size: $font-size-28;
  507. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  508. }
  509. }
  510. .uni-badge--small {
  511. -webkit-transform: scale(0.8);
  512. -ms-transform: scale(0.8);
  513. transform: scale(0.8);
  514. -webkit-transform-origin: center center;
  515. -ms-transform-origin: center center;
  516. transform-origin: center center;
  517. }
  518. .uni-badge {
  519. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  520. -webkit-box-sizing: border-box;
  521. box-sizing: border-box;
  522. font-size: 12px;
  523. line-height: 1;
  524. display: inline-block;
  525. padding: 3px 6px;
  526. color: #333;
  527. border-radius: 100px;
  528. background-color: #f1f1f1;
  529. }
  530. .uni-badge-error {
  531. color: #fff;
  532. background-color: #dd524d;
  533. }
  534. </style>