liveApply.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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" 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. let dock_id = this.$route.query.id;
  86. data.goodsList = [this.productInfo(this.form.goodsList)];
  87. const res = await this.applyCreate({ id: dock_id, ...data });
  88. if (res.errcode === 0) {
  89. this.$message({
  90. message: '申请参加对接会成功',
  91. type: 'success',
  92. });
  93. this.restBtn();
  94. }
  95. } else {
  96. // let res = 0;
  97. // this.$checkRes(res, '请登录', '请登录');
  98. this.$message({
  99. dangerouslyUseHTMLString: true,
  100. message: '<strong><a href="http://free.liaoningdoupo.com/platlive/newlogin" style="color:red;">游客身份无法与卖家对话,请先注册</a></strong>',
  101. type: 'error',
  102. });
  103. }
  104. },
  105. // 取消
  106. restBtn() {
  107. $router.go(-1);
  108. },
  109. productInfo(id) {
  110. let index = this.goodsLists.find(item => item.id == id);
  111. return index;
  112. },
  113. async searchInfo() {
  114. let res = await this.mapProductQuery({ userid: this.user.uid });
  115. if (res.errcode === 0) {
  116. this.$set(this, `goodsLists`, res.data);
  117. }
  118. },
  119. changeuser(label) {
  120. this.$set(this, 'resource', label);
  121. },
  122. uploadSuccess({ type, data }) {
  123. this.$set(this.form, `${type}`, data.uri);
  124. },
  125. },
  126. computed: {
  127. ...mapState(['user']),
  128. pageTitle() {
  129. return `${this.$route.meta.title}`;
  130. },
  131. },
  132. metaInfo() {
  133. return { title: this.$route.meta.title };
  134. },
  135. };
  136. </script>
  137. <style lang="less" scoped>
  138. @import '~@/style/style.css';
  139. .liveApply {
  140. float: left;
  141. margin: 30px 0;
  142. }
  143. .liveApply .liveApplyTop {
  144. float: left;
  145. background: #f3faff;
  146. padding: 15px;
  147. border: 1px solid #ccc;
  148. margin: 0 0 15px 0;
  149. }
  150. .liveApplyTop p:first-child {
  151. font-size: 14px;
  152. font-weight: bold;
  153. }
  154. .liveApplyTop p:nth-child(2n) {
  155. font-size: 12px;
  156. padding: 15px 0;
  157. }
  158. .liveApplyTop p:last-child {
  159. font-size: 12px;
  160. }
  161. .liveApplyInfo {
  162. padding: 0 100px;
  163. }
  164. </style>