AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

remind.vue 4.8 KiB

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