selfMeetingInfo.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <van-nav-bar
  3. fixed
  4. title="私设聚会点"
  5. left-text=""
  6. left-arrow
  7. @click-left="onClickLeft"
  8. />
  9. <van-loading size="16px" v-show="isLoading">加载中...</van-loading>
  10. <div class="main" v-show="!isLoading">
  11. <div class="banner">
  12. <img src="../../../../public/loginbg/banner.jpg" alt="" />
  13. </div>
  14. <div class="info">
  15. <p class="miniTitle">详细信息</p>
  16. <van-cell-group>
  17. <van-field
  18. v-model="inputForm.placeSelectName"
  19. center
  20. readonly
  21. label="地点:"
  22. input-align="right"
  23. />
  24. </van-cell-group>
  25. <van-cell-group>
  26. <van-field
  27. v-model="inputForm.placeDel"
  28. center
  29. label="详细地址:"
  30. readonly
  31. input-align="right"
  32. right-icon="location"
  33. />
  34. </van-cell-group>
  35. <van-cell-group>
  36. <van-field
  37. v-model="inputForm.frequency"
  38. center
  39. label="频次:"
  40. input-align="right"
  41. readonly
  42. />
  43. </van-cell-group>
  44. <van-cell-group>
  45. <van-field
  46. v-model="inputForm.partyTime"
  47. center
  48. readonly
  49. label="时间:"
  50. input-align="right"
  51. />
  52. </van-cell-group>
  53. <van-cell-group>
  54. <van-field
  55. v-model="inputForm.relatedPersons.name"
  56. center
  57. readonly
  58. label="相关人:"
  59. input-align="right"
  60. />
  61. </van-cell-group>
  62. <van-cell-group>
  63. <van-field label="内容:" input-align="right">
  64. <template #input>
  65. <span v-show="inputForm.content == ''">无</span>
  66. <span
  67. v-show="inputForm.content != ''"
  68. style="color: #36a7f3"
  69. @click="open"
  70. >查看内容</span
  71. >
  72. </template>
  73. </van-field>
  74. </van-cell-group>
  75. </div>
  76. <van-button
  77. v-if="inputForm.assessment == 0"
  78. type="primary"
  79. class="btn-sub"
  80. @click="update"
  81. >审核</van-button
  82. >
  83. </div>
  84. <!-- 富文本编辑器 -->
  85. <van-popup v-model:show="showReport"
  86. >
  87. <!-- <wang-editor ref="contentEditor" v-model="inputForm.content" /> -->
  88. <div v-html="inputForm.content" class="showhtml"></div>
  89. </van-popup>
  90. </template>
  91. <script>
  92. import { ref, nextTick } from "vue";
  93. import { useRoute } from "vue-router";
  94. import PrivatePartyPointService from "@/api/privateparty/PrivatePartyPointService";
  95. import UserManage from "@/api/user/UserManage";
  96. // 富文本编辑器
  97. import WangEditor from "@/components/editor/WangEditor";
  98. export default {
  99. components: { WangEditor },
  100. setup() {
  101. const onClickLeft = () => {
  102. history.back();
  103. };
  104. // 加载
  105. let isLoading = ref(true);
  106. // 私设聚会点信息
  107. let inputForm = ref({
  108. id: "",
  109. place: "320900",
  110. placeSelectName: "盐城市",
  111. placeSelectType3: "320900",
  112. placeSelectType4: "",
  113. placeSelectType5: "",
  114. placeSelectType6: "",
  115. placeDel: "",
  116. frequency: "",
  117. partyTime: "",
  118. relatedPersons: {
  119. id: "",
  120. name: "",
  121. },
  122. content: "",
  123. state: "0",
  124. assessment: "0",
  125. });
  126. // 获取信息
  127. let route = useRoute();
  128. // 富文本
  129. let contentEditor = ref(null);
  130. const showReport = ref(false);
  131. new PrivatePartyPointService().queryById(route.query.id).then((data) => {
  132. inputForm.value = data;
  133. let ids = data.relatedPersons.id.split(",");
  134. inputForm.value.relatedPersons.name = "";
  135. ids.forEach((item) => {
  136. new UserManage().queryById(item).then((data) => {
  137. inputForm.value.relatedPersons.name += data.name + ",";
  138. });
  139. });
  140. isLoading.value = false;
  141. });
  142. // 打开富文本
  143. const open = () => {
  144. showReport.value = true;
  145. nextTick(() => {
  146. if (contentEditor.value != null) {
  147. contentEditor.value.init(inputForm.value.content);
  148. }
  149. });
  150. };
  151. // 审核通过
  152. const update = () => {
  153. xm.showConfirm({
  154. title: "审核",
  155. message: "确定审核所选项吗?",
  156. }).then((result) => {
  157. if (result == "ok") {
  158. inputForm.value.assessment = 1;
  159. new PrivatePartyPointService().save(inputForm.value).then((res) => {
  160. if (res.status == 200 || res.statusText == "OK") {
  161. xm.showToast({
  162. message: "已审核",
  163. });
  164. }
  165. onClickLeft();
  166. });
  167. }
  168. });
  169. };
  170. return {
  171. onClickLeft,
  172. inputForm,
  173. isLoading,
  174. update,
  175. contentEditor,
  176. showReport,
  177. open,
  178. };
  179. },
  180. };
  181. </script>
  182. <style lang="less">
  183. .btn-sub {
  184. width: 90%;
  185. border-radius: 20px;
  186. margin-left: 5%;
  187. margin-bottom: 40px;
  188. }
  189. .van-popup--center {
  190. width: 98% !important;
  191. border-radius: 10px;
  192. height: 70vh;
  193. overflow: auto;
  194. }
  195. .showhtml {
  196. width: 94%;
  197. padding: 10px;
  198. }
  199. </style>