searchForm.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <view class="container">
  3. <form @submit="onSubmit">
  4. <block v-if="orderdetail.base_order_status.status">
  5. <view class="form-item">
  6. <view class="input-block flex box-pack-between">
  7. <label class="label">状态</label>
  8. <view class="content">
  9. {{getStatusName(orderdetail.base_order_status.status)}}
  10. </view>
  11. </view>
  12. </view>
  13. <view class="form-item" v-if="orderdetail.base_order_status.status == 'REJECT'">
  14. <view class="input-block flex box-pack-between">
  15. <label class="label">驳回原因</label>
  16. <view class="content">
  17. <rich-text :nodes="orderdetail.base_order_status.reject_reason"></rich-text>
  18. </view>
  19. </view>
  20. </view>
  21. </block>
  22. <view class="form-item">
  23. <view class="input-block flex box-pack-between">
  24. <label class="label">服务描述</label>
  25. <view class="content flex-grow-1 ">
  26. <textarea v-model="info.descprise" name="descprise" placeholder="请输入"
  27. placeholder-style="font-size:28rpx;line-height:1.5" disable-default-padding
  28. style="padding-top:7rpx ;" class="input-box" />
  29. </view>
  30. </view>
  31. <view class="tips">字数限制1~256个字</view>
  32. </view>
  33. <view class="form-item">
  34. <view class="input-block flex box-pack-between">
  35. <label class="label">关键词 </label>
  36. <view class="content flex-grow-1 ">
  37. <textarea v-model="info.key_words" name="key_words" placeholder="请输入" disable-default-padding
  38. style="padding-top:7rpx ;" class="input-box" />
  39. </view>
  40. </view>
  41. <view class="tips">提报关键词列表,例如:111,222,333</view>
  42. </view>
  43. <button class="sub-btn" form-type="submit"
  44. v-if="!orderdetail.base_order_status.status || ['AGREE','REJECT','CANCEL'].includes(orderdetail.base_order_status.status)">
  45. 立即提交</button>
  46. </form>
  47. <view class="is-iphone-x"></view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. admin_id: '',
  55. info: {},
  56. orderdetail: {
  57. base_order_status: {
  58. status: ""
  59. }
  60. },
  61. baseUrl: getApp().globalData.URL
  62. }
  63. },
  64. onLoad() {
  65. this.admin_id = uni.getStorageSync('admin_id')
  66. this.getInfo()
  67. },
  68. methods: {
  69. getInfo() {
  70. this.request({
  71. url: 'alipaycoupon/search_index',
  72. data: {
  73. admin_id: this.admin_id
  74. }
  75. }).then(res => {
  76. if (res.code == 200) {
  77. console.log(res)
  78. this.info = res.data.info
  79. this.orderdetail = res.data.orderdetail
  80. }
  81. })
  82. },
  83. getStatusName(status) {
  84. let name = ""
  85. switch (status) {
  86. case "AUDIT":
  87. name = "审核中"
  88. break;
  89. case "AGREE":
  90. name = "审核成功"
  91. break;
  92. case "REJECT":
  93. name = "审核驳回"
  94. break;
  95. case "CANCEL":
  96. name = "撤销"
  97. break;
  98. case "EDIT":
  99. name = "编辑中"
  100. break;
  101. }
  102. console.log(status, name)
  103. return name
  104. },
  105. onLeimuChange(e) {
  106. this.info.category_id = this.leimuList[e.detail.value].code
  107. this.getCategoryName(this.leimuList[e.detail.value].code)
  108. },
  109. onChangeTime(e, name) {
  110. this.info[name] = e.detail.value
  111. },
  112. onSubmit(e) {
  113. let {key_words,descprise} = e.detail.value;
  114. let params = {
  115. admin_id: this.admin_id,
  116. descprise,
  117. key_words,
  118. id: this.info ? this.info.id : '',
  119. }
  120. this.request({
  121. url: 'alipaycoupon/search_edit',
  122. data: params
  123. }).then(res => {
  124. if (res.code == 200) {
  125. uni.showModal({
  126. content: "提交成功",
  127. showCancel: false,
  128. success: (r) => {
  129. this.getInfo()
  130. }
  131. })
  132. } else {
  133. uni.showToast({
  134. title: res.message,
  135. icon: 'none'
  136. })
  137. }
  138. }).catch(res => {
  139. uni.showToast({
  140. title: res.message,
  141. icon: 'none'
  142. })
  143. })
  144. }
  145. }
  146. }
  147. </script>
  148. <style>
  149. page {
  150. background-color: #f4f5f6;
  151. }
  152. </style>
  153. <style lang="scss" scoped>
  154. @import url("@/static/css/flex.css");
  155. .container {
  156. background-color: #f4f5f6
  157. }
  158. .desc-info {
  159. padding: 20rpx;
  160. font-size: 26rpx;
  161. line-height: 1.5;
  162. }
  163. .desc-info-img {
  164. display: block;
  165. width: 100%;
  166. }
  167. .text-align-right {
  168. text-align: right;
  169. }
  170. .form-item {
  171. padding: 20rpx 20rpx;
  172. font-size: 28rpx;
  173. line-height: 1.5;
  174. margin-bottom: 20rpx;
  175. background: #fff;
  176. word-break: break-all;
  177. .input-block {}
  178. .label {
  179. flex: none;
  180. display: block;
  181. font-size: 28rpx;
  182. line-height: 1.5;
  183. padding-right: 30rpx;
  184. }
  185. .content {}
  186. .input-box {
  187. width: 100%;
  188. font-size: 28rpx;
  189. line-height: 1.5;
  190. }
  191. .tips {
  192. font-size: 24rpx;
  193. color: #f00;
  194. line-height: 1.5;
  195. border-top: 1rpx solid #f2f2f2;
  196. margin-top: 20rpx;
  197. padding-top: 15rpx;
  198. }
  199. .image-bg {
  200. background-color: #f4f5f6;
  201. }
  202. .image-block {
  203. overflow: hidden;
  204. border-radius: 12rpx;
  205. position: relative;
  206. .form-img {
  207. display: block;
  208. width: 100%;
  209. height: 100%;
  210. }
  211. .form-img-add-btn {
  212. display: block;
  213. width: 100rpx;
  214. height: 100rpx;
  215. position: absolute;
  216. left: 50%;
  217. top: 50%;
  218. transform: translate(-50%, -50%);
  219. }
  220. }
  221. }
  222. .sub-btn {
  223. width: 700rpx;
  224. height: 100rpx;
  225. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  226. border-radius: 8rpx;
  227. box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(51, 135, 255, 0.20);
  228. text-align: center;
  229. line-height: 100rpx;
  230. font-size: 36rpx;
  231. font-weight: 500;
  232. color: #fff;
  233. margin: 0 auto;
  234. }
  235. </style>