distribution.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. <template>
  2. <view class="content">
  3. <view class="align-center justify-center">
  4. <text class="fs32">恭喜成为推广大使!</text>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import {getFindById,updateByI,bindPromoter} from '@/api/companyUser.js'
  10. import {getDictByKey} from '@/api/common.js'
  11. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  12. export default {
  13. mixins: [MescrollMixin],
  14. data() {
  15. return {
  16. time:this.utils.timeFormat(new Date(),'yyyy-mm-dd'),
  17. type:null,
  18. showType:1,
  19. mescroll:null,
  20. tags:[
  21. // {id:0,name:'未完成'},
  22. // {id:1,name:'进行中'},
  23. // {id:2,name:'已完成'},
  24. ],
  25. // 上拉加载的配置
  26. upOption: {
  27. onScroll:true,
  28. use: true, // 是否启用上拉加载; 默认true
  29. page: {
  30. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  31. size: 10 // 每页数据的数量,默认10
  32. },
  33. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  34. empty: {
  35. icon:'/static/images/no_data.png',
  36. tip: '暂无数据'
  37. }
  38. },
  39. form:{
  40. },
  41. userCode:null
  42. }
  43. },
  44. onLoad(options) {
  45. this.userCode= options.scene
  46. this.getBindPromoter()
  47. },
  48. methods: {
  49. navgetTo(url){
  50. uni.navigateTo({
  51. url:url
  52. })
  53. },
  54. getBindPromoter(){
  55. var data = {
  56. userCode:this.userCode
  57. };
  58. bindPromoter(data).then(
  59. res => {
  60. if (res.code == 200) {
  61. uni.showToast({
  62. icon:'success',
  63. title: "成为推广大使成功!",
  64. });
  65. // this.tuiModalControl = false
  66. } else {
  67. uni.showToast({
  68. icon: 'none',
  69. title: res.msg,
  70. });
  71. }
  72. },
  73. rej => {}
  74. );
  75. },
  76. bindDateChange: function(e) {
  77. this.form.dueDate= e.target.value
  78. },
  79. bindTimeChange: function(e) {
  80. this.form.completeTime = e.target.value
  81. },
  82. bindStatusChange: function(e,list) {
  83. this.form.status = list[e.target.value].dictValue
  84. this.form.statusText=list[e.target.value].dictLabel
  85. },
  86. getDictByKey(){
  87. var data={key:'todo_item_status'}
  88. getDictByKey(data).then(
  89. res => {
  90. if(res.code==200){
  91. this.tags=res.data;
  92. }
  93. },
  94. err => {
  95. }
  96. );
  97. },
  98. getInfo(){
  99. var data={id:this.recordId};
  100. getFindById(data).then(
  101. res => {
  102. if(res.code==200){
  103. this.form=res.data;
  104. // this.form.completeTime=this.form.completeTime.slice(0,5)
  105. }else{
  106. uni.showToast({
  107. title: res.msg,
  108. });
  109. }
  110. },
  111. rej => {}
  112. );
  113. },
  114. submit(){
  115. if(this.form.status==null){
  116. uni.showToast({
  117. icon:'none',
  118. title: "请选择状态",
  119. });
  120. return;
  121. }
  122. // if(this.form.recordTime==null){
  123. // uni.showToast({
  124. // icon:'none',
  125. // title: "记录时间不能为空",
  126. // });
  127. // return;
  128. // }
  129. // if(this.form.mealDescription==null){
  130. // uni.showToast({
  131. // icon:'none',
  132. // title: "用餐情况不能为空",
  133. // });
  134. // return;
  135. // }
  136. if(this.type=="add"){
  137. this.addRecord()
  138. }
  139. else if(this.type=="edit"){
  140. this.updateById()
  141. }
  142. },
  143. updateById(){
  144. updateById(this.form).then(
  145. res => {
  146. if(res.code==200){
  147. uni.showToast({
  148. icon:'success',
  149. title: "操作成功",
  150. });
  151. setTimeout(function() {
  152. uni.$emit('refreshToDoList');
  153. uni.navigateBack({
  154. delta: 1
  155. })
  156. }, 500);
  157. }else{
  158. uni.showToast({
  159. icon:'none',
  160. title: res.msg,
  161. });
  162. }
  163. },
  164. rej => {}
  165. );
  166. },
  167. addRecord(){
  168. addRecord(this.form).then(
  169. res => {
  170. if(res.code==200){
  171. uni.showToast({
  172. icon:'success',
  173. title: "操作成功",
  174. });
  175. setTimeout(function() {
  176. uni.$emit('refreshToDoList');
  177. uni.navigateBack({
  178. delta: 1
  179. })
  180. }, 500);
  181. }else{
  182. uni.showToast({
  183. icon:'none',
  184. title: res.msg,
  185. });
  186. }
  187. },
  188. rej => {}
  189. );
  190. },
  191. }
  192. }
  193. </script>
  194. <style lang="scss" scoped>
  195. @mixin u-flex($flexD, $alignI, $justifyC) {
  196. display: flex;
  197. flex-direction: $flexD;
  198. align-items: $alignI;
  199. justify-content: $justifyC;
  200. }
  201. .flex-bt {
  202. @include u-flex(row, center, space-between);
  203. }
  204. .default {
  205. font-weight: 400;
  206. font-size: 28rpx;
  207. color: #999999;
  208. }
  209. .content{
  210. padding: 20upx;
  211. .datebox {
  212. padding: 0 30rpx;
  213. margin-bottom: 20rpx;
  214. background: #FFFFFF;
  215. border-radius: 16rpx 16rpx 16rpx 16rpx;
  216. .form-item{
  217. padding: 30upx 0;
  218. display: flex;
  219. align-items: flex-start;
  220. border-bottom: 1px solid #F1F1F1;
  221. &:last-child{
  222. border-bottom: none;
  223. }
  224. .label{
  225. flex:1;
  226. font-family: PingFang SC, PingFang SC;
  227. font-weight: 500;
  228. font-size: 32rpx;
  229. color: #222426;
  230. line-height: 34rpx;
  231. text-align: left;
  232. }
  233. input{
  234. text-align: right;
  235. }
  236. .form-input{
  237. font-size: 30upx;
  238. font-family: PingFang SC;
  239. font-weight: 500;
  240. color: #999999;
  241. text-align: right;
  242. }
  243. .form-textarea{
  244. font-size: 30upx;
  245. color: #999999;
  246. height: 100upx;
  247. padding: 4upx 0;
  248. }
  249. .birth-picker {
  250. flex: 1;
  251. display: flex;
  252. align-items: center;
  253. .right-box{
  254. width: 100%;
  255. display: flex;
  256. align-items: center;
  257. .input-box{
  258. // width: 470upx;
  259. }
  260. .arrow{
  261. width: 13upx;
  262. height: 23upx;
  263. margin-left: 20upx;
  264. }
  265. }
  266. }
  267. }
  268. }
  269. .datebox2{
  270. background: #FFFFFF;
  271. padding:30rpx;
  272. border-radius: 16rpx 16rpx 16rpx 16rpx;
  273. .textinput{
  274. margin-top: 30rpx;
  275. height:200rpx;
  276. overflow-y: scroll;
  277. }
  278. }
  279. .top-fixed{
  280. width: 100%;
  281. position: fixed;
  282. top: 0;
  283. left: 0;
  284. z-index: 10;
  285. }
  286. .pub-tab-box{
  287. box-sizing: border-box;
  288. width: 100%;
  289. padding: 0 40upx;
  290. background-color: #FFFFFF;
  291. .tab-inner{
  292. height: 88upx;
  293. line-height: 88upx;
  294. display: flex;
  295. align-items: center;
  296. justify-content: space-between;
  297. overflow-x: auto;
  298. }
  299. .item{
  300. flex:1;
  301. font-size: 28upx;
  302. white-space: nowrap;
  303. line-height: 1;
  304. font-family: PingFang SC;
  305. font-weight: 500;
  306. color: #626468;
  307. // margin-right: 60upx;
  308. display: flex;
  309. align-items: center;
  310. justify-content: center;
  311. &:last-child{
  312. margin-right: 0;
  313. }
  314. &.active{
  315. font-weight: bold;
  316. color:#008FD3;
  317. &::after {
  318. content: "";
  319. width: 48rpx;
  320. height: 8rpx;
  321. background: linear-gradient(120deg, #31A1FE 0%, #008FD3 100%);
  322. position: absolute;
  323. bottom: 0;
  324. border-radius: 6upx 6upx 0upx 0;
  325. }
  326. }
  327. .text{
  328. position: relative;
  329. z-index: 1;
  330. }
  331. .tab-bg{
  332. width: 72upx;
  333. height: 28upx;
  334. position: absolute;
  335. top: 17upx;
  336. left: 50%;
  337. transform: translateX(-36upx);
  338. z-index: -1;
  339. }
  340. }
  341. }
  342. .btn-box{
  343. z-index: 9999;
  344. width: 100%;
  345. padding: 30upx;
  346. // position: fixed;
  347. bottom: 0;
  348. left: 0;
  349. box-sizing: border-box;
  350. // background: #FFFFFF;
  351. display: flex;
  352. align-items: center;
  353. justify-content: space-between;
  354. padding-bottom: 40rpx;
  355. .sub-btn{
  356. flex:1;
  357. // width: 100%;
  358. height: 88upx;
  359. line-height: 88upx;
  360. text-align: center;
  361. font-size: 32upx;
  362. font-family: PingFang SC;
  363. font-weight: bold;
  364. color: #FFFFFF;
  365. background: #008FD3;
  366. border-radius: 44upx;
  367. display: flex;
  368. align-items: center;
  369. border: 2rpx solid #008FD3;
  370. justify-content: center;
  371. image{
  372. margin-right: 16rpx;
  373. }
  374. }
  375. .sub-btn2{
  376. flex:1;
  377. height: 88upx;
  378. line-height: 88upx;
  379. text-align: center;
  380. font-size: 32rpx;
  381. color: #008FD3;
  382. font-family: PingFang SC;
  383. font-weight: bold;
  384. background: #FFFFFF;
  385. border-radius: 44rpx 44rpx 44rpx 44rpx;
  386. border: 2rpx solid #008FD3;
  387. margin-right: 20rpx;
  388. }
  389. }
  390. .phone-list{
  391. // padding: 30rpx;
  392. .item{
  393. display: flex;
  394. align-items: center;
  395. justify-content: space-between;
  396. background: #FFFFFF;
  397. border-radius: 16rpx 16rpx 16rpx 16rpx;
  398. // border-bottom: 1rpx solid #ECECEC;
  399. padding: 20rpx;
  400. margin-bottom: 20rpx;
  401. &:last-child{
  402. margin-bottom: 0;
  403. }
  404. .phone-name{
  405. display: flex;
  406. flex-direction: column;
  407. align-items: flex-start;
  408. // justify-content: flex-start;
  409. // padding-left: 24rpx;
  410. flex: 1;
  411. .name{
  412. font-family: PingFang SC, PingFang SC;
  413. font-weight: 500;
  414. font-size: 32rpx;
  415. color: #222426;
  416. text-align: left;
  417. }
  418. .type{
  419. font-family: PingFang SC;
  420. font-weight: 400;
  421. font-size: 28rpx;
  422. color: #626468;
  423. text-align: right;
  424. }
  425. .time{
  426. font-family: PingFang SC;
  427. font-weight: 400;
  428. font-size: 24rpx;
  429. color: #898E91;
  430. text-align: left;
  431. margin-top: 14rpx;
  432. }
  433. }
  434. }
  435. }
  436. .sms-list{
  437. .item{
  438. padding: 30rpx;
  439. background: #FFFFFF;
  440. border-radius: 16rpx 16rpx 16rpx 16rpx;
  441. margin-bottom: 20rpx;
  442. .title{
  443. font-family: PingFang SC;
  444. font-weight: 500;
  445. font-size: 32rpx;
  446. color: #222426;
  447. text-align: left;
  448. }
  449. .box{
  450. display: flex;
  451. align-items: center;
  452. justify-content: space-between;
  453. padding-top: 22rpx;
  454. .time{
  455. font-family: PingFang SC;
  456. font-weight: 400;
  457. font-size: 24rpx;
  458. color: #898E91;
  459. text-align: left;
  460. }
  461. .state{
  462. font-family: PingFang SC;
  463. font-weight: 400;
  464. font-size: 24rpx;
  465. color: #2CAE5C;
  466. text-align: right;
  467. }
  468. }
  469. }
  470. }
  471. }
  472. </style>