Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

remind.vue 4.8 KiB

il y a 2 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="box">
  3. <view class="conmsg">
  4. <view class="conmsg-lab">
  5. <view class="conmsg-lab-1">
  6. 客户信息
  7. </view>
  8. <view class="conmsg-lab-2">
  9. <!-- 李先生/12385945986 -->
  10. {{str}}
  11. </view>
  12. </view>
  13. <view class="conmsg-lab" style="border: none;">
  14. <view class="conmsg-lab-1">
  15. 提醒时间
  16. </view>
  17. <view class="conmsg-lab-3">
  18. <!-- 请选择提醒时间(必填) -->
  19. <KXDateTime :date='date' :end='enddate' :start='startdate' @rundata='kxdatetime' default='start' placeholder='请选择时间'></KXDateTime>
  20. </view>
  21. <view class="conmsg-lab-4">
  22. <image class="screen-sel-img" src="../../../static/images/right.png" mode=""></image>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="conent">
  27. <u-input v-model="value" type="textarea" height="148" :auto-height="true" />
  28. </view>
  29. <view class="btn" @click="add">
  30. 添加提醒
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. var util = require("../../../utils/util.js");
  36. import KXDateTime from "@/components/kx-datetime/kx-datetime.vue"
  37. export default{
  38. data(){
  39. return{
  40. str:'',
  41. date: '',
  42. // startdate:new Date().toLocaleDateString()+'00:00',
  43. startdate:'2021-01-01 00:00',
  44. enddate: '2025-12-30 23:59',
  45. code:'',
  46. customerId:'',
  47. value:'',
  48. }
  49. },
  50. components:{
  51. KXDateTime
  52. },
  53. methods:{
  54. kxdatetime(e) {
  55. console.log(e)
  56. this.date = e
  57. },
  58. add(){
  59. // console.log(new Date().toLocaleDateString())
  60. // return
  61. if(!this.date){
  62. uni.showToast({
  63. title:'请选择时间',
  64. icon:'none'
  65. })
  66. return
  67. }
  68. if(!this.value){
  69. uni.showToast({
  70. title:'请填写备注',
  71. icon:'none'
  72. })
  73. return
  74. }
  75. const that = this; // 检测是否已经授权,有授权直接弹窗,没授权弹出授权
  76. uni.getSetting({
  77. withSubscriptions: true,
  78. success(res) {
  79. console.log(res);
  80. if (res && res.subscriptionsSetting && res.subscriptionsSetting.itemSettings && res
  81. .subscriptionsSetting
  82. .itemSettings['cBnJvhkMPHp0ReUiSdpM_Pd2usGeEEW6wx-5s6X4hEI'] == 'accept') {
  83. that.addFlag()
  84. } else {
  85. uni.requestSubscribeMessage({
  86. tmplIds: ['cBnJvhkMPHp0ReUiSdpM_Pd2usGeEEW6wx-5s6X4hEI'],
  87. success(res) {
  88. that.addFlag()
  89. },
  90. fail(res) {
  91. console.log(res);
  92. util.showNone("请授权");
  93. }
  94. });
  95. }
  96. },
  97. fail(res) {
  98. console.log(res);
  99. }
  100. });
  101. },
  102. addFlag(){
  103. var that = this;
  104. var params = {
  105. customerId: that.customerId,
  106. orderRemindTime: that.date + ':00',
  107. code: that.code,
  108. remarks:this.value,
  109. OrderRemindDesc:this.value
  110. };
  111. this.$u.post("/customer/settingTime", params).then(data => {
  112. uni.showToast({
  113. title: '操作成功'
  114. });
  115. uni.navigateBack()
  116. // var data = that.orderRemindDate + ':00';
  117. // var setData = new Date(data).getTime();
  118. // var newData = new Date().getTime();
  119. // console.log(setData, newData);
  120. // if (setData < newData) {
  121. // this.setData({
  122. // overdue: true
  123. // });
  124. // } else {
  125. // this.setData({
  126. // overdue: false
  127. // });
  128. // }
  129. // this.setData({
  130. // show: false,
  131. // value: [this.year, Number(this.month) - 1, Number(this.day) - 1, this.hour, this
  132. // .minute
  133. // ],
  134. // orderRemindDate1: that.orderRemindDate + ':00'
  135. // });
  136. });
  137. },
  138. },
  139. onLoad(e) {
  140. // console.log(e)
  141. this.str=e.str
  142. this.customerId=e.customerId||''
  143. const that = this;
  144. let num=new Date().toLocaleDateString().split('/').join('-')+' '+new Date().getHours()+':'+ new Date().getMinutes()
  145. this.startdate=num
  146. console.log(num)
  147. uni.login({
  148. success(res) {
  149. if (res.code) {
  150. that.code=res.code
  151. } else {
  152. console.log('登录失败!' + res.errMsg);
  153. }
  154. }
  155. });
  156. }
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. .box {
  161. width: 100%;
  162. height: 100%;
  163. background: #F8F8F8;
  164. }
  165. .conmsg{
  166. border-top: 1px solid #E0E0E0;
  167. padding: 0 30rpx;
  168. background: #fff;
  169. height: 208rpx;
  170. .conmsg-lab{
  171. display: flex;
  172. border-bottom: 1px solid #E0E0E0;
  173. height: 102rpx;
  174. font-size: 30rpx;
  175. font-weight: 400;
  176. line-height: 102rpx;
  177. color: #333333;
  178. .conmsg-lab-1{
  179. margin-right: 60rpx;
  180. }
  181. .conmsg-lab-3{
  182. color: #B2B2B2;
  183. }
  184. .conmsg-lab-4{
  185. width: 14rpx;
  186. height: 30rpx;
  187. margin-top: 6rpx;
  188. margin-left: auto;
  189. image{
  190. width: 100%;
  191. height: 100%;
  192. }
  193. }
  194. }
  195. }
  196. .conent{
  197. margin-top: 20rpx;
  198. min-height: 208rpx;
  199. background: #FFFFFF;
  200. box-sizing: border-box;
  201. padding: 30rpx;
  202. margin-bottom: 20rpx;
  203. }
  204. .btn{
  205. position: fixed;
  206. width: 690rpx;
  207. height: 88rpx;
  208. background: #2671E2;
  209. border-radius: 8px;
  210. line-height: 88rpx;
  211. text-align: center;
  212. color: #FFFFFF;
  213. bottom: 108rpx;
  214. left: 30rpx;
  215. }
  216. </style>