expressSet.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div class="app-content">
  3. <div v-show="showStaffArea">
  4. <form @submit="formSubmit" @reset="formReset">
  5. <div class="module-com input-line-wrap">
  6. <tui-list-cell class="line-cell" :hover="false">
  7. <div class="tui-title required">达达商户ID</div>
  8. <input
  9. v-model="form.sjId"
  10. placeholder-class="phcolor"
  11. class="tui-input"
  12. name="sjId"
  13. placeholder="请输入商户ID"
  14. maxlength="50"
  15. type="text"
  16. />
  17. </tui-list-cell>
  18. <tui-list-cell class="line-cell" :hover="false">
  19. <div class="tui-title required">达达门店编号</div>
  20. <input
  21. v-model="form.shopNo"
  22. placeholder-class="phcolor"
  23. class="tui-input"
  24. name="shopNo"
  25. placeholder="请输入编号"
  26. maxlength="50"
  27. type="text"
  28. />
  29. </tui-list-cell>
  30. <div style="padding:20upx 0 0 30upx;color:#CCCCCC;">设置完成后请联系管理员进行授权</div>
  31. </div>
  32. <!-- 提交 -->
  33. <div class="confirm-btn">
  34. <button class="admin-button-com big blue" formType="submit">
  35. 提交
  36. </button>
  37. </div>
  38. </form>
  39. </div>
  40. <!-- <kd-entrance></kd-entrance> -->
  41. </div>
  42. </template>
  43. <script>
  44. import TuiListCell from "@/components/plugin/list-cell";
  45. import AppAvatarModule from "@/components/module/app-avatar";
  46. const form = require("@/utils/formValidation.js");
  47. import { dadaInfo,updateDada } from "@/api/shop-express";
  48. export default {
  49. name: "expressSet",
  50. components: {
  51. TuiListCell,
  52. AppAvatarModule,
  53. },
  54. data() {
  55. return {
  56. form: {
  57. shopNo: "",
  58. sjId: "",
  59. },
  60. roleList: [],
  61. roleSelData: {},
  62. showStaffArea: true,
  63. miniCodeSrc: "",
  64. memberData: {},
  65. };
  66. },
  67. onLoad() {
  68. },
  69. onShow() {
  70. uni.setNavigationBarTitle({
  71. title: `快递设置`,
  72. });
  73. },
  74. methods: {
  75. async init() {
  76. try {
  77. const { data } = await dadaInfo();
  78. this.form.shopNo = data.shopNo;
  79. this.form.sjId = data.sjId;
  80. this.$forceUpdate();
  81. } finally {
  82. }
  83. },
  84. confirmFn() {
  85. updateDada(this.form).then((res) => {
  86. this.$msg("操作成功");
  87. setTimeout(() => {
  88. uni.navigateBack();
  89. }, 1300)
  90. });
  91. },
  92. formSubmit(e) {
  93. // 表单验证
  94. let rules = [
  95. {
  96. name: "sjId",
  97. rule: ["required"],
  98. msg: ["请输入商户ID"],
  99. },
  100. {
  101. name: "shopNo",
  102. rule: ["required"],
  103. msg: ["请输入门店编号"],
  104. },
  105. ];
  106. // 进行表单检查
  107. let formData = e.detail.value;
  108. let checkRes = form.validation(formData, rules);
  109. // 验证通过!
  110. if (!checkRes) {
  111. this.confirmFn();
  112. } else {
  113. this.$msg(checkRes);
  114. }
  115. },
  116. },
  117. };
  118. </script>
  119. <style lang="scss" scoped>
  120. .app-content {
  121. min-height: calc(100vh - 20upx);
  122. padding-top: 20upx;
  123. }
  124. .prompt-text {
  125. color: $fontColor3;
  126. padding-left: 30upx;
  127. margin-bottom: 30upx;
  128. }
  129. // ---
  130. .module-com {
  131. margin-bottom: 20upx;
  132. .member-wrap {
  133. .member-det {
  134. font-size: 24upx;
  135. margin-left: 20upx;
  136. }
  137. }
  138. .remark-wrap {
  139. align-items: flex-start;
  140. .remark {
  141. height: 240upx;
  142. }
  143. }
  144. }
  145. // 按钮
  146. .confirm-btn {
  147. width: calc(100% - 60upx);
  148. margin: 60upx 30upx 20upx;
  149. .admin-button-com {
  150. width: 100%;
  151. }
  152. }
  153. </style>