liveApply.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <div id="liveApply">
  3. <div class="w_0100">
  4. <div class="w_1200">
  5. <div class="liveApply">
  6. <el-col :span="24" class="liveApplyTop">
  7. <el-col :span="3">
  8. <el-image :src="logo" style="width:105px;height:105px;"></el-image>
  9. </el-col>
  10. <el-col :span="20">
  11. <p>温馨提示:</p>
  12. <p>1、为了保证您的信息能顺利通过我们的审核,请将信息的真实情况尽可能全面的发布出来!</p>
  13. <p>
  14. 2、根据我们的长期跟踪统计,信息完整度越高,越容易获得目标客户的关注!3、信息完整度越高,将在我们的平台搜索结果排序靠前、获得推荐机会,以及享受增值服务试用机会!
  15. </p>
  16. </el-col>
  17. </el-col>
  18. <el-col :span="24" class="liveApplyInfo">
  19. <el-form ref="form" :model="form" label-width="120px">
  20. <el-form-item label="申请人身份">
  21. <el-radio-group v-model="form.buyer" @change="changeuser">
  22. <el-radio label="0">买家</el-radio>
  23. <el-radio label="1">卖家</el-radio>
  24. </el-radio-group>
  25. </el-form-item>
  26. <span v-if="this.resource == '1' || this.resource == ''">
  27. <el-form-item label="选择产品">
  28. <el-select v-model="form.goodsList" multiple placeholder="请选择选择产品">
  29. <el-option v-for="(item, index) in goodsLists" :key="index" :label="item.name" :value="item.id"> </el-option>
  30. </el-select>
  31. </el-form-item>
  32. </span>
  33. <el-form-item label="联系人">
  34. <el-input v-model="form.contact"></el-input>
  35. </el-form-item>
  36. <el-form-item label="联系电话">
  37. <el-input v-model="form.contact_tel"></el-input>
  38. </el-form-item>
  39. <el-form-item label="电子邮箱">
  40. <el-input v-model="form.email"></el-input>
  41. </el-form-item>
  42. <el-form-item label="单位名称">
  43. <el-input v-model="form.company"></el-input>
  44. </el-form-item>
  45. <el-row style="text-align:center">
  46. <el-button type="primary" @click="onSubmit">立即申请</el-button>
  47. <el-button @click="restBtn">取消</el-button>
  48. </el-row>
  49. </el-form>
  50. </el-col>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. import { mapState, createNamespacedHelpers } from 'vuex';
  58. const { mapActions: mapProduct } = createNamespacedHelpers('marketproduct');
  59. const { mapActions: apply } = createNamespacedHelpers('apply');
  60. import upload from '@/components/upload.vue';
  61. export default {
  62. name: 'liveApply',
  63. props: {},
  64. components: {
  65. // upload,
  66. },
  67. data: () => ({
  68. form: {},
  69. logo: require('@/assets/live/d10_fbb1.png'),
  70. resource: '',
  71. goodsLists: [],
  72. }),
  73. created() {
  74. this.searchInfo();
  75. },
  76. methods: {
  77. ...mapProduct({ mapProductQuery: 'query', mapProductFetch: 'fetch' }),
  78. ...apply({ applyCreate: 'create' }),
  79. async onSubmit() {
  80. let duplicate = JSON.parse(JSON.stringify(this.form));
  81. let data = { ...duplicate };
  82. data.user_id = this.user.uid;
  83. if (data.user_id) {
  84. data.user_name = this.user.name;
  85. data.role = this.user.role;
  86. let dock_id = this.$route.query.id;
  87. data.goodsList = this.form.goodsList;
  88. // data.goodsList = [this.productInfo(this.form.goodsList)];
  89. const res = await this.applyCreate({ id: dock_id, ...data });
  90. if (res.errcode === 0) {
  91. this.$message({
  92. message: '申请参加对接会成功',
  93. type: 'success',
  94. });
  95. this.restBtn();
  96. }
  97. } else {
  98. // let res = 0;
  99. // this.$checkRes(res, '请登录', '请登录');
  100. this.$message({
  101. dangerouslyUseHTMLString: true,
  102. message: '<strong><a href="http://free.liaoningdoupo.com/platlive/newlogin" style="color:red;">游客身份无法与卖家对话,请先注册</a></strong>',
  103. type: 'error',
  104. });
  105. }
  106. },
  107. // 取消
  108. restBtn() {
  109. history.go(-1);
  110. },
  111. productInfo(id) {
  112. let index = this.goodsLists.find(item => item.id == id);
  113. return index;
  114. },
  115. async searchInfo() {
  116. let res = await this.mapProductQuery({ userid: this.user.uid });
  117. if (res.errcode === 0) {
  118. this.$set(this, `goodsLists`, res.data);
  119. }
  120. },
  121. changeuser(label) {
  122. this.$set(this, 'resource', label);
  123. },
  124. uploadSuccess({ type, data }) {
  125. this.$set(this.form, `${type}`, data.uri);
  126. },
  127. },
  128. computed: {
  129. ...mapState(['user']),
  130. pageTitle() {
  131. return `${this.$route.meta.title}`;
  132. },
  133. },
  134. metaInfo() {
  135. return { title: this.$route.meta.title };
  136. },
  137. };
  138. </script>
  139. <style lang="less" scoped>
  140. @import '~@/style/style.css';
  141. .liveApply {
  142. float: left;
  143. margin: 30px 0;
  144. }
  145. .liveApply .liveApplyTop {
  146. float: left;
  147. background: #f3faff;
  148. padding: 15px;
  149. border: 1px solid #ccc;
  150. margin: 0 0 15px 0;
  151. }
  152. .liveApplyTop p:first-child {
  153. font-size: 14px;
  154. font-weight: bold;
  155. }
  156. .liveApplyTop p:nth-child(2n) {
  157. font-size: 12px;
  158. padding: 15px 0;
  159. }
  160. .liveApplyTop p:last-child {
  161. font-size: 12px;
  162. }
  163. .liveApplyInfo {
  164. padding: 0 100px;
  165. }
  166. /deep/.el-input__inner {
  167. width: 1300px;
  168. }
  169. </style>